KF2-TAWOD/TAWOD/Classes/TAWODMut.uc

38 lines
861 B
Ucode
Raw Normal View History

2022-06-10 12:25:54 +00:00
class TAWODMut extends KFMutator;
2021-01-31 10:13:35 +00:00
2022-06-10 12:25:54 +00:00
public event PreBeginPlay()
2021-01-31 10:13:35 +00:00
{
2022-06-10 12:25:54 +00:00
Super.PreBeginPlay();
`log("Loaded.", true, 'TAWOD');
2021-01-31 10:13:35 +00:00
}
2022-06-10 12:25:54 +00:00
public function AddMutator(Mutator Mut)
2021-01-31 10:13:35 +00:00
{
2022-06-10 12:25:54 +00:00
if (Mut == Self) return;
2021-01-31 10:13:35 +00:00
if (Mut.Class == Class)
Mut.Destroy();
else
Super.AddMutator(Mut);
}
2022-06-10 12:25:54 +00:00
public function bool PreventDeath(Pawn Killed, Controller Killer, class<DamageType> damageType, vector HitLocation)
{
local KFWeapon TempWeapon;
local KFPawn_Human KFP;
KFP = KFPawn_Human(Killed);
2022-06-10 12:25:54 +00:00
if (Role >= ROLE_Authority && KFP != None && KFP.InvManager != None)
foreach KFP.InvManager.InventoryActors(class'KFWeapon', TempWeapon)
2022-06-10 12:25:54 +00:00
if (TempWeapon != None && TempWeapon.bDropOnDeath && TempWeapon.CanThrow())
KFP.TossInventory(TempWeapon);
return Super.PreventDeath(Killed, Killer, damageType, HitLocation);
}
2021-01-31 10:13:35 +00:00
defaultproperties
{
2022-06-10 12:25:54 +00:00
2021-01-31 10:13:35 +00:00
}