Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
recipebase.c File Reference

Go to the source code of this file.

Classes

class  RecipeAnimationInfo
 

Functions

void RecipeBase ()
 
void Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
void SetAnimation (DayZPlayerConstants uid)
 
float GetLengthInSecs ()
 
float GetSpecialty ()
 
bool IsRecipeAnywhere ()
 
bool IsRepeatable ()
 
bool CheckIngredientMatch (ItemBase item1, ItemBase item2)
 
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)
 
void RemoveIngredient (int index, string ingredient)
 
void AddResult (string item)
 
string GetName ()
 Test name getter. Strictly for UI porposes!
 
bool IsInstaRecipe ()
 
void SpawnItems (ItemBase ingredients[], PlayerBase player, array< ItemBase > spawned_objects)
 
void ApplyModificationsResults (ItemBase sorted[], array< ItemBase > results, ItemBase result, PlayerBase player)
 
void DeleleIngredientsPass ()
 
void ApplyModificationsIngredients (ItemBase sorted[], PlayerBase player)
 
bool CheckConditions (ItemBase sorted[])
 
bool CheckRecipe (ItemBase item1, ItemBase item2, PlayerBase player)
 
void OnSelectedRecipe (ItemBase item1, ItemBase item2, PlayerBase player)
 
void OnSelected (ItemBase item1, ItemBase item2, PlayerBase player)
 
void PerformRecipe (ItemBase item1, ItemBase item2, PlayerBase player)
 
void ApplySoftSkillsSpecialty (PlayerBase player)
 
bool CanDo (ItemBase ingredients[], PlayerBase player)
 
void Do (ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
 
int GetID ()
 
void SetID (int id)
 
void GetAllItems (array< string > items)
 
string GetSoundCategory (int ingredientIndex, ItemBase item)
 
bool IsItemInRecipe (string item)
 
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])
 
int GetAnimationCommandUID ()
 
RecipeAnimationInfo GetRecipeAnimationInfo (PlayerBase player, ItemBase mainItem, ItemBase target)
 

Variables

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

Function Documentation

◆ AddResult()

void AddResult ( string item)
protected

Definition at line 198 of file recipebase.c.

◆ ApplyModificationsIngredients()

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

Definition at line 373 of file recipebase.c.

◆ ApplyModificationsResults()

void ApplyModificationsResults ( ItemBase sorted[],
array< ItemBase > results,
ItemBase result,
PlayerBase player )
protected

Definition at line 268 of file recipebase.c.

◆ 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.

◆ CheckConditions()

bool CheckConditions ( ItemBase sorted[])
protected

Definition at line 429 of file recipebase.c.

◆ CheckIngredientMatch()

bool CheckIngredientMatch ( ItemBase item1,
ItemBase item2 )
protected

Definition at line 115 of file recipebase.c.

◆ CheckRecipe()

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

Definition at line 479 of file recipebase.c.

◆ DeleleIngredientsPass()

void DeleleIngredientsPass ( )
protected

Definition at line 362 of file recipebase.c.

◆ 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.

◆ GetAnimationCommandUID()

int GetAnimationCommandUID ( )
protected

Definition at line 641 of file recipebase.c.

◆ GetID()

int GetID ( )
protected

Definition at line 568 of file recipebase.c.

◆ 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.

◆ GetLengthInSecs()

float GetLengthInSecs ( )
protected

Definition at line 95 of file recipebase.c.

◆ GetRecipeAnimationInfo()

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

Definition at line 646 of file recipebase.c.

◆ GetSoundCategory()

string GetSoundCategory ( int ingredientIndex,
ItemBase item )
protected

Definition at line 592 of file recipebase.c.

◆ GetSpecialty()

float GetSpecialty ( )
protected

Definition at line 100 of file recipebase.c.

◆ Init()

void Init ( )
protected

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

Definition at line 127 of file dayzgame.c.

◆ InsertIngredient()

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

Definition at line 159 of file recipebase.c.

◆ InsertIngredientEx()

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

Definition at line 164 of file recipebase.c.

◆ IsInstaRecipe()

bool IsInstaRecipe ( )
protected

Definition at line 209 of file recipebase.c.

◆ IsItemInRecipe()

bool IsItemInRecipe ( string item)
protected

Definition at line 607 of file recipebase.c.

◆ IsRecipeAnywhere()

bool IsRecipeAnywhere ( )
protected

Definition at line 105 of file recipebase.c.

◆ 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.

◆ PerformRecipe()

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

Definition at line 521 of file recipebase.c.

◆ RecipeBase()

void RecipeBase ( )
protected

Definition at line 67 of file recipebase.c.

◆ RemoveIngredient()

void RemoveIngredient ( int index,
string ingredient )
protected

Definition at line 183 of file recipebase.c.

◆ SetAnimation()

void SetAnimation ( DayZPlayerConstants uid)
protected

Definition at line 90 of file recipebase.c.

◆ SetID()

void SetID ( int id)
protected

Definition at line 574 of file recipebase.c.

◆ SpawnItems()

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

Definition at line 215 of file recipebase.c.

Variable Documentation

◆ BASE_CRAFT_ANIMATION_ID

◆ DEFAULT_SPAWN_DISTANCE

const float DEFAULT_SPAWN_DISTANCE = 0.6

Definition at line 3 of file recipebase.c.

◆ m_AnimationInfos

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

Definition at line 26 of file recipebase.c.

◆ m_AnimationLength

float m_AnimationLength = 1
protected

Definition at line 38 of file recipebase.c.

◆ m_AnywhereInInventory

bool m_AnywhereInInventory
protected

Definition at line 41 of file recipebase.c.

◆ m_ID

int m_ID
protected

Definition at line 35 of file recipebase.c.

◆ m_IngredientAddHealth

float m_IngredientAddHealth[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 49 of file recipebase.c.

◆ m_IngredientAddQuantity

float m_IngredientAddQuantity[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 50 of file recipebase.c.

◆ m_IngredientDestroy

bool m_IngredientDestroy[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 52 of file recipebase.c.

◆ m_Ingredients

ref array<string> m_Ingredients[MAX_NUMBER_OF_INGREDIENTS]

Definition at line 24 of file recipebase.c.

◆ m_IngredientSetHealth

float m_IngredientSetHealth[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 51 of file recipebase.c.

◆ m_IngredientsSorted

ItemBase m_IngredientsSorted[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 30 of file recipebase.c.

◆ m_IngredientsToBeDeleted

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

Definition at line 32 of file recipebase.c.

◆ m_IngredientUseSoftSkills

bool m_IngredientUseSoftSkills[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 48 of file recipebase.c.

◆ m_IsInstaRecipe

bool m_IsInstaRecipe
protected

Definition at line 40 of file recipebase.c.

◆ m_Items

ItemBase m_Items[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 28 of file recipebase.c.

◆ m_ItemsToCreate

string m_ItemsToCreate[MAXIMUM_RESULTS]

Definition at line 23 of file recipebase.c.

◆ m_MaxDamageIngredient

float m_MaxDamageIngredient[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 46 of file recipebase.c.

◆ m_MaxQuantityIngredient

float m_MaxQuantityIngredient[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 44 of file recipebase.c.

◆ m_MinDamageIngredient

float m_MinDamageIngredient[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 45 of file recipebase.c.

◆ m_MinQuantityIngredient

float m_MinQuantityIngredient[MAX_NUMBER_OF_INGREDIENTS]
protected

Definition at line 43 of file recipebase.c.

◆ 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.

◆ m_RecipeUID

int m_RecipeUID
protected

Definition at line 37 of file recipebase.c.

◆ m_ResultInheritsColor

int m_ResultInheritsColor[MAXIMUM_RESULTS]
protected

Definition at line 61 of file recipebase.c.

◆ m_ResultInheritsHealth

int m_ResultInheritsHealth[MAXIMUM_RESULTS]
protected

Definition at line 60 of file recipebase.c.

◆ m_ResultReplacesIngredient

int m_ResultReplacesIngredient[MAXIMUM_RESULTS]
protected

Definition at line 62 of file recipebase.c.

◆ m_ResultSetFullQuantity

bool m_ResultSetFullQuantity[MAXIMUM_RESULTS]
protected

Definition at line 55 of file recipebase.c.

◆ m_ResultSetHealth

float m_ResultSetHealth[MAXIMUM_RESULTS]
protected

Definition at line 57 of file recipebase.c.

◆ m_ResultSetQuantity

float m_ResultSetQuantity[MAXIMUM_RESULTS]
protected

Definition at line 56 of file recipebase.c.

◆ m_ResultSpawnDistance

float m_ResultSpawnDistance[MAXIMUM_RESULTS]
protected

Definition at line 58 of file recipebase.c.

◆ m_ResultToInventory

int m_ResultToInventory[MAXIMUM_RESULTS]
protected

Definition at line 59 of file recipebase.c.

◆ m_ResultUseSoftSkills

bool m_ResultUseSoftSkills[MAXIMUM_RESULTS]
protected

Definition at line 63 of file recipebase.c.

◆ m_SoundCategories

ref array<string> m_SoundCategories[MAX_NUMBER_OF_INGREDIENTS]

Definition at line 25 of file recipebase.c.

◆ m_Specialty

float m_Specialty = 0
protected

Definition at line 39 of file recipebase.c.

◆ MAX_NUMBER_OF_INGREDIENTS

const int MAX_NUMBER_OF_INGREDIENTS = 2

Definition at line 1 of file recipebase.c.

◆ MAXIMUM_RESULTS

const int MAXIMUM_RESULTS = 10

Definition at line 2 of file recipebase.c.