DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnEndServer()

override void ActionGiveBloodTarget::OnEndServer ( ActionData action_data)
inlineprivate

См. определение в файле ActionGiveBloodTarget.c строка 59

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));
69 plugin.TransmitAgents(action_data.m_MainItem, player_target, AGT_UACTION_TO_PLAYER,blood_obtained );
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
96 if (!(action_data_b.m_Agents & eAgents.CHEMICAL_POISON))//does bloodbag NOT contain nerve agent ?
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 }
eAgents
Определения EAgents.c:3
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
int m_Agents
Определения ActionGiveBloodSelf.c:5
float m_BloodAmount
Определения ActionGiveBloodSelf.c:4
int m_ItemBloodType
Определения ActionGiveBloodSelf.c:3
eModifiers
Определения eModifiers.c:2
const int AGT_UACTION_TO_PLAYER
Определения constants.c:502

Перекрестные ссылки ActionData, AGT_UACTION_TO_PLAYER, ActionGiveBloodSelf::CHEM_AGENT_BLOOD_REMOVAL_MODIFIER, GetPlugin(), PlayerConstants::HEMOLYTIC_REACTION_THRESHOLD, PlayerConstants::HEMOLYTIC_RISK_SHOCK_THRESHOLD, ActionGiveBloodData::m_Agents, ActionGiveBloodData::m_BloodAmount, ActionGiveBloodData::m_ItemBloodType и BloodTypes::MatchBloodCompatibility().