Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created February 22, 2018 19:03
Show Gist options
  • Save triacontane/77f2528f4295de9fece1fe10e71887c8 to your computer and use it in GitHub Desktop.
Save triacontane/77f2528f4295de9fece1fe10e71887c8 to your computer and use it in GitHub Desktop.
オーバーライドのサンプル
Game_Actor.prototype.die = function() {
// this._equipsはアクターオブジェクトにしか存在しない。
// よってGame_Actorにdieメソッドを定義して親であるGame_Battlerのdieメソッドを呼び出す。
Game_Battler.prototype.die.apply(this, arguments);
if (this._equips) {
this._equips[5].setObject(null);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment