Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
recipebase.c File Reference

Go to the source code of this file.

Data Structures

class  RecipeAnimationInfo

Functions

void AddResult (string item)
void ApplyModificationsIngredients (ItemBase sorted[], PlayerBase player)
void ApplyModificationsResults (ItemBase sorted[], array< ItemBase > results, ItemBase result, PlayerBase player)
void ApplySoftSkillsSpecialty (PlayerBase player)
bool CanDo (ItemBase ingredients[], PlayerBase player)
bool CheckConditions (ItemBase sorted[])
bool CheckIngredientMatch (ItemBase item1, ItemBase item2)
bool CheckRecipe (ItemBase item1, ItemBase item2, PlayerBase player)
void DeleleIngredientsPass ()
void Do (ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
void GetAllItems (array< string > items)
int GetAnimationCommandUID ()
int GetID ()
int GetIngredientMaskForItem (string item)
 returns a mask which marks ingredient positions for a given item in this recipe(for example mask of value 3 [....000011] means this item is both ingredient 1 and 2 in this recipe[from right to left])
float GetLengthInSecs ()
string GetName ()
 Test name getter. Strictly for UI porposes!
RecipeAnimationInfo GetRecipeAnimationInfo (PlayerBase player, ItemBase mainItem, ItemBase target)
string GetSoundCategory (int ingredientIndex, ItemBase item)
float GetSpecialty ()
void Init ()
void InsertIngredient (int index, string ingredient, DayZPlayerConstants uid=BASE_CRAFT_ANIMATION_ID, bool showItem=false)
void InsertIngredientEx (int index, string ingredient, string soundCategory, DayZPlayerConstants uid=BASE_CRAFT_ANIMATION_ID, bool showItem=false)
bool IsInstaRecipe ()
bool IsItemInRecipe (string item)
bool IsRecipeAnywhere ()
bool IsRepeatable ()
void OnSelected (ItemBase item1, ItemBase item2, PlayerBase player)
void OnSelectedRecipe (ItemBase item1, ItemBase item2, PlayerBase player)
void PerformRecipe (ItemBase item1, ItemBase item2, PlayerBase player)
void RecipeBase ()
void RemoveIngredient (int index, string ingredient)
void SetAnimation (DayZPlayerConstants uid)
void SetID (int id)
void SpawnItems (ItemBase ingredients[], PlayerBase player, array< ItemBase > spawned_objects)

Variables

class RecipeAnimationInfo BASE_CRAFT_ANIMATION_ID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING
const float DEFAULT_SPAWN_DISTANCE = 0.6
ref array< ref RecipeAnimationInfom_AnimationInfos = new array<ref RecipeAnimationInfo>()
float m_AnimationLength = 1
bool m_AnywhereInInventory
int m_ID
float m_IngredientAddHealth [MAX_NUMBER_OF_INGREDIENTS]
float m_IngredientAddQuantity [MAX_NUMBER_OF_INGREDIENTS]
bool m_IngredientDestroy [MAX_NUMBER_OF_INGREDIENTS]
ref array< stringm_Ingredients [MAX_NUMBER_OF_INGREDIENTS]
float m_IngredientSetHealth [MAX_NUMBER_OF_INGREDIENTS]
ItemBase m_IngredientsSorted [MAX_NUMBER_OF_INGREDIENTS]
ref array< ItemBasem_IngredientsToBeDeleted = new array<ItemBase>
bool m_IngredientUseSoftSkills [MAX_NUMBER_OF_INGREDIENTS]
bool m_IsInstaRecipe
ItemBase m_Items [MAX_NUMBER_OF_INGREDIENTS]
string m_ItemsToCreate [MAXIMUM_RESULTS]
float m_MaxDamageIngredient [MAX_NUMBER_OF_INGREDIENTS]
float m_MaxQuantityIngredient [MAX_NUMBER_OF_INGREDIENTS]
float m_MinDamageIngredient [MAX_NUMBER_OF_INGREDIENTS]
float m_MinQuantityIngredient [MAX_NUMBER_OF_INGREDIENTS]
string m_Name
int m_NumberOfResults
int m_RecipeUID
int m_ResultInheritsColor [MAXIMUM_RESULTS]
int m_ResultInheritsHealth [MAXIMUM_RESULTS]
int m_ResultReplacesIngredient [MAXIMUM_RESULTS]
bool m_ResultSetFullQuantity [MAXIMUM_RESULTS]
float m_ResultSetHealth [MAXIMUM_RESULTS]
float m_ResultSetQuantity [MAXIMUM_RESULTS]
float m_ResultSpawnDistance [MAXIMUM_RESULTS]
int m_ResultToInventory [MAXIMUM_RESULTS]
bool m_ResultUseSoftSkills [MAXIMUM_RESULTS]
ref array< stringm_SoundCategories [MAX_NUMBER_OF_INGREDIENTS]
float m_Specialty = 0
const int MAX_NUMBER_OF_INGREDIENTS = 2
const int MAXIMUM_RESULTS = 10

Function Documentation

◆ AddResult()

◆ ApplyModificationsIngredients()

void ApplyModificationsIngredients ( ItemBase sorted[],
PlayerBase player )
protected

◆ ApplyModificationsResults()

◆ ApplySoftSkillsSpecialty()

void ApplySoftSkillsSpecialty ( PlayerBase player)
protected

Definition at line 547 of file recipebase.c.

◆ CanDo()

bool CanDo ( ItemBase ingredients[],
PlayerBase player )
protected

Definition at line 551 of file recipebase.c.

References MAX_NUMBER_OF_INGREDIENTS.

◆ CheckConditions()

bool CheckConditions ( ItemBase sorted[])
protected

◆ CheckIngredientMatch()

bool CheckIngredientMatch ( ItemBase item1,
ItemBase item2 )
protected

Definition at line 115 of file recipebase.c.

References g_Game, m_Ingredients, m_IngredientsSorted, m_Items, MAX_NUMBER_OF_INGREDIENTS, and x.

◆ CheckRecipe()

bool CheckRecipe ( ItemBase item1,
ItemBase item2,
PlayerBase player )
protected

◆ DeleleIngredientsPass()

void DeleleIngredientsPass ( )
protected

Definition at line 362 of file recipebase.c.

References m_IngredientsToBeDeleted.

Referenced by PerformRecipe().

◆ Do()

void Do ( ItemBase ingredients[],
PlayerBase player,
array< ItemBase > results,
float specialty_weight )
protected

Definition at line 563 of file recipebase.c.

◆ GetAllItems()

void GetAllItems ( array< string > items)
protected

Definition at line 579 of file recipebase.c.

References m_Ingredients, MAX_NUMBER_OF_INGREDIENTS, and x.

◆ GetAnimationCommandUID()

int GetAnimationCommandUID ( )
protected

Definition at line 641 of file recipebase.c.

References BASE_CRAFT_ANIMATION_ID.

◆ GetID()

int GetID ( )
protected

Definition at line 568 of file recipebase.c.

References m_ID.

◆ GetIngredientMaskForItem()

int GetIngredientMaskForItem ( string item)
protected

returns a mask which marks ingredient positions for a given item in this recipe(for example mask of value 3 [....000011] means this item is both ingredient 1 and 2 in this recipe[from right to left])

Definition at line 622 of file recipebase.c.

References m_Ingredients, MAX_NUMBER_OF_INGREDIENTS, Math::Pow(), and x.

◆ GetLengthInSecs()

float GetLengthInSecs ( )
protected

Definition at line 95 of file recipebase.c.

References CRAFTING_TIME_UNIT_SIZE, and m_AnimationLength.

◆ GetRecipeAnimationInfo()

RecipeAnimationInfo GetRecipeAnimationInfo ( PlayerBase player,
ItemBase mainItem,
ItemBase target )
protected

◆ GetSoundCategory()

string GetSoundCategory ( int ingredientIndex,
ItemBase item )
protected

Definition at line 592 of file recipebase.c.

References g_Game, m_Ingredients, m_SoundCategories, and x.

◆ GetSpecialty()

float GetSpecialty ( )
protected

Definition at line 100 of file recipebase.c.

References m_Specialty.

◆ Init()

void Init ( )
protected

Definition at line 127 of file dayzgame.c.

◆ InsertIngredient()

◆ InsertIngredientEx()

void InsertIngredientEx ( int index,
string ingredient,
string soundCategory,
DayZPlayerConstants uid = BASE_CRAFT_ANIMATION_ID,
bool showItem = false )
protected

◆ IsInstaRecipe()

bool IsInstaRecipe ( )
protected

Definition at line 209 of file recipebase.c.

References m_IsInstaRecipe.

◆ IsItemInRecipe()

bool IsItemInRecipe ( string item)
protected

Definition at line 607 of file recipebase.c.

References m_Ingredients, MAX_NUMBER_OF_INGREDIENTS, and x.

◆ IsRecipeAnywhere()

bool IsRecipeAnywhere ( )
protected

Definition at line 105 of file recipebase.c.

References m_AnywhereInInventory.

Referenced by CheckRecipe().

◆ IsRepeatable()

bool IsRepeatable ( )
protected

Definition at line 110 of file recipebase.c.

◆ OnSelected()

void OnSelected ( ItemBase item1,
ItemBase item2,
PlayerBase player )
protected

Definition at line 515 of file recipebase.c.

◆ OnSelectedRecipe()

void OnSelectedRecipe ( ItemBase item1,
ItemBase item2,
PlayerBase player )
protected

Definition at line 504 of file recipebase.c.

References Error(), and OnSelected().

◆ PerformRecipe()

◆ RecipeBase()

◆ RemoveIngredient()

void RemoveIngredient ( int index,
string ingredient )
protected

Definition at line 183 of file recipebase.c.

References m_Ingredients, and m_SoundCategories.

◆ SetAnimation()

void SetAnimation ( DayZPlayerConstants uid)
protected

Definition at line 90 of file recipebase.c.

References m_RecipeUID.

◆ SetID()

void SetID ( int id)
protected

Definition at line 574 of file recipebase.c.

References m_ID.

◆ SpawnItems()

void SpawnItems ( ItemBase ingredients[],
PlayerBase player,
array< ItemBase > spawned_objects )
protected

Variable Documentation

◆ BASE_CRAFT_ANIMATION_ID

◆ DEFAULT_SPAWN_DISTANCE

const float DEFAULT_SPAWN_DISTANCE = 0.6

◆ m_AnimationInfos

ref array<ref RecipeAnimationInfo> m_AnimationInfos = new array<ref RecipeAnimationInfo>()
protected

Definition at line 26 of file recipebase.c.

Referenced by GetRecipeAnimationInfo(), and InsertIngredientEx().

◆ m_AnimationLength

◆ m_AnywhereInInventory

bool m_AnywhereInInventory
protected

Definition at line 41 of file recipebase.c.

Referenced by RecipeBase::Init(), and IsRecipeAnywhere().

◆ m_ID

int m_ID
protected

Definition at line 35 of file recipebase.c.

◆ m_IngredientAddHealth

◆ m_IngredientAddQuantity

◆ m_IngredientDestroy

◆ m_Ingredients

◆ m_IngredientSetHealth

◆ m_IngredientsSorted

ItemBase m_IngredientsSorted[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 30 of file recipebase.c.

Referenced by CheckIngredientMatch(), CheckRecipe(), PerformRecipe(), and RecipeBase().

◆ m_IngredientsToBeDeleted

ref array<ItemBase> m_IngredientsToBeDeleted = new array<ItemBase>
protected

Definition at line 32 of file recipebase.c.

Referenced by ApplyModificationsIngredients(), and DeleleIngredientsPass().

◆ m_IngredientUseSoftSkills

◆ m_IsInstaRecipe

◆ m_Items

ItemBase m_Items[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 28 of file recipebase.c.

Referenced by CheckIngredientMatch().

◆ m_ItemsToCreate

string m_ItemsToCreate[MAXIMUM_RESULTS]

Definition at line 23 of file recipebase.c.

Referenced by AddResult(), and SpawnItems().

◆ m_MaxDamageIngredient

◆ m_MaxQuantityIngredient

◆ m_MinDamageIngredient

◆ m_MinQuantityIngredient

◆ m_Name

string m_Name
protected

Definition at line 33 of file recipebase.c.

◆ m_NumberOfResults

int m_NumberOfResults
protected

Definition at line 36 of file recipebase.c.

Referenced by AddResult(), ApplyModificationsResults(), RecipeBase(), and SpawnItems().

◆ m_RecipeUID

int m_RecipeUID
protected

Definition at line 37 of file recipebase.c.

Referenced by RecipeBase::Init(), RecipeBase(), and SetAnimation().

◆ m_ResultInheritsColor

◆ m_ResultInheritsHealth

◆ m_ResultReplacesIngredient

◆ m_ResultSetFullQuantity

◆ m_ResultSetHealth

◆ m_ResultSetQuantity

◆ m_ResultSpawnDistance

float m_ResultSpawnDistance[MAXIMUM_RESULTS]
protected

Definition at line 58 of file recipebase.c.

Referenced by RecipeBase(), and SpawnItems().

◆ m_ResultToInventory

◆ m_ResultUseSoftSkills

◆ m_SoundCategories

ref array<string> m_SoundCategories[MAX_NUMBER_OF_INGREDIENTS]

Definition at line 25 of file recipebase.c.

Referenced by GetSoundCategory(), InsertIngredientEx(), RecipeBase(), and RemoveIngredient().

◆ m_Specialty

◆ MAX_NUMBER_OF_INGREDIENTS

◆ MAXIMUM_RESULTS

const int MAXIMUM_RESULTS = 10

Definition at line 2 of file recipebase.c.

Referenced by RecipeBase().