diff --git a/sources/NiceReplicationInfo.uc b/sources/NiceReplicationInfo.uc index a685f4e..01295a2 100644 --- a/sources/NiceReplicationInfo.uc +++ b/sources/NiceReplicationInfo.uc @@ -203,34 +203,45 @@ simulated function RemovePoisonAndBleed(NiceHumanPawn healed) } // Tells server to heal given human pawn. -simulated function ServerHealTarget(NiceHumanPawn healed, float charPotency, - Pawn instigator){ +simulated function ServerHealTarget( + NiceHumanPawn healed, + float charPotency, + Pawn instigator +) { local NiceHumanPawn healer; + local PlayerController healedPC; local KFPlayerReplicationInfo KFPRI; + local NiceMedicGun healingTool; local float healTotal; local float healPotency; + if(instigator == none || healed == none) return; if(healed.health <= 0 || healed.health >= healed.healthMax) return; KFPRI = KFPlayerReplicationInfo(instigator.PlayerReplicationInfo); - if(KFPRI == none || KFPRI.ClientVeteranSkill == none) - return; + if(KFPRI == none || KFPRI.ClientVeteranSkill == none) return; healer = NiceHumanPawn(instigator); - if(healer == none) - return; + if(healer == none) return; + + healingTool = NiceMedicGun(healer.weapon); healPotency = KFPRI.ClientVeteranSkill.static.GetHealPotency(KFPRI); healTotal = charPotency * healPotency; - healer.AlphaAmount = 255; - if(NiceMedicGun(healer.weapon) != none) - NiceMedicGun(healer.weapon).ClientSuccessfulHeal(healer, healed); - if(healed.health >= healed.healthMax){ + if(healingTool != none) { + healingTool.ClientSuccessfulHeal(healer, healed); + } + healedPC = PlayerController(healed.controller); + if(healedPC != none) { + healedPC.ClientMessage( + "You've been healed by" @ healer.GetPlayerName(), + 'CriticalEvent'); + } + if(healed.health >= healed.healthMax) { healed.GiveHealth(healTotal, healed.healthMax); return; } HandleNiceHealingMechanicsAndSkills(healer, healed, healPotency); - if(healed.health < healed.healthMax){ - healed.TakeHealing( healed, healTotal, healPotency, - KFWeapon(instigator.weapon)); + if(healed.health < healed.healthMax) { + healed.TakeHealing(healed, healTotal, healPotency, healingTool); } RemovePoisonAndBleed(healed); } diff --git a/sources/Weapons/BaseWeaponClasses/Medic/NiceMedicGun.uc b/sources/Weapons/BaseWeaponClasses/Medic/NiceMedicGun.uc index 4f37338..f18064d 100644 --- a/sources/Weapons/BaseWeaponClasses/Medic/NiceMedicGun.uc +++ b/sources/Weapons/BaseWeaponClasses/Medic/NiceMedicGun.uc @@ -66,15 +66,19 @@ simulated function WeaponTick(float dt){ } super.WeaponTick(dt); } -simulated function ClientSuccessfulHeal(NiceHumanPawn healer, NiceHumanPawn healed){ - if(healed == none) - return; - if(instigator != none && PlayerController(instigator.controller) != none) - PlayerController(instigator.controller). - ClientMessage("You've healed"@healed.GetPlayerName(), 'CriticalEvent'); - if(NiceHumanPawn(instigator) != none && PlayerController(healed.controller) != none) - PlayerController(healed.controller). - ClientMessage("You've been healed by"@healer.GetPlayerName(), 'CriticalEvent'); + +simulated function ClientSuccessfulHeal( + NiceHumanPawn healer, + NiceHumanPawn healed +){ + if(healed == none) { + return; + } + if(instigator != none && PlayerController(instigator.controller) != none) { + PlayerController(instigator.controller).ClientMessage( + "You've healed" @ healed.GetPlayerName(), + 'CriticalEvent'); + } } defaultproperties