diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4 index b398d157..18cd0c30 100644 --- a/_server/blockly/MotaAction.g4 +++ b/_server/blockly/MotaAction.g4 @@ -306,41 +306,45 @@ return code; */; setText_s - : '设置剧情文本的属性' '位置' SetTextPosition_List BGNL? '标题颜色' EvalString? '正文颜色' EvalString? '背景色' EvalString? '粗体' B_1_List BGNL? '标题字体大小' EvalString? '正文字体大小' EvalString? '打字间隔' EvalString? Newline + : '设置剧情文本的属性' '位置' SetTextPosition_List '偏移像素' EvalString? BGNL? '标题颜色' EvalString? '正文颜色' EvalString? '背景色' EvalString? '粗体' B_1_List BGNL? '标题字体大小' EvalString? '正文字体大小' EvalString? '打字间隔' EvalString? Newline /* setText_s tooltip : setText:设置剧情文本的属性,颜色为RGB三元组或RGBA四元组,打字间隔为剧情文字添加的时间间隔,为整数或不填 helpUrl : https://ckcz123.github.io/mota-js/#/event?id=settext%EF%BC%9A%E8%AE%BE%E7%BD%AE%E5%89%A7%E6%83%85%E6%96%87%E6%9C%AC%E7%9A%84%E5%B1%9E%E6%80%A7 -default : [null,"","","",null,"","",''] +default : [null,"","","","",null,"","",""] SetTextPosition_List_0 =SetTextPosition_List_0==='null'?'': ', "position": "'+SetTextPosition_List_0+'"'; var colorRe = /^(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d),(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d),(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(,0(\.\d+)?|,1)?$/; if (EvalString_0) { - if (!colorRe.test(EvalString_0))throw new Error('颜色格式错误,形如:0~255,0~255,0~255,0~1'); - EvalString_0 = ', "title": ['+EvalString_0+']'; + if (!/^\d+$/.test(EvalString_0))throw new Error('像素偏移量必须是整数或不填'); + EvalString_0 = ', "offset": '+EvalString_0; } if (EvalString_1) { if (!colorRe.test(EvalString_1))throw new Error('颜色格式错误,形如:0~255,0~255,0~255,0~1'); - EvalString_1 = ', "text": ['+EvalString_1+']'; + EvalString_1 = ', "title": ['+EvalString_1+']'; } if (EvalString_2) { if (!colorRe.test(EvalString_2))throw new Error('颜色格式错误,形如:0~255,0~255,0~255,0~1'); - EvalString_2 = ', "background": ['+EvalString_2+']'; + EvalString_2 = ', "text": ['+EvalString_2+']'; } if (EvalString_3) { - if (!/^\d+$/.test(EvalString_3))throw new Error('字体大小必须是整数或不填'); - EvalString_3 = ', "titlefont": '+EvalString_3; + if (!colorRe.test(EvalString_3))throw new Error('颜色格式错误,形如:0~255,0~255,0~255,0~1'); + EvalString_3 = ', "background": ['+EvalString_3+']'; } if (EvalString_4) { if (!/^\d+$/.test(EvalString_4))throw new Error('字体大小必须是整数或不填'); - EvalString_4 = ', "textfont": '+EvalString_4; + EvalString_4 = ', "titlefont": '+EvalString_4; } if (EvalString_5) { - if (!/^\d+$/.test(EvalString_5))throw new Error('打字时间间隔必须是整数或不填'); - EvalString_5 = ', "time": '+EvalString_5; + if (!/^\d+$/.test(EvalString_5))throw new Error('字体大小必须是整数或不填'); + EvalString_5 = ', "textfont": '+EvalString_5; } -B_1_List_0 = ', "bold": '+B_1_List_0; -var code = '{"type": "setText"'+SetTextPosition_List_0+EvalString_0+EvalString_1+EvalString_2+B_1_List_0+EvalString_3+EvalString_4+EvalString_5+'},\n'; +if (EvalString_6) { + if (!/^\d+$/.test(EvalString_6))throw new Error('打字时间间隔必须是整数或不填'); + EvalString_6 = ', "time": '+EvalString_6; +} +B_1_List_0 = B_1_List_0==='null'?'':', "bold": '+B_1_List_0; +var code = '{"type": "setText"'+SetTextPosition_List_0+EvalString_0+EvalString_1+EvalString_2+B_1_List_0+EvalString_3+EvalString_4+EvalString_5+EvalString_6+'},\n'; return code; */; @@ -1450,7 +1454,7 @@ Stair_List /*Stair_List ['loc','upFloor','downFloor']*/; SetTextPosition_List - : '不改变'|'上'|'中'|'下' + : '不改变'|'距离顶部'|'居中'|'距离底部' /*SetTextPosition_List ['null','up','center','down']*/; ShopUse_List @@ -1705,7 +1709,7 @@ ActionParser.prototype.parseAction = function() { data.text=setTextfunc(data.text); data.background=setTextfunc(data.background); this.next = MotaActionBlocks['setText_s'].xmlText([ - data.position,data.title,data.text,data.background,data.bold,data.titlefont,data.textfont,data.time,this.next]); + data.position,data.offset,data.title,data.text,data.background,data.bold,data.titlefont,data.textfont,data.time,this.next]); break; case "tip": this.next = MotaActionBlocks['tip_s'].xmlText([ diff --git a/_server/data.comment.js b/_server/data.comment.js index a149b17b..7afe0f36 100644 --- a/_server/data.comment.js +++ b/_server/data.comment.js @@ -79,6 +79,26 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "_leaf": true, "_type": "textarea", "_data": "边框颜色,包括游戏边界的边框和对话框边框等。" + }, + "statusBarColor": { + "_leaf": true, + "_type": "textarea", + "_data": "状态栏的文字颜色,默认是白色" + }, + "hardLabelColor": { + "_leaf": true, + "_type": "textarea", + "_data": "难度显示的颜色,默认是红色" + }, + "floorChangingBackground": { + "_leaf": true, + "_type": "textarea", + "_data": "楼层转换界面的背景样式;可以使用纯色(默认值black),也可以使用图片(参见状态栏的图片写法)" + }, + "floorChangingTextColor": { + "_leaf": true, + "_type": "textarea", + "_data": "楼层转换界面的文字颜色,默认是白色" } } }, @@ -551,12 +571,6 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "_bool": "bool", "_data": "寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶" }, - "enableViewMaps": { - "_leaf": true, - "_type": "checkbox", - "_bool": "bool", - "_data": "是否支持在菜单栏中查看所有楼层的地图" - }, "portalWithoutTrigger": { "_leaf": true, "_type": "checkbox", @@ -575,12 +589,6 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "_bool": "bool", "_data": "是否允许瞬间移动" }, - "clickMoveDirectly": { - "_leaf": true, - "_type": "checkbox", - "_bool": "bool", - "_data": "是否默认开启单击瞬移,用户可在菜单栏手动开关" - } } } } diff --git a/docs/api.md b/docs/api.md index fa703397..72335c95 100644 --- a/docs/api.md +++ b/docs/api.md @@ -162,11 +162,13 @@ core.nextY(n) core.openDoor(id, x, y, needKey, callback) [异步] 尝试开门操作。id为目标点的ID,x和y为坐标,needKey表示是否需要使用钥匙,callback为开门完毕后的回调函数。 +id可为null代表使用地图上的值。 例如:core.openDoor('yellowDoor', 10, 3, false, function() {console.log("1")}) core.battle(id, x, y, force, callback) [异步] 执行战斗事件。id为怪物的id,x和y为坐标,force为bool值表示是否是强制战斗,callback为战斗完毕后的回调函数。 +id可为null代表使用地图上的值。 例如:core.battle('greenSlime', null, null, true) diff --git a/docs/element.md b/docs/element.md index 63e7ed59..bd743bef 100644 --- a/docs/element.md +++ b/docs/element.md @@ -126,7 +126,7 @@ animate为该装备的攻击动画,仅对type为0时有效。具体可参见[ ``` text yellowDoor, blueDoor, redDoor, greenDoor, specialDoor, steelDoor, -yellowWall, blueWall, whiteWall, lava, star +yellowWall, blueWall, whiteWall ``` ## 怪物 diff --git a/editor-mobile.html b/editor-mobile.html index 38c0fb7f..161e7897 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -337,47 +337,47 @@
-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

diff --git a/editor.html b/editor.html index 5b8600b0..cce7d36c 100644 --- a/editor.html +++ b/editor.html @@ -323,47 +323,47 @@
-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

diff --git a/index.html b/index.html index fdaa77ff..62182c53 100644 --- a/index.html +++ b/index.html @@ -44,47 +44,47 @@
-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

-

+

diff --git a/libs/actions.js b/libs/actions.js index ea8e84cc..e0803368 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -71,10 +71,10 @@ actions.prototype.onkeyUp = function(e) { break; } } - this.keyUp(e.keyCode); + this.keyUp(e.keyCode, e.altKey); } else { if (e.keyCode==17) core.status.ctrlDown = false; - this.keyUp(e.keyCode); + this.keyUp(e.keyCode, e.altKey); } } @@ -187,7 +187,7 @@ actions.prototype.keyDown = function(keyCode) { } ////// 根据放开键的code来执行一系列操作 ////// -actions.prototype.keyUp = function(keyCode) { +actions.prototype.keyUp = function(keyCode, altKey) { if (core.isset(core.status.replay)&&core.status.replay.replaying &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; @@ -239,7 +239,7 @@ actions.prototype.keyUp = function(keyCode) { return; } if (core.status.event.id=='equipbox') { - this.keyUpEquipbox(keyCode); + this.keyUpEquipbox(keyCode, altKey); return; } if (core.status.event.id=='save' || core.status.event.id=='load' || core.status.event.id=='replayLoad') { @@ -288,6 +288,12 @@ actions.prototype.keyUp = function(keyCode) { if(!core.status.played) return; + // 0~9的AltKey + if (altKey && keyCode>=48 && keyCode<=57 && core.status.heroStop) { + core.items.quickLoadEquip(keyCode-48); + return; + } + switch (keyCode) { case 27: // ESC if (core.status.heroStop) @@ -357,12 +363,7 @@ actions.prototype.keyUp = function(keyCode) { break; case 33: case 34: // PAGEUP/PAGEDOWN if (core.status.heroStop) { - if (core.flags.enableViewMaps) { - core.ui.drawMaps(); - } - else { - core.drawTip("本塔不允许浏览地图!"); - } + core.ui.drawMaps(); } break; case 37: // UP @@ -409,6 +410,18 @@ actions.prototype.keyUp = function(keyCode) { core.events.useItem('centerFly'); } break; + case 52: // 快捷键4:破冰/冰冻/地震/上下楼器/... + if (core.status.heroStop) { + var list = ["icePickaxe", "snow", "earthquake", "upFly", "downFly", "jumpShoes", "lifeWand", "poisonWine", "weakWine", "curseWine", "superWine"]; + for (var i=0;i=48 && keycode<=57) { + core.items.quickSaveEquip(keycode-48); + return; + } if (keycode==84){ core.ui.closePanel(); core.openToolbox(); @@ -1836,13 +1853,12 @@ actions.prototype.clickSwitchs = function (x,y) { core.ui.drawSwitchs(); break; case 6: - core.flags.clickMoveDirectly=!core.flags.clickMoveDirectly; - core.setLocalStorage('clickMoveDirectly', core.flags.clickMoveDirectly); + core.platform.useLocalForage=!core.platform.useLocalForage; + core.setLocalStorage('useLocalForage', core.platform.useLocalForage); core.ui.drawSwitchs(); break; case 7: - core.platform.useLocalForage=!core.platform.useLocalForage; - core.setLocalStorage('useLocalForage', core.platform.useLocalForage); + core.setFlag('bigmapMoveDirectly', !core.getFlag('bigmapMoveDirectly', false)); core.ui.drawSwitchs(); break; case 8: @@ -1904,17 +1920,7 @@ actions.prototype.clickSettings = function (x,y) { core.ui.drawQuickShop(); break; case 2: - if (!core.flags.enableViewMaps) { - core.drawTip("本塔不允许浏览地图!"); - } - else { - /* - core.drawText("\t[系统提示]即将进入浏览地图模式。\n\n点击地图上半部分,或按[↑]键可查看前一张地图\n点击地图下半部分,或按[↓]键可查看后一张地图\n点击地图中间,或按[ESC]键可离开浏览地图模式\n此模式下可以打开怪物手册以查看某层楼的怪物属性", function () { - core.ui.drawMaps(core.floorIds.indexOf(core.status.floorId)); - }) - */ - core.ui.drawMaps(); - } + core.ui.drawMaps(); break; case 3: core.status.event.selection=0; @@ -2375,6 +2381,9 @@ actions.prototype.clickReplay = function (x, y) { break; } case 2: + core.chooseReplayFile(); + break; + case 3: if (core.hasFlag('debug')) { core.drawText("\t[系统提示]调试模式下无法下载录像"); break; @@ -2387,7 +2396,7 @@ actions.prototype.clickReplay = function (x, y) { })); break; break; - case 3: + case 4: core.ui.closePanel(); break; } diff --git a/libs/control.js b/libs/control.js index 9054d2dd..dacb11d5 100644 --- a/libs/control.js +++ b/libs/control.js @@ -471,7 +471,7 @@ control.prototype.setAutomaticRoute = function (destX, destY, stepPostfix) { if (core.timeout.turnHeroTimeout!=null) return; // 单击瞬间移动 - if (core.flags.clickMoveDirectly && core.status.heroStop) { + if (core.status.heroStop) { if (core.control.tryMoveDirectly(destX, destY)) return; } @@ -1658,25 +1658,37 @@ control.prototype.doEffect = function (effect) { ////// 开启debug模式 ////// control.prototype.debug = function() { core.setFlag('debug', true); - core.insertAction(["\t[调试模式开启]此模式下按住Ctrl键(或Ctrl+Shift键)可以穿墙并忽略一切事件。\n同时,录像将失效,也无法上传成绩。"]); - /* - core.setStatus('hp', 999999); - core.setStatus('atk', 10000); - core.setStatus('def', 10000); - core.setStatus('mdef', 10000); - core.setStatus('money', 10000); - core.setStatus('experience', 10000); - core.setItem('yellowKey', 50); - core.setItem('blueKey', 50); - core.setItem('redKey', 50); - core.setItem('book', 1); - core.setItem('fly', 1); - for (var i in core.status.maps) - if (core.status.maps[i].canFlyTo && core.status.hero.flyRange.indexOf(i)<0) - core.status.hero.flyRange.push(i); - core.updateStatusBar(); - core.drawTip("作弊成功"); - */ + core.drawText("\t[调试模式开启]此模式下按住Ctrl键(或Ctrl+Shift键)可以穿墙并忽略一切事件。\n同时,录像将失效,也无法上传成绩。"); +} + +////// 选择录像文件 ////// +control.prototype.chooseReplayFile = function () { + core.readFile(function (obj) { + if (obj.name!=core.firstData.name) { + alert("存档和游戏不一致!"); + return; + } + if (core.isset(obj.version) && obj.version!=core.firstData.version) { + // alert("游戏版本不一致!"); + if (!confirm("游戏版本不一致!\n你仍然想播放录像吗?")) + return; + } + if (!core.isset(obj.route) || !core.isset(obj.hard)) { + alert("无效的录像!"); + return; + } + + core.dom.startPanel.style.display = 'none'; + core.resetStatus(core.firstData.hero, obj.hard, core.firstData.floorId, null, core.initStatus.maps); + core.setFlag('seed', obj.seed); + core.setFlag('rand', obj.seed); + core.events.setInitData(obj.hard); + core.changeFloor(core.status.floorId, null, core.firstData.hero.loc, null, function() { + core.startReplay(core.decodeRoute(obj.route)); + }, true); + }, function () { + + }) } ////// 开始播放 ////// @@ -2977,6 +2989,8 @@ control.prototype.resize = function(clientWidth, clientHeight) { height: (gameGroupHeight - SPACE*2) + unit, top: SPACE + unit, right: SPACE + unit, + background: main.floorChangingBackground||"black", + color: main.floorChangingTextColor||"white" } }, { @@ -2992,7 +3006,7 @@ control.prototype.resize = function(clientWidth, clientHeight) { borderLeft: statusBarBorder, borderRight: borderRight, fontSize: fontSize + unit, - background: statusBackground, + background: statusBackground } }, { @@ -3008,7 +3022,13 @@ control.prototype.resize = function(clientWidth, clientHeight) { className: 'statusLabels', rules:{ marginLeft: margin + unit, - lineHeight: statusLabelsLH + unit, + lineHeight: statusLabelsLH + unit + } + }, + { + className: 'statusTexts', + rules: { + color: main.statusBarColor||"white" } }, { @@ -3110,9 +3130,10 @@ control.prototype.resize = function(clientWidth, clientHeight) { { id: 'hard', rules: { - lineHeight: toolsHeight + unit + lineHeight: toolsHeight + unit, + color: main.hardLabelColor||"red" } - } + }, ] core.domRenderer(); } @@ -3133,8 +3154,11 @@ control.prototype.domRenderer = function(){ if(styles[i].hasOwnProperty('className')){ var className = styles[i].className for(var j=0; j0) t+=atk+"攻"; + if (def>0) t+=def+"防"; + if (mdef>0) t+=mdef+"魔防"; + if (t!="") ext[id]=t; + } + core.status.hero = core.clone(temp); total.count[id]++; total.add.hp+=hp; @@ -2328,22 +2351,33 @@ ui.prototype.drawStatistics = function () { if (core.flags.enableMoney) text+=",总金币数"+data.monster.money; if (core.flags.enableExperience) text+=",总经验数"+data.monster.experience; if (core.flags.enableAddPoint) text+=",总加点数"+data.monster.point; - text+="。\n\n"; - Object.keys(data.count).forEach(function (key) { - var value=data.count[key]; - if (value>0) { - var name=null; - if (key=='yellowDoor') name="黄门"; - else if (key=='blueDoor') name="蓝门"; - else if (key=='redDoor') name="红门"; - else if (key=='greenDoor') name="绿门"; - else if (key=='steelDoor') name="铁门"; - else name=(core.material.items[key]||{}).name; - if (core.isset(name)) { - text+=name+value+"个;"; - } + text+="。\n"; + + var prev = ""; + ids.forEach(function (key) { + var value = data.count[key]; + if (value==0) return; + var c = cls[key]; + if (c!=prev) { + if (prev != "") text += "。"; + text += "\n"; } + else + text += ","; + prev = c; + var name = null; + if (key=='yellowDoor') name="黄门"; + else if (key=='blueDoor') name="蓝门"; + else if (key=='redDoor') name="红门"; + else if (key=='greenDoor') name="绿门"; + else if (key=='steelDoor') name="铁门"; + else name=core.material.items[key].name; + text+=name+value+"个"; + if (core.isset(ext[key])) + text+="("+ext[key]+")"; }) + + if (prev!="") text+="。"; text+="\n\n"; text+="共加生命值"+core.formatBigNumber(data.add.hp)+"点,攻击" +core.formatBigNumber(data.add.atk)+"点,防御" diff --git a/main.js b/main.js index 02a0a8f2..d411900b 100644 --- a/main.js +++ b/main.js @@ -50,6 +50,7 @@ function main() { 'levelChooseButtons': document.getElementById('levelChooseButtons'), 'data': document.getElementById('data'), 'statusLabels': document.getElementsByClassName('statusLabel'), + 'statusTexts': document.getElementsByClassName('statusText'), 'floorCol': document.getElementById('floorCol'), 'nameCol': document.getElementById('nameCol'), 'lvCol': document.getElementById('lvCol'), @@ -531,32 +532,7 @@ main.dom.replayGame.onclick = function () { } } - core.readFile(function (obj) { - if (obj.name!=core.firstData.name) { - alert("存档和游戏不一致!"); - return; - } - if (core.isset(obj.version) && obj.version!=core.firstData.version) { - // alert("游戏版本不一致!"); - if (!confirm("游戏版本不一致!\n你仍然想播放录像吗?")) - return; - } - if (!core.isset(obj.route) || !core.isset(obj.hard)) { - alert("无效的录像!"); - return; - } - - core.dom.startPanel.style.display = 'none'; - core.resetStatus(core.firstData.hero, obj.hard, core.firstData.floorId, null, core.initStatus.maps); - core.setFlag('seed', obj.seed); - core.setFlag('rand', obj.seed); - core.events.setInitData(obj.hard); - core.changeFloor(core.status.floorId, null, core.firstData.hero.loc, null, function() { - core.startReplay(core.decodeRoute(obj.route)); - }, true); - }, function () { - - }) + core.chooseReplayFile(); } diff --git a/project/data.js b/project/data.js index 2a73e455..74c27764 100644 --- a/project/data.js +++ b/project/data.js @@ -27,7 +27,10 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "item.mp3", "equip.mp3", "zone.mp3", - "jump.mp3" + "jump.mp3", + "pickaxe.mp3", + "bomb.mp3", + "centerFly.mp3" ], "startBackground": "bg.jpg", "startLogoStyle": "color: black", @@ -56,7 +59,11 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "statusLeftBackground": "url(project/images/ground.png) repeat", "statusTopBackground": "url(project/images/ground.png) repeat", "toolsBackground": "url(project/images/ground.png) repeat", - "borderColor": "white" + "borderColor": "white", + "statusBarColor": "white", + "hardLabelColor": "red", + "floorChangingBackground": "black", + "floorChangingTextColor": "white" }, "firstData": { "title": "魔塔样板", @@ -219,10 +226,8 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "displayExtraDamage": true, "enableGentleClick": true, "potionWhileRouting": false, - "enableViewMaps": true, "portalWithoutTrigger": true, "canGoDeadZone": false, - "enableMoveDirectly": true, - "clickMoveDirectly": true + "enableMoveDirectly": true } } \ No newline at end of file diff --git a/project/icons.js b/project/icons.js index 314c671a..bcb69d6a 100644 --- a/project/icons.js +++ b/project/icons.js @@ -64,11 +64,11 @@ icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 = 'greenDoor': 7, 'specialDoor': 8, 'steelDoor': 9, - 'yellowWallDoor': 10, - 'whiteWallDoor': 11, - 'blueWallDoor': 12, - 'lavaDoor': 13, - 'starDoor': 14, + 'yellowWall': 10, + 'whiteWall': 11, + 'blueWall': 12, + 'crystalUp': 13, + 'crystalBottom': 14, 'starPortal': 15, 'fire': 16, 'portal': 17, diff --git a/project/images/animates.png b/project/images/animates.png index f6245285..3a901cb8 100644 Binary files a/project/images/animates.png and b/project/images/animates.png differ diff --git a/project/items.js b/project/items.js index d4bedf6e..ac20097b 100644 --- a/project/items.js +++ b/project/items.js @@ -15,35 +15,43 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = }, "redJewel": { "cls": "items", - "name": "红宝石" + "name": "红宝石", + "text": "',攻击+'+core.values.redJewel" }, "blueJewel": { "cls": "items", - "name": "蓝宝石" + "name": "蓝宝石", + "text": "',防御+'+core.values.blueJewel" }, "greenJewel": { "cls": "items", - "name": "绿宝石" + "name": "绿宝石", + "text": "',魔防+'+core.values.greenJewel" }, "yellowJewel": { "cls": "items", - "name": "黄宝石" + "name": "黄宝石", + "text": "可以进行加点" }, "redPotion": { "cls": "items", - "name": "红血瓶" + "name": "红血瓶", + "text": "',生命+'+core.values.redPotion" }, "bluePotion": { "cls": "items", - "name": "蓝血瓶" + "name": "蓝血瓶", + "text": "',生命+'+core.values.bluePotion" }, "yellowPotion": { "cls": "items", - "name": "黄血瓶" + "name": "黄血瓶", + "text": "'生命+'+core.values.yellowPotion" }, "greenPotion": { "cls": "items", - "name": "绿血瓶" + "name": "绿血瓶", + "text": "',生命+'+core.values.greenPotion" }, "sword0": { "cls": "items", @@ -343,13 +351,13 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "book": "core.ui.drawBook(0);", "fly": "core.ui.drawFly(core.status.hero.flyRange.indexOf(core.status.floorId));", "earthquake": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n});", - "pickaxe": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n});", + "pickaxe": "core.playSound('pickaxe.mp3');\ncore.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n});", "icePickaxe": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n});", "snow": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n});", "bigKey": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n});", - "bomb": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.events.afterUseBomb();\n});", - "hammer": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.events.afterUseBomb();\n});", - "centerFly": "core.clearMap('hero');\ncore.setHeroLoc('x', (core.bigmap.width||13)-1-core.getHeroLoc('x'));\ncore.setHeroLoc('y', (core.bigmap.height||13)-1-core.getHeroLoc('y'));\ncore.drawHero();\ncore.drawTip(core.material.items[itemId].name + '使用成功');", + "bomb": "core.playSound('bomb.mp3');\ncore.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.events.afterUseBomb();\n});", + "hammer": "core.playSound('bomb.mp3');\ncore.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.events.afterUseBomb();\n});", + "centerFly": "core.playSound('centerFly.mp3');\ncore.clearMap('hero');\ncore.setHeroLoc('x', (core.bigmap.width||13)-1-core.getHeroLoc('x'));\ncore.setHeroLoc('y', (core.bigmap.height||13)-1-core.getHeroLoc('y'));\ncore.drawHero();\ncore.drawTip(core.material.items[itemId].name + '使用成功');", "upFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.data.x, 'y': core.status.event.data.y};\ncore.changeFloor(core.status.event.data.id, null, loc, null, function (){\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.replay();\n});", "downFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.data.x, 'y': core.status.event.data.y};\ncore.changeFloor(core.status.event.data.id, null, loc, null, function (){\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\tcore.replay();\n});", "poisonWine": "core.setFlag('poison', false);", @@ -357,7 +365,15 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "curseWine": "core.setFlag('curse', false);", "superWine": "core.setFlag('poison', false);\nif (core.hasFlag('weak')) {\n\tcore.setFlag('weak', false);\n\tcore.status.hero.atk += core.getFlag('weakAtk', core.values.weakValue);\n\tcore.status.hero.def += core.getFlag('weakDef', core.values.weakValue);\n}\ncore.setFlag('curse', false);", "lifeWand": "core.insertAction([\n\t{\"type\": \"input\", \"text\": \"请输入生命魔杖使用次数:(0-${item:lifeWand})\"},\n\t{\"type\": \"if\", \"condition\": \"flag:input<=item:lifeWand\",\n\t\t\"true\": [\n\t\t\t{\"type\": \"setValue\", \"name\": \"item:lifeWand\", \"value\": \"item:lifeWand-flag:input\"},\n\t\t\t{\"type\": \"setValue\", \"name\": \"status:hp\", \"value\": \"status:hp+flag:input*100\"},\n\t\t\t\"成功使用${flag:input}次生命魔杖,恢复${flag:input*100}点生命。\"\n\t\t],\n\t\t\"false\": [\"输入不合法!\"]\n\t},\n]);\ncore.addItem('lifeWand', 1);", - "jumpShoes": "core.insertAction({\"type\":\"jumpHero\",\"loc\":[core.nextX(2),core.nextY(2)]});" + "jumpShoes": "core.insertAction({\"type\":\"jumpHero\",\"loc\":[core.nextX(2),core.nextY(2)]});", + "redPotion": "core.status.hero.hp += core.values.redPotion", + "bluePotion": "core.status.hero.hp += core.values.bluePotion", + "greenPotion": "core.status.hero.hp += core.values.greenPotion", + "yellowPotion": "core.status.hero.hp += core.values.yellowPotion", + "redJewel": "core.status.hero.atk += core.values.redJewel", + "blueJewel": "core.status.hero.def += core.values.blueJewel", + "greenJewel": "core.status.hero.mdef += core.values.greenJewel", + "yellowJewel": "core.insertAction([\n\t{\"type\": \"choices\", \"choices\": [\n\t\t{\"text\": \"攻击+1\", \"action\": [\n\t\t\t{\"type\": \"setValue\", \"name\": \"status:atk\", \"value\": \"status:atk+1\"}\n\t\t]},\n\t\t{\"text\": \"防御+2\", \"action\": [\n\t\t\t{\"type\": \"setValue\", \"name\": \"status:def\", \"value\": \"status:def+2\"}\n\t\t]},\n\t\t{\"text\": \"生命+200\", \"action\": [\n\t\t\t{\"type\": \"setValue\", \"name\": \"status:hp\", \"value\": \"status:hp+200\"}\n\t\t]},\n\t]}\n]);" }, "canUseItemEffect": { "book": "true", @@ -377,6 +393,14 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "curseWine": "core.hasFlag('curse')", "superWine": "core.hasFlag('poison') || core.hasFlag('weak') || core.hasFlag('curse')", "lifeWand": "true", - "jumpShoes": "var nx=core.nextX(2),ny=core.nextY(2);nx>=0&&nx=0&&ny=0&&nx=0&&ny