2001-01-25 10:37:55 +01:00
|
|
|
|
/* vi: set ts=2:
|
|
|
|
|
*
|
2001-04-14 13:39:14 +02:00
|
|
|
|
*
|
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? */
|
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;
|
|
|
|
|
unsigned char level;
|
2002-02-23 17:18:26 +01:00
|
|
|
|
unsigned char weeks;
|
2002-02-23 20:04:51 +01:00
|
|
|
|
unsigned char old;
|
2002-02-15 17:13:30 +01:00
|
|
|
|
} skill;
|
|
|
|
|
|
2001-01-25 10:37:55 +01:00
|
|
|
|
typedef struct skillmod_data {
|
2001-02-03 14:45:35 +01:00
|
|
|
|
skill_t skill;
|
2002-02-15 17:13:30 +01:00
|
|
|
|
int (*special)(const struct unit * u, const struct region * r, skill_t sk, int value);
|
2001-02-03 14:45:35 +01:00
|
|
|
|
double multiplier;
|
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);
|
2002-02-15 17:13:30 +01:00
|
|
|
|
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
|
|
|
|
|
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-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);
|
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
|
|
|
|
|
|
|
|
|
#endif
|