comparison rogue5/wizard.c @ 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 f502bf60e6e4
children
comparison
equal deleted inserted replaced
244:ded75a57405c 245:e7aab31362af
218 /* 218 /*
219 * turn off ISHELD in case teleportation was done while fighting 219 * turn off ISHELD in case teleportation was done while fighting
220 * a Flytrap 220 * a Flytrap
221 */ 221 */
222 if (on(player, ISHELD)) { 222 if (on(player, ISHELD)) {
223 THING *mp;
224
223 player.t_flags &= ~ISHELD; 225 player.t_flags &= ~ISHELD;
224 vf_hit = 0; 226 vf_hit = 0;
225 strcpy(monsters['F'-'A'].m_stats.s_dmg, "000x0"); 227 for (mp = mlist; mp != NULL; mp = next(mp)) {
228 if (mp->t_type == 'F')
229 strcpy(mp->t_stats.s_dmg, "0x0");
230 }
226 } 231 }
227 no_move = 0; 232 no_move = 0;
228 count = 0; 233 count = 0;
229 running = FALSE; 234 running = FALSE;
230 flush_type(); 235 flush_type();