下面的代码位于rpg_objects.js第10000行,它们是【事件指令】中那些音频控制的实现。
只要在任何一个函数开头用if()语句判定变量、开关等条件就能做到【满足/不满足某些条件时该指令才执行】。
注意这里只给出了事件指令,而“切换地图、战斗、乘降载具、菜单操作声效”等不受控制,如有需要请进一步修改AudioManager下的四个playXxx函数。
// Play BGM Game_Interpreter.prototype.command241 = function() { AudioManager.playBgm(this._params[0]); return true; }; // Fadeout BGM Game_Interpreter.prototype.command242 = function() { AudioManager.fadeOutBgm(this._params[0]); return true; }; // Save BGM Game_Interpreter.prototype.command243 = function() { $gameSystem.saveBgm(); return true; }; // Resume BGM Game_Interpreter.prototype.command244 = function() { $gameSystem.replayBgm(); return true; }; // Play BGS Game_Interpreter.prototype.command245 = function() { AudioManager.playBgs(this._params[0]); return true; }; // Fadeout BGS Game_Interpreter.prototype.command246 = function() { AudioManager.fadeOutBgs(this._params[0]); return true; }; // Play ME Game_Interpreter.prototype.command249 = function() { AudioManager.playMe(this._params[0]); return true; }; // Play SE Game_Interpreter.prototype.command250 = function() { AudioManager.playSe(this._params[0]); return true; }; // Stop SE Game_Interpreter.prototype.command251 = function() { AudioManager.stopSe(); return true; };
// Play BGM
Game_Interpreter.prototype.command241 = function() {
AudioManager.playBgm(this._params[0]);
return true;
};
// Fadeout BGM
Game_Interpreter.prototype.command242 = function() {
AudioManager.fadeOutBgm(this._params[0]);
return true;
};
// Save BGM
Game_Interpreter.prototype.command243 = function() {
$gameSystem.saveBgm();
return true;
};
// Resume BGM
Game_Interpreter.prototype.command244 = function() {
$gameSystem.replayBgm();
return true;
};
// Play BGS
Game_Interpreter.prototype.command245 = function() {
AudioManager.playBgs(this._params[0]);
return true;
};
// Fadeout BGS
Game_Interpreter.prototype.command246 = function() {
AudioManager.fadeOutBgs(this._params[0]);
return true;
};
// Play ME
Game_Interpreter.prototype.command249 = function() {
AudioManager.playMe(this._params[0]);
return true;
};
// Play SE
Game_Interpreter.prototype.command250 = function() {
AudioManager.playSe(this._params[0]);
return true;
};
// Stop SE
Game_Interpreter.prototype.command251 = function() {
AudioManager.stopSe();
return true;
};
|