// 属性声明
Object.defineProperties(Game_BattlerBase.prototype, {
// HIT rate
hit: { get: function() { return this.xparam(0); }, configurable: true },
// EVAsion rate
eva: { get: function() { return this.xparam(1); }, configurable: true }
});
// 获取属性
Game_BattlerBase.prototype.xparam = function(xparamId) {
return this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId);
};
// 判断 item/skill 是否命中
Game_Action.prototype.itemHit = function(target) {
if (this.isPhysical()) {
// 技能命中率 * 角色命中
return this.item().successRate * 0.01 * this.subject().hit;
} else {
return this.item().successRate * 0.01;
}
};
// 属性声明
Object.defineProperties(Game_BattlerBase.prototype, {
// HIT rate
hit: { get: function() { return this.xparam(0); }, configurable: true },
// EVAsion rate
eva: { get: function() { return this.xparam(1); }, configurable: true }
});
// 获取属性
Game_BattlerBase.prototype.xparam = function(xparamId) {
return this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId);
};
// 判断 item/skill 是否命中
Game_Action.prototype.itemHit = function(target) {
if (this.isPhysical()) {
// 技能命中率 * 角色命中
return this.item().successRate * 0.01 * this.subject().hit;
} else {
return this.item().successRate * 0.01;
}
};
// 应用动作
Game_Action.prototype.apply = function(target) {
result.missed = (result.used && Math.random() >= this.itemHit(target));
result.evaded = (!result.missed && Math.random() < this.itemEva(target));
};
Game_Action.prototype.itemHit = function(target) {
if (this.isPhysical()) {
// 技能命中率 * 角色命中
return this.item().successRate * 0.01 * this.subject().hit;
} else {
return this.item().successRate * 0.01;
}
};
// 应用动作
Game_Action.prototype.apply = function(target) {
result.missed = (result.used && Math.random() >= this.itemHit(target));
result.evaded = (!result.missed && Math.random() < this.itemEva(target));
};
Game_Action.prototype.itemHit = function(target) {
if (this.isPhysical()) {
// 技能命中率 * 角色命中
return this.item().successRate * 0.01 * this.subject().hit;
} else {
return this.item().successRate * 0.01;
}
};