Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл BleedingSource.c

См. исходные тексты.

Перечисления

enum  eBleedingSourceType { NORMAL , CONTAMINATED }
 

Функции

void BleedingSource (PlayerBase player, int bit, string bone, vector orientation, vector offset, int max_time, float flow_modifier, string particle_name)
 
void ~BleedingSource ()
 
void SetType (eBleedingSourceType type)
 
eBleedingSourceType GetType ()
 
int GetActiveTime ()
 
void SetActiveTime (int time)
 
int GetBit ()
 
void CreateParticle ()
 
void RemoveParticle ()
 
void OnUpdateServer (float deltatime, float blood_scale, bool no_blood_loss)
 
void StartSourceBleedingIndication ()
 
void StopSourceBleedingIndication (bool instant=false)
 
void DrawDebugShape ()
 
void RemoveDebugShape ()
 

Переменные

enum eBleedingSourceType m_Position
 
Particle m_BloodParticle
 
PlayerBase m_Player
 
int m_Bit
 
string m_Bone
 
ref EffectParticle m_BleedingEffect
 
vector m_Orientation
 
Shape m_DebugShape
 
Shape m_DebugShape1
 
ref Timer m_DebugTick
 
vector m_Offset
 
float m_FlowModifier
 
float m_ActiveTime
 
float m_MaxTime
 
string m_ParticleName
 
bool m_DeleteRequested
 
eBleedingSourceType m_Type = eBleedingSourceType.NORMAL
 

Перечисления

◆ eBleedingSourceType

Элементы перечислений
NORMAL 
CONTAMINATED 
2{
3 NORMAL,
5}
@ CONTAMINATED
Definition BleedingSource.c:4
@ NORMAL
Definition BleedingSource.c:3

Функции

◆ BleedingSource()

void BleedingSource ( PlayerBase player,
int bit,
string bone,
vector orientation,
vector offset,
int max_time,
float flow_modifier,
string particle_name )
28 {
29 //m_Position = position;
31 m_Bit = bit;
32 m_Bone = bone;
38
39 //CreateBleedSymptom();
40 if (!GetGame().IsDedicatedServer())
41 {
44
45 }
46 }
void StartSourceBleedingIndication()
Definition BleedingSource.c:145
PlayerBase m_Player
Definition BleedingSource.c:11
vector m_Offset
Definition BleedingSource.c:19
float m_FlowModifier
Definition BleedingSource.c:20
void CreateParticle()
Definition BleedingSource.c:83
string m_Bone
Definition BleedingSource.c:13
vector m_Orientation
Definition BleedingSource.c:15
float m_MaxTime
Definition BleedingSource.c:22
int m_Bit
Definition BleedingSource.c:12
string m_ParticleName
Definition BleedingSource.c:23
Definition EntityAI.c:95
proto native CGame GetGame()

Перекрестные ссылки CreateParticle(), GetGame(), m_Bit, m_Bone, m_FlowModifier, m_MaxTime, m_Offset, m_Orientation, m_ParticleName, m_Player и StartSourceBleedingIndication().

Используется в BleedingSourcesManagerBase::AddBleedingSource().

◆ CreateParticle()

void CreateParticle ( )
84 {
85 int boneIdx = m_Player.GetBoneIndexByName(m_Bone);
88 {
90 m_BloodParticle = m_BleedingEffect.GetParticle();
91 m_BloodParticle.SetOrientation(m_Orientation);
92 vector pos;
93 pos += m_Offset;
94 m_BloodParticle.SetPosition(pos);
95 float time = Math.RandomFloat01() * 2;
96 //time = time;
98 //m_BloodParticle.SetParameter(1, EmitorParam.CURRENT_TIME, time);
99
101 return;
102 }
103 else
104 {
105 Error("bleeding source: failed to spawn the particle: "+m_ParticleName);
106 }
107 }
ref EffectParticle m_BleedingEffect
Definition BleedingSource.c:14
Particle m_BloodParticle
Definition BleedingSource.c:10
Wrapper class for managing particles through SEffectManager.
Definition EffectParticle.c:5
Definition EnMath.c:7
void SetParameter(int emitter, int parameter, float value)
Set the value of a parameter of an emitor in the particle.
Definition Particle.c:625
Manager class for managing Effect (EffectParticle, EffectSound)
Definition EffectManager.c:6
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
Definition EffectManager.c:43
Definition EnConvert.c:106
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:126
EmitorParam
Definition EnVisual.c:114
proto native ToType()
Returns internal type representation. Can be used in runtime, or cached in variables and used for fas...

Перекрестные ссылки Error(), m_BleedingEffect, m_BloodParticle, m_Bone, m_Offset, m_Orientation, m_ParticleName, m_Player, SEffectManager::PlayInWorld(), Math::RandomFloat01(), Particle::SetParameter() и string::ToType().

Используется в BleedingSource(), CreateInWorld(), ParticleSource::CreateInWorld(), CreateOnObject(), ParticleSource::CreateOnObject(), ParticleSource::PlayInWorld(), PlayInWorldEx(), PlayOnObject() и ParticleSource::PlayOnObject().

◆ DrawDebugShape()

void DrawDebugShape ( )
172 {
174
175 Particle p = m_BleedingEffect.GetParticle();
176 vector pos = p.GetPosition();
177 m_DebugShape = Debug.DrawSphere(pos, 0.009, COLOR_BLUE, ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE|ShapeFlags.NOZBUFFER);
178 vector arrow_to = m_BloodParticle.GetOrientation();
179 arrow_to = arrow_to.AnglesToVector();
180 arrow_to = -arrow_to * 0.3;
181 arrow_to = pos + arrow_to;
182
184 }
void RemoveDebugShape()
Definition BleedingSource.c:186
Shape m_DebugShape
Definition BleedingSource.c:16
Shape m_DebugShape1
Definition BleedingSource.c:17
Definition Debug.c:14
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
Definition Debug.c:562
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
Definition Debug.c:485
Legacy way of using particles in the game.
Definition Particle.c:7
const int COLOR_BLUE
Definition constants.c:66
const int COLOR_GREEN
Definition constants.c:65
ShapeFlags
Definition EnDebug.c:126

Перекрестные ссылки COLOR_BLUE, COLOR_GREEN, Debug::DrawArrow(), Debug::DrawSphere(), m_BleedingEffect, m_BloodParticle, m_DebugShape, m_DebugShape1 и RemoveDebugShape().

◆ GetActiveTime()

int GetActiveTime ( )
69 {
70 return m_ActiveTime;
71 }
float m_ActiveTime
Definition BleedingSource.c:21

Перекрестные ссылки m_ActiveTime.

◆ GetBit()

int GetBit ( )
79 {
80 return m_Bit;
81 }

Перекрестные ссылки m_Bit.

Используется в OnUpdateServer().

◆ GetType()

eBleedingSourceType GetType ( )
64 {
65 return m_Type;
66 }
eBleedingSourceType m_Type
Definition BleedingSource.c:25

Перекрестные ссылки m_Type.

Используется в Ammo_40mm_Smoke_ColorBase::Activate(), ItemBase::BatteryCharger(), EntityAI::Building(), InventoryItem::CanBeCombined(), Container_Base::CanPutInCargo(), BaseBuildingBase::CanReceiveAttachment(), ItemBase::ChangeInfestation(), Chemlight_ColorBase::Chemlight_ColorBase(), Chemlight_ColorBase::CreateLight(), RecipeBase::Do(), InventoryItemSuper::EEHealthLevelChanged(), CarWheel_Ruined::EEHealthLevelChanged(), EEInit(), Inventory_Base::EmptySeedPack(), Entity::EntityAI(), Entity::GetDefaultHitComponent(), Entity::GetDefaultHitPosition(), Entity::GetDefaultHitPositionComponent(), InventoryItem::GetDryingIncrement(), ItemBase::GetEnergyNeededToCharge(), IEntity::GetHiddenSelections(), IEntity::GetHiddenSelectionsMaterials(), IEntity::GetHiddenSelectionsTextures(), Entity::GetHitComponentForAI(), ManBase::GetItemOnSlot(), IEntity::GetModelName(), InventoryItem::GetMuzzleID(), ActionTargetsCursor::GetOnScreenPosition(), InventoryItem::GetProtectionLevel(), PluginRecipesManagerBase::GetRecipeIntersection(), InventoryItem::GetSoakingIncrement(), Entity::GetSuitableFinisherHitComponents(), ItemBase::GetTimeNeededToCharge(), IEntity::HasAnimation(), InventoryItem::HasFoodStage(), ItemBase::HideAllAnimationsAndProxyPhysics(), Entity::HideAllSelections(), ManBase::HideHairSelections(), Hologram::Hologram(), AlarmClock_ColorBase::Init(), KitchenTimer::Init(), FlammableBase::Init(), ItemOptics::Init2DPreloadType(), ItemOptics::InitCameraOverrideProperties(), Entity::InitDamageZoneDisplayNameMapping(), ItemOptics::InitDOFAvailability(), Weapon::InitDOFProperties(), ItemOptics::InitOpticsDOFProperties(), ItemOptics::InitOpticsPP(), ItemOptics::InitReddotData(), Weapon::InitReliability(), IEntity::KindOf(), InventoryItem::KindOf(), Land_Bilboard_Base::Land_Bilboard_Base(), Weapon::LoadCurrentFSMState(), InventoryItem::LoadParticleConfigOnFire(), InventoryItem::LoadParticleConfigOnOverheating(), LockOvenAttachments(), Entity::Log(), Entity::LogError(), Entity::LogWarning(), Entity::OnAction(), ItemBase::OnInitEnergy(), InventoryItem::OnRightClick(), Ammo_40mm_Smoke_ColorBase::OnVariablesSynchronized(), OnWorkStart(), ItemBase::PlantBase(), InventoryItem::PlayAttachSound(), Weapon::SaveCurrentFSMState(), ItemBase::SetFuel(), Entity::ShowAllSelections(), PluginRecipesManagerBase::SortIngredientsInRecipe(), InventoryItem::SplitIntoStackMax(), InventoryItem::SplitIntoStackMaxHands(), InventoryItem::SplitItem(), InventoryItem::SplitItemToInventoryLocation(), VicinityObjects::TransformToVicinityObjects() и FlammableBase::TryTransformIntoStick().

◆ OnUpdateServer()

void OnUpdateServer ( float deltatime,
float blood_scale,
bool no_blood_loss )
115 {
117
118 if (m_ActiveTime >= m_MaxTime)
119 {
120 if (m_Player.GetBleedingManagerServer() && !m_DeleteRequested)
121 {
122 m_Player.GetBleedingManagerServer().RequestDeletion(GetBit());//add yourself to a list of sources to be deleted
123 m_DeleteRequested = true;
124 }
125 }
126 if ( !no_blood_loss )
127 {
128 float flow = m_FlowModifier;
129 switch ( m_Type )
130 {
131 case eBleedingSourceType.NORMAL:
132 {
133 //do nothing
134 break;
135 }
136 case eBleedingSourceType.CONTAMINATED:
137 {
139 }
140 }
141 m_Player.AddHealth("GlobalHealth","Blood", (PlayerConstants.BLEEDING_SOURCE_BLOODLOSS_PER_SEC * blood_scale * deltatime * flow) );
142 }
143 }
int GetBit()
Definition BleedingSource.c:78
bool m_DeleteRequested
Definition BleedingSource.c:24
eBleedingSourceType
Definition BleedingSource.c:2
Definition PlayerConstants.c:2
static const float BLEEDING_SOURCE_BURN_MODIFIER
Definition PlayerConstants.c:166
static const float BLEEDING_SOURCE_BLOODLOSS_PER_SEC
Definition PlayerConstants.c:157

Перекрестные ссылки PlayerConstants::BLEEDING_SOURCE_BLOODLOSS_PER_SEC, PlayerConstants::BLEEDING_SOURCE_BURN_MODIFIER, GetBit(), m_ActiveTime, m_DeleteRequested, m_FlowModifier, m_MaxTime, m_Player и m_Type.

◆ RemoveDebugShape()

void RemoveDebugShape ( )
187 {
188 if (m_DebugShape)
189 {
191 }
192
193 if (m_DebugShape1)
194 {
196 }
197 }
static void RemoveShape(out Shape shape)
Definition Debug.c:110

Перекрестные ссылки m_DebugShape, m_DebugShape1 и Debug::RemoveShape().

Используется в DrawDebugShape() и ~BleedingSource().

◆ RemoveParticle()

void RemoveParticle ( )
110 {
112 }
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Definition EffectManager.c:267

Перекрестные ссылки SEffectManager::DestroyEffect() и m_BleedingEffect.

Используется в ~BleedingSource().

◆ SetActiveTime()

void SetActiveTime ( int time)
74 {
76 }

Перекрестные ссылки m_ActiveTime.

◆ SetType()

void SetType ( eBleedingSourceType type)
59 {
60 m_Type = type;
61 }

Перекрестные ссылки m_Type.

◆ StartSourceBleedingIndication()

void StartSourceBleedingIndication ( )
146 {
147 if (m_Player.IsControlledPlayer())
148 {
149 #ifdef DIAG_DEVELOPER
151 {
152 #endif
154 GetGame().GetMission().GetEffectWidgets().AddActiveEffects({EffectWidgetsTypes.BLEEDING_LAYER});
155 GetGame().GetMission().GetEffectWidgets().UpdateWidgets(EffectWidgetsTypes.BLEEDING_LAYER,0,par);
156 #ifdef DIAG_DEVELOPER
157 }
158 #endif
159 }
160 }
static info (non-constants)
Definition BleedingIndicationStaticInfo.c:3
static bool m_DbgEnableBleedingIndication
Definition BleedingIndicationStaticInfo.c:4

Перекрестные ссылки GetGame(), m_Bit, DbgBleedingIndicationStaticInfo::m_DbgEnableBleedingIndication и m_Player.

Используется в BleedingSource().

◆ StopSourceBleedingIndication()

void StopSourceBleedingIndication ( bool instant = false)
163 {
164 if ( m_Player && m_Player.IsControlledPlayer() && GetGame() && (!GetGame().IsDedicatedServer()) )
165 {
167 GetGame().GetMission().GetEffectWidgets().UpdateWidgets(EffectWidgetsTypes.BLEEDING_LAYER,0,par);
168 }
169 }

Перекрестные ссылки GetGame(), m_Bit и m_Player.

Используется в ~BleedingSource().

◆ ~BleedingSource()

49 {
52
54
56 }
void RemoveParticle()
Definition BleedingSource.c:109
void StopSourceBleedingIndication(bool instant=false)
Definition BleedingSource.c:162

Перекрестные ссылки m_BloodParticle, m_Player, RemoveDebugShape(), RemoveParticle() и StopSourceBleedingIndication().

Переменные

◆ m_ActiveTime

float m_ActiveTime

Используется в GetActiveTime(), OnUpdateServer() и SetActiveTime().

◆ m_Bit

◆ m_BleedingEffect

ref EffectParticle m_BleedingEffect

Используется в CreateParticle(), DrawDebugShape() и RemoveParticle().

◆ m_BloodParticle

Particle m_BloodParticle

Используется в CreateParticle(), DrawDebugShape() и ~BleedingSource().

◆ m_Bone

string m_Bone

Используется в BleedingSource() и CreateParticle().

◆ m_DebugShape

Shape m_DebugShape

Используется в DrawDebugShape() и RemoveDebugShape().

◆ m_DebugShape1

Shape m_DebugShape1

Используется в DrawDebugShape() и RemoveDebugShape().

◆ m_DebugTick

ref Timer m_DebugTick

◆ m_DeleteRequested

bool m_DeleteRequested

Используется в OnUpdateServer().

◆ m_FlowModifier

float m_FlowModifier

Используется в BleedingSource() и OnUpdateServer().

◆ m_MaxTime

float m_MaxTime

Используется в BleedingSource() и OnUpdateServer().

◆ m_Offset

vector m_Offset

◆ m_Orientation

◆ m_ParticleName

string m_ParticleName

Используется в BleedingSource() и CreateParticle().

◆ m_Player

PlayerBase m_Player

◆ m_Position

◆ m_Type