grosser commit mit vielen curses

This commit is contained in:
Enno Rehling 2002-05-09 12:19:15 +00:00
parent dfa6fe7397
commit db6d04c888
6 changed files with 45 additions and 47 deletions

View File

@ -780,7 +780,7 @@ static struct curse_type ct_farvision = { "farvision",
static struct curse_type ct_gbdream = { "gbdream",
CURSETYP_NORM, 0, (NO_MERGE),
"",
cinfo_dreamcurse
cinfo_region
};
static struct curse_type ct_auraboost = { "auraboost",
CURSETYP_NORM, CURSE_SPREADMODULO, (NO_MERGE),
@ -993,8 +993,8 @@ static struct curse_type ct_sparkle = { "sparkle",
static struct curse_type ct_skillmod = { "skillmod",
CURSETYP_NORM, CURSE_SPREADMODULO, M_MEN,
"",
cinfo_skill,
NULL, NULL,
cinfo_unit,
NULL,
read_skill, write_skill
};
@ -1007,7 +1007,6 @@ resolve_curse(void * id)
void
register_curses(void)
{
int i;
ct_register(&ct_fogtrap);
ct_register(&ct_antimagiczone);
ct_register(&ct_farvision);

View File

@ -208,8 +208,6 @@ typedef struct curse_unit {
/* ------------------------------------------------------------- */
typedef int (*cdesc_fun)(const locale *, const void*, int, curse*, int);
typedef struct curse_type {
const char *cname; /* Name der Zauberwirkung, Identifizierung des curse */
int typ;
@ -217,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 locale*, const void*, int, curse*, int);
int (*curseinfo)(const struct locale*, const void*, int, curse*, int);
void (*change_vigour)(curse*, int);
int (*read)(FILE * F, curse * c);
int (*write)(FILE * F, const curse * c);

View File

@ -24,15 +24,15 @@
/* util includes */
#include <message.h>
#include <functions.h>
/* libc includes */
#include <string.h>
#include <stdlib.h>
#include <assert.h>
static int
cinfo_region(const locale * lang, void * obj, typ_t typ, curse *c, int self)
int
cinfo_region(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
message * msg;
@ -114,7 +114,11 @@ cinfo_magicstreet(const locale * lang,void * obj, typ_t typ, curse *c, int self)
return 1;
}
void register_regioncurse(void)
void
register_regioncurse(void)
{
register_function((pf_generic)cinfo_cursed_by_the_gods, "curseinfo::cursed_by_the_gods");
register_function((pf_generic)cinfo_dreamcurse, "curseinfo::dreamcurse");
register_function((pf_generic)cinfo_magicstreet, "curseinfo::magicstreet");
}

View File

@ -14,13 +14,9 @@
#ifndef _RCURSE_H
#define _RCURSE_H
/*
int cinfo_region(const locale *, void *, typ_t, curse *, int);
int cinfo_cursed_by_the_gods(const locale *, void *, typ_t, curse *, int);
int cinfo_dreamcurse(const locale *, void *, typ_t, curse *, int);
int cinfo_magicstreet(const locale *, void *, typ_t, curse *, int);
*/
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 void register_regioncurse(void);

View File

@ -36,7 +36,7 @@
#include <assert.h>
int
cinfo_unit(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_unit(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
message * msg;
@ -53,7 +53,7 @@ cinfo_unit(const struct locale * lang, void * obj, enum typ_t typ, struct curse
}
static int
cinfo_unit_onlyowner(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_unit_onlyowner(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
message * msg;
struct unit *u;
@ -77,7 +77,7 @@ cinfo_unit_onlyowner(const struct locale * lang, void * obj, enum typ_t typ, str
/* C_AURA */
/* erhöht/senkt regeneration und maxaura um effect% */
static int
cinfo_auraboost(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_auraboost(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
struct unit *u;
unused(typ);
@ -99,7 +99,7 @@ cinfo_auraboost(const struct locale * lang, void * obj, enum typ_t typ, struct c
/* C_SLAVE */
static int
cinfo_slave(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_slave(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unit *u;
unused(typ);
@ -117,7 +117,7 @@ cinfo_slave(const struct locale * lang, void * obj, enum typ_t typ, struct curse
/* C_CALM */
static int
cinfo_calm(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_calm(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unit *u;
const struct race * rc;
@ -144,7 +144,7 @@ cinfo_calm(const struct locale * lang, void * obj, enum typ_t typ, struct curse
}
/* C_SPEED */
static int
cinfo_speed(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_speed(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unit *u;
curse_unit * cu;
@ -166,7 +166,7 @@ cinfo_speed(const struct locale * lang, void * obj, enum typ_t typ, struct curse
}
/* C_ORC */
static int
cinfo_orc(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_orc(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unit *u;
message * msg;
@ -186,7 +186,7 @@ cinfo_orc(const struct locale * lang, void * obj, enum typ_t typ, struct curse *
/* C_KAELTESCHUTZ */
static int
cinfo_kaelteschutz(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_kaelteschutz(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unit *u;
curse_unit * cu;
@ -208,7 +208,7 @@ cinfo_kaelteschutz(const struct locale * lang, void * obj, enum typ_t typ, struc
/* C_SPARKLE */
static int
cinfo_sparkle(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_sparkle(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
const char * effects[] = {
NULL, /* end grau*/
@ -263,7 +263,7 @@ cinfo_sparkle(const struct locale * lang, void * obj, enum typ_t typ, struct cur
/* C_STRENGTH */
static int
cinfo_strength(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_strength(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unused(c);
unused(typ);
@ -280,7 +280,7 @@ cinfo_strength(const struct locale * lang, void * obj, enum typ_t typ, struct cu
}
/* C_ALLSKILLS */
static int
cinfo_allskills(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_allskills(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unused(obj);
unused(typ);
@ -296,7 +296,7 @@ cinfo_allskills(const struct locale * lang, void * obj, enum typ_t typ, struct c
}
/* C_SKILL */
static int
cinfo_skill(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_skill(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unit *u = (unit *)obj;
int sk = (int)c->data;
@ -312,7 +312,7 @@ cinfo_skill(const struct locale * lang, void * obj, enum typ_t typ, struct curse
}
/* C_ITEMCLOAK */
static int
cinfo_itemcloak(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_itemcloak(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unit *u;
unused(typ);
@ -329,7 +329,7 @@ cinfo_itemcloak(const struct locale * lang, void * obj, enum typ_t typ, struct c
}
static int
cinfo_fumble(const struct locale * lang, void * obj, enum typ_t typ, struct curse *c, int self)
cinfo_fumble(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self)
{
unit * u = (unit*)obj;
unused(typ);
@ -348,18 +348,17 @@ cinfo_fumble(const struct locale * lang, void * obj, enum typ_t typ, struct curs
void
register_unitcurse(void)
{
register_function((pf_generic)cinfo_unit, "cinfo::unit");
register_function((pf_generic)cinfo_unit_onlyowner, "cinfo::unit_onlyowner");
register_function((pf_generic)cinfo_auraboost, "cinfo::auraboost");
register_function((pf_generic)cinfo_slave, "cinfo::slave");
register_function((pf_generic)cinfo_calm, "cinfo::calm");
register_function((pf_generic)cinfo_speed, "cinfo::speed");
register_function((pf_generic)cinfo_orc, "cinfo::orc");
register_function((pf_generic)cinfo_kaelteschutz, "cinfo::kaelteschutz");
register_function((pf_generic)cinfo_sparkle, "cinfo::sparkle");
register_function((pf_generic)cinfo_strength, "cinfo::strength");
register_function((pf_generic)cinfo_allskills, "cinfo::allskills");
register_function((pf_generic)cinfo_skill, "cinfo::skill");
register_function((pf_generic)cinfo_itemcloak, "cinfo::itemcloak");
register_function((pf_generic)cinfo_fumble, "cinfo::fumble");
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");
}

View File

@ -33,7 +33,9 @@ int cinfo_skill(void *, enum typ_t, struct curse *, int);
int cinfo_itemcloak(void *, enum typ_t, struct curse *, int);
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 void register_unitcurse(void);
#endif /* _UCURSE_H */