rott/kf_sources/KFMod/Classes/SyringeAltFire.uc
2026-07-14 20:27:09 +07:00

84 lines
2.1 KiB
Ucode

// Self Healing Fire //
class SyringeAltFire extends WeaponFire;
var float InjectDelay;
var float HealeeRange;
function DoFireEffect()
{
SetTimer(InjectDelay, False);
if ( Level.NetMode != NM_StandAlone && Level.Game.NumPlayers > 1 && KFPlayerController(Instigator.Controller) != none &&
KFSteamStatsAndAchievements(KFPlayerController(Instigator.Controller).SteamStatsAndAchievements) != none )
{
KFSteamStatsAndAchievements(KFPlayerController(Instigator.Controller).SteamStatsAndAchievements).AddSelfHeal();
}
}
Function Timer()
{
local float HealSum;
HealSum = Syringe(Weapon).HealBoostAmount;
if ( KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo) != none && KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill != none )
{
HealSum *= KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.Static.GetHealPotency(KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo));
}
Weapon.ConsumeAmmo(ThisModeNum, AmmoPerFire);
Instigator.GiveHealth(HealSum, 100);
}
function bool AllowFire()
{
if (Instigator.Health >= Instigator.HealthMax)
return false;
return Weapon.AmmoAmount(ThisModeNum) >= AmmoPerFire;
}
event ModeDoFire()
{
Load = 0;
Super.ModeDoFire(); // We don't consume the ammo just yet.
}
function PlayFiring()
{
if ( Weapon.Mesh != None )
{
if ( FireCount > 0 )
{
if ( Weapon.HasAnim(FireLoopAnim) )
{
Weapon.PlayAnim(FireLoopAnim, FireLoopAnimRate, 0.0);
}
else
{
Weapon.PlayAnim(FireAnim, FireAnimRate, 0.0);
}
}
else
{
Weapon.PlayAnim(FireAnim, FireAnimRate, 0.0);
}
}
Weapon.PlayOwnedSound(FireSound,SLOT_Interact,TransientSoundVolume,,TransientSoundRadius,Default.FireAnimRate/FireAnimRate,false);
ClientPlayForceFeedback(FireForce); // jdf
FireCount++;
}
defaultproperties
{
TweenTime=0.1
TransientSoundVolume=1.8
FireAnim="AltFire"
FireRate=3.60000
AmmoPerFire=500
bModeExclusive=true
InjectDelay=0.1//1.0
HealeeRange=70.000000
}