Critical Condition:#16

如果技能/物品设置为不暴击,那就把这次行动实际的暴击几率赋值为零
否则,实际暴击率为 攻击者暴击率 - 攻击目标暴击闪避率
main
xian18 2 years ago
parent fec79f5165
commit 0e175a3a23
Signed by: SaltedFish
GPG Key ID: B0C26448E9EF40CA

@ -33,6 +33,13 @@ var SF_Plugins = SF_Plugins || {};
return this.subject().hit; return this.subject().hit;
}; };
Game_Action.prototype.attackCritical = function (target) {
if (!this.item().damage.critical) {
return 0;
}
return this.subject().cri - target.cev;
};
SF_Objects.Game_Action_apply = Game_Action.prototype.apply; SF_Objects.Game_Action_apply = Game_Action.prototype.apply;
Game_Action.prototype.apply = function (target) { Game_Action.prototype.apply = function (target) {
if (this.isAttack() || this.isSkill()) { if (this.isAttack() || this.isSkill()) {
@ -49,7 +56,7 @@ var SF_Plugins = SF_Plugins || {};
result.drain = this.isDrain(); result.drain = this.isDrain();
if (result.isHit()) { if (result.isHit()) {
if (this.item().damage.type > 0) { if (this.item().damage.type > 0) {
result.critical = Math.random() < this.subject().cri - target.cev; result.critical = Math.random() < this.attackCritical(target);
var value = this.makeDamageValue(target, result.critical); var value = this.makeDamageValue(target, result.critical);
this.executeDamage(target, value); this.executeDamage(target, value);
} }

Loading…
Cancel
Save