morphine.c 524 B

123456789101112131415161718192021
  1. class Morphine: Inventory_Base
  2. {
  3. override void SetActions()
  4. {
  5. super.SetActions();
  6. AddAction(ActionInjectMorphineTarget);
  7. AddAction(ActionInjectMorphineSelf);
  8. }
  9. override void OnApply(PlayerBase player)
  10. {
  11. if (!player)
  12. return;
  13. if( player.GetModifiersManager().IsModifierActive(eModifiers.MDF_MORPHINE ) )//effectively resets the timer
  14. {
  15. player.GetModifiersManager().DeactivateModifier( eModifiers.MDF_MORPHINE );
  16. }
  17. player.GetModifiersManager().ActivateModifier( eModifiers.MDF_MORPHINE );
  18. }
  19. };