25 super.OnEnergyConsumed();
29 float energy_coef = GetCompEM().GetEnergy0To1();
31 if ( energy_coef < m_EfficiencyDecayStart && m_EfficiencyDecayStart > 0 )
41 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
49 array<string> config_materials = GetHiddenSelectionsMaterials();
51 if (config_materials.Count() == 2)
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() +
".";
63 RegisterNetSyncVariableInt(
"m_Efficiency0To10");
73 m_Light.AttachOnMemoryPoint(
this,
"light");
79 case "Chemlight_White":
85 case "Chemlight_Green":
88 case "Chemlight_Blue":
91 case "Chemlight_Yellow":
95 default: {
m_Light.SetColorToWhite(); };
108 super.OnInventoryExit(player);
115 if (
GetGame().IsServer() && GetCompEM().IsWorking() )
117 vector ori_rotate =
"0 0 0";
118 SetOrientation(ori_rotate);
141 override void OnWork (
float consumed_energy)
151 if ( efficiency < 1 )
153 m_Light.SetIntensity( efficiency, GetCompEM().GetUpdateInterval() );
167 int currentHealthLevel;
171 if (healthLevel == -1)
172 currentHealthLevel = GetHealthLevel();
174 currentHealthLevel = healthLevel;
181 suffixIndex = base.
IndexOf(
".rvmat");
182 if (suffixIndex == -1)
184 Error(
"Error - no valid rvmat found for chemlight");
191 base = base +
"_damage";
195 base = base +
"_destruct";
198 return base +
".rvmat";
eBleedingSourceType GetType()
void AddAction(typename actionName)
void Chemlight_ColorBase()
override void OnWork(float consumed_energy)
override void OnWorkStop()
string GetMaterialForDamageState(bool glowing, int healthLevel=-1)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
float m_EfficiencyDecayStart
float GetEfficiencyDecayStart()
Returns efficiency. The value is synchronized from server to all clients and is accurate down to 0....
override void SetActions()
override void OnInventoryExit(Man player)
override void OnEnergyConsumed()
float GetEfficiency0To1()
Returns efficiency. The value is synchronized from server to all clients and is accurate down to 0....
override void OnWorkStart()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
const int STATE_BADLY_DAMAGED
static proto float Round(float f)
Returns mathematical round of value.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto native int IndexOf(string sample)
Finds 'sample' in 'str'. Returns -1 when not found.