@Override
	public void randomizeTrainerPokes(boolean rivalCarriesStarter,
			boolean usePowerLevels, boolean noLegendaries,
			boolean noEarlyWonderGuard) {
		checkPokemonRestrictions();
		List<Trainer> currentTrainers = this.getTrainers();
		cachedReplacementLists = new TreeMap<Type, List<Pokemon>>();
		cachedAllList = noLegendaries ? new ArrayList<Pokemon>(noLegendaryList)
				: new ArrayList<Pokemon>(mainPokemonList);

		// Fully random is easy enough - randomize then worry about rival
		// carrying starter at the end
		for (Trainer t : currentTrainers) {
			if (t.tag != null && t.tag.equals("IRIVAL")) {
				continue; // skip
			}
			for (TrainerPokemon tp : t.pokemon) {
				boolean wgAllowed = (!noEarlyWonderGuard) || tp.level >= 20;
				tp.pokemon = pickReplacement(tp.pokemon, usePowerLevels, null,
						noLegendaries, wgAllowed);
			}
		}

		// Rival carries starter?
		if (rivalCarriesStarter) {
			rivalCarriesStarterUpdate(currentTrainers, "RIVAL", 1);
			rivalCarriesStarterUpdate(currentTrainers, "FRIEND", 2);
		}

		// Save it all up
		this.setTrainers(currentTrainers);
	}