forked from github/server
More curseinfo everywhere, less code.
This commit is contained in:
parent
15d056e423
commit
fd06a885f0
|
@ -32,11 +32,13 @@
|
||||||
#include "faction.h"
|
#include "faction.h"
|
||||||
#include "building.h"
|
#include "building.h"
|
||||||
#include "ship.h"
|
#include "ship.h"
|
||||||
|
#include "message.h"
|
||||||
#include "objtypes.h"
|
#include "objtypes.h"
|
||||||
|
|
||||||
/* util includes */
|
/* util includes */
|
||||||
#include <util/resolve.h>
|
#include <util/resolve.h>
|
||||||
#include <util/base36.h>
|
#include <util/base36.h>
|
||||||
|
#include <util/nrmessage.h>
|
||||||
#include <util/rand.h>
|
#include <util/rand.h>
|
||||||
#include <util/rng.h>
|
#include <util/rng.h>
|
||||||
#include <util/goodies.h>
|
#include <util/goodies.h>
|
||||||
|
@ -733,3 +735,22 @@ oldcursename(int id)
|
||||||
return oldnames[id];
|
return oldnames[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------- */
|
||||||
|
int
|
||||||
|
cinfo_simple(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
||||||
|
{
|
||||||
|
struct message * msg;
|
||||||
|
|
||||||
|
unused(typ);
|
||||||
|
unused(self);
|
||||||
|
unused(obj);
|
||||||
|
|
||||||
|
msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no);
|
||||||
|
if (msg) {
|
||||||
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||||||
|
msg_release(msg);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
log_warning(("There is no curseinfo for %s.\n", c->type->cname));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2003
|
* Eressea PB(E)M host Copyright (C) 1998-2003
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||||
|
@ -93,60 +93,60 @@ extern "C" {
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
/* struct's vom typ curse: */
|
/* struct's vom typ curse: */
|
||||||
C_FOGTRAP,
|
C_FOGTRAP,
|
||||||
C_ANTIMAGICZONE,
|
C_ANTIMAGICZONE,
|
||||||
C_FARVISION,
|
C_FARVISION,
|
||||||
C_GBDREAM,
|
C_GBDREAM,
|
||||||
C_AURA,
|
C_AURA,
|
||||||
C_MAELSTROM,
|
C_MAELSTROM,
|
||||||
C_BLESSEDHARVEST,
|
C_BLESSEDHARVEST,
|
||||||
C_DROUGHT,
|
C_DROUGHT,
|
||||||
C_BADLEARN,
|
C_BADLEARN,
|
||||||
C_SHIP_SPEEDUP, /* 9 - Sturmwind-Zauber */
|
C_SHIP_SPEEDUP, /* 9 - Sturmwind-Zauber */
|
||||||
C_SHIP_FLYING, /* 10 - Luftschiff-Zauber */
|
C_SHIP_FLYING, /* 10 - Luftschiff-Zauber */
|
||||||
C_SHIP_NODRIFT, /* 11 - GünstigeWinde-Zauber */
|
C_SHIP_NODRIFT, /* 11 - GünstigeWinde-Zauber */
|
||||||
C_DEPRESSION,
|
C_DEPRESSION,
|
||||||
C_MAGICWALLS, /* 13 - Heimstein */
|
C_MAGICWALLS, /* 13 - Heimstein */
|
||||||
C_STRONGWALL, /* 14 - Feste Mauer - Precombat*/
|
C_STRONGWALL, /* 14 - Feste Mauer - Precombat*/
|
||||||
C_ASTRALBLOCK, /* 15 - Astralblock */
|
C_ASTRALBLOCK, /* 15 - Astralblock */
|
||||||
C_GENEROUS, /* 16 - Unterhaltung vermehren */
|
C_GENEROUS, /* 16 - Unterhaltung vermehren */
|
||||||
C_PEACE, /* 17 - Regionsweit Attacken verhindern */
|
C_PEACE, /* 17 - Regionsweit Attacken verhindern */
|
||||||
C_REGCONF, /* 18 - Erschwert Bewegungen */
|
C_REGCONF, /* 18 - Erschwert Bewegungen */
|
||||||
C_MAGICSTREET, /* 19 - magisches Straßennetz */
|
C_MAGICSTREET, /* 19 - magisches Straßennetz */
|
||||||
C_RESIST_MAGIC, /* 20 - verändert Magieresistenz von Objekten */
|
C_RESIST_MAGIC, /* 20 - verändert Magieresistenz von Objekten */
|
||||||
C_SONG_BADMR, /* 21 - verändert Magieresistenz */
|
C_SONG_BADMR, /* 21 - verändert Magieresistenz */
|
||||||
C_SONG_GOODMR, /* 22 - verändert Magieresistenz */
|
C_SONG_GOODMR, /* 22 - verändert Magieresistenz */
|
||||||
C_SLAVE, /* 23 - dient fremder Partei */
|
C_SLAVE, /* 23 - dient fremder Partei */
|
||||||
C_DISORIENTATION, /* 24 - Spezielle Auswirkung auf Schiffe */
|
C_DISORIENTATION, /* 24 - Spezielle Auswirkung auf Schiffe */
|
||||||
C_CALM, /* 25 - Beinflussung */
|
C_CALM, /* 25 - Beinflussung */
|
||||||
C_OLDRACE,
|
C_OLDRACE,
|
||||||
C_FUMBLE,
|
C_FUMBLE,
|
||||||
C_RIOT, /*region in Aufruhr */
|
C_RIOT, /*region in Aufruhr */
|
||||||
C_NOCOST,
|
C_NOCOST,
|
||||||
C_HOLYGROUND,
|
C_HOLYGROUND,
|
||||||
C_CURSED_BY_THE_GODS,
|
C_CURSED_BY_THE_GODS,
|
||||||
C_FREE_14,
|
C_FREE_14,
|
||||||
C_FREE_15,
|
C_FREE_15,
|
||||||
C_FREE_16,
|
C_FREE_16,
|
||||||
C_FREE_17,
|
C_FREE_17,
|
||||||
C_FREE_18,
|
C_FREE_18,
|
||||||
C_FREE_19,
|
C_FREE_19,
|
||||||
/* struct's vom untertyp curse_unit: */
|
/* struct's vom untertyp curse_unit: */
|
||||||
C_SPEED, /* Beschleunigt */
|
C_SPEED, /* Beschleunigt */
|
||||||
C_ORC,
|
C_ORC,
|
||||||
C_MBOOST,
|
C_MBOOST,
|
||||||
C_KAELTESCHUTZ,
|
C_KAELTESCHUTZ,
|
||||||
C_STRENGTH,
|
C_STRENGTH,
|
||||||
C_ALLSKILLS,
|
C_ALLSKILLS,
|
||||||
C_MAGICRESISTANCE, /* 44 - verändert Magieresistenz */
|
C_MAGICRESISTANCE, /* 44 - verändert Magieresistenz */
|
||||||
C_ITEMCLOAK,
|
C_ITEMCLOAK,
|
||||||
C_SPARKLE,
|
C_SPARKLE,
|
||||||
C_FREE_22,
|
C_FREE_22,
|
||||||
C_FREE_23,
|
C_FREE_23,
|
||||||
C_FREE_24,
|
C_FREE_24,
|
||||||
/* struct's vom untertyp curse_skill: */
|
/* struct's vom untertyp curse_skill: */
|
||||||
C_SKILL,
|
C_SKILL,
|
||||||
MAXCURSE
|
MAXCURSE
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
@ -156,22 +156,22 @@ enum {
|
||||||
#define CURSE_NOAGE 2 /* wirkt ewig */
|
#define CURSE_NOAGE 2 /* wirkt ewig */
|
||||||
#define CURSE_IMMUNE 4 /* ignoriert Antimagie */
|
#define CURSE_IMMUNE 4 /* ignoriert Antimagie */
|
||||||
#define CURSE_ONLYONE 8 /* Verhindert, das ein weiterer Zauber dieser Art
|
#define CURSE_ONLYONE 8 /* Verhindert, das ein weiterer Zauber dieser Art
|
||||||
auf das Objekt gezaubert wird */
|
auf das Objekt gezaubert wird */
|
||||||
|
|
||||||
/* Verhalten von Zaubern auf Units beim Übergeben von Personen */
|
/* Verhalten von Zaubern auf Units beim Übergeben von Personen */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CURSE_SPREADNEVER, /* wird nie mit übertragen */
|
CURSE_SPREADNEVER, /* wird nie mit übertragen */
|
||||||
CURSE_SPREADALWAYS, /* wird immer mit übertragen */
|
CURSE_SPREADALWAYS, /* wird immer mit übertragen */
|
||||||
CURSE_SPREADMODULO, /* personenweise weitergabe */
|
CURSE_SPREADMODULO, /* personenweise weitergabe */
|
||||||
CURSE_SPREADCHANCE /* Ansteckungschance je nach Mengenverhältnis*/
|
CURSE_SPREADCHANCE /* Ansteckungschance je nach Mengenverhältnis*/
|
||||||
} spread_t;
|
} spread_t;
|
||||||
|
|
||||||
/* typ von struct */
|
/* typ von struct */
|
||||||
enum {
|
enum {
|
||||||
CURSETYP_NORM,
|
CURSETYP_NORM,
|
||||||
CURSETYP_UNIT,
|
CURSETYP_UNIT,
|
||||||
CURSETYP_REGION, /* stores the region in c->data.v */
|
CURSETYP_REGION, /* stores the region in c->data.v */
|
||||||
MAXCURSETYP
|
MAXCURSETYP
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Verhalten beim Zusammenfassen mit einem schon bestehenden Zauber
|
/* Verhalten beim Zusammenfassen mit einem schon bestehenden Zauber
|
||||||
|
@ -183,24 +183,24 @@ enum {
|
||||||
#define M_MAXEFFECT 4 /* der Effekt ist der maximale Effekt beider */
|
#define M_MAXEFFECT 4 /* der Effekt ist der maximale Effekt beider */
|
||||||
#define M_SUMEFFECT 8 /* der Effekt summiert sich */
|
#define M_SUMEFFECT 8 /* der Effekt summiert sich */
|
||||||
#define M_MEN 16 /* die Anzahl der betroffenen Personen summiert
|
#define M_MEN 16 /* die Anzahl der betroffenen Personen summiert
|
||||||
sich */
|
sich */
|
||||||
#define M_VIGOUR 32 /* das Maximum der beiden Stärken wird die
|
#define M_VIGOUR 32 /* das Maximum der beiden Stärken wird die
|
||||||
Stärke des neuen Zaubers */
|
Stärke des neuen Zaubers */
|
||||||
#define M_VIGOUR_ADD 64 /* Vigour wird addiert */
|
#define M_VIGOUR_ADD 64 /* Vigour wird addiert */
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
/* Allgemeine Zauberwirkungen */
|
/* Allgemeine Zauberwirkungen */
|
||||||
|
|
||||||
typedef struct curse {
|
typedef struct curse {
|
||||||
struct curse *nexthash;
|
struct curse *nexthash;
|
||||||
int no; /* 'Einheitennummer' dieses Curse */
|
int no; /* 'Einheitennummer' dieses Curse */
|
||||||
const struct curse_type * type; /* Zeiger auf ein curse_type-struct */
|
const struct curse_type * type; /* Zeiger auf ein curse_type-struct */
|
||||||
int flag; /* generelle Flags wie zb CURSE_ISNEW oder CURSE_NOAGE */
|
int flag; /* generelle Flags wie zb CURSE_ISNEW oder CURSE_NOAGE */
|
||||||
int duration; /* Dauer der Verzauberung. Wird jede Runde vermindert */
|
int duration; /* Dauer der Verzauberung. Wird jede Runde vermindert */
|
||||||
double vigour; /* Stärke der Verzauberung, Widerstand gegen Antimagie */
|
double vigour; /* Stärke der Verzauberung, Widerstand gegen Antimagie */
|
||||||
struct unit *magician; /* Pointer auf den Magier, der den Spruch gewirkt hat */
|
struct unit *magician; /* Pointer auf den Magier, der den Spruch gewirkt hat */
|
||||||
variant effect;
|
variant effect;
|
||||||
variant data; /* pointer auf spezielle curse-unterstructs*/
|
variant data; /* pointer auf spezielle curse-unterstructs*/
|
||||||
} curse;
|
} curse;
|
||||||
|
|
||||||
/* Die Unterattribute curse->data: */
|
/* Die Unterattribute curse->data: */
|
||||||
|
@ -209,24 +209,24 @@ typedef struct curse {
|
||||||
* nicht immer auf ganze Einheiten wirken brauchen
|
* nicht immer auf ganze Einheiten wirken brauchen
|
||||||
*/
|
*/
|
||||||
typedef struct curse_unit {
|
typedef struct curse_unit {
|
||||||
int cursedmen; /* verzauberte Personen in der Einheit */
|
int cursedmen; /* verzauberte Personen in der Einheit */
|
||||||
} curse_unit;
|
} curse_unit;
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
typedef struct curse_type {
|
typedef struct curse_type {
|
||||||
const char *cname; /* Name der Zauberwirkung, Identifizierung des curse */
|
const char *cname; /* Name der Zauberwirkung, Identifizierung des curse */
|
||||||
int typ;
|
int typ;
|
||||||
spread_t spread;
|
spread_t spread;
|
||||||
unsigned int mergeflags;
|
unsigned int mergeflags;
|
||||||
const char *info_str; /* Wirkung des curse, wird bei einer gelungenen
|
const char *info_str; /* Wirkung des curse, wird bei einer gelungenen
|
||||||
Zauberanalyse angezeigt */
|
Zauberanalyse angezeigt */
|
||||||
int (*curseinfo)(const struct locale*, const void*, typ_t, curse*, int);
|
int (*curseinfo)(const struct locale*, const void*, typ_t, curse*, int);
|
||||||
void (*change_vigour)(curse*, double);
|
void (*change_vigour)(curse*, double);
|
||||||
int (*read)(FILE * F, curse * c);
|
int (*read)(FILE * F, curse * c);
|
||||||
int (*write)(FILE * F, const curse * c);
|
int (*write)(FILE * F, const curse * c);
|
||||||
int (*cansee)(const struct faction*, const void*, typ_t, curse *, int);
|
int (*cansee)(const struct faction*, const void*, typ_t, curse *, int);
|
||||||
int (*age)(curse *);
|
int (*age)(curse *);
|
||||||
} curse_type;
|
} curse_type;
|
||||||
|
|
||||||
|
@ -249,56 +249,56 @@ extern int curse_read(struct attrib * a,FILE * f);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
curse * create_curse(struct unit *magician, struct attrib**ap, const curse_type * ctype,
|
curse * create_curse(struct unit *magician, struct attrib**ap, const curse_type * ctype,
|
||||||
double vigour, int duration, variant ceffect, int men);
|
double vigour, int duration, variant ceffect, int men);
|
||||||
/* Verzweigt automatisch zum passenden struct-typ. Sollte es schon
|
/* Verzweigt automatisch zum passenden struct-typ. Sollte es schon
|
||||||
* einen Zauber dieses Typs geben, so wird der neue dazuaddiert. Die
|
* einen Zauber dieses Typs geben, so wird der neue dazuaddiert. Die
|
||||||
* Zahl der verzauberten Personen sollte beim Aufruf der Funktion
|
* Zahl der verzauberten Personen sollte beim Aufruf der Funktion
|
||||||
* nochmal gesondert auf min(get_cursedmen, u->number) gesetzt werden.
|
* nochmal gesondert auf min(get_cursedmen, u->number) gesetzt werden.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern void destroy_curse(curse * c);
|
extern void destroy_curse(curse * c);
|
||||||
|
|
||||||
|
|
||||||
boolean is_cursed_internal(struct attrib *ap, const curse_type * ctype);
|
boolean is_cursed_internal(struct attrib *ap, const curse_type * ctype);
|
||||||
/* ignoriert CURSE_ISNEW */
|
/* ignoriert CURSE_ISNEW */
|
||||||
|
|
||||||
extern void remove_curse(struct attrib **ap, const curse * c);
|
extern void remove_curse(struct attrib **ap, const curse * c);
|
||||||
/* löscht einen konkreten Spruch auf einem Objekt.
|
/* löscht einen konkreten Spruch auf einem Objekt.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern int curse_geteffect(const curse * c);
|
extern int curse_geteffect(const curse * c);
|
||||||
/* gibt die Auswirkungen der Verzauberungen zurück. zB bei
|
/* gibt die Auswirkungen der Verzauberungen zurück. zB bei
|
||||||
* Skillmodifiziernden Verzauberungen ist hier der Modifizierer
|
* Skillmodifiziernden Verzauberungen ist hier der Modifizierer
|
||||||
* gespeichert. Wird automatisch beim Anlegen eines neuen curse
|
* gespeichert. Wird automatisch beim Anlegen eines neuen curse
|
||||||
* gesetzt. Gibt immer den ersten Treffer von ap aus zurück.
|
* gesetzt. Gibt immer den ersten Treffer von ap aus zurück.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
extern double curse_changevigour(struct attrib **ap, curse * c, double i);
|
extern double curse_changevigour(struct attrib **ap, curse * c, double i);
|
||||||
/* verändert die Stärke der Verzauberung um i */
|
/* verändert die Stärke der Verzauberung um i */
|
||||||
|
|
||||||
extern int get_cursedmen(struct unit *u, struct curse *c);
|
extern int get_cursedmen(struct unit *u, struct curse *c);
|
||||||
/* gibt bei Personenbeschränkten Verzauberungen die Anzahl der
|
/* gibt bei Personenbeschränkten Verzauberungen die Anzahl der
|
||||||
* betroffenen Personen zurück. Ansonsten wird 0 zurückgegeben. */
|
* betroffenen Personen zurück. Ansonsten wird 0 zurückgegeben. */
|
||||||
|
|
||||||
extern void curse_setflag(curse * c, int flag);
|
extern void curse_setflag(curse * c, int flag);
|
||||||
/* setzt Spezialflag einer Verzauberung (zB 'dauert ewig') */
|
/* setzt Spezialflag einer Verzauberung (zB 'dauert ewig') */
|
||||||
|
|
||||||
void transfer_curse(struct unit * u, struct unit * u2, int n);
|
void transfer_curse(struct unit * u, struct unit * u2, int n);
|
||||||
/* sorgt dafür, das bei der Übergabe von Personen die curse-attribute
|
/* sorgt dafür, das bei der Übergabe von Personen die curse-attribute
|
||||||
* korrekt gehandhabt werden. Je nach internen Flag kann dies
|
* korrekt gehandhabt werden. Je nach internen Flag kann dies
|
||||||
* unterschiedlich gewünscht sein
|
* unterschiedlich gewünscht sein
|
||||||
* */
|
* */
|
||||||
|
|
||||||
extern curse * get_cursex(attrib *ap, const curse_type * ctype, variant data,
|
extern curse * get_cursex(attrib *ap, const curse_type * ctype, variant data,
|
||||||
boolean(*compare)(const curse *, variant));
|
boolean(*compare)(const curse *, variant));
|
||||||
/* gibt pointer auf die erste curse-struct zurück, deren Typ ctype ist,
|
/* gibt pointer auf die erste curse-struct zurück, deren Typ ctype ist,
|
||||||
* und für die compare() true liefert, oder einen NULL-pointer.
|
* und für die compare() true liefert, oder einen NULL-pointer.
|
||||||
* */
|
* */
|
||||||
extern curse * get_curse(struct attrib *ap, const curse_type * ctype);
|
extern curse * get_curse(struct attrib *ap, const curse_type * ctype);
|
||||||
/* gibt pointer auf die erste curse-struct zurück, deren Typ ctype ist,
|
/* gibt pointer auf die erste curse-struct zurück, deren Typ ctype ist,
|
||||||
* oder einen NULL-pointer
|
* oder einen NULL-pointer
|
||||||
* */
|
* */
|
||||||
|
|
||||||
struct unit * get_tracingunit(struct attrib **ap, const curse_type * ct);
|
struct unit * get_tracingunit(struct attrib **ap, const curse_type * ct);
|
||||||
int find_cursebyname(const char *c);
|
int find_cursebyname(const char *c);
|
||||||
|
@ -321,16 +321,17 @@ extern void * resolve_curse(variant data);
|
||||||
extern boolean is_cursed_with(attrib *ap, curse *c);
|
extern boolean is_cursed_with(attrib *ap, curse *c);
|
||||||
|
|
||||||
extern boolean curse_active(const curse * c);
|
extern boolean curse_active(const curse * c);
|
||||||
/* gibt true, wenn der Curse nicht NULL oder inaktiv ist */
|
/* gibt true, wenn der Curse nicht NULL oder inaktiv ist */
|
||||||
|
|
||||||
/*** COMPATIBILITY MACROS. DO NOT USE FOR NEW CODE, REPLACE IN OLD CODE: */
|
/*** COMPATIBILITY MACROS. DO NOT USE FOR NEW CODE, REPLACE IN OLD CODE: */
|
||||||
extern const char * oldcursename(int id);
|
extern const char * oldcursename(int id);
|
||||||
extern void register_curses(void);
|
extern void register_curses(void);
|
||||||
|
extern int cinfo_simple(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self);
|
||||||
|
|
||||||
#define is_cursed(a, id, id2) \
|
#define is_cursed(a, id, id2) \
|
||||||
curse_active(get_curse(a, ct_find(oldcursename(id))))
|
curse_active(get_curse(a, ct_find(oldcursename(id))))
|
||||||
#define get_curseeffect(a, id, id2) \
|
#define get_curseeffect(a, id, id2) \
|
||||||
curse_geteffect(get_curse(a, ct_find(oldcursename(id))))
|
curse_geteffect(get_curse(a, ct_find(oldcursename(id))))
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,8 +121,6 @@ static struct curse_type ct_nocostbuilding = { "nocostbuilding",
|
||||||
void
|
void
|
||||||
register_buildingcurse(void)
|
register_buildingcurse(void)
|
||||||
{
|
{
|
||||||
register_function((pf_generic)cinfo_magicrunes, "curseinfo::magicrunes");
|
|
||||||
|
|
||||||
ct_register(&ct_magicwalls);
|
ct_register(&ct_magicwalls);
|
||||||
ct_register(&ct_strongwall);
|
ct_register(&ct_strongwall);
|
||||||
ct_register(&ct_magicrunes);
|
ct_register(&ct_magicrunes);
|
||||||
|
|
|
@ -34,30 +34,6 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
int
|
|
||||||
cinfo_region(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
|
||||||
{
|
|
||||||
message * msg;
|
|
||||||
|
|
||||||
unused(typ);
|
|
||||||
unused(self);
|
|
||||||
unused(obj);
|
|
||||||
|
|
||||||
assert(typ == TYP_REGION);
|
|
||||||
|
|
||||||
msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no);
|
|
||||||
if (msg) {
|
|
||||||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
|
||||||
msg_release(msg);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
log_warning(("There is no curseinfo for %s.\n", c->type->cname));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
/* CurseInfo mit Spezialabfragen
|
/* CurseInfo mit Spezialabfragen
|
||||||
*/
|
*/
|
||||||
|
@ -68,19 +44,19 @@ cinfo_region(const struct locale * lang, const void * obj, typ_t typ, struct cur
|
||||||
static int
|
static int
|
||||||
cinfo_cursed_by_the_gods(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
cinfo_cursed_by_the_gods(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
||||||
{
|
{
|
||||||
region *r;
|
region *r;
|
||||||
message * msg;
|
message * msg;
|
||||||
|
|
||||||
unused(typ);
|
unused(typ);
|
||||||
unused(self);
|
unused(self);
|
||||||
|
|
||||||
assert(typ == TYP_REGION);
|
assert(typ == TYP_REGION);
|
||||||
r = (region *)obj;
|
r = (region *)obj;
|
||||||
if (fval(r->terrain, SEA_REGION)) {
|
if (fval(r->terrain, SEA_REGION)) {
|
||||||
msg = msg_message("curseinfo::godcurseocean", "id", c->no);
|
msg = msg_message("curseinfo::godcurseocean", "id", c->no);
|
||||||
} else {
|
} else {
|
||||||
msg = msg_message("curseinfo::godcurse", "id", c->no);
|
msg = msg_message("curseinfo::godcurse", "id", c->no);
|
||||||
}
|
}
|
||||||
if (msg!=NULL) {
|
if (msg!=NULL) {
|
||||||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||||||
msg_release(msg);
|
msg_release(msg);
|
||||||
|
@ -91,13 +67,13 @@ cinfo_cursed_by_the_gods(const struct locale * lang, const void * obj, typ_t typ
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct curse_type ct_godcursezone = {
|
static struct curse_type ct_godcursezone = {
|
||||||
"godcursezone",
|
"godcursezone",
|
||||||
CURSETYP_NORM, 0, (NO_MERGE),
|
CURSETYP_NORM, 0, (NO_MERGE),
|
||||||
"Diese Region wurde von den Göttern verflucht. Stinkende Nebel ziehen "
|
"Diese Region wurde von den Göttern verflucht. Stinkende Nebel ziehen "
|
||||||
"über die tote Erde, furchbare Kreaturen ziehen über das Land. Die Brunnen "
|
"über die tote Erde, furchbare Kreaturen ziehen über das Land. Die Brunnen "
|
||||||
"sind vergiftet, und die wenigen essbaren Früchte sind von einem rosa Pilz "
|
"sind vergiftet, und die wenigen essbaren Früchte sind von einem rosa Pilz "
|
||||||
"überzogen. Niemand kann hier lange überleben.",
|
"überzogen. Niemand kann hier lange überleben.",
|
||||||
cinfo_cursed_by_the_gods,
|
cinfo_cursed_by_the_gods,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,18 +84,18 @@ static struct curse_type ct_godcursezone = {
|
||||||
static int
|
static int
|
||||||
cinfo_dreamcurse(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
cinfo_dreamcurse(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
||||||
{
|
{
|
||||||
message * msg;
|
message * msg;
|
||||||
|
|
||||||
unused(self);
|
unused(self);
|
||||||
unused(typ);
|
unused(typ);
|
||||||
unused(obj);
|
unused(obj);
|
||||||
assert(typ == TYP_REGION);
|
assert(typ == TYP_REGION);
|
||||||
|
|
||||||
if (curse_geteffect(c) > 0){
|
if (curse_geteffect(c) > 0){
|
||||||
msg = msg_message("curseinfo::gooddream", "id", c->no);
|
msg = msg_message("curseinfo::gooddream", "id", c->no);
|
||||||
} else {
|
} else {
|
||||||
msg = msg_message("curseinfo::baddream", "id", c->no);
|
msg = msg_message("curseinfo::baddream", "id", c->no);
|
||||||
}
|
}
|
||||||
if (msg!=NULL) {
|
if (msg!=NULL) {
|
||||||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||||||
msg_release(msg);
|
msg_release(msg);
|
||||||
|
@ -129,10 +105,10 @@ cinfo_dreamcurse(const struct locale * lang, const void * obj, typ_t typ, curse
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct curse_type ct_gbdream = {
|
static struct curse_type ct_gbdream = {
|
||||||
"gbdream",
|
"gbdream",
|
||||||
CURSETYP_NORM, 0, (NO_MERGE),
|
CURSETYP_NORM, 0, (NO_MERGE),
|
||||||
"",
|
"",
|
||||||
cinfo_dreamcurse
|
cinfo_dreamcurse
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
@ -143,35 +119,35 @@ static struct curse_type ct_gbdream = {
|
||||||
static int
|
static int
|
||||||
cinfo_magicstreet(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
cinfo_magicstreet(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
||||||
{
|
{
|
||||||
message * msg;
|
message * msg;
|
||||||
|
|
||||||
unused(typ);
|
unused(typ);
|
||||||
unused(self);
|
unused(self);
|
||||||
unused(obj);
|
unused(obj);
|
||||||
|
|
||||||
assert(typ == TYP_REGION);
|
assert(typ == TYP_REGION);
|
||||||
|
|
||||||
/* Warnung vor Auflösung */
|
/* Warnung vor Auflösung */
|
||||||
if (c->duration <= 2){
|
if (c->duration <= 2){
|
||||||
msg = msg_message("curseinfo::magicstreet", "id", c->no);
|
msg = msg_message("curseinfo::magicstreet", "id", c->no);
|
||||||
} else {
|
} else {
|
||||||
msg = msg_message("curseinfo::magicstreetwarn", "id", c->no);
|
msg = msg_message("curseinfo::magicstreetwarn", "id", c->no);
|
||||||
}
|
}
|
||||||
if (msg!=NULL) {
|
if (msg!=NULL) {
|
||||||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||||||
msg_release(msg);
|
msg_release(msg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct curse_type ct_magicstreet = {
|
static struct curse_type ct_magicstreet = {
|
||||||
"magicstreet",
|
"magicstreet",
|
||||||
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
||||||
"Es scheint sich um einen elementarmagischen Zauber zu handeln, der alle "
|
"Es scheint sich um einen elementarmagischen Zauber zu handeln, der alle "
|
||||||
"Pfade und Wege so gut festigt, als wären sie gepflastert. Wie auf einer "
|
"Pfade und Wege so gut festigt, als wären sie gepflastert. Wie auf einer "
|
||||||
"Straße kommt man so viel besser und schneller vorwärts.",
|
"Straße kommt man so viel besser und schneller vorwärts.",
|
||||||
cinfo_magicstreet
|
cinfo_magicstreet
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
@ -179,58 +155,58 @@ static struct curse_type ct_magicstreet = {
|
||||||
static int
|
static int
|
||||||
cinfo_antimagiczone(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
cinfo_antimagiczone(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
||||||
{
|
{
|
||||||
message * msg;
|
message * msg;
|
||||||
|
|
||||||
unused(typ);
|
unused(typ);
|
||||||
unused(self);
|
unused(self);
|
||||||
unused(obj);
|
unused(obj);
|
||||||
|
|
||||||
assert(typ == TYP_REGION);
|
assert(typ == TYP_REGION);
|
||||||
|
|
||||||
/* Magier spüren eine Antimagiezone */
|
/* Magier spüren eine Antimagiezone */
|
||||||
if (self == 2 || self == 1){
|
if (self == 2 || self == 1){
|
||||||
msg = msg_message("curseinfo::antimagiczone", "id", c->no);
|
msg = msg_message("curseinfo::antimagiczone", "id", c->no);
|
||||||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||||||
msg_release(msg);
|
msg_release(msg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static struct curse_type ct_antimagiczone = {
|
|
||||||
"antimagiczone",
|
|
||||||
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
|
||||||
"Dieser Zauber scheint magische Energien irgendwie abzuleiten und "
|
|
||||||
"so alle in der Region gezauberten Sprüche in ihrer Wirkung zu "
|
|
||||||
"schwächen oder ganz zu verhindern.",
|
|
||||||
cinfo_antimagiczone
|
|
||||||
};
|
|
||||||
|
|
||||||
/* alle Magier können eine Antimagiezone wahrnehmen */
|
/* alle Magier können eine Antimagiezone wahrnehmen */
|
||||||
static int
|
static int
|
||||||
cansee_antimagiczone(const struct faction *viewer, curse *c, const void * obj, typ_t typ, int self)
|
cansee_antimagiczone(const struct faction *viewer, const void * obj, typ_t typ, curse *c, int self)
|
||||||
{
|
{
|
||||||
region *r;
|
region *r;
|
||||||
unit *u = NULL;
|
unit *u = NULL;
|
||||||
unit *mage = c->magician;
|
unit *mage = c->magician;
|
||||||
|
|
||||||
unused(typ);
|
unused(typ);
|
||||||
|
|
||||||
assert(typ == TYP_REGION);
|
assert(typ == TYP_REGION);
|
||||||
r = (region *)obj;
|
r = (region *)obj;
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
if (u->faction==viewer){
|
if (u->faction==viewer){
|
||||||
if (u==mage){
|
if (u==mage){
|
||||||
self = 2;
|
self = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (is_mage(u)){
|
if (is_mage(u)) {
|
||||||
self = 1;
|
self = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
static struct curse_type ct_antimagiczone = {
|
||||||
|
"antimagiczone",
|
||||||
|
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
||||||
|
"Dieser Zauber scheint magische Energien irgendwie abzuleiten und "
|
||||||
|
"so alle in der Region gezauberten Sprüche in ihrer Wirkung zu "
|
||||||
|
"schwächen oder ganz zu verhindern.",
|
||||||
|
cinfo_antimagiczone, NULL, NULL, NULL, cansee_antimagiczone
|
||||||
|
};
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
static int
|
static int
|
||||||
|
@ -255,162 +231,156 @@ cinfo_farvision(const struct locale * lang, const void * obj, typ_t typ, curse *
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct curse_type ct_farvision = {
|
static struct curse_type ct_farvision = {
|
||||||
"farvision",
|
"farvision",
|
||||||
CURSETYP_NORM, 0, (NO_MERGE),
|
CURSETYP_NORM, 0, (NO_MERGE),
|
||||||
"",
|
"",
|
||||||
cinfo_farvision
|
cinfo_farvision
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
|
||||||
static struct curse_type ct_fogtrap = {
|
static struct curse_type ct_fogtrap = {
|
||||||
"fogtrap",
|
"fogtrap",
|
||||||
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
||||||
"",
|
"",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
static struct curse_type ct_maelstrom = {
|
static struct curse_type ct_maelstrom = {
|
||||||
"maelstrom",
|
"maelstrom",
|
||||||
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
||||||
"Dieser Zauber verursacht einen gigantischen magischen Strudel. Der "
|
"Dieser Zauber verursacht einen gigantischen magischen Strudel. Der "
|
||||||
"Mahlstrom wird alle Schiffe, die in seinen Sog geraten, schwer "
|
"Mahlstrom wird alle Schiffe, die in seinen Sog geraten, schwer "
|
||||||
"beschädigen.",
|
"beschädigen.",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
static struct curse_type ct_blessedharvest = {
|
static struct curse_type ct_blessedharvest = {
|
||||||
"blessedharvest",
|
"blessedharvest",
|
||||||
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
||||||
"Dieser Fruchtbarkeitszauber erhöht die Erträge der Felder.",
|
"Dieser Fruchtbarkeitszauber erhöht die Erträge der Felder.",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
static struct curse_type ct_drought = {
|
static struct curse_type ct_drought = {
|
||||||
"drought",
|
"drought",
|
||||||
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
||||||
"Dieser Zauber strahlt starke negative Energien aus. Warscheinlich "
|
"Dieser Zauber strahlt starke negative Energien aus. Warscheinlich "
|
||||||
"ist er die Ursache der Dürre." ,
|
"ist er die Ursache der Dürre." ,
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
static struct curse_type ct_badlearn = {
|
static struct curse_type ct_badlearn = {
|
||||||
"badlearn",
|
"badlearn",
|
||||||
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
||||||
"Dieser Zauber scheint die Ursache für die Schlaflosigkeit und "
|
"Dieser Zauber scheint die Ursache für die Schlaflosigkeit und "
|
||||||
"Mattigkeit zu sein, unter der die meisten Leute hier leiden und "
|
"Mattigkeit zu sein, unter der die meisten Leute hier leiden und "
|
||||||
"die dazu führt, das Lernen weniger Erfolg bringt. ",
|
"die dazu führt, das Lernen weniger Erfolg bringt. ",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
/* Trübsal-Zauber */
|
/* Trübsal-Zauber */
|
||||||
static struct curse_type ct_depression = {
|
static struct curse_type ct_depression = {
|
||||||
"depression",
|
"depression",
|
||||||
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
||||||
"Wie schon zu vermuten war, sind der ewig graue Himmel und die "
|
"Wie schon zu vermuten war, sind der ewig graue Himmel und die "
|
||||||
"depressive Stimmung in der Region nicht natürlich. Dieser Fluch "
|
"depressive Stimmung in der Region nicht natürlich. Dieser Fluch "
|
||||||
"hat sich wie ein bleiernes Tuch auf die Gemüter der Bevölkerung "
|
"hat sich wie ein bleiernes Tuch auf die Gemüter der Bevölkerung "
|
||||||
"gelegt und eh er nicht gebrochen oder verklungen ist, wird keiner "
|
"gelegt und eh er nicht gebrochen oder verklungen ist, wird keiner "
|
||||||
"sich an Gaukelleien erfreuen können.",
|
"sich an Gaukelleien erfreuen können.",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Astralblock, auf Astralregion */
|
/* Astralblock, auf Astralregion */
|
||||||
static struct curse_type ct_astralblock = {
|
static struct curse_type ct_astralblock = {
|
||||||
"astralblock",
|
"astralblock",
|
||||||
CURSETYP_NORM, 0, NO_MERGE,
|
CURSETYP_NORM, 0, NO_MERGE,
|
||||||
"",
|
"",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
/* Unterhaltungsanteil vermehren */
|
/* Unterhaltungsanteil vermehren */
|
||||||
static struct curse_type ct_generous = {
|
static struct curse_type ct_generous = {
|
||||||
"generous",
|
"generous",
|
||||||
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR | M_MAXEFFECT ),
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR | M_MAXEFFECT ),
|
||||||
"Dieser Zauber beeinflusst die allgemeine Stimmung in der Region positiv. "
|
"Dieser Zauber beeinflusst die allgemeine Stimmung in der Region positiv. "
|
||||||
"Die gute Laune macht die Leute freigiebiger.",
|
"Die gute Laune macht die Leute freigiebiger.",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
/* verhindert Attackiere regional */
|
/* verhindert Attackiere regional */
|
||||||
static struct curse_type ct_peacezone = {
|
static struct curse_type ct_peacezone = {
|
||||||
"peacezone",
|
"peacezone",
|
||||||
CURSETYP_NORM, 0, NO_MERGE,
|
CURSETYP_NORM, 0, NO_MERGE,
|
||||||
"Dieser machtvoller Beeinflussungszauber erstickt jeden Streit schon im "
|
"Dieser machtvoller Beeinflussungszauber erstickt jeden Streit schon im "
|
||||||
"Keim.",
|
"Keim.",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
/* erschwert geordnete Bewegungen */
|
/* erschwert geordnete Bewegungen */
|
||||||
static struct curse_type ct_disorientationzone = {
|
static struct curse_type ct_disorientationzone = {
|
||||||
"disorientationzone",
|
"disorientationzone",
|
||||||
CURSETYP_NORM, 0, NO_MERGE,
|
CURSETYP_NORM, 0, NO_MERGE,
|
||||||
"",
|
"",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
/* erniedigt Magieresistenz von nicht-aliierten Einheiten, wirkt nur 1x
|
/* erniedigt Magieresistenz von nicht-aliierten Einheiten, wirkt nur 1x
|
||||||
* pro Einheit */
|
* pro Einheit */
|
||||||
static struct curse_type ct_badmagicresistancezone = {
|
static struct curse_type ct_badmagicresistancezone = {
|
||||||
"badmagicresistancezone",
|
"badmagicresistancezone",
|
||||||
CURSETYP_NORM, 0, NO_MERGE,
|
CURSETYP_NORM, 0, NO_MERGE,
|
||||||
"Dieses Lied, das irgendwie in die magische Essenz der Region gewoben "
|
"Dieses Lied, das irgendwie in die magische Essenz der Region gewoben "
|
||||||
"ist, schwächt die natürliche Widerstandskraft gegen eine "
|
"ist, schwächt die natürliche Widerstandskraft gegen eine "
|
||||||
"Verzauberung. Es scheint jedoch nur auf bestimmte Einheiten zu wirken.",
|
"Verzauberung. Es scheint jedoch nur auf bestimmte Einheiten zu wirken.",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
/* erhöht Magieresistenz von aliierten Einheiten, wirkt nur 1x pro
|
/* erhöht Magieresistenz von aliierten Einheiten, wirkt nur 1x pro
|
||||||
* Einheit */
|
* Einheit */
|
||||||
static struct curse_type ct_goodmagicresistancezone = {
|
static struct curse_type ct_goodmagicresistancezone = {
|
||||||
"goodmagicresistancezone",
|
"goodmagicresistancezone",
|
||||||
CURSETYP_NORM, 0, NO_MERGE,
|
CURSETYP_NORM, 0, NO_MERGE,
|
||||||
"Dieses Lied, das irgendwie in die magische Essenz der Region gewoben "
|
"Dieses Lied, das irgendwie in die magische Essenz der Region gewoben "
|
||||||
"ist, verstärkt die natürliche Widerstandskraft gegen eine "
|
"ist, verstärkt die natürliche Widerstandskraft gegen eine "
|
||||||
"Verzauberung. Es scheint jedoch nur auf bestimmte Einheiten zu wirken.",
|
"Verzauberung. Es scheint jedoch nur auf bestimmte Einheiten zu wirken.",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
static struct curse_type ct_riotzone = {
|
static struct curse_type ct_riotzone = {
|
||||||
"riotzone",
|
"riotzone",
|
||||||
CURSETYP_NORM, 0, (M_DURATION),
|
CURSETYP_NORM, 0, (M_DURATION),
|
||||||
NULL,
|
NULL,
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
static struct curse_type ct_holyground = {
|
static struct curse_type ct_holyground = {
|
||||||
"holyground",
|
"holyground",
|
||||||
CURSETYP_NORM, 0, (M_VIGOUR_ADD),
|
CURSETYP_NORM, 0, (M_VIGOUR_ADD),
|
||||||
"Verschiedene Naturgeistern sind im Boden der Region gebunden und "
|
"Verschiedene Naturgeistern sind im Boden der Region gebunden und "
|
||||||
"beschützen diese vor dem der dunklen Magie des lebenden Todes.",
|
"beschützen diese vor dem der dunklen Magie des lebenden Todes.",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
static struct curse_type ct_healing = {
|
static struct curse_type ct_healing = {
|
||||||
"healingzone",
|
"healingzone",
|
||||||
CURSETYP_NORM, 0, (M_VIGOUR | M_DURATION),
|
CURSETYP_NORM, 0, (M_VIGOUR | M_DURATION),
|
||||||
"Heilung ist in dieser Region magisch beeinflusst.",
|
"Heilung ist in dieser Region magisch beeinflusst.",
|
||||||
cinfo_region
|
cinfo_simple
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
register_regioncurse(void)
|
register_regioncurse(void)
|
||||||
{
|
{
|
||||||
register_function((pf_generic)cinfo_cursed_by_the_gods, "curseinfo::cursed_by_the_gods");
|
ct_register(&ct_fogtrap);
|
||||||
register_function((pf_generic)cinfo_dreamcurse, "curseinfo::dreamcurse");
|
ct_register(&ct_antimagiczone);
|
||||||
register_function((pf_generic)cinfo_magicstreet, "curseinfo::magicstreet");
|
ct_register(&ct_farvision);
|
||||||
|
ct_register(&ct_gbdream);
|
||||||
register_function((pf_generic)cansee_antimagiczone, "cursecansee::antimagiczone");
|
ct_register(&ct_maelstrom);
|
||||||
|
ct_register(&ct_blessedharvest);
|
||||||
ct_register(&ct_fogtrap);
|
ct_register(&ct_drought);
|
||||||
ct_register(&ct_antimagiczone);
|
ct_register(&ct_badlearn);
|
||||||
ct_register(&ct_farvision);
|
ct_register(&ct_depression);
|
||||||
ct_register(&ct_gbdream);
|
ct_register(&ct_astralblock);
|
||||||
ct_register(&ct_maelstrom);
|
ct_register(&ct_generous);
|
||||||
ct_register(&ct_blessedharvest);
|
ct_register(&ct_peacezone);
|
||||||
ct_register(&ct_drought);
|
ct_register(&ct_disorientationzone);
|
||||||
ct_register(&ct_badlearn);
|
ct_register(&ct_magicstreet);
|
||||||
ct_register(&ct_depression);
|
ct_register(&ct_badmagicresistancezone);
|
||||||
ct_register(&ct_astralblock);
|
ct_register(&ct_goodmagicresistancezone);
|
||||||
ct_register(&ct_generous);
|
ct_register(&ct_riotzone);
|
||||||
ct_register(&ct_peacezone);
|
ct_register(&ct_godcursezone);
|
||||||
ct_register(&ct_disorientationzone);
|
ct_register(&ct_holyground);
|
||||||
ct_register(&ct_magicstreet);
|
ct_register(&ct_healing);
|
||||||
ct_register(&ct_badmagicresistancezone);
|
|
||||||
ct_register(&ct_goodmagicresistancezone);
|
|
||||||
ct_register(&ct_riotzone);
|
|
||||||
ct_register(&ct_godcursezone);
|
|
||||||
ct_register(&ct_holyground);
|
|
||||||
ct_register(&ct_healing);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ extern "C" {
|
||||||
|
|
||||||
struct curse;
|
struct curse;
|
||||||
struct locale;
|
struct locale;
|
||||||
extern int cinfo_region(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self);
|
|
||||||
|
|
||||||
extern void register_regioncurse(void);
|
extern void register_regioncurse(void);
|
||||||
|
|
||||||
|
|
|
@ -3263,7 +3263,7 @@ dc_age(struct curse * c)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct curse_type ct_deathcloud = {
|
static struct curse_type ct_deathcloud = {
|
||||||
"deathcloud", CURSETYP_REGION, 0, NO_MERGE, NULL, cinfo_region, NULL, NULL, NULL, NULL, dc_age
|
"deathcloud", CURSETYP_REGION, 0, NO_MERGE, NULL, cinfo_simple, NULL, NULL, NULL, NULL, dc_age
|
||||||
};
|
};
|
||||||
|
|
||||||
static curse *
|
static curse *
|
||||||
|
|
|
@ -35,29 +35,6 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
|
||||||
int
|
|
||||||
cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
|
||||||
{
|
|
||||||
struct message * msg;
|
|
||||||
|
|
||||||
unused(typ);
|
|
||||||
unused(self);
|
|
||||||
unused(obj);
|
|
||||||
|
|
||||||
assert(typ == TYP_UNIT);
|
|
||||||
|
|
||||||
msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no);
|
|
||||||
if (msg) {
|
|
||||||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
|
||||||
msg_release(msg);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
log_warning(("There is no curseinfo for %s.\n", c->type->cname));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cinfo_unit_onlyowner(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
cinfo_unit_onlyowner(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
||||||
{
|
{
|
||||||
|
@ -221,8 +198,8 @@ static struct curse_type ct_speed = {
|
||||||
/*
|
/*
|
||||||
* C_ORC
|
* C_ORC
|
||||||
*/
|
*/
|
||||||
static int
|
int
|
||||||
cinfo_orc(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
||||||
{
|
{
|
||||||
unit *u;
|
unit *u;
|
||||||
message * msg;
|
message * msg;
|
||||||
|
@ -239,12 +216,13 @@ cinfo_orc(const struct locale * lang, const void * obj, typ_t typ, struct curse
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct curse_type ct_orcish = {
|
static struct curse_type ct_orcish = {
|
||||||
"orcish",
|
"orcish",
|
||||||
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
|
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
|
||||||
"Dieser Zauber scheint die Einheit zu 'orkisieren'. Wie bei Orks "
|
"Dieser Zauber scheint die Einheit zu 'orkisieren'. Wie bei Orks "
|
||||||
"ist eine deutliche Neigung zur Fortpflanzung zu beobachten.",
|
"ist eine deutliche Neigung zur Fortpflanzung zu beobachten.",
|
||||||
cinfo_orc
|
cinfo_unit
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
@ -345,53 +323,22 @@ static struct curse_type ct_sparkle = { "sparkle",
|
||||||
/*
|
/*
|
||||||
* C_STRENGTH
|
* C_STRENGTH
|
||||||
*/
|
*/
|
||||||
static int
|
|
||||||
cinfo_strength(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
|
||||||
{
|
|
||||||
unused(c);
|
|
||||||
unused(typ);
|
|
||||||
|
|
||||||
assert(typ == TYP_UNIT);
|
|
||||||
unused(obj);
|
|
||||||
|
|
||||||
if (self != 0){
|
|
||||||
sprintf(buf, "Die Leute strotzen nur so vor Kraft. (%s)",
|
|
||||||
curseid(c));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
static struct curse_type ct_strength = { "strength",
|
static struct curse_type ct_strength = { "strength",
|
||||||
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
|
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
|
||||||
"Dieser Zauber vermehrt die Stärke der verzauberten Personen um ein "
|
"Dieser Zauber vermehrt die Stärke der verzauberten Personen um ein "
|
||||||
"vielfaches.",
|
"vielfaches.",
|
||||||
cinfo_strength
|
cinfo_simple
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
/*
|
/*
|
||||||
* C_ALLSKILLS (Alp)
|
* C_ALLSKILLS (Alp)
|
||||||
*/
|
*/
|
||||||
static int
|
|
||||||
cinfo_allskills(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
|
||||||
{
|
|
||||||
unused(obj);
|
|
||||||
unused(typ);
|
|
||||||
unused(c);
|
|
||||||
|
|
||||||
assert(typ == TYP_UNIT);
|
|
||||||
|
|
||||||
if (self != 0){
|
|
||||||
sprintf(buf, "Wird von einem Alp geritten. (%s)", curseid(c));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
static struct curse_type ct_worse = {
|
static struct curse_type ct_worse = {
|
||||||
"worse",
|
"worse",
|
||||||
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
|
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
|
||||||
"",
|
"",
|
||||||
cinfo_allskills
|
cinfo_unit
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
@ -399,50 +346,19 @@ static struct curse_type ct_worse = {
|
||||||
/*
|
/*
|
||||||
* C_ITEMCLOAK
|
* C_ITEMCLOAK
|
||||||
*/
|
*/
|
||||||
static int
|
|
||||||
cinfo_itemcloak(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
|
||||||
{
|
|
||||||
unit *u;
|
|
||||||
unused(typ);
|
|
||||||
|
|
||||||
assert(typ == TYP_UNIT);
|
|
||||||
u = (unit *)obj;
|
|
||||||
|
|
||||||
if (self != 0) {
|
|
||||||
sprintf(buf, "Die Ausrüstung von %s scheint unsichtbar. (%s)",
|
|
||||||
u->name, curseid(c));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
static struct curse_type ct_itemcloak = {
|
static struct curse_type ct_itemcloak = {
|
||||||
"itemcloak",
|
"itemcloak",
|
||||||
CURSETYP_UNIT, CURSE_SPREADNEVER, M_DURATION,
|
CURSETYP_UNIT, CURSE_SPREADNEVER, M_DURATION,
|
||||||
"Dieser Zauber macht die Ausrüstung unsichtbar.",
|
"Dieser Zauber macht die Ausrüstung unsichtbar.",
|
||||||
cinfo_itemcloak
|
cinfo_unit
|
||||||
};
|
};
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
static int
|
|
||||||
cinfo_fumble(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
|
||||||
{
|
|
||||||
unit * u = (unit*)obj;
|
|
||||||
unused(typ);
|
|
||||||
|
|
||||||
assert(typ == TYP_UNIT);
|
|
||||||
|
|
||||||
if (self != 0){
|
|
||||||
sprintf(buf, "%s kann sich kaum konzentrieren. (%s)",
|
|
||||||
u->name, curseid(c));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
static struct curse_type ct_fumble = {
|
static struct curse_type ct_fumble = {
|
||||||
"fumble",
|
"fumble",
|
||||||
CURSETYP_NORM, CURSE_SPREADNEVER, NO_MERGE,
|
CURSETYP_NORM, CURSE_SPREADNEVER, NO_MERGE,
|
||||||
"Eine Wolke negativer Energie umgibt die Einheit.",
|
"Eine Wolke negativer Energie umgibt die Einheit.",
|
||||||
cinfo_fumble
|
cinfo_unit
|
||||||
};
|
};
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
|
@ -452,11 +368,12 @@ static struct curse_type ct_oldrace = { "oldrace",
|
||||||
"",
|
"",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct curse_type ct_magicresistance = { "magicresistance",
|
static struct curse_type ct_magicresistance = { "magicresistance",
|
||||||
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
|
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
|
||||||
"Dieser Zauber verstärkt die natürliche Widerstandskraft gegen eine "
|
"Dieser Zauber verstärkt die natürliche Widerstandskraft gegen eine "
|
||||||
"Verzauberung.",
|
"Verzauberung.",
|
||||||
NULL
|
cinfo_simple
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -500,6 +417,7 @@ cinfo_skill(const struct locale * lang, const void * obj, typ_t typ, struct curs
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct curse_type ct_skillmod = {
|
static struct curse_type ct_skillmod = {
|
||||||
"skillmod",
|
"skillmod",
|
||||||
CURSETYP_NORM, CURSE_SPREADMODULO, M_MEN,
|
CURSETYP_NORM, CURSE_SPREADMODULO, M_MEN,
|
||||||
|
@ -513,20 +431,6 @@ static struct curse_type ct_skillmod = {
|
||||||
void
|
void
|
||||||
register_unitcurse(void)
|
register_unitcurse(void)
|
||||||
{
|
{
|
||||||
register_function((pf_generic)cinfo_unit_onlyowner, "curseinfo::unit_onlyowner");
|
|
||||||
register_function((pf_generic)cinfo_auraboost, "curseinfo::auraboost");
|
|
||||||
register_function((pf_generic)cinfo_slave, "curseinfo::slave");
|
|
||||||
register_function((pf_generic)cinfo_calm, "curseinfo::calm");
|
|
||||||
register_function((pf_generic)cinfo_speed, "curseinfo::speed");
|
|
||||||
register_function((pf_generic)cinfo_orc, "curseinfo::orc");
|
|
||||||
register_function((pf_generic)cinfo_kaelteschutz, "curseinfo::kaelteschutz");
|
|
||||||
register_function((pf_generic)cinfo_sparkle, "curseinfo::sparkle");
|
|
||||||
register_function((pf_generic)cinfo_strength, "curseinfo::strength");
|
|
||||||
register_function((pf_generic)cinfo_allskills, "curseinfo::allskills");
|
|
||||||
register_function((pf_generic)cinfo_skill, "curseinfo::skill");
|
|
||||||
register_function((pf_generic)cinfo_itemcloak, "curseinfo::itemcloak");
|
|
||||||
register_function((pf_generic)cinfo_fumble, "curseinfo::fumble");
|
|
||||||
|
|
||||||
ct_register(&ct_auraboost);
|
ct_register(&ct_auraboost);
|
||||||
ct_register(&ct_magicboost);
|
ct_register(&ct_magicboost);
|
||||||
ct_register(&ct_slavery);
|
ct_register(&ct_slavery);
|
||||||
|
@ -544,4 +448,3 @@ register_unitcurse(void)
|
||||||
ct_register(&ct_magicresistance);
|
ct_register(&ct_magicresistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ extern "C" {
|
||||||
struct curse;
|
struct curse;
|
||||||
struct locale;
|
struct locale;
|
||||||
extern int cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self);
|
extern int cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self);
|
||||||
|
|
||||||
extern void register_unitcurse(void);
|
extern void register_unitcurse(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -712,6 +712,7 @@
|
||||||
</string>
|
</string>
|
||||||
<string name="section_newpotions">
|
<string name="section_newpotions">
|
||||||
<text locale="de">Neue Tränke</text>
|
<text locale="de">Neue Tränke</text>
|
||||||
|
<text locale="en">New Potions</text>
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
<!--Gebäudetypen -->
|
<!--Gebäudetypen -->
|
||||||
|
@ -2992,19 +2993,19 @@
|
||||||
|
|
||||||
<string name="alp">
|
<string name="alp">
|
||||||
<text locale="de">Alp</text>
|
<text locale="de">Alp</text>
|
||||||
<text locale="en">alp</text>
|
<text locale="en">nightmare</text>
|
||||||
</string>
|
</string>
|
||||||
<string name="alp_p">
|
<string name="alp_p">
|
||||||
<text locale="de">Alps</text>
|
<text locale="de">Alps</text>
|
||||||
<text locale="en">alps</text>
|
<text locale="en">nightmaress</text>
|
||||||
</string>
|
</string>
|
||||||
<string name="alp_d">
|
<string name="alp_d">
|
||||||
<text locale="de">Alps</text>
|
<text locale="de">Alps</text>
|
||||||
<text locale="en">alps</text>
|
<text locale="en">nightmares</text>
|
||||||
</string>
|
</string>
|
||||||
<string name="alp_x">
|
<string name="alp_x">
|
||||||
<text locale="de">Alp</text>
|
<text locale="de">Alp</text>
|
||||||
<text locale="en">alp</text>
|
<text locale="en">nightmare</text>
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
<string name="mountainguard">
|
<string name="mountainguard">
|
||||||
|
|
|
@ -47,14 +47,49 @@
|
||||||
<text locale="fr">"A fog of negative energy enshrouds the region. ($int36($id))"</text>
|
<text locale="fr">"A fog of negative energy enshrouds the region. ($int36($id))"</text>
|
||||||
<text locale="en">"A fog of negative energy enshrouds the region. ($int36($id))"</text>
|
<text locale="en">"A fog of negative energy enshrouds the region. ($int36($id))"</text>
|
||||||
</message>
|
</message>
|
||||||
|
<message name="curseinfo::strength" section="events">
|
||||||
|
<type>
|
||||||
|
<arg name="id" type="int"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">"Die Leute strotzen nur so vor Kraft. ($int36($id))"</text>
|
||||||
|
<text locale="fr">"Testosterone levels are at an all-time high. ($int36($id))"</text>
|
||||||
|
<text locale="en">"Testosterone levels are at an all-time high. ($int36($id))"</text>
|
||||||
|
</message>
|
||||||
|
<message name="curseinfo::worse" section="events">
|
||||||
|
<type>
|
||||||
|
<arg name="unit" type="unit"/>
|
||||||
|
<arg name="id" type="int"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">"$unit($unit) wird von einem Alp geritten. ($int36($id))"</text>
|
||||||
|
<text locale="fr">"$unit($unit) is chased by a nightmare. ($int36($id))"</text>
|
||||||
|
<text locale="en">"$unit($unit) is chased by a nightmare. ($int36($id))"</text>
|
||||||
|
</message>
|
||||||
<message name="curseinfo::orcish" section="events">
|
<message name="curseinfo::orcish" section="events">
|
||||||
<type>
|
<type>
|
||||||
<arg name="unit" type="unit"/>
|
<arg name="unit" type="unit"/>
|
||||||
<arg name="id" type="int"/>
|
<arg name="id" type="int"/>
|
||||||
</type>
|
</type>
|
||||||
<text locale="de">"$unit($unit) stürzt sich von einem amourösen Abenteuer ins nächste. ($int36($id))"</text>
|
<text locale="de">"$unit($unit) stürzt sich von einem amourösen Abenteuer ins nächste. ($int36($id))"</text>
|
||||||
<text locale="fr">"($int36($id))"</text>
|
<text locale="fr">"$unit($unit) goes from one amourous adventure to another. ($int36($id))"</text>
|
||||||
<text locale="de">"$unit($unit) goes from one amourous adventure to another. ($int36($id))"</text>
|
<text locale="en">"$unit($unit) goes from one amourous adventure to another. ($int36($id))"</text>
|
||||||
|
</message>
|
||||||
|
<message name="curseinfo::fumble" section="events">
|
||||||
|
<type>
|
||||||
|
<arg name="unit" type="unit"/>
|
||||||
|
<arg name="id" type="int"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">"$unit($unit) kann sich kaum konzentrieren. ($int36($id))"</text>
|
||||||
|
<text locale="fr">"$unit($unit) can hardly focus on anything. ($int36($id))"</text>
|
||||||
|
<text locale="en">"$unit($unit) can hardly focus on anything. ($int36($id))"</text>
|
||||||
|
</message>
|
||||||
|
<message name="curseinfo::itemcloak" section="events">
|
||||||
|
<type>
|
||||||
|
<arg name="unit" type="unit"/>
|
||||||
|
<arg name="id" type="int"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">"Die Ausrüstung von $unit($unit) scheint unsichtbar. ($int36($id))"</text>
|
||||||
|
<text locale="fr">"$unit($unit)'s equipment is invisible. ($int36($id))"</text>
|
||||||
|
<text locale="en">"$unit($unit)'s equipment is invisible. ($int36($id))"</text>
|
||||||
</message>
|
</message>
|
||||||
<message name="curseinfo::magicresistance" section="events">
|
<message name="curseinfo::magicresistance" section="events">
|
||||||
<type>
|
<type>
|
||||||
|
|
Loading…
Reference in New Issue