DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
FilteringBottle.c
См. документацию.
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 = GetGame().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};
eAgents
Определения EAgents.c:3
override int GetQuantityMax()
Определения ItemBase.c:8106
Определения Canteen.c:2
proto native Mission GetMission()
Определения Building.c:6
override string GetEmptyingEndSoundsetWater()
Определения FilteringBottle.c:40
override string GetEmptyingLoopSoundsetHard()
Определения FilteringBottle.c:15
override float GetItemOverheatThreshold()
disregards liquid boil threshold if filled
Определения FilteringBottle.c:107
override string GetEmptyingLoopSoundsetWater()
Определения FilteringBottle.c:25
override void AffectLiquidContainerOnFill(int liquid_type, float amount)
Определения FilteringBottle.c:80
override string GetEmptyingEndSoundsetHard()
Определения FilteringBottle.c:30
override bool IsOpen()
Определения FilteringBottle.c:56
override int FilterAgents(int agentsIn)
Определения FilteringBottle.c:61
const float DAMAGE_ENVIRO_LIQUID_COEF_MAX
Определения FilteringBottle.c:6
override void OnConsume(float amount, PlayerBase consumer)
Определения FilteringBottle.c:68
const float DAMAGE_OVERHEAT_PER_S
Определения FilteringBottle.c:4
override string GetEmptyingEndSoundsetSoft()
Определения FilteringBottle.c:35
const float DAMAGE_ENVIRO_TEMPDIFF_MIN
Определения FilteringBottle.c:7
override string GetEmptyingLoopSoundsetSoft()
Определения FilteringBottle.c:20
override bool CanPutInCargo(EntityAI parent)
Определения FilteringBottle.c:45
const float DAMAGE_ENVIRO_TEMPDIFF_MAX
Определения FilteringBottle.c:8
override void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
Определения FilteringBottle.c:93
const float DAMAGE_ENVIRO_LIQUID_COEF_MIN
Определения FilteringBottle.c:5
void DamageBottleConsume(float amount, PlayerBase consumer)
Определения FilteringBottle.c:75
override string GetPouringSoundset()
Определения FilteringBottle.c:10
const float DAMAGE_CONSUME_PER_ML
Определения FilteringBottle.c:3
Определения FilteringBottle.c:2
Определения EnMath.c:7
WorldData GetWorldData()
Определения gameplay.c:743
Определения PlayerBaseClient.c:2
float GetLiquidTypeEnviroTemperature(int liquidType)
Определения WorldData.c:228
proto native CGame GetGame()
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
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,...