diff options
Diffstat (limited to 'games/rogue/monster.c')
-rw-r--r-- | games/rogue/monster.c | 100 |
1 files changed, 60 insertions, 40 deletions
diff --git a/games/rogue/monster.c b/games/rogue/monster.c index 968e153d284..b634a1eb6f2 100644 --- a/games/rogue/monster.c +++ b/games/rogue/monster.c @@ -1,3 +1,4 @@ +/* $OpenBSD: monster.c,v 1.3 1998/08/22 08:55:34 pjanzen Exp $ */ /* $NetBSD: monster.c,v 1.3 1995/04/22 10:27:45 cgd Exp $ */ /* @@ -40,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)monster.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: monster.c,v 1.3 1995/04/22 10:27:45 cgd Exp $"; +static char rcsid[] = "$OpenBSD: monster.c,v 1.3 1998/08/22 08:55:34 pjanzen Exp $"; #endif #endif /* not lint */ @@ -52,7 +53,7 @@ static char rcsid[] = "$NetBSD: monster.c,v 1.3 1995/04/22 10:27:45 cgd Exp $"; * 1.) No portion of this notice shall be removed. * 2.) Credit shall not be taken for the creation of this source. * 3.) This code is not to be traded, sold, or used for personal - * gain or profit. + * gain or profit. * */ @@ -123,12 +124,7 @@ object mon_tab[MONSTERS] = { {(ASLEEP|WAKENS|WANDERS),"1d7",21,'Z',8,5,14,69,0,0,0,0,0} }; -extern short cur_level; -extern short cur_room, party_room; -extern short blind, halluc, haste_self; -extern boolean detect_monster, see_invisible, r_see_invisible; -extern short stealthy; - +void put_mons() { short i; @@ -150,8 +146,8 @@ put_mons() object * gr_monster(monster, mn) -register object *monster; -register mn; + object *monster; + int mn; { if (!monster) { monster = alloc_object(); @@ -175,9 +171,10 @@ register mn; return(monster); } +void mv_mons() { - register object *monster, *next_monster; + object *monster, *next_monster; boolean flew; if (haste_self % 2) { @@ -220,8 +217,9 @@ NM: monster = next_monster; } } +void party_monsters(rn, n) -int rn, n; + int rn, n; { short i, j; short row, col; @@ -260,12 +258,13 @@ int rn, n; } } +char gmc_row_col(row, col) -register row, col; + short row, col; { - register object *monster; + object *monster; - if (monster = object_at(&level_monsters, row, col)) { + if ((monster = object_at(&level_monsters, row, col))) { if ((!(detect_monster || see_invisible || r_see_invisible) && (monster->m_flags & INVISIBLE)) || blind) { return(monster->trail_char); @@ -279,8 +278,9 @@ register row, col; } } +char gmc(monster) -object *monster; + object *monster; { if ((!(detect_monster || see_invisible || r_see_invisible) && (monster->m_flags & INVISIBLE)) @@ -293,9 +293,10 @@ object *monster; return(monster->m_char); } +void mv_1_monster(monster, row, col) -register object *monster; -short row, col; + object *monster; + short row, col; { short i, n; boolean tried[6]; @@ -432,9 +433,10 @@ O: } } +int mtry(monster, row, col) -register object *monster; -register short row, col; + object *monster; + short row, col; { if (mon_can_go(monster, row, col)) { move_mon_to(monster, row, col); @@ -443,12 +445,13 @@ register short row, col; return(0); } +void move_mon_to(monster, row, col) -register object *monster; -register short row, col; + object *monster; + short row, col; { short c; - register mrow, mcol; + short mrow, mcol; mrow = monster->row; mcol = monster->col; @@ -493,9 +496,10 @@ register short row, col; } } +int mon_can_go(monster, row, col) -register object *monster; -register short row, col; + object *monster; + short row, col; { object *obj; short dr, dc; @@ -534,18 +538,20 @@ register short row, col; return(1); } +void wake_up(monster) -object *monster; + object *monster; { if (!(monster->m_flags & NAPPING)) { monster->m_flags &= (~(ASLEEP | IMITATES | WAKENS)); } } +void wake_room(rn, entering, row, col) -short rn; -boolean entering; -short row, col; + short rn; + boolean entering; + short row, col; { object *monster; short wake_percent; @@ -580,7 +586,7 @@ short row, col; char * mon_name(monster) -object *monster; + object *monster; { short ch; @@ -596,8 +602,9 @@ object *monster; return(m_names[ch]); } +int rogue_is_around(row, col) -register row, col; + short row, col; { short rdif, cdif, retval; @@ -608,6 +615,7 @@ register row, col; return(retval); } +void wanderer() { object *monster; @@ -638,6 +646,7 @@ wanderer() } } +void show_monsters() { object *monster; @@ -659,6 +668,7 @@ show_monsters() } } +void create_monster() { short row, col; @@ -694,9 +704,10 @@ create_monster() } } +void put_m_at(row, col, monster) -short row, col; -object *monster; + short row, col; + object *monster; { monster->row = row; monster->col = col; @@ -706,8 +717,9 @@ object *monster; aim_monster(monster); } +void aim_monster(monster) -object *monster; + object *monster; { short i, rn, d, r; @@ -724,10 +736,11 @@ object *monster; } } +int rogue_can_see(row, col) -register row, col; + short row, col; { - register retval; + int retval; retval = !blind && (((get_room_number(row, col) == cur_room) && @@ -737,8 +750,9 @@ register row, col; return(retval); } +int move_confused(monster) -object *monster; + object *monster; { short i, row, col; @@ -767,8 +781,9 @@ object *monster; return(0); } +int flit(monster) -object *monster; + object *monster; { short i, row, col; @@ -793,6 +808,7 @@ object *monster; return(1); } +char gr_obj_char() { short r; @@ -803,8 +819,9 @@ gr_obj_char() return(rs[r]); } +int no_room_for_monster(rn) -int rn; + int rn; { short i, j; @@ -818,6 +835,7 @@ int rn; return(1); } +void aggravate() { object *monster; @@ -838,7 +856,8 @@ aggravate() boolean mon_sees(monster, row, col) -object *monster; + object *monster; + short row, col; { short rn, rdif, cdif, retval; @@ -856,6 +875,7 @@ object *monster; return(retval); } +void mv_aquatars() { object *monster; |