赞 | 156 |
VIP | 0 |
好人卡 | 0 |
积分 | 259 |
经验 | 0 |
最后登录 | 2025-5-11 |
在线时间 | 5242 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 25891
- 在线时间
- 5242 小时
- 注册时间
- 2016-3-8
- 帖子
- 1648
|
本帖最后由 alexncf125 于 2023-9-22 23:49 编辑
- Game_Action.prototype.itemEffectAddNormalState = function(target, effect) {
- var chance = effect.value1;
- if (!this.isCertainHit()) {
- chance *= target.stateRate(effect.dataId);
- chance *= this.lukEffectRate(target);
- }
- if (Math.random() < chance) {
- target.addState(effect.dataId);
- this.makeSuccess(target);
- }
- };
复制代码
- Game_Action.prototype.lukEffectRate = function(target) {
- return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
- };
复制代码
敌人的幸运调到1,我的幸运是10
敌人攻击我挨打,所以this.subject().luk是1,而target.luk是10
敌人攻击设置为:附加状态 中毒100%,所以effect.value1是1
因为有行if (!this.isCertainHit()) {}
所以敌人攻击的命中类型得不是"必定命中"才会计算幸运影响与target.stateRate(effect.dataId)(我对中毒的状态抗性)
那假如敌人攻击的命中类型不是"必定命中"而我对中毒的状态抗性是1(100%)
lukEffectRate计算:Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0) = 1.0 + (1 - 10) * 0.001与0.0取最大值 = 0.991
itemEffectAddNormalState计算:effect.value1 * target.stateRate(effect.dataId) * this.lukEffectRate(target) = 1 x 1 x 0.991 = 0.991
结论就是你测说的100%其实不对,而是99.1% |
|