Dayz Explorer 1.28.160049
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 override bool CanBeSplit()
35 {
36 Torch torchParent = Torch.Cast(GetHierarchyParent());
37 if (torchParent && torchParent.GetCompEM() && torchParent.GetCompEM().IsWorking())
38 return false;
39
40 return super.CanBeSplit();
41 }
42
43 //================================================================
44 // IGNITION ACTION
45 //================================================================
46 override bool HasFlammableMaterial()
47 {
48 return true;
49 }
50
51 override bool CanBeIgnitedBy(EntityAI igniter = null)
52 {
53 return GetHierarchyParent() == null;
54 }
55
56 override bool CanIgniteItem(EntityAI ignite_target = null)
57 {
58 return false;
59 }
60
61 override bool CanBeCombined(EntityAI other_item, bool reservation_check = true, bool stack_max_limit = false)
62 {
63 if (!super.CanBeCombined(other_item, reservation_check, stack_max_limit))
64 {
65 return false;
66 }
67
68 return Torch.Cast(other_item.GetHierarchyParent()) == null;//when the other rag is attached to the torch, disallow this action
69 }
70
71 override void OnIgnitedThis(EntityAI fire_source)
72 {
73 Fireplace.IgniteEntityAsFireplace(this, fire_source);
74 }
75
76 override bool IsThisIgnitionSuccessful(EntityAI item_source = null)
77 {
78 return Fireplace.CanIgniteEntityAsFireplace(this);
79 }
80
81 override bool CanAssignToQuickbar()
82 {
83 return (!GetInventory().IsAttachment());
84 }
85
86 override bool CanBeDisinfected()
87 {
88 return true;
89 }
90
91
92 override void SetActions()
93 {
94 super.SetActions();
95
100
103 AddAction(ActionAttach);
106
115 }
116
117 override float GetBandagingEffectivity()
118 {
119 return 0.5;
120 }
121
122 override float GetInfectionChance(int system = 0, Param param = null)
123 {
124 if (m_Cleanness == 1)
125 return 0;
126
127 return 0.15;
128 }
129
130 override void OnCombine(ItemBase other_item)
131 {
132 super.OnCombine(other_item);
133 if (m_Cleanness == 1 && other_item.m_Cleanness == 0)
134 SetCleanness(0);
135 }
136}
ActionBandageSelfCB ActionContinuousBaseCB ActionBandageSelf()
ActionBandageTargetCB ActionContinuousBaseCB ActionBandageTarget()
ActionCraftArmbandCB ActionContinuousBaseCB ActionCraftArmband()
void ActionDetach()
void AddAction(typename actionName)
void SetActions()
InventoryLocation.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
override bool CanAssignToQuickbar()
Definition crafting.c:79
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
override void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.
override bool HasFlammableMaterial()
bool CanBeIgnitedBy(EntityAI igniter=NULL)
override float GetQuantity()
Definition itembase.c:8296
int m_Cleanness
Definition itembase.c:4884
bool CanBeDisinfected()
Definition itembase.c:8090
void OnCombine(ItemBase other_item)
Definition itembase.c:7148
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
Definition itembase.c:7016
float GetBandagingEffectivity()
Definition itembase.c:9337
override bool CanPutAsAttachment(EntityAI parent)
Definition itembase.c:8966
override void SetCleanness(int value, bool allow_client=false)
Definition itembase.c:8598