DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
WaterBottle.c
См. документацию.
1class WaterBottle extends Bottle_Base
2{
3 const float DAMAGE_OVERHEAT_PER_S = 0.1;
6 const float DAMAGE_ENVIRO_TEMPDIFF_MIN = 80; //min damage at this demperature diff
7 const float DAMAGE_ENVIRO_TEMPDIFF_MAX = 10; //maximum damage at this demperature diff
8
9 override string GetPouringSoundset()
10 {
11 return "emptyVessle_WaterBottle_SoundSet";
12 }
13
15 {
16 return "pour_HardGround_WatterBottle_SoundSet";
17 }
18
20 {
21 return "pour_SoftGround_WatterBottle_SoundSet";
22 }
23
25 {
26 return "pour_Water_WatterBottle_SoundSet";
27 }
28
30 {
31 return "pour_End_HardGround_WatterBottle_SoundSet";
32 }
33
35 {
36 return "pour_End_SoftGround_WatterBottle_SoundSet";
37 }
38
40 {
41 return "pour_End_Water_WatterBottle_SoundSet";
42 }
43
44 override bool CanPutInCargo( EntityAI parent )
45 {
46 if( !super.CanPutInCargo(parent) ) {return false;}
47 if ( parent && (parent.IsKindOf("WatterBottle"))/* && !(parent.IsKindOf("Container_Base"))*/)
48 {
49 return false;
50 }
51
52 return true;
53 }
54
55 override bool IsOpen()
56 {
57 return true;
58 }
59
60 override void EEOnCECreate()
61 {
62 super.EEOnCECreate();
63
65 if (data)
66 {
67 float chance = data.GetAgentSpawnChance(eAgents.CHOLERA);
68 int rand = Math.RandomFloat(0, 100);
69
70 if (rand < chance)
71 InsertAgent(eAgents.CHOLERA, 1);
72 }
73 }
74
75 override void OnDebugSpawn()
76 {
77 super.OnDebugSpawn();
78
79 InsertAgent(eAgents.CHOLERA, 1);
80 }
81
82 override void AffectLiquidContainerOnFill(int liquid_type, float amount)
83 {
84 float liquidTemperature = GetGame().GetMission().GetWorldData().GetLiquidTypeEnviroTemperature(liquid_type);
85 if (liquidTemperature >= GetItemOverheatThreshold())
86 {
87 float temperatureDiff = liquidTemperature - GetTemperature();
90 float damageVal = GetMaxHealth("","Health") / GetQuantityMax();
91 DecreaseHealth(amount * damageVal * temperatureDiffCoef,false);
92 }
93 }
94
95 override void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
96 {
97 //does damage if receiving scalding liquid
98 if (sourceLiquidTemperature >= GetItemOverheatThreshold())
99 {
100 float temperatureDiff = sourceLiquidTemperature - GetTemperature();
102 float temperatureDiffCoef = Math.Lerp(DAMAGE_ENVIRO_LIQUID_COEF_MIN,DAMAGE_ENVIRO_LIQUID_COEF_MAX,tTime);
103 float damageVal = GetMaxHealth("","Health") / GetQuantityMax();
104 DecreaseHealth(amount * damageVal * temperatureDiffCoef,false);
105 }
106 }
107
110 {
111 return GetTemperatureMax();
112 }
113}
eAgents
Определения EAgents.c:3
override void InsertAgent(int agent, float count=1)
Определения ItemBase.c:8653
override int GetQuantityMax()
Определения ItemBase.c:8106
override string GetEmptyingEndSoundsetWater()
Определения WaterBottle.c:39
override void OnDebugSpawn()
Определения WaterBottle.c:75
override void AffectLiquidContainerOnFill(int liquid_type, float amount)
Определения WaterBottle.c:82
override void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
Определения WaterBottle.c:95
override string GetEmptyingLoopSoundsetWater()
Определения WaterBottle.c:24
override string GetEmptyingLoopSoundsetHard()
Определения WaterBottle.c:14
const float DAMAGE_ENVIRO_LIQUID_COEF_MIN
Определения WaterBottle.c:4
override string GetEmptyingEndSoundsetSoft()
Определения WaterBottle.c:34
override void EEOnCECreate()
Определения WaterBottle.c:60
const float DAMAGE_ENVIRO_LIQUID_COEF_MAX
Определения WaterBottle.c:5
override bool CanPutInCargo(EntityAI parent)
Определения WaterBottle.c:44
const float DAMAGE_ENVIRO_TEMPDIFF_MAX
Определения WaterBottle.c:7
const float DAMAGE_ENVIRO_TEMPDIFF_MIN
Определения WaterBottle.c:6
const float DAMAGE_OVERHEAT_PER_S
Определения WaterBottle.c:3
override string GetEmptyingLoopSoundsetSoft()
Определения WaterBottle.c:19
override string GetEmptyingEndSoundsetHard()
Определения WaterBottle.c:29
override float GetItemOverheatThreshold()
disregards liquid boil threshold if filled
Определения WaterBottle.c:109
override string GetPouringSoundset()
Определения WaterBottle.c:9
override bool IsOpen()
Определения WaterBottle.c:55
Определения Canteen.c:2
proto native Mission GetMission()
Определения Building.c:6
Определения EnMath.c:7
WorldData GetWorldData()
Определения gameplay.c:743
float GetAgentSpawnChance(eAgents agent)
Определения WorldData.c:253
float GetLiquidTypeEnviroTemperature(int liquidType)
Определения WorldData.c:228
Keeps information about currently loaded world, like temperature.
Определения WorldData.c:3
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 RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
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,...