taroxd 发表于 2016-5-14 07:00
没怎么看懂问题,不知道你是不是要这个
a.opponentsUnit().aliveMembers().length[/pre] ...
Game_Action.prototype.targetsForOpponents = function() { var targets = []; var unit = this.opponentsUnit(); if (this.isForRandom()) { for (var i = 0; i < this.numTargets(); i++) { targets.push(unit.randomTarget()); } } else if (this.isForOne() && (!this.subject().isActor || !this.subject()._skillquan)) { if (this._targetIndex < 0) { targets.push(unit.randomTarget()); } else { targets.push(unit.smoothTarget(this._targetIndex)); } } else { targets = unit.aliveMembers(); } return targets; };
Game_Action.prototype.targetsForOpponents = function() {
var targets = [];
var unit = this.opponentsUnit();
if (this.isForRandom()) {
for (var i = 0; i < this.numTargets(); i++) {
targets.push(unit.randomTarget());
}
} else if (this.isForOne() && (!this.subject().isActor || !this.subject()._skillquan)) {
if (this._targetIndex < 0) {
targets.push(unit.randomTarget());
} else {
targets.push(unit.smoothTarget(this._targetIndex));
}
} else {
targets = unit.aliveMembers();
}
return targets;
};
例如敌人我通过这种方法在单体技能时可切换成多目标技能,因为我需要目标数作为那个变量除一下,你那个没法根据目标数,如果能分歧也行,例如单目标=1,多目标=a.opponentsUnit().aliveMembers().length,可是我不会 |