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 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 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 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 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); } }
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 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); } }
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 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 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 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)); } } }
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); } } }
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 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); } } }
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); } } }
public static void PushBack1103(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castcellid) { affecteds.Remove(fighter); PushBack(fighter, level, effect, affecteds, castcellid); }
public static void RemoveLifePercent(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid) { // transe, zobal actions enum dans le displayable ^^ }
public static void IncreaseDamage1054(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affected, short castcellid) { IncreaseDamage(fighter, level, effect, affected, castcellid); }
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); }
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); }
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) { }
public static void StealRange(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castspellid) { }
public static void StealIntelligence(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List <Fighter> affecteds, short castSpellId) { foreach (var target in affecteds) { } }
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; }
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; }
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) { }
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()); }
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; }
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; }
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); }
public static bool LearnSpell(Character character, EffectInteger effect) { character.LearnSpell(SpellLevelRecord.GetSpellId(effect.Value)); return(true); }
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)); }
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)); }
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) { }
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) { }
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 Pull1043(Fighter source, SpellLevelRecord spellLevel, EffectInstance effect, Fighter[] targets, MapPoint castPoint, bool critical) : base(source, spellLevel, effect, targets, castPoint, critical) { }
public void RegisterCastedSpell(SpellLevelRecord spell, Fighter target) { this.RegisterCastedSpell(new SpellHistoryEntry(this, spell, this.Owner, target, this.CurrentRound)); }
public Tremor(Fighter source, SpellLevelRecord level, MapPoint castPoint, bool criticalHit) : base(source, level, castPoint, criticalHit) { }
public static void RevealsInvisible(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid) { }
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); } }
public static void LosingAp(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid) { RemoveAP(fighter, level, effect, affecteds, castcellid); }
public static void AddArmorDamagesReduction(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid) { AddGlobalDamageReduction(fighter, level, effect, affecteds, castcellid); }
public static void LosingMP(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castspellid) { LostMp(fighter, level, effect, affecteds, castspellid); }
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); }