protected override void DoAction(BossPartStateController controller)
        {
            BossPart bossPart = controller.bossPart;

            Ability ability = AbilityUtils.FindAbilityByName(
                "Boss_MiniDebuffAoeAbility",
                bossPart.GetAbilityAgent().abilitiesMulti
                );

            if (!ability || !(ability is AoeAbility))
            {
                return;
            }
            AoeAbility aoeAbility = (AoeAbility)ability;

            var reachabeEnemies = WorkManager.FindReachableObjects(controller.nearbyEnemies, bossPart.transform.position, ability.range);

            // wait till at least 2 targets are reachable
            if (ability != null && ability.IsReady() && reachabeEnemies.Count > 1)
            {
                var abilityTarget = AoeUtils.GetAoeTargetPosition(
                    ability.range,
                    reachabeEnemies,
                    bossPart.GetPlayer()
                    );

                bossPart.UseAbility(abilityTarget, aoeAbility);
            }
        }
示例#2
0
        protected override void DoAction(BossPartStateController controller)
        {
            BossPart bossPart = controller.bossPart;

            Ability ability = AbilityUtils.FindAbilityByName(
                "Boss_AttackDownAbilityMulti",
                bossPart.GetAbilityAgent().abilitiesMulti
                );
            var reachabeEnemies = WorkManager.FindReachableObjects(controller.nearbyEnemies, bossPart.transform.position, ability.range);

            // wait till at least 2 targets are reachable
            if (ability != null && ability.IsReady() && reachabeEnemies.Count > 1)
            {
                bossPart.UseAbility(reachabeEnemies, ability);
            }
        }
示例#3
0
        protected override void DoAction(BossPartStateController controller)
        {
            BossPart bossPart = controller.bossPart;

            Ability ability = AbilityUtils.FindAbilityByName(
                "Boss_HealingAbility",
                bossPart.GetAbilityAgent().abilities
                );
            var reachabeAllies     = WorkManager.FindReachableObjects(controller.nearbyAllies, bossPart.transform.position, ability.range);
            var damagedMajorAllies = reachabeAllies
                                     .Where(p => p.hitPoints < p.maxHitPoints &&
                                            (!(p is Unit) || ((Unit)p).IsMajor())
                                            )
                                     .ToList();

            // wait till at least 2 targets are reachable
            if (ability != null && ability.IsReady() && damagedMajorAllies.Count > 0)
            {
                var mostDamagedAlliesHP = damagedMajorAllies.Min(p => p.hitPoints);
                var mostDamagedAllies   = damagedMajorAllies.Find(p => p.hitPoints == mostDamagedAlliesHP);

                bossPart.UseAbility(mostDamagedAllies, ability);
            }
        }
 protected virtual void DoAction(BossPartStateController controller)
 {
     // the method is to be overriden
 }