DayZ 1.24
Loading...
Searching...
No Matches
ActionGiveBloodTarget.c
Go to the documentation of this file.
8
10{
12 {
15
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_SALINEBLOODBAGTARGET;
17 m_FullBody = true;
18 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
19 m_Text = "#give_blood_person";
20 }
21
27
33
35 {
36 if (super.SetupAction(player, target, item, action_data, extra_data))
37 {
39 action_data_b.m_ItemBloodType = action_data.m_MainItem.GetLiquidType();
40 action_data_b.m_BloodAmount = action_data.m_MainItem.GetQuantity();
41 action_data_b.m_Agents = action_data.m_MainItem.GetAgents();
42 return true;
43 }
44 return false;
45 }
46
48 {
49 //OnFinishProgressServer(action_data);
50
51 if (action_data.m_MainItem.IsKindOf("BloodSyringe"))
52 {
53 SyringeLambda lambda = new SyringeLambda(action_data.m_MainItem, "Syringe", action_data.m_Player);
54 lambda.SetTransferParams(true, true, true);
55 MiscGameplayFunctions.TurnItemIntoItemEx(action_data.m_Player, lambda);
56 }
57
58 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
59 }
60
62 {
64 float blood_obtained = action_data_b.m_BloodAmount - action_data_b.m_MainItem.GetQuantity();
65 PlayerBase player_target = PlayerBase.Cast(action_data_b.m_Target.GetObject());
66
67
68 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
70
71
72 int bloodtypetarget = player_target.GetStatBloodType().Get();
74
75 if (!bloodmatch)
76 {
77
78
80 {
81 player_target.m_UnconsciousEndTime = -60;
82 player_target.SetHealth("", "Shock", 0);
83
85 player_target.m_ModifiersManager.ActivateModifier(eModifiers.MDF_HEMOLYTIC_REACTION);
86 }
87 }
88
89 if (action_data_b.m_MainItem && action_data_b.m_MainItem.GetQuantity() <= 0.01)
90 action_data_b.m_MainItem.SetQuantity(0);
91
92 if (!(action_data_b.m_Agents & eAgents.CHEMICAL_POISON))//does bloodbag NOT contain nerve agent ?
93 {
95 player_target.InsertAgent(eAgents.CHEMICAL_POISON, -remove_count_agents);
96
97 }
98 }
99};
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
eAgents
Definition EAgents.c:3
PluginBase GetPlugin(typename plugin_type)
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
const float CHEM_AGENT_BLOOD_REMOVAL_MODIFIER
override void CreateActionComponent()
override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
override void CreateConditionComponents()
override ActionData CreateActionData()
override void OnEndServer(ActionData action_data)
override void OnEndAnimationLoopServer(ActionData action_data)
static bool MatchBloodCompatibility(int bloodtypetarget, int bloodtype)
Definition BloodType.c:36
Definition CCTMan.c:2
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
const float DEFAULT
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