Technical Machine / source / evaluate / evaluate.hpp

// Evaluate header
// Copyright (C) 2012 David Stone
// This file is part of Technical Machine.
// Technical Machine is free software: you can redistribute it and / or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// GNU Affero General Public License for more details.
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <>.


#include <array>
#include <cstdint>

#include "../stat/stat.hpp"

namespace technicalmachine {

class ActivePokemon;
class EntryHazards;
class Pokemon;
class Status;
class Team;
class Weather;

class Evaluate {
	void load();
	int64_t operator()(Team const & ai, Team const & foe, Weather const & weather) const;
	// Both of these return victory if the battle is won. Returns -victory
	// if the battle is lost. Returns 0 otherwise.
	static int64_t win(Team const & team);
	static int64_t sleep_clause(Team const & team);
	// Highest score. 100% chance to win. No particular significance to
	// this number other than being larger than any score a non-winning
	// position can have.
	constexpr static int64_t victory = 30240;
	int64_t score_team(Team const & team) const;
	int64_t score_all_pokemon(Team const & team, Team const & other, Weather const & weather) const;
	int64_t score_pokemon(Pokemon const & pokemon, EntryHazards const & entry_hazards, Team const & other, Weather const & weather, int toxic_counter = 1) const;
	int64_t score_active_pokemon(ActivePokemon const & active) const;
	int64_t baton_passable_score(ActivePokemon const & pokemon) const;
	int64_t score_status(Pokemon const & pokemon, int toxic_counter) const;
	int64_t score_move (Pokemon const & pokemon, Team const & other, Weather const & weather) const;

	int light_screen;
	int lucky_chant;
	int mist;
	int reflect;
	int safeguard;
	int tailwind;

	int wish;

	int spikes;
	int stealth_rock;
	int toxic_spikes;

	int members;
	int hp;
	int hidden;
	int aqua_ring;
	int curse;
	int imprison;
	int ingrain;
	int leech_seed;
	int loaf;
	int magnet_rise;
	int nightmare;
	int substitute;
	int substitute_hp;
	int torment;
	int trapped;

	int burn;
	int freeze;
	int paralysis;
	int poison;
	int sleep;
	std::array<int, Stat::END> stage;
	int focus_energy;

	int baton_pass;
	int no_pp;

} // namespace technicalmachine