移动鼠标查看怪物信息

This commit is contained in:
unanmed 2023-01-06 21:51:58 +08:00
parent b84b1e6137
commit ac55517d57
21 changed files with 476 additions and 141 deletions

View File

@ -3056,7 +3056,14 @@ control.prototype.getStatus = function (name) {
if (main.mode == 'editor' && !core.hasFlag('__statistics__')) {
return data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.firstData.hero[name];
}
return core.status.hero[name];
if (name === 'atk' || name === 'def') {
return (
core.status.hero[name] +
(window.flags?.[`night_${core.status.floorId}`] ?? 0)
);
} else {
return core.status.hero[name];
}
};
////// 从status中获得属性如果不存在则从勇士属性中获取 //////

View File

@ -262,29 +262,14 @@ enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId) {
return [[info.__overAtk__ || 0, 0]];
}
if (core.flags.useLoop) {
if (core.status.hero.atk <= (main.criticalUseLoop || 1)) {
return this._nextCriticals_useLoop(
enemy,
info,
number,
x,
y,
floorId
);
} else {
return this._nextCriticals_useBinarySearch(
enemy,
info,
number,
x,
y,
floorId
);
}
} else {
return this._nextCriticals_useTurn(enemy, info, number, x, y, floorId);
}
return this._nextCriticals_useBinarySearch(
enemy,
info,
number,
x,
y,
floorId
);
};
/// 未破防临界采用二分计算
@ -316,10 +301,10 @@ enemys.prototype._nextCriticals_overAtk = function (enemy, x, y, floorId) {
);
return nextInfo == null
? null
: [start - core.status.hero.atk, nextInfo];
: [start - core.getStatus('atk'), nextInfo];
};
return calNext(
core.status.hero.atk + 1,
core.getStatus('atk') + 1,
core.getEnemyValue(enemy, 'hp', x, y, floorId) +
core.getEnemyValue(enemy, 'def', x, y, floorId)
);
@ -346,7 +331,7 @@ enemys.prototype._nextCriticals_useLoop = function (
floorId
) {
var mon_hp = info.mon_hp,
hero_atk = core.status.hero.atk,
hero_atk = core.getStatus('atk'),
mon_def = info.mon_def,
pre = info.damage;
var list = [];
@ -378,7 +363,7 @@ enemys.prototype._nextCriticals_useBinarySearch = function (
floorId
) {
var mon_hp = info.mon_hp,
hero_atk = core.status.hero.atk,
hero_atk = core.getStatus('atk'),
mon_def = info.mon_def,
pre = info.damage;
var list = [];
@ -442,7 +427,7 @@ enemys.prototype._nextCriticals_useTurn = function (
floorId
) {
var mon_hp = info.mon_hp,
hero_atk = core.status.hero.atk,
hero_atk = core.getStatus('atk'),
mon_def = info.mon_def,
turn = info.turn;
// ------ 超大回合数强制使用二分算临界
@ -499,7 +484,7 @@ enemys.prototype.getDefDamage = function (enemy, k, x, y, floorId) {
var nowDamage = this._getDamage(enemy, null, x, y, floorId);
var nextDamage = this._getDamage(
enemy,
{ def: core.status.hero.def + k },
{ def: core.getStatus('def') + k },
x,
y,
floorId

View File

@ -141,7 +141,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
"E579": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E590": {"name":"冰封史莱姆","hp":7500,"atk":1750,"def":1000,"money":2,"exp":75,"point":0,"special":[20],"ice":25},
"E591": {"name":"新敌人","hp":10000,"atk":2000,"def":1000,"money":0,"exp":0,"point":0,"special":[]},
"E592": {"name":"冰封巨兽","hp":10000,"atk":2000,"def":1000,"money":2,"exp":85,"point":0,"special":[20,21],"iceHalo":10,"ice":50},
"E592": {"name":"冰封巨兽","hp":6000,"atk":1750,"def":1000,"money":2,"exp":85,"point":0,"special":[20,21],"iceHalo":20,"ice":50},
"E593": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E594": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E595": {"name":"寒冰兽人","hp":12500,"atk":1800,"def":800,"money":2,"exp":100,"point":0,"special":[7],"hungry":25},
@ -151,6 +151,6 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
"E599": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E600": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E601": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E602": {"name":"永夜","hp":6000,"atk":2000,"def":800,"money":1,"exp":65,"point":0,"special":[22],"night":100},
"E602": {"name":"永夜","hp":6000,"atk":2000,"def":800,"money":1,"exp":65,"point":0,"special":[22],"night":100},
"E603": {"name":"极昼蝠","hp":8000,"atk":1750,"def":1000,"money":1,"exp":65,"point":0,"special":[23],"day":100}
}

View File

@ -19,11 +19,20 @@ main.floors.MT22=
"events": {
"0,8": [
{
"type": "changeFloor",
"floorId": "MT21",
"loc": [
14,
8
"type": "if",
"condition": "flag:inWinter",
"true": [
"\t[初级智人]\b[up,hero]没必要再回去了"
],
"false": [
{
"type": "changeFloor",
"floorId": "MT21",
"loc": [
14,
8
]
}
]
}
],

View File

@ -140,6 +140,16 @@ main.floors.MT31=
}
]
}
],
"2,6": [
"注意右方的清怪检测是检测\r[gold]勇气之路\r[]的怪物,本区域的怪物不检测,可以暂时留怪"
],
"13,7": [
"这里是漏怪检测,会检测\r[gold]勇气之路\r[]区域是否有遗漏怪物",
{
"type": "function",
"function": "function(){\nconst enemy = core.getRemainEnemyString(core.floorIds.slice(17, 22));\nif (enemy.length === 0) {\n\tcore.insertAction(['当前无剩余怪物!', { \"type\": \"hide\", \"remove\": true }, ]);\n} else {\n\tcore.insertAction(enemy);\n}\n}"
}
]
},
"changeFloor": {
@ -246,8 +256,8 @@ main.floors.MT31=
[143,143,143,143,143,143,143,143,143,143,143,143,143,143,143],
[143,143, 0, 0, 0, 0,143,491,491,468,468,466,466,143,143],
[143,143, 0,491,491, 0,143, 85,143,143,143,143,143,143,143],
[143,143, 0, 0, 0, 0,143, 0, 0, 0, 0, 0, 0,143,143],
[ 92, 0, 0, 23,123, 0,497, 0, 0, 0,577, 0, 0, 0, 94],
[143,143,129, 0, 0, 0,143, 0, 0, 0, 0, 0, 0,143,143],
[ 92, 0, 0, 23,123, 0,497, 0, 0, 0,577, 0, 0,516, 94],
[143,143, 0, 0, 0, 0,143, 0, 0, 0, 0, 0, 0,143,143],
[143,143, 0,491,491, 0,143, 85,143,143,143,143,143,143,143],
[143,143, 0, 0, 0, 0,143,491,491,468,468,467,467,143,143],

View File

@ -13,7 +13,12 @@ main.floors.MT32=
"ratio": 8,
"defaultGround": "T580",
"bgm": "winter.mp3",
"firstArrive": [],
"firstArrive": [
{
"type": "function",
"function": "function(){\ncore.removeMaps('MT17', 'MT21', true)\n}"
}
],
"eachArrive": [],
"parallelDo": "",
"events": {
@ -33,10 +38,19 @@ main.floors.MT32=
"1,8": [
"衣服是个装备,记得穿上",
"光环会在地图上显示,如果不想要可以在背包里面的系统设置里面关闭",
"每张地图会保证极昼怪的数量与永夜怪的数量相同"
"每张地图会保证极昼怪的数量与永夜怪的数量相同",
"注意打过永夜怪或者极昼怪之后怪物标记可能与当前地图不符,因为标记怪物是标记的某一类怪物而不是某一点的怪物"
]
},
"changeFloor": {},
"changeFloor": {
"14,6": {
"floorId": "MT33",
"loc": [
0,
6
]
}
},
"beforeBattle": {},
"afterBattle": {},
"afterGetItem": {},
@ -46,19 +60,19 @@ main.floors.MT32=
"cannotMoveIn": {},
"map": [
[147,147,147,147,147,147,147,147,147,147,147,147,147,147,147],
[147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,147],
[147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,147],
[147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,147],
[147, 0, 0, 0, 0,514, 0, 0, 0, 0, 0, 0, 0, 0,147],
[147,147,147,147,147, 0,274, 0, 0, 0, 0, 0, 0, 0,147],
[147,129, 0, 21,147,590, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 92, 0,589, 0,492, 0,595, 0, 0, 0, 0, 0, 0, 0,147],
[147,129, 0, 22,147,602, 0, 0, 0, 0, 0, 0, 0, 0,147],
[147,147,147,147,147, 0,603, 0, 0, 0, 0, 0, 0, 0,147],
[147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,147],
[147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,592, 0, 0,147],
[147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,147],
[147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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": [
@ -66,16 +80,16 @@ main.floors.MT32=
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 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,145,145],
[145,145,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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": [
@ -85,15 +99,15 @@ main.floors.MT32=
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 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,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,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],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

View File

@ -1,45 +1,65 @@
main.floors.MT33=
{
"floorId": "MT33",
"title": "冰封雪原",
"name": "冰封雪原",
"width": 15,
"height": 15,
"canFlyTo": true,
"canFlyFrom": true,
"canUseQuickShop": true,
"cannotViewMap": false,
"images": [],
"ratio": 8,
"defaultGround": "T580",
"bgm": "winter.mp3",
"firstArrive": [],
"eachArrive": [],
"parallelDo": "",
"events": {},
"changeFloor": {},
"beforeBattle": {},
"afterBattle": {},
"afterGetItem": {},
"afterOpenDoor": {},
"autoEvent": {},
"cannotMove": {},
"cannotMoveIn": {},
"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]
"floorId": "MT33",
"title": "冰封雪原",
"name": "冰封雪原",
"width": 15,
"height": 15,
"canFlyTo": true,
"canFlyFrom": true,
"canUseQuickShop": true,
"cannotViewMap": false,
"images": [],
"ratio": 8,
"defaultGround": "T580",
"bgm": "winter.mp3",
"firstArrive": [],
"eachArrive": [],
"parallelDo": "",
"events": {},
"changeFloor": {
"0,6": {
"floorId": "MT32",
"loc": [
14,
6
]
}
},
"beforeBattle": {},
"afterBattle": {},
"afterGetItem": {},
"afterOpenDoor": {},
"autoEvent": {},
"cannotMove": {},
"cannotMoveIn": {},
"map": [
[147,147,147,147,147,147,147,147,147, 0,147,147,147,147,147],
[147, 0, 0, 0, 0, 0,147, 0,595, 0,592, 0, 0, 0,147],
[147,147,147,147,147,590,147, 0,586, 0,492, 0, 0, 0,147],
[147, 0,595, 0, 0, 0,147,586,586, 0,585,147,147,603, 0],
[147, 0,147,147,147,592, 0, 0, 0, 0,585,484,274, 0,147],
[147, 21, 34,147, 0,492,492,587,587,587,147,147,147, 0,147],
[ 92, 0, 0,590, 0,587, 32, 32,274, 32, 0, 32,147, 0,147],
[147,147,147,147, 27,587,587,602,585, 0,396, 0,147,603,147],
[147, 28, 34,274, 34,381, 0, 0,585,147,147,147,147, 0,147],
[147,403, 27,147,147,147,602,585,585, 0,602, 0, 0, 0,147],
[147,147,147,147, 0, 0, 0, 0,585, 0,147,147,147,147,147],
[147, 0, 0,147,590,147,147,147,147, 0,147, 0, 0, 0,147],
[147,147, 0,595, 0, 0, 0,147,147, 0,514, 0, 0,147,147],
[147,147,147,147,147, 0, 0, 0,603, 0,147,147,147,147,147],
[147,147,147,147,147,147,147,147,147,147,147,147,147,147,147]
],
"bgmap": [
],
"fgmap": [
],
"bg2map": [
],
"fg2map": [
]
}

View File

@ -326,6 +326,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
},
afterBattle: function (enemyId, x, y) {
// 战斗结束后触发的事件
const floorId = core.status.floorId;
var enemy = core.material.enemys[enemyId];
var special = enemy.special;
@ -369,7 +370,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
// 智慧之源
if (core.hasSpecial(special, 14) && flags.hard == 2) {
var floorId = core.status.floorId;
core.addFlag(
'inte_' + floorId,
Math.ceil((core.status.hero.mdef / 10) * 0.3) * 10
@ -378,6 +378,16 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
Math.ceil((core.status.hero.mdef / 10) * 0.3) * 10;
}
// 极昼永夜
if (core.hasSpecial(special, 22)) {
flags[`night_${floorId}`] ??= 0;
flags[`night_${floorId}`] -= enemy.night;
}
if (core.hasSpecial(special, 23)) {
flags[`night_${floorId}`] ??= 0;
flags[`night_${floorId}`] += enemy.day;
}
if (core.getSkillLevel(11) > 0) {
core.declineStudiedSkill();
}
@ -593,7 +603,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
'%加在自己身上(勇士攻击也会降低)'
);
},
'#b30000'
'#b67'
],
[
8,
@ -724,14 +734,14 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
22,
'永夜',
enemy =>
`战斗后,减少勇士${enemy.night}点攻防,加到本层所有怪物身上`,
`战斗后,减少勇士${enemy.night}点攻防,增加本层所有怪物${enemy.night}点攻防,仅在本层有效`,
'#d8a'
],
[
23,
'极昼',
enemy =>
`战斗后,减少本层所有怪物${enemy.day}点攻防,加到勇士身上`,
`战斗后,减少本层所有怪物${enemy.day}点攻防,增加勇士${enemy.day}点攻防,仅在本层有效`,
'#ffd'
],
[
@ -815,6 +825,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
mon_atk += core.getFlag('inte_' + floorId, 0);
}
// 极昼永夜
mon_atk -= flags[`night_${floorId}`] ?? 0;
mon_def -= flags[`night_${floorId}`] ?? 0;
if (flags.blade && flags.bladeOn) {
hero_atk *= 1 + core.getSkillLevel(2) / 10;
hero_def *= 1 - core.getSkillLevel(2) / 10;
@ -1470,7 +1484,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
const haloMap = {
21: 'square:7:cyan'
};
const haloEntry = Object.entries(haloMap);
var width = core.floors[floorId].width,
height = core.floors[floorId].height;
@ -1711,12 +1724,13 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
needCache = true;
if (specialFlag & 2) haveHunt = true;
// 检查范围光环
if (enemy) {
for (const [num, range] of haloEntry) {
const n = parseInt(num);
if (core.hasSpecial(enemy.special, n)) {
if (!(enemy.special instanceof Array)) continue;
for (const num of enemy.special) {
if (num in haloMap) {
halo[loc] ??= [];
halo[loc].push(range);
halo[loc].push(haloMap[num]);
}
}
}

View File

@ -541,6 +541,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
flags.__disabled__ = flags.__disabled__ || {};
flags.__leaveLoc__ = flags.__leaveLoc__ || {};
flags.__forceDelete__ ??= {};
let deleted = false;
for (var i = fromIndex; i <= toIndex; ++i) {
var floorId = core.floorIds[i];
if (core.status.maps[floorId].deleted) continue;
@ -562,6 +563,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
core.status.maps[floorId].forceDelete = true;
flags.__forceDelete__[floorId] = true;
}
deleted = true;
}
if (deleted && !main.replayChecking) {
core.splitArea();
}
};
@ -4602,9 +4607,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
if (!core.getLocalStorage('showHalo', true)) return;
const halo = core.status.checkBlock.halo;
ctx.save();
core.clearMap(ctx);
ctx.globalAlpha = 0.1;
ctx.globalCompositeOperation = 'source-over';
for (const [loc, range] of Object.entries(halo)) {
const [x, y] = loc.split(',').map(v => parseInt(v));
for (const r of range) {

View File

@ -5,6 +5,7 @@
<Studied
v-if="showStudiedSkill && showStatusBar && showStudied"
></Studied>
<Fixed v-if="showStatusBar && useFixed"></Fixed>
<Chapter v-if="chapterShowed" :chapter="chapterContent"></Chapter>
</div>
</template>
@ -18,7 +19,8 @@ import Chapter from './ui/chapter.vue';
import { chapterContent, chapterShowed } from './plugin/ui/chapter';
import { showMarkedEnemy } from './plugin/mark';
import Studied from './ui/studied.vue';
import { showStudied } from './plugin/settings';
import { showStudied, useFixed } from './plugin/settings';
import Fixed from './ui/fixed.vue';
</script>
<style lang="less" scoped>

View File

@ -14,18 +14,22 @@
"同时每次增加新内容时都会有提示。",
"<br>",
"<br>",
"3. 本塔中<span style=\"color: gold\">几乎所有 ui </span>都可以纵向滚动,如果发现显示不全,",
"3. 背包中的系统设置同样非常重要,有些问题可以在那里找到原因。例如当你获得技能时可能会发现开启不了技能,",
"就是因为你打开了自动切换技能的功能,在系统设置里面有说。",
"<br>",
"<br>",
"4. 本塔中<span style=\"color: gold\">几乎所有 ui </span>都可以纵向滚动,如果发现显示不全,",
"可以尝试上下拖动,就像浏览网页一样。电脑端还可以使用滚轮上下滚动。",
"大部分可以纵向滚动的 ui 都会在右方有一个滚动条,也可以拖动它进行滚动,例如本百科全书的条目列表和",
"条目说明都是可以通过上述方式滚动的。",
"<br>",
"<br>",
"4. 本塔主要面向电脑端设计,",
"5. 本塔主要面向电脑端设计,",
"<span style=\"color: gold\">建议使用电脑游玩以获得更好的游戏体验</span>。但是手机依然可以游玩本塔,",
"但部分操作可能不是很方便ui 也可能不是很美观,不过依然可以完整体验本游戏。",
"<br>",
"<br>",
"5. 对于手机端,可以点击<span style=\"color: gold\">右下角的难度文字</span>来切换工具栏至数字键。",
"6. 对于手机端,可以点击<span style=\"color: gold\">右下角的难度文字</span>来切换工具栏至数字键。",
"这样,你可以更加方便地进行使用技能等操作。",
"<br>",
"<br>",
@ -135,6 +139,7 @@
"condition": "true",
"desc": [
"这里包含本塔中所有的快捷键。对于手机端,可以点击工具栏的难度的位置切换工具栏至数字键。",
"下面会分为样板快捷键和本塔快捷键两类。",
"<br>",
"<br>",
"下面是样板中的所有快捷键:",
@ -176,13 +181,15 @@
"<span style=\"color: gold\">P</span>:打开评论区",
"<br>",
"<br>",
"下面是本塔中新增的快捷键",
"下面是本塔中新增的快捷键(不包括技能,技能快捷键请在查看技能界面中查看)",
"<br>",
"<span style=\"color: gold\">M</span>:快速标记怪物",
"<br>",
"<span style=\"color: gold\">J</span>:打开技能树",
"<br>",
"<span style=\"color: gold\">H</span>:打开百科全书"
"<span style=\"color: gold\">H</span>:打开百科全书",
"<br>",
"<span style=\"color: gold\">K</span>:查看鼠标位置怪物的详细信息"
]
},
"extraAttr": {
@ -476,7 +483,12 @@
"该特技会撞碎路上的所有地形和门,不需要消耗钥匙,拾取路上的所有道具,与路上的怪物战斗,最后与该怪物战斗。",
"如果怪物所在位置可以被嘲讽,那么勇士会被继续嘲讽。如果在被嘲讽的路上可以被其他怪物嘲讽,则不会触发。",
"如果一个点可以被多个怪物嘲讽,那么会优先选择最靠左上角的怪物。",
"<span style=\"color: gold\">在被嘲讽之前会自动存档。</span>"
"<span style=\"color: gold\">在被嘲讽之前会自动存档。</span>",
"<br>",
"<br>",
"<span style=\"color: #d8a\">2. 永夜</span>、<span style=\"color: #ffd\">极昼</span>",
"战斗后会在本楼层中加减怪物与勇士的攻防每个楼层会单独存储。例如你在1楼层增加了100点攻击2楼层减少了100点攻击",
"那么当你从2楼层到1楼层时攻击会增加200点反之亦然。注意这里没有计算buff。"
]
}
}

View File

@ -34,6 +34,15 @@
"text": "展示范围光环",
"desc": ["开启后,会在地图上显示范围光环。"]
},
"useFixed": {
"text": "移动鼠标显示怪物信息",
"desc": [
"开启后,当鼠标移动到怪物上时,会以盒子的形式展示该点的怪物信息。",
"<br>",
"<br>",
"注当鼠标移动到怪物上时经过200毫秒才会显示信息防止误操作。"
]
},
"showStudied": {
"text": "展示已学习技能",
"desc": [

View File

@ -10,6 +10,7 @@ import setting from './plugin/settings';
import chapter from './plugin/ui/chapter';
import fly from './plugin/ui/fly';
import chase from './plugin/chase/chase';
import fixed from './plugin/ui/fixed';
function forward() {
// 每个引入的插件都要在这里执行,否则不会被转发
@ -24,7 +25,8 @@ function forward() {
setting(),
chapter(),
fly(),
chase()
chase(),
fixed()
];
// 初始化所有插件并转发到core上

View File

@ -117,8 +117,8 @@ const ratio = core.status.thisMap.ratio;
const nowDamage = computed(() => {
const dam = core.getDamageInfo(enemy, {
atk: core.status.hero.atk + addAtk.value * ratio,
def: core.status.hero.def + addDef.value * ratio
atk: core.getStatus('atk') + addAtk.value * ratio,
def: core.getStatus('def') + addDef.value * ratio
});
if (!has(dam)) return ['???', '???'];
if (!has(originDamage)) return [-dam.damage, dam.damage];

View File

@ -30,6 +30,11 @@ export const showHalo = ref(true);
*/
export const showStudied = ref(true);
/**
* 使
*/
export const useFixed = ref(true);
watch(transition, n => {
core.plugin.transition.value = n;
core.setLocalStorage('transition', n);
@ -58,6 +63,10 @@ watch(showHalo, n => {
core.setLocalStorage('showHalo', n);
});
watch(useFixed, n => {
core.setLocalStorage('useFixed', n);
});
/**
* localStorage读取即可
*/

View File

@ -60,8 +60,8 @@ export function getDefDamage(
for (let i = 0; i <= max; i++) {
const dam = core.getDamageInfo(enemy.id, {
def: core.status.hero.def + ratio * i + addDef,
atk: core.status.hero.atk + addAtk
def: core.getStatus('def') + ratio * i + addDef,
atk: core.getStatus('atk') + addAtk
});
if (res.length === 0) {
@ -100,8 +100,8 @@ export function getCriticalDamage(
for (let i = 0; i <= max; i++) {
const dam = core.getDamageInfo(enemy.id, {
atk: core.status.hero.atk + ratio * i + addAtk,
def: core.status.hero.def + addDef
atk: core.getStatus('atk') + ratio * i + addAtk,
def: core.getStatus('def') + addDef
});
if (res.length === 0) {

64
src/plugin/ui/fixed.ts Normal file
View File

@ -0,0 +1,64 @@
import { cloneDeep, debounce } from 'lodash';
import { ref } from 'vue';
import { getDamageColor } from '../utils';
export const showFixed = ref(false);
const show = debounce((ev: MouseEvent) => {
if (!window.flags) return;
if (!flags.mouseLoc) return;
flags.clientLoc = [ev.clientX, ev.clientY];
const [x, y] = flags.mouseLoc;
const e = core.getBlockId(x, y);
if (!e || !core.getClsFromId(e)?.startsWith('enemy')) return;
const enemy = core.material.enemys[e as EnemyIds];
const detail = getDetailedEnemy(enemy, x, y);
core.plugin.bookDetailEnemy = detail;
showFixed.value = true;
}, 200);
export default function init() {
const data = core.canvas.data.canvas;
data.addEventListener('mousemove', ev => {
showFixed.value = false;
show(ev);
});
}
export function getDetailedEnemy<I extends EnemyIds>(
enemy: Enemy<I>,
x: number,
y: number,
floorId: FloorIds = core.status.floorId
): DetailedEnemy<I> {
const ratio = core.status.maps[floorId].ratio;
const enemyInfo = Object.assign(
core.getEnemyInfo(enemy, void 0, x, y),
core.getDamageInfo(enemy, void 0, x, y) ?? {},
enemy
);
const critical = core.nextCriticals(enemy, 1, x, y);
const defDamage = core.getDefDamage(enemy, ratio, x, y);
const specialText = core.getSpecialText(enemyInfo);
let toShowSpecial = cloneDeep(specialText);
if (toShowSpecial.length > 2) {
toShowSpecial = toShowSpecial.slice(0, 2).concat(['...']);
}
const specialColor = core.getSpecialColor(enemyInfo);
let toShowColor = cloneDeep(specialColor);
if (toShowColor.length > 2) {
toShowColor = toShowColor.slice(0, 2).concat(['#fff']);
}
const damageColor = getDamageColor(enemyInfo.damage);
const detail: DetailedEnemy<I> = Object.assign(enemyInfo, {
critical: critical[0][0],
criticalDamage: critical[0][1],
defDamage,
specialColor,
specialText,
toShowColor,
toShowSpecial,
damageColor
});
return detail;
}

5
src/types/core.d.ts vendored
View File

@ -1372,6 +1372,11 @@ interface Flags {
*/
mouseLoc: LocArr;
/**
*
*/
clientLoc: LocArr;
[key: string]: any;
}

157
src/ui/fixed.vue Normal file
View File

@ -0,0 +1,157 @@
<template>
<div id="fixed">
<Transition>
<Box
v-if="showFixed"
v-model:height="height"
v-model:left="left"
v-model:top="top"
v-model:width="width"
>
<div id="enemy-fixed">
<span id="enemy-name">{{ enemy.name }}</span>
<div id="enemy-special">
<span
v-for="(text, i) of enemy.toShowSpecial"
:style="{color: (enemy.toShowColor[i] as string)} "
>{{ text }}</span
>
</div>
<div class="enemy-attr" v-for="(a, i) of toShowAttrs">
<span
class="attr-name"
:style="{ color: attrColor[i] }"
>{{ getLabel(a) }}</span
>
<span
class="attr-value"
:style="{ color: attrColor[i] }"
>{{ enemy[a] }}</span
>
</div>
</div>
</Box>
</Transition>
</div>
</template>
<script lang="ts" setup>
import { onMounted, onUpdated, ref, watch } from 'vue';
import Box from '../components/box.vue';
import { showFixed } from '../plugin/ui/fixed';
watch(showFixed, calHeight);
let main: HTMLDivElement;
const toShowAttrs: (keyof DetailedEnemy)[] = [
'hp',
'atk',
'def',
'money',
'exp',
'critical',
'criticalDamage',
'defDamage'
];
const attrColor = [
'lightgreen',
'lightcoral',
'lightblue',
'lightyellow',
'lawngreen',
'lightsalmon',
'lightpink',
'cyan'
];
const enemy = ref(core.plugin.bookDetailEnemy);
const left = ref(0);
const top = ref(0);
const width = ref(300);
const height = ref(400);
let vh = window.innerHeight;
let vw = window.innerWidth;
async function calHeight() {
enemy.value = core.plugin.bookDetailEnemy;
vh = window.innerHeight;
vw = window.innerWidth;
width.value = vh * 0.28;
await new Promise(res => requestAnimationFrame(res));
main = document.getElementById('enemy-fixed') as HTMLDivElement;
const style = getComputedStyle(main);
const h = parseFloat(style.height);
const [cx, cy] = flags.clientLoc;
if (cy + h + 10 > vh - 10) top.value = vh - h - 10;
else top.value = cy + 10;
if (cx + width.value + 10 > vw - 10) left.value = vw - width.value - 10;
else left.value = cx + 10;
height.value = h;
}
function getLabel(attr: keyof DetailedEnemy) {
if (attr === 'critical') return '临界';
if (attr === 'criticalDamage') return '临界减伤';
if (attr === 'defDamage') return `${core.status.thisMap.ratio}`;
return core.getStatusLabel(attr);
}
onUpdated(calHeight);
onMounted(() => {
main = document.getElementById('enemy-fixed') as HTMLDivElement;
calHeight();
});
</script>
<style lang="less" scoped>
#fixed {
font-family: 'normal';
font-size: 2.5vh;
}
.v-enter-active,
.v-leave-active {
transition: opacity 0.2s linear;
}
.v-enter-from,
.v-leave-to {
opacity: 0;
}
#enemy-fixed {
display: flex;
flex-direction: column;
align-items: center;
background-color: #000c;
padding: 1vh;
}
#enemy-special {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-around;
}
.enemy-attr {
display: flex;
flex-direction: row;
width: 100%;
}
.attr-name {
flex-basis: 50%;
width: 100%;
text-align: right;
padding-right: 5%;
}
.attr-value {
flex-basis: 50%;
padding-left: 5%;
}
</style>

View File

@ -97,7 +97,7 @@ const nowArea = ref(
Object.keys(area).find(v => area[v].includes(core.status.floorId))!
);
const nowFloor = ref(core.status.floorId);
const noBorder = ref(false);
const noBorder = ref(true);
const tradition = ref(false);
let scale = isMobile ? 1.5 : 3;
let ox = 0;
@ -105,8 +105,8 @@ let oy = 0;
let drawedThumbnail: Partial<Record<FloorIds, boolean>> = {};
let thumbnailLoc: Partial<Record<FloorIds, Loc2>> = {};
noBorder.value = core.getLocalStorage('noBorder') ?? false;
tradition.value = core.getLocalStorage('flyTradition') ?? false;
noBorder.value = core.getLocalStorage('noBorder', true);
tradition.value = core.getLocalStorage('flyTradition', false);
const floor = computed(() => {
return core.status.maps[nowFloor.value];

View File

@ -42,6 +42,14 @@
showHalo ? 'ON' : 'OFF'
}}</span
>
<span
class="selectable"
:selected="selected === 'useFixed'"
@click="click('useFixed')"
>移动鼠标显示怪物信息:&nbsp;&nbsp;&nbsp;{{
useFixed ? 'ON' : 'OFF'
}}</span
>
<span
class="selectable"
:selected="selected === 'showStudied'"
@ -65,7 +73,8 @@ import {
autoSkill,
autoScale,
showStudied,
showHalo
showHalo,
useFixed
} from '../plugin/settings';
import settingInfo from '../data/settings.json';
import { has, splitText } from '../plugin/utils';
@ -100,6 +109,10 @@ function click(id: keyof Settings) {
autoScale.value = !autoScale.value;
} else if (id === 'showHalo') {
showHalo.value = !showHalo.value;
} else if (id === 'showStudied') {
showStudied.value = !showStudied.value;
} else if (id === 'useFixed') {
useFixed.value = !useFixed.value;
}
}
</script>