public static void StealHPFix(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castercellid)
 {
     foreach (var target in affecteds)
     {
         Steal(fighter, target, effect.BaseEffect.DiceNum, ElementType.Neutral, level);
     }
 }
        public static void SpawnPortal(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
        {
            Portal portal = new Portal(fighter, castcellid, effect.ZoneShape, effect.ZoneSize,
                                       effect.BaseEffect.DiceNum, level.Grade, Color.Red.ToArgb());

            fighter.Fight.AddMarkTrigger(fighter, portal);
        }
 public static void AddAp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     foreach (var affected in affecteds)
     {
         var buff = new APBuff((uint)affected.BuffIdProvider.Pop(), effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.EffectType, effect.BaseEffect.Delay);
         affected.AddBuff(buff);
     }
 }
Exemple #4
0
 public static void AddState(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castercellid)
 {
     foreach (var target in affecteds)
     {
         StateBuff buff = new StateBuff((uint)target.BuffIdProvider.Pop(), (short)effect.BaseEffect.Value, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay);
         target.AddBuff(buff);
     }
 }
 public static void DamageErodedAir(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castCellId)
 {
     foreach (var target in affecteds)
     {
         int num = target.FighterStats.ErodedLife.Percentage(effect.BaseEffect.DiceNum);
         target.TakeDamages(new TakenDamages((short)num, ElementType.Air), fighter.ContextualId);
     }
 }
Exemple #6
0
 public static void AddVitality(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affected, short castcellid)
 {
     foreach (var target in affected)
     {
         var definition = new UInt16ReflectedStat(StatsRecord.GetFieldInfo("LifePoints"), target.FighterStats.Stats);
         target.AddBuff(new StatBuff((uint)target.BuffIdProvider.Pop(), definition, (uint)ActionsEnum.ACTION_CHARACTER_BOOST_VITALITY, effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, effect.BaseEffect.Delay));
     }
 }
 public static void AddSpellBoost(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         SpellBoostBuff buff = new SpellBoostBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay, (short)effect.BaseEffect.Value);
         target.AddBuff(buff);
     }
 }
 public static void PunishmentEffect(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castspellid)
 {
     foreach (var target in affecteds)
     {
         PunishementBuff buff = new PunishementBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceSide, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, (short)effect.BaseEffect.Value, 0);
         target.AddBuff(buff);
     }
 }
 public static void DodgeBuffEffect(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affected, short castcellid)
 {
     foreach (var target in affected)
     {
         DodgeBuff buff = new DodgeBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceSide, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay);
         target.AddBuff(buff);
     }
 }
 public static void AddVitality(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affected, short castcellid)
 {
     foreach (var target in affected)
     {
         var definition = new UInt16ReflectedStat(StatsRecord.GetFieldInfo("LifePoints"), target.FighterStats.Stats);
         target.AddBuff(new StatBuff((uint)target.BuffIdProvider.Pop(), definition, (uint)ActionsEnum.ACTION_CHARACTER_BOOST_VITALITY, effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, effect.BaseEffect.Delay));
     }
 }
Exemple #11
0
 public static void Detonate(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     var bomb = fighter.Fight.GetFighter(castcellid) as BombFighter;
     if (bomb != null)
     {
         bomb.Detonate();
     }
 }
 public static void AddDamageBonus(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         var definition = new UInt16ReflectedStat(StatsRecord.GetFieldInfo("AllDamagesBonus"), target.FighterStats.Stats);
         target.AddBuff(new StatBuff((uint)target.BuffIdProvider.Pop(), definition, (uint)effect.BaseEffect.EffectType, effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, effect.BaseEffect.Delay));
     }
 }
Exemple #13
0
 public static void MultiplyTakenDamages(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         MultiplyTakenDamageBuff buff = new MultiplyTakenDamageBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay);
         target.AddBuff(buff);
     }
 }
Exemple #14
0
 public static void HealHp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect record, List <Fighter> affecteds, short castspellid)
 {
     foreach (var target in affecteds)
     {
         var jet = fighter.CalculateJet(record, fighter.FighterStats.Stats.Intelligence);
         target.Heal(jet, fighter.ContextualId);
     }
 }
Exemple #15
0
 public static void AddRange(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         var definition = new UInt16ReflectedStat(StatsRecord.GetFieldInfo("_Range"), target.FighterStats.Stats);
         target.AddBuff(new StatBuff((uint)target.BuffIdProvider.Pop(), definition, (uint)effect.BaseEffect.EffectType, effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, effect.BaseEffect.Delay));
     }
 }
 public static void SubMp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castspellid)
 {
     foreach (var target in affecteds)
     {
         MPBuff buff = new MPBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.EffectType, effect.BaseEffect.Delay);
         target.AddBuff(buff);
     }
 }
        [EffectHandler(EffectsEnum.Eff_1009)] // exploser une bombe
        public static void Detonate(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
        {
            var bomb = fighter.Fight.GetFighter(castcellid) as BombFighter;

            if (bomb != null)
            {
                bomb.Detonate();
            }
        }
Exemple #18
0
        public static void HealHp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect record, List<Fighter> affecteds, short castspellid)
        {
            foreach (var target in affecteds)
            {
                var jet = fighter.CalculateJet(record, fighter.FighterStats.Stats.Intelligence);
                target.Heal(jet, fighter.ContextualId);

            }
        }
Exemple #19
0
 public static void AddShieldPercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     short num = (short)((double)fighter.FighterStats.RealStats.LifePoints * ((double)effect.BaseEffect.DiceNum / 100.0));
     foreach (var target in affecteds)
     {
         ShieldBuff buff = new ShieldBuff((uint)target.BuffIdProvider.Pop(), num, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay);
         target.AddBuff(buff);
     }
 }
Exemple #20
0
        public static void AddAp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
        {
            foreach (var affected in affecteds)
            {
                var buff = new APBuff((uint)affected.BuffIdProvider.Pop(), effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.EffectType,effect.BaseEffect.Delay);
                affected.AddBuff(buff);

            }
        }
 public static void AddGlobalDamageReduction(Fighter fighter,SpellLevelRecord level,ExtendedSpellEffect effect,List<Fighter> affecteds,short castcellid)
 {
     foreach (var target in affecteds)
     {
         var statdefinition = new UInt16ReflectedStat(StatsRecord.GetFieldInfo("GlobalDamageReduction"),target.FighterStats.Stats);
         StatBuff buff = new StatBuff((uint)target.BuffIdProvider.Pop(), statdefinition, (uint)effect.BaseEffect.EffectId, effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, effect.BaseEffect.Delay);
         target.AddBuff(buff);
     }
 }
 public static void AirResistPercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         var      statdefinition = new UInt16ReflectedStat(StatsRecord.GetFieldInfo("AirResistPercent"), fighter.FighterStats.Stats);
         StatBuff buff           = new StatBuff((uint)target.BuffIdProvider.Pop(), statdefinition, (uint)effect.BaseEffect.EffectType, effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, effect.BaseEffect.Delay);
         target.AddBuff(buff);
     }
 }
        public static void AddShieldPercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
        {
            short num = (short)((double)fighter.FighterStats.RealStats.LifePoints * ((double)effect.BaseEffect.DiceNum / 100.0));

            foreach (var target in affecteds)
            {
                ShieldBuff buff = new ShieldBuff((uint)target.BuffIdProvider.Pop(), num, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay);
                target.AddBuff(buff);
            }
        }
        public short CalculateJet(ExtendedSpellEffect record, short statdata)
        {
            short jet = (short)(SpellEffectsHandler.GetRandom(record));

            if (record.BaseEffect.SpellLevelId != 0)
            {
                ushort spellId = SpellLevelRecord.GetLevel(record.BaseEffect.SpellLevelId).SpellId;
                jet += GetSpellBoost(spellId);
            }
            return((short)(Math.Floor((double)jet * (100 + statdata + FighterStats.Stats.AllDamagesBonusPercent) / 100) + FighterStats.Stats.AllDamagesBonus));
        }
Exemple #25
0
 public static void AddSpellCooldown(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         if (target is CharacterFighter)
         {
             var ctarget = target as CharacterFighter;
             ctarget.Client.Send(new GameActionFightSpellCooldownVariationMessage((ushort)ActionsEnum.ACTION_CHARACTER_ADD_SPELL_COOLDOWN,
                 fighter.ContextualId, ctarget.ContextualId, (ushort)effect.BaseEffect.DiceNum, (short)effect.BaseEffect.Value));
         }
     }
 }
 public static void AddSpellCooldown(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         if (target is CharacterFighter)
         {
             var ctarget = target as CharacterFighter;
             ctarget.Client.Send(new GameActionFightSpellCooldownVariationMessage((ushort)ActionsEnum.ACTION_CHARACTER_ADD_SPELL_COOLDOWN,
                                                                                  fighter.ContextualId, ctarget.ContextualId, (ushort)effect.BaseEffect.DiceNum, (short)effect.BaseEffect.Value));
         }
     }
 }
Exemple #27
0
 [EffectHandler(EffectsEnum.Eff_Teleport)]  //Bond de Iop
 public static void Teleport(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     if (fighter.Fight.IsObstacle(castcellid))
     {
         return;
     }
     fighter.Fight.Send(new SequenceStartMessage(5, fighter.ContextualId));
     fighter.Fight.Send(new GameActionFightTeleportOnSameMapMessage(4, fighter.ContextualId, fighter.ContextualId, castcellid));
     fighter.Fight.Send(new SequenceEndMessage(2, fighter.ContextualId, 5));
     fighter.ApplyFighterEvent(FighterEventType.ON_TELEPORTED, castcellid);
     fighter.CellId = castcellid;
 }
Exemple #28
0
        public static void Handle(Fighter fighter, SpellLevelRecord record, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
        {
            var handler = Handlers.FirstOrDefault(x => x.Key == effect.BaseEffect.EffectType);

            if (handler.Value != null)
            {
                handler.Value(fighter, record, effect, affecteds, castcellid);
            }
            else
            {
                fighter.Fight.Reply(effect.BaseEffect.EffectType + " is not handled...");
            }
        }
Exemple #29
0
 public static void ReduceEffsDuration(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     foreach(Fighter target in affecteds)
     {
         foreach(Buff buff in target.Buffs)
         {
             short LastDuration = buff.Duration;
             buff.setDuration(effect.BaseEffect.Value, fighter);
             short ral = (short)((LastDuration - buff.Duration) * -1);
             target.Fight.Send(new GameActionFightModifyEffectsDurationMessage((ushort)buff.UID, buff.SourceId, fighter.ContextualId, ral));
         }
     }
 }
Exemple #30
0
        public static short GetRandom(ExtendedSpellEffect record)
        {
            short jet;

            if (record.BaseEffect.DiceSide == 0)
            {
                jet = (short)record.BaseEffect.DiceNum;
            }
            else
            {
                jet = (short)new AsyncRandom().Next(record.BaseEffect.DiceNum, record.BaseEffect.DiceSide + 1);
            }
            return(jet);
        }
Exemple #31
0
        public static void Bomb(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect record, List <Fighter> affecteds, short castCellid)
        {
            var target = fighter.Fight.GetFighter(castCellid);

            if (target == null)
            {
                fighter.Fight.SpawnBomb(fighter, record.BaseEffect.DiceNum, fighter.GetSpellLevel(level.SpellId).Grade, castCellid, fighter.Team);
            }
            else

            {
                MarksHelper.Instance.DirectExplosion(fighter, target, record.BaseEffect.DiceNum, level.Grade);
            }
        }
Exemple #32
0
        [EffectHandler(EffectsEnum.Eff_405)] // Invocation Sadida
        public static void SadidaSummon(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castCellId)
        {
            if (affecteds.Count > 0)
            {
                MonsterFighter affected = affecteds.First() as MonsterFighter;

                if (affected != null && affected.FighterStats.SummonerId == fighter.ContextualId)
                {
                    MonsterFighter summoned = fighter.Fight.AddSummon(fighter, effect.BaseEffect.DiceNum, fighter.GetSpellLevel(level.SpellId).Grade, castCellId, fighter.Team);
                    summoned.AddBuff(new OnSadidaSummonDieEffect((uint)fighter.BuffIdProvider.Pop(), 0, -1, 0, 0, level.Grade, 0));
                    affected.Die();
                }
            }
        }
        public static void BePulled(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
        {
            foreach (var target in affecteds)
            {
                var direction = ShapesProvider.GetDirectionFromTwoCells(target.CellId, fighter.CellId);
                List<short> line = ShapesProvider.GetLineFromDirection(target.CellId, (byte)effect.BaseEffect.DiceNum, direction);
                List<short> cells = fighter.Fight.BreakAtFirstObstacles(line);
                cells.Reverse();

                if (cells.Count > 0)
                {
                    fighter.Slide(fighter.ContextualId, cells);
                }
            }
        }
Exemple #34
0
        public static void BePulled(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
        {
            foreach (var target in affecteds)
            {
                var          direction = ShapesProvider.GetDirectionFromTwoCells(target.CellId, fighter.CellId);
                List <short> line      = ShapesProvider.GetLineFromDirection(target.CellId, (byte)effect.BaseEffect.DiceNum, direction);
                List <short> cells     = fighter.Fight.BreakAtFirstObstacles(line);
                cells.Reverse();

                if (cells.Count > 0)
                {
                    fighter.Slide(fighter.ContextualId, cells);
                }
            }
        }
Exemple #35
0
        public static void SwitchPosition(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
        {
            bool save = true;

            if (effect != null && effect.BaseEffect.EffectType == EffectsEnum.Eff_1100)
            {
                save = false;
            }
            var target = affecteds.Find(x => x.CellId == castcellid);

            if (target != null)
            {
                target.Teleport(fighter.CellId, save);
                fighter.Teleport(castcellid, save);
            }
        }
Exemple #36
0
        public static void LostMp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
        {
            foreach (var affected in affecteds)
            {
                // TODO, ALGO

                //if (loss == 0)
                //{
                //    fighter.Fight.Send(new GameActionFightDodgePointLossMessage((ushort)ActionsEnum.ACTION_FIGHT_SPELL_DODGED_PM, fighter.ContextualId, affected.ContextualId, (ushort)maxLost));
                //}
                //else
                //{
                //    var buff = new MPBuff((uint)affected.BuffIdProvider.Pop(), loss, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.EffectType);
                //    affected.AddBuff(buff);
                //}
            }
        }
 public static void LastTurnPositionMove(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     foreach (Fighter affected in affecteds)
     {
         if (affected.LastTurnPosition == 0)
             continue;
         if (fighter.Fight.GetFighter(affected.LastTurnPosition) != null)
         {
             Fighter other = fighter.Fight.GetFighter(affected.LastTurnPosition);
             SwitchPosition(other, null, effect, new List<Fighter> { affected }, castcellid);
         }
         else
         {
             affected.Teleport(affected.LastTurnPosition, false);
         }
     }
 }
        public static void LostMp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
        {
            foreach (var affected in affecteds)
            {
                // TODO, ALGO

                //if (loss == 0)
                //{
                //    fighter.Fight.Send(new GameActionFightDodgePointLossMessage((ushort)ActionsEnum.ACTION_FIGHT_SPELL_DODGED_PM, fighter.ContextualId, affected.ContextualId, (ushort)maxLost));
                //}
                //else
                //{
                //    var buff = new MPBuff((uint)affected.BuffIdProvider.Pop(), loss, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.EffectType);
                //    affected.AddBuff(buff);
                //}
            }
        }
Exemple #39
0
 public static void GiveHPPercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect record, List<Fighter> affecteds, short castspellid)
 {
     short num = (short)((double)fighter.FighterStats.RealStats.LifePoints * ((double)record.BaseEffect.DiceNum / 100.0));
     if (fighter.FighterStats.Stats.LifePoints == 1)
         return;
     if (num > fighter.FighterStats.Stats.LifePoints)
     {
         num = (short)(fighter.FighterStats.Stats.LifePoints - 1);
     }
     else
     {
         fighter.TakeDamages(new TakenDamages(num,ElementType.Neutral), fighter.ContextualId);
         foreach (var target in affecteds)
         {
             target.Heal(num, fighter.ContextualId);
         }
     }
 }
Exemple #40
0
 public static void RestoreHpPercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castspellid)
 {
     if (effect.BaseEffect.Duration == 0)
     {
         foreach (var target in affecteds)
         {
             short num = (short)((double)target.FighterStats.RealStats.LifePoints * ((double)effect.BaseEffect.DiceNum / 100.0));
             target.Heal(num, fighter.ContextualId);
         }
     }
     else
     {
         foreach (var target in affecteds)
         {
             HealPercentBuff buff = new HealPercentBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay);
             target.AddBuff(buff);
         }
     }
 }
Exemple #41
0
 public static void RestoreHpPercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castspellid)
 {
     if (effect.BaseEffect.Duration == 0)
     {
         foreach (var target in affecteds)
         {
             short num = (short)((double)target.FighterStats.RealStats.LifePoints * ((double)effect.BaseEffect.DiceNum / 100.0));
             target.Heal(num, fighter.ContextualId);
         }
     }
     else
     {
         foreach (var target in affecteds)
         {
             HealPercentBuff buff = new HealPercentBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay);
             target.AddBuff(buff);
         }
     }
 }
 public static void PullForward(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         DirectionsEnum direction;
         if (target.CellId != castcellid)
         {
             direction = ShapesProvider.GetDirectionFromTwoCells(target.CellId, castcellid);
         }
         else
         {
             direction = ShapesProvider.GetDirectionFromTwoCells(target.CellId, fighter.CellId);
         }
         List<short> line = ShapesProvider.GetLineFromDirection(target.CellId, effect.BaseEffect.DiceNum, direction);
         List<short> cells = fighter.Fight.BreakAtFirstObstacles(line);
         if (cells.Count > 0)
         {
             target.Slide(fighter.ContextualId, cells);
         }
     }
 }
Exemple #43
0
        public static void GiveHPPercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect record, List <Fighter> affecteds, short castspellid)
        {
            short num = (short)((double)fighter.FighterStats.RealStats.LifePoints * ((double)record.BaseEffect.DiceNum / 100.0));

            if (fighter.FighterStats.Stats.LifePoints == 1)
            {
                return;
            }
            if (num > fighter.FighterStats.Stats.LifePoints)
            {
                num = (short)(fighter.FighterStats.Stats.LifePoints - 1);
            }
            else
            {
                fighter.TakeDamages(new TakenDamages(num, ElementType.Neutral), fighter.ContextualId);
                foreach (var target in affecteds)
                {
                    target.Heal(num, fighter.ContextualId);
                }
            }
        }
Exemple #44
0
 public static void PullForward(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         DirectionsEnum direction;
         if (target.CellId != castcellid)
         {
             direction = ShapesProvider.GetDirectionFromTwoCells(target.CellId, castcellid);
         }
         else
         {
             direction = ShapesProvider.GetDirectionFromTwoCells(target.CellId, fighter.CellId);
         }
         List <short> line  = ShapesProvider.GetLineFromDirection(target.CellId, effect.BaseEffect.DiceNum, direction);
         List <short> cells = fighter.Fight.BreakAtFirstObstacles(line);
         if (cells.Count > 0)
         {
             target.Slide(fighter.ContextualId, cells);
         }
     }
 }
Exemple #45
0
        [EffectHandler(EffectsEnum.Eff_1106)] // symétrie esprit
        public static void SymetryMove(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
        {
            var   direction       = ShapesProvider.GetDirectionFromTwoCells(fighter.CellId, castcellid);
            var   line            = ShapesProvider.GetLineFromDirection(fighter.CellId, 2, direction);
            short destinationCell = line.Last();

            if (fighter.Fight.IsObstacle(destinationCell))
            {
                var target = fighter.Fight.GetFighter(destinationCell);
                if (target != null)
                {
                    SwitchPosition(fighter, null, null, new List <Fighter>()
                    {
                        target
                    }, destinationCell);
                }
            }
            else
            {
                fighter.Teleport(destinationCell);
            }
        }
Exemple #46
0
        [EffectHandler(EffectsEnum.Eff_RepelsTo)] // Peur du sram
        public static void RepelsTo(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
        {
            var dir             = ShapesProvider.GetDirectionFromTwoCells(fighter.CellId, castcellid);
            var movedCellAmount = (short)(PathHelper.GetDistanceBetween(fighter.CellId, castcellid));

            fighter.Fight.Reply(movedCellAmount.ToString());
            var line = ShapesProvider.GetLineFromDirection(fighter.CellId, movedCellAmount, dir);

            if (line.Count > 0)
            {
                var target = fighter.Fight.GetFighter(line.First());
                if (target != null)
                {
                    line.Remove(target.CellId);
                    List <short> cells = fighter.Fight.BreakAtFirstObstacles(line);
                    if (cells.Count > 0)
                    {
                        target.Slide(fighter.ContextualId, cells);
                    }
                }
            }
        }
Exemple #47
0
 [EffectHandler(EffectsEnum.Eff_1100)] // Gelure/Fuite
 public static void LastPositionMove(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     foreach (Fighter affected in affecteds)
     {
         if (affected.LastPosition.Count <= 0)
         {
             continue;
         }
         if (fighter.Fight.GetFighter(affected.LastPosition.Last()) != null)
         {
             Fighter other = fighter.Fight.GetFighter(affected.LastPosition.Last());
             SwitchPosition(other, null, effect, new List <Fighter> {
                 affected
             }, castcellid);
         }
         else
         {
             affected.Teleport(affected.LastPosition.Last(), false);
         }
         affected.LastPosition.Remove(affected.LastPosition.Last());
     }
 }
Exemple #48
0
 public static void LosingAp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     RemoveAP(fighter, level, effect, affecteds, castcellid);
 }
Exemple #49
0
 public static void SpawnGlyphOnDied(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
 }
Exemple #50
0
 public static void RevealsInvisible(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
 }
Exemple #51
0
 public static void LosingMP(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castspellid)
 {
     LostMp(fighter, level, effect, affecteds, castspellid);
 }
 public static void AddArmorDamagesReduction(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     AddGlobalDamageReduction(fighter, level, effect, affecteds, castcellid);
 }
Exemple #53
0
 public static void ChangeAppearence(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect record, List<Fighter> affecteds, short castcellid)
 {
     ExtendedChangeAppearence(fighter, level, record, affecteds, castcellid);
 }
Exemple #54
0
 public static void Debuff(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     affecteds.ForEach(x => x.DispellSpell((ushort)effect.BaseEffect.Value));
 }
Exemple #55
0
 public static void CarryEntity(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
 }
Exemple #56
0
 public static void IncreaseDamage1054(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affected, short castcellid)
 {
     IncreaseDamage(fighter, level, effect, affected, castcellid);
 }
Exemple #57
0
 public static void PunishmentEffect(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castspellid)
 {
     foreach (var target in affecteds)
     {
         PunishementBuff buff = new PunishementBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceSide, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, (short)effect.BaseEffect.Value, 0);
         target.AddBuff(buff);
     }
 }
Exemple #58
0
 public static void RemoveLifePercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     // transe, zobal actions enum dans le displayable ^^
 }
Exemple #59
0
 public static void DodgeBuffEffect(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affected, short castcellid)
 {
     foreach (var target in affected)
     {
         DodgeBuff buff = new DodgeBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceSide, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay);
         target.AddBuff(buff);
     }
 }
Exemple #60
0
 public static void ExtendedChangeAppearence(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     foreach (var target in affecteds)
     {
         LookBuff buff = new LookBuff((uint)target.BuffIdProvider.Pop(), 0, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay);
         target.AddBuff(buff);
     }
 }