XRogue: convert to ANSI-style function declarations.
This commit is contained in:
parent
e8e6e604c3
commit
2853120387
41 changed files with 1281 additions and 908 deletions
|
|
@ -24,12 +24,20 @@
|
|||
int mf_count = 0; /* move_free counter - see actions.c(m_act()) */
|
||||
int mf_jmpcnt = 0; /* move_free counter for # of jumps */
|
||||
|
||||
void m_breathe(struct thing *tp);
|
||||
void m_select(struct thing *th, bool flee);
|
||||
void m_sonic(struct thing *tp);
|
||||
void m_spell(struct thing *tp);
|
||||
void m_summon(struct thing *tp);
|
||||
bool m_use_it(struct thing *tp, bool flee, struct room *rer, struct room *ree);
|
||||
bool m_use_pack(struct thing *monster, coord *defend_pos, int dist,
|
||||
coord *shoot_dir);
|
||||
|
||||
/*
|
||||
* Did we disrupt a spell?
|
||||
*/
|
||||
dsrpt_monster(tp, always, see_him)
|
||||
register struct thing *tp;
|
||||
bool always, see_him;
|
||||
void
|
||||
dsrpt_monster(struct thing *tp, bool always, bool see_him)
|
||||
{
|
||||
switch (tp->t_action) {
|
||||
case A_SUMMON:
|
||||
|
|
@ -58,7 +66,8 @@ bool always, see_him;
|
|||
}
|
||||
}
|
||||
|
||||
dsrpt_player()
|
||||
void
|
||||
dsrpt_player(void)
|
||||
{
|
||||
int which, action;
|
||||
struct linked_list *item;
|
||||
|
|
@ -87,7 +96,7 @@ dsrpt_player()
|
|||
if (purse > 0) {
|
||||
msg("Your gold goes flying everywhere!");
|
||||
do {
|
||||
item = spec_item(GOLD, NULL, NULL, NULL);
|
||||
item = spec_item(GOLD, 0, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_count = min(purse, rnd(20)+1);
|
||||
purse -= obj->o_count;
|
||||
|
|
@ -125,8 +134,8 @@ dsrpt_player()
|
|||
* Otherwise, let it perform its chosen action.
|
||||
*/
|
||||
|
||||
m_act(tp)
|
||||
register struct thing *tp;
|
||||
void
|
||||
m_act(struct thing *tp)
|
||||
{
|
||||
struct object *obj;
|
||||
bool flee; /* Are we scared? */
|
||||
|
|
@ -290,8 +299,8 @@ register struct thing *tp;
|
|||
* Breathe in the chosen direction.
|
||||
*/
|
||||
|
||||
m_breathe(tp)
|
||||
register struct thing *tp;
|
||||
void
|
||||
m_breathe(struct thing *tp)
|
||||
{
|
||||
register int damage;
|
||||
register char *breath = NULL;
|
||||
|
|
@ -399,11 +408,11 @@ register struct thing *tp;
|
|||
/*
|
||||
* m_select:
|
||||
* Select an action for the monster.
|
||||
* flee: True if running away or player is inaccessible in wall
|
||||
*/
|
||||
|
||||
m_select(th, flee)
|
||||
register struct thing *th;
|
||||
register bool flee; /* True if running away or player is inaccessible in wall */
|
||||
void
|
||||
m_select(struct thing *th, bool flee)
|
||||
{
|
||||
register struct room *rer, *ree; /* room of chaser, room of chasee */
|
||||
int dist = INT_MIN;
|
||||
|
|
@ -541,8 +550,8 @@ register bool flee; /* True if running away or player is inaccessible in wall */
|
|||
* The monster is sounding a sonic blast.
|
||||
*/
|
||||
|
||||
m_sonic(tp)
|
||||
register struct thing *tp;
|
||||
void
|
||||
m_sonic(struct thing *tp)
|
||||
{
|
||||
register int damage;
|
||||
struct object blast =
|
||||
|
|
@ -571,8 +580,8 @@ register struct thing *tp;
|
|||
* The monster casts a spell. Currently this is limited to
|
||||
* magic missile.
|
||||
*/
|
||||
m_spell(tp)
|
||||
register struct thing *tp;
|
||||
void
|
||||
m_spell(struct thing *tp)
|
||||
{
|
||||
struct object missile =
|
||||
{
|
||||
|
|
@ -594,8 +603,8 @@ register struct thing *tp;
|
|||
* Summon aid.
|
||||
*/
|
||||
|
||||
m_summon(tp)
|
||||
register struct thing *tp;
|
||||
void
|
||||
m_summon(struct thing *tp)
|
||||
{
|
||||
register char *helpname, *mname;
|
||||
int fail, numsum;
|
||||
|
|
@ -668,10 +677,7 @@ register struct thing *tp;
|
|||
*/
|
||||
|
||||
bool
|
||||
m_use_it(tp, flee, rer, ree)
|
||||
register struct thing *tp;
|
||||
bool flee;
|
||||
register struct room *rer, *ree;
|
||||
m_use_it(struct thing *tp, bool flee, struct room *rer, struct room *ree)
|
||||
{
|
||||
int dist;
|
||||
register coord *ee = tp->t_dest, *er = &tp->t_pos;
|
||||
|
|
@ -836,7 +842,8 @@ register struct room *rer, *ree;
|
|||
|
||||
}
|
||||
|
||||
reap()
|
||||
void
|
||||
reap(void)
|
||||
{
|
||||
_t_free_list(&rlist);
|
||||
}
|
||||
|
|
@ -844,10 +851,11 @@ reap()
|
|||
/*
|
||||
* runners:
|
||||
* Make all the awake monsters try to do something.
|
||||
* segments: Number of segments since last called
|
||||
*/
|
||||
|
||||
runners(segments)
|
||||
int segments; /* Number of segments since last called */
|
||||
int
|
||||
runners(int segments)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct thing *tp = NULL;
|
||||
|
|
@ -961,11 +969,7 @@ int segments; /* Number of segments since last called */
|
|||
* Only care about relics and wands for now.
|
||||
*/
|
||||
bool
|
||||
m_use_pack(monster, defend_pos, dist, shoot_dir)
|
||||
register struct thing *monster;
|
||||
coord *defend_pos;
|
||||
register int dist;
|
||||
register coord *shoot_dir;
|
||||
m_use_pack(struct thing *monster, coord *defend_pos, int dist, coord *shoot_dir)
|
||||
{
|
||||
register struct object *obj;
|
||||
register struct linked_list *pitem, *relic, *stick;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue