O TEMA DO FÓRUM ESTÁ EM MANUTENÇÃO. FEEDBACKS AQUI: ACESSAR

Chamar tela de experiência.

Iniciado por Darkrafa, 24/02/2017 às 15:15

Eu estava usando o victory aftermath e tentando achar uma brecha no plugin a qual eu possa usar para chamar a cena de ganho de experiencia isoladamente mas sem êxito.
Estou usando um sistema de quest e gostaria de complementá-lo com essa cena. Quando a pessoa completa a quest e ganha seu premio, a experiencia em questão, eu gostaria de poder chamar a cena onde no plugin victory aftermath mostra os personagens e a experiencia respectiva sendo adicionada.
Semelhante a rpgs que vc encontra por aí, como por exemplo o novo FFXV = vc completa a quest, ganha a experiencia e o monte dela é mostrado.

Na verdade poderia ser qualquer cena onde mostra a experiencia sendo acumulada mesmo, uso o exemplo do victory aftermath para, talvez, ficar mais fácil.

Alguma ideia, senhores?
Obrigado.

Eu não uso MV, mas eu sei que há uma opção no evento para adicionar à experiência. Normalmente, esta é a primeira página do evento, seção "herói" na coluna da direita há uma "Change Exp" (ou "troca de exp" em Inglês). Depois, você pode adicionar uma mensagem que diz "Você começa XX pontos de experiência."
Aqui está a minha solução, se eu entender o problema. Na esperança de tê-lo ajudado :blink: .

Eu agradeço a resposta, Yamashi, mas isso seria simplório demais, aí apenas diria o quanto que o grupo/ator ganhou de experiencia.
O que eu busco é algo que mostre a experiencia ganha como numa barrinha, igual a que aparece no Victory Aftermath.

24/02/2017 às 21:25 #3 Última edição: 24/02/2017 às 21:51 por Yamashi
Eu vejo. I tentar algo e eu protestou tudo. Se eu não responder no prazo de 48 horas, é que eu não tenho nenhuma solução.

Edit: Eu posso ver este plugin?

Tudo bem.
Pode. Obrigado.

Spoiler
1
//=============================================================================
// Yanfly Engine Plugins - Victory Aftermath
// YEP_VictoryAftermath.js
//=============================================================================

var Imported = Imported || {};
Imported.YEP_VictoryAftermath = true;

var Yanfly = Yanfly || {};
Yanfly.VA = Yanfly.VA || {};

//=============================================================================
/*:
* @plugindesc v1.05b Mostra uma janela informativa depois que uma batalha
* terminou em vez de uma caixa de mensagem dizendo o que a party ganhou.
* @author Yanfly Engine Plugins
*
* @param ---General---
* @default
*
* @param Victory Order
* @desc Essa é a ordem que a sequência de vitória terá.
* Separe cada parte com um espaço.
* @default exp custom drops
*
* @param ---BGM---
* @default
*
* @param Victory BGM
* @desc Esse será o BGM usado quando a batalha acabar.
* @default Ship3
*
* @param BGM Volume
* @desc Esse será o volume do BGM que vai tocar.
* @default 90
*
* @param BGM Pitch
* @desc Esse será o pitch do BGM que vai tocar.
* @default 100
*
* @param BGM Pan
* @desc Esse será o pan do BGM que vai tocar.
* @default 0
*
* @param ---Battle Results---
* @default
*
* @param Cheer Wait
* @desc Isso será quantos frames os personagens irão ter de alegria
* antes que a janela de vitória apareça.
* @default 90
*
* @param Battle Results Text
* @desc Esse é o texto usado para o texto de resultados de batalha.
* @default Battle Results
*
* @param Battle Drops Text
* @desc Esse é o texto usado para os ganhos de drop na batalha.
* @default Battle Spoils
*
* @param ---EXP Window---
* @default
*
* @param Font Size
* @desc This is the font size used for the EXP Window.
* Default: 28
* @default 28
*
* @param Level Up Text
* @desc O texto usado quando passando de level.
* @default LEVEL UP!
*
* @param Max Level Text
* @desc O texto usado quando o personagem está no level máximo.
* @default MAX LEVEL
*
* @param Show Skills Learned
* @desc Exibir habilidades aprendidas no level up?
* NÃO - false     SIM - true
* @default true
*
* @param Gained EXP Text
* @desc O texto que rotula quantos de EXP foi ganho na batalha.
* @default Gained EXP
*
* @param Gained EXP Format
* @desc O texto que mostra quantos de EXP foi ganho na batalha.
* @default +%1
*
* @param EXP Gauge Color 1
* @desc A cor de pele usada no EXP Gauge Color 1 mostrada na
* janela de resultado de vitória.
* @default 30
*
* @param EXP Gauge Color 2
* @desc A cor de pele usada no EXP Gauge Color 2 mostrada na
* janela de resultado de vitória.
* @default 31
*
* @param Level Gauge Color 1
* @desc A cor de pele usada para o EXP Gauge Color 1 se o personagem
* passou de level.
* @default 14
*
* @param Level Gauge Color 2
* @desc A cor de pele usada para o EXP Gauge Color 2 se o personagem
* passou de level.
* @default 6
*
* @param Gauge Ticks
* @desc Isso são quantos ticks irão ocorrer antes que o indicador de
* EXP ganho esteja cheio. Cada tick são 4 frames.
* @default 15
*
* @param Tick SE
* @desc Isso será o som usado enquanto o indicador de EXP enche.
* @default Absorb2
*
* @param Tick Volume
* @desc Esse será o volume do BGM que vai tocar.
* @default 90
*
* @param Tick Pitch
* @desc Esse será o pitch do BGM que vai tocar.
* @default 150
*
* @param Tick Pan
* @desc Esse será o pan do BGM que vai tocar.
* @default 0
*
* @help
* ============================================================================
* Introdução
* ============================================================================
*
* Esse plugin troca as mensagens de vitória do sistema de batalha padrão
* em favor de mais janelas informativas a serem mostradas. Ajuste os
* parâmetros para mudar as configurações para se encaixar ao seu jogo.
*
* ============================================================================
* Resultado de Vitória
* ============================================================================
*
* Nos parâmetros, tem um parâmetro 'Victory Order'. Esse parâmetro
* deixa você escolher a ordem dos passos no Resultado de Vitória.
*
* A ordem padrão é a seguinte:
*           exp          Mostra a janela de EXP.
*           custom       Mostra qualquer plugin de extensões personalizadas.
*           drops        Mostra a janela de drops.
*
* Se você trocar a ordem desses passos, adicionar passos, ou remover passos
* do plugin 'Victory Order', o Resultado de Vitória vai corresponder a
* qualquer mudança que você fez.
*
* ============================================================================
* Comandos de Plugin
* ============================================================================
*
* Se você quiser alterar um pouco a sequência do Resultado de Vitória, você
* pode usar os seguintes Comandos de Plugin.
*
* Comandos de Plugin:
*   DisableVictoryAftermath   - Inabilita a sequência do Resultado
*                               de Vitória e evita sua música, também.
*   EnableVictoryAftermath    - Habilita a sequência de Resultado de
*                               Vitória se foi previamente inabilitado.
*   DisableVictoryMusic       - Inabilita a música do Resultado de
*                               Vitória para continuar tocando o que estava
*                               tocando.
*   EnableVictoryMusic        - Habilita a música do Resultado de
*                               Vitória se foi previamente inabilitado.
*
* ============================================================================
* Changelog
* ============================================================================
*
* Version 1.05a:
* - Added 'Font Size' plugin parameter to alter the font size for the battle
* results page.
* - Fixed a graphical issue where an actor in crisis would display its level
* in the crisis color.
* - Changed the Victory Aftermath sequence so that the player can hold down a
* button to quickly go through all the Victory Sequence menus.
*
* Version 1.04:
* - Updated the plugin so it doesn't break visually when party sizes are too
* large. That said, if the party size is beyond a certain amount, this plugin
* will not support that many faces for it and will fit just the bare minimum.
*
* Version 1.03:
* - Added parameter 'Show Skills Learned'.
*
* Version 1.02:
* - If the Battle HUD has been hidden for whatever reason during the victory
* sequence, it will be returned.
*
* Version 1.01:
* - Fixed a bug plugin commands that would cause some victory sequences to
* loop forever.
*
* Version 1.00:
* - Finished plugin!
*/
//=============================================================================

//=============================================================================
// Parameter Variables
//=============================================================================

Yanfly.Parameters = PluginManager.parameters('YEP_VictoryAftermath');
Yanfly.Param = Yanfly.Param || {};

Yanfly.Param.VAOrder = String(Yanfly.Parameters['Victory Order']);

Yanfly.Param.VACheerWait = Number(Yanfly.Parameters['Cheer Wait']);
Yanfly.Param.VABattleResults = String(Yanfly.Parameters['Battle Results Text']);
Yanfly.Param.VABattleDrops = String(Yanfly.Parameters['Battle Drops Text']);

Yanfly.Param.VABgmName = String(Yanfly.Parameters['Victory BGM']);
Yanfly.Param.VABgmVol = Number(Yanfly.Parameters['BGM Volume']);
Yanfly.Param.VABgmPitch = Number(Yanfly.Parameters['BGM Pitch']);
Yanfly.Param.VABgmPan = Number(Yanfly.Parameters['BGM Pan']);

Yanfly.Param.VAFontSize = Number(Yanfly.Parameters['Font Size']);
Yanfly.Param.VALevelUp = String(Yanfly.Parameters['Level Up Text']);
Yanfly.Param.VAMaxLv = String(Yanfly.Parameters['Max Level Text']);
Yanfly.Param.VAShowSkills = String(Yanfly.Parameters['Show Skills Learned']);
Yanfly.Param.VAGainedExp = String(Yanfly.Parameters['Gained EXP Text']);
Yanfly.Param.VAGainedExpfmt = String(Yanfly.Parameters['Gained EXP Format']);
Yanfly.Param.ColorExp1 = Number(Yanfly.Parameters['EXP Gauge Color 1']);
Yanfly.Param.ColorExp2 = Number(Yanfly.Parameters['EXP Gauge Color 2']);
Yanfly.Param.ColorLv1 = Number(Yanfly.Parameters['Level Gauge Color 1']);
Yanfly.Param.ColorLv2 = Number(Yanfly.Parameters['Level Gauge Color 2']);
Yanfly.Param.VAGaugeTicks = Number(Yanfly.Parameters['Gauge Ticks']);
Yanfly.Param.VATickName = String(Yanfly.Parameters['Tick SE']);
Yanfly.Param.VATickVol = Number(Yanfly.Parameters['Tick Volume']);
Yanfly.Param.VATickPitch = Number(Yanfly.Parameters['Tick Pitch']);
Yanfly.Param.VATickPan = Number(Yanfly.Parameters['Tick Pan']);

//=============================================================================
// BattleManager
//=============================================================================

Yanfly.VA.BattleManager_initMembers = BattleManager.initMembers;
BattleManager.initMembers = function() {
    Yanfly.VA.BattleManager_initMembers.call(this);
    this.initVictoryData();
};

BattleManager.initVictoryData = function() {
    this._victoryPhase = false;
    this._victoryCheerWait = 0;
    this._victoryStep = 0;
};

BattleManager.processVictory = function() {
    $gameParty.performVictory();
    if (this.isVictoryPhase()) return;
    if (this._windowLayer) this._windowLayer.x = 0;
    $gameParty.removeBattleStates();
    this._victoryPhase = true;
    if ($gameSystem.skipVictoryAftermath()) {
      this.processSkipVictory();
    } else {
      this.processNormalVictory();
    }
};

BattleManager.isVictoryPhase = function() {
    return this._victoryPhase;
};

BattleManager.isFinishedVictoryCheer = function() {
    return ++this._victoryCheerWait >= Yanfly.Param.VACheerWait;
};

BattleManager.processSkipVictory = function() {
    this.makeRewards();
    this.gainRewards();
    this.replayBgmAndBgs();
    this.endBattle(0);
};

BattleManager.processNormalVictory = function() {
    if (!$gameSystem.skipVictoryMusic()) this.playVictoryMe();
    this.makeRewards();
    this.startVictoryPhase();
};

Yanfly.VA.BattleManager_playVictoryMe = BattleManager.playVictoryMe;
BattleManager.playVictoryMe = function() {
    Yanfly.VA.BattleManager_playVictoryMe.call(this);
    this.playVictoryBGM();
};

BattleManager.playVictoryBGM = function() {
    var victoryBgm = {
      name:   Yanfly.Param.VABgmName,
      volume: Yanfly.Param.VABgmVol,
      pitch:  Yanfly.Param.VABgmPitch,
      pan:    Yanfly.Param.VABgmPan
    };
    AudioManager.playBgm(victoryBgm);
};

BattleManager.startVictoryPhase = function() {
    this._victoryCheerWait = 0;
    this._victoryStep = 0;
    this.prepareVictoryInfo();
};

BattleManager.prepareVictoryInfo = function() {
    $gameParty.allMembers().forEach(function(actor) {
        ImageManager.loadFace(actor.faceName());
        actor._preVictoryExp = actor.currentExp();
        actor._preVictoryLv = actor._level;
        actor._victoryPhase = true;
        actor._victorySkills = [];
    }, this);
    this.gainRewards();
    $gameParty.allMembers().forEach(function(actor) {
        actor._expGained = actor.currentExp() - actor._preVictoryExp;
        actor._postVictoryLv = actor._level;
    }, this);
};

BattleManager.processVictoryFinish = function() {
    $gameParty.clearVictoryData();
    this.endBattle(0);
    this.replayBgmAndBgs();
    this._victoryPhase = false;
};

//=============================================================================
// Game_System
//=============================================================================

Yanfly.VA.Game_System_initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function() {
    Yanfly.VA.Game_System_initialize.call(this);
    this._skipVictoryAftermath = false;
    this._skipVictoryMusic = false;
};

Game_System.prototype.skipVictoryAftermath = function() {
    return this._skipVictoryAftermath;
};

Game_System.prototype.skipVictoryMusic = function() {
    return this._skipVictoryMusic;
};

//=============================================================================
// Game_Actor
//=============================================================================

Yanfly.VA.Game_Actor_shouldDisplayLevelUp =
    Game_Actor.prototype.shouldDisplayLevelUp;
Game_Actor.prototype.shouldDisplayLevelUp = function() {
    if ($gameParty.inBattle()) return false;
    return Yanfly.VA.Game_Actor_shouldDisplayLevelUp.call(this);
};

Game_Actor.prototype.clearVictoryData = function() {
    this._preVictoryExp = undefined;
    this._preVictoryLv = undefined;
    this._expGained = undefined;
    this._postVictoryLv = undefined;
    this._victoryPhase = undefined;
    this._victorySkills = undefined;
};

Yanfly.VA.Game_Actor_learnSkill = Game_Actor.prototype.learnSkill;
Game_Actor.prototype.learnSkill = function(skillId) {
    if (!this.isLearnedSkill(skillId) && this._victoryPhase) {
      this._victorySkills.push(skillId);
    }
    Yanfly.VA.Game_Actor_learnSkill.call(this, skillId);
};

//=============================================================================
// Game_Party
//=============================================================================

Game_Party.prototype.clearVictoryData = function() {
    for (var i = 0; i < this.members().length; ++i) {
      var actor = this.members();
      if (!actor) continue;
      actor.clearVictoryData();
    }
};

//=============================================================================
// Game_Interpreter
//=============================================================================

Yanfly.VA.Game_Interpreter_pluginCommand =
    Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
    Yanfly.VA.Game_Interpreter_pluginCommand.call(this, command, args)
    if (command === 'DisableVictoryAftermath') {
      $gameSystem._skipVictoryAftermath = true;
    }
    if (command === 'EnableVictoryAftermath') {
      $gameSystem._skipVictoryAftermath = false;
    }
    if (command === 'DisableVictoryMusic') {
      $gameSystem._skipVictoryMusic = true;
    }
    if (command === 'EnableVictoryMusic') {
      $gameSystem._skipVictoryMusic = false;
    }
};

Game_Interpreter.prototype.gotoSceneParty = function() {
    if (!$gameParty.inBattle()) SceneManager.push(Scene_Party);
    return true;
};

Game_Interpreter.prototype.lockActor = function(args, value) {
    for (i = 0; i < args.length; i++) {
      var actorId = Number(args);
      if ($gameActors.actor(actorId)) {
        $gameActors.actor(actorId)._locked = value;
      }
    }
};

Game_Interpreter.prototype.requireActor = function(args, value) {
    for (i = 0; i < args.length; i++) {
      var actorId = Number(args);
      if ($gameActors.actor(actorId)) {
        $gameActors.actor(actorId)._required = value;
      }
    }
};

//=============================================================================
// Window_VictoryTitle
//=============================================================================

function Window_VictoryTitle() {
    this.initialize.apply(this, arguments);
}

Window_VictoryTitle.prototype = Object.create(Window_Base.prototype);
Window_VictoryTitle.prototype.constructor = Window_VictoryTitle;

Window_VictoryTitle.prototype.initialize = function() {
    var width = this.windowWidth();
    var height = this.windowHeight();
    Window_Base.prototype.initialize.call(this, 0, 0, width, height);
    this.refresh(Yanfly.Param.VABattleResults);
    this.openness = 0;
};

Window_VictoryTitle.prototype.windowWidth = function() {
    return Graphics.boxWidth;
};

Window_VictoryTitle.prototype.windowHeight = function() {
    return this.fittingHeight(1);
};

Window_VictoryTitle.prototype.refresh = function(text) {
    this.contents.clear();
    this.drawText(text, 0, 0, this.contents.width, 'center');
};

//=============================================================================
// Window_VictoryExp
//=============================================================================

function Window_VictoryExp() {
    this.initialize.apply(this, arguments);
}

Window_VictoryExp.prototype = Object.create(Window_Selectable.prototype);
Window_VictoryExp.prototype.constructor = Window_VictoryExp;

Window_VictoryExp.prototype.initialize = function() {
    var wy = this.fittingHeight(1);
    var width = this.windowWidth();
    var height = this.windowHeight();
    this._showGainedSkills = eval(Yanfly.Param.VAShowSkills);
    Window_Selectable.prototype.initialize.call(this, 0, wy, width, height);
    this.defineTickSound();
    this.refresh();
    AudioManager.playSe(this._tickSound);
    this._tick = 0;
    this.openness = 0;
};

Window_VictoryExp.prototype.windowWidth = function() {
    return Graphics.boxWidth;
};

Window_VictoryExp.prototype.windowHeight = function() {
    return Graphics.boxHeight - this.fittingHeight(1);
};

Window_VictoryExp.prototype.maxItems = function() {
    return $gameParty.maxBattleMembers();
};

Window_VictoryExp.prototype.standardFontSize = function() {
    return Yanfly.Param.VAFontSize;
};

Window_VictoryExp.prototype.lineHeight = function() {
    return this.standardFontSize() + 8;
};

Window_VictoryExp.prototype.itemHeight = function() {
    var clientHeight = this.height - this.padding * 2;
    var clientHeight = Math.floor(clientHeight / this.maxItems());
    var clientHeight = Math.max(clientHeight, this.lineHeight() * 2);
    return clientHeight;
};

Window_VictoryExp.prototype.textWidthEx = function(text) {
    return this.drawTextEx(text, 0, this.contents.height);
};

Window_VictoryExp.prototype.defineTickSound = function() {
    this._tickSound = {
      name:   Yanfly.Param.VATickName,
      volume: Yanfly.Param.VATickVol,
      pitch:  Yanfly.Param.VATickPitch,
      pan:    Yanfly.Param.VATickPan
    };
};

Window_VictoryExp.prototype.update = function() {
    Window_Selectable.prototype.update.call(this);
    if (this.openness >= 255) this.updateTicks();
};

Window_VictoryExp.prototype.updateTicks = function() {
    if (this._tick >= Yanfly.Param.VAGaugeTicks) return;
    if (Graphics.frameCount % 4 !== 0) return;
    if (Input.isPressed('ok') || TouchInput.isPressed()) {
      this._tick = Yanfly.Param.VAGaugeTicks;
    } else {
      this._tick += 1;
    }
    this.drawAllGauges();
};

Window_VictoryExp.prototype.drawAllGauges = function() {
    var topIndex = this.topIndex();
    for (var i = 0; i < this.maxPageItems(); i++) {
      var index = topIndex + i;
      if (index < this.maxItems()) this.drawItemGauge(index);
    }
};

Window_VictoryExp.prototype.drawItem = function(index) {
    var actor = $gameParty.battleMembers()[index];
    if (!actor) return;
    this.drawActorProfile(actor, index);
};

Window_VictoryExp.prototype.drawActorProfile = function(actor, index) {
    var rect = this.itemRect(index);
    var fw = Window_Base._faceWidth;
    this.drawActorFace(actor, rect.x + 1, rect.y + 1, fw, rect.height - 2);
};

Window_VictoryExp.prototype.drawItemGauge = function(index) {
    var actor = $gameParty.battleMembers()[index];
    if (!actor) return;
    this.drawActorGauge(actor, index);
};

Window_VictoryExp.prototype.gaugeRect = function(index) {
    var rect = this.itemRect(index);
    var fw = Window_Base._faceWidth;
    rect.x += fw + this.standardPadding() * 2;
    rect.width -= fw * 2 + this.standardPadding() * 4;
    return rect;
};

Window_VictoryExp.prototype.clearGaugeRect = function(index) {
    var rect = this.gaugeRect(index);
    this.contents.clearRect(rect.x, rect.y, rect.width, rect.height);
};

Window_VictoryExp.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.drawExpGauge(actor, rect);
    this.drawExpValues(actor, rect);
    this.drawExpGained(actor, rect);
    this.drawGainedSkills(actor, rect);
};

Window_VictoryExp.prototype.drawLevel = function(actor, rect) {
    this.changeTextColor(this.normalColor());
    if (this.actorExpRate(actor) >= 1.0) {
      var text = Yanfly.Util.toGroup(actor._postVictoryLv);
    } else {
      var text = Yanfly.Util.toGroup(actor._preVictoryLv);
    }
    this.drawText(text, rect.x + 2, rect.y, rect.width - 4, 'right');
    var ww = rect.width - 4 - this.textWidth('0' +
      Yanfly.Util.toGroup(actor.maxLevel()));
    this.changeTextColor(this.systemColor());
    this.drawText(TextManager.levelA, rect.x + 2, rect.y, ww, 'right');
};

Window_VictoryExp.prototype.actorExpRate = function(actor) {
    var actorLv = actor._preVictoryLv;
    if (actorLv === actor.maxLevel()) return 1.0;
    var bonusExp = 1.0 * actor._expGained * this._tick /
      Yanfly.Param.VAGaugeTicks;
    var nowExp = actor._preVictoryExp - actor.expForLevel(actorLv) + bonusExp;
    var nextExp = actor.expForLevel(actorLv + 1) - actor.expForLevel(actorLv);
    return (1.0 * nowExp / nextExp).clamp(0.0, 1.0);
};

Window_VictoryExp.prototype.drawExpGauge = function(actor, rect) {
    var rate = this.actorExpRate(actor);
    if (rate >= 1.0) {
      var color1 = this.textColor(Yanfly.Param.ColorLv1);
      var color2 = this.textColor(Yanfly.Param.ColorLv2);
    } else {
      var color1 = this.textColor(Yanfly.Param.ColorExp1);
      var color2 = this.textColor(Yanfly.Param.ColorExp2);
    }
    var wy = rect.y + this.lineHeight();
    this.drawGauge(rect.x, wy, rect.width, rate, color1, color2);
};

Window_VictoryExp.prototype.drawExpValues = function(actor, rect) {
    var wy = rect.y + this.lineHeight();
    var actorLv = actor._preVictoryLv;
    var bonusExp = 1.0 * actor._expGained * this._tick /
      Yanfly.Param.VAGaugeTicks;
    var nowExp = actor._preVictoryExp - actor.expForLevel(actorLv) + bonusExp;
    var nextExp = actor.expForLevel(actorLv + 1) - actor.expForLevel(actorLv);
    if (actorLv === actor.maxLevel()) {
      var text = Yanfly.Param.VAMaxLv;
    } else if (nowExp >= nextExp) {
      var text = Yanfly.Param.VALevelUp;
    } else {
      var text = Yanfly.Util.toGroup(parseInt(nextExp - nowExp));
    }
    this.changeTextColor(this.normalColor());
    this.drawText(text, rect.x + 2, wy, rect.width - 4, 'right');
};

Window_VictoryExp.prototype.drawExpGained = function(actor, rect) {
    var wy = rect.y + this.lineHeight() * 2;
    if (wy >= rect.y + rect.height) return;
    this.changeTextColor(this.systemColor());
    this.drawText(Yanfly.Param.VAGainedExp, rect.x + 2, wy, rect.width - 4,
      'left');
    var bonusExp = 1.0 * actor._expGained * this._tick /
      Yanfly.Param.VAGaugeTicks;
    var expParse = Yanfly.Util.toGroup(parseInt(bonusExp));
    var expText = Yanfly.Param.VAGainedExpfmt.format(expParse);
    this.changeTextColor(this.normalColor());
    this.drawText(expText, rect.x + 2, wy, rect.width - 4, 'right');
};

Window_VictoryExp.prototype.drawGainedSkills = function(actor, rect) {
    if (actor._victorySkills.length <= 0) return;
    if (!this.meetDrawGainedSkillsCondition(actor)) return;
    var wy = rect.y;
    for (var i = 0; i < actor._victorySkills.length; ++i) {
      if (wy + this.lineHeight() > rect.y + rect.height) break;
      var skillId = actor._victorySkills;
      var skill = $dataSkills[skillId];
      if (!skill) continue;
      var text = '\\i[' + skill.iconIndex + ']' + skill.name;
      text = TextManager.obtainSkill.format(text);
      var ww = this.textWidthEx(text);
      var wx = rect.x + (rect.width - ww) / 2;
      this.drawTextEx(text, wx, wy);
      wy += this.lineHeight();
    }
};

Window_VictoryExp.prototype.meetDrawGainedSkillsCondition = function(actor) {
    if (!this._showGainedSkills) return;
    var actorLv = actor._preVictoryLv;
    var bonusExp = 1.0 * actor._expGained * this._tick /
      Yanfly.Param.VAGaugeTicks;
    var nowExp = actor._preVictoryExp - actor.expForLevel(actorLv) + bonusExp;
    var nextExp = actor.expForLevel(actorLv + 1) - actor.expForLevel(actorLv);
    if (actorLv === actor.maxLevel()) {
      return false;
    } else if (nowExp >= nextExp) {
      return true;
    } else {
      return false;
    }
};

Window_VictoryExp.prototype.isReady = function() {
    return this._tick >= Yanfly.Param.VAGaugeTicks;
};

//=============================================================================
// Window_VictoryDrop
//=============================================================================

function Window_VictoryDrop() {
    this.initialize.apply(this, arguments);
}

Window_VictoryDrop.prototype = Object.create(Window_ItemList.prototype);
Window_VictoryDrop.prototype.constructor = Window_VictoryDrop;

Window_VictoryDrop.prototype.initialize = function(titleWindow) {
    var wy = titleWindow.height;
    var ww = Graphics.boxWidth;
    var wh = Graphics.boxHeight - wy;
    Window_ItemList.prototype.initialize.call(this, 0, wy, ww, wh);
    this.openness = 0;
    this.refresh();
};

Window_VictoryDrop.prototype.makeItemList = function() {
    if (BattleManager._rewards.gold > 0) {
      this._data = ['gold', null];
    } else {
      this._data = [];
    }
    this._dropItems = [];
    this._dropWeapons = [];
    this._dropArmors = [];
    this.extractDrops();
};

Window_VictoryDrop.prototype.extractDrops = function() {
    BattleManager._rewards.items.forEach(function(item) {
      if (!item) return;
      if (DataManager.isItem(item)) this._dropItems.push(item.id);
      if (DataManager.isWeapon(item)) this._dropWeapons.push(item.id);
      if (DataManager.isArmor(item)) this._dropArmors.push(item.id);
    }, this);
    this._dropItems.sort(function(a, b){return a-b});
    this._dropWeapons.sort(function(a, b){return a-b});
    this._dropArmors.sort(function(a, b){return a-b});
    this._dropItems.forEach(function(id) {
      var item = $dataItems[id];
      if (item && !this._data.contains(item)) this._data.push(item);
    }, this);
    this._dropWeapons.forEach(function(id) {
      var item = $dataWeapons[id];
      if (item && !this._data.contains(item)) this._data.push(item);
    }, this);
    this._dropArmors.forEach(function(id) {
      var item = $dataArmors[id];
      if (item && !this._data.contains(item)) this._data.push(item);
    }, this);
};

Window_VictoryDrop.prototype.drawItem = function(index) {
    var item = this._data[index];
    if (!item) return;
    this.drawGold(item, index);
    this.drawDrop(item, index);
};

Window_VictoryDrop.prototype.drawGold = function(item, index) {
    if (item !== 'gold') return;
    var rect = this.itemRect(index);
    rect.width -= this.textPadding();
    var value = BattleManager._rewards.gold;
    var currency = TextManager.currencyUnit;
    this.drawCurrencyValue(value, currency, rect.x, rect.y, rect.width);
};

Window_VictoryDrop.prototype.drawDrop = function(item, index) {
    if (!DataManager.isItem(item) && !DataManager.isWeapon(item) &&
    !DataManager.isArmor(item)) return;
    var rect = this.itemRect(index);
    rect.width -= this.textPadding();
    this.drawItemName(item, rect.x, rect.y, rect.width);
    this.drawItemNumber(item, rect.x, rect.y, rect.width);
};

Window_VictoryDrop.prototype.drawItemNumber = function(item, x, y, width) {
    if (!this.needsNumber()) return;
    var numItems = Yanfly.Util.toGroup(this.numItems(item));
    var size = Yanfly.Param.ItemQuantitySize || 28;
    this.contents.fontSize = size;
    this.drawText('\u00d7' + numItems, x, y, width, 'right');
    this.resetFontSettings();
};

Window_VictoryDrop.prototype.numItems = function(item) {
    if (DataManager.isItem(item)) {
      return Yanfly.Util.getCount(item.id, this._dropItems);
    }
    if (DataManager.isWeapon(item)) {
      return Yanfly.Util.getCount(item.id, this._dropWeapons);
    }
    if (DataManager.isArmor(item)) {
      return Yanfly.Util.getCount(item.id, this._dropArmors);
    }
  return 0;
};

//=============================================================================
// Scene_Battle
//=============================================================================

Yanfly.VA.Scene_Battle_update = Scene_Battle.prototype.update;
Scene_Battle.prototype.update = function() {
    Yanfly.VA.Scene_Battle_update.call(this);
    this.updateVictoryAftermath();
};

Scene_Battle.prototype.processNextVictoryStep = function() {
    var step = this._victorySteps.shift();
    if (step) {
      this.processVictoryStep(step.toUpperCase());
    } else {
      this.processVictoryFinish();
    }
};

Scene_Battle.prototype.processVictoryStep = function(step) {
    this._victoryStep = step;
};

Scene_Battle.prototype.processVictoryFinish = function() {
    this._victoryTitleWindow.close();
    BattleManager.processVictoryFinish();
};

Scene_Battle.prototype.isVictoryStep = function(value) {
    return this._victoryStep && this._victoryStep === value;
};

Scene_Battle.prototype.updateVictoryAftermath = function() {
    if (!BattleManager.isVictoryPhase()) return;
    if (!BattleManager.isFinishedVictoryCheer()) return;
    this.activateVictoryStep();
    this.updateVictorySteps();
};

Scene_Battle.prototype.activateVictoryStep = function() {
    if (this._activateVictoryStep) return;
    this._activateVictoryStep = true;
    this.createVictoryTitle();
    this._victorySteps = this.createVictorySteps();
    this.createVictorySteps();
    this.processNextVictoryStep();
};

Scene_Battle.prototype.createVictorySteps = function() {
    var steps = Yanfly.Param.VAOrder.split(' ');
    var array = [];
    for (var i = 0; i < steps.length; ++i) {
      var step = steps;
      if (step.toUpperCase() === 'CUSTOM') {
        array = this.addCustomVictorySteps(array);
      } else {
        array.push(step.toUpperCase());
      }
    }
    return array;
};

Scene_Battle.prototype.addCustomVictorySteps = function(array) {
    return array;
};

Scene_Battle.prototype.updateVictorySteps = function() {
  if (this.isVictoryStep('EXP')) this.updateVictoryExp();
  if (this.isVictoryStep('DROPS')) this.updateVictoryDrops();
};

Scene_Battle.prototype.updateVictoryExp = function() {
    if (!this._victoryExpWindow) {
      this.createVictoryExp();
    } else if (this._victoryExpWindow.isReady()) {
      if (this.victoryTriggerContinue()) this.finishVictoryExp();
    }
};

Scene_Battle.prototype.createVictoryTitle = function() {
    this._statusWindow.hide();
    this._logWindow.hide();
    this._victoryTitleWindow = new Window_VictoryTitle();
    this.addWindow(this._victoryTitleWindow);
    this._victoryTitleWindow.open();
};

Scene_Battle.prototype.createVictoryExp = function() {
    this._victoryTitleWindow.refresh(Yanfly.Param.VABattleResults);
    this._victoryExpWindow = new Window_VictoryExp();
    this.addWindow(this._victoryExpWindow);
    this._victoryExpWindow.open();
};

Scene_Battle.prototype.finishVictoryExp = function() {
  SoundManager.playOk();
  this._victoryExpWindow.close();
  this.processNextVictoryStep();
};

Scene_Battle.prototype.updateVictoryDrops = function() {
    if (!this._victoryDropWindow) {
      this.createVictoryDrop();
    } else if (this._victoryDropWindow.isOpen()) {
      if (this.victoryTriggerContinue()) this.finishVictoryDrop();
    }
};

Scene_Battle.prototype.createVictoryDrop = function() {
  this._victoryTitleWindow.refresh(Yanfly.Param.VABattleDrops);
  this._victoryDropWindow = new Window_VictoryDrop(this._victoryTitleWindow);
  this.addWindow(this._victoryDropWindow);
  this._victoryDropWindow.open();
  this._victoryDropWindow.activate();
  this._victoryDropWindow.select(0);
};

Scene_Battle.prototype.finishVictoryDrop = function() {
    SoundManager.playOk();
    this._victoryDropWindow.close();
    this.processNextVictoryStep();
};

Scene_Battle.prototype.victoryTriggerContinue = function() {
    if (Input.isRepeated('ok') || TouchInput.isRepeated()) return true;
    if (Input.isRepeated('cancel')) return true;
    return false;
};

//=============================================================================
// Utilities
//=============================================================================

Yanfly.Util = Yanfly.Util || {};

if (!Yanfly.Util.toGroup) {
    Yanfly.Util.toGroup = function(inVal) {
        return inVal;
    }
};

Yanfly.Util.getCount = function(value, arr){
    var occur = 0;
    for(var i = 0; i < arr.length; i++){
        if (arr === value) occur++;
    }
    return occur;
};

//=============================================================================
// End of File
//=============================================================================
[close]