【解決済み】Moghunter様の「MOG_BattleResult」プラグインについて

アバター
ツクラ―
記事: 68
登録日時: 2019年5月15日(水) 19:03

【解決済み】Moghunter様の「MOG_BattleResult」プラグインについて

投稿記事by ツクラ― » 2019年11月02日(土) 13:18

Moghunter様の「MOG_BattleResult」プラグインについて
<機能>を追加していただけないかお願いしたく投稿させていただきました。

バトル終了後、プレイヤーがレベルアップした際に、
表示されるステータス画面(Result_D)のタイミングでSE(ボイス)を一つ挿入したいのですが可能でしょうか?
またそのSE(ボイス)はトリアコンタン様「SimpleVoice」プラグインに紐づけていただければ幸いです。

SimpleVoiceプラグイン: https://raw.githubusercontent.com/triacontane/RPGMakerMV/master/SimpleVoice.js


ご協力して頂ける方、ご回答お待ちしております。

        HP : https://atelierrgss.wordpress.com/rmv-battle-result/

「MOG_BattleResult」プラグインのページが見当たらなかったので以下に直接コピペさせていただきます。
かなり長文となりますがご了承ください…。


//=============================================================================
// MOG_BattleResult.js
//=============================================================================

/*:
* @plugindesc (v1.3) Modifica a tela de vítoria.
* @author Moghunter
*
* @param Exp X-Axis
* @desc Posição X-Axis da EXP.
* @default 760
*
* @param Exp Y-Axis
* @desc Posição Y-Axis da EXP.
* @default 160
*
* @param Gold X-Axis
* @desc Posição X-Axis do Gold.
* @default 760
*
* @param Gold Y-Axis
* @desc Posição Y-Axis do Gold.
* @default 230
*
* @param Treasure X-Axis
* @desc Posição X-Axis do tersouro.
* @default 32
*
* @param Treasure Y-Axis
* @desc Posição Y-Axis do tesouro.
* @default 330
*
* @param Actor X-Axis
* @desc Posição X-Axis do personagem.
* @default 250
*
* @param Actor Y-Axis
* @desc Posição Y-Axis do personagem.
* @default 0
*
* @param Parameter Real X-Axis
* @desc Posição X-Axis dos parâmetros.
* @default 0
*
* @param Parameter Real Y-Axis
* @desc Posição Y-Axis dos parâmetros.
* @default 0
*
* @param Parameter 1 X-Axis
* @desc Posição X-Axis dos parâmetros antes do level-up.
* @default 550
*
* @param Parameter 1 Y-Axis
* @desc Posição Y-Axis dos parâmetros antes do level-up.
* @default 140
*
* @param Parameter 2 X-Axis
* @desc Posição X-Axis dos parâmetros depois do level-up.
* @default 700
*
* @param Parameter 2 Y-Axis
* @desc Posição Y-Axis dos parâmetros depois do level-up.
* @default 140
*
* @param New Skill X-Axis
* @desc Posição X-Axis da nova habilidade.
* @default 570
*
* @param New Skill Y-Axis
* @desc Posição Y-Axis da nova habilidade.
* @default 520
*
* @param Name X-Axis
* @desc Posição X-Axis do nome do personagem.
* @default 155
*
* @param Name Y-Axis
* @desc Posição Y-Axis do nome do personagem.
* @default 540
*
* @help
* =============================================================================
* +++ MOG - Battle Result (v1.3) +++
* By Moghunter
* https://atelierrgss.wordpress.com/
* =============================================================================
* Modifica a tela de vítoria.
* =============================================================================
* Serão necessários os arquivos. (img/system/)
*
* Result_A.png
* Result_B.png
* Result_C.png
* Result_D.png
* Result_E.png
*
* =============================================================================
* ACTOR PICTURE
* =============================================================================
* As imagens deverão ser gravadas na pasta /img/picture/
* Nomeie as imagens da seguinte forma.
*
* Actor_ ID
*
* Exemplo
*
* Actor_1.png
* Actor_2.png
* Actor_3.png
* ...
*
* =============================================================================
* HISTÓRICO
* =============================================================================
* (v1.3) - Correção na apresentação de itens quando o valor é maior que 24.
* (v1.2) - Correção do plugin parameter não funcionar.
* (v1.1) - Correção de não apresentar a janela de status na batalha seguinte.
*/

//=============================================================================
// ** PLUGIN PARAMETERS
//=============================================================================

  var Imported = Imported || {};
  Imported.MOG_BattleResult = true;
  var Moghunter = Moghunter || {};
Moghunter.parameters = PluginManager.parameters('MOG_BattleResult');
Moghunter.bresult_exp_x = Number(Moghunter.parameters['Exp X-Axis'] || 760);
Moghunter.bresult_exp_y = Number(Moghunter.parameters['Exp Y-Axis'] || 160);
Moghunter.bresult_gold_x = Number(Moghunter.parameters['Gold X-Axis'] || 760);
Moghunter.bresult_gold_y = Number(Moghunter.parameters['Gold Y-Axis'] || 230);
Moghunter.bresult_treasure_x = Number(Moghunter.parameters['Treasure X-Axis'] || 32);
Moghunter.bresult_treasure_y = Number(Moghunter.parameters['Treasure Y-Axis'] || 330);
Moghunter.bresult_actor_x = Number(Moghunter.parameters['Actor X-Axis'] || 250);
Moghunter.bresult_actor_y = Number(Moghunter.parameters['Actor Y-Axis'] || 0);
Moghunter.bresult_par0_x = Number(Moghunter.parameters['Parameter Real X-Axis'] || 0);
Moghunter.bresult_par0_y = Number(Moghunter.parameters['Parameter Real Y-Axis'] || 0);
Moghunter.bresult_par1_x = Number(Moghunter.parameters['Parameter 1 X-Axis'] || 550);
Moghunter.bresult_par1_y = Number(Moghunter.parameters['Parameter 1 Y-Axis'] || 140);
Moghunter.bresult_par2_x = Number(Moghunter.parameters['Parameter 2 X-Axis'] || 700);
Moghunter.bresult_par2_y = Number(Moghunter.parameters['Parameter 2 Y-Axis'] || 140);
Moghunter.bresult_skill_x = Number(Moghunter.parameters['New Skill X-Axis'] || 570);
Moghunter.bresult_skill_y = Number(Moghunter.parameters['New Skill Y-Axis'] || 520);
Moghunter.bresult_name_x = Number(Moghunter.parameters['Name X-Axis'] || 155);
Moghunter.bresult_name_y = Number(Moghunter.parameters['Name Y-Axis'] || 540);


//=============================================================================
// ** Game Temp
//=============================================================================

//==============================
// ** Initialize
//==============================
var _mog_bresult_gtemp_initialize = Game_Temp.prototype.initialize;
Game_Temp.prototype.initialize = function() {
_mog_bresult_gtemp_initialize.call(this);
this.battleResultClear()
};

//==============================
// ** battle Result Clear
//==============================
Game_Temp.prototype.battleResultClear = function() {
this._bResult = [false,[],0,0,[]];
this._battleEnd = false;
};

//=============================================================================
// ** Game Actor
//=============================================================================

//==============================
// ** display LevelUP
//==============================
var _mog_bresult_gact_displayLevelUp = Game_Actor.prototype.displayLevelUp;
Game_Actor.prototype.displayLevelUp = function(newSkills) {
if ($gameTemp._bResult[0]) {
$gameTemp._bResult[4] = newSkills;
return;
};
_mog_bresult_gact_displayLevelUp.call(this,newSkills);
};


//=============================================================================
// ** BattleManager
//=============================================================================

//==============================
// ** setup
//==============================
var _mog_brt_bmngr_setup = BattleManager.setup;
BattleManager.setup = function(troopId, canEscape, canLose) {
_mog_brt_bmngr_setup.call(this,troopId, canEscape, canLose);
$gameTemp.battleResultClear();
};

//==============================
// ** process Victory
//==============================
BattleManager.processVictory = function() {
if (Imported.MOG_BattleCry) {
var actor = this.randomActor();
if (actor) {SoundManager.selectVoice(actor._v_victory)};
};
AudioManager.fadeOutBgm(1);
$gameTemp._battleEnd = true;
$gameTemp._battleResult = true;
this.getResultData();
$gameParty.removeBattleStates();
$gameParty.performVictory();
this.endBattle(0);
};


//==============================
// ** get Result Data
//==============================
BattleManager.getResultData = function() {
this.makeRewards();
$gameTemp._bResult[0] = true;
$gameTemp._bResult[1] = this._rewards.exp;
$gameTemp._bResult[2] = this._rewards.gold;
$gameTemp._bResult[3] = this._rewards.items;
$gameTemp._bResult[4] = [];
};

//==============================
// ** Update
//==============================
var _mog_bresult_update = BattleManager.update;
BattleManager.update = function() {
if ($gameTemp._bResult[0]) {return};
_mog_bresult_update.call(this);
};

//=============================================================================
// ** Scene Battle
//=============================================================================

//==============================
// ** Terminate
//==============================
var _mog_bresult_terminate = Scene_Battle.prototype.terminate;
Scene_Battle.prototype.terminate = function() {
_mog_bresult_terminate.call(this);
$gameTemp._bResult = [false,[],0,0,[]];
};

//==============================
// ** Update
//==============================
var _mog_bresult_sbat_update = Scene_Battle.prototype.update;
Scene_Battle.prototype.update = function() {
_mog_bresult_sbat_update.call(this);
if ($gameTemp._bResult[0]) {this.updateBResult()};
};

//==============================
// ** updateWindow Position
//==============================
var _mog_bresult_updateWindowPositions = Scene_Battle.prototype.updateWindowPositions;
Scene_Battle.prototype.updateWindowPositions = function() {
_mog_bresult_updateWindowPositions.call(this);
if ($gameTemp._battleEnd) {
this._statusWindow.opacity -= 10;
this._statusWindow.contentsOpacity -= 10;
};
};

//==============================
// ** Update BResult
//==============================
Scene_Battle.prototype.updateBResult = function() {
if (!this._bresult) {this.createBResult()};
};

//==============================
// ** createBresult
//==============================
Scene_Battle.prototype.createBResult = function() {
this._bresult = new BattleResult();
this.addChild(this._bresult);
};

//=============================================================================
// * Battle Result
//=============================================================================
function BattleResult() {
this.initialize.apply(this, arguments);
};

BattleResult.prototype = Object.create(Sprite.prototype);
BattleResult.prototype.constructor = BattleResult;

//==============================
// * Initialize
//==============================
BattleResult.prototype.initialize = function() {
Sprite.prototype.initialize.call(this);
if (BattleManager._spriteset && BattleManager._spriteset.combo_sprite_data) {
BattleManager._spriteset.combo_sprite_data[0] = 1;
};
this._phase = 0;
this._actorIndex = 0;
this._skillIndex = 0;
this.z = 50;
this._actor = null;
this._actopar = [];
this._playME = 10;
this.phaseAniClear();
this._phaseAnime[0] = 1;
this._phaseAnime[1] = 60;
this._numbeData = [-1,-1];
this.loadImages();
this.createObjects();
};

//==============================
// * Phase Ani Clear
//==============================
BattleResult.prototype.phaseAniClear = function() {
this._phaseAnime = [0,0,0];
};


//==============================
// * loadImages
//==============================
BattleResult.prototype.loadImages = function() {
this._icon_img = ImageManager.loadSystem("IconSet");
this._layout_img = ImageManager.loadSystem("Result_A");
this._number_img1 = ImageManager.loadSystem("Result_B");
this._number_img2 = ImageManager.loadSystem("Result_C");
this._layout2_img = ImageManager.loadSystem("Result_D");
this._vict_img = ImageManager.loadSystem("Result_E");
};

//==============================
// * Press Any Key
//==============================
BattleResult.prototype.pressAnyKey = function() {
if (TouchInput.isTriggered()) {return true};
if (TouchInput.isCancelled()) {return true};
if (Input.isTriggered("ok")) {return true};
if (Input.isTriggered("cancel")) {return true};
return false;
};

//==============================
// * Create Objects
//==============================
BattleResult.prototype.createObjects = function() {
this.createVict();
this.createLayout();
this.createExp();
this.createGold();
this.createTreasures();
};

//==============================
// * Create Vict
//==============================
BattleResult.prototype.createVict = function() {
this._vict = new Sprite(this._vict_img);
this._vict.opacity = 0;
this._vict.scale.x = 3.0;
this._vict.scale.y = 3.0;
this._vict.anchor.x = 0.5;
this._vict.anchor.y = 0.5;
this._vict.x = Graphics.boxWidth / 2;
this._vict.y = Graphics.boxHeight / 2;
this.addChild(this._vict);
};

//==============================
// * Create Layout
//==============================
BattleResult.prototype.createLayout = function() {
this._layout = new Sprite(this._layout_img);
this._layout.opacity = 0;
this._layout.scale.x = 3.0;
this._layout.anchor.x = 0.5;
this._layout.x = Graphics.boxWidth / 2;
this.addChild(this._layout);
};

//==============================
// * Create Exp
//==============================
BattleResult.prototype.createExp = function() {
this._expNumber = [];
this._expOld = 0;
this._expOrg = [Moghunter.bresult_exp_x,Moghunter.bresult_exp_y];
for (var i = 0; i < 8; i++) {
this._expNumber[i] = new Sprite(this._number_img1);
this._expNumber[i].visible = false;
this._expNumber[i].x = this._expOrg[0];
this._expNumber[i].y = this._expOrg[1];
this.addChild(this._expNumber[i]);
};

};

//==============================
// * Create Gold
//==============================
BattleResult.prototype.createGold = function() {
this._goldNumber = [];
this._goldNumber = [];
this._goldOld = 0;
this._goldOrg = [Moghunter.bresult_gold_x,Moghunter.bresult_gold_y];
for (var i = 0; i < 8; i++) {
this._goldNumber[i] = new Sprite(this._number_img1);
this._goldNumber[i].visible = false;
this._goldNumber[i].x = this._goldOrg[0];
this._goldNumber[i].y = this._goldOrg[1];
this.addChild(this._goldNumber[i]);
};
};

//==============================
// * Add ICon
//==============================
BattleResult.prototype.addIcon = function(sprite,data) {
var icon = new Sprite(this._icon_img);
var w = Window_Base._iconWidth;
var h = Window_Base._iconHeight;
var sx = data.iconIndex % 16 * w;
var sy = Math.floor(data.iconIndex / 16) * h;
icon.setFrame(sx,sy,w,h);
sprite.addChild(icon);
var name = new Sprite(new Bitmap(160,32));
name.bitmap.drawText(data.name,0,0,160,32);
name.x = w + 4;
sprite.addChild(name);
};

//==============================
// * Create Treasures
//==============================
BattleResult.prototype.createTreasures = function() {
this._treasures = [];
var x = Moghunter.bresult_treasure_x;
var y = Moghunter.bresult_treasure_y;
var s = Graphics.boxWidth - 64;
var w = (s / 3);
var h = Window_Base._iconHeight + 4;
for (var i = 0; i < $gameTemp._bResult[3].length; i++) {
if (i > 23) {
break
}
this._treasures[i] = new Sprite();
this._treasures[i].opacity = 0;
this.addChild(this._treasures[i]);
var l = Math.floor(i / 3);
this._treasures[i].x = x + (w * i) - Math.floor(l * s);
this._treasures[i].y = y + (l * h);
this.addIcon(this._treasures[i],$gameTemp._bResult[3][i]);
};
};

//==============================
// * getData
//==============================
BattleResult.prototype.getData = function() {
this._numbeData[0] = this._number_img1.width / 10;
this._numbeData[1] = this._number_img1.height;
};

//==============================
// * Update Dif
//==============================
BattleResult.prototype.update_dif = function(value,real_value,speed) {
if (value == real_value) {return value};
var dnspeed = 1 + (Math.abs(value - real_value) / speed);
if (value > real_value) {value -= dnspeed;
if (value < real_value) {value = real_value};}
else if (value < real_value) {value += dnspeed;
if (value > real_value) {value = real_value};
};
return Math.floor(value);
};

//==============================
// * Refresh Number
//==============================
BattleResult.prototype.refresh_number = function(sprites,value,img_data,x,center) {
numbers = Math.abs(value).toString().split("");
for (var i = 0; i < sprites.length ; i++) {sprites[i].visible = false;
if (i > numbers.length) {return};
var n = Number(numbers[i]);
sprites[i].setFrame(n * img_data[0], 0, img_data[0], img_data[1]);
sprites[i].visible = true;
if (center === 0) {
var nx = -(img_data[0] * i) + (img_data[0] * numbers.length);
} else {
var nx = -(img_data[0] * i) + ((img_data[0] / 2) * numbers.length);
};
sprites[i].x = x - nx;
};
};

//==============================
// * Update
//==============================
BattleResult.prototype.update = function() {
Sprite.prototype.update.call(this);
if (this._numbeData[0] === -1 && this._number_img1.isReady() && this._number_img2.isReady()) {this.getData()};
if (this._numbeData[0] === -1) {return};
if (this._phaseAnime[1] > 0) {this._phaseAnime[1] --;return};
if (this._playME > 0) {this.updateME()};
switch (this._phase) {
case 0:
this.updateStart();
break;
case 1:
this.updateExp();
break;
case 2:
this.updateGold();
break;
case 3:
this.updateTreasure();
break;
case 4:
this.updateLevel();
break;
case 5:
this.updateEnd();
break;
};
};


//==============================
// * update ME
//==============================
BattleResult.prototype.updateME = function() {
this._playME --
if (this._playME === 0) {
BattleManager.playVictoryMe();
BattleManager.replayBgmAndBgs();
};
};

//==============================
// * Update Start
//==============================
BattleResult.prototype.updateStart = function() {
if (this._phaseAnime[0] > 0) {
this.updateVictAnimation();
} else {
this.updateLayoutAnimation();
};
};


//==============================
// * Update Layout Animation
//==============================
BattleResult.prototype.updateLayoutAnimation = function() {
this._layout.opacity += 5;
if (this._layout.scale.x > 1.00) {
this._layout.scale.x -= 0.05;
if (this._layout.scale.x < 1.00) {this._layout.scale.x = 1.00};
} else {
this.phaseAniClear();
this._phase = 1;
};
};

//==============================
// * Update Vict Animation
//==============================
BattleResult.prototype.updateVictAnimation = function() {
if (this._phaseAnime[0] === 1) {
if (this._vict.scale.x > 1.00) {
this._vict.scale.x -= 0.05;
this._vict.opacity += 15;
if (this._vict.scale.x <= 1.00) {
this._vict.scale.x = 1.00;
this._vict.opacity = 255;
this._phaseAnime[0] = 2;
this._phaseAnime[1] = 40;
};
};
} else {
if (this._vict.scale.x < 3.00) {
this._vict.scale.x += 0.05;
this._vict.opacity -= 10;
if (this._vict.scale.x >= 3.00) {
this._vict.scale.x = 3.00;
this._vict.opacity = 0;
this._phaseAnime[0] = 0;
};
};
};
this._vict.scale.y = this._vict.scale.x;
};

//==============================
// * Update Exp
//==============================
BattleResult.prototype.updateExp = function() {
if (this.pressAnyKey() && $gameTemp._bResult[1] > 0) {
this._expOld = $gameTemp._bResult[1] - 1;
};
var dif_number = this.update_dif(this._expOld,$gameTemp._bResult[1],15);
if (this._expOld != dif_number) {this._expOld = dif_number;
this.refresh_number(this._expNumber,this._expOld,this._numbeData,this._expOrg[0],0)};
if (this._expOld === $gameTemp._bResult[1]) {
this.phaseAniClear();
this._phase = 2;
SoundManager.playCursor();
};
};

//==============================
// * Update Gold
//==============================
BattleResult.prototype.updateGold = function() {
if (this.pressAnyKey() && $gameTemp._bResult[1] > 0) {
this._goldOld = $gameTemp._bResult[2] - 1;
};
var dif_number = this.update_dif(this._goldOld,$gameTemp._bResult[2],15);
if (this._goldOld != dif_number) {this._goldOld = dif_number;
this.refresh_number(this._goldNumber,this._goldOld,this._numbeData,this._goldOrg[0],0)};
if (this._goldOld === $gameTemp._bResult[2]) {
BattleManager.gainGold();
this.phaseAniClear();
this._phase = 3;
SoundManager.playCursor();
};
};

//==============================
// * Update Treasure
//==============================
BattleResult.prototype.updateTreasure = function() {
if (this._treasures.length > 0) {
for (var i = 0; i < this._treasures.length; i++) {
this._treasures[i].opacity += 10;
};
if (this._treasures[0].opacity >= 255 && this._phaseAnime[0] === 0) {
this._phaseAnime[0] = 1;
};
} else {
this._phaseAnime[0] = 1;
};
if (this._phaseAnime[0] === 1 && this.pressAnyKey()) {
BattleManager.gainDropItems();
this.phaseAniClear();
this._phase = 4;
};
};

//==============================
// * Update Level
//==============================
BattleResult.prototype.updateLevel = function() {
if (this._layout.opacity > 0) {this.updateFade()};
if (!this._actor && this._actorIndex >= $gameParty.battleMembers().length) {
this._phase = 5;
SoundManager.playCursor();
} else {
if (this._actor) {
this.updateLevelAnimation();
} else {
this.gainEXP();
};
};
};

//==============================
// * Create Level Sprites
//==============================
BattleResult.prototype.createLevelSprites = function() {
this.disposeLevel();
this._phaseAnime[0] = 0;
this._phaseAnime[1] = 10;
this.createActorSprite();
this.createLevelLayout();
this.createParameters();
this.createActorName();
this.playVoice();
};

//==============================
// * Play Voice
//==============================
BattleResult.prototype.playVoice = function() {
if (Imported.MOG_BattleCry) {SoundManager.selectVoice(this._actor._v_levelup)};
};

//==============================
// * Create Level Layout
//==============================
BattleResult.prototype.createLevelLayout = function() {
this._levelLayout = new Sprite(this._layout2_img);
this._levelLayout.opacity = 0;
this._levelLayout.anchor.x = 0.5;
this._levelLayout.anchor.y = 0.5;
this._levelLayout.x = Graphics.boxWidth / 2;
this._levelLayout.y = Graphics.boxHeight / 2;
this._levelLayout.scale.x = 3.0;
this.addChild(this._levelLayout);
};

//==============================
// * Create Actor Name
//==============================
BattleResult.prototype.createActorName = function() {
this._name = new Sprite(new Bitmap(140,32));
this._name.opacity = 0;
this._name.bitmap.drawText(this._actor._name,0,0,140,32);
this._name.x = Moghunter.bresult_name_x;
this._name.y = Moghunter.bresult_name_y;
this.addChild(this._name);
};

//==============================
// * Create Actor Sprite
//==============================
BattleResult.prototype.createActorSprite = function() {
var img = ImageManager.loadPicture("Actor_" + this._actor._actorId)
this._spriteActor = new Sprite(img);
this._spriteActor.opacity = 0;
this._spriteActor.anchor.x = 0.5;
this.addChild(this._spriteActor);
};

//==============================
// * Create Parameters
//==============================
BattleResult.prototype.createParameters = function() {
var x = Moghunter.bresult_par1_x;
var y = Moghunter.bresult_par1_y;
this._par = new Sprite(new Bitmap(Graphics.boxWidth,Graphics.boxHeight));
this._par.opacity = 0;
this._par.bitmap.drawText(this._actopar[0],x,y,100,32);
this._par.bitmap.drawText(this._actopar[1],x,y + 32 * 1,100,32);
this._par.bitmap.drawText(this._actopar[2],x,y + 32 * 2,100,32);
this._par.bitmap.drawText(this._actopar[3],x,y + 32 * 3,100,32);
this._par.bitmap.drawText(this._actopar[4],x,y + 32 * 4,100,32);
this._par.bitmap.drawText(this._actopar[5],x,y + 32 * 5,100,32);
this._par.bitmap.drawText(this._actopar[6],x,y + 32 * 6,100,32);
this._par.bitmap.drawText(this._actopar[7],x,y + 32 * 7,100,32);
this._par.bitmap.drawText(this._actopar[8],x,y + 32 * 8,100,32);
var x = Moghunter.bresult_par2_x;
var y = Moghunter.bresult_par2_y;
this._par.bitmap.drawText(this._actor._level,x,y,100,32);
this._par.bitmap.drawText(this._actor.mhp,x,y + 32 * 1,100,32);
this._par.bitmap.drawText(this._actor.mmp,x,y + 32 * 2,100,32);
this._par.bitmap.drawText(this._actor.atk,x,y + 32 * 3,100,32);
this._par.bitmap.drawText(this._actor.def,x,y + 32 * 4,100,32);
this._par.bitmap.drawText(this._actor.mat,x,y + 32 * 5,100,32);
this._par.bitmap.drawText(this._actor.mdf,x,y + 32 * 6,100,32);
this._par.bitmap.drawText(this._actor.agi,x,y + 32 * 7,100,32);
this._par.bitmap.drawText(this._actor.luk,x,y + 32 * 8,100,32);
this.addChild(this._par);
};

//==============================
// * Refresh New Skill
//==============================
BattleResult.prototype.refreshNewSkill = function() {
SoundManager.playUseSkill();
this.removeChild(this._skill);
this._skill = new Sprite();
this._skill.x = Moghunter.bresult_skill_x;
this._skill.y = Moghunter.bresult_skill_y;
this._skill.opacity = 0;
this.addChild(this._skill);
this.addIcon(this._skill,$gameTemp._bResult[4][this._skillIndex]);
this._skillIndex += 1;
this._skillAnime = [0,0];
};

//==============================
// * dispose Level
//==============================
BattleResult.prototype.disposeLevel = function() {
this.removeChild(this._spriteActor);
this.removeChild(this._par);
this.removeChild(this._levelLayout);
this.removeChild(this._name);
this.removeChild(this._skill);
this._skill = null;
};

//==============================
// * Update Animation
//==============================
BattleResult.prototype.updateLevelAnimation = function() {
this.updateLevelPosition();
this._spriteActor.opacity += 10;
this._levelLayout.opacity += 10;
this._name.opacity += 10;
this._par.opacity += 10;
if (this._skill) {this.updateSkillAnimation()};
if (this.pressAnyKey()) {
if (this._skillIndex >= $gameTemp._bResult[4].length) {
this.clearParData();
} else {
this.refreshNewSkill();
};
};
};

//==============================
// * Update Level Position
//==============================
BattleResult.prototype.updateLevelPosition = function() {
if (this._phaseAnime[0] === 0) {
this._phaseAnime[0] = 1;
this._spriteActor.x = -this._spriteActor.width + Moghunter.bresult_actor_x;
this._par.x = this._spriteActor.width + Moghunter.bresult_actor_x;
};
this._spriteActor.x = this.sprite_move_to(this._spriteActor.x,Moghunter.bresult_actor_x,20);
this._spriteActor.y = Graphics.boxHeight - this._spriteActor.height + Moghunter.bresult_actor_y;
if (this._levelLayout.scale.x > 1.00) {
this._levelLayout.scale.x -= 0.05;
if (this._levelLayout.scale.x < 1.00) {this._levelLayout.scale.x = 1.00};
};
this._par.x = this.sprite_move_to(this._par.x,Moghunter.bresult_par0_x,20);
this._par.y = Moghunter.bresult_par0_y;
};

//==============================
// * Update Skill Animation
//==============================
BattleResult.prototype.updateSkillAnimation = function() {
this._skill.opacity += 10;
this._skillAnime[0] ++;
if (this._skillAnime[0] < 20) {
this._skill.y -= 2;
} else if (this._skillAnime[0] < 40) {
this._skill.y += 2;
};
};

//==============================
// * Sprite Move To
//==============================
BattleResult.prototype.sprite_move_to = function(value,real_value,speed) {
if (value == real_value) {return value};
var dnspeed = 5 + (Math.abs(value - real_value) / speed);
if (value > real_value) {value -= dnspeed;
if (value < real_value) {value = real_value};}
else if (value < real_value) {value += dnspeed;
if (value > real_value) {value = real_value};
};
return Math.floor(value);
};

//==============================
// * clear Par DAta
//==============================
BattleResult.prototype.clearParData = function() {
this._actor = null;
this.disposeLevel();
this._skillIndex = 0;
$gameTemp._bResult[4] = [];
};

//==============================
// * Gain EXP
//==============================
BattleResult.prototype.gainEXP = function() {
var actor = $gameParty.battleMembers()[this._actorIndex];
this._actopar = [actor._level,actor.mhp,actor.mmp,actor.atk,actor.def,actor.mat,actor.mdf,actor.agi,actor.luk];
var lvOld = actor._level
actor.gainExp($gameTemp._bResult[1]);
this._actorIndex += 1;
if (actor._level > lvOld) {
this._actor = actor;
this.createLevelSprites();
SoundManager.playCursor();
} else {
this.clearParData();
};
};

//==============================
// * Update Fade
//==============================
BattleResult.prototype.updateFade = function() {
this._layout.opacity -= 10;
for (var i = 0; i < this._expNumber.length; i++) {
this._expNumber[i].opacity = this._layout.opacity;
};
for (var i = 0; i < this._goldNumber.length; i++) {
this._goldNumber[i].opacity = this._layout.opacity;
};
for (var i = 0; i < this._treasures.length; i++) {
this._treasures[i].opacity = this._layout.opacity;
};
if (this._phase === 5 && this._layout.opacity <= 0) {
$gameTemp._bResult = [false,[],0,0,[]];;
};
};

//==============================
// * Update End
//==============================
BattleResult.prototype.updateEnd = function() {
if (this._layout.opacity <= 0) {
$gameTemp._bResult = [false,[],0,0,[]];;
} else {
this.updateFade();
};
};




            
最後に編集したユーザー ツクラ― on 2019年11月04日(月) 16:13 [ 編集 1 回目 ]

ecf5DTTzl6h6lJj02
記事: 456
登録日時: 2018年12月23日(日) 13:55

Re: Moghunter様の「MOG_BattleResult」プラグインについて

投稿記事by ecf5DTTzl6h6lJj02 » 2019年11月03日(日) 20:34

690行目から始まっている、 Play Voice の部分で、
"MOG_BattleCry" プラグインが有効の際に、音声を鳴らすようになっているのですが、
これを改変して、レベルアップの際に、トリアコンタン様のSimpleVoiceを使って、
音声を再生するよう拡張するプラグインを試作してみました。
詳しくは、プラグインヘルプをご覧ください。
添付ファイル
MOG_BattleResult_LvUpVoiceEx.js
(3.71 KiB) ダウンロード数: 13 回
アバター
ツクラ―
記事: 68
登録日時: 2019年5月15日(水) 19:03

Re: Moghunter様の「MOG_BattleResult」プラグインについて

投稿記事by ツクラ― » 2019年11月03日(日) 23:57

ecf5DTTzl6h6lJj02様
プラグインを制作していただき誠にありがとうございます!

早速導入させていただきましたところエラーが出てしまいましたので数点質問させていただきます。

・今回「MOG_BattleCry」プラグインは入れていないのですが問題ないでしょうか?

・プラグイン一覧で上から順に「SimpleVoice」→「MOG_BattleResult」→「MOG_BattleResult_LvUpVoiceEx」でも大丈夫でしょうか?

・「MOG_BattleResult_LvUpVoiceEx」のパラメータ「Defaultvoice」は空欄でよろしいでしょうか?
 voiceフォルダ内に音声が入っているので「voice」なのでしょうか?

エラー画面も添付させていただきます。
(伏せ字は以前教えていただきまして個人情報のようですので黒色にさせていただきました)
添付ファイル
Error pic.png
ecf5DTTzl6h6lJj02
記事: 456
登録日時: 2018年12月23日(日) 13:55

Re: Moghunter様の「MOG_BattleResult」プラグインについて

投稿記事by ecf5DTTzl6h6lJj02 » 2019年11月04日(月) 04:36

こんばんは。
・今回「MOG_BattleCry」プラグインは入れていないのですが問題ないでしょうか?

はい。「MOG_BattleCry」は必要ありません。

・プラグイン一覧で上から順に「SimpleVoice」→「MOG_BattleResult」→「MOG_BattleResult_LvUpVoiceEx」でも大丈夫でしょうか?

はい。「SimpleVoice」より下に「MOG_BattleResult」、この下(できれば真下)に「Mog_BattleResult_LvUpVoiceEx」があれば問題ないはずです。

・「MOG_BattleResult_LvUpVoiceEx」のパラメータ「Defaultvoice」は空欄でよろしいでしょうか?
voiceフォルダ内に音声が入っているので「voice」なのでしょうか?

アクター個別で設定していない場合に、鳴らすファイルを指定する項目なので、必要ない(設定されていなければ鳴らさない)場合は、空欄のままにしてください。
設定する場合は、ファイル名を記入してください。
ファイルは、「SimpleVoice」プラグインで設定したフォルダから検索するので、フォルダ名をつける必要はありません。また、拡張子も必要ありません。
SimpleVoiceで再生ファイルを指定するのと同じ要領で、記入してください。
プラグインヘルプにも記載していますが、
AAA,BBB,CCC,DDD のように、カンマ区切りでファイル名を列挙すると、この中からランダムで選んで再生するようになっています。(アクター個別に設定する際も同じ仕様です)

アクター個別に設定する際、そのアクターは音声を再生しないという場合は、
<レベルアップ音声:> もしくは、 <LevelUpVoice:> と入力してください。
(DefaultVoiceでファイルを指定している場合の設定です)



すみませんが、添付画像のエラー内容が、こちらでは再現できず、原因を特定できませんでした。
コンソールにログをはくようにしましたので、下記ファイルに差し替え、上記に基づいて
設定をしなおして頂き、エラーが出た場合は、エラー画面(スタックトレース)を添付してください。
(それで、原因を特定できるかは保証できないのですが…)
よろしくお願いします。
添付ファイル
MOG_BattleResult_LvUpVoiceEx.js
(4.75 KiB) ダウンロード数: 3 回
アバター
ツクラ―
記事: 68
登録日時: 2019年5月15日(水) 19:03

Re: Moghunter様の「MOG_BattleResult」プラグインについて

投稿記事by ツクラ― » 2019年11月04日(月) 11:28

質問へのご回答、プラグインを添付していただき誠にありがとうございました。

ご回答していただいた内容に沿って設定したのですが、
レベルアップ画面に映ると「TypeError」が出てしまいました…。

こちらの誤設定か他との競合の可能性があるのでは…と思うのですが、
こちらの設定画面を添付させていただきました。

アクター数は「5名」としておりまして、実際戦闘をする人数がプレイヤー1番目とプレイヤー2番目で、
3番目~5番目は非戦闘員にしており、メモ欄は「空欄」にしております。

お手数おかけして申し訳ありません。
ご確認よろしくお願い致します。
添付ファイル
Error pic 2.png
Set pic.png
ecf5DTTzl6h6lJj02
記事: 456
登録日時: 2018年12月23日(日) 13:55

Re: Moghunter様の「MOG_BattleResult」プラグインについて

投稿記事by ecf5DTTzl6h6lJj02 » 2019年11月04日(月) 14:11

こんにちは、
プラグイン「SimpleVoice」が存在していなければ、再生を中止する
という、処理をしていたのですが、その判定の部分がエラーを起こすようです。
判定の方法などを変更したので、下記のファイルに差し替えて、確認してください。
添付ファイル
MOG_BattleResult_LvUpVoiceEx.js
(5.21 KiB) ダウンロード数: 4 回
アバター
ツクラ―
記事: 68
登録日時: 2019年5月15日(水) 19:03

Re: Moghunter様の「MOG_BattleResult」プラグインについて

投稿記事by ツクラ― » 2019年11月04日(月) 16:10

ecf5DTTzl6h6lJj02様

この度はプラグインの改良をしていただきありがとうございました!

更新プラグインを導入しましたところ、
「SimpleVoice」オプションで音量を調節できるボイスが流れるようになりました!

3度にわたりプラグイン調整をしていただきお手数おかけしました…。
おかげさまで希望の仕様にすることができました、誠にありがとうございます!
ecf5DTTzl6h6lJj02
記事: 456
登録日時: 2018年12月23日(日) 13:55

Re: 【解決済み】Moghunter様の「MOG_BattleResult」プラグインについて

投稿記事by ecf5DTTzl6h6lJj02 » 2019年11月04日(月) 16:47

きちんと動作したようで何よりです。

コンソールにログを出力する部分があると、何かと邪魔だ(エディタで設定した内容等が表示されてしまう)と思いますので、削除したこちらをお使いください。
添付ファイル
MOG_BattleResult_LvUpVoiceEx.js
(4.73 KiB) ダウンロード数: 12 回
アバター
ツクラ―
記事: 68
登録日時: 2019年5月15日(水) 19:03

Re: 【解決済み】Moghunter様の「MOG_BattleResult」プラグインについて

投稿記事by ツクラ― » 2019年11月04日(月) 23:44

ecf5DTTzl6h6lJj02様

プラグインの更新ありがとうございます。
上書きさせていただきました。

利便性まで考えていただき、
お心遣い誠にありがとうございました!

“MV:質問” へ戻る