Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
preparefish.c
Go to the documentation of this file.
1 class 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  {
15  ItemBase ingredient = ingredients[0];
16 
17  for (int i=0; i < results.Count(); i++)
18  {
19  ItemBase item_result;
20  Class.CastTo(item_result, results.Get(i));
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 };
ItemBase
Definition: inventoryitem.c:730
Do
override protected void Do(PlayerBase player)
Definition: spookyareamisc.c:13
RecipeBase
Definition: recipebase.c:4
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
PlayerBase
Definition: playerbaseclient.c:1
PluginLifespan
void PluginLifespan()
Definition: pluginlifespan.c:45
array< ItemBase >
PrepareFish
Definition: preparecarp.c:1
Math
Definition: enmath.c:6
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10