From 31d01ef1404091e8e927d41b9db89c216c9fd618 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Fri, 29 May 2020 21:22:44 +0800 Subject: [PATCH] getNakedStatus --- libs/control.js | 16 ++++++++++++++++ libs/items.js | 11 ----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/libs/control.js b/libs/control.js index a78fd56e..10b5b931 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2057,6 +2057,22 @@ control.prototype.getRealStatusOrDefault = function (status, name) { return Math.floor(this.getStatusOrDefault(status, name) * this.getBuff(name)); } +////// 获得勇士原始属性(无装备和衰弱影响) ////// +control.prototype.getNakedStatus = function (name) { + var value = this.getStatus(name); + if (value == null) return value; + // 装备增幅 + core.status.hero.equipment.forEach(function (v) { + if (!v || !(core.material.items[v] || {}).equip) return; + value -= core.material.items[v].equip.value[name] || 0; + }); + // 衰弱扣除 + if (core.hasFlag('weak') && core.values.weakValue >= 1 && (name == 'atk' || name == 'def')) { + value += core.values.weakValue; + } + return value; +} + ////// 设置某个属性的增幅值 ////// control.prototype.setBuff = function (name, value) { // 仅保留三位有效buff值 diff --git a/libs/items.js b/libs/items.js index 4ac6813b..b54db525 100644 --- a/libs/items.js +++ b/libs/items.js @@ -391,14 +391,3 @@ items.prototype.quickLoadEquip = function (index) { core.drawTip("成功换上" + index + "号套装"); } - -////// 获得装备直接增加的属性数据 ////// -items.prototype.getEquippedStatus = function (name) { - var value = 0; - core.status.hero.equipment.forEach(function (v) { - if (!v || !(core.material.items[v] || {}).equip) return; - if (core.material.items[v].equip.percentage) return; - value += core.material.items[v].equip[name] || 0; - }); - return value; -}