comparison srogue/monsters.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 94a0d9dd5ce1
children e52a8a7ad4c5
comparison
equal deleted inserted replaced
244:ded75a57405c 245:e7aab31362af
332 * Release the player from being held 332 * Release the player from being held
333 */ 333 */
334 void 334 void
335 unhold(char whichmon) 335 unhold(char whichmon)
336 { 336 {
337 struct linked_list *item;
338 struct thing *mon;
339
337 switch (whichmon) { 340 switch (whichmon) {
338 case 'F': 341 case 'F':
339 fung_hit = 0; 342 fung_hit = 0;
340 strcpy(monsters[midx('F')].m_stats.s_dmg, "000d0"); 343 for (item = mlist; item != NULL; item = next(item)) {
344 mon = THINGPTR(item);
345 if (mon->t_type == 'F')
346 strcpy(mon->t_stats.s_dmg, "000d0");
347 }
341 case 'd': 348 case 'd':
342 player.t_flags &= ~ISHELD; 349 player.t_flags &= ~ISHELD;
343 } 350 }
344 } 351 }
345 352