Example #1
0
        public void Use(List <HexCell> cells)
        {
            ItadakiNoKura passiveAbility = ParentCharacter.Abilities.OfType <ItadakiNoKura>().SingleOrDefault();

            if (passiveAbility != null)
            {
//                    List<Character> enemyCharactersOnMap = Game.Players.Where(p => p != Active.GamePlayer).SelectMany(p => p.Characters).Where(c => c.IsOnMap).ToList();
                List <Character> enemyCharactersOnMap = GetTargetsInRange().GetCharacters();
                int damageValue = passiveAbility.CollectedEnergy / enemyCharactersOnMap.Count;
                enemyCharactersOnMap.ForEach(c =>
                {
                    var damage = new Damage(damageValue, DamageType.Magical);
                    ParentCharacter.Attack(this, c, damage);
                });
                passiveAbility.CollectedEnergyCharacters.Clear();
            }

            Finish();
        }
Example #2
0
        public void Use(List <HexCell> cells)
        {
            List <Character> characters = cells.GetCharacters();

            try
            {
                ItadakiNoKura passiveAbility = ParentCharacter.Abilities.OfType <ItadakiNoKura>().SingleOrDefault();

                characters = characters.Where(c => c.Owner != ParentCharacter.Owner).ToList();
                AnimationPlayer.Add(new Animations.AsterYo(ParentCharacter.CharacterObject.transform, characters.Select(c => c.CharacterObject.transform).ToList()));
                characters.ForEach(targetCharacter =>
                {
                    var damage = new Damage(Damage, DamageType.Magical);
                    ParentCharacter.Attack(this, targetCharacter, damage);
                    passiveAbility?.TryCollectingEnergy(targetCharacter);
                });
                Finish();
            }
            catch (Exception e)
            {
                Console.DebugLog(e.Message);
                OnFailedUseFinish();
            }
        }