DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionCreateIndoorFireplace
+ Граф наследования:ActionCreateIndoorFireplace:

Закрытые члены

void ActionCreateIndoorFireplace ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 
override void OnExecuteClient (ActionData action_data)
 
override bool IsLockTargetOnUse ()
 

Подробное описание

Конструктор(ы)

◆ ActionCreateIndoorFireplace()

void ActionCreateIndoorFireplace ( )
inlineprivate
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
8 m_Text = "#place_object";
9 }
string m_Text
Definition ActionBase.c:58
float m_SpecialtyWeight
Definition ActionBase.c:77
int m_StanceMask
Definition ActionBase.c:62
int m_CommandUID
Definition AnimatedActionBase.c:143
Definition EntityAI.c:95
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CommandUID, ActionBase::m_SpecialtyWeight, ActionBase::m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
18 {
19 if ( !target ) return false;
20
21 Object target_object = target.GetObject();
22 string action_selection = target_object.GetActionComponentName( target.GetComponentIndex() );
24
25 if ( target_object && building && action_selection.Contains( FireplaceIndoor.FIREPOINT_ACTION_SELECTION ) )
26 {
27 if ( !IsInReach(player, target, UAMaxDistances.DEFAULT) ) return false;
28
30 int fire_point_index = FireplaceIndoor.GetFirePointIndex( action_selection );
31 if ( FireplaceIndoor.CanPlaceFireplaceInSelectedSpot( building, fire_point_index, fire_point_pos_world, fire_point_rot_world ) )
32 {
33 float rot_deg = 0.0;
34 if ( building.HasSelection( FireplaceIndoor.FIREPOINT_PLACE_ROT + fire_point_index.ToString() ) )
35 {
37 diff[1] = 0.0;
38 diff.Normalize();
39 float dotp = vector.Dot( "0 0 1" , diff );
41 if ( ( diff[0] < 0 ) && ( diff[2] < 0 ) )
42 rot_deg = 360.0 - rot_deg;
43 else if ( ( diff[0] < 0 ) && ( diff[2] > 0 ) )
44 rot_deg = 360.0 - rot_deg;
45
46 //Debug.DrawArrow( fire_point_pos_world, fire_point_pos_world + diff );
47 }
48
50 if ( fire_point_dist <= 2 )
51 {
52 player.SetLastFirePoint( fire_point_pos_world );
53 player.SetLastFirePointIndex( fire_point_index );
54 player.SetLastFirePointRot( rot_deg );
55 return true;
56 }
57 }
58 }
59
60 return false;
61 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:1054
Definition BuildingWithFireplace.c:2
Definition EnMath.c:7
Definition ObjectTyped.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108
Definition EnConvert.c:106
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
static proto float Acos(float c)
Returns angle in radians from cosinus.
static const float RAD2DEG
Definition EnMath.c:16

Перекрестные ссылки Math::Acos(), UAMaxDistances::DEFAULT, vector::Distance(), vector::Dot(), ActionBase::IsInReach() и Math::RAD2DEG.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
12 {
15 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINonRuined.c:2
Definition CCTCursor.c:2

Перекрестные ссылки ActionBase::m_ConditionItem и ActionBase::m_ConditionTarget.

◆ IsLockTargetOnUse()

override bool IsLockTargetOnUse ( )
inlineprivate
102 {
103 return false;
104 }

◆ OnExecuteClient()

override void OnExecuteClient ( ActionData action_data)
inlineprivate
97 {
99 }
void ClearInventoryReservationEx(ActionData action_data)
Definition ActionBase.c:921

Перекрестные ссылки ActionBase::ClearInventoryReservationEx().

◆ OnExecuteServer()

override void OnExecuteServer ( ActionData action_data)
inlineprivate
64 {
65 Object obj = GetGame().CreateObjectEx( "FireplaceIndoor", action_data.m_Player.GetLastFirePoint(), ECE_PLACE_ON_SURFACE );
66
67 int m_FirePointIndex = action_data.m_Player.GetLastFirePointIndex();
68 float m_FireplaceRot = action_data.m_Player.GetLastFirePointRot();
69 vector smoke_point_pos = action_data.m_Target.GetObject().GetSelectionPositionMS( FireplaceIndoor.FIREPOINT_SMOKE_POSITION + m_FirePointIndex.ToString() );
70 vector smoke_point_pos_world = action_data.m_Target.GetObject().ModelToWorld( smoke_point_pos );
72
73 FireplaceIndoor fp_indoor = FireplaceIndoor.Cast( obj );
74 if ( fp_indoor )
75 {
76 fp_indoor.SetFirePointIndex( m_FirePointIndex );
77 fp_indoor.SetSmokePointPosition( m_SmokePosition );
78
81 fp_indoor.SetOrientation( fprot );
82
83 fp_indoor.Synchronize();
84
85 //move item to target fireplace
86 if (!GetGame().IsMultiplayer())
87 {
89 action_data.m_Player.LocalTakeEntityToTargetAttachment(fp_indoor, action_data.m_MainItem);
90 }
91 else
92 action_data.m_Player.ServerTakeEntityToTargetAttachment(fp_indoor, action_data.m_MainItem);
93 }
94 }
ActionPlaceFireplaceIndoor m_FirePointIndex
vector m_SmokePosition
Definition ActionPlaceFireplaceIndoor.c:84
float m_FireplaceRot
Definition ActionPlaceFireplaceIndoor.c:83
const int ECE_PLACE_ON_SURFACE
Definition CentralEconomy.c:37
static const vector Zero
Definition EnConvert.c:110
proto native CGame GetGame()

Перекрестные ссылки ActionBase::ClearInventoryReservationEx(), ECE_PLACE_ON_SURFACE, GetGame(), m_FireplaceRot, m_FirePointIndex, m_SmokePosition и vector::Zero.


Объявления и описания членов класса находятся в файле: