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

Private Member Functions

float GetEfficiency0To1 ()
 Returns efficiency. The value is synchronized from server to all clients and is accurate down to 0.1 units.
 
float GetEfficiencyDecayStart ()
 Returns efficiency. The value is synchronized from server to all clients and is accurate down to 0.1 units.
 
override void OnEnergyConsumed ()
 
override void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
 
void Chemlight_ColorBase ()
 
void CreateLight ()
 
override void OnWorkStart ()
 
override void OnInventoryExit (Man player)
 
void StandUp ()
 
override void OnWorkStop ()
 
override void OnWork (float consumed_energy)
 
override void SetActions ()
 
string GetMaterialForDamageState (bool glowing, int healthLevel=-1)
 
- Private Member Functions inherited from ItemBase
void BarbedWire ()
 
void ~BarbedWire ()
 
override void EEInit ()
 
bool IsMounted ()
 
bool GetSlotLockedState ()
 
void SetMountedState (bool is_mounted)
 
void UpdateAttachmentSlot ()
 
void LockAttachmentSlot (bool lock_state)
 
void Synchronize ()
 
override void OnVariablesSynchronized ()
 
void PlayDeployLoopSound ()
 
void StopDeployLoopSound ()
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void AfterStoreLoad ()
 
override void OnWorkStart ()
 
override void OnWorkStop ()
 
override void OnWork (float consumed_energy)
 
override void OnIsPlugged (EntityAI source_device)
 
override void OnIsUnplugged (EntityAI last_energy_source)
 
override void OnInventoryEnter (Man player)
 
void CreateElectrifiedDamageTrigger ()
 
void CreateDamageTrigger ()
 
void DestroyDamageTrigger ()
 
void Spark ()
 
void SoundCut ()
 
void SoundSpark ()
 
void SoundBuzzLoopStart ()
 
void SoundBuzzLoopStop ()
 
void SoundElectricShock ()
 
void SoundCollision ()
 
override void PreAreaDamageActions ()
 
override void PostAreaDamageActions ()
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
override string GetDeploySoundset ()
 
override string GetLoopDeploySoundset ()
 
override void SetActions ()
 
void BaseBuildingBase ()
 
override void EEDelete (EntityAI parent)
 
override string GetInvulnerabilityTypeString ()
 
override bool CanObstruct ()
 
override int GetHideIconMask ()
 
void SynchronizeBaseState ()
 
override void OnVariablesSynchronized ()
 
void OnSynchronizedClient ()
 
void RegisterPartForSync (int part_id)
 
void UnregisterPartForSync (int part_id)
 
bool IsPartBuildInSyncData (int part_id)
 
void RegisterActionForSync (int part_id, int action_id)
 
void ResetActionSyncData ()
 
void SetActionFromSyncData ()
 
void SetPartFromSyncData (ConstructionPart part)
 
void SetPartsFromSyncData ()
 
ConstructionPart GetConstructionPartById (int id)
 
bool HasBase ()
 
void SetBaseState (bool has_base)
 
override bool IsDeployable ()
 
bool IsOpened ()
 
ItemBase CreateConstructionKit ()
 
void CreateConstructionKitInHands (notnull PlayerBase player)
 
vector GetKitSpawnPosition ()
 
string GetConstructionKitType ()
 
void DestroyConstructionKit (ItemBase construction_kit)
 
void DestroyConstruction ()
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void AfterStoreLoad ()
 
void SetPartsAfterStoreLoad ()
 
override void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
 
override void EEOnAfterLoad ()
 
override void EEInit ()
 
override void EEItemAttached (EntityAI item, string slot_name)
 
override void EEItemDetached (EntityAI item, string slot_name)
 
void OnSetSlotLock (int slotId, bool locked, bool was_locked)
 
override bool IgnoreOutOfReachCondition ()
 
void OnPartBuiltServer (notnull Man player, string part_name, int action_id)
 
void OnPartBuiltClient (string part_name, int action_id)
 
void OnPartDismantledServer (notnull Man player, string part_name, int action_id)
 
void OnPartDismantledClient (string part_name, int action_id)
 
void OnPartDestroyedServer (Man player, string part_name, int action_id, bool destroyed_by_connected_part=false)
 
void OnPartDestroyedClient (string part_name, int action_id)
 
void InitBaseState ()
 
void InitVisuals ()
 
void UpdateVisuals ()
 
void UpdateAttachmentVisuals (string slot_name, bool is_locked)
 
void UpdatePhysics ()
 
void UpdateAttachmentPhysics (string slot_name, bool is_locked)
 
void UpdateNavmesh ()
 
override bool CanUseConstruction ()
 
override bool CanUseConstructionBuild ()
 
bool IsAttachmentSlotLocked (EntityAI attachment)
 
bool IsAttachmentSlotLocked (string slot_name)
 
void GetAttachmentSlots (EntityAI entity, out array< string > attachment_slots)
 
bool CheckSlotVerticalDistance (int slot_id, PlayerBase player)
 
bool CheckMemoryPointVerticalDistance (float max_dist, string selection, PlayerBase player)
 
bool CheckLevelVerticalDistance (float max_dist, string selection, PlayerBase player)
 
void ConstructionInit ()
 
Construction GetConstruction ()
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
bool HasAttachmentsBesidesBase ()
 
override bool ShowZonesHealth ()
 
override bool CanPutInCargo (EntityAI parent)
 
override bool CanRemoveFromCargo (EntityAI parent)
 
override bool CanPutIntoHands (EntityAI parent)
 
override bool IsFacingPlayer (PlayerBase player, string selection)
 
override bool IsPlayerInside (PlayerBase player, string selection)
 
bool MustBeBuiltFromOutside ()
 Some buildings can only be built from outside.
 
bool IsFacingCamera (string selection)
 
bool PerformRoofCheckForBase (string partName, PlayerBase player, out bool result)
 
bool HasProperDistance (string selection, PlayerBase player)
 
bool CanFoldBaseBuildingObject ()
 
ItemBase FoldBaseBuildingObject ()
 
void CreateAreaDamage (string slot_name, float rotation_angle=0)
 
void CalcDamageAreaRotation (float angle_deg, out vector center, out vector orientation)
 
void DestroyAreaDamage (string slot_name)
 
override bool IsIgnoredByConstruction ()
 
void SoundBuildStart (string part_name)
 
void SoundDismantleStart (string part_name)
 
void SoundDestroyStart (string part_name)
 
string GetBuildSoundByMaterial (string part_name)
 
string GetDismantleSoundByMaterial (string part_name)
 
void CheckForHybridAttachments (EntityAI item, string slot_name)
 
override int GetDamageSystemVersionChange ()
 
override void SetActions ()
 
void DebugCustomState ()
 
array< stringOnDebugSpawnBuildExcludes ()
 Excludes certain parts from being built by OnDebugSpawn, uses Contains to compare.
 
override void OnDebugSpawn ()
 
void FullyBuild ()
 
void BatteryCharger ()
 
override bool IsElectricAppliance ()
 
override void OnWork (float consumed_energy)
 
override void OnWorkStart ()
 
override void OnWorkStop ()
 
void UpdateStatusLights ()
 
override bool CanPutInCargo (EntityAI parent)
 
override bool CanPutIntoHands (EntityAI player)
 
override void OnOwnSocketTaken (EntityAI device)
 
override void OnOwnSocketReleased (EntityAI device)
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool CanLoadAttachment (EntityAI attachment)
 
void HideAttachedClipsStates ()
 
void RedLightOn ()
 
void GreenLightOn ()
 
void YellowLightOn ()
 
void SwitchLightOn ()
 
void RedLightOff ()
 
void GreenLightOff ()
 
void YellowLightOff ()
 
void SwitchLightOff ()
 
override void OnSwitchOn ()
 
override void OnSwitchOff ()
 
override void OnInventoryExit (Man player)
 
override void OnInventoryEnter (Man player)
 
override void OnVariablesSynchronized ()
 
override void RefreshPhysics ()
 
override void OnPlacementStarted (Man player)
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
override bool IsDeployable ()
 
override string GetPlaceSoundset ()
 
override void SetActions ()
 
override void OnWorkStart ()
 
override void OnWorkStop ()
 
void RefreshFlameVisual (bool working=false)
 
void SoundBurningStart ()
 
void SoundBurningStop ()
 
override bool CanPutInCargo (EntityAI parent)
 
override bool CanRemoveFromCargo (EntityAI parent)
 
override bool IsIgnited ()
 
override void OnIgnitedTarget (EntityAI ignited_item)
 
override bool CanIgniteItem (EntityAI ignite_target=NULL)
 
override void SetActions ()
 
EntityAI GetGasCanister ()
 
bool HasEnoughEnergyForRepair (float pTime)
 
override void OnDebugSpawn ()
 
void KitBase ()
 
void ~KitBase ()
 
override bool IsBasebuildingKit ()
 
override bool HasProxyParts ()
 
override bool CanProxyObstruct ()
 
override void OnVariablesSynchronized ()
 
override void EEInit ()
 
override bool DisassembleOnLastDetach ()
 
override void EEItemDetached (EntityAI item, string slot_name)
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override void OnEndPlacement ()
 
override void OnPlacementCancelled (Man player)
 
override bool IsDeployable ()
 
override bool CanAssignAttachmentsToQuickbar ()
 
override string GetDeploySoundset ()
 
override string GetLoopDeploySoundset ()
 
override string GetDeployFinishSoundset ()
 
override void RefreshPhysics ()
 
void UpdateVisuals ()
 
void UpdatePhysics ()
 
void PlayDeployLoopSound ()
 
void StopDeployLoopSound ()
 
void AssembleKit ()
 
void DisassembleKit (ItemBase item)
 
void CreateRope (Rope rope)
 
override void SetActions ()
 
void Paper ()
 
void ~Paper ()
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override WrittenNoteData GetWrittenNoteData ()
 
override bool HasFlammableMaterial ()
 
override bool CanBeIgnitedBy (EntityAI igniter=null)
 
override bool CanIgniteItem (EntityAI ignite_target=null)
 
override void OnIgnitedTarget (EntityAI ignited_item)
 
override void OnIgnitedThis (EntityAI fire_source)
 
override bool IsThisIgnitionSuccessful (EntityAI item_source=null)
 
override void SetActions ()
 
void ParticleTest ()
 
override void EEDelete (EntityAI parent)
 
override void OnSwitchOn ()
 
override void OnSwitchOff ()
 
override void OnWorkStart ()
 
override void OnWorkStop ()
 
void SoundBurningStart ()
 
void SoundBurningStop ()
 
void SoundTurnOn ()
 
void SoundTurnOff ()
 
override void SetActions ()
 
ItemBase GetCookingEquipment ()
 
void SetCookingEquipment (ItemBase equipment)
 
void ClearCookingEquipment (ItemBase pItem)
 
void DestroyFireplace ()
 
override void EEInit ()
 
override void EEItemAttached (EntityAI item, string slot_name)
 
override void EEItemDetached (EntityAI item, string slot_name)
 
override void OnSwitchOn ()
 
override void OnSwitchOff ()
 
override void OnWorkStart ()
 
override void OnWorkStop ()
 
override void OnWork (float consumed_energy)
 
void CookWithEquipment ()
 
void RefreshFlameVisual (bool working=false, bool hasAttachment=false)
 
void RemoveCookingAudioVisuals ()
 
void SoundBurningStart ()
 
void SoundBurningStop ()
 
void SoundTurnOn ()
 
void SoundTurnOff ()
 
override bool CanPutInCargo (EntityAI parent)
 
override bool CanRemoveFromCargo (EntityAI parent)
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool CanLoadAttachment (EntityAI attachment)
 
override bool CanPutIntoHands (EntityAI parent)
 
override bool IsIgnited ()
 
override bool CanIgniteItem (EntityAI ignite_target=NULL)
 
override void SetActions ()
 
override void OnDebugSpawn ()
 
void PowerGeneratorBase ()
 
void ~PowerGeneratorBase ()
 
override void EEInit ()
 
override void EOnInit (IEntity other, int extra)
 
override float GetLiquidThroughputCoef ()
 
void StartLoopSound ()
 
override bool CanPutInCargo (EntityAI parent)
 
override bool CanPutIntoHands (EntityAI player)
 
bool CanManipulate ()
 
override void OnInitEnergy ()
 
override void OnWorkStart ()
 
override void OnWork (float consumed_energy)
 
override void OnWorkStop ()
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override void EEItemAttached (EntityAI item, string slot_name)
 
override void EEItemDetached (EntityAI item, string slot_name)
 
void UpdateFuelMeter ()
 
void SetFuel (float fuel_amount)
 
float AddFuel (float available_fuel)
 
bool CanAddFuel (ItemBase container)
 
float GetFuel ()
 
float GetMaxFuel ()
 
bool HasSparkplug ()
 
override void OnVariablesSynchronized ()
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
override string GetPlaceSoundset ()
 
override void SetActions ()
 
override void OnDebugSpawn ()
 
override void OnWorkStart ()
 
void StartPeriodicMeasurement ()
 
void PrepareMeasurement ()
 
void DoMeasurement ()
 
void StopPeriodicMeasurement ()
 
override void OnWorkStop ()
 
override void SetActions ()
 
void Spotlight ()
 
void ~Spotlight ()
 
override bool IsElectricAppliance ()
 
override void OnInitEnergy ()
 
override void EOnInit (IEntity other, int extra)
 
override void OnSwitchOn ()
 
override void OnSwitchOff ()
 
override void OnWorkStart ()
 
override void OnWorkStop ()
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override void OnIsPlugged (EntityAI source_device)
 
void UpdateAllSelections ()
 
override void OnIsUnplugged (EntityAI last_energy_source)
 
override void OnVariablesSynchronized ()
 
void Fold (bool keep_connected=false)
 
void Unfold ()
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override bool CanPutInCargo (EntityAI parent)
 
override bool CanPutIntoHands (EntityAI player)
 
bool IsFolded ()
 
void SoundTurnOn ()
 
void SoundTurnOff ()
 
override void OnPlacementStarted (Man player)
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
override void OnPlacementCancelled (Man player)
 
override bool IsDeployable ()
 
override string GetDeploySoundset ()
 
override string GetLoopDeploySoundset ()
 
void PlayDeployLoopSound ()
 
void StopDeployLoopSound ()
 
override int GetViewIndex ()
 
override void SetActions ()
 
void TentBase ()
 
void ~TentBase ()
 
override string GetInvulnerabilityTypeString ()
 
override bool HasProxyParts ()
 
override bool CanProxyObstructSelf ()
 prevents showing cargo when outside the tent geometry
 
override bool IsItemTent ()
 
override bool CanBeRepairedByCrafting ()
 
override int GetMeleeTargetType ()
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void RefreshPhysics ()
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override void OnVariablesSynchronized ()
 
override void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
 
void HideAllAnimationsAndProxyPhysics (bool hide_animations=true, bool hide_physics=true)
 
bool ConditionIntoInventory (EntityAI player)
 
override bool CanPutIntoHands (EntityAI parent)
 
override bool CanPutInCargo (EntityAI parent)
 
bool ConditionOutOfHands (EntityAI player)
 
override bool CanBeRepairedToPristine ()
 
void RefreshAttachements ()
 
override void EEItemAttached (EntityAI item, string slot_name)
 
override void EEItemDetached (EntityAI item, string slot_name)
 
override int GetViewIndex ()
 
int GetState ()
 
int GetStateLocal ()
 
bool CanBePacked ()
 
bool CanBeManipulated ()
 
bool CanAttach (ItemBase item)
 
override bool IsIgnoredByConstruction ()
 
void Pack (bool update_navmesh, bool init=false)
 
void Pitch (bool update_navmesh, bool init=false)
 
void TryPitch (bool update_navmesh, bool init=false)
 
void UpdateVisuals ()
 
void UpdatePhysics ()
 
void Refresh ()
 
bool CanToggleAnimations (string selection)
 
void ResetToggle ()
 
void ManipulateEntrance ()
 
void ManipulateWindow ()
 
bool IsManipulatedEntrance ()
 
bool IsManipulatedWindow ()
 
void ToggleAnimation (string selection)
 
void HandleCamoNetAttachment (bool hide)
 
void AnimateCamonetToggle (ToggleAnimations toggle)
 
void AnimateCamonetByOpeningSelection (string opening_selection)
 
string GetSoundOpen ()
 
string GetSoundClose ()
 
string GetSoundOpenWindow ()
 
string GetSoundCloseWindow ()
 
void SoundTentOpenPlay ()
 
void SoundTentClosePlay ()
 
void SoundTentOpenWindowPlay ()
 
void SoundTentCloseWindowPlay ()
 
void RegenerateNavmesh ()
 
bool HasClutterCutter ()
 
string GetClutterCutter ()
 
void DestroyClutterCutter ()
 
override bool IsDeployable ()
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
void PlayDeployLoopSound ()
 
void StopDeployLoopSound ()
 
override void SetActions ()
 
void HandleOpeningsVisuals ()
 
void HandleOpeningsPhysics ()
 
override int GetDamageSystemVersionChange ()
 
override bool CanReceiveItemIntoCargo (EntityAI item)
 
override bool CanLoadItemIntoCargo (EntityAI item)
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool CanLoadAttachment (EntityAI attachment)
 
override bool CanBePlaced (Man player, vector position)
 
void SetIsBeingPacked (bool isBeingPacked)
 
void ToolBase ()
 
int GetDisarmRate ()
 
override void OnRPC (PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
 

Private Attributes

string m_DefaultMaterial
 
string m_GlowMaterial
 
ChemlightLight m_Light
 
int m_Efficiency0To10
 
- Private Attributes inherited from ItemBase
ref array< ref Slotm_Slots
 
int m_SlotFertilityState = 0
 
int m_SlotWateredState = 0
 
int m_MaxWateredStateVal = 0
 
float m_DefaultFertility = 1
 
ref Timer m_CheckRainTimer
 
EffectSound m_DeployLoopSound
 
SoundOnVehicle m_BuzzSoundLoop
 
ref Timer m_SparkEvent
 
ref AreaDamageManager m_AreaDamage
 
bool m_TriggerActive
 
bool m_IsPlaced
 
bool m_IsMounted
 
bool m_LastMountedState
 
const string SOUND_MOUNT = "putDown_BarbedWire_SoundSet"
 
EffectSound m_MountSound
 
EffectSound m_Sound
 
ref map< string, ref AreaDamageManagerm_DamageTriggers
 
ref array< stringm_HybridAttachments
 
ref array< stringm_Mountables
 
const string ATTACHED_CLIPS_STATES [] = {SEL_CLIPS_CAR, SEL_CLIPS_TRUCK}
 
const int ATTACHED_CLIPS_STATES_COUNT = 2
 
int m_BatteryEnergy0To100
 
float m_ChargeEnergyPerSecond
 
ref Timer m_UpdateStatusLightsTimer
 
bool m_BlinkingStatusLightIsOn = false
 
BlowtorchLight m_Light
 
EffectSound m_SoundBurningLoop
 
bool m_DeployedRegularly
 
ref WrittenNoteData m_NoteContents
 
int PARTICLE_PATH
 
Particle m_Particle
 
EffectSound m_SoundTurnOn
 
EffectSound m_SoundTurnOff
 
const string FLAME_BUTANE_ON = "dz\\gear\\cooking\\data\\flame_butane_ca.paa"
 
const string FLAME_BUTANE_OFF = ""
 
 ATTACHMENT_COOKING_POT = Pot
 
 ATTACHMENT_FRYING_PAN = FryingPan
 
 ATTACHMENT_CAULDRON = Cauldron
 
const float PARAM_COOKING_TEMP_THRESHOLD = 100
 
const float PARAM_COOKING_EQUIP_TEMP_INCREASE = 10
 
const float PARAM_COOKING_EQUIP_MAX_TEMP = 250
 
const float PARAM_COOKING_TIME_INC_COEF = 0.5
 
ref UniversalTemperatureSource m_UTSource
 DEPRECATED Attached spark plug item.
 
ref UniversalTemperatureSourceSettings m_UTSSettings
 
ref UniversalTemperatureSourceLambdaConstant m_UTSLConst
 
EffectSound m_EngineLoop
 
EffectSound m_EngineStart
 
EffectSound m_EngineStop
 
ref Timer m_SoundLoopStartTimer
 
Effect m_Smoke
 
ItemBase m_SparkPlug
 
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
 
ref Timer m_Timer
 
int m_State
 
int m_StateLocal = -1
 
bool m_IsEntrance
 
bool m_IsWindow
 
bool m_IsToggle
 
bool m_IsBeingPacked = false
 
int m_OpeningMask = 0
 
int m_OpeningMaskLocal = -1
 
ref map< ref ToggleAnimations, boolm_ToggleAnimations
 
ref array< stringm_ShowAnimationsWhenPitched
 
ref array< stringm_ShowAnimationsWhenPacked
 
Object m_ClutterCutter
 
CamoNet m_CamoNet
 
vector m_HalfExtents
 
int m_MineDisarmRate = 60
 
EntityAI m_Bait
 
bool m_IsActive
 
bool m_IsDeployed
 
bool m_IsInProgress
 
string m_AnimationPhaseSet
 
string m_AnimationPhaseTriggered
 
string m_AnimationPhaseUsed
 
ref array< stringm_PlaceableWaterSurfaceList
 DEPRECATED.
 
bool m_WaterSurfaceForSetup
 
ref multiMap< string, floatm_CatchesPond
 
ref multiMap< string, floatm_CatchesSea
 
ref multiMap< string, floatm_CatchesGroundAnimal
 
ref EffectSound m_DeployLoopSound
 
ref Timer m_PrevTimer
 
bool m_NeedInstalation
 
bool m_BaitNeeded
 
bool m_IsUsable
 

Static Private Attributes

float m_EfficiencyDecayStart = 0.05
 
- Static Private Attributes inherited from ItemBase
const string SEL_CLIPS_CAR = "clips_car_battery"
 
const string SEL_CLIPS_TRUCK = "clips_truck_battery"
 
const string SEL_CLIPS_DETACHED = "clips_detached"
 
const string SEL_CLIPS_FOLDED = "clips_folded"
 
const string SEL_SWITCH_ON = "switch_on"
 
const string SEL_SWITCH_OFF = "switch_off"
 
const string SEL_CORD_PLUGGED = "cord_plugged"
 
const string SEL_CORD_FOLDED = "cord_folded"
 
const string SEL_LIGHT_STATE_1 = "light_stand_by"
 
const string SEL_LIGHT_STATE_2 = "light_charging"
 
const string SEL_LIGHT_STATE_3 = "light_charged"
 
const string RED_LIGHT_GLOW = "dz\\gear\\camping\\data\\battery_charger_light_r.rvmat"
 
const string GREEN_LIGHT_GLOW = "dz\\gear\\camping\\data\\battery_charger_light_g.rvmat"
 
const string YELLOW_LIGHT_GLOW = "dz\\gear\\camping\\data\\battery_charger_light_y.rvmat"
 
const string SWITCH_LIGHT_GLOW = "dz\\gear\\camping\\data\\battery_charger_light_switch_on.rvmat"
 
const string DEFAULT_MATERIAL = "dz\\gear\\camping\\data\\battery_charger.rvmat"
 
float m_BlinkingStatusLightInterval = 0.4
 

Detailed Description

Definition at line 1 of file ChemLight.c.

Constructor & Destructor Documentation

◆ Chemlight_ColorBase()

void Chemlight_ColorBase::Chemlight_ColorBase ( )
inlineprivate

Definition at line 46 of file ChemLight.c.

47 {
48 //materials
49 array<string> config_materials = GetHiddenSelectionsMaterials();
50
51 if (config_materials.Count() == 2)
52 {
55 }
56 else
57 {
58 string error = "Error! Item " + GetType() + " must have 2 entries in config array hiddenSelectionsMaterials[]. One for the default state, the other one for the glowing state. Currently it has " + config_materials.Count() + ".";
59 Error(error);
60 }
61
63 RegisterNetSyncVariableInt("m_Efficiency0To10");
64 }
eBleedingSourceType GetType()
string m_DefaultMaterial
Definition ChemLight.c:3
string m_GlowMaterial
Definition ChemLight.c:4
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), GetType(), m_DefaultMaterial, m_Efficiency0To10, and m_GlowMaterial.

Member Function Documentation

◆ CreateLight()

void Chemlight_ColorBase::CreateLight ( )
inlineprivate

Definition at line 66 of file ChemLight.c.

67 {
68 SetObjectMaterial(0, GetMaterialForDamageState(true)); // must be server side!
69
70 if (!GetGame().IsServer() || !GetGame().IsMultiplayer()) // client side
71 {
72 m_Light = ChemlightLight.Cast(ScriptedLightBase.CreateLight(ChemlightLight, "0 0 0"));
73 m_Light.AttachOnMemoryPoint(this, "light");
74
75 string type = GetType();
76
77 switch (type)
78 {
79 case "Chemlight_White":
80 m_Light.SetColorToWhite();
81 break;
82 case "Chemlight_Red":
83 m_Light.SetColorToRed();
84 break;
85 case "Chemlight_Green":
86 m_Light.SetColorToGreen();
87 break;
88 case "Chemlight_Blue":
89 m_Light.SetColorToBlue();
90 break;
91 case "Chemlight_Yellow":
92 m_Light.SetColorToYellow();
93 break;
94
95 default: { m_Light.SetColorToWhite(); };
96 }
97 }
98 }
string GetMaterialForDamageState(bool glowing, int healthLevel=-1)
Definition ChemLight.c:161
ChemlightLight m_Light
Definition ChemLight.c:6
proto native CGame GetGame()

References GetGame(), GetMaterialForDamageState(), GetType(), and m_Light.

Referenced by OnWork().

◆ EEHealthLevelChanged()

override void Chemlight_ColorBase::EEHealthLevelChanged ( int oldLevel,
int newLevel,
string zone )
inlineprivate

Definition at line 39 of file ChemLight.c.

40 {
41 super.EEHealthLevelChanged(oldLevel, newLevel, zone);
42
43 SetObjectMaterial(0, GetMaterialForDamageState(GetCompEM().IsWorking(), newLevel));
44 }

References GetMaterialForDamageState().

◆ GetEfficiency0To1()

float Chemlight_ColorBase::GetEfficiency0To1 ( )
inlineprivate

Returns efficiency. The value is synchronized from server to all clients and is accurate down to 0.1 units.

Definition at line 12 of file ChemLight.c.

13 {
14 return m_Efficiency0To10 / 10;
15 }

References m_Efficiency0To10.

Referenced by OnWork().

◆ GetEfficiencyDecayStart()

float Chemlight_ColorBase::GetEfficiencyDecayStart ( )
inlineprivate

Returns efficiency. The value is synchronized from server to all clients and is accurate down to 0.1 units.

Definition at line 18 of file ChemLight.c.

19 {
21 }
float m_EfficiencyDecayStart
Definition ChemLight.c:9

References m_EfficiencyDecayStart.

◆ GetMaterialForDamageState()

string Chemlight_ColorBase::GetMaterialForDamageState ( bool glowing,
int healthLevel = -1 )
inlineprivate

Definition at line 161 of file ChemLight.c.

162 {
164 int suffixIndex;
165 string base;
166
167 if (healthLevel == -1)
168 currentHealthLevel = GetHealthLevel();
169 else
171
172 if (glowing)
174 else
176
177 suffixIndex = base.IndexOf(".rvmat");
178 if (suffixIndex == -1)
179 {
180 Error("Error - no valid rvmat found for chemlight");
181 return "";
182 }
183 base = base.Substring(0, suffixIndex);
184
186 base = base + "_damage";
188 base = base + "_destruct";
189
190 return base + ".rvmat";
191 }
const int STATE_RUINED
Definition constants.c:757
const int STATE_DAMAGED
Definition constants.c:759
const int STATE_BADLY_DAMAGED
Definition constants.c:758

References Error(), m_DefaultMaterial, m_GlowMaterial, GameConstants::STATE_BADLY_DAMAGED, GameConstants::STATE_DAMAGED, and GameConstants::STATE_RUINED.

Referenced by CreateLight(), EEHealthLevelChanged(), and OnWorkStop().

◆ OnEnergyConsumed()

override void Chemlight_ColorBase::OnEnergyConsumed ( )
inlineprivate

Definition at line 23 of file ChemLight.c.

24 {
25 super.OnEnergyConsumed();
26
27 if (GetGame().IsServer())
28 {
29 float energy_coef = GetCompEM().GetEnergy0To1();
30
32 {
34 SetSynchDirty();
35 }
36 }
37 }
Definition EnMath.c:7
static proto float Round(float f)
Returns mathematical round of value.

References GetGame(), m_Efficiency0To10, m_EfficiencyDecayStart, and Math::Round().

◆ OnInventoryExit()

override void Chemlight_ColorBase::OnInventoryExit ( Man player)
inlineprivate

Definition at line 106 of file ChemLight.c.

107 {
108 super.OnInventoryExit(player);
109
110 StandUp();
111 }

References StandUp().

◆ OnWork()

override void Chemlight_ColorBase::OnWork ( float consumed_energy)
inlineprivate

Definition at line 139 of file ChemLight.c.

140 {
141 if (!m_Light)
142 CreateLight();
143
144 // Handle fade out of chemlight
145 if (m_Light)
146 {
148
149 if (efficiency < 1)
150 m_Light.SetIntensity(efficiency, GetCompEM().GetUpdateInterval());
151 }
152 }
float GetEfficiency0To1()
Returns efficiency. The value is synchronized from server to all clients and is accurate down to 0....
Definition ChemLight.c:12

References CreateLight(), GetEfficiency0To1(), and m_Light.

◆ OnWorkStart()

override void Chemlight_ColorBase::OnWorkStart ( )
inlineprivate

Definition at line 100 of file ChemLight.c.

101 {
102
103 }

◆ OnWorkStop()

override void Chemlight_ColorBase::OnWorkStop ( )
inlineprivate

Definition at line 122 of file ChemLight.c.

123 {
124 SetObjectMaterial(0, GetMaterialForDamageState(false));
125
126 if (m_Light)
127 m_Light.FadeOut();
128
129 if (GetGame().IsServer())
130 {
131 //Safeguard if item is turned off by another event than running out of energy
132 if (GetCompEM().GetEnergy() > 0)
133 return;
134
135 SetHealth(0);
136 }
137 }
float GetEnergy()
Definition ItemBase.c:8140

References GetEnergy(), GetGame(), GetMaterialForDamageState(), and m_Light.

◆ SetActions()

override void Chemlight_ColorBase::SetActions ( )
inlineprivate

Definition at line 154 of file ChemLight.c.

155 {
156 super.SetActions();
157
159 }
void AddAction(typename actionName)

References AddAction().

◆ StandUp()

void Chemlight_ColorBase::StandUp ( )
inlineprivate

Definition at line 113 of file ChemLight.c.

114 {
115 if (GetGame().IsServer() && GetCompEM().IsWorking())
116 {
117 vector ori_rotate = "0 0 0";
118 SetOrientation(ori_rotate);
119 }
120 }

References GetGame().

Referenced by OnInventoryExit().

Member Data Documentation

◆ m_DefaultMaterial

string Chemlight_ColorBase::m_DefaultMaterial
private

Definition at line 3 of file ChemLight.c.

Referenced by Chemlight_ColorBase(), and GetMaterialForDamageState().

◆ m_Efficiency0To10

int Chemlight_ColorBase::m_Efficiency0To10
private

Definition at line 8 of file ChemLight.c.

Referenced by Chemlight_ColorBase(), GetEfficiency0To1(), and OnEnergyConsumed().

◆ m_EfficiencyDecayStart

float Chemlight_ColorBase::m_EfficiencyDecayStart = 0.05
staticprivate

Definition at line 9 of file ChemLight.c.

Referenced by GetEfficiencyDecayStart(), and OnEnergyConsumed().

◆ m_GlowMaterial

string Chemlight_ColorBase::m_GlowMaterial
private

Definition at line 4 of file ChemLight.c.

Referenced by Chemlight_ColorBase(), and GetMaterialForDamageState().

◆ m_Light

ChemlightLight Chemlight_ColorBase::m_Light
private

Definition at line 6 of file ChemLight.c.

Referenced by CreateLight(), OnWork(), and OnWorkStop().


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