PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
RecipeBase.c File Reference

Data Structures

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)
 
protected 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]
 
protected 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()

◆ ApplyModificationsIngredients()

◆ ApplyModificationsResults()

◆ ApplySoftSkillsSpecialty()

void ApplySoftSkillsSpecialty ( PlayerBase  player)

◆ CanDo()

bool CanDo ( ItemBase  ingredients[],
PlayerBase  player 
)

◆ CheckConditions()

◆ CheckIngredientMatch()

bool CheckIngredientMatch ( ItemBase  item1,
ItemBase  item2 
)

◆ CheckRecipe()

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

◆ DeleleIngredientsPass()

void DeleleIngredientsPass ( )

References m_IngredientsToBeDeleted.

Referenced by PerformRecipe().

◆ Do()

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

◆ GetAllItems()

void GetAllItems ( array< string items)

◆ GetAnimationCommandUID()

int GetAnimationCommandUID ( )

◆ GetID()

int GetID ( )

References m_ID.

◆ GetIngredientMaskForItem()

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])

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

◆ GetLengthInSecs()

float GetLengthInSecs ( )

◆ GetRecipeAnimationInfo()

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

◆ GetSoundCategory()

string GetSoundCategory ( int  ingredientIndex,
ItemBase  item 
)

◆ GetSpecialty()

float GetSpecialty ( )

References m_Specialty.

◆ Init()

void Init ( )

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

◆ InsertIngredient()

◆ InsertIngredientEx()

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

◆ IsInstaRecipe()

bool IsInstaRecipe ( )

References m_IsInstaRecipe.

◆ IsItemInRecipe()

bool IsItemInRecipe ( string  item)

◆ IsRecipeAnywhere()

bool IsRecipeAnywhere ( )

References m_AnywhereInInventory.

Referenced by CheckRecipe().

◆ IsRepeatable()

bool IsRepeatable ( )

◆ OnSelected()

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

◆ OnSelectedRecipe()

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

References Error(), and OnSelected().

◆ PerformRecipe()

◆ RecipeBase()

◆ RemoveIngredient()

void RemoveIngredient ( int  index,
string  ingredient 
)

References m_Ingredients, and m_SoundCategories.

◆ SetAnimation()

protected void SetAnimation ( DayZPlayerConstants  uid)

References m_RecipeUID.

◆ SetID()

void SetID ( int  id)

References m_ID.

◆ SpawnItems()

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

Variable Documentation

◆ BASE_CRAFT_ANIMATION_ID

◆ DEFAULT_SPAWN_DISTANCE

const float DEFAULT_SPAWN_DISTANCE = 0.6

◆ m_AnimationInfos

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

◆ m_AnimationLength

◆ m_AnywhereInInventory

bool m_AnywhereInInventory

◆ m_ID

int m_ID

◆ m_IngredientAddHealth

◆ m_IngredientAddQuantity

◆ m_IngredientDestroy

◆ m_Ingredients

◆ m_IngredientSetHealth

◆ m_IngredientsSorted

◆ m_IngredientsToBeDeleted

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

◆ m_IngredientUseSoftSkills

◆ m_IsInstaRecipe

◆ m_Items

◆ m_ItemsToCreate

string m_ItemsToCreate[MAXIMUM_RESULTS]

Referenced by AddResult(), and SpawnItems().

◆ m_MaxDamageIngredient

◆ m_MaxQuantityIngredient

◆ m_MinDamageIngredient

◆ m_MinQuantityIngredient

◆ m_Name

string m_Name

◆ m_NumberOfResults

int m_NumberOfResults

◆ m_RecipeUID

int m_RecipeUID

◆ m_ResultInheritsColor

◆ m_ResultInheritsHealth

◆ m_ResultReplacesIngredient

◆ m_ResultSetFullQuantity

◆ m_ResultSetHealth

◆ m_ResultSetQuantity

◆ m_ResultSpawnDistance

float m_ResultSpawnDistance[MAXIMUM_RESULTS]

Referenced by RecipeBase(), and SpawnItems().

◆ m_ResultToInventory

◆ m_ResultUseSoftSkills

bool m_ResultUseSoftSkills[MAXIMUM_RESULTS]

◆ m_SoundCategories

◆ m_Specialty

◆ MAX_NUMBER_OF_INGREDIENTS

◆ MAXIMUM_RESULTS

const int MAXIMUM_RESULTS = 10

Referenced by RecipeBase().