Merge branch 'map' of https://gitea.mota.press/Dove/Eustia into map
This commit is contained in:
commit
5602b59827
@ -128,6 +128,12 @@ var plugins_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
|||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
"_range": "typeof(thiseval)=='string' || thiseval==null",
|
"_range": "typeof(thiseval)=='string' || thiseval==null",
|
||||||
"_data": "背景音乐拼接"
|
"_data": "背景音乐拼接"
|
||||||
|
},
|
||||||
|
"scrollingText": {
|
||||||
|
"_leaf": true,
|
||||||
|
"_type": "textarea",
|
||||||
|
"_range": "typeof(thiseval)=='string' || thiseval==null",
|
||||||
|
"_data": "接收&发送在线留言"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (obj[key]) return obj[key];
|
if (obj[key]) return obj[key];
|
||||||
|
@ -37,7 +37,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"guangchang6",
|
"guangchang6",
|
||||||
"guangchang5",
|
"guangchang5",
|
||||||
"jiaocheng01",
|
"jiaocheng01",
|
||||||
"jiaocheng02"
|
"jiaocheng02",
|
||||||
|
"jiaocheng03"
|
||||||
],
|
],
|
||||||
"floorPartitions": [],
|
"floorPartitions": [],
|
||||||
"images": [
|
"images": [
|
||||||
@ -1520,7 +1521,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
},
|
},
|
||||||
"firstData": {
|
"firstData": {
|
||||||
"title": "秽翼的尤斯蒂娅",
|
"title": "秽翼的尤斯蒂娅",
|
||||||
"name": "Eustia",
|
"name": "Eustia_text",
|
||||||
"version": "鸽子窝造塔小队",
|
"version": "鸽子窝造塔小队",
|
||||||
"floorId": "jiaocheng01",
|
"floorId": "jiaocheng01",
|
||||||
"hero": {
|
"hero": {
|
||||||
@ -1532,10 +1533,10 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"hp": 1000,
|
"hp": 1000,
|
||||||
"manamax": -1,
|
"manamax": -1,
|
||||||
"mana": 0,
|
"mana": 0,
|
||||||
"atk": 30,
|
"atk": 26,
|
||||||
"def": 20,
|
"def": 16,
|
||||||
"mdef": 100,
|
"mdef": 100,
|
||||||
"speed": 20,
|
"speed": 16,
|
||||||
"money": 0,
|
"money": 0,
|
||||||
"exp": 0,
|
"exp": 0,
|
||||||
"equipment": [],
|
"equipment": [],
|
||||||
@ -1558,7 +1559,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"followers": [],
|
"followers": [],
|
||||||
"steps": 0,
|
"steps": 0,
|
||||||
"matk": 0,
|
"matk": 0,
|
||||||
"spell": 20,
|
"spell": 0,
|
||||||
"spelldef": 0,
|
"spelldef": 0,
|
||||||
"mhp": 100
|
"mhp": 100
|
||||||
},
|
},
|
||||||
@ -1915,10 +1916,6 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"startText": [
|
"startText": [
|
||||||
{
|
|
||||||
"type": "if",
|
|
||||||
"condition": "false",
|
|
||||||
"true": [
|
|
||||||
{
|
{
|
||||||
"type": "setText"
|
"type": "setText"
|
||||||
},
|
},
|
||||||
@ -1936,12 +1933,10 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
],
|
],
|
||||||
"time": 500,
|
"time": 500,
|
||||||
"keep": true
|
"keep": true
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "function",
|
"type": "function",
|
||||||
"function": "function(){\ncore.getItem('book', 1);\ncore.getItem('fly', 1);\n}"
|
"function": "function(){\ncore.getItem('book', 1);\ncore.getItem('fly', 1);\ncore.getItem('postman', 1);\ncore.getItem('I369', 1);\n}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "insert",
|
"type": "insert",
|
||||||
@ -1951,13 +1946,22 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"type": "insert",
|
"type": "insert",
|
||||||
"name": "强制横屏"
|
"name": "强制横屏"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "if",
|
|
||||||
"condition": "false",
|
|
||||||
"true": [
|
|
||||||
{
|
{
|
||||||
"type": "insert",
|
"type": "insert",
|
||||||
"name": "chapter0"
|
"name": "chapter0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "confirm",
|
||||||
|
"text": "要进行教程内容吗",
|
||||||
|
"yes": [],
|
||||||
|
"no": [
|
||||||
|
{
|
||||||
|
"type": "changeFloor",
|
||||||
|
"floorId": "guangchang",
|
||||||
|
"loc": [
|
||||||
|
6,
|
||||||
|
10
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -2,18 +2,18 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
|
|||||||
{
|
{
|
||||||
"greenSlime": {"name":"绿头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"greenSlime": {"name":"绿头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
||||||
"redSlime": {"name":"红头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"value":10,"mdef":0,"spell":0,"speed":1},
|
"redSlime": {"name":"红头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"value":10,"mdef":0,"spell":0,"speed":1},
|
||||||
"blackSlime": {"name":"青头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"blackSlime": {"name":"青头怪","hp":222,"atk":46,"def":10,"money":0,"exp":0,"point":0,"special":[],"mdef":0,"spell":0,"speed":15},
|
||||||
"slimelord": {"name":"怪王","hp":790,"atk":48,"def":8,"money":10,"exp":0,"point":0,"special":[],"mdef":0,"spell":0,"speed":20},
|
"slimelord": {"name":"怪王","hp":790,"atk":48,"def":8,"money":0,"exp":0,"point":0,"special":[],"mdef":0,"spell":0,"speed":20},
|
||||||
"bat": {"name":"小蝙蝠","hp":100,"atk":50,"def":30,"money":2,"exp":0,"point":0,"special":[1],"mdef":0,"speed":15,"spell":0},
|
"bat": {"name":"小蝙蝠","hp":100,"atk":50,"def":30,"money":2,"exp":0,"point":0,"special":[1],"mdef":0,"speed":15,"spell":0},
|
||||||
"bigBat": {"name":"大蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"bigBat": {"name":"大蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
||||||
"redBat": {"name":"红蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"mdef":0,"spell":0,"speed":1},
|
"redBat": {"name":"红蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"mdef":0,"spell":0,"speed":1},
|
||||||
"vampire": {"name":"冥灵魔王","hp":888,"atk":888,"def":888,"money":888,"exp":888,"point":0,"special":[6],"n":8,"mdef":0,"spell":0,"speed":1},
|
"vampire": {"name":"冥灵魔王","hp":888,"atk":888,"def":888,"money":888,"exp":888,"point":0,"special":[6],"n":8,"mdef":0,"spell":0,"speed":1},
|
||||||
"skeleton": {"name":"骷髅人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"skeleton": {"name":"骷髅人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
||||||
"skeletonCaptain": {"name":"骷髅队长","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"skeletonCaptain": {"name":"骷髅队长","hp":226,"atk":66,"def":1,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":18},
|
||||||
"zombie": {"name":"兽人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[22],"mdef":0,"spell":0,"speed":1},
|
"zombie": {"name":"兽人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[22],"mdef":0,"spell":0,"speed":1},
|
||||||
"zombieKnight": {"name":"兽人武士","hp":10000,"atk":100,"def":100,"money":0,"exp":0,"point":0,"special":[22],"speed":10,"mdef":0,"damage2":20,"spell":0},
|
"zombieKnight": {"name":"兽人武士","hp":10000,"atk":100,"def":100,"money":0,"exp":0,"point":0,"special":[22],"speed":10,"mdef":0,"damage2":20,"spell":0},
|
||||||
"rock": {"name":"石头人","hp":50,"atk":50,"def":0,"money":3,"exp":0,"point":0,"special":3,"damage2":15,"mdef":0,"spell":0,"speed":1},
|
"rock": {"name":"石头人","hp":50,"atk":50,"def":0,"money":3,"exp":0,"point":0,"special":3,"damage2":15,"mdef":0,"spell":0,"speed":1},
|
||||||
"bluePriest": {"name":"初级法师","hp":100,"atk":120,"def":0,"money":3,"exp":0,"point":1,"special":[9],"mdef":0,"spell":0,"speed":1},
|
"bluePriest": {"name":"初级法师","hp":108,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[9],"mdef":0,"spell":270,"speed":12},
|
||||||
"redPriest": {"name":"高级法师","hp":162,"atk":0,"def":1,"money":0,"exp":0,"point":0,"special":[1],"mdef":0,"spell":308,"speed":14},
|
"redPriest": {"name":"高级法师","hp":162,"atk":0,"def":1,"money":0,"exp":0,"point":0,"special":[1],"mdef":0,"spell":308,"speed":14},
|
||||||
"brownWizard": {"name":"初级巫师","hp":162,"atk":120,"def":1,"money":16,"exp":0,"point":0,"special":[],"value":null,"range":2,"mdef":0,"spell":66,"speed":14},
|
"brownWizard": {"name":"初级巫师","hp":162,"atk":120,"def":1,"money":16,"exp":0,"point":0,"special":[],"value":null,"range":2,"mdef":0,"spell":66,"speed":14},
|
||||||
"redWizard": {"name":"高级巫师","hp":1000,"atk":1200,"def":0,"money":160,"exp":0,"point":0,"special":15,"value":200,"zoneSquare":true,"mdef":0,"spell":0,"speed":1},
|
"redWizard": {"name":"高级巫师","hp":1000,"atk":1200,"def":0,"money":160,"exp":0,"point":0,"special":15,"value":200,"zoneSquare":true,"mdef":0,"spell":0,"speed":1},
|
||||||
@ -45,7 +45,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
|
|||||||
"goldSlimelord": {"name":"金怪王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"goldSlimelord": {"name":"金怪王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
||||||
"skeletonWarrior": {"name":"骷髅士兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"skeletonWarrior": {"name":"骷髅士兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
||||||
"whiteSlimeman": {"name":"水银战士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"whiteSlimeman": {"name":"水银战士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
||||||
"slimeman": {"name":"影子战士","hp":100,"atk":0,"def":0,"money":11,"exp":0,"point":0,"special":[9],"atkValue":2,"defValue":3,"mdef":0,"spell":0,"speed":1},
|
"slimeman": {"name":"影子战士","hp":243,"atk":28,"def":5,"money":0,"exp":0,"point":0,"special":[],"atkValue":2,"defValue":3,"mdef":0,"spell":0,"speed":69},
|
||||||
"yellowGateKeeper": {"name":"初级卫兵","hp":80,"atk":25,"def":5,"money":3,"exp":1,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"yellowGateKeeper": {"name":"初级卫兵","hp":80,"atk":25,"def":5,"money":3,"exp":1,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
||||||
"blueGateKeeper": {"name":"中级卫兵","hp":80,"atk":25,"def":5,"money":3,"exp":1,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"blueGateKeeper": {"name":"中级卫兵","hp":80,"atk":25,"def":5,"money":3,"exp":1,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
||||||
"redGateKeeper": {"name":"高级卫兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
"redGateKeeper": {"name":"高级卫兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"mdef":0,"spell":0,"speed":1},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
main.floors.jiaocheng01=
|
main.floors.jiaocheng01=
|
||||||
{
|
{
|
||||||
"floorId": "jiaocheng01",
|
"floorId": "jiaocheng01",
|
||||||
"title": "广场",
|
"title": "教程1",
|
||||||
"name": "1",
|
"name": "1",
|
||||||
"width": 13,
|
"width": 13,
|
||||||
"height": 13,
|
"height": 13,
|
||||||
@ -11,7 +11,16 @@ main.floors.jiaocheng01=
|
|||||||
"images": [],
|
"images": [],
|
||||||
"ratio": 1,
|
"ratio": 1,
|
||||||
"defaultGround": "X90078",
|
"defaultGround": "X90078",
|
||||||
"firstArrive": [],
|
"firstArrive": [
|
||||||
|
{
|
||||||
|
"type": "setHeroOpacity",
|
||||||
|
"opacity": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "setCurtain",
|
||||||
|
"time": 1000
|
||||||
|
}
|
||||||
|
],
|
||||||
"eachArrive": [],
|
"eachArrive": [],
|
||||||
"parallelDo": "",
|
"parallelDo": "",
|
||||||
"events": {
|
"events": {
|
||||||
@ -20,6 +29,78 @@ main.floors.jiaocheng01=
|
|||||||
],
|
],
|
||||||
"12,11": [
|
"12,11": [
|
||||||
"血瓶介绍:不同大小"
|
"血瓶介绍:不同大小"
|
||||||
|
],
|
||||||
|
"5,7": [
|
||||||
|
"\t[小妖精,fairy]一种颜色的钥匙开一种颜色的门。\n一把钥匙只能开一扇门。",
|
||||||
|
{
|
||||||
|
"type": "jump",
|
||||||
|
"from": [
|
||||||
|
5,
|
||||||
|
7
|
||||||
|
],
|
||||||
|
"to": [
|
||||||
|
2,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"time": 500,
|
||||||
|
"keep": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"2,2": [
|
||||||
|
"\t[小妖精,fairy]在这个游戏中,不同颜色的钥匙珍贵程度也不相同。",
|
||||||
|
"\t[小妖精,fairy]黄色的钥匙最为常见。",
|
||||||
|
"\t[小妖精,fairy]蓝色的钥匙有点罕见,其价值在正式游戏中略高于2把黄钥匙,但低于3把黄钥匙。",
|
||||||
|
"\t[小妖精,fairy]红色的钥匙比较稀有,在正式游戏中一般一把红钥匙可以换取3把蓝钥匙,但反之则有价无市。\n红色的钥匙在正式游戏中一般仅用于boss战相关,开启非常重要的道具,或绕过非常非常强力的怪物。",
|
||||||
|
"\t[小妖精,fairy]绿色的钥匙为剧情道具,在游戏进程中绿钥匙和不可绕过的绿门一一对应,但存在通往相同区域的二选一绿门。\n绿色的钥匙一般被重兵把守,且不参与其他钥匙的相互兑换。",
|
||||||
|
{
|
||||||
|
"type": "jump",
|
||||||
|
"to": [
|
||||||
|
8,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"time": 500,
|
||||||
|
"keep": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"8,1": [
|
||||||
|
"\t[小妖精,fairy]在地图上,偶尔会出现这种看起来白送一把蓝钥匙的房间。",
|
||||||
|
"\t[小妖精,fairy]然而,拿到这把“免费的”蓝钥匙,需要一把红钥匙作为前置。\n在教程关卡中,你肯定拥有这把红钥匙——如果你没有立即拿取旁边绿钥匙的话。",
|
||||||
|
"\t[小妖精,fairy]在正式游戏中,你可能当时没有,甚至在一时半会儿都不会有这把红钥匙。\n那样的话,这把蓝钥匙只能寄存在房间里。\n在拿到红钥匙之后,你的第一优先级行动就是回来拿上这把蓝钥匙。",
|
||||||
|
"\t[小妖精,fairy]这把红钥匙,以及用1红钥匙换取1红1蓝钥匙的操作,称为钥匙的周转。",
|
||||||
|
"\t[小妖精,fairy]当然,如果门口有怪物把守的话就另当别论——等到损失比较合适的时候再回来吧。",
|
||||||
|
{
|
||||||
|
"type": "jump",
|
||||||
|
"to": [
|
||||||
|
6,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"time": 500,
|
||||||
|
"keep": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "setValue",
|
||||||
|
"name": "flag:教程1",
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"6,1": [
|
||||||
|
{
|
||||||
|
"type": "if",
|
||||||
|
"condition": "(flag:教程1===1)",
|
||||||
|
"true": [
|
||||||
|
"\t[小妖精,fairy]接下来就要开始适应本游戏的战斗系统了——",
|
||||||
|
"\t[小妖精,fairy]在此之前,让我先确认一下吧。\n你拥有黄钥匙和蓝钥匙各一把,对吗?",
|
||||||
|
"\t[小妖精,fairy]相对于其他RPG游戏来说,本作的战斗系统并不需要玩家在战斗中爆手速进行操作。\n暂停或挂机也是没问题的——怪物并不会因为现实中的你不操作而主动攻击你。\n换句话说,战斗的结果在战斗开始的一瞬间就已经确定了。",
|
||||||
|
"\t[小妖精,fairy]除此之外,通过存档读档刷取随机数的操作在本作中也是不可行的。\n本作品将不涉及任何随机数的判定。\n这意味着如果你愿意,你可以百分百精确地复制一条攻略路线。",
|
||||||
|
"\t[小妖精,fairy]换句话说,本作的战斗过程只依赖于战斗双方的各项数据。\n这包括双方的面板数值,各种技能,和多样的装备。",
|
||||||
|
"\t[小妖精,fairy]本作还有另外一个特点——地图上的资源是有限的,并不会随时间自动刷新。\n这意味着不能在低级图反复刷取资源来碾压高级的怪物,必须仔细规划资源的获取及使用。",
|
||||||
|
"\t[小妖精,fairy]在手部乘区、脸部乘区、肝部乘区都被限制住的情况下——\n请开发自己的脑部乘区,迎接后面的挑战吧!",
|
||||||
|
{
|
||||||
|
"type": "hide",
|
||||||
|
"remove": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"changeFloor": {
|
"changeFloor": {
|
||||||
@ -54,14 +135,14 @@ main.floors.jiaocheng01=
|
|||||||
[ 1, 0, 0, 82, 0, 1, 81, 1, 82, 1, 1, 1, 1],
|
[ 1, 0, 0, 82, 0, 1, 81, 1, 82, 1, 1, 1, 1],
|
||||||
[ 1, 21, 1, 1, 0, 1, 22, 1, 0, 0, 21, 23, 1],
|
[ 1, 21, 1, 1, 0, 1, 22, 1, 0, 0, 21, 23, 1],
|
||||||
[ 1, 1, 1, 1, 83, 1, 1, 1, 1, 1, 1, 1, 1],
|
[ 1, 1, 1, 1, 83, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||||
[ 27, 0, 28, 1, 0, 0, 82, 0, 22, 1, 31, 0, 32],
|
[ 27, 0, 28, 1, 0,124, 82, 0, 22, 1, 31, 0, 32],
|
||||||
[ 0, 0, 0, 1, 21, 1, 1, 1, 0, 1, 0, 0, 0],
|
[ 0, 0, 0, 1, 21, 1, 1, 1, 0, 1, 0, 0, 0],
|
||||||
[ 29, 0, 30, 1, 23, 1, 21, 1, 0, 1, 34, 0, 33],
|
[ 29, 0, 30, 1, 23, 1, 21, 1, 0, 1, 34, 0, 33],
|
||||||
[ 1, 1, 1, 1, 1, 1, 0, 1, 81, 1, 1, 1, 1],
|
[ 1, 1, 1, 1, 1, 1, 0, 1, 81, 1, 1, 1, 1],
|
||||||
[129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129],
|
[129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129],
|
||||||
[ 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]
|
[ 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]
|
||||||
],
|
],
|
||||||
"areas": "牢狱",
|
"areas": "教程",
|
||||||
"bgmap": [
|
"bgmap": [
|
||||||
|
|
||||||
],
|
],
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
main.floors.jiaocheng02=
|
main.floors.jiaocheng02=
|
||||||
{
|
{
|
||||||
"floorId": "jiaocheng02",
|
"floorId": "jiaocheng02",
|
||||||
"title": "广场",
|
"title": "教程2",
|
||||||
"name": "1",
|
"name": "1",
|
||||||
"width": 13,
|
"width": 13,
|
||||||
"height": 13,
|
"height": 13,
|
||||||
@ -15,14 +15,69 @@ main.floors.jiaocheng02=
|
|||||||
"eachArrive": [],
|
"eachArrive": [],
|
||||||
"parallelDo": "",
|
"parallelDo": "",
|
||||||
"events": {
|
"events": {
|
||||||
"5,11": [
|
"9,10": [
|
||||||
"教程初始属性:\n1000HP,30攻击,20防御,20速度,20法强(*100%=20护盾)\n绿血瓶此处900,红血瓶100"
|
"\t[小妖精,fairy]恭喜你!开始了接触本作战斗系统的第一步!\n希望你刚才有好好看过战斗动画哦——当然没有也没关系!我们一点点教!",
|
||||||
|
"\t[小妖精,fairy]刚才我们的剑砍到敌人身上的时候,敌人身上冒出了一个“-16”的数字。\n这意味着我们砍出去的剑对敌人造成了16点伤害。\n这个“-16”是怎么来的呢?",
|
||||||
|
"\t[小妖精,fairy]打开怪物手册!",
|
||||||
|
{
|
||||||
|
"type": "callBook"
|
||||||
|
},
|
||||||
|
"\t[小妖精,fairy]我们拥有26点攻击力——在左边的状态栏可以看到。\n敌人拥有10点防御力——在怪物手册可以看到。\n我们的每次普通攻击将对怪物造成26-10=16点伤害。",
|
||||||
|
"\t[小妖精,fairy]同理,怪物的每次普通攻击将对我们造成46-16=30点伤害。\n在战斗动画中也有体现哦!",
|
||||||
|
"\t[小妖精,fairy]一方的生命值降低到0,意味着这一方被对方击杀。\n换句话说,如果我们的生命值被怪物的攻击压低到了0,这意味着勇士在战斗中牺牲了。\n(也就是game over啦)。",
|
||||||
|
"\t[小妖精,fairy]虽然在相同的状态下,持有更多的生命值总是更好,但生命值只是一个“够用就行”的属性。\n相较于把自己的生命值把握在自我设定的“500点”“1000点”等“安全线”上,\n用这些多余的生命值换取钥匙、能力,甚至是金币等资源,对后续的游戏过程来说会更轻松。",
|
||||||
|
"\t[小妖精,fairy]话说回来。\n怪物的生命值一共有222点。\n我们想要击杀怪物需要攻击怪物——222÷16(向上取整)=14次。\n为什么是向上取整?因为哪怕怪物还剩1点生命值,没死就是没死。",
|
||||||
|
"\t[小妖精,fairy]在我们攻击怪物14次的过程中,敌人也反击了我们13次。\n我们的生命因此损失了13*30=390点。\n如果没有关闭显伤开关的话,这个”390点“的数字将会显示在在怪物的左下角。\n剩余的生命仍然足够击败第二个相同的敌人呢——但好像还有什么事需要做?",
|
||||||
|
{
|
||||||
|
"type": "jump",
|
||||||
|
"to": [
|
||||||
|
11,
|
||||||
|
8
|
||||||
],
|
],
|
||||||
"0,0": [
|
"time": 500,
|
||||||
"匕首:速度+20"
|
"keep": true
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"12,0": [
|
"11,8": [
|
||||||
"法杖:魔攻比例10%,魔防比例0%"
|
"\t[小妖精,fairy]在本作中,有一个便捷操作,叫做“自动存档”。\n具体点说,就是在我们与怪物发生战斗前,或开门前,都会进行一个存档。\n后面我们发现之前哪一步做错了,都有机会撤销,“反悔”——最多支持反悔50步之前的错误。\n读取自动存档的快捷键是“A”键。",
|
||||||
|
"\t[小妖精,fairy]红宝石可以提高角色的攻击力。\n不同形状、不同区域的红宝石,提高攻击力的程度也不一样。\n刚才黄门里的红宝石,在当前区域每一颗可以提升角色2点攻击力。",
|
||||||
|
{
|
||||||
|
"type": "if",
|
||||||
|
"condition": "(status:hp!==280)",
|
||||||
|
"true": [
|
||||||
|
"\t[小妖精,fairy]一般来说,在地图上有无需战斗就可以获得的资源时,优先获得这些资源再进行战斗。\n获得资源提升能力,会让我们在战斗中更具有优势。\n不用为了后面保存黄钥匙!钥匙是够的!",
|
||||||
|
"\t[小妖精,fairy]所以你为什么没有拿红宝石就急匆匆地来战斗了!",
|
||||||
|
"\t[小妖精,fairy]请读取自动存档,回去拿完宝石再与敌人作战!"
|
||||||
|
],
|
||||||
|
"false": [
|
||||||
|
"\t[小妖精,fairy]在提升攻击力后,角色的攻击将更有力度。\n在获得2颗红宝石之后,角色每次攻击对怪物造成的伤害将由16点提升到20点。\n原本需要222÷16=14次攻击击杀的怪物,现在只需要222÷20=12次即可击杀。",
|
||||||
|
"\t[小妖精,fairy]由于怪物受到更少次数的攻击就被击杀了,角色受到的攻击次数也减少了。\n从13次减少到了11次。",
|
||||||
|
"\t[小妖精,fairy]但要注意——不是所有时候提升攻击力都能降低角色受到的攻击次数。\n如果角色的攻击力仅提升了1点,攻击伤害从16提升到17——\n击败怪物需要的攻击次数是222÷17,还是14次。这意味着战斗伤害不会有任何变化。",
|
||||||
|
"\t[小妖精,fairy]因此,能带来战斗伤害减少的攻击力提升节点特别重要——我们称之为“临界”。\n从最初的26点攻击力,16点攻击伤害,需要14次攻击击杀,开始计算——\n222÷13=17.077,这意味着我们至少要达到17.077的攻击伤害,才能减少击杀敌人的攻击次数——但由于本作的攻击力是整数,你必须达到18的攻击伤害,也就是28点攻击力,才能降低战斗伤害。",
|
||||||
|
"\t[小妖精,fairy]同理,以现在的状态开始计算。现在我们需要12次攻击击杀怪物。\n222÷11=20.182,我们需要21的攻击伤害,也就是31点攻击力。",
|
||||||
|
{
|
||||||
|
"type": "callBook"
|
||||||
|
},
|
||||||
|
"\t[小妖精,fairy]我们的攻击力距离下一个临界点还差1点;达到临界点可以让我们受到的伤害减少30点。\n在怪物手册中记作[1,30]或\"1:30\"。\n同样地,右上角相同的怪物身上,在战斗伤害330的数字上面,显示的是距离下一个攻击临界点的距离,\n1点。",
|
||||||
|
"\t[小妖精,fairy]但请注意,有的时候用更少的攻击次数击杀怪物,并不会让自己承受怪物的伤害变少哦!\n这就与我们接下来要讲解的属性,”速度“,有关啦。",
|
||||||
|
"\t[小妖精,fairy]哎呀——生命值好像不太够了!\n捡起后面黄门里的血瓶,补充生命值继续后面的内容吧!",
|
||||||
|
{
|
||||||
|
"type": "jump",
|
||||||
|
"to": [
|
||||||
|
11,
|
||||||
|
4
|
||||||
|
],
|
||||||
|
"time": 500,
|
||||||
|
"keep": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"11,4": [
|
||||||
|
{
|
||||||
|
"type": "hide",
|
||||||
|
"remove": true
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"changeFloor": {
|
"changeFloor": {
|
||||||
@ -32,6 +87,13 @@ main.floors.jiaocheng02=
|
|||||||
6,
|
6,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"6,0": {
|
||||||
|
"floorId": "jiaocheng03",
|
||||||
|
"loc": [
|
||||||
|
6,
|
||||||
|
12
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"beforeBattle": {},
|
"beforeBattle": {},
|
||||||
@ -42,21 +104,21 @@ main.floors.jiaocheng02=
|
|||||||
"cannotMove": {},
|
"cannotMove": {},
|
||||||
"cannotMoveIn": {},
|
"cannotMoveIn": {},
|
||||||
"map": [
|
"map": [
|
||||||
[129, 1, 27, 1, 28, 1, 91, 1, 29, 1, 30, 1,129],
|
[ 0, 33, 0,217, 31, 0, 91, 1, 28, 1, 30, 1,203],
|
||||||
[ 70, 1, 82, 1, 82, 1,236, 1, 82, 1, 82, 1,375],
|
[216, 1, 0, 1, 1, 1, 1, 1, 28, 1, 30, 1, 1],
|
||||||
[ 0, 83, 0, 29, 0, 33, 0, 31, 0, 23, 0, 83, 0],
|
[216, 1, 31, 1, 0, 0, 0, 81, 0, 1, 0, 1,211],
|
||||||
[ 1, 1, 1, 1, 1, 1,219, 1, 1, 1, 1, 1, 1],
|
[211, 1, 21, 1,216, 1,216, 1, 1, 1, 81, 1, 1],
|
||||||
[ 0, 22, 0, 31, 0, 31, 0, 1, 27, 1, 30, 1, 30],
|
[ 0, 1, 1, 1, 0, 1, 0, 0, 0,211, 0, 0, 0],
|
||||||
[ 81, 1, 81, 1, 81, 1, 22, 1, 27, 1, 30, 1, 27],
|
[ 0, 1, 32, 1, 0, 1, 1, 0, 1, 1, 1, 1,211],
|
||||||
[ 29, 1, 31, 1, 31, 1,218, 1, 82, 1, 82, 1, 82],
|
[ 0, 81, 0, 1, 0, 1, 21, 33, 1, 33, 0, 81, 0],
|
||||||
[ 28, 1, 28, 1, 29, 1, 0, 81, 0, 33, 0, 21, 0],
|
[ 31, 1, 1, 1,217, 1, 1, 1, 1, 1, 1, 1, 22],
|
||||||
[ 1, 1, 1, 1, 1, 1,240, 1, 1, 1, 1, 1, 1],
|
[203, 1, 33, 0, 0, 29, 29, 29, 29, 1, 0, 0, 0],
|
||||||
[ 0, 33, 0, 21, 0, 29, 0, 1, 27, 1, 28, 1, 31],
|
[ 0, 1, 1, 1, 0, 1, 1, 1, 1, 1,203, 1, 82],
|
||||||
[ 83, 1, 83, 1, 83, 1,204, 1, 81, 1, 81, 1, 81],
|
[ 33, 0,211, 1, 0, 1, 0,203, 0,124, 0, 1, 0],
|
||||||
[ 28, 1, 30, 1, 27,129, 0,204, 0, 33, 0, 23, 0],
|
[ 0, 81, 0, 1,217, 1, 0, 1, 1, 81, 1, 1, 21],
|
||||||
[ 1, 1, 1, 1, 1, 1, 93, 1, 1, 1, 1, 1, 1]
|
[216, 0, 0, 21, 0, 1, 93, 1, 27, 0, 27, 1, 21]
|
||||||
],
|
],
|
||||||
"areas": "牢狱",
|
"areas": "教程",
|
||||||
"bgmap": [
|
"bgmap": [
|
||||||
|
|
||||||
],
|
],
|
||||||
|
76
project/floors/jiaocheng03.js
Normal file
76
project/floors/jiaocheng03.js
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
main.floors.jiaocheng03=
|
||||||
|
{
|
||||||
|
"floorId": "jiaocheng03",
|
||||||
|
"title": "广场",
|
||||||
|
"name": "1",
|
||||||
|
"width": 13,
|
||||||
|
"height": 13,
|
||||||
|
"canFlyTo": true,
|
||||||
|
"canFlyFrom": true,
|
||||||
|
"canUseQuickShop": true,
|
||||||
|
"images": [],
|
||||||
|
"ratio": 1,
|
||||||
|
"defaultGround": "X90078",
|
||||||
|
"firstArrive": [],
|
||||||
|
"eachArrive": [],
|
||||||
|
"parallelDo": "",
|
||||||
|
"events": {
|
||||||
|
"0,0": [
|
||||||
|
"匕首:速度+20"
|
||||||
|
],
|
||||||
|
"12,0": [
|
||||||
|
"法杖:魔攻比例10%,魔防比例0%"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"changeFloor": {
|
||||||
|
"6,12": {
|
||||||
|
"floorId": "jiaocheng02",
|
||||||
|
"loc": [
|
||||||
|
6,
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"6,0": {
|
||||||
|
"floorId": "guangchang",
|
||||||
|
"loc": [
|
||||||
|
6,
|
||||||
|
10
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"beforeBattle": {},
|
||||||
|
"afterBattle": {},
|
||||||
|
"afterGetItem": {},
|
||||||
|
"afterOpenDoor": {},
|
||||||
|
"autoEvent": {},
|
||||||
|
"cannotMove": {},
|
||||||
|
"cannotMoveIn": {},
|
||||||
|
"map": [
|
||||||
|
[129, 1, 27, 1, 28, 1, 91, 1, 29, 1, 30, 1,129],
|
||||||
|
[ 70, 1, 82, 1, 82, 1,236, 1, 82, 1, 82, 1,375],
|
||||||
|
[ 0, 83, 0, 29, 0, 33, 0, 31, 0, 23, 0, 83, 0],
|
||||||
|
[ 1, 1, 1, 1, 1, 1,219, 1, 1, 1, 1, 1, 1],
|
||||||
|
[ 0, 22, 0, 31, 0, 31, 0, 1, 27, 1, 30, 1, 30],
|
||||||
|
[ 81, 1, 81, 1, 81, 1, 22, 1, 27, 1, 30, 1, 27],
|
||||||
|
[ 29, 1, 31, 1, 31, 1,218, 1, 82, 1, 82, 1, 82],
|
||||||
|
[ 28, 1, 28, 1, 29, 1, 0, 81, 0, 33, 0, 21, 0],
|
||||||
|
[ 1, 1, 1, 1, 1, 1,240, 1, 1, 1, 1, 1, 1],
|
||||||
|
[ 0, 33, 0, 21, 0, 29, 0, 1, 27, 1, 28, 1, 31],
|
||||||
|
[ 83, 1, 83, 1, 83, 1,204, 1, 81, 1, 81, 1, 81],
|
||||||
|
[ 28, 1, 30, 1, 27,129, 0,204, 0, 33, 0, 23, 0],
|
||||||
|
[ 1, 1, 1, 1, 1, 1, 93, 1, 1, 1, 1, 1, 1]
|
||||||
|
],
|
||||||
|
"areas": "牢狱",
|
||||||
|
"bgmap": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"fgmap": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"bg2map": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"fg2map": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
@ -192,6 +192,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
core.plugin.bfs();
|
core.plugin.bfs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!core.isReplaying()) core.plugin.drawCommentSign()
|
||||||
},
|
},
|
||||||
"flyTo": function (toId, callback) {
|
"flyTo": function (toId, callback) {
|
||||||
// 楼层传送器的使用,从当前楼层飞往toId
|
// 楼层传送器的使用,从当前楼层飞往toId
|
||||||
@ -2022,6 +2023,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
nowy = core.getHeroLoc("y");
|
nowy = core.getHeroLoc("y");
|
||||||
var block = core.getBlock(nowx, nowy);
|
var block = core.getBlock(nowx, nowy);
|
||||||
var hasTrigger = false;
|
var hasTrigger = false;
|
||||||
|
core.showComment(nowx, nowy)
|
||||||
if (
|
if (
|
||||||
block != null &&
|
block != null &&
|
||||||
block.event.trigger == "getItem" &&
|
block.event.trigger == "getItem" &&
|
||||||
@ -2061,7 +2063,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
core.status.hero.statistics.poisonDamage += damage;
|
core.status.hero.statistics.poisonDamage += damage;
|
||||||
core.status.hero.hp -= damage;
|
core.status.hero.hp -= damage;
|
||||||
}
|
}
|
||||||
|
core.showComment(x, y)
|
||||||
core.clearMap("hero");
|
core.clearMap("hero");
|
||||||
if (
|
if (
|
||||||
core.bigmap.width * 32 === core.bigmap.height * 32 &&
|
core.bigmap.width * 32 === core.bigmap.height * 32 &&
|
||||||
|
@ -326,7 +326,8 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
|
|||||||
"I373": 36,
|
"I373": 36,
|
||||||
"I374": 37,
|
"I374": 37,
|
||||||
"I375": 38,
|
"I375": 38,
|
||||||
"I396": 39
|
"I396": 39,
|
||||||
|
"postman": 62
|
||||||
},
|
},
|
||||||
"autotile": {
|
"autotile": {
|
||||||
"autotile": 0,
|
"autotile": 0,
|
||||||
|
@ -529,9 +529,31 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
|||||||
"canUseItemEffect": "true"
|
"canUseItemEffect": "true"
|
||||||
},
|
},
|
||||||
"I369": {
|
"I369": {
|
||||||
"cls": "items",
|
"cls": "constants",
|
||||||
"name": "新物品",
|
"name": "动画开关",
|
||||||
"canUseItemEffect": "true"
|
"canUseItemEffect": "true",
|
||||||
|
"hideInToolbox": true,
|
||||||
|
"hideInReplay": true,
|
||||||
|
"useItemEvent": [
|
||||||
|
{
|
||||||
|
"type": "confirm",
|
||||||
|
"text": "是否开启战斗动画",
|
||||||
|
"yes": [
|
||||||
|
{
|
||||||
|
"type": "setValue",
|
||||||
|
"name": "flag:noAnimate",
|
||||||
|
"value": "false"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no": [
|
||||||
|
{
|
||||||
|
"type": "setValue",
|
||||||
|
"name": "flag:noAnimate",
|
||||||
|
"value": "true"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"I370": {
|
"I370": {
|
||||||
"cls": "items",
|
"cls": "items",
|
||||||
@ -576,5 +598,67 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
|||||||
"cls": "items",
|
"cls": "items",
|
||||||
"name": "新物品",
|
"name": "新物品",
|
||||||
"canUseItemEffect": "true"
|
"canUseItemEffect": "true"
|
||||||
|
},
|
||||||
|
"postman": {
|
||||||
|
"cls": "constants",
|
||||||
|
"name": "言灵",
|
||||||
|
"canUseItemEffect": "true",
|
||||||
|
"text": "可以发送和接收在线留言。",
|
||||||
|
"hideInToolbox": true,
|
||||||
|
"hideInReplay": true,
|
||||||
|
"useItemEvent": [
|
||||||
|
{
|
||||||
|
"type": "while",
|
||||||
|
"condition": "true",
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"type": "choices",
|
||||||
|
"text": "本功能需要您在h5mota.com在线游玩并处于登录状态时使用,可以发送和接受留言。\n发言后需要选择\"获取最新留言\"才能看到自己新发的留言。",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"text": "地图上显示在线留言:${flag:comment?'开':'关'}",
|
||||||
|
"icon": "postman",
|
||||||
|
"action": [
|
||||||
|
{
|
||||||
|
"type": "function",
|
||||||
|
"function": "function(){\nif (core.hasFlag('comment')) {\n\tcore.setFlag('comment', false);\n\tcore.plugin.clearCommentSign();\n} else {\n\tcore.setFlag('comment', true);\n\tcore.plugin.drawCommentSign();\n}\n}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "写留言",
|
||||||
|
"action": [
|
||||||
|
{
|
||||||
|
"type": "input2",
|
||||||
|
"text": "请输入要发送的评论,文明友善发言,拒绝放假、剧透。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "function",
|
||||||
|
"function": "function(){\nconst input = core.getFlag('input', '');\nconst tags = [core.status.floorId,\n\tcore.getHeroLoc().x.toString(), core.getHeroLoc().y.toString()\n]\nif (!core.isReplaying()) {\n\tcore.plugin.postComment(input, tags);\n}\n}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "获取最新留言",
|
||||||
|
"action": [
|
||||||
|
{
|
||||||
|
"type": "function",
|
||||||
|
"function": "function(){\nif (!core.isReplaying()) {\n\tcore.plugin.getComment();\n\tsetTimeout(core.plugin.drawCommentSign, 1000);\n}\n}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "退出",
|
||||||
|
"action": [
|
||||||
|
{
|
||||||
|
"type": "exit"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -295,6 +295,7 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
|
|||||||
"394": {"cls":"terrains","id":"T394"},
|
"394": {"cls":"terrains","id":"T394"},
|
||||||
"395": {"cls":"terrains","id":"T395"},
|
"395": {"cls":"terrains","id":"T395"},
|
||||||
"396": {"cls":"items","id":"I396"},
|
"396": {"cls":"items","id":"I396"},
|
||||||
|
"397": {"cls":"items","id":"postman"},
|
||||||
"20034": {"cls":"tileset","id":"X20034","canPass":true},
|
"20034": {"cls":"tileset","id":"X20034","canPass":true},
|
||||||
"20154": {"cls":"tileset","id":"X20154","canPass":true},
|
"20154": {"cls":"tileset","id":"X20154","canPass":true},
|
||||||
"20216": {"cls":"tileset","id":"X20216","canPass":true},
|
"20216": {"cls":"tileset","id":"X20216","canPass":true},
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 22 KiB |
@ -2912,7 +2912,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
//道具栏列表
|
//道具栏列表
|
||||||
this.itemMx = [
|
this.itemMx = [
|
||||||
//空位用‘none’填充,当前ui至多4列6行
|
//空位用‘none’填充,当前ui至多4列6行
|
||||||
["book", "wand", "none", "fly"],
|
["book", "postman", "I369", "fly"],
|
||||||
["cross", "superPotion", "pickaxe"],
|
["cross", "superPotion", "pickaxe"],
|
||||||
["bomb", "centerFly", "upFly"],
|
["bomb", "centerFly", "upFly"],
|
||||||
["none", "none", "none"],
|
["none", "none", "none"],
|
||||||
@ -2929,7 +2929,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.openToolbox,
|
core.openToolbox,
|
||||||
core.doSL,
|
core.doSL,
|
||||||
],
|
],
|
||||||
[main.core.openSettings, main.core.save, main.core.load, core.doSL],
|
[main.core.save, main.core.load, main.core.openSettings, core.doSL],
|
||||||
];
|
];
|
||||||
this.replayAction = [
|
this.replayAction = [
|
||||||
[core.triggerReplay, core.stopReplay, core.rewindReplay],
|
[core.triggerReplay, core.stopReplay, core.rewindReplay],
|
||||||
@ -3561,7 +3561,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
["speedDown", "speedUp", "save"],
|
["speedDown", "speedUp", "save"],
|
||||||
] : [
|
] : [
|
||||||
["keyboard", "shop", "pack", "T332"],
|
["keyboard", "shop", "pack", "T332"],
|
||||||
["settings", "save", "load", "T331"],
|
["save", "load", "settings", "T331"],
|
||||||
];
|
];
|
||||||
if (core.domStyle.isVertical) {
|
if (core.domStyle.isVertical) {
|
||||||
core.clearMap(
|
core.clearMap(
|
||||||
@ -3630,15 +3630,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
case "book":
|
case "book":
|
||||||
core.openBook(true);
|
core.openBook(true);
|
||||||
break;
|
break;
|
||||||
case "wand":
|
|
||||||
core.insertAction({
|
|
||||||
type: "useItem",
|
|
||||||
id: itemId,
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "fly":
|
|
||||||
core.useItem(itemId);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
core.useItem(itemId);
|
core.useItem(itemId);
|
||||||
}
|
}
|
||||||
@ -4499,6 +4490,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.actions._sys_ondown_lockControl,
|
core.actions._sys_ondown_lockControl,
|
||||||
30
|
30
|
||||||
);
|
);
|
||||||
|
////// 绘制提示同时播放错误音效 //////
|
||||||
|
ui.prototype.drawFailTip = function (text, id, frame) {
|
||||||
|
this.drawTip(text, id, frame);
|
||||||
|
core.playSound('error.opus');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"额外信息": function () {
|
"额外信息": function () {
|
||||||
/* 宝石血瓶左下角显示数值
|
/* 宝石血瓶左下角显示数值
|
||||||
@ -5712,9 +5708,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
|
|
||||||
var itembar_right = rightArrow_right;
|
var itembar_right = rightArrow_right;
|
||||||
var boxName =
|
var boxName =
|
||||||
core.status.event.id == "toolbox"
|
core.status.event.id == "toolbox" ?
|
||||||
? "\r[yellow]道具栏\r | 装备栏"
|
"\r[yellow]道具栏\r | 装备栏" :
|
||||||
: "道具栏 | \r[yellow]装备栏\r";
|
"道具栏 | \r[yellow]装备栏\r";
|
||||||
core.drawArrow(
|
core.drawArrow(
|
||||||
ctx,
|
ctx,
|
||||||
arrow_x + arrow_width,
|
arrow_x + arrow_width,
|
||||||
@ -6106,8 +6102,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
color: "white",
|
color: "white",
|
||||||
align: "left",
|
align: "left",
|
||||||
fontSize: itemTextFontSize,
|
fontSize: itemTextFontSize,
|
||||||
maxWidth:
|
maxWidth: rightbar_width -
|
||||||
rightbar_width -
|
|
||||||
(itemText_x - rightbar_x) * 2 +
|
(itemText_x - rightbar_x) * 2 +
|
||||||
itemTextFontSize / 2,
|
itemTextFontSize / 2,
|
||||||
});
|
});
|
||||||
@ -6119,8 +6114,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
color: "white",
|
color: "white",
|
||||||
align: "left",
|
align: "left",
|
||||||
fontSize: itemTextFontSize,
|
fontSize: itemTextFontSize,
|
||||||
maxWidth:
|
maxWidth: rightbar_width -
|
||||||
rightbar_width -
|
|
||||||
(itemText_x - rightbar_x) * 2 +
|
(itemText_x - rightbar_x) * 2 +
|
||||||
itemTextFontSize / 2,
|
itemTextFontSize / 2,
|
||||||
});
|
});
|
||||||
@ -6260,9 +6254,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
if (i === 1) name = "副手";
|
if (i === 1) name = "副手";
|
||||||
var selectBorder = false;
|
var selectBorder = false;
|
||||||
if (core.status.thisUIEventInfo.select.type == i) selectBorder = true;
|
if (core.status.thisUIEventInfo.select.type == i) selectBorder = true;
|
||||||
var borderStyle = selectBorder
|
var borderStyle = selectBorder ?
|
||||||
? box_selectBorderStyle
|
box_selectBorderStyle :
|
||||||
: box_borderStyle;
|
box_borderStyle;
|
||||||
drawEquipbox_drawOne(
|
drawEquipbox_drawOne(
|
||||||
ctx,
|
ctx,
|
||||||
name,
|
name,
|
||||||
@ -6352,9 +6346,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
name = toDrawList[i];
|
name = toDrawList[i];
|
||||||
var selectBorder = false;
|
var selectBorder = false;
|
||||||
if (core.status.thisUIEventInfo.select.type == i) selectBorder = true;
|
if (core.status.thisUIEventInfo.select.type == i) selectBorder = true;
|
||||||
var borderStyle = selectBorder
|
var borderStyle = selectBorder ?
|
||||||
? box_selectBorderStyle
|
box_selectBorderStyle :
|
||||||
: box_borderStyle;
|
box_borderStyle;
|
||||||
drawEquipbox_drawOne(
|
drawEquipbox_drawOne(
|
||||||
ctx,
|
ctx,
|
||||||
name,
|
name,
|
||||||
@ -6586,8 +6580,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
if (
|
if (
|
||||||
!(
|
!(
|
||||||
info &&
|
info &&
|
||||||
info.select.id &&
|
info.select.id && ["toolbox", "equipbox"].includes(core.status.event.id)
|
||||||
["toolbox", "equipbox"].includes(core.status.event.id)
|
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
core.drawFailTip("发生了未知错误!");
|
core.drawFailTip("发生了未知错误!");
|
||||||
@ -15623,7 +15616,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
block?.event &&
|
block?.event &&
|
||||||
!main.replayChecking &&
|
!main.replayChecking &&
|
||||||
!core.isReplaying() &&
|
!core.isReplaying() &&
|
||||||
!core.getFlag("__isFlying__", false)
|
!core.hasFlag("__isFlying__") && !core.hasFlag("__fromLoad__")
|
||||||
) {
|
) {
|
||||||
const dirEntries = allChangeEntries.find(
|
const dirEntries = allChangeEntries.find(
|
||||||
(v) => v[1] === block.event.id
|
(v) => v[1] === block.event.id
|
||||||
@ -15720,9 +15713,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
_run();
|
_run();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
core.status.replay.speed == 24
|
core.status.replay.speed == 24 ?
|
||||||
? 1
|
1 :
|
||||||
: 10 / core.status.replay.speed
|
10 / core.status.replay.speed
|
||||||
);
|
);
|
||||||
|
|
||||||
core.animateFrame.lastAsyncId = animate;
|
core.animateFrame.lastAsyncId = animate;
|
||||||
@ -21658,7 +21651,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
let max = heroInfo.speed
|
let max = heroInfo.speed
|
||||||
if (enemyInfo.speed > max) max = enemyInfo.speed
|
if (enemyInfo.speed > max) max = enemyInfo.speed
|
||||||
equipInfo.forEach(v => { if (v.speed > max) max = v.speed })
|
equipInfo.forEach(v => { if (v.speed > max) max = v.speed })
|
||||||
let i = 0
|
let i = 1
|
||||||
while (oneTurn * i / max < 15) {
|
while (oneTurn * i / max < 15) {
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
@ -21666,7 +21659,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
if (enemyInfo.onAttack) enemyInfo.now *= i
|
if (enemyInfo.onAttack) enemyInfo.now *= i
|
||||||
equipInfo.forEach(v => { if (v.onAttack) v.now *= i })
|
equipInfo.forEach(v => { if (v.onAttack) v.now *= i })
|
||||||
oneTurn *= i
|
oneTurn *= i
|
||||||
console.log([oneTurn, heroInfo.now, enemyInfo.now])
|
|
||||||
let time = 0,
|
let time = 0,
|
||||||
farme = 0;
|
farme = 0;
|
||||||
return new Promise((res) => {
|
return new Promise((res) => {
|
||||||
@ -21696,11 +21688,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
(inRect(pos, easyclosebox) && easy) ||
|
(inRect(pos, easyclosebox) && easy) ||
|
||||||
(inRect(pos, uneasyclosebox) && !easy)
|
(inRect(pos, uneasyclosebox) && !easy)
|
||||||
) {
|
) {
|
||||||
core.status.event.id = "";
|
flags.qukly = !flags.qukly
|
||||||
core.unregisterAnimationFrame("attackAnimate");
|
|
||||||
core.clearMap(ctx);
|
|
||||||
core.closePanel();
|
|
||||||
res();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
async function drawAttackAnimate(
|
async function drawAttackAnimate(
|
||||||
@ -21730,7 +21719,28 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
if (v.onAttack) onAttack = true;
|
if (v.onAttack) onAttack = true;
|
||||||
});
|
});
|
||||||
core.clearMap(ctx);
|
core.clearMap(ctx);
|
||||||
let animate = Math.floor(farme / 30);
|
let animate = Math.floor(farme / 15);
|
||||||
|
|
||||||
|
if (flags.qukly) {
|
||||||
|
while (true) {
|
||||||
|
let goattack = false
|
||||||
|
equipInfo.forEach(v => {
|
||||||
|
if (v.now >= oneTurn) goattack = true
|
||||||
|
|
||||||
|
});
|
||||||
|
if (enemyInfo.now >= oneTurn) goattack = true
|
||||||
|
if (heroInfo.now >= oneTurn) goattack = true
|
||||||
|
|
||||||
|
if (goattack) break;
|
||||||
|
enemyInfo.now += enemyInfo.speed
|
||||||
|
heroInfo.now += heroInfo.speed
|
||||||
|
equipInfo.forEach(function (v) {
|
||||||
|
v.now += v.speed
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
if (easy) {
|
if (easy) {
|
||||||
core.fillRect(ctx, 64, 52, 288, 212, "rgba(0,0,0,0.5)");
|
core.fillRect(ctx, 64, 52, 288, 212, "rgba(0,0,0,0.5)");
|
||||||
core.strokeRect(ctx, 64, 52, 288, 212, "rgba(255,255,255,0.5)", 4);
|
core.strokeRect(ctx, 64, 52, 288, 212, "rgba(255,255,255,0.5)", 4);
|
||||||
@ -21861,7 +21871,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
);
|
);
|
||||||
core.fillBoldText(
|
core.fillBoldText(
|
||||||
ctx,
|
ctx,
|
||||||
"跳过",
|
flags.qukly ? "正常" : "极速",
|
||||||
330,
|
330,
|
||||||
250,
|
250,
|
||||||
"#FFFF60",
|
"#FFFF60",
|
||||||
@ -21888,7 +21898,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
"bold 36px pala"
|
"bold 36px pala"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!attack && !onAttack) enemyInfo.now += enemyInfo.speed;
|
if (!attack && !onAttack && !flags.qukly) enemyInfo.now += enemyInfo.speed;
|
||||||
let enemynow = Math.min(100 + (enemyInfo.now / oneTurn) * 215, 315);
|
let enemynow = Math.min(100 + (enemyInfo.now / oneTurn) * 215, 315);
|
||||||
ctx.fillStyle = "#FFFFFF";
|
ctx.fillStyle = "#FFFFFF";
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@ -21939,7 +21949,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
|
|
||||||
core.drawIcon(ctx, v.id, vnow - 16, 54, 32, 32);
|
core.drawIcon(ctx, v.id, vnow - 16, 54, 32, 32);
|
||||||
});
|
});
|
||||||
if (!attack && !onAttack) heroInfo.now += hero.speed;
|
if (!attack && !onAttack && !flags.qukly) heroInfo.now += hero.speed;
|
||||||
let heronow = Math.min(100 + (heroInfo.now / oneTurn) * 215, 315);
|
let heronow = Math.min(100 + (heroInfo.now / oneTurn) * 215, 315);
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(heronow, 120);
|
ctx.moveTo(heronow, 120);
|
||||||
@ -22209,7 +22219,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
);
|
);
|
||||||
core.fillBoldText(
|
core.fillBoldText(
|
||||||
ctx,
|
ctx,
|
||||||
"跳过",
|
flags.qukly ? "正常" : "极速",
|
||||||
330,
|
330,
|
||||||
365,
|
365,
|
||||||
"#FFFF60",
|
"#FFFF60",
|
||||||
@ -22236,7 +22246,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
"bold 36px pala"
|
"bold 36px pala"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!attack && !onAttack) enemyInfo.now += enemyInfo.speed;
|
if (!attack && !onAttack & !flags.qukly) enemyInfo.now += enemyInfo.speed;
|
||||||
let enemynow = Math.min(100 + (enemyInfo.now / oneTurn) * 215, 315);
|
let enemynow = Math.min(100 + (enemyInfo.now / oneTurn) * 215, 315);
|
||||||
ctx.fillStyle = "#FFFFFF";
|
ctx.fillStyle = "#FFFFFF";
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@ -22287,7 +22297,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
|
|
||||||
core.drawIcon(ctx, v.id, vnow - 16, 54, 32, 32);
|
core.drawIcon(ctx, v.id, vnow - 16, 54, 32, 32);
|
||||||
});
|
});
|
||||||
if (!attack && !onAttack) heroInfo.now += hero.speed;
|
if (!attack && !onAttack && !flags.qukly) heroInfo.now += hero.speed;
|
||||||
let heronow = Math.min(100 + (heroInfo.now / oneTurn) * 215, 315);
|
let heronow = Math.min(100 + (heroInfo.now / oneTurn) * 215, 315);
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(heronow, 120);
|
ctx.moveTo(heronow, 120);
|
||||||
@ -23679,5 +23689,242 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
|
|
||||||
ctx.restore(); //恢复变换前的坐标,否则将连续转置
|
ctx.restore(); //恢复变换前的坐标,否则将连续转置
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"scrollingText": function () {
|
||||||
|
// 本插件用于绘制在线留言
|
||||||
|
// 说明:https://h5mota.com/bbs/thread/?tid=1017
|
||||||
|
// 目前使用core.http代替帖子中提到的axios
|
||||||
|
////// 绘制提示同时播放成功音效 //////
|
||||||
|
ui.prototype.drawSuccessTip = function (text, id, frame) {
|
||||||
|
this.drawTip(text, id, frame);
|
||||||
|
core.playSound('gem.mp3');
|
||||||
|
}
|
||||||
|
core.plugin.aniMap = new Map()
|
||||||
|
////// 绘制提示同时播放错误音效 //////
|
||||||
|
ui.prototype.drawFailTip = function (text, id, frame) {
|
||||||
|
this.drawTip(text, id, frame);
|
||||||
|
core.playSound('error.mp3');
|
||||||
|
}
|
||||||
|
/** 塔的英文名 */
|
||||||
|
const towerName = core.firstData.name;
|
||||||
|
|
||||||
|
let [W, H] = [core.__SIZE__, core.__SIZE__];
|
||||||
|
let [WIDTH, HEIGHT] = [core.__PIXELS__, core.__PIXELS__];
|
||||||
|
|
||||||
|
//#region 弹幕的收发
|
||||||
|
this.getComment = function () {
|
||||||
|
if (core.isReplaying()) return;
|
||||||
|
let form = new FormData();
|
||||||
|
form.append('type', 1);
|
||||||
|
form.append('towername', towerName);
|
||||||
|
utils.prototype.http(
|
||||||
|
'POST',
|
||||||
|
'https://h5mota.com/backend/tower/barrage.php',
|
||||||
|
form,
|
||||||
|
function (res) {
|
||||||
|
try {
|
||||||
|
res = JSON.parse(res);
|
||||||
|
console.log(res);
|
||||||
|
core.drawTip('接收成功!')
|
||||||
|
core.playSound('item.mp3');
|
||||||
|
let commentCollection = {};
|
||||||
|
const commentList = res?.list;
|
||||||
|
const isEmpty = /^\s*$/;
|
||||||
|
for (let i = 0, l = commentList.length; i <= l - 1; i++) {
|
||||||
|
if (isEmpty.test(commentList[i]?.comment)) continue;
|
||||||
|
const commentTagsList = commentList[i].tags.split(',');
|
||||||
|
const [cFloorId, cX, cY] = commentTagsList;
|
||||||
|
if (0 <= cX && cX <= W - 1 && 0 <= cY && cY <= H - 1 && core.floorIds.includes(cFloorId)) {
|
||||||
|
if (!commentCollection.hasOwnProperty(cFloorId)) { commentCollection[cFloorId] = {}; }
|
||||||
|
const str = cX + ',' + cY;
|
||||||
|
if (!commentCollection[cFloorId].hasOwnProperty(str)) { commentCollection[cFloorId][str] = []; }
|
||||||
|
commentCollection[cFloorId][str].push(commentList[i]?.comment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
core.setFlag('commentCollection', commentCollection);
|
||||||
|
} catch (err) {
|
||||||
|
core.drawFailTip('接收失败!' + err.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function (err) {
|
||||||
|
err = JSON.parse(err);
|
||||||
|
console.error(err);
|
||||||
|
core.drawFailTip('接收失败' + err?.message);
|
||||||
|
},
|
||||||
|
null, null, null, 1000
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.postComment = function (comment, tags) {
|
||||||
|
if (core.isReplaying()) return;
|
||||||
|
const isEmpty = /^\s*$/;
|
||||||
|
if (isEmpty.test(comment)) {
|
||||||
|
core.drawFailTip('您输入的消息为空,请重发!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let form = new FormData();
|
||||||
|
form.append('type', 2);
|
||||||
|
form.append('towername', towerName);
|
||||||
|
form.append('comment', comment);
|
||||||
|
form.append('tags', tags);
|
||||||
|
form.append('userid', 2324);
|
||||||
|
form.append('password', '77c8fd5ff49c370342e4472ebdda5903');
|
||||||
|
utils.prototype.http(
|
||||||
|
'POST',
|
||||||
|
'https://h5mota.com/backend/tower/barrage.php',
|
||||||
|
form,
|
||||||
|
function (res) {
|
||||||
|
try {
|
||||||
|
res = JSON.parse(res);
|
||||||
|
console.log(res);
|
||||||
|
if (res?.code === 0) {
|
||||||
|
core.drawTip('提交成功!')
|
||||||
|
} else {
|
||||||
|
core.drawTip('提交失败!' + res?.message);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
core.drawFailTip('提交失败!' + err.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function (err) {
|
||||||
|
err = JSON.parse(err);
|
||||||
|
console.error(err);
|
||||||
|
core.drawFailTip('提交失败!' + err?.message);
|
||||||
|
},
|
||||||
|
null, null, null, 1000
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
/** 若变量comment为真,在每层切换时在地上有弹幕的地方显示相应图标。 */
|
||||||
|
this.drawCommentSign = function () {
|
||||||
|
if (!core.hasFlag('comment') || core.isReplaying()) return;
|
||||||
|
let commentCollection = core.getFlag('commentCollection', {}),
|
||||||
|
floorId = core.status.floorId;
|
||||||
|
core.createCanvas('sign', 0, 0, WIDTH, HEIGHT, 61);
|
||||||
|
core.setOpacity('sign', 0.6);
|
||||||
|
if (commentCollection.hasOwnProperty(floorId)) {
|
||||||
|
for (let pos in commentCollection[floorId]) {
|
||||||
|
const l = commentCollection[floorId][pos].length;
|
||||||
|
for (let i = 0; i <= l - 1; i++) {
|
||||||
|
const [x, y] = pos.split(',');
|
||||||
|
core.drawIcon('sign', 'postman', 32 * x, 32 * y);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 立即清除楼层的弹幕图标。关闭弹幕相关设置时调用。 */
|
||||||
|
this.clearCommentSign = function () {
|
||||||
|
core.deleteCanvas('sign');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 默认一次显示的弹幕数 */
|
||||||
|
const showNum = 5;
|
||||||
|
|
||||||
|
// 每走一步或瞬移,调用该函数,若目标点有弹幕,显示之
|
||||||
|
this.showComment = function (x, y) {
|
||||||
|
if (!core.getFlag('comment') || core.isReplaying()) return;
|
||||||
|
const commentCollection = core.getFlag('commentCollection', {});
|
||||||
|
const floorId = core.status.floorId,
|
||||||
|
str = x + ',' + y;
|
||||||
|
if (commentCollection.hasOwnProperty(floorId) &&
|
||||||
|
commentCollection[floorId].hasOwnProperty(str)) {
|
||||||
|
let commentArr = commentCollection[floorId][str].concat();
|
||||||
|
const commentArrPicked = pickComment(commentArr, showNum);
|
||||||
|
drawComment(commentArrPicked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 返回从commentArr中挑选showNum个comment组成的数组*/
|
||||||
|
function pickComment(commentArr, showNum) {
|
||||||
|
let showList = [];
|
||||||
|
if (commentArr.length <= showNum) {
|
||||||
|
showList = commentArr;
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i <= showNum - 1; i++) {
|
||||||
|
const l = commentArr.length,
|
||||||
|
n = core.plugin.dice(l - 1);
|
||||||
|
showList.push(commentArr[n]);
|
||||||
|
commentArr.splice(n, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return showList;
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawComment(commentArr) {
|
||||||
|
const l = commentArr.length;
|
||||||
|
let yList = generateCommentYList(20, HEIGHT - 20, showNum);
|
||||||
|
if (l < showNum) yList = getRandomElements(yList, l);
|
||||||
|
for (let i = 0; i <= l - 1; i++) {
|
||||||
|
drawCommentStr(commentArr[i], WIDTH + 20 * Math.random(),
|
||||||
|
yList[i], Math.random() * 0.1 + 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 生成count个随机数,范围从min到max,作为弹幕的y坐标*/
|
||||||
|
function generateCommentYList(min, max, count) {
|
||||||
|
let yList = Array(count).fill(0);
|
||||||
|
const distance = (max - min) / (count + 1);
|
||||||
|
for (let i = 0; i < count; i++) {
|
||||||
|
yList[i] = min + distance * (i + 1) + (Math.random() - 0.5) * (distance / 2);
|
||||||
|
}
|
||||||
|
return yList;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRandomElements(arr, count) {
|
||||||
|
let result = [...arr];
|
||||||
|
let len = result.length;
|
||||||
|
count = Math.min(len, count);
|
||||||
|
|
||||||
|
for (let i = len - 1; i > len - 1 - count; i--) {
|
||||||
|
let j = Math.floor(Math.random() * (i + 1));
|
||||||
|
[result[i], result[j]] = [result[j], result[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.slice(len - count);
|
||||||
|
}
|
||||||
|
|
||||||
|
//#region 弹幕绘制部分
|
||||||
|
const { Animation, linear, Ticker } = core.plugin.animate ?? {};
|
||||||
|
const ctxName = 'scrollingText';
|
||||||
|
|
||||||
|
if (Ticker) {
|
||||||
|
const ticker = new Ticker();
|
||||||
|
ticker.add(() => {
|
||||||
|
if (core.isReplaying()) return;
|
||||||
|
core.createCanvas(ctxName, 0, 0, core.__PIXELS__, core.__PIXELS__, 136); //每帧重绘该画布
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绘制弹幕
|
||||||
|
* @example
|
||||||
|
* drawCommentStr('OK', 450, 200, 0.1);
|
||||||
|
* @param {string} content 弹幕的内容
|
||||||
|
* @param {number} x 弹幕的初始x坐标
|
||||||
|
* @param {number} y 弹幕的初始y坐标
|
||||||
|
* @param {number} vx 弹幕的横向滚动速度
|
||||||
|
*/
|
||||||
|
function drawCommentStr(content, x, y, vx) {
|
||||||
|
if (core.isReplaying() || !Animation) return;
|
||||||
|
const ani = new Animation();
|
||||||
|
core.plugin.aniMap.set(ani, (ani) => ani.ticker.destroy());
|
||||||
|
ani.ticker.add(() => {
|
||||||
|
core.fillText(ctxName, content, x + ani.x, y, 'white', '16px Verdana');
|
||||||
|
})
|
||||||
|
// 弹幕的最大长度5600,再长属于异常数据
|
||||||
|
const aim = 600 + Math.min(core.calWidth(ctxName, content, '16px Verdana'), 5000);
|
||||||
|
ani.mode(linear())
|
||||||
|
.time(aim / vx)
|
||||||
|
.absolute()
|
||||||
|
.move(-aim, 0)
|
||||||
|
ani.all().then(() => {
|
||||||
|
ani.ticker.destroy();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user