diff --git a/rogue3/fight.c b/rogue3/fight.c index a2ff0cb..c88df9c 100644 --- a/rogue3/fight.c +++ b/rogue3/fight.c @@ -108,6 +108,8 @@ attack(struct thing *mp) */ running = FALSE; quiet = 0; + if (mp->t_type == 'F') + fung_hit = atoi(mp->t_stats.s_dmg); if (mp->t_type == 'M' && off(player, ISBLIND)) mp->t_disguise = 'M'; if (on(player, ISBLIND)) @@ -200,7 +202,7 @@ attack(struct thing *mp) * Violet fungi stops the poor guy from moving */ player.t_flags |= ISHELD; - sprintf(monsters['F'-'A'].m_stats.s_dmg,"%dd1",++fung_hit); + sprintf(mp->t_stats.s_dmg, "%dd1", ++fung_hit); when 'L': { /* @@ -693,7 +695,6 @@ killed(struct linked_list *item, int pr) case 'F': player.t_flags &= ~ISHELD; fung_hit = 0; - strcpy(monsters['F'-'A'].m_stats.s_dmg, "000d0"); when 'L': { struct room *rp; diff --git a/rogue3/wizard.c b/rogue3/wizard.c index 132befe..efe7e09 100644 --- a/rogue3/wizard.c +++ b/rogue3/wizard.c @@ -166,9 +166,16 @@ teleport() * a Fungi */ if (on(player, ISHELD)) { + struct linked_list *item; + struct thing *mon; + player.t_flags &= ~ISHELD; fung_hit = 0; - strcpy(monsters['F'-'A'].m_stats.s_dmg, "000d0"); + for (item = mlist; item != NULL; item = next(item)) { + mon = (struct thing *) ldata(item); + if (mon->t_type == 'F') + strcpy(mon->t_stats.s_dmg, "000d0"); + } } count = 0; running = FALSE; diff --git a/rogue4/extern.c b/rogue4/extern.c index 017180c..6fe070b 100644 --- a/rogue4/extern.c +++ b/rogue4/extern.c @@ -170,9 +170,7 @@ struct monster monsters[26] = { "centaur", 15, 0, { XX, 15, 4, 4, ___, "1d6/1d6" } }, { "dragon", 100, ISMEAN, { XX,6800, 10, -1, ___, "1d8/1d8/3d10" } }, { "floating eye",0, 0, { XX, 5, 1, 9, ___, "0d0" } }, - /* NOTE: the damage is %%% so that xstr won't merge this */ - /* string with others, since it is written on in the program */ - { "violet fungi",0, ISMEAN, { XX, 80, 8, 3, ___, "%%%d0" } }, + { "violet fungi",0, ISMEAN, { XX, 80, 8, 3, ___, "0d0" } }, { "gnome", 10, 0, { XX, 7, 1, 5, ___, "1d6" } }, { "hobgoblin", 0, ISMEAN, { XX, 3, 1, 5, ___, "1d8" } }, { "invisible stalker",0,ISINVIS,{ XX,120, 8, 3, ___, "4d4" } }, diff --git a/rogue4/fight.c b/rogue4/fight.c index c7ed6df..e66e6f3 100644 --- a/rogue4/fight.c +++ b/rogue4/fight.c @@ -113,6 +113,8 @@ attack(THING *mp) */ running = FALSE; count = quiet = 0; + if (mp->t_type == 'F') + fung_hit = atoi(mp->t_stats.s_dmg); if (mp->t_type == 'M' && !on(player, ISBLIND)) mp->t_disguise = 'M'; if (on(player, ISBLIND)) @@ -216,7 +218,7 @@ attack(THING *mp) * Violet fungi stops the poor guy from moving */ player.t_flags |= ISHELD; - sprintf(monsters['F'-'A'].m_stats.s_dmg,"%dd1",++fung_hit); + sprintf(mp->t_stats.s_dmg,"%dd1",++fung_hit); when 'L': { /* @@ -695,7 +697,6 @@ killed(THING *tp, bool pr) case 'F': player.t_flags &= ~ISHELD; fung_hit = 0; - strcpy(monsters['F'-'A'].m_stats.s_dmg, "000d0"); when 'L': { register THING *gold; diff --git a/rogue4/wizard.c b/rogue4/wizard.c index 18827ae..40fdda5 100644 --- a/rogue4/wizard.c +++ b/rogue4/wizard.c @@ -180,9 +180,14 @@ teleport(void) * a Fungi */ if (on(player, ISHELD)) { + THING *mon; + player.t_flags &= ~ISHELD; fung_hit = 0; - strcpy(monsters['F'-'A'].m_stats.s_dmg, "000d0"); + for (mon = mlist; mon != NULL; mon = next(mon)) { + if (mon->t_type == 'F') + strcpy(mon->t_stats.s_dmg, "0d0"); + } } no_move = 0; count = 0; diff --git a/rogue5/extern.c b/rogue5/extern.c index 390b762..8351d9c 100644 --- a/rogue5/extern.c +++ b/rogue5/extern.c @@ -197,9 +197,7 @@ struct monster monsters[26] = { "centaur", 15, 0, { XX, 17, 4, 4, ___, "1x2/1x5/1x5" } }, { "dragon", 100, ISMEAN, { XX,5000, 10, -1, ___, "1x8/1x8/3x10" } }, { "emu", 0, ISMEAN, { XX, 2, 1, 7, ___, "1x2" } }, -{ "venus flytrap", 0, ISMEAN, { XX, 80, 8, 3, ___, "%%%x0" } }, - /* NOTE: the damage is %%% so that xstr won't merge this */ - /* string with others, since it is written on in the program */ +{ "venus flytrap", 0, ISMEAN, { XX, 80, 8, 3, ___, "0x0" } }, { "griffin", 20, ISMEAN|ISFLY|ISREGEN, { XX,2000, 13, 2, ___, "4x3/3x5" } }, { "hobgoblin", 0, ISMEAN, { XX, 3, 1, 5, ___, "1x8" } }, { "ice monster", 0, 0, { XX, 5, 1, 9, ___, "0x0" } }, diff --git a/rogue5/fight.c b/rogue5/fight.c index b88d875..6a00497 100644 --- a/rogue5/fight.c +++ b/rogue5/fight.c @@ -156,6 +156,8 @@ attack(THING *mp) to_death = FALSE; kamikaze = FALSE; } + if (mp->t_type == 'F') + vf_hit = atoi(mp->t_stats.s_dmg); if (mp->t_type == 'X' && mp->t_disguise != 'X' && !on(player, ISBLIND)) { mp->t_disguise = 'X'; @@ -269,7 +271,7 @@ attack(THING *mp) * Venus Flytrap stops the poor guy from moving */ player.t_flags |= ISHELD; - sprintf(monsters['F'-'A'].m_stats.s_dmg,"%dx1", ++vf_hit); + sprintf(mp->t_stats.s_dmg,"%dx1", ++vf_hit); if (--pstats.s_hpt <= 0) death('F'); when 'L': @@ -641,7 +643,6 @@ killed(THING *tp, int pr) case 'F': player.t_flags &= ~ISHELD; vf_hit = 0; - strcpy(monsters['F'-'A'].m_stats.s_dmg, "000x0"); when 'L': { THING *gold; diff --git a/rogue5/wizard.c b/rogue5/wizard.c index 29434f3..20169e1 100644 --- a/rogue5/wizard.c +++ b/rogue5/wizard.c @@ -220,9 +220,14 @@ teleport(void) * a Flytrap */ if (on(player, ISHELD)) { + THING *mp; + player.t_flags &= ~ISHELD; vf_hit = 0; - strcpy(monsters['F'-'A'].m_stats.s_dmg, "000x0"); + for (mp = mlist; mp != NULL; mp = next(mp)) { + if (mp->t_type == 'F') + strcpy(mp->t_stats.s_dmg, "0x0"); + } } no_move = 0; count = 0; diff --git a/srogue/fight.c b/srogue/fight.c index 6f80372..c463a20 100644 --- a/srogue/fight.c +++ b/srogue/fight.c @@ -142,6 +142,8 @@ attack(struct thing *mp) running = FALSE; quiet = 0; isfight = TRUE; + if (mp->t_type == 'F') + fung_hit = atoi(mp->t_stats.s_dmg); if (mp->t_type == 'M' && pl_off(ISBLIND)) mp->t_disguise = 'M'; if (pl_on(ISBLIND)) @@ -206,7 +208,7 @@ attack(struct thing *mp) } when 'F': player.t_flags |= ISHELD; - sprintf(monsters[midx('F')].m_stats.s_dmg,"%dd1",++fung_hit); + sprintf(mp->t_stats.s_dmg,"%dd1",++fung_hit); when 'L': { long lastpurse; struct linked_list *lep; diff --git a/srogue/monsters.c b/srogue/monsters.c index 1acccfb..77337f3 100644 --- a/srogue/monsters.c +++ b/srogue/monsters.c @@ -334,10 +334,17 @@ tryagain: void unhold(char whichmon) { + struct linked_list *item; + struct thing *mon; + switch (whichmon) { case 'F': fung_hit = 0; - strcpy(monsters[midx('F')].m_stats.s_dmg, "000d0"); + for (item = mlist; item != NULL; item = next(item)) { + mon = THINGPTR(item); + if (mon->t_type == 'F') + strcpy(mon->t_stats.s_dmg, "000d0"); + } case 'd': player.t_flags &= ~ISHELD; }