DayZ 1.24
Loading...
Searching...
No Matches
ActionCollectBloodTarget.c
Go to the documentation of this file.
8
10{
12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_SALINEBLOODBAGTARGET;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
18 m_Text = "#collect_persons_blood";
19 }
20
26
28 {
29 PlayerBase ntarget = PlayerBase.Cast(action_data.m_Target.GetObject());
30
31 if (!ntarget)
32 return;
33
35 Class.CastTo(nacdata, action_data.m_ActionComponent.GetACData());
36 float delta = 0;
37 if (nacdata)
39
40 if (delta > 0)
41 {
43 action_data.m_Player.ServerReplaceItemInHandsWithNew(lambda);
44 }
45 //action_data.m_Player.GetItemInHands().SetQuantity();
46 }
47};
48
50{
54
56
58 {
59 float maxQuantity;
60 float quantitySet;
61 super.CopyOldPropertiesToNew(old_item, new_item);
62
63 if (new_item)
64 {
67
68 ItemBase.Cast(old_item).TransferModifiers(m_Target);
69 MiscGameplayFunctions.TransferItemProperties(old_item_IB, new_item_IB, true, false, true);
70 ItemBase.Cast(new_item).SetLiquidType(m_Target.GetStatBloodType().Get());
71 m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
72
73 maxQuantity = ItemBase.Cast(new_item).GetQuantityMax();
75 ItemBase.Cast(new_item).SetQuantity(quantitySet);
76 m_Target.AddHealth("", "Blood", -quantitySet);
77
78 if (m_Player.HasBloodTypeVisible())
79 BloodContainerBase.Cast(new_item).SetBloodTypeVisible(true);
80 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
82 }
83 else
84 Debug.LogError("ActionCollectBloodTargetLambda: failed to create new item", "static");
85 }
86};
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
PluginBase GetPlugin(typename plugin_type)
ActionData m_ActionData
override void OnEndServer(ActionData action_data)
void ActionCollectBloodTargetLambda(EntityAI old_item, string new_item_type, PlayerBase player, float specialtyWeight, PlayerBase target, float delta)
override void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
ref CABase m_ActionComponent
Definition ActionBase.c:30
Definition CCTMan.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Debug.c:14
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:341
adds automatic QuickBar handling
const float DEFAULT
const float COLLECT_BLOOD
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
const int AGT_UACTION_TO_ITEM
Definition constants.c:474
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.