38 RegisterNetSyncVariableInt(
"m_RAIB.m_PairDeviceNetIdLow");
39 RegisterNetSyncVariableInt(
"m_RAIB.m_PairDeviceNetIdHigh");
44 if (!
g_Game.IsMultiplayer())
51 return GetInventory().GetSlotLock(
InventorySlots.GetSlotIdFromString(triggerSlot));
59 GetInventory().SetSlotLock(
InventorySlots.GetSlotIdFromString(triggerSlotName),
true);
65 GetInventory().SetSlotLock(
InventorySlots.GetSlotIdFromString(triggerSlotName),
false);
71 GetInventory().SetSlotLock(
InventorySlots.GetSlotIdFromString(explosiveSlotName),
true);
77 GetInventory().SetSlotLock(
InventorySlots.GetSlotIdFromString(explosiveSlotName),
false);
82 if (!super.OnStoreLoad(ctx, version))
90 bool locked = GetInventory().GetSlotLock(slotId);
93 GetInventory().SetSlotLock(slotId,
false);
94 locked = GetInventory().GetSlotLock(slotId);
104 super.OnStoreSave(ctx);
111 super.OnVariablesSynchronized();
132 super.OnPlacementComplete(player, position, orientation);
136 SetOrientation(
vector.Up);
142 super.EEItemLocationChanged(oldLoc, newLoc);
192 GetInventory().GetCurrentInventoryLocation(il);
215 return FindAttachmentBySlotName(
slotName) != null;
229 return !
GetArmed() && super.IsTakeable();
247 super.EEHealthLevelChanged(oldLevel, newLevel, zone);
253 for (
int attachmentIdx = 0; attachmentIdx < GetInventory().AttachmentCount(); attachmentIdx++)
255 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(attachmentIdx));
258 attachment.UnlockFromParent();
259 attachment.SetHealth(
"",
"", 0.0);
273 bool isTimeTriggered =
false;
276 for (
int attachmentIdx = 0; attachmentIdx < GetInventory().AttachmentCount(); attachmentIdx++)
278 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(attachmentIdx));
280 attachmentsCache.Insert(attachment);
283 foreach (
ItemBase attachment1 : attachmentsCache)
284 attachment1.UnlockFromParent();
287 foreach (
ItemBase attachment2 : attachmentsCache)
289 if (attachment2.IsInherited(ClockBase))
291 isTimeTriggered =
true;
297 foreach (
ItemBase attachment3 : attachmentsCache)
301 vector dropExtents =
"0.5 0.0 0.5";
303 dropExtents[1] = 0.15;
305 GetInventory().DropEntityInBounds(
InventoryMode.SERVER,
this, attachment3, dropExtents, 0, 0, 0);
307 attachment3.SetTakeable(
false);
324 foreach (
ItemBase attachment4 : attachmentsCache)
326 if (attachment4.IsAnyInherited({RemoteDetonator, ClockBase}))
332 if (attachment4 && !attachment4.IsAnyInherited({RemoteDetonator, ClockBase}))
334 Param1<ItemBase> params =
new Param1<ItemBase>(attachment4);
347 super.EEItemAttached(item, slot_name);
361 super.EEItemDetached(item, slot_name);
380 super.OnDisarmed(pWithTool);
385 for (
int attachmentIdx = 0; attachmentIdx < GetInventory().AttachmentCount(); attachmentIdx++)
387 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(attachmentIdx));
390 attachmentsCache.Insert(attachment);
394 foreach (
ItemBase attachment1 : attachmentsCache)
395 attachment1.UnlockFromParent();
398 foreach (
ItemBase attachment2 : attachmentsCache)
400 if (attachment2.IsInherited(ClockBase))
403 GetInventory().DropEntity(
InventoryMode.SERVER,
this, attachment2);
406 if (attachment2.IsInherited(RemoteDetonator))
410 GetInventory().DropEntity(
InventoryMode.SERVER,
this, attachment2);
411 attachment2.SetHealth(
"",
"", 0.0);
415 attachment2.Delete();
428 receiver.UpdateLED(pState,
true);
436 if (entity.IsInherited(ClockBase))
453 if (entity.IsInherited(RemoteDetonator))
486 return "placeImprovisedExplosive_SoundSet";
491 return "improvisedexplosive_deploy_SoundSet";
496 return "ImprovisedExplosive_disarm_SoundSet";
501 return "ImprovisedExplosive_disarm_SoundSet";
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void AddAction(typename actionName)
PlayerSpawnPreset slotName
const string ANIM_PHASE_TRIGGER_REMOTE
override void OnBeforeDisarm()
override void UnlockExplosivesSlots()
const float TIME_TRIGGER_DELAY_SECS
const int SLOT_EXPLOSIVE_COUNT
override void LockExplosivesSlots()
void OnTriggerDetached(EntityAI entity)
const string ANIM_PHASE_TRIGGER_CLOCK
override string GetDisarmSoundset()
override void SetActions()
static const string SLOT_TRIGGER_ALARM_CLOCK
override bool HasLockedTriggerSlots()
static const string SLOT_EXPLOSIVE_A
static const string SLOT_TRIGGER_KITCHEN_TIMER
void UpdateVisuals(EntityAI entity)
const float TIME_TRIGGER_INITIAL_DELAY_SECS
override void OnVariablesSynchronized()
override bool IsDeployable()
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
const float TIME_TRIGGER_TIMER_BASED_DELAY_SECS
const string SLOT_EXPLOSIVES[SLOT_EXPLOSIVE_COUNT]
override void PairRemote(notnull EntityAI trigger)
const string SLOT_TRIGGERS[SLOT_TRIGGERS_COUNT]
override void EEItemDetached(EntityAI item, string slot_name)
override void EEItemAttached(EntityAI item, string slot_name)
const int SLOT_TRIGGERS_COUNT
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
const string ANIM_PHASE_TRIGGER_EMPTY
override void UnlockTriggerSlots()
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void EOnInit(IEntity other, int extra)
static const string SLOT_EXPLOSIVE_B
const string ANIM_PHASE_TRIGGER_TIMER
static const string SLOT_TRIGGER_REMOTE
void ImprovisedExplosive()
ref RemotelyActivatedItemBehaviour m_RAIB
override bool IsTimerDetonable()
void InitiateExplosion()
not exploding itself, rely on attached explosives
override void LockTriggerSlots()
override bool CanDisplayAttachmentSlot(int slot_id)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
override bool IsTakeable()
override void OnStoreSave(ParamsWriteContext ctx)
override string GetArmSoundset()
override string GetDeploySoundset()
override bool CanBeArmed()
void OnTriggerAttached(EntityAI entity)
override void OnDisarmed(bool pWithTool)
override void UpdateLED(int pState)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnActivatedByItem(notnull ItemBase item)
override bool CanBeDisarmed()
override EntityAI GetPairDevice()
provides access to slot configuration
void OnVariableSynchronized()
int GetPairDeviceNetIdHigh()
int GetPairDeviceNetIdLow()
Serialization general interface. Serializer API works with:
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
void SetArmed(bool state)
const string ANIM_PHASE_VISIBILITY
override void UnpairRemote()
proto native CGame GetGame()
InventoryLocationType
types of Inventory Location
override void SetTakeable(bool pState)
RemoteDetonatorTrigger RemoteDetonator RemoteDetonatorReceiver()