DayZ 1.24
Loading...
Searching...
No Matches
PrepareFish.c
Go to the documentation of this file.
1class PrepareFish extends RecipeBase
2{
3 override void Init()
4 {
5
6 }
7
8 override bool CanDo(ItemBase ingredients[], PlayerBase player)//final check for recipe's validity
9 {
10 return true;
11 }
12
13 override void Do(ItemBase ingredients[], PlayerBase player, array<ItemBase> results, float specialty_weight) //gets called upon recipe's completion
14 {
16
17 for (int i = 0; i < results.Count(); i++)
18 {
21
22 //Trasnfer current food state
23 MiscGameplayFunctions.TransferItemProperties(ingredient, item_result);
24 item_result.SetQuantityNormalized(Math.RandomFloat(0.8, 1));
25 }
26
28 lifespan.UpdateBloodyHandsVisibility(player, true);
29 }
30};
void PluginLifespan()
PluginBase GetPlugin(typename plugin_type)
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition EnMath.c:7
override bool CanDo(ItemBase ingredients[], PlayerBase player)
Definition PrepareFish.c:8
override void Do(ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
Definition PrepareFish.c:13
override void Init()
Definition PrepareFish.c:3
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].