From 1aef219f538801c47164b6a5c46f789943ab723f Mon Sep 17 00:00:00 2001 From: oc Date: Thu, 27 Sep 2018 10:58:32 +0800 Subject: [PATCH] Equipment Buff --- docs/element.md | 4 +++- project/functions.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/element.md b/docs/element.md index 2a4d8444..a9e1dc78 100644 --- a/docs/element.md +++ b/docs/element.md @@ -77,12 +77,14 @@ animate为该装备的攻击动画,仅对type为0时有效。具体可参见[ ``` js {"type": 0, "atk": 10} // 装备类型是武器,效果是攻击提升10%,使用默认的攻击动画 -{"type": 0, "atk": 40, "animate": "sword"} // 装备类型为武器,效果是攻击提升10%,攻击动画是sword +{"type": 0, "atk": 40, "animate": "sword"} // 装备类型为武器,效果是攻击提升40%,攻击动画是sword {"type": 1, "def": 40} // 装备类型是防具,效果是防御提升40% {"type": 1, "def": 100, "mdef": 100} // 装备类型是防具,效果是防御和魔防各提升100% {"type": 3, "atk": -20, "def": 50, "mdef": 50} // 装备类型是魔杖,效果是攻击下降20%,防御和魔防各提升50% ``` +所有取值全部向下取整。 + 值得注意的是:多装备增加同一属性使用加法计算;也就是比如武器增加30%攻击,防具增加10%攻击,最终合起来增加的是40%而不是43%的属性。 ### 检测是否存在装备 diff --git a/project/functions.js b/project/functions.js index da3e33f9..de58713f 100644 --- a/project/functions.js +++ b/project/functions.js @@ -508,8 +508,8 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = // 装备按比例增加属性 if (core.flags.equipPercentage) { core.statusBar.atk.innerHTML = core.formatBigNumber(Math.floor(core.getFlag('equip_atk_buff',1)*core.getStatus('atk'))); - core.statusBar.def.innerHTML = core.formatBigNumber(Math.floor(core.getFlag('equip_def_buff',1)*core.getStatus('def'))); - core.statusBar.mdef.innerHTML = core.formatBigNumber(Math.floor(core.getFlag('equip_mdef_buff',1)*core.getStatus('mdef'))); + core.statusBar.def.innerHTML = core.formatBigNumber(Math.floor(core.getFlag('equip_def_buff',1)*core.getStatus('def'))); + core.statusBar.mdef.innerHTML = core.formatBigNumber(Math.floor(core.getFlag('equip_mdef_buff',1)*core.getStatus('mdef'))); } // 可以在这里添加自己额外的状态栏信息,比如想攻击显示 +0.5 可以这么写: