7 bool m_CanCatch =
false;
53 m_UpdateWaitTime = 10;
55 m_NeedInstalation =
true;
58 m_MinimalDistanceFromPlayersToCatch = 0;
61 m_NoBaitCatchProb = 50;
65 m_AnimationPhaseUsed =
"";
69 m_CatchesGroundAnimal =
NULL;
75 RegisterNetSyncVariableBool(
"m_IsSoundSynchRemote");
76 RegisterNetSyncVariableBool(
"m_IsDeploySound");
77 RegisterNetSyncVariableBool(
"m_IsActive");
78 RegisterNetSyncVariableBool(
"m_IsDeployed");
94 ctx.Write(m_IsDeployed);
99 if (!
super.OnStoreLoad(
ctx, version))
128 super.OnVariablesSynchronized();
160 SetAnimationPhase(m_AnimationPhaseUsed, 1);
169 SetAnimationPhase(m_AnimationPhaseUsed, 1);
194 if (GetHierarchyRootPlayer() && GetHierarchyRootPlayer().CanDropEntity(
this))
216 if (
GetGame().IsServer() && m_IsFoldable ==
true)
233 if (!IsDeployed() || (GetInventory().AttachmentCount() == 0 && IsDeployed()))
241 super.CanPutInCargo(parent);
247 super.CanPutIntoHands(parent);
262 SetAnimationPhase(m_AnimationPhaseUsed, 1);
294 m_IsDeployed =
false;
302 SetAnimationPhase(m_AnimationPhaseUsed, 0);
324 m_CanCatch = SetCanCatch(m_Bait);
330 if (m_MinimalDistanceFromPlayersToCatch > 0)
341 m_Timer.Run(m_UpdateWaitTime,
this,
"SpawnCatch");
349 m_FinalCatchProb = m_BaitCatchProb;
351 m_FinalCatchProb = m_NoBaitCatchProb;
355 if (MemoryPointExists(
"Prey_Position"))
356 m_PreyPos = ModelToWorld(GetMemoryPointPos(
"Prey_Position"));
440 if (IsDeployed() &&
slot_name ==
"Trap_Bait")
461 if (GetInventory().GetCurrentInventoryLocation(
source))
478 if (!
GetGame().IsDedicatedServer())
487 if (!
GetGame().IsDedicatedServer())
516 if (GetHierarchyRootPlayer() !=
NULL && GetHierarchyRootPlayer().GetHumanInventory().GetEntityInHands() ==
this)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
ActionActivateTrapCB ActionContinuousBaseCB ActionActivateTrap()
void AddAction(typename actionName)
proto native bool AvoidPlayer(vector vPos, float fDistance)
Check if there is a player within a radius.
proto native CEApi GetCEApi()
Get the CE API.
void SetIsDeploySound(bool is_deploy_sound)
bool CanPlayDeployLoopSound()
string m_AnimationPhaseTriggered
void PlayDeployLoopSound()
void StopDeployLoopSound()
ref EffectSound m_DeployLoopSound
string m_AnimationPhaseSet
void SetInactive(bool stop_timer=true)
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
void StartActivate(PlayerBase player)
class JsonUndergroundAreaTriggerData GetPosition
Wrapper class for managing sound through SEffectManager.
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
override void EEItemAttached(EntityAI item, string slot_name)
bool IsSurfaceWater(vector position)
string m_AnimationPhaseTriggered
bool SetCanCatch(out EntityAI bait)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
ref Timer m_AlignCatchTimer
bool CanPutInInventory(EntityAI player)
void AlignCatch(ItemBase obj, string catch_name)
float m_MinimalDistanceFromPlayersToCatch
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool CanPutIntoHands(EntityAI parent)
void PlayDeployLoopSound()
override void SetActions()
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
ref multiMap< string, float > m_CatchesGroundAnimal
ref EffectSound m_DeployLoopSound
override void OnStoreSave(ParamsWriteContext ctx)
ref multiMap< string, float > m_CatchesSea
override void OnVariablesSynchronized()
this event is called all variables are synchronized on client
override bool CanDisplayAttachmentSlot(int slot_id)
void SetDeployed(bool newState)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
void StartActivate(PlayerBase player)
override bool IsTakeable()
bool IsPlaceableAtPosition(vector position)
string m_AnimationPhaseSet
void StopDeployLoopSound()
override bool CanBePlaced(Man player, vector position)
bool m_WaterSurfaceForSetup
ref multiMap< string, float > m_CatchesPond
void CatchSetQuant(ItemBase catch)
string m_AnimationPhaseUsed
ref array< string > m_PlaceableWaterSurfaceList
DEPRECATED.
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.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Serialization general interface. Serializer API works with:
static bool AllowedWaterSurface(float pHeight, string pSurface, array< string > pAllowedSurfaceList)
override string GetLoopDeploySoundset()
override bool IsPlaceableAtPosition(vector position)
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto native CGame GetGame()
proto native void SetPosition(vector position)
Set the world position of the Effect.
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float Round(float f)
Returns mathematical round of value.