Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
rag.c
Go to the documentation of this file.
1 class 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 
97 
106  }
107 
108  override float GetBandagingEffectivity()
109  {
110  return 0.5;
111  }
112 
113  override float GetInfectionChance(int system = 0, Param param = null)
114  {
115  if (m_Cleanness == 1)
116  return 0;
117 
118  return 0.15;
119  }
120 
121  override void OnCombine(ItemBase other_item)
122  {
123  super.OnCombine(other_item);
124  if (m_Cleanness == 1 && other_item.m_Cleanness == 0)
125  SetCleanness(0);
126  }
127 }
ItemBase
Definition: inventoryitem.c:730
OnIgnitedThis
override void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.
Definition: fireworksbase.c:96
ActionCraftImprovisedHeadCover
Definition: actioncraftimprovisedheadcover.c:13
ActionCraftImprovisedLegsCover
Definition: actioncraftimprovisedlegscover.c:12
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
CanBeDisinfected
bool CanBeDisinfected()
Definition: itembase.c:3097
ActionDetach
void ActionDetach()
Definition: actiondetach.c:10
ActionGagSelf
Definition: actiongagself.c:1
m_Cleanness
int m_Cleanness
Definition: itembase.c:36
ActionGagTarget
Definition: actiongagtarget.c:1
SetCleanness
void SetCleanness(int value, bool allow_client=false)
Definition: itembase.c:3678
InventoryLocation
InventoryLocation.
Definition: inventorylocation.c:27
CanPutAsAttachment
override bool CanPutAsAttachment(EntityAI parent)
Definition: itembase.c:4021
GetQuantity
override float GetQuantity()
Definition: itembase.c:3316
ActionCraftImprovisedEyePatch
Definition: actioncraftimprovisedeyepatch.c:9
ActionBandageSelf
ActionBandageSelfCB ActionContinuousBaseCB ActionBandageSelf()
Definition: actionbandageself.c:17
ActionCraftImprovisedFeetCover
Definition: actioncraftimprovisedfeetcover.c:12
ActionCraftImprovisedHandsCover
Definition: actioncraftimprovisedhandscover.c:12
PlayerBase
Definition: playerbaseclient.c:1
HasFlammableMaterial
override bool HasFlammableMaterial()
Definition: fireworksbase.c:41
CanAssignToQuickbar
override bool CanAssignToQuickbar()
Definition: crafting.c:79
ActionRefuelTorch
Definition: actionrefueltorch.c:1
ActionCraftImprovisedTorsoCover
Definition: actioncraftimprovisedtorsocover.c:12
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
SetActions
void SetActions()
Definition: advancedcommunication.c:79
ActionCreateIndoorFireplace
Definition: actioncreateindoorfireplace.c:1
ActionCreateIndoorOven
Definition: actioncreateindooroven.c:1
OnCombine
void OnCombine(ItemBase other_item)
Definition: itembase.c:2084
ActionAttach
ActionAttachWheels ActionAttach
CanSwapEntities
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
Definition: fireplacebase.c:2491
ActionCraftArmband
ActionCraftBoltsCB ActionCraftArmband
GetInfectionChance
float GetInfectionChance(int system=0, Param param=null)
Infection chance while/after using this item, originally used for wound infection after bandaging,...
Definition: itembase.c:656
CanBeCombined
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
Definition: itembase.c:1956
ActionBandageTarget
ActionBurnSewSelfCB ActionBandageTarget
ActionCraftImprovisedFaceCover
Definition: actioncraftimprovisedfacecover.c:12
GetBandagingEffectivity
float GetBandagingEffectivity()
Definition: itembase.c:4409
CanBeIgnitedBy
override protected bool CanBeIgnitedBy(EntityAI igniter=NULL)
Definition: fireworksbase.c:102
EntityAI
Definition: building.c:5