DayZ Enforce
Script API
Private Member Functions | Private Attributes | List of all members
PlayerBase Class Reference

#include <PlayerBase.h>

Inheritance diagram for PlayerBase:
ManBase SurvivorBase

Private Member Functions

bool  IsItemInInventory (EntityAI entity)
 
void  SetHologram (Hologram hologram)
 
Hologram  GetHologram ()
 
bool  IsPlacingObject ()
 
void  PlayerBase ()
 
void  ~PlayerBase ()
 
void  EEItemIntoHands ()
 
void  EEItemOutOfHands ()
 
void  EEOnWaterEnter ()
 
bool  IsFacingTarget (Object target)
 
void  OnCheckPlugRange ()
 
void  StartPlugInMode (ItemBase Device)
 
void  StopPlugInMode ()
 
void  RPC (int rpc_type, array< Param > param, Man recipient=NULL)
 
void  OnRPC (int rpc_type, ParamsReadContext ctx)
 
void  OnSynchronize (ParamsWriteContext ctx)
 
void  OnSynchronized (ParamsReadContext ctx)
 
bool  DropItem (ItemBase item)
 
bool  TakeItemToInventory (ItemBase item)
 
bool  TakeItemToHands (ItemBase item)
 
bool  IsPluggingADevice ()
 
void  ActionSetter ()
 
void  GetUserActions ()
 
void  ClearUserActions ()
 
void  ShowHintForUserActions ()
 
void  SetUserActionAnimReadiness (int action, bool state)
 
bool  GetUserActionAnimReadiness (int action)
 
void  OnSingleUse ()
 
void  OnSingleUseFinished ()
 
void  OnContinuous ()
 
void  OnContinuousStart ()
 
void  OnContinuousCancel (float actionTime)
 
void  OnInteract ()
 
void  OnInteractMenu ()
 
void  OnInteractFinished ()
 
void  OnGetActions (ActionMenuContext ctx, Man player)
 
bool  OnAction (int action_id, Man player, ParamsReadContext ctx)
 
void  CalculatePlayerLoad ()
 
void  ChangePlayerLoad (EntityAI attachment, bool decrease)
 
void  AddPlayerLoad (float addedload)
 
float  GetPlayerLoad ()
 
void  SetPlayerLoad (float load)
 
DisplayStatus  GetDisplayStatus ()
 
array< string >  GetFullInventory ()
 
ItemBase  GetPluggedDevice ()
 
ItemBase  GetItemInHands ()
 
ItemBase  SpawnItem (string object_name, int spawn_type, bool full_quantity, float distance=0)
  Spawn item on server side. More...
 
void  SQF_PlayerNotifierAdd (string notifi_name, int notifi_id, float r, float g, float b, float a)
 
void  SQF_PlayerNotifierSend ()
 
void  PlayerNotifierClear ()
 
void  UpdatePlayerNotifier (array< Param > params)
 
void  PlayerNotifiersInit ()
 
void  PlayerNotifiersDelete ()
 
array< PlayerStatBase GetStatsArray ()
 
void  PerformRecipe ()
 
void  SetCrafting (bool state)
 
bool  GetCrafting ()
 
void  SetUpCrafting (int id, Link< EntityAI > item1, Link< EntityAI > item2)
 
ItemBase  CreateInInventory (string item_name, string cargo_type="")
 
ItemBase  CopyInventoryItem (ItemBase orig_item, string cargo_type="")
 
void  Message (string text, string style)
 
void  MessageStatus (string text)
 
void  MessageAction (string text)
 
void  MessageFriendly (string text)
 
void  MessageImportant (string text)
 
void  ClearInventory ()
 
string  GetPlayerClass ()
 
void  ShavePlayer ()
 
int  GetLastShavedSeconds ()
 
void  SetLastShavedSeconds (int last_shaved_seconds)
 
int  GetCachedPlaytime ()
 
void  SetCachedPlaytime (int playtime)
 
bool  GetHasBloodyHands ()
 
void  SetHasBloodyHands (bool has_bloody_hands)
 
void  WashHands ()
 
void  SetSkill (int exp_id, float exp_value)
 
float  GetSkill (int exp_id)
 
float  GetTimeToCompleteEfficiency (int exp_id)
 
float  GetQuantityEfficiency (int exp_id)
 
void  IncreaseSkill (int exp_id, float increase_value=1)
 
void  OnStoreSave (ParamsWriteContext ctx)
 
void  OnStoreLoad (ParamsReadContext ctx)
 
void  OnStoreSaveLifespan (ParamsWriteContext ctx)
 
void  OnStoreLoadLifespan (ParamsReadContext ctx)
 
void  OnSqfPlayerInit ()
 
void  UseActionAnimLoopIn ()
 
void  UseActionAnimLoop ()
 
void  UseActionAnimLoopOut ()
 
void  ImmuneSystemTick (float value)
 
int  GetSingleAgentCount (int agent)
 
void  TransmitAgents (Object object, int pathway)
 
protected void  InsertAgent (int agent, int count=1)
 
protected array< int >  GetAgentsFromSource (Object object)
 
protected int  GetAgentInitValue (int agent)
 
protected int  CalculateAgentsToTransmit (int agent, float protection)
 
protected float  GetProtectionLevel (int type, int slot)
 
protected void  InjectAgents (Object object, array< int > agents, float protection)
 
protected array< int >  GetAgents ()
 
vector  GetAimPosition ()
 

Private Attributes

ItemBase  m_PluggedDevice
 
autoptr Timer  m_CheckDistance
 
private int  m_LastShavedSeconds
 
private int  m_CachedPlaytime
 
private bool  m_HasBloodyHands
 
private ModuleExperience  m_ModuleExperience
 
private ModulePlayerStatus  m_ModulePlayerStatus
 
autoptr PlayerStats  m_PlayerStats
 
autoptr ModifiersManager  m_ModifiersManager
 
autoptr NotifiersManager  m_NotifiersManager
 
autoptr ActionManager  m_ActionManager
 
autoptr AgentManager  m_AgentManager
 
autoptr Environment  m_Environment
 
autoptr DisplayStatus  m_DisplayStatus
 
autoptr TIntArray  m_PrimaryAction_Ids
 
autoptr TIntArray  m_SecondaryAction_Ids
 
autoptr TIntArray  m_TertiaryAction_Ids
 
ActionBase  m_CurrentPrimaryAction
 
ActionBase  m_CurrentSecondaryAction
 
ActionBase  m_CurrentTertiaryAction
 
string  lastcontinuoushint
 
string  lastsingleusehint
 
string  lastinteracthint
 
const int  AT_CRAFTING = 179
 
int  m_CurrentAction
 
bool  m_PrimaryActionSet
 
bool  m_SecondaryActionSet
 
bool  m_TertiaryActionSet
 
bool  m_PrimaryActionAnimReady
 
bool  m_SecondaryActionAnimReady
 
bool  m_TertiaryActionAnimReady
 
float  m_CargoLoad
 
autoptr Timer  m_ActionSetter
 
autoptr Timer  m_ActionTick
 
autoptr Timer  m_Test
 
const int  OPEN_SLOT = 0
 
const int  PRIMARY_ACTION = 1
 
const int  SECONDARY_ACTION = 2
 
const int  TERTIARY_ACTION = 3
 
Hologram  m_Hologram = NULL
 
private autoptr map< int, float >  m_Skills
 
Param3< string, int, bool >  m_MyNotifiers [NTF_COUNT]
 
int  m_RecipeID = -1
 
Link< EntityAI m_Item1
 
Link< EntityAI m_Item2
 
bool  m_Crafting = false
 
protected autoptr array< int >  sourceAgents
 
protected autoptr array< int >  localAgents
 

Constructor & Destructor Documentation

void PlayerBase::PlayerBase ( )
private
void PlayerBase::~PlayerBase ( )
private

Member Function Documentation

bool PlayerBase::IsItemInInventory ( EntityAI  entity )
private
void PlayerBase::SetHologram ( Hologram  hologram )
private
Hologram PlayerBase::GetHologram ( )
private
bool PlayerBase::IsPlacingObject ( )
private
void PlayerBase::EEItemIntoHands ( )
private
void PlayerBase::EEItemOutOfHands ( )
private
void PlayerBase::EEOnWaterEnter ( )
private
bool PlayerBase::IsFacingTarget ( Object  target )
private
void PlayerBase::OnCheckPlugRange ( )
private
void PlayerBase::StartPlugInMode ( ItemBase  Device )
private
void PlayerBase::StopPlugInMode ( )
private

References m_CheckDistance, and m_PluggedDevice.

Referenced by OnCheckPlugRange().

void PlayerBase::RPC ( int  rpc_type,
array< Param param,
Man  recipient = NULL 
)
private

Referenced by SQF_PlayerNotifierSend().

void PlayerBase::OnRPC ( int  rpc_type,
ParamsReadContext  ctx 
)
private
void PlayerBase::OnSynchronize ( ParamsWriteContext  ctx )
private
void PlayerBase::OnSynchronized ( ParamsReadContext  ctx )
private
bool PlayerBase::DropItem ( ItemBase  item )
private
bool PlayerBase::TakeItemToInventory ( ItemBase  item )
private
bool PlayerBase::TakeItemToHands ( ItemBase  item )
private
bool PlayerBase::IsPluggingADevice ( )
private

References m_PluggedDevice.

Referenced by OnCheckPlugRange().

void PlayerBase::ActionSetter ( )
private
void PlayerBase::GetUserActions ( )
private
void PlayerBase::ClearUserActions ( )
private
void PlayerBase::ShowHintForUserActions ( )
private
void PlayerBase::SetUserActionAnimReadiness ( int  action,
bool  state 
)
private
bool PlayerBase::GetUserActionAnimReadiness ( int  action )
private
void PlayerBase::OnSingleUse ( )
private
void PlayerBase::OnSingleUseFinished ( )
private
void PlayerBase::OnContinuous ( )
private
void PlayerBase::OnContinuousStart ( )
private
void PlayerBase::OnContinuousCancel ( float  actionTime )
private
void PlayerBase::OnInteract ( )
private

References OnInteractMenu().

void PlayerBase::OnInteractMenu ( )
private
void PlayerBase::OnInteractFinished ( )
private
void PlayerBase::OnGetActions ( ActionMenuContext  ctx,
Man  player 
)
private
bool PlayerBase::OnAction ( int  action_id,
Man  player,
ParamsReadContext  ctx 
)
private

References GetDayZGame(), and OnInteractMenu().

void PlayerBase::CalculatePlayerLoad ( )
private
void PlayerBase::ChangePlayerLoad ( EntityAI  attachment,
bool  decrease 
)
private
void PlayerBase::AddPlayerLoad ( float  addedload )
private

References GetPlayerLoad(), and SetPlayerLoad().

Referenced by ChangePlayerLoad().

float PlayerBase::GetPlayerLoad ( )
private

References m_CargoLoad.

Referenced by AddPlayerLoad(), and StaminaCalc::OnTick().

void PlayerBase::SetPlayerLoad ( float  load )
private

References m_CargoLoad.

Referenced by AddPlayerLoad(), and CalculatePlayerLoad().

DisplayStatus PlayerBase::GetDisplayStatus ( )
private

References m_DisplayStatus.

Referenced by NotifierBase::GetDisplayStatus(), and OnRPC().

array<string> PlayerBase::GetFullInventory ( )
private
ItemBase PlayerBase::GetPluggedDevice ( )
private

References m_PluggedDevice.

Referenced by OnCheckPlugRange().

ItemBase PlayerBase::GetItemInHands ( )
private
ItemBase PlayerBase::SpawnItem ( string  object_name,
int  spawn_type,
bool  full_quantity,
float  distance = 0 
)
private

Spawn item on server side.

Parameters
object_name string Name of item class
spawn_type (const) Type of spawning const: SPAWNTYPE_GROUND, SPAWNTYPE_HANDS, SPAWNTYPE_INVENTORY
full_quantity Spawn with full quantity of item
distance Distance of spawn position from player (Only if spawn_type = SPAWNTYPE_GROUND)
Returns
ItemBase Spawned item
player.SpawnItem("Fruit_Apple", SPAWNTYPE_GROUND, true, 5);

References CGame::CreateObject(), EntityAI::EntityAI(), ManBase::GetCursorObject(), Object::GetDirection(), GetGame(), Object::GetPosition(), ItemBase::GetQuantityMax(), IsInherited(), CGame::IsKindOf(), Print(), ItemBase::SetQuantity(), SPAWNTYPE_ATTACHMENT, SPAWNTYPE_HANDS, SPAWNTYPE_INVENTORY, EntityAI::TakeEntityAsAttachment(), TakeItemToHands(), TakeItemToInventory(), and Type().

Referenced by CreateInInventory().

void PlayerBase::SQF_PlayerNotifierAdd ( string  notifi_name,
int  notifi_id,
float  r,
float  g,
float  b,
float  a 
)
private

References ARGBF(), GetGame(), and m_MyNotifiers.

void PlayerBase::SQF_PlayerNotifierSend ( )
private
void PlayerBase::PlayerNotifierClear ( )
private
void PlayerBase::UpdatePlayerNotifier ( array< Param params )
private
void PlayerBase::PlayerNotifiersInit ( )
private
void PlayerBase::PlayerNotifiersDelete ( )
private

References m_MyNotifiers, and NTF_COUNT.

Referenced by PlayerNotifiersInit(), and ~PlayerBase().

array< PlayerStatBase > PlayerBase::GetStatsArray ( )
private
void PlayerBase::PerformRecipe ( )
private
void PlayerBase::SetCrafting ( bool  state )
private
bool PlayerBase::GetCrafting ( )
private

References m_Crafting.

Referenced by ActionCraft::CanDo(), and GetUserActions().

void PlayerBase::SetUpCrafting ( int  id,
Link< EntityAI item1,
Link< EntityAI item2 
)
private
ItemBase PlayerBase::CreateInInventory ( string  item_name,
string  cargo_type = "" 
)
private

/brief Creates ItemBase in players inventory. If player dont have enough slots for new item, item will be created on the ground under player.

Parameters
item_name string Class name of ItemBase in configs
Returns
ItemBase Created item
ItemBase item = g_Game.GetPlayer().CreateInInventory("Consumable_GardenLime", "cargo_weapon");

References SpawnItem(), and SPAWNTYPE_INVENTORY.

Referenced by CopyInventoryItem(), TempCrafting::CraftFireplace(), PileOfWoodenPlanks::OnAction(), ActionCoverHeadTarget::OnComplete(), ActionCoverHeadSelf::OnComplete(), ActionPickBerry::OnComplete(), ActionOnTargetContinuousMine::OnTick(), EN5C_FishingRod_Base::Pulling(), BaseBuildingBase::ReceiveRemainingMaterials(), and ModuleSkinning::SkinComplete().

ItemBase PlayerBase::CopyInventoryItem ( ItemBase  orig_item,
string  cargo_type = "" 
)
private

/brief Creates copy of ItemBase in players inventory. If player dont have enough slots for new item, item will be created on the ground under player.

Parameters
item_name string Class name of ItemBase in configs
Returns
ItemBase Created item
ItemBase item = g_Game.GetPlayer().CreateInInventory("Consumable_GardenLime", "cargo_weapon");

References CreateInInventory(), ItemBase::GetQuantity(), and ItemBase::SetQuantity().

Referenced by ItemBase::QuantitySplit().

void PlayerBase::Message ( string  text,
string  style 
)
private
void PlayerBase::MessageStatus ( string  text )
private
void PlayerBase::MessageAction ( string  text )
private
void PlayerBase::MessageFriendly ( string  text )
private
void PlayerBase::MessageImportant ( string  text )
private
void PlayerBase::ClearInventory ( )
private

/brief Delete all items in inventory

Returns
void
player.ClearInventory();

References EntityAI::FindAttachment(), Man::GetEntityInHands(), GetGame(), EntityAI::GetSlotsCount(), and CGame::ObjectDelete().

string PlayerBase::GetPlayerClass ( )
private
void PlayerBase::ShavePlayer ( )
private
int PlayerBase::GetLastShavedSeconds ( )
private
void PlayerBase::SetLastShavedSeconds ( int  last_shaved_seconds )
private
int PlayerBase::GetCachedPlaytime ( )
private
void PlayerBase::SetCachedPlaytime ( int  playtime )
private
bool PlayerBase::GetHasBloodyHands ( )
private

References m_HasBloodyHands.

void PlayerBase::SetHasBloodyHands ( bool  has_bloody_hands )
private
void PlayerBase::WashHands ( )
private
void PlayerBase::SetSkill ( int  exp_id,
float  exp_value 
)
private

References m_Skills.

Referenced by OnStoreLoadLifespan(), and ModuleExperience::Store().

float PlayerBase::GetSkill ( int  exp_id )
private

References m_Skills.

Referenced by ModuleExperience::GetExpPoints().

float PlayerBase::GetTimeToCompleteEfficiency ( int  exp_id )
private
float PlayerBase::GetQuantityEfficiency ( int  exp_id )
private
void PlayerBase::IncreaseSkill ( int  exp_id,
float  increase_value = 1 
)
private
void PlayerBase::OnStoreSave ( ParamsWriteContext  ctx )
private
void PlayerBase::OnStoreLoad ( ParamsReadContext  ctx )
private
void PlayerBase::OnStoreSaveLifespan ( ParamsWriteContext  ctx )
private
void PlayerBase::OnStoreLoadLifespan ( ParamsReadContext  ctx )
private
void PlayerBase::OnSqfPlayerInit ( )
private
void PlayerBase::UseActionAnimLoopIn ( )
private
void PlayerBase::UseActionAnimLoop ( )
private
void PlayerBase::UseActionAnimLoopOut ( )
private
void PlayerBase::ImmuneSystemTick ( float  value )
private
int PlayerBase::GetSingleAgentCount ( int  agent )
private
void PlayerBase::TransmitAgents ( Object  object,
int  pathway 
)
private
void PlayerBase::InsertAgent ( int  agent,
int  count = 1 
)
private
array< int > PlayerBase::GetAgentsFromSource ( Object  object )
private
int PlayerBase::GetAgentInitValue ( int  agent )
private
int PlayerBase::CalculateAgentsToTransmit ( int  agent,
float  protection 
)
private
float PlayerBase::GetProtectionLevel ( int  type,
int  slot 
)
private
void PlayerBase::InjectAgents ( Object  object,
array< int >  agents,
float  protection 
)
private
array< int > PlayerBase::GetAgents ( )
private
vector PlayerBase::GetAimPosition ( )
private

Member Data Documentation

ItemBase PlayerBase::m_PluggedDevice
private
autoptr Timer PlayerBase::m_CheckDistance
private
private int PlayerBase::m_LastShavedSeconds
private
private int PlayerBase::m_CachedPlaytime
private
private bool PlayerBase::m_HasBloodyHands
private
private ModuleExperience PlayerBase::m_ModuleExperience
private
private ModulePlayerStatus PlayerBase::m_ModulePlayerStatus
private
autoptr PlayerStats PlayerBase::m_PlayerStats
private
autoptr ModifiersManager PlayerBase::m_ModifiersManager
private
autoptr NotifiersManager PlayerBase::m_NotifiersManager
private
autoptr ActionManager PlayerBase::m_ActionManager
private
autoptr AgentManager PlayerBase::m_AgentManager
private
autoptr Environment PlayerBase::m_Environment
private
autoptr DisplayStatus PlayerBase::m_DisplayStatus
private

Referenced by GetDisplayStatus(), and PlayerBase().

autoptr TIntArray PlayerBase::m_PrimaryAction_Ids
private
autoptr TIntArray PlayerBase::m_SecondaryAction_Ids
private
autoptr TIntArray PlayerBase::m_TertiaryAction_Ids
private
ActionBase PlayerBase::m_CurrentPrimaryAction
private
ActionBase PlayerBase::m_CurrentSecondaryAction
private
ActionBase PlayerBase::m_CurrentTertiaryAction
private
string PlayerBase::lastcontinuoushint
private
string PlayerBase::lastsingleusehint
private
string PlayerBase::lastinteracthint
private
const int PlayerBase::AT_CRAFTING = 179
private

Referenced by GetUserActions().

int PlayerBase::m_CurrentAction
private
bool PlayerBase::m_PrimaryActionSet
private
bool PlayerBase::m_SecondaryActionSet
private

Referenced by OnSingleUse(), and OnSingleUseFinished().

bool PlayerBase::m_TertiaryActionSet
private
bool PlayerBase::m_PrimaryActionAnimReady
private
bool PlayerBase::m_SecondaryActionAnimReady
private
bool PlayerBase::m_TertiaryActionAnimReady
private
float PlayerBase::m_CargoLoad
private
autoptr Timer PlayerBase::m_ActionSetter
private

Referenced by PlayerBase().

autoptr Timer PlayerBase::m_ActionTick
private
autoptr Timer PlayerBase::m_Test
private
const int PlayerBase::OPEN_SLOT = 0
private
const int PlayerBase::PRIMARY_ACTION = 1
private
const int PlayerBase::SECONDARY_ACTION = 2
private
const int PlayerBase::TERTIARY_ACTION = 3
private
Hologram PlayerBase::m_Hologram = NULL
private
private autoptr map<int, float> PlayerBase::m_Skills
private
Param3<string, int, bool> PlayerBase::m_MyNotifiers[NTF_COUNT]
private
int PlayerBase::m_RecipeID = -1
private

Referenced by PerformRecipe(), and SetUpCrafting().

Link<EntityAI> PlayerBase::m_Item1
private
Link<EntityAI> PlayerBase::m_Item2
private
bool PlayerBase::m_Crafting = false
private
protected autoptr array<int> PlayerBase::sourceAgents
private

Referenced by PlayerBase(), and TransmitAgents().

protected autoptr array<int> PlayerBase::localAgents
private

Referenced by PlayerBase(), and TransmitAgents().


The documentation for this class was generated from the following files:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)