Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- /*:
- @plugindesc v1.00 Adds AP scene in victory aftermath
- @author Zarsla + Yanfly Engine Plugins
- @help
- ============================================================================
- Introduction
- ============================================================================
- Nothing much to say out side of the fact that this copies and paste the JP
- victory aftermath scene, and turns it into an AP one.
- ============================================================================
- Changelog
- ============================================================================
- */
- //=============================================================================
- function Window_VictoryAp() {
- this.initialize.apply(this, arguments);
- }
- Window_VictoryAp.prototype = Object.create(Window_VictoryExp.prototype);
- Window_VictoryAp.prototype.constructor = Window_VictoryAp;
- Window_VictoryAp.prototype.drawActorGauge = function(actor, index) {
- this.clearGaugeRect(index);
- var rect = this.gaugeRect(index);
- this.changeTextColor(this.normalColor());
- this.drawActorName(actor, rect.x + 2, rect.y);
- this.drawLevel(actor, rect);
- this.drawApGained(actor, rect);
- };
- Window_VictoryAp.prototype.drawApGained = function(actor, rect) {
- var actorLv = actor._preVictoryLv;
- var nowExp = actor._preVictoryExp - actor.expForLevel(actorLv);
- var nextExp = actor.expForLevel(actorLv + 1) - actor.expForLevel(actorLv);
- //Edit Text:
- var textEarned = "AP Earned in Battle";
- var wy = rect.y + this.lineHeight() * 1;
- this.changeTextColor(this.systemColor());
- this.drawText(textEarned, rect.x + 2, wy, rect.width - 4,
- 'left');
- var bonusAp = 1.0 * actor.availableAp() * this._tick /
- Yanfly.Param.VAGaugeTicks;
- var value = Yanfly.Util.toGroup(parseInt(bonusAp));
- //Edit Text:
- var ApText = value + " AP";
- this.changeTextColor(this.normalColor());
- wx = rect.x + rect.width - this.textWidthEx(ApText);
- this.drawTextEx(ApText, wx, wy);
- };
- //=============================================================================
- // Scene_Battle
- //=============================================================================
- var Yanfly_AP_Scene_Battle_addCustomVictorySteps =
- Scene_Battle.prototype.addCustomVictorySteps;
- Scene_Battle.prototype.addCustomVictorySteps = function(array) {
- array = Yanfly_AP_Scene_Battle_addCustomVictorySteps.call(this, array);
- if (!array.contains('AP')) array.push('AP');
- return array;
- };
- var Yanfly_AP_Scene_Battle_updateVictorySteps =
- Scene_Battle.prototype.updateVictorySteps;
- Scene_Battle.prototype.updateVictorySteps = function() {
- Yanfly_AP_Scene_Battle_updateVictorySteps.call(this);
- if (this.isVictoryStep('AP')) this.updateVictoryAp();
- };
- Scene_Battle.prototype.updateVictoryAp = function() {
- if (!this._victoryApWindow) {
- this.createVictoryAp();
- } else if (this._victoryApWindow.isReady()) {
- if (this.victoryTriggerContinue()) this.finishVictoryAp();
- }
- };
- Scene_Battle.prototype.createVictoryAp = function() {
- //Edit Text
- var text = "AP Earned"
- this._victoryTitleWindow.refresh(text);
- this._victoryApWindow = new Window_VictoryAp();
- this.addWindow(this._victoryApWindow);
- this._victoryApWindow.open();
- };
- Scene_Battle.prototype.finishVictoryAp = function() {
- SoundManager.playOk();
- this._victoryApWindow.close();
- this.processNextVictoryStep();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement