Beispiel #1
0
        protected override bool InternalApply()
        {
            var trapSpell = new Spell(Dice.DiceNum, (byte)Dice.DiceFace);

            if (trapSpell.Template == null || !trapSpell.ByLevel.ContainsKey(Dice.DiceFace))
            {
                logger.Error("Cannot find trap spell id = {0}, level = {1}. Casted Spell = {2}", Dice.DiceNum, Dice.DiceFace, Spell.Id);
                return(false);
            }

            var trap = new Trap((short)Fight.PopNextTriggerId(), Caster, Spell, Dice, trapSpell, TargetedCell, EffectZone.ShapeType, (byte)Effect.ZoneMinSize, (byte)Effect.ZoneSize);

            if (Spell.Id == (int)SpellIdEnum.PIÈGE_RÉPULSIF)
            {
                trap.Priority = -1;
            }

            Fight.AddTriger(trap);
            return(true);
        }
Beispiel #2
0
        protected override bool InternalApply()
        {
            var runeSpell = new Spell(Dice.DiceNum, (byte)Dice.DiceFace);

            if (runeSpell.Template == null || !runeSpell.ByLevel.ContainsKey(Dice.DiceFace))
            {
                logger.Error("Cannot find rune spell id = {0}, level = {1}. Casted Spell = {2}", Dice.DiceNum, Dice.DiceFace, Spell.Id);
                return(false);
            }

            foreach (var trigger in Fight.GetTriggersByCell(TargetedCell).OfType <Rune>().Where(x => x.Caster.IsFriendlyWith(Caster)))
            {
                trigger.Remove();
            }

            var rune = new Rune((short)Fight.PopNextTriggerId(), Caster, Spell, Dice, runeSpell, TargetedCell, EffectZone.ShapeType, (byte)Effect.ZoneMinSize, (byte)Effect.ZoneSize);

            Fight.AddTriger(rune);

            return(true);
        }
Beispiel #3
0
        protected override bool InternalApply()
        {
            var glyphSpell = new Spell(Dice.DiceNum, (byte)Dice.DiceFace);

            if (glyphSpell.Template == null || !glyphSpell.ByLevel.ContainsKey(Dice.DiceFace))
            {
                logger.Error("Cannot find glyph spell id = {0}, level = {1}. Casted Spell = {2}", Dice.DiceNum, Dice.DiceFace, Spell.Id);
                return(false);
            }

            var spell = Spell;

            if (spell.Id == (int)SpellIdEnum.DAIPIPAY)
            {
                spell = glyphSpell;
            }

            Glyph glyph;

            if (Effect.EffectId == EffectsEnum.Effect_GlyphAura)
            {
                glyph = new GlyphAura((short)Fight.PopNextTriggerId(), Caster, spell, Dice, glyphSpell, TargetedCell,
                                      EffectZone.ShapeType, (byte)Effect.ZoneMinSize, (byte)Effect.ZoneSize, GetGlyphColorBySpell(Spell));
            }
            else
            {
                glyph = new Glyph((short)Fight.PopNextTriggerId(), Caster, spell, Dice, glyphSpell, TargetedCell,
                                  EffectZone.ShapeType, (byte)Effect.ZoneMinSize, (byte)Effect.ZoneSize,
                                  GetGlyphColorBySpell(Spell), Effect.EffectId == EffectsEnum.Effect_Glyph,
                                  Effect.EffectId == EffectsEnum.Effect_Glyph_402 ? TriggerType.OnTurnEnd : TriggerType.OnTurnBegin);
            }

            Fight.AddTriger(glyph);

            return(true);
        }