Mercurial > hg > early-roguelike
view rogue4/extern.h @ 245:e7aab31362af
Rogue V[345], Super-Rogue: Fix violet fungi/venus flytraps.
Violet fungi (renamed venus flytraps in Rogue V5) do an increasing
amount of damage each time they hit. If they miss, you still suffer
the same number of HP. This worked by keeping a counter and printing
new damage strings into monsters[5].m_stats.s_dmg, which is the
"prototype" of that particular monster.
Each individual monster has its own damage string. Apparently these
were once char *, pointing to the same string as the prototype. When
the s_dmg member was changed to be an internal char array, changing the
prototype's damage string no longer had any effect on actual monsters.
As a result, flytraps did no damage on a hit, or only one point in V5.
The mechanism for doing damage on a miss continued to work.
This has been fixed by overwriting the individual monster's damage
string instead of the prototype's. It is now no longer necessary to
reset the damage string when the flytrap is killed. The method for
resetting it when the hero teleports away had to be modified. Comments
referencing the long-unused xstr have been removed.
author | John "Elwin" Edwards |
---|---|
date | Sun, 01 May 2016 19:39:56 -0400 |
parents | b24545357d2e |
children | 3d4252fa2ed3 |
line wrap: on
line source
/* * Defines for things used in mach_dep.c * * @(#)extern.h 4.3 (Berkeley) 4/2/82 * * Rogue: Exploring the Dungeons of Doom * Copyright (C) 1980, 1981, 1982 Michael Toy, Ken Arnold and Glenn Wichman * All rights reserved. * * See the file LICENSE.TXT for full copyright and licensing information. */ /* * Don't change the constants, since they are used for sizes in many * places in the program. */ #define MAXSTR 80 /* maximum length of strings */ #define MAXLINES 32 /* maximum number of screen lines used */ #define MAXCOLS 80 /* maximum number of screen columns used */ #define RN (((seed = seed*11109+13849) >> 16) & 0xffff) /* * Now all the global variables */ extern bool after, amulet, askme, door_stop, fight_flush, firstmove, in_shell, jump, noscore, p_know[], passgo, playing, r_know[], running, s_know[], save_msg, slow_invent, terse, use_savedir, wizard, ws_know[]; extern const char *p_colors[], *r_stones[], *w_names[], *a_names[], *ws_made[]; extern char _flags[], _level[], file_name[], fruit[], home[], huh[], outbuf[], *p_guess[], prbuf[], *r_guess[], *release, runch, *s_guess[], *s_names[], take, whoami[], *ws_guess[], *ws_type[]; extern int a_chances[], a_class[], count, dnum, food_left, fung_hit, fd, group, hungry_state, inpack, lastscore, level, lfd, max_level, mpos, no_command, no_food, no_move, ntraps, purse, quiet, total; extern long seed; extern WINDOW *hw; /* * Function types */ char *ctime(), *getenv(); void tstp(), endit(int); long lseek(); extern coord ch_ret; extern shint countch; extern shint direction; extern shint newcount; extern int between; extern int num_checks; extern char lvl_mons[27]; extern char wand_mons[27]; extern coord nh; extern bool got_genocide; #if defined(__GLIBC__) || defined(__INTERIX) /* O_BINARY flag not provided in Interix/SFU or some versions of Linux. It is the same as default behavior so we just zero define it here to make source code compatible. */ #define O_BINARY 0 #endif extern int md_erasechar(void); extern FILE *md_fdopen(int fd, char *mode); extern int md_fileno(FILE *fp); extern char *md_getusername(int uid); extern char *md_gethomedir(); extern int md_getuid(void); extern void md_ignore_signals(void); extern void md_init(void); extern int md_killchar(void); extern void md_normaluser(void); extern int md_readchar(WINDOW *win); extern int md_shellescape(void); extern void md_sleep(int s); extern int md_unlink(char *file); extern int md_unlink_open_file(char *file, int inf);