SHARE
TWEET

Untitled

a guest Jul 19th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using static CGameFactory;
  5.  
  6. public class CModifier_Seism : CModifier
  7. {
  8.     private int damage, damage_interval;
  9.     public sealed override void OnCreated()
  10.     {
  11. #if SERVER
  12.         Vector3 pos = ((CAres_Seism) GetAbility()).GetSeismPos();
  13.  
  14.         GetParent().Stop();
  15.  
  16.         GetParent().ForceMoveTo(pos, 0.75f, GetDuration());
  17.  
  18.         ABILITY_RETRIEVE_INT_VALUE(this, ref damage, "damage");
  19.         ABILITY_RETRIEVE_INT_VALUE(this, ref damage_interval, "damage_interval");
  20.  
  21.         StartIntervalThink(1f);
  22.         OnIntervalThink();
  23. #endif
  24.     }
  25.  
  26.     protected override void OnExpire() //// On modifier expired on server and client!! Both-sided!!
  27.     {
  28. #if SERVER
  29.         ApplyDamage(new SDamageInfo()
  30.         {
  31.             attacker = GetCaster(),
  32.             damage = damage,
  33.             ability = GetAbility(),
  34.             eDamageType = EDamageType.DAMAGE_TYPE_MAGICAL,
  35.             victim = GetParent(),
  36.             damage_flags = (int)EDamageFlag.DAMAGE_FLAG_NONE
  37.         });
  38. #endif
  39.     }
  40.  
  41.     public sealed override void OnIntervalThink()
  42.     {
  43. #if SERVER
  44.         ApplyDamage(new SDamageInfo()
  45.         {
  46.             attacker = GetCaster(),
  47.             damage = damage,
  48.             ability = GetAbility(),
  49.             eDamageType = EDamageType.DAMAGE_TYPE_MAGICAL,
  50.             victim = GetParent(),
  51.             damage_flags = (int)EDamageFlag.DAMAGE_FLAG_NONE
  52.         });
  53. #endif
  54.     }
  55.  
  56.     public override bool IsDebuff()
  57.     {
  58.         return true;
  59.     }
  60.  
  61.     public sealed override bool IsAuraModifier()
  62.     {
  63.         return true;
  64.     }
  65.  
  66.     public override bool IsHidden()
  67.     {
  68.         return true;
  69.     }
  70.  
  71.     public override string GetModifierLabel()
  72.     {
  73.         return "modifier_ares_seism"; //test
  74.     }
  75.  
  76.     public override Dictionary<EModifiersStates, bool> CheckState()
  77.     {
  78.         return new Dictionary<EModifiersStates, bool>()
  79.         {
  80.             {EModifiersStates.MODIFIER_STATE_COMMAND_RESTRICTED, true}
  81.         };
  82.     }
  83. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top