-/* $NetBSD: fight.c,v 1.3 1997/10/13 02:18:12 lukem Exp $ */
+/* $NetBSD: fight.c,v 1.7 2000/04/27 00:30:53 jdc Exp $ */
/*
* fight.c Phantasia monster fighting routines
mvaddstr(7, 0, "1:Melee 2:Skirmish 3:Evade 4:Spell 5:Nick ");
- if (!Luckout)
+ if (!Luckout) {
/* haven't tried to luckout yet */
if (Curmonster.m_type == SM_MORGOTH)
/* cannot luckout against Morgoth */
addstr("6:Ally ");
else
addstr("6:Luckout ");
+ }
if (Player.p_ring.ring_type != R_NONE)
/* player has a ring */
/* takes some of the player's strength */
inflict = ROLL(1.0, (Circle - 1.0) / 2.0);
inflict = MIN(Player.p_strength, inflict);
- mvprintw(Lines++, 0, "%s sapped %0.f of your strength!",
+ mvprintw(Lines++, 0, "%s sapped %.0f of your strength!",
Enemyname, inflict);
Player.p_strength -= inflict;
Player.p_might -= inflict;
mvprintw(Lines++, 0,
"%s flew away, and left you to contend with one of its friends.",
Enemyname);
- Whichmonster = 55 + (drandom() > 0.5) ? 22 : 0;
+ Whichmonster = 55 + ((drandom() > 0.5) ? 22 : 0);
longjmp(Fightenv, 0);
/* NOTREACHED */
which = MIN(which, 99); /* make sure within range */
/* fill structure */
- fseek(Monstfp, (long) which * (long) SZ_MONSTERSTRUCT, 0);
+ fseek(Monstfp, (long) which * (long) SZ_MONSTERSTRUCT, SEEK_SET);
fread((char *) &Curmonster, SZ_MONSTERSTRUCT, 1, Monstfp);
/* handle some special monsters */
Curmonster.m_energy = Player.p_might * 30.0;
Curmonster.m_type = SM_MORGOTH;
Curmonster.m_speed = Player.p_speed * 1.1
- + (Player.p_specialtype == SC_EXVALAR) ? Player.p_speed : 0.0;
+ + ((Player.p_specialtype == SC_EXVALAR) ? Player.p_speed : 0.0);
Curmonster.m_flock = 0.0;
Curmonster.m_treasuretype = 0;
Curmonster.m_experience = 0.0;
/* pick another name */
{
which = (int) ROLL(0.0, 100.0);
- fseek(Monstfp, (long) which * (long) SZ_MONSTERSTRUCT, 0);
+ fseek(Monstfp, (long) which * (long) SZ_MONSTERSTRUCT, SEEK_SET);
fread(&Othermonster, SZ_MONSTERSTRUCT, 1, Monstfp);
strcpy(Curmonster.m_name, Othermonster.m_name);
}
ch = getanswer("NY", FALSE);
addstr("\n\n");
- if (ch == 'Y')
+ if (ch == 'Y') {
if (drandom() < treasuretype / 35.0 + 0.04)
/* cursed */
{
cursedtreasure();
} else
collecttaxes(gold, gems);
+ }
return;
} else