diff options
Diffstat (limited to 'games/rogue/spec_hit.c')
-rw-r--r-- | games/rogue/spec_hit.c | 75 |
1 files changed, 45 insertions, 30 deletions
diff --git a/games/rogue/spec_hit.c b/games/rogue/spec_hit.c index 7893d32667f..b5544c7e2d0 100644 --- a/games/rogue/spec_hit.c +++ b/games/rogue/spec_hit.c @@ -1,3 +1,4 @@ +/* $OpenBSD: spec_hit.c,v 1.3 1998/08/22 08:55:48 pjanzen Exp $ */ /* $NetBSD: spec_hit.c,v 1.3 1995/04/22 10:28:29 cgd Exp $ */ /* @@ -40,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)spec_hit.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: spec_hit.c,v 1.3 1995/04/22 10:28:29 cgd Exp $"; +static char rcsid[] = "$OpenBSD: spec_hit.c,v 1.3 1998/08/22 08:55:48 pjanzen Exp $"; #endif #endif /* not lint */ @@ -52,7 +53,7 @@ static char rcsid[] = "$NetBSD: spec_hit.c,v 1.3 1995/04/22 10:28:29 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. * */ @@ -61,14 +62,9 @@ static char rcsid[] = "$NetBSD: spec_hit.c,v 1.3 1995/04/22 10:28:29 cgd Exp $"; short less_hp = 0; boolean being_held; -extern short cur_level, max_level, blind, levitate, ring_exp; -extern long level_points[]; -extern boolean detect_monster, mon_disappeared; -extern boolean sustain_strength, maintain_armor; -extern char *you_can_move_again; - +void special_hit(monster) -object *monster; + object *monster; { if ((monster->m_flags & CONFUSED) && rand_percent(66)) { return; @@ -98,8 +94,9 @@ object *monster; } } +void rust(monster) -object *monster; + object *monster; { if ((!rogue.armor) || (get_armor_class(rogue.armor) <= 1) || (rogue.armor->which_kind == LEATHER)) { @@ -117,8 +114,9 @@ object *monster; } } +void freeze(monster) -object *monster; + object *monster; { short freeze_percent = 99; short i, n; @@ -150,8 +148,9 @@ object *monster; } } +void steal_gold(monster) -object *monster; + object *monster; { int amount; @@ -170,11 +169,12 @@ object *monster; disappear(monster); } +void steal_item(monster) -object *monster; + object *monster; { object *obj; - short i, n, t; + short i, n, t = 0; char desc[80]; boolean has_something = 0; @@ -224,8 +224,9 @@ DSPR: disappear(monster); } +void disappear(monster) -object *monster; + object *monster; { short row, col; @@ -241,8 +242,9 @@ object *monster; mon_disappeared = 1; } +void cough_up(monster) -object *monster; + object *monster; { object *obj; short row, col, i, n; @@ -285,11 +287,13 @@ object *monster; free_object(obj); } +boolean try_to_cough(row, col, obj) -short row, col; -object *obj; + short row, col; + object *obj; { - if ((row < MIN_ROW) || (row > (DROWS-2)) || (col < 0) || (col>(DCOLS-1))) { + if ((row < MIN_ROW) || + (row > (DROWS-2)) || (col < 0) || (col>(DCOLS-1))) { return(0); } if ((!(dungeon[row][col] & (OBJECT | STAIRS | TRAP))) && @@ -304,8 +308,9 @@ object *obj; return(0); } +boolean seek_gold(monster) -object *monster; + object *monster; { short i, j, rn, s; @@ -336,8 +341,9 @@ object *monster; return(0); } +boolean gold_at(row, col) -short row, col; + short row, col; { if (dungeon[row][col] & OBJECT) { object *obj; @@ -350,14 +356,16 @@ short row, col; return(0); } +void check_gold_seeker(monster) -object *monster; + object *monster; { monster->m_flags &= (~SEEKS_GOLD); } +boolean check_imitator(monster) -object *monster; + object *monster; { char msg[80]; @@ -375,13 +383,14 @@ object *monster; return(0); } +boolean imitating(row, col) -register short row, col; + short row, col; { if (dungeon[row][col] & MONSTER) { - object *object_at(), *monster; + object *monster; - if (monster = object_at(&level_monsters, row, col)) { + if ((monster = object_at(&level_monsters, row, col))) { if (monster->m_flags & IMITATES) { return(1); } @@ -390,8 +399,9 @@ register short row, col; return(0); } +void sting(monster) -object *monster; + object *monster; { short sting_chance = 35; char msg[80]; @@ -413,6 +423,7 @@ object *monster; } } +void drop_level() { int hp; @@ -432,6 +443,7 @@ drop_level() add_exp(1, 0); } +void drain_life() { short n; @@ -460,8 +472,9 @@ drain_life() print_stats((STAT_STRENGTH | STAT_HP)); } +boolean m_confuse(monster) -object *monster; + object *monster; { char msg[80]; @@ -482,8 +495,9 @@ object *monster; return(0); } +boolean flame_broil(monster) -object *monster; + object *monster; { short row, col, dir; @@ -508,8 +522,9 @@ object *monster; return(1); } +int get_dir(srow, scol, drow, dcol) -short srow, scol, drow, dcol; + short srow, scol, drow, dcol; { if (srow == drow) { if (scol < dcol) { |