9 const string COLOR_LED_OFF =
"#(argb,8,8,3)color(0,0,0,1.0,co)";
48 protected const string ANIM_PHASE_TRIGGER =
"trigger";
58 RegisterNetSyncVariableInt(
"m_RAIB.m_PairDeviceNetIdLow");
59 RegisterNetSyncVariableInt(
"m_RAIB.m_PairDeviceNetIdHigh");
70 override void OnVariablesSynchronized()
72 super.OnVariablesSynchronized();
76 m_RAIB.OnVariableSynchronized();
84 super.EEItemLocationChanged(oldLoc, newLoc);
97 override void OnCEUpdate()
101 if (!IsRuined() && IsConnected() && GetControlledDevice())
114 override void PairRemote(notnull
EntityAI trigger)
119 override void UnpairRemote()
125 override void OnActivatedByItem(notnull
ItemBase item)
129 if (
m_RAIB.IsPaired() && !IsRuined())
134 device.OnActivatedByItem(
this);
152 return m_RAIB.GetPairDevice();
157 string type =
"RemoteDetonatorTrigger";
162 ItemBase inHandsItem = player.GetItemInHands();
167 ReplaceDetonatorItemOnArmLambda onArmLambda =
new ReplaceDetonatorItemOnArmLambda(inHandsItem, type);
168 onArmLambda.SetPairDevice(deviceToPair);
169 MiscGameplayFunctions.TurnItemIntoItemEx(player, onArmLambda);
174 MiscGameplayFunctions.TurnItemIntoItemEx(player, lambda);
184 if (player.GetItemInHands())
185 player.GetItemAccessor().OnItemInHandsChanged();
191 override void OnAnimationPhaseStarted(
string animSource,
float phase)
202 override void SetActions()
213 #ifdef DIAG_DEVELOPER
217 debug_output +=
string.Format(
"low net id: %1\n",
m_RAIB.GetPairDeviceNetIdLow());
218 debug_output +=
string.Format(
"high net id: %1\n",
m_RAIB.GetPairDeviceNetIdHigh());
219 debug_output +=
string.Format(
"pair device: %1\n",
m_RAIB.GetPairDevice());
232 override bool IsKit()
244 super.EEKilled(killer);
260 override void CopyOldPropertiesToNew(notnull
EntityAI old_item,
EntityAI new_item)
262 super.CopyOldPropertiesToNew(old_item, new_item);
264 MiscGameplayFunctions.TransferItemProperties(old_item, new_item);
274 m_PairDevice = device;
279 super.OnSuccess(new_item);
281 RemoteDetonator detonator = RemoteDetonator.Cast(new_item);
287 ItemBase receiver =
ItemBase.Cast(explosive.GetInventory().CreateAttachment(
"RemoteDetonatorReceiver"));
290 MiscGameplayFunctions.TransferItemProperties(detonator, receiver);
291 receiver.LockToParent();
292 explosive.SetTakeable(
false);
293 explosive.PairWithDevice(detonator);
305 explosive.LockTriggerSlots();
306 explosive.SetTakeable(
true);
313 override void OnSuccess(
EntityAI new_item)
315 super.OnSuccess(new_item);
317 RemoteDetonator detonator = RemoteDetonator.Cast(m_OldItem);
320 if (detonator.GetRemotelyActivatedItemBehaviour())
331 override void OnAbort()
335 RemoteDetonator detonator = RemoteDetonator.Cast(m_OldItem);
338 if (detonator.GetRemotelyActivatedItemBehaviour())
343 explosive.LockExplosivesSlots();