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

◆ OnEndServer()

override void ActionGiveBloodSelf::OnEndServer ( ActionData action_data)
inlineprivate

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

73 {
74 super.OnEndServer(action_data);
75
76 ActionGiveBloodData action_data_b = ActionGiveBloodData.Cast( action_data );
77 float blood_obtained = action_data_b.m_BloodAmount - action_data_b.m_MainItem.GetQuantity();
78
79 PluginTransmissionAgents plugin = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
80 plugin.TransmitAgentsEx(action_data.m_MainItem, action_data.m_Player, AGT_UACTION_TO_PLAYER,blood_obtained ,action_data_b.m_Agents);
81
82
83 int bloodtypetarget = action_data_b.m_Player.GetStatBloodType().Get();
84 bool bloodmatch = BloodTypes.MatchBloodCompatibility(action_data_b.m_ItemBloodType, bloodtypetarget);
85
86 if ( !bloodmatch )
87 {
88
89
90 if (blood_obtained > PlayerConstants.HEMOLYTIC_RISK_SHOCK_THRESHOLD)
91 {
92 action_data_b.m_Player.m_UnconsciousEndTime = -60;
93 action_data_b.m_Player.SetHealth("","Shock",0);
94
95 if (blood_obtained > PlayerConstants.HEMOLYTIC_REACTION_THRESHOLD)
96 {
97 action_data_b.m_Player.m_ModifiersManager.ActivateModifier(eModifiers.MDF_HEMOLYTIC_REACTION);
98 }
99 }
100 }
101
102 if ( action_data_b.m_MainItem && action_data_b.m_MainItem.GetQuantity() <= 0.01 )
103 {
104 action_data_b.m_MainItem.SetQuantity(0);
105 }
106
107 if (!(action_data_b.m_Agents & eAgents.CHEMICAL_POISON))//does bloodbag NOT contain nerve agent ?
108 {
109 float remove_count_agents = blood_obtained * CHEM_AGENT_BLOOD_REMOVAL_MODIFIER;
110 action_data.m_Player.InsertAgent(eAgents.CHEMICAL_POISON, -remove_count_agents);
111
112 }
113 }
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
const float CHEM_AGENT_BLOOD_REMOVAL_MODIFIER
Определения ActionGiveBloodSelf.c:18
eModifiers
Определения eModifiers.c:2
const int AGT_UACTION_TO_PLAYER
Определения constants.c:502

Перекрестные ссылки ActionData, AGT_UACTION_TO_PLAYER, 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().