Freeciv-3.1
|
#include "capability.h"
#include "log.h"
#include "registry.h"
#include "actions.h"
#include "effects.h"
#include "game.h"
#include "movement.h"
#include "requirements.h"
#include "unittype.h"
#include "rssanity.h"
#include "ruleset.h"
#include "settings.h"
#include "rscompat.h"
Go to the source code of this file.
Macros | |
#define | enough_new_user_flags(_new_flags_, _name_, _LAST_USER_FLAG_, _LAST_USER_FLAG_PREV_) |
#define | UTYF_LAST_USER_FLAG_3_0 UTYF_USER_FLAG_40 |
#define | UCF_LAST_USER_FLAG_3_0 UCF_USER_FLAG_8 |
#define | TER_LAST_USER_FLAG_3_0 TER_USER_8 |
#define enough_new_user_flags | ( | _new_flags_, | |
_name_, | |||
_LAST_USER_FLAG_, | |||
_LAST_USER_FLAG_PREV_ | |||
) |
Definition at line 43 of file rscompat.c.
#define TER_LAST_USER_FLAG_3_0 TER_USER_8 |
Definition at line 51 of file rscompat.c.
#define UCF_LAST_USER_FLAG_3_0 UCF_USER_FLAG_8 |
Definition at line 50 of file rscompat.c.
#define UTYF_LAST_USER_FLAG_3_0 UTYF_USER_FLAG_40 |
Definition at line 49 of file rscompat.c.
|
static |
Handle a universal being separated from an original universal.
A universal may be split into two new universals. An effect may mention the universal that now has been split in its requirement list. In that case two effect - one for the original and one for the universal being separated from it - are needed.
Check if the original universal is mentioned in the requirement list of peffect. Handle creating one effect for the original and one for the universal that has been separated out if it is.
Definition at line 551 of file rscompat.c.
Referenced by effect_list_compat_cb().
|
static |
Turn old effect to an action enabler.
Definition at line 752 of file rscompat.c.
Referenced by rscompat_old_effect_3_1().
|
static |
Helper for effect_to_enabler(). Is this requirement meant for target rather than actor?
Definition at line 670 of file rscompat.c.
Referenced by effect_to_enabler().
|
static |
Find and return the first unused terrain user flag. If all terrain user flags are taken MAX_NUM_USER_TER_FLAGS is returned.
Definition at line 361 of file rscompat.c.
Referenced by rscompat_names().
|
static |
Find and return the first unused unit class user flag. If all unit class user flags are taken MAX_NUM_USER_UCLASS_FLAGS is returned.
Definition at line 342 of file rscompat.c.
Referenced by rscompat_names().
|
static |
Find and return the first unused unit type user flag. If all unit type user flags are taken MAX_NUM_USER_UNIT_FLAGS is returned.
Definition at line 323 of file rscompat.c.
Referenced by rscompat_names().
|
static |
Turn paratroopers_mr_sub into the Action_Success_Actor_Move_Cost effect
Definition at line 645 of file rscompat.c.
Referenced by rscompat_postprocess().
const char * rscompat_action_max_range_name_S3_1 | ( | struct rscompat_info * | compat, |
int | act_id | ||
) |
Adjust freeciv-3.0 ruleset action max_range to freeciv-3.1
Definition at line 2255 of file rscompat.c.
Referenced by load_action_range_max().
const char * rscompat_action_ui_name_S3_1 | ( | struct rscompat_info * | compat, |
int | act_id | ||
) |
Adjust freeciv-3.0 ruleset action ui_name to freeciv-3.1
Definition at line 2240 of file rscompat.c.
Referenced by load_ruleset_game().
void rscompat_adjust_pre_sanity | ( | struct rscompat_info * | info | ) |
Do compatibility things after regular ruleset loading, but before sanity checking.
Definition at line 839 of file rscompat.c.
Referenced by load_rulesetdir().
bool rscompat_auto_attack_3_1 | ( | struct rscompat_info * | compat, |
struct action_auto_perf * | auto_perf, | ||
size_t | psize, | ||
enum unit_type_flag_id * | protecor_flag | ||
) |
Replace deprecated auto_attack configuration.
Definition at line 1751 of file rscompat.c.
Referenced by load_ruleset_game().
bool rscompat_check_cap_and_version | ( | struct section_file * | file, |
const char * | filename, | ||
const struct rscompat_info * | info | ||
) |
Different ruleset files within a ruleset directory should all have identical datafile.format_version This checks the file version against the expected version.
See also rscompat_check_capabilities
Definition at line 131 of file rscompat.c.
Referenced by load_building_names(), load_government_names(), load_nation_names(), load_ruleset_cities(), load_ruleset_effects(), load_style_names(), load_tech_names(), load_terrain_names(), and load_unit_names().
int rscompat_check_capabilities | ( | struct section_file * | file, |
const char * | filename, | ||
const struct rscompat_info * | info | ||
) |
Ruleset files should have a capabilities string datafile.options This checks the string and that the required capabilities are satisfied.
Definition at line 65 of file rscompat.c.
Referenced by load_game_names(), and rscompat_check_cap_and_version().
const char * rscompat_combat_bonus_name_3_1 | ( | struct rscompat_info * | compat, |
const char * | old_type | ||
) |
Replace deprecated combat bonus names with currently valid ones.
Definition at line 2179 of file rscompat.c.
Referenced by lookup_cbonus_list().
|
static |
Add all hard obligatory requirements to an action enabler or disable it.
ae | the action enabler to add requirements to. |
Definition at line 165 of file rscompat.c.
Referenced by rscompat_enablers_add_obligatory_hard_reqs().
void rscompat_enablers_add_obligatory_hard_reqs | ( | void | ) |
Update existing action enablers for new hard obligatory requirements. Disable those that can't be upgraded.
Definition at line 285 of file rscompat.c.
Referenced by rscompat_postprocess(), and ruleset_purge_redundant_reqs().
void rscompat_extra_adjust_3_1 | ( | struct rscompat_info * | compat, |
struct extra_type * | pextra | ||
) |
Adjust freeciv-3.0 ruleset extra definitions to freeciv-3.1
Definition at line 2206 of file rscompat.c.
Referenced by load_ruleset_terrain().
void rscompat_init_info | ( | struct rscompat_info * | info | ) |
Initialize rscompat information structure
Definition at line 56 of file rscompat.c.
Referenced by load_rulesetdir(), and tab_misc::sanity_check().
bool rscompat_names | ( | struct rscompat_info * | info | ) |
Do compatibility things with names before they are referred to. Runs after names are loaded from the ruleset but before the ruleset objects that may refer to them are loaded.
This is needed when previously hard coded items that are referred to in the ruleset them self becomes ruleset defined.
Returns FALSE if an error occurs.
Definition at line 386 of file rscompat.c.
Referenced by load_rulesetdir().
bool rscompat_old_effect_3_1 | ( | const char * | type, |
struct section_file * | file, | ||
const char * | sec_name, | ||
struct rscompat_info * | compat | ||
) |
Check if effect name refers to one of the removed effects, and handle it if it does. Returns TRUE iff name was a valid old name.
Definition at line 806 of file rscompat.c.
Referenced by load_ruleset_effects().
bool rscompat_old_slow_invasions_3_1 | ( | struct rscompat_info * | compat, |
bool | slow_invasions | ||
) |
Replace slow_invasions and friends.
Definition at line 1910 of file rscompat.c.
Referenced by load_ruleset_game().
void rscompat_postprocess | ( | struct rscompat_info * | info | ) |
Do compatibility things after regular ruleset loading.
Definition at line 859 of file rscompat.c.
Referenced by load_rulesetdir().
const char * rscompat_req_name_3_1 | ( | const char * | type, |
const char * | old_name | ||
) |
Replace deprecated requirement type names with currently valid ones.
The extra arguments are for situation where some, but not all, instances of a requirement type should become something else.
Definition at line 2061 of file rscompat.c.
Referenced by lookup_req_list().
const char * rscompat_req_type_name_3_1 | ( | const char * | old_type | ) |
Replace deprecated requirement type names with currently valid ones.
Definition at line 2045 of file rscompat.c.
Referenced by lookup_req_list().
void rscompat_req_vec_adjust_3_1 | ( | struct rscompat_info * | compat, |
struct requirement_vector * | preqs, | ||
int * | reqs_count, | ||
const char * | filename, | ||
const char * | sec, | ||
const char * | sub, | ||
const char * | rfor | ||
) |
Modify requirement vectors in ways that require looking at the entire vector, rather than just individual requirements.
Definition at line 2081 of file rscompat.c.
Referenced by lookup_req_list().
enum road_gui_type rscompat_road_gui_type_3_1 | ( | struct road_type * | proad | ) |
Determine freeciv-3.1 road gui_type from freeciv-3.0 compat_special
Definition at line 2222 of file rscompat.c.
Referenced by load_ruleset_terrain().
void rscompat_uclass_flags_3_1 | ( | struct rscompat_info * | compat, |
struct unit_class * | pclass | ||
) |
Set compatibility unit class flags.
Definition at line 2194 of file rscompat.c.
Referenced by load_ruleset_units().
const char * rscompat_utype_flag_name_3_1 | ( | struct rscompat_info * | compat, |
const char * | old_type | ||
) |
Replace deprecated unit type flag names with currently valid ones.
Definition at line 2167 of file rscompat.c.
Referenced by load_ruleset_units(), load_unit_names(), lookup_cbonus_list(), and lookup_req_list().
|
static |
Slow invasion movement punishment.
Definition at line 1883 of file rscompat.c.
Referenced by rscompat_old_slow_invasions_3_1().
Slow invasion split existing action enablers for action_orig.
Definition at line 1792 of file rscompat.c.
Referenced by rscompat_old_slow_invasions_3_1().
|
static |
Copy the ui_name of an existing action to the ui_name of its copy by inserting it at the first s in name_modification string.
Definition at line 531 of file rscompat.c.
Referenced by rscompat_postprocess().