decluttering settings.h

This commit is contained in:
Enno Rehling 2017-03-31 21:37:30 +02:00
parent d99090ac67
commit ed99f60186
6 changed files with 7 additions and 57 deletions

View File

@ -102,7 +102,6 @@ void register_attributes(void)
at_register(&at_group); at_register(&at_group);
at_register(&at_building_generic_type); at_register(&at_building_generic_type);
at_register(&at_maxmagicians);
at_register(&at_npcfaction); at_register(&at_npcfaction);
/* connection-typen */ /* connection-typen */
@ -114,6 +113,7 @@ void register_attributes(void)
at_register(&at_germs); at_register(&at_germs);
at_deprecate("maxmagicians", a_readint); /* factions with differnt magician limits, probably unused */
at_deprecate("hurting", a_readint); /* an old arena attribute */ at_deprecate("hurting", a_readint); /* an old arena attribute */
at_deprecate("xontormiaexpress", a_readint); /* required for old datafiles */ at_deprecate("xontormiaexpress", a_readint); /* required for old datafiles */
at_deprecate("orcification", a_readint); /* required for old datafiles */ at_deprecate("orcification", a_readint); /* required for old datafiles */

View File

@ -480,7 +480,6 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders)
gamedate date; gamedate date;
get_gamedate(turn, &date); get_gamedate(turn, &date);
if (date.season == 0 && r->terrain != newterrain(T_DESERT)) { if (date.season == 0 && r->terrain != newterrain(T_DESERT)) {
#ifdef INSECT_POTION
bool usepotion = false; bool usepotion = false;
unit *u2; unit *u2;
@ -490,7 +489,6 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders)
break; break;
} }
if (!usepotion) if (!usepotion)
#endif
{ {
cmistake(u, ord, 98, MSG_EVENT); cmistake(u, ord, 98, MSG_EVENT);
return; return;
@ -2016,20 +2014,6 @@ static void expandstealing(region * r, request * stealorders)
if (u && u->region == r) { if (u && u->region == r) {
n = get_pooled(u, rsilver, GET_ALL, INT_MAX); n = get_pooled(u, rsilver, GET_ALL, INT_MAX);
} }
#ifndef GOBLINKILL
if (oa[i].type.goblin) { /* Goblin-Spezialklau */
int uct = 0;
unit *u2;
assert(effskill(oa[i].unit, SK_STEALTH) >= 4
|| !"this goblin\'s skill is too low");
for (u2 = r->units; u2; u2 = u2->next) {
if (u2->faction == u->faction) {
uct += maintenance_cost(u2);
}
}
n -= uct * 2;
}
#endif
if (n > 10 && rplane(r) && (rplane(r)->flags & PFL_NOALLIANCES)) { if (n > 10 && rplane(r) && (rplane(r)->flags & PFL_NOALLIANCES)) {
/* In Questen nur reduziertes Klauen */ /* In Questen nur reduziertes Klauen */
n = 10; n = 10;

View File

@ -644,7 +644,7 @@ int skill_limit(faction * f, skill_t sk)
m = max_magicians(f); m = max_magicians(f);
} }
else if (sk == SK_ALCHEMY) { else if (sk == SK_ALCHEMY) {
m = config_get_int("rules.maxskills.alchemy", MAXALCHEMISTS); m = config_get_int("rules.maxskills.alchemy", 3);
} }
return m; return m;
} }
@ -752,22 +752,6 @@ int count_maxmigrants(const faction * f)
return 0; return 0;
} }
static void init_maxmagicians(struct attrib *a)
{
a->data.i = MAXMAGICIANS;
}
attrib_type at_maxmagicians = {
"maxmagicians",
init_maxmagicians,
NULL,
NULL,
a_writeint,
a_readint,
NULL,
ATF_UNIQUE
};
int max_magicians(const faction * f) int max_magicians(const faction * f)
{ {
static int rule, config, rc_cache; static int rule, config, rc_cache;
@ -775,15 +759,9 @@ int max_magicians(const faction * f)
int m; int m;
if (config_changed(&config)) { if (config_changed(&config)) {
rule = config_get_int("rules.maxskills.magic", MAXMAGICIANS); rule = config_get_int("rules.maxskills.magic", 3);
} }
m = rule; m = rule;
if (f->attribs) {
attrib *a = a_find(f->attribs, &at_maxmagicians);
if (a) {
m = a->data.i;
}
}
if (rc_changed(&rc_cache)) { if (rc_changed(&rc_cache)) {
rc_elf = get_race(RC_ELF); rc_elf = get_race(RC_ELF);
} }

View File

@ -35,8 +35,6 @@ extern "C" {
struct gamedata; struct gamedata;
struct selist; struct selist;
extern struct attrib_type at_maxmagicians;
/* faction flags */ /* faction flags */
#define FFL_NEWID (1<<0) /* Die Partei hat bereits einmal ihre no gewechselt */ #define FFL_NEWID (1<<0) /* Die Partei hat bereits einmal ihre no gewechselt */
#define FFL_ISNEW (1<<1) #define FFL_ISNEW (1<<1)

View File

@ -1724,13 +1724,13 @@ int unit_max_hp(const unit * u)
int h; int h;
double p; double p;
static int config; static int config;
static int rule_stamina; static bool rule_stamina;
h = u_race(u)->hitpoints; h = u_race(u)->hitpoints;
if (config_changed(&config)) { if (config_changed(&config)) {
rule_stamina = config_get_int("rules.stamina", STAMINA_AFFECTS_HP); rule_stamina = config_get_int("rules.stamina", 1)!=0;
} }
if (rule_stamina & 1) { if (rule_stamina) {
p = pow(effskill(u, SK_STAMINA, u->region) / 2.0, 1.5) * 0.2; p = pow(effskill(u, SK_STAMINA, u->region) / 2.0, 1.5) * 0.2;
h += (int)(h * p + 0.5); h += (int)(h * p + 0.5);
} }

View File

@ -30,23 +30,13 @@
*/ */
#define MUSEUM_MODULE 1 #define MUSEUM_MODULE 1
/* experimental gameplay features (that don't affect the savefile) */
/* TODO: move these settings to settings.h or into configuration files */ /* TODO: move these settings to settings.h or into configuration files */
#define GOBLINKILL /* Goblin-Spezialklau kann toedlich enden */
#define INSECT_POTION /* Spezialtrank fuer Insekten */
#define TREESIZE (8) /* space used by trees (in #peasants) */ #define TREESIZE (8) /* space used by trees (in #peasants) */
#define PEASANTFORCE 0.75 /* Chance einer Vermehrung trotz 90% Auslastung */ #define PEASANTFORCE 0.75 /* Chance einer Vermehrung trotz 90% Auslastung */
/* Gebaeudegroesse = Minimalbelagerer */ /* Gebaeudegroesse = Minimalbelagerer */
#define SIEGEFACTOR 2 #define SIEGEFACTOR 2
/** Magic */
#define MAXMAGICIANS 3
#define MAXALCHEMISTS 3
#define ENCCHANCE 10 /* %-Chance fuer einmalige Zufallsbegegnung */ #define ENCCHANCE 10 /* %-Chance fuer einmalige Zufallsbegegnung */
#define BAGCAPACITY 20000 /* soviel passt in einen Bag of Holding */ #define BAGCAPACITY 20000 /* soviel passt in einen Bag of Holding */
#define PERSON_WEIGHT 1000 /* weight of a "normal" human unit */ #define PERSON_WEIGHT 1000 /* weight of a "normal" human unit */
#define STAMINA_AFFECTS_HP 1<<0