Code center > Bugs and fixes

Should Memory shots obey Shot Formation cost?

(1/1)

EricL:
Positive valued shots currently don't cost anything (2.4x).  That is, they do not currently respect the Shot Formation value in the costs dialog.  I tracked this down.  The line to actually subtact the shot cost from the bot's erngy was inside an IF statement for -1 shots and never gets executed for postive shots.  I've changed it as below.

Case Is >= -1
    shtype = shtype Mod MaxMem
    If shtype = -1 Then
      If rob(n).Multibot Then
        value = 20 + (rob(n).body / 5) * (rob(n).Numties + 1)
      Else
        value = 20 + (rob(n).body / 5)
      End If
      value = value * multiplier
      'rob(n).nrg = rob(n).nrg - cost
    Else
      rngmultiplier = 1
    End If
    rob(n).nrg = rob(n).nrg - cost ' EricL Moved this here from above as postive shots weren't costing anything
    newshot n, shtype, value, rngmultiplier
  Case -2......


I assume my change is the correct one, that all shots should respect the Shot Formation cost, but since this is a core change, I thought I would be explicit.  Does anyone have any objections?

-E

Numsgil:
Yes, all shots should cost at least the shot formation cost.  It probably got overlooked when I added the "power" shots, which seriously complicated the cost analysis.

EricL:
Okey Dokey, it's fixed in 2.42.2.

-E

Navigation

[0] Message Index

Go to full version