DayZ 1.24
Loading...
Searching...
No Matches
BroomBase Class Reference
Inheritance diagram for BroomBase:
[legend]
Collaboration diagram for BroomBase:
[legend]

Private Member Functions

override void Init ()
 
override void SetActions ()
 
override bool CanReceiveUpgrade ()
 
override void OnWorkStart ()
 
override void ApplyResultModifications (ItemBase result)
 
override bool CanTransformIntoStick ()
 
override void EEHitBy (TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
 
override void CalculateQuantity ()
 
override void UpdateParticle ()
 
void DebugSetHealthAndEnergy (float time)
 
override void GetDebugActions (out TSelectableActionInfoArrayEx outputList)
 
override bool OnAction (int action_id, Man player, ParamsReadContext ctx)
 
- Private Member Functions inherited from FlammableBase
override void DeferredInit ()
 
void Init ()
 
override void EEInit ()
 
override vector GetUniversalTemperatureSourcePosition ()
 
override void EEDelete (EntityAI parent)
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool CanPutInCargo (EntityAI parent)
 
override bool CanReleaseAttachment (EntityAI attachment)
 
override bool CanRemoveFromCargo (EntityAI parent)
 
override bool CanPutAsAttachment (EntityAI parent)
 
bool CanBeTakenAsCargo ()
 
override bool IsIgnited ()
 
override bool CanIgniteItem (EntityAI ignite_target=NULL)
 
override bool HasFlammableMaterial ()
 
override bool CanBeIgnitedBy (EntityAI igniter=NULL)
 
bool IsRagDryEnough (ItemBase rag)
 
void UpdateCheckForReceivingUpgrade ()
 
override void OnIgnitedThis (EntityAI fire_source)
 
override void OnSwitchOn ()
 
override void OnSwitchOff ()
 
void SetTorchDecraftResult (string type)
 
bool ConsumeRag ()
 
void ConsumeLard (Lard lard)
 
void Upgrade (ItemBase source)
 
void ConsumeFuelFromBottle (ItemBase vessel)
 
void ConsumeFuelFromGasStation ()
 
void RuinRags ()
 
override void OnInventoryExit (Man player)
 
bool StandUp ()
 
void CalculateQuantity ()
 
bool CanReceiveUpgrade ()
 
void CraftingInit (float quantity)
 
override void EEItemAttached (EntityAI item, string slot_name)
 
override void EEItemDetached (EntityAI item, string slot_name)
 
bool CanTransformIntoStick ()
 
void TryTransformIntoStick ()
 
override void OnWorkStart ()
 
void StopAllParticles ()
 
Rag GetRag ()
 
void LockRags (bool do_lock)
 
void UpdateLight ()
 
override void OnItemInHandsPlayerSwimStart (PlayerBase player)
 
override void OnWork (float consumed_energy)
 
string GetSoundName ()
 
void UpdateParticle ()
 
override void OnWorkStop ()
 
override int GetMeleeMode ()
 
override int GetMeleeHeavyMode ()
 
override int GetMeleeSprintMode ()
 
override void SetActions ()
 
override void OnAttachmentQuantityChangedEx (ItemBase item, float delta)
 
override bool DisassembleOnLastDetach ()
 
override void OnDebugSpawn ()
 
int GetRagQuantity ()
 
string GetBurningMaterial ()
 
string GetBurntMaterial ()
 
void UpdateMaterial ()
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
void ApplyResultModifications (ItemBase result)
 

Additional Inherited Members

- Private Attributes inherited from FlammableBase
ref UniversalTemperatureSource m_UTSource
 
ref UniversalTemperatureSourceSettings m_UTSSettings
 
ref UniversalTemperatureSourceLambdaConstant m_UTSLConstant
 

Detailed Description

Definition at line 1 of file Broom.c.

Member Function Documentation

◆ ApplyResultModifications()

override void BroomBase::ApplyResultModifications ( ItemBase result)
inlineprivate

Definition at line 29 of file Broom.c.

30 {
31 result.SetHealth(result.GetHealthLevelValue(2, ""));
32 result.SetQuantity(1);
33 }

◆ CalculateQuantity()

override void BroomBase::CalculateQuantity ( )
inlineprivate

Definition at line 52 of file Broom.c.

53 {
54 if (GetGame().IsServer())
55 {
56 float currentHealth01 = GetHealth01();
57 float currentEnergy01 = GetCompEM().GetEnergy0To1();
58
59 //Health needs to copy internal energy, but only if that means it will be going down from its current value(the item can't heal itself after obtaining damage just because it has full internal energy)
60 SetHealth01("", "", Math.Min(currentHealth01, currentEnergy01));
61 //Energy needs to copy health, but only if it is higher(in 01 terms) than health, that means if an item with full energy gets damaged and lit, the internal energy needs to be adjusted to follow the health. Situations where internal energy is lower than health are handled on the line above
62 GetCompEM().SetEnergy0To1(GetHealth01());
63 }
64 }
Definition EnMath.c:7
proto native CGame GetGame()
static proto float Min(float x, float y)
Returns smaller of two given values.

References GetGame(), and Math::Min().

Referenced by OnWorkStart().

◆ CanReceiveUpgrade()

override bool BroomBase::CanReceiveUpgrade ( )
inlineprivate

Definition at line 18 of file Broom.c.

19 {
20 return false;
21 }

◆ CanTransformIntoStick()

override bool BroomBase::CanTransformIntoStick ( )
inlineprivate

Definition at line 35 of file Broom.c.

36 {
37 if (GetGame().IsServer() && !IsIgnited() && GetEnergy() < 1 && !IsSetForDeletion())
38 return true;
39 else
40 return false;
41 }
float GetEnergy()
Definition ItemBase.c:8140
override bool IsIgnited()
Definition Torch.c:129

References GetEnergy(), GetGame(), and FlammableBase::IsIgnited().

◆ DebugSetHealthAndEnergy()

void BroomBase::DebugSetHealthAndEnergy ( float time)
inlineprivate

Definition at line 83 of file Broom.c.

84 {
85 float max_energy = GetCompEM().GetEnergyMaxPristine();
87 SetHealth01("", "", health01);
88 GetCompEM().SetEnergy(time);
89 }
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

References Math::InverseLerp().

Referenced by OnAction().

◆ EEHitBy()

override void BroomBase::EEHitBy ( TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo,
vector modelPos,
float speedCoef )
inlineprivate

Definition at line 44 of file Broom.c.

45 {
47
48 GetCompEM().SetEnergy0To1(GetHealth01("", ""));
49 }
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.

References component.

◆ GetDebugActions()

override void BroomBase::GetDebugActions ( out TSelectableActionInfoArrayEx outputList)
inlineprivate

Definition at line 91 of file Broom.c.

92 {
93 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.BROOM_BURN_VERY_SHORT, "SetBurnTimeTo15Secs", FadeColors.LIGHT_GREY));
94 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.BROOM_BURN_SHORT, "SetBurnTimeTo1Min", FadeColors.LIGHT_GREY));
95 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.BROOM_BURN_MEDIUM, "SetBurnTimeTo10Min", FadeColors.LIGHT_GREY));
96 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.BROOM_BURN_LONG, "SetBurnTimeToMax", FadeColors.LIGHT_GREY));
97 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.LIGHT_GREY));
98
99 super.GetDebugActions(outputList);
100 }
Param4< int, int, string, int > TSelectableActionInfoWithColor
Definition EntityAI.c:97
EActions
Definition EActions.c:2
const int SAT_DEBUG_ACTION
Definition constants.c:424

References SAT_DEBUG_ACTION.

◆ Init()

override void BroomBase::Init ( )
inlineprivate

Definition at line 3 of file Broom.c.

4 {
5 super.Init();
6 m_DecraftResult = "LongWoodenStick";
7 m_ParticleLocalPos = Vector(0, 1.2, 0);
8 }
vector m_ParticleLocalPos
Definition Torch.c:23
string m_DecraftResult
Definition Torch.c:25
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

References FlammableBase::m_DecraftResult, FlammableBase::m_ParticleLocalPos, and Vector().

◆ OnAction()

override bool BroomBase::OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
inlineprivate

Definition at line 102 of file Broom.c.

103 {
104 if (super.OnAction(action_id, player, ctx))
105 return true;
106 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
107 {
108 if (action_id == EActions.BROOM_BURN_VERY_SHORT)
109 {
112 }
113 else if (action_id == EActions.BROOM_BURN_SHORT)
114 {
117 }
118 else if (action_id == EActions.BROOM_BURN_MEDIUM)
119 {
122 }
123 else if (action_id == EActions.BROOM_BURN_LONG)
124 {
125 DebugSetHealthAndEnergy(GetCompEM().GetEnergyMaxPristine());
127 }
128 }
129 return false;
130 }
void DebugSetHealthAndEnergy(float time)
Definition Broom.c:83
override void OnIgnitedThis(EntityAI fire_source)
Definition Torch.c:190

References DebugSetHealthAndEnergy(), GetGame(), and FlammableBase::OnIgnitedThis().

◆ OnWorkStart()

override void BroomBase::OnWorkStart ( )
inlineprivate

Definition at line 23 of file Broom.c.

24 {
25 super.OnWorkStart();
27 }
override void CalculateQuantity()
Definition Broom.c:52

References CalculateQuantity().

◆ SetActions()

override void BroomBase::SetActions ( )
inlineprivate

◆ UpdateParticle()

override void BroomBase::UpdateParticle ( )
inlineprivate

Definition at line 66 of file Broom.c.

67 {
69
70 if (!m_FireParticle)
75 {
76 float scale = Math.Max(normalizedQuant * 2.4, 0.4);
77
79 }
80 }
override float GetQuantity()
Definition ItemBase.c:7995
override int GetQuantityMax()
Definition ItemBase.c:7941
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Particle m_FireParticle
Definition Torch.c:9
void ScaleParticleParamFromOriginal(int parameter_id, float coef)
Scales the given parameter on all emitors relatively to their ORIGINAL value.
Definition Particle.c:646
static const int BROOM_TORCH_T1
static proto float Max(float x, float y)
Returns bigger of two given values.
EmitorParam
Definition EnVisual.c:114

References ParticleList::BROOM_TORCH_T1, GetQuantity(), GetQuantityMax(), FlammableBase::m_FireParticle, FlammableBase::m_ParticleLocalPos, Math::Max(), ParticleManager(), and Particle::ScaleParticleParamFromOriginal().


The documentation for this class was generated from the following file: