forked from github/server
binding GUARD to lua
This commit is contained in:
parent
64a91a75a1
commit
59665de7ba
|
@ -43,6 +43,8 @@ function test_process()
|
||||||
assert_equal("function", _G.type(eressea.process.magic))
|
assert_equal("function", _G.type(eressea.process.magic))
|
||||||
assert_equal("function", _G.type(eressea.process.give_control))
|
assert_equal("function", _G.type(eressea.process.give_control))
|
||||||
assert_equal("function", _G.type(eressea.process.regeneration))
|
assert_equal("function", _G.type(eressea.process.regeneration))
|
||||||
|
assert_equal("function", _G.type(eressea.process.guard_on))
|
||||||
|
assert_equal("function", _G.type(eressea.process.guard_off))
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_settings()
|
function test_settings()
|
||||||
|
|
|
@ -229,3 +229,10 @@ function test_process_regeneration()
|
||||||
eressea.process.regeneration()
|
eressea.process.regeneration()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_process_guard_on()
|
||||||
|
eressea.process.guard_on()
|
||||||
|
end
|
||||||
|
|
||||||
|
function test_process_guard_off()
|
||||||
|
eressea.process.guard_off()
|
||||||
|
end
|
||||||
|
|
|
@ -211,6 +211,14 @@ void process_give_control(void) {
|
||||||
process_cmd(K_CONTACT, give_control_cmd, 0);
|
process_cmd(K_CONTACT, give_control_cmd, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void process_guard_on(void) {
|
||||||
|
process_cmd(K_GUARD, guard_on_cmd, PROC_LAND_REGION);
|
||||||
|
}
|
||||||
|
|
||||||
|
void process_guard_off(void) {
|
||||||
|
process_cmd(K_GUARD, guard_off_cmd, PROC_LAND_REGION);
|
||||||
|
}
|
||||||
|
|
||||||
void process_regeneration(void) {
|
void process_regeneration(void) {
|
||||||
monthly_healing();
|
monthly_healing();
|
||||||
regenerate_aura();
|
regenerate_aura();
|
||||||
|
|
|
@ -35,6 +35,8 @@ void process_enter(int final);
|
||||||
void process_magic(void);
|
void process_magic(void);
|
||||||
void process_give_control(void);
|
void process_give_control(void);
|
||||||
void process_regeneration(void);
|
void process_regeneration(void);
|
||||||
|
void process_guard_on(void);
|
||||||
|
void process_guard_off(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,5 +32,7 @@ module eressea {
|
||||||
void process_magic @ magic(void); /* CAST */
|
void process_magic @ magic(void); /* CAST */
|
||||||
void process_give_control @ give_control(void); /* GIVE CONTROL */
|
void process_give_control @ give_control(void); /* GIVE CONTROL */
|
||||||
void process_regeneration @ regeneration(void); /* regen health & aura */
|
void process_regeneration @ regeneration(void); /* regen health & aura */
|
||||||
|
void process_guard_on @ guard_on(void); /* GUARD */
|
||||||
|
void process_guard_off @ guard_off(void); /* GUARD NOT */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2769,7 +2769,7 @@ int origin_cmd(unit * u, struct order *ord)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int guard_off_cmd(unit * u, struct order *ord)
|
int guard_off_cmd(unit * u, struct order *ord)
|
||||||
{
|
{
|
||||||
assert(get_keyword(ord) == K_GUARD);
|
assert(get_keyword(ord) == K_GUARD);
|
||||||
init_tokens(ord);
|
init_tokens(ord);
|
||||||
|
@ -2930,7 +2930,7 @@ void update_guards(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int guard_on_cmd(unit * u, struct order *ord)
|
int guard_on_cmd(unit * u, struct order *ord)
|
||||||
{
|
{
|
||||||
assert(get_keyword(ord) == K_GUARD);
|
assert(get_keyword(ord) == K_GUARD);
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,8 @@ extern "C" {
|
||||||
extern int renumber_cmd(struct unit *u, struct order *ord);
|
extern int renumber_cmd(struct unit *u, struct order *ord);
|
||||||
extern int combatspell_cmd(struct unit *u, struct order *ord);
|
extern int combatspell_cmd(struct unit *u, struct order *ord);
|
||||||
extern int contact_cmd(struct unit *u, struct order *ord);
|
extern int contact_cmd(struct unit *u, struct order *ord);
|
||||||
|
extern int guard_on_cmd(struct unit *u, struct order *ord);
|
||||||
|
extern int guard_off_cmd(struct unit *u, struct order *ord);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue