public override Turn BuildTurn(MonsterBattler battler) { var usableSkills = battler.Skills.Where(monsterSkill => monsterSkill.Evaluate(battler)).ToArray(); if (usableSkills.Any() == false) { return(new Turn()); } var randomIndex = Random.Range(0, usableSkills.Length); var chosenSkill = usableSkills.ElementAt(randomIndex); var possibleTargets = BattleController.Instance.Party.Where(partyMember => !partyMember.Fainted).ToArray(); if (possibleTargets.Any() == false) { return(new Turn()); } //Ver quando tem multiplos alvos randomIndex = Random.Range(0, possibleTargets.Count()); var chosenTargets = new[] { possibleTargets.ElementAt(randomIndex) }; return(new Turn { Skill = chosenSkill, Targets = chosenTargets }); }
private void _updateAssetIcon() { try { _assetIcon = MonsterBattler.GetComponent <Image>().sprite; } catch { // ignored } }
public void Apply(MonsterBattler monster, ref Stats stats) => ApplyBonusStats(monster.MonsterBase.Stats, ref stats);
public abstract Turn BuildTurn(MonsterBattler battler);
public bool Evalute(MonsterBattler source, Skill skill) => true;
public bool Evaluate(MonsterBattler battler) { return(Conditions.All(condition => condition.Evalute(battler, this))); }