18 const float CHEM_AGENT_BLOOD_REMOVAL_MODIFIER = 0.25;
21 m_CallbackClass = ActionGiveBloodSelfCB;
30 override void CreateConditionComponents()
36 override bool HasTarget()
49 if ( super.SetupAction(player, target, item, action_data, extra_data ) )
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();
60 override void OnEndAnimationLoopServer(
ActionData action_data )
64 if ( action_data.m_MainItem.IsKindOf(
"BloodSyringe") )
67 lambda.SetTransferParams(
true,
true,
true);
68 MiscGameplayFunctions.TurnItemIntoItemEx(action_data.m_Player, lambda);
74 override void OnEndServer(
ActionData action_data)
78 float blood_obtained = action_data_b.m_BloodAmount - action_data_b.m_MainItem.GetQuantity();
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);
84 int bloodtypetarget = action_data_b.m_Player.GetStatBloodType().Get();
85 bool bloodmatch =
BloodTypes.MatchBloodCompatibility(action_data_b.m_ItemBloodType, bloodtypetarget);
93 action_data_b.m_Player.m_UnconsciousEndTime = -60;
94 action_data_b.m_Player.SetHealth(
"",
"Shock",0);
98 action_data_b.m_Player.m_ModifiersManager.ActivateModifier(
eModifiers.MDF_HEMOLYTIC_REACTION);
103 if ( action_data_b.m_MainItem && action_data_b.m_MainItem.GetQuantity() <= 0.01 )
105 action_data_b.m_MainItem.SetQuantity(0);
108 if (!(action_data_b.m_Agents &
eAgents.CHEMICAL_POISON))
110 float remove_count_agents = blood_obtained * CHEM_AGENT_BLOOD_REMOVAL_MODIFIER;
111 action_data.m_Player.InsertAgent(
eAgents.CHEMICAL_POISON, -remove_count_agents);