2001-01-25 10:37:55 +01:00
|
|
|
|
/* vi: set ts=2:
|
2003-07-29 11:48:03 +02:00
|
|
|
|
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
|
|
|
|
|
| | Enno Rehling <enno@eressea-pbem.de>
|
|
|
|
|
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
|
|
|
|
|
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
|
|
|
|
|
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
|
|
|
|
|
+-------------------+ Stefan Reich <reich@halbling.de>
|
|
|
|
|
|
|
|
|
|
This program may not be used, modified or distributed
|
|
|
|
|
without prior permission by the authors of Eressea.
|
2001-01-25 10:37:55 +01:00
|
|
|
|
*/
|
|
|
|
|
|
2003-07-29 11:48:03 +02:00
|
|
|
|
#ifndef H_KRNL_SKILL
|
|
|
|
|
#define H_KRNL_SKILL
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
extern signed char skill_bonus(struct unit * u, struct region * r);
|
|
|
|
|
|
|
|
|
|
/* skillmod_data::flags -- wann gilt der modifier? */
|
2001-02-03 14:45:35 +01:00
|
|
|
|
#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
|
|
|
|
|
2002-02-15 17:13:30 +01:00
|
|
|
|
typedef struct skill {
|
|
|
|
|
unsigned char id;
|
2002-10-08 08:46:03 +02:00
|
|
|
|
unsigned int level : 8;
|
|
|
|
|
unsigned int weeks : 8;
|
|
|
|
|
unsigned int old : 8;
|
2002-02-15 17:13:30 +01:00
|
|
|
|
} skill;
|
|
|
|
|
|
2004-06-11 21:59:02 +02:00
|
|
|
|
typedef int (*skillmod_fun)(const struct unit*, const struct region*, skill_t, int);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
typedef struct skillmod_data {
|
2001-02-03 14:45:35 +01:00
|
|
|
|
skill_t skill;
|
2004-06-11 21:59:02 +02:00
|
|
|
|
skillmod_fun special;
|
2001-02-03 14:45:35 +01:00
|
|
|
|
double multiplier;
|
2002-11-27 20:35:36 +01:00
|
|
|
|
int number;
|
2001-01-25 10:37:55 +01:00
|
|
|
|
int bonus;
|
|
|
|
|
int flags;
|
|
|
|
|
} skillmod_data;
|
|
|
|
|
extern attrib_type at_skillmod;
|
2002-02-15 17:13:30 +01:00
|
|
|
|
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);
|
2004-06-11 21:59:02 +02:00
|
|
|
|
extern struct attrib * make_skillmod(skill_t sk, unsigned int flags, skillmod_fun special, double multiplier, int bonus);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2001-04-16 16:34:19 +02:00
|
|
|
|
extern const char * skillname(skill_t, const struct locale *);
|
2001-12-10 01:13:39 +01:00
|
|
|
|
extern skill_t sk_find(const char * name);
|
2001-04-16 16:34:19 +02:00
|
|
|
|
|
2001-12-10 01:13:39 +01:00
|
|
|
|
extern int level_days(int level);
|
2002-02-16 11:37:18 +01:00
|
|
|
|
extern int level(int days);
|
2002-02-15 17:13:30 +01:00
|
|
|
|
|
2002-03-11 22:20:31 +01:00
|
|
|
|
#define skill_level(level) (level)
|
2002-10-08 08:46:03 +02:00
|
|
|
|
extern void reduce_skill(struct unit *u, skill * sv, unsigned int change);
|
2002-02-23 17:18:26 +01:00
|
|
|
|
extern int skill_weeks(int level);
|
2002-02-15 17:13:30 +01:00
|
|
|
|
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);
|
2002-02-15 17:13:30 +01:00
|
|
|
|
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2003-07-29 11:48:03 +02:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2001-01-25 10:37:55 +01:00
|
|
|
|
#endif
|