public virtual void OnHit(EntityManagerBase victim)
 {
     if (onHitDelegate != null)
     {
         onHitDelegate(victim);
     }
 }
 public Damage(int _max, int _min, float _critRate, float _critPower, EntityManagerBase _attacker)
 {
     max       = _max;
     min       = _min;
     critPower = _critPower;
     critRate  = _critRate;
     attacker  = _attacker;
 }
Exemple #3
0
 public void OnExecute(EntityManagerBase victim)
 {
     if (UnityEngine.Random.Range(0, 100) <= 10)
     {
         PlayerManager p = (PlayerManager)aim;
         GameObject    a = UnityEngine.Object.Instantiate(Resources.Load("Prefab/BuffEffects/Buff0Effect"), victim.gameObject.transform.position, new Quaternion()) as GameObject;
         a.GetComponent <Buff0Effect>().damage = new Damage(p.player.level * 10, p.player.level * 8, p.player.finalCritRate, p.player.finalCritPower);
     }
     //在victim的位置制造一个爆炸
 }
Exemple #4
0
 public void OnExecute(EntityManagerBase victim)
 {
     if (aim.GetType() == typeof(PlayerManager))
     {
         PlayerManager pm = aim as PlayerManager;
         int           h  = (int)(pm.player.maxHealth * 2 / 100);
         if (h < 1)
         {
             h = 1;
         }
         pm.OnHealTaken(new Heal(h));
     }
     else if (aim.GetType() == typeof(EnemyManager))
     {
         EnemyManager em = aim as EnemyManager;
         int          h  = (int)(em.enemy.maxHealth * 2 / 100);
         if (h < 1)
         {
             h = 1;
         }
         em.OnHealTaken(new Heal(h));
     }
     //
 }
 public virtual void OnKill(EntityManagerBase victim)
 {
 }
Exemple #6
0
 public override void OnHit(EntityManagerBase victim)
 {
     base.OnHit(victim);
 }