Esempio n. 1
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));
     }
 }
Esempio n. 2
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);
     }
 }
Esempio n. 3
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();
     }
 }
Esempio n. 4
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));
     }
 }
Esempio n. 5
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);
     }
 }
Esempio n. 6
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);

            }
        }
Esempio n. 7
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);

            }
        }
Esempio n. 8
0
 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);
     }
 }
Esempio n. 9
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);
     }
 }
Esempio n. 10
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));
         }
     }
 }
Esempio n. 11
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));
         }
     }
 }
Esempio n. 12
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);
                }
            }
        }
Esempio n. 13
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);
                //}
            }
        }
Esempio n. 14
0
 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);
         }
     }
 }
Esempio n. 15
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);
         }
     }
 }
Esempio n. 16
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);
         }
     }
 }
Esempio n. 17
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);
         }
     }
 }
Esempio n. 18
0
 public static void PushBack1103(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     affecteds.Remove(fighter);
     PushBack(fighter, level, effect, affecteds, castcellid);
 }
Esempio n. 19
0
 public static void RemoveLifePercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     // transe, zobal actions enum dans le displayable ^^
 }
Esempio n. 20
0
 public static void IncreaseDamage1054(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affected, short castcellid)
 {
     IncreaseDamage(fighter, level, effect, affected, castcellid);
 }
Esempio n. 21
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);
     }
 }
 public short ReviveDeathTarget(BrainFighter fighter, SpellLevelRecord level)
 {
     return(fighter.Point.GetNearPoints().FirstOrDefault(x => fighter.Fight.IsCellFree(x.CellId)).CellId);
 }
Esempio n. 23
0
 public static void SpawnGlyphOnDied(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
 }
 public static void SpawnGlyphOnDied(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
 }
 public static void AddArmorDamagesReduction(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     AddGlobalDamageReduction(fighter, level, effect, affecteds, castcellid);
 }
Esempio n. 26
0
 public SpellBoost(int id, Fighter target, Fighter caster, SpellLevelRecord level, EffectInstance effect, ushort spellId, bool critical, FightDispellableEnum dispelable)
     : base(id, target, caster, level, effect, spellId, critical, dispelable)
 {
 }
Esempio n. 27
0
 public static void StealRange(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castspellid)
 {
 }
Esempio n. 28
0
 public static void StealIntelligence(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castSpellId)
 {
     foreach (var target in affecteds)
     {
     }
 }
Esempio n. 29
0
 public ErosionBuff(int id, Fighter target, Fighter caster, SpellLevelRecord level, EffectInstance effect, ushort spellId, short value, bool critical, FightDispellableEnum dispelable)
     : base(id, target, caster, level, effect, spellId, critical, dispelable)
 {
     this.Value = value;
 }
Esempio n. 30
0
 public BombFighter(MonsterRecord template, Fighter owner, FightTeam team, short summonCellId, sbyte gradeId, SpellLevelRecord summonSpellLevel)
     : base(team, 0)
 {
     this.Owner                 = owner;
     this.Template              = template;
     this.GradeId               = gradeId;
     this.Grade                 = Template.GetGrade(gradeId);
     this.SummonCellId          = summonCellId;
     this.BeforeSlideEvt       += BombFighter_BeforeSlideEvt;
     this.Owner.OnTurnStartEvt += OnOwnerTurnStart;
     this.AfterSlideEvt        += BombFighter_OnSlideEvt;
     this.OnTeleportEvt        += BombFighter_OnTeleportEvt;
     this.AfterDeadEvt         += BombFighter_AfterDeadEvt;
     this.OnDamageTaken        += BombFighter_OnDamageTaken;
     this.BeforeDeadEvt        += BombFighter_OnDeadEvt;
     this.Walls                 = new List <Wall>();
     this.SummonSpellLevel      = summonSpellLevel;
     this.SpellBombRecord       = SpellBombRecord.GetSpellBombRecord(summonSpellLevel.SpellId);
     this.WallSpellLevel        = SpellRecord.GetSpellRecord(SpellBombRecord.WallSpellId).GetLevel(GradeId);
     this.BuffTurnCount         = BUFF_TURN_COUNT;
 }
Esempio n. 31
0
 public Rune(short id, Fighter source, SpellLevelRecord spellLevel, EffectInstance effect,
             MapPoint centerPoint, Zone zone, Color color)
     : base(id, source, spellLevel, effect, centerPoint, zone, color, MarkTriggerTypeEnum.NONE)
 {
 }
 public static void ThrowEntity(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
 }
Esempio n. 33
0
 public static void CarryEntity(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
 }
        private EffectInstance[] SelectEffects(Fighter source, List <EffectInstance> effects, SpellLevelRecord level, MapPoint castPoint)
        {
            List <EffectInstance> results = new List <EffectInstance>();

            results.AddRange(effects.FindAll(x => x.Random == 0));

            List <EffectInstance> randomEffects = effects.FindAll(x => x.Random != 0);

            if (randomEffects.Count > 0)
            {
                results.Add(randomEffects.Random());
            }

            return(results.ToArray());
        }
Esempio n. 35
0
 public StatBuff(int id, Fighter target, Fighter caster, SpellLevelRecord level, EffectInstance effect, ushort spellId, short value, Characteristic caracteristic, bool critical, FightDispellableEnum dispelable, short customActionId)
     : base(id, target, caster, level, effect, spellId, critical, dispelable, customActionId)
 {
     this.Value         = value;
     this.Caracteristic = caracteristic;
 }
Esempio n. 36
0
 public Glyph(short id, Fighter source, SpellLevelRecord spellLevel, EffectInstance effect,
              MapPoint centerPoint, Zone zone, Color color, MarkTriggerTypeEnum triggerType)
     : base(id, source, spellLevel, effect, centerPoint, zone, color, triggerType)
 {
     this.Duration = (short)effect.Duration;
 }
Esempio n. 37
0
 public ArmorBuff(int id, Fighter target, Fighter caster, SpellLevelRecord level, EffectInstance effect, ushort spellId, short value, bool critical, FightDispellableEnum dispelable)
     : base(id, target, caster, level, effect, spellId, critical, dispelable)
 {
     this.Value = value;
     this.Delta = (short)target.CalculateArmorValue(this.Value);
 }
Esempio n. 38
0
 public static bool LearnSpell(Character character, EffectInteger effect)
 {
     character.LearnSpell(SpellLevelRecord.GetSpellId(effect.Value));
     return(true);
 }
Esempio n. 39
0
 public static void ChangeAppearence(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect record, List<Fighter> affecteds, short castcellid)
 {
     ExtendedChangeAppearence(fighter, level, record, affecteds, castcellid);
 }
        public override SpellLevelRecord GetSpellLevel(ushort spellid)
        {
            var spell = Client.Character.Spells.Find(x => x.spellId == spellid);

            return(SpellLevelRecord.GetLevel(spellid, spell.spellLevel));
        }
Esempio n. 41
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);
     }
 }
 public short UnkownTarget(BrainFighter fighter, SpellLevelRecord level)
 {
     return(this.AgressiveTarget(fighter, level));
 }
Esempio n. 43
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);
     }
 }
 public ReplacePerControlableInvocation(Fighter source, SpellLevelRecord level, EffectInstance effect,
                                        Fighter[] targets, MapPoint castPoint, bool critical)
     : base(source, level, effect, targets, castPoint, critical)
 {
 }
 public short SummonTarget(BrainFighter fighter, SpellLevelRecord level)
 {
     return(fighter.NearFreeCell());
 }
 public short HealTarget(BrainFighter fighter, SpellLevelRecord level)
 {
     return(fighter.Team.LowerFighterPercentage().CellId);
 }
 public static void RevealsInvisible(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
 }
Esempio n. 48
0
 public Erosion(Fighter source, SpellLevelRecord level, EffectInstance effect,
                Fighter[] targets, MapPoint castPoint, bool critical)
     : base(source, level, effect, targets, castPoint, critical)
 {
 }
 public static void Debuff(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid)
 {
     affecteds.ForEach(x => x.DispellSpell((ushort)effect.BaseEffect.Value));
 }
 public SymetricCasterTeleport(Fighter source, SpellLevelRecord spellLevel, EffectInstance effect,
                               Fighter[] targets, MapPoint castPoint, bool critical)
     : base(source, spellLevel, effect, targets, castPoint, critical)
 {
 }
Esempio n. 51
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));
 }
Esempio n. 52
0
 public Pull1043(Fighter source, SpellLevelRecord spellLevel, EffectInstance effect,
                 Fighter[] targets, MapPoint castPoint, bool critical)
     : base(source, spellLevel, effect, targets, castPoint, critical)
 {
 }
Esempio n. 53
0
 public void RegisterCastedSpell(SpellLevelRecord spell, Fighter target)
 {
     this.RegisterCastedSpell(new SpellHistoryEntry(this, spell, this.Owner, target, this.CurrentRound));
 }
Esempio n. 54
0
 public Tremor(Fighter source, SpellLevelRecord level, MapPoint castPoint, bool criticalHit)
     : base(source, level, castPoint, criticalHit)
 {
 }
Esempio n. 55
0
 public static void RevealsInvisible(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
 }
Esempio n. 56
0
        public short GetTargetedCell(BrainFighter fighter, SpellCategoryEnum category, SpellLevelRecord level)
        {
            if (fighter.Brain.HasBehavior)
            {
                var cellId = fighter.Brain.GetBehavior <Behavior>().GetTargetCellForSpell(level.SpellId);

                if (cellId != null)
                {
                    return(cellId.Value);
                }
            }
            var handler = Handlers.FirstOrDefault(x => x.Key.SpellCategory == category);

            if (handler.Value != null)
            {
                return((short)handler.Value.Invoke(this, new object[] { fighter, level }));
            }
            else
            {
                return(fighter.CellId);
            }
        }
Esempio n. 57
0
 public static void LosingAp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     RemoveAP(fighter, level, effect, affecteds, castcellid);
 }
Esempio n. 58
0
 public static void AddArmorDamagesReduction(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid)
 {
     AddGlobalDamageReduction(fighter, level, effect, affecteds, castcellid);
 }
Esempio n. 59
0
 public static void LosingMP(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castspellid)
 {
     LostMp(fighter, level, effect, affecteds, castspellid);
 }
Esempio n. 60
0
 public Rekop(Fighter source, SpellLevelRecord level, MapPoint castPoint, bool criticalHit) : base(source, level, castPoint, criticalHit)
 {
     this.TurnTrigger = new AsyncRandom().Next(1, 4);
     this.Target      = this.Source.Fight.GetFighter(this.CastPoint);
 }