DayZ 1.24
Loading...
Searching...
No Matches
Rag.c
Go to the documentation of this file.
1class Rag extends ItemBase
2{
4 {
5 if (!super.CanSwapEntities(otherItem, otherDestination, destination))
6 return false;
7
8 if (Torch.Cast(GetHierarchyParent()) && otherItem.IsInherited(Rag))
9 return false;
10
11 return true;
12 }
13
14
15 override bool CanPutAsAttachment(EntityAI parent)
16 {
17 if (!super.CanPutAsAttachment(parent))
18 return false;
19
20 if (GetQuantity() > 1 && PlayerBase.Cast(parent))
21 return false;
22
23 return true;
24 }
25
26 //================================================================
27 // IGNITION ACTION
28 //================================================================
29 override bool HasFlammableMaterial()
30 {
31 return true;
32 }
33
35 {
36 return GetHierarchyParent() == null;
37 }
38
40 {
41 return false;
42 }
43
44 override bool CanBeCombined(EntityAI other_item, bool reservation_check = true, bool stack_max_limit = false)
45 {
47 return false;
48
49 return Torch.Cast(other_item.GetHierarchyParent()) == null;//when the other rag is attached to the torch, disallow this action
50 }
51
53 {
54 Fireplace.IgniteEntityAsFireplace(this, fire_source);
55 }
56
58 {
59 return Fireplace.CanIgniteEntityAsFireplace(this);
60 }
61
62 override bool CanAssignToQuickbar()
63 {
64 return (!GetInventory().IsAttachment());
65 }
66
67 override bool CanBeDisinfected()
68 {
69 return true;
70 }
71
72
97
98 override float GetBandagingEffectivity()
99 {
100 return 0.5;
101 }
102
103 override float GetInfectionChance(int system = 0, Param param = null)
104 {
105 if (m_Cleanness == 1)
106 return 0;
107
108 return 0.15;
109 }
110
112 {
113 super.OnCombine(other_item);
114 if (m_Cleanness == 1 && other_item.m_Cleanness == 0)
115 SetCleanness(0);
116 }
117}
ActionBandageSelfCB ActionContinuousBaseCB ActionBandageSelf()
ActionBandageTargetCB ActionContinuousBaseCB ActionBandageTarget()
ActionCraftArmbandCB ActionContinuousBaseCB ActionCraftArmband()
void ActionDetach()
void AddAction(typename actionName)
override float GetQuantity()
Definition ItemBase.c:7995
int m_Cleanness
Definition ItemBase.c:4715
void SetCleanness(int value, bool allow_client=false)
Definition ItemBase.c:8357
InventoryLocation.
override bool CanPutAsAttachment(EntityAI parent)
Definition Rag.c:15
override bool CanBeIgnitedBy(EntityAI igniter=null)
Definition Rag.c:34
override void SetActions()
Definition Rag.c:73
override bool HasFlammableMaterial()
Definition Rag.c:29
override float GetBandagingEffectivity()
Definition Rag.c:98
override void OnIgnitedThis(EntityAI fire_source)
Definition Rag.c:52
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
Definition Rag.c:3
override bool CanAssignToQuickbar()
Definition Rag.c:62
override bool IsThisIgnitionSuccessful(EntityAI item_source=null)
Definition Rag.c:57
override void OnCombine(ItemBase other_item)
Definition Rag.c:111
override bool CanIgniteItem(EntityAI ignite_target=null)
Definition Rag.c:39
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
Definition Rag.c:44
override bool CanBeDisinfected()
Definition Rag.c:67
override float GetInfectionChance(int system=0, Param param=null)
Definition Rag.c:103
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12