comparison srogue/fight.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
comparison
equal deleted inserted replaced
244:ded75a57405c 245:e7aab31362af
140 if (mp->t_flags & ISPARA) /* paralyzed monsters */ 140 if (mp->t_flags & ISPARA) /* paralyzed monsters */
141 return(0); 141 return(0);
142 running = FALSE; 142 running = FALSE;
143 quiet = 0; 143 quiet = 0;
144 isfight = TRUE; 144 isfight = TRUE;
145 if (mp->t_type == 'F')
146 fung_hit = atoi(mp->t_stats.s_dmg);
145 if (mp->t_type == 'M' && pl_off(ISBLIND)) 147 if (mp->t_type == 'M' && pl_off(ISBLIND))
146 mp->t_disguise = 'M'; 148 mp->t_disguise = 'M';
147 if (pl_on(ISBLIND)) 149 if (pl_on(ISBLIND))
148 mname = "it"; 150 mname = "it";
149 else 151 else
204 him->s_exp = e_levels[him->s_lvl - 1] + 1; 206 him->s_exp = e_levels[him->s_lvl - 1] + 1;
205 chg_hpt(-roll(1,10),TRUE,mp->t_indx); 207 chg_hpt(-roll(1,10),TRUE,mp->t_indx);
206 } 208 }
207 when 'F': 209 when 'F':
208 player.t_flags |= ISHELD; 210 player.t_flags |= ISHELD;
209 sprintf(monsters[midx('F')].m_stats.s_dmg,"%dd1",++fung_hit); 211 sprintf(mp->t_stats.s_dmg,"%dd1",++fung_hit);
210 when 'L': { 212 when 'L': {
211 long lastpurse; 213 long lastpurse;
212 struct linked_list *lep; 214 struct linked_list *lep;
213 215
214 lastpurse = purse; 216 lastpurse = purse;