KF2-Server-Extension/ServerExt/Classes/ExtProj_SUPERMedGrenade.uc

61 lines
1.3 KiB
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
// Written by Marco.
class ExtProj_SUPERMedGrenade extends KFProj_MedicGrenade
hidedropdown;
var() byte NumClusters;
2020-11-28 20:04:55 +00:00
simulated function Disintegrate(rotator inDisintegrateEffectRotation); // Nope!
2017-10-20 02:00:49 +00:00
simulated function TriggerExplosion(Vector HitLocation, Vector HitNormal, Actor HitActor)
{
local byte i;
local KFProj_MedicGrenade P;
2020-11-28 20:12:58 +00:00
if (bHasExploded)
2017-10-20 02:00:49 +00:00
return;
2020-11-28 20:12:58 +00:00
if (InstigatorController==None && WorldInfo.NetMode!=NM_Client) // Prevent Team-Kill.
2017-10-20 02:00:49 +00:00
{
Destroy();
return;
}
Super.TriggerExplosion(HitLocation,HitNormal,HitActor);
2020-11-28 20:12:58 +00:00
if (WorldInfo.NetMode!=NM_Client)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
for (i=0; i<NumClusters; ++i)
2017-10-20 02:00:49 +00:00
{
P = Spawn(class'KFProj_MedicGrenade',,,Location);
2020-11-28 20:12:58 +00:00
if (P!=None)
2017-10-20 02:00:49 +00:00
{
P.InstigatorController = InstigatorController;
P.Init(VRand());
}
}
}
bHasExploded = true;
}
simulated function Destroyed()
{
2020-11-28 19:53:57 +00:00
local Actor HitActor;
local vector HitLocation, HitNormal;
2017-10-20 02:00:49 +00:00
// Final Failsafe check for explosion effect
2020-11-28 20:12:58 +00:00
if (!bHasExploded && WorldInfo.NetMode==NM_Client)
2017-10-20 02:00:49 +00:00
{
GetExplodeEffectLocation(HitLocation, HitNormal, HitActor);
2020-11-28 19:53:57 +00:00
TriggerExplosion(HitLocation, HitNormal, HitActor);
2017-10-20 02:00:49 +00:00
}
}
defaultproperties
{
bCanDisintegrate=false
DrawScale=2
NumClusters=5
ProjFlightTemplate=ParticleSystem'ZED_Hans_EMIT.FX_Grenade_Explosive_01'
Begin Object Name=ExploTemplate0
Damage=170
DamageRadius=800
End Object
}