From b06c464e4f7dae459897144242094a62e95e8ed7 Mon Sep 17 00:00:00 2001 From: Katja Zedel Date: Thu, 9 May 2002 10:42:41 +0000 Subject: [PATCH] und noch mehr kleinkram --- src/common/kernel/curse.h | 2 +- src/common/spells/buildingcurse.c | 53 +++++++++++++++++++++++++++++++ src/common/spells/buildingcurse.h | 18 +++++++++++ src/common/spells/regioncurse.c | 6 ++-- src/common/spells/regioncurse.h | 8 ++--- src/common/spells/shipcurse.c | 4 +-- src/common/spells/unitcurse.c | 25 ++++++++------- 7 files changed, 94 insertions(+), 22 deletions(-) create mode 100644 src/common/spells/buildingcurse.c create mode 100644 src/common/spells/buildingcurse.h diff --git a/src/common/kernel/curse.h b/src/common/kernel/curse.h index 275bf8ac8..7e47db0b7 100644 --- a/src/common/kernel/curse.h +++ b/src/common/kernel/curse.h @@ -208,7 +208,7 @@ typedef struct curse_unit { /* ------------------------------------------------------------- */ -typedef int (*cdesc_fun)(const void*, int, curse*, int); +typedef int (*cdesc_fun)(const locale *, const void*, int, curse*, int); typedef struct curse_type { const char *cname; /* Name der Zauberwirkung, Identifizierung des curse */ diff --git a/src/common/spells/buildingcurse.c b/src/common/spells/buildingcurse.c new file mode 100644 index 000000000..1b00bfe02 --- /dev/null +++ b/src/common/spells/buildingcurse.c @@ -0,0 +1,53 @@ +/* vi: set ts=2: + * + * Eressea PB(E)M host Copyright (C) 1998-2000 + * Christian Schlittchen (corwin@amber.kn-bremen.de) + * Katja Zedel (katze@felidae.kn-bremen.de) + * Henning Peters (faroul@beyond.kn-bremen.de) + * Enno Rehling (enno@eressea-pbem.de) + * Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de) + * + * This program may not be used, modified or distributed without + * prior permission by the authors of Eressea. + */ + +#include +#include "eressea.h" +#include "buildingcurse.h" + +/* kernel includes */ +#include "message.h" +#include "nrmessage.h" +#include "objtypes.h" +#include "curse.h" + +/* util includes */ +#include + +/* libc includes */ +#include +#include +#include + + +static int +cinfo_building(const locale * lang, void * obj, typ_t typ, curse *c, int self) +{ + message * msg; + + unused(typ); + assert(typ == TYP_BUILDING); + + if (self){ + msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no); + } else { + msg = msg_message(mkname("curseinfo", "buildingunknown"), "id", c->no); + } + nr_render(msg, lang, buf, sizeof(buf), NULL); + msg_release(msg); + return 1; +} + +/* CurseInfo mit Spezialabfragen */ + + diff --git a/src/common/spells/buildingcurse.h b/src/common/spells/buildingcurse.h new file mode 100644 index 000000000..885c2e7a7 --- /dev/null +++ b/src/common/spells/buildingcurse.h @@ -0,0 +1,18 @@ +/* vi: set ts=2: + * + * Eressea PB(E)M host Copyright (C) 1998-2000 + * Christian Schlittchen (corwin@amber.kn-bremen.de) + * Katja Zedel (katze@felidae.kn-bremen.de) + * Henning Peters (faroul@beyond.kn-bremen.de) + * Enno Rehling (enno@eressea-pbem.de) + * Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de) + * + * This program may not be used, modified or distributed without + * prior permission by the authors of Eressea. + */ + +#ifndef _BCURSE_H +#define _BCURSE_H + + +#endif /* _BCURSE_H */ diff --git a/src/common/spells/regioncurse.c b/src/common/spells/regioncurse.c index f672be6e7..b465d93d1 100644 --- a/src/common/spells/regioncurse.c +++ b/src/common/spells/regioncurse.c @@ -50,7 +50,7 @@ cinfo_region(const locale * lang, void * obj, typ_t typ, curse *c, int self) /* CurseInfo mit Spezialabfragen */ static int -cinfo_cursed_by_the_gods(void * obj, typ_t typ, curse *c, int self) +cinfo_cursed_by_the_gods(const locale * lang,void * obj, typ_t typ, curse *c, int self) { region *r; message * msg; @@ -72,7 +72,7 @@ cinfo_cursed_by_the_gods(void * obj, typ_t typ, curse *c, int self) } /* C_GBDREAM, */ static int -cinfo_dreamcurse(void * obj, typ_t typ, curse *c, int self) +cinfo_dreamcurse(const locale * lang,void * obj, typ_t typ, curse *c, int self) { unused(self); unused(typ); @@ -93,7 +93,7 @@ cinfo_dreamcurse(void * obj, typ_t typ, curse *c, int self) } /* C_MAGICSTREET */ static int -cinfo_magicstreet(void * obj, typ_t typ, curse *c, int self) +cinfo_magicstreet(const locale * lang,void * obj, typ_t typ, curse *c, int self) { unused(typ); unused(self); diff --git a/src/common/spells/regioncurse.h b/src/common/spells/regioncurse.h index b3df6c28f..286bae42c 100644 --- a/src/common/spells/regioncurse.h +++ b/src/common/spells/regioncurse.h @@ -14,10 +14,10 @@ #ifndef _RCURSE_H #define _RCURSE_H -static int cinfo_region(const locale * lang, void * obj, typ_t typ, curse *c, int self); +static int cinfo_region(const locale *, void *, typ_t, curse *, int); -static int cinfo_cursed_by_the_gods(void * obj, typ_t typ, curse *c, int self); -static int cinfo_dreamcurse(void * obj, typ_t typ, curse *c, int self); -static int cinfo_magicstreet(void * obj, typ_t typ, curse *c, int self); +static int cinfo_cursed_by_the_gods(const locale *, void *, typ_t, curse *, int); +static int cinfo_dreamcurse(const locale *, void *, typ_t, curse *, int); +static int cinfo_magicstreet(const locale *, void *, typ_t, curse *, int); #endif /* _RCURSE_H */ diff --git a/src/common/spells/shipcurse.c b/src/common/spells/shipcurse.c index 026d1daf6..82a4caad6 100644 --- a/src/common/spells/shipcurse.c +++ b/src/common/spells/shipcurse.c @@ -13,7 +13,7 @@ #include #include "eressea.h" -#include "regioncurse.h" +#include "shipcurse.h" /* kernel includes */ #include "message.h" @@ -72,7 +72,7 @@ cinfo_ship_onlyowner(const locale * lang, void * obj, typ_t typ, curse *c, int s /* C_SHIP_NODRIFT */ static int -cinfo_shipnodrift(void * obj, typ_t typ, curse *c, int self) +cinfo_shipnodrift(const locale * lang, void * obj, typ_t typ, curse *c, int self) { ship * sh; unused(typ); diff --git a/src/common/spells/unitcurse.c b/src/common/spells/unitcurse.c index cef4d9289..d471af267 100644 --- a/src/common/spells/unitcurse.c +++ b/src/common/spells/unitcurse.c @@ -13,6 +13,7 @@ #include #include "eressea.h" +#include "unitcurse.h" /* kernel includes */ #include "message.h" @@ -70,7 +71,7 @@ cinfo_unit_onlyowner(const locale * lang, void * obj, typ_t typ, curse *c, int s /* C_AURA */ /* erhöht/senkt regeneration und maxaura um effect% */ static int -cinfo_auraboost(void * obj, typ_t typ, curse *c, int self) +cinfo_auraboost(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unit *u; unused(typ); @@ -92,7 +93,7 @@ cinfo_auraboost(void * obj, typ_t typ, curse *c, int self) /* C_SLAVE */ static int -cinfo_slave(void * obj, typ_t typ, curse *c, int self) +cinfo_slave(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unit *u; unused(typ); @@ -110,7 +111,7 @@ cinfo_slave(void * obj, typ_t typ, curse *c, int self) /* C_CALM */ static int -cinfo_calm(void * obj, typ_t typ, curse *c, int self) +cinfo_calm(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unit *u; const race * rc; @@ -137,7 +138,7 @@ cinfo_calm(void * obj, typ_t typ, curse *c, int self) } /* C_SPEED */ static int -cinfo_speed(void * obj, typ_t typ, curse *c, int self) +cinfo_speed(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unit *u; curse_unit * cu; @@ -159,7 +160,7 @@ cinfo_speed(void * obj, typ_t typ, curse *c, int self) } /* C_ORC */ static int -cinfo_orc(void * obj, typ_t typ, curse *c, int self) +cinfo_orc(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unit *u; unused(typ); @@ -177,7 +178,7 @@ cinfo_orc(void * obj, typ_t typ, curse *c, int self) /* C_KAELTESCHUTZ */ static int -cinfo_kaelteschutz(void * obj, typ_t typ, curse *c, int self) +cinfo_kaelteschutz(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unit *u; curse_unit * cu; @@ -199,7 +200,7 @@ cinfo_kaelteschutz(void * obj, typ_t typ, curse *c, int self) /* C_SPARKLE */ static int -cinfo_sparkle(void * obj, typ_t typ, curse *c, int self) +cinfo_sparkle(const locale * lang, void * obj, typ_t typ, curse *c, int self) { const char * effects[] = { NULL, /* end grau*/ @@ -254,7 +255,7 @@ cinfo_sparkle(void * obj, typ_t typ, curse *c, int self) /* C_STRENGTH */ static int -cinfo_strength(void * obj, typ_t typ, curse *c, int self) +cinfo_strength(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unused(c); unused(typ); @@ -271,7 +272,7 @@ cinfo_strength(void * obj, typ_t typ, curse *c, int self) } /* C_ALLSKILLS */ static int -cinfo_allskills(void * obj, typ_t typ, curse *c, int self) +cinfo_allskills(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unused(obj); unused(typ); @@ -287,7 +288,7 @@ cinfo_allskills(void * obj, typ_t typ, curse *c, int self) } /* C_SKILL */ static int -cinfo_skill(void * obj, typ_t typ, curse *c, int self) +cinfo_skill(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unit *u = (unit *)obj; int sk = (int)c->data; @@ -303,7 +304,7 @@ cinfo_skill(void * obj, typ_t typ, curse *c, int self) } /* C_ITEMCLOAK */ static int -cinfo_itemcloak(void * obj, typ_t typ, curse *c, int self) +cinfo_itemcloak(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unit *u; unused(typ); @@ -320,7 +321,7 @@ cinfo_itemcloak(void * obj, typ_t typ, curse *c, int self) } static int -cinfo_fumble(void * obj, typ_t typ, curse *c, int self) +cinfo_fumble(const locale * lang, void * obj, typ_t typ, curse *c, int self) { unit * u = (unit*)obj; unused(typ);