mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-20 20:50:21 +02:00
CLOSES #1396, CLOSES #1398, CLOSES #1400, CLOSES #1401, CLOSES #1406, CLOSES #1407, CLOSES #1411, CLOSES #1413, CLOSES #1415, CLOSES #1416, CLOSES #1417, CLOSES #1419, CLOSES #1421, CLOSES #1422, CLOSES #1423, CLOSES #1424, CLOSES #1425, CLOSES #1427, CLOSES #1428, CLOSES #1429, CLOSES #1431, CLOSES #1432, CLOSES #1433, CLOSES #1435, CLOSES #1437, CLOSES #1440, CLOSES #1441, CLOSES #1442, CLOSES #1443, CLOSES #1447, CLOSES #1449, CLOSES #1456, CLOSES #1464, CLOSES #1465, CLOSES #1468, CLOSES #1469, CLOSES #1470
This commit is contained in:
@@ -134,6 +134,10 @@ function Commands.show_text(ctx, textId, subs, extraOpts)
|
||||
opts[k] = v
|
||||
end
|
||||
end
|
||||
-- MONEY_BOX (engine/menus/text_box.asm:133) reads the live wallet
|
||||
if opts and opts.money == true then
|
||||
opts.money = function() return ctx.save.money end
|
||||
end
|
||||
ctx.game.stack:push(TextBox.new(ctx.game, text, function()
|
||||
runner:resume()
|
||||
end, opts))
|
||||
@@ -780,6 +784,16 @@ function Commands.give_money(ctx, amount)
|
||||
ctx.save.money = math.max(0, ctx.save.money + amount)
|
||||
end
|
||||
|
||||
-- check_money <amount>: HasEnoughMoney (home/money.asm:1)
|
||||
function Commands.check_money(ctx, amount)
|
||||
ctx.lastCheck = (ctx.save.money or 0) >= (amount or 0)
|
||||
end
|
||||
|
||||
-- take_money <amount>: SubBCDPredef (engine/math/bcd.asm:193)
|
||||
function Commands.take_money(ctx, amount)
|
||||
ctx.save.money = math.max(0, (ctx.save.money or 0) - (amount or 0))
|
||||
end
|
||||
|
||||
-- Point LAST_MAP exits at an outdoor door (pokered wLastMap). Keeps the
|
||||
-- live overworld memory in sync so a scripted home warp from the HoF PC
|
||||
-- does not leave Red's house mats aimed at Indigo Plateau (#103).
|
||||
|
||||
Reference in New Issue
Block a user