mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-05-10 10:23:25 +08:00
Deploying to gh-pages from @ e471648e52
🚀
This commit is contained in:
parent
f9a78e8523
commit
0864048006
@ -1,4 +1,4 @@
|
||||
System.register(["./antdv-legacy.8282396f.js"],(function(n,t){"use strict";var r;return{setters:[n=>{r=n.c}],execute:function(){var t=n("l",{exports:{}});
|
||||
System.register(["./antdv-legacy.e3a2a19a.js"],(function(n,t){"use strict";var r;return{setters:[n=>{r=n.c}],execute:function(){var t=n("l",{exports:{}});
|
||||
/**
|
||||
* @license
|
||||
* Lodash <https://lodash.com/>
|
@ -1,4 +1,4 @@
|
||||
import{c as jt}from"./antdv.5500b770.js";var el={exports:{}};/**
|
||||
import{c as jt}from"./antdv.d3c1a017.js";var el={exports:{}};/**
|
||||
* @license
|
||||
* Lodash <https://lodash.com/>
|
||||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
20
assets/index-legacy.9f4dcf89.js
Normal file
20
assets/index-legacy.9f4dcf89.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
18
assets/index.49d02966.js
Normal file
18
assets/index.49d02966.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
10
index.html
10
index.html
@ -18,10 +18,10 @@
|
||||
<meta name="x5-fullscreen" content="true">
|
||||
<meta name="x5-page-mode" content="app">
|
||||
<link id="mota-css" type='text/css' href='/HumanBreak/styles.css' rel='stylesheet'>
|
||||
<script type="module" crossorigin src="/HumanBreak/assets/index.61e32055.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/HumanBreak/assets/antdv.5500b770.js">
|
||||
<link rel="modulepreload" crossorigin href="/HumanBreak/assets/common.7ff7c6bc.js">
|
||||
<link rel="stylesheet" href="/HumanBreak/assets/index.47c37c54.css">
|
||||
<script type="module" crossorigin src="/HumanBreak/assets/index.49d02966.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/HumanBreak/assets/antdv.d3c1a017.js">
|
||||
<link rel="modulepreload" crossorigin href="/HumanBreak/assets/common.311ffe86.js">
|
||||
<link rel="stylesheet" href="/HumanBreak/assets/index.854b2f74.css">
|
||||
<script type="module">try{import.meta.url;import("_").catch(()=>1);}catch(e){}window.__vite_is_modern_browser=true;</script>
|
||||
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy build because dynamic import or import.meta.url is unsupported, syntax error above should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
|
||||
</head>
|
||||
@ -215,7 +215,7 @@
|
||||
|
||||
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
|
||||
<script nomodule crossorigin id="vite-legacy-polyfill" src="/HumanBreak/assets/polyfills-legacy.fcbd97b9.js"></script>
|
||||
<script nomodule crossorigin id="vite-legacy-entry" data-src="/HumanBreak/assets/index-legacy.ca0803f1.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
|
||||
<script nomodule crossorigin id="vite-legacy-entry" data-src="/HumanBreak/assets/index-legacy.9f4dcf89.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,128 +1,127 @@
|
||||
main.floors.MT32 = {
|
||||
floorId: 'MT32',
|
||||
title: '冰封雪原',
|
||||
name: '冰封雪原',
|
||||
width: 15,
|
||||
height: 15,
|
||||
canFlyTo: true,
|
||||
canFlyFrom: true,
|
||||
canUseQuickShop: true,
|
||||
cannotViewMap: false,
|
||||
images: [],
|
||||
ratio: 8,
|
||||
defaultGround: 'T580',
|
||||
bgm: 'winter.mp3',
|
||||
firstArrive: [
|
||||
main.floors.MT32=
|
||||
{
|
||||
"floorId": "MT32",
|
||||
"title": "冰封雪原",
|
||||
"name": "冰封雪原",
|
||||
"width": 15,
|
||||
"height": 15,
|
||||
"canFlyTo": true,
|
||||
"canFlyFrom": true,
|
||||
"canUseQuickShop": true,
|
||||
"cannotViewMap": false,
|
||||
"images": [],
|
||||
"ratio": 8,
|
||||
"defaultGround": "T580",
|
||||
"bgm": "winter.mp3",
|
||||
"firstArrive": [
|
||||
{
|
||||
type: 'function',
|
||||
function: "function(){\ncore.removeMaps('MT17', 'MT21', true)\n}"
|
||||
"type": "function",
|
||||
"function": "function(){\ncore.removeMaps('MT17', 'MT21', true)\n}"
|
||||
}
|
||||
],
|
||||
eachArrive: [],
|
||||
parallelDo: '',
|
||||
events: {
|
||||
'0,7': [
|
||||
"eachArrive": [],
|
||||
"parallelDo": "",
|
||||
"events": {
|
||||
"0,7": [
|
||||
{
|
||||
type: 'if',
|
||||
condition: '(flag:inWinter2===true)',
|
||||
true: ['\t[低级智人]\b[up,hero]没必要回去了'],
|
||||
false: [
|
||||
"type": "if",
|
||||
"condition": "(flag:inWinter2===true)",
|
||||
"true": [
|
||||
"\t[低级智人]\b[up,hero]没必要回去了"
|
||||
],
|
||||
"false": [
|
||||
{
|
||||
type: 'changeFloor',
|
||||
floorId: 'MT31',
|
||||
loc: [14, 7]
|
||||
"type": "changeFloor",
|
||||
"floorId": "MT31",
|
||||
"loc": [
|
||||
14,
|
||||
7
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
'1,6': ['宝石血瓶的加成已提升至8倍'],
|
||||
'1,8': [
|
||||
'衣服是个装备,记得穿上',
|
||||
'光环会在地图上显示,如果不想要可以在背包里面的系统设置里面关闭',
|
||||
'每张地图会保证极昼怪的数量与永夜怪的数量相同',
|
||||
'注意打过永夜怪或者极昼怪之后或者有光环的时候,怪物标记可能与当前地图不符,因为标记怪物是标记的某一类怪物而不是某一点的怪物',
|
||||
'怪物手册显示的怪物是不经过光环加成的怪物,而定点查看则是经过各种加成的怪物。你可以将鼠标移动到怪物上,按下e或c使用定点查看功能'
|
||||
"1,6": [
|
||||
"宝石血瓶的加成已提升至8倍"
|
||||
],
|
||||
"1,8": [
|
||||
"衣服是个装备,记得穿上",
|
||||
"光环会在地图上显示,如果不想要可以在背包里面的系统设置里面关闭",
|
||||
"注意打过永夜怪或者极昼怪之后或者有光环的时候,怪物标记可能与当前地图不符,因为标记怪物是标记的某一类怪物而不是某一点的怪物",
|
||||
"怪物手册显示的怪物是不经过光环加成的怪物,而定点查看则是经过各种加成的怪物。你可以将鼠标移动到怪物上,按下e或c使用定点查看功能"
|
||||
]
|
||||
},
|
||||
changeFloor: {
|
||||
'14,6': {
|
||||
floorId: 'MT33',
|
||||
loc: [0, 6]
|
||||
"changeFloor": {
|
||||
"14,6": {
|
||||
"floorId": "MT33",
|
||||
"loc": [
|
||||
0,
|
||||
6
|
||||
]
|
||||
}
|
||||
},
|
||||
beforeBattle: {},
|
||||
afterBattle: {},
|
||||
afterGetItem: {},
|
||||
afterOpenDoor: {},
|
||||
autoEvent: {},
|
||||
cannotMove: {},
|
||||
cannotMoveIn: {},
|
||||
map: [
|
||||
[
|
||||
147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
|
||||
147, 147
|
||||
],
|
||||
[147, 0, 482, 441, 274, 0, 28, 147, 34, 0, 603, 0, 0, 0, 147],
|
||||
[147, 595, 147, 147, 147, 32, 0, 590, 0, 34, 587, 0, 147, 147, 147],
|
||||
[147, 0, 403, 0, 147, 602, 587, 586, 587, 587, 587, 21, 147, 381, 147],
|
||||
[147, 28, 33, 27, 492, 34, 34, 586, 34, 390, 588, 0, 592, 34, 147],
|
||||
[
|
||||
147, 147, 494, 147, 147, 585, 492, 585, 595, 588, 588, 590, 147,
|
||||
492, 147
|
||||
],
|
||||
[147, 129, 0, 21, 147, 32, 0, 602, 0, 586, 0, 0, 34, 0, 94],
|
||||
[92, 0, 589, 0, 492, 0, 32, 584, 27, 590, 0, 587, 0, 28, 147],
|
||||
[147, 129, 0, 22, 147, 590, 492, 584, 29, 586, 587, 587, 492, 147, 147],
|
||||
[147, 147, 494, 147, 147, 0, 0, 603, 0, 586, 0, 32, 32, 0, 147],
|
||||
[
|
||||
147, 27, 33, 28, 147, 147, 147, 147, 494, 585, 585, 585, 584, 602,
|
||||
147
|
||||
],
|
||||
[147, 0, 403, 0, 492, 34, 34, 147, 0, 0, 381, 381, 0, 0, 147],
|
||||
[
|
||||
147, 595, 147, 147, 147, 603, 147, 147, 147, 147, 274, 147, 147,
|
||||
590, 147
|
||||
],
|
||||
[147, 0, 21, 27, 0, 0, 0, 0, 28, 33, 0, 492, 0, 0, 147],
|
||||
[
|
||||
147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
|
||||
147, 147
|
||||
]
|
||||
],
|
||||
bgmap: [
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 145, 145, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 145, 0, 145, 145, 145, 145, 145],
|
||||
[145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 0, 145, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 145, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 0],
|
||||
[0, 145, 0, 0, 0, 0, 0, 0, 0, 0, 145, 145, 145, 145, 0],
|
||||
[0, 145, 0, 0, 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, 0],
|
||||
[0, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
],
|
||||
fgmap: [],
|
||||
bg2map: [
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 146, 146, 146, 0, 0, 0, 0, 146, 146, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 146, 146, 146, 0, 0, 0, 582, 0, 0, 0, 0, 146, 146, 0],
|
||||
[0, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 146, 146, 0],
|
||||
[0, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 581, 581, 582, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
],
|
||||
fg2map: []
|
||||
};
|
||||
"beforeBattle": {},
|
||||
"afterBattle": {},
|
||||
"afterGetItem": {},
|
||||
"afterOpenDoor": {},
|
||||
"autoEvent": {},
|
||||
"cannotMove": {},
|
||||
"cannotMoveIn": {},
|
||||
"map": [
|
||||
[147,147,147,147,147,147,147,147,147,147,147,147,147,147,147],
|
||||
[147, 0,482,441,274, 0, 28,147, 34, 0,603, 0, 0, 0,147],
|
||||
[147,595,147,147,147, 32, 0,590, 0, 34,587, 0,147,147,147],
|
||||
[147, 0,403, 0,147,602,587,586,587,587,587, 21,147,381,147],
|
||||
[147, 28, 33, 27,492, 34, 34,586, 34,390,588, 0,592, 34,147],
|
||||
[147,147,494,147,147,585,492,585,595,588,588,590,147,492,147],
|
||||
[147,129, 0, 21,147, 32, 0,602, 0,586, 0, 0, 34, 0, 94],
|
||||
[ 92, 0,589, 0,492, 0, 32,584, 27,590, 0,587, 0, 28,147],
|
||||
[147,129, 0, 22,147,590,492,584, 29,586,587,587,492,147,147],
|
||||
[147,147,494,147,147, 0, 0,603, 0,586, 0, 32, 32, 0,147],
|
||||
[147, 27, 33, 28,147,147,147,147,494,585,585,585,584,602,147],
|
||||
[147, 0,403, 0,492, 34, 34,147, 0, 0,381,381, 0, 0,147],
|
||||
[147,595,147,147,147,603,147,147,147,147,274,147,147,590,147],
|
||||
[147, 0, 21, 27, 0, 0, 0, 0, 28, 33, 0,492, 0, 0,147],
|
||||
[147,147,147,147,147,147,147,147,147,147,147,147,147,147,147]
|
||||
],
|
||||
"bgmap": [
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0,145,145, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0,145, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0,145, 0,145,145,145,145,145],
|
||||
[145,145,145,145,145,145,145,145,145,145,145, 0,145, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,145, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,145,145, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,145, 0],
|
||||
[ 0,145, 0, 0, 0, 0, 0, 0, 0, 0,145,145,145,145, 0],
|
||||
[ 0,145, 0, 0, 0, 0, 0, 0, 0, 0,145, 0, 0, 0, 0],
|
||||
[ 0,145,145,145,145,145,145,145,145,145,145, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
],
|
||||
"fgmap": [
|
||||
|
||||
],
|
||||
"bg2map": [
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0,146,146,146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0,146,146,146, 0, 0, 0, 0,146,146, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0,146,146,146, 0, 0, 0,582, 0, 0, 0, 0,146,146, 0],
|
||||
[ 0,146,146,146, 0, 0, 0, 0, 0, 0, 0, 0,146,146, 0],
|
||||
[ 0,146,146,146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0,581,581,582, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0,146,146,146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0,146,146,146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
],
|
||||
"fg2map": [
|
||||
|
||||
]
|
||||
}
|
@ -1122,29 +1122,19 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
return damageInfo;
|
||||
}
|
||||
|
||||
if (toMap.length <= 1) {
|
||||
// 单个与多个分开计算,有助于提高性能表现
|
||||
const dirDamage = [];
|
||||
for (const dir of toMap) {
|
||||
damage = Infinity;
|
||||
damageInfo = null;
|
||||
autoSkill();
|
||||
if (damageInfo) {
|
||||
return Object.assign(damageInfo, {
|
||||
dir: [toMap[0]?.[0] ?? 'none', damage]
|
||||
});
|
||||
} else return null;
|
||||
} else {
|
||||
const dirDamage = [];
|
||||
for (const dir of toMap) {
|
||||
damage = Infinity;
|
||||
damageInfo = null;
|
||||
autoSkill();
|
||||
dirDamage.push([dir, damage]);
|
||||
if (damage < dirMinDamage) {
|
||||
dirMinDamage = damage;
|
||||
dirDamageInfo = damageInfo;
|
||||
}
|
||||
if (dirDamageInfo) {
|
||||
return Object.assign(dirDamageInfo, { dir: dirDamage });
|
||||
} else return null;
|
||||
dirDamage.push([dir, damage]);
|
||||
if (damage < dirMinDamage) {
|
||||
dirMinDamage = damage;
|
||||
dirDamageInfo = damageInfo;
|
||||
}
|
||||
if (dirDamageInfo) {
|
||||
return Object.assign(dirDamageInfo, { dir: dirDamage });
|
||||
} else return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -160,9 +160,9 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
||||
"itemEffectTip": ",攻击+10"
|
||||
},
|
||||
"sword2": {
|
||||
"cls": "items",
|
||||
"cls": "equips",
|
||||
"name": "铁剑",
|
||||
"text": "真的是一把很普通的银剑,哦不,铁剑",
|
||||
"text": "真的是一把很普通的银剑,哦不,铁剑。攻击+180,额外攻击+50",
|
||||
"equip": {
|
||||
"type": 0,
|
||||
"animate": "sword",
|
||||
@ -246,17 +246,16 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
||||
"itemEffectTip": ",防御+10"
|
||||
},
|
||||
"shield2": {
|
||||
"cls": "items",
|
||||
"name": "银盾",
|
||||
"text": "一个真的很普通的铁盾,这次没错了,就是铁盾!",
|
||||
"cls": "equips",
|
||||
"name": "铁盾",
|
||||
"text": "一个真的很普通的铁盾,这次没错了,就是铁盾!防御+120,生命回复+30",
|
||||
"equip": {
|
||||
"type": 1,
|
||||
"value": {
|
||||
"hpmax": 30,
|
||||
"def": 120
|
||||
},
|
||||
"percentage": {
|
||||
"hpmax": 30
|
||||
}
|
||||
"percentage": {}
|
||||
},
|
||||
"itemEffect": "core.status.hero.def += 20",
|
||||
"itemEffectTip": ",防御+20"
|
||||
@ -1349,7 +1348,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
||||
"cls": "equips",
|
||||
"name": "寒冰护符",
|
||||
"canUseItemEffect": "true",
|
||||
"text": "与寒冰没有任何关系,但是为什么叫寒冰护符呢?攻击和额外攻击各增加5%",
|
||||
"text": "!!html<span style=\"color: gold\">饰品</span>。与寒冰没有任何关系,但是为什么叫寒冰护符呢?攻击和额外攻击各增加5%",
|
||||
"equip": {
|
||||
"type": 0,
|
||||
"value": {},
|
||||
|
@ -384,7 +384,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
|
||||
/// 是否访问过某个快捷商店
|
||||
this.isShopVisited = function (id) {
|
||||
if (!core.hasFlag('__shops__')) core.setFlag('__shops__', {});
|
||||
flags.__shops__ ??= {};
|
||||
var shops = core.getFlag('__shops__');
|
||||
if (!shops[id]) shops[id] = {};
|
||||
return shops[id].visited;
|
||||
@ -864,431 +864,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
};
|
||||
},
|
||||
itemShop: function () {
|
||||
// 道具商店相关的插件
|
||||
// 可在全塔属性-全局商店中使用「道具商店」事件块进行编辑(如果找不到可以在入口方块中找)
|
||||
|
||||
var shopId = null; // 当前商店ID
|
||||
var type = 0; // 当前正在选中的类型,0买入1卖出
|
||||
var selectItem = 0; // 当前正在选中的道具
|
||||
var selectCount = 0; // 当前已经选中的数量
|
||||
var page = 0;
|
||||
var totalPage = 0;
|
||||
var totalMoney = 0;
|
||||
var list = [];
|
||||
var shopInfo = null; // 商店信息
|
||||
var choices = []; // 商店选项
|
||||
var use = 'money';
|
||||
var useText = '金币';
|
||||
|
||||
var bigFont = core.ui._buildFont(20, false),
|
||||
middleFont = core.ui._buildFont(18, false);
|
||||
|
||||
this._drawItemShop = function () {
|
||||
// 绘制道具商店
|
||||
|
||||
// Step 1: 背景和固定的几个文字
|
||||
core.ui._createUIEvent();
|
||||
core.clearMap('ui');
|
||||
core.ui.clearUIEventSelector();
|
||||
core.setTextAlign('ui', 'left');
|
||||
core.setTextBaseline('ui', 'top');
|
||||
core.fillRect('ui', 0, 0, 480, 480, 'black');
|
||||
core.drawWindowSkin('winskin.png', 'ui', 0, 0, 480, 64);
|
||||
core.drawWindowSkin('winskin.png', 'ui', 0, 64, 360, 64);
|
||||
core.drawWindowSkin('winskin.png', 'ui', 0, 128, 360, 352);
|
||||
core.drawWindowSkin('winskin.png', 'ui', 360, 64, 120, 64);
|
||||
core.drawWindowSkin('winskin.png', 'ui', 360, 128, 120, 352);
|
||||
core.setFillStyle('ui', 'white');
|
||||
core.setStrokeStyle('ui', 'white');
|
||||
core.fillText('ui', '购买', 32, 84, 'white', bigFont);
|
||||
core.fillText('ui', '卖出', 152, 84);
|
||||
core.fillText('ui', '离开', 272, 84);
|
||||
core.fillText('ui', '当前' + useText, 374, 75, null, middleFont);
|
||||
core.setTextAlign('ui', 'right');
|
||||
core.fillText(
|
||||
'ui',
|
||||
core.formatBigNumber(core.status.hero.money),
|
||||
466,
|
||||
100
|
||||
);
|
||||
core.setTextAlign('ui', 'left');
|
||||
core.ui.drawUIEventSelector(
|
||||
1,
|
||||
'winskin.png',
|
||||
22 + 120 * type,
|
||||
76,
|
||||
60,
|
||||
33
|
||||
);
|
||||
if (selectItem != null) {
|
||||
core.setTextAlign('ui', 'center');
|
||||
core.fillText(
|
||||
'ui',
|
||||
type == 0 ? '买入个数' : '卖出个数',
|
||||
420,
|
||||
360,
|
||||
null,
|
||||
bigFont
|
||||
);
|
||||
core.fillText('ui', '< ' + selectCount + ' >', 420, 390);
|
||||
core.fillText('ui', '确定', 420, 420);
|
||||
}
|
||||
|
||||
// Step 2:获得列表并展示
|
||||
list = choices.filter(one => {
|
||||
if (one.condition != null && one.condition != '') {
|
||||
try {
|
||||
if (!core.calValue(one.condition)) return false;
|
||||
} catch (e) {}
|
||||
}
|
||||
return (
|
||||
(type == 0 && one.money != null) ||
|
||||
(type == 1 && one.sell != null)
|
||||
);
|
||||
});
|
||||
var per_page = 7;
|
||||
totalPage = Math.ceil(list.length / per_page);
|
||||
page = Math.floor((selectItem || 0) / per_page) + 1;
|
||||
|
||||
// 绘制分页
|
||||
if (totalPage > 1) {
|
||||
var half = 180;
|
||||
core.setTextAlign('ui', 'center');
|
||||
core.fillText(
|
||||
'ui',
|
||||
page + ' / ' + totalPage,
|
||||
half,
|
||||
450,
|
||||
null,
|
||||
middleFont
|
||||
);
|
||||
if (page > 1) core.fillText('ui', '上一页', half - 80, 450);
|
||||
if (page < totalPage)
|
||||
core.fillText('ui', '下一页', half + 80, 450);
|
||||
}
|
||||
core.setTextAlign('ui', 'left');
|
||||
|
||||
// 绘制每一项
|
||||
var start = (page - 1) * per_page;
|
||||
for (var i = 0; i < per_page; ++i) {
|
||||
var curr = start + i;
|
||||
if (curr >= list.length) break;
|
||||
var item = list[curr];
|
||||
core.drawIcon('ui', item.id, 10, 141 + i * 40);
|
||||
core.setTextAlign('ui', 'left');
|
||||
core.fillText(
|
||||
'ui',
|
||||
core.material.items[item.id].name,
|
||||
50,
|
||||
148 + i * 40,
|
||||
null,
|
||||
bigFont
|
||||
);
|
||||
core.setTextAlign('ui', 'right');
|
||||
core.fillText(
|
||||
'ui',
|
||||
(type == 0
|
||||
? core.calValue(item.money)
|
||||
: core.calValue(item.sell)) +
|
||||
useText +
|
||||
'/个',
|
||||
340,
|
||||
149 + i * 40,
|
||||
null,
|
||||
middleFont
|
||||
);
|
||||
core.setTextAlign('ui', 'left');
|
||||
if (curr == selectItem) {
|
||||
// 绘制描述,文字自动放缩
|
||||
var text =
|
||||
core.material.items[item.id].text || '该道具暂无描述';
|
||||
try {
|
||||
text = core.replaceText(text);
|
||||
} catch (e) {}
|
||||
for (var fontSize = 20; fontSize >= 8; fontSize -= 2) {
|
||||
var config = {
|
||||
left: 10,
|
||||
fontSize: fontSize,
|
||||
maxWidth: 467
|
||||
};
|
||||
var height = core.getTextContentHeight(text, config);
|
||||
if (height <= 60) {
|
||||
config.top = (64 - height) / 2;
|
||||
core.drawTextContent('ui', text, config);
|
||||
break;
|
||||
}
|
||||
}
|
||||
core.ui.drawUIEventSelector(
|
||||
2,
|
||||
'winskin.png',
|
||||
8,
|
||||
137 + i * 40,
|
||||
343,
|
||||
40
|
||||
);
|
||||
if (type == 0 && item.number != null) {
|
||||
core.fillText('ui', '存货', 370, 152, null, bigFont);
|
||||
core.setTextAlign('ui', 'right');
|
||||
core.fillText(
|
||||
'ui',
|
||||
item.number,
|
||||
470,
|
||||
152,
|
||||
null,
|
||||
null,
|
||||
60
|
||||
);
|
||||
} else if (type == 1) {
|
||||
core.fillText('ui', '数量', 370, 152, null, bigFont);
|
||||
core.setTextAlign('ui', 'right');
|
||||
core.fillText(
|
||||
'ui',
|
||||
core.itemCount(item.id),
|
||||
470,
|
||||
152,
|
||||
null,
|
||||
null,
|
||||
40
|
||||
);
|
||||
}
|
||||
core.setTextAlign('ui', 'left');
|
||||
core.fillText('ui', '预计' + useText, 370, 280);
|
||||
core.setTextAlign('ui', 'right');
|
||||
totalMoney =
|
||||
selectCount *
|
||||
(type == 0
|
||||
? core.calValue(item.money)
|
||||
: core.calValue(item.sell));
|
||||
core.fillText(
|
||||
'ui',
|
||||
core.formatBigNumber(totalMoney),
|
||||
470,
|
||||
310
|
||||
);
|
||||
|
||||
core.setTextAlign('ui', 'left');
|
||||
core.fillText(
|
||||
'ui',
|
||||
type == 0 ? '已购次数' : '已卖次数',
|
||||
370,
|
||||
190
|
||||
);
|
||||
core.setTextAlign('ui', 'right');
|
||||
core.fillText(
|
||||
'ui',
|
||||
(type == 0 ? item.money_count : item.sell_count) || 0,
|
||||
470,
|
||||
220
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
core.setTextAlign('ui', 'left');
|
||||
core.setTextBaseline('ui', 'alphabetic');
|
||||
};
|
||||
|
||||
var _add = (item, delta) => {
|
||||
if (item == null) return;
|
||||
selectCount = core.clamp(
|
||||
selectCount + delta,
|
||||
0,
|
||||
Math.min(
|
||||
type == 0
|
||||
? Math.floor(
|
||||
core.status.hero[use] / core.calValue(item.money)
|
||||
)
|
||||
: core.itemCount(item.id),
|
||||
type == 0 && item.number != null
|
||||
? item.number
|
||||
: Number.MAX_SAFE_INTEGER
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
var _confirm = item => {
|
||||
if (item == null || selectCount == 0) return;
|
||||
if (type == 0) {
|
||||
core.status.hero[use] -= totalMoney;
|
||||
core.getItem(item.id, selectCount);
|
||||
if (item.number != null) item.number -= selectCount;
|
||||
item.money_count = (item.money_count || 0) + selectCount;
|
||||
} else {
|
||||
core.status.hero[use] += totalMoney;
|
||||
core.removeItem(item.id, selectCount);
|
||||
core.drawTip(
|
||||
'成功卖出' +
|
||||
selectCount +
|
||||
'个' +
|
||||
core.material.items[item.id].name,
|
||||
item.id
|
||||
);
|
||||
if (item.number != null) item.number += selectCount;
|
||||
item.sell_count = (item.sell_count || 0) + selectCount;
|
||||
}
|
||||
selectCount = 0;
|
||||
};
|
||||
|
||||
this._performItemShopKeyBoard = function (keycode) {
|
||||
var item = list[selectItem] || null;
|
||||
// 键盘操作
|
||||
switch (keycode) {
|
||||
case 38: // up
|
||||
if (selectItem == null) break;
|
||||
if (selectItem == 0) selectItem = null;
|
||||
else selectItem--;
|
||||
selectCount = 0;
|
||||
break;
|
||||
case 37: // left
|
||||
if (selectItem == null) {
|
||||
if (type > 0) type--;
|
||||
break;
|
||||
}
|
||||
_add(item, -1);
|
||||
break;
|
||||
case 39: // right
|
||||
if (selectItem == null) {
|
||||
if (type < 2) type++;
|
||||
break;
|
||||
}
|
||||
_add(item, 1);
|
||||
break;
|
||||
case 40: // down
|
||||
if (selectItem == null) {
|
||||
if (list.length > 0) selectItem = 0;
|
||||
break;
|
||||
}
|
||||
if (list.length == 0) break;
|
||||
selectItem = Math.min(selectItem + 1, list.length - 1);
|
||||
selectCount = 0;
|
||||
break;
|
||||
case 13:
|
||||
case 32: // Enter/Space
|
||||
if (selectItem == null) {
|
||||
if (type == 2) core.insertAction({ type: 'break' });
|
||||
else if (list.length > 0) selectItem = 0;
|
||||
break;
|
||||
}
|
||||
_confirm(item);
|
||||
break;
|
||||
case 27: // ESC
|
||||
if (selectItem == null) {
|
||||
core.insertAction({ type: 'break' });
|
||||
break;
|
||||
}
|
||||
selectItem = null;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
this._performItemShopClick = function (px, py) {
|
||||
var item = list[selectItem] || null;
|
||||
// 鼠标操作
|
||||
if (px >= 22 && px <= 82 && py >= 81 && py <= 112) {
|
||||
// 买
|
||||
if (type != 0) {
|
||||
type = 0;
|
||||
selectItem = null;
|
||||
selectCount = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (px >= 142 && px <= 202 && py >= 81 && py <= 112) {
|
||||
// 卖
|
||||
if (type != 1) {
|
||||
type = 1;
|
||||
selectItem = null;
|
||||
selectCount = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (px >= 262 && px <= 322 && py >= 81 && py <= 112)
|
||||
// 离开
|
||||
return core.insertAction({ type: 'break' });
|
||||
// <,>
|
||||
if (px >= 370 && px <= 395 && py >= 392 && py <= 415)
|
||||
return _add(item, -1);
|
||||
if (px >= 445 && px <= 470 && py >= 302 && py <= 415)
|
||||
return _add(item, 1);
|
||||
// 确定
|
||||
if (px >= 392 && px <= 443 && py >= 421 && py <= 446)
|
||||
return _confirm(item);
|
||||
|
||||
// 上一页/下一页
|
||||
if (px >= 70 && px <= 130 && py >= 450) {
|
||||
if (page > 1) {
|
||||
selectItem -= 7;
|
||||
selectCount = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (px >= 230 && px <= 290 && py >= 450) {
|
||||
if (page < totalPage) {
|
||||
selectItem = Math.min(selectItem + 7, list.length - 1);
|
||||
selectCount = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 实际区域
|
||||
if (px >= 9 && px <= 351 && py >= 142 && py < 422) {
|
||||
if (list.length == 0) return;
|
||||
var index = parseInt((py - 142) / 40);
|
||||
var newItem = 7 * (page - 1) + index;
|
||||
if (newItem >= list.length) newItem = list.length - 1;
|
||||
if (newItem != selectItem) {
|
||||
selectItem = newItem;
|
||||
selectCount = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
this._performItemShopAction = function () {
|
||||
if (flags.type == 0)
|
||||
return this._performItemShopKeyBoard(flags.keycode);
|
||||
else return this._performItemShopClick(flags.px, flags.py);
|
||||
};
|
||||
|
||||
this.openItemShop = function (itemShopId) {
|
||||
shopId = itemShopId;
|
||||
type = 0;
|
||||
page = 0;
|
||||
selectItem = null;
|
||||
selectCount = 0;
|
||||
core.isShopVisited(itemShopId);
|
||||
shopInfo = flags.__shops__[shopId];
|
||||
if (shopInfo.choices == null)
|
||||
shopInfo.choices = core.clone(
|
||||
core.status.shops[shopId].choices
|
||||
);
|
||||
choices = shopInfo.choices;
|
||||
use = core.status.shops[shopId].use;
|
||||
if (use != 'exp') use = 'money';
|
||||
useText = use == 'money' ? '金币' : '经验';
|
||||
|
||||
core.insertAction([
|
||||
{
|
||||
type: 'while',
|
||||
condition: 'true',
|
||||
data: [
|
||||
{
|
||||
type: 'function',
|
||||
function: '() => { core.plugin._drawItemShop(); }'
|
||||
},
|
||||
{ type: 'wait' },
|
||||
{
|
||||
type: 'function',
|
||||
function:
|
||||
'() => { core.plugin._performItemShopAction(); }'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'function',
|
||||
function:
|
||||
"() => { core.deleteCanvas('ui'); core.ui.clearUIEventSelector(); }"
|
||||
}
|
||||
]);
|
||||
if (!main.replayChecking) {
|
||||
core.plugin.openedShopId = itemShopId;
|
||||
core.plugin.shopOpened.value = true;
|
||||
}
|
||||
};
|
||||
},
|
||||
heroFourFrames: function () {
|
||||
@ -3932,6 +3512,53 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
core.studySkill(enemy, num);
|
||||
return true;
|
||||
});
|
||||
|
||||
// 商店
|
||||
let shopOpened = false;
|
||||
let openedShopId = '';
|
||||
core.registerReplayAction('openShop', name => {
|
||||
if (!name.startsWith('openShop:')) return false;
|
||||
openedShopId = name.slice(9);
|
||||
shopOpened = true;
|
||||
return true;
|
||||
});
|
||||
|
||||
core.registerReplayAction('buy', name => {
|
||||
if (!name.startsWith('buy:') && !name.startsWith('sell:'))
|
||||
return false;
|
||||
if (!shopOpened) return false;
|
||||
if (!openedShopId) return false;
|
||||
const [type, id, num] = name
|
||||
.split(':')
|
||||
.map(v => (/^\d+$/.test(v) ? parseInt(v) : v));
|
||||
const shop = core.status.shops[id];
|
||||
const item = shop.choices.find(v => v.id === id);
|
||||
if (!item) return false;
|
||||
flags.itemShop ??= {};
|
||||
flags.itemShop[openedShopId] ??= {};
|
||||
flags.itemShop[openedShopId][id] ??= 0;
|
||||
if (num > item.number - flags.itemShop[openedShopId][id]) {
|
||||
return false;
|
||||
}
|
||||
let cost = 0;
|
||||
if (type === 'buy') {
|
||||
cost = item.money * num;
|
||||
} else {
|
||||
cost = -item.sell * num;
|
||||
}
|
||||
if (cost > core.status.hero.money) return false;
|
||||
core.status.hero.money -= cost;
|
||||
flags.itemShop[openedShopId][id] += type === 'buy' ? num : -num;
|
||||
return true;
|
||||
});
|
||||
|
||||
core.registerReplayAction('closeShop', name => {
|
||||
if (name !== 'closeShop') return false;
|
||||
if (!shopOpened) return false;
|
||||
shopOpened = false;
|
||||
openedShopId = '';
|
||||
return true;
|
||||
});
|
||||
},
|
||||
skillTree: function () {
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user