update11 #31

Merged
dkanus merged 4 commits from update11 into master 2024-03-24 20:25:18 +03:00
2 changed files with 37 additions and 22 deletions
Showing only changes of commit 2bf5f3dbe1 - Show all commits

View File

@ -203,34 +203,45 @@ simulated function RemovePoisonAndBleed(NiceHumanPawn healed)
} }
// Tells server to heal given human pawn. // Tells server to heal given human pawn.
simulated function ServerHealTarget(NiceHumanPawn healed, float charPotency, simulated function ServerHealTarget(
Pawn instigator){ NiceHumanPawn healed,
float charPotency,
Pawn instigator
) {
local NiceHumanPawn healer; local NiceHumanPawn healer;
local PlayerController healedPC;
local KFPlayerReplicationInfo KFPRI; local KFPlayerReplicationInfo KFPRI;
local NiceMedicGun healingTool;
local float healTotal; local float healTotal;
local float healPotency; local float healPotency;
if(instigator == none || healed == none) return; if(instigator == none || healed == none) return;
if(healed.health <= 0 || healed.health >= healed.healthMax) return; if(healed.health <= 0 || healed.health >= healed.healthMax) return;
KFPRI = KFPlayerReplicationInfo(instigator.PlayerReplicationInfo); KFPRI = KFPlayerReplicationInfo(instigator.PlayerReplicationInfo);
if(KFPRI == none || KFPRI.ClientVeteranSkill == none) if(KFPRI == none || KFPRI.ClientVeteranSkill == none) return;
return;
healer = NiceHumanPawn(instigator); healer = NiceHumanPawn(instigator);
if(healer == none) if(healer == none) return;
return;
healingTool = NiceMedicGun(healer.weapon);
healPotency = KFPRI.ClientVeteranSkill.static.GetHealPotency(KFPRI); healPotency = KFPRI.ClientVeteranSkill.static.GetHealPotency(KFPRI);
healTotal = charPotency * healPotency; healTotal = charPotency * healPotency;
healer.AlphaAmount = 255; healer.AlphaAmount = 255;
if(NiceMedicGun(healer.weapon) != none) if(healingTool != none) {
NiceMedicGun(healer.weapon).ClientSuccessfulHeal(healer, healed); healingTool.ClientSuccessfulHeal(healer, healed);
if(healed.health >= healed.healthMax){ }
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); healed.GiveHealth(healTotal, healed.healthMax);
return; return;
} }
HandleNiceHealingMechanicsAndSkills(healer, healed, healPotency); HandleNiceHealingMechanicsAndSkills(healer, healed, healPotency);
if(healed.health < healed.healthMax){ if(healed.health < healed.healthMax) {
healed.TakeHealing( healed, healTotal, healPotency, healed.TakeHealing(healed, healTotal, healPotency, healingTool);
KFWeapon(instigator.weapon));
} }
RemovePoisonAndBleed(healed); RemovePoisonAndBleed(healed);
} }

View File

@ -66,15 +66,19 @@ simulated function WeaponTick(float dt){
} }
super.WeaponTick(dt); super.WeaponTick(dt);
} }
simulated function ClientSuccessfulHeal(NiceHumanPawn healer, NiceHumanPawn healed){
if(healed == none) simulated function ClientSuccessfulHeal(
return; NiceHumanPawn healer,
if(instigator != none && PlayerController(instigator.controller) != none) NiceHumanPawn healed
PlayerController(instigator.controller). ){
ClientMessage("You've healed"@healed.GetPlayerName(), 'CriticalEvent'); if(healed == none) {
if(NiceHumanPawn(instigator) != none && PlayerController(healed.controller) != none) return;
PlayerController(healed.controller). }
ClientMessage("You've been healed by"@healer.GetPlayerName(), 'CriticalEvent'); if(instigator != none && PlayerController(instigator.controller) != none) {
PlayerController(instigator.controller).ClientMessage(
"You've healed" @ healed.GetPlayerName(),
'CriticalEvent');
}
} }
defaultproperties defaultproperties