DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
Rag.c
Go to the documentation of this file.
1class Rag extends ItemBase
2{
3 override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
4 {
5 if (!super.CanSwapEntities(otherItem, otherDestination, destination))
6 {
7 return false;
8 }
9
10 if (Torch.Cast(GetHierarchyParent()) && otherItem.IsInherited(Rag))
11 {
12 return false;
13 }
14
15 return true;
16 }
17
18
19 override bool CanPutAsAttachment(EntityAI parent)
20 {
21 if (!super.CanPutAsAttachment(parent))
22 {
23 return false;
24 }
25
26 if (GetQuantity() > 1 && PlayerBase.Cast(parent))
27 {
28 return false;
29 }
30
31 return true;
32 }
33
34 //================================================================
35 // IGNITION ACTION
36 //================================================================
37 override bool HasFlammableMaterial()
38 {
39 return true;
40 }
41
42 override bool CanBeIgnitedBy(EntityAI igniter = null)
43 {
44 return GetHierarchyParent() == null;
45 }
46
47 override bool CanIgniteItem(EntityAI ignite_target = null)
48 {
49 return false;
50 }
51
52 override bool CanBeCombined(EntityAI other_item, bool reservation_check = true, bool stack_max_limit = false)
53 {
54 if (!super.CanBeCombined(other_item, reservation_check, stack_max_limit))
55 {
56 return false;
57 }
58
59 return Torch.Cast(other_item.GetHierarchyParent()) == null;//when the other rag is attached to the torch, disallow this action
60 }
61
62 override void OnIgnitedThis(EntityAI fire_source)
63 {
64 Fireplace.IgniteEntityAsFireplace(this, fire_source);
65 }
66
67 override bool IsThisIgnitionSuccessful(EntityAI item_source = null)
68 {
69 return Fireplace.CanIgniteEntityAsFireplace(this);
70 }
71
72 override bool CanAssignToQuickbar()
73 {
74 return (!GetInventory().IsAttachment());
75 }
76
77 override bool CanBeDisinfected()
78 {
79 return true;
80 }
81
82
83 override void SetActions()
84 {
85 super.SetActions();
86
91
96
105 }
106
107 override float GetBandagingEffectivity()
108 {
109 return 0.5;
110 }
111
112 override float GetInfectionChance(int system = 0, Param param = null)
113 {
114 if (m_Cleanness == 1)
115 return 0;
116
117 return 0.15;
118 }
119
120 override void OnCombine(ItemBase other_item)
121 {
122 super.OnCombine(other_item);
123 if (m_Cleanness == 1 && other_item.m_Cleanness == 0)
124 SetCleanness(0);
125 }
126}
AttachActionData ActionData ActionAttach()
Definition ActionAttach.c:9
ActionCraftArmbandCB ActionContinuousBaseCB ActionCraftArmband()
void ActionDetach()
void AddAction(typename actionName)
int m_Cleanness
Definition ItemBase.c:4671
override float GetQuantity()
Definition ItemBase.c:7967
void SetCleanness(int value, bool allow_client=false)
Definition ItemBase.c:8300
InventoryLocation.
override bool CanIgniteItem(EntityAI ignite_target=null)
Definition Rag.c:47
override bool CanAssignToQuickbar()
Definition Rag.c:72
override bool IsThisIgnitionSuccessful(EntityAI item_source=null)
Definition Rag.c:67
override void OnIgnitedThis(EntityAI fire_source)
Definition Rag.c:62
override void OnCombine(ItemBase other_item)
Definition Rag.c:120
override bool HasFlammableMaterial()
Definition Rag.c:37
override bool CanPutAsAttachment(EntityAI parent)
Definition Rag.c:19
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
Definition Rag.c:52
override float GetInfectionChance(int system=0, Param param=null)
Definition Rag.c:112
override bool CanBeDisinfected()
Definition Rag.c:77
override bool CanBeIgnitedBy(EntityAI igniter=null)
Definition Rag.c:42
override float GetBandagingEffectivity()
Definition Rag.c:107
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
Definition Rag.c:3
override void SetActions()
Definition Rag.c:83
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12