forked from github/server
move chaosgate to borders.c
This commit is contained in:
parent
faefaf2523
commit
612cd1158a
40
src/spells.c
40
src/spells.c
|
@ -3116,46 +3116,6 @@ static int sp_summonshadowlords(castorder * co)
|
|||
return cast_level;
|
||||
}
|
||||
|
||||
static bool chaosgate_valid(const connection * b)
|
||||
{
|
||||
const attrib *a = a_find(b->from->attribs, &at_direction);
|
||||
if (!a)
|
||||
a = a_find(b->to->attribs, &at_direction);
|
||||
if (!a)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct region *chaosgate_move(const connection * b, struct unit *u,
|
||||
struct region *from, struct region *to, bool routing)
|
||||
{
|
||||
UNUSED_ARG(from);
|
||||
UNUSED_ARG(b);
|
||||
if (!routing) {
|
||||
int maxhp = u->hp / 4;
|
||||
if (maxhp < u->number)
|
||||
maxhp = u->number;
|
||||
u->hp = maxhp;
|
||||
}
|
||||
return to;
|
||||
}
|
||||
|
||||
border_type bt_chaosgate = {
|
||||
"chaosgate", VAR_NONE,
|
||||
b_transparent, /* transparent */
|
||||
NULL, /* init */
|
||||
NULL, /* destroy */
|
||||
NULL, /* read */
|
||||
NULL, /* write */
|
||||
b_blocknone, /* block */
|
||||
NULL, /* name */
|
||||
b_rinvisible, /* rvisible */
|
||||
b_finvisible, /* fvisible */
|
||||
b_uinvisible, /* uvisible */
|
||||
chaosgate_valid,
|
||||
chaosgate_move
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
/* Name: Chaossog
|
||||
* Stufe: 14
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <platform.h>
|
||||
|
||||
#include "borders.h"
|
||||
#include "vortex.h"
|
||||
|
||||
#include <kernel/connection.h>
|
||||
#include <kernel/curse.h>
|
||||
|
@ -198,6 +199,46 @@ border_type bt_wisps = { /* only here for reading old data */
|
|||
0
|
||||
};
|
||||
|
||||
static bool chaosgate_valid(const connection * b)
|
||||
{
|
||||
const attrib *a = a_find(b->from->attribs, &at_direction);
|
||||
if (!a)
|
||||
a = a_find(b->to->attribs, &at_direction);
|
||||
if (!a)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct region *chaosgate_move(const connection * b, struct unit *u,
|
||||
struct region *from, struct region *to, bool routing)
|
||||
{
|
||||
UNUSED_ARG(from);
|
||||
UNUSED_ARG(b);
|
||||
if (!routing) {
|
||||
int maxhp = u->hp / 4;
|
||||
if (maxhp < u->number)
|
||||
maxhp = u->number;
|
||||
u->hp = maxhp;
|
||||
}
|
||||
return to;
|
||||
}
|
||||
|
||||
border_type bt_chaosgate = {
|
||||
"chaosgate", VAR_NONE,
|
||||
b_transparent, /* transparent */
|
||||
NULL, /* init */
|
||||
NULL, /* destroy */
|
||||
NULL, /* read */
|
||||
NULL, /* write */
|
||||
b_blocknone, /* block */
|
||||
NULL, /* name */
|
||||
b_rinvisible, /* rvisible */
|
||||
b_finvisible, /* fvisible */
|
||||
b_uinvisible, /* uvisible */
|
||||
chaosgate_valid,
|
||||
chaosgate_move
|
||||
};
|
||||
|
||||
void register_borders(void)
|
||||
{
|
||||
border_convert_cb = &convert_firewall_timeouts;
|
||||
|
|
|
@ -15,6 +15,7 @@ extern "C" {
|
|||
**/
|
||||
extern struct border_type bt_chaosgate;
|
||||
extern struct border_type bt_firewall;
|
||||
extern const struct curse_type ct_firewall;
|
||||
|
||||
typedef struct wall_data {
|
||||
struct unit *mage;
|
||||
|
@ -23,7 +24,6 @@ extern "C" {
|
|||
int countdown;
|
||||
} wall_data;
|
||||
|
||||
extern const struct curse_type ct_firewall;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue