switch source tree from k&r to c99
This commit is contained in:
53
src/steed.c
53
src/steed.c
@@ -9,12 +9,12 @@ static NEARDATA const char steeds[] = { S_QUADRUPED, S_UNICORN, S_ANGEL,
|
||||
S_CENTAUR, S_DRAGON, S_JABBERWOCK,
|
||||
'\0' };
|
||||
|
||||
static boolean FDECL(landing_spot, (coord *, int, int));
|
||||
static void FDECL(maybewakesteed, (struct monst *));
|
||||
static boolean landing_spot(coord *, int, int);
|
||||
static void maybewakesteed(struct monst *);
|
||||
|
||||
/* caller has decided that hero can't reach something while mounted */
|
||||
void
|
||||
rider_cant_reach()
|
||||
rider_cant_reach(void)
|
||||
{
|
||||
You("aren't skilled enough to reach from %s.", y_monnam(u.usteed));
|
||||
}
|
||||
@@ -23,8 +23,7 @@ rider_cant_reach()
|
||||
|
||||
/* Can this monster wear a saddle? */
|
||||
boolean
|
||||
can_saddle(mtmp)
|
||||
struct monst *mtmp;
|
||||
can_saddle(struct monst* mtmp)
|
||||
{
|
||||
struct permonst *ptr = mtmp->data;
|
||||
|
||||
@@ -34,8 +33,7 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
int
|
||||
use_saddle(otmp)
|
||||
struct obj *otmp;
|
||||
use_saddle(struct obj* otmp)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
struct permonst *ptr;
|
||||
@@ -139,9 +137,7 @@ struct obj *otmp;
|
||||
}
|
||||
|
||||
void
|
||||
put_saddle_on_mon(saddle, mtmp)
|
||||
struct obj *saddle;
|
||||
struct monst *mtmp;
|
||||
put_saddle_on_mon(struct obj* saddle, struct monst* mtmp)
|
||||
{
|
||||
if (!can_saddle(mtmp) || which_armor(mtmp, W_SADDLE))
|
||||
return;
|
||||
@@ -157,8 +153,7 @@ struct monst *mtmp;
|
||||
|
||||
/* Can we ride this monster? Caller should also check can_saddle() */
|
||||
boolean
|
||||
can_ride(mtmp)
|
||||
struct monst *mtmp;
|
||||
can_ride(struct monst* mtmp)
|
||||
{
|
||||
return (mtmp->mtame && humanoid(g.youmonst.data)
|
||||
&& !verysmall(g.youmonst.data) && !bigmonst(g.youmonst.data)
|
||||
@@ -166,7 +161,7 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
int
|
||||
doride()
|
||||
doride(void)
|
||||
{
|
||||
boolean forcemount = FALSE;
|
||||
|
||||
@@ -184,9 +179,9 @@ doride()
|
||||
|
||||
/* Start riding, with the given monster */
|
||||
boolean
|
||||
mount_steed(mtmp, force)
|
||||
struct monst *mtmp; /* The animal */
|
||||
boolean force; /* Quietly force this animal */
|
||||
mount_steed(
|
||||
struct monst *mtmp, /* The animal */
|
||||
boolean force) /* Quietly force this animal */
|
||||
{
|
||||
struct obj *otmp;
|
||||
char buf[BUFSZ];
|
||||
@@ -363,7 +358,7 @@ boolean force; /* Quietly force this animal */
|
||||
|
||||
/* You and your steed have moved */
|
||||
void
|
||||
exercise_steed()
|
||||
exercise_steed(void)
|
||||
{
|
||||
if (!u.usteed)
|
||||
return;
|
||||
@@ -378,7 +373,7 @@ exercise_steed()
|
||||
|
||||
/* The player kicks or whips the steed */
|
||||
void
|
||||
kick_steed()
|
||||
kick_steed(void)
|
||||
{
|
||||
char He[BUFSZ]; /* monverbself() appends to the "He"/"She"/"It" value */
|
||||
if (!u.usteed)
|
||||
@@ -436,10 +431,10 @@ kick_steed()
|
||||
* Adapted from mail daemon code.
|
||||
*/
|
||||
static boolean
|
||||
landing_spot(spot, reason, forceit)
|
||||
coord *spot; /* landing position (we fill it in) */
|
||||
int reason;
|
||||
int forceit;
|
||||
landing_spot(
|
||||
coord *spot, /* landing position (we fill it in) */
|
||||
int reason,
|
||||
int forceit)
|
||||
{
|
||||
int i = 0, x, y, distance, min_distance = -1;
|
||||
boolean found = FALSE;
|
||||
@@ -482,8 +477,8 @@ int forceit;
|
||||
|
||||
/* Stop riding the current steed */
|
||||
void
|
||||
dismount_steed(reason)
|
||||
int reason; /* Player was thrown off etc. */
|
||||
dismount_steed(
|
||||
int reason) /* Player was thrown off etc. */
|
||||
{
|
||||
struct monst *mtmp;
|
||||
struct obj *otmp;
|
||||
@@ -698,8 +693,7 @@ int reason; /* Player was thrown off etc. */
|
||||
/* when attempting to saddle or mount a sleeping steed, try to wake it up
|
||||
(for the saddling case, it won't be u.usteed yet) */
|
||||
static void
|
||||
maybewakesteed(steed)
|
||||
struct monst *steed;
|
||||
maybewakesteed(struct monst* steed)
|
||||
{
|
||||
int frozen = (int) steed->mfrozen;
|
||||
boolean wasimmobile = steed->msleeping || !steed->mcanmove;
|
||||
@@ -725,8 +719,7 @@ struct monst *steed;
|
||||
/* decide whether hero's steed is able to move;
|
||||
doesn't check for holding traps--those affect the hero directly */
|
||||
boolean
|
||||
stucksteed(checkfeeding)
|
||||
boolean checkfeeding;
|
||||
stucksteed(boolean checkfeeding)
|
||||
{
|
||||
struct monst *steed = u.usteed;
|
||||
|
||||
@@ -746,9 +739,7 @@ boolean checkfeeding;
|
||||
}
|
||||
|
||||
void
|
||||
place_monster(mon, x, y)
|
||||
struct monst *mon;
|
||||
int x, y;
|
||||
place_monster(struct monst* mon, int x, int y)
|
||||
{
|
||||
struct monst *othermon;
|
||||
const char *monnm, *othnm;
|
||||
|
||||
Reference in New Issue
Block a user