update11 #31
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user