19 SetVisibleDuringDaylight(
true);
22 SetFlareVisible(
false);
23 SetAmbientColor(1.0, 1.0, 1.0);
24 SetDiffuseColor(1.0, 1.0, 1.0);
26 SetDisableShadowsWithinRadius(-1);
32 protected const float DEFAULT_FUSE_DELAY = 10;
34 protected ref
Timer m_FuseTimer;
35 protected float m_FuseDelay;
36 protected float m_RemainingFuseTime;
38 protected bool m_Pinned;
39 protected bool m_Pinnable;
46 if (!m_Pinned && m_Pinnable)
61 override void OnActivatedByTripWire();
63 override void OnActivatedByItem(notnull
ItemBase item)
82 if (m_FuseTimer.IsRunning())
90 void ActivateImmediate()
92 OnActivateImmediate();
95 void ActivateRandomTime()
97 float delay =
Math.RandomFloat(1, 20);
102 void SetPinnable(
bool state)
107 void SetFuseDelay(
float delay)
114 m_GrenadeType = type;
119 return m_GrenadeType;
122 protected void Activate()
124 if (!m_FuseTimer.IsRunning())
127 if (m_RemainingFuseTime > 0)
130 m_FuseTimer.Run(m_RemainingFuseTime,
this,
"OnActivateFinished");
135 m_FuseTimer.Run(m_FuseDelay,
this,
"OnActivateFinished");
141 protected void Deactivate()
143 if (m_FuseTimer.IsRunning())
145 m_RemainingFuseTime = m_FuseTimer.GetRemaining();
151 protected override void InitiateExplosion()
153 switch (GetGrenadeType())
171 protected void ExplodeGrenade(
EGrenadeType grenade_type)
176 protected void OnPin()
181 ForceFarBubble(
false);
188 protected void OnUnpin()
193 ForceFarBubble(
true);
200 protected void OnActivateStarted();
201 protected void OnActivateFinished()
205 SetHealth(
"",
"", 0.0);
210 protected void OnActivateImmediate()
214 SetHealth(
"",
"", 0.0);
219 protected void OnDeactivate();
223 super.OnStoreSave(ctx);
225 if (
GetGame().SaveVersion() >= 107)
233 if (!super.OnStoreLoad(ctx, version))
239 if (!ctx.Read(pinned))
250 override bool CanBeArmed()
255 override bool CanBeDisarmed()
260 override bool CanExplodeInFire()
265 override void SetActions()
275 super.EEItemLocationChanged(oldLoc, newLoc);
284 override void OnWasAttached(
EntityAI parent,
int slot_id)
286 super.OnWasAttached(parent, slot_id);
288 if (parent.IsAnyInherited({TrapBase,ImprovisedExplosive}))
297 m_FuseTimer =
new Timer;
298 m_RemainingFuseTime = -1;
301 SetFuseDelay(DEFAULT_FUSE_DELAY);
304 RegisterNetSyncVariableBool(
"m_Pinned");