DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс PrepareAnimal

Закрытые члены

override void Init ()
 
override bool CanDo (ItemBase ingredients[], PlayerBase player)
 
override void Do (ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
 
override void Init ()
 
override bool CanDo (ItemBase ingredients[], PlayerBase player)
 
override void Do (ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
 
override void Init ()
 
override bool CanDo (ItemBase ingredients[], PlayerBase player)
 
override void Do (ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
 

Подробное описание

Методы

◆ CanDo() [1/3]

override bool CanDo ( ItemBase ingredients[],
PlayerBase player )
inlineprivate
28 {
29 if (ingredients[0].GetHealthLevel() == GameConstants.STATE_RUINED)
30 {
31 return false;
32 }
33 return true;
34 }
Definition constants.c:638
Definition EntityAI.c:95
const int STATE_RUINED
Definition constants.c:807

Перекрестные ссылки GameConstants::STATE_RUINED.

◆ CanDo() [2/3]

override bool CanDo ( ItemBase ingredients[],
PlayerBase player )
inlineprivate
39 {
40 return true;
41 }

◆ CanDo() [3/3]

override bool CanDo ( ItemBase ingredients[],
PlayerBase player )
inlineprivate
38 {
39 return true;
40 }

◆ Do() [1/3]

override void Do ( ItemBase ingredients[],
PlayerBase player,
array< ItemBase > results,
float specialty_weight )
inlineprivate
37 {
40
42 for (int i=0; i < steakCount; i++)
43 {
44 ItemBase result = ItemBase.Cast(player.SpawnEntityOnGroundOnCursorDir("ChickenBreastMeat", DEFAULT_SPAWN_DISTANCE));
45 MiscGameplayFunctions.TransferItemProperties(deadChicken, result);
46 result.SetQuantityNormalized(Math.RandomFloatInclusive(0.8,1));
47 }
48
49 ItemBase resultFeathers = ItemBase.Cast(player.SpawnEntityOnGroundOnCursorDir("ChickenFeather", DEFAULT_SPAWN_DISTANCE));
50 MiscGameplayFunctions.TransferItemProperties(deadChicken, resultFeathers);
51 resultFeathers.SetQuantity(Math.RandomIntInclusive(5,15));
52
53 MiscGameplayFunctions.TransferItemProperties(deadChicken, resultBones);
54 resultBones.SetQuantity(Math.RandomIntInclusive(2,5));
55
57 lifespan.UpdateBloodyHandsVisibility( player, true );
58 }
void PluginLifespan()
Definition PluginLifespan.c:45
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316
const float DEFAULT_SPAWN_DISTANCE
Definition RecipeBase.c:3
Definition InventoryItem.c:731
Definition EnMath.c:7
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки DEFAULT_SPAWN_DISTANCE, GetPlugin(), PluginLifespan(), Math::RandomFloatInclusive() и Math::RandomIntInclusive().

◆ Do() [2/3]

override void Do ( ItemBase ingredients[],
PlayerBase player,
array< ItemBase > results,
float specialty_weight )
inlineprivate
44 {
47
49 for (int i=0; i < legCount; i++)
50 {
51 ItemBase result = ItemBase.Cast(player.SpawnEntityOnGroundOnCursorDir("FoxSteakMeat", DEFAULT_SPAWN_DISTANCE));
52 MiscGameplayFunctions.TransferItemProperties(deadRabbit, result);
53 result.SetQuantityNormalized(Math.RandomFloatInclusive(0.8,1));
54 }
55
56
57 MiscGameplayFunctions.TransferItemProperties(deadRabbit, resultBones);
58 resultBones.SetQuantity(Math.RandomIntInclusive(2,5));
59
60
62 lifespan.UpdateBloodyHandsVisibility( player, true );
63 }

Перекрестные ссылки DEFAULT_SPAWN_DISTANCE, GetPlugin(), PluginLifespan(), Math::RandomFloatInclusive() и Math::RandomIntInclusive().

◆ Do() [3/3]

override void Do ( ItemBase ingredients[],
PlayerBase player,
array< ItemBase > results,
float specialty_weight )
inlineprivate
43 {
46
48 for (int i=0; i < legCount; i++)
49 {
50 ItemBase result = ItemBase.Cast(player.SpawnEntityOnGroundOnCursorDir("RabbitLegMeat", DEFAULT_SPAWN_DISTANCE));
51 MiscGameplayFunctions.TransferItemProperties(deadRabbit, result);
52 result.SetQuantityNormalized(Math.RandomFloatInclusive(0.8,1));
53 }
54
55 MiscGameplayFunctions.TransferItemProperties(deadRabbit, resultBones);
56 resultBones.SetQuantity(Math.RandomIntInclusive(2,5));
57
59 lifespan.UpdateBloodyHandsVisibility( player, true );
60 }

Перекрестные ссылки DEFAULT_SPAWN_DISTANCE, GetPlugin(), PluginLifespan(), Math::RandomFloatInclusive() и Math::RandomIntInclusive().

◆ Init() [1/3]

override void Init ( )
inlineprivate
4 {
5 super.Init();
6
7 //----------------------------------------------------------------------------------------------------------------------
8 //ingredient 1
9 InsertIngredient(0,"DeadChicken_ColorBase");//you can insert multiple ingredients this way
10 m_IngredientAddHealth[0] = 0; // 0 = do nothing
11 m_IngredientSetHealth[0] = -1; // -1 = do nothing
12 m_IngredientAddQuantity[0] = 0; // 0 = do nothing
13 m_IngredientDestroy[0] = true; // true = destroy, false = do nothing
14
15 //----------------------------------------------------------------------------------------------------------------------
16 AddResult("Bone");//add results here
17 m_ResultSetFullQuantity[0] = false; // true = set full quantity, false = do nothing
18 m_ResultSetQuantity[0] = 2; // -1 = do nothing
19 m_ResultSetHealth[0] = -1; // -1 = do nothing
20 m_ResultInheritsHealth[0] = 0; // (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
21 m_ResultInheritsColor[0] = -1; // (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
22 m_ResultToInventory[0] = -2; // (value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
23 m_ResultReplacesIngredient[0] = 0; // (value) == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
24
25 }

◆ Init() [2/3]

override void Init ( )
inlineprivate
4 {
5 super.Init();
6
7 //----------------------------------------------------------------------------------------------------------------------
8 //ingredient 1
9 InsertIngredient(0,"DeadFox");//you can insert multiple ingredients this way
10
11 m_IngredientAddHealth[0] = 0;// 0 = do nothing
12 m_IngredientSetHealth[0] = -1; // -1 = do nothing
13 m_IngredientAddQuantity[0] = 0;// 0 = do nothing
14 m_IngredientDestroy[0] = true;//true = destroy, false = do nothing
15
16 //----------------------------------------------------------------------------------------------------------------------
17 //result1
18 AddResult("Bone");//add results here
19 m_ResultSetFullQuantity[0] = false; //true = set full quantity, false = do nothing
20 m_ResultSetQuantity[0] = -1; // -1 = do nothing
21 m_ResultSetHealth[0] = -1; // -1 = do nothing
22 m_ResultInheritsHealth[0] = 0; // (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
23 m_ResultInheritsColor[0] = -1; // (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
24 m_ResultToInventory[0] = -2; // (value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
25 m_ResultReplacesIngredient[0] = 0; // (value) == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
26
27 //result2
28 AddResult("FoxPelt");//add results here
29 m_ResultSetFullQuantity[1] = false; //true = set full quantity, false = do nothing
30 m_ResultSetQuantity[1] = -1; // -1 = do nothing
31 m_ResultSetHealth[1] = -1; // -1 = do nothing
32 m_ResultInheritsHealth[1] = 0; // (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
33 m_ResultInheritsColor[1] = -1; // (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
34 m_ResultToInventory[1] = -2; // (value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
35 m_ResultReplacesIngredient[1] = 0; // (value) == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
36 }

◆ Init() [3/3]

override void Init ( )
inlineprivate
4 {
5 super.Init();
6
7 //----------------------------------------------------------------------------------------------------------------------
8 //ingredient 1
9 InsertIngredient(0,"DeadRabbit"); //you can insert multiple ingredients this way
10 m_IngredientAddHealth[0] = 0; // 0 = do nothing
11 m_IngredientSetHealth[0] = -1; // -1 = do nothing
12 m_IngredientAddQuantity[0] = 0; // 0 = do nothing
13 m_IngredientDestroy[0] = true; // true = destroy, false = do nothing
14
15 //----------------------------------------------------------------------------------------------------------------------
16 //result1
17 AddResult("Bone");//add results here
18 m_ResultSetFullQuantity[0] = false; // true = set full quantity, false = do nothing
19 m_ResultSetQuantity[0] = -1; // -1 = do nothing
20 m_ResultSetHealth[0] = -1; // -1 = do nothing
21 m_ResultInheritsHealth[0] = 0; // (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
22 m_ResultInheritsColor[0] = -1; // (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
23 m_ResultToInventory[0] = -2; // (value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
24 m_ResultReplacesIngredient[0] = 0; // (value) == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
25
26 //result2
27 AddResult("RabbitPelt"); // add results here
28 m_ResultSetFullQuantity[1] = false; // true = set full quantity, false = do nothing
29 m_ResultSetQuantity[1] = -1; // -1 = do nothing
30 m_ResultSetHealth[1] = -1; // -1 = do nothing
31 m_ResultInheritsHealth[1] = 0; // (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
32 m_ResultInheritsColor[1] = -1; // (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
33 m_ResultToInventory[1] = -2; // (value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
34 m_ResultReplacesIngredient[1] = 0; // (value) == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
35 }

Объявления и описания членов классов находятся в файлах: