Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
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
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}
AttachActionData ActionData ActionAttach()
Definition actionattach.c:9
ActionBandageSelfCB ActionContinuousBaseCB ActionBandageSelf()
ActionBandageTargetCB ActionContinuousBaseCB ActionBandageTarget()
ActionCraftArmbandCB ActionContinuousBaseCB ActionCraftArmband()
void ActionDetach()
void AddAction(typename actionName)
InventoryLocation.
override bool CanIgniteItem(EntityAI ignite_target=null)
Definition rag.c:56
override bool CanBeSplit()
Definition rag.c:34
override bool CanAssignToQuickbar()
Definition rag.c:81
override bool IsThisIgnitionSuccessful(EntityAI item_source=null)
Definition rag.c:76
override void OnIgnitedThis(EntityAI fire_source)
Definition rag.c:71
override void OnCombine(ItemBase other_item)
Definition rag.c:130
override bool HasFlammableMaterial()
Definition rag.c:46
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:61
override float GetInfectionChance(int system=0, Param param=null)
Definition rag.c:122
override bool CanBeDisinfected()
Definition rag.c:86
override bool CanBeIgnitedBy(EntityAI igniter=null)
Definition rag.c:51
override float GetBandagingEffectivity()
Definition rag.c:117
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
Definition rag.c:3
override void SetActions()
Definition rag.c:92
Base Param Class with no parameters.
Definition param.c:12
override void SetCleanness(int value, bool allow_client=false)
Definition itembase.c:8703
int m_Cleanness
Definition itembase.c:4940
override float GetQuantity()
Definition itembase.c:8398