乘算法抗

This commit is contained in:
草莓 2025-02-05 22:38:46 +08:00
parent 4079bb9710
commit a0cbb8cdb8
4 changed files with 1199 additions and 1222 deletions

View File

@ -1118,7 +1118,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"mana": 0, "mana": 0,
"atk": 100, "atk": 100,
"def": 100, "def": 100,
"mdef": 0, "mdef": 100,
"speed": 10, "speed": 10,
"money": 0, "money": 0,
"exp": 0, "exp": 0,
@ -1135,7 +1135,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
}, },
"flags": { "flags": {
"itemDetail": true, "itemDetail": true,
"useBetweenLight": true "useBetweenLight": true,
"__mdef_buff__": 0
}, },
"followers": [], "followers": [],
"steps": 0, "steps": 0,
@ -1499,7 +1500,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"startText": [ "startText": [
{ {
"type": "function", "type": "function",
"function": "function(){\ncore.getItem('book',1);core.getItem('fly',1)\n}" "function": "function(){\ncore.getItem('book', 1);\ncore.getItem('fly', 1);\n}"
}, },
{ {
"type": "insert", "type": "insert",

View File

@ -1466,7 +1466,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
spell: "法强", spell: "法强",
matk: "魔攻比例", matk: "魔攻比例",
mhp: "护盾比例", mhp: "护盾比例",
mdef: "法抗比例", mdef: "法抗",
speed: "速度", speed: "速度",
money: "金币", money: "金币",
exp: "经验", exp: "经验",

View File

@ -150,10 +150,10 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"equip": { "equip": {
"type": 0, "type": 0,
"animate": "sword", "animate": "sword",
"value": { "value": {},
"percentage": {
"mdef": 10 "mdef": 10
}, }
"percentage": {}
}, },
"itemEffect": "core.status.hero.atk += 10", "itemEffect": "core.status.hero.atk += 10",
"itemEffectTip": ",攻击+10", "itemEffectTip": ",攻击+10",
@ -166,10 +166,10 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"equip": { "equip": {
"type": "武器", "type": "武器",
"animate": "sword", "animate": "sword",
"value": { "value": {},
"percentage": {
"mdef": 20 "mdef": 20
}, }
"percentage": {}
}, },
"itemEffect": "core.status.hero.atk += 20", "itemEffect": "core.status.hero.atk += 20",
"itemEffectTip": ",攻击+20", "itemEffectTip": ",攻击+20",
@ -247,10 +247,10 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"text": "一个很普通的铁盾", "text": "一个很普通的铁盾",
"equip": { "equip": {
"type": 1, "type": 1,
"value": { "value": {},
"percentage": {
"mdef": 10 "mdef": 10
}, }
"percentage": {}
}, },
"itemEffect": "core.status.hero.def += 10", "itemEffect": "core.status.hero.def += 10",
"itemEffectTip": ",防御+10", "itemEffectTip": ",防御+10",

View File

@ -5617,6 +5617,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var compare2; var compare2;
if (item.equipCls === "双手剑") if (item.equipCls === "双手剑")
compare2 = core.compareEquipment(null, core.getEquip(1)); compare2 = core.compareEquipment(null, core.getEquip(1));
if (item.equipCls === "盾牌" && core.material.items[core.getEquip(0)].equipCls === "双手剑")
compare2 = core.compareEquipment(null, core.getEquip(0));
if (info.select.action == "unload") if (info.select.action == "unload")
compare = core.compareEquipment(null, item.id); compare = core.compareEquipment(null, item.id);
// --- 变化值... // --- 变化值...
@ -5633,22 +5635,27 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
(compare2?.percentage[name] || 0))) / (compare2?.percentage[name] || 0))) /
100 100
); );
/*if (name === 'mdef') { if (name === "mdef") {
nowValue = core.getRealStatus(name) + '%' var nowValue = core.getRealStatus(name);
newValue = Math.floor( var newValue = Math.round(
((core.getStatus(name) + (core.getStatus(name) -
((compare.value[name] || 0) + (compare.value[name] || 0) -
(compare2?.value[name] || 0) - 2) * 100) * (compare2?.value[name] || 0)) *
(core.getBuff(name) * 100 + (1 - (1 - core.getBuff(name)) *
(compare.percentage[name] || 0) + ((compare.percentage[name] || 1)) *
(compare2?.percentage[name] || 0))) / ((compare2?.percentage[name] || 1)))
100
) + '%'; );
}*/
}
if (nowValue == newValue) continue; if (nowValue == newValue) continue;
var color = newValue > nowValue ? "#00FF00" : "#FF0000"; var color = newValue > nowValue ? "#00FF00" : "#FF0000";
nowValue = core.formatBigNumber(nowValue); nowValue = core.formatBigNumber(nowValue);
newValue = core.formatBigNumber(newValue); newValue = core.formatBigNumber(newValue);
if (name === "mdef") {
nowValue += '%';
newValue += '%'
}
statusText += statusText +=
core.getStatusLabel(name) + core.getStatusLabel(name) +
" " + " " +
@ -6225,7 +6232,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.loadEquip(id, function () { core.loadEquip(id, function () {
core.status.route.push("equip:" + id); core.status.route.push("equip:" + id);
info.select.type = type; info.select.type = type;
//core.setIndexAndSelect("select"); core.setIndexAndSelect("select");
core.drawEquipbox(); core.drawEquipbox();
}); });
} else { } else {
@ -6233,8 +6240,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.unloadEquip(type, function () { core.unloadEquip(type, function () {
core.status.route.push("unEquip:" + type); core.status.route.push("unEquip:" + type);
info.select.type = type; info.select.type = type;
//info.select.action = 'load' info.select.action = 'load'
//core.setIndexAndSelect("select"); core.setIndexAndSelect("select");
core.drawEquipbox(); core.drawEquipbox();
}); });
} }
@ -6247,7 +6254,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.setPageItems(info.page); core.setPageItems(info.page);
var index = info.index || 1; var index = info.index || 1;
var items = info.pageItems; var items = info.pageItems;
if (info.select.type != null) { /*if (info.select.type != null) {
var type = info.select.type; var type = info.select.type;
id = core.getEquip(type); id = core.getEquip(type);
info.index = null; info.index = null;
@ -6257,12 +6264,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
type: type, type: type,
}; };
return; return;
} else { } else {*/
info.select.action = null; info.select.action = null;
info.select.type = null; info.select.type = null;
if (toChange == "index") info.index = items.indexOf(info.select.id) + 1; if (toChange == "index") info.index = items.indexOf(info.select.id) + 1;
info.select.id = items[info.index - 1]; info.select.id = items[info.index - 1];
} //}
}; };
this.addItemListboxPage = function (num) { this.addItemListboxPage = function (num) {
@ -10893,18 +10900,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
* @type {{[EvnetName:actionParserJson]}} * @type {{[EvnetName:actionParserJson]}}
*/ */
events_c12a15a8_c380_4b28_8144_256cba95f760.CommonEventTemplate = { events_c12a15a8_c380_4b28_8144_256cba95f760.CommonEventTemplate = {
检测音乐如果没有开启则系统提示开启: [ 检测音乐如果没有开启则系统提示开启: [{
{
type: "if", type: "if",
condition: "!core.musicStatus.bgmStatus", condition: "!core.musicStatus.bgmStatus",
true: [ true: [
"\t[系统提示]你当前音乐处于关闭状态,本塔开音乐游戏效果更佳", "\t[系统提示]你当前音乐处于关闭状态,本塔开音乐游戏效果更佳",
], ],
false: [], false: [],
}, }, ],
], 仿新新魔塔一次性商人: [{
仿新新魔塔一次性商人: [
{
type: "if", type: "if",
condition: "switch:A", condition: "switch:A",
true: [ true: [
@ -10919,16 +10923,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
time: 250, time: 250,
}, },
], ],
false: [ false: [{
{
type: "confirm", type: "confirm",
text: "我有3把黄钥匙\n你出50金币就卖给你。", text: "我有3把黄钥匙\n你出50金币就卖给你。",
yes: [ yes: [{
{
type: "if", type: "if",
condition: "status:money>=50", condition: "status:money>=50",
true: [ true: [{
{
type: "setValue", type: "setValue",
name: "status:money", name: "status:money",
operator: "-=", operator: "-=",
@ -10951,22 +10952,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
value: "true", value: "true",
}, },
], ],
false: [ false: [{
{
type: "playSound", type: "playSound",
name: "操作失败", name: "操作失败",
}, },
"\t[行商,trader]\b[this]你的金币不足!", "\t[行商,trader]\b[this]你的金币不足!",
], ],
}, }, ],
],
no: [], no: [],
}, }, ],
], }, ],
}, 全地图选中一个点: [{
],
全地图选中一个点: [
{
type: "comment", type: "comment",
text: "全地图选中一个点,需要用鼠标或触屏操作", text: "全地图选中一个点,需要用鼠标或触屏操作",
}, },
@ -10987,8 +10983,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{ {
type: "while", type: "while",
condition: "true", condition: "true",
data: [ data: [{
{
type: "drawSelector", type: "drawSelector",
image: "winskin.webp", image: "winskin.webp",
code: 1, code: 1,
@ -11003,16 +10998,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{ {
type: "if", type: "if",
condition: "(flag:type === 1)", condition: "(flag:type === 1)",
true: [ true: [{
{
type: "if", type: "if",
condition: "((temp:X===flag:x)&&(temp:Y===flag:y))", condition: "((temp:X===flag:x)&&(temp:Y===flag:y))",
true: [ true: [{
{
type: "break", type: "break",
n: 1, n: 1,
}, }, ],
],
}, },
{ {
type: "setValue", type: "setValue",
@ -11042,8 +11034,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
loc: ["temp:X", "temp:Y"], loc: ["temp:X", "temp:Y"],
}, },
], ],
多阶段Boss战斗: [ 多阶段Boss战斗: [{
{
type: "comment", type: "comment",
text: "多阶段boss请直接作为战后事件使用", text: "多阶段boss请直接作为战后事件使用",
}, },
@ -11056,11 +11047,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{ {
type: "switch", type: "switch",
condition: "switch:A", condition: "switch:A",
caseList: [ caseList: [{
{
case: "1", case: "1",
action: [ action: [{
{
type: "setBlock", type: "setBlock",
number: "redSlime", number: "redSlime",
}, },
@ -11069,8 +11058,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}, },
{ {
case: "2", case: "2",
action: [ action: [{
{
type: "setBlock", type: "setBlock",
number: "blackSlime", number: "blackSlime",
}, },
@ -11079,8 +11067,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}, },
{ {
case: "3", case: "3",
action: [ action: [{
{
type: "setBlock", type: "setBlock",
number: "slimelord", number: "slimelord",
}, },
@ -11334,8 +11321,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
], ],
"event" "event"
), ),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse({
{
condition: "flag:__door__===2", condition: "flag:__door__===2",
currentFloor: true, currentFloor: true,
priority: 0, priority: 0,
@ -11347,17 +11333,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
), ),
MotaActionBlocks["changeFloor_m"].xmlText(), MotaActionBlocks["changeFloor_m"].xmlText(),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse(
[ [{
{
id: "shop1", id: "shop1",
text: "\t[贪婪之神,moneyShop]勇敢的武士啊, 给我${20+2*flag:shop1}金币就可以:", text: "\t[贪婪之神,moneyShop]勇敢的武士啊, 给我${20+2*flag:shop1}金币就可以:",
textInList: "1F金币商店", textInList: "1F金币商店",
choices: [ choices: [{
{
text: "生命+800", text: "生命+800",
need: "status:money>=20+2*flag:shop1", need: "status:money>=20+2*flag:shop1",
action: [ action: [{
{
type: "comment", type: "comment",
text: "新版商店中需要手动扣减金币和增加访问次数", text: "新版商店中需要手动扣减金币和增加访问次数",
}, },
@ -11380,8 +11363,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
value: "800", value: "800",
}, },
], ],
}, }, ],
],
}, },
{ {
id: "itemShop", id: "itemShop",
@ -11407,26 +11389,25 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionBlocks["eachArrive_m"].xmlText(), MotaActionBlocks["eachArrive_m"].xmlText(),
MotaActionBlocks["level_m"].xmlText(), MotaActionBlocks["level_m"].xmlText(),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse(
[["MTx", ""]], [
["MTx", ""]
],
"floorPartition" "floorPartition"
), ),
MotaActionBlocks["commonEvent_m"].xmlText(), MotaActionBlocks["commonEvent_m"].xmlText(),
MotaActionBlocks["item_m"].xmlText(), MotaActionBlocks["item_m"].xmlText(),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse(
[ [{
{
title: "简单", title: "简单",
name: "Easy", name: "Easy",
hard: 1, hard: 1,
action: [ action: [
{ type: "comment", text: "在这里写该难度需执行的事件" }, { type: "comment", text: "在这里写该难度需执行的事件" },
], ],
}, }, ],
],
"levelChoose" "levelChoose"
), ),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse({
{
type: 0, type: 0,
value: { atk: 10 }, value: { atk: 10 },
percentage: { speed: 10 }, percentage: { speed: 10 },
@ -11434,18 +11415,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"equip" "equip"
), ),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse(
[ [{
{
name: "bg.webp", name: "bg.webp",
x: 0, x: 0,
y: 0, y: 0,
canvas: "bg", canvas: "bg",
}, }, ],
],
"floorImage" "floorImage"
), ),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse({
{
time: 160, time: 160,
openSound: "door.opus", openSound: "door.opus",
closeSound: "door.opus", closeSound: "door.opus",
@ -11455,8 +11433,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
), ),
MotaActionBlocks["faceIds_m"].xmlText(), MotaActionBlocks["faceIds_m"].xmlText(),
MotaActionBlocks["mainStyle_m"].xmlText(), MotaActionBlocks["mainStyle_m"].xmlText(),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse({
{
背景音乐: "bgm.opus", 背景音乐: "bgm.opus",
确定: "confirm.opus", 确定: "confirm.opus",
攻击: "attack.opus", 攻击: "attack.opus",
@ -11478,14 +11455,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"\t[小妖精,fairy]\f[fairy.webp,0,0]欢迎使用事件编辑器(双击方块可直接预览)" "\t[小妖精,fairy]\f[fairy.webp,0,0]欢迎使用事件编辑器(双击方块可直接预览)"
), ),
MotaActionBlocks["over_s"].xmlText(), MotaActionBlocks["over_s"].xmlText(),
MotaActionFunctions.actionParser.parseList([ MotaActionFunctions.actionParser.parseList([{
{
type: "overlist", type: "overlist",
image: "bg_5043.webp", image: "bg_5043.webp",
memory: false, memory: false,
hidetime: 30, hidetime: 30,
list: [ list: [{
{
text: "", text: "",
sound: "", sound: "",
time: 50, time: 50,
@ -11493,13 +11468,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
boldColor: "0,0,0,1", boldColor: "0,0,0,1",
font: "bold 48px Verdana", font: "bold 48px Verdana",
frame: 0, frame: 0,
}, }, ],
], }, ]),
},
]),
MotaActionBlocks["cgtextList_s"].xmlText(), MotaActionBlocks["cgtextList_s"].xmlText(),
MotaActionFunctions.actionParser.parseList([ MotaActionFunctions.actionParser.parseList([{
{
type: "cgtext", type: "cgtext",
bg: "bg_5043.webp", bg: "bg_5043.webp",
memory: false, memory: false,
@ -11514,8 +11486,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
bodyList: [ bodyList: [
{ name: "tati_050145a.webp", px: 100, filter: false }, { name: "tati_050145a.webp", px: 100, filter: false },
], ],
}, }, ]),
]),
MotaActionBlocks["moveTextBox_s"].xmlText(), MotaActionBlocks["moveTextBox_s"].xmlText(),
MotaActionBlocks["clearTextBox_s"].xmlText(), MotaActionBlocks["clearTextBox_s"].xmlText(),
MotaActionBlocks["comment_s"].xmlText(), MotaActionBlocks["comment_s"].xmlText(),
@ -11609,20 +11580,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionFunctions.actionParser.parseList({ MotaActionFunctions.actionParser.parseList({
type: "switch", type: "switch",
condition: "判别值", condition: "判别值",
caseList: [ caseList: [{
{
action: [ action: [
{ type: "comment", text: "当判别值是值的场合执行此事件" }, { type: "comment", text: "当判别值是值的场合执行此事件" },
], ],
}, },
{ {
case: "default", case: "default",
action: [ action: [{
{
type: "comment", type: "comment",
text: "当没有符合的值的场合执行default事件", text: "当没有符合的值的场合执行default事件",
}, }, ],
],
}, },
], ],
}), }),
@ -11658,37 +11626,30 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionFunctions.actionParser.parseList({ MotaActionFunctions.actionParser.parseList({
type: "wait", type: "wait",
timeout: 0, timeout: 0,
data: [ data: [{
{
case: "keyboard", case: "keyboard",
keycode: "13,32", keycode: "13,32",
action: [ action: [{
{
type: "comment", type: "comment",
text: "当按下回车(keycode=13)或空格(keycode=32)时执行此事件\n超时剩余时间会写入flag:timeout", text: "当按下回车(keycode=13)或空格(keycode=32)时执行此事件\n超时剩余时间会写入flag:timeout",
}, }, ],
],
}, },
{ {
case: "mouse", case: "mouse",
px: [0, 32], px: [0, 32],
py: [0, 32], py: [0, 32],
action: [ action: [{
{
type: "comment", type: "comment",
text: "当点击地图左上角时执行此事件\n超时剩余时间会写入flag:timeout", text: "当点击地图左上角时执行此事件\n超时剩余时间会写入flag:timeout",
}, }, ],
],
}, },
{ {
case: "condition", case: "condition",
condition: "flag:type==0\n&&flag:keycode==13", condition: "flag:type==0\n&&flag:keycode==13",
action: [ action: [{
{
type: "comment", type: "comment",
text: "当满足自定义条件时会执行此事件\n超时剩余时间会写入flag:timeout", text: "当满足自定义条件时会执行此事件\n超时剩余时间会写入flag:timeout",
}, }, ],
],
}, },
{ {
case: "timeout", case: "timeout",
@ -11905,10 +11866,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var list = toolboxObj["入口方块"]; var list = toolboxObj["入口方块"];
var xmlList = []; var xmlList = [];
var eventType = var eventType =
(editor_blockly.isCommonEntry() (editor_blockly.isCommonEntry() ?
? "common" "common" :
: editor_blockly.entryType) + "_m"; editor_blockly.entryType) + "_m";
for (var ii = 0, blockText; (blockText = list[ii]); ii++) { for (var ii = 0, blockText;
(blockText = list[ii]); ii++) {
if ( if (
new RegExp('<block type="' + eventType + '">').exec(blockText) new RegExp('<block type="' + eventType + '">').exec(blockText)
) { ) {
@ -11963,14 +11925,16 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var mousewheelOffsetValue = var mousewheelOffsetValue =
(20 / 380) * workspace.scrollbar[hvScroll].handleLength_ * 3; (20 / 380) * workspace.scrollbar[hvScroll].handleLength_ * 3;
workspace.scrollbar[hvScroll].handlePosition_ += workspace.scrollbar[hvScroll].handlePosition_ +=
(e.deltaY || 0) + (e.detail || 0) > 0 (e.deltaY || 0) + (e.detail || 0) > 0 ?
? mousewheelOffsetValue mousewheelOffsetValue :
: -mousewheelOffsetValue; -mousewheelOffsetValue;
workspace.scrollbar[hvScroll].onScroll_(); workspace.scrollbar[hvScroll].onScroll_();
// workspace.setScale(workspace.scale); // workspace.setScale(workspace.scale);
}; };
var doubleClickCheck = [[0, "abc"]]; var doubleClickCheck = [
[0, "abc"]
];
function omitedcheckUpdateFunction(event) { function omitedcheckUpdateFunction(event) {
if (event.type === "create") { if (event.type === "create") {
@ -12054,7 +12018,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
">" ">"
); );
if (!inputs) inputs = []; if (!inputs) inputs = [];
for (var ii = 0, inputType; (inputType = rule.argsType[ii]); ii++) { for (var ii = 0, inputType;
(inputType = rule.argsType[ii]); ii++) {
var input = inputs[ii]; var input = inputs[ii];
var _input = ""; var _input = "";
var noinput = input === null || input === undefined; var noinput = input === null || input === undefined;
@ -12118,7 +12083,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
.split("// start mark sfergsvae")[1] .split("// start mark sfergsvae")[1]
.split("// end mark sfergsvae")[0]; .split("// end mark sfergsvae")[0];
} }
}, },
"夹击激光动画": function () { "夹击激光动画": function () {
function createCanvas(name, zIndex) { function createCanvas(name, zIndex) {
if (!name) return; if (!name) return;
@ -19579,11 +19544,18 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
second = core.material.items[beComparedEquipId]; second = core.material.items[beComparedEquipId];
for (var one in result) { for (var one in result) {
for (var name in core.status.hero) { for (var name in core.status.hero) {
if (name === "mdef" && one === 'value') { if (name === "mdef" && one === 'percentage') {
var ans = 1; var ans = 1;
if (first) ans *= (((first.equip || {})[one] || {})[name] || 0) / 100 + 1; if (first?.equip?.[one]?.[name]) ans *= (1 - (first.equip[one][name] || 0) / 100);
if (second) ans /= (((second.equip || {})[one] || {})[name] || 0) / 100 + 1;
if (second?.equip?.[one]?.[name]) ans /= (1 - (second.equip[one][name] || 0) / 100);
if (ans != 1) result[one][name] = ans; if (ans != 1) result[one][name] = ans;
} else if (name === "mdef" && one === 'value') {
var ans = 0;
if (first) ans -= ((first.equip || {})[one] || {})[name] || 0;
if (second) ans += ((second.equip || {})[one] || {})[name] || 0;
if (ans != 0) result[one][name] = ans;
} else { } else {
if (typeof core.status.hero[name] == 'number') { if (typeof core.status.hero[name] == 'number') {
var ans = 0; var ans = 0;
@ -19596,19 +19568,23 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
return result; return result;
} }
let a = 1
items.prototype._loadEquipEffect = function (equipId, unloadEquipId) { items.prototype._loadEquipEffect = function (equipId, unloadEquipId) {
// 比较能力值 // 比较能力值
var result = core.compareEquipment(equipId, unloadEquipId); var result = core.compareEquipment(equipId, unloadEquipId);
for (var name in result.percentage) for (var name in result.percentage) {
core.addBuff(name, result.percentage[name] / 100); if (name === "mdef") {
a *= result.percentage[name]
for (var name in result.value) core.setBuff(name, 1 - a)
if (name === 'mdef') {
core.status.hero[name] += (result.value[name] - 1) * 100
} else { } else {
core.addBuff(name, result.percentage[name] / 100);
}
}
for (var name in result.value)
core.status.hero[name] += result.value[name]; core.status.hero[name] += result.value[name];
}
} }
} }
} }