DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
DayZInfected.c
См. документацию.
20
21enum DayZInfectedConstantsMovement
22{
26 MOVEMENTSTATE_SPRINT
27}
28
29enum DayZInfectedDeathAnims
30{
34 ANIM_DEATH_NECKSTAB = 3
35}
36
38{
39 proto native void SetStanceVariation(int pStanceVariation);
40 proto native void SetIdleState(int pIdleState);
41 proto native void StartTurn(float pDirection, int pSpeedType);
42 proto native bool IsTurning();
43}
44
45class DayZInfectedCommandDeath extends AnimCommandBase {}
46
47class DayZInfectedCommandHit extends AnimCommandBase {}
48
49class DayZInfectedCommandAttack extends AnimCommandBase
50{
51 proto native bool WasHit();
52}
53class DayZInfectedCommandVault extends AnimCommandBase
54{
55 proto native bool WasLand();
56}
57
58class DayZInfectedCommandCrawl extends AnimCommandBase {}
59
67class DayZInfectedCommandScript extends AnimCommandBase
68{
70 void DayZInfectedCommandScript(DayZInfected pInfected) {}
71 void ~DayZInfectedCommandScript() {}
72
73 //---------------------------------------------------------------
74 // usable everywhere
75
77 proto native void SetFlagFinished(bool pFinished);
78
79 //---------------------------------------------------------------
80 // PrePhys Update
81
83 proto native bool PrePhys_GetTranslation(out vector pOutTransl); // vec3 in local space !
84 proto native bool PrePhys_GetRotation(out float pOutRot[4]); // quaternion in local space !
85 proto native void PrePhys_SetTranslation(vector pInTransl); // vec3 in local space !
86 proto native void PrePhys_SetRotation(float pInRot[4]); // quaternion in local space !
87
88 //---------------------------------------------------------------
89 // PostPhys Update
90
94 bool PostPhysUpdate(float pDt);
95
97 proto native void PostPhys_GetPosition(out vector pOutTransl);
98 proto native void PostPhys_GetRotation(out float pOutRot[4]);
99 proto native void PostPhys_SetPosition(vector pInTransl);
100 proto native void PostPhys_SetRotation(float pInRot[4]);
101 proto native void PostPhys_LockRotation();
102}
103
104class DayZInfected extends DayZCreatureAI
105{
106 proto native DayZInfectedType GetDayZInfectedType();
107 proto native DayZInfectedInputController GetInputController();
108 proto native DayZInfectedCommandMove StartCommand_Move();
109 proto native DayZInfectedCommandVault StartCommand_Vault(int pType);
110 proto native void StartCommand_Death(int pType, float pDirection);
111 proto native void StartCommand_Hit(bool pHeavy, int pType, float pDirection);
112 proto native DayZInfectedCommandAttack StartCommand_Attack(EntityAI pTarget, int pType, float pSubtype);
113 proto native void StartCommand_Crawl(int pType);
114
115 proto native bool CanAttackToPosition(vector pTargetPosition);
116
117 proto native DayZInfectedCommandMove GetCommand_Move();
118 proto native DayZInfectedCommandVault GetCommand_Vault();
119 proto native DayZInfectedCommandAttack GetCommand_Attack();
120
122 proto native DayZInfectedCommandScript StartCommand_Script(DayZInfectedCommandScript pInfectedCommand);
123 proto native DayZInfectedCommandScript StartCommand_ScriptInst(typename pCallbackClass);
124 proto native DayZInfectedCommandScript GetCommand_Script();
125
127 proto native void GetTransformWS(out vector pTm[4]);
128
129 const float LEG_CRIPPLE_THRESHOLD = 74.0;
130
131 bool m_HeavyHitOverride;
132
133 //-------------------------------------------------------------
134 void DayZInfected();
135 void ~DayZInfected();
136
137 //-------------------------------------------------------------
138 override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
139 {
140 super.EEHitBy(damageResult, damageType, source, component, dmgZone, ammo, modelPos, speedCoef);
141
142 int transferShockToDamageCoef = g_Game.ConfigGetInt(string.Format("%1 %2 DamageApplied transferShockToDamage", CFG_AMMO, ammo));
143 if (transferShockToDamageCoef == 1)
144 {
145 float damage = damageResult.GetDamage(dmgZone, "Shock");
146 HandleSpecialZoneDamage(dmgZone, damage);
147 AddHealth("", "Health", -ConvertNonlethalDamage(damage, damageType));
148 }
149
150 if (!IsAlive())
151 {
152 if (!m_DeathSyncSent) //to be sent only once on hit/death
153 {
154 Man killer = source.GetHierarchyRootPlayer();
155
156 if (!m_KillerData) //only one player is considered killer in the event of crossfire
157 {
158 m_KillerData = new KillerData();
159 m_KillerData.m_Killer = killer;
160 m_KillerData.m_MurderWeapon = source;
161 }
162
163 if (killer && killer.IsPlayer())
164 {
165 // was infected killed by headshot?
166 if (dmgZone == "Head") //no "Brain" damage zone defined (nor can it be caught like on player, due to missing command handler), "Head" is sufficient
167 {
168 m_KilledByHeadshot = true;
169 if (m_KillerData.m_Killer == killer)
170 m_KillerData.m_KillerHiTheBrain = true;
171 }
172 }
173
174 SyncEvents.SendEntityKilled(this, m_KillerData.m_Killer, m_KillerData.m_MurderWeapon, m_KillerData.m_KillerHiTheBrain);
175 m_DeathSyncSent = true;
176 }
177 }
178 }
179
180 override protected float ConvertNonlethalDamage(float damage, DamageType damageType)
181 {
182 switch (damageType)
183 {
184 case DamageType.CLOSE_COMBAT:
185 return damage * GameConstants.NL_DAMAGE_CLOSECOMBAT_CONVERSION_INFECTED;
186 case DamageType.FIRE_ARM:
187 return damage * GameConstants.NL_DAMAGE_FIREARM_CONVERSION_INFECTED;
188 }
189
190 return super.ConvertNonlethalDamage(damage, damageType);
191 }
192
193 void HandleSpecialZoneDamage(string dmgZone, float damage)
194 {
195 if (damage < LEG_CRIPPLE_THRESHOLD)
196 return;
197
198 if (dmgZone == "LeftLeg" || dmgZone == "RightLeg")
199 SetHealth(dmgZone,"Health",0.0);
200
201 if (dmgZone == "Torso" || dmgZone == "Head")
202 m_HeavyHitOverride = true;
203 }
204
205 override int GetHideIconMask()
206 {
207 return EInventoryIconVisibility.HIDE_VICINITY;
208 }
209}
class LogManager EntityAI
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
proto native void PrePhys_SetRotation(float pInRot[4])
bool PostPhysUpdate(float pDt)
class DayZCreatureAI extends DayZCreature COMMANDID_ATTACK
proto native void PostPhys_SetPosition(vector pInTransl)
quaternion in world space
class DayZCreatureAI extends DayZCreature COMMANDID_HIT
class DayZAnimalCommandMove extends AnimCommandBase SetFlagFinished(bool pFinished)
DayZAnimalCommandScript fully scriptable command.
proto native bool PrePhys_GetRotation(out float pOutRot[4])
proto native void PostPhys_GetRotation(out float pOutRot[4])
vec3 in world space
proto native bool PrePhys_GetTranslation(out vector pOutTransl)
script function usable in PrePhysUpdate
proto native void PostPhys_SetRotation(float pInRot[4])
vec3 in world space
proto native void PrePhys_SetTranslation(vector pInTransl)
proto native void PostPhys_LockRotation()
quaternion in world space
proto native void PostPhys_GetPosition(out vector pOutTransl)
script function usable in PostPhysUpdate
DayZGame g_Game
Определения DayZGame.c:4074
enum DayZInfectedConstants ANIM_DEATH_BACKSTAB
enum DayZInfectedConstants ANIM_DEATH_DEFAULT
enum DayZInfectedConstants MOVEMENTSTATE_WALK
enum DayZInfectedConstants ANIM_DEATH_IMPULSE
enum DayZInfectedConstants MOVEMENTSTATE_IDLE
DayZInfectedConstants
Определения DayZInfected.c:2
@ MINDSTATE_COWER
Определения DayZInfected.c:18
@ MINDSTATE_CHASE
Определения DayZInfected.c:16
@ MINDSTATE_CALM
mind states
Определения DayZInfected.c:13
@ MINDSTATE_DISTURBED
Определения DayZInfected.c:14
@ COMMANDID_VAULT
Определения DayZInfected.c:5
@ COMMANDID_CRAWL
Определения DayZInfected.c:9
@ MINDSTATE_ALERTED
Определения DayZInfected.c:15
@ MINDSTATE_FIGHT
Определения DayZInfected.c:17
enum DayZInfectedConstants MOVEMENTSTATE_RUN
override int GetHideIconMask()
Определения EffectManager.c:769
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
base class of all commands exposed to script to provide common functionality over animations
Определения AnimCommand.c:3
do not process rotations !
Определения DayZAnimal.c:656
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
Определения ZombieBase.c:981
Определения ZombieBase.c:2
proto native float GetDamage(string zoneName, string healthType)
@ COMMANDID_MOVE
Определения dayzplayer.c:696
@ COMMANDID_SCRIPT
Определения dayzplayer.c:708
@ COMMANDID_DEATH
Определения dayzplayer.c:701
const string CFG_AMMO
Определения 3_Game/DayZ/constants.c:231
proto native bool WasHit()
is true only once after hit event