乘算法抗

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,
"atk": 100,
"def": 100,
"mdef": 0,
"mdef": 100,
"speed": 10,
"money": 0,
"exp": 0,
@ -1135,7 +1135,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
},
"flags": {
"itemDetail": true,
"useBetweenLight": true
"useBetweenLight": true,
"__mdef_buff__": 0
},
"followers": [],
"steps": 0,
@ -1499,7 +1500,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"startText": [
{
"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",

View File

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

View File

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

View File

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