From 0bec85079add5fe0cda8106ed18ef282e174691c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 18 Aug 2024 10:24:36 +0100 Subject: feat: working on vm_prompt --- rules.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/rules.js b/rules.js index 0973f0d..4fac33b 100644 --- a/rules.js +++ b/rules.js @@ -3255,6 +3255,30 @@ function vm_endif() { vm_next() } +function event_prompt(str) { + if (typeof str === "undefined") + str = CODE[game.vm.fp][game.vm.prompt][1] + if (typeof str === "function") + str = str() + view.prompt = data.card_title[this_card()] + ": " + str +} + +function vm_prompt() { + if (game.vm.prompt) + game.vm._prompt = game.vm.prompt + game.vm.prompt = game.vm.ip + vm_next() +} + +function pop_vm_prompt() { + if (game.vm._prompt) { + game.vm.prompt = game.vm._prompt + delete game.vm._prompt + } else { + game.vm.prompt = 0 + } +} + function vm_return() { /* let return_vm = game.vm.return_vm; console.log('in vm_return') -- cgit v1.2.3