commit
5369bc2a16
@ -455,8 +455,8 @@ HTML5魔塔交流群群号: `539113091`
|
|||||||
|
|
||||||
[@wadxm](https://github.com/wadxm) iOS平台的APP(因为苹果政策无法上架)和启动服务mac版的开发者。我们现在能在mac上制作魔塔得归功于他。
|
[@wadxm](https://github.com/wadxm) iOS平台的APP(因为苹果政策无法上架)和启动服务mac版的开发者。我们现在能在mac上制作魔塔得归功于他。
|
||||||
|
|
||||||
[@fux4](https://github.com/fux4) 打通了RM和H5之间的障壁(从而使RM动画导出器和怪物数据导出器成为可能),同时也是部分新功能(如跳跃、跟随、画面震动)等的编写者。
|
[@fux4](https://github.com/fux4) 打通了RM和H5之间的障壁(从而使RM动画导出器和怪物数据导出器成为可能),同时也是大地图和部分新功能(如跳跃、跟随、画面震动)等的编写者。
|
||||||
|
|
||||||
[@tocque](https://github.com/tocque) 装备栏的编写者。
|
[@tocque](https://github.com/tocque) 装备栏、动态创建图层等的编写者。
|
||||||
|
|
||||||
以及[百度贴吧魔塔吧](https://tieba.baidu.com/f?kw=%E9%AD%94%E5%A1%94)和H5魔塔交流群`539113091`内的诸位魔塔爱好者们对本样板的大力支持!
|
以及[百度贴吧魔塔吧](https://tieba.baidu.com/f?kw=%E9%AD%94%E5%A1%94)和H5魔塔交流群`539113091`内的诸位魔塔爱好者们对本样板的大力支持!
|
||||||
|
|||||||
2
_server/blockly/Converter.bundle.min.js
vendored
2
_server/blockly/Converter.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
@ -231,6 +231,7 @@ action
|
|||||||
| setFloor_s
|
| setFloor_s
|
||||||
| setGlobalAttribute_s
|
| setGlobalAttribute_s
|
||||||
| setGlobalValue_s
|
| setGlobalValue_s
|
||||||
|
| setGlobalFlag_s
|
||||||
| show_s
|
| show_s
|
||||||
| hide_s
|
| hide_s
|
||||||
| trigger_s
|
| trigger_s
|
||||||
@ -293,6 +294,9 @@ action
|
|||||||
| input_s
|
| input_s
|
||||||
| input2_s
|
| input2_s
|
||||||
| choices_s
|
| choices_s
|
||||||
|
| callBook_s
|
||||||
|
| callSave_s
|
||||||
|
| callLoad_s
|
||||||
| function_s
|
| function_s
|
||||||
| pass_s
|
| pass_s
|
||||||
;
|
;
|
||||||
@ -384,13 +388,13 @@ return code;
|
|||||||
*/;
|
*/;
|
||||||
|
|
||||||
setText_s
|
setText_s
|
||||||
: '设置剧情文本的属性' '位置' SetTextPosition_List '偏移像素' EvalString? BGNL? '标题颜色' EvalString? '正文颜色' EvalString? '背景色' EvalString? '粗体' B_1_List BGNL? '标题字体大小' EvalString? '正文字体大小' EvalString? '打字间隔' EvalString? Newline
|
: '设置剧情文本的属性' '位置' SetTextPosition_List '偏移像素' EvalString? BGNL? '标题颜色' EvalString? Colour '正文颜色' EvalString? Colour '背景色' EvalString? Colour BGNL? '粗体' B_1_List '标题字体大小' EvalString? '正文字体大小' EvalString? '打字间隔' EvalString? Newline
|
||||||
|
|
||||||
|
|
||||||
/* setText_s
|
/* setText_s
|
||||||
tooltip : setText:设置剧情文本的属性,颜色为RGB三元组或RGBA四元组,打字间隔为剧情文字添加的时间间隔,为整数或不填
|
tooltip : setText:设置剧情文本的属性,颜色为RGB三元组或RGBA四元组,打字间隔为剧情文字添加的时间间隔,为整数或不填
|
||||||
helpUrl : https://h5mota.com/games/template/docs/#/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
|
helpUrl : https://h5mota.com/games/template/docs/#/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,"","",'rgba(255,255,255,1)',"",'rgba(255,255,255,1)',"",'rgba(255,255,255,1)',null,"","",""]
|
||||||
SetTextPosition_List_0 =SetTextPosition_List_0==='null'?'': ', "position": "'+SetTextPosition_List_0+'"';
|
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)?$/;
|
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 (EvalString_0) {
|
||||||
@ -500,6 +504,20 @@ return code;
|
|||||||
*/;
|
*/;
|
||||||
|
|
||||||
|
|
||||||
|
setGlobalFlag_s
|
||||||
|
: '设置系统开关' ':' Global_Flag_List Bool Newline
|
||||||
|
|
||||||
|
|
||||||
|
/* setGlobalFlag_s
|
||||||
|
tooltip : setGlobalFlag:设置系统开关
|
||||||
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=setGlobalFlag%ef%bc%9a%e8%ae%be%e7%bd%ae%e4%b8%80%e4%b8%aa%e7%b3%bb%e7%bb%9f%e5%bc%80%e5%85%b3
|
||||||
|
default : ["enableFloor","true"]
|
||||||
|
colour : this.dataColor
|
||||||
|
var code = '{"type": "setGlobalFlag", "name": "'+Global_Flag_List_0+'", "value": '+Bool_0+'},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
|
||||||
show_s
|
show_s
|
||||||
: '显示事件' 'x' EvalString? ',' 'y' EvalString? '楼层' IdString? '动画时间' Int? '不等待执行完毕' Bool? Newline
|
: '显示事件' 'x' EvalString? ',' 'y' EvalString? '楼层' IdString? '动画时间' Int? '不等待执行完毕' Bool? Newline
|
||||||
|
|
||||||
@ -842,15 +860,16 @@ return code;
|
|||||||
*/;
|
*/;
|
||||||
|
|
||||||
sleep_s
|
sleep_s
|
||||||
: '等待' Int '毫秒' Newline
|
: '等待' Int '毫秒' '不可被Ctrl跳过' Bool Newline
|
||||||
|
|
||||||
|
|
||||||
/* sleep_s
|
/* sleep_s
|
||||||
tooltip : sleep: 等待多少毫秒
|
tooltip : sleep: 等待多少毫秒
|
||||||
helpUrl : https://h5mota.com/games/template/docs/#/event?id=sleep%EF%BC%9A%E7%AD%89%E5%BE%85%E5%A4%9A%E5%B0%91%E6%AF%AB%E7%A7%92
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=sleep%EF%BC%9A%E7%AD%89%E5%BE%85%E5%A4%9A%E5%B0%91%E6%AF%AB%E7%A7%92
|
||||||
default : [500]
|
default : [500, false]
|
||||||
colour : this.soundColor
|
colour : this.soundColor
|
||||||
var code = '{"type": "sleep", "time": '+Int_0+'},\n';
|
Bool_0 = Bool_0?', "noSkip": true':'';
|
||||||
|
var code = '{"type": "sleep", "time": '+Int_0+Bool_0+'},\n';
|
||||||
return code;
|
return code;
|
||||||
*/;
|
*/;
|
||||||
|
|
||||||
@ -1118,13 +1137,13 @@ return code;
|
|||||||
*/;
|
*/;
|
||||||
|
|
||||||
setFg_0_s
|
setFg_0_s
|
||||||
: '更改画面色调' EvalString '动画时间' Int? '不等待执行完毕' Bool Newline
|
: '更改画面色调' EvalString Colour '动画时间' Int? '不等待执行完毕' Bool Newline
|
||||||
|
|
||||||
|
|
||||||
/* setFg_0_s
|
/* setFg_0_s
|
||||||
tooltip : setFg: 更改画面色调,动画时间可不填
|
tooltip : setFg: 更改画面色调,动画时间可不填
|
||||||
helpUrl : https://h5mota.com/games/template/docs/#/event?id=setfg%EF%BC%9A%E6%9B%B4%E6%94%B9%E7%94%BB%E9%9D%A2%E8%89%B2%E8%B0%83
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=setfg%EF%BC%9A%E6%9B%B4%E6%94%B9%E7%94%BB%E9%9D%A2%E8%89%B2%E8%B0%83
|
||||||
default : ["255,255,255,1",500,false]
|
default : ["255,255,255,1",'rgba(255,255,255,1)',500,false]
|
||||||
colour : this.soundColor
|
colour : this.soundColor
|
||||||
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)?$/;
|
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 (!colorRe.test(EvalString_0))throw new Error('颜色格式错误,形如:0~255,0~255,0~255,0~1');
|
if (!colorRe.test(EvalString_0))throw new Error('颜色格式错误,形如:0~255,0~255,0~255,0~1');
|
||||||
@ -1150,12 +1169,12 @@ return code;
|
|||||||
*/;
|
*/;
|
||||||
|
|
||||||
screenFlash_s
|
screenFlash_s
|
||||||
: '画面闪烁' EvalString '单次时间' Int '执行次数' Int? '不等待执行完毕' Bool Newline
|
: '画面闪烁' EvalString Colour '单次时间' Int '执行次数' Int? '不等待执行完毕' Bool Newline
|
||||||
|
|
||||||
/* screenFlash_s
|
/* screenFlash_s
|
||||||
tooltip : screenFlash: 画面闪烁,动画时间可不填
|
tooltip : screenFlash: 画面闪烁,动画时间可不填
|
||||||
helpUrl : https://h5mota.com/games/template/docs/#/event?id=screenFlash%EF%BC%9A%E7%94%BB%E9%9D%A2%E9%97%AA%E7%83%81
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=screenFlash%EF%BC%9A%E7%94%BB%E9%9D%A2%E9%97%AA%E7%83%81
|
||||||
default : ["255,255,255,1",500,1,false]
|
default : ["255,255,255,1",'rgba(255,255,255,1)',500,1,false]
|
||||||
colour : this.soundColor
|
colour : this.soundColor
|
||||||
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)?$/;
|
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 (!colorRe.test(EvalString_0))throw new Error('颜色格式错误,形如:0~255,0~255,0~255,0~1');
|
if (!colorRe.test(EvalString_0))throw new Error('颜色格式错误,形如:0~255,0~255,0~255,0~1');
|
||||||
@ -1540,6 +1559,45 @@ return code;
|
|||||||
*/;
|
*/;
|
||||||
|
|
||||||
|
|
||||||
|
callBook_s
|
||||||
|
: '呼出怪物手册'
|
||||||
|
|
||||||
|
|
||||||
|
/* callBook_s
|
||||||
|
tooltip : callBook: 呼出怪物手册;返回游戏后将继续执行后面的事件
|
||||||
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=callBook%ef%bc%9a%e5%91%bc%e5%87%ba%e6%80%aa%e7%89%a9%e6%89%8b%e5%86%8c
|
||||||
|
colour : this.soundColor
|
||||||
|
var code = '{"type": "callBook"},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
|
||||||
|
callSave_s
|
||||||
|
: '呼出存档页面'
|
||||||
|
|
||||||
|
|
||||||
|
/* callSave_s
|
||||||
|
tooltip : callSave: 呼出存档页面;之后读此档将执行eachArrive
|
||||||
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=callSave%ef%bc%9a%e5%91%bc%e5%87%ba%e5%ad%98%e6%a1%a3%e7%95%8c%e9%9d%a2
|
||||||
|
colour : this.soundColor
|
||||||
|
var code = '{"type": "callSave"},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
|
||||||
|
callLoad_s
|
||||||
|
: '呼出读档页面'
|
||||||
|
|
||||||
|
|
||||||
|
/* callLoad_s
|
||||||
|
tooltip : callLoad: 呼出存档页面;返回游戏后将继续执行后面的事件
|
||||||
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=callLoad%ef%bc%9a%e5%91%bc%e5%87%ba%e8%af%bb%e6%a1%a3%e7%95%8c%e9%9d%a2
|
||||||
|
colour : this.soundColor
|
||||||
|
var code = '{"type": "callLoad"},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
|
||||||
function_s
|
function_s
|
||||||
: '自定义JS脚本' '不自动执行下一个事件' Bool BGNL? Newline RawEvalString Newline BEND Newline
|
: '自定义JS脚本' '不自动执行下一个事件' Bool BGNL? Newline RawEvalString Newline BEND Newline
|
||||||
|
|
||||||
@ -1643,7 +1701,6 @@ colour : this.idstring_eColor
|
|||||||
default : [null,"自定义flag"]
|
default : [null,"自定义flag"]
|
||||||
//todo 将其output改成'idString_e'
|
//todo 将其output改成'idString_e'
|
||||||
var code = Id_List_0+':'+IdText_0;
|
var code = Id_List_0+':'+IdText_0;
|
||||||
if (Id_List_0 === 'flag0') code = "flag:__"+IdText_0+"__";
|
|
||||||
return [code, Blockly.JavaScript.ORDER_ATOMIC];
|
return [code, Blockly.JavaScript.ORDER_ATOMIC];
|
||||||
*/;
|
*/;
|
||||||
|
|
||||||
@ -1667,7 +1724,7 @@ evFlag_e
|
|||||||
/* evFlag_e
|
/* evFlag_e
|
||||||
colour : this.idstring_eColor
|
colour : this.idstring_eColor
|
||||||
default : ["A"]
|
default : ["A"]
|
||||||
var code = "flag:__"+Letter_List_0+"__";
|
var code = "switch:"+Letter_List_0;
|
||||||
return [code, Blockly.JavaScript.ORDER_ATOMIC];
|
return [code, Blockly.JavaScript.ORDER_ATOMIC];
|
||||||
*/;
|
*/;
|
||||||
|
|
||||||
@ -1744,6 +1801,19 @@ Global_Value_List
|
|||||||
: '血网伤害'|'中毒伤害'|'衰弱效果'|'红宝石效果'|'蓝宝石效果'|'绿宝石效果'|'红血瓶效果'|'蓝血瓶效果'|'黄血瓶效果'|'绿血瓶效果'|'破甲比例'|'反击比例'|'净化比例'|'仇恨增加值'|'行走速度'|'动画时间'|'楼层切换时间'
|
: '血网伤害'|'中毒伤害'|'衰弱效果'|'红宝石效果'|'蓝宝石效果'|'绿宝石效果'|'红血瓶效果'|'蓝血瓶效果'|'黄血瓶效果'|'绿血瓶效果'|'破甲比例'|'反击比例'|'净化比例'|'仇恨增加值'|'行走速度'|'动画时间'|'楼层切换时间'
|
||||||
/*Global_Value_List ['lavaDamage','poisonDamage','weakValue', 'redJewel', 'blueJewel', 'greenJewel', 'redPotion', 'bluePotion', 'yellowPotion', 'greenPotion', 'breakArmor', 'counterAttack', 'purify', 'hatred', 'moveSpeed', 'animateSpeed', 'floorChangeTime']*/;
|
/*Global_Value_List ['lavaDamage','poisonDamage','weakValue', 'redJewel', 'blueJewel', 'greenJewel', 'redPotion', 'bluePotion', 'yellowPotion', 'greenPotion', 'breakArmor', 'counterAttack', 'purify', 'hatred', 'moveSpeed', 'animateSpeed', 'floorChangeTime']*/;
|
||||||
|
|
||||||
|
|
||||||
|
Global_Flag_List
|
||||||
|
: '显示当前楼层'|'显示勇士图标'|'显示当前等级'|'启用生命上限'|'显示魔力值'|'显示魔防值'|'显示金币值'|'显示经验值'|'允许等级提升'|'升级扣除模式'|'显示钥匙数量'|'显示破炸飞'|'显示毒衰咒'|'显示当前技能'|'楼梯边才能楼传'|'开启加点'|'开启负伤'|'循环计算临界'|'允许轻按'|'允许走到将死领域'|'允许瞬间移动'|'阻激夹域后禁用快捷商店'
|
||||||
|
/*Global_Flag_List ['enableFloor','enableName','enableLv', 'enableHPMax', 'enableMana', 'enableMDef', 'enableMoney', 'enableExperience', 'enableLevelUp', 'levelUpLeftMode', 'enableKeys', 'enablePZF', 'enableDebuff', 'enableSkill', 'flyNearStair', 'enableAddPoint', 'enableNegativeDamage', 'useLoop', 'enableGentleClick', 'canGoDeadZone', 'enableMoveDirectly', 'disableShopOnDamage']*/;
|
||||||
|
|
||||||
|
Colour
|
||||||
|
: 'sdeirughvuiyasdeb'+ //为了被识别为复杂词法规则
|
||||||
|
;
|
||||||
|
|
||||||
|
Angle
|
||||||
|
: 'sdeirughvuiyasdeb'+ //为了被识别为复杂词法规则
|
||||||
|
;
|
||||||
|
|
||||||
Bool: 'TRUE'
|
Bool: 'TRUE'
|
||||||
| 'FALSE'
|
| 'FALSE'
|
||||||
;
|
;
|
||||||
@ -1751,8 +1821,8 @@ Bool: 'TRUE'
|
|||||||
Int : '0' | [1-9][0-9]* ; // no leading zeros
|
Int : '0' | [1-9][0-9]* ; // no leading zeros
|
||||||
|
|
||||||
Letter_List
|
Letter_List
|
||||||
: 'A'|'B'|'C'|'D'|'E'|'F'|'G'|'H'|'I'|'J'|'K'|'L'|'M'|'N'|'O'|'P'|'Q'|'R'|'S'|'T'|'U'|'V'|'W'|'X'|'Y'|'Z'
|
: 'A'|'B'|'C'|'D'|'E'|'F'
|
||||||
/*Letter_List ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']*/;
|
/*Letter_List ['A','B','C','D','E','F']*/;
|
||||||
|
|
||||||
|
|
||||||
Number
|
Number
|
||||||
@ -1784,7 +1854,7 @@ FixedId_List
|
|||||||
|
|
||||||
Id_List
|
Id_List
|
||||||
: '变量' | '状态' | '物品' | '独立开关'
|
: '变量' | '状态' | '物品' | '独立开关'
|
||||||
/*Id_List ['flag','status','item', 'flag0']*/;
|
/*Id_List ['flag','status','item', 'switch']*/;
|
||||||
|
|
||||||
//转blockly后不保留需要加"
|
//转blockly后不保留需要加"
|
||||||
EvalString
|
EvalString
|
||||||
@ -1845,6 +1915,7 @@ this.evisitor.commentColor=285;
|
|||||||
delete(this.block('negate_e').inputsInline);
|
delete(this.block('negate_e').inputsInline);
|
||||||
this.block('idString_1_e').output='idString_e';
|
this.block('idString_1_e').output='idString_e';
|
||||||
this.block('idString_2_e').output='idString_e';
|
this.block('idString_2_e').output='idString_e';
|
||||||
|
this.block('evFlag_e').output='idString_e';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Functions
|
/* Functions
|
||||||
@ -1981,7 +2052,7 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
data.time, data.async||false, this.EvalString(data.text), this.next]);
|
data.time, data.async||false, this.EvalString(data.text), this.next]);
|
||||||
break;
|
break;
|
||||||
case "comment": // 注释
|
case "comment": // 注释
|
||||||
this.next = MotaActionBlocks['comment_s'].xmlText([this.EvalString(data.text),this.next]);
|
this.next = MotaActionBlocks['comment_s'].xmlText([this.EvalString(data.text),this.next],null,data.text);
|
||||||
break;
|
break;
|
||||||
case "setText": // 设置剧情文本的属性
|
case "setText": // 设置剧情文本的属性
|
||||||
var setTextfunc = function(a){return a?JSON.stringify(a).slice(1,-1):null;}
|
var setTextfunc = function(a){return a?JSON.stringify(a).slice(1,-1):null;}
|
||||||
@ -1990,7 +2061,7 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
if (!/^\w+\.png$/.test(data.background))
|
if (!/^\w+\.png$/.test(data.background))
|
||||||
data.background=setTextfunc(data.background);
|
data.background=setTextfunc(data.background);
|
||||||
this.next = MotaActionBlocks['setText_s'].xmlText([
|
this.next = MotaActionBlocks['setText_s'].xmlText([
|
||||||
data.position,data.offset,data.title,data.text,data.background,data.bold,data.titlefont,data.textfont,data.time,this.next]);
|
data.position,data.offset,data.title,`rgba(${data.title})`,data.text,`rgba(${data.text})`,data.background,`rgba(${data.background})`,data.bold,data.titlefont,data.textfont,data.time,this.next]);
|
||||||
break;
|
break;
|
||||||
case "tip":
|
case "tip":
|
||||||
this.next = MotaActionBlocks['tip_s'].xmlText([
|
this.next = MotaActionBlocks['tip_s'].xmlText([
|
||||||
@ -2162,7 +2233,7 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
case "setFg": // 颜色渐变
|
case "setFg": // 颜色渐变
|
||||||
if(this.isset(data.color)){
|
if(this.isset(data.color)){
|
||||||
this.next = MotaActionBlocks['setFg_0_s'].xmlText([
|
this.next = MotaActionBlocks['setFg_0_s'].xmlText([
|
||||||
data.color,data.time||0,data.async||false,this.next]);
|
data.color,`rgba(${data.color})`,data.time||0,data.async||false,this.next]);
|
||||||
} else {
|
} else {
|
||||||
this.next = MotaActionBlocks['setFg_1_s'].xmlText([
|
this.next = MotaActionBlocks['setFg_1_s'].xmlText([
|
||||||
data.time||0,data.async||false,this.next]);
|
data.time||0,data.async||false,this.next]);
|
||||||
@ -2170,7 +2241,7 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
break;
|
break;
|
||||||
case "screenFlash": // 画面闪烁
|
case "screenFlash": // 画面闪烁
|
||||||
this.next = MotaActionBlocks['screenFlash_s'].xmlText([
|
this.next = MotaActionBlocks['screenFlash_s'].xmlText([
|
||||||
data.color,data.time||500,data.times||1,data.async||false,this.next]);
|
data.color,`rgba(${data.color})`,data.time||500,data.times||1,data.async||false,this.next]);
|
||||||
break;
|
break;
|
||||||
case "setWeather": // 更改天气
|
case "setWeather": // 更改天气
|
||||||
this.next = MotaActionBlocks['setWeather_s'].xmlText([
|
this.next = MotaActionBlocks['setWeather_s'].xmlText([
|
||||||
@ -2231,7 +2302,8 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
break
|
break
|
||||||
case "setValue":
|
case "setValue":
|
||||||
this.next = MotaActionBlocks['setValue_s'].xmlText([
|
this.next = MotaActionBlocks['setValue_s'].xmlText([
|
||||||
MotaActionBlocks['idString_e'].xmlText([data.name]),
|
// MotaActionBlocks['idString_e'].xmlText([data.name]),
|
||||||
|
this.tryToUseEvFlag_e('idString_e', [data.name]),
|
||||||
MotaActionBlocks['evalString_e'].xmlText([data.value]),
|
MotaActionBlocks['evalString_e'].xmlText([data.value]),
|
||||||
this.next]);
|
this.next]);
|
||||||
break;
|
break;
|
||||||
@ -2247,6 +2319,10 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
this.next = MotaActionBlocks['setGlobalValue_s'].xmlText([
|
this.next = MotaActionBlocks['setGlobalValue_s'].xmlText([
|
||||||
data.name, data.value, this.next]);
|
data.name, data.value, this.next]);
|
||||||
break;
|
break;
|
||||||
|
case "setGlobalFlag":
|
||||||
|
this.next = MotaActionBlocks['setGlobalFlag_s'].xmlText([
|
||||||
|
data.name, data.value, this.next]);
|
||||||
|
break;
|
||||||
case "input":
|
case "input":
|
||||||
this.next = MotaActionBlocks['input_s'].xmlText([
|
this.next = MotaActionBlocks['input_s'].xmlText([
|
||||||
data.text,this.next]);
|
data.text,this.next]);
|
||||||
@ -2257,7 +2333,8 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
break;
|
break;
|
||||||
case "if": // 条件判断
|
case "if": // 条件判断
|
||||||
this.next = MotaActionBlocks['if_s'].xmlText([
|
this.next = MotaActionBlocks['if_s'].xmlText([
|
||||||
MotaActionBlocks['evalString_e'].xmlText([data.condition]),
|
// MotaActionBlocks['evalString_e'].xmlText([data.condition]),
|
||||||
|
this.tryToUseEvFlag_e('evalString_e', [data.condition]),
|
||||||
this.insertActionList(data["true"]),
|
this.insertActionList(data["true"]),
|
||||||
this.insertActionList(data["false"]),
|
this.insertActionList(data["false"]),
|
||||||
this.next]);
|
this.next]);
|
||||||
@ -2269,7 +2346,9 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
this.isset(caseNow.case)?MotaActionBlocks['evalString_e'].xmlText([caseNow.case]):"值",this.insertActionList(caseNow.action),case_caseList]);
|
this.isset(caseNow.case)?MotaActionBlocks['evalString_e'].xmlText([caseNow.case]):"值",this.insertActionList(caseNow.action),case_caseList]);
|
||||||
}
|
}
|
||||||
this.next = MotaActionBlocks['switch_s'].xmlText([
|
this.next = MotaActionBlocks['switch_s'].xmlText([
|
||||||
MotaActionBlocks['evalString_e'].xmlText([data.condition]),case_caseList,this.next]);
|
// MotaActionBlocks['evalString_e'].xmlText([data.condition]),
|
||||||
|
this.tryToUseEvFlag_e('evalString_e', [data.condition]),
|
||||||
|
case_caseList,this.next]);
|
||||||
break;
|
break;
|
||||||
case "choices": // 提供选项
|
case "choices": // 提供选项
|
||||||
var text_choices = null;
|
var text_choices = null;
|
||||||
@ -2282,7 +2361,8 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
break;
|
break;
|
||||||
case "while": // 循环处理
|
case "while": // 循环处理
|
||||||
this.next = MotaActionBlocks['while_s'].xmlText([
|
this.next = MotaActionBlocks['while_s'].xmlText([
|
||||||
MotaActionBlocks['evalString_e'].xmlText([data.condition]),
|
// MotaActionBlocks['evalString_e'].xmlText([data.condition]),
|
||||||
|
this.tryToUseEvFlag_e('evalString_e', [data.condition]),
|
||||||
this.insertActionList(data["data"]),
|
this.insertActionList(data["data"]),
|
||||||
this.next]);
|
this.next]);
|
||||||
break;
|
break;
|
||||||
@ -2326,7 +2406,7 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
break;
|
break;
|
||||||
case "sleep": // 等待多少毫秒
|
case "sleep": // 等待多少毫秒
|
||||||
this.next = MotaActionBlocks['sleep_s'].xmlText([
|
this.next = MotaActionBlocks['sleep_s'].xmlText([
|
||||||
data.time||0,this.next]);
|
data.time||0,data.noSkip||false,this.next]);
|
||||||
break;
|
break;
|
||||||
case "wait": // 等待用户操作
|
case "wait": // 等待用户操作
|
||||||
this.next = MotaActionBlocks['wait_s'].xmlText([
|
this.next = MotaActionBlocks['wait_s'].xmlText([
|
||||||
@ -2340,6 +2420,18 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
this.next = MotaActionBlocks['revisit_s'].xmlText([
|
this.next = MotaActionBlocks['revisit_s'].xmlText([
|
||||||
this.next]);
|
this.next]);
|
||||||
break;
|
break;
|
||||||
|
case "callBook": // 呼出怪物手册
|
||||||
|
this.next = MotaActionBlocks['callBook_s'].xmlText([
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
|
case "callSave": // 呼出存档界面
|
||||||
|
this.next = MotaActionBlocks['callSave_s'].xmlText([
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
|
case "callLoad": // 呼出读档界面
|
||||||
|
this.next = MotaActionBlocks['callLoad_s'].xmlText([
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
case "exit": // 立刻结束事件
|
case "exit": // 立刻结束事件
|
||||||
this.next = MotaActionBlocks['exit_s'].xmlText([
|
this.next = MotaActionBlocks['exit_s'].xmlText([
|
||||||
this.next]);
|
this.next]);
|
||||||
@ -2392,6 +2484,15 @@ ActionParser.prototype.EvalString = function(EvalString) {
|
|||||||
return EvalString.split('\b').join('\\b').split('\t').join('\\t').split('\n').join('\\n');
|
return EvalString.split('\b').join('\\b').split('\t').join('\\t').split('\n').join('\\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ActionParser.prototype.tryToUseEvFlag_e = function(defaultType, args, isShadow, comment) {
|
||||||
|
var match=/^switch:([A-F])$/.exec(args[0])
|
||||||
|
if(match){
|
||||||
|
args[0]=match[1]
|
||||||
|
return MotaActionBlocks['evFlag_e'].xmlText(args, isShadow, comment);
|
||||||
|
}
|
||||||
|
return MotaActionBlocks[defaultType||'evalString_e'].xmlText(args, isShadow, comment);
|
||||||
|
}
|
||||||
|
|
||||||
MotaActionFunctions.actionParser = new ActionParser();
|
MotaActionFunctions.actionParser = new ActionParser();
|
||||||
|
|
||||||
MotaActionFunctions.workspace = function(){return workspace}
|
MotaActionFunctions.workspace = function(){return workspace}
|
||||||
|
|||||||
@ -1,263 +1,256 @@
|
|||||||
(function (window) {
|
(function (window) {
|
||||||
window.jsColorPicker = function(selectors, config) {
|
window.jsColorPicker = function(selectors, config) {
|
||||||
var renderCallback = function(colors, mode) {
|
var renderCallback = function(colors, mode) {
|
||||||
var options = this,
|
var options = this,
|
||||||
input = options.input,
|
input = options.input,
|
||||||
patch = options.patch,
|
patch = options.patch,
|
||||||
RGB = colors.RND.rgb,
|
RGB = colors.RND.rgb,
|
||||||
HSL = colors.RND.hsl,
|
HSL = colors.RND.hsl,
|
||||||
AHEX = options.isIE8 ? (colors.alpha < 0.16 ? '0' : '') +
|
AHEX = options.isIE8 ? (colors.alpha < 0.16 ? '0' : '') +
|
||||||
(Math.round(colors.alpha * 100)).toString(16).toUpperCase() + colors.HEX : '',
|
(Math.round(colors.alpha * 100)).toString(16).toUpperCase() + colors.HEX : '',
|
||||||
RGBInnerText = RGB.r + ',' + RGB.g + ',' + RGB.b,
|
RGBInnerText = RGB.r + ',' + RGB.g + ',' + RGB.b,
|
||||||
RGBAText = RGBInnerText + ',' + colors.alpha,
|
RGBAText = RGBInnerText + ',' + colors.alpha,
|
||||||
isAlpha = colors.alpha !== 1 && !options.isIE8,
|
isAlpha = colors.alpha !== 1 && !options.isIE8,
|
||||||
colorMode = input.getAttribute('data-colorMode');
|
colorMode = input.getAttribute('data-colorMode');
|
||||||
|
|
||||||
patch.style.cssText =
|
patch.style.cssText =
|
||||||
'color:' + (colors.rgbaMixCustom.luminance > 0.22 ? '#222' : '#ddd') + ';' + // Black...???
|
'color:' + (colors.rgbaMixCustom.luminance > 0.22 ? '#222' : '#ddd') + ';' + // Black...???
|
||||||
'background-color: rgba(' + RGBAText + ');' +
|
'background-color: rgba(' + RGBAText + ');' +
|
||||||
'filter:' + (options.isIE8 ? 'progid:DXImageTransform.Microsoft.gradient(' + // IE<9
|
'filter:' + (options.isIE8 ? 'progid:DXImageTransform.Microsoft.gradient(' + // IE<9
|
||||||
'startColorstr=#' + AHEX + ',' + 'endColorstr=#' + AHEX + ')' : '');
|
'startColorstr=#' + AHEX + ',' + 'endColorstr=#' + AHEX + ')' : '');
|
||||||
|
|
||||||
input.value = RGBAText;
|
input.value = RGBAText;
|
||||||
|
|
||||||
if (options.displayCallback) {
|
if (options.displayCallback) {
|
||||||
options.displayCallback(colors, mode, options);
|
options.displayCallback(colors, mode, options);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
extractValue = function(elm) {
|
extractValue = function(elm) {
|
||||||
var val = elm.value || elm.getAttribute('value') || elm.style.backgroundColor || "0,0,0,1";
|
var val = elm.value || elm.getAttribute('value') || elm.style.backgroundColor || "0,0,0,1";
|
||||||
if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+,[0-9. ]+$/.test(val)) return "rgba("+val+")";
|
if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+,[0-9. ]+$/.test(val)) return "rgba("+val+")";
|
||||||
if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+$/.test(val)) return "rgba("+val+",1)";
|
if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+$/.test(val)) return "rgba("+val+",1)";
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
actionCallback = function(event, action) {
|
actionCallback = function(event, action) {
|
||||||
var options = this,
|
var options = this,
|
||||||
colorPicker = colorPickers.current;
|
colorPicker = colorPickers.current;
|
||||||
|
|
||||||
if (action === 'toMemory') {
|
if (action === 'toMemory') {
|
||||||
var memos = colorPicker.nodes.memos,
|
var memos = colorPicker.nodes.memos,
|
||||||
backgroundColor = '',
|
backgroundColor = '',
|
||||||
opacity = 0,
|
opacity = 0,
|
||||||
cookieTXT = [];
|
cookieTXT = [];
|
||||||
|
|
||||||
for (var n = 0, m = memos.length; n < m; n++) {
|
for (var n = 0, m = memos.length; n < m; n++) {
|
||||||
backgroundColor = memos[n].style.backgroundColor;
|
backgroundColor = memos[n].style.backgroundColor;
|
||||||
opacity = memos[n].style.opacity;
|
opacity = memos[n].style.opacity;
|
||||||
opacity = Math.round((opacity === '' ? 1 : opacity) * 100) / 100;
|
opacity = Math.round((opacity === '' ? 1 : opacity) * 100) / 100;
|
||||||
cookieTXT.push(backgroundColor.
|
cookieTXT.push(backgroundColor.
|
||||||
replace(/, /g, ',').
|
replace(/, /g, ',').
|
||||||
replace('rgb(', 'rgba(').
|
replace('rgb(', 'rgba(').
|
||||||
replace(')', ',' + opacity + ')')
|
replace(')', ',' + opacity + ')')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
cookieTXT = '\'' + cookieTXT.join('\',\'') + '\'';
|
cookieTXT = '\'' + cookieTXT.join('\',\'') + '\'';
|
||||||
ColorPicker.docCookies('colorPickerMemos' + (options.noAlpha ? 'NoAlpha' : ''), cookieTXT);
|
ColorPicker.docCookies('colorPickerMemos' + (options.noAlpha ? 'NoAlpha' : ''), cookieTXT);
|
||||||
} else if (action === 'resizeApp') {
|
} else if (action === 'resizeApp') {
|
||||||
ColorPicker.docCookies('colorPickerSize', colorPicker.color.options.currentSize);
|
ColorPicker.docCookies('colorPickerSize', colorPicker.color.options.currentSize);
|
||||||
} else if (action === 'modeChange') {
|
} else if (action === 'modeChange') {
|
||||||
var mode = colorPicker.color.options.mode;
|
var mode = colorPicker.color.options.mode;
|
||||||
|
|
||||||
ColorPicker.docCookies('colorPickerMode', mode.type + '-' + mode.z);
|
ColorPicker.docCookies('colorPickerMode', mode.type + '-' + mode.z);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
createInstance = function(elm, config) {
|
createInstance = function(elm, config) {
|
||||||
var initConfig = {
|
var initConfig = {
|
||||||
klass: window.ColorPicker,
|
klass: window.ColorPicker,
|
||||||
input: elm,
|
input: elm,
|
||||||
patch: elm,
|
patch: elm,
|
||||||
isIE8: !!document.all && !document.addEventListener, // Opera???
|
isIE8: !!document.all && !document.addEventListener, // Opera???
|
||||||
// *** animationSpeed: 200,
|
// *** animationSpeed: 200,
|
||||||
// *** draggable: true,
|
// *** draggable: true,
|
||||||
margin: {left: -1, top: 2},
|
margin: {left: -1, top: 2},
|
||||||
customBG: '#FFFFFF',
|
customBG: '#FFFFFF',
|
||||||
// displayCallback: displayCallback,
|
// displayCallback: displayCallback,
|
||||||
/* --- regular colorPicker options from this point --- */
|
/* --- regular colorPicker options from this point --- */
|
||||||
color: extractValue(elm),
|
color: extractValue(elm),
|
||||||
initStyle: 'display: none',
|
initStyle: 'display: none',
|
||||||
mode: ColorPicker.docCookies('colorPickerMode') || 'hsv-h',
|
mode: ColorPicker.docCookies('colorPickerMode') || 'hsv-h',
|
||||||
// memoryColors: (function(colors, config) {
|
// memoryColors: (function(colors, config) {
|
||||||
// return config.noAlpha ?
|
// return config.noAlpha ?
|
||||||
// colors.replace(/\,\d*\.*\d*\)/g, ',1)') : colors;
|
// colors.replace(/\,\d*\.*\d*\)/g, ',1)') : colors;
|
||||||
// })($.docCookies('colorPickerMemos'), config || {}),
|
// })($.docCookies('colorPickerMemos'), config || {}),
|
||||||
memoryColors: ColorPicker.docCookies('colorPickerMemos' +
|
memoryColors: ColorPicker.docCookies('colorPickerMemos' +
|
||||||
((config || {}).noAlpha ? 'NoAlpha' : '')),
|
((config || {}).noAlpha ? 'NoAlpha' : '')),
|
||||||
size: ColorPicker.docCookies('colorPickerSize') || 1,
|
size: ColorPicker.docCookies('colorPickerSize') || 1,
|
||||||
renderCallback: renderCallback,
|
renderCallback: renderCallback,
|
||||||
actionCallback: actionCallback
|
actionCallback: actionCallback
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var n in config) {
|
for (var n in config) {
|
||||||
initConfig[n] = config[n];
|
initConfig[n] = config[n];
|
||||||
}
|
}
|
||||||
return new initConfig.klass(initConfig);
|
return new initConfig.klass(initConfig);
|
||||||
},
|
},
|
||||||
doEventListeners = function(elm, multiple, off) {
|
doEventListeners = function(elm, multiple, off) {
|
||||||
var onOff = off ? 'removeEventListener' : 'addEventListener',
|
var onOff = off ? 'removeEventListener' : 'addEventListener',
|
||||||
inputListener = function(e) {
|
inputListener = function(e) {
|
||||||
var index = multiple ? Array.prototype.indexOf.call(elms, this) : 0,
|
var index = multiple ? Array.prototype.indexOf.call(elms, this) : 0,
|
||||||
colorPicker = colorPickers[index] ||
|
colorPicker = colorPickers[index] ||
|
||||||
(colorPickers[index] = createInstance(this, config)),
|
(colorPickers[index] = createInstance(this, config)),
|
||||||
options = colorPicker.color.options;
|
options = colorPicker.color.options;
|
||||||
|
|
||||||
options.color = extractValue(elm); // brings color to default on reset
|
options.color = extractValue(elm); // brings color to default on reset
|
||||||
//检查颜色合法性
|
//检查颜色合法性
|
||||||
if (options.color != null && options.color == options.color.match(/rgba\([0-9 ]+,[0-9 ]+,[0-9 ]+,[0-9. ]+\)/)[0]) {
|
if (options.color != null && options.color == options.color.match(/rgba\([0-9 ]+,[0-9 ]+,[0-9 ]+,[0-9. ]+\)/)[0]) {
|
||||||
var chec = options.color.match(/[0-9.]+/g);
|
var chec = options.color.match(/[0-9.]+/g);
|
||||||
if (chec.length != 4)
|
if (chec.length != 4)
|
||||||
return;
|
return;
|
||||||
for (var i = 0; i < 3; i++) {
|
for (var i = 0; i < 3; i++) {
|
||||||
if (chec[i] != chec[i].match(/\d+/)[0] || +chec[i] < 0 || +chec[i] > 255)
|
if (chec[i] != chec[i].match(/\d+/)[0] || +chec[i] < 0 || +chec[i] > 255)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (chec[3] != chec[3].match(/\d+(\.\d+)?/)[0] || parseFloat(chec[3]) > 1 || parseFloat(chec[3] < 0))
|
if (chec[3] != chec[3].match(/\d+(\.\d+)?/)[0] || parseFloat(chec[3]) > 1 || parseFloat(chec[3] < 0))
|
||||||
return;
|
return;
|
||||||
if (!multiple) {
|
if (!multiple) {
|
||||||
colorPicker.setColor(extractValue(elm), undefined, undefined, true);
|
colorPicker.setColor(extractValue(elm), undefined, undefined, true);
|
||||||
colorPicker.saveAsBackground();
|
colorPicker.saveAsBackground();
|
||||||
}
|
}
|
||||||
colorPickers.current = colorPickers[index];
|
colorPickers.current = colorPickers[index];
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
focusListener = function(e) {
|
createListener = function(e) {
|
||||||
elm = document.getElementById("colorPicker");
|
elm = document.getElementById("colorPicker");
|
||||||
var input = elm,
|
var input = elm,
|
||||||
position = window.ColorPicker.getOrigin(input),
|
position = window.ColorPicker.getOrigin(input),
|
||||||
index = multiple ? Array.prototype.indexOf.call(elms, elm) : 0,
|
index = multiple ? Array.prototype.indexOf.call(elms, elm) : 0,
|
||||||
colorPicker = colorPickers[index] ||
|
colorPicker = colorPickers[index] ||
|
||||||
(colorPickers[index] = createInstance(elm, config)),
|
(colorPickers[index] = createInstance(elm, config)),
|
||||||
options = colorPicker.color.options,
|
options = colorPicker.color.options,
|
||||||
colorPickerUI = colorPicker.nodes.colorPicker,
|
colorPickerUI = colorPicker.nodes.colorPicker,
|
||||||
appendTo = (options.appendTo || document.body),
|
appendTo = (options.appendTo || document.body),
|
||||||
isStatic = /static/.test(window.getComputedStyle(appendTo).position),
|
isStatic = /static/.test(window.getComputedStyle(appendTo).position),
|
||||||
atrect = isStatic ? {left: 0, top: 0} : appendTo.getBoundingClientRect(),
|
atrect = isStatic ? {left: 0, top: 0} : appendTo.getBoundingClientRect(),
|
||||||
waitTimer = 0;
|
waitTimer = 0;
|
||||||
|
|
||||||
options.color = extractValue(elm); // brings color to default on reset
|
options.color = extractValue(elm); // brings color to default on reset
|
||||||
colorPickerUI.style.cssText =
|
colorPickerUI.style.cssText =
|
||||||
'position: absolute;' + (!colorPickers[index].cssIsReady ? 'display: none;' : '') +
|
'position: absolute;' + (!colorPickers[index].cssIsReady ? 'display: none;' : '') +
|
||||||
'left:' + (position.left + options.margin.left - atrect.left) + 'px;' +
|
'left:' + (position.left + options.margin.left - atrect.left) + 'px;' +
|
||||||
'top:' + (position.top + +input.offsetHeight + options.margin.top - atrect.top) + 'px;';
|
'top:' + (position.top + +input.offsetHeight + options.margin.top - atrect.top) + 'px;';
|
||||||
|
|
||||||
if (!multiple) {
|
if (!multiple) {
|
||||||
options.input = elm;
|
options.input = elm;
|
||||||
options.patch = elm; // check again???
|
options.patch = elm; // check again???
|
||||||
colorPicker.setColor(extractValue(elm), undefined, undefined, true);
|
colorPicker.setColor(extractValue(elm), undefined, undefined, true);
|
||||||
colorPicker.saveAsBackground();
|
colorPicker.saveAsBackground();
|
||||||
}
|
}
|
||||||
colorPickers.current = colorPickers[index];
|
colorPickers.current = colorPickers[index];
|
||||||
appendTo.appendChild(colorPickerUI);
|
appendTo.appendChild(colorPickerUI);
|
||||||
waitTimer = setInterval(function() { // compensating late style on onload in colorPicker
|
waitTimer = setInterval(function() { // compensating late style on onload in colorPicker
|
||||||
if (colorPickers.current.cssIsReady) {
|
if (colorPickers.current.cssIsReady) {
|
||||||
waitTimer = clearInterval(waitTimer);
|
waitTimer = clearInterval(waitTimer);
|
||||||
colorPickerUI.style.display = 'block';
|
colorPickerUI.style.display = 'block';
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
},
|
},
|
||||||
mousDownListener = function(e) {
|
hideListener = function(e) {
|
||||||
var colorPicker = colorPickers.current,
|
var colorPicker = colorPickers.current,
|
||||||
colorPickerUI = (colorPicker ? colorPicker.nodes.colorPicker : undefined),
|
colorPickerUI = (colorPicker ? colorPicker.nodes.colorPicker : undefined),
|
||||||
animationSpeed = colorPicker ? colorPicker.color.options.animationSpeed : 0,
|
animationSpeed = colorPicker ? colorPicker.color.options.animationSpeed : 0,
|
||||||
isColorPicker = colorPicker && (function(elm) {
|
isColorPicker = colorPicker && (function(elm) {
|
||||||
while (elm) {
|
while (elm) {
|
||||||
if ((elm.className || '').indexOf('cpPanel') !== -1) return elm;
|
if ((elm.className || '').indexOf('cpPanel') !== -1) return elm;
|
||||||
elm = elm.parentNode;
|
elm = elm.parentNode;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
})(e.target),
|
})(e.target),
|
||||||
inputIndex = Array.prototype.indexOf.call(elms, e.target);
|
inputIndex = Array.prototype.indexOf.call(elms, e.target);
|
||||||
|
|
||||||
if (isColorPicker && Array.prototype.indexOf.call(colorPickers, isColorPicker)) {
|
if (isColorPicker && Array.prototype.indexOf.call(colorPickers, isColorPicker)) {
|
||||||
if (e.target === colorPicker.nodes.exit) {
|
if (e.target === colorPicker.nodes.exit) {
|
||||||
colorPickerUI.parentNode.style.display = 'none';
|
colorPickerUI.parentNode.style.display = 'none';
|
||||||
document.activeElement.blur();
|
document.activeElement.blur();
|
||||||
} else {
|
} else {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
} else if (inputIndex !== -1) {
|
} else if (inputIndex !== -1) {
|
||||||
// ...
|
// ...
|
||||||
} else if (colorPickerUI) {
|
} else if (colorPickerUI) {
|
||||||
colorPickerUI.parentNode.style.display = 'none';
|
colorPickerUI.parentNode.style.display = 'none';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
button = document.getElementById("colorSwitch");
|
elm[onOff]('input', inputListener);
|
||||||
button[onOff]('click', focusListener);
|
window.jsColorPicker.create = createListener;
|
||||||
elm[onOff]('input', inputListener);
|
},
|
||||||
|
// this is a way to prevent data binding on HTMLElements
|
||||||
|
colorPickers = window.jsColorPicker.colorPickers || [],
|
||||||
|
elms = document.querySelectorAll(selectors),
|
||||||
|
testColors = new window.Colors({customBG: config.customBG, allMixDetails: true});
|
||||||
|
|
||||||
if (!colorPickers.evt || off) {
|
window.jsColorPicker.colorPickers = colorPickers;
|
||||||
colorPickers.evt = true; // prevent new eventListener for window
|
|
||||||
|
|
||||||
window[onOff]('mousedown', mousDownListener);
|
for (var n = 0, m = elms.length; n < m; n++) {
|
||||||
}
|
var elm = elms[n];
|
||||||
},
|
|
||||||
// this is a way to prevent data binding on HTMLElements
|
|
||||||
colorPickers = window.jsColorPicker.colorPickers || [],
|
|
||||||
elms = document.querySelectorAll(selectors),
|
|
||||||
testColors = new window.Colors({customBG: config.customBG, allMixDetails: true});
|
|
||||||
|
|
||||||
window.jsColorPicker.colorPickers = colorPickers;
|
if (config === 'destroy') {
|
||||||
|
doEventListeners(elm, (config && config.multipleInstances), true);
|
||||||
|
if (colorPickers[n]) {
|
||||||
|
colorPickers[n].destroyAll();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var color = extractValue(elm);
|
||||||
|
var value = color.split('(');
|
||||||
|
|
||||||
for (var n = 0, m = elms.length; n < m; n++) {
|
testColors.setColor(color);
|
||||||
var elm = elms[n];
|
if (config && config.init) {
|
||||||
|
config.init(elm, testColors.colors);
|
||||||
|
}
|
||||||
|
elm.setAttribute('data-colorMode', value[1] ? value[0].substr(0, 3) : 'HEX');
|
||||||
|
doEventListeners(elm, (config && config.multipleInstances), false);
|
||||||
|
if (config && config.readOnly) {
|
||||||
|
elm.readOnly = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (config === 'destroy') {
|
return window.jsColorPicker.colorPickers;
|
||||||
doEventListeners(elm, (config && config.multipleInstances), true);
|
};
|
||||||
if (colorPickers[n]) {
|
|
||||||
colorPickers[n].destroyAll();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var color = extractValue(elm);
|
|
||||||
var value = color.split('(');
|
|
||||||
|
|
||||||
testColors.setColor(color);
|
window.ColorPicker.docCookies = function(key, val, options) {
|
||||||
if (config && config.init) {
|
var encode = encodeURIComponent, decode = decodeURIComponent,
|
||||||
config.init(elm, testColors.colors);
|
cookies, n, tmp, cache = {},
|
||||||
}
|
days;
|
||||||
elm.setAttribute('data-colorMode', value[1] ? value[0].substr(0, 3) : 'HEX');
|
|
||||||
doEventListeners(elm, (config && config.multipleInstances), false);
|
|
||||||
if (config && config.readOnly) {
|
|
||||||
elm.readOnly = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return window.jsColorPicker.colorPickers;
|
if (val === undefined) { // all about reading cookies
|
||||||
};
|
cookies = document.cookie.split(/;\s*/) || [];
|
||||||
|
for (n = cookies.length; n--; ) {
|
||||||
|
tmp = cookies[n].split('=');
|
||||||
|
if (tmp[0]) cache[decode(tmp.shift())] = decode(tmp.join('=')); // there might be '='s in the value...
|
||||||
|
}
|
||||||
|
|
||||||
window.ColorPicker.docCookies = function(key, val, options) {
|
if (!key) return cache; // return Json for easy access to all cookies
|
||||||
var encode = encodeURIComponent, decode = decodeURIComponent,
|
else return cache[key]; // easy access to cookies from here
|
||||||
cookies, n, tmp, cache = {},
|
} else { // write/delete cookie
|
||||||
days;
|
options = options || {};
|
||||||
|
|
||||||
if (val === undefined) { // all about reading cookies
|
if (val === '' || options.expires < 0) { // prepare deleteing the cookie
|
||||||
cookies = document.cookie.split(/;\s*/) || [];
|
options.expires = -1;
|
||||||
for (n = cookies.length; n--; ) {
|
// options.path = options.domain = options.secure = undefined; // to make shure the cookie gets deleted...
|
||||||
tmp = cookies[n].split('=');
|
}
|
||||||
if (tmp[0]) cache[decode(tmp.shift())] = decode(tmp.join('=')); // there might be '='s in the value...
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!key) return cache; // return Json for easy access to all cookies
|
if (options.expires !== undefined) { // prepare date if any
|
||||||
else return cache[key]; // easy access to cookies from here
|
days = new Date();
|
||||||
} else { // write/delete cookie
|
days.setDate(days.getDate() + options.expires);
|
||||||
options = options || {};
|
}
|
||||||
|
|
||||||
if (val === '' || options.expires < 0) { // prepare deleteing the cookie
|
document.cookie = encode(key) + '=' + encode(val) +
|
||||||
options.expires = -1;
|
(days ? '; expires=' + days.toUTCString() : '') +
|
||||||
// options.path = options.domain = options.secure = undefined; // to make shure the cookie gets deleted...
|
(options.path ? '; path=' + options.path : '') +
|
||||||
}
|
(options.domain ? '; domain=' + options.domain : '') +
|
||||||
|
(options.secure ? '; secure' : '');
|
||||||
if (options.expires !== undefined) { // prepare date if any
|
}
|
||||||
days = new Date();
|
};
|
||||||
days.setDate(days.getDate() + options.expires);
|
|
||||||
}
|
|
||||||
|
|
||||||
document.cookie = encode(key) + '=' + encode(val) +
|
|
||||||
(days ? '; expires=' + days.toUTCString() : '') +
|
|
||||||
(options.path ? '; path=' + options.path : '') +
|
|
||||||
(options.domain ? '; domain=' + options.domain : '') +
|
|
||||||
(options.secure ? '; secure' : '');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
// Added
|
// Added
|
||||||
@ -272,17 +265,131 @@ var colors = jsColorPicker('input.color', {
|
|||||||
appendTo: document.getElementById("colorPanel"),
|
appendTo: document.getElementById("colorPanel"),
|
||||||
size: 1,
|
size: 1,
|
||||||
});
|
});
|
||||||
function doHide() {
|
|
||||||
var oDiv = document.getElementById("colorPanel");
|
function openColorFromButton() {
|
||||||
if (oDiv.style.display == "none"){
|
delete window.jsColorPicker.confirm;
|
||||||
oDiv.style.display = "inline-block";
|
triggerColorPicker('414px', '53px');
|
||||||
} else {
|
}
|
||||||
oDiv.style.display = "none";
|
|
||||||
|
function confirmColor() {
|
||||||
|
var colorPicker = document.getElementById("colorPicker");
|
||||||
|
if (window.jsColorPicker.confirm) { /* 存在块 */
|
||||||
|
// 检测需要是合法数值
|
||||||
|
var val = colorPicker.value;
|
||||||
|
if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+,[0-9. ]+$/.test(val)) val = "rgba("+val+")";
|
||||||
|
else if (/^[0-9 ]+,[0-9 ]+,[0-9 ]+$/.test(val)) val = "rgba("+val+",1)";
|
||||||
|
else val = null;
|
||||||
|
if (val) window.jsColorPicker.confirm(val);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
colorPicker.select();
|
||||||
|
document.execCommand("Copy");
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerColorPicker();
|
||||||
|
}
|
||||||
|
|
||||||
|
function triggerColorPicker(left, top) {
|
||||||
|
var colorPanel = document.getElementById('colorPanel');
|
||||||
|
if (colorPanel.style.display=='none' && left && top) {
|
||||||
|
colorPanel.style.display = "inline-block";
|
||||||
|
colorPanel.style.left = left;
|
||||||
|
colorPanel.style.top = top;
|
||||||
|
window.jsColorPicker.create();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
colorPanel.style.display = 'none';
|
||||||
|
delete window.jsColorPicker.confirm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function copyColor() {
|
|
||||||
var colorPicker = document.getElementById("colorPicker");
|
Blockly.FieldColour.prototype.createWidget_ = function() {
|
||||||
colorPicker.select();
|
// Create the palette using Closure.
|
||||||
document.execCommand("Copy");
|
var picker = new goog.ui.ColorPicker();
|
||||||
doHide();
|
picker.setSize(this.columns_ || Blockly.FieldColour.COLUMNS);
|
||||||
}
|
picker.setColors(this.colours_ || Blockly.FieldColour.COLOURS);
|
||||||
|
var div = Blockly.WidgetDiv.DIV;
|
||||||
|
picker.render(div);
|
||||||
|
picker.setSelectedColor(this.getValue());
|
||||||
|
|
||||||
|
Blockly.WidgetDiv.hide();
|
||||||
|
|
||||||
|
// console.log('here')
|
||||||
|
var self=this;
|
||||||
|
var pb=self.sourceBlock_
|
||||||
|
var args = MotaActionBlocks[pb.type].args
|
||||||
|
var targetf=args[args.indexOf(self.name)-1]
|
||||||
|
|
||||||
|
var getValue=function(){
|
||||||
|
// return self.getValue() // css颜色
|
||||||
|
return pb.getFieldValue(targetf);
|
||||||
|
// 也可以用 pb.getFieldValue(targetf) 获得颜色块左边的域的内容
|
||||||
|
}
|
||||||
|
|
||||||
|
var setValue=function(newValue){ // css颜色
|
||||||
|
self.setValue(newValue)
|
||||||
|
var c=new Colors();
|
||||||
|
c.setColor(newValue)
|
||||||
|
var rgbatext=`${c.colors.webSmart.r},${c.colors.webSmart.g},${c.colors.webSmart.b},${c.colors.alpha}` // 转成r,g,b,a文本
|
||||||
|
pb.setFieldValue(rgbatext, targetf) // 放在颜色块左边的域中
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
document.getElementById("colorPicker").value = getValue();
|
||||||
|
window.jsColorPicker.confirm = setValue;
|
||||||
|
// 设置位置
|
||||||
|
triggerColorPicker(Blockly.WidgetDiv.DIV.style.left, Blockly.WidgetDiv.DIV.style.top);
|
||||||
|
});
|
||||||
|
|
||||||
|
return picker;
|
||||||
|
};
|
||||||
|
|
||||||
|
Blockly.FieldTextInput.prototype.showInlineEditor_ = function(quietInput) {
|
||||||
|
Blockly.WidgetDiv.show(this, this.sourceBlock_.RTL, this.widgetDispose_());
|
||||||
|
var div = Blockly.WidgetDiv.DIV;
|
||||||
|
// Create the input.
|
||||||
|
var htmlInput =
|
||||||
|
goog.dom.createDom(goog.dom.TagName.INPUT, 'blocklyHtmlInput');
|
||||||
|
htmlInput.setAttribute('spellcheck', this.spellcheck_);
|
||||||
|
var fontSize =
|
||||||
|
(Blockly.FieldTextInput.FONTSIZE * this.workspace_.scale) + 'pt';
|
||||||
|
div.style.fontSize = fontSize;
|
||||||
|
htmlInput.style.fontSize = fontSize;
|
||||||
|
|
||||||
|
Blockly.FieldTextInput.htmlInput_ = htmlInput;
|
||||||
|
div.appendChild(htmlInput);
|
||||||
|
|
||||||
|
htmlInput.value = htmlInput.defaultValue = this.text_;
|
||||||
|
htmlInput.oldValue_ = null;
|
||||||
|
this.validate_();
|
||||||
|
this.resizeEditor_();
|
||||||
|
if (!quietInput) {
|
||||||
|
htmlInput.focus();
|
||||||
|
htmlInput.select();
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log('here')
|
||||||
|
var self=this;
|
||||||
|
var pb=self.sourceBlock_
|
||||||
|
var args = MotaActionBlocks[pb.type].args
|
||||||
|
var targetf=args[args.indexOf(self.name)+1]
|
||||||
|
|
||||||
|
if(targetf && targetf.slice(0,7)==='Colour_'){
|
||||||
|
var inputDom = htmlInput;
|
||||||
|
// var getValue=function(){ // 获得自己的字符串
|
||||||
|
// return pb.getFieldValue(self.name);
|
||||||
|
// }
|
||||||
|
var setValue = function(newValue){ // 设置右边颜色块的css颜色
|
||||||
|
pb.setFieldValue(newValue, targetf)
|
||||||
|
}
|
||||||
|
// 给inputDom绑事件
|
||||||
|
inputDom.oninput=function(){
|
||||||
|
var value=inputDom.value
|
||||||
|
if(/[0-9 ]+,[0-9 ]+,[0-9 ]+(,[0-9. ]+)?/.test(value)){
|
||||||
|
setValue('rgba('+value+')')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.bindEvents_(htmlInput);
|
||||||
|
};
|
||||||
@ -23,13 +23,12 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#colorPanel {
|
#colorPanel {
|
||||||
position: absolute;
|
position: fixed;
|
||||||
left: 130px;
|
width: max-content;
|
||||||
top: 30px;
|
|
||||||
width: 168px;
|
|
||||||
height: 205px;
|
height: 205px;
|
||||||
z-index: 240;
|
z-index: 240;
|
||||||
padding: 4px 6px;
|
padding: 4px 6px;
|
||||||
|
margin-top: 6px;
|
||||||
background-color: #F5F5F5;
|
background-color: #F5F5F5;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
||||||
@ -58,7 +57,7 @@ body {
|
|||||||
#editArea {
|
#editArea {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 70%;
|
height: 400px;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
/* padding: 10px 5px; */
|
/* padding: 10px 5px; */
|
||||||
@ -68,7 +67,7 @@ body {
|
|||||||
#pout {
|
#pout {
|
||||||
display: block;
|
display: block;
|
||||||
width: 410px;
|
width: 410px;
|
||||||
height: 100%;
|
height: 380px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-left: 22px;
|
margin-left: 22px;
|
||||||
margin-top: 23px;
|
margin-top: 23px;
|
||||||
@ -84,9 +83,28 @@ body {
|
|||||||
#editTip {
|
#editTip {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 120px;
|
|
||||||
bottom: 0;
|
|
||||||
left: 10px;
|
left: 10px;
|
||||||
|
top: 430px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#editBtns {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
left: 10px;
|
||||||
|
top: 465px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#newMaps {
|
||||||
|
position: absolute;
|
||||||
|
left: 10px;
|
||||||
|
top: 505px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#newFloors {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
left: 10px;
|
||||||
|
top: 530px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#editArea p {
|
#editArea p {
|
||||||
|
|||||||
@ -45,6 +45,7 @@ body {
|
|||||||
top: 0;
|
top: 0;
|
||||||
/* padding: 10px 5px; */
|
/* padding: 10px 5px; */
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pout {
|
#pout {
|
||||||
@ -72,12 +73,39 @@ body {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#editTip {
|
||||||
|
position: absolute;
|
||||||
|
width: 95vw;
|
||||||
|
left: 4vw;
|
||||||
|
top: 4vw;
|
||||||
|
}
|
||||||
|
|
||||||
#editTip .btn {
|
#editTip .btn {
|
||||||
float: right;
|
float: right;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#editBtns {
|
||||||
|
position: absolute;
|
||||||
|
width: 95vw;
|
||||||
|
left: 4vw;
|
||||||
|
top: 20vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
#newMaps {
|
||||||
|
position: absolute;
|
||||||
|
left: 4vw;
|
||||||
|
top: 35vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
#newFloors {
|
||||||
|
position: absolute;
|
||||||
|
width: 95vw;
|
||||||
|
left: 4vw;
|
||||||
|
top: 43vw;
|
||||||
|
}
|
||||||
|
|
||||||
#mid {
|
#mid {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
@ -279,6 +307,7 @@ div.col .coltd {
|
|||||||
width: 95vw;
|
width: 95vw;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mapColMark {
|
#mapColMark {
|
||||||
@ -334,6 +363,7 @@ div.row .rowtd .rowtext{
|
|||||||
width: 4vw;
|
width: 4vw;
|
||||||
height: 62vw;
|
height: 62vw;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mapRowMark {
|
#mapRowMark {
|
||||||
@ -426,3 +456,21 @@ div.row .rowtd .rowtext{
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#colorPanel {
|
||||||
|
position: fixed;
|
||||||
|
width: max-content;
|
||||||
|
height: 205px;
|
||||||
|
z-index: 240;
|
||||||
|
padding: 4px 6px;
|
||||||
|
margin-top: 6px;
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
||||||
|
}
|
||||||
|
|
||||||
|
#colorPicker {
|
||||||
|
margin: 2px 0;
|
||||||
|
border-radius: 3px;
|
||||||
|
width: 90px;
|
||||||
|
}
|
||||||
@ -31,7 +31,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"bgms": {
|
"bgms": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
"_data": "在此存放所有的bgm,和文件名一致。第一项为默认播放项 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
|
"_data": "在此存放所有的bgm,和文件名一致。 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
|
||||||
},
|
},
|
||||||
"sounds": {
|
"sounds": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
@ -62,6 +62,12 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"_range": "(thiseval instanceof Array && thiseval.length<=6)||thiseval==null",
|
"_range": "(thiseval instanceof Array && thiseval.length<=6)||thiseval==null",
|
||||||
"_data": "装备位名称,为不超过6个的数组,此项的顺序与equiptype数值关联;例如可写[\"武器\",\"防具\",\"首饰\"]等等。"
|
"_data": "装备位名称,为不超过6个的数组,此项的顺序与equiptype数值关联;例如可写[\"武器\",\"防具\",\"首饰\"]等等。"
|
||||||
},
|
},
|
||||||
|
"startBgm": {
|
||||||
|
"_leaf": true,
|
||||||
|
"_type": "textarea",
|
||||||
|
"_string": true,
|
||||||
|
"_data": "在标题界面应该播放的bgm内容"
|
||||||
|
},
|
||||||
"statusLeftBackground": {
|
"statusLeftBackground": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
@ -480,7 +486,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "checkbox",
|
"_type": "checkbox",
|
||||||
"_bool": "bool",
|
"_bool": "bool",
|
||||||
"_data": "是否涉及毒衰咒;如果此项为false则不会在状态栏中显示毒衰咒的debuff"
|
"_data": "是否在状态栏显示毒衰咒"
|
||||||
},
|
},
|
||||||
"enableSkill": {
|
"enableSkill": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
|
|||||||
@ -1001,6 +1001,19 @@ editor.prototype.listen = function () {
|
|||||||
var locStr='('+editor.lastRightButtonPos[1].x+','+editor.lastRightButtonPos[1].y+')';
|
var locStr='('+editor.lastRightButtonPos[1].x+','+editor.lastRightButtonPos[1].y+')';
|
||||||
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
||||||
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
||||||
|
|
||||||
|
// 检测是否是上下楼
|
||||||
|
var thisevent = editor.map[editor.pos.y][editor.pos.x];
|
||||||
|
if (thisevent.id=='upFloor') {
|
||||||
|
addFloorEvent.style.display='block';
|
||||||
|
addFloorEvent.children[0].innerHTML='绑定上楼事件';
|
||||||
|
}
|
||||||
|
else if (thisevent.id=='downFloor') {
|
||||||
|
addFloorEvent.style.display='block';
|
||||||
|
addFloorEvent.children[0].innerHTML='绑定下楼事件';
|
||||||
|
}
|
||||||
|
else addFloorEvent.style.display='none';
|
||||||
|
|
||||||
chooseThis.children[0].innerHTML='选中此点'+'('+editor.pos.x+','+editor.pos.y+')'
|
chooseThis.children[0].innerHTML='选中此点'+'('+editor.pos.x+','+editor.pos.y+')'
|
||||||
copyLoc.children[0].innerHTML='复制事件'+locStr+'到此处';
|
copyLoc.children[0].innerHTML='复制事件'+locStr+'到此处';
|
||||||
moveLoc.children[0].innerHTML='交换事件'+locStr+'与此事件的位置';
|
moveLoc.children[0].innerHTML='交换事件'+locStr+'与此事件的位置';
|
||||||
@ -1016,6 +1029,28 @@ editor.prototype.listen = function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var addFloorEvent = document.getElementById('addFloorEvent');
|
||||||
|
addFloorEvent.onmousedown = function(e) {
|
||||||
|
editor.hideMidMenu();
|
||||||
|
e.stopPropagation();
|
||||||
|
var thisevent = editor.map[editor.pos.y][editor.pos.x];
|
||||||
|
if (thisevent.id=='upFloor') {
|
||||||
|
editor.currentFloorData.changeFloor[editor.pos.x+","+editor.pos.y] = {"floorId": ":next", "stair": "downFloor"};
|
||||||
|
}
|
||||||
|
else if (thisevent.id=='downFloor') {
|
||||||
|
editor.currentFloorData.changeFloor[editor.pos.x+","+editor.pos.y] = {"floorId": ":before", "stair": "upFloor"};
|
||||||
|
}
|
||||||
|
editor.file.saveFloorFile(function (err) {
|
||||||
|
if (err) {
|
||||||
|
printe(err);
|
||||||
|
throw(err)
|
||||||
|
}
|
||||||
|
;printf('添加楼梯事件成功');
|
||||||
|
editor.drawPosSelection();
|
||||||
|
editor_mode.showMode('loc');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var chooseThis = document.getElementById('chooseThis');
|
var chooseThis = document.getElementById('chooseThis');
|
||||||
chooseThis.onmousedown = function(e){
|
chooseThis.onmousedown = function(e){
|
||||||
editor.hideMidMenu();
|
editor.hideMidMenu();
|
||||||
|
|||||||
@ -88,6 +88,7 @@ editor_blockly = function () {
|
|||||||
MotaActionBlocks['setFloor_s'].xmlText(),
|
MotaActionBlocks['setFloor_s'].xmlText(),
|
||||||
MotaActionBlocks['setGlobalAttribute_s'].xmlText(),
|
MotaActionBlocks['setGlobalAttribute_s'].xmlText(),
|
||||||
MotaActionBlocks['setGlobalValue_s'].xmlText(),
|
MotaActionBlocks['setGlobalValue_s'].xmlText(),
|
||||||
|
MotaActionBlocks['setGlobalFlag_s'].xmlText(),
|
||||||
MotaActionBlocks['input_s'].xmlText(),
|
MotaActionBlocks['input_s'].xmlText(),
|
||||||
MotaActionBlocks['input2_s'].xmlText(),
|
MotaActionBlocks['input2_s'].xmlText(),
|
||||||
MotaActionBlocks['update_s'].xmlText(),
|
MotaActionBlocks['update_s'].xmlText(),
|
||||||
@ -143,12 +144,15 @@ editor_blockly = function () {
|
|||||||
MotaActionBlocks['screenFlash_s'].xmlText(),
|
MotaActionBlocks['screenFlash_s'].xmlText(),
|
||||||
MotaActionBlocks['setWeather_s'].xmlText(),
|
MotaActionBlocks['setWeather_s'].xmlText(),
|
||||||
MotaActionBlocks['playBgm_s'].xmlText(),
|
MotaActionBlocks['playBgm_s'].xmlText(),
|
||||||
MotaActionBlocks['pauseBgm_s'].xmlText(),
|
// MotaActionBlocks['pauseBgm_s'].xmlText(),
|
||||||
MotaActionBlocks['resumeBgm_s'].xmlText(),
|
// MotaActionBlocks['resumeBgm_s'].xmlText(),
|
||||||
MotaActionBlocks['loadBgm_s'].xmlText(),
|
MotaActionBlocks['loadBgm_s'].xmlText(),
|
||||||
MotaActionBlocks['freeBgm_s'].xmlText(),
|
MotaActionBlocks['freeBgm_s'].xmlText(),
|
||||||
MotaActionBlocks['playSound_s'].xmlText(),
|
MotaActionBlocks['playSound_s'].xmlText(),
|
||||||
MotaActionBlocks['setVolume_s'].xmlText(),
|
MotaActionBlocks['setVolume_s'].xmlText(),
|
||||||
|
MotaActionBlocks['callBook_s'].xmlText(),
|
||||||
|
MotaActionBlocks['callSave_s'].xmlText(),
|
||||||
|
MotaActionBlocks['callLoad_s'].xmlText(),
|
||||||
],
|
],
|
||||||
'原生脚本':[
|
'原生脚本':[
|
||||||
MotaActionBlocks['function_s'].xmlText(),
|
MotaActionBlocks['function_s'].xmlText(),
|
||||||
@ -364,6 +368,54 @@ function omitedcheckUpdateFunction(event) {
|
|||||||
MotaActionFunctions.workspace = function(){
|
MotaActionFunctions.workspace = function(){
|
||||||
return editor_blockly.workspace;
|
return editor_blockly.workspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 因为在editor_blockly.parse里已经HTML转义过一次了,所以这里要覆盖掉以避免在注释中出现<等
|
||||||
|
MotaActionFunctions.xmlText = function (ruleName,inputs,isShadow,comment) {
|
||||||
|
var rule = MotaActionBlocks[ruleName];
|
||||||
|
var blocktext = isShadow?'shadow':'block';
|
||||||
|
var xmlText = [];
|
||||||
|
xmlText.push('<'+blocktext+' type="'+ruleName+'">');
|
||||||
|
if(!inputs)inputs=[];
|
||||||
|
for (var ii=0,inputType;inputType=rule.argsType[ii];ii++) {
|
||||||
|
var input = inputs[ii];
|
||||||
|
var _input = '';
|
||||||
|
var noinput = (input===null || input===undefined);
|
||||||
|
if(noinput && inputType==='field') continue;
|
||||||
|
if(noinput) input = '';
|
||||||
|
if(inputType!=='field') {
|
||||||
|
var subList = false;
|
||||||
|
var subrulename = rule.args[ii];
|
||||||
|
subrulename=subrulename.split('_').slice(0,-1).join('_');
|
||||||
|
var subrule = MotaActionBlocks[subrulename];
|
||||||
|
if (subrule instanceof Array) {
|
||||||
|
subrulename=subrule[subrule.length-1];
|
||||||
|
subrule = MotaActionBlocks[subrulename];
|
||||||
|
subList = true;
|
||||||
|
}
|
||||||
|
_input = subrule.xmlText([],true);
|
||||||
|
if(noinput && !subList && !isShadow) {
|
||||||
|
//无输入的默认行为是: 如果语句块的备选方块只有一个,直接代入方块
|
||||||
|
input = subrule.xmlText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xmlText.push('<'+inputType+' name="'+rule.args[ii]+'">');
|
||||||
|
xmlText.push(_input+input);
|
||||||
|
xmlText.push('</'+inputType+'>');
|
||||||
|
}
|
||||||
|
if(comment){
|
||||||
|
xmlText.push('<comment>');
|
||||||
|
xmlText.push(comment);
|
||||||
|
xmlText.push('</comment>');
|
||||||
|
}
|
||||||
|
var next = inputs[rule.args.length];
|
||||||
|
if (next) {//next
|
||||||
|
xmlText.push('<next>');
|
||||||
|
xmlText.push(next);
|
||||||
|
xmlText.push('</next>');
|
||||||
|
}
|
||||||
|
xmlText.push('</'+blocktext+'>');
|
||||||
|
return xmlText.join('');
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@ -174,6 +174,82 @@ editor_file = function (editor, callback) {
|
|||||||
editor.currentFloorId = saveFilename;
|
editor.currentFloorId = saveFilename;
|
||||||
editor_file.saveFloorFile(callback);
|
editor_file.saveFloorFile(callback);
|
||||||
}
|
}
|
||||||
|
editor_file.saveNewFiles = function (floorIdList, from, to, callback) {
|
||||||
|
if (!isset(callback)) {
|
||||||
|
printe('未设置callback');
|
||||||
|
throw('未设置callback')
|
||||||
|
};
|
||||||
|
var currData=editor.currentFloorData;
|
||||||
|
var saveStatus = document.getElementById('newMapsStatus').checked;
|
||||||
|
|
||||||
|
var calValue = function (text, i) {
|
||||||
|
return text.replace(/\${(.*?)}/g, function (word, value) {
|
||||||
|
return eval(value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var width = parseInt(document.getElementById('newMapsWidth').value);
|
||||||
|
var height = parseInt(document.getElementById('newMapsHeight').value);
|
||||||
|
|
||||||
|
var row = [], map = [];
|
||||||
|
for (var i=0;i<width;i++) row.push(0);
|
||||||
|
for (var i=0;i<height;i++) map.push(row);
|
||||||
|
|
||||||
|
var filenames = floorIdList.map(function (v) {return "project/floors/"+v+".js";});
|
||||||
|
var datas = [];
|
||||||
|
for (var i=from;i<=to;i++) {
|
||||||
|
var datastr = ['main.floors.', floorIdList[i-from], '=\n{'];
|
||||||
|
var data = {
|
||||||
|
floorId: floorIdList[i-from],
|
||||||
|
title: calValue(document.getElementById('newFloorTitles').value, i),
|
||||||
|
name: calValue(document.getElementById('newFloorNames').value, i),
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
map: map,
|
||||||
|
canFlyTo: saveStatus?currData.canFlyTo:true,
|
||||||
|
canUseQuickShop: saveStatus?currData.canUseQuickShop:true,
|
||||||
|
cannotViewMap: saveStatus?currData.cannotViewMap:false,
|
||||||
|
cannotMoveDirectly: saveStatus?currData.cannotMoveDirectly:false,
|
||||||
|
images: [],
|
||||||
|
item_ratio: saveStatus?currData.item_ratio:1,
|
||||||
|
defaultGround: saveStatus?currData.defaultGround:"ground",
|
||||||
|
bgm: saveStatus?currData.bgm:null,
|
||||||
|
upFloor: null,
|
||||||
|
downFloor: null,
|
||||||
|
color: saveStatus?currData.color:null,
|
||||||
|
weather: saveStatus?currData.weather:null,
|
||||||
|
firstArrive: [],
|
||||||
|
eachArrive: [],
|
||||||
|
parallelDo: "",
|
||||||
|
events: {},
|
||||||
|
changeFloor: {},
|
||||||
|
afterBattle: {},
|
||||||
|
afterGetItem: {},
|
||||||
|
afterOpenDoor: {},
|
||||||
|
cannotMove: {}
|
||||||
|
};
|
||||||
|
Object.keys(data).forEach(function (t) {
|
||||||
|
if (!core.isset(data[t]))
|
||||||
|
delete data[t];
|
||||||
|
else {
|
||||||
|
if (t=='map') {
|
||||||
|
datastr = datastr.concat(['\n"', t, '": [\n', formatMap(data[t]), '\n],']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
datastr = datastr.concat(['\n"', t, '": ', JSON.stringify(data[t], null, 4), ',']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
datastr = datastr.concat(['\n}']);
|
||||||
|
datastr = datastr.join('');
|
||||||
|
datas.push(encode(datastr));
|
||||||
|
}
|
||||||
|
alertWhenCompress();
|
||||||
|
fs.writeMultiFiles(filenames, datas, function (err, data) {
|
||||||
|
callback(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//callback(err:String)
|
//callback(err:String)
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@ -35,16 +35,46 @@ editor_mode = function (editor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
/**
|
||||||
|
* 把来自数据文件的obj和来自*comment.js的commentObj组装成表格
|
||||||
|
* commentObj在无视['_data']的意义下与obj同形
|
||||||
|
* 即: commentObj['_data']['a']['_data']['b'] 与 obj['a']['b'] 是对应的
|
||||||
|
* 在此意义下, 两者的结构是一致的
|
||||||
|
* 在commentObj没有被定义的obj的分支, 会取defaultcobj作为默认值
|
||||||
|
* 因此在深度优先遍历时,维护
|
||||||
|
* field="['a']['b']"
|
||||||
|
* cfield="['_data']['a']['_data']['b']"
|
||||||
|
* vobj=obj['a']['b']
|
||||||
|
* cobj=commentObj['_data']['a']['_data']['b']
|
||||||
|
* cobj
|
||||||
|
* cobj = Object.assign({}, defaultcobj, pcobj['_data'][ii])
|
||||||
|
* 每一项若未定义,就从defaultcobj中取
|
||||||
|
* 当其是函数不是具体值时,把args = {field: field, cfield: cfield, vobj: vobj, cobj: cobj}代入算出该值
|
||||||
|
* 得到的叶节点的<tr>结构如下
|
||||||
|
* tr>td[title=field]
|
||||||
|
* >td[title=comment,cobj=cobj:json]
|
||||||
|
* >td>div>input[value=thiseval]
|
||||||
|
* 返回结果
|
||||||
|
* 返回一个对象, 假设被命名为tableinfo
|
||||||
|
* 在把一个 table 的 innerHTML 赋值为 tableinfo.HTML 后
|
||||||
|
* 再调 tableinfo.listen(tableinfo.guids) 进行绑定事件
|
||||||
|
* @param {Object} obj
|
||||||
|
* @param {Object} commentObj
|
||||||
|
* @returns {{"HTML":String,"guids":String[],"listen":Function}}
|
||||||
|
*/
|
||||||
editor_mode.prototype.objToTable_ = function (obj, commentObj) {
|
editor_mode.prototype.objToTable_ = function (obj, commentObj) {
|
||||||
|
// 表格抬头
|
||||||
var outstr = ["\n<tr><td>条目</td><td>注释</td><td>值</td></tr>\n"];
|
var outstr = ["\n<tr><td>条目</td><td>注释</td><td>值</td></tr>\n"];
|
||||||
var guids = [];
|
var guids = [];
|
||||||
var defaultcobj = {
|
var defaultcobj = {
|
||||||
|
// 默认是文本域
|
||||||
_type: 'textarea',
|
_type: 'textarea',
|
||||||
_data: '',
|
_data: '',
|
||||||
_string: function (args) {//object~[field,cfield,vobj,cobj]
|
_string: function (args) {//object~[field,cfield,vobj,cobj]
|
||||||
var thiseval = args.vobj;
|
var thiseval = args.vobj;
|
||||||
return (typeof(thiseval) === typeof('')) && thiseval[0] === '"';
|
return (typeof(thiseval) === typeof('')) && thiseval[0] === '"';
|
||||||
},
|
},
|
||||||
|
// 默认情况下 非对象和数组的视为叶节点
|
||||||
_leaf: function (args) {//object~[field,cfield,vobj,cobj]
|
_leaf: function (args) {//object~[field,cfield,vobj,cobj]
|
||||||
var thiseval = args.vobj;
|
var thiseval = args.vobj;
|
||||||
if (thiseval == null || thiseval == undefined) return true;//null,undefined
|
if (thiseval == null || thiseval == undefined) return true;//null,undefined
|
||||||
@ -53,6 +83,13 @@ editor_mode = function (editor) {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 深度优先遍历, p*即为父节点的四个属性
|
||||||
|
* @param {String} pfield
|
||||||
|
* @param {String} pcfield
|
||||||
|
* @param {Object} pvobj
|
||||||
|
* @param {Object} pcobj
|
||||||
|
*/
|
||||||
var recursionParse = function (pfield, pcfield, pvobj, pcobj) {
|
var recursionParse = function (pfield, pcfield, pvobj, pcobj) {
|
||||||
for (var ii in pvobj) {
|
for (var ii in pvobj) {
|
||||||
var field = pfield + "['" + ii + "']";
|
var field = pfield + "['" + ii + "']";
|
||||||
@ -60,28 +97,34 @@ editor_mode = function (editor) {
|
|||||||
var vobj = pvobj[ii];
|
var vobj = pvobj[ii];
|
||||||
var cobj = null;
|
var cobj = null;
|
||||||
if (pcobj && pcobj['_data'] && pcobj['_data'][ii]) {
|
if (pcobj && pcobj['_data'] && pcobj['_data'][ii]) {
|
||||||
|
// cobj存在时直接取
|
||||||
cobj = Object.assign({}, defaultcobj, pcobj['_data'][ii]);
|
cobj = Object.assign({}, defaultcobj, pcobj['_data'][ii]);
|
||||||
} else {
|
} else {
|
||||||
|
// 当其函数时代入参数算出cobj, 不存在时只取defaultcobj
|
||||||
if (pcobj && (pcobj['_data'] instanceof Function)) cobj = Object.assign({}, defaultcobj, pcobj['_data'](ii));
|
if (pcobj && (pcobj['_data'] instanceof Function)) cobj = Object.assign({}, defaultcobj, pcobj['_data'](ii));
|
||||||
else cobj = Object.assign({}, defaultcobj);
|
else cobj = Object.assign({}, defaultcobj);
|
||||||
}
|
}
|
||||||
var args = {field: field, cfield: cfield, vobj: vobj, cobj: cobj}
|
var args = {field: field, cfield: cfield, vobj: vobj, cobj: cobj}
|
||||||
if (cobj._leaf instanceof Function) cobj._leaf = cobj._leaf(args);
|
// 当cobj的参数为函数时,代入args算出值
|
||||||
for (var key in cobj) {
|
for (var key in cobj) {
|
||||||
if (key === '_data') continue;
|
if (key === '_data') continue;
|
||||||
if (cobj[key] instanceof Function) cobj[key] = cobj[key](args);
|
if (cobj[key] instanceof Function) cobj[key] = cobj[key](args);
|
||||||
}
|
}
|
||||||
|
// 标记为_hide的属性不展示
|
||||||
if (cobj._hide)continue;
|
if (cobj._hide)continue;
|
||||||
if (cobj._leaf) {
|
if (!cobj._leaf) {
|
||||||
|
// 不是叶节点时, 插入展开的标记并继续遍历, 此处可以改成按钮用来添加新项或折叠等
|
||||||
|
outstr.push(["<tr><td>----</td><td>----</td><td>", field, "</td></tr>\n"].join(''));
|
||||||
|
recursionParse(field, cfield, vobj, cobj);
|
||||||
|
} else {
|
||||||
|
// 是叶节点时, 调objToTr_渲染<tr>
|
||||||
var leafnode = editor_mode.objToTr_(obj, commentObj, field, cfield, vobj, cobj);
|
var leafnode = editor_mode.objToTr_(obj, commentObj, field, cfield, vobj, cobj);
|
||||||
outstr.push(leafnode[0]);
|
outstr.push(leafnode[0]);
|
||||||
guids.push(leafnode[1]);
|
guids.push(leafnode[1]);
|
||||||
} else {
|
|
||||||
outstr.push(["<tr><td>----</td><td>----</td><td>", field, "</td></tr>\n"].join(''));
|
|
||||||
recursionParse(field, cfield, vobj, cobj);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 开始遍历
|
||||||
recursionParse("", "", obj, commentObj);
|
recursionParse("", "", obj, commentObj);
|
||||||
var checkRange = function (evalstr, thiseval) {
|
var checkRange = function (evalstr, thiseval) {
|
||||||
if (evalstr) {
|
if (evalstr) {
|
||||||
@ -90,6 +133,7 @@ editor_mode = function (editor) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var listen = function (guids) {
|
var listen = function (guids) {
|
||||||
|
// 每个叶节点的事件绑定
|
||||||
guids.forEach(function (guid) {
|
guids.forEach(function (guid) {
|
||||||
// tr>td[title=field]
|
// tr>td[title=field]
|
||||||
// >td[title=comment,cobj=cobj:json]
|
// >td[title=comment,cobj=cobj:json]
|
||||||
@ -138,21 +182,38 @@ editor_mode = function (editor) {
|
|||||||
return {"HTML": outstr.join(''), "guids": guids, "listen": listen};
|
return {"HTML": outstr.join(''), "guids": guids, "listen": listen};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回叶节点<tr>形如
|
||||||
|
* tr>td[title=field]
|
||||||
|
* >td[title=comment,cobj=cobj:json]
|
||||||
|
* >td>div>input[value=thiseval]
|
||||||
|
* 参数意义在 objToTable_ 中已解释
|
||||||
|
* @param {Object} obj
|
||||||
|
* @param {Object} commentObj
|
||||||
|
* @param {String} field
|
||||||
|
* @param {String} cfield
|
||||||
|
* @param {Object} vobj
|
||||||
|
* @param {Object} cobj
|
||||||
|
*/
|
||||||
editor_mode.prototype.objToTr_ = function (obj, commentObj, field, cfield, vobj, cobj) {
|
editor_mode.prototype.objToTr_ = function (obj, commentObj, field, cfield, vobj, cobj) {
|
||||||
var guid = editor.guid();
|
var guid = editor.guid();
|
||||||
var thiseval = vobj;
|
var thiseval = vobj;
|
||||||
var comment = cobj._data;
|
var comment = cobj._data;
|
||||||
|
|
||||||
var charlength = 10;
|
var charlength = 10;
|
||||||
|
// "['a']['b']" => "b"
|
||||||
var shortField = field.split("']").slice(-2)[0].split("['").slice(-1)[0];
|
var shortField = field.split("']").slice(-2)[0].split("['").slice(-1)[0];
|
||||||
|
// 把长度超过 charlength 的字符改成 固定长度+...的形式
|
||||||
shortField = (shortField.length < charlength ? shortField : shortField.slice(0, charlength) + '...');
|
shortField = (shortField.length < charlength ? shortField : shortField.slice(0, charlength) + '...');
|
||||||
|
|
||||||
|
// 完整的内容转义后供悬停查看
|
||||||
var commentHTMLescape = editor.HTMLescape(comment);
|
var commentHTMLescape = editor.HTMLescape(comment);
|
||||||
|
// 把长度超过 charlength 的字符改成 固定长度+...的形式
|
||||||
var shortCommentHTMLescape = (comment.length < charlength ? commentHTMLescape : editor.HTMLescape(comment.slice(0, charlength)) + '...');
|
var shortCommentHTMLescape = (comment.length < charlength ? commentHTMLescape : editor.HTMLescape(comment.slice(0, charlength)) + '...');
|
||||||
|
|
||||||
var cobjstr = Object.assign({}, cobj);
|
var cobjstr = Object.assign({}, cobj);
|
||||||
delete cobjstr._data;
|
delete cobjstr._data;
|
||||||
|
// 把cobj塞到第二个td的[cobj]中, 方便绑定事件时取
|
||||||
cobjstr = editor.HTMLescape(JSON.stringify(cobjstr));
|
cobjstr = editor.HTMLescape(JSON.stringify(cobjstr));
|
||||||
|
|
||||||
var outstr = ['<tr id="', guid, '"><td title="', field, '">', shortField, '</td>',
|
var outstr = ['<tr id="', guid, '"><td title="', field, '">', shortField, '</td>',
|
||||||
@ -497,6 +558,71 @@ editor_mode = function (editor) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var newMaps = document.getElementById('newMaps');
|
||||||
|
var newFloors = document.getElementById('newFloors');
|
||||||
|
newMaps.onclick = function () {
|
||||||
|
if (newFloors.style.display == 'none') newFloors.style.display = 'block';
|
||||||
|
else newFloors.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
var createNewMaps = document.getElementById('createNewMaps');
|
||||||
|
createNewMaps.onclick = function () {
|
||||||
|
var floorIds = document.getElementById('newFloorIds').value;
|
||||||
|
if (!floorIds) return;
|
||||||
|
var from = parseInt(document.getElementById('newMapsFrom').value),
|
||||||
|
to = parseInt(document.getElementById('newMapsTo').value);
|
||||||
|
if (!core.isset(from) || !core.isset(to) || from>to || from<0 || to<0) {
|
||||||
|
printe("请输入有效的起始和终止楼层");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (to-from >= 100) {
|
||||||
|
printe("一次最多创建99个楼层");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var floorIdList = [];
|
||||||
|
for (var i = from; i<=to; i++) {
|
||||||
|
var floorId = floorIds.replace(/\${(.*?)}/g, function (word, value) {
|
||||||
|
return eval(value);
|
||||||
|
});
|
||||||
|
if (core.floorIds.indexOf(floorId)>=0) {
|
||||||
|
printe("要创建的楼层 "+floorId+" 已存在!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(floorId)) {
|
||||||
|
printe("楼层名 "+floorId+" 不合法!请使用字母、数字、下划线,且不能以数字开头!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (floorIdList.indexOf(floorId)>=0) {
|
||||||
|
printe("尝试重复创建楼层 "+floorId+" !");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
floorIdList.push(floorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
var width = parseInt(document.getElementById('newMapsWidth').value);
|
||||||
|
var height = parseInt(document.getElementById('newMapsHeight').value);
|
||||||
|
if (!core.isset(width) || !core.isset(height) || width<13 || height<13 || width*height>1000) {
|
||||||
|
printe("新建地图的宽高都不得小于13,且宽高之积不能超过1000");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
editor_mode.onmode('');
|
||||||
|
|
||||||
|
editor.file.saveNewFiles(floorIdList, from, to, function (err) {
|
||||||
|
if (err) {
|
||||||
|
printe(err);
|
||||||
|
throw(err)
|
||||||
|
}
|
||||||
|
core.floorIds = core.floorIds.concat(floorIdList);
|
||||||
|
editor.file.editTower([['change', "['main']['floorIds']", core.floorIds]], function (objs_) {//console.log(objs_);
|
||||||
|
if (objs_.slice(-1)[0] != null) {
|
||||||
|
printe(objs_.slice(-1)[0]);
|
||||||
|
throw(objs_.slice(-1)[0])
|
||||||
|
}
|
||||||
|
;printe('批量创建 '+floorIdList[0]+'~'+floorIdList[floorIdList.length-1]+' 成功,请F5刷新编辑器生效');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var ratio = 1;
|
var ratio = 1;
|
||||||
var appendPicCanvas = document.getElementById('appendPicCanvas');
|
var appendPicCanvas = document.getElementById('appendPicCanvas');
|
||||||
var bg = appendPicCanvas.children[0];
|
var bg = appendPicCanvas.children[0];
|
||||||
|
|||||||
@ -119,6 +119,10 @@
|
|||||||
throw 'Type Error in fs.writeFile';
|
throw 'Type Error in fs.writeFile';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fs.writeMultiFiles = function (filenames, datastrs, callback) {
|
||||||
|
postsomething('name='+filenames.join(';')+'&value='+datastrs.join(';'), '/writeMultiFiles', callback);
|
||||||
|
}
|
||||||
|
|
||||||
fs.readdir = function (path, callback) {
|
fs.readdir = function (path, callback) {
|
||||||
//callback:function(err, data)
|
//callback:function(err, data)
|
||||||
//path:支持"/"做分隔符,不以"/"结尾
|
//path:支持"/"做分隔符,不以"/"结尾
|
||||||
|
|||||||
@ -34,6 +34,12 @@
|
|||||||
console.log(d);
|
console.log(d);
|
||||||
})
|
})
|
||||||
}, 4000);
|
}, 4000);
|
||||||
|
setTimeout(function () {
|
||||||
|
fs.writeMultiFiles(['_test.txt','_test_multi.txt'], ['abc=','abe='], function (e, d) {
|
||||||
|
console.log(e);
|
||||||
|
console.log(d);
|
||||||
|
})
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -29,7 +29,7 @@ main.dom.data.ontouchend // 手指离开触摸屏时
|
|||||||
main.statusBar.image.book.onclick // 点击状态栏中的怪物手册时
|
main.statusBar.image.book.onclick // 点击状态栏中的怪物手册时
|
||||||
main.statusBar.image.fly.onclick // 点击状态栏中的楼层传送器时
|
main.statusBar.image.fly.onclick // 点击状态栏中的楼层传送器时
|
||||||
main.statusBar.image.toolbox.onclick // 点击状态栏中的工具箱时
|
main.statusBar.image.toolbox.onclick // 点击状态栏中的工具箱时
|
||||||
main.statusBar.image.shop.onclick // 点击状态栏中的快捷商店时
|
main.statusBar.image.keyboard.onclick // 点击状态栏中的快捷商店时
|
||||||
main.statusBar.image.save.onclick // 点击状态栏中的存档按钮时
|
main.statusBar.image.save.onclick // 点击状态栏中的存档按钮时
|
||||||
main.statusBar.image.load.onclick // 点击状态栏中的读档按钮时
|
main.statusBar.image.load.onclick // 点击状态栏中的读档按钮时
|
||||||
main.statusBar.image.settings.onclick // 点击状态栏中的系统菜单时
|
main.statusBar.image.settings.onclick // 点击状态栏中的系统菜单时
|
||||||
|
|||||||
33
docs/api.md
33
docs/api.md
@ -168,6 +168,10 @@ core.nextY(n)
|
|||||||
获得勇士面向的第n个位置的y坐标,n可以省略默认为1(即正前方)
|
获得勇士面向的第n个位置的y坐标,n可以省略默认为1(即正前方)
|
||||||
|
|
||||||
|
|
||||||
|
core.nearHero(x, y)
|
||||||
|
判断某个点是否和勇士的距离不超过1。
|
||||||
|
|
||||||
|
|
||||||
core.openDoor(id, x, y, needKey, callback) [异步]
|
core.openDoor(id, x, y, needKey, callback) [异步]
|
||||||
尝试开门操作。id为目标点的ID,x和y为坐标,needKey表示是否需要使用钥匙,callback为开门完毕后的回调函数。
|
尝试开门操作。id为目标点的ID,x和y为坐标,needKey表示是否需要使用钥匙,callback为开门完毕后的回调函数。
|
||||||
id可为null代表使用地图上的值。
|
id可为null代表使用地图上的值。
|
||||||
@ -184,6 +188,10 @@ core.trigger(x, y) [异步]
|
|||||||
触发某个地点的事件。
|
触发某个地点的事件。
|
||||||
|
|
||||||
|
|
||||||
|
core.isReplaying()
|
||||||
|
当前是否正在录像播放中
|
||||||
|
|
||||||
|
|
||||||
core.drawBlock(block)
|
core.drawBlock(block)
|
||||||
重绘某个图块。block应为core.status.thisMap.blocks中的一项。
|
重绘某个图块。block应为core.status.thisMap.blocks中的一项。
|
||||||
|
|
||||||
@ -294,6 +302,11 @@ core.getLocalForage(key, defaultValue, successCallback, errorCallback)
|
|||||||
如果成功则通过successCallback回调,失败则通过errorCallback回调。
|
如果成功则通过successCallback回调,失败则通过errorCallback回调。
|
||||||
|
|
||||||
|
|
||||||
|
core.hasSave(index)
|
||||||
|
判定当前某个存档位是否存在存档,返回true/false。
|
||||||
|
index为存档编号,0代表自动存档,大于0则为正常的存档位。
|
||||||
|
|
||||||
|
|
||||||
core.clone(data)
|
core.clone(data)
|
||||||
深拷贝某个对象。
|
深拷贝某个对象。
|
||||||
|
|
||||||
@ -330,12 +343,19 @@ control.js主要用来进行游戏控制,比如行走控制、自动寻路、
|
|||||||
core.control.setGameCanvasTranslate(canvasId, x, y)
|
core.control.setGameCanvasTranslate(canvasId, x, y)
|
||||||
设置大地图的偏移量
|
设置大地图的偏移量
|
||||||
|
|
||||||
|
|
||||||
core.control.updateViewport()
|
core.control.updateViewport()
|
||||||
更新大地图的可见区域
|
更新大地图的可见区域
|
||||||
|
|
||||||
|
|
||||||
|
core.control.gatherFollowers()
|
||||||
|
立刻聚集所有的跟随者
|
||||||
|
|
||||||
|
|
||||||
core.control.replay()
|
core.control.replay()
|
||||||
回放下一个操作
|
回放下一个操作
|
||||||
|
|
||||||
|
|
||||||
========== core.enemys.XXX 和怪物相关的函数 ==========
|
========== core.enemys.XXX 和怪物相关的函数 ==========
|
||||||
enemys.js主要用来进行怪物相关的内容,比如怪物的特殊属性,伤害和临界计算等。
|
enemys.js主要用来进行怪物相关的内容,比如怪物的特殊属性,伤害和临界计算等。
|
||||||
|
|
||||||
@ -463,6 +483,17 @@ core.maps.removeBlockByIds(floorId, ids)
|
|||||||
根据索引删除或禁用若干块。
|
根据索引删除或禁用若干块。
|
||||||
|
|
||||||
|
|
||||||
|
core.maps.drawAnimate(name, x, y, callback)
|
||||||
|
播放一段动画,name为动画名(需在全塔属性注册),x和y为坐标(0-12之间),callback可选,为播放完毕的回调函数。
|
||||||
|
播放过程是异步的,如需等待播放完毕请使用insertAction插入一条type:waitAsync事件。
|
||||||
|
此函数将随机返回一个数字id,为此异步动画的唯一标识符。
|
||||||
|
|
||||||
|
|
||||||
|
core.maps.stopAnimate(id, doCallback)
|
||||||
|
立刻停止一个异步动画。
|
||||||
|
id为该动画的唯一标识符(由drawAnimate函数返回),doCallback可选,若为true则会执行该动画所绑定的回调函数。
|
||||||
|
|
||||||
|
|
||||||
========== core.ui.XXX 和对话框绘制相关的函数 ==========
|
========== core.ui.XXX 和对话框绘制相关的函数 ==========
|
||||||
ui.js主要用来进行UI窗口的绘制,比如对话框、怪物手册、楼传器、存读档界面等等。
|
ui.js主要用来进行UI窗口的绘制,比如对话框、怪物手册、楼传器、存读档界面等等。
|
||||||
|
|
||||||
@ -483,7 +514,7 @@ core.ui.fillText(name, text, x, y, style, font)
|
|||||||
text为要绘制的文本,x,y为要绘制的坐标,style可选为绘制的样式,font可选为绘制的字体。(下同)
|
text为要绘制的文本,x,y为要绘制的坐标,style可选为绘制的样式,font可选为绘制的字体。(下同)
|
||||||
|
|
||||||
|
|
||||||
core.ui.fillBoldText(name, text, style, x, y, font)
|
core.ui.fillBoldText(name, text, x, y, style, font)
|
||||||
在某个画布上绘制一个描黑边的文字。
|
在某个画布上绘制一个描黑边的文字。
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -374,7 +374,7 @@ floorId指定的是目标楼层的唯一标识符(ID)。
|
|||||||
要播放音乐和音效,你需要将对应的文件放在sounds目录下,然后在全塔属性中进行定义
|
要播放音乐和音效,你需要将对应的文件放在sounds目录下,然后在全塔属性中进行定义
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
"bgms": [ // 在此存放所有的bgm,和文件名一致。第一项为默认播放项
|
"bgms": [ // 在此存放所有的bgm,和文件名一致。
|
||||||
// 音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好
|
// 音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好
|
||||||
'bgm.mp3'
|
'bgm.mp3'
|
||||||
];
|
];
|
||||||
@ -386,12 +386,12 @@ floorId指定的是目标楼层的唯一标识符(ID)。
|
|||||||
|
|
||||||
!> 音频名不能使用中文,不能带空格或特殊字符。
|
!> 音频名不能使用中文,不能带空格或特殊字符。
|
||||||
|
|
||||||
目前BGM支持主流的音乐格式,如mp3, ogg, mid格式等。SE则不支持mid格式的播放。
|
目前BGM支持主流的音乐格式,如mp3, ogg,格式等。不支持mid格式的播放。
|
||||||
|
<!--
|
||||||
!> mid格式是通过数学方法模拟出来的音乐效果,质量可能会和实际效果差距较大。
|
!> mid格式是通过数学方法模拟出来的音乐效果,质量可能会和实际效果差距较大。
|
||||||
|
|
||||||
!> **警告!** mid格式在手机端播放可能会特别卡,仍推荐直接使用mp3/ogg来播放。
|
!> **警告!** mid格式在手机端播放可能会特别卡,仍推荐直接使用mp3/ogg来播放。
|
||||||
|
-->
|
||||||
定义完毕后,我们可以调用`playBgm`/`playSound`事件来播放对应的音乐/音效,有关事件的详细介绍请参见[事件](event)。
|
定义完毕后,我们可以调用`playBgm`/`playSound`事件来播放对应的音乐/音效,有关事件的详细介绍请参见[事件](event)。
|
||||||
|
|
||||||
**另外,考虑到用户的流量问题,将遵循如下规则:**
|
**另外,考虑到用户的流量问题,将遵循如下规则:**
|
||||||
|
|||||||
@ -481,6 +481,23 @@ name必填项,代表要修改的全局数值,其和全塔属性中的values
|
|||||||
|
|
||||||
value为必填项,代表要修改到的结果。该项必须是个数值。
|
value为必填项,代表要修改到的结果。该项必须是个数值。
|
||||||
|
|
||||||
|
### setGlobalFlag:设置一个系统开关
|
||||||
|
|
||||||
|
使用`{"type":"setGlobalFlag"}`可以设置一个系统开关。
|
||||||
|
|
||||||
|
``` js
|
||||||
|
"x,y": [ // 实际执行的事件列表
|
||||||
|
{"type": "setGlobalFlag", "name": "enableMDef", "value": false}, // 不在状态栏显示魔防值
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
name必填项,代表要修改的系统开关,其是全塔属性中的flags中的一部分。目前只能为`"enableFloor", "enableName", "enableLv",
|
||||||
|
"enableHPMax", "enableMana", "enableMDef", "enableMoney", "enableExperience", "enableLevelUp", "levelUpLeftMode",
|
||||||
|
"enableKeys", "enablePZF", "enableDebuff", "enableSkill", "flyNearStair", "enableAddPoint", "enableNegativeDamage",
|
||||||
|
"useLoop", "enableGentleClick", "canGoDeadZone", "enableMoveDirectly", "disableShopOnDamage"`。
|
||||||
|
|
||||||
|
value为必填项,只能为true或false,代表要修改到的结果。
|
||||||
|
|
||||||
### show:将一个禁用事件启用
|
### show:将一个禁用事件启用
|
||||||
|
|
||||||
我们上面提到了,所有事件都必须靠其他事件驱动来完成,不存在当某个flag为true时自动执行的说法。那么,我们自然要有启用事件的写法。
|
我们上面提到了,所有事件都必须靠其他事件驱动来完成,不存在当某个flag为true时自动执行的说法。那么,我们自然要有启用事件的写法。
|
||||||
@ -771,10 +788,15 @@ name是可选的,代表目标行走图的文件名。
|
|||||||
``` js
|
``` js
|
||||||
"x,y": [ // 实际执行的事件列表
|
"x,y": [ // 实际执行的事件列表
|
||||||
{"type": "sleep", "time": 1000}, // 等待1000ms
|
{"type": "sleep", "time": 1000}, // 等待1000ms
|
||||||
"等待1000ms后才开始执行这个事件"
|
"等待1000ms后才开始执行这个事件",
|
||||||
|
{"type": "sleep", "time": 2000, "noSkip": true}, // 等待2000毫秒,且不可被跳过
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
默认的等待事件可以被Ctrl跳过,下面两种情况下不可呗跳过:
|
||||||
|
- 加上`"noSkip": true`后
|
||||||
|
- 当前存在尚未执行完毕的异步事件。
|
||||||
|
|
||||||
### battle:强制战斗
|
### battle:强制战斗
|
||||||
|
|
||||||
调用battle可强制与某怪物进行战斗(而无需去触碰到它)。
|
调用battle可强制与某怪物进行战斗(而无需去触碰到它)。
|
||||||
@ -1234,10 +1256,14 @@ async可选,如果为true则会异步执行(即不等待当前事件执行
|
|||||||
|
|
||||||
使用`{"type": "pauseBgm"}`可以暂停背景音乐的播放。
|
使用`{"type": "pauseBgm"}`可以暂停背景音乐的播放。
|
||||||
|
|
||||||
|
**从V2.5.4开始不再支持此事件,请通过设置音量来达到此效果。**
|
||||||
|
|
||||||
### resumeBgm:恢复背景音乐
|
### resumeBgm:恢复背景音乐
|
||||||
|
|
||||||
使用`{"type": "resumeBgm"}`可以恢复背景音乐的播放。
|
使用`{"type": "resumeBgm"}`可以恢复背景音乐的播放。
|
||||||
|
|
||||||
|
**从V2.5.4开始不再支持此事件,请通过设置音量来达到此效果。**
|
||||||
|
|
||||||
### loadBgm:预加载一个背景音乐
|
### loadBgm:预加载一个背景音乐
|
||||||
|
|
||||||
使用loadBgm可以预加载一个背景音乐。
|
使用loadBgm可以预加载一个背景音乐。
|
||||||
@ -1286,6 +1312,24 @@ async可选,如果为true则会异步执行(即不等待当前事件执行
|
|||||||
|
|
||||||
该事件会显示失败页面,并重新开始游戏。
|
该事件会显示失败页面,并重新开始游戏。
|
||||||
|
|
||||||
|
### callBook:呼出怪物手册
|
||||||
|
|
||||||
|
`{"type": "callBook"}` 可以呼出怪物手册,玩家可以自由查看当前楼层怪物数据和详细信息。
|
||||||
|
|
||||||
|
返回游戏后将继续执行后面的事件。没有怪物手册或在录像播放中,则会跳过本事件。
|
||||||
|
|
||||||
|
### callSave:呼出存档界面
|
||||||
|
|
||||||
|
`{"type": "callSave"}` 可以呼出存档页面并允许玩家存一次档。
|
||||||
|
|
||||||
|
在玩家进行一次存档,或者直接点返回游戏后,将接着执行后面的事件。录像播放将会跳过本事件。
|
||||||
|
|
||||||
|
### callLoad:呼出读档界面
|
||||||
|
|
||||||
|
`{"type": "callLoad"}` 可以呼出读档页面并允许玩家进行读档。
|
||||||
|
|
||||||
|
如果玩家没有进行读档而是直接返回游戏,则会继续执行后面的事件。录像播放将会跳过本事件。
|
||||||
|
|
||||||
### input:接受用户输入数字
|
### input:接受用户输入数字
|
||||||
|
|
||||||
使用`{"type": "input"}`可以接受用户的输入的数字。
|
使用`{"type": "input"}`可以接受用户的输入的数字。
|
||||||
@ -1607,7 +1651,7 @@ choices为一个数组,其中每一项都是一个选项列表。
|
|||||||
|
|
||||||
当用户执行操作后:
|
当用户执行操作后:
|
||||||
- 如果是键盘的按键操作,则会将flag:type置为0,并且把flag:keycode置为刚刚按键的keycode。
|
- 如果是键盘的按键操作,则会将flag:type置为0,并且把flag:keycode置为刚刚按键的keycode。
|
||||||
- 如果是屏幕的点击操作,则会将flag:type置为1,并且设置flag:x和flag:y为刚刚的点击坐标。
|
- 如果是屏幕的点击操作,则会将flag:type置为1,并且设置flag:x和flag:y为刚刚的点击坐标(0-12之间),flag:px和flag:py置为刚刚的像素坐标(0-415之间)。
|
||||||
|
|
||||||
下面是一个while事件和wait合并使用的例子,这个例子将不断接收用户的点击或按键行为,并输出该信息。
|
下面是一个while事件和wait合并使用的例子,这个例子将不断接收用户的点击或按键行为,并输出该信息。
|
||||||
如果用户按下了ESC或者点击了屏幕正中心,则退出循环。
|
如果用户按下了ESC或者点击了屏幕正中心,则退出循环。
|
||||||
@ -1627,7 +1671,7 @@ choices为一个数组,其中每一项都是一个选项列表。
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"false": [ // flag:type==1,鼠标点击
|
"false": [ // flag:type==1,鼠标点击
|
||||||
"你当前点击屏幕了,坐标是[${flag:x},${flag:y}]",
|
"你当前点击屏幕了,位置坐标是[${flag:x},${flag:y}],像素坐标是[${flag:px},${flag:py}]",
|
||||||
{"type": "if", "condition": "flag:x==6 && flag:y==6", // 点击(6,6)
|
{"type": "if", "condition": "flag:x==6 && flag:y==6", // 点击(6,6)
|
||||||
"true": [{"type": "break"}], // 跳出循环
|
"true": [{"type": "break"}], // 跳出循环
|
||||||
"false": []
|
"false": []
|
||||||
@ -1693,12 +1737,12 @@ core.insertAction([
|
|||||||
|
|
||||||
从V2.5.3开始,针对每个事件都提供了独立开关。
|
从V2.5.3开始,针对每个事件都提供了独立开关。
|
||||||
|
|
||||||
独立开关的写法是`flag:__A__`, `flag:__B__`直到`flag:__Z__`,共计26个。
|
独立开关的写法是`switch:A`, `switch:A`直到`switch:Z`,共计26个;不过样板中的值块默认只提供前6个。
|
||||||
|
|
||||||
独立开关算是特殊的flag,它在事件中使用时会和事件的楼层及坐标进行绑定;换句话说每个事件对应的`flag:__A__`都是不同的。
|
独立开关算是特殊的flag,它在事件中使用时会和事件的楼层及坐标进行绑定;换句话说每个事件对应的`switch:A`都是不同的。
|
||||||
|
|
||||||
事实上,在某个楼层某个点的事件的独立开关对应的系统flag为`floorId@x@y__X__`,
|
事实上,在某个楼层某个点的事件的独立开关A对应的系统flag为`floorId@x@y@A`,
|
||||||
比如在`MT0`层的`[2,5]`点事件,对应的`flag:__B__`独立开关,实际会被映射到`flag:MT0@2@5__B__`。
|
比如在`MT0`层的`[2,5]`点事件,对应的`switch:B`独立开关,实际会被映射到`flag:MT0@2@5@B`。
|
||||||
|
|
||||||
如果在事件外想访问某个事件的独立开关也需要通过上面这个方式。
|
如果在事件外想访问某个事件的独立开关也需要通过上面这个方式。
|
||||||
|
|
||||||
@ -2206,9 +2250,9 @@ if (core.getFlag("door",0)==2) {
|
|||||||
if (hard=='Easy') { // 简单难度
|
if (hard=='Easy') { // 简单难度
|
||||||
core.setFlag('hard', 1); // 可以用flag:hard来获得当前难度
|
core.setFlag('hard', 1); // 可以用flag:hard来获得当前难度
|
||||||
// 可以在此设置一些初始福利,比如设置初始生命值可以调用:
|
// 可以在此设置一些初始福利,比如设置初始生命值可以调用:
|
||||||
// core.setStatus("hp", 10000);
|
// core.setStatus('hp', 10000);
|
||||||
// 赠送一把黄钥匙可以调用
|
// 赠送一把黄钥匙可以调用
|
||||||
// core.setItem("yellowKey", 1);
|
// core.setItem('yellowKey', 1);
|
||||||
}
|
}
|
||||||
if (hard=='Normal') { // 普通难度
|
if (hard=='Normal') { // 普通难度
|
||||||
core.setFlag('hard', 2); // 可以用flag:hard来获得当前难度
|
core.setFlag('hard', 2); // 可以用flag:hard来获得当前难度
|
||||||
@ -2231,7 +2275,7 @@ if (core.getFlag("door",0)==2) {
|
|||||||
////// 游戏获胜事件 //////
|
////// 游戏获胜事件 //////
|
||||||
"win": function(reason, norank) {
|
"win": function(reason, norank) {
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
var replaying = core.status.replay.replaying;
|
var replaying = core.isReplaying();
|
||||||
core.stopReplay();
|
core.stopReplay();
|
||||||
core.waitHeroToStop(function() {
|
core.waitHeroToStop(function() {
|
||||||
core.clearMap('all'); // 清空全地图
|
core.clearMap('all'); // 清空全地图
|
||||||
@ -2255,7 +2299,7 @@ if (core.getFlag("door",0)==2) {
|
|||||||
////// 游戏失败事件 //////
|
////// 游戏失败事件 //////
|
||||||
"lose": function(reason) {
|
"lose": function(reason) {
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
var replaying = core.status.replay.replaying;
|
var replaying = core.isReplaying();
|
||||||
core.stopReplay();
|
core.stopReplay();
|
||||||
core.waitHeroToStop(function() {
|
core.waitHeroToStop(function() {
|
||||||
core.drawText([
|
core.drawText([
|
||||||
|
|||||||
@ -951,15 +951,15 @@ this.getAchievements = function () {
|
|||||||
- **`flag:hatred`**: 当前的仇恨数值。
|
- **`flag:hatred`**: 当前的仇恨数值。
|
||||||
- **`flag:commonTimes`**: 全局商店共用次数时的访问次数。
|
- **`flag:commonTimes`**: 全局商店共用次数时的访问次数。
|
||||||
- **`flag:input`**: 接受用户输入的事件后,存放用户输入的结果。
|
- **`flag:input`**: 接受用户输入的事件后,存放用户输入的结果。
|
||||||
- **`flag:type`**, **`flag:keycode`**, **`flag:x`**, **`flag:y`**: 等待用户操作后,用户的操作类型,按键keycode或点击坐标。
|
- **`flag:type`**, **`flag:keycode`**, **`flag:x`**, **`flag:y`**, **`flag:px`**, **`flag:py`**: 等待用户操作后,用户的操作类型,按键keycode或点击/像素坐标。
|
||||||
- **`flag:skill`**, **`flag:skillName`**: 开启的技能编号和技能名。
|
- **`flag:skill`**, **`flag:skillName`**: 开启的技能编号和技能名。
|
||||||
- **`flag:heroIcon`**: 当前的勇士行走图名称。
|
- **`flag:heroIcon`**: 当前的勇士行走图名称。
|
||||||
- **`flag:saveEquips`**: 快速换装时保存的套装。
|
- **`flag:saveEquips`**: 快速换装时保存的套装。
|
||||||
- **`flag:__visited__`**: 当前访问过的楼层。
|
- **`flag:__visited__`**: 当前访问过的楼层。
|
||||||
- **`flag:equip_atk_buff`**, **`flag:equip_def_buff`**, **`flag:equip_mdef_buff`**: 当前攻防魔防的实际计算比例加成。
|
- **`flag:equip_atk_buff`**, **`flag:equip_def_buff`**, **`flag:equip_mdef_buff`**: 当前攻防魔防的实际计算比例加成。
|
||||||
- **`flag:forceSave`**: 是否允许事件中强制自动存档。如果将此项置为true并调用core.autosave()即可在事件中强制自动存档,读档时会自动执行该楼层的`eachArrive`事件。
|
|
||||||
- **`flag:__color__`**, **`flag:__weather__`**, **`flag:__volume__`**: 当前的画面色调、天气和音量。
|
- **`flag:__color__`**, **`flag:__weather__`**, **`flag:__volume__`**: 当前的画面色调、天气和音量。
|
||||||
- **`flag:textAttribute`**, **`flag:globalAttribute`**: 当前的剧情文本属性,当前的全局属性。
|
- **`flag:__events__`**: 当前保存的事件列表,读档时会恢复(适用于在事件中存档)
|
||||||
|
- **`flag:textAttribute`**, **`flag:globalAttribute`**, **`flag:globalFlags`**: 当前的剧情文本属性,当前的全局属性,当前的全局开关。
|
||||||
- **`flag:cannotMoveDirectly`**, **`flag:clickMove`**: 当前是否不允许瞬间移动,当前用户是否开启了单击瞬移。
|
- **`flag:cannotMoveDirectly`**, **`flag:clickMove`**: 当前是否不允许瞬间移动,当前用户是否开启了单击瞬移。
|
||||||
- **`flag:hideStatusBar`**, **`flag:showToolbox`**: 是否隐藏状态栏,是否显示工具栏。
|
- **`flag:hideStatusBar`**, **`flag:showToolbox`**: 是否隐藏状态栏,是否显示工具栏。
|
||||||
- **`flag:debug`**, **`flag:consoleOpened`**: 当前是否开启了调试模式,是否开启了控制台。
|
- **`flag:debug`**, **`flag:consoleOpened`**: 当前是否开启了调试模式,是否开启了控制台。
|
||||||
|
|||||||
@ -22,30 +22,48 @@
|
|||||||
<textarea cols="10" rows="10" id="pout" v-model="mapArr"></textarea>
|
<textarea cols="10" rows="10" id="pout" v-model="mapArr"></textarea>
|
||||||
<!-- <p class="warnText" v-if="error">{{ errors[error-1] }}</p> -->
|
<!-- <p class="warnText" v-if="error">{{ errors[error-1] }}</p> -->
|
||||||
</div>
|
</div>
|
||||||
<div id="editTip" style="position: absolute; width: 95vw;margin-bottom: 10%;bottom: 0;left: 4vw;">
|
<div id="editTip">
|
||||||
<input type="button" value="新建空白地图" id='newMap'/>
|
<input id='newFileName' placeholder="新楼层id" style="width: 100px"/>
|
||||||
<input id='newFileName' placeholder="新楼层id" style="width: 70px"/>
|
|
||||||
<span style="vertical-align: bottom">宽</span>
|
<span style="vertical-align: bottom">宽</span>
|
||||||
<input id='newMapWidth' value="13" style="width: 20px"/>
|
<input id='newMapWidth' value="13" style="width: 20px"/>
|
||||||
<span style="vertical-align: bottom">高</span>
|
<span style="vertical-align: bottom">高</span>
|
||||||
<input id='newMapHeight' value="13" style="width: 20px"/>
|
<input id='newMapHeight' value="13" style="width: 20px"/>
|
||||||
<input type="checkbox" id='newMapStatus' checked='checked' style='vertical-align: bottom'/>
|
<input type="checkbox" id='newMapStatus' checked='checked' style='vertical-align: bottom'/>
|
||||||
<span style='vertical-align: bottom; margin-left: -4px'>保留属性</span>
|
<span style='vertical-align: bottom;'>保留楼层属性</span>
|
||||||
|
<br/>
|
||||||
|
<input type="button" value="新建空白地图" id='newMap'/>
|
||||||
</div>
|
</div>
|
||||||
<div style="position: absolute;left: 10px;bottom:0; margin-bottom: 0%">
|
<div id='editBtns'>
|
||||||
<input type="button" value="导出地图" id="exportMap" v-on:click="exportMap"/>
|
<input type="button" value="导出地图" id="exportMap" v-on:click="exportMap"/>
|
||||||
<input type="button" value="复制地图" id="copyMap" v-on:click="copyMap"/>
|
<input type="button" value="复制地图" id="copyMap" v-on:click="copyMap"/>
|
||||||
<input type="button" value="清除地图" id='clearMap' v-on:click="clearMap"/>
|
<input type="button" value="清除地图" id='clearMap' v-on:click="clearMap"/>
|
||||||
<input type="button" value="删除地图" id="deleteMap" v-on:click="deleteMap"/>
|
<input type="button" value="删除地图" id="deleteMap" v-on:click="deleteMap"/>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="button" value="批量创建空白地图 ↓" id='newMaps'/>
|
||||||
|
<div id='newFloors' style='display:none'>
|
||||||
|
<span style="vertical-align: bottom">楼层ID格式: </span>
|
||||||
|
<input id='newFloorIds' style="width: 70px" value='MT${i}'/>
|
||||||
|
<br/>
|
||||||
|
<span style="vertical-align: bottom">地图中文名格式: </span>
|
||||||
|
<input id='newFloorTitles' style="width: 100px" value='主塔 ${i} 层'/>
|
||||||
|
<br/>
|
||||||
|
<span style="vertical-align: bottom">状态栏名称: </span>
|
||||||
|
<input id='newFloorNames' style="width: 70px" value='${i}'/>
|
||||||
|
<br/>
|
||||||
|
<span style="vertical-align: bottom">宽</span>
|
||||||
|
<input id='newMapsWidth' value="13" style="width: 20px"/>
|
||||||
|
<span style="vertical-align: bottom">高</span>
|
||||||
|
<input id='newMapsHeight' value="13" style="width: 20px"/>
|
||||||
|
<input type="checkbox" id='newMapsStatus' checked='checked' style='vertical-align: bottom'/>
|
||||||
|
<span style='vertical-align: bottom; margin-left: -4px'>保留楼层属性</span>
|
||||||
|
<br/>
|
||||||
|
<span style="vertical-align: bottom">从 i=</span>
|
||||||
|
<input id='newMapsFrom' value="1" style="width: 20px"/>
|
||||||
|
<span style="vertical-align: bottom">到</span>
|
||||||
|
<input id='newMapsTo' value="5" style="width: 20px"/>
|
||||||
|
<input type="button" value="确认创建" id='createNewMaps'>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="objDataEditor">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="eventEditor">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="left1" class='leftTab' style="z-index:-1;opacity: 0;"><!-- appendpic -->
|
<div id="left1" class='leftTab' style="z-index:-1;opacity: 0;"><!-- appendpic -->
|
||||||
<h3 class="leftTabHeader">追加素材</h3>
|
<h3 class="leftTabHeader">追加素材</h3>
|
||||||
@ -184,6 +202,10 @@
|
|||||||
<div class="searchLogo"></div>
|
<div class="searchLogo"></div>
|
||||||
<input type="text" id="searchBlock" placeholder="搜索图块"/>
|
<input type="text" id="searchBlock" placeholder="搜索图块"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="colorPanel" class="cpPanel" style="display: none">
|
||||||
|
<input class="color" id="colorPicker" value="255,215,0,1"/>
|
||||||
|
<button onclick="confirmColor()">确定</button>
|
||||||
|
</div>
|
||||||
<xml id="toolbox" style="display:none">
|
<xml id="toolbox" style="display:none">
|
||||||
</xml>
|
</xml>
|
||||||
</h3>
|
</h3>
|
||||||
@ -271,6 +293,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<div id="menuDiv">
|
<div id="menuDiv">
|
||||||
<div id="midMenu" style="display:none">
|
<div id="midMenu" style="display:none">
|
||||||
|
<div id='addFloorEvent' class="menuitem" style="display:none"><div class="menuitem-content">添加上下楼事件</div></div>
|
||||||
<div id='chooseThis' class="menuitem"><div class="menuitem-content">选中此点</div></div>
|
<div id='chooseThis' class="menuitem"><div class="menuitem-content">选中此点</div></div>
|
||||||
<div id='chooseInRight' class="menuitem"><div class="menuitem-content">在素材区选中此图块</div></div>
|
<div id='chooseInRight' class="menuitem"><div class="menuitem-content">在素材区选中此图块</div></div>
|
||||||
<div id='copyLoc' class="menuitem"><div class="menuitem-content">复制此事件</div></div>
|
<div id='copyLoc' class="menuitem"><div class="menuitem-content">复制此事件</div></div>
|
||||||
@ -318,6 +341,7 @@
|
|||||||
<!-- <script>/* -->
|
<!-- <script>/* -->
|
||||||
<div id='gameGroup' style='display:none'>
|
<div id='gameGroup' style='display:none'>
|
||||||
<p id='mainTips'>请稍后...</p>
|
<p id='mainTips'>请稍后...</p>
|
||||||
|
<img id='musicBtn'>
|
||||||
<div id='startPanel'>
|
<div id='startPanel'>
|
||||||
<div id='startTop'>
|
<div id='startTop'>
|
||||||
<div id='startTopProgressBar'>
|
<div id='startTopProgressBar'>
|
||||||
@ -417,7 +441,7 @@
|
|||||||
<img class="tools" id='img-book'>
|
<img class="tools" id='img-book'>
|
||||||
<img class="tools" id='img-fly'>
|
<img class="tools" id='img-fly'>
|
||||||
<img class="tools" id='img-toolbox'>
|
<img class="tools" id='img-toolbox'>
|
||||||
<img class="tools" id='img-shop'>
|
<img class="tools" id='img-keyboard'>
|
||||||
<img class="tools" id='img-save'>
|
<img class="tools" id='img-save'>
|
||||||
<img class="tools" id='img-load'>
|
<img class="tools" id='img-load'>
|
||||||
<img class="tools" id='img-settings'>
|
<img class="tools" id='img-settings'>
|
||||||
@ -511,6 +535,9 @@ if (location.protocol.indexOf("http")!=0) {
|
|||||||
<script src="_server/CodeMirror/codeMirror.bundle.min.js"></script>
|
<script src="_server/CodeMirror/codeMirror.bundle.min.js"></script>
|
||||||
<script src="_server/CodeMirror/jshint.min.js"></script>
|
<script src="_server/CodeMirror/jshint.min.js"></script>
|
||||||
<script src="_server/CodeMirror/codeMirror.plugin.min.js"></script>
|
<script src="_server/CodeMirror/codeMirror.plugin.min.js"></script>
|
||||||
|
<!-- colorPicker -->
|
||||||
|
<script type="text/javascript" src="_server/colorPicker/color.all.min.js"></script>
|
||||||
|
<script type="text/javascript" src="_server/colorPicker/jsColor.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
39
editor.html
39
editor.html
@ -31,20 +31,35 @@
|
|||||||
<input type="checkbox" id='newMapStatus' checked='checked' style='vertical-align: bottom'/>
|
<input type="checkbox" id='newMapStatus' checked='checked' style='vertical-align: bottom'/>
|
||||||
<span style='vertical-align: bottom; margin-left: -4px'>保留楼层属性</span>
|
<span style='vertical-align: bottom; margin-left: -4px'>保留楼层属性</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="position: absolute;left: 10px;bottom:0; margin-bottom: 90px">
|
<div id="editBtns">
|
||||||
<input type="button" value="导出地图" id="exportMap" v-on:click="exportMap"/>
|
<input type="button" value="导出地图" id="exportMap" v-on:click="exportMap"/>
|
||||||
<input type="button" value="复制地图" id="copyMap" v-on:click="copyMap"/>
|
<input type="button" value="复制地图" id="copyMap" v-on:click="copyMap"/>
|
||||||
<input type="button" value="清除地图" id='clearMap' v-on:click="clearMap"/>
|
<input type="button" value="清除地图" id='clearMap' v-on:click="clearMap"/>
|
||||||
<input type="button" value="删除地图" id="deleteMap" v-on:click="deleteMap"/>
|
<input type="button" value="删除地图" id="deleteMap" v-on:click="deleteMap"/>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="button" value="批量创建空白地图 ↓" id='newMaps'/>
|
||||||
|
<div id='newFloors' style='display:none'>
|
||||||
|
<span style="vertical-align: bottom">楼层ID格式: </span>
|
||||||
|
<input id='newFloorIds' style="width: 70px" value='MT${i}'/>
|
||||||
|
<span style="vertical-align: bottom">地图中文名格式: </span>
|
||||||
|
<input id='newFloorTitles' style="width: 100px" value='主塔 ${i} 层'/>
|
||||||
|
<br/>
|
||||||
|
<span style="vertical-align: bottom">状态栏名称: </span>
|
||||||
|
<input id='newFloorNames' style="width: 70px" value='${i}'/>
|
||||||
|
<span style="vertical-align: bottom">宽</span>
|
||||||
|
<input id='newMapsWidth' value="13" style="width: 20px"/>
|
||||||
|
<span style="vertical-align: bottom">高</span>
|
||||||
|
<input id='newMapsHeight' value="13" style="width: 20px"/>
|
||||||
|
<input type="checkbox" id='newMapsStatus' checked='checked' style='vertical-align: bottom'/>
|
||||||
|
<span style='vertical-align: bottom; margin-left: -4px'>保留楼层属性</span>
|
||||||
|
<br/>
|
||||||
|
<span style="vertical-align: bottom">从 i=</span>
|
||||||
|
<input id='newMapsFrom' value="1" style="width: 20px"/>
|
||||||
|
<span style="vertical-align: bottom">到</span>
|
||||||
|
<input id='newMapsTo' value="5" style="width: 20px"/>
|
||||||
|
<input type="button" value="确认创建" id='createNewMaps'>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="objDataEditor">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="eventEditor">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="left1" class='leftTab' style="z-index:-1;opacity: 0;"><!-- appendpic -->
|
<div id="left1" class='leftTab' style="z-index:-1;opacity: 0;"><!-- appendpic -->
|
||||||
<h3 class="leftTabHeader">追加素材</h3>
|
<h3 class="leftTabHeader">追加素材</h3>
|
||||||
@ -181,10 +196,10 @@
|
|||||||
<div style="position: relative; display: inline-block; margin-left: 10px">
|
<div style="position: relative; display: inline-block; margin-left: 10px">
|
||||||
<div class="searchLogo"></div>
|
<div class="searchLogo"></div>
|
||||||
<input type="text" id="searchBlock" placeholder="搜索图块"/>
|
<input type="text" id="searchBlock" placeholder="搜索图块"/>
|
||||||
<button id = "colorSwitch" class="cpPanel" onclick="doHide()" style="margin-left:5px">颜色选择器</button>
|
<button id = "colorSwitch" class="cpPanel" onclick="openColorFromButton()" style="margin-left:5px">颜色选择器</button>
|
||||||
<div id="colorPanel" class="cpPanel" style="display: none">
|
<div id="colorPanel" class="cpPanel" style="display: none">
|
||||||
<input class="color" id="colorPicker" value="255,215,0,1"/>
|
<input class="color" id="colorPicker" value="255,215,0,1"/>
|
||||||
<button onclick="copyColor()">复制</button>
|
<button onclick="confirmColor()">确定</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<xml id="toolbox" style="display:none">
|
<xml id="toolbox" style="display:none">
|
||||||
@ -297,6 +312,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="menuDiv">
|
<div id="menuDiv">
|
||||||
<div id="midMenu" style="display:none">
|
<div id="midMenu" style="display:none">
|
||||||
|
<div id='addFloorEvent' class="menuitem" style="display:none"><div class="menuitem-content">添加上下楼事件</div></div>
|
||||||
<div id='chooseThis' class="menuitem"><div class="menuitem-content">选中此点</div></div>
|
<div id='chooseThis' class="menuitem"><div class="menuitem-content">选中此点</div></div>
|
||||||
<div id='chooseInRight' class="menuitem"><div class="menuitem-content">在素材区选中此图块</div></div>
|
<div id='chooseInRight' class="menuitem"><div class="menuitem-content">在素材区选中此图块</div></div>
|
||||||
<div id='copyLoc' class="menuitem"><div class="menuitem-content">复制此事件</div></div>
|
<div id='copyLoc' class="menuitem"><div class="menuitem-content">复制此事件</div></div>
|
||||||
@ -308,6 +324,7 @@
|
|||||||
<!-- <script>/* -->
|
<!-- <script>/* -->
|
||||||
<div id='gameGroup' style='display:none'>
|
<div id='gameGroup' style='display:none'>
|
||||||
<p id='mainTips'>请稍后...</p>
|
<p id='mainTips'>请稍后...</p>
|
||||||
|
<img id='musicBtn'>
|
||||||
<div id='startPanel'>
|
<div id='startPanel'>
|
||||||
<div id='startTop'>
|
<div id='startTop'>
|
||||||
<div id='startTopProgressBar'>
|
<div id='startTopProgressBar'>
|
||||||
@ -407,7 +424,7 @@
|
|||||||
<img class="tools" id='img-book'>
|
<img class="tools" id='img-book'>
|
||||||
<img class="tools" id='img-fly'>
|
<img class="tools" id='img-fly'>
|
||||||
<img class="tools" id='img-toolbox'>
|
<img class="tools" id='img-toolbox'>
|
||||||
<img class="tools" id='img-shop'>
|
<img class="tools" id='img-keyboard'>
|
||||||
<img class="tools" id='img-save'>
|
<img class="tools" id='img-save'>
|
||||||
<img class="tools" id='img-load'>
|
<img class="tools" id='img-load'>
|
||||||
<img class="tools" id='img-settings'>
|
<img class="tools" id='img-settings'>
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id='gameGroup'>
|
<div id='gameGroup'>
|
||||||
<p id='mainTips'>请稍后...</p>
|
<p id='mainTips'>请稍后...</p>
|
||||||
|
<img id='musicBtn'>
|
||||||
<div id='startPanel'>
|
<div id='startPanel'>
|
||||||
<div id='startTop'>
|
<div id='startTop'>
|
||||||
<div id='startTopProgressBar'>
|
<div id='startTopProgressBar'>
|
||||||
@ -117,7 +118,7 @@
|
|||||||
<img class="tools" id='img-book'>
|
<img class="tools" id='img-book'>
|
||||||
<img class="tools" id='img-fly'>
|
<img class="tools" id='img-fly'>
|
||||||
<img class="tools" id='img-toolbox'>
|
<img class="tools" id='img-toolbox'>
|
||||||
<img class="tools" id='img-shop'>
|
<img class="tools" id='img-keyboard'>
|
||||||
<img class="tools" id='img-save'>
|
<img class="tools" id='img-save'>
|
||||||
<img class="tools" id='img-load'>
|
<img class="tools" id='img-load'>
|
||||||
<img class="tools" id='img-settings'>
|
<img class="tools" id='img-settings'>
|
||||||
@ -145,7 +146,6 @@
|
|||||||
<canvas class='gameCanvas' id='data' width='416' height='416'>此浏览器不支持HTML5</canvas>
|
<canvas class='gameCanvas' id='data' width='416' height='416'>此浏览器不支持HTML5</canvas>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src='libs/thirdparty/mid.min.js'></script>
|
|
||||||
<script src='libs/thirdparty/lz-string.min.js'></script>
|
<script src='libs/thirdparty/lz-string.min.js'></script>
|
||||||
<script src='libs/thirdparty/priority-queue.min.js'></script>
|
<script src='libs/thirdparty/priority-queue.min.js'></script>
|
||||||
<script src='libs/thirdparty/localforage.min.js'></script>
|
<script src='libs/thirdparty/localforage.min.js'></script>
|
||||||
|
|||||||
230
libs/actions.js
230
libs/actions.js
@ -13,10 +13,16 @@ actions.prototype.init = function () {
|
|||||||
this.actionsdata = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.actions;
|
this.actionsdata = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actions.prototype.checkReplaying = function () {
|
||||||
|
if (core.isReplaying()&&core.status.event.id!='save'
|
||||||
|
&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps')
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////// 按下某个键时 //////
|
////// 按下某个键时 //////
|
||||||
actions.prototype.onkeyDown = function (e) {
|
actions.prototype.onkeyDown = function (e) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying
|
if (this.checkReplaying()) return;
|
||||||
&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return;
|
|
||||||
if (!core.isset(core.status.holdingKeys))core.status.holdingKeys=[];
|
if (!core.isset(core.status.holdingKeys))core.status.holdingKeys=[];
|
||||||
var isArrow={37:true,38:true,39:true,40:true}[e.keyCode]
|
var isArrow={37:true,38:true,39:true,40:true}[e.keyCode]
|
||||||
if(isArrow && !core.status.lockControl){
|
if(isArrow && !core.status.lockControl){
|
||||||
@ -35,8 +41,7 @@ actions.prototype.onkeyDown = function (e) {
|
|||||||
|
|
||||||
////// 放开某个键时 //////
|
////// 放开某个键时 //////
|
||||||
actions.prototype.onkeyUp = function(e) {
|
actions.prototype.onkeyUp = function(e) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying
|
if (this.checkReplaying()) {
|
||||||
&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') {
|
|
||||||
if (e.keyCode==27) // ESCAPE
|
if (e.keyCode==27) // ESCAPE
|
||||||
core.stopReplay();
|
core.stopReplay();
|
||||||
else if (e.keyCode==90) // Z
|
else if (e.keyCode==90) // Z
|
||||||
@ -82,7 +87,7 @@ actions.prototype.onkeyUp = function(e) {
|
|||||||
|
|
||||||
////// 按住某个键时 //////
|
////// 按住某个键时 //////
|
||||||
actions.prototype.pressKey = function (keyCode) {
|
actions.prototype.pressKey = function (keyCode) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
|
if (this.checkReplaying()) return;
|
||||||
if (keyCode === core.status.holdingKeys.slice(-1)[0]) {
|
if (keyCode === core.status.holdingKeys.slice(-1)[0]) {
|
||||||
this.keyDown(keyCode);
|
this.keyDown(keyCode);
|
||||||
window.setTimeout(function(){core.pressKey(keyCode);},30);
|
window.setTimeout(function(){core.pressKey(keyCode);},30);
|
||||||
@ -91,8 +96,7 @@ actions.prototype.pressKey = function (keyCode) {
|
|||||||
|
|
||||||
////// 根据按下键的code来执行一系列操作 //////
|
////// 根据按下键的code来执行一系列操作 //////
|
||||||
actions.prototype.keyDown = function(keyCode) {
|
actions.prototype.keyDown = function(keyCode) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying
|
if (this.checkReplaying()) return;
|
||||||
&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return;
|
|
||||||
if (core.status.lockControl) {
|
if (core.status.lockControl) {
|
||||||
// Ctrl跳过对话
|
// Ctrl跳过对话
|
||||||
if (keyCode==17) {
|
if (keyCode==17) {
|
||||||
@ -193,8 +197,7 @@ actions.prototype.keyDown = function(keyCode) {
|
|||||||
|
|
||||||
////// 根据放开键的code来执行一系列操作 //////
|
////// 根据放开键的code来执行一系列操作 //////
|
||||||
actions.prototype.keyUp = function(keyCode, altKey, fromReplay) {
|
actions.prototype.keyUp = function(keyCode, altKey, fromReplay) {
|
||||||
if (!fromReplay && core.isset(core.status.replay)&&core.status.replay.replaying
|
if (!fromReplay && this.checkReplaying()) return;
|
||||||
&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return;
|
|
||||||
|
|
||||||
var ok = function (keycode) {
|
var ok = function (keycode) {
|
||||||
return keycode==27 || keycode==88 || keycode==13 || keycode==32 || keycode==67;
|
return keycode==27 || keycode==88 || keycode==13 || keycode==32 || keycode==67;
|
||||||
@ -324,19 +327,31 @@ actions.prototype.keyUp = function(keyCode, altKey, fromReplay) {
|
|||||||
|
|
||||||
////// 点击(触摸)事件按下时 //////
|
////// 点击(触摸)事件按下时 //////
|
||||||
actions.prototype.ondown = function (loc) {
|
actions.prototype.ondown = function (loc) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying
|
if (this.checkReplaying()) return;
|
||||||
&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return;
|
|
||||||
|
var x = parseInt(loc.x / loc.size), y = parseInt(loc.y / loc.size);
|
||||||
|
var px = parseInt(loc.x/core.domStyle.scale), py = parseInt(loc.y/core.domStyle.scale);
|
||||||
|
|
||||||
// 画板
|
// 画板
|
||||||
if (core.status.played && (core.status.event||{}).id=='paint') {
|
if (core.status.played && (core.status.event||{}).id=='paint') {
|
||||||
this.ondownPaint(loc.x/core.domStyle.scale, loc.y/core.domStyle.scale);
|
this.ondownPaint(px, py);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var x = parseInt(loc.x / loc.size), y = parseInt(loc.y / loc.size);
|
|
||||||
|
|
||||||
if (!core.status.played || core.status.lockControl) {
|
if (!core.status.played || core.status.lockControl) {
|
||||||
this.onclick(x, y, []);
|
|
||||||
|
if (!this.checkReplaying() && core.status.event.id=='action' && core.status.event.data.type=='wait') {
|
||||||
|
core.setFlag('type', 1);
|
||||||
|
core.setFlag('x', x);
|
||||||
|
core.setFlag('y', y);
|
||||||
|
core.setFlag('px', px);
|
||||||
|
core.setFlag('py', py);
|
||||||
|
core.status.route.push("input:"+(1000000+1000*px+py));
|
||||||
|
core.doAction();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.onclick(x, y, []);
|
||||||
|
}
|
||||||
if (core.timeout.onDownTimeout==null) {
|
if (core.timeout.onDownTimeout==null) {
|
||||||
core.timeout.onDownTimeout = setTimeout(function () {
|
core.timeout.onDownTimeout = setTimeout(function () {
|
||||||
if (core.interval.onDownInterval == null) {
|
if (core.interval.onDownInterval == null) {
|
||||||
@ -362,8 +377,7 @@ actions.prototype.ondown = function (loc) {
|
|||||||
|
|
||||||
////// 当在触摸屏上滑动时 //////
|
////// 当在触摸屏上滑动时 //////
|
||||||
actions.prototype.onmove = function (loc) {
|
actions.prototype.onmove = function (loc) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying
|
if (this.checkReplaying()) return;
|
||||||
&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return;
|
|
||||||
|
|
||||||
// 画板
|
// 画板
|
||||||
if (core.status.played && (core.status.event||{}).id=='paint') {
|
if (core.status.played && (core.status.event||{}).id=='paint') {
|
||||||
@ -373,29 +387,30 @@ actions.prototype.onmove = function (loc) {
|
|||||||
|
|
||||||
var x = parseInt(loc.x / loc.size), y = parseInt(loc.y / loc.size);
|
var x = parseInt(loc.x / loc.size), y = parseInt(loc.y / loc.size);
|
||||||
|
|
||||||
var pos={'x':x,'y':y};
|
if ((core.status.stepPostfix||[]).length>0) {
|
||||||
var pos0=core.status.stepPostfix[core.status.stepPostfix.length-1];
|
var pos={'x':x,'y':y};
|
||||||
var directionDistance=[pos.y-pos0.y,pos0.x-pos.x,pos0.y-pos.y,pos.x-pos0.x];
|
var pos0=core.status.stepPostfix[core.status.stepPostfix.length-1];
|
||||||
var max=0,index=4;
|
var directionDistance=[pos.y-pos0.y,pos0.x-pos.x,pos0.y-pos.y,pos.x-pos0.x];
|
||||||
for(var ii=0;ii<4;ii++){
|
var max=0,index=4;
|
||||||
if(directionDistance[ii]>max){
|
for(var ii=0;ii<4;ii++){
|
||||||
index=ii;
|
if(directionDistance[ii]>max){
|
||||||
max=directionDistance[ii];
|
index=ii;
|
||||||
|
max=directionDistance[ii];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pos=[{'x':0,'y':1},{'x':-1,'y':0},{'x':0,'y':-1},{'x':1,'y':0},false][index]
|
||||||
|
if(pos){
|
||||||
|
pos.x+=pos0.x;
|
||||||
|
pos.y+=pos0.y;
|
||||||
|
core.status.stepPostfix.push(pos);
|
||||||
|
core.fillPosWithPoint(pos);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
pos=[{'x':0,'y':1},{'x':-1,'y':0},{'x':0,'y':-1},{'x':1,'y':0},false][index]
|
|
||||||
if(pos){
|
|
||||||
pos.x+=pos0.x;
|
|
||||||
pos.y+=pos0.y;
|
|
||||||
core.status.stepPostfix.push(pos);
|
|
||||||
core.fillPosWithPoint(pos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 当点击(触摸)事件放开时 //////
|
////// 当点击(触摸)事件放开时 //////
|
||||||
actions.prototype.onup = function () {
|
actions.prototype.onup = function () {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying
|
if (this.checkReplaying()) return;
|
||||||
&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return;
|
|
||||||
|
|
||||||
// 画板
|
// 画板
|
||||||
if (core.status.played && (core.status.event||{}).id=='paint') {
|
if (core.status.played && (core.status.event||{}).id=='paint') {
|
||||||
@ -409,7 +424,7 @@ actions.prototype.onup = function () {
|
|||||||
core.interval.onDownInterval = null;
|
core.interval.onDownInterval = null;
|
||||||
|
|
||||||
// core.status.holdingPath=0;
|
// core.status.holdingPath=0;
|
||||||
if(core.status.stepPostfix.length>0){
|
if ((core.status.stepPostfix||[]).length>0) {
|
||||||
var stepPostfix = [];
|
var stepPostfix = [];
|
||||||
var direction={'0':{'1':'down','-1':'up'},'-1':{'0':'left'},'1':{'0':'right'}};
|
var direction={'0':{'1':'down','-1':'up'},'-1':{'0':'left'},'1':{'0':'right'}};
|
||||||
for(var ii=1;ii<core.status.stepPostfix.length;ii++){
|
for(var ii=1;ii<core.status.stepPostfix.length;ii++){
|
||||||
@ -460,8 +475,7 @@ actions.prototype.getClickLoc = function (x, y) {
|
|||||||
|
|
||||||
////// 具体点击屏幕上(x,y)点时,执行的操作 //////
|
////// 具体点击屏幕上(x,y)点时,执行的操作 //////
|
||||||
actions.prototype.onclick = function (x, y, stepPostfix) {
|
actions.prototype.onclick = function (x, y, stepPostfix) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying
|
if (this.checkReplaying()) return;
|
||||||
&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return;
|
|
||||||
// console.log("Click: (" + x + "," + y + ")");
|
// console.log("Click: (" + x + "," + y + ")");
|
||||||
|
|
||||||
stepPostfix=stepPostfix||[];
|
stepPostfix=stepPostfix||[];
|
||||||
@ -620,8 +634,7 @@ actions.prototype.onclick = function (x, y, stepPostfix) {
|
|||||||
actions.prototype.onmousewheel = function (direct) {
|
actions.prototype.onmousewheel = function (direct) {
|
||||||
// 向下滚动是 -1 ,向上是 1
|
// 向下滚动是 -1 ,向上是 1
|
||||||
|
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying
|
if (this.checkReplaying()) {
|
||||||
&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') {
|
|
||||||
// 滚轮控制速度
|
// 滚轮控制速度
|
||||||
if (direct==1) core.speedUpReplay();
|
if (direct==1) core.speedUpReplay();
|
||||||
if (direct==-1) core.speedDownReplay();
|
if (direct==-1) core.speedDownReplay();
|
||||||
@ -678,6 +691,16 @@ actions.prototype.longClick = function (x, y, fromEvent) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 长按可以跳过等待事件
|
||||||
|
if (core.status.event.id=='action' && core.status.event.data.type=='sleep'
|
||||||
|
&& !core.status.event.data.current.noSkip) {
|
||||||
|
if (core.isset(core.timeout.sleepTimeout) && Object.keys(core.animateFrame.asyncId).length==0) {
|
||||||
|
clearTimeout(core.timeout.sleepTimeout);
|
||||||
|
core.timeout.sleepTimeout = null;
|
||||||
|
core.events.doAction();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!fromEvent) {
|
else if (!fromEvent) {
|
||||||
core.waitHeroToStop(function () {
|
core.waitHeroToStop(function () {
|
||||||
@ -698,6 +721,15 @@ actions.prototype.keyDownCtrl = function () {
|
|||||||
core.doAction();
|
core.doAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (core.status.event.id=='action' && core.status.event.data.type=='sleep'
|
||||||
|
&& !core.status.event.data.current.noSkip) {
|
||||||
|
if (core.isset(core.timeout.sleepTimeout) && Object.keys(core.animateFrame.asyncId).length==0) {
|
||||||
|
clearTimeout(core.timeout.sleepTimeout);
|
||||||
|
core.timeout.sleepTimeout = null;
|
||||||
|
core.events.doAction();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//////
|
//////
|
||||||
@ -772,6 +804,7 @@ actions.prototype.clickAction = function (x,y) {
|
|||||||
core.doAction();
|
core.doAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if (core.status.event.data.type=='wait') {
|
if (core.status.event.data.type=='wait') {
|
||||||
core.setFlag('type', 1);
|
core.setFlag('type', 1);
|
||||||
core.setFlag('x', x);
|
core.setFlag('x', x);
|
||||||
@ -780,6 +813,7 @@ actions.prototype.clickAction = function (x,y) {
|
|||||||
core.doAction();
|
core.doAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if (core.status.event.data.type=='choices') {
|
if (core.status.event.data.type=='choices') {
|
||||||
// 选项
|
// 选项
|
||||||
@ -869,12 +903,14 @@ actions.prototype.clickBook = function(x,y) {
|
|||||||
}
|
}
|
||||||
// 返回
|
// 返回
|
||||||
if (x>=10 && x<=12 && y==12) {
|
if (x>=10 && x<=12 && y==12) {
|
||||||
if (core.status.event.selection==null)
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
core.ui.closePanel();
|
return;
|
||||||
else {
|
|
||||||
core.status.boxAnimateObjs = [];
|
|
||||||
core.ui.drawMaps(core.status.event.selection);
|
|
||||||
}
|
}
|
||||||
|
else if (core.status.event.ui != null) {
|
||||||
|
core.status.boxAnimateObjs = [];
|
||||||
|
core.ui.drawMaps(core.status.event.ui);
|
||||||
|
}
|
||||||
|
else core.ui.closePanel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 怪物信息
|
// 怪物信息
|
||||||
@ -902,12 +938,14 @@ actions.prototype.keyDownBook = function (keycode) {
|
|||||||
////// 怪物手册界面时,放开某个键的操作 //////
|
////// 怪物手册界面时,放开某个键的操作 //////
|
||||||
actions.prototype.keyUpBook = function (keycode) {
|
actions.prototype.keyUpBook = function (keycode) {
|
||||||
if (keycode==27 || keycode==88) {
|
if (keycode==27 || keycode==88) {
|
||||||
if (core.status.event.selection==null)
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
core.ui.closePanel();
|
return;
|
||||||
else {
|
|
||||||
core.status.boxAnimateObjs = [];
|
|
||||||
core.ui.drawMaps(core.status.event.selection);
|
|
||||||
}
|
}
|
||||||
|
else if (core.status.event.ui != null) {
|
||||||
|
core.status.boxAnimateObjs = [];
|
||||||
|
core.ui.drawMaps(core.status.event.ui);
|
||||||
|
}
|
||||||
|
else core.ui.closePanel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (keycode==13 || keycode==32 || keycode==67) {
|
if (keycode==13 || keycode==32 || keycode==67) {
|
||||||
@ -1042,7 +1080,7 @@ actions.prototype.keyUpViewMaps = function (keycode) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keycode==27 || keycode==13 || keycode==32 || (!core.status.replay.replaying && keycode==67)) {
|
if (keycode==27 || keycode==13 || keycode==32 || (!core.isReplaying() && keycode==67)) {
|
||||||
core.clearMap('data');
|
core.clearMap('data');
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
return;
|
return;
|
||||||
@ -1062,8 +1100,8 @@ actions.prototype.keyUpViewMaps = function (keycode) {
|
|||||||
core.ui.drawMaps(core.status.event.data);
|
core.ui.drawMaps(core.status.event.data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (keycode==88 || (core.status.replay.replaying && keycode==67)) {
|
if (keycode==88 || (core.isReplaying() && keycode==67)) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.bookReplay();
|
core.bookReplay();
|
||||||
} else {
|
} else {
|
||||||
core.openBook(false);
|
core.openBook(false);
|
||||||
@ -1632,6 +1670,9 @@ actions.prototype.clickSL = function(x,y) {
|
|||||||
}
|
}
|
||||||
// 返回
|
// 返回
|
||||||
if (x>=10 && x<=12 && y==12) {
|
if (x>=10 && x<=12 && y==12) {
|
||||||
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
if (!core.isPlaying()) {
|
if (!core.isPlaying()) {
|
||||||
core.showStartAnimate(true);
|
core.showStartAnimate(true);
|
||||||
@ -1744,6 +1785,9 @@ actions.prototype.keyUpSL = function (keycode) {
|
|||||||
var page = parseInt(index/10), offset=index%10;
|
var page = parseInt(index/10), offset=index%10;
|
||||||
|
|
||||||
if (keycode==27 || keycode==88 || (core.status.event.id == 'save' && keycode==83) || (core.status.event.id == 'load' && keycode==68)) {
|
if (keycode==27 || keycode==88 || (core.status.event.id == 'save' && keycode==83) || (core.status.event.id == 'load' && keycode==68)) {
|
||||||
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
if (!core.isPlaying()) {
|
if (!core.isPlaying()) {
|
||||||
core.showStartAnimate(true);
|
core.showStartAnimate(true);
|
||||||
@ -1791,14 +1835,7 @@ actions.prototype.clickSwitchs = function (x,y) {
|
|||||||
var selection = y-topIndex;
|
var selection = y-topIndex;
|
||||||
switch (selection) {
|
switch (selection) {
|
||||||
case 0:
|
case 0:
|
||||||
core.musicStatus.bgmStatus = !core.musicStatus.bgmStatus;
|
core.triggerBgm();
|
||||||
if (core.musicStatus.bgmStatus)
|
|
||||||
core.resumeBgm();
|
|
||||||
else {
|
|
||||||
core.pauseBgm();
|
|
||||||
core.musicStatus.playingBgm = null;
|
|
||||||
}
|
|
||||||
core.setLocalStorage('bgmStatus', core.musicStatus.bgmStatus);
|
|
||||||
core.ui.drawSwitchs();
|
core.ui.drawSwitchs();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@ -1837,6 +1874,9 @@ actions.prototype.clickSwitchs = function (x,y) {
|
|||||||
case 6:
|
case 6:
|
||||||
core.platform.useLocalForage=!core.platform.useLocalForage;
|
core.platform.useLocalForage=!core.platform.useLocalForage;
|
||||||
core.setLocalStorage('useLocalForage', core.platform.useLocalForage);
|
core.setLocalStorage('useLocalForage', core.platform.useLocalForage);
|
||||||
|
core.control.getSaveIndexes(function (indexes) {
|
||||||
|
core.saves.ids = indexes;
|
||||||
|
});
|
||||||
core.ui.drawSwitchs();
|
core.ui.drawSwitchs();
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
@ -1844,6 +1884,11 @@ actions.prototype.clickSwitchs = function (x,y) {
|
|||||||
core.ui.drawSwitchs();
|
core.ui.drawSwitchs();
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
|
core.platform.extendKeyboard = !core.platform.extendKeyboard;
|
||||||
|
core.setLocalStorage('extendKeyboard', core.platform.extendKeyboard);
|
||||||
|
core.ui.drawSwitchs();
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
core.status.event.selection=0;
|
core.status.event.selection=0;
|
||||||
core.ui.drawSettings();
|
core.ui.drawSettings();
|
||||||
break;
|
break;
|
||||||
@ -2009,12 +2054,11 @@ actions.prototype.clickSyncSave = function (x,y) {
|
|||||||
core.ui.drawConfirmBox("所有本地存档都将被覆盖,确认?", function () {
|
core.ui.drawConfirmBox("所有本地存档都将被覆盖,确认?", function () {
|
||||||
for (var i=1;i<=5*(main.savePages||30);i++) {
|
for (var i=1;i<=5*(main.savePages||30);i++) {
|
||||||
if (i<=data.length) {
|
if (i<=data.length) {
|
||||||
// core.setLocalStorage("save"+i, data[i-1]);
|
|
||||||
core.setLocalForage("save"+i, data[i-1]);
|
core.setLocalForage("save"+i, data[i-1]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// core.removeLocalStorage("save"+i);
|
if (core.saves.ids[i])
|
||||||
core.removeLocalForage("save"+i);
|
core.removeLocalForage("save"+i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.drawText("读取成功!\n你的本地所有存档均已被覆盖。");
|
core.drawText("读取成功!\n你的本地所有存档均已被覆盖。");
|
||||||
@ -2024,9 +2068,9 @@ actions.prototype.clickSyncSave = function (x,y) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// core.setLocalStorage("save"+core.status.saveIndex, data);
|
// core.setLocalStorage("save"+core.saves.saveIndex, data);
|
||||||
core.setLocalForage("save"+core.status.saveIndex, data, function() {
|
core.setLocalForage("save"+core.saves.saveIndex, data, function() {
|
||||||
core.drawText("同步成功!\n单存档已覆盖至存档"+core.status.saveIndex);
|
core.drawText("同步成功!\n单存档已覆盖至存档"+core.saves.saveIndex);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function () {
|
||||||
@ -2161,30 +2205,10 @@ actions.prototype.clickLocalSaveSelect = function (x,y) {
|
|||||||
|
|
||||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||||
|
|
||||||
var saves=null;
|
|
||||||
|
|
||||||
if (y>=topIndex && y<topIndex+choices.length) {
|
if (y>=topIndex && y<topIndex+choices.length) {
|
||||||
var selection = y - topIndex;
|
var selection = y - topIndex;
|
||||||
/*
|
|
||||||
switch (selection) {
|
|
||||||
case 0:
|
|
||||||
saves=[];
|
|
||||||
for (var i=1;i<=5*(main.savePages||30);i++) {
|
|
||||||
var data = core.getLocalStorage("save"+i, null);
|
|
||||||
if (core.isset(data)) {
|
|
||||||
saves.push(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
saves=core.getLocalStorage("save"+core.status.saveIndex, null);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (selection<2) {
|
if (selection<2) {
|
||||||
core.control.getSaves(selection==0?null:core.status.saveIndex, function(saves) {
|
core.control.getSaves(selection==0?null:core.saves.saveIndex, function(saves) {
|
||||||
if (core.isset(saves)) {
|
if (core.isset(saves)) {
|
||||||
var content = {
|
var content = {
|
||||||
"name": core.firstData.name,
|
"name": core.firstData.name,
|
||||||
@ -2251,39 +2275,43 @@ actions.prototype.clickStorageRemove = function (x, y) {
|
|||||||
localforage.clear(function () {
|
localforage.clear(function () {
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.drawText("\t[操作成功]你的所有存档已被清空。");
|
core.drawText("\t[操作成功]你的所有存档已被清空。");
|
||||||
core.status.saveIndex = 1;
|
core.saves.saveIndex = 1;
|
||||||
core.removeLocalStorage('saveIndex');
|
core.removeLocalStorage('saveIndex');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
core.drawText("\t[操作成功]你的所有存档已被清空。");
|
core.drawText("\t[操作成功]你的所有存档已被清空。");
|
||||||
core.status.saveIndex = 1;
|
core.saves.saveIndex = 1;
|
||||||
core.removeLocalStorage('saveIndex');
|
core.removeLocalStorage('saveIndex');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (core.platform.useLocalForage) {
|
if (core.platform.useLocalForage) {
|
||||||
core.ui.drawWaiting("正在清空,请稍后...");
|
core.ui.drawWaiting("正在清空,请稍后...");
|
||||||
for (var i=1;i<=5*(main.savePages||30);i++) {
|
Object.keys(core.saves.ids).forEach(function (v) {
|
||||||
// core.removeLocalStorage("save"+i);
|
if (v!=0)
|
||||||
core.removeLocalForage("save"+i);
|
core.removeLocalForage("save"+v);
|
||||||
}
|
});
|
||||||
core.removeLocalForage("autoSave", function() {
|
core.removeLocalForage("autoSave", function() {
|
||||||
|
core.saves.autosave.data = null;
|
||||||
|
core.saves.autosave.updated = false;
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.drawText("\t[操作成功]当前塔的存档已被清空。");
|
core.drawText("\t[操作成功]当前塔的存档已被清空。");
|
||||||
core.status.saveIndex = 1;
|
core.saves.saveIndex = 1;
|
||||||
core.removeLocalStorage('saveIndex');
|
core.removeLocalStorage('saveIndex');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (var i=1;i<=5*(main.savePages||30);i++) {
|
Object.keys(core.saves.ids).forEach(function (v) {
|
||||||
// core.removeLocalStorage("save"+i);
|
if (v!=0)
|
||||||
core.removeLocalStorage("save"+i);
|
core.removeLocalStorage("save"+v);
|
||||||
}
|
});
|
||||||
core.removeLocalStorage("autoSave");
|
core.removeLocalStorage("autoSave");
|
||||||
|
core.saves.autosave.data = null;
|
||||||
|
core.saves.autosave.updated = false;
|
||||||
core.drawText("\t[操作成功]当前塔的存档已被清空。");
|
core.drawText("\t[操作成功]当前塔的存档已被清空。");
|
||||||
core.status.saveIndex = 1;
|
core.saves.saveIndex = 1;
|
||||||
core.removeLocalStorage('saveIndex');
|
core.removeLocalStorage('saveIndex');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2350,7 +2378,7 @@ actions.prototype.clickReplay = function (x, y) {
|
|||||||
{
|
{
|
||||||
core.status.event.id = 'replayLoad';
|
core.status.event.id = 'replayLoad';
|
||||||
core.status.event.selection = null;
|
core.status.event.selection = null;
|
||||||
var saveIndex = core.status.saveIndex;
|
var saveIndex = core.saves.saveIndex;
|
||||||
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
||||||
core.ui.drawSLPanel(10*page+offset);
|
core.ui.drawSLPanel(10*page+offset);
|
||||||
break;
|
break;
|
||||||
@ -2716,7 +2744,7 @@ actions.prototype.loadPaint = function () {
|
|||||||
actions.prototype.exitPaint = function () {
|
actions.prototype.exitPaint = function () {
|
||||||
core.deleteCanvas('paint');
|
core.deleteCanvas('paint');
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.statusBar.image.shop.style.opacity = 1;
|
core.statusBar.image.keyboard.style.opacity = 1;
|
||||||
core.updateStatusBar();
|
core.updateStatusBar();
|
||||||
core.drawTip("退出绘图模式");
|
core.drawTip("退出绘图模式");
|
||||||
}
|
}
|
||||||
|
|||||||
390
libs/control.js
390
libs/control.js
@ -55,6 +55,7 @@ control.prototype.setRequestAnimationFrame = function () {
|
|||||||
core.animateFrame.moveTime = core.animateFrame.moveTime||timestamp;
|
core.animateFrame.moveTime = core.animateFrame.moveTime||timestamp;
|
||||||
core.animateFrame.lastLegTime = core.animateFrame.lastLegTime||timestamp;
|
core.animateFrame.lastLegTime = core.animateFrame.lastLegTime||timestamp;
|
||||||
core.animateFrame.weather.time = core.animateFrame.weather.time||timestamp;
|
core.animateFrame.weather.time = core.animateFrame.weather.time||timestamp;
|
||||||
|
core.saves.autosave.time = core.saves.autosave.time||timestamp;
|
||||||
|
|
||||||
// move time
|
// move time
|
||||||
if (core.isPlaying() && core.isset(core.status) && core.isset(core.status.hero)
|
if (core.isPlaying() && core.isset(core.status) && core.isset(core.status.hero)
|
||||||
@ -102,6 +103,12 @@ control.prototype.setRequestAnimationFrame = function () {
|
|||||||
core.animateFrame.boxTime = timestamp;
|
core.animateFrame.boxTime = timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AutosaveTime
|
||||||
|
if (timestamp - core.saves.autosave.time > 5000 && core.isPlaying()) {
|
||||||
|
core.control.checkAutosave();
|
||||||
|
core.saves.autosave.time = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
// selectorTime
|
// selectorTime
|
||||||
if (timestamp-core.animateFrame.selectorTime>20 && core.isset(core.dymCanvas.selector)) {
|
if (timestamp-core.animateFrame.selectorTime>20 && core.isset(core.dymCanvas.selector)) {
|
||||||
var opacity = parseFloat(core.dymCanvas.selector.canvas.style.opacity);
|
var opacity = parseFloat(core.dymCanvas.selector.canvas.style.opacity);
|
||||||
@ -271,6 +278,25 @@ control.prototype.setRequestAnimationFrame = function () {
|
|||||||
// 执行用户的并行事件处理内容
|
// 执行用户的并行事件处理内容
|
||||||
functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins.parallelDo(timestamp);
|
functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins.parallelDo(timestamp);
|
||||||
|
|
||||||
|
if (core.isPlaying()) {
|
||||||
|
// 执行插件中的每帧函数
|
||||||
|
var renderFrameFuncs = core.plugin.__renderFrameFuncs || [];
|
||||||
|
renderFrameFuncs.forEach(function (t) {
|
||||||
|
try {
|
||||||
|
if (t instanceof Function) {
|
||||||
|
t(timestamp);
|
||||||
|
}
|
||||||
|
else if (typeof t == 'string') {
|
||||||
|
if (core.plugin[t])
|
||||||
|
core.plugin[t](timestamp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 检查控制台状态
|
// 检查控制台状态
|
||||||
if (core.utils.consoleOpened()) {
|
if (core.utils.consoleOpened()) {
|
||||||
core.setFlag('consoleOpened', true);
|
core.setFlag('consoleOpened', true);
|
||||||
@ -380,6 +406,7 @@ control.prototype.resetStatus = function(hero, hard, floorId, route, maps, value
|
|||||||
|
|
||||||
// 初始化status
|
// 初始化status
|
||||||
core.status = core.clone(core.initStatus);
|
core.status = core.clone(core.initStatus);
|
||||||
|
core.status.played = true;
|
||||||
// 初始化maps
|
// 初始化maps
|
||||||
core.status.floorId = floorId;
|
core.status.floorId = floorId;
|
||||||
core.status.maps = core.clone(maps);
|
core.status.maps = core.clone(maps);
|
||||||
@ -412,24 +439,26 @@ control.prototype.resetStatus = function(hero, hard, floorId, route, maps, value
|
|||||||
// 初始化路线
|
// 初始化路线
|
||||||
if (core.isset(route))
|
if (core.isset(route))
|
||||||
core.status.route = route;
|
core.status.route = route;
|
||||||
// 保存的Index
|
|
||||||
core.status.saveIndex = core.getLocalStorage('saveIndex', 1);
|
|
||||||
|
|
||||||
if (core.isset(values))
|
if (core.isset(values))
|
||||||
core.values = core.clone(values);
|
core.values = core.clone(values);
|
||||||
else core.values = core.clone(core.data.values);
|
else core.values = core.clone(core.data.values);
|
||||||
|
|
||||||
|
core.flags = core.clone(core.data.flags);
|
||||||
|
var systemFlags = core.getFlag("globalFlags", {});
|
||||||
|
for (var key in systemFlags)
|
||||||
|
core.flags[key] = systemFlags[key];
|
||||||
|
|
||||||
core.events.initGame();
|
core.events.initGame();
|
||||||
|
core.resize();
|
||||||
this.updateGlobalAttribute(Object.keys(core.status.globalAttribute));
|
this.updateGlobalAttribute(Object.keys(core.status.globalAttribute));
|
||||||
this.triggerStatusBar(core.getFlag('hideStatusBar', false)?'hide':'show', core.getFlag("showToolbox"));
|
this.triggerStatusBar(core.getFlag('hideStatusBar', false)?'hide':'show', core.getFlag("showToolbox"));
|
||||||
core.status.played = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 重新开始游戏;此函数将回到标题页面 //////
|
////// 重新开始游戏;此函数将回到标题页面 //////
|
||||||
control.prototype.restart = function(noAnimate) {
|
control.prototype.restart = function(noAnimate) {
|
||||||
this.showStartAnimate(noAnimate);
|
this.showStartAnimate(noAnimate);
|
||||||
if (core.bgms.length>0)
|
core.playBgm(main.startBgm);
|
||||||
core.playBgm(core.bgms[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1124,6 +1153,11 @@ control.prototype.nextY = function (n) {
|
|||||||
return core.getHeroLoc('y')+core.utils.scan[core.getHeroLoc('direction')].y*(n||1);
|
return core.getHeroLoc('y')+core.utils.scan[core.getHeroLoc('direction')].y*(n||1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 某个点是否在勇士旁边 //////
|
||||||
|
control.prototype.nearHero = function (x, y) {
|
||||||
|
return Math.abs(x-core.getHeroLoc('x'))+Math.abs(y-core.getHeroLoc('y'))<=1;
|
||||||
|
}
|
||||||
|
|
||||||
////// 聚集跟随者 //////
|
////// 聚集跟随者 //////
|
||||||
control.prototype.gatherFollowers = function () {
|
control.prototype.gatherFollowers = function () {
|
||||||
if (!core.isset(core.status.hero.followers) || core.status.hero.followers.length==0) return;
|
if (!core.isset(core.status.hero.followers) || core.status.hero.followers.length==0) return;
|
||||||
@ -1422,7 +1456,7 @@ control.prototype.updateDamage = function (floorId, canvas) {
|
|||||||
if (core.flags.displayEnemyDamage) {
|
if (core.flags.displayEnemyDamage) {
|
||||||
var damageString = core.enemys.getDamageString(id, x, y);
|
var damageString = core.enemys.getDamageString(id, x, y);
|
||||||
var damage = damageString.damage, color = damageString.color;
|
var damage = damageString.damage, color = damageString.color;
|
||||||
core.fillBoldText(canvas, damage, color, 32*x+1, 32*(y+1)-1);
|
core.fillBoldText(canvas, damage, 32*x+1, 32*(y+1)-1, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 临界显伤
|
// 临界显伤
|
||||||
@ -1431,7 +1465,7 @@ control.prototype.updateDamage = function (floorId, canvas) {
|
|||||||
if (critical.length>0) critical=critical[0];
|
if (critical.length>0) critical=critical[0];
|
||||||
critical = core.formatBigNumber(critical[0], true);
|
critical = core.formatBigNumber(critical[0], true);
|
||||||
if (critical == '???') critical = '?';
|
if (critical == '???') critical = '?';
|
||||||
core.fillBoldText(canvas, critical, '#FFFFFF', 32*x+1, 32*(y+1)-11);
|
core.fillBoldText(canvas, critical, 32*x+1, 32*(y+1)-11, '#FFFFFF');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1456,7 +1490,7 @@ control.prototype.updateDamage = function (floorId, canvas) {
|
|||||||
var damage = core.status.checkBlock.damage[x+core.bigmap.width*y];
|
var damage = core.status.checkBlock.damage[x+core.bigmap.width*y];
|
||||||
if (damage>0) {
|
if (damage>0) {
|
||||||
damage = core.formatBigNumber(damage, true);
|
damage = core.formatBigNumber(damage, true);
|
||||||
core.fillBoldText(canvas, damage, "#FF7F00", 32*x+16, 32*(y+1)-14);
|
core.fillBoldText(canvas, damage, 32*x+16, 32*(y+1)-14, '#FF7F00');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1554,7 +1588,7 @@ control.prototype.triggerReplay = function () {
|
|||||||
control.prototype.pauseReplay = function () {
|
control.prototype.pauseReplay = function () {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
core.status.replay.pausing = true;
|
core.status.replay.pausing = true;
|
||||||
core.updateStatusBar();
|
core.updateStatusBar();
|
||||||
core.drawTip("暂停播放");
|
core.drawTip("暂停播放");
|
||||||
@ -1564,7 +1598,7 @@ control.prototype.pauseReplay = function () {
|
|||||||
control.prototype.resumeReplay = function () {
|
control.prototype.resumeReplay = function () {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
core.status.replay.pausing = false;
|
core.status.replay.pausing = false;
|
||||||
core.updateStatusBar();
|
core.updateStatusBar();
|
||||||
core.drawTip("恢复播放");
|
core.drawTip("恢复播放");
|
||||||
@ -1575,7 +1609,7 @@ control.prototype.resumeReplay = function () {
|
|||||||
control.prototype.speedUpReplay = function () {
|
control.prototype.speedUpReplay = function () {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
if (core.status.replay.speed==12) core.status.replay.speed=24.0;
|
if (core.status.replay.speed==12) core.status.replay.speed=24.0;
|
||||||
else if (core.status.replay.speed==6) core.status.replay.speed=12.0;
|
else if (core.status.replay.speed==6) core.status.replay.speed=12.0;
|
||||||
else if (core.status.replay.speed==3) core.status.replay.speed=6.0;
|
else if (core.status.replay.speed==3) core.status.replay.speed=6.0;
|
||||||
@ -1590,7 +1624,7 @@ control.prototype.speedUpReplay = function () {
|
|||||||
control.prototype.speedDownReplay = function () {
|
control.prototype.speedDownReplay = function () {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
if (core.status.replay.speed==24) core.status.replay.speed=12.0;
|
if (core.status.replay.speed==24) core.status.replay.speed=12.0;
|
||||||
else if (core.status.replay.speed==12) core.status.replay.speed=6.0;
|
else if (core.status.replay.speed==12) core.status.replay.speed=6.0;
|
||||||
else if (core.status.replay.speed==6) core.status.replay.speed=3.0;
|
else if (core.status.replay.speed==6) core.status.replay.speed=3.0;
|
||||||
@ -1606,7 +1640,7 @@ control.prototype.speedDownReplay = function () {
|
|||||||
control.prototype.setReplaySpeed = function (speed) {
|
control.prototype.setReplaySpeed = function (speed) {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
core.status.replay.speed = speed;
|
core.status.replay.speed = speed;
|
||||||
core.drawTip("x"+core.status.replay.speed+"倍");
|
core.drawTip("x"+core.status.replay.speed+"倍");
|
||||||
}
|
}
|
||||||
@ -1615,7 +1649,7 @@ control.prototype.setReplaySpeed = function (speed) {
|
|||||||
control.prototype.stopReplay = function () {
|
control.prototype.stopReplay = function () {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
core.status.replay.toReplay = [];
|
core.status.replay.toReplay = [];
|
||||||
core.status.replay.totalList = [];
|
core.status.replay.totalList = [];
|
||||||
core.status.replay.replaying=false;
|
core.status.replay.replaying=false;
|
||||||
@ -1631,7 +1665,7 @@ control.prototype.stopReplay = function () {
|
|||||||
control.prototype.rewindReplay = function () {
|
control.prototype.rewindReplay = function () {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
if (!core.status.replay.pausing) {
|
if (!core.status.replay.pausing) {
|
||||||
core.drawTip("请先暂停录像");
|
core.drawTip("请先暂停录像");
|
||||||
return;
|
return;
|
||||||
@ -1667,7 +1701,7 @@ control.prototype.rewindReplay = function () {
|
|||||||
control.prototype.saveReplay = function () {
|
control.prototype.saveReplay = function () {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
if (!core.status.replay.pausing) {
|
if (!core.status.replay.pausing) {
|
||||||
core.drawTip("请先暂停录像");
|
core.drawTip("请先暂停录像");
|
||||||
return;
|
return;
|
||||||
@ -1679,7 +1713,7 @@ control.prototype.saveReplay = function () {
|
|||||||
|
|
||||||
core.lockControl();
|
core.lockControl();
|
||||||
core.status.event.id='save';
|
core.status.event.id='save';
|
||||||
var saveIndex = core.status.saveIndex;
|
var saveIndex = core.saves.saveIndex;
|
||||||
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
||||||
|
|
||||||
core.ui.drawSLPanel(10*page+offset);
|
core.ui.drawSLPanel(10*page+offset);
|
||||||
@ -1689,7 +1723,7 @@ control.prototype.saveReplay = function () {
|
|||||||
control.prototype.bookReplay = function () {
|
control.prototype.bookReplay = function () {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0) return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0) return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
if (!core.status.replay.pausing) {
|
if (!core.status.replay.pausing) {
|
||||||
core.drawTip("请先暂停录像");
|
core.drawTip("请先暂停录像");
|
||||||
return;
|
return;
|
||||||
@ -1716,7 +1750,7 @@ control.prototype.viewMapReplay = function () {
|
|||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
if (core.status.event.id=='save' || (core.status.event.id||"").indexOf('book')==0 || core.status.event.id=='viewMaps') return;
|
||||||
|
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.isReplaying()) return;
|
||||||
if (!core.status.replay.pausing) {
|
if (!core.status.replay.pausing) {
|
||||||
core.drawTip("请先暂停录像");
|
core.drawTip("请先暂停录像");
|
||||||
return;
|
return;
|
||||||
@ -1735,7 +1769,7 @@ control.prototype.viewMapReplay = function () {
|
|||||||
control.prototype.replay = function () {
|
control.prototype.replay = function () {
|
||||||
if (!core.isPlaying()) return;
|
if (!core.isPlaying()) return;
|
||||||
|
|
||||||
if (!core.status.replay.replaying) return; // 没有回放
|
if (!core.isReplaying()) return; // 没有回放
|
||||||
if (core.status.replay.pausing) return; // 暂停状态
|
if (core.status.replay.pausing) return; // 暂停状态
|
||||||
if (core.status.replay.animate) return; // 正在某段动画中
|
if (core.status.replay.animate) return; // 正在某段动画中
|
||||||
|
|
||||||
@ -1928,6 +1962,10 @@ control.prototype.replay = function () {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
control.prototype.isReplaying = function () {
|
||||||
|
return (core.status.replay||{}).replaying;
|
||||||
|
}
|
||||||
|
|
||||||
////// 判断当前能否进入某个事件 //////
|
////// 判断当前能否进入某个事件 //////
|
||||||
control.prototype.checkStatus = function (name, need, item) {
|
control.prototype.checkStatus = function (name, need, item) {
|
||||||
if (need && core.status.event.id == name) {
|
if (need && core.status.event.id == name) {
|
||||||
@ -1952,19 +1990,23 @@ control.prototype.checkStatus = function (name, need, item) {
|
|||||||
|
|
||||||
////// 点击怪物手册时的打开操作 //////
|
////// 点击怪物手册时的打开操作 //////
|
||||||
control.prototype.openBook = function (need) {
|
control.prototype.openBook = function (need) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
if (core.isReplaying()) return;
|
||||||
|
|
||||||
|
if (core.status.event.id == 'book' && core.events.recoverEvents(core.status.event.interval)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 当前是book,且从“浏览地图”打开
|
// 当前是book,且从“浏览地图”打开
|
||||||
if (core.status.event.id == 'book' && core.isset(core.status.event.selection)) {
|
if (core.status.event.id == 'book' && core.isset(core.status.event.ui)) {
|
||||||
core.status.boxAnimateObjs = [];
|
core.status.boxAnimateObjs = [];
|
||||||
core.ui.drawMaps(core.status.event.selection);
|
core.ui.drawMaps(core.status.event.ui);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从“浏览地图”页面打开
|
// 从“浏览地图”页面打开
|
||||||
if (core.status.event.id=='viewMaps') {
|
if (core.status.event.id=='viewMaps') {
|
||||||
need=false;
|
need=false;
|
||||||
core.status.event.selection = core.status.event.data;
|
core.status.event.ui = core.status.event.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!core.checkStatus('book', need, true))
|
if (!core.checkStatus('book', need, true))
|
||||||
@ -1974,7 +2016,7 @@ control.prototype.openBook = function (need) {
|
|||||||
|
|
||||||
////// 点击楼层传送器时的打开操作 //////
|
////// 点击楼层传送器时的打开操作 //////
|
||||||
control.prototype.useFly = function (need) {
|
control.prototype.useFly = function (need) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
if (core.isReplaying()) return;
|
||||||
if (!core.checkStatus('fly', need, true))
|
if (!core.checkStatus('fly', need, true))
|
||||||
return;
|
return;
|
||||||
if (core.flags.flyNearStair && !core.nearStair()) {
|
if (core.flags.flyNearStair && !core.nearStair()) {
|
||||||
@ -2001,7 +2043,7 @@ control.prototype.flyTo = function (toId, callback) {
|
|||||||
|
|
||||||
////// 点击装备栏时的打开操作 //////
|
////// 点击装备栏时的打开操作 //////
|
||||||
control.prototype.openEquipbox = function (need) {
|
control.prototype.openEquipbox = function (need) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
if (core.isReplaying()) return;
|
||||||
if (!core.checkStatus('equipbox', need))
|
if (!core.checkStatus('equipbox', need))
|
||||||
return;
|
return;
|
||||||
core.ui.drawEquipbox();
|
core.ui.drawEquipbox();
|
||||||
@ -2009,7 +2051,7 @@ control.prototype.openEquipbox = function (need) {
|
|||||||
|
|
||||||
////// 点击工具栏时的打开操作 //////
|
////// 点击工具栏时的打开操作 //////
|
||||||
control.prototype.openToolbox = function (need) {
|
control.prototype.openToolbox = function (need) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
if (core.isReplaying()) return;
|
||||||
if (!core.checkStatus('toolbox', need))
|
if (!core.checkStatus('toolbox', need))
|
||||||
return;
|
return;
|
||||||
core.ui.drawToolbox();
|
core.ui.drawToolbox();
|
||||||
@ -2017,19 +2059,31 @@ control.prototype.openToolbox = function (need) {
|
|||||||
|
|
||||||
////// 点击快捷商店按钮时的打开操作 //////
|
////// 点击快捷商店按钮时的打开操作 //////
|
||||||
control.prototype.openQuickShop = function (need) {
|
control.prototype.openQuickShop = function (need) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
if (core.isReplaying()) return;
|
||||||
if (!core.checkStatus('selectShop', need))
|
if (!core.checkStatus('selectShop', need))
|
||||||
return;
|
return;
|
||||||
core.ui.drawQuickShop();
|
core.ui.drawQuickShop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
control.prototype.openKeyBoard = function (need) {
|
||||||
|
if (core.isReplaying()) return;
|
||||||
|
if (!core.checkStatus('keyBoard', need))
|
||||||
|
return;
|
||||||
|
core.ui.drawKeyBoard();
|
||||||
|
}
|
||||||
|
|
||||||
////// 点击保存按钮时的打开操作 //////
|
////// 点击保存按钮时的打开操作 //////
|
||||||
control.prototype.save = function(need) {
|
control.prototype.save = function(need) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
if (core.isReplaying()) return;
|
||||||
|
|
||||||
|
if (core.status.event.id == 'save' && core.events.recoverEvents(core.status.event.interval)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!core.checkStatus('save', need))
|
if (!core.checkStatus('save', need))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var saveIndex = core.status.saveIndex;
|
var saveIndex = core.saves.saveIndex;
|
||||||
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
||||||
|
|
||||||
core.ui.drawSLPanel(10*page+offset);
|
core.ui.drawSLPanel(10*page+offset);
|
||||||
@ -2037,9 +2091,9 @@ control.prototype.save = function(need) {
|
|||||||
|
|
||||||
////// 点击读取按钮时的打开操作 //////
|
////// 点击读取按钮时的打开操作 //////
|
||||||
control.prototype.load = function (need) {
|
control.prototype.load = function (need) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
if (core.isReplaying()) return;
|
||||||
|
|
||||||
var saveIndex = core.getLocalStorage('saveIndex', 1);
|
var saveIndex = core.saves.saveIndex;
|
||||||
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
||||||
|
|
||||||
// 游戏开始前读档
|
// 游戏开始前读档
|
||||||
@ -2054,6 +2108,10 @@ control.prototype.load = function (need) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (core.status.event.id == 'load' && core.events.recoverEvents(core.status.event.interval)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!core.checkStatus('load', need))
|
if (!core.checkStatus('load', need))
|
||||||
return;
|
return;
|
||||||
core.ui.drawSLPanel(10*page+offset);
|
core.ui.drawSLPanel(10*page+offset);
|
||||||
@ -2061,7 +2119,7 @@ control.prototype.load = function (need) {
|
|||||||
|
|
||||||
////// 点击设置按钮时的操作 //////
|
////// 点击设置按钮时的操作 //////
|
||||||
control.prototype.openSettings = function (need) {
|
control.prototype.openSettings = function (need) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
if (core.isReplaying()) return;
|
||||||
if (!core.checkStatus('settings', need))
|
if (!core.checkStatus('settings', need))
|
||||||
return;
|
return;
|
||||||
core.ui.drawSettings();
|
core.ui.drawSettings();
|
||||||
@ -2069,23 +2127,27 @@ control.prototype.openSettings = function (need) {
|
|||||||
|
|
||||||
////// 自动存档 //////
|
////// 自动存档 //////
|
||||||
control.prototype.autosave = function (removeLast) {
|
control.prototype.autosave = function (removeLast) {
|
||||||
var addLast = true;
|
if (core.status.event.id!=null) return;
|
||||||
if (core.status.event.id!=null) {
|
|
||||||
// 检查是否是强制自动存档
|
|
||||||
if (core.status.event.id=='action' && core.hasFlag("forceSave")) addLast = false;
|
|
||||||
else return;
|
|
||||||
}
|
|
||||||
var x=null;
|
var x=null;
|
||||||
if (removeLast)
|
if (removeLast)
|
||||||
x=core.status.route.pop();
|
x=core.status.route.pop();
|
||||||
if (addLast)
|
core.status.route.push("turn:"+core.getHeroLoc('direction'));
|
||||||
core.status.route.push("turn:"+core.getHeroLoc('direction'));
|
// core.setLocalForage("autoSave", core.saveData());
|
||||||
core.setLocalForage("autoSave", core.saveData());
|
// ----- Add to autosaveData
|
||||||
if (addLast)
|
core.saves.autosave.data = core.saveData();
|
||||||
core.status.route.pop();
|
core.saves.autosave.updated = true;
|
||||||
|
core.saves.ids[0] = true;
|
||||||
|
// ----- Updated every 5s
|
||||||
|
core.status.route.pop();
|
||||||
if (removeLast && core.isset(x))
|
if (removeLast && core.isset(x))
|
||||||
core.status.route.push(x);
|
core.status.route.push(x);
|
||||||
core.removeFlag("forceSave");
|
}
|
||||||
|
|
||||||
|
/////// 实际进行自动存档 //////
|
||||||
|
control.prototype.checkAutosave = function () {
|
||||||
|
if (core.saves.autosave.data == null || !core.saves.autosave.updated) return;
|
||||||
|
core.saves.autosave.updated = false;
|
||||||
|
core.setLocalForage("autoSave", core.saves.autosave.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 实际进行存读档事件 //////
|
////// 实际进行存读档事件 //////
|
||||||
@ -2095,13 +2157,21 @@ control.prototype.doSL = function (id, type) {
|
|||||||
core.drawTip('不能覆盖自动存档!');
|
core.drawTip('不能覆盖自动存档!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 事件中的存档
|
||||||
|
if (core.status.event.interval != null) {
|
||||||
|
core.setFlag("__events__", core.status.event.interval);
|
||||||
|
}
|
||||||
core.setLocalForage("save"+id, core.saveData(), function() {
|
core.setLocalForage("save"+id, core.saveData(), function() {
|
||||||
|
if (id!="autoSave") {
|
||||||
|
core.saves.saveIndex=id;
|
||||||
|
core.setLocalStorage('saveIndex', core.saves.saveIndex);
|
||||||
|
}
|
||||||
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
|
core.drawTip("存档成功!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.drawTip('存档成功!');
|
core.drawTip('存档成功!');
|
||||||
if (id!="autoSave") {
|
|
||||||
core.status.saveIndex=id;
|
|
||||||
core.setLocalStorage('saveIndex', core.status.saveIndex);
|
|
||||||
}
|
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
console.info(err);
|
console.info(err);
|
||||||
if (core.platform.useLocalForage) {
|
if (core.platform.useLocalForage) {
|
||||||
@ -2110,13 +2180,12 @@ control.prototype.doSL = function (id, type) {
|
|||||||
else {
|
else {
|
||||||
alert("存档失败,错误信息:\n"+err+"\n建议使用垃圾存档清理工具进行清理!");
|
alert("存档失败,错误信息:\n"+err+"\n建议使用垃圾存档清理工具进行清理!");
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
core.removeFlag("__events__");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (type=='load') {
|
else if (type=='load') {
|
||||||
// var data = core.getLocalStorage(id=='autoSave'?id:"save"+id, null);
|
var afterGet = function (data) {
|
||||||
|
|
||||||
core.getLocalForage(id=='autoSave'?id:"save"+id, null, function(data) {
|
|
||||||
if (!core.isset(data)) {
|
if (!core.isset(data)) {
|
||||||
alert("无效的存档");
|
alert("无效的存档");
|
||||||
return;
|
return;
|
||||||
@ -2138,20 +2207,27 @@ control.prototype.doSL = function (id, type) {
|
|||||||
core.loadData(data, function() {
|
core.loadData(data, function() {
|
||||||
core.drawTip("读档成功");
|
core.drawTip("读档成功");
|
||||||
if (id!="autoSave") {
|
if (id!="autoSave") {
|
||||||
core.status.saveIndex=id;
|
core.saves.saveIndex=id;
|
||||||
core.setLocalStorage('saveIndex', core.status.saveIndex);
|
core.setLocalStorage('saveIndex', core.saves.saveIndex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, function(err) {
|
}
|
||||||
console.log(err);
|
if (id == 'autoSave' && core.saves.autosave.data != null) {
|
||||||
alert("无效的存档");
|
afterGet(core.saves.autosave.data);
|
||||||
})
|
}
|
||||||
|
else {
|
||||||
|
core.getLocalForage(id=='autoSave'?id:"save"+id, null, function(data) {
|
||||||
|
if (id == 'autoSave') core.saves.autosave.data = core.clone(data);
|
||||||
|
afterGet(data);
|
||||||
|
}, function(err) {
|
||||||
|
console.log(err);
|
||||||
|
alert("无效的存档");
|
||||||
|
})
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (type == 'replayLoad') {
|
else if (type == 'replayLoad') {
|
||||||
// var data = core.getLocalStorage(id=='autoSave'?id:"save"+id, null);
|
var afterGet = function (data) {
|
||||||
core.getLocalForage(id=='autoSave'?id:"save"+id, null, function(data) {
|
|
||||||
if (!core.isset(data)) {
|
if (!core.isset(data)) {
|
||||||
core.drawTip("无效的存档");
|
core.drawTip("无效的存档");
|
||||||
return;
|
return;
|
||||||
@ -2177,17 +2253,26 @@ control.prototype.doSL = function (id, type) {
|
|||||||
core.startReplay(route);
|
core.startReplay(route);
|
||||||
core.drawTip("回退到存档节点");
|
core.drawTip("回退到存档节点");
|
||||||
});
|
});
|
||||||
}, function(err) {
|
}
|
||||||
console.log(err);
|
if (id == 'autoSave' && core.saves.autosave.data != null) {
|
||||||
core.drawTip("无效的存档");
|
afterGet(core.saves.autosave.data);
|
||||||
})
|
}
|
||||||
|
else {
|
||||||
|
core.getLocalForage(id=='autoSave'?id:"save"+id, null, function(data) {
|
||||||
|
if (id == 'autoSave') core.saves.autosave.data = core.clone(data);
|
||||||
|
afterGet(data);
|
||||||
|
}, function(err) {
|
||||||
|
console.log(err);
|
||||||
|
alert("无效的存档");
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 同步存档到服务器 //////
|
////// 同步存档到服务器 //////
|
||||||
control.prototype.syncSave = function (type) {
|
control.prototype.syncSave = function (type) {
|
||||||
core.ui.drawWaiting("正在同步,请稍后...");
|
core.ui.drawWaiting("正在同步,请稍后...");
|
||||||
core.control.getSaves(type=='all'?null:core.status.saveIndex, function (saves) {
|
core.control.getSaves(type=='all'?null:core.saves.saveIndex, function (saves) {
|
||||||
if (!core.isset(saves)) {
|
if (!core.isset(saves)) {
|
||||||
core.drawText("没有要同步的存档");
|
core.drawText("没有要同步的存档");
|
||||||
return;
|
return;
|
||||||
@ -2205,7 +2290,7 @@ control.prototype.syncSave = function (type) {
|
|||||||
core.drawText("出错啦!\n无法同步存档到服务器。\n错误原因:"+response.msg);
|
core.drawText("出错啦!\n无法同步存档到服务器。\n错误原因:"+response.msg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.drawText((type=='all'?"所有存档":"存档"+core.status.saveIndex)+"同步成功!\n\n您的存档编号: "
|
core.drawText((type=='all'?"所有存档":"存档"+core.saves.saveIndex)+"同步成功!\n\n您的存档编号: "
|
||||||
+response.code+"\n您的存档密码: "+response.msg
|
+response.code+"\n您的存档密码: "+response.msg
|
||||||
+"\n\n请牢记以上两个信息(如截图等),在从服务器\n同步存档时使用。")
|
+"\n\n请牢记以上两个信息(如截图等),在从服务器\n同步存档时使用。")
|
||||||
}
|
}
|
||||||
@ -2241,8 +2326,6 @@ control.prototype.syncLoad = function () {
|
|||||||
case 0:
|
case 0:
|
||||||
// 成功
|
// 成功
|
||||||
var data=JSON.parse(response.msg);
|
var data=JSON.parse(response.msg);
|
||||||
// console.log(data);
|
|
||||||
|
|
||||||
if (data instanceof Array) {
|
if (data instanceof Array) {
|
||||||
core.status.event.selection=1;
|
core.status.event.selection=1;
|
||||||
core.ui.drawConfirmBox("所有本地存档都将被覆盖,确认?", function () {
|
core.ui.drawConfirmBox("所有本地存档都将被覆盖,确认?", function () {
|
||||||
@ -2252,8 +2335,8 @@ control.prototype.syncLoad = function () {
|
|||||||
core.setLocalForage("save"+i, data[i-1]);
|
core.setLocalForage("save"+i, data[i-1]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// core.removeLocalStorage("save"+i);
|
if (core.saves.ids[i])
|
||||||
core.removeLocalForage("save"+i);
|
core.removeLocalForage("save"+i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.drawText("同步成功!\n你的本地所有存档均已被覆盖。");
|
core.drawText("同步成功!\n你的本地所有存档均已被覆盖。");
|
||||||
@ -2264,9 +2347,8 @@ control.prototype.syncLoad = function () {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// 只覆盖单存档
|
// 只覆盖单存档
|
||||||
// core.setLocalStorage("save"+core.status.saveIndex, data);
|
core.setLocalForage("save"+core.saves.saveIndex, data, function() {
|
||||||
core.setLocalForage("save"+core.status.saveIndex, data, function() {
|
core.drawText("同步成功!\n单存档已覆盖至存档"+core.saves.saveIndex);
|
||||||
core.drawText("同步成功!\n单存档已覆盖至存档"+core.status.saveIndex);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2363,14 +2445,17 @@ control.prototype.getSaves = function (index, callback) {
|
|||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var number = 5*(main.savePages||30);
|
|
||||||
|
var ids = Object.keys(core.saves.ids).sort(function(a,b) {return a-b;}), number = ids.length;
|
||||||
|
// 不计0
|
||||||
var saves = [];
|
var saves = [];
|
||||||
|
|
||||||
var load = function (index, callback) {
|
var load = function (index, callback) {
|
||||||
if (index > number) {
|
if (index >= number) {
|
||||||
if (core.isset(callback)) callback(saves);
|
if (core.isset(callback)) callback(saves);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.getLocalForage("save"+index, null, function (data) {
|
core.getLocalForage("save"+ids[index], null, function (data) {
|
||||||
saves.push(data);
|
saves.push(data);
|
||||||
load(index+1, callback);
|
load(index+1, callback);
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
@ -2381,6 +2466,38 @@ control.prototype.getSaves = function (index, callback) {
|
|||||||
load(1, callback);
|
load(1, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 获得所有存在存档的存档位 //////
|
||||||
|
control.prototype.getSaveIndexes = function (callback) {
|
||||||
|
var indexes = {};
|
||||||
|
|
||||||
|
var getIndex = function (name) {
|
||||||
|
var e = new RegExp('^'+core.firstData.name+"_(save\\d+|autoSave)$").exec(name);
|
||||||
|
if (e!=null) {
|
||||||
|
if (e[1]=='autoSave') indexes[0]=true;
|
||||||
|
else indexes[parseInt(e[1].substring(4))] = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!core.platform.useLocalForage) {
|
||||||
|
Object.keys(localStorage).forEach(function (key) {
|
||||||
|
getIndex(key);
|
||||||
|
});
|
||||||
|
callback(indexes);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
localforage.iterate(function (value, key, n) {
|
||||||
|
getIndex(key)
|
||||||
|
}, function () {
|
||||||
|
callback(indexes);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////// 判断某个存档位是否存在存档 //////
|
||||||
|
control.prototype.hasSave = function (index) {
|
||||||
|
return core.saves.ids[index]||false;
|
||||||
|
}
|
||||||
|
|
||||||
////// 设置勇士属性 //////
|
////// 设置勇士属性 //////
|
||||||
control.prototype.setStatus = function (statusName, statusVal) {
|
control.prototype.setStatus = function (statusName, statusVal) {
|
||||||
if (statusName == 'exp') statusName = 'experience';
|
if (statusName == 'exp') statusName = 'experience';
|
||||||
@ -2444,26 +2561,38 @@ control.prototype.unLockControl = function () {
|
|||||||
////// 播放背景音乐 //////
|
////// 播放背景音乐 //////
|
||||||
control.prototype.playBgm = function (bgm) {
|
control.prototype.playBgm = function (bgm) {
|
||||||
if (main.mode!='play')return;
|
if (main.mode!='play')return;
|
||||||
// 如果不允许播放
|
|
||||||
if (!core.musicStatus.bgmStatus) return;
|
|
||||||
// 音频不存在
|
// 音频不存在
|
||||||
if (!core.isset(core.material.bgms[bgm])) return;
|
if (!core.isset(core.material.bgms[bgm])) return;
|
||||||
|
// 如果不允许播放
|
||||||
|
if (!core.musicStatus.bgmStatus) {
|
||||||
|
try {
|
||||||
|
core.musicStatus.playingBgm = bgm;
|
||||||
|
core.material.bgms[bgm].pause();
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setMusicBtn();
|
||||||
|
|
||||||
|
/*
|
||||||
// 延迟播放
|
// 延迟播放
|
||||||
if (core.material.bgms[bgm] == 'loading') {
|
if (core.material.bgms[bgm] == 'loading') {
|
||||||
core.material.bgms[bgm] = 'starting';
|
core.material.bgms[bgm] = 'starting';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 缓存BGM
|
// 缓存BGM
|
||||||
core.loader.loadBgm(bgm);
|
core.loader.loadBgm(bgm);
|
||||||
// 如果当前正在播放,且和本BGM相同,直接忽略
|
// 如果当前正在播放,且和本BGM相同,直接忽略
|
||||||
if (core.musicStatus.playingBgm == bgm && core.musicStatus.isPlaying) {
|
if (core.musicStatus.playingBgm == bgm && !core.material.bgms[core.musicStatus.playingBgm].paused) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 如果正在播放中,暂停
|
// 如果正在播放中,暂停
|
||||||
if (core.isset(core.musicStatus.playingBgm) && core.musicStatus.isPlaying) {
|
if (core.isset(core.musicStatus.playingBgm)) {
|
||||||
core.material.bgms[core.musicStatus.playingBgm].pause();
|
core.material.bgms[core.musicStatus.playingBgm].pause();
|
||||||
}
|
}
|
||||||
// 播放当前BGM
|
// 播放当前BGM
|
||||||
@ -2471,7 +2600,6 @@ control.prototype.playBgm = function (bgm) {
|
|||||||
core.material.bgms[bgm].currentTime = 0;
|
core.material.bgms[bgm].currentTime = 0;
|
||||||
core.material.bgms[bgm].play();
|
core.material.bgms[bgm].play();
|
||||||
core.musicStatus.playingBgm = bgm;
|
core.musicStatus.playingBgm = bgm;
|
||||||
core.musicStatus.isPlaying = true;
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log("无法播放BGM "+bgm);
|
console.log("无法播放BGM "+bgm);
|
||||||
@ -2487,40 +2615,48 @@ control.prototype.pauseBgm = function () {
|
|||||||
if (core.isset(core.musicStatus.playingBgm)) {
|
if (core.isset(core.musicStatus.playingBgm)) {
|
||||||
core.material.bgms[core.musicStatus.playingBgm].pause();
|
core.material.bgms[core.musicStatus.playingBgm].pause();
|
||||||
}
|
}
|
||||||
core.musicStatus.isPlaying = false;
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log("无法暂停BGM");
|
console.log("无法暂停BGM");
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
this.setMusicBtn();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 恢复背景音乐的播放 //////
|
////// 恢复背景音乐的播放 //////
|
||||||
control.prototype.resumeBgm = function () {
|
control.prototype.resumeBgm = function () {
|
||||||
if (main.mode!='play')return;
|
if (main.mode!='play')return;
|
||||||
// 如果不允许播放
|
|
||||||
if (!core.musicStatus.bgmStatus) return;
|
|
||||||
|
|
||||||
// 恢复BGM
|
// 恢复BGM
|
||||||
try {
|
try {
|
||||||
if (core.isset(core.musicStatus.playingBgm)) {
|
core.playBgm(core.musicStatus.playingBgm);
|
||||||
core.material.bgms[core.musicStatus.playingBgm].play();
|
|
||||||
core.musicStatus.isPlaying = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (core.bgms.length>0) {
|
|
||||||
if (core.isset(core.status.thisMap.bgm)) {
|
|
||||||
core.playBgm(core.status.thisMap.bgm);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
core.playBgm(core.bgms[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log("无法恢复BGM");
|
console.log("无法恢复BGM");
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
this.setMusicBtn();
|
||||||
|
}
|
||||||
|
|
||||||
|
control.prototype.setMusicBtn = function () {
|
||||||
|
if (core.musicStatus.bgmStatus)
|
||||||
|
core.dom.musicBtn.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAABWVBMVEX///9iYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmL///8AAAC5ubn+/v6xsbEtLS0MDAxmZmZoaGhvb2/c3Nzd3d38/Pz9/f0oKCgpKSl0dHR1dXW6urrb29v7+/v09PTv7+/39/cgICACAgImJibh4eGFhYWGhoaHh4eOjo5paWm7u7vDw8PMzMwyMjI7OztAQEDe3t5FRUVMTEzj4+Pl5eXm5ubp6enr6+tcXFzi4uL19fVeXl74+PgjIyNkZGQGBgaSkpKYmJiampqenp4DAwMwMDBnZ2cICAivr68eHh63t7cLCwsSEhLw8PBhYWEUFBQVFRXNzc3Pz8/Z2dna2toaGhqkpKSlpaWpqamrq6tFOUNAAAAAc3RSTlMAAwQFBhUWGxwkJSYyO0dISVBRUmpvj5CSk5SVoaOlpqiysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKyA0IuUgAAAVdJREFUeF5NkVVbw0AQRTcQrLR4IIEGcidJoaUuQHF3d3d3+P/CkuxCzss8nG++mbnDBJXhNt2CpbeFK1kQpSEKidlc8S9qdATRa6UIdQMoxEpDA0Ov3wUAPfW+qLWACydNv9zMrzkJwPK6FB3oHyOfXfuNxvoBQ+GmBYinhHB77TmiVBxoYUw1AYcEq332AS8OYKosAuTT0nza9uU2USYPRJgGxEiSOFywJ3mNARozgBJJzkfLvfu8JgGDWcC9FEsjWzR+y80gYDEAA8QZ3N6kmP1Fs3fEASB7pob7Hh+Wz5L0ci17Or05J7bH6B6dZv05XWK3rG+myV05Ert592Qo55sPuoIr7hEZHHtieIPWy0RU9DLwc3Mnck/vi8/E8XNrDWQtEVnL/ySKMrv0jPwPp870fprcyYifmiEmqGpHkI5q9ofSFIUk2qiwIGpEMyxYhhZRRcMPz89RJ2s9W8wAAAAASUVORK5CYII=";
|
||||||
|
else
|
||||||
|
core.dom.musicBtn.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAABYlBMVEX///9iYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmL////8/PwAAABmZmZoaGihoaGioqKxsbG5ubnb29vc3Nzd3d3h4eHi4uL9/f3+/v4tLS1nZ2d0dHSUlJSenp66uroMDAz7+/spKSkoKCgUFBRpaWkVFRVvb291dXU7OzuVlZWYmJhkZGQgICAjIyOkpKQCAgK3t7cGBgbv7++pqamrq6seHh4mJiZhYWGamprp6enr6+saGhpeXl7j4+Pl5eXm5uZKSkrw8PD09PT19fW7u7vDw8PMzMwICAgwMDAyMjILCwtAQECGhoaHh4eBgYGFhYUSEhJXV1dZWVlcXFyOjo6SkpLNzc339/fPz8/Z2dna2tqTk5OlpaWxOPeTAAAAdnRSTlMAAwQFBhUWGxwkJSYyO0dISVBRUmpvj5CSk5SVoaOlpqiysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKyNuo+uwAAAWJJREFUeF5NkmV34zAQReUm7WbTuJBNunY3bvXGDjNTkZkZlpn5/9eR5FPfbzr3jGb0RkwRiMQMDm7EIgHmRxtLwMOaHHoQjwz4MUKeCM8AWMrmd7u7f/aXAMyOShHiQD1n04DtN5e5FMBFlSauIsm585dKi4CpuSYKJIv1tBDVmvOSqJgEoowFLSBHaQh10XHWiCgHWEGmAw2blPrvOK/KRJUGoLM4kCVSKrWz7HwgoiwQZyaQJ0+9PvxV23BNATAZB25IqX9b3+jTW9fcApwB6NLgUD5NY3mPXnwmFwBezff1ztzRFzTp94FXMy36HDuCa2RafdnnmZqtL818Gl9/qNnEeyrUk2aTPiKj3qMyWBVi/YSuWq5qiwxkbtX3vYWzdz/l8M0k8ERlvViiB1Ygslb7SbVtJezncj+Cx5bYaeGuonZqhZlieAp+no74/s5EAh6JcY35Cepxk4ObcT3IJPe/1lKsDpFCFQAAAABJRU5ErkJggg==";
|
||||||
|
}
|
||||||
|
|
||||||
|
////// 更改背景音乐的播放 //////
|
||||||
|
control.prototype.triggerBgm = function () {
|
||||||
|
if (main.mode!='play')return;
|
||||||
|
|
||||||
|
core.musicStatus.bgmStatus = !core.musicStatus.bgmStatus;
|
||||||
|
if (core.musicStatus.bgmStatus)
|
||||||
|
this.resumeBgm();
|
||||||
|
else {
|
||||||
|
this.pauseBgm();
|
||||||
|
}
|
||||||
|
core.setLocalStorage('bgmStatus', core.musicStatus.bgmStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 播放音频 //////
|
////// 播放音频 //////
|
||||||
@ -2544,6 +2680,7 @@ control.prototype.playSound = function (sound) {
|
|||||||
source.noteOn(0);
|
source.noteOn(0);
|
||||||
}
|
}
|
||||||
catch (ee) {
|
catch (ee) {
|
||||||
|
console.log(ee);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2559,18 +2696,11 @@ control.prototype.playSound = function (sound) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
control.prototype.checkBgm = function() {
|
control.prototype.checkBgm = function() {
|
||||||
if (core.musicStatus.startDirectly && core.musicStatus.bgmStatus) {
|
core.playBgm(core.musicStatus.playingBgm || main.startBgm);
|
||||||
if (core.musicStatus.playingBgm==null
|
|
||||||
|| core.material.bgms[core.musicStatus.playingBgm].paused) {
|
|
||||||
core.musicStatus.playingBgm=null;
|
|
||||||
core.playBgm(core.bgms[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 清空状态栏 //////
|
////// 清空状态栏 //////
|
||||||
control.prototype.clearStatusBar = function() {
|
control.prototype.clearStatusBar = function() {
|
||||||
|
|
||||||
Object.keys(core.statusBar).forEach(function (e) {
|
Object.keys(core.statusBar).forEach(function (e) {
|
||||||
if (core.isset(core.statusBar[e].innerHTML))
|
if (core.isset(core.statusBar[e].innerHTML))
|
||||||
core.statusBar[e].innerHTML = " ";
|
core.statusBar[e].innerHTML = " ";
|
||||||
@ -2587,7 +2717,7 @@ control.prototype.updateStatusBar = function () {
|
|||||||
this.controldata.updateStatusBar();
|
this.controldata.updateStatusBar();
|
||||||
|
|
||||||
// 回放
|
// 回放
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.statusBar.image.book.src = core.status.replay.pausing ? core.statusBar.icons.play.src : core.statusBar.icons.pause.src;
|
core.statusBar.image.book.src = core.status.replay.pausing ? core.statusBar.icons.play.src : core.statusBar.icons.pause.src;
|
||||||
core.statusBar.image.book.style.opacity = 1;
|
core.statusBar.image.book.style.opacity = 1;
|
||||||
|
|
||||||
@ -2596,7 +2726,7 @@ control.prototype.updateStatusBar = function () {
|
|||||||
|
|
||||||
core.statusBar.image.toolbox.src = core.statusBar.icons.rewind.src;
|
core.statusBar.image.toolbox.src = core.statusBar.icons.rewind.src;
|
||||||
|
|
||||||
core.statusBar.image.shop.src = core.statusBar.icons.book.src;
|
core.statusBar.image.keyboard.src = core.statusBar.icons.book.src;
|
||||||
|
|
||||||
core.statusBar.image.save.src = core.statusBar.icons.speedDown.src;
|
core.statusBar.image.save.src = core.statusBar.icons.speedDown.src;
|
||||||
|
|
||||||
@ -2620,7 +2750,7 @@ control.prototype.updateStatusBar = function () {
|
|||||||
|
|
||||||
core.statusBar.image.toolbox.src = core.statusBar.icons.toolbox.src;
|
core.statusBar.image.toolbox.src = core.statusBar.icons.toolbox.src;
|
||||||
|
|
||||||
core.statusBar.image.shop.src = core.statusBar.icons.shop.src;
|
core.statusBar.image.keyboard.src = core.statusBar.icons.keyboard.src;
|
||||||
|
|
||||||
core.statusBar.image.save.src = core.statusBar.icons.save.src;
|
core.statusBar.image.save.src = core.statusBar.icons.save.src;
|
||||||
|
|
||||||
@ -2634,7 +2764,7 @@ control.prototype.triggerStatusBar = function (name, showToolbox) {
|
|||||||
if (name!='hide') name='show';
|
if (name!='hide') name='show';
|
||||||
|
|
||||||
// 如果是隐藏 -> 显示工具栏,则先显示
|
// 如果是隐藏 -> 显示工具栏,则先显示
|
||||||
if (name == 'hide' && showToolbox && !core.domStyle.showStatusBar && !core.hasFlag("showToolbox")) {
|
if (name == 'hide' && !core.domStyle.showStatusBar) {
|
||||||
this.triggerStatusBar("show");
|
this.triggerStatusBar("show");
|
||||||
this.triggerStatusBar("hide", showToolbox);
|
this.triggerStatusBar("hide", showToolbox);
|
||||||
return;
|
return;
|
||||||
@ -2753,10 +2883,11 @@ control.prototype.setToolbarButton = function (useButton) {
|
|||||||
|
|
||||||
if (!core.isset(useButton)) useButton = core.domStyle.toolbarBtn;
|
if (!core.isset(useButton)) useButton = core.domStyle.toolbarBtn;
|
||||||
if (!core.domStyle.isVertical) useButton = false;
|
if (!core.domStyle.isVertical) useButton = false;
|
||||||
|
if (!core.platform.extendKeyboard) useButton = false;
|
||||||
|
|
||||||
core.domStyle.toolbarBtn = useButton;
|
core.domStyle.toolbarBtn = useButton;
|
||||||
if (useButton) {
|
if (useButton) {
|
||||||
["book","fly","toolbox","shop","save","load","settings"].forEach(function (t) {
|
["book","fly","toolbox","keyboard","save","load","settings"].forEach(function (t) {
|
||||||
core.statusBar.image[t].style.display = 'none';
|
core.statusBar.image[t].style.display = 'none';
|
||||||
});
|
});
|
||||||
["btn1","btn2","btn3","btn4","btn5","btn6","btn7"].forEach(function (t) {
|
["btn1","btn2","btn3","btn4","btn5","btn6","btn7"].forEach(function (t) {
|
||||||
@ -2767,10 +2898,10 @@ control.prototype.setToolbarButton = function (useButton) {
|
|||||||
["btn1","btn2","btn3","btn4","btn5","btn6","btn7"].forEach(function (t) {
|
["btn1","btn2","btn3","btn4","btn5","btn6","btn7"].forEach(function (t) {
|
||||||
core.statusBar.image[t].style.display = 'none';
|
core.statusBar.image[t].style.display = 'none';
|
||||||
});
|
});
|
||||||
["book","fly","toolbox","shop","save","load","settings"].forEach(function (t) {
|
["book","fly","toolbox","keyboard","save","load","settings"].forEach(function (t) {
|
||||||
core.statusBar.image[t].style.display = 'block';
|
core.statusBar.image[t].style.display = 'block';
|
||||||
});
|
});
|
||||||
core.statusBar.image.shop.style.display = core.domStyle.isVertical ? "block":"none";
|
core.statusBar.image.keyboard.style.display = core.domStyle.isVertical ? "block":"none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2808,6 +2939,9 @@ control.prototype.needDraw = function(id) {
|
|||||||
control.prototype.resize = function(clientWidth, clientHeight) {
|
control.prototype.resize = function(clientWidth, clientHeight) {
|
||||||
if (main.mode=='editor')return;
|
if (main.mode=='editor')return;
|
||||||
|
|
||||||
|
clientWidth = clientWidth || main.dom.body.clientWidth;
|
||||||
|
clientHeight = clientHeight || main.dom.body.clientHeight;
|
||||||
|
|
||||||
// 默认画布大小
|
// 默认画布大小
|
||||||
var DEFAULT_CANVAS_WIDTH = 422;
|
var DEFAULT_CANVAS_WIDTH = 422;
|
||||||
// 默认边栏宽度
|
// 默认边栏宽度
|
||||||
@ -2834,7 +2968,7 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
toolBarWidth, toolBarHeight, toolBarTop, toolBarBorder,
|
toolBarWidth, toolBarHeight, toolBarTop, toolBarBorder,
|
||||||
toolsWidth, toolsHeight,toolsMargin,toolsPMaxwidth,
|
toolsWidth, toolsHeight,toolsMargin,toolsPMaxwidth,
|
||||||
fontSize, toolbarFontSize, margin, statusBackground, toolsBackground,
|
fontSize, toolbarFontSize, margin, statusBackground, toolsBackground,
|
||||||
statusCanvasWidth, statusCanvasHeight;
|
statusCanvasWidth, statusCanvasHeight, musicBtnBottom, musicBtnRight;
|
||||||
|
|
||||||
var toDraw = this.needDraw();
|
var toDraw = this.needDraw();
|
||||||
var count = toDraw.length;
|
var count = toDraw.length;
|
||||||
@ -2848,8 +2982,6 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
var statusLineFontSize = DEFAULT_FONT_SIZE;
|
var statusLineFontSize = DEFAULT_FONT_SIZE;
|
||||||
if (count>9) statusLineFontSize = statusLineFontSize * 9 / count;
|
if (count>9) statusLineFontSize = statusLineFontSize * 9 / count;
|
||||||
|
|
||||||
var shopDisplay;
|
|
||||||
|
|
||||||
var borderColor = (core.status.globalAttribute||core.initStatus.globalAttribute).borderColor;
|
var borderColor = (core.status.globalAttribute||core.initStatus.globalAttribute).borderColor;
|
||||||
|
|
||||||
statusBarBorder = '3px '+borderColor+' solid';
|
statusBarBorder = '3px '+borderColor+' solid';
|
||||||
@ -2875,8 +3007,6 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
if(!isHorizontal){ //竖屏
|
if(!isHorizontal){ //竖屏
|
||||||
core.domStyle.screenMode = 'vertical';
|
core.domStyle.screenMode = 'vertical';
|
||||||
core.domStyle.isVertical = true;
|
core.domStyle.isVertical = true;
|
||||||
//显示快捷商店图标
|
|
||||||
shopDisplay = 'block';
|
|
||||||
|
|
||||||
var tempTopBarH = scale * (BASE_LINEHEIGHT * col + SPACE * 2) + 6;
|
var tempTopBarH = scale * (BASE_LINEHEIGHT * col + SPACE * 2) + 6;
|
||||||
var tempBotBarH = scale * (BASE_LINEHEIGHT + SPACE * 4) + 6;
|
var tempBotBarH = scale * (BASE_LINEHEIGHT + SPACE * 4) + 6;
|
||||||
@ -2909,10 +3039,11 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
toolsMargin = scale * SPACE * 4;
|
toolsMargin = scale * SPACE * 4;
|
||||||
fontSize = DEFAULT_FONT_SIZE * scale;
|
fontSize = DEFAULT_FONT_SIZE * scale;
|
||||||
toolbarFontSize = DEFAULT_FONT_SIZE * scale;
|
toolbarFontSize = DEFAULT_FONT_SIZE * scale;
|
||||||
|
musicBtnRight = 3;
|
||||||
|
musicBtnBottom = 3;
|
||||||
}else { //横屏
|
}else { //横屏
|
||||||
core.domStyle.screenMode = 'horizontal';
|
core.domStyle.screenMode = 'horizontal';
|
||||||
core.domStyle.isVertical = false;
|
core.domStyle.isVertical = false;
|
||||||
shopDisplay = 'none';
|
|
||||||
gameGroupWidth = tempWidth + DEFAULT_BAR_WIDTH * scale;
|
gameGroupWidth = tempWidth + DEFAULT_BAR_WIDTH * scale;
|
||||||
gameGroupHeight = tempWidth;
|
gameGroupHeight = tempWidth;
|
||||||
canvasTop = 0;
|
canvasTop = 0;
|
||||||
@ -2939,13 +3070,14 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
|
|
||||||
margin = scale * SPACE * 2;
|
margin = scale * SPACE * 2;
|
||||||
toolsMargin = 2 * SPACE * scale;
|
toolsMargin = 2 * SPACE * scale;
|
||||||
|
musicBtnRight = 3;
|
||||||
|
musicBtnBottom = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else { //大屏设备 pc端
|
}else { //大屏设备 pc端
|
||||||
core.domStyle.scale = 1;
|
core.domStyle.scale = 1;
|
||||||
core.domStyle.screenMode = 'bigScreen';
|
core.domStyle.screenMode = 'bigScreen';
|
||||||
core.domStyle.isVertical = false;
|
core.domStyle.isVertical = false;
|
||||||
shopDisplay = 'none';
|
|
||||||
|
|
||||||
gameGroupWidth = DEFAULT_CANVAS_WIDTH + DEFAULT_BAR_WIDTH;
|
gameGroupWidth = DEFAULT_CANVAS_WIDTH + DEFAULT_BAR_WIDTH;
|
||||||
gameGroupHeight = DEFAULT_CANVAS_WIDTH;
|
gameGroupHeight = DEFAULT_CANVAS_WIDTH;
|
||||||
@ -2974,6 +3106,9 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
toolsPMaxwidth = DEFAULT_BAR_WIDTH * .9;
|
toolsPMaxwidth = DEFAULT_BAR_WIDTH * .9;
|
||||||
margin = SPACE * 2;
|
margin = SPACE * 2;
|
||||||
toolsMargin = 2 * SPACE;
|
toolsMargin = 2 * SPACE;
|
||||||
|
|
||||||
|
musicBtnRight = (clientWidth-gameGroupWidth)/2;
|
||||||
|
musicBtnBottom = (clientHeight-gameGroupHeight)/2 - 27;
|
||||||
}
|
}
|
||||||
|
|
||||||
var unit = 'px'
|
var unit = 'px'
|
||||||
@ -3101,9 +3236,9 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imgId: 'shop',
|
imgId: 'keyboard',
|
||||||
rules:{
|
rules:{
|
||||||
display: shopDisplay && core.domStyle.showStatusBar
|
display: core.domStyle.isVertical && core.domStyle.showStatusBar
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -3113,6 +3248,14 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
color: (core.status.globalAttribute||core.initStatus.globalAttribute).hardLabelColor
|
color: (core.status.globalAttribute||core.initStatus.globalAttribute).hardLabelColor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'musicBtn',
|
||||||
|
rules: {
|
||||||
|
display: 'block',
|
||||||
|
right: musicBtnRight + unit,
|
||||||
|
bottom: musicBtnBottom + unit
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
for (var i = 0; i < core.dom.status.length; ++i) {
|
for (var i = 0; i < core.dom.status.length; ++i) {
|
||||||
var id = core.dom.status[i].id;
|
var id = core.dom.status[i].id;
|
||||||
@ -3135,6 +3278,7 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
core.dom.statusCanvas.width = 129;
|
core.dom.statusCanvas.width = 129;
|
||||||
core.dom.statusCanvas.height = 416;
|
core.dom.statusCanvas.height = 416;
|
||||||
}
|
}
|
||||||
|
this.setMusicBtn();
|
||||||
if (core.isPlaying())
|
if (core.isPlaying())
|
||||||
core.updateStatusBar();
|
core.updateStatusBar();
|
||||||
}
|
}
|
||||||
|
|||||||
87
libs/core.js
87
libs/core.js
@ -20,6 +20,7 @@ function core() {
|
|||||||
'getItemTipTimeout': null,
|
'getItemTipTimeout': null,
|
||||||
'turnHeroTimeout': null,
|
'turnHeroTimeout': null,
|
||||||
'onDownTimeout': null,
|
'onDownTimeout': null,
|
||||||
|
'sleepTimeout': null,
|
||||||
}
|
}
|
||||||
this.interval = {
|
this.interval = {
|
||||||
'heroMoveInterval': null,
|
'heroMoveInterval': null,
|
||||||
@ -49,11 +50,9 @@ function core() {
|
|||||||
}
|
}
|
||||||
this.musicStatus = {
|
this.musicStatus = {
|
||||||
'audioContext': null, // WebAudioContext
|
'audioContext': null, // WebAudioContext
|
||||||
'startDirectly': false, // 是否直接播放(加载)音乐
|
|
||||||
'bgmStatus': false, // 是否播放BGM
|
'bgmStatus': false, // 是否播放BGM
|
||||||
'soundStatus': true, // 是否播放SE
|
'soundStatus': true, // 是否播放SE
|
||||||
'playingBgm': null, // 正在播放的BGM
|
'playingBgm': null, // 正在播放的BGM
|
||||||
'isPlaying': false,
|
|
||||||
'gainNode': null,
|
'gainNode': null,
|
||||||
'volume': 1.0, // 音量
|
'volume': 1.0, // 音量
|
||||||
'cachedBgms': [], // 缓存BGM内容
|
'cachedBgms': [], // 缓存BGM内容
|
||||||
@ -69,6 +68,7 @@ function core() {
|
|||||||
'isChrome': false, // 是否是Chrome
|
'isChrome': false, // 是否是Chrome
|
||||||
'supportCopy': false, // 是否支持复制到剪切板
|
'supportCopy': false, // 是否支持复制到剪切板
|
||||||
'useLocalForage': true,
|
'useLocalForage': true,
|
||||||
|
'extendKeyboard': false,
|
||||||
|
|
||||||
'fileInput': null, // FileInput
|
'fileInput': null, // FileInput
|
||||||
'fileReader': null, // 是否支持FileReader
|
'fileReader': null, // 是否支持FileReader
|
||||||
@ -92,7 +92,16 @@ function core() {
|
|||||||
height: 13,
|
height: 13,
|
||||||
tempCanvas: null, // A temp canvas for drawing
|
tempCanvas: null, // A temp canvas for drawing
|
||||||
}
|
}
|
||||||
this.paint = {}
|
this.paint = {};
|
||||||
|
this.saves = {
|
||||||
|
"saveIndex": null,
|
||||||
|
"ids": {},
|
||||||
|
"autosave": {
|
||||||
|
"data": null,
|
||||||
|
"time": null,
|
||||||
|
"updated": false,
|
||||||
|
}
|
||||||
|
}
|
||||||
this.initStatus = {
|
this.initStatus = {
|
||||||
'played': false,
|
'played': false,
|
||||||
'gameOver': false,
|
'gameOver': false,
|
||||||
@ -150,7 +159,6 @@ function core() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// event事件
|
// event事件
|
||||||
'saveIndex': null,
|
|
||||||
'shops': {},
|
'shops': {},
|
||||||
'event': {
|
'event': {
|
||||||
'id': null,
|
'id': null,
|
||||||
@ -295,6 +303,8 @@ core.prototype.init = function (coreData, callback) {
|
|||||||
catch (e) {console.log(e); core.platform.useLocalForage=false;}
|
catch (e) {console.log(e); core.platform.useLocalForage=false;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
core.platform.extendKeyboard = core.getLocalStorage("extendKeyboard", false);
|
||||||
|
|
||||||
if (window.FileReader) {
|
if (window.FileReader) {
|
||||||
core.platform.fileReader = new FileReader();
|
core.platform.fileReader = new FileReader();
|
||||||
core.platform.fileReader.onload = function () {
|
core.platform.fileReader.onload = function () {
|
||||||
@ -306,24 +316,11 @@ core.prototype.init = function (coreData, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (core.platform.isPC) {
|
|
||||||
// 如果是PC端直接加载
|
|
||||||
core.musicStatus.startDirectly = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var connection = navigator.connection;
|
|
||||||
if (core.isset(connection) && connection.type=='wifi')
|
|
||||||
core.musicStatus.startDirectly = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 先从存储中读取BGM状态
|
// 先从存储中读取BGM状态
|
||||||
core.musicStatus.bgmStatus = core.getLocalStorage('bgmStatus', true);
|
core.musicStatus.bgmStatus = core.getLocalStorage('bgmStatus', true);
|
||||||
if (!core.musicStatus.startDirectly) // 如果当前网络环境不允许
|
if (!core.platform.isPC && (navigator.connection||{}).type!='wifi')
|
||||||
core.musicStatus.bgmStatus = false;
|
core.musicStatus.bgmStatus = false;
|
||||||
// core.setLocalStorage('bgmStatus', core.musicStatus.bgmStatus);
|
|
||||||
|
|
||||||
core.musicStatus.soundStatus = core.getLocalStorage('soundStatus', true);
|
core.musicStatus.soundStatus = core.getLocalStorage('soundStatus', true);
|
||||||
core.setLocalStorage('soundStatus', core.musicStatus.soundStatus);
|
|
||||||
|
|
||||||
// switchs
|
// switchs
|
||||||
core.flags.battleAnimate = core.getLocalStorage('battleAnimate', core.flags.battleAnimate);
|
core.flags.battleAnimate = core.getLocalStorage('battleAnimate', core.flags.battleAnimate);
|
||||||
@ -349,6 +346,12 @@ core.prototype.init = function (coreData, callback) {
|
|||||||
|
|
||||||
core.bigmap.tempCanvas = document.createElement('canvas').getContext('2d');
|
core.bigmap.tempCanvas = document.createElement('canvas').getContext('2d');
|
||||||
|
|
||||||
|
////// 记录所有的存档编号!!! //////
|
||||||
|
core.saves.saveIndex = core.getLocalStorage('saveIndex', 1);
|
||||||
|
core.control.getSaveIndexes(function (indexes) {
|
||||||
|
core.saves.ids = indexes;
|
||||||
|
});
|
||||||
|
|
||||||
core.loader.load(function () {
|
core.loader.load(function () {
|
||||||
console.log(core.material);
|
console.log(core.material);
|
||||||
// 设置勇士高度
|
// 设置勇士高度
|
||||||
@ -362,8 +365,13 @@ core.prototype.init = function (coreData, callback) {
|
|||||||
if (main.mode=='play')
|
if (main.mode=='play')
|
||||||
core.events.initGame();
|
core.events.initGame();
|
||||||
|
|
||||||
if (core.isset(functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins))
|
if (core.isset(functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins)) {
|
||||||
core.plugin = new functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins.plugin();
|
core.plugin = new function () {
|
||||||
|
this.__renderFrameFuncs = [];
|
||||||
|
};
|
||||||
|
core.plugin.__init__ = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins.plugin;
|
||||||
|
core.plugin.__init__();
|
||||||
|
}
|
||||||
|
|
||||||
core.showStartAnimate();
|
core.showStartAnimate();
|
||||||
|
|
||||||
@ -602,6 +610,11 @@ core.prototype.nextY = function (n) {
|
|||||||
return core.control.nextY(n);
|
return core.control.nextY(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 某个点是否在勇士旁边 //////
|
||||||
|
core.prototype.nearHero = function (x, y) {
|
||||||
|
return core.control.nearHero(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
/////////// 自动行走 & 行走控制 END ///////////
|
/////////// 自动行走 & 行走控制 END ///////////
|
||||||
|
|
||||||
|
|
||||||
@ -649,8 +662,8 @@ core.prototype.fillText = function (name, text, x, y, style, font) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////// 在某个canvas上绘制一段描边文字 //////
|
////// 在某个canvas上绘制一段描边文字 //////
|
||||||
core.prototype.fillBoldText = function (name, text, style, x, y, font) {
|
core.prototype.fillBoldText = function (name, text, x, y, style, font) {
|
||||||
core.ui.fillBoldText(name, text, style , x, y, font);
|
core.ui.fillBoldText(name, text, x, y, style, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 在某个canvas上绘制一个矩形 //////
|
////// 在某个canvas上绘制一个矩形 //////
|
||||||
@ -892,7 +905,12 @@ core.prototype.drawBoxAnimate = function () {
|
|||||||
|
|
||||||
////// 绘制动画 //////
|
////// 绘制动画 //////
|
||||||
core.prototype.drawAnimate = function (name, x, y, callback) {
|
core.prototype.drawAnimate = function (name, x, y, callback) {
|
||||||
core.maps.drawAnimate(name, x, y, callback);
|
return core.maps.drawAnimate(name, x, y, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
////// 停止动画 //////
|
||||||
|
core.prototype.stopAnimate = function (id, doCallback) {
|
||||||
|
return core.maps.stopAnimate(id, doCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 更新领域、夹击、阻击的伤害地图 //////
|
////// 更新领域、夹击、阻击的伤害地图 //////
|
||||||
@ -1225,6 +1243,11 @@ core.prototype.replay = function () {
|
|||||||
core.control.replay();
|
core.control.replay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 是否正在回放录像 //////
|
||||||
|
core.prototype.isReplaying = function () {
|
||||||
|
return core.control.isReplaying();
|
||||||
|
}
|
||||||
|
|
||||||
////// 判断当前能否进入某个事件 //////
|
////// 判断当前能否进入某个事件 //////
|
||||||
core.prototype.checkStatus = function (name, need, item) {
|
core.prototype.checkStatus = function (name, need, item) {
|
||||||
return core.control.checkStatus(name, need, item);
|
return core.control.checkStatus(name, need, item);
|
||||||
@ -1255,6 +1278,10 @@ core.prototype.openQuickShop = function (need) {
|
|||||||
core.control.openQuickShop(need);
|
core.control.openQuickShop(need);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
core.prototype.openKeyBoard = function (need) {
|
||||||
|
core.control.openKeyBoard(need);
|
||||||
|
}
|
||||||
|
|
||||||
////// 点击保存按钮时的打开操作 //////
|
////// 点击保存按钮时的打开操作 //////
|
||||||
core.prototype.save = function(need) {
|
core.prototype.save = function(need) {
|
||||||
core.control.save(need);
|
core.control.save(need);
|
||||||
@ -1315,6 +1342,11 @@ core.prototype.http = function (type, url, formData, success, error, mimeType, r
|
|||||||
core.utils.http(type, url, formData, success, error, mimeType, responseType)
|
core.utils.http(type, url, formData, success, error, mimeType, responseType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 判断某个存档位是否存在存档 //////
|
||||||
|
core.prototype.hasSave = function (index) {
|
||||||
|
return core.control.hasSave(index);
|
||||||
|
}
|
||||||
|
|
||||||
////// 设置勇士属性 //////
|
////// 设置勇士属性 //////
|
||||||
core.prototype.setStatus = function (statusName, statusVal) {
|
core.prototype.setStatus = function (statusName, statusVal) {
|
||||||
core.control.setStatus(statusName, statusVal);
|
core.control.setStatus(statusName, statusVal);
|
||||||
@ -1384,6 +1416,10 @@ core.prototype.clamp = function (x, a, b) {
|
|||||||
return core.utils.clamp(x, a, b);
|
return core.utils.clamp(x, a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
core.prototype.getCookie = function (name) {
|
||||||
|
return core.utils.getCookie(name);
|
||||||
|
}
|
||||||
|
|
||||||
////// Base64加密 //////
|
////// Base64加密 //////
|
||||||
core.prototype.encodeBase64 = function (str) {
|
core.prototype.encodeBase64 = function (str) {
|
||||||
return core.utils.encodeBase64(str);
|
return core.utils.encodeBase64(str);
|
||||||
@ -1439,6 +1475,11 @@ core.prototype.resumeBgm = function () {
|
|||||||
core.control.resumeBgm();
|
core.control.resumeBgm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 更改背景音乐的状态 //////
|
||||||
|
core.prototype.triggerBgm = function () {
|
||||||
|
core.control.triggerBgm();
|
||||||
|
}
|
||||||
|
|
||||||
////// 预加载一个背景音乐 //////
|
////// 预加载一个背景音乐 //////
|
||||||
core.prototype.loadBgm = function (bgm) {
|
core.prototype.loadBgm = function (bgm) {
|
||||||
core.loader.loadBgm(bgm);
|
core.loader.loadBgm(bgm);
|
||||||
|
|||||||
141
libs/events.js
141
libs/events.js
@ -149,7 +149,7 @@ events.prototype.startGame = function (hard, seed, route, callback) {
|
|||||||
|
|
||||||
var real_start = function () {
|
var real_start = function () {
|
||||||
core.insertAction(core.clone(core.firstData.startText), null, null, function() {
|
core.insertAction(core.clone(core.firstData.startText), null, null, function() {
|
||||||
if (!core.flags.startUsingCanvas && !core.status.replay.replaying && core.flags.showBattleAnimateConfirm) { // 是否提供“开启战斗动画”的选择项
|
if (!core.flags.startUsingCanvas && !core.isReplaying() && core.flags.showBattleAnimateConfirm) { // 是否提供“开启战斗动画”的选择项
|
||||||
core.status.event.selection = core.flags.battleAnimate ? 0 : 1;
|
core.status.event.selection = core.flags.battleAnimate ? 0 : 1;
|
||||||
core.ui.drawConfirmBox("你想开启战斗动画吗?\n之后可以在菜单栏中开启或关闭。\n(强烈建议新手开启此项)", function () {
|
core.ui.drawConfirmBox("你想开启战斗动画吗?\n之后可以在菜单栏中开启或关闭。\n(强烈建议新手开启此项)", function () {
|
||||||
core.flags.battleAnimate = true;
|
core.flags.battleAnimate = true;
|
||||||
@ -301,7 +301,7 @@ events.prototype.gameOver = function (ending, fromReplay, norank) {
|
|||||||
doUpload("");
|
doUpload("");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
doUpload(prompt("请输入你的ID:"));
|
doUpload(prompt("请输入你的ID:", core.getCookie('id')));
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function () {
|
||||||
if (main.isCompetition)
|
if (main.isCompetition)
|
||||||
@ -406,7 +406,7 @@ events.prototype.doAction = function() {
|
|||||||
if (typeof data == "string") {
|
if (typeof data == "string") {
|
||||||
core.status.event.data.type='text';
|
core.status.event.data.type='text';
|
||||||
// 如果是正在回放中,不显示
|
// 如果是正在回放中,不显示
|
||||||
if (core.status.replay.replaying)
|
if (core.isReplaying())
|
||||||
core.events.doAction();
|
core.events.doAction();
|
||||||
else
|
else
|
||||||
core.ui.drawTextBox(data);
|
core.ui.drawTextBox(data);
|
||||||
@ -415,13 +415,13 @@ events.prototype.doAction = function() {
|
|||||||
core.status.event.data.type=data.type;
|
core.status.event.data.type=data.type;
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case "text": // 文字/对话
|
case "text": // 文字/对话
|
||||||
if (core.status.replay.replaying)
|
if (core.isReplaying())
|
||||||
core.events.doAction();
|
core.events.doAction();
|
||||||
else
|
else
|
||||||
core.ui.drawTextBox(data.text, data.showAll);
|
core.ui.drawTextBox(data.text, data.showAll);
|
||||||
break;
|
break;
|
||||||
case "autoText":
|
case "autoText":
|
||||||
if (core.status.replay.replaying)
|
if (core.isReplaying())
|
||||||
core.events.doAction();
|
core.events.doAction();
|
||||||
else {
|
else {
|
||||||
core.ui.drawTextBox(data.text);
|
core.ui.drawTextBox(data.text);
|
||||||
@ -431,7 +431,7 @@ events.prototype.doAction = function() {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "scrollText": // 滚动剧情文本
|
case "scrollText": // 滚动剧情文本
|
||||||
if (core.status.replay.replaying)
|
if (core.isReplaying())
|
||||||
core.events.doAction();
|
core.events.doAction();
|
||||||
else {
|
else {
|
||||||
var content = core.replaceText(data.text);
|
var content = core.replaceText(data.text);
|
||||||
@ -729,7 +729,7 @@ events.prototype.doAction = function() {
|
|||||||
break;
|
break;
|
||||||
case "showImage": // 显示图片
|
case "showImage": // 显示图片
|
||||||
if (!core.isset(data.loc)) data.loc=[0, 0];
|
if (!core.isset(data.loc)) data.loc=[0, 0];
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
data.time = 0;
|
data.time = 0;
|
||||||
}
|
}
|
||||||
var image = core.material.images.images[data.image];
|
var image = core.material.images.images[data.image];
|
||||||
@ -749,7 +749,7 @@ events.prototype.doAction = function() {
|
|||||||
break;
|
break;
|
||||||
case "showTextImage": // 显示图片化文本
|
case "showTextImage": // 显示图片化文本
|
||||||
if (!core.isset(data.loc)) data.loc=[0, 0];
|
if (!core.isset(data.loc)) data.loc=[0, 0];
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
data.time = 0;
|
data.time = 0;
|
||||||
}
|
}
|
||||||
var content = core.replaceText(data.text);
|
var content = core.replaceText(data.text);
|
||||||
@ -765,7 +765,7 @@ events.prototype.doAction = function() {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "hideImage": // 隐藏图片
|
case "hideImage": // 隐藏图片
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
data.time = 0;
|
data.time = 0;
|
||||||
}
|
}
|
||||||
if (data.async || data.time == 0) {
|
if (data.async || data.time == 0) {
|
||||||
@ -795,7 +795,7 @@ events.prototype.doAction = function() {
|
|||||||
this.doAction();
|
this.doAction();
|
||||||
break;
|
break;
|
||||||
case "moveImage": // 图片移动
|
case "moveImage": // 图片移动
|
||||||
if (core.status.replay.replaying) { // 正在播放录像
|
if (core.isReplaying()) { // 正在播放录像
|
||||||
this.doAction();
|
this.doAction();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -860,7 +860,7 @@ events.prototype.doAction = function() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "openShop": // 打开一个全局商店
|
case "openShop": // 打开一个全局商店
|
||||||
if (core.status.replay.replaying) { // 正在播放录像,简单将visited置为true
|
if (core.isReplaying()) { // 正在播放录像,简单将visited置为true
|
||||||
core.status.shops[data.id].visited=true;
|
core.status.shops[data.id].visited=true;
|
||||||
core.status.event.data.list = [];
|
core.status.event.data.list = [];
|
||||||
this.doAction();
|
this.doAction();
|
||||||
@ -905,14 +905,15 @@ events.prototype.doAction = function() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "playSound":
|
case "playSound":
|
||||||
if (!core.status.replay.replaying)
|
if (!core.isReplaying())
|
||||||
core.playSound(data.name);
|
core.playSound(data.name);
|
||||||
this.doAction();
|
this.doAction();
|
||||||
break;
|
break;
|
||||||
case "playBgm":
|
case "playBgm":
|
||||||
core.playBgm(data.name);
|
core.playBgm(data.name);
|
||||||
this.doAction();
|
this.doAction();
|
||||||
break
|
break;
|
||||||
|
/*
|
||||||
case "pauseBgm":
|
case "pauseBgm":
|
||||||
core.pauseBgm();
|
core.pauseBgm();
|
||||||
this.doAction();
|
this.doAction();
|
||||||
@ -921,8 +922,10 @@ events.prototype.doAction = function() {
|
|||||||
core.resumeBgm();
|
core.resumeBgm();
|
||||||
this.doAction();
|
this.doAction();
|
||||||
break
|
break
|
||||||
|
*/
|
||||||
case "loadBgm":
|
case "loadBgm":
|
||||||
core.loadBgm(data.name);
|
if (core.platform.isPC)
|
||||||
|
core.loadBgm(data.name);
|
||||||
this.doAction();
|
this.doAction();
|
||||||
break;
|
break;
|
||||||
case "freeBgm":
|
case "freeBgm":
|
||||||
@ -965,9 +968,11 @@ events.prototype.doAction = function() {
|
|||||||
}
|
}
|
||||||
// flag
|
// flag
|
||||||
if (data.name.indexOf("flag:")==0) {
|
if (data.name.indexOf("flag:")==0) {
|
||||||
var flag = data.name.substring(5);
|
core.setFlag(data.name.substring(5), value);
|
||||||
if (/^__[A-Z]__$/.test(flag)) flag = (prefix||"")+flag;
|
}
|
||||||
core.setFlag(flag, value);
|
// switch
|
||||||
|
if (data.name.indexOf("switch:")==0) {
|
||||||
|
core.setFlag((prefix||"global")+"@"+data.name.substring(7), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {console.log(e)}
|
catch (e) {console.log(e)}
|
||||||
@ -994,6 +999,16 @@ events.prototype.doAction = function() {
|
|||||||
core.values[data.name] = data.value;
|
core.values[data.name] = data.value;
|
||||||
this.doAction();
|
this.doAction();
|
||||||
break;
|
break;
|
||||||
|
case "setGlobalFlag":
|
||||||
|
{
|
||||||
|
var flags = core.getFlag("globalFlags", {});
|
||||||
|
flags[data.name] = data.value;
|
||||||
|
core.flags[data.name] = data.value;
|
||||||
|
core.setFlag("globalFlags", flags);
|
||||||
|
core.resize();
|
||||||
|
this.doAction();
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "setHeroIcon":
|
case "setHeroIcon":
|
||||||
{
|
{
|
||||||
this.setHeroIcon(data.name);
|
this.setHeroIcon(data.name);
|
||||||
@ -1003,7 +1018,7 @@ events.prototype.doAction = function() {
|
|||||||
case "input":
|
case "input":
|
||||||
{
|
{
|
||||||
var value;
|
var value;
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
var action = core.status.replay.toReplay.shift();
|
var action = core.status.replay.toReplay.shift();
|
||||||
if (action.indexOf("input:")==0 ) {
|
if (action.indexOf("input:")==0 ) {
|
||||||
value=parseInt(action.substring(6));
|
value=parseInt(action.substring(6));
|
||||||
@ -1027,7 +1042,7 @@ events.prototype.doAction = function() {
|
|||||||
case "input2":
|
case "input2":
|
||||||
{
|
{
|
||||||
var value;
|
var value;
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
var action = core.status.replay.toReplay.shift();
|
var action = core.status.replay.toReplay.shift();
|
||||||
try {
|
try {
|
||||||
if (action.indexOf("input2:")!=0) throw new Error("Input2 Error. Current action: "+action);
|
if (action.indexOf("input2:")!=0) throw new Error("Input2 Error. Current action: "+action);
|
||||||
@ -1068,7 +1083,7 @@ events.prototype.doAction = function() {
|
|||||||
this.doAction();
|
this.doAction();
|
||||||
break;
|
break;
|
||||||
case "choices": // 提供选项
|
case "choices": // 提供选项
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
if (core.status.replay.toReplay.length==0) { // 回放完毕
|
if (core.status.replay.toReplay.length==0) { // 回放完毕
|
||||||
core.status.replay.replaying=false;
|
core.status.replay.replaying=false;
|
||||||
core.drawTip("录像回放完毕");
|
core.drawTip("录像回放完毕");
|
||||||
@ -1127,8 +1142,6 @@ events.prototype.doAction = function() {
|
|||||||
if ((typeof func == "string") && func.indexOf("function")==0) {
|
if ((typeof func == "string") && func.indexOf("function")==0) {
|
||||||
eval('('+func+')()');
|
eval('('+func+')()');
|
||||||
}
|
}
|
||||||
else if (func instanceof Function)
|
|
||||||
func();
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@ -1166,20 +1179,32 @@ events.prototype.doAction = function() {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "sleep": // 等待多少毫秒
|
case "sleep": // 等待多少毫秒
|
||||||
setTimeout(function() {
|
core.timeout.sleepTimeout = setTimeout(function() {
|
||||||
|
core.timeout.sleepTimeout = null;
|
||||||
core.events.doAction();
|
core.events.doAction();
|
||||||
}, core.status.replay.replaying?20:data.time);
|
}, core.isReplaying()?20:data.time);
|
||||||
break;
|
break;
|
||||||
case "wait":
|
case "wait":
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
var code = core.status.replay.toReplay.shift();
|
var code = core.status.replay.toReplay.shift();
|
||||||
if (code.indexOf("input:")==0) {
|
if (code.indexOf("input:")==0) {
|
||||||
var value = parseInt(code.substring(6));
|
var value = parseInt(code.substring(6));
|
||||||
core.status.route.push("input:"+value);
|
core.status.route.push("input:"+value);
|
||||||
if (value>=10000) {
|
if (value>=1000000) {
|
||||||
core.setFlag('type', 1);
|
core.setFlag('type', 1);
|
||||||
core.setFlag('x', parseInt((value-10000)/100));
|
var px = parseInt((value-1000000)/1000), py = value%1000;
|
||||||
core.setFlag('y', value%100);
|
core.setFlag('px', px);
|
||||||
|
core.setFlag('py', py);
|
||||||
|
core.setFlag('x', parseInt(px/32));
|
||||||
|
core.setFlag('y', parseInt(py/32));
|
||||||
|
}
|
||||||
|
else if (value>=10000) {
|
||||||
|
core.setFlag('type', 1);
|
||||||
|
var x = parseInt((value-10000)/100), y = value%100;
|
||||||
|
core.setFlag('px', 32*x+16);
|
||||||
|
core.setFlag('py', 32*y+16);
|
||||||
|
core.setFlag('x', x);
|
||||||
|
core.setFlag('y', y);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.setFlag('type', 0);
|
core.setFlag('type', 0);
|
||||||
@ -1196,7 +1221,7 @@ events.prototype.doAction = function() {
|
|||||||
case "waitAsync": // 等待所有异步事件执行完毕
|
case "waitAsync": // 等待所有异步事件执行完毕
|
||||||
{
|
{
|
||||||
var test = window.setInterval(function () {
|
var test = window.setInterval(function () {
|
||||||
if (Object.keys(core.animateFrame.asyncId)==0) {
|
if (Object.keys(core.animateFrame.asyncId).length==0) {
|
||||||
clearInterval(test);
|
clearInterval(test);
|
||||||
core.events.doAction();
|
core.events.doAction();
|
||||||
}
|
}
|
||||||
@ -1217,6 +1242,40 @@ events.prototype.doAction = function() {
|
|||||||
this.doAction();
|
this.doAction();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "callBook": // 呼出怪物手册
|
||||||
|
if (core.isReplaying() || !core.hasItem('book')) {
|
||||||
|
this.doAction();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var e = core.clone(core.status.event.data);
|
||||||
|
core.ui.closePanel();
|
||||||
|
core.openBook();
|
||||||
|
core.status.event.interval = e;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "callSave": // 呼出存档页面
|
||||||
|
if (core.isReplaying() || core.hasFlag("__events__")) {
|
||||||
|
core.removeFlag("__events__");
|
||||||
|
this.doAction();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var e = core.clone(core.status.event.data);
|
||||||
|
core.ui.closePanel();
|
||||||
|
core.save();
|
||||||
|
core.status.event.interval = e;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "callLoad": // 呼出读档页面
|
||||||
|
if (core.isReplaying()) {
|
||||||
|
this.doAction();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var e = core.clone(core.status.event.data);
|
||||||
|
core.ui.closePanel();
|
||||||
|
core.load();
|
||||||
|
core.status.event.interval = e;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "exit": // 立刻结束事件
|
case "exit": // 立刻结束事件
|
||||||
core.status.event.data.list = [];
|
core.status.event.data.list = [];
|
||||||
core.events.doAction();
|
core.events.doAction();
|
||||||
@ -1243,6 +1302,21 @@ events.prototype.insertAction = function (action, x, y, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 恢复一个事件 //////
|
||||||
|
events.prototype.recoverEvents = function (data) {
|
||||||
|
if (core.isset(data)) {
|
||||||
|
core.ui.closePanel();
|
||||||
|
core.lockControl();
|
||||||
|
core.status.event.id = 'action';
|
||||||
|
core.status.event.data = data;
|
||||||
|
setTimeout(function () {
|
||||||
|
core.doAction();
|
||||||
|
}, 30);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////// 获得面前的物品(轻按) //////
|
////// 获得面前的物品(轻按) //////
|
||||||
events.prototype.getNextItem = function() {
|
events.prototype.getNextItem = function() {
|
||||||
if (!core.status.heroStop || !core.flags.enableGentleClick) return false;
|
if (!core.status.heroStop || !core.flags.enableGentleClick) return false;
|
||||||
@ -1270,7 +1344,6 @@ events.prototype.getItem = function (itemId, itemNum, itemX, itemY, callback) {
|
|||||||
if (itemNum > 1) text += "x" + itemNum;
|
if (itemNum > 1) text += "x" + itemNum;
|
||||||
if (itemCls === 'items') text += core.items.getItemEffectTip(itemId);
|
if (itemCls === 'items') text += core.items.getItemEffectTip(itemId);
|
||||||
core.drawTip(text, core.material.icons.items[itemId]);
|
core.drawTip(text, core.material.icons.items[itemId]);
|
||||||
core.clearMap('event', itemX * 32, itemY * 32, 32, 32);
|
|
||||||
core.updateStatusBar();
|
core.updateStatusBar();
|
||||||
|
|
||||||
this.eventdata.afterGetItem(itemId, itemX, itemY, callback);
|
this.eventdata.afterGetItem(itemId, itemX, itemY, callback);
|
||||||
@ -1356,7 +1429,7 @@ events.prototype.battle = function (id, x, y, force, callback) {
|
|||||||
if (!core.isset(core.status.event.id)) // 自动存档
|
if (!core.isset(core.status.event.id)) // 自动存档
|
||||||
core.autosave(true);
|
core.autosave(true);
|
||||||
|
|
||||||
if (core.flags.battleAnimate&&!core.status.replay.replaying) {
|
if (core.flags.battleAnimate&&!core.isReplaying()) {
|
||||||
core.waitHeroToStop(function() {
|
core.waitHeroToStop(function() {
|
||||||
core.ui.drawBattleAnimate(id, function() {
|
core.ui.drawBattleAnimate(id, function() {
|
||||||
core.events.afterBattle(id, x, y, callback);
|
core.events.afterBattle(id, x, y, callback);
|
||||||
@ -1390,7 +1463,7 @@ events.prototype.trigger = function (x, y) {
|
|||||||
if (core.isset(mapBlocks[b].event.data) && core.isset(mapBlocks[b].event.data.portalWithoutTrigger))
|
if (core.isset(mapBlocks[b].event.data) && core.isset(mapBlocks[b].event.data.portalWithoutTrigger))
|
||||||
canCross=mapBlocks[b].event.data.portalWithoutTrigger;
|
canCross=mapBlocks[b].event.data.portalWithoutTrigger;
|
||||||
if (canCross) {
|
if (canCross) {
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
if (core.status.replay.toReplay[0]=='no') {
|
if (core.status.replay.toReplay[0]=='no') {
|
||||||
core.status.replay.toReplay.shift();
|
core.status.replay.toReplay.shift();
|
||||||
core.status.route.push("no");
|
core.status.route.push("no");
|
||||||
@ -1459,7 +1532,7 @@ events.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback
|
|||||||
if (!core.isset(time)) time = core.values.floorChangeTime;
|
if (!core.isset(time)) time = core.values.floorChangeTime;
|
||||||
if (!core.isset(time)) time = 800;
|
if (!core.isset(time)) time = 800;
|
||||||
|
|
||||||
var displayAnimate = time>=100 && !core.status.replay.replaying;
|
var displayAnimate = time>=100 && !core.isReplaying();
|
||||||
|
|
||||||
time /= 20;
|
time /= 20;
|
||||||
core.lockControl();
|
core.lockControl();
|
||||||
@ -1717,7 +1790,7 @@ events.prototype.setVolume = function (value, time, callback) {
|
|||||||
////// 画面震动 //////
|
////// 画面震动 //////
|
||||||
events.prototype.vibrate = function(time, callback) {
|
events.prototype.vibrate = function(time, callback) {
|
||||||
|
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,17 @@ loader.prototype.load = function (callback) {
|
|||||||
core.loader.loadImages(images, core.material.images.images, function () {
|
core.loader.loadImages(images, core.material.images.images, function () {
|
||||||
// 加载autotile
|
// 加载autotile
|
||||||
core.material.images.autotile = {};
|
core.material.images.autotile = {};
|
||||||
core.loader.loadImages(Object.keys(core.material.icons.autotile), core.material.images.autotile, function () {
|
var keys = Object.keys(core.material.icons.autotile);
|
||||||
|
var autotiles = {};
|
||||||
|
core.loader.loadImages(keys, autotiles, function () {
|
||||||
|
|
||||||
|
keys.forEach(function (v) {
|
||||||
|
core.material.images.autotile[v] = autotiles[v];
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
core.maps.makeAutotileEdges();
|
||||||
|
});
|
||||||
|
|
||||||
// 加载tilesets
|
// 加载tilesets
|
||||||
core.material.images.tilesets = {};
|
core.material.images.tilesets = {};
|
||||||
@ -136,6 +146,7 @@ loader.prototype.loadAnimates = function () {
|
|||||||
image.src = t2;
|
image.src = t2;
|
||||||
data.images.push(image);
|
data.images.push(image);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
data.images.push(null);
|
data.images.push(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -174,7 +185,8 @@ loader.prototype.loadAnimates = function () {
|
|||||||
loader.prototype.loadMusic = function () {
|
loader.prototype.loadMusic = function () {
|
||||||
|
|
||||||
core.bgms.forEach(function (t) {
|
core.bgms.forEach(function (t) {
|
||||||
|
core.loader.loadOneMusic(t);
|
||||||
|
/*
|
||||||
// 判断是不是mid
|
// 判断是不是mid
|
||||||
if (/^.*\.mid$/i.test(t)) {
|
if (/^.*\.mid$/i.test(t)) {
|
||||||
|
|
||||||
@ -210,6 +222,7 @@ loader.prototype.loadMusic = function () {
|
|||||||
else {
|
else {
|
||||||
core.loader.loadOneMusic(t);
|
core.loader.loadOneMusic(t);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
});
|
});
|
||||||
|
|
||||||
core.sounds.forEach(function (t) {
|
core.sounds.forEach(function (t) {
|
||||||
@ -243,8 +256,7 @@ loader.prototype.loadMusic = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 直接开始播放
|
// 直接开始播放
|
||||||
if (core.musicStatus.startDirectly && core.bgms.length>0)
|
core.playBgm(main.startBgm);
|
||||||
core.playBgm(core.bgms[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loader.prototype.loadOneMusic = function (name) {
|
loader.prototype.loadOneMusic = function (name) {
|
||||||
@ -264,6 +276,9 @@ loader.prototype.freeBgm = function (name) {
|
|||||||
core.material.bgms[name].removeAttribute("src");
|
core.material.bgms[name].removeAttribute("src");
|
||||||
core.material.bgms[name].load();
|
core.material.bgms[name].load();
|
||||||
core.material.bgms[name] = null;
|
core.material.bgms[name] = null;
|
||||||
|
if (name == core.musicStatus.playingBgm) {
|
||||||
|
core.musicStatus.playingBgm = null;
|
||||||
|
}
|
||||||
// 三秒后重新加载
|
// 三秒后重新加载
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
core.loader.loadOneMusic(name);
|
core.loader.loadOneMusic(name);
|
||||||
|
|||||||
133
libs/maps.js
133
libs/maps.js
@ -465,6 +465,17 @@ maps.prototype.drawBgFgMap = function (floorId, canvas, name, animate) {
|
|||||||
if (animate) core.status.autotileAnimateObjs[name+"map"] = core.clone(arr);
|
if (animate) core.status.autotileAnimateObjs[name+"map"] = core.clone(arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 生成groundPattern //////
|
||||||
|
maps.prototype.generateGroundPattern = function (floorId) {
|
||||||
|
// 生成floorId层的groundPattern(盒子内的怪物动画)
|
||||||
|
var groundId = ((core.status.maps||core.floors)[floorId||core.status.floorId]||{}).defaultGround || "ground";
|
||||||
|
core.material.groundCanvas.clearRect(0, 0, 32, 32);
|
||||||
|
core.material.groundCanvas.drawImage(core.material.images.terrains, 0, 32*core.material.icons.terrains[groundId], 32, 32, 0, 0, 32, 32);
|
||||||
|
core.material.groundPattern = core.material.groundCanvas.createPattern(core.material.groundCanvas.canvas, 'repeat');
|
||||||
|
// 如果需要用纯色可以直接将下面代码改成改成
|
||||||
|
// core.material.groundPattern = '#000000';
|
||||||
|
}
|
||||||
|
|
||||||
////// 绘制某张地图 //////
|
////// 绘制某张地图 //////
|
||||||
maps.prototype.drawMap = function (floorId, callback) {
|
maps.prototype.drawMap = function (floorId, callback) {
|
||||||
floorId = floorId || core.status.floorId;
|
floorId = floorId || core.status.floorId;
|
||||||
@ -475,10 +486,7 @@ maps.prototype.drawMap = function (floorId, callback) {
|
|||||||
}
|
}
|
||||||
core.clearMap('all');
|
core.clearMap('all');
|
||||||
|
|
||||||
var groundId = (core.status.maps||core.floors)[floorId].defaultGround || "ground";
|
this.generateGroundPattern(floorId);
|
||||||
core.material.groundCanvas.clearRect(0, 0, 32, 32);
|
|
||||||
core.material.groundCanvas.drawImage(core.material.images.terrains, 0, 32*core.material.icons.terrains[groundId], 32, 32, 0, 0, 32, 32);
|
|
||||||
core.material.groundPattern = core.material.groundCanvas.createPattern(core.material.groundCanvas.canvas, 'repeat');
|
|
||||||
|
|
||||||
var drawBg = function(){
|
var drawBg = function(){
|
||||||
var width = core.floors[floorId].width || 13;
|
var width = core.floors[floorId].width || 13;
|
||||||
@ -587,6 +595,8 @@ maps.prototype.drawMap = function (floorId, callback) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
drawEvent();
|
drawEvent();
|
||||||
|
if (core.isset(core.status.curtainColor))
|
||||||
|
core.fillRect('curtain',0,0,416,416,core.arrayToRGBA(core.status.curtainColor));
|
||||||
core.setGlobalAnimate(core.values.animateSpeed);
|
core.setGlobalAnimate(core.values.animateSpeed);
|
||||||
core.drawHero();
|
core.drawHero();
|
||||||
core.updateStatusBar();
|
core.updateStatusBar();
|
||||||
@ -625,7 +635,7 @@ maps.prototype.drawAutotile = function(ctx, mapArr, block, size, left, top, stat
|
|||||||
}
|
}
|
||||||
var getAutotileAroundId = function(currId, x, y) {
|
var getAutotileAroundId = function(currId, x, y) {
|
||||||
if(x<0 || y<0 || x>=mapArr[0].length || y>=mapArr.length) return 1;
|
if(x<0 || y<0 || x>=mapArr[0].length || y>=mapArr.length) return 1;
|
||||||
else return mapArr[y][x]==currId ? 1:0;
|
else return core.material.autotileEdges[currId].indexOf(mapArr[y][x])>=0;
|
||||||
}
|
}
|
||||||
var checkAround = function(x, y){ // 得到周围四个32*32块(周围每块都包含当前块的1/4,不清楚的话画下图你就明白)的数组索引
|
var checkAround = function(x, y){ // 得到周围四个32*32块(周围每块都包含当前块的1/4,不清楚的话画下图你就明白)的数组索引
|
||||||
var currId = mapArr[y][x];
|
var currId = mapArr[y][x];
|
||||||
@ -679,6 +689,39 @@ maps.prototype.drawAutotile = function(ctx, mapArr, block, size, left, top, stat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 为autotile判定边界 //////
|
||||||
|
maps.prototype.makeAutotileEdges = function () {
|
||||||
|
var autotileIds = Object.keys(core.material.images.autotile);
|
||||||
|
core.material.autotileEdges = {};
|
||||||
|
|
||||||
|
var canvas = document.createElement("canvas"), ctx = canvas.getContext('2d');
|
||||||
|
canvas.width = canvas.height = 32;
|
||||||
|
ctx.mozImageSmoothingEnabled = false;
|
||||||
|
ctx.webkitImageSmoothingEnabled = false;
|
||||||
|
ctx.msImageSmoothingEnabled = false;
|
||||||
|
ctx.imageSmoothingEnabled = false;
|
||||||
|
|
||||||
|
autotileIds.forEach(function (t) {
|
||||||
|
var n = core.maps.getNumberById(t);
|
||||||
|
core.material.autotileEdges[n] = [n];
|
||||||
|
|
||||||
|
ctx.clearRect(0,0,32,32);
|
||||||
|
ctx.drawImage(core.material.images.autotile[t], 0, 0, 32, 32, 0, 0, 32, 32);
|
||||||
|
var data = canvas.toDataURL("image/png");
|
||||||
|
|
||||||
|
autotileIds.forEach(function (t2) {
|
||||||
|
if (t==t2) return;
|
||||||
|
var n2 = core.maps.getNumberById(t2);
|
||||||
|
|
||||||
|
ctx.clearRect(0,0,32,32);
|
||||||
|
ctx.drawImage(core.material.images.autotile[t2], 32, 0, 32, 32, 0, 0, 32, 32);
|
||||||
|
if (data == canvas.toDataURL("image/png")) {
|
||||||
|
core.material.autotileEdges[n].push(n2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
////// 某个点是否不可通行 //////
|
////// 某个点是否不可通行 //////
|
||||||
maps.prototype.noPassExists = function (x, y, floorId) {
|
maps.prototype.noPassExists = function (x, y, floorId) {
|
||||||
var block = core.getBlock(x,y,floorId);
|
var block = core.getBlock(x,y,floorId);
|
||||||
@ -834,13 +877,13 @@ maps.prototype.__initBlockCanvas = function (block, height, x, y) {
|
|||||||
var ctx = core.createCanvas(damageCanvas, 0, 0, 32, 32, 65);
|
var ctx = core.createCanvas(damageCanvas, 0, 0, 32, 32, 65);
|
||||||
ctx.textAlign = 'left';
|
ctx.textAlign = 'left';
|
||||||
ctx.font = "bold 11px Arial";
|
ctx.font = "bold 11px Arial";
|
||||||
core.fillBoldText(ctx, damage, damageColor, 1, 31);
|
core.fillBoldText(ctx, damage, 1, 31, damageColor);
|
||||||
if (core.flags.displayCritical) {
|
if (core.flags.displayCritical) {
|
||||||
var critical = core.enemys.nextCriticals(block.event.id);
|
var critical = core.enemys.nextCriticals(block.event.id);
|
||||||
if (critical.length>0) critical=critical[0];
|
if (critical.length>0) critical=critical[0];
|
||||||
critical = core.formatBigNumber(critical[0], true);
|
critical = core.formatBigNumber(critical[0], true);
|
||||||
if (critical == '???') critical = '?';
|
if (critical == '???') critical = '?';
|
||||||
core.fillBoldText(ctx, critical, '#FFFFFF', 1, 21);
|
core.fillBoldText(ctx, critical, 1, 21, '#FFFFFF');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -853,6 +896,7 @@ maps.prototype.__initBlockCanvas = function (block, height, x, y) {
|
|||||||
////// 显示移动某块的动画,达到{“type”:”move”}的效果 //////
|
////// 显示移动某块的动画,达到{“type”:”move”}的效果 //////
|
||||||
maps.prototype.moveBlock = function(x,y,steps,time,keep,callback) {
|
maps.prototype.moveBlock = function(x,y,steps,time,keep,callback) {
|
||||||
time = time || 500;
|
time = time || 500;
|
||||||
|
var floorId = core.status.floorId;
|
||||||
|
|
||||||
var block = core.getBlock(x,y);
|
var block = core.getBlock(x,y);
|
||||||
if (block==null) {// 不存在
|
if (block==null) {// 不存在
|
||||||
@ -891,6 +935,11 @@ maps.prototype.moveBlock = function(x,y,steps,time,keep,callback) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var nowX=32*x, nowY=32*y, step=0;
|
var nowX=32*x, nowY=32*y, step=0;
|
||||||
|
var destX=x, destY=y;
|
||||||
|
moveSteps.forEach(function (t) {
|
||||||
|
destX += core.utils.scan[t].x;
|
||||||
|
destY += core.utils.scan[t].y;
|
||||||
|
});
|
||||||
|
|
||||||
var animateValue = block.event.animate || 1, animateCurrent = isTileset?bx:0, animateTime = 0;
|
var animateValue = block.event.animate || 1, animateCurrent = isTileset?bx:0, animateTime = 0;
|
||||||
var blockCanvas = this.__initBlockCanvas(block, height, x, y);
|
var blockCanvas = this.__initBlockCanvas(block, height, x, y);
|
||||||
@ -910,8 +959,8 @@ maps.prototype.moveBlock = function(x,y,steps,time,keep,callback) {
|
|||||||
if (isTileset) animateCurrent = bx;
|
if (isTileset) animateCurrent = bx;
|
||||||
|
|
||||||
// 已经移动完毕,消失
|
// 已经移动完毕,消失
|
||||||
if (moveSteps.length==0) {
|
if (moveSteps.length==0 || floorId != core.status.floorId) {
|
||||||
if (keep) opacity=0;
|
if (keep || floorId!=core.status.floorId) opacity=0;
|
||||||
else opacity -= 0.06;
|
else opacity -= 0.06;
|
||||||
if (opacity<=0) {
|
if (opacity<=0) {
|
||||||
delete core.animateFrame.asyncId[animate];
|
delete core.animateFrame.asyncId[animate];
|
||||||
@ -921,8 +970,9 @@ maps.prototype.moveBlock = function(x,y,steps,time,keep,callback) {
|
|||||||
core.deleteCanvas(damageCanvas);
|
core.deleteCanvas(damageCanvas);
|
||||||
// 不消失
|
// 不消失
|
||||||
if (keep) {
|
if (keep) {
|
||||||
core.setBlock(id, nowX/32, nowY/32);
|
core.setBlock(id, destX, destY, floorId);
|
||||||
core.showBlock(nowX/32, nowY/32);
|
if (floorId == core.status.floorId)
|
||||||
|
core.showBlock(destX, destY);
|
||||||
}
|
}
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
@ -962,6 +1012,7 @@ maps.prototype.moveBlock = function(x,y,steps,time,keep,callback) {
|
|||||||
////// 显示跳跃某块的动画,达到{"type":"jump"}的效果 //////
|
////// 显示跳跃某块的动画,达到{"type":"jump"}的效果 //////
|
||||||
maps.prototype.jumpBlock = function(sx,sy,ex,ey,time,keep,callback) {
|
maps.prototype.jumpBlock = function(sx,sy,ex,ey,time,keep,callback) {
|
||||||
time = time || 500;
|
time = time || 500;
|
||||||
|
var floorId = core.status.floorId;
|
||||||
var block = core.getBlock(sx,sy);
|
var block = core.getBlock(sx,sy);
|
||||||
if (block==null) {
|
if (block==null) {
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
@ -1014,12 +1065,12 @@ maps.prototype.jumpBlock = function(sx,sy,ex,ey,time,keep,callback) {
|
|||||||
|
|
||||||
var animate=window.setInterval(function() {
|
var animate=window.setInterval(function() {
|
||||||
|
|
||||||
if (jump_count>0) {
|
if (jump_count>0 && floorId == core.status.floorId) {
|
||||||
updateJump();
|
updateJump();
|
||||||
core.maps.__moveBlockCanvas(image, bx, by, height, drawX(), drawY(), opacity, headCanvas, bodyCanvas, damageCanvas);
|
core.maps.__moveBlockCanvas(image, bx, by, height, drawX(), drawY(), opacity, headCanvas, bodyCanvas, damageCanvas);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (keep) opacity=0;
|
if (keep || floorId != core.status.floorId) opacity=0;
|
||||||
else opacity -= 0.06;
|
else opacity -= 0.06;
|
||||||
if (opacity<=0) {
|
if (opacity<=0) {
|
||||||
delete core.animateFrame.asyncId[animate];
|
delete core.animateFrame.asyncId[animate];
|
||||||
@ -1028,8 +1079,9 @@ maps.prototype.jumpBlock = function(sx,sy,ex,ey,time,keep,callback) {
|
|||||||
core.deleteCanvas(bodyCanvas);
|
core.deleteCanvas(bodyCanvas);
|
||||||
core.deleteCanvas(damageCanvas);
|
core.deleteCanvas(damageCanvas);
|
||||||
if (keep) {
|
if (keep) {
|
||||||
core.setBlock(id, ex, ey);
|
core.setBlock(id, ex, ey, floorId);
|
||||||
core.showBlock(ex, ey);
|
if (floorId == core.status.floorId)
|
||||||
|
core.showBlock(ex, ey);
|
||||||
}
|
}
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
@ -1224,7 +1276,7 @@ maps.prototype.setBlock = function (number, x, y, floorId) {
|
|||||||
floorId = floorId || core.status.floorId;
|
floorId = floorId || core.status.floorId;
|
||||||
if (!core.isset(floorId)) return;
|
if (!core.isset(floorId)) return;
|
||||||
if (!core.isset(number) || !core.isset(x) || !core.isset(y)) return;
|
if (!core.isset(number) || !core.isset(x) || !core.isset(y)) return;
|
||||||
if (x<0 || x>=core.bigmap.width || y<0 || y>=core.bigmap.height) return;
|
if (x<0 || x>=(core.floors[floorId].width||13) || y<0 || y>=(core.floors[floorId].height||13)) return;
|
||||||
|
|
||||||
var originBlock=core.getBlock(x,y,floorId,true);
|
var originBlock=core.getBlock(x,y,floorId,true);
|
||||||
var block = core.maps.initBlock(x,y,number);
|
var block = core.maps.initBlock(x,y,number);
|
||||||
@ -1232,15 +1284,28 @@ maps.prototype.setBlock = function (number, x, y, floorId) {
|
|||||||
core.maps.addEvent(block,x,y,core.floors[floorId].events[x+","+y]);
|
core.maps.addEvent(block,x,y,core.floors[floorId].events[x+","+y]);
|
||||||
core.maps.addChangeFloor(block,x,y,core.floors[floorId].changeFloor[x+","+y]);
|
core.maps.addChangeFloor(block,x,y,core.floors[floorId].changeFloor[x+","+y]);
|
||||||
if (core.isset(block.event)) {
|
if (core.isset(block.event)) {
|
||||||
|
if (floorId == core.status.floorId) {
|
||||||
|
core.removeGlobalAnimate(x, y);
|
||||||
|
core.clearMap('event', x * 32, y * 32, 32, 32);
|
||||||
|
if (originBlock != null) {
|
||||||
|
var height = (originBlock.block.event||{}).height||32;
|
||||||
|
if (height>32)
|
||||||
|
core.clearMap('event2', x * 32, y * 32 +32-height, 32, height-32);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (originBlock==null) {
|
if (originBlock==null) {
|
||||||
core.status.maps[floorId].blocks.push(block);
|
core.status.maps[floorId].blocks.push(block);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
originBlock.block.id = number;
|
originBlock.block.id = number;
|
||||||
originBlock.block.event = block.event;
|
originBlock.block.event = block.event;
|
||||||
|
block = originBlock.block;
|
||||||
}
|
}
|
||||||
if (floorId==core.status.floorId) {
|
if (floorId==core.status.floorId && !block.disable) {
|
||||||
core.drawMap(floorId);
|
core.drawBlock(block);
|
||||||
|
core.addGlobalAnimate(block);
|
||||||
|
core.syncGlobalAnimate();
|
||||||
|
core.updateStatusBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1250,7 +1315,7 @@ maps.prototype.setBgFgBlock = function (name, number, x, y, floorId) {
|
|||||||
floorId = floorId || core.status.floorId;
|
floorId = floorId || core.status.floorId;
|
||||||
if (!core.isset(floorId)) return;
|
if (!core.isset(floorId)) return;
|
||||||
if (!core.isset(number) || !core.isset(x) || !core.isset(y)) return;
|
if (!core.isset(number) || !core.isset(x) || !core.isset(y)) return;
|
||||||
if (x<0 || x>=core.bigmap.width || y<0 || y>=core.bigmap.height) return;
|
if (x<0 || x>=(core.floors[floorId].width||13) || y<0 || y>=(core.floors[floorId].height||13)) return;
|
||||||
if (name!='bg' && name!='fg') return;
|
if (name!='bg' && name!='fg') return;
|
||||||
|
|
||||||
core.setFlag(name+"v_"+floorId+"_"+x+"_"+y, number);
|
core.setFlag(name+"v_"+floorId+"_"+x+"_"+y, number);
|
||||||
@ -1355,15 +1420,15 @@ maps.prototype.drawAnimateFrame = function (animate, centerX, centerY, index) {
|
|||||||
maps.prototype.drawAnimate = function (name, x, y, callback) {
|
maps.prototype.drawAnimate = function (name, x, y, callback) {
|
||||||
|
|
||||||
// 正在播放录像:不显示动画
|
// 正在播放录像:不显示动画
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检测动画是否存在
|
// 检测动画是否存在
|
||||||
if (!core.isset(core.material.animates[name]) || !core.isset(x) || !core.isset(y)) {
|
if (!core.isset(core.material.animates[name]) || !core.isset(x) || !core.isset(y)) {
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 开始绘制
|
// 开始绘制
|
||||||
@ -1382,6 +1447,30 @@ maps.prototype.drawAnimate = function (name, x, y, callback) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
core.animateFrame.asyncId[animateId] = true;
|
core.animateFrame.asyncId[animateId] = true;
|
||||||
|
return animateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
////// 停止动画 //////
|
||||||
|
maps.prototype.stopAnimate = function (id, doCallback) {
|
||||||
|
for (var i=0;i<core.status.animateObjs.length;i++) {
|
||||||
|
var obj = core.status.animateObjs[i];
|
||||||
|
if (obj.id == id) {
|
||||||
|
delete core.animateFrame.asyncId[obj.id];
|
||||||
|
if (doCallback) {
|
||||||
|
(function(callback) {
|
||||||
|
setTimeout(function() {
|
||||||
|
if (core.isset(callback))
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
})(obj.callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
core.status.animateObjs.splice(i, 1);
|
||||||
|
if (core.status.animateObjs.length == 0) {
|
||||||
|
core.clearMap('animate');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
maps.prototype.setFloorImage = function (type, loc, floorId, callback) {
|
maps.prototype.setFloorImage = function (type, loc, floorId, callback) {
|
||||||
|
|||||||
44
libs/ui.js
44
libs/ui.js
@ -58,10 +58,11 @@ ui.prototype.fillText = function (name, text, x, y, style, font) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////// 在某个canvas上绘制粗体 //////
|
////// 在某个canvas上绘制粗体 //////
|
||||||
ui.prototype.fillBoldText = function (name, text, style, x, y, font) {
|
ui.prototype.fillBoldText = function (name, text, x, y, style, font) {
|
||||||
var ctx = this.getContextByName(name);
|
var ctx = this.getContextByName(name);
|
||||||
if (!ctx) return;
|
if (!ctx) return;
|
||||||
if (core.isset(font)) ctx.font = font;
|
if (core.isset(font)) ctx.font = font;
|
||||||
|
if (!core.isset(style)) style = ctx.fillStyle;
|
||||||
ctx.fillStyle = '#000000';
|
ctx.fillStyle = '#000000';
|
||||||
ctx.fillText(text, x-1, y-1);
|
ctx.fillText(text, x-1, y-1);
|
||||||
ctx.fillText(text, x-1, y+1);
|
ctx.fillText(text, x-1, y+1);
|
||||||
@ -226,6 +227,7 @@ ui.prototype.closePanel = function () {
|
|||||||
core.status.boxAnimateObjs = [];
|
core.status.boxAnimateObjs = [];
|
||||||
clearInterval(core.status.event.interval);
|
clearInterval(core.status.event.interval);
|
||||||
core.clearLastEvent();
|
core.clearLastEvent();
|
||||||
|
core.maps.generateGroundPattern();
|
||||||
core.unLockControl();
|
core.unLockControl();
|
||||||
core.status.event.data = null;
|
core.status.event.data = null;
|
||||||
core.status.event.id = null;
|
core.status.event.id = null;
|
||||||
@ -299,7 +301,7 @@ ui.prototype.drawText = function (contents, callback) {
|
|||||||
if (core.isset(contents)) {
|
if (core.isset(contents)) {
|
||||||
|
|
||||||
// 合并
|
// 合并
|
||||||
if ((core.isset(core.status.event)&&core.status.event.id=='action') || (core.isset(core.status.replay)&&core.status.replay.replaying)) {
|
if ((core.isset(core.status.event)&&core.status.event.id=='action') || core.isReplaying()) {
|
||||||
core.insertAction(contents,null,null,callback);
|
core.insertAction(contents,null,null,callback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1065,6 +1067,7 @@ ui.prototype.drawSwitchs = function() {
|
|||||||
"领域显伤: "+(core.flags.displayExtraDamage ? "[ON]" : "[OFF]"),
|
"领域显伤: "+(core.flags.displayExtraDamage ? "[ON]" : "[OFF]"),
|
||||||
"新版存档: "+(core.platform.useLocalForage ? "[ON]":"[OFF]"),
|
"新版存档: "+(core.platform.useLocalForage ? "[ON]":"[OFF]"),
|
||||||
"单击瞬移: "+(core.getFlag('clickMove', true) ? "[ON]":"[OFF]"),
|
"单击瞬移: "+(core.getFlag('clickMove', true) ? "[ON]":"[OFF]"),
|
||||||
|
"拓展键盘: "+(core.platform.extendKeyboard ? "[ON]":"[OFF]"),
|
||||||
"返回主菜单"
|
"返回主菜单"
|
||||||
];
|
];
|
||||||
this.drawChoices(null, choices);
|
this.drawChoices(null, choices);
|
||||||
@ -1536,9 +1539,14 @@ ui.prototype.drawCursor = function () {
|
|||||||
|
|
||||||
////// 绘制怪物手册 //////
|
////// 绘制怪物手册 //////
|
||||||
ui.prototype.drawBook = function (index) {
|
ui.prototype.drawBook = function (index) {
|
||||||
var enemys = core.enemys.getCurrentEnemys(core.floorIds[(core.status.event.selection||{}).index]);
|
var floorId = core.floorIds[(core.status.event.ui||{}).index] || core.status.floorId;
|
||||||
|
var enemys = core.enemys.getCurrentEnemys(floorId);
|
||||||
|
|
||||||
core.clearLastEvent();
|
core.clearLastEvent();
|
||||||
|
|
||||||
|
// 生成groundPattern
|
||||||
|
core.maps.generateGroundPattern(floorId);
|
||||||
|
|
||||||
core.setFillStyle('ui', core.material.groundPattern);
|
core.setFillStyle('ui', core.material.groundPattern);
|
||||||
core.fillRect('ui', 0, 0, 416, 416);
|
core.fillRect('ui', 0, 0, 416, 416);
|
||||||
|
|
||||||
@ -1681,7 +1689,9 @@ ui.prototype.drawBook = function (index) {
|
|||||||
|
|
||||||
////// 绘制怪物属性的详细信息 //////
|
////// 绘制怪物属性的详细信息 //////
|
||||||
ui.prototype.drawBookDetail = function (index) {
|
ui.prototype.drawBookDetail = function (index) {
|
||||||
var enemys = core.enemys.getCurrentEnemys(core.floorIds[(core.status.event.selection||{}).index]);
|
var floorId = core.floorIds[(core.status.event.ui||{}).index] || core.status.floorId;
|
||||||
|
var enemys = core.enemys.getCurrentEnemys(floorId);
|
||||||
|
|
||||||
if (enemys.length==0) return;
|
if (enemys.length==0) return;
|
||||||
if (index<0) index=0;
|
if (index<0) index=0;
|
||||||
if (index>=enemys.length) index=enemys.length-1;
|
if (index>=enemys.length) index=enemys.length-1;
|
||||||
@ -2346,10 +2356,26 @@ ui.prototype.drawSLPanel = function(index, refresh) {
|
|||||||
callback();
|
callback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.getLocalForage(i==0?"autoSave":"save"+(5*page+i), null, function(data) {
|
|
||||||
core.status.event.ui[i]=data;
|
if (i==0) {
|
||||||
loadSave(i+1, callback);
|
if (core.saves.autosave.data!=null) {
|
||||||
}, function(err) {console.log(err);});
|
core.status.event.ui[i] = core.saves.autosave.data;
|
||||||
|
loadSave(1, callback);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.getLocalForage("autoSave", null, function(data) {
|
||||||
|
core.saves.autosave.data = data;
|
||||||
|
core.status.event.ui[i]=data;
|
||||||
|
loadSave(i+1, callback);
|
||||||
|
}, function(err) {console.log(err);});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.getLocalForage("save"+(5*page+i), null, function(data) {
|
||||||
|
core.status.event.ui[i]=data;
|
||||||
|
loadSave(i+1, callback);
|
||||||
|
}, function(err) {console.log(err);});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawAll() {
|
function drawAll() {
|
||||||
@ -2791,7 +2817,7 @@ ui.prototype.drawPaint = function () {
|
|||||||
core.setLineWidth('paint', 3);
|
core.setLineWidth('paint', 3);
|
||||||
core.setStrokeStyle('paint', '#FF0000');
|
core.setStrokeStyle('paint', '#FF0000');
|
||||||
|
|
||||||
core.statusBar.image.shop.style.opacity = 0;
|
core.statusBar.image.keyboard.style.opacity = 0;
|
||||||
|
|
||||||
core.statusBar.image.book.src = core.statusBar.icons.paint.src;
|
core.statusBar.image.book.src = core.statusBar.icons.paint.src;
|
||||||
core.statusBar.image.fly.src = core.statusBar.icons.erase.src;
|
core.statusBar.image.fly.src = core.statusBar.icons.erase.src;
|
||||||
|
|||||||
@ -62,10 +62,8 @@ utils.prototype.calValue = function (value, prefix, need, times) {
|
|||||||
}
|
}
|
||||||
value=value.replace(/status:([\w\d_]+)/g, "core.getStatus('$1')");
|
value=value.replace(/status:([\w\d_]+)/g, "core.getStatus('$1')");
|
||||||
value=value.replace(/item:([\w\d_]+)/g, "core.itemCount('$1')");
|
value=value.replace(/item:([\w\d_]+)/g, "core.itemCount('$1')");
|
||||||
value=value.replace(/flag:([\w\d_]+)/g, function (word, value) {
|
value=value.replace(/flag:([\w\d_]+)/g, "core.getFlag('$1', 0)");
|
||||||
if (/^__[A-Z]__$/.test(value)) value = (prefix||"")+value;
|
value=value.replace(/switch:([\w\d_]+)/g, "core.getFlag('"+(prefix||"global")+"@$1', 0)");
|
||||||
return core.getFlag(value, 0);
|
|
||||||
});
|
|
||||||
return eval(value);
|
return eval(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,6 +111,11 @@ utils.prototype.unshift = function (a,b) {
|
|||||||
////// 设置本地存储 //////
|
////// 设置本地存储 //////
|
||||||
utils.prototype.setLocalStorage = function(key, value) {
|
utils.prototype.setLocalStorage = function(key, value) {
|
||||||
try {
|
try {
|
||||||
|
if (!core.isset(value)) {
|
||||||
|
this.removeLocalStorage(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var str = JSON.stringify(value);
|
var str = JSON.stringify(value);
|
||||||
var compressed = LZString.compress(str);
|
var compressed = LZString.compress(str);
|
||||||
|
|
||||||
@ -126,6 +129,10 @@ utils.prototype.setLocalStorage = function(key, value) {
|
|||||||
localStorage.setItem(core.firstData.name + "_" + key, str);
|
localStorage.setItem(core.firstData.name + "_" + key, str);
|
||||||
}
|
}
|
||||||
localStorage.removeItem("__tmp__");
|
localStorage.removeItem("__tmp__");
|
||||||
|
|
||||||
|
if (key == 'autoSave') core.saves.ids[0] = true;
|
||||||
|
else if (/^save\d+$/.test(key)) core.saves.ids[parseInt(key.substring(4))] = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
@ -144,7 +151,9 @@ utils.prototype.getLocalStorage = function(key, defaultValue) {
|
|||||||
try {
|
try {
|
||||||
return JSON.parse(output);
|
return JSON.parse(output);
|
||||||
}
|
}
|
||||||
catch (ee) {}
|
catch (ee) {
|
||||||
|
// Ignore, use default value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return JSON.parse(value);
|
return JSON.parse(value);
|
||||||
}
|
}
|
||||||
@ -159,6 +168,8 @@ utils.prototype.getLocalStorage = function(key, defaultValue) {
|
|||||||
////// 移除本地存储 //////
|
////// 移除本地存储 //////
|
||||||
utils.prototype.removeLocalStorage = function (key) {
|
utils.prototype.removeLocalStorage = function (key) {
|
||||||
localStorage.removeItem(core.firstData.name+"_"+key);
|
localStorage.removeItem(core.firstData.name+"_"+key);
|
||||||
|
if (key == 'autoSave') delete core.saves.ids[0];
|
||||||
|
else if (/^save\d+$/.test(key)) delete core.saves.ids[parseInt(key.substring(4))];
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.prototype.setLocalForage = function (key, value, successCallback, errorCallback) {
|
utils.prototype.setLocalForage = function (key, value, successCallback, errorCallback) {
|
||||||
@ -173,13 +184,22 @@ utils.prototype.setLocalForage = function (key, value, successCallback, errorCal
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!core.isset(value)) {
|
||||||
|
this.removeLocalForage(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Save to localforage
|
// Save to localforage
|
||||||
var compressed = LZString.compress(JSON.stringify(value));
|
var compressed = LZString.compress(JSON.stringify(value));
|
||||||
localforage.setItem(core.firstData.name+"_"+key, compressed, function (err) {
|
localforage.setItem(core.firstData.name+"_"+key, compressed, function (err) {
|
||||||
if (core.isset(err)) {
|
if (core.isset(err)) {
|
||||||
if (core.isset(errorCallback)) errorCallback(err);
|
if (core.isset(errorCallback)) errorCallback(err);
|
||||||
}
|
}
|
||||||
else if (core.isset(successCallback)) successCallback();
|
else {
|
||||||
|
if (key == 'autoSave') core.saves.ids[0] = true;
|
||||||
|
else if (/^save\d+$/.test(key)) core.saves.ids[parseInt(key.substring(4))] = true;
|
||||||
|
if (core.isset(successCallback)) successCallback();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +250,11 @@ utils.prototype.removeLocalForage = function (key, successCallback, errorCallbac
|
|||||||
if (core.isset(err)) {
|
if (core.isset(err)) {
|
||||||
if (core.isset(errorCallback)) errorCallback(err);
|
if (core.isset(errorCallback)) errorCallback(err);
|
||||||
}
|
}
|
||||||
else if (core.isset(successCallback)) successCallback();
|
else {
|
||||||
|
if (key == 'autoSave') delete core.saves.ids[0];
|
||||||
|
else if (/^save\d+$/.test(key)) delete core.saves.ids[parseInt(key.substring(4))];
|
||||||
|
if (core.isset(successCallback)) successCallback();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,6 +520,11 @@ utils.prototype.clamp = function (x, a, b) {
|
|||||||
return Math.min(Math.max(x||0, min), max);
|
return Math.min(Math.max(x||0, min), max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
utils.prototype.getCookie = function (name) {
|
||||||
|
var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
|
||||||
|
return match?match[2]:null;
|
||||||
|
}
|
||||||
|
|
||||||
////// Base64加密 //////
|
////// Base64加密 //////
|
||||||
utils.prototype.encodeBase64 = function (str) {
|
utils.prototype.encodeBase64 = function (str) {
|
||||||
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
|
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
|
||||||
@ -560,7 +589,7 @@ utils.prototype.rand2 = function (num) {
|
|||||||
num = num||2147483648;
|
num = num||2147483648;
|
||||||
|
|
||||||
var value;
|
var value;
|
||||||
if (core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
var action = core.status.replay.toReplay.shift();
|
var action = core.status.replay.toReplay.shift();
|
||||||
if (action.indexOf("random:")==0 ) {
|
if (action.indexOf("random:")==0 ) {
|
||||||
value=parseInt(action.substring(7));
|
value=parseInt(action.substring(7));
|
||||||
|
|||||||
68
main.js
68
main.js
@ -2,7 +2,7 @@ function main() {
|
|||||||
|
|
||||||
//------------------------ 用户修改内容 ------------------------//
|
//------------------------ 用户修改内容 ------------------------//
|
||||||
|
|
||||||
this.version = "2.5.3"; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。
|
this.version = "2.5.4"; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。
|
||||||
|
|
||||||
this.useCompress = false; // 是否使用压缩文件
|
this.useCompress = false; // 是否使用压缩文件
|
||||||
// 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。
|
// 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。
|
||||||
@ -99,7 +99,7 @@ function main() {
|
|||||||
'book': document.getElementById("img-book"),
|
'book': document.getElementById("img-book"),
|
||||||
'fly': document.getElementById("img-fly"),
|
'fly': document.getElementById("img-fly"),
|
||||||
'toolbox': document.getElementById("img-toolbox"),
|
'toolbox': document.getElementById("img-toolbox"),
|
||||||
'shop': document.getElementById("img-shop"),
|
'keyboard': document.getElementById("img-keyboard"),
|
||||||
'save': document.getElementById("img-save"),
|
'save': document.getElementById("img-save"),
|
||||||
'load': document.getElementById("img-load"),
|
'load': document.getElementById("img-load"),
|
||||||
'settings': document.getElementById("img-settings"),
|
'settings': document.getElementById("img-settings"),
|
||||||
@ -126,7 +126,7 @@ function main() {
|
|||||||
'book': 10,
|
'book': 10,
|
||||||
'fly': 11,
|
'fly': 11,
|
||||||
'toolbox': 12,
|
'toolbox': 12,
|
||||||
'shop': 13,
|
'keyboard': 13,
|
||||||
'save': 14,
|
'save': 14,
|
||||||
'load': 15,
|
'load': 15,
|
||||||
'settings': 16,
|
'settings': 16,
|
||||||
@ -177,6 +177,9 @@ function main() {
|
|||||||
}
|
}
|
||||||
this.floors = {}
|
this.floors = {}
|
||||||
this.canvas = {};
|
this.canvas = {};
|
||||||
|
|
||||||
|
this.__VERSION__ = "2.5.4";
|
||||||
|
this.__VERSION_CODE__ = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
main.prototype.init = function (mode, callback) {
|
main.prototype.init = function (mode, callback) {
|
||||||
@ -313,23 +316,23 @@ main.prototype.listen = function () {
|
|||||||
window.onresize = function () {
|
window.onresize = function () {
|
||||||
try {
|
try {
|
||||||
main.core.resize(main.dom.body.clientWidth, main.dom.body.clientHeight);
|
main.core.resize(main.dom.body.clientWidth, main.dom.body.clientHeight);
|
||||||
}catch (e) {}
|
}catch (e) { console.log(e); }
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 在界面上按下某按键时 //////
|
////// 在界面上按下某按键时 //////
|
||||||
main.dom.body.onkeydown = function(e) {
|
main.dom.body.onkeydown = function(e) {
|
||||||
try {
|
try {
|
||||||
if (main.core.isPlaying() || main.core.status.lockControl)
|
if (main.core && (main.core.isPlaying() || main.core.status.lockControl))
|
||||||
main.core.onkeyDown(e);
|
main.core.onkeyDown(e);
|
||||||
} catch (ee) {}
|
} catch (ee) { console.log(ee); }
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 在界面上放开某按键时 //////
|
////// 在界面上放开某按键时 //////
|
||||||
main.dom.body.onkeyup = function(e) {
|
main.dom.body.onkeyup = function(e) {
|
||||||
try {
|
try {
|
||||||
if (main.core.isPlaying() || main.core.status.lockControl)
|
if (main.core && (main.core.isPlaying() || main.core.status.lockControl))
|
||||||
main.core.onkeyUp(e);
|
main.core.onkeyUp(e);
|
||||||
} catch (ee) {}
|
} catch (ee) { console.log(ee); }
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 开始选择时 //////
|
////// 开始选择时 //////
|
||||||
@ -344,7 +347,7 @@ main.dom.data.onmousedown = function (e) {
|
|||||||
var loc = main.core.getClickLoc(e.clientX, e.clientY);
|
var loc = main.core.getClickLoc(e.clientX, e.clientY);
|
||||||
if (loc == null) return;
|
if (loc == null) return;
|
||||||
main.core.ondown(loc);
|
main.core.ondown(loc);
|
||||||
} catch (ee) {}
|
} catch (ee) { console.log(ee); }
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 鼠标移动时 //////
|
////// 鼠标移动时 //////
|
||||||
@ -354,14 +357,14 @@ main.dom.data.onmousemove = function (e) {
|
|||||||
var loc = main.core.getClickLoc(e.clientX, e.clientY);
|
var loc = main.core.getClickLoc(e.clientX, e.clientY);
|
||||||
if (loc == null) return;
|
if (loc == null) return;
|
||||||
main.core.onmove(loc);
|
main.core.onmove(loc);
|
||||||
}catch (ee) {}
|
}catch (ee) { console.log(ee); }
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 鼠标放开时 //////
|
////// 鼠标放开时 //////
|
||||||
main.dom.data.onmouseup = function () {
|
main.dom.data.onmouseup = function () {
|
||||||
try {
|
try {
|
||||||
main.core.onup();
|
main.core.onup();
|
||||||
}catch (e) {}
|
}catch (e) { console.log(e); }
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 鼠标滑轮滚动时 //////
|
////// 鼠标滑轮滚动时 //////
|
||||||
@ -371,7 +374,7 @@ main.dom.data.onmousewheel = function(e) {
|
|||||||
main.core.onmousewheel(Math.sign(e.wheelDelta))
|
main.core.onmousewheel(Math.sign(e.wheelDelta))
|
||||||
else if (e.detail)
|
else if (e.detail)
|
||||||
main.core.onmousewheel(Math.sign(e.detail));
|
main.core.onmousewheel(Math.sign(e.detail));
|
||||||
} catch (ee) {}
|
} catch (ee) { console.log(ee); }
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 手指在触摸屏开始触摸时 //////
|
////// 手指在触摸屏开始触摸时 //////
|
||||||
@ -381,7 +384,7 @@ main.dom.data.ontouchstart = function (e) {
|
|||||||
var loc = main.core.getClickLoc(e.targetTouches[0].clientX, e.targetTouches[0].clientY);
|
var loc = main.core.getClickLoc(e.targetTouches[0].clientX, e.targetTouches[0].clientY);
|
||||||
if (loc == null) return;
|
if (loc == null) return;
|
||||||
main.core.ondown(loc);
|
main.core.ondown(loc);
|
||||||
}catch (ee) {}
|
}catch (ee) { console.log(ee); }
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 手指在触摸屏上移动时 //////
|
////// 手指在触摸屏上移动时 //////
|
||||||
@ -391,7 +394,7 @@ main.dom.data.ontouchmove = function (e) {
|
|||||||
var loc = main.core.getClickLoc(e.targetTouches[0].clientX, e.targetTouches[0].clientY);
|
var loc = main.core.getClickLoc(e.targetTouches[0].clientX, e.targetTouches[0].clientY);
|
||||||
if (loc == null) return;
|
if (loc == null) return;
|
||||||
main.core.onmove(loc);
|
main.core.onmove(loc);
|
||||||
}catch (ee) {}
|
}catch (ee) { console.log(ee); }
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 手指离开触摸屏时 //////
|
////// 手指离开触摸屏时 //////
|
||||||
@ -400,6 +403,7 @@ main.dom.data.ontouchend = function (e) {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
main.core.onup();
|
main.core.onup();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,7 +411,7 @@ main.dom.data.ontouchend = function (e) {
|
|||||||
main.statusBar.image.book.onclick = function (e) {
|
main.statusBar.image.book.onclick = function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.triggerReplay();
|
core.triggerReplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -426,7 +430,7 @@ main.statusBar.image.fly.onclick = function (e) {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
// 播放录像时
|
// 播放录像时
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.stopReplay();
|
core.stopReplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -451,7 +455,7 @@ main.statusBar.image.fly.onclick = function (e) {
|
|||||||
main.statusBar.image.toolbox.onclick = function (e) {
|
main.statusBar.image.toolbox.onclick = function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.rewindReplay();
|
core.rewindReplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -470,7 +474,7 @@ main.statusBar.image.toolbox.onclick = function (e) {
|
|||||||
main.statusBar.image.toolbox.ondblclick = function (e) {
|
main.statusBar.image.toolbox.ondblclick = function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.rewindReplay();
|
core.rewindReplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -480,24 +484,24 @@ main.statusBar.image.toolbox.ondblclick = function (e) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 点击状态栏中的快捷商店时 //////
|
////// 点击状态栏中的虚拟键盘时 //////
|
||||||
main.statusBar.image.shop.onclick = function (e) {
|
main.statusBar.image.keyboard.onclick = function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.bookReplay();
|
core.bookReplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (main.core.isPlaying())
|
if (main.core.isPlaying())
|
||||||
main.core.openQuickShop(true);
|
main.core.openKeyBoard(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 点击状态栏中的存档按钮时 //////
|
////// 点击状态栏中的存档按钮时 //////
|
||||||
main.statusBar.image.save.onclick = function (e) {
|
main.statusBar.image.save.onclick = function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.speedDownReplay();
|
core.speedDownReplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -515,7 +519,7 @@ main.statusBar.image.save.onclick = function (e) {
|
|||||||
main.statusBar.image.load.onclick = function (e) {
|
main.statusBar.image.load.onclick = function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.speedUpReplay();
|
core.speedUpReplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -533,7 +537,7 @@ main.statusBar.image.load.onclick = function (e) {
|
|||||||
main.statusBar.image.settings.onclick = function (e) {
|
main.statusBar.image.settings.onclick = function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
if (core.isReplaying()) {
|
||||||
core.saveReplay();
|
core.saveReplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -549,7 +553,7 @@ main.statusBar.image.settings.onclick = function (e) {
|
|||||||
|
|
||||||
////// 点击工具栏时 //////
|
////// 点击工具栏时 //////
|
||||||
main.dom.toolBar.onclick = function () {
|
main.dom.toolBar.onclick = function () {
|
||||||
if (core.isset(core.status.replay) && core.status.replay.replaying)
|
if (core.isReplaying())
|
||||||
return;
|
return;
|
||||||
main.core.control.setToolbarButton(!core.domStyle.toolbarBtn);
|
main.core.control.setToolbarButton(!core.domStyle.toolbarBtn);
|
||||||
}
|
}
|
||||||
@ -615,6 +619,18 @@ main.dom.replayGame.onclick = function () {
|
|||||||
main.core.chooseReplayFile();
|
main.core.chooseReplayFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main.dom.musicBtn.onclick = function () {
|
||||||
|
try {
|
||||||
|
if (main.core)
|
||||||
|
main.core.triggerBgm();
|
||||||
|
} catch (e) {console.log(e);}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onblur = function () {
|
||||||
|
if (main.core && main.core.control) {
|
||||||
|
main.core.control.checkAutosave();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}//listen end
|
}//listen end
|
||||||
|
|
||||||
|
|||||||
184
project/data.js
184
project/data.js
@ -57,6 +57,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"武器",
|
"武器",
|
||||||
"盾牌"
|
"盾牌"
|
||||||
],
|
],
|
||||||
|
"startBgm": "bgm.mp3",
|
||||||
"statusLeftBackground": "url(project/images/ground.png) repeat",
|
"statusLeftBackground": "url(project/images/ground.png) repeat",
|
||||||
"statusTopBackground": "url(project/images/ground.png) repeat",
|
"statusTopBackground": "url(project/images/ground.png) repeat",
|
||||||
"toolsBackground": "url(project/images/ground.png) repeat",
|
"toolsBackground": "url(project/images/ground.png) repeat",
|
||||||
@ -70,7 +71,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"firstData": {
|
"firstData": {
|
||||||
"title": "魔塔样板",
|
"title": "魔塔样板",
|
||||||
"name": "template",
|
"name": "template",
|
||||||
"version": "Ver 2.5.3",
|
"version": "Ver 2.5.4",
|
||||||
"floorId": "sample0",
|
"floorId": "sample0",
|
||||||
"hero": {
|
"hero": {
|
||||||
"name": "阳光",
|
"name": "阳光",
|
||||||
@ -108,6 +109,10 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"type": "comment",
|
"type": "comment",
|
||||||
"text": "在这里可以用事件来自定义绘制标题界面的背景图等"
|
"text": "在这里可以用事件来自定义绘制标题界面的背景图等"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "comment",
|
||||||
|
"text": "也可以直接切换到其他楼层(比如某个开始剧情楼层)进行操作。"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "showImage",
|
"type": "showImage",
|
||||||
"code": 1,
|
"code": 1,
|
||||||
@ -122,111 +127,108 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"time": 0
|
"time": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "comment",
|
"type": "while",
|
||||||
"text": "给用户提供选择项,这里简单的使用了choices事件"
|
"condition": "1",
|
||||||
},
|
"data": [
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"text": "也可以贴按钮图然后使用循环处理+等待操作来完成"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "choices",
|
|
||||||
"choices": [
|
|
||||||
{
|
{
|
||||||
"text": "开始游戏",
|
"type": "comment",
|
||||||
"action": [
|
"text": "给用户提供选择项,这里简单的使用了choices事件"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "comment",
|
||||||
|
"text": "也可以贴按钮图然后使用等待操作来完成"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "choices",
|
||||||
|
"choices": [
|
||||||
{
|
{
|
||||||
"type": "comment",
|
"text": "开始游戏",
|
||||||
"text": "检查bgm状态,下同"
|
"action": [
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "function",
|
|
||||||
"function": "function(){\ncore.control.checkBgm()\n}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "if",
|
|
||||||
"condition": "core.flags.startDirectly",
|
|
||||||
"true": [
|
|
||||||
{
|
{
|
||||||
"type": "comment",
|
"type": "comment",
|
||||||
"text": "直接开始游戏,设置初始化数据"
|
"text": "检查bgm状态,下同"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "function",
|
"type": "function",
|
||||||
"function": "function(){\ncore.events.setInitData('')\n}"
|
"function": "function(){\ncore.control.checkBgm()\n}"
|
||||||
}
|
|
||||||
],
|
|
||||||
"false": [
|
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"text": "动态生成难度选择项"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "function",
|
"type": "if",
|
||||||
"function": "function(){\nvar choices = [];\nmain.levelChoose.forEach(function (one) {\n\tchoices.push({\"text\": one[0], \"action\": [\n\t\t{\"type\": \"function\", \"function\": \"function() { core.status.hard = '\"+one[1]+\"'; core.events.setInitData('\"+one[1]+\"'); }\"}\n\t]});\n})\ncore.insertAction({\"type\": \"choices\", \"choices\": choices});\n}"
|
"condition": "core.flags.startDirectly",
|
||||||
|
"true": [
|
||||||
|
{
|
||||||
|
"type": "comment",
|
||||||
|
"text": "直接开始游戏,设置初始化数据"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "function",
|
||||||
|
"function": "function(){\ncore.events.setInitData('')\n}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"false": [
|
||||||
|
{
|
||||||
|
"type": "comment",
|
||||||
|
"text": "动态生成难度选择项"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "function",
|
||||||
|
"function": "function(){\nvar choices = [];\nmain.levelChoose.forEach(function (one) {\n\tchoices.push({\"text\": one[0], \"action\": [\n\t\t{\"type\": \"function\", \"function\": \"function() { core.status.hard = '\"+one[1]+\"'; core.events.setInitData('\"+one[1]+\"'); }\"}\n\t]});\n})\ncore.insertAction({\"type\": \"choices\", \"choices\": choices});\n}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "hideImage",
|
||||||
|
"code": 1,
|
||||||
|
"time": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "comment",
|
||||||
|
"text": "成功选择难度"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "break"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "hideImage",
|
"text": "读取存档",
|
||||||
"code": 1,
|
"action": [
|
||||||
"time": 0
|
{
|
||||||
|
"type": "function",
|
||||||
|
"function": "function(){\ncore.control.checkBgm()\n}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "comment",
|
||||||
|
"text": "简单的使用“呼出读档界面”来处理"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "callLoad"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "comment",
|
"text": "回放录像",
|
||||||
"text": "成功选择难度"
|
"action": [
|
||||||
}
|
{
|
||||||
]
|
"type": "function",
|
||||||
},
|
"function": "function(){\ncore.control.checkBgm()\n}"
|
||||||
{
|
},
|
||||||
"text": "读取存档",
|
{
|
||||||
"action": [
|
"type": "comment",
|
||||||
{
|
"text": "这段代码会弹框选择录像文件"
|
||||||
"type": "function",
|
},
|
||||||
"function": "function(){\ncore.control.checkBgm()\n}"
|
{
|
||||||
},
|
"type": "if",
|
||||||
{
|
"condition": "!core.isReplaying()",
|
||||||
"type": "hideImage",
|
"true": [
|
||||||
"code": 1,
|
{
|
||||||
"time": 0
|
"type": "function",
|
||||||
},
|
"function": "function(){\ncore.chooseReplayFile()\n}"
|
||||||
{
|
}
|
||||||
"type": "comment",
|
],
|
||||||
"text": "这段代码会结束事件,打开读档页面,读取存档或重新开始"
|
"false": []
|
||||||
},
|
}
|
||||||
{
|
]
|
||||||
"type": "function",
|
|
||||||
"function": "function(){\ncore.insertAction([{\"type\": \"exit\"}], null, null, function() {\n\tcore.status.played = false;\n\tcore.load();\n})\n}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"text": "不管读档有没有成功,都会重新开始,这个地方不会被执行到"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "回放录像",
|
|
||||||
"action": [
|
|
||||||
{
|
|
||||||
"type": "function",
|
|
||||||
"function": "function(){\ncore.control.checkBgm()\n}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "hideImage",
|
|
||||||
"code": 1,
|
|
||||||
"time": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"text": "这段代码会结束事件,选择录像文件,播放录像或重新开始"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "function",
|
|
||||||
"function": "function(){\ncore.insertAction([{\"type\": \"exit\"}], null, null, function() {\n\tcore.restart();\n\tcore.chooseReplayFile();\n})\n}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"text": "不管录像有没有成功,都会重新开始,这个地方不会被执行到"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,35 +1,41 @@
|
|||||||
main.floors.MT0=
|
main.floors.MT0=
|
||||||
{
|
{
|
||||||
"floorId": "MT0",
|
"floorId": "MT0",
|
||||||
"title": "主塔 0 层",
|
"title": "主塔 0 层",
|
||||||
"name": "0",
|
"name": "0",
|
||||||
"canFlyTo": true,
|
"canFlyTo": true,
|
||||||
"canUseQuickShop": true,
|
"canUseQuickShop": true,
|
||||||
"cannotViewMap": false,
|
"cannotViewMap": false,
|
||||||
"defaultGround": "ground",
|
"defaultGround": "ground",
|
||||||
"images": [],
|
"images": [],
|
||||||
"item_ratio": 1,
|
"item_ratio": 1,
|
||||||
"map": [
|
"map": [
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||||
],
|
],
|
||||||
"firstArrive": [],
|
"firstArrive": [],
|
||||||
"parallelDo": "",
|
"parallelDo": "",
|
||||||
"events": {},
|
"events": {},
|
||||||
"changeFloor": {},
|
"changeFloor": {},
|
||||||
"afterBattle": {},
|
"afterBattle": {},
|
||||||
"afterGetItem": {},
|
"afterGetItem": {},
|
||||||
"afterOpenDoor": {},
|
"afterOpenDoor": {},
|
||||||
"cannotMove": {},
|
"cannotMove": {},
|
||||||
|
"bgmap": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"fgmap": [
|
||||||
|
|
||||||
|
],
|
||||||
}
|
}
|
||||||
@ -8,7 +8,7 @@ main.floors.sample0=
|
|||||||
"defaultGround": "ground",
|
"defaultGround": "ground",
|
||||||
"images": [],
|
"images": [],
|
||||||
"bgm": "bgm.mp3",
|
"bgm": "bgm.mp3",
|
||||||
"item_ratio": 2,
|
"item_ratio": 1,
|
||||||
"map": [
|
"map": [
|
||||||
[ 0, 0,220, 0, 0, 20, 87, 3, 65, 64, 44, 43, 42],
|
[ 0, 0,220, 0, 0, 20, 87, 3, 65, 64, 44, 43, 42],
|
||||||
[ 0,246, 0,246, 0, 20, 0, 3, 58, 59, 60, 61, 41],
|
[ 0,246, 0,246, 0, 20, 0, 3, 58, 59, 60, 61, 41],
|
||||||
|
|||||||
@ -772,4 +772,10 @@ main.floors.sample1=
|
|||||||
"afterGetItem": {},
|
"afterGetItem": {},
|
||||||
"afterOpenDoor": {},
|
"afterOpenDoor": {},
|
||||||
"cannotMove": {},
|
"cannotMove": {},
|
||||||
|
"bgmap": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"fgmap": [
|
||||||
|
|
||||||
|
],
|
||||||
}
|
}
|
||||||
@ -10,41 +10,63 @@ main.floors.sample2=
|
|||||||
"images": [],
|
"images": [],
|
||||||
"item_ratio": 1,
|
"item_ratio": 1,
|
||||||
"map": [
|
"map": [
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1,121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,202, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,202, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 1, 1, 45, 0, 1, 0,202,202, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0,202,202, 0],
|
[ 0, 0, 0, 0, 1, 1, 45, 0, 1, 0,202,202, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0,202,202, 0],
|
||||||
[ 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0],
|
[ 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 88, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 88, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0,122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,202, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,202, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 1, 1, 0, 0, 1, 0,202,202, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0,202,202, 0],
|
[ 0, 0, 0, 0, 1, 1, 0, 0, 1, 0,202,202, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0,202,202, 0],
|
||||||
[ 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0],
|
[ 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0],
|
[ 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0],
|
||||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||||
],
|
],
|
||||||
"width":26,
|
"width": 26,
|
||||||
"height":26,
|
"height": 26,
|
||||||
"firstArrive": [],
|
"firstArrive": [],
|
||||||
"events": {"3,2":["123"],"12,12":["234"]},
|
"events": {
|
||||||
"changeFloor": {"6,10": {"floorId": "sample1", "stair": "upFloor"}, "7,12": {"floorId": "sample3", "stair": "downFloor"}},
|
"3,2": [
|
||||||
|
"123"
|
||||||
|
],
|
||||||
|
"12,12": [
|
||||||
|
"234"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"changeFloor": {
|
||||||
|
"6,10": {
|
||||||
|
"floorId": "sample1",
|
||||||
|
"stair": "upFloor"
|
||||||
|
},
|
||||||
|
"7,12": {
|
||||||
|
"floorId": "sample3",
|
||||||
|
"stair": "downFloor"
|
||||||
|
}
|
||||||
|
},
|
||||||
"afterBattle": {},
|
"afterBattle": {},
|
||||||
"afterGetItem": {},
|
"afterGetItem": {},
|
||||||
"afterOpenDoor": {},
|
"afterOpenDoor": {},
|
||||||
"cannotMove": {},
|
"cannotMove": {},
|
||||||
"upFloor": null,
|
"upFloor": null,
|
||||||
|
"bgmap": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"fgmap": [
|
||||||
|
|
||||||
|
],
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -55,7 +55,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
"win": function(reason, norank) {
|
"win": function(reason, norank) {
|
||||||
// 游戏获胜事件
|
// 游戏获胜事件
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
var replaying = core.status.replay.replaying;
|
var replaying = core.isReplaying();
|
||||||
core.stopReplay();
|
core.stopReplay();
|
||||||
core.waitHeroToStop(function() {
|
core.waitHeroToStop(function() {
|
||||||
core.clearMap('all'); // 清空全地图
|
core.clearMap('all'); // 清空全地图
|
||||||
@ -75,7 +75,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
"lose": function(reason) {
|
"lose": function(reason) {
|
||||||
// 游戏失败事件
|
// 游戏失败事件
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
var replaying = core.status.replay.replaying;
|
var replaying = core.isReplaying();
|
||||||
core.stopReplay();
|
core.stopReplay();
|
||||||
core.waitHeroToStop(function() {
|
core.waitHeroToStop(function() {
|
||||||
core.drawText([
|
core.drawText([
|
||||||
@ -109,6 +109,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
}
|
}
|
||||||
// 设置勇士的位置
|
// 设置勇士的位置
|
||||||
core.status.hero.loc = heroLoc;
|
core.status.hero.loc = heroLoc;
|
||||||
|
core.control.gatherFollowers();
|
||||||
|
|
||||||
// ---------- 重绘新地图;这一步将会设置core.status.floorId ---------- //
|
// ---------- 重绘新地图;这一步将会设置core.status.floorId ---------- //
|
||||||
core.drawMap(floorId);
|
core.drawMap(floorId);
|
||||||
@ -123,9 +124,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
var color = core.getFlag('__color__', null);
|
var color = core.getFlag('__color__', null);
|
||||||
if (!core.isset(color) && core.isset(core.status.maps[floorId].color))
|
if (!core.isset(color) && core.isset(core.status.maps[floorId].color))
|
||||||
color = core.status.maps[floorId].color;
|
color = core.status.maps[floorId].color;
|
||||||
|
core.clearMap('curtain');
|
||||||
|
core.status.curtainColor = color;
|
||||||
if (core.isset(color)) {
|
if (core.isset(color)) {
|
||||||
core.fillRect('curtain',0,0,416,416,core.arrayToRGBA(color));
|
core.fillRect('curtain',0,0,416,416,core.arrayToRGBA(color));
|
||||||
core.status.curtainColor = color;
|
|
||||||
}
|
}
|
||||||
// 更改天气
|
// 更改天气
|
||||||
var weather = core.getFlag('__weather__', null);
|
var weather = core.getFlag('__weather__', null);
|
||||||
@ -142,17 +144,22 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
// 转换楼层结束的事件;此函数会在整个楼层切换完全结束后再执行
|
// 转换楼层结束的事件;此函数会在整个楼层切换完全结束后再执行
|
||||||
// floorId是切换到的楼层;fromLoad若为true则代表是从读档行为造成的楼层切换
|
// floorId是切换到的楼层;fromLoad若为true则代表是从读档行为造成的楼层切换
|
||||||
|
|
||||||
// 每次抵达楼层时执行的事件
|
// 如果是读档,则进行检查
|
||||||
if (!fromLoad || core.hasFlag("forceSave")) {
|
if (fromLoad) {
|
||||||
core.insertAction(core.floors[floorId].eachArrive);
|
core.events.recoverEvents(core.getFlag("__events__"));
|
||||||
|
core.removeFlag("__events__");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// 每次抵达楼层执行的事件
|
||||||
|
core.insertAction(core.floors[floorId].eachArrive);
|
||||||
|
|
||||||
// 首次抵达楼层时执行的事件(后插入,先执行)
|
// 首次抵达楼层时执行的事件(后插入,先执行)
|
||||||
var visited = core.getFlag("__visited__", []);
|
var visited = core.getFlag("__visited__", []);
|
||||||
if (visited.indexOf(floorId)===-1) {
|
if (visited.indexOf(floorId)===-1) {
|
||||||
core.insertAction(core.floors[floorId].firstArrive);
|
core.insertAction(core.floors[floorId].firstArrive);
|
||||||
visited.push(floorId);
|
visited.push(floorId);
|
||||||
core.setFlag("__visited__", visited);
|
core.setFlag("__visited__", visited);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"addPoint": function (enemy) {
|
"addPoint": function (enemy) {
|
||||||
@ -1184,7 +1191,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
core.setTextAlign('ui', 'left');
|
core.setTextAlign('ui', 'left');
|
||||||
var globalFont = (core.status.globalAttribute||core.initStatus.globalAttribute).font;
|
var globalFont = (core.status.globalAttribute||core.initStatus.globalAttribute).font;
|
||||||
core.fillText('ui', "HTML5 魔塔样板", text_start, top+35, "#FFD700", "bold 22px "+globalFont);
|
core.fillText('ui', "HTML5 魔塔样板", text_start, top+35, "#FFD700", "bold 22px "+globalFont);
|
||||||
core.fillText('ui', "版本: "+core.firstData.version, text_start, top + 80, "#FFFFFF", "bold 17px "+globalFont);
|
core.fillText('ui', "版本: "+main.__VERSION__, text_start, top + 80, "#FFFFFF", "bold 17px "+globalFont);
|
||||||
core.fillText('ui', "作者: 艾之葵", text_start, top + 112);
|
core.fillText('ui', "作者: 艾之葵", text_start, top + 112);
|
||||||
core.fillText('ui', 'HTML5魔塔交流群:539113091', text_start, top+112+32);
|
core.fillText('ui', 'HTML5魔塔交流群:539113091', text_start, top+112+32);
|
||||||
// TODO: 写自己的“关于”页面,每次增加32像素即可
|
// TODO: 写自己的“关于”页面,每次增加32像素即可
|
||||||
@ -1231,7 +1238,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
console.log("插件编写测试");
|
console.log("插件编写测试");
|
||||||
// 可以写一些其他的被直接执行的代码
|
// 可以写一些其他的被直接执行的代码
|
||||||
|
|
||||||
|
|
||||||
// 在这里写所有需要自定义的函数
|
// 在这里写所有需要自定义的函数
|
||||||
// 写法必须是 this.xxx = function (args) { ...
|
// 写法必须是 this.xxx = function (args) { ...
|
||||||
// 如果不写this的话,函数将无法被外部所访问
|
// 如果不写this的话,函数将无法被外部所访问
|
||||||
|
|||||||
512
project/icons.js
512
project/icons.js
@ -1,248 +1,270 @@
|
|||||||
var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
|
var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
|
||||||
{
|
{
|
||||||
'hero': {
|
"hero": {
|
||||||
'down': {'loc': 0, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3},
|
"down": {
|
||||||
'left': {'loc': 1, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3},
|
"loc": 0,
|
||||||
'right': {'loc': 2, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3},
|
"stop": 0,
|
||||||
'up': {'loc': 3, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3}
|
"leftFoot": 1,
|
||||||
},
|
"rightFoot": 3
|
||||||
'terrains': {
|
},
|
||||||
'ground': 0,
|
"left": {
|
||||||
'grass': 1,
|
"loc": 1,
|
||||||
'grass2': 2,
|
"stop": 0,
|
||||||
'yellowWall': 3,
|
"leftFoot": 1,
|
||||||
'whiteWall': 4,
|
"rightFoot": 3
|
||||||
'blueWall': 5,
|
},
|
||||||
'snowGround': 6,
|
"right": {
|
||||||
'ground2': 7,
|
"loc": 2,
|
||||||
'ground3': 8,
|
"stop": 0,
|
||||||
'ground4': 9,
|
"leftFoot": 1,
|
||||||
'sand': 10,
|
"rightFoot": 3
|
||||||
'ground5': 11,
|
},
|
||||||
'yellowWall2': 12,
|
"up": {
|
||||||
'whiteWall2': 13,
|
"loc": 3,
|
||||||
'blueWall2': 14,
|
"stop": 0,
|
||||||
'blockWall': 15,
|
"leftFoot": 1,
|
||||||
'grayWall': 16,
|
"rightFoot": 3
|
||||||
'white': 17,
|
},
|
||||||
'ground6': 18,
|
"height": 48
|
||||||
'soil': 19,
|
},
|
||||||
'ground7': 20,
|
"terrains": {
|
||||||
'ground8': 21,
|
"ground": 0,
|
||||||
'ice': 22,
|
"grass": 1,
|
||||||
'downFloor': 23,
|
"grass2": 2,
|
||||||
'upFloor': 24,
|
"yellowWall": 3,
|
||||||
'yellowDoor': 25,
|
"whiteWall": 4,
|
||||||
'blueDoor': 26,
|
"blueWall": 5,
|
||||||
'redDoor': 27,
|
"snowGround": 6,
|
||||||
'greenDoor': 28,
|
"ground2": 7,
|
||||||
'specialDoor': 29,
|
"ground3": 8,
|
||||||
'steelDoor': 30,
|
"ground4": 9,
|
||||||
'blueShop-left': 31,
|
"sand": 10,
|
||||||
'blueShop-right': 32,
|
"ground5": 11,
|
||||||
'pinkShop-left': 33,
|
"yellowWall2": 12,
|
||||||
'pinkShop-right': 34,
|
"whiteWall2": 13,
|
||||||
'arrowUp': 35,
|
"blueWall2": 14,
|
||||||
'arrowDown': 36,
|
"blockWall": 15,
|
||||||
'arrowLeft': 37,
|
"grayWall": 16,
|
||||||
'arrowRight': 38,
|
"white": 17,
|
||||||
'light': 39,
|
"ground6": 18,
|
||||||
'darkLight': 40,
|
"soil": 19,
|
||||||
'ski': 41,
|
"ground7": 20,
|
||||||
'flower': 42,
|
"ground8": 21,
|
||||||
'box': 43,
|
"ice": 22,
|
||||||
'boxed': 44
|
"downFloor": 23,
|
||||||
},
|
"upFloor": 24,
|
||||||
'animates': {
|
"yellowDoor": 25,
|
||||||
'star': 0,
|
"blueDoor": 26,
|
||||||
'lava': 1,
|
"redDoor": 27,
|
||||||
'blueWater': 2,
|
"greenDoor": 28,
|
||||||
'water': 3,
|
"specialDoor": 29,
|
||||||
'yellowDoor': 4,
|
"steelDoor": 30,
|
||||||
'blueDoor': 5,
|
"blueShop-left": 31,
|
||||||
'redDoor': 6,
|
"blueShop-right": 32,
|
||||||
'greenDoor': 7,
|
"pinkShop-left": 33,
|
||||||
'specialDoor': 8,
|
"pinkShop-right": 34,
|
||||||
'steelDoor': 9,
|
"arrowUp": 35,
|
||||||
'yellowWall': 10,
|
"arrowDown": 36,
|
||||||
'whiteWall': 11,
|
"arrowLeft": 37,
|
||||||
'blueWall': 12,
|
"arrowRight": 38,
|
||||||
'crystalUp': 13,
|
"light": 39,
|
||||||
'crystalBottom': 14,
|
"darkLight": 40,
|
||||||
'starPortal': 15,
|
"ski": 41,
|
||||||
'fire': 16,
|
"flower": 42,
|
||||||
'portal': 17,
|
"box": 43,
|
||||||
'switch': 18,
|
"boxed": 44
|
||||||
'lavaNet': 19,
|
},
|
||||||
'poisonNet': 20,
|
"animates": {
|
||||||
'weakNet': 21,
|
"star": 0,
|
||||||
'curseNet': 22,
|
"lava": 1,
|
||||||
'downPortal': 23,
|
"blueWater": 2,
|
||||||
'leftPortal': 24,
|
"water": 3,
|
||||||
'rightPortal': 25,
|
"yellowDoor": 4,
|
||||||
'upPortal': 26,
|
"blueDoor": 5,
|
||||||
},
|
"redDoor": 6,
|
||||||
'npcs': {
|
"greenDoor": 7,
|
||||||
'man': 0,
|
"specialDoor": 8,
|
||||||
'woman': 1,
|
"steelDoor": 9,
|
||||||
'thief': 2,
|
"yellowWall": 10,
|
||||||
'fairy': 3,
|
"whiteWall": 11,
|
||||||
'magician': 4,
|
"blueWall": 12,
|
||||||
'womanMagician': 5,
|
"crystalUp": 13,
|
||||||
'oldMan': 6,
|
"crystalBottom": 14,
|
||||||
'child': 7,
|
"starPortal": 15,
|
||||||
'wood': 8,
|
"fire": 16,
|
||||||
'pinkShop': 9,
|
"portal": 17,
|
||||||
'blueShop': 10,
|
"switch": 18,
|
||||||
'princess': 11,
|
"lavaNet": 19,
|
||||||
'wlt': 12,
|
"poisonNet": 20,
|
||||||
'wt': 13,
|
"weakNet": 21,
|
||||||
'wrt': 14,
|
"curseNet": 22,
|
||||||
'wl': 15,
|
"downPortal": 23,
|
||||||
'wc': 16,
|
"leftPortal": 24,
|
||||||
'wr': 17,
|
"rightPortal": 25,
|
||||||
'wlb': 18,
|
"upPortal": 26
|
||||||
'wrb': 19,
|
},
|
||||||
'dlt': 20,
|
"npcs": {
|
||||||
'dt': 21,
|
"man": 0,
|
||||||
'drt': 22,
|
"woman": 1,
|
||||||
'dl': 23,
|
"thief": 2,
|
||||||
'dc': 24,
|
"fairy": 3,
|
||||||
'dr': 25,
|
"magician": 4,
|
||||||
'dlb': 26,
|
"womanMagician": 5,
|
||||||
'drb': 27,
|
"oldMan": 6,
|
||||||
},
|
"child": 7,
|
||||||
'npc48': {
|
"wood": 8,
|
||||||
'npc0': 0,
|
"pinkShop": 9,
|
||||||
'npc1': 1,
|
"blueShop": 10,
|
||||||
'npc2': 2,
|
"princess": 11,
|
||||||
'npc3': 3,
|
"wlt": 12,
|
||||||
'npc4': 4,
|
"wt": 13,
|
||||||
},
|
"wrt": 14,
|
||||||
'enemys': {
|
"wl": 15,
|
||||||
'greenSlime': 0,
|
"wc": 16,
|
||||||
'redSlime': 1,
|
"wr": 17,
|
||||||
'blackSlime': 2,
|
"wlb": 18,
|
||||||
'slimelord': 3,
|
"wrb": 19,
|
||||||
'bat': 4,
|
"dlt": 20,
|
||||||
'bigBat': 5,
|
"dt": 21,
|
||||||
'redBat': 6,
|
"drt": 22,
|
||||||
'vampire': 7,
|
"dl": 23,
|
||||||
'skeleton': 8,
|
"dc": 24,
|
||||||
'skeletonSoilder': 9,
|
"dr": 25,
|
||||||
'skeletonCaptain': 10,
|
"dlb": 26,
|
||||||
'ghostSkeleton': 11,
|
"drb": 27
|
||||||
'zombie': 12,
|
},
|
||||||
'zombieKnight': 13,
|
"npc48": {
|
||||||
'rock': 14,
|
"npc0": 0,
|
||||||
'slimeMan': 15,
|
"npc1": 1,
|
||||||
'bluePriest': 16,
|
"npc2": 2,
|
||||||
'redPriest': 17,
|
"npc3": 3,
|
||||||
'brownWizard': 18,
|
"npc4": 4
|
||||||
'redWizard': 19,
|
},
|
||||||
'yellowGuard': 20,
|
"enemys": {
|
||||||
'blueGuard': 21,
|
"greenSlime": 0,
|
||||||
'redGuard': 22,
|
"redSlime": 1,
|
||||||
'swordsman': 23,
|
"blackSlime": 2,
|
||||||
'soldier': 24,
|
"slimelord": 3,
|
||||||
'yellowKnight': 25,
|
"bat": 4,
|
||||||
'redKnight': 26,
|
"bigBat": 5,
|
||||||
'darkKnight': 27,
|
"redBat": 6,
|
||||||
'blackKing': 28,
|
"vampire": 7,
|
||||||
'yellowKing': 29,
|
"skeleton": 8,
|
||||||
'greenKing': 30,
|
"skeletonSoilder": 9,
|
||||||
'blueKnight': 31,
|
"skeletonCaptain": 10,
|
||||||
'goldSlime': 32,
|
"ghostSkeleton": 11,
|
||||||
'poisonSkeleton': 33,
|
"zombie": 12,
|
||||||
'poisonBat': 34,
|
"zombieKnight": 13,
|
||||||
'steelRock': 35,
|
"rock": 14,
|
||||||
'skeletonPriest': 36,
|
"slimeMan": 15,
|
||||||
'skeletonKing': 37,
|
"bluePriest": 16,
|
||||||
'skeletonWizard': 38,
|
"redPriest": 17,
|
||||||
'redSkeletonCaption': 39,
|
"brownWizard": 18,
|
||||||
'badHero': 40,
|
"redWizard": 19,
|
||||||
'demon': 41,
|
"yellowGuard": 20,
|
||||||
'demonPriest': 42,
|
"blueGuard": 21,
|
||||||
'goldHornSlime': 43,
|
"redGuard": 22,
|
||||||
'redKing': 44,
|
"swordsman": 23,
|
||||||
'whiteKing': 45,
|
"soldier": 24,
|
||||||
'blackMagician': 46,
|
"yellowKnight": 25,
|
||||||
'silverSlime': 47,
|
"redKnight": 26,
|
||||||
'swordEmperor': 48,
|
"darkKnight": 27,
|
||||||
'whiteHornSlime': 49,
|
"blackKing": 28,
|
||||||
'badPrincess': 50,
|
"yellowKing": 29,
|
||||||
'badFairy': 51,
|
"greenKing": 30,
|
||||||
'grayPriest': 52,
|
"blueKnight": 31,
|
||||||
'redSwordsman': 53,
|
"goldSlime": 32,
|
||||||
'whiteGhost': 54,
|
"poisonSkeleton": 33,
|
||||||
'poisonZombie': 55,
|
"poisonBat": 34,
|
||||||
'magicDragon': 56,
|
"steelRock": 35,
|
||||||
'octopus': 57,
|
"skeletonPriest": 36,
|
||||||
'darkFairy': 58,
|
"skeletonKing": 37,
|
||||||
'greenKnight': 59,
|
"skeletonWizard": 38,
|
||||||
},
|
"redSkeletonCaption": 39,
|
||||||
'enemy48': {
|
"badHero": 40,
|
||||||
'angel': 0,
|
"demon": 41,
|
||||||
'elemental': 1,
|
"demonPriest": 42,
|
||||||
'steelGuard': 2,
|
"goldHornSlime": 43,
|
||||||
'evilBat': 3,
|
"redKing": 44,
|
||||||
},
|
"whiteKing": 45,
|
||||||
'items': {
|
"blackMagician": 46,
|
||||||
'yellowKey': 0,
|
"silverSlime": 47,
|
||||||
'blueKey': 1,
|
"swordEmperor": 48,
|
||||||
'redKey': 2,
|
"whiteHornSlime": 49,
|
||||||
'greenKey': 3,
|
"badPrincess": 50,
|
||||||
'steelKey': 4,
|
"badFairy": 51,
|
||||||
'bigKey': 6,
|
"grayPriest": 52,
|
||||||
'redJewel': 16,
|
"redSwordsman": 53,
|
||||||
'blueJewel': 17,
|
"whiteGhost": 54,
|
||||||
'greenJewel': 18,
|
"poisonZombie": 55,
|
||||||
'yellowJewel': 19,
|
"magicDragon": 56,
|
||||||
'redPotion': 20,
|
"octopus": 57,
|
||||||
'bluePotion': 21,
|
"darkFairy": 58,
|
||||||
'greenPotion': 22,
|
"greenKnight": 59
|
||||||
'yellowPotion': 23,
|
},
|
||||||
'lifeWand': 33,
|
"enemy48": {
|
||||||
"sword0": 60,
|
"angel": 0,
|
||||||
'sword1': 50,
|
"elemental": 1,
|
||||||
'sword2': 51,
|
"steelGuard": 2,
|
||||||
'sword3': 52,
|
"evilBat": 3
|
||||||
'sword4': 53,
|
},
|
||||||
'sword5': 54,
|
"items": {
|
||||||
"shield0": 61,
|
"yellowKey": 0,
|
||||||
'shield1': 55,
|
"blueKey": 1,
|
||||||
'shield2': 56,
|
"redKey": 2,
|
||||||
'shield3': 57,
|
"greenKey": 3,
|
||||||
'shield4': 58,
|
"steelKey": 4,
|
||||||
'shield5': 59,
|
"bigKey": 6,
|
||||||
'book': 9,
|
"redJewel": 16,
|
||||||
'fly': 12,
|
"blueJewel": 17,
|
||||||
'pickaxe': 45,
|
"greenJewel": 18,
|
||||||
'icePickaxe': 44,
|
"yellowJewel": 19,
|
||||||
'bomb': 43,
|
"redPotion": 20,
|
||||||
'centerFly': 13,
|
"bluePotion": 21,
|
||||||
'upFly': 15,
|
"greenPotion": 22,
|
||||||
'downFly': 14,
|
"yellowPotion": 23,
|
||||||
'coin': 11,
|
"lifeWand": 33,
|
||||||
'snow': 41,
|
"sword0": 60,
|
||||||
'cross': 40,
|
"sword1": 50,
|
||||||
'superPotion': 29,
|
"sword2": 51,
|
||||||
'earthquake': 8,
|
"sword3": 52,
|
||||||
'poisonWine': 24,
|
"sword4": 53,
|
||||||
'weakWine': 25,
|
"sword5": 54,
|
||||||
'curseWine': 27,
|
"shield0": 61,
|
||||||
'superWine': 28,
|
"shield1": 55,
|
||||||
'knife': 42,
|
"shield2": 56,
|
||||||
'moneyPocket': 46,
|
"shield3": 57,
|
||||||
'shoes': 47,
|
"shield4": 58,
|
||||||
'hammer': 48,
|
"shield5": 59,
|
||||||
'jumpShoes': 49,
|
"book": 9,
|
||||||
'skill1': 30,
|
"fly": 12,
|
||||||
},
|
"pickaxe": 45,
|
||||||
'autotile': { // 所有的Autotile列表;后面的index简单取0即可
|
"icePickaxe": 44,
|
||||||
'autotile': 0,
|
"bomb": 43,
|
||||||
'autotile1': 0,
|
"centerFly": 13,
|
||||||
'autotile2': 0,
|
"upFly": 15,
|
||||||
'autotile3': 0,
|
"downFly": 14,
|
||||||
}
|
"coin": 11,
|
||||||
|
"snow": 41,
|
||||||
|
"cross": 40,
|
||||||
|
"superPotion": 29,
|
||||||
|
"earthquake": 8,
|
||||||
|
"poisonWine": 24,
|
||||||
|
"weakWine": 25,
|
||||||
|
"curseWine": 27,
|
||||||
|
"superWine": 28,
|
||||||
|
"knife": 42,
|
||||||
|
"moneyPocket": 46,
|
||||||
|
"shoes": 47,
|
||||||
|
"hammer": 48,
|
||||||
|
"jumpShoes": 49,
|
||||||
|
"skill1": 30,
|
||||||
|
"I73": 10
|
||||||
|
},
|
||||||
|
"autotile": {
|
||||||
|
"autotile": 0,
|
||||||
|
"autotile1": 0,
|
||||||
|
"autotile2": 0,
|
||||||
|
"autotile3": 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
@ -302,6 +302,10 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
|||||||
"name": "技能:二倍斩",
|
"name": "技能:二倍斩",
|
||||||
"text": "可以打开或关闭主动技能二倍斩",
|
"text": "可以打开或关闭主动技能二倍斩",
|
||||||
"hideInReplay": true
|
"hideInReplay": true
|
||||||
|
},
|
||||||
|
"I73": {
|
||||||
|
"cls": "items",
|
||||||
|
"name": "新物品"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"itemEffect": {
|
"itemEffect": {
|
||||||
@ -385,23 +389,23 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
|||||||
},
|
},
|
||||||
"canUseItemEffect": {
|
"canUseItemEffect": {
|
||||||
"book": "true",
|
"book": "true",
|
||||||
"fly": "core.status.hero.flyRange.indexOf(core.status.floorId)>=0",
|
"fly": "(function () {\n\treturn core.status.hero.flyRange.indexOf(core.status.floorId)>=0;\n})();",
|
||||||
"pickaxe": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1 && \n\t\t(block.event.canBreak || block.event.id == 'yellowWall' || block.event.id=='whiteWall' || block.event.id=='blueWall')) { // 能破哪些墙\n\t\t// 四个方向\n\t\tif (core.flags.pickaxeFourDirections || (block.x == core.nextX() && block.y == core.nextY()))\n\t\t\tids.push(i);\n\t\telse id2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable",
|
"pickaxe": "(function() {\n\tvar ids = [], id2s = [];\n\tfor (var i in core.status.thisMap.blocks) {\n\t\tvar block = core.status.thisMap.blocks[i];\n\t\tif (core.isset(block.event) && !block.disable && core.nearHero(block.x, block.y) && \n\t\t\t(block.event.canBreak || block.event.id == 'yellowWall' || block.event.id=='whiteWall' || block.event.id=='blueWall')) { // 能破哪些墙\n\t\t\t// 四个方向\n\t\t\tif (core.flags.pickaxeFourDirections || (block.x == core.nextX() && block.y == core.nextY()))\n\t\t\t\tids.push(i);\n\t\t\telse id2s.push(i);\n\t\t}\n\t}\n\tif (ids.length>0) {\n\t\tcore.status.event.data = ids;\n\t\treturn true;\n\t}\n\telse if (id2s.length==1) {\n\t\tcore.status.event.data = id2s;\n\t\treturn true;\n\t}\n\treturn false;\n})();",
|
||||||
"icePickaxe": "var able=false;\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.x==core.nextX() && block.y==core.nextY() && block.event.id=='ice') {\n\t\tcore.status.event.data = [i];\n\t\table=true;\n\t}\n}\nable",
|
"icePickaxe": "(function() {\n\tfor (var i in core.status.thisMap.blocks) {\n\t\tvar block = core.status.thisMap.blocks[i];\n\t\tif (core.isset(block.event) && !block.disable && block.x==core.nextX() && block.y==core.nextY() && block.event.id=='ice') {\n\t\t\tcore.status.event.data = [i];\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n})();",
|
||||||
"bomb": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0 && Math.abs(block.x-core.getHeroLoc('x'))+Math.abs(block.y-core.getHeroLoc('y'))<=1) {\n\t\tvar enemy = core.material.enemys[block.event.id];\n\t\tif (core.isset(enemy) && enemy.notBomb) continue;\n\t\tif (core.flags.bombFourDirections || (block.x==core.nextX() && block.y==core.nextY()))\n\t\t\tids.push(i);\n\t\telse\n\t\t\tid2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable",
|
"bomb": "(function () {\n\tvar ids = [], id2s = [];\n\tfor (var i in core.status.thisMap.blocks) {\n\t\tvar block = core.status.thisMap.blocks[i];\n\t\tif (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0 && core.nearHero(block.x, block.y)) {\n\t\t\tvar enemy = core.material.enemys[block.event.id];\n\t\t\tif (core.isset(enemy) && enemy.notBomb) continue;\n\t\t\tif (core.flags.bombFourDirections || (block.x==core.nextX() && block.y==core.nextY()))\n\t\t\t\tids.push(i);\n\t\t\telse\n\t\t\t\tid2s.push(i);\n\t\t}\n\t}\n\tif (ids.length>0) {\n\t\tcore.status.event.data = ids;\n\t\treturn true;\n\t}\n\tif (id2s.length==1) {\n\t\tcore.status.event.data = id2s;\n\t\treturn true;\n\t}\n\treturn false;\n})();",
|
||||||
"hammer": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0 && Math.abs(block.x-core.getHeroLoc('x'))+Math.abs(block.y-core.getHeroLoc('y'))<=1) {\n\t\tvar enemy = core.material.enemys[block.event.id];\n\t\tif (core.isset(enemy) && enemy.notBomb) continue;\n\t\tif (block.x==core.nextX() && block.y==core.nextY())\n\t\t\tids.push(i);\n\t\telse\n\t\t\tid2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable",
|
"hammer": "(function() {\n\tvar ids = [], id2s = [];\n\tfor (var i in core.status.thisMap.blocks) {\n\t\tvar block = core.status.thisMap.blocks[i];\n\t\tif (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0 && core.nearHero(block.x, block.y)) {\n\t\t\tvar enemy = core.material.enemys[block.event.id];\n\t\t\tif (core.isset(enemy) && enemy.notBomb) continue;\n\t\t\tif (block.x==core.nextX() && block.y==core.nextY())\n\t\t\t\tids.push(i);\n\t\t\telse\n\t\t\t\tid2s.push(i);\n\t\t}\n\t}\n\tif (ids.length>0) {\n\t\tcore.status.event.data = ids;\n\t\treturn true;\n\t}\n\telse if (id2s.length==1) {\n\t\tcore.status.event.data = id2s;\n\t\treturn true;\n\t}\n\treturn false;\n})();",
|
||||||
"earthquake": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable &&\n\t\t(block.event.canBreak || block.event.id == 'yellowWall' || block.event.id == 'blueWall' || block.event.id == 'whiteWall')) { // 能炸的墙壁\n\t\tids.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nable",
|
"earthquake": "(function () {\n\tvar able=false;\n\tvar ids = [];\n\tfor (var i in core.status.thisMap.blocks) {\n\t\tvar block = core.status.thisMap.blocks[i];\n\t\tif (core.isset(block.event) && !block.disable &&\n\t\t\t(block.event.canBreak || block.event.id == 'yellowWall' || block.event.id == 'blueWall' || block.event.id == 'whiteWall')) { // 能炸的墙壁\n\t\t\tids.push(i);\n\t\t}\n\t}\n\tif (ids.length>0) {\n\t\tcore.status.event.data = ids;\n\t\table=true;\n\t}\n\treturn able;\n})();",
|
||||||
"centerFly": "var toX = (core.bigmap.width||13)-1-core.getHeroLoc('x'), toY = (core.bigmap.height||13)-1-core.getHeroLoc('y');\ncore.getBlockId(toX, toY) == null",
|
"centerFly": "(function () {\n\tvar toX = (core.bigmap.width||13)-1-core.getHeroLoc('x'), toY = (core.bigmap.height||13)-1-core.getHeroLoc('y');\n\tvar id = core.getBlockId(toX, toY);\n\treturn id == null;\n})();",
|
||||||
"upFly": "var able=false;\nvar floorId = core.status.floorId, index = core.floorIds.indexOf(floorId);\nif (index<core.floorIds.length-1) {\n\tvar toId = core.floorIds[index+1], toX = core.getHeroLoc('x'), toY = core.getHeroLoc('y');\n\tvar mw = core.floors[toId].width||13, mh = core.floors[toId].height||13;\n\tif (toX>=0 && toX<mw && toY>=0 && toY<mh && core.getBlock(toX, toY, toId)==null) {\n\t\tcore.status.event.data = {'id': toId, 'x': toX, 'y': toY};\n\t\table=true;\n\t}\n}\nable",
|
"upFly": "(function() {\n\tvar floorId = core.status.floorId, index = core.floorIds.indexOf(floorId);\n\tif (index<core.floorIds.length-1) {\n\t\tvar toId = core.floorIds[index+1], toX = core.getHeroLoc('x'), toY = core.getHeroLoc('y');\n\t\tvar mw = core.floors[toId].width||13, mh = core.floors[toId].height||13;\n\t\tif (toX>=0 && toX<mw && toY>=0 && toY<mh && core.getBlock(toX, toY, toId)==null) {\n\t\t\tcore.status.event.data = {'id': toId, 'x': toX, 'y': toY};\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n})();",
|
||||||
"downFly": "var able=false;\nvar floorId = core.status.floorId, index = core.floorIds.indexOf(floorId);\nif (index>0) {\n\tvar toId = core.floorIds[index-1], toX = core.getHeroLoc('x'), toY = core.getHeroLoc('y');\n\tvar mw = core.floors[toId].width||13, mh = core.floors[toId].height||13;\n\tif (toX>=0 && toX<mw && toY>=0 && toY<mh && core.getBlock(toX, toY, toId)==null) {\n\t\tcore.status.event.data = {'id': toId, 'x': toX, 'y': toY};\n\t\table=true;\n\t}\n}\nable",
|
"downFly": "(function() {\n\tvar floorId = core.status.floorId, index = core.floorIds.indexOf(floorId);\n\tif (index>0) {\n\t\tvar toId = core.floorIds[index-1], toX = core.getHeroLoc('x'), toY = core.getHeroLoc('y');\n\t\tvar mw = core.floors[toId].width||13, mh = core.floors[toId].height||13;\n\t\tif (toX>=0 && toX<mw && toY>=0 && toY<mh && core.getBlock(toX, toY, toId)==null) {\n\t\t\tcore.status.event.data = {'id': toId, 'x': toX, 'y': toY};\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n})();",
|
||||||
"snow": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.id == 'lava' && Math.abs(block.x-core.getHeroLoc('x'))+Math.abs(block.y-core.getHeroLoc('y'))<=1) {\n\t\tif (core.flags.snowFourDirections || (block.x == core.nextX() && block.y == core.nextY()))\n\t\t\tids.push(i);\n\t\telse id2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable",
|
"snow": "(function () {\n\tvar ids = [], id2s = [];\n\tfor (var i in core.status.thisMap.blocks) {\n\t\tvar block = core.status.thisMap.blocks[i];\n\t\tif (core.isset(block.event) && !block.disable && block.event.id == 'lava' && core.nearHero(block.x, block.y)) {\n\t\t\tif (core.flags.snowFourDirections || (block.x == core.nextX() && block.y == core.nextY()))\n\t\t\t\tids.push(i);\n\t\t\telse id2s.push(i);\n\t\t}\n\t}\n\tif (ids.length>0) {\n\t\tcore.status.event.data = ids;\n\t\treturn true;\n\t}\n\tif (id2s.length==1) {\n\t\tcore.status.event.data = id2s;\n\t\treturn true;\n\t}\n\treturn false;\n})();",
|
||||||
"bigKey": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.id == 'yellowDoor') {\n\t\tids.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nable",
|
"bigKey": "(function() {\n\tvar able=false, ids = [];\n\tfor (var i in core.status.thisMap.blocks) {\n\t\tvar block = core.status.thisMap.blocks[i];\n\t\tif (core.isset(block.event) && !block.disable && block.event.id == 'yellowDoor') {\n\t\t\tids.push(i);\n\t\t}\n\t}\n\tif (ids.length>0) {\n\t\tcore.status.event.data = ids;\n\t\table=true;\n\t}\n\treturn able;\n})();",
|
||||||
"poisonWine": "core.hasFlag('poison')",
|
"poisonWine": "core.hasFlag('poison');",
|
||||||
"weakWine": "core.hasFlag('weak')",
|
"weakWine": "core.hasFlag('weak');",
|
||||||
"curseWine": "core.hasFlag('curse')",
|
"curseWine": "core.hasFlag('curse');",
|
||||||
"superWine": "core.hasFlag('poison') || core.hasFlag('weak') || core.hasFlag('curse')",
|
"superWine": "(function() {\n\treturn core.hasFlag('poison') || core.hasFlag('weak') || core.hasFlag('curse');\n})();",
|
||||||
"lifeWand": "true",
|
"lifeWand": "true",
|
||||||
"jumpShoes": "var nx=core.nextX(2),ny=core.nextY(2);nx>=0&&nx<core.bigmap.width&&ny>=0&&ny<core.bigmap.height&&core.getBlock(nx,ny)==null",
|
"jumpShoes": "(function() {\n\tvar nx=core.nextX(2), ny=core.nextY(2);\n\treturn nx>=0 && nx<core.bigmap.width && ny>=0 && ny<core.bigmap.height && core.getBlockId(nx,ny)==null;\n})();",
|
||||||
"redPotion": "true",
|
"redPotion": "true",
|
||||||
"bluePotion": "true",
|
"bluePotion": "true",
|
||||||
"greenPotion": "true",
|
"greenPotion": "true",
|
||||||
|
|||||||
426
project/maps.js
426
project/maps.js
@ -1,233 +1,199 @@
|
|||||||
var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
|
var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
|
||||||
{
|
{
|
||||||
////////////////////////// 地形部分 //////////////////////////
|
"1": {"cls":"terrains","id":"yellowWall","canBreak":true},
|
||||||
|
"2": {"cls":"terrains","id":"whiteWall","canBreak":true},
|
||||||
// 0-20 地形
|
"3": {"cls":"terrains","id":"blueWall","canBreak":true},
|
||||||
'1':{'cls': 'terrains', 'id': 'yellowWall', 'canBreak': true}, // 黄墙
|
"4": {"cls":"animates","id":"star","noPass":true},
|
||||||
'2':{'cls': 'terrains', 'id': 'whiteWall', 'canBreak': true}, // 白墙
|
"5": {"cls":"animates","id":"lava","noPass":true},
|
||||||
'3':{'cls': 'terrains', 'id': 'blueWall', 'canBreak': true}, // 蓝墙
|
"6": {"cls":"terrains","id":"ice"},
|
||||||
'4':{'cls': 'animates', 'id': 'star', 'noPass': true}, // 星空
|
"7": {"cls":"terrains","id":"blueShop-left"},
|
||||||
'5':{'cls': 'animates', 'id': 'lava', 'noPass': true}, // 岩浆
|
"8": {"cls":"terrains","id":"blueShop-right"},
|
||||||
'6':{'cls': 'terrains', 'id': 'ice'}, // 冰面
|
"9": {"cls":"terrains","id":"pinkShop-left"},
|
||||||
'7':{'cls': 'terrains', 'id': 'blueShop-left'}, // 蓝色商店左
|
"10": {"cls":"terrains","id":"pinkShop-right"},
|
||||||
'8':{'cls': 'terrains', 'id': 'blueShop-right'}, // 蓝色商店右
|
"11": {"cls":"animates","id":"lavaNet","noPass":false,"trigger":"passNet"},
|
||||||
'9':{'cls': 'terrains', 'id': 'pinkShop-left'}, // 粉色商店左
|
"12": {"cls":"animates","id":"poisonNet","noPass":false,"trigger":"passNet"},
|
||||||
'10':{'cls': 'terrains', 'id': 'pinkShop-right'}, // 粉色商店左
|
"13": {"cls":"animates","id":"weakNet","noPass":false,"trigger":"passNet"},
|
||||||
'11':{'cls': 'animates', 'id': 'lavaNet', 'noPass': false, 'trigger': 'passNet'}, // 血网
|
"14": {"cls":"animates","id":"curseNet","noPass":false,"trigger":"passNet"},
|
||||||
'12':{'cls': 'animates', 'id': 'poisonNet', 'noPass': false, 'trigger': 'passNet'}, // 毒网
|
"15": {"cls":"animates","id":"blueWater","noPass":true},
|
||||||
'13':{'cls': 'animates', 'id': 'weakNet', 'noPass': false, 'trigger': 'passNet'}, // 衰网
|
"16": {"cls":"animates","id":"water","noPass":true},
|
||||||
'14':{'cls': 'animates', 'id': 'curseNet', 'noPass': false, 'trigger': 'passNet'}, // 咒网
|
"20": {"cls":"autotile","id":"autotile","noPass":true},
|
||||||
'15':{'cls': 'animates', 'id': 'blueWater', 'noPass': true}, // 水
|
"21": {"cls":"items","id":"yellowKey"},
|
||||||
'16':{'cls': 'animates', 'id': 'water', 'noPass': true}, // 水
|
"22": {"cls":"items","id":"blueKey"},
|
||||||
// 在这里添加更多地形
|
"23": {"cls":"items","id":"redKey"},
|
||||||
// 如果空位不足,可以从180以后开始继续放,只要不和现有的数字冲突即可
|
"24": {"cls":"items","id":"greenKey"},
|
||||||
|
"25": {"cls":"items","id":"steelKey"},
|
||||||
// Autotile
|
"26": {"cls":"items","id":"bigKey"},
|
||||||
'20':{'cls': 'autotile', 'id': 'autotile', 'noPass': true}, // autotile
|
"27": {"cls":"items","id":"redJewel"},
|
||||||
// 更多的autotile从151到160等,只要不和现有的数字冲突即可
|
"28": {"cls":"items","id":"blueJewel"},
|
||||||
'151':{'cls': 'autotile', 'id': 'autotile1', 'noPass': true},
|
"29": {"cls":"items","id":"greenJewel"},
|
||||||
'152':{'cls': 'autotile', 'id': 'autotile2', 'noPass': true},
|
"30": {"cls":"items","id":"yellowJewel"},
|
||||||
'153':{'cls': 'autotile', 'id': 'autotile3', 'noPass': true},
|
"31": {"cls":"items","id":"redPotion"},
|
||||||
|
"32": {"cls":"items","id":"bluePotion"},
|
||||||
////////////////////////// 物品部分 //////////////////////////
|
"33": {"cls":"items","id":"greenPotion"},
|
||||||
|
"34": {"cls":"items","id":"yellowPotion"},
|
||||||
// 21-80 物品
|
"35": {"cls":"items","id":"sword1"},
|
||||||
'21':{'cls': 'items', 'id': 'yellowKey'}, // 黄钥匙
|
"36": {"cls":"items","id":"shield1"},
|
||||||
'22':{'cls': 'items', 'id': 'blueKey'}, // 蓝钥匙
|
"37": {"cls":"items","id":"sword2"},
|
||||||
'23':{'cls': 'items', 'id': 'redKey'}, // 红钥匙
|
"38": {"cls":"items","id":"shield2"},
|
||||||
'24':{'cls': 'items', 'id': 'greenKey'}, // 绿钥匙
|
"39": {"cls":"items","id":"sword3"},
|
||||||
'25':{'cls': 'items', 'id': 'steelKey'}, // 铁门钥匙
|
"40": {"cls":"items","id":"shield3"},
|
||||||
'26':{'cls': 'items', 'id': 'bigKey'}, // 大黄门钥匙(钥匙盒)
|
"41": {"cls":"items","id":"sword4"},
|
||||||
'27':{'cls': 'items', 'id': 'redJewel'}, // 红宝石
|
"42": {"cls":"items","id":"shield4"},
|
||||||
'28':{'cls': 'items', 'id': 'blueJewel'}, // 蓝宝石
|
"43": {"cls":"items","id":"sword5"},
|
||||||
'29':{'cls': 'items', 'id': 'greenJewel'}, // 绿宝石
|
"44": {"cls":"items","id":"shield5"},
|
||||||
'30':{'cls': 'items', 'id': 'yellowJewel'}, // 黄宝石
|
"45": {"cls":"items","id":"book"},
|
||||||
'31':{'cls': 'items', 'id': 'redPotion'}, // 红血瓶
|
"46": {"cls":"items","id":"fly"},
|
||||||
'32':{'cls': 'items', 'id': 'bluePotion'}, // 蓝血瓶
|
"47": {"cls":"items","id":"pickaxe"},
|
||||||
'33':{'cls': 'items', 'id': 'greenPotion'}, // 绿血瓶
|
"48": {"cls":"items","id":"icePickaxe"},
|
||||||
'34':{'cls': 'items', 'id': 'yellowPotion'}, // 黄血瓶
|
"49": {"cls":"items","id":"bomb"},
|
||||||
'35':{'cls': 'items', 'id': 'sword1'}, // 铁剑
|
"50": {"cls":"items","id":"centerFly"},
|
||||||
'36':{'cls': 'items', 'id': 'shield1'}, // 铁盾
|
"51": {"cls":"items","id":"upFly"},
|
||||||
'37':{'cls': 'items', 'id': 'sword2'}, // 银剑
|
"52": {"cls":"items","id":"downFly"},
|
||||||
'38':{'cls': 'items', 'id': 'shield2'}, // 银盾
|
"53": {"cls":"items","id":"coin"},
|
||||||
'39':{'cls': 'items', 'id': 'sword3'}, // 骑士剑
|
"54": {"cls":"items","id":"snow"},
|
||||||
'40':{'cls': 'items', 'id': 'shield3'}, // 骑士盾
|
"55": {"cls":"items","id":"cross"},
|
||||||
'41':{'cls': 'items', 'id': 'sword4'}, // 圣剑
|
"56": {"cls":"items","id":"superPotion"},
|
||||||
'42':{'cls': 'items', 'id': 'shield4'}, // 圣盾
|
"57": {"cls":"items","id":"earthquake"},
|
||||||
'43':{'cls': 'items', 'id': 'sword5'}, // 神圣剑
|
"58": {"cls":"items","id":"poisonWine"},
|
||||||
'44':{'cls': 'items', 'id': 'shield5'}, // 神圣盾
|
"59": {"cls":"items","id":"weakWine"},
|
||||||
'45':{'cls': 'items', 'id': 'book'}, // 怪物手册
|
"60": {"cls":"items","id":"curseWine"},
|
||||||
'46':{'cls': 'items', 'id': 'fly'}, // 楼层传送器
|
"61": {"cls":"items","id":"superWine"},
|
||||||
'47':{'cls': 'items', 'id': 'pickaxe'}, // 破墙镐
|
"62": {"cls":"items","id":"knife"},
|
||||||
'48':{'cls': 'items', 'id': 'icePickaxe'}, // 破冰镐
|
"63": {"cls":"items","id":"moneyPocket"},
|
||||||
'49':{'cls': 'items', 'id': 'bomb'}, // 炸弹
|
"64": {"cls":"items","id":"shoes"},
|
||||||
'50':{'cls': 'items', 'id': 'centerFly'}, // 中心对称
|
"65": {"cls":"items","id":"hammer"},
|
||||||
'51':{'cls': 'items', 'id': 'upFly'}, // 上楼器
|
"68": {"cls":"items","id":"lifeWand"},
|
||||||
'52':{'cls': 'items', 'id': 'downFly'}, // 下楼器
|
"69": {"cls":"items","id":"jumpShoes"},
|
||||||
'53':{'cls': 'items', 'id': 'coin'}, // 幸运金币
|
"70": {"cls":"items","id":"sword0"},
|
||||||
'54':{'cls': 'items', 'id': 'snow'}, // 冰冻徽章
|
"71": {"cls":"items","id":"shield0"},
|
||||||
'55':{'cls': 'items', 'id': 'cross'}, // 十字架
|
"72": {"cls":"items","id":"skill1"},
|
||||||
'56':{'cls': 'items', 'id': 'superPotion'}, // 圣水
|
"73": {"cls":"items","id":"I73"},
|
||||||
'57':{'cls': 'items', 'id': 'earthquake'}, // 地震卷轴
|
"81": {"cls":"terrains","id":"yellowDoor","trigger":"openDoor"},
|
||||||
'58':{'cls': 'items', 'id': 'poisonWine'}, // 解毒药水
|
"82": {"cls":"terrains","id":"blueDoor","trigger":"openDoor"},
|
||||||
'59':{'cls': 'items', 'id': 'weakWine'}, // 解衰药水
|
"83": {"cls":"terrains","id":"redDoor","trigger":"openDoor"},
|
||||||
'60':{'cls': 'items', 'id': 'curseWine'}, // 解咒药水
|
"84": {"cls":"terrains","id":"greenDoor","trigger":"openDoor"},
|
||||||
'61':{'cls': 'items', 'id': 'superWine'}, // 万能药水
|
"85": {"cls":"terrains","id":"specialDoor","trigger":"openDoor"},
|
||||||
'62':{'cls': 'items', 'id': 'knife'}, // 屠龙匕首
|
"86": {"cls":"terrains","id":"steelDoor","trigger":"openDoor"},
|
||||||
'63':{'cls': 'items', 'id': 'moneyPocket'}, // 金钱袋
|
"87": {"cls":"terrains","id":"upFloor","noPass":false},
|
||||||
'64':{'cls': 'items', 'id': 'shoes'}, // 绿鞋
|
"88": {"cls":"terrains","id":"downFloor","noPass":false},
|
||||||
'65':{'cls': 'items', 'id': 'hammer'}, // 圣锤
|
"89": {"cls":"animates","id":"portal","noPass":false},
|
||||||
'68':{'cls': 'items', 'id': 'lifeWand'}, // 生命魔杖
|
"90": {"cls":"animates","id":"starPortal","noPass":false},
|
||||||
'69':{'cls': 'items', 'id': 'jumpShoes'}, // 生命魔杖
|
"91": {"cls":"animates","id":"upPortal","noPass":false},
|
||||||
'70':{'cls': 'items', 'id': 'sword0'},
|
"92": {"cls":"animates","id":"leftPortal","noPass":false},
|
||||||
'71':{'cls': 'items', 'id': 'shield0'},
|
"93": {"cls":"animates","id":"downPortal","noPass":false},
|
||||||
'72':{'cls': 'items', 'id': 'skill1'}, // 技能:二倍斩
|
"94": {"cls":"animates","id":"rightPortal","noPass":false},
|
||||||
|
"101": {"cls":"animates","id":"crystalUp"},
|
||||||
|
"102": {"cls":"animates","id":"crystalBottom"},
|
||||||
////////////////////////// 门、楼梯、传送点部分 //////////////////////////
|
"103": {"cls":"animates","id":"fire"},
|
||||||
|
"104": {"cls":"animates","id":"switch"},
|
||||||
// 81-100 门
|
"121": {"cls":"npcs","id":"man"},
|
||||||
'81':{'cls': 'terrains', 'id': 'yellowDoor', 'trigger': 'openDoor'}, // 黄门
|
"122": {"cls":"npcs","id":"woman"},
|
||||||
'82':{'cls': 'terrains', 'id': 'blueDoor', 'trigger': 'openDoor'}, // 蓝门
|
"123": {"cls":"npcs","id":"thief"},
|
||||||
'83':{'cls': 'terrains', 'id': 'redDoor', 'trigger': 'openDoor'}, // 红门
|
"124": {"cls":"npcs","id":"fairy"},
|
||||||
'84':{'cls': 'terrains', 'id': 'greenDoor', 'trigger': 'openDoor'}, // 绿门
|
"125": {"cls":"npcs","id":"magician"},
|
||||||
'85':{'cls': 'terrains', 'id': 'specialDoor', 'trigger': 'openDoor'}, // 机关门左
|
"126": {"cls":"npcs","id":"womanMagician"},
|
||||||
'86':{'cls': 'terrains', 'id': 'steelDoor', 'trigger': 'openDoor'}, // 铁门
|
"127": {"cls":"npcs","id":"oldMan"},
|
||||||
'87':{'cls': 'terrains', 'id': 'upFloor', 'noPass': false}, // 上楼梯
|
"128": {"cls":"npcs","id":"child"},
|
||||||
'88':{'cls': 'terrains', 'id': 'downFloor', 'noPass': false}, // 下楼梯
|
"129": {"cls":"npcs","id":"wood"},
|
||||||
'89':{'cls': 'animates', 'id': 'portal', 'noPass': false}, // 传送门
|
"130": {"cls":"npcs","id":"pinkShop"},
|
||||||
'90':{'cls': 'animates', 'id': 'starPortal', 'noPass': false}, // 星空传送门
|
"131": {"cls":"npcs","id":"blueShop"},
|
||||||
'91':{'cls': 'animates', 'id': 'upPortal', 'noPass': false}, // 上箭头
|
"132": {"cls":"npcs","id":"princess"},
|
||||||
'92':{'cls': 'animates', 'id': 'leftPortal', 'noPass': false}, // 左箭头
|
"133": {"cls":"npc48","id":"npc0"},
|
||||||
'93':{'cls': 'animates', 'id': 'downPortal', 'noPass': false}, // 下箭头
|
"134": {"cls":"npc48","id":"npc1"},
|
||||||
'94':{'cls': 'animates', 'id': 'rightPortal', 'noPass': false}, // 右箭头
|
"135": {"cls":"npc48","id":"npc2"},
|
||||||
|
"136": {"cls":"npc48","id":"npc3"},
|
||||||
// 101~120 其他的animates
|
"137": {"cls":"npc48","id":"npc4"},
|
||||||
'101':{'cls': 'animates', 'id': 'crystalUp'},
|
"151": {"cls":"autotile","id":"autotile1","noPass":true},
|
||||||
'102':{'cls': 'animates', 'id': 'crystalBottom'},
|
"152": {"cls":"autotile","id":"autotile2","noPass":true},
|
||||||
'103':{'cls': 'animates', 'id': 'fire'},
|
"153": {"cls":"autotile","id":"autotile3","noPass":true},
|
||||||
'104':{'cls': 'animates', 'id': 'switch'},
|
"161": {"cls":"terrains","id":"arrowUp","noPass":false,"cannotOut":["left","right","down"],"cannotIn":["down"]},
|
||||||
|
"162": {"cls":"terrains","id":"arrowDown","noPass":false,"cannotOut":["left","right","up"],"cannotIn":["up"]},
|
||||||
////////////////////////// NPC部分 //////////////////////////
|
"163": {"cls":"terrains","id":"arrowLeft","noPass":false,"cannotOut":["up","down","right"],"cannotIn":["right"]},
|
||||||
|
"164": {"cls":"terrains","id":"arrowRight","noPass":false,"cannotOut":["up","down","left"],"cannotIn":["left"]},
|
||||||
// 121-150 NPC
|
"165": {"cls":"terrains","id":"light","trigger":"changeLight","noPass":false},
|
||||||
'121':{'cls': 'npcs', 'id': 'man'},
|
"166": {"cls":"terrains","id":"darkLight","noPass":true},
|
||||||
'122':{'cls': 'npcs', 'id': 'woman'},
|
"167": {"cls":"terrains","id":"ski","trigger":"ski","noPass":false},
|
||||||
'123':{'cls': 'npcs', 'id': 'thief'},
|
"168": {"cls":"terrains","id":"flower","noPass":false},
|
||||||
'124':{'cls': 'npcs', 'id': 'fairy'},
|
"169": {"cls":"terrains","id":"box","trigger":"pushBox","noPass":true},
|
||||||
'125':{'cls': 'npcs', 'id': 'magician'},
|
"170": {"cls":"terrains","id":"boxed","trigger":"pushBox","noPass":true},
|
||||||
'126':{'cls': 'npcs', 'id': 'womanMagician'},
|
"181": {"cls":"npcs","id":"wlt"},
|
||||||
'127':{'cls': 'npcs', 'id': 'oldMan'},
|
"182": {"cls":"npcs","id":"wt"},
|
||||||
'128':{'cls': 'npcs', 'id': 'child'},
|
"183": {"cls":"npcs","id":"wrt"},
|
||||||
'129':{'cls': 'npcs', 'id': 'wood'},
|
"184": {"cls":"npcs","id":"wl"},
|
||||||
'130':{'cls': 'npcs', 'id': 'pinkShop'},
|
"185": {"cls":"npcs","id":"wc"},
|
||||||
'131':{'cls': 'npcs', 'id': 'blueShop'},
|
"186": {"cls":"npcs","id":"wr"},
|
||||||
'132':{'cls': 'npcs', 'id': 'princess'},
|
"187": {"cls":"npcs","id":"wlb"},
|
||||||
'133': {'cls': 'npc48', 'id': 'npc0'},
|
"188": {"cls":"npcs","id":"wrb"},
|
||||||
'134': {'cls': 'npc48', 'id': 'npc1'},
|
"189": {"cls":"npcs","id":"dlt"},
|
||||||
'135': {'cls': 'npc48', 'id': 'npc2'},
|
"190": {"cls":"npcs","id":"dt"},
|
||||||
'136': {'cls': 'npc48', 'id': 'npc3'},
|
"191": {"cls":"npcs","id":"drt"},
|
||||||
'137': {'cls': 'npc48', 'id': 'npc4'},
|
"192": {"cls":"npcs","id":"dl"},
|
||||||
|
"193": {"cls":"npcs","id":"dc"},
|
||||||
'181': {'cls': 'npcs', 'id': 'wlt'},
|
"194": {"cls":"npcs","id":"dr"},
|
||||||
'182': {'cls': 'npcs', 'id': 'wt'},
|
"195": {"cls":"npcs","id":"dlb"},
|
||||||
'183': {'cls': 'npcs', 'id': 'wrt'},
|
"196": {"cls":"npcs","id":"drb"},
|
||||||
'184': {'cls': 'npcs', 'id': 'wl'},
|
"201": {"cls":"enemys","id":"greenSlime"},
|
||||||
'185': {'cls': 'npcs', 'id': 'wc'},
|
"202": {"cls":"enemys","id":"redSlime"},
|
||||||
'186': {'cls': 'npcs', 'id': 'wr'},
|
"203": {"cls":"enemys","id":"blackSlime"},
|
||||||
'187': {'cls': 'npcs', 'id': 'wlb'},
|
"204": {"cls":"enemys","id":"slimelord"},
|
||||||
'188': {'cls': 'npcs', 'id': 'wrb'},
|
"205": {"cls":"enemys","id":"bat"},
|
||||||
'189': {'cls': 'npcs', 'id': 'dlt'},
|
"206": {"cls":"enemys","id":"bigBat"},
|
||||||
'190': {'cls': 'npcs', 'id': 'dt'},
|
"207": {"cls":"enemys","id":"redBat"},
|
||||||
'191': {'cls': 'npcs', 'id': 'drt'},
|
"208": {"cls":"enemys","id":"vampire"},
|
||||||
'192': {'cls': 'npcs', 'id': 'dl'},
|
"209": {"cls":"enemys","id":"skeleton"},
|
||||||
'193': {'cls': 'npcs', 'id': 'dc'},
|
"210": {"cls":"enemys","id":"skeletonSoilder"},
|
||||||
'194': {'cls': 'npcs', 'id': 'dr'},
|
"211": {"cls":"enemys","id":"skeletonCaptain"},
|
||||||
'195': {'cls': 'npcs', 'id': 'dlb'},
|
"212": {"cls":"enemys","id":"ghostSkeleton"},
|
||||||
'196': {'cls': 'npcs', 'id': 'drb'},
|
"213": {"cls":"enemys","id":"zombie"},
|
||||||
|
"214": {"cls":"enemys","id":"zombieKnight"},
|
||||||
////////////////////////// 其他部分 //////////////////////////
|
"215": {"cls":"enemys","id":"rock"},
|
||||||
|
"216": {"cls":"enemys","id":"slimeMan"},
|
||||||
// 171-200 其他(单向箭头、灯、箱子等等)
|
"217": {"cls":"enemys","id":"bluePriest"},
|
||||||
'161':{'cls': 'terrains', 'id': 'arrowUp', 'noPass': false, "cannotOut": ["left","right","down"], "cannotIn": ["down"]}, // 单向上箭头
|
"218": {"cls":"enemys","id":"redPriest"},
|
||||||
'162':{'cls': 'terrains', 'id': 'arrowDown', 'noPass': false, "cannotOut": ["left","right","up"], "cannotIn": ["up"]}, // 单向下箭头
|
"219": {"cls":"enemys","id":"brownWizard"},
|
||||||
'163':{'cls': 'terrains', 'id': 'arrowLeft', 'noPass': false, "cannotOut": ["up","down","right"], "cannotIn": ["right"]}, // 单向左箭头
|
"220": {"cls":"enemys","id":"redWizard"},
|
||||||
'164':{'cls': 'terrains', 'id': 'arrowRight', 'noPass': false, "cannotOut": ["up","down","left"], "cannotIn": ["left"]}, // 单向右箭头
|
"221": {"cls":"enemys","id":"yellowGuard"},
|
||||||
'165':{'cls': 'terrains', 'id': 'light', 'trigger': 'changeLight', 'noPass': false}, // 灯
|
"222": {"cls":"enemys","id":"blueGuard"},
|
||||||
'166':{'cls': 'terrains', 'id': 'darkLight', 'noPass': true}, // 暗灯
|
"223": {"cls":"enemys","id":"redGuard"},
|
||||||
'167':{'cls': 'terrains', 'id': 'ski', 'trigger': 'ski', 'noPass': false}, // 滑冰
|
"224": {"cls":"enemys","id":"swordsman"},
|
||||||
'168':{'cls': 'terrains', 'id': 'flower', 'noPass': false}, // 花
|
"225": {"cls":"enemys","id":"soldier"},
|
||||||
'169':{'cls': 'terrains', 'id': 'box', 'trigger': 'pushBox', 'noPass': true}, // 箱子
|
"226": {"cls":"enemys","id":"yellowKnight"},
|
||||||
'170':{'cls': 'terrains', 'id': 'boxed', 'trigger': 'pushBox', 'noPass': true}, // 完成的箱子
|
"227": {"cls":"enemys","id":"redKnight"},
|
||||||
|
"228": {"cls":"enemys","id":"darkKnight"},
|
||||||
////////////////////////// 怪物部分 //////////////////////////
|
"229": {"cls":"enemys","id":"blackKing"},
|
||||||
|
"230": {"cls":"enemys","id":"yellowKing"},
|
||||||
// 201-300 怪物
|
"231": {"cls":"enemys","id":"greenKing"},
|
||||||
'201':{'cls': 'enemys', 'id': 'greenSlime'},
|
"232": {"cls":"enemys","id":"blueKnight"},
|
||||||
'202':{'cls': 'enemys', 'id': 'redSlime'},
|
"233": {"cls":"enemys","id":"goldSlime"},
|
||||||
'203':{'cls': 'enemys', 'id': 'blackSlime'},
|
"234": {"cls":"enemys","id":"poisonSkeleton"},
|
||||||
'204':{'cls': 'enemys', 'id': 'slimelord'},
|
"235": {"cls":"enemys","id":"poisonBat"},
|
||||||
'205':{'cls': 'enemys', 'id': 'bat'},
|
"236": {"cls":"enemys","id":"steelRock"},
|
||||||
'206':{'cls': 'enemys', 'id': 'bigBat'},
|
"237": {"cls":"enemys","id":"skeletonPriest"},
|
||||||
'207':{'cls': 'enemys', 'id': 'redBat'},
|
"238": {"cls":"enemys","id":"skeletonKing"},
|
||||||
'208':{'cls': 'enemys', 'id': 'vampire'},
|
"239": {"cls":"enemys","id":"skeletonWizard"},
|
||||||
'209':{'cls': 'enemys', 'id': 'skeleton'},
|
"240": {"cls":"enemys","id":"redSkeletonCaption"},
|
||||||
'210':{'cls': 'enemys', 'id': 'skeletonSoilder'},
|
"241": {"cls":"enemys","id":"badHero"},
|
||||||
'211':{'cls': 'enemys', 'id': 'skeletonCaptain'},
|
"242": {"cls":"enemys","id":"demon"},
|
||||||
'212':{'cls': 'enemys', 'id': 'ghostSkeleton'},
|
"243": {"cls":"enemys","id":"demonPriest"},
|
||||||
'213':{'cls': 'enemys', 'id': 'zombie'},
|
"244": {"cls":"enemys","id":"goldHornSlime"},
|
||||||
'214':{'cls': 'enemys', 'id': 'zombieKnight'},
|
"245": {"cls":"enemys","id":"redKing"},
|
||||||
'215':{'cls': 'enemys', 'id': 'rock'},
|
"246": {"cls":"enemys","id":"whiteKing"},
|
||||||
'216':{'cls': 'enemys', 'id': 'slimeMan'},
|
"247": {"cls":"enemys","id":"blackMagician"},
|
||||||
'217':{'cls': 'enemys', 'id': 'bluePriest'},
|
"248": {"cls":"enemys","id":"silverSlime"},
|
||||||
'218':{'cls': 'enemys', 'id': 'redPriest'},
|
"249": {"cls":"enemys","id":"swordEmperor"},
|
||||||
'219':{'cls': 'enemys', 'id': 'brownWizard'},
|
"250": {"cls":"enemys","id":"whiteHornSlime"},
|
||||||
'220':{'cls': 'enemys', 'id': 'redWizard'},
|
"251": {"cls":"enemys","id":"badPrincess"},
|
||||||
'221':{'cls': 'enemys', 'id': 'yellowGuard'},
|
"252": {"cls":"enemys","id":"badFairy"},
|
||||||
'222':{'cls': 'enemys', 'id': 'blueGuard'},
|
"253": {"cls":"enemys","id":"grayPriest"},
|
||||||
'223':{'cls': 'enemys', 'id': 'redGuard'},
|
"254": {"cls":"enemys","id":"redSwordsman"},
|
||||||
'224':{'cls': 'enemys', 'id': 'swordsman'},
|
"255": {"cls":"enemys","id":"whiteGhost"},
|
||||||
'225':{'cls': 'enemys', 'id': 'soldier'},
|
"256": {"cls":"enemys","id":"poisonZombie"},
|
||||||
'226':{'cls': 'enemys', 'id': 'yellowKnight'},
|
"257": {"cls":"enemys","id":"magicDragon"},
|
||||||
'227':{'cls': 'enemys', 'id': 'redKnight'},
|
"258": {"cls":"enemys","id":"octopus"},
|
||||||
'228':{'cls': 'enemys', 'id': 'darkKnight'},
|
"259": {"cls":"enemys","id":"darkFairy"},
|
||||||
'229':{'cls': 'enemys', 'id': 'blackKing'},
|
"260": {"cls":"enemys","id":"greenKnight"},
|
||||||
'230':{'cls': 'enemys', 'id': 'yellowKing'},
|
"261": {"cls":"enemy48","id":"angel"},
|
||||||
'231':{'cls': 'enemys', 'id': 'greenKing'},
|
"262": {"cls":"enemy48","id":"elemental"},
|
||||||
'232':{'cls': 'enemys', 'id': 'blueKnight'},
|
"263": {"cls":"enemy48","id":"steelGuard"},
|
||||||
'233':{'cls': 'enemys', 'id': 'goldSlime'},
|
"264": {"cls":"enemy48","id":"evilBat"}
|
||||||
'234':{'cls': 'enemys', 'id': 'poisonSkeleton'},
|
|
||||||
'235':{'cls': 'enemys', 'id': 'poisonBat'},
|
|
||||||
'236':{'cls': 'enemys', 'id': 'steelRock'},
|
|
||||||
'237':{'cls': 'enemys', 'id': 'skeletonPriest'},
|
|
||||||
'238':{'cls': 'enemys', 'id': 'skeletonKing'},
|
|
||||||
'239':{'cls': 'enemys', 'id': 'skeletonWizard'},
|
|
||||||
'240':{'cls': 'enemys', 'id': 'redSkeletonCaption'},
|
|
||||||
'241':{'cls': 'enemys', 'id': 'badHero'},
|
|
||||||
'242':{'cls': 'enemys', 'id': 'demon'},
|
|
||||||
'243':{'cls': 'enemys', 'id': 'demonPriest'},
|
|
||||||
'244':{'cls': 'enemys', 'id': 'goldHornSlime'},
|
|
||||||
'245':{'cls': 'enemys', 'id': 'redKing'},
|
|
||||||
'246':{'cls': 'enemys', 'id': 'whiteKing'},
|
|
||||||
'247':{'cls': 'enemys', 'id': 'blackMagician'},
|
|
||||||
'248':{'cls': 'enemys', 'id': 'silverSlime'},
|
|
||||||
'249':{'cls': 'enemys', 'id': 'swordEmperor'},
|
|
||||||
'250':{'cls': 'enemys', 'id': 'whiteHornSlime'},
|
|
||||||
'251':{'cls': 'enemys', 'id': 'badPrincess'},
|
|
||||||
'252':{'cls': 'enemys', 'id': 'badFairy'},
|
|
||||||
'253':{'cls': 'enemys', 'id': 'grayPriest'},
|
|
||||||
'254':{'cls': 'enemys', 'id': 'redSwordsman'},
|
|
||||||
'255':{'cls': 'enemys', 'id': 'whiteGhost'},
|
|
||||||
'256':{'cls': 'enemys', 'id': 'poisonZombie'},
|
|
||||||
'257':{'cls': 'enemys', 'id': 'magicDragon'},
|
|
||||||
'258':{'cls': 'enemys', 'id': 'octopus'},
|
|
||||||
'259':{'cls': 'enemys', 'id': 'darkFairy'},
|
|
||||||
'260':{'cls': 'enemys', 'id': 'greenKnight'},
|
|
||||||
|
|
||||||
'261':{'cls': 'enemy48', 'id': 'angel'},
|
|
||||||
'262':{'cls': 'enemy48', 'id': 'elemental'},
|
|
||||||
'263':{'cls': 'enemy48', 'id': 'steelGuard'},
|
|
||||||
'264':{'cls': 'enemy48', 'id': 'evilBat'},
|
|
||||||
|
|
||||||
////////////////////////// 待定... //////////////////////////
|
|
||||||
}
|
}
|
||||||
@ -24,6 +24,15 @@
|
|||||||
z-index: 370;
|
z-index: 370;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#musicBtn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 3px;
|
||||||
|
right: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 400;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#startPanel {
|
#startPanel {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
BIN
常用工具/RM动画导出器.exe
BIN
常用工具/RM动画导出器.exe
Binary file not shown.
BIN
常用工具/便捷PS工具.exe
BIN
常用工具/便捷PS工具.exe
Binary file not shown.
Loading…
Reference in New Issue
Block a user