Dayz Explorer 1.29.162510
Loading...
Searching...
No Matches
apple.c
Go to the documentation of this file.
1class Apple : Edible_Base
2{
3 override bool CanBeCooked()
4 {
5 return true;
6 }
7
8 override bool CanBeCookedOnStick()
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
31 }
32
33 override void EEOnCECreate()
34 {
35 int rand = Math.RandomInt(0,10);
36 float baseTemp = g_Game.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}
ActionForceFeedSmallCB ActionForceFeed
void AddAction(typename actionName)
Definition apple.c:2
override bool IsFruit()
override bool CanDecay()
override void SetActions()
void ChangeFoodStage(FoodStageType new_food_stage_type)
Definition enmath.c:7
override void EEOnCECreate()
DayZGame g_Game
Definition dayzgame.c:3942
FoodStageType
Definition foodstage.c:2
bool CanBeCooked()
Definition itembase.c:7556
bool CanBeCookedOnStick()
Definition itembase.c:7561