2010-08-08 10:06:34 +02:00
|
|
|
|
/* vi: set ts=2:
|
|
|
|
|
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
|
|
|
|
|
| | Enno Rehling <enno@eressea.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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef H_KRNL_SKILL
|
|
|
|
|
#define H_KRNL_SKILL
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* skillmod_data::flags -- wann gilt der modifier? */
|
2011-03-07 08:02: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 */
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
|
typedef struct skill {
|
2011-03-08 07:31:06 +01:00
|
|
|
|
int id:8;
|
2011-03-07 08:02:35 +01:00
|
|
|
|
unsigned int level:8;
|
|
|
|
|
unsigned int weeks:8;
|
|
|
|
|
unsigned int old:8;
|
|
|
|
|
} skill;
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
|
typedef int (*skillmod_fun) (const struct unit *, const struct region *,
|
|
|
|
|
skill_t, int);
|
|
|
|
|
typedef struct skillmod_data {
|
|
|
|
|
skill_t skill;
|
|
|
|
|
skillmod_fun special;
|
|
|
|
|
double multiplier;
|
|
|
|
|
int number;
|
|
|
|
|
int bonus;
|
|
|
|
|
int flags;
|
|
|
|
|
} skillmod_data;
|
|
|
|
|
extern struct attrib_type at_skillmod;
|
|
|
|
|
extern int rc_skillmod(const struct race *rc, const struct region *r,
|
|
|
|
|
skill_t sk);
|
|
|
|
|
extern int skillmod(const struct attrib *a, const struct unit *u,
|
|
|
|
|
const struct region *r, skill_t sk, int value, int flags);
|
|
|
|
|
extern struct attrib *make_skillmod(skill_t sk, unsigned int flags,
|
|
|
|
|
skillmod_fun special, double multiplier, int bonus);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
|
extern const char *skillname(skill_t, const struct locale *);
|
|
|
|
|
extern skill_t sk_find(const char *name);
|
2012-06-24 07:41:07 +02:00
|
|
|
|
extern void enable_skill(const char *name, bool value);
|
2011-03-07 08:02:35 +01:00
|
|
|
|
extern int level_days(int level);
|
|
|
|
|
extern int level(int days);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
|
|
#define skill_level(level) (level)
|
2011-03-07 08:02:35 +01:00
|
|
|
|
extern void reduce_skill(struct unit *u, skill * sv, unsigned int change);
|
|
|
|
|
extern int skill_weeks(int level);
|
|
|
|
|
extern int skill_compare(const skill * sk, const skill * sc);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
|
extern void sk_set(skill * sv, int level);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
|
extern const char *skillnames[];
|
2012-06-24 07:41:07 +02:00
|
|
|
|
extern bool skill_enabled[];
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|