38 RegisterNetSyncVariableInt(
"m_RAIB.m_PairDeviceNetIdLow");
39 RegisterNetSyncVariableInt(
"m_RAIB.m_PairDeviceNetIdHigh");
44 if (!
g_Game.IsMultiplayer())
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();
115 m_RAIB.OnVariableSynchronized();
132 super.OnPlacementComplete(player, position, orientation);
142 super.EEItemLocationChanged(oldLoc, newLoc);
162 return m_RAIB.GetPairDevice();
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)
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)
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);
453 if (entity.IsInherited(RemoteDetonator))
486 return "placeImprovisedExplosive_SoundSet";
491 return "improvisedexplosive_deploy_SoundSet";
496 return "improvisedexplosive_deploy_SoundSet";
501 return "ImprovisedExplosive_disarm_SoundSet";
509 debug_output +=
string.
Format(
"low net id: %1\n",
m_RAIB.GetPairDeviceNetIdLow());
510 debug_output +=
string.
Format(
"high net id: %1\n",
m_RAIB.GetPairDeviceNetIdHigh());
511 debug_output +=
string.
Format(
"pair device: %1\n",
m_RAIB.GetPairDevice());
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
void AddAction(typename actionName)
PlayerSpawnPreset slotName
void SetArmed(bool state)
const string ANIM_PHASE_VISIBILITY
override void UnpairRemote()
InventoryLocationType
types of Inventory Location
override void SetTakeable(bool pState)
RemoteDetonatorTrigger RemoteDetonator RemoteDetonatorReceiver()
ref RemotelyActivatedItemBehaviour m_RAIB
override ScriptCallQueue GetCallQueue(int call_category)
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()
proto native int GetType()
returns type of InventoryLocation
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
proto void CallLaterByName(Class obj, string fnName, int delay=0, bool repeat=false, Param params=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Serializer ParamsReadContext
proto native CGame GetGame()
Serializer ParamsWriteContext
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.