79 m_Text =
"default action text";
147 action_data.m_Action =
this;
148 action_data.m_Player = player;
149 action_data.m_Target = target;
150 action_data.m_MainItem = item;
155 action_data.m_WasActionStarted =
false;
156 action_data.m_ReciveEndInput =
false;
158 ActionReciveData action_recive_data = player.GetActionManager().GetReciveData();
159 if ( action_recive_data )
165 if ( player.GetItemInHands() != action_data.m_MainItem )
185 for (
int i = 0; i < action_data.m_ReservedInventoryLocations.Count(); i++)
386 int componentIndex = -1;
387 int proxyBoneIdx = -1;
392 Object targetObject = null;
393 Object targetParent = null;
403 targetObject = action_data.
m_Target.GetObject();
404 ctx.
Write(targetObject);
405 targetParent = action_data.
m_Target.GetParent();
406 ctx.
Write(targetParent);
407 componentIndex = action_data.
m_Target.GetComponentIndex();
408 ctx.
Write(componentIndex);
409 cursorHitPos = action_data.
m_Target.GetCursorHitPos();
410 ctx.
Write(cursorHitPos);
419 action_data.
m_Target.GetObject().GetActionComponentNameList(action_data.
m_Target.GetComponentIndex(), selectionNames);
420 for (
int s = 0; s < selectionNames.Count(); s++)
422 proxyBoneIdx = entParent.GetBoneIndex(selectionNames[s]);
423 if( proxyBoneIdx > -1 )
430 ctx.
Write(proxyBoneIdx);
431 targetParent = action_data.
m_Target.GetParent();
432 ctx.
Write(targetParent);
433 componentIndex = action_data.
m_Target.GetComponentIndex();
434 ctx.
Write(componentIndex);
435 cursorHitPos = action_data.
m_Target.GetCursorHitPos();
436 ctx.
Write(cursorHitPos);
442 if ( !action_recive_data )
444 action_recive_data =
new ActionReciveData;
446 Object actionTargetObject = null;
447 Object actionTargetParent = null;
448 int componentIndex = -1;
449 int proxyBoneIdx = -1;
457 if ( !ctx.
Read(mainItem) )
463 if ( !ctx.
Read(actionTargetObject) )
466 if ( !ctx.
Read(actionTargetParent))
469 if ( !ctx.
Read(componentIndex) )
472 if ( !ctx.
Read(cursorHitPos) )
475 target =
new ActionTarget(actionTargetObject, actionTargetParent, componentIndex, cursorHitPos, 0);
477 action_recive_data.m_Target = target;
481 if ( !ctx.
Read(proxyBoneIdx) )
484 if ( !ctx.
Read(actionTargetParent))
487 if ( !ctx.
Read(componentIndex) )
490 if ( !ctx.
Read(cursorHitPos) )
494 if ( proxyBoneIdx > -1 )
500 actionTargetObject = entParent.GetBoneObject(proxyBoneIdx);
508 target =
new ActionTarget(actionTargetObject, actionTargetParent, componentIndex, cursorHitPos, 0);
510 action_recive_data.m_Target = target;
513 action_recive_data.m_MainItem = mainItem;
519 action_data.
m_MainItem = action_recive_data.m_MainItem;
523 if (action_recive_data.m_Target)
525 action_data.
m_Target = action_recive_data.m_Target;
529 Error(
"Action target not created.");
576 Debug.
ActionLog(
"Time stamp: " + action_data.
m_Player.GetSimulationTimeStamp(),
this.ToString() ,
"n/a",
"OnStart", action_data.
m_Player.ToString() );
611 action_data.
m_Player.GetActionManager().OnActionEnd();
644 result = !target_player.IsJumpInProgress();
645 result = result && !(target_player.GetCommand_Ladder() || target_player.GetCommand_Vehicle() || target_player.GetCommand_Swim());
654 if ( player.GetCommand_Vehicle() )
659 if ( player.GetCommand_Ladder() )
664 if ( player.IsRestrained() )
669 if ( player.GetCommand_Swim() )
674 if ( player.IsRaised() )
679 if ( player.GetCommand_Move() && player.GetCommand_Move().IsOnBack() )
684 if ( player.GetThrowing().IsThrowingModeEnabled())
689 if (player.IsLeaning())
694 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
712 if ( entity && !target.GetObject().
IsMan() )
714 Man man = entity.GetHierarchyRootPlayer();
715 if ( man && man != player )
733 if (stanceIdx != -1 && !
DayZPlayerUtils.PlayerCanChangeStance(player, stanceIdx ))
744 return Can( player, target, item, condition_mask);
820 targetItem.GetInventory().GetCurrentInventoryLocation(targetInventoryLocation);
821 if ( action_data.
m_Player.GetInventory().HasInventoryReservation( targetItem, targetInventoryLocation) )
835 if (action_data.
m_Player.GetInventory().HasInventoryReservation( action_data.
m_Player.GetItemInHands(), handInventoryLocation))
839 action_data.
m_Player.GetInventory().ClearInventoryReservation(targetItem, targetInventoryLocation);
851 if (targetInventoryLocation)
854 if (handInventoryLocation)
870 action_data.
m_Player.GetInventory().ClearInventoryReservationEx( il.
GetItem() , il );
886 action_data.
m_Player.GetInventory().ExtendInventoryReservationEx(il.
GetItem() , il, 10000);
914 return target.GetObject() && target.GetObject().IsDamageDestroyed();
919 return target.GetObject() && target.GetObject().IsBuilding();
924 return target.GetObject() && target.GetObject().IsTransport();
929 Object obj = target.GetObject();
933 float distanceRoot, distanceHead;
934 vector modelPos, worldPos, playerHeadPos;
937 maxDistance = maxDistance * maxDistance;
940 MiscGameplayFunctions.GetHeadBonePos(player, playerHeadPos);
943 obj.GetActionComponentNameList(target.GetComponentIndex(), componentNames);
944 foreach (
string componentName : componentNames)
946 if (componentName.Contains(
"doorstwin"))
949 modelPos = obj.GetSelectionPositionMS(componentName);
950 worldPos = obj.ModelToWorld(modelPos);
958 return distanceRoot <= maxDistance || distanceHead <= maxDistance;
967 if (
GetGame().IsServer() && player )
999 if ( !
GetGame().IsDedicatedServer() )
1019 action_data.
m_Player.PlacingCancelLocal();
void OnUpdateServer(float deltatime, float blood_scale, bool no_blood_loss)
const int AC_UNCATEGORIZED
ActionData CreateActionData()
protected bool HasProneException()
protected ActionInput m_Input
void OnUpdateClient(ActionData action_data)
bool InventoryReservation(ActionData action_data)
bool CanBeSetFromInventory()
protected ref ActionVariantManager m_VariantManager
class ActionData m_RefreshReservationTimerValue
ActionVariantManager GetVariantManager()
void CreateConditionComponents()
protected ref Param1< string > m_MessageParam
float GetSpecialtyWeight()
void OnEndServer(ActionData action_data)
void SendMessageToClient(Object reciever, string message)
void ApplyModifiers(ActionData action_data)
protected float m_SpecialtyWeight
void OnEndInput(ActionData action_data)
protected bool CanContinue(ActionData action_data)
static int ComputeConditionMask(PlayerBase player, ActionTarget target, ItemBase item)
protected bool m_LockTargetOnUse
bool IsUsingProxies()
not using plane object - it's using multiple proxies
string GetSoundCategory(ActionData action_data)
enum ActionConditionMask m_MainItem
bool MainItemAlwaysInHands()
void OnStartClient(ActionData action_data)
bool CanBeUsedWithBrokenLegs()
void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
void RefreshReservations(ActionData action_data)
bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
ref CCIBase m_ConditionItem
protected bool IsTransport(ActionTarget target)
void OnStartServer(ActionData action_data)
ref CCTBase m_ConditionTarget
SoundOnVehicle PlayActionSound(PlayerBase player)
void SetVariantID(int ID)
void UpdateVariants(Object item, Object target, int componet_index)
bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
void ClearInventoryReservationEx(ActionData action_data)
void SetInput(ActionInput ai)
void OnEndRequest(ActionData action_data)
void EndInput(ActionData action_data)
bool CanBePerformedFromQuickbar()
bool RemoveForceTargetAfterUse()
bool CanReceiveAction(ActionTarget target)
protected bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
protected bool IsBuilding(ActionTarget target)
int GetRefreshReservationTimerValue()
protected bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
protected ref TStringArray m_Sounds
protected int m_VariantID
string GetAdminLogMessage(ActionData action_data)
float GetProgress(ActionData action_data)
bool HasProgress()
For UI: hiding of progress bar.
void ActionCleanup(ActionData action_data)
void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
bool CanBeUsedInRestrain()
protected bool IsDamageDestroyed(ActionTarget target)
bool CanBePerformedFromInventory()
bool IsDeploymentAction()
Is an action directly related to deployment/advanced placing.
bool CanBeUsedInVehicle()
protected bool m_FullBody
protected int m_StanceMask
Object GetDisplayInteractObject(PlayerBase player, ActionTarget target)
protected bool ActionConditionContinue(ActionData action_data)
void OnEndClient(ActionData action_data)
ref ActionTarget m_Target
protected void InformPlayers(PlayerBase player, ActionTarget target, int state)
DEPRECATED delivers message ids to clients based on given context.
int GetVariants(out array< ref ActionBase > variants)
void EndRequest(ActionData action_data)
bool Post_SetupAction(ActionData action_data)
class ActionTargets ActionTarget
private void DayZPlayerUtils()
cannot be instantiated
void Start()
Plays all elements this effects consists of.
int GetID()
Get the ID registered in SEffectManager.
protected void SetID(int id)
Set the ID registered in SEffectManager.
void End()
called on surrender end request end
void ReadFromContext(ParamsReadContext ctx)
void WriteToContext(ParamsWriteContext ctx)
int m_RefreshReservationTimer
ref array< ref InventoryLocation > m_ReservedInventoryLocations
int m_RefreshJunctureTimer
ref CABase m_ActionComponent
ref ActionTarget m_Target
int GetActions(out array< ref ActionBase > variants_action)
void UpdateVariants(Object item, Object target, int componet_index)
bool CanContinue(PlayerBase player, ItemBase item)
bool Can(PlayerBase player, ItemBase item)
bool CanContinue(PlayerBase player, ActionTarget target)
bool Can(PlayerBase player, ActionTarget target)
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
Super root of all classes in Enforce script.
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
script counterpart to engine's class Inventory
const int c_InventoryReservationTimeoutMS
reservations
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
proto native EntityAI GetItem()
returns item of current inventory location
static string DumpToStringNullSafe(InventoryLocation loc)
static bool IsActionLogEnable()
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Serialization general interface. Serializer API works with:
proto bool Write(void value_out)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
array< string > TStringArray
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
proto native int GetState()
returns one of STATE_...