server/src/kernel/skills.h

73 lines
2.2 KiB
C
Raw Normal View History

/*
2010-08-08 10:06:34 +02:00
+-------------------+ 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
#include <skill.h>
2010-08-08 10:06:34 +02:00
#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
typedef struct skill {
#ifdef LOMEM
int id:8;
unsigned int level:8;
unsigned int weeks:8;
unsigned int old:8;
#else
int id;
unsigned int level;
unsigned int weeks;
unsigned int old;
#endif
} skill;
2010-08-08 10:06:34 +02: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
extern int level_days(int level);
extern int level(int days);
2010-08-08 10:06:34 +02:00
#define skill_level(level) (level)
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
extern void sk_set(skill * sv, int level);
2010-08-08 10:06:34 +02:00
#ifdef __cplusplus
}
#endif
#endif