75 RegisterNetSyncVariableBool(
"m_IsActive");
76 RegisterNetSyncVariableBool(
"m_IsInProgress");
77 RegisterNetSyncVariableBool(
"m_IsSoundSynchRemote");
78 RegisterNetSyncVariableBool(
"m_IsDeploySound");
96 super.OnVariablesSynchronized();
119 super.EEDelete(parent);
130 super.OnStoreSave(ctx);
139 if ( !super.OnStoreLoad(ctx, version) )
142 bool b_is_active =
false;
143 if ( !ctx.Read( b_is_active ) )
146 bool b_is_in_progress =
false;
147 if ( !ctx.Read( b_is_in_progress ) )
148 b_is_in_progress =
false;
155 if (b_is_in_progress && !b_is_active)
191 if ( GetHierarchyRootPlayer() !=
null && GetHierarchyRootPlayer().GetHumanInventory().GetEntityInHands() ==
this )
195 vector player_pos = player.GetPosition();
196 vector aim_pos = player.GetAimPosition();
198 if (
vector.DistanceSq( player_pos, aim_pos ) <= (
Math.SqrFloat( 1.5 ) ) )
209 if (
GetGame().SurfaceIsSea( position[0], position[2] ) )
213 else if (
GetGame().SurfaceIsPond( position[0], position[2] ) )
225 GetGame().RPCSingleParam(
this,
ERPCs.RPC_TRAP_DISARM,
null,
true);
248 if ( victim.IsInherited(SurvivorBase))
256 else if (victim.IsInherited(
ItemBase))
259 float damage_coef = 1;
261 if (victim_item.HasQuantity() && victim_item.GetQuantityMax() != 0 && victim_item.GetQuantity() > 0)
263 damage_coef = victim_item.GetQuantityMax() / victim_item.GetQuantity();
270 GetGame().GetInventoryItemSize(victim_item, item_size_x, item_size_y);
272 float add_damage = 300 * damage_coef /
Math.Clamp(item_size_x * item_size_y, 1,
int.
MAX);
273 victim_item.DecreaseHealth(
"",
"", add_damage);
287 OnSteppedOut(victim);
302 if (victim && !victim.GetAllowDamage())
305 Param1<EntityAI> p =
new Param1<EntityAI>(victim);
306 GetGame().RPCSingleParam(
this,
ERPCs.RPC_TRAP_VICTIM, p,
true);
314 super.OnRPC(sender, rpc_type, ctx);
316 if ( !
GetGame().IsDedicatedServer() )
320 case ERPCs.RPC_TRAP_VICTIM:
321 Param1<EntityAI> victim =
new Param1<EntityAI>(
null);
323 if (ctx.Read(victim))
331 case ERPCs.RPC_TRAP_DISARM:
337 Param1<bool> p =
new Param1<bool>(
false);
339 bool isActivating =
false;
341 isActivating = p.param1;
406 if (GetHierarchyRootPlayer() && GetHierarchyRootPlayer().CanDropEntity(
this))
417 player.LocalDropEntity(
this);
419 vector trapPos = player.GetDirection() * 1.5;
466 HideSelection(
"safety_pin");
502 vector mins =
"-0.01 -0.05 -0.01";
503 vector maxs =
"0.01 0.5 0.01";
528 super.OnItemLocationChanged(old_owner, new_owner);
535 if (old_owner == NULL && new_owner != NULL &&
IsActive())
538 if ( new_owner.IsPlayer() )
542 else if (new_owner.GetHierarchyRootPlayer())
553 super.EEItemAttached(item, slot_name);
561 super.EEItemDetached(item, slot_name);
567 override void OnPlacementComplete(Man player,
vector position =
"0 0 0",
vector orientation =
"0 0 0")
569 super.OnPlacementComplete(player, position, orientation);
573 SetOrientation(orientation);
582 if ( !super.CanPutInCargo(parent) )
592 if ( !super.CanPutIntoHands( parent ) )
642 override void SetActions()
657 for (
int i = 0; i < inv.AttachmentCount(); i++)
660 EntityAI wheelEntity = inv.GetAttachmentFromIndex(i);
669 wheelEntity.GetInventory().GetCurrentAttachmentSlotInfo(slotId,
slotName);
677 if (wheelEntity && wheelEntity.IsInherited(
CarWheel))
679 vector entPosXZ = wheelEntity.GetPosition();
681 if (
vector.Distance(trapPosXZ, entPosXZ) < 1)
696 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"LEGS")));
697 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"BACK")));
698 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"VEST")));
699 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"HeadGear")));
700 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"Mask")));
701 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"BODY")));
702 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"FEET")));
703 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"GLOVES")));
706 for (
int i = 0; i < equippedClothes.Count(); i++)
709 if (equippedClothes[i] ==
null)