<div class="markdown_content"><p>Also, item costs on attacks used by enemies add/remove act on the player's inventory, but I think that's accepted as a feature, not a bug.</p>
<hr/>
<p><strong> <a class="alink" href="http://sourceforge.net/p/ohrrpgce/bugs/2018/">[bugs:#2018]</a> Negative HP or MP costs on attacks do nothing</strong></p>
<p><strong>Status:</strong> open<br/>
<strong>Milestone:</strong> OHRRPGCE<br/>
<strong>Created:</strong> Sun Jan 24, 2016 02:15 PM UTC by TeeEmCee<br/>
<strong>Last Updated:</strong> Sun Jan 24, 2016 02:15 PM UTC<br/>
<strong>Owner:</strong> nobody</p>
<p>In r1284 (Aug 2008) James fixed bug 429, "Negative gold cost no longer gives you money". However looking at the cost deducting code now I was surprised to see that negative MP or HP costs for an attack still do nothing, even though you can set negative costs in the attack editor! In fact the help page even documents that negative HP cost cures, even though it hasn't done so for as long as we've had help pages.</p>
<p>I found that r761 (July 2006) introduced bug 429 and also introduced another unnoticed bug where negative HP costs stopped healing. Also, r761 removed the +/- 50% randomness that HP and MP costs used to have.</p>
<p>The relevant code in r760 (atk(9) was HP cost):<br/>
   IF atk(9) <> 0 THEN<br/>
    hc(who) = 7<br/>
    hx(who) = x(who) + (w(who) * .5)<br/>
    hy(who) = y(who) + (h(who) * .5)<br/>
    temp = large(range(atk(9), 50), 1)<br/>
    harm$(who) = STR$(ABS(temp))<br/>
    stat(who, 0, 0) = large(stat(who, 0, 0) - temp, 0)<br/>
    IF stat(who, 0, 0) <= 0 THEN<br/>
     tdwho = who<br/>
     stat(tdwho, 0, 0) = 0<br/>
     GOSUB triggerfade<br/>
    END IF</p>
<p>Current code:<br/>
  IF attack.hp_cost > 0 THEN<br/>
    WITH bslot(bat.acting)<br/>
      .stat.cur.hp = large(.stat.cur.hp - attack.hp_cost, 0)<br/>
      .harm.ticks = gen(genDamageDisplayTicks)<br/>
      .harm.pos.x = .x + (.w * .5)<br/>
      .harm.pos.y = .y + (.h * .5)<br/>
      .harm.text = STR(attack.hp_cost)<br/>
    END WITH<br/>
  END IF</p>
<p>But even going back to a copy of the source code from 2000, I found negative MP costs have always done nothing.</p>
<p>Negative HP costs not working is a bug, but I think negative MP costs would be a nice feature too. But they need to be treated separately. The HP cost bug is so old now. I don't think it's worth treating games since 2006 specially (not fixing it for them) - an older game might have been edited with a version of Custom since 2006 anyway, and you have to explicitly ask for negative costs.<br/>
On the other hand negative MP has never worked, so we could reset all negative MP costs to zero if it is implemented.</p>
<p>Negative HP cost isn't totally trivial; the 'REVIVE' block might have to get shifted down afterwards.</p>
<hr/>
<p>Sent from sourceforge.net because ohrrpgce@lists.motherhamster.org is subscribed to <a href="https://sourceforge.net/p/ohrrpgce/bugs/">https://sourceforge.net/p/ohrrpgce/bugs/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/ohrrpgce/admin/bugs/options.">https://sourceforge.net/p/ohrrpgce/admin/bugs/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>