From 2fb5713a2d3da0a6a1fb03016e223d6ac7864e8b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 9 May 2002 12:48:19 +0000 Subject: [PATCH] =?UTF-8?q?*=20buildingcurse=20kompiliert=20wieder.=20*=20?= =?UTF-8?q?shipcurse=20kompiliert=20wieder.=20*=20enum-typedefs=20in=20ANS?= =?UTF-8?q?I-C=20sind=20scheisse.=20*=20includes=20aufger=C3=A4umt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/items/lmsreward.c | 9 +++++---- src/common/kernel/curse.h | 2 +- src/common/kernel/eressea.h | 1 + src/common/kernel/objtypes.h | 4 ++-- src/common/spells/buildingcurse.c | 22 +++++++++++++++------- src/common/spells/buildingcurse.h | 5 +++++ src/common/spells/regioncurse.c | 2 +- src/common/spells/regioncurse.h | 2 +- src/common/spells/shipcurse.c | 12 +++++++++--- src/common/spells/shipcurse.h | 7 ++++--- src/common/spells/unitcurse.c | 28 ++++++++++++++-------------- src/common/spells/unitcurse.h | 2 +- 12 files changed, 59 insertions(+), 37 deletions(-) diff --git a/src/common/items/lmsreward.c b/src/common/items/lmsreward.c index a8828b6c0..3d203cc61 100644 --- a/src/common/items/lmsreward.c +++ b/src/common/items/lmsreward.c @@ -28,12 +28,13 @@ #include static int -info_lmsstory(const void* vp, int i, curse * c, int i2) +info_lmsstory(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { - unused(vp); - unused(i); + unused(lang); + unused(obj); + unused(typ); unused(c); - unused(i2); + unused(self); strcpy(buf, "Die Bauern der Region erzählen sich die Geschichte von den glorreichen Siegern des Last-Man-Standing Turniers."); return 1; } diff --git a/src/common/kernel/curse.h b/src/common/kernel/curse.h index 629746663..d4058eb72 100644 --- a/src/common/kernel/curse.h +++ b/src/common/kernel/curse.h @@ -215,7 +215,7 @@ typedef struct curse_type { unsigned int mergeflags; const char *info_str; /* Wirkung des curse, wird bei einer gelungenen Zauberanalyse angezeigt */ - int (*curseinfo)(const struct locale*, const void*, int, curse*, int); + int (*curseinfo)(const struct locale*, const void*, typ_t, curse*, int); void (*change_vigour)(curse*, int); int (*read)(FILE * F, curse * c); int (*write)(FILE * F, const curse * c); diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index dab51c63c..f5705d28a 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -40,6 +40,7 @@ typedef char direction_t; typedef int race_t; typedef int magic_t; typedef short skill_t; +typedef short typ_t; typedef int herb_t; typedef int potion_t; typedef int luxury_t; diff --git a/src/common/kernel/objtypes.h b/src/common/kernel/objtypes.h index b34fdc1dd..5ac8b5e8e 100644 --- a/src/common/kernel/objtypes.h +++ b/src/common/kernel/objtypes.h @@ -23,7 +23,7 @@ typedef struct obj_ID { int a, b; } obj_ID; -typedef enum typ_t { +enum { TYP_UNIT, TYP_REGION, TYP_BUILDING, @@ -32,7 +32,7 @@ typedef enum typ_t { TYP_ACTION, TYP_TRIGGER, TYP_TIMEOUT -} typ_t; +}; extern obj_ID get_ID(void *obj, typ_t typ); extern void write_ID(FILE *f, obj_ID id); diff --git a/src/common/spells/buildingcurse.c b/src/common/spells/buildingcurse.c index 21b1e3323..63eafe72f 100644 --- a/src/common/spells/buildingcurse.c +++ b/src/common/spells/buildingcurse.c @@ -16,14 +16,16 @@ #include "buildingcurse.h" /* kernel includes */ -#include "message.h" -#include "nrmessage.h" -#include "objtypes.h" -#include "curse.h" +#include +#include +#include +#include +#include +#include /* util includes */ -#include -#include +#include +#include /* libc includes */ #include @@ -31,7 +33,7 @@ #include -static int +int cinfo_building(const locale * lang, void * obj, typ_t typ, curse *c, int self) { message * msg; @@ -77,3 +79,9 @@ cinfo_magicrunes(void * obj, typ_t typ, curse *c, int self) return 0; } + +void +register_buildingcurse(void) +{ + register_function((pf_generic)cinfo_magicrunes, "curseinfo::magicrunes"); +} \ No newline at end of file diff --git a/src/common/spells/buildingcurse.h b/src/common/spells/buildingcurse.h index 885c2e7a7..12c9e3ae3 100644 --- a/src/common/spells/buildingcurse.h +++ b/src/common/spells/buildingcurse.h @@ -14,5 +14,10 @@ #ifndef _BCURSE_H #define _BCURSE_H +struct locale; +struct curse; +extern int cinfo_building(const struct locale * lang, void * obj, typ_t typ, struct curse *c, int self); + +extern void register_buildingcurse(void); #endif /* _BCURSE_H */ diff --git a/src/common/spells/regioncurse.c b/src/common/spells/regioncurse.c index 8dfbb1645..add9a0355 100644 --- a/src/common/spells/regioncurse.c +++ b/src/common/spells/regioncurse.c @@ -32,7 +32,7 @@ #include int -cinfo_region(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_region(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { message * msg; diff --git a/src/common/spells/regioncurse.h b/src/common/spells/regioncurse.h index d0473db50..51f181fe5 100644 --- a/src/common/spells/regioncurse.h +++ b/src/common/spells/regioncurse.h @@ -16,7 +16,7 @@ struct curse; struct locale; -extern int cinfo_region(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self); +extern int cinfo_region(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self); extern void register_regioncurse(void); diff --git a/src/common/spells/shipcurse.c b/src/common/spells/shipcurse.c index a337fa5f5..813cb1b8c 100644 --- a/src/common/spells/shipcurse.c +++ b/src/common/spells/shipcurse.c @@ -23,7 +23,7 @@ #include /* util includes */ -#include +#include #include /* libc includes */ @@ -32,8 +32,8 @@ #include -static int -cinfo_ship(const locale * lang, void * obj, typ_t typ, curse *c, int self) +int +cinfo_ship(const locale * lang, const void * obj, typ_t typ, curse *c, int self) { message * msg; @@ -94,3 +94,9 @@ cinfo_disorientation(void * obj, typ_t typ, curse *c, int self) return 1; } +void +register_shipcurse(void) +{ + register_function((pf_generic)cinfo_disorientation, "curseinfo::disorientation"); + register_function((pf_generic)cinfo_shipnodrift, "curseinfo::shipnodrift"); +} diff --git a/src/common/spells/shipcurse.h b/src/common/spells/shipcurse.h index 440f30ee2..7519e2c80 100644 --- a/src/common/spells/shipcurse.h +++ b/src/common/spells/shipcurse.h @@ -14,8 +14,9 @@ #ifndef _SCURSE_H #define _SCURSE_H -/* -int cinfo_shipnodrift(const locale *, void *, typ_t, curse *, int); -*/ +struct locale; +struct curse; +extern int cinfo_ship(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self); +extern void register_shipcurse(void); #endif /* _SCURSE_H */ diff --git a/src/common/spells/unitcurse.c b/src/common/spells/unitcurse.c index 1729cb742..ee58f11ce 100644 --- a/src/common/spells/unitcurse.c +++ b/src/common/spells/unitcurse.c @@ -37,7 +37,7 @@ int -cinfo_unit(const struct locale * lang, const void * obj, enum 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) { message * msg; @@ -54,7 +54,7 @@ cinfo_unit(const struct locale * lang, const void * obj, enum typ_t typ, struct } static int -cinfo_unit_onlyowner(const struct locale * lang, const void * obj, enum 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) { message * msg; struct unit *u; @@ -78,7 +78,7 @@ cinfo_unit_onlyowner(const struct locale * lang, const void * obj, enum typ_t ty /* C_AURA */ /* erhöht/senkt regeneration und maxaura um effect% */ static int -cinfo_auraboost(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_auraboost(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { struct unit *u; unused(typ); @@ -100,7 +100,7 @@ cinfo_auraboost(const struct locale * lang, const void * obj, enum typ_t typ, st /* C_SLAVE */ static int -cinfo_slave(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_slave(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unit *u; unused(typ); @@ -118,7 +118,7 @@ cinfo_slave(const struct locale * lang, const void * obj, enum typ_t typ, struct /* C_CALM */ static int -cinfo_calm(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_calm(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unit *u; const struct race * rc; @@ -145,7 +145,7 @@ cinfo_calm(const struct locale * lang, const void * obj, enum typ_t typ, struct } /* C_SPEED */ static int -cinfo_speed(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_speed(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unit *u; curse_unit * cu; @@ -167,7 +167,7 @@ cinfo_speed(const struct locale * lang, const void * obj, enum typ_t typ, struct } /* C_ORC */ static int -cinfo_orc(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_orc(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unit *u; message * msg; @@ -187,7 +187,7 @@ cinfo_orc(const struct locale * lang, const void * obj, enum typ_t typ, struct c /* C_KAELTESCHUTZ */ static int -cinfo_kaelteschutz(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_kaelteschutz(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unit *u; curse_unit * cu; @@ -209,7 +209,7 @@ cinfo_kaelteschutz(const struct locale * lang, const void * obj, enum typ_t typ, /* C_SPARKLE */ static int -cinfo_sparkle(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_sparkle(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { const char * effects[] = { NULL, /* end grau*/ @@ -264,7 +264,7 @@ cinfo_sparkle(const struct locale * lang, const void * obj, enum typ_t typ, stru /* C_STRENGTH */ static int -cinfo_strength(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_strength(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unused(c); unused(typ); @@ -281,7 +281,7 @@ cinfo_strength(const struct locale * lang, const void * obj, enum typ_t typ, str } /* C_ALLSKILLS */ static int -cinfo_allskills(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_allskills(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unused(obj); unused(typ); @@ -297,7 +297,7 @@ cinfo_allskills(const struct locale * lang, const void * obj, enum typ_t typ, st } /* C_SKILL */ static int -cinfo_skill(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_skill(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unit *u = (unit *)obj; int sk = (int)c->data; @@ -313,7 +313,7 @@ cinfo_skill(const struct locale * lang, const void * obj, enum typ_t typ, struct } /* C_ITEMCLOAK */ static int -cinfo_itemcloak(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_itemcloak(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unit *u; unused(typ); @@ -330,7 +330,7 @@ cinfo_itemcloak(const struct locale * lang, const void * obj, enum typ_t typ, st } static int -cinfo_fumble(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) +cinfo_fumble(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) { unit * u = (unit*)obj; unused(typ); diff --git a/src/common/spells/unitcurse.h b/src/common/spells/unitcurse.h index ea0b8e444..6e2320b38 100644 --- a/src/common/spells/unitcurse.h +++ b/src/common/spells/unitcurse.h @@ -35,7 +35,7 @@ int cinfo_fumble(void *, enum typ_t, struct curse *, int); */ struct curse; struct locale; -extern int cinfo_unit(const struct locale * lang, const void * obj, enum 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); #endif /* _UCURSE_H */