From 955476285d3ee240b54dcacc22d45f0b2d40176a Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Thu, 15 Mar 2018 21:07:53 +0800 Subject: [PATCH] Shop Template --- _server/editor_blockly.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/_server/editor_blockly.js b/_server/editor_blockly.js index d42b88d7..c949f620 100644 --- a/_server/editor_blockly.js +++ b/_server/editor_blockly.js @@ -126,6 +126,32 @@ initscript=String.raw` ], "false": [] }), + '', + MotaActionFunctions.actionParser.parse([ + {"type": "choices", "text": "\t[老人,man]少年,你需要钥匙吗?\n我这里有大把的!", + "choices": [ + {"text": "黄钥匙(\${9+flag:shop_times}金币)", "action": [ + {"type": "if", "condition": "status:money>=9+flag:shop_times", + "true": [ + {"type": "setValue", "name": "status:money", "value": "status:money-(9+flag:shop_times)"}, + {"type": "setValue", "name": "item:yellowKey", "value": "item:yellowKey+1"}, + ], + "false": [ + "\t[老人,man]你的金钱不足!", + {"type": "revisit"} + ] + } + ]}, + {"text": "蓝钥匙(\${18+2*flag:shop_times}金币)", "action": [ + ]}, + {"text": "离开", "action": [ + {"type": "exit"} + ]} + ] + }, + {"type": "setValue", "name": "flag:shop_times", "value": "flag:shop_times+1"}, + {"type": "revisit"} + ], 'event'), '', MotaActionFunctions.actionParser.parse({ "trigger": "action",