|
Dayz
1.11.153731
Dayz Code Explorer by Zeroy
|
Go to the documentation of this file.
79 super.OnVariablesSynchronized();
96 if (
GetGame().IsMultiplayer() )
112 super.EEDelete(parent);
124 super.OnStoreSave(ctx);
134 if ( !super.OnStoreLoad(ctx,
version) )
137 bool b_is_active =
false;
138 if ( !ctx.
Read( b_is_active ) )
141 bool b_is_in_progress =
false;
142 if ( !ctx.
Read( b_is_in_progress ) )
143 b_is_in_progress =
false;
150 if (b_is_in_progress && !b_is_active)
203 vector player_pos = player.GetPosition();
204 vector aim_pos = player.GetAimPosition();
217 if(
GetGame().SurfaceIsSea( position[0], position[2] ) )
221 else if(
GetGame().SurfaceIsPond( position[0], position[2] ) )
240 if (m_DamagePlayers > 0)
244 if ( victim.IsInherited(SurvivorBase) )
250 else if(victim.IsInherited(DayZCreatureAI) )
254 else if(victim.IsInherited(
ItemBase) )
257 float damage_coef = 1;
259 if ( victim_item.HasQuantity() && victim_item.GetQuantityMax() != 0 )
261 damage_coef = victim_item.GetQuantityMax() / victim_item.GetQuantity();
271 int item_size = item_size_x * item_size_y;
276 float add_damage = 300*damage_coef/item_size;
277 victim_item.DecreaseHealth(
"",
"", add_damage );
303 Param1<EntityAI> p =
new Param1<EntityAI>( victim );
312 super.OnRPC(sender, rpc_type, ctx);
318 case ERPCs.RPC_TRAP_VICTIM:
320 ref Param1<EntityAI> p_victim =
new Param1<EntityAI>(NULL);
322 if (ctx.
Read(p_victim))
334 ref Param1<bool> p =
new Param1<bool>(
false);
338 bool play = p.param1;
378 if ( m_AnimationPhaseGrounded !=
"" )
421 Error(
"Mojmir: TODO");
422 player.LocalDropEntity(
this );
424 vector trapPos = ( player.GetDirection() ) * 1.5;
426 this.
SetPosition( player.GetPosition() + trapPos );
511 Print(
"Delete trap trigger");
523 if ( attachments > 0 )
528 Error(
"Mojmir: TODO");
539 m_TrapTrigger = TrapTrigger.Cast(
g_Game.CreateObject(
"TrapTrigger",
this.GetPosition(),
false ) );
540 vector mins =
"-0.01 -0.05 -0.01";
541 vector maxs =
"0.01 0.05 0.01";
549 super.OnItemLocationChanged(old_owner, new_owner);
556 if ( old_owner == NULL && new_owner != NULL &&
IsActive() )
559 if ( new_owner.ClassName() ==
"PlayerBase" )
565 if ( new_owner.GetHierarchyRootPlayer().ClassName() ==
"PlayerBase" )
577 super.EEItemAttached(item, slot_name);
587 super.EEItemDetached(item, slot_name);
597 if( !super.CanPutInCargo(parent) ) {
return false;}
603 if( !super.CanPutIntoHands( parent ) )
622 return "Trap can't be placed on this surface type.";
proto native CGame GetGame()
bool LocalDropEntity(notnull EntityAI item)
string m_InfoDamageManipulation
void Error(string err)
Messagebox with error message.
override bool CanPutIntoHands(EntityAI parent)
bool CanPlayDeployLoopSound()
override void OnVariablesSynchronized()
this event is called all variables are synchronized on client
protected bool m_IsInProgress
proto native void ObjectDelete(Object obj)
bool CanDropEntity(notnull EntityAI item)
Returns if item can be dropped out from this entity.
void PlayDeployLoopSound()
void AddAction(typename actionName)
void StopDeployLoopSound()
void SetSoundFadeOut(float fade_out)
proto native Man GetHierarchyRootPlayer()
Returns root of current hierarchy cast to Man.
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
void SnapOnObject(EntityAI victim)
proto void Print(void var)
Prints content of variable to console/log.
proto native int AttachmentCount()
Returns count of attachments attached to this item.
static bool DestroySound(EffectSound sound_effect)
protected TrapTrigger m_TrapTrigger
proto native void SetSynchDirty()
Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take ef...
bool m_AddActivationDefect
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
void HideSelection(string selection_name)
Hides selection of the given name. Must be configed in config.hpp and models.cfg.
override void EEItemAttached(EntityAI item, string slot_name)
override bool IsTakeable()
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
string m_AnimationPhaseGrounded
bool m_WasActivatedOrDeactivated
override void EEItemDetached(EntityAI item, string slot_name)
proto bool Write(void value_out)
Serialization general interface.
override void EEDelete(EntityAI parent)
void SetInactive(bool stop_timer=true)
proto native EntityAI GetHierarchyParent()
Returns direct parent of current entity.
override void SetActions()
ref protected EffectSound m_DeployLoopSound
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=NULL)
see CGame.RPC
string m_AnimationPhaseTriggered
override string CanBePlacedFailMessage(Man player, vector position)
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
bool IsPlaceableAtPosition(vector position)
protected ref Timer m_Timer
override void OnStoreSave(ParamsWriteContext ctx)
override bool CanPutInCargo(EntityAI parent)
proto native void RegisterNetSyncVariableBool(string variableName)
enum SoundTypeTrap m_InitWaitTime
override string GetLoopDeploySoundset()
void StartDeactivate(PlayerBase player)
override void OnSteppedOn(EntityAI victim)
bool m_AddDeactivationDefect
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto bool Read(void value_in)
override void StartActivate(PlayerBase player)
proto native EntityAI GetAttachmentFromIndex(int index)
string m_InfoActivationTime
proto native void SetPosition(vector position)
Base native class of all vehicles in game.
proto native GameInventory GetInventory()
protected void Synch(EntityAI victim)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
protected bool m_IsActive
override void OnActivate()
string m_AnimationPhaseSet
override bool CanRemoveFromHands(EntityAI parent)
override bool CanBePlaced(Man player, vector position)