2010-08-08 10:06:34 +02:00
|
|
|
#ifndef H_KRNL_STUDY
|
|
|
|
#define H_KRNL_STUDY
|
|
|
|
|
2014-06-21 08:59:04 +02:00
|
|
|
#include "skill.h"
|
2015-07-09 13:24:21 +02:00
|
|
|
#include <kernel/types.h>
|
2014-06-21 08:59:04 +02:00
|
|
|
|
2010-08-08 10:06:34 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-03-09 23:20:05 +01:00
|
|
|
struct unit;
|
2017-01-26 18:58:29 +01:00
|
|
|
struct selist;
|
2016-03-09 23:20:05 +01:00
|
|
|
|
2018-09-09 15:13:20 +02:00
|
|
|
#define STUDYDAYS 30
|
|
|
|
#define TEACHNUMBER 10
|
2018-09-09 17:10:18 +02:00
|
|
|
#define TEACHDIFFERENCE 2
|
2018-09-09 15:13:20 +02:00
|
|
|
|
|
|
|
typedef struct teaching_info {
|
|
|
|
struct selist *teachers;
|
|
|
|
int students;
|
|
|
|
int days;
|
|
|
|
} teaching_info;
|
|
|
|
|
|
|
|
extern const struct attrib_type at_learning;
|
|
|
|
|
2016-03-08 14:09:22 +01:00
|
|
|
int teach_cmd(struct unit *u, struct order *ord);
|
|
|
|
int study_cmd(struct unit *u, struct order *ord);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2016-03-08 14:09:22 +01:00
|
|
|
magic_t getmagicskill(const struct locale *lang);
|
2018-07-05 20:06:32 +02:00
|
|
|
skill_t getskill(const struct locale *lang);
|
2016-03-08 14:09:22 +01:00
|
|
|
bool is_migrant(struct unit *u);
|
2018-09-09 15:13:20 +02:00
|
|
|
int study_cost(struct unit *u, skill_t sk);
|
2018-10-28 21:27:24 +01:00
|
|
|
bool check_student(const struct unit *u, struct order *ord, skill_t sk);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2016-03-23 11:56:17 +01:00
|
|
|
typedef void(*learn_fun)(struct unit *u, skill_t sk, int days);
|
2016-03-12 14:52:33 +01:00
|
|
|
|
|
|
|
void learn_skill(struct unit *u, skill_t sk, int days);
|
2017-07-31 12:55:05 +02:00
|
|
|
void reduce_skill_days(struct unit *u, skill_t sk, int days);
|
2016-03-09 23:20:05 +01:00
|
|
|
|
2016-03-08 14:09:22 +01:00
|
|
|
void produceexp(struct unit *u, skill_t sk, int n);
|
2016-03-24 22:31:07 +01:00
|
|
|
void produceexp_ex(struct unit *u, skill_t sk, int n, learn_fun learn);
|
2016-03-12 14:52:33 +01:00
|
|
|
|
2016-03-13 13:31:54 +01:00
|
|
|
void demon_skillchange(struct unit *u);
|
|
|
|
|
2016-03-24 22:32:29 +01:00
|
|
|
void inject_learn(learn_fun fun);
|
2016-03-08 15:13:49 +01:00
|
|
|
|
2010-08-08 10:06:34 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|