Exemple #1
0
        protected override bool InternalApply()
        {
            var bombSpell       = SpellManager.Instance.GetSpellBombTemplate(Dice.DiceNum);
            var monsterTemplate = MonsterManager.Instance.GetMonsterGrade(Dice.DiceNum, Dice.DiceFace);

            var targets = GetAffectedActors();

            if (targets.Any())
            {
                var spell = new Spell(bombSpell.InstantReactionSpell, Spell.CurrentLevel);
                var cast  = SpellManager.Instance.GetSpellCastHandler(Caster, spell, TargetedCell, Critical);

                cast.Initialize();
                cast.Execute();
            }
            else
            {
                if (!Caster.CanSummonBomb())
                {
                    return(false);
                }

                var bomb = new SummonedBomb(Fight.GetNextContextualId(), Caster.Team, bombSpell, monsterTemplate, Caster,
                                            TargetedCell)
                {
                    SummoningEffect = this
                };

                ActionsHandler.SendGameActionFightSummonMessage(Fight.Clients, bomb);

                Caster.AddBomb(bomb);
                Caster.Team.AddFighter(bomb);

                Fight.TriggerMarks(bomb.Cell, bomb, TriggerType.MOVE);
            }

            return(false);
        }