本帖最后由 洛林 于 2016-3-27 02:27 编辑
想到了一个原始的方法,就是用 state 标记哪些是部位,哪个是boss,然后改一下 Game_Action.prototype.apply 函数Game_Action.prototype.apply = function(target) { var result = target.result(); this.subject().clearResult(); result.clear(); result.used = this.testApply(target); result.missed = (result.used && Math.random() >= this.itemHit(target)); result.evaded = (!result.missed && Math.random() < this.itemEva(target)); result.physical = this.isPhysical(); result.drain = this.isDrain(); if (result.isHit()) { if (this.item().damage.type > 0) { result.critical = (Math.random() < this.itemCri(target)); var value = this.makeDamageValue(target, result.critical); this.executeDamage(target, value); //BOSS hp 同步 if (target.isStateAffected(15)) { $gameTroop.members().forEach( function(member) { if (member.isStateAffected(14)) {member.gainHp(-value);} } ); } } this.item().effects.forEach(function(effect) { this.applyItemEffect(target, effect); }, this); this.applyItemUserEffect(target); } };
Game_Action.prototype.apply = function(target) {
var result = target.result();
this.subject().clearResult();
result.clear();
result.used = this.testApply(target);
result.missed = (result.used && Math.random() >= this.itemHit(target));
result.evaded = (!result.missed && Math.random() < this.itemEva(target));
result.physical = this.isPhysical();
result.drain = this.isDrain();
if (result.isHit()) {
if (this.item().damage.type > 0) {
result.critical = (Math.random() < this.itemCri(target));
var value = this.makeDamageValue(target, result.critical);
this.executeDamage(target, value);
//BOSS hp 同步
if (target.isStateAffected(15)) {
$gameTroop.members().forEach( function(member) {
if (member.isStateAffected(14)) {member.gainHp(-value);}
}
);
}
}
this.item().effects.forEach(function(effect) {
this.applyItemEffect(target, effect);
}, this);
this.applyItemUserEffect(target);
}
};
|