Original function in rpg_objects.js:
Code:
Game_CharacterBase.prototype.canPass = function(x, y, d) {
var x2 = $gameMap.roundXWithDirection(x, d);
var y2 = $gameMap.roundYWithDirection(y, d);
if (!$gameMap.isValid(x2, y2)) {
return false;
}
if (this.isThrough() || this.isDebugThrough()) {
return true;
}
if (!this.isMapPassable(x, y, d)) {
return false;
}
if (this.isCollidedWithCharacters(x2, y2)) {
return false;
}
return true;
};Code from plugin 1 (to make the player move in sync with an event):
Code:
Game_Event.prototype.canPass = function(x, y, d) {
return $gamePlayer.isSyncedWith(this._eventId) || this._playerSync ||
Game_CharacterBase.prototype.canPass.call(this, x, y, d);
};Code from plugin 2 (to make an event move only within a certain range):
Code:
Game_Event.prototype.canPass = function(x, y, d) {
var x2 = $gameMap.roundXWithDirection(x, d);
var y2 = $gameMap.roundYWithDirection(y, d);
return Game_CharacterBase.prototype.canPass.call(this, x, y, d) &&
x2 >= this._tlx && x2 <= this._brx && y2 >= this._tly && y2 <= this._bry;
};I need a way for the plugins to call other versions of Game_Event.canPass, and if no other versions can be found, to THEN call Game_CharacterBase.canPass. Does anyone know how to do this?