13 static const int DEPLOYED = 2;
14 static const int TRIGGERED = 1;
17 private int m_WireMaterial;
34 RegisterNetSyncVariableInt(
"m_State");
39 super.OnStoreSave(ctx);
47 if ( !super.OnStoreLoad(ctx, version) )
51 if ( !ctx.Read( state ) )
63 vector mins =
"-0.75 0.3 -0.01";
64 vector maxs =
"0.75 0.32 0.01";
79 if (!victim.GetAllowDamage())
87 victim.ProcessDirectDamage(
DamageType.CLOSE_COMBAT,
this,
"",
"TripWireHit",
"0 0 0", 1);
101 super.OnItemLocationChanged(old_owner, new_owner);
113 super.EEItemLocationChanged(oldLoc, newLoc);
138 super.EEHealthLevelChanged(oldLevel, newLevel, zone);
152 super.SetInactive(stop_timer);
155 for (
int att = 0; att < GetInventory().AttachmentCount(); att++)
157 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(att));
160 if (attachment.IsLockedInSlot())
162 attachment.UnlockFromParent();
165 attachment.OnActivatedByItem(
this);
166 GetInventory().DropEntity(
InventoryMode.SERVER,
this, attachment);
183 m_WireMaterial = wireType;
188 return m_WireMaterial;
194 super.RefreshState();
204 super.SetupTrapPlayer( player, set_position );
210 super.StartDeactivate(player);
219 if ( GetState() != DEPLOYED )
222 return super.CanReceiveAttachment( attachment, slotId );
228 if ( GetState() != DEPLOYED )
231 return super.CanDisplayAttachmentSlot( slot_id );
236 super.EEItemAttached(item, slot_name);
243 super.EEItemDetached(item, slot_name);
255 super.EEKilled(killer);
279 #ifdef PLATFORM_WINDOWS
281 override int GetViewIndex()
283 if ( MemoryPointExists(
"invView2" ) )
286 GetInventory().GetCurrentInventoryLocation( il );
305 if ( GetState() == DEPLOYED )
307 else if ( GetState() == TRIGGERED )
319 if ( GetState() == DEPLOYED )
321 else if ( GetState() == TRIGGERED )
349 super.OnPlacementComplete(player, position, orientation);
354 super.OnPlacementCancelled(player);
369 return GetState() != DEPLOYED || (GetInventory().AttachmentCount() == 0 && GetState() == DEPLOYED);
374 return "tripwire_deploy_SoundSet";
379 return "tripwiretrap_deploy_SoundSet";
396 if ( GetInventory().AttachmentCount() > 0)
398 ItemBase attachment =
ItemBase.Cast( GetInventory().GetAttachmentFromIndex(0) );
403 for (
int i = 1; i <= 3; i++)
405 HideSelection(
"s" + i +
"_charge");
409 string proxy_to_show =
string.Format(
"s%1_charge", GetState() );
411 ShowSelection( proxy_to_show );
428 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
434 super.GetDebugActions(outputList);
439 if (super.OnAction(action_id, player, ctx))
443 if (action_id ==
EActions.ACTIVATE_ENTITY)
447 else if (action_id ==
EActions.DEACTIVATE_ENTITY)
Param4< int, int, string, int > TSelectableActionInfoWithColor
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void AddAction(typename actionName)
override void EEItemDetached(EntityAI item, string slot_name)
override void EEItemAttached(EntityAI item, string slot_name)
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Serialization general interface. Serializer API works with:
DamageType
exposed from C++ (do not change)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEKilled(Object killer)
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override bool IsTakeable()
proto native CGame GetGame()
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
class Hatchback_02_Blue extends Hatchback_02 OnDebugSpawn
InventoryLocationType
types of Inventory Location
string GetDeploySoundset()
void OnInventoryEnter(Man player)
Event called on item when it is placed in the player(Man) inventory, passes the owner as a parameter.
override void SetTakeable(bool pState)
string GetLoopDeploySoundset()
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
void OnStoreSave(ParamsWriteContext ctx)
bool OnStoreLoad(ParamsReadContext ctx, int version)
enum EObjectTemperatureState m_State
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
void SetState(bool state)
bool m_ResultOfAdvancedPlacing
enum eWireMaterial FOLDED
override bool CanDisplayAttachmentSlot(int slot_id)
void SetWireType(int wireType)
override void OnPlacementCancelled(Man player)
vector m_TriggerOrientation
void UpdateProxySelections()
string m_AnimationPhaseTriggered
void DeferredEnableTrigger()
enum SoundTypeTrap SPAWN_FLAGS
string m_AnimationPhaseGrounded
void OnSteppedOn(EntityAI victim)
string m_InfoActivationTime
string m_AnimationPhaseSet
void SetInactive(bool stop_timer=true)
TrapTrigger m_TrapTrigger
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
void StartActivate(PlayerBase player)
void StartDeactivate(PlayerBase player)