/*:
* @plugindesc When a character is on a ladder, they will use the next set of sprites in the same sprite sheet.
* (For example, if your character uses the upper-left set of sprites when walking, then they will use the set
* of sprites directly to the right when on a ladder.)
* @author Ben Hendel-Doying
* @help
* COMPATIBILITY:
* * REPLACES Game_CharacterBase..increaseSteps
* * ALIASES Game_Player..clearTransferInfo
* * REPLACES Game_CharacterBase..ladderCheck
*/

Game_CharacterBase.prototype.increaseSteps = function() {
this.ladderCheck(false);
this.resetStopCount();
this.refreshBushDepth();
};

var AltClimbingCharacter_Game_Player_clearTransferInfo = Game_Player.prototype.clearTransferInfo;

Game_Player.prototype.clearTransferInfo = function() {
AltClimbingCharacter_Game_Player_clearTransferInfo.call(this);

this.ladderCheck(true);
};

Game_CharacterBase.prototype.ladderCheck = function(characterTransferred) {
if (this.isOnLadder())
{
this.setDirection(8);

if(!this._wasOnLadder)
{
this._wasOnLadder = true;
this.setImage(this.characterName(), this.characterIndex() + 1);
}
}
else if(this._wasOnLadder)
{
this._wasOnLadder = false;

if(!characterTransferred)
this.setImage(this.characterName(), this.characterIndex() - 1);
}
};