[Ohrrpgce] [ohrrpgce:bugs] #2018 Negative HP or MP costs on attacks do nothing

TeeEmCee teeemcee at users.sf.net
Sun Jan 24 06:35:23 PST 2016


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.


---

** [bugs:#2018] Negative HP or MP costs on attacks do nothing**

**Status:** open
**Milestone:** OHRRPGCE
**Created:** Sun Jan 24, 2016 02:15 PM UTC by TeeEmCee
**Last Updated:** Sun Jan 24, 2016 02:15 PM UTC
**Owner:** nobody


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.

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.

The relevant code in r760 (atk(9) was HP cost):
   IF atk(9) <> 0 THEN
    hc(who) = 7
    hx(who) = x(who) + (w(who) * .5)
    hy(who) = y(who) + (h(who) * .5)
    temp = large(range(atk(9), 50), 1)
    harm$(who) = STR$(ABS(temp))
    stat(who, 0, 0) = large(stat(who, 0, 0) - temp, 0)
    IF stat(who, 0, 0) <= 0 THEN
     tdwho = who
     stat(tdwho, 0, 0) = 0
     GOSUB triggerfade
    END IF

Current code:
  IF attack.hp_cost > 0 THEN
    WITH bslot(bat.acting)
      .stat.cur.hp = large(.stat.cur.hp - attack.hp_cost, 0)
      .harm.ticks = gen(genDamageDisplayTicks)
      .harm.pos.x = .x + (.w * .5)
      .harm.pos.y = .y + (.h * .5)
      .harm.text = STR(attack.hp_cost)
    END WITH
  END IF

But even going back to a copy of the source code from 2000, I found negative MP costs have always done nothing.

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.
On the other hand negative MP has never worked, so we could reset all negative MP costs to zero if it is implemented.

Negative HP cost isn't totally trivial; the 'REVIVE' block might have to get shifted down afterwards.


---

Sent from sourceforge.net because ohrrpgce at lists.motherhamster.org is subscribed to https://sourceforge.net/p/ohrrpgce/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/ohrrpgce/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20160124/a31e0b30/attachment.htm>


More information about the Ohrrpgce mailing list