comparison rogue3/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 527e2150eaf0
children
comparison
equal deleted inserted replaced
244:ded75a57405c 245:e7aab31362af
164 /* 164 /*
165 * turn off ISHELD in case teleportation was done while fighting 165 * turn off ISHELD in case teleportation was done while fighting
166 * a Fungi 166 * a Fungi
167 */ 167 */
168 if (on(player, ISHELD)) { 168 if (on(player, ISHELD)) {
169 struct linked_list *item;
170 struct thing *mon;
171
169 player.t_flags &= ~ISHELD; 172 player.t_flags &= ~ISHELD;
170 fung_hit = 0; 173 fung_hit = 0;
171 strcpy(monsters['F'-'A'].m_stats.s_dmg, "000d0"); 174 for (item = mlist; item != NULL; item = next(item)) {
175 mon = (struct thing *) ldata(item);
176 if (mon->t_type == 'F')
177 strcpy(mon->t_stats.s_dmg, "000d0");
178 }
172 } 179 }
173 count = 0; 180 count = 0;
174 running = FALSE; 181 running = FALSE;
175 flush_type(); /* flush typeahead */ 182 flush_type(); /* flush typeahead */
176 return rm; 183 return rm;