Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
filteringbottle.c
Go to the documentation of this file.
2{
3 const float DAMAGE_CONSUME_PER_ML = 0.01;
4 const float DAMAGE_OVERHEAT_PER_S = 1;
7 const float DAMAGE_ENVIRO_TEMPDIFF_MIN = 80; //min damage at this demperature diff
8 const float DAMAGE_ENVIRO_TEMPDIFF_MAX = 10; //maximum damage at this demperature diff
9
10 override string GetPouringSoundset()
11 {
12 return "emptyVessle_WaterBottle_SoundSet";
13 }
14
16 {
17 return "pour_HardGround_WatterBottle_SoundSet";
18 }
19
21 {
22 return "pour_SoftGround_WatterBottle_SoundSet";
23 }
24
26 {
27 return "pour_Water_WatterBottle_SoundSet";
28 }
29
31 {
32 return "pour_End_HardGround_WatterBottle_SoundSet";
33 }
34
36 {
37 return "pour_End_SoftGround_WatterBottle_SoundSet";
38 }
39
41 {
42 return "pour_End_Water_WatterBottle_SoundSet";
43 }
44
45 override bool CanPutInCargo( EntityAI parent )
46 {
47 if( !super.CanPutInCargo(parent) ) {return false;}
48 if ( parent && (parent.IsKindOf("WatterBottle"))/* && !(parent.IsKindOf("Container_Base"))*/)
49 {
50 return false;
51 }
52
53 return true;
54 }
55
56 override bool IsOpen()
57 {
58 return true;
59 }
60
61 override int FilterAgents(int agentsIn)
62 {
63 int agentsOut = agentsIn & (~eAgents.HEAVYMETAL) & (~eAgents.CHOLERA);
64
65 return agentsOut;
66 }
67
68 override void OnConsume(float amount, PlayerBase consumer)
69 {
70 super.OnConsume(amount,consumer);
71
72 DamageBottleConsume(amount,consumer);
73 }
74
75 protected void DamageBottleConsume(float amount, PlayerBase consumer)
76 {
77 DecreaseHealth(amount * DAMAGE_CONSUME_PER_ML,false);
78 }
79
80 override void AffectLiquidContainerOnFill(int liquid_type, float amount)
81 {
82 float liquidTemperature = g_Game.GetMission().GetWorldData().GetLiquidTypeEnviroTemperature(liquid_type);
83 if (liquidTemperature >= GetTemperatureMax())
84 {
85 float temperatureDiff = liquidTemperature - GetTemperature();
88 float damageVal = GetMaxHealth("","Health") / GetQuantityMax();
89 DecreaseHealth(amount * damageVal * temperatureDiffCoef,false);
90 }
91 }
92
93 override void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
94 {
95 //does damage if receiving scalding liquid
96 if (sourceLiquidTemperature >= GetItemOverheatThreshold())
97 {
98 float temperatureDiff = sourceLiquidTemperature - GetTemperature();
100 float temperatureDiffCoef = Math.Lerp(DAMAGE_ENVIRO_LIQUID_COEF_MIN,DAMAGE_ENVIRO_LIQUID_COEF_MAX,tTime);
101 float damageVal = GetMaxHealth("","Health") / GetQuantityMax();
102 DecreaseHealth(amount * damageVal * temperatureDiffCoef,false);
103 }
104 }
105
108 {
109 return GetTemperatureMax();
110 }
111};
override string GetEmptyingEndSoundsetSoft()
const float DAMAGE_ENVIRO_TEMPDIFF_MIN
override bool IsOpen()
override float GetItemOverheatThreshold()
disregards liquid boil threshold if filled
override int FilterAgents(int agentsIn)
const float DAMAGE_ENVIRO_TEMPDIFF_MAX
override string GetEmptyingEndSoundsetHard()
const float DAMAGE_CONSUME_PER_ML
override string GetPouringSoundset()
void DamageBottleConsume(float amount, PlayerBase consumer)
override bool CanPutInCargo(EntityAI parent)
const float DAMAGE_ENVIRO_LIQUID_COEF_MAX
override string GetEmptyingLoopSoundsetWater()
override string GetEmptyingEndSoundsetWater()
const float DAMAGE_ENVIRO_LIQUID_COEF_MIN
override void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
override void OnConsume(float amount, PlayerBase consumer)
override void AffectLiquidContainerOnFill(int liquid_type, float amount)
const float DAMAGE_OVERHEAT_PER_S
override string GetEmptyingLoopSoundsetSoft()
override string GetEmptyingLoopSoundsetHard()
Definition enmath.c:7
DayZGame g_Game
Definition dayzgame.c:3942
eAgents
Definition eagents.c:3
float GetTemperature()
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
override int GetQuantityMax()
Definition itembase.c:8349