特殊属性全部完成

This commit is contained in:
strawberry 2025-07-02 17:42:22 +08:00
parent 371c23b713
commit 4a633a063e
4 changed files with 345 additions and 721 deletions

View File

@ -255,41 +255,107 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_docs": "特殊属性数值", "_docs": "特殊属性数值",
"_data": "特殊属性的数值\n如领域/阻激/激光怪的伤害值;光环怪增加生命的比例" "_data": "特殊属性的数值\n如领域/阻激/激光怪的伤害值;光环怪增加生命的比例"
}, },
"zone": { "baoshang": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_docs": "领域伤害", "_docs": "暴击伤害",
"_data": "领域怪的伤害值" "_data": "暴击伤害的数值此项为百分数。如20为20%"
}, },
"repulse": { "baoji": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_docs": "阻击伤害", "_docs": "暴击回合",
"_data": "阻击怪的伤害值" "_data": "怪物每进行多少回合进行一次暴击"
}, },
"laser": { "duck": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_docs": "激光伤害", "_docs": "闪避回合",
"_data": "激光怪的伤害值" "_data": "怪物每受到多少次普通攻击进行一次闪避"
},
"absorb": {
"_leaf": true,
"_type": "textarea",
"_docs": "汲取效果",
"_data": "怪物对角色护盾造成破坏时将窃取破坏数值的一定比例作为自身护盾此项为百分数。如20为20%"
},
"gravity": {
"_leaf": true,
"_type": "textarea",
"_docs": "重力效果",
"_data": "怪物操纵角色的重力每携带一件双手装备速度下降4x%每携带一件单手装备速度下降2x%每携带一件其他装备速度下降x%此项为百分数。如20为20%"
},
"cold": {
"_leaf": true,
"_type": "textarea",
"_docs": "寒霜回合",
"_data": "怪物前多少次回合附加寒霜0为每回合"
},
"coldValue": {
"_leaf": true,
"_type": "textarea",
"_docs": "寒霜效果",
"_data": "每层寒霜下降的速度"
},
"fire": {
"_leaf": true,
"_type": "textarea",
"_docs": "灼炎效果",
"_data": "每层灼炎熔毁的防御"
},
"wind": {
"_leaf": true,
"_type": "textarea",
"_docs": "风行效果",
"_data": "每层风行提高的速度"
},
"light": {
"_leaf": true,
"_type": "textarea",
"_docs": "闪电效果",
"_data": "闪电对护盾伤害提升效果百分比此项为百分数。如20为20%"
},
"poison": {
"_leaf": true,
"_type": "textarea",
"_docs": "毒素效果",
"_data": "每层毒素造成的生命流失"
},
"tear": {
"_leaf": true,
"_type": "textarea",
"_docs": "撕裂效果",
"_data": "怪物的普通攻击附加角色当前已损失生命值的百分比此项为百分数。如20为20%"
},
"immolate": {
"_leaf": true,
"_type": "textarea",
"_docs": "献祭伤害",
"_data": "每次献祭造成的伤害"
}, },
"breakArmor": { "breakArmor": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_docs": "破甲比例", "_docs": "破甲比例",
"_data": "破甲百分比" "_data": "破甲百分比此项为百分数。如20为20%"
}, },
"counterAttack": { "onceBreakArmor": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_docs": "反击比例", "_docs": "首次额外破甲比例",
"_data": "反击百分比" "_data": "额外破甲百分比此项为百分数。如20为20%,首次伤害与破甲比例加算"
}, },
"vampire": { "vampire": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_docs": "吸血比例", "_docs": "吸血比例",
"_data": "吸血怪的吸血百分比" "_data": "吸血怪的吸血百分比,此项为百分数。如20为20%,仅计算破盾后伤害"
},
"curseValue": {
"_leaf": true,
"_type": "textarea",
"_docs": "诅咒倍率",
"_data": "触发诅咒时魔法伤害提升比例此项为百分数。如20为20%"
}, },
"hpBuff": { "hpBuff": {
"_leaf": true, "_leaf": true,
@ -297,6 +363,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_docs": "光环加血", "_docs": "光环加血",
"_data": "光环怪增加生命的比例" "_data": "光环怪增加生命的比例"
}, },
"atkBuff": { "atkBuff": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
@ -341,53 +408,14 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_docs": "不可炸", "_docs": "不可炸",
"_data": "该怪物不可被炸" "_data": "该怪物不可被炸"
}, },
"n": {
"_leaf": true,
"_type": "textarea",
"_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null",
"_docs": "连击数",
"_data": "多连击的连击数,净化怪的净化倍率"
},
"purify": {
"_leaf": true,
"_type": "textarea",
"_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null",
"_docs": "净化倍率",
"_data": "净化百分比"
},
"add": {
"_leaf": true,
"_type": "checkbox",
"_docs": "吸血加到自身",
"_data": "吸血后是否加到自身"
},
"haloAdd": { "haloAdd": {
"_leaf": true, "_leaf": true,
"_type": "checkbox", "_type": "checkbox",
"_docs": "光环是否叠加", "_docs": "光环是否叠加",
"_data": "光环是否叠加" "_data": "光环是否叠加"
}, },
"atkValue": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval||thiseval==null",
"_docs": "退化扣攻",
"_data": "退化时勇士下降的攻击力点数"
},
"defValue": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval||thiseval==null",
"_docs": "退化扣防",
"_data": "退化时勇士下降的防御力点数"
},
"damage": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval||thiseval==null",
"_docs": "固伤",
"_data": "战前扣血的点数"
},
"beforeBattle": { "beforeBattle": {
"_leaf": true, "_leaf": true,
"_type": "event", "_type": "event",

View File

@ -1557,7 +1557,6 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
}, },
"flags": { "flags": {
"itemDetail": true, "itemDetail": true,
"useBetweenLight": true,
"__mdef_buff__": 0, "__mdef_buff__": 0,
"popmove": true "popmove": true
}, },

View File

@ -345,27 +345,15 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.status.hero.statistics.battleDamage += damage; core.status.hero.statistics.battleDamage += damage;
core.status.hero.statistics.battle++; core.status.hero.statistics.battle++;
// 计算当前怪物的支援怪物
var guards = [];
if (x != null && y != null) {
guards = core.getFlag("__guards__" + x + "_" + y, []);
core.removeFlag("__guards__" + x + "_" + y);
}
// 获得金币 // 获得金币
var money = guards.reduce(function (curr, g) { var money = core.getEnemyValue(enemy, "money", x, y)
return curr + core.material.enemys[g[2]].money;
}, core.getEnemyValue(enemy, "money", x, y));
if (core.hasItem('coin')) money *= 2; // 幸运金币:双倍
if (core.hasFlag('curse')) money = 0; // 诅咒效果
core.status.hero.money += money; core.status.hero.money += money;
core.status.hero.statistics.money += money; core.status.hero.statistics.money += money;
// 获得经验 // 获得经验
var exp = guards.reduce(function (curr, g) { var exp = core.getEnemyValue(enemy, "exp", x, y);
return curr + core.material.enemys[g[2]].exp;
}, core.getEnemyValue(enemy, "exp", x, y));
if (core.hasFlag('curse')) exp = 0;
core.status.hero.exp += exp; core.status.hero.exp += exp;
core.status.hero.statistics.exp += exp; core.status.hero.statistics.exp += exp;
@ -376,36 +364,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
hint += ',' + core.getStatusLabel('exp') + '+' + exp; // hint += ",经验+" + exp; hint += ',' + core.getStatusLabel('exp') + '+' + exp; // hint += ",经验+" + exp;
core.drawTip(hint, enemy.id); core.drawTip(hint, enemy.id);
// 中毒
if (core.enemys.hasSpecial(special, 12)) {
core.triggerDebuff('get', 'poison');
}
// 衰弱
if (core.enemys.hasSpecial(special, 13)) {
core.triggerDebuff('get', 'weak');
}
// 诅咒
if (core.enemys.hasSpecial(special, 14)) {
core.triggerDebuff('get', 'curse');
}
// 仇恨怪物将仇恨值减半
if (core.enemys.hasSpecial(special, 17)) {
core.setFlag('hatred', Math.floor(core.getFlag('hatred', 0) / 2));
}
// 自爆
if (core.enemys.hasSpecial(special, 19)) {
core.status.hero.statistics.battleDamage += core.status.hero.hp - 1;
core.status.hero.hp = 1;
}
// 退化
if (core.enemys.hasSpecial(special, 21)) {
core.status.hero.atk -= core.getEnemyValue(enemy, "atkValue", x, y) || 0;
core.status.hero.def -= core.getEnemyValue(enemy, "defValue", x, y) || 0;
if (core.status.hero.atk < 0) core.status.hero.atk = 0;
if (core.status.hero.def < 0) core.status.hero.def = 0;
}
// 增加仇恨值
core.setFlag('hatred', core.getFlag('hatred', 0) + core.values.hatred);
// 战后的技能处理,比如扣除魔力值 // 战后的技能处理,比如扣除魔力值
if (core.flags.statusBarItems.indexOf('enableSkill') >= 0) { if (core.flags.statusBarItems.indexOf('enableSkill') >= 0) {
@ -455,11 +413,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 因为removeBlock和hideBlock都会刷新状态栏因此将删除部分移动到这里并保证刷新只执行一次以提升效率 // 因为removeBlock和hideBlock都会刷新状态栏因此将删除部分移动到这里并保证刷新只执行一次以提升效率
if (core.getBlock(x, y) != null) { if (core.getBlock(x, y) != null) {
// 检查是否是重生怪物;如果是则仅隐藏不删除 // 检查是否是重生怪物;如果是则仅隐藏不删除
if (core.hasSpecial(special, 23)) {
core.hideBlock(x, y);
} else {
core.removeBlock(x, y); core.removeBlock(x, y);
}
} else { } else {
core.updateStatusBar(); core.updateStatusBar();
} }
@ -547,215 +503,34 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 第五项为该特殊属性的标记;目前 1 代表是地图类技能(需要进行遍历全图) // 第五项为该特殊属性的标记;目前 1 代表是地图类技能(需要进行遍历全图)
// 名字和描述可以直接写字符串也可以写个function将怪物传进去 // 名字和描述可以直接写字符串也可以写个function将怪物传进去
return [ return [
[1, "先攻", "怪物首先攻击", "#ffcc33"], //√ [1, "先攻", "怪物起始行动条为50%", "#ffcc33"], //√
//[2, "魔攻", "怪物无视角色的防御", "#bbb0ff"], [2, "暴击", function (enemy) { return `怪物的首次攻击必定暴击,暴击额外造成${enemy.baoshang}%的伤害;除此以外,怪物每${enemy.baoji}次攻击就将打出一次暴击。` }, "#ffcc33"],
[3, "坚固", "怪物防御不小于角色攻击-1", "#c0b088"], //√ [3, "坚固", "每次至多受到1点物理伤害", "#c0b088"], //√
[ [4, "反击", "怪物的首次攻击附加怪物当前已损失生命值的100%作为伤害", "#c0b088"],
6, [5, "破甲", function (enemy) { return `怪物攻击时无视角色${enemy.breakArmor}%的防御力;首次攻击时,怪物额外无视角色${enemy.onceBreakArmor}%的防御力(加算)` }, "#88c0ff", ], //√
function (enemy) { [6, "吸血", function (enemy) {
return (enemy.n || "") + "连击"; return `怪物造成的物理伤害以${enemy.vampire}%回复怪物自身的生命值,不计对护盾造成的破坏`;
},
function (enemy) {
return "怪物每回合攻击" + (enemy.n || 4) + "次";
},
"#ffee77",
], //想改成“以XX%、XX%攻击力各攻击一次”
[
7,
"破甲",
function (enemy) {
return (
"怪物无视角色防御的" +
Math.floor(
100 * (enemy.breakArmor || core.values.breakArmor || 0)
) +
"%"
);
},
"#88c0ff",
], //√
[
8,
"反击",
function (enemy) {
return (
"战斗时,怪物每回合附加角色攻击的" +
Math.floor(
100 * (enemy.counterAttack || core.values.counterAttack || 0)
) +
"%作为伤害,无视角色防御"
);
},
"#ffaa44",
],
[
9,
"净化",
function (enemy) {
return (
"战斗前,怪物附加角色护盾的" +
(enemy.purify || core.values.purify) +
"倍作为伤害"
);
},
"#80eed6",
],
[10, "模仿", "怪物的攻防和角色攻防相等", "#b0c0dd"],
[
11,
"吸血",
function (enemy) {
return (
"战斗前,怪物首先吸取角色的" +
Math.floor(100 * enemy.vampire || 0) +
"%生命(约" +
Math.floor((enemy.vampire || 0) * core.getStatus("hp")) +
"点)作为伤害" +
(enemy.add ? ",并把伤害数值加到自身生命上" : "")
);
}, },
"#dd4448", "#dd4448",
], ],
[ [7, "诅咒", function (enemy) { return `当怪物的攻击同时造成了物理伤害和魔法伤害(护盾优先抵挡物理伤害),则魔法伤害提升${enemy.curseValue}%` }, "#bbeef0", ],
12, [8, "闪避", function (enemy) { return `怪物受到的首次普通攻击将被闪避而无效化;除此以外,怪物每受到${enemy.duck}次普通攻击造成的伤害就将闪避一次。` }, "#99ee88", ],
"中毒", [9, "寒霜", function (enemy) { return `怪物的${enemy.cold===0?"每次":"前"+enemy.cold+"次"}普通攻击命中角色时,将使角色在该场战斗中的速度下降${enemy.coldValue}点(速度最低为1)` }, "#99ee88", ],
"战斗后,角色陷入中毒状态,每一步损失生命" + [10, "灼炎", function (enemy) { return `怪物的普通攻击命中角色时,将在该场战斗中熔毁角色的防御${enemy.fire}` }, "#99ee88", ],
core.values.poisonDamage + [11, "风行", function (enemy) { return `怪物的基础速度将不低于角色的基础速度;怪物每次攻击命中或闪避攻击时,其速度提高${enemy.wind}` }, "#99ee88", ],
"点", [12, "撕裂", function (enemy) { return `怪物的普通攻击附加角色当前已损失生命值的${enemy.tear}%作为伤害,不计对护盾造成的破坏` }, "#99ee88", ],
"#99ee88", [13, "献祭", function (enemy) { return `怪物身周萦绕着火焰,火焰每次对角色造成${enemy.immolate}点魔法伤害,伤害速度等于怪物的初始生命` }, "#99ee88", ],
], [14, "闪电", function (enemy) { return `怪物对角色护盾的破坏效率提升${enemy.light}%。(击破护盾的那次攻击,剩余的伤害也计算闪电加成)` }, "#99ee88", ],
[
13, [15, "警戒", function (enemy) { return ("经过怪物周围" + (enemy.zoneSquare ? "九宫格" : "十字") + "范围内" + (enemy.range || 1) + "格时受到一次仅有20%护盾生效的攻击,扣除护盾后伤害为" + (Math.max(Math.max(enemy.atk - core.getRealStatusOrDefault(void 0, "def"), 0) + Math.floor(enemy.spell * (100 - core.getRealStatusOrDefault(void 0, "mdef")) / 100) - Math.floor(core.getRealStatusOrDefault(void 0, "spell") * core.getRealStatusOrDefault(void 0, "mhp") / 100 * 0.2), 0) || 0) + "点"); }, "#c677dd", ],
"衰弱", [16, "毒素", function (enemy) { return `怪物的普通攻击造成物理伤害时(不计对护盾造成的破坏)将附加一层毒素效果,每层毒素效果将使角色在该场战斗中攻击时流失${enemy.poison}点生命值` }, "#99ee88", ],
"战斗后,角色陷入衰弱状态,攻防暂时下降" +
(core.values.weakValue >= 1 ? [17, "汲取", function (enemy) { return `怪物对角色护盾造成破坏时,将窃取破坏数值的${enemy.absorb}%作为自身护盾` }, "#bbeef0", ],
core.values.weakValue + "点" : [18, "重力", function (enemy) { return `怪物操纵角色的重力,每携带一件双手装备速度下降${4*enemy.gravity}%,每携带一件单手装备速度下降${2*enemy.gravity}%,每携带一件其他装备速度下降${enemy.gravity}%` }, "#bbeef0", ],
parseInt(core.values.weakValue * 100) + "%"),
"#f0bbcc",
],
[
14,
"诅咒",
"战斗后,角色陷入诅咒状态,战斗无法获得金币和经验",
"#bbeef0",
],
[
15,
"领域",
function (enemy) {
return (
"经过怪物周围" +
(enemy.zoneSquare ? "九宫格" : "十字") +
"范围内" +
(enemy.range || 1) +
"格时自动减生命" +
(enemy.zone || 0) +
"点"
);
},
"#c677dd",
],
[16, "夹击", "经过两只相同的怪物中间,角色生命值变成一半", "#bb99ee"],
[
17,
"仇恨",
"战斗前,怪物附加之前积累的仇恨值作为伤害;战斗后,释放一半的仇恨值。(每杀死一个怪物获得" +
(core.values.hatred || 0) +
"点仇恨值)",
"#b0b666",
],
[
18,
"阻击",
function (enemy) {
return (
"经过怪物周围" +
(enemy.zoneSquare ? "九宫格" : "十字") +
"时自动减生命" +
(enemy.repulse || 0) +
"点,同时怪物后退一格"
);
},
"#8888e6",
],
[19, "自爆", "战斗后角色的生命值变成1", "#ff6666"],
[20, "无敌", "角色无法打败怪物,除非拥有十字架", "#aaaaaa"], [20, "无敌", "角色无法打败怪物,除非拥有十字架", "#aaaaaa"],
[
21, [25, "光环", function (enemy) { return ((enemy.range != null ? (enemy.haloSquare ? "该怪物九宫格" : "该怪物十字") + enemy.haloRange + "格范围内" : "同楼层所有") + "怪物生命提升" + (enemy.hpBuff || 0) + "%,攻击提升" + (enemy.atkBuff || 0) + "%,防御提升" + (enemy.defBuff || 0) + "%" + (enemy.haloAdd ? "可叠加" : "不可叠加")); }, "#e6e099", 1, ],
"退化", [27, "捕捉", function (enemy) { return ("当走到怪物周围" + (enemy.zoneSquare ? "九宫格" : "十字") + "时会强制进行战斗。"); }, "#c0ddbb", ],
function (enemy) {
return (
"战斗后角色永久下降" +
(enemy.atkValue || 0) +
"点攻击和" +
(enemy.defValue || 0) +
"点防御"
);
},
],
[
22,
"固伤",
function (enemy) {
return (
"战斗前,怪物对角色造成" +
(enemy.damage || 0) +
"点固定伤害,未开启负伤时无视角色护盾。"
);
},
"#ff9977",
],
[23, "重生", "怪物被击败后,角色转换楼层则怪物将再次出现", "#a0e0ff"],
[
24,
"激光",
function (enemy) {
return "经过怪物同行或同列时自动减生命" + (enemy.laser || 0) + "点";
},
"#dda0dd",
],
[
25,
"光环",
function (enemy) {
return (
(enemy.range != null ?
(enemy.haloSquare ? "该怪物九宫格" : "该怪物十字") +
enemy.haloRange +
"格范围内" :
"同楼层所有") +
"怪物生命提升" +
(enemy.hpBuff || 0) +
"%,攻击提升" +
(enemy.atkBuff || 0) +
"%,防御提升" +
(enemy.defBuff || 0) +
"%" +
(enemy.haloAdd ? "可叠加" : "不可叠加")
);
},
"#e6e099",
1,
],
[
26,
"支援",
"当周围一圈的怪物受到攻击时将上前支援,并组成小队战斗。",
"#77c0b6",
1,
],
[
27,
"捕捉",
function (enemy) {
return (
"当走到怪物周围" +
(enemy.zoneSquare ? "九宫格" : "十字") +
"时会强制进行战斗。"
);
},
"#c0ddbb",
],
]; ];
}, },
"getEnemyInfo": function (enemy, hero, x, y, floorId) { "getEnemyInfo": function (enemy, hero, x, y, floorId) {
@ -788,18 +563,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
mon_point = core.getEnemyValue(enemy, "point", x, y, floorId); mon_point = core.getEnemyValue(enemy, "point", x, y, floorId);
var mon_barrier = 0, var mon_barrier = 0,
mon_absorb_damage = 0; mon_absorb_damage = 0;
// 模仿 if (core.hasSpecial(mon_special, 11)) mon_speed = Math.max(mon_speed, hero_speed + 1)
if (core.hasSpecial(mon_special, 10)) { // 光环检查
mon_atk = hero_atk;
mon_def = hero_def;
}
// 坚固
if (core.hasSpecial(mon_special, 3) && mon_def < hero_atk - 1) {
mon_def = hero_atk - 1;
}
var guards = [];
// 光环和支援检查
if (!core.status.checkBlock) core.status.checkBlock = {}; if (!core.status.checkBlock) core.status.checkBlock = {};
if (core.status.checkBlock.needCache) { if (core.status.checkBlock.needCache) {
@ -845,21 +610,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
usedEnemyIds[enemy.id] = true; usedEnemyIds[enemy.id] = true;
} }
} }
// 检查【支援】技能数字26
if (
enemy &&
core.hasSpecial(enemy.special, 26) &&
// 检查支援条件坐标存在距离为1且不能是自己
// 其他类型的支援怪,比如十字之类的话.... 看着做是一样的
x != null &&
y != null &&
Math.abs(block.x - x) <= 1 &&
Math.abs(block.y - y) <= 1 &&
!(x == block.x && y == block.y)
) {
// 记录怪物的x,yID
guards.push([block.x, block.y, id]);
}
// TODO如果有其他类型光环怪物在这里仿照添加检查 // TODO如果有其他类型光环怪物在这里仿照添加检查
// 注新增新的类光环属性需要遍历全图的需要在特殊属性定义那里的第五项写1参见光环和支援的特殊属性定义。 // 注新增新的类光环属性需要遍历全图的需要在特殊属性定义那里的第五项写1参见光环和支援的特殊属性定义。
@ -870,14 +620,14 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
hp_buff: hp_buff, hp_buff: hp_buff,
atk_buff: atk_buff, atk_buff: atk_buff,
def_buff: def_buff, def_buff: def_buff,
guards: guards,
}; };
} else { } else {
// 直接使用缓存数据 // 直接使用缓存数据
hp_buff = cache.hp_buff; hp_buff = cache.hp_buff;
atk_buff = cache.atk_buff; atk_buff = cache.atk_buff;
def_buff = cache.def_buff; def_buff = cache.def_buff;
guards = cache.guards;
} }
// 增加比例;如果要增加数值可以直接在这里修改 // 增加比例;如果要增加数值可以直接在这里修改
@ -907,8 +657,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
money: Math.floor(mon_money), money: Math.floor(mon_money),
exp: Math.floor(mon_exp), exp: Math.floor(mon_exp),
point: Math.floor(mon_point), point: Math.floor(mon_point),
special: mon_special, special: mon_special
guards: guards // 返回支援情况
}; };
}, },
@ -947,7 +696,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
hero_spell = hero?.spell ?? core.status.hero.spell; hero_spell = hero?.spell ?? core.status.hero.spell;
} }
// 怪物的各项数据 // 怪物的各项数据
// 对坚固模仿等处理扔到了脚本编辑-getEnemyInfo之中
var enemyInfo = core.enemys.getEnemyInfo(enemy, hero, x, y, floorId); var enemyInfo = core.enemys.getEnemyInfo(enemy, hero, x, y, floorId);
var mon_hp = enemyInfo.hp, var mon_hp = enemyInfo.hp,
mon_atk = enemyInfo.atk, mon_atk = enemyInfo.atk,
@ -955,29 +704,31 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
mon_mdef = enemyInfo.mdef, mon_mdef = enemyInfo.mdef,
mon_spell = enemyInfo.spell, mon_spell = enemyInfo.spell,
mon_speed = enemyInfo.speed, mon_speed = enemyInfo.speed,
mon_special = enemyInfo.special, mon_special = enemyInfo.special
mon_absorb_damage = enemyInfo.absorb,
mon_barrier = enemyInfo.barrier;
const { lcm, gcd } = core.plugin.utils const { lcm, gcd } = core.plugin.utils
const equip0 = core.getEquip(0) const equip0 = core.getEquip(0)
//---第一部分:静态属性修正--- //---第一部分:静态属性修正---
//此处写入静态影响勇士属性的勇士或怪物技能静态影响怪物属性的技能于getEnemyInfo中写入 //此处写入静态影响勇士属性的勇士或怪物技能静态影响怪物属性的技能于getEnemyInfo中写入
// 技能的处理 // 技能的处理
if (core.getFlag("skill", 0) == 1) {
// 开启了技能1二倍斩 var enemyvalue = core.material.enemys[enemy.id]
hero_atk *= 2; // 计算时攻击力翻倍
if (core.hasSpecial(mon_special, 18)) {
let a = 0
for (let i = 0; i <= 4; i++) {
const equip = core.getEquip(i)
if (!equip) continue
const cls = core.material.items[equip].equipCls
if (cls === "双手剑") a += enemyvalue.gravity * 4
else if (['法杖', '单手剑', '匕首', '盾牌'].includes(cls)) a += enemyvalue.gravity * 2
else a += enemyvalue.gravity
}
hero_speed = hero_speed * (100 - a) / 100
} }
// 破甲
if (core.hasSpecial(mon_special, 7))
hero_def -= Math.floor(
(enemy.breakArmor || core.values.breakArmor) * hero_def
);
//勇士属性取整 //勇士属性取整
hero_atk = Math.max(0, Math.floor(hero_atk)); hero_atk = Math.max(0, Math.floor(hero_atk));
hero_def = Math.max(0, Math.floor(hero_def)); hero_def = Math.max(0, Math.floor(hero_def));
hero_speed = Math.max(0, Math.floor(hero_speed)); hero_speed = Math.max(1, Math.floor(hero_speed));
hero_spell = Math.max(0, Math.floor(hero_spell)); hero_spell = Math.max(0, Math.floor(hero_spell));
hero_matk = Math.min(100, Math.max(0, Math.floor(hero_matk))); hero_matk = Math.min(100, Math.max(0, Math.floor(hero_matk)));
hero_mdef = Math.min(100, Math.max(0, Math.floor(hero_mdef))); hero_mdef = Math.min(100, Math.max(0, Math.floor(hero_mdef)));
@ -987,26 +738,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (core.hasSpecial(mon_special, 20) && !core.hasItem("cross")) if (core.hasSpecial(mon_special, 20) && !core.hasItem("cross"))
return null; // 不可战斗 return null; // 不可战斗
// 战前造成的额外伤害(可被护盾抵消)
let init_damage = 0;
// 吸血
if (core.hasSpecial(mon_special, 11)) {
let vampire_damage = hero_hp * enemy.vampire;
// 如果有神圣盾免疫吸血等可以在这里写
// 也可以用hasItem和hasEquip来判定装备
// if (core.hasFlag('shield5')) vampire_damage = 0;
vampire_damage = Math.floor(vampire_damage) || 0;
// 加到自身
if (enemy.add)
// 如果加到自身
mon_hp += vampire_damage;
init_damage += vampire_damage;
}
//——第二部分:变量定义和初始赋值—— //——第二部分:变量定义和初始赋值——
let hero_per_damage = Math.max(hero_atk - mon_def, 0), let hero_per_damage = Math.max(hero_atk - mon_def, 0),
@ -1017,7 +748,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
hero_turn = 0, hero_turn = 0,
mon_turn = 0; mon_turn = 0;
let equipInfo = [] //回合生效的装备列表 let equipInfo = [] //回合生效的装备列表
if (core.hasSpecial(mon_special, 13)) equipInfo.push({
id: "献祭", //需注册图标
speed: mon_hp
})
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {
const a = core.plugin.equip[core.getEquip(i)] const a = core.plugin.equip[core.getEquip(i)]
if (a) equipInfo.push(a) if (a) equipInfo.push(a)
@ -1046,8 +780,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}) })
const heroinfo = { hp: hero_hp, atk: hero_atk, def: hero_def, mdef: (!hero?.mdef || hero?.mdef === 100) ? hero_mdef : hero.mdef, spell: hero_spell, mhp: Math.floor(hero_spell * hero_mhp / 100), matk: Math.floor(hero_spell * hero_matk / 100), speed: hero_speed, now: 0, isAttack: false } //勇士属性 const heroinfo = { hp: hero_hp, atk: hero_atk, def: hero_def, mdef: (!hero?.mdef || hero?.mdef === 100) ? hero_mdef : hero.mdef, spell: hero_spell, mhp: Math.floor(hero_spell * hero_mhp / 100), matk: Math.floor(hero_spell * hero_matk / 100), speed: hero_speed, now: 0, isAttack: false } //勇士属性
const enemyinfo = { hp: mon_hp, atk: mon_atk, def: mon_def, mdef: mon_mdef, spell: mon_spell, speed: mon_speed, special: mon_special, now: 0, isAttack: false } //怪物属性 const enemyinfo = { hp: mon_hp, atk: mon_atk, def: mon_def, mhp: 0, mdef: mon_mdef, spell: mon_spell, speed: mon_speed, special: mon_special, now: 0, isAttack: false } //怪物属性
//先攻,先攻为怪物和勇士勇士行动前怪物出第一刀 //先攻,先攻为怪物50%行动条
if (core.hasSpecial(mon_special, 1)) { if (core.hasSpecial(mon_special, 1)) {
enemyinfo.now = oneTurn / 2 enemyinfo.now = oneTurn / 2
heroinfo.now = 0 heroinfo.now = 0
@ -1068,7 +802,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
oneTurn *= i oneTurn *= i
const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), oneTurn] //记录开始战斗时的属性并转发 const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), oneTurn] //记录开始战斗时的属性并转发
//---第三部分:递归开始--- //---第三部分:递归开始---
let poison = 0
const heroDiffList = [], const heroDiffList = [],
enemyDiffList = [], enemyDiffList = [],
heroanimateList = [], heroanimateList = [],
@ -1101,14 +835,32 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
//伤害计算 //伤害计算
let per_damage = Math.max(heroinfo.atk - enemyinfo.def, 0) let per_damage = Math.max(heroinfo.atk - enemyinfo.def, 0)
let per_mdamage = Math.max(Math.floor(heroinfo.matk * (100 - enemyinfo.mdef) / 100), 0) let per_mdamage = Math.max(Math.floor(heroinfo.matk * (100 - enemyinfo.mdef) / 100), 0)
//坚固
if (core.hasSpecial(mon_special, 3)) per_damage = Math.min(per_damage, 1)
mon_damage = per_damage + per_mdamage mon_damage = per_damage + per_mdamage
if (enemyinfo.mhp > 0) {
if (mon_damage > enemyinfo.mhp + (enemy_diff.mhp ?? 0)) {
mon_damage -= enemyinfo.mhp + (enemy_diff.mhp ?? 0)
enemy_diff.mhp = -enemyinfo.mhp
} else {
enemy_diff.mhp = (enemy_diff.mhp ?? 0) - mon_damage
mon_damage = 0
}
}
//这里记录伤害触发后的属性变化和动画同时计入diff(不要在此直接修改heroinfo和enemyinfo) //这里记录伤害触发后的属性变化和动画同时计入diff(不要在此直接修改heroinfo和enemyinfo)
let animate = core.plugin.heroanimate[equip0] ?? "jianji2" let animate = core.plugin.heroanimate[equip0] ?? "jianji2"
//这里可通过if更改默认的武器攻击特效 //这里可通过if更改默认的武器攻击特效
enemy_animate.push(animate) enemy_animate.push(animate)
damage += poison
enemy_diff.hp = (enemy_diff.hp ?? 0) - mon_damage hero_diff.hp = (hero_diff.hp ?? 0) - poison
//闪避
enemy_diff.hp = (enemy_diff.hp ?? 0) - (core.hasSpecial(mon_special, 8) && hero_turn % enemyvalue.duck === 0 ? 0 : mon_damage)
//风行
if (core.hasSpecial(mon_special, 11) && core.hasSpecial(mon_special, 8) && hero_turn % enemyvalue.duck === 0) enemy_diff.speed = (enemy_diff.def ?? 0) + enemyvalue.wind
heroinfo.now -= oneTurn heroinfo.now -= oneTurn
hero_turn++ hero_turn++
onattack = true onattack = true
@ -1122,25 +874,69 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
//伤害计算 //伤害计算
let per_damage = Math.max(enemyinfo.atk - heroinfo.def, 0), let per_damage = Math.max(enemyinfo.atk - heroinfo.def, 0),
per_mdamage = Math.floor(enemyinfo.spell * (100 - heroinfo.mdef) / 100); per_mdamage = Math.floor(enemyinfo.spell * (100 - heroinfo.mdef) / 100);
//破甲
if (core.hasSpecial(mon_special, 5)) per_damage = Math.max(enemyinfo.atk - (mon_turn === 0 ? Math.floor(heroinfo.def * (enemyvalue.breakArmor + enemyvalue.onceBreakArmor) / 100) : Math.floor(heroinfo.def * enemyvalue.breakArmor / 100)), 0)
//这里记录伤害触发后的属性变化和动画同时计入diff、damage(不要在此直接修改heroinfo和enemyinfo) //这里记录伤害触发后的属性变化和动画同时计入diff、damage(不要在此直接修改heroinfo和enemyinfo)
if (core.hasSpecial(mon_special, 6)) { //反击
hero_damage += per_damage * enemy.n + per_mdamage * enemy.n if (core.hasSpecial(mon_special, 4) && mon_turn === 0) per_damage += Math.max(mon_hp - enemyinfo.hp, 0)
} else { //暴击
hero_damage += per_damage + per_mdamage if (core.hasSpecial(mon_special, 2) && mon_turn % enemyvalue.baoji === 0) {
per_damage = Math.floor(per_damage * enemyvalue.baoshang / 100)
per_mdamage = Math.floor(per_mdamage * enemyvalue.baoshang / 100)
} }
let animate = core.plugin.enemyanimate[enemy.id] ?? "jianji2" let animate = core.plugin.enemyanimate[enemy.id] ?? "jianji2"
//这里可通过if更改默认的怪物攻击特效 //这里可通过if更改默认的怪物攻击特效
hero_animate.push(animate) //勇士身上绘制sword动画 hero_animate.push(animate) //勇士身上绘制sword动画
if (heroinfo.mhp + (hero_diff.mhp ?? 0) - hero_damage >= 0) { //闪电
hero_diff.mhp = (hero_diff.mhp ?? 0) - hero_damage if (core.hasSpecial(mon_special, 14) && heroinfo.mhp + (hero_diff.mhp ?? 0) > 0) {
per_damage = Math.floor(per_damage * enemyvalue.light / 100)
per_mdamage = Math.floor(per_mdamage * enemyvalue.light / 100)
}
if (heroinfo.mhp + (hero_diff.mhp ?? 0) - per_damage - per_mdamage >= 0) { //完美护盾
//汲取
if (core.hasSpecial(mon_special, 17)) enemy_diff.mhp = (enemy_diff.mhp ?? 0) + Math.floor((per_damage + per_mdamage) * enemyvalue.absorb / 100)
hero_diff.mhp = (hero_diff.mhp ?? 0) - per_damage - per_mdamage
hero_damage = 0 hero_damage = 0
hero_diff.hp = (hero_diff.hp ?? 0) - hero_damage
} else {
hero_damage -= heroinfo.mhp + (hero_diff.mhp ?? 0)
hero_diff.mhp = (hero_diff.mhp ?? 0) - heroinfo.mhp - (hero_diff.mhp ?? 0)
} else if (heroinfo.mhp + (hero_diff.mhp ?? 0) - per_damage >= 0) { //护盾击破但只受到魔法伤害
//汲取
if (core.hasSpecial(mon_special, 17)) enemy_diff.mhp = (enemy_diff.mhp ?? 0) + Math.floor((heroinfo.mhp + (hero_diff.mhp ?? 0)) * enemyvalue.absorb / 100)
//诅咒
hero_damage = per_damage + (core.hasSpecial(mon_special, 7) && heroinfo.mhp > 0 ? 2 * per_mdamage : per_mdamage) - heroinfo.mhp
hero_diff.mhp = -heroinfo.mhp
//撕裂
if (core.hasSpecial(mon_special, 12)) hero_damage = MNath.floor(Math.max(mon_hp - enemyinfo.hp, 0) * enemyvalue.tear / 100)
hero_diff.hp = (hero_diff.hp ?? 0) - hero_damage hero_diff.hp = (hero_diff.hp ?? 0) - hero_damage
//灼炎
if (core.hasSpecial(mon_special, 10)) hero_diff.def = (hero_diff.def ?? 0) - enemyvalue.fire
//风行
if (core.hasSpecial(mon_special, 11)) enemy_diff.speed = (enemy_diff.def ?? 0) + enemyvalue.wind
} else { //护盾击破
if (core.hasSpecial(mon_special, 16)) poison++
//汲取
if (core.hasSpecial(mon_special, 17)) enemy_diff.mhp = (enemy_diff.mhp ?? 0) + Math.floor((heroinfo.mhp + (hero_diff.mhp ?? 0)) * enemyvalue.absorb / 100)
const over = per_damage - (hero_diff.mhp ?? 0)
//吸血
if (core.hasSpecial(mon_special, 6)) hero_diff.hp = (hero_diff.hp ?? 0) + Math.floor(over * enemyvalue.vampire / 100)
//诅咒
hero_damage = per_damage + (core.hasSpecial(mon_special, 7) && heroinfo.mhp > 0 ? 2 * per_mdamage : per_mdamage) - heroinfo.mhp
hero_diff.mhp = -heroinfo.mhp
//撕裂
if (core.hasSpecial(mon_special, 12)) hero_damage = MNath.floor(Math.max(mon_hp - enemyinfo.hp, 0) * enemyvalue.tear / 100)
hero_diff.hp = (hero_diff.hp ?? 0) - hero_damage
//灼炎
if (core.hasSpecial(mon_special, 10)) hero_diff.def = (hero_diff.def ?? 0) - enemyvalue.fire
//风行
if (core.hasSpecial(mon_special, 11)) enemy_diff.speed = (enemy_diff.def ?? 0) + enemyvalue.wind
}
//寒霜
if (core.hasSpecial(mon_special, 9) && enemyvalue.cold === 0 || enemyvalue.cold > mon_turn) {
hero_diff.speed = Math.max(1 - heroinfo.speed, (hero_diff.speed ?? 0) - enemyvalue.coldValue)
} }
damage += hero_damage damage += hero_damage
@ -1152,11 +948,21 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (v.now >= oneTurn) { if (v.now >= oneTurn) {
let mon_damage = 0 let mon_damage = 0
let hero_damage = 0 let hero_damage = 0
if (v.id === '献祭') {
if (heroinfo.mhp + (hero_diff.mhp ?? 0) - enemyvalue.immolate >= 0) {
hero_diff.mhp = (hero_diff.mhp ?? 0) - enemyvalue.immolate
} else {
hero_damage += enemyvalue.immolate - (hero_diff.mhp ?? 0)
hero_diff.mhp = -heroinfo.mhp
hero_diff.hp = (hero_diff.hp ?? 0) - hero_damage
}
}
//这里写生效装备的技能效果同时对双方属性的修改计入diff(不要在此直接修改heroinfo和enemyinfo) //这里写生效装备的技能效果同时对双方属性的修改计入diff(不要在此直接修改heroinfo和enemyinfo)
let animate = core.plugin.equipanimate[v.id] ?? "jianji2" let animate = core.plugin.equipanimate[v.id] ?? "jianji2"
//这里可通过if更改默认的道具特效 //这里可通过if更改默认的道具特效
enemy_animate.push(animate) //怪物身上绘制动画 enemy_animate.push(animate) //怪物身上绘制动画
damage += hero_damage
v.now -= oneTurn v.now -= oneTurn
onattack = true onattack = true
} }
@ -1187,77 +993,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
} }
//下面这些还没修改,原有技能除先攻、连击外暂时全部移除,所有技能需要在上方的模拟循环中做修正
/*
// 每回合的反击伤害;反击是按照勇士的攻击次数来计算回合
let counterDamage = 0;
if (core.hasSpecial(mon_special, 8))
counterDamage += Math.floor(
(enemy.counterAttack || core.values.counterAttack) * hero_atk
);
// 净化
if (core.hasSpecial(mon_special, 9))
init_damage += Math.floor(
(enemy.purify || core.values.purify) * hero_mdef
);
//上面这些还没修改
//勇士护盾计算
let barrier = Math.floor(hero_spell * hero_mhp / 100);
// ------ 支援 ----- //
// 这个递归最好想明白为什么flag:__extraTurn__是怎么用的
/*var guards = core.getFlag("__guards__" + x + "_" + y, enemyInfo.guards);
var guard_before_current_enemy = false; // ------ 支援怪是先打(true)还是后打(false)
turn += core.getFlag("__extraTurn__", 0);
if (guards.length > 0) {
if (!guard_before_current_enemy) { // --- 先打当前怪物,记录当前回合数
core.setFlag("__extraTurn__", turn);
}
// 获得那些怪物组成小队战斗
for (var i = 0; i < guards.length; i++) {
var gx = guards[i][0],
gy = guards[i][1],
gid = guards[i][2];
// 递归计算支援怪伤害信息这里不传x,y保证不会重复调用
// 这里的mdef传0因为护盾应该只会被计算一次
var info = core.enemys.getDamageInfo(core.material.enemys[gid], { hp: origin_hero_hp, atk: origin_hero_atk, def: origin_hero_def, mdef: 0 });
if (info == null) { // 小队中任何一个怪物不可战斗直接返回null
core.removeFlag("__extraTurn__");
return null;
}
// 已经进行的回合数
core.setFlag("__extraTurn__", info.turn);
init_damage += info.damage;
}
if (guard_before_current_enemy) { // --- 先打支援怪物,增加当前回合数
turn += core.getFlag("__extraTurn__", 0);
}
}
core.removeFlag("__extraTurn__");*/
// ------ 支援END ------ //
/*
// 最终伤害:初始伤害 + 怪物对勇士造成的伤害 + 反击伤害
damage += init_damage + hero_turn * counterDamage;
// 再扣去护盾
damage -= barrier;
// 检查是否允许负伤
if (!core.flags.enableNegativeDamage) damage = Math.max(0, damage);
// 最后处理仇恨和固伤(因为这两个不能被护盾减伤)
if (core.hasSpecial(mon_special, 17)) {
// 仇恨
damage += core.getFlag("hatred", 0);
}
if (core.hasSpecial(mon_special, 22)) {
// 固伤
damage += enemy.damage2 || 0;
}
*/
return { return {
start: start, start: start,
mon_hp: Math.floor(mon_hp), mon_hp: Math.floor(mon_hp),
@ -1757,19 +1493,19 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
type[loc][(block.event.name || "血网") + "伤害"] = true; type[loc][(block.event.name || "血网") + "伤害"] = true;
} }
// 领域 // 警戒
// 如果要防止领域伤害,可以直接简单的将 flag:no_zone 设为true // 如果要防止警戒伤害,可以直接简单的将 flag:no_zone 设为true
if ( if (
enemy && enemy &&
core.hasSpecial(enemy.special, 15) && core.hasSpecial(enemy.special, 15) &&
!core.hasFlag("no_zone") !core.hasFlag("no_zone")
) { ) {
// 领域范围默认为1 // 警戒范围默认为1
var range = enemy.range || 1; var range = enemy.range || 1;
// 是否是九宫格领域 // 是否是九宫格警戒
var zoneSquare = false; var zoneSquare = false;
if (enemy.zoneSquare != null) zoneSquare = enemy.zoneSquare; if (enemy.zoneSquare != null) zoneSquare = enemy.zoneSquare;
// 在范围内进行搜索,增加领域伤害值 // 在范围内进行搜索,增加警戒伤害值
for (var dx = -range; dx <= range; dx++) { for (var dx = -range; dx <= range; dx++) {
for (var dy = -range; dy <= range; dy++) { for (var dy = -range; dy <= range; dy++) {
if (dx == 0 && dy == 0) continue; if (dx == 0 && dy == 0) continue;
@ -1777,71 +1513,16 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
ny = y + dy, ny = y + dy,
currloc = nx + "," + ny; currloc = nx + "," + ny;
if (nx < 0 || nx >= width || ny < 0 || ny >= height) continue; if (nx < 0 || nx >= width || ny < 0 || ny >= height) continue;
// 如果是十字领域,则还需要满足 |dx|+|dy|<=range // 如果是十字警戒,则还需要满足 |dx|+|dy|<=range
if (!zoneSquare && Math.abs(dx) + Math.abs(dy) > range) continue; if (!zoneSquare && Math.abs(dx) + Math.abs(dy) > range) continue;
damage[currloc] = (damage[currloc] || 0) + (enemy.zone || 0); damage[currloc] = (damage[currloc] || 0) + (Math.max(Math.max(enemy.atk - core.getRealStatusOrDefault(void 0, "def"), 0) + Math.floor(enemy.spell * (100 - core.getRealStatusOrDefault(void 0, "mdef")) / 100) - Math.floor(core.getRealStatusOrDefault(void 0, "spell") * core.getRealStatusOrDefault(void 0, "mhp") / 100 * 0.2), 0) || 0);
type[currloc] = type[currloc] || {}; type[currloc] = type[currloc] || {};
type[currloc]["领域伤害"] = true; type[currloc]["警戒伤害"] = true;
} }
} }
} }
// 阻击
// 如果要防止阻击伤害,可以直接简单的将 flag:no_repulse 设为true
if (
enemy &&
core.hasSpecial(enemy.special, 18) &&
!core.hasFlag("no_repulse")
) {
var scan = enemy.zoneSquare ? core.utils.scan2 : core.utils.scan;
for (var dir in scan) {
var nx = x + scan[dir].x,
ny = y + scan[dir].y,
currloc = nx + "," + ny;
if (nx < 0 || nx >= width || ny < 0 || ny >= height) continue;
damage[currloc] = (damage[currloc] || 0) + (enemy.repulse || 0);
type[currloc] = type[currloc] || {};
type[currloc]["阻击伤害"] = true;
var rdir = core.turnDirection(":back", dir);
// 检查下一个点是否存在事件(从而判定是否移动)
var rnx = x + scan[rdir].x,
rny = y + scan[rdir].y;
if (rnx < 0 || rnx >= width || rny < 0 || rny >= height) continue;
// 如需禁止阻击被推到已隐藏的事件处如重生怪处可将这一句的false改为true
if (core.getBlock(rnx, rny, floorId, false) != null) continue;
if (core.utils.scan[rdir] && !core.canMoveHero(x, y, rdir, floorId))
continue;
repulse[currloc] = (repulse[currloc] || []).concat([
[x, y, id, rdir],
]);
}
}
// 激光
// 如果要防止激光伤害,可以直接简单的将 flag:no_laser 设为true
if (
enemy &&
core.hasSpecial(enemy.special, 24) &&
!core.hasFlag("no_laser")
) {
for (var nx = 0; nx < width; nx++) {
var currloc = nx + "," + y;
if (nx != x) {
damage[currloc] = (damage[currloc] || 0) + (enemy.laser || 0);
type[currloc] = type[currloc] || {};
type[currloc]["激光伤害"] = true;
}
}
for (var ny = 0; ny < height; ny++) {
var currloc = x + "," + ny;
if (ny != y) {
damage[currloc] = (damage[currloc] || 0) + (enemy.laser || 0);
type[currloc] = type[currloc] || {};
type[currloc]["激光伤害"] = true;
}
}
}
// 捕捉 // 捕捉
// 如果要防止捕捉效果,可以直接简单的将 flag:no_ambush 设为true // 如果要防止捕捉效果,可以直接简单的将 flag:no_ambush 设为true
@ -1864,94 +1545,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
(core.utils.scan[dir] && !core.canMoveHero(x, y, dir, floorId)) (core.utils.scan[dir] && !core.canMoveHero(x, y, dir, floorId))
) )
continue; continue;
ambush[currloc] = (ambush[currloc] || []).concat([[x, y, id, dir]]); ambush[currloc] = (ambush[currloc] || []).concat([
} [x, y, id, dir]
} ]);
// 夹击;在这里提前计算所有可能的夹击点,具体计算逻辑在下面
// 如果要防止夹击伤害,可以简单的将 flag:no_betweenAttack 设为true
if (
enemy &&
core.enemys.hasSpecial(enemy.special, 16) &&
!core.hasFlag("no_betweenAttack")
) {
for (var dir in core.utils.scan) {
var nx = x + core.utils.scan[dir].x,
ny = y + core.utils.scan[dir].y,
currloc = nx + "," + ny;
if (nx < 0 || nx >= width || ny < 0 || ny >= height) continue;
betweenAttackLocs[currloc] = true;
}
}
// 检查地图范围类技能
var specialFlag = core.getSpecialFlag(enemy);
if (specialFlag & 1) needCache = true;
if (core.status.event.id == "viewMaps") needCache = true;
if (
(core.status.event.id == "book" ||
core.status.event.id == "bool-detail") &&
core.status.event.ui
)
needCache = true;
}
// 对每个可能的夹击点计算夹击伤害
for (var loc in betweenAttackLocs) {
var xy = loc.split(","),
x = parseInt(xy[0]),
y = parseInt(xy[1]);
// 夹击怪物的ID
var enemyId1 = null,
enemyId2 = null;
// 检查左右夹击
var leftBlock = blocks[x - 1 + "," + y],
rightBlock = blocks[x + 1 + "," + y];
var leftId = core.getFaceDownId(leftBlock),
rightId = core.getFaceDownId(rightBlock);
if (
leftBlock &&
!leftBlock.disable &&
rightBlock &&
!rightBlock.disable &&
leftId == rightId
) {
if (core.hasSpecial(leftId, 16)) enemyId1 = leftId;
}
// 检查上下夹击
var topBlock = blocks[x + "," + (y - 1)],
bottomBlock = blocks[x + "," + (y + 1)];
var topId = core.getFaceDownId(topBlock),
bottomId = core.getFaceDownId(bottomBlock);
if (
topBlock &&
!topBlock.disable &&
bottomBlock &&
!bottomBlock.disable &&
topId == bottomId
) {
if (core.hasSpecial(topId, 16)) enemyId2 = topId;
}
if (enemyId1 != null || enemyId2 != null) {
var leftHp = core.status.hero.hp - (damage[loc] || 0);
if (leftHp > 1) {
// 夹击伤害值
var value = Math.floor(leftHp / 2);
// 是否不超过怪物伤害值
if (core.flags.betweenAttackMax) {
var enemyDamage1 = core.getDamage(enemyId1, x, y, floorId);
if (enemyDamage1 != null && enemyDamage1 < value)
value = enemyDamage1;
var enemyDamage2 = core.getDamage(enemyId2, x, y, floorId);
if (enemyDamage2 != null && enemyDamage2 < value)
value = enemyDamage2;
}
if (value > 0) {
damage[loc] = (damage[loc] || 0) + value;
type[loc] = type[loc] || {};
type[loc]["夹击伤害"] = true;
}
} }
} }
} }
@ -1986,19 +1582,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 更新跟随者状态,并绘制 // 更新跟随者状态,并绘制
core.updateFollowers(); core.updateFollowers();
core.drawHero(); core.drawHero();
// 检查中毒状态的扣血和死亡
if (core.hasFlag("poison")) {
core.status.hero.statistics.poisonDamage += core.values.poisonDamage;
core.status.hero.hp -= core.values.poisonDamage;
if (core.status.hero.hp <= 0) {
core.status.hero.hp = 0;
core.updateStatusBar(false, true);
core.events.lose();
return;
} else {
core.updateStatusBar(false, true);
}
}
// 从v2.7开始,每一步行走不会再刷新状态栏。 // 从v2.7开始,每一步行走不会再刷新状态栏。
// 如果有特殊要求如每走一步都加buff之类可手动取消注释下面这一句 // 如果有特殊要求如每走一步都加buff之类可手动取消注释下面这一句

View File

@ -20194,6 +20194,8 @@ let time=0
while (oneTurn * i / max < 15) { while (oneTurn * i / max < 15) {
i++ i++
} }
heroInfo.turn = 0
enemyInfo.turn = 0
heroInfo.now *= i heroInfo.now *= i
enemyInfo.now *= i enemyInfo.now *= i
equipInfo.forEach(v => { v.now *= i }) equipInfo.forEach(v => { v.now *= i })
@ -20815,11 +20817,13 @@ let time=0
} }
let nowattacking = false; let nowattacking = false;
if (heroInfo.now >= oneTurn && !heroInfo.isAttack) { if (heroInfo.now >= oneTurn && !heroInfo.isAttack) {
heroInfo.turn++
heroInfo.onAttack = false; heroInfo.onAttack = false;
heroInfo.isAttack = true; heroInfo.isAttack = true;
nowattacking = true; nowattacking = true;
} }
if (enemyInfo.now >= oneTurn && !enemyInfo.isAttack) { if (enemyInfo.now >= oneTurn && !enemyInfo.isAttack) {
enemyInfo.turn++
enemyInfo.onAttack = false; enemyInfo.onAttack = false;
enemyInfo.isAttack = true; enemyInfo.isAttack = true;
nowattacking = true; nowattacking = true;
@ -20834,9 +20838,14 @@ let time=0
} }
}); });
if (!attack && nowattacking) { if (!attack && nowattacking) {
let herodamage = enemyDiffList[turn].hp; let herodamage = enemyDiffList[turn].hp;
if (herodamage > 0) herodamage = "+" + herodamage; if (herodamage > 0) herodamage = "+" + herodamage;
let text = herodamage === 0 ? "抵抗" : herodamage; let text
if (core.hasSpecial(enemyInfo.id, 2) && (enemyInfo.turn - 1) % core.material.enemys[enemyInfo.id].baoji)
text = "暴击" + herodamage
else
text = herodamage === 0 ? "抵抗" : herodamage;
Dove.MorePerform.ShowDamagePop.PopDamage( Dove.MorePerform.ShowDamagePop.PopDamage(
ctx, // 默认画布名称 ctx, // 默认画布名称
@ -20862,6 +20871,9 @@ let time=0
enemyanimateList[turn].forEach((v) => animateonAttack(v, true)); enemyanimateList[turn].forEach((v) => animateonAttack(v, true));
let enemydamage = heroDiffList[turn].hp; let enemydamage = heroDiffList[turn].hp;
if (enemydamage > 0) enemydamage = "+" + enemydamage; if (enemydamage > 0) enemydamage = "+" + enemydamage;
if (core.hasSpecial(enemyInfo.id, 8) && (heroInfo.turn - 1) % core.material.enemys[enemyInfo.id].duck)
text = "闪避"
else
text = enemydamage === 0 ? "抵抗" : enemydamage; text = enemydamage === 0 ? "抵抗" : enemydamage;
Dove.MorePerform.ShowDamagePop.PopDamage( Dove.MorePerform.ShowDamagePop.PopDamage(
ctx, // 默认画布名称 ctx, // 默认画布名称
@ -24420,7 +24432,7 @@ let time=0
centerX += core.bigmap.offsetX; centerX += core.bigmap.offsetX;
centerY += core.bigmap.offsetY; centerY += core.bigmap.offsetY;
} }
var id = setTimeout(null); var id = Symbol();
animate.se = animate.se || {}; animate.se = animate.se || {};
if (typeof animate.se == 'string') animate.se = { 1: animate.se }; if (typeof animate.se == 'string') animate.se = { 1: animate.se };
tran.mode(linear()).time(1).absolute() tran.mode(linear()).time(1).absolute()
@ -24458,7 +24470,7 @@ let time=0
animate.se = animate.se || {}; animate.se = animate.se || {};
if (typeof animate.se == 'string') animate.se = { 1: animate.se }; if (typeof animate.se == 'string') animate.se = { 1: animate.se };
var id = id || setTimeout(null); var id = id || Symbol();
tran.mode(linear()).time(1).absolute() tran.mode(linear()).time(1).absolute()
if (!hero) tran.value[id + name + "x"] = centerX if (!hero) tran.value[id + name + "x"] = centerX
if (!hero) tran.value[id + name + "y"] = centerY if (!hero) tran.value[id + name + "y"] = centerY
@ -24663,7 +24675,7 @@ let time=0
if (!flags["animate_" + name]) { if (!flags["animate_" + name]) {
callback?.() callback?.()
} }
if (!id) id = setTimeout(null) if (!id) id = Symbol()
tran.mode(linear()).time(1).absolute() tran.mode(linear()).time(1).absolute()
if (!hero) tran.value[id + name + "x"] = x if (!hero) tran.value[id + name + "x"] = x
if (!hero) tran.value[id + name + "y"] = y if (!hero) tran.value[id + name + "y"] = y
@ -24680,11 +24692,11 @@ let time=0
loop: loop, loop: loop,
reverse: reverse, reverse: reverse,
farme: reverse ? flags["animate_" + name].allFarme : 0, farme: reverse ? flags["animate_" + name].allFarme : 0,
callback: callback
}; };
core.plugin.playing.add(data); core.plugin.playing.add(data);
callback?.()
return id return id
}; };
this.animateloop = function (id, loop) { this.animateloop = function (id, loop) {
@ -24738,6 +24750,7 @@ let time=0
} }
} }
if ((!one.reverse && one.farme > data.allFarme) || (one.reverse && one.farme < 0)) { if ((!one.reverse && one.farme > data.allFarme) || (one.reverse && one.farme < 0)) {
one.callback?.()
delete tran.value[one.id + one.name + "x"] delete tran.value[one.id + one.name + "x"]
delete tran.value[one.id + one.name + "y"] delete tran.value[one.id + one.name + "y"]
core.plugin.playing.delete(one) core.plugin.playing.delete(one)