From ac8435dc2aca5bd9e88509c2ee49770054d56e30 Mon Sep 17 00:00:00 2001 From: inklesspen1scripter Date: Sun, 21 Jun 2020 22:06:43 +0300 Subject: [PATCH] Some changes 9mm and MedPistol is perked for all now and used by Rack'em Up Standart pistol has unlimited ammo without reloading --- ServerExt/Classes/ExtHumanPawn.uc | 1 + ServerExt/Classes/ExtPerkManager.uc | 1 + ServerExt/Classes/ExtPlayerController.uc | 2 +- ServerExt/Classes/ExtWeap_Pistol_9mm.uc | 26 +++++++++++++++++++++ ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc | 24 +++++++++++++++++++ ServerExt/Classes/ExtWeap_Pistol_MedicS.uc | 22 ++++++++++++++++- ServerExt/Classes/Ext_PerkBase.uc | 3 +++ ServerExt/Classes/Ext_PerkRhythmPerkBase.uc | 11 +++++++-- 8 files changed, 86 insertions(+), 4 deletions(-) diff --git a/ServerExt/Classes/ExtHumanPawn.uc b/ServerExt/Classes/ExtHumanPawn.uc index a8ee08b..1b58271 100644 --- a/ServerExt/Classes/ExtHumanPawn.uc +++ b/ServerExt/Classes/ExtHumanPawn.uc @@ -1307,6 +1307,7 @@ defaultproperties DefaultInventory.Empty() DefaultInventory.Add(class'ExtWeap_Pistol_9mm') + // DefaultInventory.Add(class'KFWeap_Pistol_9mm') DefaultInventory.Add(class'KFWeap_Healer_Syringe') DefaultInventory.Add(class'KFWeap_Welder') DefaultInventory.Add(class'KFInventory_Money') diff --git a/ServerExt/Classes/ExtPerkManager.uc b/ServerExt/Classes/ExtPerkManager.uc index f02fb54..d65bc39 100644 --- a/ServerExt/Classes/ExtPerkManager.uc +++ b/ServerExt/Classes/ExtPerkManager.uc @@ -228,6 +228,7 @@ function Destroyed() function EarnedEXP( int EXP, optional byte Mode ) { + `log("EarnedEXP" @ GetScriptTrace()); if( CurrentPerk!=None ) { // Limit how much EXP we got for healing and welding. diff --git a/ServerExt/Classes/ExtPlayerController.uc b/ServerExt/Classes/ExtPlayerController.uc index 7d74739..e062304 100644 --- a/ServerExt/Classes/ExtPlayerController.uc +++ b/ServerExt/Classes/ExtPlayerController.uc @@ -172,7 +172,7 @@ function OnPlayerXPAdded(INT XP, class PerkClass) AwardXP(XP); } -function AddSmallRadiusKill( byte Difficulty ) +function AddSmallRadiusKill( byte Difficulty, class PerkClass ) { AwardXP(class'KFPerk_Berserker'.static.GetSmallRadiusKillXP(Difficulty)); } diff --git a/ServerExt/Classes/ExtWeap_Pistol_9mm.uc b/ServerExt/Classes/ExtWeap_Pistol_9mm.uc index 9258a19..2662659 100644 --- a/ServerExt/Classes/ExtWeap_Pistol_9mm.uc +++ b/ServerExt/Classes/ExtWeap_Pistol_9mm.uc @@ -8,5 +8,31 @@ defaultproperties bInfiniteSpareAmmo=True DualClass=class'ExtWeap_Pistol_Dual9mm' + + InstantHitDamageTypes(DEFAULT_FIREMODE)=class'ExtDT_Ballistic_9mm' } +simulated static function bool AllowedForAllPerks() +{ + return true; +} + +simulated function ConsumeAmmo( byte FireModeNum ) +{ + +} + +simulated static event class GetWeaponPerkClass( class InstigatorPerkClass ) +{ + if(InstigatorPerkClass != None) + return InstigatorPerkClass; + + return default.AssociatedPerkClasses[0]; +} + +simulated function KFPerk GetPerk() +{ + if(KFPlayer != None) + return KFPlayer.GetPerk(); + return super.GetPerk(); +} \ No newline at end of file diff --git a/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc b/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc index 19ed02a..44efa3a 100644 --- a/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc +++ b/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc @@ -2,6 +2,30 @@ class ExtWeap_Pistol_Dual9mm extends KFWeap_Pistol_Dual9mm; defaultproperties { + SpareAmmoCapacity[0]=-1 + InitialSpareMags[0]=0 + + bInfiniteSpareAmmo=True + SingleClass=class'ExtWeap_Pistol_9mm' + + InstantHitDamageTypes(DEFAULT_FIREMODE)=class'ExtDT_Ballistic_9mm' // KFDT_Ballistic_9mm } +simulated static function bool AllowedForAllPerks() +{ + return true; +} + +simulated function ConsumeAmmo( byte FireModeNum ) +{ + +} + +simulated static event class GetWeaponPerkClass( class InstigatorPerkClass ) +{ + if(InstigatorPerkClass != None) + return InstigatorPerkClass; + + return default.AssociatedPerkClasses[0]; +} \ No newline at end of file diff --git a/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc b/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc index b0e5877..a7eb187 100644 --- a/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc +++ b/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc @@ -2,11 +2,31 @@ class ExtWeap_Pistol_MedicS extends KFWeap_Pistol_Medic; defaultproperties { - AssociatedPerkClasses(0)=none bCanThrow=false SpareAmmoCapacity[0]=-1 InitialSpareMags[0]=0 bInfiniteSpareAmmo=True + + InstantHitDamageTypes(DEFAULT_FIREMODE)=class'ExtDT_Ballistic_Pistol_Medic' +} + +simulated static function bool AllowedForAllPerks() +{ + return true; +} + +simulated function ConsumeAmmo( byte FireModeNum ) +{ + if(FireModeNum == ALTFIRE_FIREMODE) + super.ConsumeAmmo(FireModeNum); +} + +simulated static event class GetWeaponPerkClass( class InstigatorPerkClass ) +{ + if(InstigatorPerkClass != None) + return InstigatorPerkClass; + + return default.AssociatedPerkClasses[0]; } \ No newline at end of file diff --git a/ServerExt/Classes/Ext_PerkBase.uc b/ServerExt/Classes/Ext_PerkBase.uc index e163f3d..ebdfdfd 100644 --- a/ServerExt/Classes/Ext_PerkBase.uc +++ b/ServerExt/Classes/Ext_PerkBase.uc @@ -99,6 +99,9 @@ simulated final function bool IsWeaponOnPerk( KFWeapon W ) { if( class(BasePerk) != None ) return true; + + //if( W.AllowedForAllPerks() ) + // return true; return W!=None && W.GetWeaponPerkClass(BasePerk)==BasePerk; } diff --git a/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc b/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc index 8c39ba9..6d6c900 100644 --- a/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc +++ b/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc @@ -42,9 +42,11 @@ final function UpdateDmgScale( bool bUp ) } function UpdatePerkHeadShots( ImpactInfo Impact, class DamageType, int NumHit ) { - local int HitZoneIdx; + local int HitZoneIdx; local KFPawn_Monster KFPM; + // `log("RACKEMUP" @ GetScriptTrace()); + if( MaxRhythmCombo<=0 ) return; KFPM = KFPawn_Monster(Impact.HitActor); @@ -58,7 +60,12 @@ function UpdatePerkHeadShots( ImpactInfo Impact, class DamageType, i HitZoneIdx = KFPM.HitZones.Find('ZoneName', Impact.HitInfo.BoneName); if( HitZoneIdx == HZI_Head && KFPM.IsAliveAndWell() ) { - if( class(DamageType)!=None && class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0 ) + if( class(DamageType)!=None + && (class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0 + || DamageType == class'ExtDT_Ballistic_9mm' + || DamageType == class'ExtDT_Ballistic_Pistol_Medic' + || DamageType == class'KFDT_Ballistic_9mm' + || DamageType == class'KFDT_Ballistic_Pistol_Medic')) UpdateDmgScale(true); else if( HeadShotComboCount>0 ) UpdateDmgScale(false);