comparison rogue4/extern.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 ee250e3646fd
children d3968e9cb98d
comparison
equal deleted inserted replaced
244:ded75a57405c 245:e7aab31362af
168 { "giant ant", 0, ISMEAN, { XX, 9, 2, 3, ___, "1d6" } }, 168 { "giant ant", 0, ISMEAN, { XX, 9, 2, 3, ___, "1d6" } },
169 { "bat", 0, 0, { XX, 1, 1, 3, ___, "1d2" } }, 169 { "bat", 0, 0, { XX, 1, 1, 3, ___, "1d2" } },
170 { "centaur", 15, 0, { XX, 15, 4, 4, ___, "1d6/1d6" } }, 170 { "centaur", 15, 0, { XX, 15, 4, 4, ___, "1d6/1d6" } },
171 { "dragon", 100, ISMEAN, { XX,6800, 10, -1, ___, "1d8/1d8/3d10" } }, 171 { "dragon", 100, ISMEAN, { XX,6800, 10, -1, ___, "1d8/1d8/3d10" } },
172 { "floating eye",0, 0, { XX, 5, 1, 9, ___, "0d0" } }, 172 { "floating eye",0, 0, { XX, 5, 1, 9, ___, "0d0" } },
173 /* NOTE: the damage is %%% so that xstr won't merge this */ 173 { "violet fungi",0, ISMEAN, { XX, 80, 8, 3, ___, "0d0" } },
174 /* string with others, since it is written on in the program */
175 { "violet fungi",0, ISMEAN, { XX, 80, 8, 3, ___, "%%%d0" } },
176 { "gnome", 10, 0, { XX, 7, 1, 5, ___, "1d6" } }, 174 { "gnome", 10, 0, { XX, 7, 1, 5, ___, "1d6" } },
177 { "hobgoblin", 0, ISMEAN, { XX, 3, 1, 5, ___, "1d8" } }, 175 { "hobgoblin", 0, ISMEAN, { XX, 3, 1, 5, ___, "1d8" } },
178 { "invisible stalker",0,ISINVIS,{ XX,120, 8, 3, ___, "4d4" } }, 176 { "invisible stalker",0,ISINVIS,{ XX,120, 8, 3, ___, "4d4" } },
179 { "jackal", 0, ISMEAN, { XX, 2, 1, 7, ___, "1d2" } }, 177 { "jackal", 0, ISMEAN, { XX, 2, 1, 7, ___, "1d2" } },
180 { "kobold", 0, ISMEAN, { XX, 1, 1, 7, ___, "1d4" } }, 178 { "kobold", 0, ISMEAN, { XX, 1, 1, 7, ___, "1d4" } },