private void OnTurnStopped(IFight fight, FightActor fighter) { if (fighter.IsDead()) { return; } if (!(fighter is CharacterFighter)) { return; } if (Id == (int)ChallengeEnum.NOMADE && fighter.MP <= 0) { return; } if (Id == (int)ChallengeEnum.PÉTULANT && fighter.AP <= 0) { return; } UpdateStatus(ChallengeStatusEnum.FAILED); Fight.BeforeTurnStopped -= OnTurnStopped; }
void OnBeforeTurnStopped(IFight fight, FightActor fighter) { if (!(fighter is CharacterFighter) || fighter.IsDead()) { return; } if (!fighter.Position.Point.GetAdjacentCells(x => m_team.GetOneFighter(y => y.IsAlive() && y.Cell == Fight.Map.GetCell(x)) != null).Any()) { return; } UpdateStatus(ChallengeStatusEnum.FAILED); Fight.BeforeTurnStopped -= OnBeforeTurnStopped; }