本帖最后由 芯☆淡茹水 于 2017-9-22 15:12 编辑
我是来搞笑的。
(function () { var new_levelUp = Game_Actor.prototype.levelUp; Game_Actor.prototype.levelUp = function() { new_levelUp.call(this); $gameTemp.reserveCommonEvent(this._actorId); }; }())();
(function () {
var new_levelUp = Game_Actor.prototype.levelUp;
Game_Actor.prototype.levelUp = function() {
new_levelUp.call(this);
$gameTemp.reserveCommonEvent(this._actorId);
};
}())();
才发现后面的公共事件会覆盖掉以前的,这样就行了:
(function () { Game_System.prototype.commonEventData = function() { return this._commonEventData || []; }; Game_System.prototype.addEventData = function(id) { this._commonEventData = this._commonEventData || []; this._commonEventData.push(id); }; var new_levelUp = Game_Actor.prototype.levelUp; Game_Actor.prototype.levelUp = function() { new_levelUp.call(this); if (this._actorId < 5) $gameSystem.addEventData(this._actorId); }; Game_Interpreter.prototype.setupReservedCommonEvent = function() { if ($gameTemp.isCommonEventReserved()) { this.setup($gameTemp.reservedCommonEvent().list); $gameTemp.clearCommonEvent(); return true; } else { //-------------------------------------------------------- if (!this.isRunning()) { if ($gameSystem.commonEventData().length > 0){ var evId = $gameSystem.commonEventData().shift(); $gameTemp.reserveCommonEvent(evId); } } //-------------------------------------------------------- return false; } }; }())();
(function () {
Game_System.prototype.commonEventData = function() {
return this._commonEventData || [];
};
Game_System.prototype.addEventData = function(id) {
this._commonEventData = this._commonEventData || [];
this._commonEventData.push(id);
};
var new_levelUp = Game_Actor.prototype.levelUp;
Game_Actor.prototype.levelUp = function() {
new_levelUp.call(this);
if (this._actorId < 5) $gameSystem.addEventData(this._actorId);
};
Game_Interpreter.prototype.setupReservedCommonEvent = function() {
if ($gameTemp.isCommonEventReserved()) {
this.setup($gameTemp.reservedCommonEvent().list);
$gameTemp.clearCommonEvent();
return true;
} else {
//--------------------------------------------------------
if (!this.isRunning()) {
if ($gameSystem.commonEventData().length > 0){
var evId = $gameSystem.commonEventData().shift();
$gameTemp.reserveCommonEvent(evId);
}
}
//--------------------------------------------------------
return false;
}
};
}())();
|