DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PrepareAnimal.c
См. документацию.
1class PrepareAnimal extends RecipeBase
2{
3 override void Init()
4 {
5 m_Name = "#skin";
6 m_IsInstaRecipe = false; // should this recipe be performed instantly without animation
7 m_AnimationLength = 1.5; // animation length in relative time units
8 m_RecipeUID = DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING;
9
10 //----------------------------------------------------------------------------------------------------------------------
11 //conditions
12 m_MinDamageIngredient[0] = -1; // -1 = disable check
13 m_MaxDamageIngredient[0] = 3; // -1 = disable check
14 m_MinQuantityIngredient[0] = -1; // -1 = disable check
15 m_MaxQuantityIngredient[0] = -1; // -1 = disable check
16
21
22 //----------------------------------------------------------------------------------------------------------------------
23 //INGREDIENTS
24 //ingredient 1
25 InsertIngredient(1,"Sickle", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true); //you can insert multiple ingredients this way
26 InsertIngredient(1,"KukriKnife", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
27 InsertIngredient(1,"FangeKnife", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
28 InsertIngredient(1,"Hacksaw", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
29 InsertIngredient(1,"HandSaw", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
30 InsertIngredient(1,"KitchenKnife", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
31 InsertIngredient(1,"SteakKnife", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
32 InsertIngredient(1,"StoneKnife", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
33 InsertIngredient(1,"Cleaver", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
34 InsertIngredient(1,"CombatKnife", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
35 InsertIngredient(1,"HuntingKnife", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
36 InsertIngredient(1,"Machete", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
37 InsertIngredient(1,"CrudeMachete", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
38 InsertIngredient(1,"OrientalMachete", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
39 InsertIngredient(1,"WoodAxe", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
40 InsertIngredient(1,"Hatchet", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
41 InsertIngredient(1,"FirefighterAxe", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
42 InsertIngredient(1,"Sword", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
43 InsertIngredient(1,"AK_Bayonet", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
44 InsertIngredient(1,"M9A1_Bayonet", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
45 InsertIngredient(1,"SKS_Bayonet", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
46 InsertIngredient(1,"BoneKnife", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
47 InsertIngredient(1,"Screwdriver", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
48 InsertIngredient(1,"Iceaxe", DayZPlayerConstants.CMD_ACTIONFB_ANIMALSKINNING, true);
49
50 m_IngredientAddHealth[1] = -6; // 0 = do nothing
51 m_IngredientSetHealth[1] = -1; // -1 = do nothing
52 m_IngredientAddQuantity[1] = 0; // 0 = do nothing
53 m_IngredientDestroy[1] = false; // false = do nothing
54 }
55
56 //final check for recipe's validity
57 override bool CanDo(ItemBase ingredients[], PlayerBase player)
58 {
59 return !ingredients[0].GetIsFrozen();
60 }
61
62 //gets called upon recipe's completion
63 override void Do(ItemBase ingredients[], PlayerBase player, array<ItemBase> results, float specialty_weight)
64 {
65 ItemBase ingredient = ingredients[0];
66
67 for (int i=0; i < results.Count(); ++i)
68 {
69 //Transfer current food state
70 MiscGameplayFunctions.TransferItemProperties(ingredient, results[i]);
71 results[i].SetQuantityNormalized(ingredient.GetQuantityNormalized());
72 }
73
74 SetBloodyHands(ingredients, player);
75 }
76
77 protected void SetBloodyHands(ItemBase ingredients[], PlayerBase player)
78 {
79 ItemBase ingredient = ingredients[0];
80
82 lifespan.UpdateBloodyHandsVisibility(player, true);
83 player.SetBloodyHandsPenaltyChancePerAgent(eAgents.SALMONELLA, ingredient.GetSkinningBloodInfectionChance(eAgents.SALMONELLA));
84 }
85}
string m_Name
Определения 3_Game/DayZ/InventoryItemType.c:34
eAgents
Определения EAgents.c:3
void PluginLifespan()
Определения PluginLifespan.c:45
void SetBloodyHands(PlayerBase player, bool show)
Определения PluginLifespan.c:449
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:325
float m_IngredientAddHealth[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:49
bool m_IsInstaRecipe
Определения RecipeBase.c:40
float m_IngredientSetHealth[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:51
float m_MinDamageIngredient[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:45
float m_MaxQuantityIngredient[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:44
void InsertIngredient(int index, string ingredient, DayZPlayerConstants uid=BASE_CRAFT_ANIMATION_ID, bool showItem=false)
Определения RecipeBase.c:159
float m_AnimationLength
Определения RecipeBase.c:38
float m_MaxDamageIngredient[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:46
int m_RecipeUID
Определения RecipeBase.c:37
float m_IngredientAddQuantity[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:50
float m_MinQuantityIngredient[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:43
bool m_IngredientDestroy[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:52
Определения PlayerBaseClient.c:2
Определения PrepareChicken.c:2
override bool CanDo(ItemBase ingredients[], PlayerBase player)
Определения PrepareAnimal.c:57
override void Do(ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
Определения PrepareAnimal.c:63
void SetBloodyHands(ItemBase ingredients[], PlayerBase player)
Определения PrepareAnimal.c:77
override void Init()
Определения PrepareAnimal.c:3
Определения AttachHolster.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602