making a warning go away. clarifying the need to remove the _MODULE defines and how to.

This commit is contained in:
Enno Rehling 2008-04-20 15:18:43 +00:00
parent b63200adf9
commit 36812c1168
42 changed files with 107 additions and 103 deletions

View file

@ -676,7 +676,7 @@ cr_output_unit(FILE * F, const region * r,
assert(u); assert(u);
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_HIDDEN)) if (fspecial(u->faction, FS_HIDDEN))
a_fshidden = a_find(u->attribs, &at_fshidden); a_fshidden = a_find(u->attribs, &at_fshidden);
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
@ -1149,7 +1149,7 @@ report_computer(const char * filename, report_context * ctx, const char * charse
const char * mailto = locale_string(f->locale, "mailto"); const char * mailto = locale_string(f->locale, "mailto");
const attrib * a; const attrib * a;
seen_region * sr = NULL; seen_region * sr = NULL;
#ifdef SCORE_MODULE #if SCORE_MODULE
int score = 0, avgscore = 0; int score = 0, avgscore = 0;
#endif #endif
int enc = xmlParseCharEncoding(charset); int enc = xmlParseCharEncoding(charset);
@ -1186,7 +1186,7 @@ report_computer(const char * filename, report_context * ctx, const char * charse
fprintf(F, "\"%s\";locale\n", locale_name(f->locale)); fprintf(F, "\"%s\";locale\n", locale_name(f->locale));
fprintf(F, "%d;age\n", f->age); fprintf(F, "%d;age\n", f->age);
fprintf(F, "%d;Optionen\n", f->options); fprintf(F, "%d;Optionen\n", f->options);
#ifdef SCORE_MODULE #if SCORE_MODULE
if (f->options & want(O_SCORE) && f->age>DISPLAYSCORE) { if (f->options & want(O_SCORE) && f->age>DISPLAYSCORE) {
score = f->score; score = f->score;
avgscore = average_score_of_age(f->age, f->age / 24 + 1); avgscore = average_score_of_age(f->age, f->age / 24 + 1);

View file

@ -233,7 +233,7 @@ add_recruits(unit * u, int number, int wanted)
assert(number<=wanted); assert(number<=wanted);
if (number > 0) { if (number > 0) {
unit * unew; unit * unew;
#ifdef KARMA_MODULE #if KARMA_MODULE
int i = fspecial(u->faction, FS_MILITIA); int i = fspecial(u->faction, FS_MILITIA);
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
@ -253,7 +253,7 @@ add_recruits(unit * u, int number, int wanted)
change_level(unew, SK_RIDING, 1); change_level(unew, SK_RIDING, 1);
} }
#ifdef KARMA_MODULE #if KARMA_MODULE
if (i > 0) { if (i > 0) {
if (unew->race->bonus[SK_SPEAR] >= 0) if (unew->race->bonus[SK_SPEAR] >= 0)
change_level(unew, SK_SPEAR, i); change_level(unew, SK_SPEAR, i);

View file

@ -118,7 +118,7 @@ give_item(int want, const item_type * itype, unit * src, unit * dest, struct ord
} }
#endif #endif
#endif #endif
#if defined(MUSEUM_MODULE) && defined(TODO) #if MUSEUM_MODULE && defined(TODO)
/* TODO: use a trigger for the museum warden! */ /* TODO: use a trigger for the museum warden! */
if (a_find(dest->attribs, &at_warden)) { if (a_find(dest->attribs, &at_warden)) {
warden_add_give(src, dest, itype, n); warden_add_give(src, dest, itype, n);

View file

@ -25,7 +25,7 @@
#include <modules/gmcmd.h> #include <modules/gmcmd.h>
#include <modules/infocmd.h> #include <modules/infocmd.h>
#ifdef WORMHOLE_MODULE #if WORMHOLE_MODULE
#include <modules/wormhole.h> #include <modules/wormhole.h>
#endif #endif
@ -3048,7 +3048,7 @@ maxunits(const faction *f)
if (global.unitsperalliance == true) { if (global.unitsperalliance == true) {
float mult = 1.0; float mult = 1.0;
#ifdef KARMA_MODULE #if KARMA_MODULE
faction *f2; faction *f2;
for (f2 = factions; f2; f2 = f2->next) { for (f2 = factions; f2; f2 = f2->next) {
if (f2->alliance == f->alliance) { if (f2->alliance == f->alliance) {
@ -3058,7 +3058,7 @@ maxunits(const faction *f)
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
return (int) (global.maxunits * mult); return (int) (global.maxunits * mult);
} }
#ifdef KARMA_MODULE #if KARMA_MODULE
return (int) (global.maxunits * (1 + 0.4 * fspecial(f, FS_ADMINISTRATOR))); return (int) (global.maxunits * (1 + 0.4 * fspecial(f, FS_ADMINISTRATOR)));
#else #else
return global.maxunits; return global.maxunits;
@ -3354,7 +3354,7 @@ monthly_healing(void)
continue; continue;
} }
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_UNDEAD)) continue; if (fspecial(u->faction, FS_UNDEAD)) continue;
if(fspecial(u->faction, FS_REGENERATION)) { if(fspecial(u->faction, FS_REGENERATION)) {
@ -3834,7 +3834,7 @@ init_processor(void)
add_proc_order(p, K_NAME, &name_cmd, 0, NULL); add_proc_order(p, K_NAME, &name_cmd, 0, NULL);
add_proc_order(p, K_GUARD, &guard_off_cmd, 0, NULL); add_proc_order(p, K_GUARD, &guard_off_cmd, 0, NULL);
add_proc_order(p, K_RESHOW, &reshow_cmd, 0, NULL); add_proc_order(p, K_RESHOW, &reshow_cmd, 0, NULL);
#ifdef KARMA_MODULE #if KARMA_MODULE
add_proc_order(p, K_WEREWOLF, &setwere_cmd, 0, NULL); add_proc_order(p, K_WEREWOLF, &setwere_cmd, 0, NULL);
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
@ -3857,7 +3857,7 @@ init_processor(void)
add_proc_global(p, &alliancevictory, "Testen der Allianzbedingungen"); add_proc_global(p, &alliancevictory, "Testen der Allianzbedingungen");
} }
#ifdef INFOCMD_MODULE #if INFOCMD_MODULE
add_proc_global(p, &infocommands, NULL); add_proc_global(p, &infocommands, NULL);
#endif #endif
add_proc_global(p, &gmcommands, "GM Kommandos"); add_proc_global(p, &gmcommands, "GM Kommandos");
@ -3866,7 +3866,7 @@ init_processor(void)
add_proc_order(p, K_LEAVE, &leave_cmd, 0, "Verlassen"); add_proc_order(p, K_LEAVE, &leave_cmd, 0, "Verlassen");
if (!nobattle) { if (!nobattle) {
#ifdef KARMA_MODULE #if KARMA_MODULE
p+=10; p+=10;
add_proc_global(p, &jihad_attacks, "Jihad-Angriffe"); add_proc_global(p, &jihad_attacks, "Jihad-Angriffe");
#endif #endif
@ -3920,7 +3920,7 @@ init_processor(void)
p+=10; p+=10;
add_proc_order(p, K_GUARD, &guard_on_cmd, 0, "Bewache (an)"); add_proc_order(p, K_GUARD, &guard_on_cmd, 0, "Bewache (an)");
#ifdef XECMD_MODULE #if XECMD_MODULE
/* can do together with guard */ /* can do together with guard */
add_proc_order(p, K_LEAVE, &xecmd, 0, "Zeitung"); add_proc_order(p, K_LEAVE, &xecmd, 0, "Zeitung");
#endif #endif
@ -3945,7 +3945,7 @@ init_processor(void)
p+=10; p+=10;
add_proc_global(p, &reorder, "Einheiten sortieren"); add_proc_global(p, &reorder, "Einheiten sortieren");
#ifdef KARMA_MODULE #if KARMA_MODULE
p+=10; p+=10;
add_proc_global(p, &karma, "Jihads setzen"); add_proc_global(p, &karma, "Jihads setzen");
#endif #endif
@ -3985,7 +3985,7 @@ processorders (void)
ageing(); ageing();
remove_empty_units(); remove_empty_units();
#ifdef WORMHOLE_MODULE #if WORMHOLE_MODULE
create_wormholes(); create_wormholes();
#endif #endif
/* immer ausführen, wenn neue Sprüche dazugekommen sind, oder sich /* immer ausführen, wenn neue Sprüche dazugekommen sind, oder sich

View file

@ -53,7 +53,7 @@
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#ifdef KARMA_MODULE #if KARMA_MODULE
#define STANDARD_LUCK 0 #define STANDARD_LUCK 0

View file

@ -612,7 +612,7 @@ drown(region *r)
unit ** up = up=&r->units; unit ** up = up=&r->units;
while (*up) { while (*up) {
unit *u = *up; unit *u = *up;
#ifdef KARMA_MODULE #if KARMA_MODULE
int amphibian_level = fspecial(u->faction, FS_AMPHIBIAN); int amphibian_level = fspecial(u->faction, FS_AMPHIBIAN);
#else #else
int amphibian_level = 0; int amphibian_level = 0;
@ -1121,7 +1121,7 @@ icebergs(void)
void void
randomevents(void) randomevents(void)
{ {
#ifdef KARMA_MODULE #if KARMA_MODULE
faction *f; faction *f;
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
region *r; region *r;
@ -1217,7 +1217,7 @@ randomevents(void)
} }
} }
#ifdef KARMA_MODULE #if KARMA_MODULE
/* lycanthropen werden werwölfe */ /* lycanthropen werden werwölfe */
for (f = factions; f; f=f->next) { for (f = factions; f; f=f->next) {
if (f->alive) { if (f->alive) {
@ -1273,7 +1273,7 @@ randomevents(void)
dissolve_units(); dissolve_units();
check_split(); check_split();
#ifdef KARMA_MODULE #if KARMA_MODULE
check_luck(); check_luck();
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
} }

View file

@ -1944,7 +1944,7 @@ report_plaintext(const char * filename, report_context * ctx, const char * chars
centre(F, alliancename(f->alliance), true); centre(F, alliancename(f->alliance), true);
} }
#ifdef KARMA_MODULE #if KARMA_MODULE
buf[0] = 0; buf[0] = 0;
dh = 0; dh = 0;
for (a=a_find(f->attribs, &at_faction_special); a && a->type==&at_faction_special; a=a->next) { for (a=a_find(f->attribs, &at_faction_special); a && a->type==&at_faction_special; a=a->next) {
@ -1996,7 +1996,7 @@ report_plaintext(const char * filename, report_context * ctx, const char * chars
} }
} }
rnl(F); rnl(F);
#ifdef SCORE_MODULE #if SCORE_MODULE
if (f->options & want(O_SCORE) && f->age > DISPLAYSCORE) { if (f->options & want(O_SCORE) && f->age > DISPLAYSCORE) {
RENDER(f, buf, sizeof(buf), ("nr_score", "score average", f->score, average_score_of_age(f->age, f->age / 24 + 1))); RENDER(f, buf, sizeof(buf), ("nr_score", "score average", f->score, average_score_of_age(f->age, f->age / 24 + 1)));
centre(F, buf, true); centre(F, buf, true);

View file

@ -174,7 +174,7 @@ spy_cmd(unit * u, struct order * ord)
int int
setwere_cmd(unit *u, struct order * ord) setwere_cmd(unit *u, struct order * ord)
{ {
#ifdef KARMA_MODULE #if KARMA_MODULE
int level = fspecial(u->faction, FS_LYCANTROPE); int level = fspecial(u->faction, FS_LYCANTROPE);
const char *s; const char *s;
@ -320,7 +320,7 @@ setstealth_cmd(unit * u, struct order * ord)
/* TARNE ALLES (was nicht so alles geht?) */ /* TARNE ALLES (was nicht so alles geht?) */
u_seteffstealth(u, -1); u_seteffstealth(u, -1);
break; break;
#ifdef KARMA_MODULE #if KARMA_MODULE
case P_NUMBER: case P_NUMBER:
/* TARNE ANZAHL [NICHT] */ /* TARNE ANZAHL [NICHT] */
if (!fspecial(u->faction, FS_HIDDEN)) { if (!fspecial(u->faction, FS_HIDDEN)) {
@ -339,7 +339,7 @@ setstealth_cmd(unit * u, struct order * ord)
} }
break; break;
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
#ifdef KARMA_MODULE #if KARMA_MODULE
case P_ITEMS: case P_ITEMS:
/* TARNE GEGENSTÄNDE [NICHT] */ /* TARNE GEGENSTÄNDE [NICHT] */
if(!fspecial(u->faction, FS_HIDDEN)) { if(!fspecial(u->faction, FS_HIDDEN)) {

View file

@ -640,7 +640,7 @@ learn_cmd(unit * u, order * ord)
change_effect(u, oldpotiontype[P_FOOL], -l); change_effect(u, oldpotiontype[P_FOOL], -l);
} }
#ifdef KARMA_MODULE #if KARMA_MODULE
l = fspecial(u->faction, FS_WARRIOR); l = fspecial(u->faction, FS_WARRIOR);
if (l > 0) { if (l > 0) {
if (sk == SK_CROSSBOW || sk == SK_LONGBOW if (sk == SK_CROSSBOW || sk == SK_LONGBOW

View file

@ -936,7 +936,7 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
++at.fighter->hits; ++at.fighter->hits;
#endif #endif
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fval(au, UFL_WERE)) { if (fval(au, UFL_WERE)) {
int level = fspecial(du->faction, FS_LYCANTROPE); int level = fspecial(du->faction, FS_LYCANTROPE);
da += level; da += level;
@ -974,7 +974,7 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
/* Momentan nur Trollgürtel und Werwolf-Eigenschaft */ /* Momentan nur Trollgürtel und Werwolf-Eigenschaft */
am = select_magicarmor(dt); am = select_magicarmor(dt);
#ifdef KARMA_MODULE #if KARMA_MODULE
if(fval(du, UFL_WERE)) { if(fval(du, UFL_WERE)) {
/* this counts as magical armor */ /* this counts as magical armor */
int level = fspecial(du->faction, FS_LYCANTROPE); int level = fspecial(du->faction, FS_LYCANTROPE);
@ -982,8 +982,8 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
} }
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
#if CHANGED_CROSSBOWS == 1 #if CHANGED_CROSSBOWS
if(awtype && fval(awtype,WTF_ARMORPIERCING)) { if (awtype && fval(awtype, WTF_ARMORPIERCING)) {
/* crossbows */ /* crossbows */
ar /= 2; ar /= 2;
an /= 2; an /= 2;
@ -1001,7 +1001,7 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
if (type!=AT_COMBATSPELL && type!=AT_SPELL) { if (type!=AT_COMBATSPELL && type!=AT_SPELL) {
/* Kein Zauber, normaler Waffenschaden */ /* Kein Zauber, normaler Waffenschaden */
double kritchance = (sk * 3 - sd) / 200.0; double kritchance = (sk * 3 - sd) / 200.0;
#ifdef KARMA_MODULE #if KARMA_MODULE
int faerie_level = fspecial(du->faction, FS_FAERIE); int faerie_level = fspecial(du->faction, FS_FAERIE);
da += jihad(au->faction, du->race); da += jihad(au->faction, du->race);
@ -1646,7 +1646,7 @@ skilldiff(troop at, troop dt, int dist)
skdiff += 5; skdiff += 5;
} }
#ifdef KARMA_MODULE #if KARMA_MODULE
/* Werwolf */ /* Werwolf */
if(fval(au, UFL_WERE)) { if(fval(au, UFL_WERE)) {
skdiff += fspecial(au->faction, FS_LYCANTROPE); skdiff += fspecial(au->faction, FS_LYCANTROPE);
@ -1657,7 +1657,7 @@ skilldiff(troop at, troop dt, int dist)
af->side->size[SUM_ROW] >= df->side->size[SUM_ROW] * 10) af->side->size[SUM_ROW] >= df->side->size[SUM_ROW] * 10)
skdiff += 1; skdiff += 1;
#ifdef KARMA_MODULE #if KARMA_MODULE
/* TODO this should be a skillmod */ /* TODO this should be a skillmod */
skdiff += jihad(au->faction, du->race); skdiff += jihad(au->faction, du->race);
#endif #endif
@ -1676,7 +1676,7 @@ skilldiff(troop at, troop dt, int dist)
int beff = buildingeffsize(df->building, false)-1; int beff = buildingeffsize(df->building, false)-1;
/* -1 because the tradepost has no protection value */ /* -1 because the tradepost has no protection value */
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(au->faction, FS_SAPPER)) { if (fspecial(au->faction, FS_SAPPER)) {
/* Halbe Schutzwirkung, aufgerundet */ /* Halbe Schutzwirkung, aufgerundet */
beff = (beff+1)/2; beff = (beff+1)/2;
@ -2294,7 +2294,7 @@ aftermath(battle * b)
unit *du = df->unit; unit *du = df->unit;
int dead = dead_fighters(df); int dead = dead_fighters(df);
int pr_mercy = 0; int pr_mercy = 0;
#ifdef KARMA_MODULE #if KARMA_MODULE
const attrib *a= a_find(du->attribs, &at_prayer_effect); const attrib *a= a_find(du->attribs, &at_prayer_effect);
while (a && a->type==&at_prayer_effect) { while (a && a->type==&at_prayer_effect) {
@ -2951,7 +2951,7 @@ make_fighter(battle * b, unit * u, side * s1, boolean attack)
/* Effekte von Artefakten */ /* Effekte von Artefakten */
strongmen = min(fig->unit->number, get_item(u, I_TROLLBELT)); strongmen = min(fig->unit->number, get_item(u, I_TROLLBELT));
#ifdef KARMA_MODULE #if KARMA_MODULE
for (a = a_find(u->attribs, &at_prayer_effect); a && a->type==&at_prayer_effect; a = a->next) { for (a = a_find(u->attribs, &at_prayer_effect); a && a->type==&at_prayer_effect; a = a->next) {
if (a->data.sa[0] == PR_AID) { if (a->data.sa[0] == PR_AID) {
pr_aid = true; pr_aid = true;
@ -4009,7 +4009,7 @@ do_battle(region * r)
battle_update(b); battle_update(b);
battle_attacks(b); battle_attacks(b);
#ifdef KARMA_MODULE #if KARMA_MODULE
/* Regeneration */ /* Regeneration */
for (fi=0;fi!=b->nfighters;++fi) { for (fi=0;fi!=b->nfighters;++fi) {
fighter *fig = b->fighters[fi]; fighter *fig = b->fighters[fi];

View file

@ -93,7 +93,7 @@ const struct race * new_race[MAXRACES];
boolean sqlpatch = false; boolean sqlpatch = false;
int turn; int turn;
#ifdef XECMD_MODULE #if XECMD_MODULE
attrib_type at_xontormiaexpress = { attrib_type at_xontormiaexpress = {
"xontormiaexpress", "xontormiaexpress",
DEFAULT_INIT, DEFAULT_INIT,
@ -512,7 +512,7 @@ max_magicians(const faction * f)
m = a->data.i; m = a->data.i;
} }
if (f->race == new_race[RC_ELF]) ++m; if (f->race == new_race[RC_ELF]) ++m;
#ifdef KARMA_MODULE #if KARMA_MODULE
m += fspecial(f, FS_MAGOCRACY) * 2; m += fspecial(f, FS_MAGOCRACY) * 2;
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
return m; return m;
@ -2318,7 +2318,7 @@ weight(const unit * u)
in_bag += w; in_bag += w;
} }
#ifdef KARMA_MODULE #if KARMA_MODULE
faerie_level = fspecial(u->faction, FS_FAERIE); faerie_level = fspecial(u->faction, FS_FAERIE);
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
@ -2397,7 +2397,7 @@ lifestyle(const unit * u)
if(u->region->planep && fval(u->region->planep, PFL_NOFEED)) if(u->region->planep && fval(u->region->planep, PFL_NOFEED))
return 0; return 0;
#ifdef KARMA_MODULE #if KARMA_MODULE
if(fspecial(u->faction, FS_REGENERATION)) if(fspecial(u->faction, FS_REGENERATION))
need += 1; need += 1;
if(fspecial(u->faction, FS_ADMINISTRATOR)) if(fspecial(u->faction, FS_ADMINISTRATOR))
@ -2523,7 +2523,7 @@ default_wage(const region *r, const faction * f, const race * rc)
index = 1; index = 1;
} }
wage = wagetable[esize][index]; wage = wagetable[esize][index];
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(f, FS_URBAN)) { if (fspecial(f, FS_URBAN)) {
wage += wagetable[esize][3]; wage += wagetable[esize][3];
} }
@ -2818,7 +2818,7 @@ attrib_init(void)
at_register(&at_guard); at_register(&at_guard);
at_register(&at_group); at_register(&at_group);
#ifdef KARMA_MODULE #if KARMA_MODULE
at_register(&at_faction_special); at_register(&at_faction_special);
at_register(&at_prayer_timeout); at_register(&at_prayer_timeout);
at_register(&at_wyrm); at_register(&at_wyrm);
@ -2838,7 +2838,7 @@ attrib_init(void)
register_bordertype(&bt_questportal); register_bordertype(&bt_questportal);
at_register(&at_germs); at_register(&at_germs);
#ifdef XECMD_MODULE #if XECMD_MODULE
at_register(&at_xontormiaexpress); /* required for old datafiles */ at_register(&at_xontormiaexpress); /* required for old datafiles */
#endif #endif
at_register(&at_speedup); at_register(&at_speedup);

View file

@ -423,7 +423,7 @@ extern struct attrib_type at_guard;
# define count_unit(u) 1 # define count_unit(u) 1
#endif #endif
#ifdef XECMD_MODULE #if XECMD_MODULE
extern struct attrib_type at_xontormiaexpress; extern struct attrib_type at_xontormiaexpress;
#endif #endif

View file

@ -89,10 +89,10 @@ typedef struct faction {
boolean alive; /* enno: sollte ein flag werden */ boolean alive; /* enno: sollte ein flag werden */
int nregions; int nregions;
int money; int money;
#ifdef SCORE_MODULE #if SCORE_MODULE
int score; int score;
#endif #endif
#ifdef KARMA_MODULE #if KARMA_MODULE
int karma; int karma;
#endif #endif
struct alliance * alliance; struct alliance * alliance;

View file

@ -128,7 +128,7 @@ typedef struct item_type {
int (*use)(struct unit * user, const struct item_type * itype, int amount, struct order * ord); int (*use)(struct unit * user, const struct item_type * itype, int amount, struct order * ord);
int (*useonother)(struct unit * user, int targetno, const struct item_type * itype, int amount, struct order * ord); int (*useonother)(struct unit * user, int targetno, const struct item_type * itype, int amount, struct order * ord);
int (*give)(struct unit * src, struct unit * dest, const struct item_type * itm, int number, struct order * ord); int (*give)(struct unit * src, struct unit * dest, const struct item_type * itm, int number, struct order * ord);
#ifdef SCORE_MODULE #if SCORE_MODULE
int score; int score;
#endif #endif
struct item_type * next; struct item_type * next;

View file

@ -69,7 +69,7 @@ attrib_type at_jihad = {
"jihad", NULL, NULL, NULL, a_writeshorts, a_readshorts "jihad", NULL, NULL, NULL, a_writeshorts, a_readshorts
}; };
#ifdef KARMA_MODULE #if KARMA_MODULE
struct fspecialdata fspecials[MAXFACTIONSPECIALS] = { struct fspecialdata fspecials[MAXFACTIONSPECIALS] = {
{ {
"Regeneration", "Regeneration",

View file

@ -42,7 +42,7 @@ typedef enum {
MAXFACTIONSPECIALS MAXFACTIONSPECIALS
} fspecial_t; } fspecial_t;
#ifdef KARMA_MODULE #if KARMA_MODULE
typedef enum { typedef enum {
PR_AID, PR_AID,
PR_MERCY, PR_MERCY,

View file

@ -430,7 +430,7 @@ updatespelllist(unit * u)
/* Nur Wyrm-Magier bekommen den Wyrmtransformationszauber */ /* Nur Wyrm-Magier bekommen den Wyrmtransformationszauber */
sp = find_spellbyid(M_GRAU, SPL_BECOMEWYRM); sp = find_spellbyid(M_GRAU, SPL_BECOMEWYRM);
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_WYRM) && !has_spell(u, sp) && sp->level<=sk) { if (fspecial(u->faction, FS_WYRM) && !has_spell(u, sp) && sp->level<=sk) {
add_spell(mage, find_spellbyid(M_GRAU, SPL_BECOMEWYRM)); add_spell(mage, find_spellbyid(M_GRAU, SPL_BECOMEWYRM));
} }
@ -1174,7 +1174,7 @@ target_resists_magic(unit *magician, void *obj, int objtyp, int t_bonus)
skill * sv; skill * sv;
unit * u = (unit*)obj; unit * u = (unit*)obj;
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_MAGICIMMUNE)) return true; if (fspecial(u->faction, FS_MAGICIMMUNE)) return true;
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
at = effskill(magician, SK_MAGIC); at = effskill(magician, SK_MAGIC);
@ -1406,7 +1406,7 @@ regeneration(unit * u)
double potenz = 1.5; double potenz = 1.5;
double divisor = 2.0; double divisor = 2.0;
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_MAGICIMMUNE)) return 0; if (fspecial(u->faction, FS_MAGICIMMUNE)) return 0;
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */

View file

@ -214,7 +214,7 @@ personcapacity(const unit *u)
{ {
int cap = u->race->weight+u->race->capacity; int cap = u->race->weight+u->race->capacity;
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_QUICK)) if (fspecial(u->faction, FS_QUICK))
cap -= 200; cap -= 200;
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
@ -401,7 +401,7 @@ canswim(unit *u)
if (get_item(u, I_DOLPHIN) >= u->number && effskill(u, SK_RIDING) >= 4) if (get_item(u, I_DOLPHIN) >= u->number && effskill(u, SK_RIDING) >= 4)
return true; return true;
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_AMPHIBIAN)) return true; if (fspecial(u->faction, FS_AMPHIBIAN)) return true;
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */
if (u->race->flags & RCF_FLY) return true; if (u->race->flags & RCF_FLY) return true;
@ -1315,7 +1315,7 @@ movement_speed(unit * u)
default: default:
mp = BP_WALKING; mp = BP_WALKING;
#ifdef KARMA_MODULE #if KARMA_MODULE
/* faction special */ /* faction special */
if (fspecial(u->faction, FS_QUICK)) mp = BP_RIDING; if (fspecial(u->faction, FS_QUICK)) mp = BP_RIDING;
#endif /* KARMA_MODULE */ #endif /* KARMA_MODULE */

View file

@ -204,7 +204,7 @@ unit_max_hp(const unit * u)
p = pow(effskill(u, SK_AUSDAUER) / 2.0, 1.5) * 0.2; p = pow(effskill(u, SK_AUSDAUER) / 2.0, 1.5) * 0.2;
h += (int) (h * p + 0.5); h += (int) (h * p + 0.5);
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_UNDEAD)) { if (fspecial(u->faction, FS_UNDEAD)) {
h *= 2; h *= 2;
} }

View file

@ -267,7 +267,7 @@ bufunit(const faction * f, const unit * u, int indent, int mode, char * buf, siz
itemcloak = curse_active(get_curse(u->attribs, itemcloak_ct)); itemcloak = curse_active(get_curse(u->attribs, itemcloak_ct));
} }
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_HIDDEN)) { if (fspecial(u->faction, FS_HIDDEN)) {
a_fshidden = a_find(u->attribs, &at_fshidden); a_fshidden = a_find(u->attribs, &at_fshidden);
} }

View file

@ -1404,7 +1404,7 @@ readfaction(FILE * F, int encoding)
} }
f->magiegebiet = (magic_t)ri(F); f->magiegebiet = (magic_t)ri(F);
#ifdef KARMA_MODULE #if KARMA_MODULE
f->karma = ri(F); f->karma = ri(F);
#else #else
/* ignore karma */ /* ignore karma */
@ -1491,7 +1491,7 @@ writefaction(FILE * F, const faction * f)
ws(F, f->race->_name[0]); ws(F, f->race->_name[0]);
wnl(F); wnl(F);
wi(F, f->magiegebiet); wi(F, f->magiegebiet);
#ifdef KARMA_MODULE #if KARMA_MODULE
wi(F, f->karma); wi(F, f->karma);
#else #else
wi(F, 0); wi(F, 0);

View file

@ -1156,7 +1156,7 @@ get_modifier(const unit *u, skill_t sk, int level, const region *r, boolean noit
} }
skill = skillmod(u->attribs, u, r, sk, skill, SMF_ALWAYS); skill = skillmod(u->attribs, u, r, sk, skill, SMF_ALWAYS);
#ifdef KARMA_MODULE #if KARMA_MODULE
if (fspecial(u->faction, FS_TELEPATHY)) { if (fspecial(u->faction, FS_TELEPATHY)) {
switch(sk) { switch(sk) {
case SK_ALCHEMY: case SK_ALCHEMY:

View file

@ -767,7 +767,7 @@ xml_readitem(xmlXPathContextPtr xpath, resource_type * rtype)
if (xml_bvalue(node, "animal", false)) flags |= ITF_ANIMAL; if (xml_bvalue(node, "animal", false)) flags |= ITF_ANIMAL;
if (xml_bvalue(node, "vehicle", false)) flags |= ITF_VEHICLE; if (xml_bvalue(node, "vehicle", false)) flags |= ITF_VEHICLE;
itype = new_itemtype(rtype, flags, weight, capacity); itype = new_itemtype(rtype, flags, weight, capacity);
#ifdef SCORE_MODULE #if SCORE_MODULE
itype->score = xml_ivalue(node, "score", 0); itype->score = xml_ivalue(node, "score", 0);
#endif #endif

View file

@ -15,7 +15,7 @@
#include <config.h> #include <config.h>
#include <kernel/eressea.h> #include <kernel/eressea.h>
#ifdef ARENA_MODULE #if ARENA_MODULE
#include "arena.h" #include "arena.h"
/* modules include */ /* modules include */

View file

@ -18,7 +18,7 @@
extern "C" { extern "C" {
#endif #endif
#ifndef ARENA_MODULE #if ARENA_MODULE == 0
#error "must define ARENA_MODULE to use this module" #error "must define ARENA_MODULE to use this module"
#endif #endif
/* exports: */ /* exports: */

View file

@ -13,7 +13,7 @@
#include <config.h> #include <config.h>
#include <kernel/eressea.h> #include <kernel/eressea.h>
#ifdef DUNGEON_MODULE #if DUNGEON_MODULE
#include "dungeon.h" #include "dungeon.h"
#include "gmcmd.h" #include "gmcmd.h"

View file

@ -16,7 +16,7 @@
extern "C" { extern "C" {
#endif #endif
#ifndef DUNGEON_MODULE #if DUNGEON_MODULE == 0
#error "must define DUNGEON_MODULE to use this module" #error "must define DUNGEON_MODULE to use this module"
#endif #endif

View file

@ -13,7 +13,7 @@
#include <config.h> #include <config.h>
#include <kernel/eressea.h> #include <kernel/eressea.h>
#ifdef INFOCMD_MODULE #if INFOCMD_MODULE
#include "infocmd.h" #include "infocmd.h"
#include "command.h" #include "command.h"

View file

@ -16,7 +16,7 @@
extern "C" { extern "C" {
#endif #endif
#ifdef INFOCMD_MODULE #if INFOCMD_MODULE
extern void init_info(void); extern void init_info(void);
extern void infocommands(void); extern void infocommands(void);
#endif #endif

View file

@ -21,7 +21,7 @@
#include <config.h> #include <config.h>
#include <kernel/eressea.h> #include <kernel/eressea.h>
#ifdef MUSEUM_MODULE #if MUSEUM_MODULE
#include "museum.h" #include "museum.h"
/* kernel includes */ /* kernel includes */

View file

@ -18,7 +18,7 @@
extern "C" { extern "C" {
#endif #endif
#ifndef MUSEUM_MODULE #if MUSEUM_MODULE == 0
#error "must define MUSEUM_MODULE to use this module" #error "must define MUSEUM_MODULE to use this module"
#endif #endif

View file

@ -21,7 +21,7 @@
#include <config.h> #include <config.h>
#include <kernel/eressea.h> #include <kernel/eressea.h>
#ifdef SCORE_MODULE #if SCORE_MODULE
#include "score.h" #include "score.h"
/* kernel includes */ /* kernel includes */

View file

@ -25,7 +25,7 @@
extern "C" { extern "C" {
#endif #endif
#ifndef SCORE_MODULE #if SCORE_MODULE == 0
#error "must define SCORE_MODULE to use this module" #error "must define SCORE_MODULE to use this module"
#endif #endif

View file

@ -13,7 +13,7 @@
#include <config.h> #include <config.h>
#include <kernel/eressea.h> #include <kernel/eressea.h>
#ifdef WORMHOLE_MODULE #if WORMHOLE_MODULE
#include "wormhole.h" #include "wormhole.h"
/* kernel includes */ /* kernel includes */

View file

@ -17,7 +17,7 @@
extern "C" { extern "C" {
#endif #endif
#ifndef WORMHOLE_MODULE #if WORMHOLE_MODULE == 0
#error "must define WORMHOLE_MODULE to use this module" #error "must define WORMHOLE_MODULE to use this module"
#endif #endif

View file

@ -13,7 +13,7 @@
#include <config.h> #include <config.h>
#include <kernel/eressea.h> #include <kernel/eressea.h>
#ifdef XECMD_MODULE #if XECMD_MODULE
#include "xecmd.h" #include "xecmd.h"
#include <items/xerewards.h> #include <items/xerewards.h>

View file

@ -16,7 +16,7 @@
extern "C" { extern "C" {
#endif #endif
#ifdef XECMD_MODULE #if XECMD_MODULE
int xecmd(struct unit * u, struct order * ord); int xecmd(struct unit * u, struct order * ord);
#endif #endif

View file

@ -38,11 +38,20 @@
#define ROW_FACTOR 3 /* factor for combat row advancement rule */ #define ROW_FACTOR 3 /* factor for combat row advancement rule */
#define HEROES #define HEROES
#define SCORE_MODULE /* optional game components. TODO: These should either be
#define MUSEUM_MODULE * configuration variables (XML), script extensions (lua),
#define ARENA_MODULE * or both. We don't want separate binaries for different games
#define WORMHOLE_MODULE */
#define XECMD_MODULE #define SCORE_MODULE 1
#define MUSEUM_MODULE 1
#define ARENA_MODULE 1
#define WORMHOLE_MODULE 1
#define XECMD_MODULE 1
#define KARMA_MODULE 0
#define DUNGEON_MODULE 0
#define INFOCMD_MODULE 0
#define CHANGED_CROSSBOWS 0 /* use the WTF_ARMORPIERCING flag */
#define GLOBAL_WARMING 200 /* number of turns before global warming sets in */
#define SIMPLE_COMBAT #define SIMPLE_COMBAT
#define SIMPLE_ESCAPE #define SIMPLE_ESCAPE

View file

@ -6799,7 +6799,7 @@ sp_break_curse(castorder *co)
int int
sp_becomewyrm(castorder *co) sp_becomewyrm(castorder *co)
{ {
#ifdef KARMA_MODULE #if KARMA_MODULE
unit *u = co->magician.u; unit *u = co->magician.u;
int wyrms_already_created = 0; int wyrms_already_created = 0;
int wyrms_allowed = 0; int wyrms_allowed = 0;

View file

@ -21,16 +21,16 @@
#include <modules/xmas.h> #include <modules/xmas.h>
#include <modules/gmcmd.h> #include <modules/gmcmd.h>
#ifdef MUSEUM_MODULE #if MUSEUM_MODULE
#include <modules/museum.h> #include <modules/museum.h>
#endif #endif
#ifdef ARENA_MODULE #if ARENA_MODULE
#include <modules/arena.h> #include <modules/arena.h>
#endif #endif
#ifdef WORMHOLE_MODULE #if WORMHOLE_MODULE
#include <modules/wormhole.h> #include <modules/wormhole.h>
#endif #endif
#ifdef DUNGEON_MODULE #if DUNGEON_MODULE
#include <modules/dungeon.h> #include <modules/dungeon.h>
#endif #endif

View file

@ -605,9 +605,7 @@ frame_regions(void)
} }
} }
#define GLOBAL_WARMING 200 #if GLOBAL_WARMING
#ifdef GLOBAL_WARMING
static void static void
iceberg(region * r) iceberg(region * r)
@ -994,16 +992,13 @@ korrektur(void)
{ {
check_dissolve(); check_dissolve();
french_testers(); french_testers();
#if TEST_LOCALES
setup_locales();
#endif
do_once("rdec", &road_decay); do_once("rdec", &road_decay);
do_once("unfi", &fix_undead); do_once("unfi", &fix_undead);
do_once("chgt", &fix_chaosgates); do_once("chgt", &fix_chaosgates);
do_once("atrx", &fix_attribflags); do_once("atrx", &fix_attribflags);
do_once("asfi", &fix_astral_firewalls); do_once("asfi", &fix_astral_firewalls);
frame_regions(); frame_regions();
#ifdef GLOBAL_WARMING #if GLOBAL_WARMING
if (get_gamedate(turn, NULL)->season == SEASON_SUMMER) { if (get_gamedate(turn, NULL)->season == SEASON_SUMMER) {
global_warming(); global_warming();
} }

View file

@ -43,16 +43,16 @@
#include <modules/xmas.h> #include <modules/xmas.h>
#include <modules/gmcmd.h> #include <modules/gmcmd.h>
#include <modules/infocmd.h> #include <modules/infocmd.h>
#ifdef MUSEUM_MODULE #if MUSEUM_MODULE
#include <modules/museum.h> #include <modules/museum.h>
#endif #endif
#ifdef WORMHOLE_MODULE #if WORMHOLE_MODULE
#include <modules/wormhole.h> #include <modules/wormhole.h>
#endif #endif
#ifdef ARENA_MODULE #if ARENA_MODULE
#include <modules/arena.h> #include <modules/arena.h>
#endif #endif
#ifdef DUNGEON_MODULE #if DUNGEON_MODULE
#include <modules/dungeon.h> #include <modules/dungeon.h>
#endif #endif
@ -235,16 +235,16 @@ game_init(void)
register_itemfunctions(); register_itemfunctions();
register_spells(); register_spells();
register_gcspells(); register_gcspells();
#ifdef DUNGEON_MODULE #if DUNGEON_MODULE
register_dungeon(); register_dungeon();
#endif #endif
#ifdef MUSEUM_MODULE #if MUSEUM_MODULE
register_museum(); register_museum();
#endif #endif
#ifdef ARENA_MODULE #if ARENA_MODULE
register_arena(); register_arena();
#endif #endif
#ifdef WORMHOLE_MODULE #if WORMHOLE_MODULE
register_wormholes(); register_wormholes();
#endif #endif
@ -262,7 +262,7 @@ game_init(void)
init_rawmaterials(); init_rawmaterials();
init_gmcmd(); init_gmcmd();
#ifdef INFOCMD_MODULE #if INFOCMD_MODULE
init_info(); init_info();
#endif #endif
} }