Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
tomato.c
Go to the documentation of this file.
2{
3 override bool CanBeCookedOnStick()
4 {
5 return true;
6 }
7
8 override bool CanBeCooked()
9 {
10 return true;
11 }
12
13 override bool IsFruit()
14 {
15 return true;
16 }
17
18 override bool CanDecay()
19 {
20 return true;
21 }
22
23 override void SetActions()
24 {
25 super.SetActions();
26
27 AddAction(ActionForceFeed);
31 }
32
33 override void EEOnCECreate()
34 {
35 int rand = Math.RandomInt(0,10);
36 float baseTemp = GetGame().GetMission().GetWorldData().GetBaseEnvTemperature();
37
38 if ( baseTemp <= GameConstants.COLD_AREA_TEMPERATURE_THRESHOLD )
39 {
40 int randQ = Math.RandomFloat(10,80);
41 SetQuantity( randQ );
42
43 if ( rand >= 9 )
44 {
46 SetHealth( "", "", GetMaxHealth()*0.1 );
47
48 }
49 else
50 {
52 SetHealth( "", "", GetMaxHealth()*0.4 );
53 }
54 }
55 else
56 {
57 if ( rand > 6 )
58 {
60 SetHealth( "", "", GetMaxHealth()*0.1 );
61 }
62 else if ( rand > 2 )
63 {
65 SetHealth( "", "", GetMaxHealth()*0.4 );
66 }
67 }
68 }
69}
void AddAction(typename actionName)
override void SetActions()
void ChangeFoodStage(FoodStageType new_food_stage_type)
Definition enmath.c:7
Definition tomato.c:2
float GetBaseEnvTemperature()
Definition worlddata.c:206
FoodStageType
Definition foodstage.c:2
proto native CGame GetGame()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
Definition itembase.c:8148