public PlanetFightResult FightMe(DnaModel monsterToFight) { monsterToFight.UpdateStats(); PlanetFightResult result = new PlanetFightResult(); List <int> stats = monsterToFight.Stats; foreach (PlanetChallenge pc in challenges) { if (stats[(int)pc.type] >= pc.Difficulty) { result.challengeResult.Add(new ChallengeResult(pc, true)); } else { int luck = 0; while (UnityEngine.Random.Range(0, 2) == 1) { luck++; } result.challengeResult.Add(new ChallengeResult(pc, stats[(int)pc.type], luck)); } } return(result); }
private void RunPlanet() { planet = PlanetModel.GeneratePlanet(PlanetDifficulty.BabyMode); result = planet.FightMe(DNA); }