server/src/common/kernel/skill.h

61 lines
2 KiB
C
Raw Normal View History

2001-01-25 10:37:55 +01:00
/* vi: set ts=2:
*
*
2001-01-25 10:37:55 +01:00
* 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 SKILL_H
#define SKILL_H
extern signed char skill_bonus(struct unit * u, struct region * r);
/* skillmod_data::flags -- wann gilt der modifier? */
#define SMF_ALWAYS (1<<0) /* immer */
#define SMF_PRODUCTION (1<<1) /* f<>r Produktion - am geb<65>ude, an der einheit */
#define SMF_RIDING (1<<2) /* Bonus f<>r berittene - an der rasse*/
2001-01-25 10:37:55 +01:00
typedef struct skill {
unsigned char id;
unsigned char level;
2002-02-23 17:18:26 +01:00
unsigned char weeks;
unsigned char old;
} skill;
2001-01-25 10:37:55 +01:00
typedef struct skillmod_data {
skill_t skill;
int (*special)(const struct unit * u, const struct region * r, skill_t sk, int value);
double multiplier;
2001-01-25 10:37:55 +01:00
int bonus;
int flags;
} skillmod_data;
extern attrib_type at_skillmod;
extern int rc_skillmod(const struct race * rc, const struct region *r, skill_t sk);
2001-01-25 10:37:55 +01:00
extern int skillmod(const attrib * a, const struct unit * u, const struct region * r, skill_t sk, int value, int flags);
extern void skill_init(void);
extern void skill_done(void);
extern struct attrib * make_skillmod(skill_t sk, unsigned int flags, int(*special)(const struct unit*, const struct region*, skill_t, int), double multiplier, int bonus);
2001-01-25 10:37:55 +01:00
extern const char * skillname(skill_t, const struct locale *);
extern skill_t sk_find(const char * name);
extern int level_days(int level);
extern int level(int days);
#define skill_level(level) (level)
2002-02-22 20:41:20 +01:00
extern void reduce_skill(struct unit *u, skill * sv, int change);
2002-02-23 17:18:26 +01:00
extern int skill_weeks(int level);
extern int skill_compare(const skill * sk, const skill * sc);
2002-02-23 17:18:26 +01:00
extern void sk_set(skill * sv, int level);
2001-01-25 10:37:55 +01:00
#endif