anticheminjector.c 667 B

12345678910111213141516171819202122232425262728
  1. class AntiChemInjector: Inventory_Base
  2. {
  3. override void SetActions()
  4. {
  5. super.SetActions();
  6. AddAction(ActionInjectTarget);
  7. AddAction(ActionInjectSelf);
  8. }
  9. override void OnApply(PlayerBase player)
  10. {
  11. if (!player)
  12. return;
  13. player.GiveShock(100);
  14. bool in_cont_stage3 = player.GetModifiersManager().IsModifierActive(eModifiers.MDF_CONTAMINATION3);
  15. if ( in_cont_stage3 )
  16. {
  17. player.m_AgentPool.SetAgentCount(eAgents.CHEMICAL_POISON, ContaminationStage2Mdfr.AGENT_THRESHOLD_ACTIVATE);//set the agent count to be the same as at the benigning of stage 2
  18. }
  19. else
  20. {
  21. player.m_AgentPool.SetAgentCount(eAgents.CHEMICAL_POISON, 0);
  22. }
  23. }
  24. };