[Ohrrpgce] [ohrrpgce:bugs] #2018 Negative HP or MP costs on attacks do nothing; HP and gold costs never disallow attacks

TeeEmCee teeemcee at users.sourceforge.net
Tue Sep 18 06:31:04 PDT 2018


Also, if the "Check costs when used as an item" attack bit also doesn't check HP or gold costs.

Also, that bit only affects items used in battle. For items used out of battle, costs are never checked.

Attack costs out of battle have other problems too.
Instead of another dozen "Actually check the dang costs when..." bits, I'd like to just have one. So the first thing to do is to draw up a list of all item cost bugs and quirks, figure out which can be fixed with a single bitset, and which we want to be able to toggle separately (like item costs on attacks used by enemies)


---

** [bugs:#2018] Negative HP or MP costs on attacks do nothing; HP and gold costs never disallow attacks**

**Status:** open
**Milestone:** OHRRPGCE
**Created:** Sun Jan 24, 2016 02:15 PM UTC by TeeEmCee
**Last Updated:** Wed Mar 16, 2016 02:10 AM 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/20180918/cb76caf4/attachment-0001.html>


More information about the Ohrrpgce mailing list