fix: disable图块的渲染 & feat: 魔法防御

This commit is contained in:
unanmed 2024-09-28 17:19:12 +08:00
parent 22c1ff5a4d
commit 5871558b15
14 changed files with 159 additions and 82 deletions

View File

@ -276,6 +276,16 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "textarea", "_type": "textarea",
"_data": "初始护盾" "_data": "初始护盾"
}, },
"magicDef": {
"_leaf": true,
"_type": "textarea",
"_data": "初始魔法防御"
},
"magicRed": {
"_leaf": true,
"_type": "textarea",
"_data": "初始魔法减免"
},
"money": { "money": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",

View File

@ -383,7 +383,9 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
}, },
"flags": {}, "flags": {},
"followers": [], "followers": [],
"steps": 0 "steps": 0,
"magicDef": 0,
"magicRed": 0
}, },
"startCanvas": [ "startCanvas": [
{ {

View File

@ -42,7 +42,6 @@ main.floors.MT50=
"此区域建议多多使用定点查看功能鼠标移动到怪物上按C或E即可打开如果你没有设置自己的快捷键的话。手机端暂时无法定点查看", "此区域建议多多使用定点查看功能鼠标移动到怪物上按C或E即可打开如果你没有设置自己的快捷键的话。手机端暂时无法定点查看",
"打完左下角和右下角的boss之后开四个机关门", "打完左下角和右下角的boss之后开四个机关门",
"注意不要忘记购买装备,到了下一章之后本章的商店将不能到达,不过快捷商店还会保留。这些装备在下一章都会有向上合成", "注意不要忘记购买装备,到了下一章之后本章的商店将不能到达,不过快捷商店还会保留。这些装备在下一章都会有向上合成",
"建议优先点出学习技能,对于特定场景将会非常有帮助",
"本区域可以使用跳跃技能,不要忘记了。", "本区域可以使用跳跃技能,不要忘记了。",
"注意火炬可通行,而且跳跃时会跳过火炬,不会跳到火炬上。" "注意火炬可通行,而且跳跃时会跳过火炬,不会跳到火炬上。"
] ]

View File

@ -56,19 +56,19 @@ main.floors.MT74=
"cannotMoveIn": {}, "cannotMoveIn": {},
"map": [ "map": [
[648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648],
[648,430,472,420,648, 0, 0, 0, 0, 0,648,420,472,430,648], [648,487,487,487,648, 0, 0, 0, 0, 0,648,487,487,487,648],
[648,648, 85,648,648, 0, 0, 0, 0, 0,648,648, 85,648,648], [648,648,497,648,648, 0, 0, 0, 0, 0,648,648,497,648,648],
[648, 0, 0, 0,648, 0, 0, 0, 0, 0,648, 0, 0, 0,648], [648, 0, 0, 0,648, 0, 0, 0, 0, 0,648, 0, 0, 0,648],
[648, 0,487, 0,648, 0, 0, 0, 0, 0,648, 0,487, 0,648], [648, 0,487, 0,648, 0, 0, 0, 0, 0,648, 0,487, 0,648],
[648, 0, 0, 0,648,103, 0, 0, 0,103,648, 0, 0, 0,648], [648, 0, 0, 0,648,103, 0, 0, 0,103,648, 0, 0, 0,648],
[648,648,492,648,648, 0, 0, 0, 0, 0,648,648,492,648,648], [648,648,494,648,648, 0, 0, 0, 0, 0,648,648,494,648,648],
[ 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94], [ 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94],
[648,648,492,648,648, 0, 0, 0, 0, 0,648,648,492,648,648], [648,648,494,648,648, 0, 0, 0, 0, 0,648,648,494,648,648],
[648, 0, 0, 0,648,103, 0, 0, 0,103,648, 0, 0, 0,648], [648, 0, 0, 0,648,103, 0, 0, 0,103,648, 0, 0, 0,648],
[648, 0,487, 0,648, 0, 0, 0, 0, 0,648, 0,487, 0,648], [648, 0,487, 0,648, 0, 0, 0, 0, 0,648, 0,487, 0,648],
[648, 0, 0, 0,648, 0, 0, 0, 0, 0,648, 0, 0, 0,648], [648, 0, 0, 0,648, 0, 0, 0, 0, 0,648, 0, 0, 0,648],
[648,648, 85,648,648, 0, 0, 0, 0, 0,648,648, 85,648,648], [648,648,497,648,648, 0, 0, 0, 0, 0,648,648,497,648,648],
[648,430,472,420,648, 0, 0, 0, 0, 0,648,420,472,430,648], [648,487,487,487,648, 0, 0, 0, 0, 0,648,487,487,487,648],
[648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648] [648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648]
], ],
"bgmap": [ "bgmap": [

View File

@ -38,6 +38,13 @@ main.floors.MT89=
7, 7,
0 0
] ]
},
"14,7": {
"floorId": "MT92",
"loc": [
0,
7
]
} }
}, },
"beforeBattle": {}, "beforeBattle": {},
@ -51,15 +58,15 @@ main.floors.MT89=
[648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648],
[648,249, 29, 0,491,578, 27, 0,658, 0,381,648,484,484,648], [648,249, 29, 0,491,578, 27, 0,658, 0,381,648,484,484,648],
[648, 29,648,648,648,648, 0,648,648,648,648,648,492,648,648], [648, 29,648,648,648,648, 0,648,648,648,648,648,492,648,648],
[648, 0,648,487,378,648,484,648, 0, 0,676,648,378,484,648], [648, 0,648,487,378,648,484,492, 0, 0,676,648,378,484,648],
[648,491,648,378, 21,618, 0,648, 0,648, 0,679,484, 27,648], [648,491,648,378, 21,618, 0,648, 0,648, 0,679,484, 27,648],
[648,578,648,648,648,648,679,648, 0,648,491,648,648,648,648], [648,578,648,648,648,648,679,648, 0,648,491,648,648,648,648],
[648, 0, 0, 0,484, 0, 0,648, 0,648, 0,513, 0, 0,648], [648, 0, 0, 0,484, 0, 0,648, 0,648, 0,513, 0, 0,648],
[ 92, 0,648,492,648,648, 0,648,494,648,648,648,484, 0, 94], [ 92, 0,648,492,648,648, 0,648,494,648,648,648,484, 0, 94],
[648, 0,682, 0,491,648, 0,644,420,249,482,648,648,682,648], [648, 0,682, 0,491,648, 0,644,420,249,482,648,648,682,648],
[648,682,648, 29, 0,648,648,648,578,648,482,648, 0,484,648], [648,682,648, 29, 0,648,648,648,578,648,482,648, 0,484,648],
[648, 0,648,648,657,648, 0,648,494,648,492,648,657,648,648], [648,482,648,648,657,648, 0,648,494,648,492,648,657,648,648],
[648, 0,648,484, 0,538, 0,676, 0,648,487,677,491, 0,648], [648, 29,492,484, 0,538, 0,676, 0,648,487,677,491, 0,648],
[648,648,648,648,677,648,648, 0,648,648,648,648,657,648,648], [648,648,648,648,677,648,648, 0,648,648,648,648,657,648,648],
[648, 27,484, 28, 0,648,491, 0, 0,232, 0,378, 0,484,648], [648, 27,484, 28, 0,648,491, 0, 0,232, 0,378, 0,484,648],
[648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648] [648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648]

View File

@ -43,17 +43,17 @@ main.floors.MT90=
"map": [ "map": [
[648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648],
[648,376, 0,648,487,232, 0, 0,484, 0,648, 0,494, 0,648], [648,376, 0,648,487,232, 0, 0,484, 0,648, 0,494, 0,648],
[648,491,381,671, 0,648,492,648,648,513,648, 0,648,376,648], [648,491,381,671, 0,648,492,648,648,513,648, 21,648,376,648],
[648,648,648,648,648,648, 27, 0,484, 0,538, 0,648,491,648], [648,648,648,648,492,648, 27, 0,484, 0,538, 0,648,491,648],
[648,491,381,679, 0,648,492,648,648,648,648,677,648,378,648], [648,491,381,679, 0,648,492,648,648,492,648,677,648,378,648],
[648,378, 0,648,491,232, 27,491,648, 0,658, 0,648,618,648], [648,378, 0,648,491,232, 27,491,648, 0,658, 0,648,618,648],
[648,648,648,648,648,648,491, 28,648,381,648,484,658, 0,648], [648,648,648,648,648,648,491, 28,648,381,648,484,658, 0,648],
[648, 0,578, 0, 28,648,644,648,648, 0,648,648,648, 0,648], [648, 0,578, 0, 28,648,644,648,648, 0,648,648,648, 0,648],
[648, 0,648,484, 0,682,103,657, 0,484,648,484,657, 0,648], [648, 0,648,484, 0,682,103,657, 0,484,648,484,657, 0,648],
[648,484,648, 0, 27,648,249,648,648,648,648,492,648,648,648], [648,484,648, 0, 27,648,249,648,648,648,648,492,648,648,648],
[648, 0,648,648,648,648, 0,491, 0,648, 27,484,677, 0,648], [648, 0,648,648,648,648, 0,491, 0,492, 27,484,677, 0,648],
[ 92, 0, 0,484, 0,648,494,648,513,648, 0, 29,648, 0,648], [ 92, 0, 0,484, 0,648,494,648,513,648, 0, 29,648, 0,648],
[648,648,648,648,513,648,491,648, 0,648,648,648,648, 0,648], [648,492,648,648,513,648,491,648, 0,648,648,648,648, 0,648],
[648, 28, 0,484, 0,648,491,648, 28, 0, 29,658, 0,491,648], [648, 28, 0,484, 0,648,491,648, 28, 0, 29,658, 0,491,648],
[648,648,648,648,648,648,648,648,648,648,648,648,648,648,648] [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648]
], ],

View File

@ -24,6 +24,13 @@ main.floors.MT91=
14, 14,
7 7
] ]
},
"7,14": {
"floorId": "MT92",
"loc": [
7,
0
]
} }
}, },
"beforeBattle": {}, "beforeBattle": {},
@ -35,19 +42,19 @@ main.floors.MT91=
"cannotMoveIn": {}, "cannotMoveIn": {},
"map": [ "map": [
[648,648,648,648,648,648,648,648,648,648,648,648,648,648,648], [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648],
[648, 0, 0, 0,648, 0, 0, 0, 0, 0, 0, 0,648, 0,648], [648, 27,381, 28,648,376, 0,679, 0,484,381, 0,492, 0,648],
[648, 0, 0, 0, 0, 0, 0,648,648,648, 0, 0,648, 0,648], [648, 27, 21, 28,618,491,381,648,492,648, 0,378,648,484,648],
[648,648,648,648,648,648,648,648, 0,648, 0,648,648, 0,648], [648,494,648,648,648,648,648,648,484,648,232,648,648, 0,648],
[648, 0,648, 0, 0, 0, 0, 0, 0,648, 0, 0, 0, 0,648], [648, 0,648, 0,599, 0,513, 0, 28,648, 0,677, 0, 28,648],
[648, 0, 0, 0,648, 0,648,648,648,648, 0,648,648,648,648], [648, 28, 0,484,648,491,648,648,492,648, 0,648,648,648,648],
[648,648,648,648,648, 0, 0, 0, 0, 0, 0,648, 0, 0,648], [648,648,648,648,648, 0,232,403, 0,648, 27,648, 0,484,648],
[ 92, 0, 0, 0,648, 0,648,648, 0,648, 0,648, 0, 0, 94], [ 92, 0, 0, 0,648,491,648,648, 0,644, 0,648,381, 0, 94],
[648, 0, 0, 0, 0, 0, 0,648, 0,648,648,648, 0,648,648], [648, 0,484, 0,658, 0, 0,648,658,648,648,648,679,648,648],
[648,648,648,648,648,648, 0,648, 0, 0, 0, 0, 0, 0,648], [648,492,648,648,648,648,682,648, 0,378,682, 0, 0,676,648],
[648, 0, 0, 0, 0, 0, 0,648, 0, 0,648, 0,648, 0,648], [648, 0, 0,578, 0,484, 0,648,484, 0,648,491,648,484,648],
[648, 0,648,648, 0,648,648,648,648,648,648, 0,648, 0,648], [648,658,648,648,682,648,648,648,648,648,648,657,648, 0,648],
[648, 0, 0,648, 0,648, 0, 0, 0,648, 0, 0,648, 0,648], [648, 0, 28,648, 0,648,482, 0,482,648, 27, 0,648, 0,648],
[648, 0, 0,648, 0,648, 0, 0, 0, 0, 0, 0,648, 0,648], [648, 27,491,492,491,492, 0, 0, 0,513, 0, 28,492,376,648],
[648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648] [648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648]
], ],
"bgmap": [ "bgmap": [

View File

@ -1,45 +1,72 @@
main.floors.MT92= main.floors.MT92=
{ {
"floorId": "MT92", "floorId": "MT92",
"title": "苍蓝之殿-右上", "title": "苍蓝之殿-右上",
"name": "92", "name": "92",
"width": 15, "width": 15,
"height": 15, "height": 15,
"canFlyTo": true, "canFlyTo": true,
"canFlyFrom": true, "canFlyFrom": true,
"canUseQuickShop": true, "canUseQuickShop": true,
"cannotViewMap": false, "cannotViewMap": false,
"images": [], "images": [],
"ratio": 8, "ratio": 8,
"defaultGround": "T650", "defaultGround": "T650",
"bgm": "palaceNorth.mp3", "bgm": "palaceNorth.mp3",
"firstArrive": [], "firstArrive": [],
"eachArrive": [], "eachArrive": [],
"parallelDo": "", "parallelDo": "",
"events": {}, "events": {},
"changeFloor": {}, "changeFloor": {
"beforeBattle": {}, "7,0": {
"afterBattle": {}, "floorId": "MT91",
"afterGetItem": {}, "loc": [
"afterOpenDoor": {}, 7,
"autoEvent": {}, 14
"cannotMove": {}, ]
"cannotMoveIn": {}, },
"map": [ "0,7": {
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "floorId": "MT89",
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "loc": [
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 14,
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 7
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], }
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], },
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "beforeBattle": {},
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "afterBattle": {},
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "afterGetItem": {},
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "afterOpenDoor": {},
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "autoEvent": {},
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "cannotMove": {},
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "cannotMoveIn": {},
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] "map": [
[648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648],
[648, 0, 0, 0, 0, 0, 0, 0, 0,648, 0, 0,648, 0,648],
[648, 0,648,648,648, 0,648,648,648,648,658,648,648, 0,648],
[648, 0, 0,648, 0, 0,648, 0,494, 0, 0, 0,232, 0,648],
[648, 0, 0,648, 0, 0, 0, 0,648,648,648,648,648, 0,648],
[648,648,648,648, 0,648,648, 0,648, 0,644, 0,648, 0,648],
[648, 0, 0,648, 0,648, 0, 0,648, 0,648, 0,677, 0,648],
[ 92, 0, 0, 0, 0, 0, 0, 0,648, 0,648,648,648,648,648],
[648,513,648,648,648,648,648,492,648, 0,679, 0, 0, 0,648],
[648, 0,648, 0,578, 0, 0, 0,648,648,648,648,648,677,648],
[648, 0,648, 0,648,648,648,682,648, 0,538, 0,648, 0,648],
[648, 0,249, 0,648, 0, 0, 0,648, 0,648, 0,648, 0,648],
[648,648,648,648,648,657,648,648,648, 0,648,658,648,682,648],
[648, 0, 0, 0,618, 0, 0, 0,513, 0,648, 0,682, 0,648],
[648,648,648,648,648,648,648,648,648,648,648,648,648,648,648]
], ],
"bgmap": [
],
"fgmap": [
],
"bg2map": [
],
"fg2map": [
]
} }

View File

@ -56,6 +56,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
} else { } else {
flags.autoSkill ??= true; flags.autoSkill ??= true;
} }
// 兼容性调整
const h = core.status.hero;
if (h.magicDef === void 0 || h.magicDef === null) {
h.magicDef = 0;
}
}, },
win: function (reason, norank, noexit) { win: function (reason, norank, noexit) {
// 游戏获胜事件 // 游戏获胜事件

View File

@ -1256,7 +1256,9 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"text": "一个用大地之力制造出的饰品貌似对魔法攻击有抵抗作用。装备后对魔攻怪会有500点防御力", "text": "一个用大地之力制造出的饰品貌似对魔法攻击有抵抗作用。装备后对魔攻怪会有500点防御力",
"equip": { "equip": {
"type": "首饰", "type": "首饰",
"value": {}, "value": {
"magicDef": 500
},
"percentage": {} "percentage": {}
} }
}, },

View File

@ -1207,6 +1207,9 @@ export class Layer extends Container {
const [a, b, , c, d, , e, f] = transform.mat; const [a, b, , c, d, , e, f] = transform.mat;
ctx.setTransform(a, b, c, d, e, f); ctx.setTransform(a, b, c, d, e, f);
const extend = this.getExtends('floor-binder') as LayerFloorBinder;
const floor = extend ? extend.getFloor() : void 0;
const map = floor ? core.status.mapBlockObjs[floor] : void 0;
render.forEach(v => { render.forEach(v => {
const x = v % width; const x = v % width;
const y = Math.floor(v / width); const y = Math.floor(v / width);
@ -1238,6 +1241,11 @@ export class Layer extends Container {
// 先画到临时画布,用于缓存 // 先画到临时画布,用于缓存
for (let nx = sx; nx < ex; nx++) { for (let nx = sx; nx < ex; nx++) {
for (let ny = sy; ny < ey; ny++) { for (let ny = sy; ny < ey; ny++) {
if (map) {
const indexLoc = `${nx},${ny}`;
const block = map[indexLoc as LocString];
if (block?.disable) continue;
}
const blockIndex = nx + ny * this.mapWidth; const blockIndex = nx + ny * this.mapWidth;
const num = this.renderData[blockIndex]; const num = this.renderData[blockIndex];
if (num === 0 || num === 17) continue; if (num === 0 || num === 17) continue;

View File

@ -964,7 +964,13 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
/** /**
* buff加成core.status.hero取 * buff加成core.status.hero取
*/ */
const realStatus: (keyof HeroStatus)[] = ['atk', 'def', 'hpmax', 'mana']; const realStatus: (keyof HeroStatus)[] = [
'atk',
'def',
'hpmax',
'mana',
'magicDef'
];
/** /**
* *
*/ */
@ -987,7 +993,7 @@ export function calDamageWith(
mdef, mdef,
special: heroSpec = { num: [], last: [] } special: heroSpec = { num: [], last: [] }
} = core.status.hero; } = core.status.hero;
let { atk, def, hpmax, mana } = hero as HeroStatus; let { atk, def, hpmax, mana, magicDef } = hero as HeroStatus;
let { hp: monHp, atk: monAtk, def: monDef, special, enemy } = info; let { hp: monHp, atk: monAtk, def: monDef, special, enemy } = info;
hpmax = Math.min(hpmax, def / 10); hpmax = Math.min(hpmax, def / 10);
@ -1041,17 +1047,9 @@ export function calDamageWith(
// 魔攻 // 魔攻
if (special.includes(2) || special.includes(13)) { if (special.includes(2) || special.includes(13)) {
enemyPerDamage = monAtk; enemyPerDamage = monAtk;
if (core.hasEquip('I663')) { enemyPerDamage -= magicDef;
enemyPerDamage = Math.max(0, enemyPerDamage - 500);
}
} else { } else {
enemyPerDamage = monAtk - def; enemyPerDamage = monAtk - def;
if (enemyPerDamage < 0) enemyPerDamage = 0;
}
// 先攻
if (special.includes(17)) {
damage += enemyPerDamage;
} }
// 连击 // 连击
@ -1069,6 +1067,8 @@ export function calDamageWith(
enemyPerDamage *= 1 - heroSpec.paleShield / 100; enemyPerDamage *= 1 - heroSpec.paleShield / 100;
} }
if (enemyPerDamage < 0) enemyPerDamage = 0;
// 苍蓝刻 // 苍蓝刻
if (special.includes(28)) { if (special.includes(28)) {
heroPerDamage *= 1 - info.paleShield! / 100; heroPerDamage *= 1 - info.paleShield! / 100;
@ -1119,6 +1119,11 @@ export function calDamageWith(
turn += 5; turn += 5;
} }
// 先攻
if (special.includes(17)) {
damage += enemyPerDamage;
}
damage += (turn - 1) * enemyPerDamage; damage += (turn - 1) * enemyPerDamage;
// 无上之盾 // 无上之盾
if (flags.superSheild) { if (flags.superSheild) {

View File

@ -426,6 +426,7 @@ export function getStatusLabel(name: string) {
point: '加点', point: '加点',
steps: '步数', steps: '步数',
up: '升级', up: '升级',
magicDef: '魔法防御',
none: '无' none: '无'
}[name] || name }[name] || name
); );

View File

@ -933,6 +933,9 @@ interface HeroStatus {
*/ */
manamax: number; manamax: number;
/** 魔法防御 */
magicDef: number;
/** /**
* *
*/ */