More reverting.

This commit is contained in:
Fabian Müller 2010-04-10 17:38:04 +00:00
parent 4a7e27d070
commit 2c47276afb
19 changed files with 19 additions and 158 deletions

View file

@ -69,9 +69,6 @@ This is the story of Kalenz, and of the Elves in the days of the humans in Wesno
#define PLAYER_GOLD
{GOLD 240 200 180}
#enddef
#define PLAYER_RECRUIT
recruit=Elvish Fighter, Elvish Archer
#enddef
[side]
side=1
@ -82,7 +79,7 @@ This is the story of Kalenz, and of the Elves in the days of the humans in Wesno
controller=human
team_name=player
user_team_name= _ "Player"
{PLAYER_RECRUIT}
recruit={ELVES}
{PLAYER_GOLD}
x=17
y=15
@ -328,7 +325,7 @@ This is the story of Kalenz, and of the Elves in the days of the humans in Wesno
controller=human
team_name=player
user_team_name= _ "Player"
{PLAYER_RECRUIT}
recruit={ELVES}
{PLAYER_GOLD}
x=16
y=15
@ -337,7 +334,7 @@ This is the story of Kalenz, and of the Elves in the days of the humans in Wesno
id=Landulias
generate_name=yes
unrenamable=yes
type=Elvish Shaman
type=Elvish Archer
gender=female
[modifications]
#TODO rethink them

View file

@ -44,17 +44,14 @@
#define PLAYER_GOLD
{GOLD 200 180 100}
#enddef
#define PLAYER_RECRUIT
recruit=Elvish Fighter, Elvish Archer
#enddef
[side]
{KALENZ}
controller=human
{PLAYER_GOLD}
{PLAYER_RECRUIT}
fog=no
# wmllint: recognize Kalenz
recruit={ELVES}
#ifndef MULTIPLAYER
[unit]
placement=leader
@ -460,9 +457,9 @@
save_id=Landar
{LANDAR}
{PLAYER_GOLD}
{PLAYER_RECRUIT}
fog=no
# wmllint: recognize Landar
recruit={ELVES}
[/side]
#wmllint: validate-on
#endif

View file

@ -10,6 +10,8 @@
# Ka'lian, but, instead, hold position and wait for their army to
# arrive"
#TODO make the ugly map border nicer
#ifdef MULTIPLAYER
[multiplayer]
random_start_time=no
@ -747,16 +749,7 @@
gold=$galdrid_gold
[/modify_side]
[set_recruit]
side=1
recruit=Elvish Fighter, Elvish Archer
[/set_recruit]
#ifdef MULTIPLAYER
[set_recruit]
side=6
recruit=Elvish Fighter, Elvish Archer
[/set_recruit]
[modify_side]
side=6
gold=$landar_gold

View file

@ -41,17 +41,14 @@
#define PLAYER_GOLD
{GOLD 280 250 220}
#enddef
#define PLAYER_RECRUIT
recruit=Elvish Fighter, Elvish Archer, Elvish Scout
#enddef
#wmllint: validate-off
[side]
{KALENZ}
{PLAYER_GOLD}
{PLAYER_RECRUIT}
fog=no
# wmllint: recognize Kalenz
recruit={ELVES}
#ifndef MULTIPLAYER
[unit]
{LANDAR}
@ -120,8 +117,8 @@
fog=no
{LANDAR}
{PLAYER_GOLD}
{PLAYER_RECRUIT}
# wmllint: recognize Landar
recruit={ELVES}
[/side]
#wmllint: validate-on
#endif

View file

@ -1723,8 +1723,6 @@ struct unit_healing_struct {
void calculate_healing(int side, bool update_display)
{
DBG_NG << "beginning of healing calculations\n";
int heal_accel = unit_type::stat_accelerator::get_acceleration();
unit_map &units = *resources::units;
std::list<unit_healing_struct> l;
@ -1795,7 +1793,7 @@ void calculate_healing(int side, bool update_display)
}
unit_abilities::effect heal_effect(heal,0,false);
healing = heal_effect.get_composite_value() * heal_accel;
healing = heal_effect.get_composite_value();
for(std::vector<unit_abilities::individual_effect>::const_iterator heal_loc = heal_effect.begin(); heal_loc != heal_effect.end(); ++heal_loc) {
healers.push_back(&*units.find(heal_loc->loc));
@ -1809,7 +1807,7 @@ void calculate_healing(int side, bool update_display)
unit_ability_list regen = u.get_abilities("regenerate");
unit_abilities::effect regen_effect(regen,0,false);
if(regen_effect.get_composite_value() > healing) {
healing = regen_effect.get_composite_value() * heal_accel;
healing = regen_effect.get_composite_value();
healers.clear();
}
if(regen.cfgs.size()) {
@ -1825,7 +1823,7 @@ void calculate_healing(int side, bool update_display)
}
if (int h = resources::game_map->gives_healing(u.get_location())) {
if (h > healing) {
healing = h * heal_accel;
healing = h;
healers.clear();
}
/** @todo FIXME */
@ -1833,7 +1831,7 @@ void calculate_healing(int side, bool update_display)
curer = units.end();
}
if (u.resting() || u.is_healthy()) {
rest_healing = game_config::rest_heal_amount * heal_accel;
rest_healing = game_config::rest_heal_amount;
healing += rest_healing;
}
}
@ -1853,7 +1851,7 @@ void calculate_healing(int side, bool update_display)
healers.clear();
healing = rest_healing;
if (u.side() == side) {
healing -= game_config::poison_amount * heal_accel;
healing -= game_config::poison_amount;
}
}
}

View file

@ -581,21 +581,11 @@ int xp_modifier()
return settings::get_xp_modifier(preferences::get("mp_xp_modifier"));
}
int stat_modifier()
{
return settings::get_stat_modifier(preferences::get("mp_stat_modifier"));
}
void set_xp_modifier(int value)
{
preferences::set("mp_xp_modifier", lexical_cast<std::string>(value));
}
void set_stat_modifier(int value)
{
preferences::set("mp_stat_modifier", lexical_cast<std::string>(value));
}
int era()
{
return lexical_cast_default<int>(preferences::get("mp_era"), 0);

View file

@ -142,9 +142,6 @@ namespace preferences {
int xp_modifier();
void set_xp_modifier(int value);
int stat_modifier();
void set_stat_modifier(int value);
int era();
void set_era(int value);

View file

@ -31,7 +31,6 @@ mp_game_settings::mp_game_settings() :
mp_scenario(),
village_gold(0),
xp_modifier(0),
stat_modifier(0),
mp_countdown_init_time(0),
mp_countdown_reservoir_time(0),
mp_countdown_turn_bonus(0),
@ -58,7 +57,6 @@ mp_game_settings::mp_game_settings(const config& cfg) :
mp_scenario(),
village_gold(0),
xp_modifier(0),
stat_modifier(0),
mp_countdown_init_time(0),
mp_countdown_reservoir_time(0),
mp_countdown_turn_bonus(0),
@ -86,7 +84,6 @@ mp_game_settings::mp_game_settings(const mp_game_settings& settings)
, mp_scenario(settings.mp_scenario)
, village_gold(settings.village_gold)
, xp_modifier(settings.xp_modifier)
, stat_modifier(settings.stat_modifier)
, mp_countdown_init_time(settings.mp_countdown_init_time)
, mp_countdown_reservoir_time(settings.mp_countdown_reservoir_time)
, mp_countdown_turn_bonus(settings.mp_countdown_turn_bonus)
@ -115,7 +112,6 @@ void mp_game_settings::set_from_config(const config& game_cfg)
mp_era = cfg["mp_era"];
mp_scenario = cfg["mp_scenario"];
xp_modifier = lexical_cast_default<int>(cfg["experience_modifier"]);
stat_modifier = lexical_cast_default<int>(cfg["stat_modifier"]);
use_map_settings = utils::string_bool(cfg["mp_use_map_settings"]);
fog_game = utils::string_bool(cfg["mp_fog"]);
shroud_game = utils::string_bool(cfg["mp_shroud"]);
@ -138,7 +134,6 @@ void mp_game_settings::reset()
mp_scenario = "";
village_gold = 0;
xp_modifier = 0;
stat_modifier = 0;
mp_countdown_init_time=0;
mp_countdown_reservoir_time=0;
mp_countdown_turn_bonus=0;
@ -158,7 +153,6 @@ config mp_game_settings::to_config() const
cfg["mp_era"] = mp_era;
cfg["mp_scenario"] = mp_scenario;
cfg["experience_modifier"] = lexical_cast<std::string>(xp_modifier);
cfg["stat_modifier"] = lexical_cast<std::string>(stat_modifier);
cfg["mp_countdown"] = mp_countdown;
cfg["mp_countdown_init_time"] = lexical_cast_default<std::string>(mp_countdown_init_time, "270");
cfg["mp_countdown_turn_bonus"] = lexical_cast_default<std::string>(mp_countdown_turn_bonus, "35");

View file

@ -1,6 +1,6 @@
/* $Id$ */
/*
Copyright (C) 2003 - 2010 by J<EFBFBD>rg Hinrichs
Copyright (C) 2003 - 2010 by Jörg Hinrichs
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
@ -41,7 +41,6 @@ struct mp_game_settings : public savegame::savegame_config
int village_gold;
int xp_modifier;
int stat_modifier;
int mp_countdown_init_time;
int mp_countdown_reservoir_time;
int mp_countdown_turn_bonus;

View file

@ -1579,7 +1579,7 @@ void connect::load_game()
{
level_["random_start_time"] = false;
}
level_["stat_modifier"] = lexical_cast<std::string>(params_.stat_modifier);
level_["experience_modifier"] = params_.xp_modifier;
level_["random_seed"] = state_.rng().get_random_seed();
}

View file

@ -73,8 +73,6 @@ create::create(game_display& disp, const config &cfg, chat& c, config& gamelist)
village_gold_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
xp_modifier_slider_(disp.video()),
xp_modifier_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
stat_modifier_slider_(disp.video()),
stat_modifier_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
name_entry_label_(disp.video(), _("Name of game:"), font::SIZE_PLUS, font::LOBBY_COLOUR),
num_players_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
map_size_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
@ -182,12 +180,6 @@ create::create(game_display& disp, const config &cfg, chat& c, config& gamelist)
xp_modifier_slider_.set_increment(10);
xp_modifier_slider_.set_help_string(_("The amount of experience a unit needs to advance"));
stat_modifier_slider_.set_min(1);
stat_modifier_slider_.set_max(3);
xp_modifier_slider_.set_value(preferences::stat_modifier());
xp_modifier_slider_.set_increment(1);
xp_modifier_slider_.set_help_string(_("The factor the units' statistics are multiplied with"));
use_map_settings_.set_check(preferences::use_map_settings());
use_map_settings_.set_help_string(_("Use scenario specific settings"));
@ -266,7 +258,6 @@ create::~create()
preferences::set_random_start_time(parameters_.random_start_time);
preferences::set_village_gold(parameters_.village_gold);
preferences::set_xp_modifier(parameters_.xp_modifier);
preferences::set_stat_modifier(parameters_.stat_modifier);
}
}
@ -307,7 +298,6 @@ mp_game_settings& create::get_parameters()
parameters_.mp_countdown = countdown_game_.checked();
parameters_.village_gold = village_gold_slider_.value();
parameters_.xp_modifier = xp_modifier_slider_.value();
parameters_.stat_modifier = stat_modifier_slider_.value();
parameters_.use_map_settings = use_map_settings_.checked();
parameters_.random_start_time = random_start_time_.checked();
parameters_.fog_game = fog_game_.checked();
@ -425,15 +415,6 @@ void create::process_event()
xp_modifier_label_.set_text(buf.str());
// Stat modifier
const int statmod = stat_modifier_slider_.value();
buf.str("");
//TODO tiny not tiny?
buf << N_("Statistics Modifier: ") << statmod << "x";
stat_modifier_label_.set_text(buf.str());
bool map_changed = map_selection_ != maps_menu_.selection();
map_selection_ = maps_menu_.selection();
@ -587,10 +568,6 @@ void create::process_event()
settings::get_xp_modifier(parameters_.scenario_data["experience_modifier"]) :
preferences::xp_modifier());
stat_modifier_slider_.set_value(map_settings ?
settings::get_stat_modifier(parameters_.scenario_data["stat_modifier"]) :
preferences::stat_modifier());
random_start_time_.set_check(map_settings ?
settings::use_random_start_time(parameters_.scenario_data["random_start_time"]) :
preferences::random_start_time());
@ -624,7 +601,6 @@ void create::process_event()
turns_slider_.enable(!map_settings);
village_gold_slider_.enable(!map_settings);
xp_modifier_slider_.enable(!map_settings);
stat_modifier_slider_.enable(!map_settings);
random_start_time_.enable(!map_settings);
fog_game_.enable(!map_settings);
shroud_game_.enable(!map_settings);
@ -653,8 +629,6 @@ void create::hide_children(bool hide)
village_gold_label_.hide(hide);
xp_modifier_slider_.hide(hide);
xp_modifier_label_.hide(hide);
stat_modifier_slider_.hide(hide);
stat_modifier_label_.hide(hide);
name_entry_label_.hide(hide);
num_players_label_.hide(hide);
@ -794,12 +768,6 @@ void create::layout_children(const SDL_Rect& rect)
xp_modifier_slider_.set_location(xpos, ypos);
ypos += xp_modifier_slider_.height() + border_size;
stat_modifier_label_.set_location(xpos, ypos);
ypos += stat_modifier_label_.height() + border_size;
stat_modifier_slider_.set_width(ca.w - xpos);
stat_modifier_slider_.set_location(xpos, ypos);
ypos += stat_modifier_slider_.height() + border_size;
use_map_settings_.set_location(xpos, ypos);
fog_game_.set_location(xpos + (ca.w - xpos)/2 + 5, ypos);
ypos += use_map_settings_.height() + border_size;

View file

@ -75,8 +75,6 @@ private:
gui::label village_gold_label_;
gui::slider xp_modifier_slider_;
gui::label xp_modifier_label_;
gui::slider stat_modifier_slider_;
gui::label stat_modifier_label_;
gui::label name_entry_label_;
gui::label num_players_label_;

View file

@ -75,7 +75,6 @@ play_controller::play_controller(const config& level, game_state& state_of_game,
undo_stack_(),
redo_stack_(),
xp_mod_(atoi(level["experience_modifier"].c_str()) > 0 ? atoi(level["experience_modifier"].c_str()) : 100),
stat_mod_(atoi(level["stat_modifier"].c_str()) > 0 ? atoi(level["stat_modifier"].c_str()) : 1),
loading_game_(level["playing_team"].empty() == false),
first_human_team_(-1),
player_number_(1),

View file

@ -208,7 +208,6 @@ protected:
undo_list redo_stack_;
const unit_type::experience_accelerator xp_mod_;
const unit_type::stat_accelerator stat_mod_;
//if a team is specified whose turn it is, it means we're loading a game
//instead of starting a fresh one. Gets reset to false after init_side
bool loading_game_;

View file

@ -49,11 +49,6 @@ int get_xp_modifier(const std::string& value)
return lexical_cast_in_range<int>(value, 70, 30, 200);
}
int get_stat_modifier(const std::string& value)
{
return lexical_cast_in_range<int>(value, 1, 1, 3);
}
bool use_fog(const std::string& value)
{
return utils::string_bool(value, true);

View file

@ -70,20 +70,6 @@ namespace settings {
*/
int get_xp_modifier(const std::string& value);
/**
* Gets the stat modifier.
* If no valid value supplied, it will return a default.
* The value is also range checked.
* When out of bounds, it will be set to the nearest bound.
*
* @param value string containing the stat modifier
*
* @returns the stat modifier
*/
int get_stat_modifier(const std::string& value);
/**
* Returns whether the fog of war should be used.
* If no valid value is supplied, it will return a default.

View file

@ -46,7 +46,7 @@ class effect
effect(const unit_ability_list& list, int def, bool backstab);
int get_composite_value() const
{ return composite_value_ ;}
{ return composite_value_; }
effect_list::const_iterator begin() const
{ return effect_list_.begin(); }
effect_list::const_iterator end() const

View file

@ -39,11 +39,6 @@ static lg::log_domain log_config("config");
static lg::log_domain log_unit("unit");
#define DBG_UT LOG_STREAM(debug, log_unit)
namespace {
int stat_modifier = 1;
}
attack_type::attack_type(const config& cfg) :
aloc_(),
dloc_(),
@ -100,12 +95,6 @@ std::string attack_type::accuracy_parry_description() const
return s.str();
}
int attack_type::num_attacks() const
{
int attacks = (num_attacks_ * stat_modifier);
return attacks;
}
bool attack_type::matches_filter(const config& cfg,bool self) const
{
const std::vector<std::string>& filter_range = utils::split(cfg["range"]);
@ -1005,33 +994,6 @@ int unit_type::experience_needed(bool with_acceleration) const
return experience_needed_;
}
unit_type::stat_accelerator::stat_accelerator(int modifier) : old_value_(stat_modifier)
{
stat_modifier = modifier;
}
unit_type::stat_accelerator::~stat_accelerator()
{
stat_modifier = old_value_;
}
int unit_type::stat_accelerator::get_acceleration()
{
return stat_modifier;
}
int unit_type::hitpoints() const
{
int hp = (hitpoints_ * stat_modifier);
return hp;
}
const char* unit_type::alignment_description(unit_type::ALIGNMENT align, unit_race::GENDER gender)
{
static const char* aligns[] = { N_("lawful"), N_("neutral"), N_("chaotic") };

View file

@ -46,7 +46,7 @@ public:
int accuracy() const { return accuracy_; }
int parry() const { return parry_; }
int damage() const { return damage_; }
int num_attacks() const;// { return num_attacks_; }
int num_attacks() const { return num_attacks_; }
double attack_weight() const { return attack_weight_; }
double defense_weight() const { return defense_weight_; }
@ -204,7 +204,7 @@ public:
// NOTE: this used to be a const object reference, but it messed up with the
// translation engine upon changing the language in the same session.
const t_string unit_description() const;
int hitpoints() const;
int hitpoints() const { return hitpoints_; }
int level() const { return level_; }
int movement() const { return movement_; }
int max_attacks() const { return max_attacks_; }
@ -230,14 +230,6 @@ public:
int old_value_;
};
struct stat_accelerator {
stat_accelerator(int modifier);
~stat_accelerator();
static int get_acceleration();
private:
int old_value_;
};
enum ALIGNMENT { LAWFUL, NEUTRAL, CHAOTIC };
ALIGNMENT alignment() const { return alignment_; }