60 {
61 super.OnEndServer(action_data);
62
63 ActionGiveBloodData action_data_b = ActionGiveBloodData.Cast( action_data );
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();
73 bool bloodmatch = BloodTypes.MatchBloodCompatibility(action_data_b.
m_ItemBloodType, bloodtypetarget);
74
75 if ( !bloodmatch )
76 {
77
78
79 if (blood_obtained > PlayerConstants.HEMOLYTIC_RISK_SHOCK_THRESHOLD)
80 {
81 player_target.m_UnconsciousEndTime = -60;
82 player_target.SetHealth("","Shock",0);
83
84 if (blood_obtained > PlayerConstants.HEMOLYTIC_REACTION_THRESHOLD)
85 {
86 player_target.m_ModifiersManager.ActivateModifier(
eModifiers.MDF_HEMOLYTIC_REACTION);
87 }
88 }
89 }
90
91 if ( action_data_b.m_MainItem && action_data_b.m_MainItem.GetQuantity() <= 0.01 )
92 {
93 action_data_b.m_MainItem.SetQuantity(0);
94 }
95
97 {
98 float remove_count_agents = blood_obtained * ActionGiveBloodSelf.CHEM_AGENT_BLOOD_REMOVAL_MODIFIER;
99 player_target.InsertAgent(
eAgents.CHEMICAL_POISON, -remove_count_agents);
100
101 }
102 }
PluginBase GetPlugin(typename plugin_type)
const int AGT_UACTION_TO_PLAYER