示例#1
0
        public static void DamageMinion(float amount, DamageType type, Minion m)
        {
            float damage = amount;

            if (type == DamageType.Soft && m.AmorType == AmorType.Soft && m.IsAmored == false)
                damage *= 2;
            else if (type == DamageType.Mechanic && m.AmorType == AmorType.Mechanic && m.IsAmored == false)
                damage *= 2;
            else if (type == DamageType.Magic && m.AmorType == AmorType.Magic && m.IsAmored == false)
                damage *= 3;

            if (type == DamageType.AntiAmor)
                m.DamageAmor(damage);

            if (m.IsAmored == true)
                damage /= 3;

            m.DoDamage(damage);
        }
示例#2
0
 public MinionAi(Minion m)
 {
     Attack(m);
 }
示例#3
0
 public void Attack(Minion d)
 {
     Building b = WorldMap.Instance.GetBuildings(Buildings.BuildingType.Depot)[0];
     _currentTask = new MoveToFortressTask(b);
     _currentBehavior = _currentTask.ActivateBehavior(d);
 }
示例#4
0
 protected virtual void OnCollision(Minion m)
 {
     DamageRules.DamageMinion(_damage, _type, m);
     DestroyProjectile();
 }
示例#5
0
        protected override void Fire(Minion m, Vector2 minionPosition, Vector2 towerPosition)
        {
            DamageRules.DamageMinion(_damage, DamageType.Electric, m);

            base.Fire(m, minionPosition, towerPosition);
        }
示例#6
0
 protected virtual void Fire(Minion minion, Vector2 minionPosition, Vector2 towerPosition)
 {
     Fired();
 }
示例#7
0
 public FireBuff(Minion m)
 {
     _m = m;
     Time = 4000;
 }
示例#8
0
 public virtual void Update(float dt, Minion m)
 {
     _timeExisted += dt;
     _secondTick += dt;
     if (_timeExisted >= Time)
         Destroy = true;
     if (_secondTick >= 1000)
     {
         _secondTick = 0;
         SecondTick();
     }
 }