forked from github/server
* buildingcurse kompiliert wieder.
* shipcurse kompiliert wieder. * enum-typedefs in ANSI-C sind scheisse. * includes aufgeräumt
This commit is contained in:
parent
1154ff6c2d
commit
2fb5713a2d
|
@ -28,12 +28,13 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -16,14 +16,16 @@
|
|||
#include "buildingcurse.h"
|
||||
|
||||
/* kernel includes */
|
||||
#include "message.h"
|
||||
#include "nrmessage.h"
|
||||
#include "objtypes.h"
|
||||
#include "curse.h"
|
||||
#include <message.h>
|
||||
#include <nrmessage.h>
|
||||
#include <objtypes.h>
|
||||
#include <building.h>
|
||||
#include <ship.h>
|
||||
#include <curse.h>
|
||||
|
||||
/* util includes */
|
||||
#include <kernel/message.h>
|
||||
#include <util/message.h>
|
||||
#include <base36.h>
|
||||
#include <functions.h>
|
||||
|
||||
/* libc includes */
|
||||
#include <string.h>
|
||||
|
@ -31,7 +33,7 @@
|
|||
#include <assert.h>
|
||||
|
||||
|
||||
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");
|
||||
}
|
|
@ -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 */
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <assert.h>
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <curse.h>
|
||||
|
||||
/* util includes */
|
||||
#include <message.h>
|
||||
#include <functions.h>
|
||||
#include <base36.h>
|
||||
|
||||
/* libc includes */
|
||||
|
@ -32,8 +32,8 @@
|
|||
#include <assert.h>
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue