DayZ 1.24
Loading...
Searching...
No Matches
ActionGiveBloodSelf.c
Go to the documentation of this file.
14};
15
17{
20 {
23
24 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_SALINEBLOODBAG;
25 m_FullBody = true;
26 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
27 m_Text = "#give_blood";
28 }
29
35
36 override bool HasTarget()
37 {
38 return false;
39 }
40
46
48 {
49 if (super.SetupAction(player, target, item, action_data, extra_data))
50 {
52 action_data_b.m_ItemBloodType = action_data.m_MainItem.GetLiquidType();
53 action_data_b.m_BloodAmount = action_data.m_MainItem.GetQuantity();
54 action_data_b.m_Agents = action_data.m_MainItem.GetAgents();
55 return true;
56 }
57 return false;
58 }
59
61 {
62 //OnFinishProgressServer(action_data);
63
64 if (action_data.m_MainItem.IsKindOf("BloodSyringe"))
65 {
66 SyringeLambda lambda = new SyringeLambda(action_data.m_MainItem, "Syringe", action_data.m_Player);
67 lambda.SetTransferParams(true, true, true);
68 MiscGameplayFunctions.TurnItemIntoItemEx(action_data.m_Player, lambda);
69 }
70
71 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
72 }
73
75 {
76
78 float blood_obtained = action_data_b.m_BloodAmount - action_data_b.m_MainItem.GetQuantity();
79
80 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
81 plugin.TransmitAgentsEx(action_data.m_MainItem, action_data.m_Player, AGT_UACTION_TO_PLAYER, blood_obtained, action_data_b.m_Agents);
82
83
84 int bloodtypetarget = action_data_b.m_Player.GetStatBloodType().Get();
86
87 if (!bloodmatch)
88 {
89
90
92 {
93 action_data_b.m_Player.m_UnconsciousEndTime = -60;
94 action_data_b.m_Player.SetHealth("", "Shock", 0);
95
97 action_data_b.m_Player.m_ModifiersManager.ActivateModifier(eModifiers.MDF_HEMOLYTIC_REACTION);
98 }
99 }
100
101 if (action_data_b.m_MainItem && action_data_b.m_MainItem.GetQuantity() <= 0.01)
102 action_data_b.m_MainItem.SetQuantity(0);
103
104 if (!(action_data_b.m_Agents & eAgents.CHEMICAL_POISON))//does bloodbag NOT contain nerve agent ?
105 {
107 action_data.m_Player.InsertAgent(eAgents.CHEMICAL_POISON, -remove_count_agents);
108
109 }
110 }
111};
112
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
ActionEmptyMagazine CreateActionComponent
eAgents
Definition EAgents.c:3
PluginBase GetPlugin(typename plugin_type)
override void OnEndAnimationLoopServer(ActionData action_data)
override void OnEndServer(ActionData action_data)
override ActionData CreateActionData()
override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
override bool HasTarget()
override void CreateConditionComponents()
const float CHEM_AGENT_BLOOD_REMOVAL_MODIFIER
static bool MatchBloodCompatibility(int bloodtypetarget, int bloodtype)
Definition BloodType.c:36
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
static const float HEMOLYTIC_RISK_SHOCK_THRESHOLD
static const float HEMOLYTIC_REACTION_THRESHOLD
void SyringeLambda(EntityAI old_item, string new_item_type, PlayerBase player)
const float BLOOD
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
eModifiers
Definition eModifiers.c:2
const int AGT_UACTION_TO_PLAYER
Definition constants.c:473