public short AgressiveTarget(BrainFighter fighter, SpellLevelRecord level) { if (fighter.Brain.HasBehavior) { var agressiveCell = fighter.Brain.GetBehavior <Behavior>().GetAgressiveCell(); if (agressiveCell != -1) { return(agressiveCell); } } if (level.MaxRange > 0) { var targets = fighter.OposedTeam().CloserFighters(fighter); var target = targets.LastOrDefault(x => x.Stats.InvisibilityState == Protocol.Enums.GameActionFightInvisibilityStateEnum.VISIBLE); if (target != null) { return(target.CellId); } else { return(Array.FindAll(fighter.GetCastZone(fighter.CellId, level), x => fighter.Fight.Map.WalkableDuringFight((ushort)x)).Random()); } } else { return(fighter.CellId); } }
public short TeleportTarget(BrainFighter fighter, SpellLevelRecord level) { if (fighter.Brain.HasBehavior) { var teleportCell = fighter.Brain.GetBehavior <Behavior>().GetTeleportCell(); if (teleportCell != -1) { return(teleportCell); } } var target = fighter.OposedTeam().LowerFighter(); if (target != null) { var points = target.Point.GetNearPoints(); if (points.Count() > 0) { var pt = points.FirstOrDefault(x => fighter.Fight.IsCellFree(x.CellId)); if (pt != null) { return(pt.CellId); } } } return(-1); }
public Virustine(BrainFighter fighter) : base(fighter) { fighter.Fight.FightStartEvt += Fight_FightStartEvt; fighter.AfterSlideEvt += Fighter_AfterSlideEvt; this.Fighter.OnTurnStartEvt += Fighter_OnTurnStartEvt; TurnCount = 0; }
public Powa(BrainFighter fighter) : base(fighter) { base.Fighter.BeforeDeadEvt += Fighter_OnDeadEvt; base.Fighter.AfterSlideEvt += Fighter_OnSlideEvt; this.Fighter.OnTurnEndEvt += Fighter_OnTurnEndEvt; this.Fighter.OnDamageTaken += Fighter_OnDamageTaken; }
public Mansot(BrainFighter fighter) : base(fighter) { foreach (var ally in this.Fighter.Team.GetFighters()) { ally.BeforeDeadEvt += this.ally_OnDeadEvt; } }
public MonsterBrain(BrainFighter fighter) { this.Fighter = fighter; if (fighter.Template.BehaviorName != string.Empty && fighter.Template.BehaviorName != null) { this.Behavior = BehaviorManager.GetBehavior(fighter.Template.BehaviorName, this.Fighter); } }
public AngelRush(BrainFighter fighter) : base(fighter) { this.SpellRecord = SpellRecord.GetSpellRecord(SpellId); this.Fighter.AfterSlideEvt += Fighter_AfterSlideEvt; this.Fighter.AfterDeadEvt += Fighter_AfterDeadEvt; this.Fighter.OnDamageTaken += Fighter_OnDamageTaken; this.IsAngel = false; }
public Barn(BrainFighter fighter) : base(fighter) { this.GradeRandomizer = new AsyncRandom(); fighter.Fight.FightStartEvt += Fight_FightStart; fighter.OnDamageTaken += fighter_OnDamageTaken; this.SummonedTemplate = MonsterRecord.GetMonster(SummonedMonsterId); }
public Royalmouth(BrainFighter fighter) : base(fighter) { this.Fighter.Fight.FightStartEvt += this.Fight_FightStart; this.Fighter.AfterSlideEvt += this.Fighter_OnSlideEvt; this.Fighter.OnPushDamages += this.Fighter_OnPushDamages; this.Fighter.OnTurnStartEvt += this.fighter_OnTurnStartEvt; this.InitmouthRecord = SpellRecord.GetSpellRecord(InitmouthSpellId); this.InitmouthLevel = this.InitmouthRecord.GetLastLevel(); }
public Tabacille(BrainFighter fighter) : base(fighter) { fighter.Fight.FightStartEvt += Fight_FightStartEvt; this.Fighter.OnTurnStartEvt += Fighter_OnTurnStartEvt; foreach (var enemy in fighter.OposedTeam().GetFighters()) { enemy.OnHealEvt += Enemy_OnHealEvt; } TurnCount = 0; }
public static Behavior GetBehavior(string behaviorName, BrainFighter fighter) { var data = BehaviorTypes.FirstOrDefault(x => x.Key == behaviorName); if (data.Value != null) { return((Behavior)Activator.CreateInstance(data.Value, fighter)); } else { logger.Error("Unable to handle beahvior identifier: " + behaviorName); return(null); } }
/// <summary> /// Index = Priority /// </summary> /// <param name="fighter"></param> /// <returns></returns> public Dictionary <int, SpellCategoryEnum> GetSpellsCategories(BrainFighter fighter) { Dictionary <int, SpellCategoryEnum> categories; if (fighter.Brain.HasBehavior) { categories = fighter.Brain.GetBehavior <Behavior>().GetSpellsCategories(); if (categories != null) { return(categories); } } categories = new Dictionary <int, SpellCategoryEnum>(); if (fighter.Team.LastDead() != null) { categories.Add(-1, SpellCategoryEnum.ReviveDeath); } if (fighter.CanSummon) { categories.Add(0, SpellCategoryEnum.Summon); } if (!fighter.IsThereEnemy(fighter.Point.GetNearPoints())) { categories.Add(1, SpellCategoryEnum.Teleport); } if (fighter.Stats.LifePercentage > WarningLifePercentage) { categories.Add(2, SpellCategoryEnum.Agressive); } else { categories.Add(5, SpellCategoryEnum.Agressive); } categories.Add(3, SpellCategoryEnum.Heal); categories.Add(4, SpellCategoryEnum.Buff); categories.Add(6, SpellCategoryEnum.Unknown); return(categories); }
public short BuffTarget(BrainFighter fighter, SpellLevelRecord level) { if (fighter.Brain.HasBehavior) { var buffCell = fighter.Brain.GetBehavior <Behavior>().GetBuffCell(); if (buffCell != -1) { return(buffCell); } } if (level.MaxRange > 0) { var target = fighter.Team.LowerFighterPercentage(); return(target != null ? target.CellId : fighter.CellId); } else { return(fighter.CellId); } }
public List <ActionType> GetSortedActions(BrainFighter fighter) { List <ActionType> actions = new List <ActionType>(); if (fighter.Brain.HasBehavior) { var behaviorActions = fighter.Brain.GetBehavior <Behavior>().GetSortedActions(); if (behaviorActions != null) { return(behaviorActions.ToList()); } } actions.Add(ActionType.CastSpell); actions.Add(ActionType.MoveToEnemy); actions.Add(ActionType.CastSpell); actions.Add(ActionType.Flee); actions.Add(ActionType.CastSpell); return(actions); }
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 Malamibe(BrainFighter fighter) : base(fighter) { this.Fighter.OnTurnStartEvt += Fighter_OnTurnStartEvt; }
public Behavior(BrainFighter fighter) { this.Fighter = fighter; }
public SalbatroceBehavior(BrainFighter fighter) : base(fighter) { this.Fighter.OnTurnStartEvt += this.Fighter_OnTurnStartEvt; }
public DragonPig(BrainFighter fighter) : base(fighter) { this.LethalBlunderRecord = SpellRecord.GetSpellRecord(LethalBlunderSpellId); this.Fighter.Fight.FightStartEvt += Fight_FightStart; }
public CastSpellAction(BrainFighter fighter) : base(fighter) { }
public Bacterrib(BrainFighter fighter) : base(fighter) { fighter.Fight.FightStartEvt += Fight_FightStartEvt; this.Fighter.OnTurnStartEvt += Fighter_OnTurnStartEvt; TurnCount = 0; }
public Puller(BrainFighter fighter) : base(fighter) { this.Fighter.OnTurnStartEvt += this.Fighter_OnTurnStartEvt; }
public HellMina(BrainFighter fighter) : base(fighter) { fighter.AfterSlideEvt += this.fighter_OnSlideEvt; }
public static BrainAction GetAction(BrainFighter fighter, ActionType actionType) { return((BrainAction)Activator.CreateInstance(Brains[actionType], new object[] { fighter })); }
public Agressive(BrainFighter fighter) : base(fighter) { }
public Verminocule(BrainFighter fighter) : base(fighter) { fighter.Fight.FightStartEvt += this.Fight_FightStartEvt; this.Fighter.OnTurnStartEvt += this.Fighter_OnTurnStartEvt; this.TurnCount = 0; }
public FleeAction(BrainFighter fighter) : base(fighter) { }
public Protect(BrainFighter fighter) : base(fighter) { fighter.BeforeDeadEvt += fighter_OnDeadEvt; fighter.Fight.OnFighters <CharacterFighter>(x => x.Character.Notification("Protegez " + Fighter.Name + "!")); }
public MoveToEnemyAction(BrainFighter fighter) : base(fighter) { }
public Sacrieur(BrainFighter fighter) : base(fighter) { }