Mercurial > hg > early-roguelike
comparison rogue4/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 | 1b73a8641b37 |
children |
comparison
equal
deleted
inserted
replaced
244:ded75a57405c | 245:e7aab31362af |
---|---|
178 /* | 178 /* |
179 * turn off ISHELD in case teleportation was done while fighting | 179 * turn off ISHELD in case teleportation was done while fighting |
180 * a Fungi | 180 * a Fungi |
181 */ | 181 */ |
182 if (on(player, ISHELD)) { | 182 if (on(player, ISHELD)) { |
183 THING *mon; | |
184 | |
183 player.t_flags &= ~ISHELD; | 185 player.t_flags &= ~ISHELD; |
184 fung_hit = 0; | 186 fung_hit = 0; |
185 strcpy(monsters['F'-'A'].m_stats.s_dmg, "000d0"); | 187 for (mon = mlist; mon != NULL; mon = next(mon)) { |
188 if (mon->t_type == 'F') | |
189 strcpy(mon->t_stats.s_dmg, "0d0"); | |
190 } | |
186 } | 191 } |
187 no_move = 0; | 192 no_move = 0; |
188 count = 0; | 193 count = 0; |
189 running = FALSE; | 194 running = FALSE; |
190 flush_type(); | 195 flush_type(); |