Advertisement
nio_kasgami

BETA_01

Dec 17th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:ja
  2. //==============================================================================
  3. // ■ 絵文字エンジンMV - 通信 "高度なマッサージバスト"
  4. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5.   @plugindesc ビジュアルノベルタイプのメッセージシステムを許可します。
  6.  
  7.  
  8.   id: EEMV::AdvanceMessageSystem JAPANESE
  9.   @author 霞上鳰
  10.   @Dデータ : 2015/10/05
  11.   @バージョン : 1.0.0 {ベータ}
  12.   @必要 : EmojiBase
  13. //==============================================================================
  14. //==============================================================================
  15. // ■ 歴史
  16. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  17. // * 2015/10/29 - Begin and finish the plugin.
  18. //==============================================================================
  19.  
  20. //==============================================================================
  21. // ■ 導入
  22. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  23. // * メッセージシステムのための複数のグラフィック強化を持つことが許可します。
  24. //==============================================================================
  25.  
  26. //==============================================================================
  27. //  ■ プラグインのパラメータ
  28. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. //  このセクションでは、プラグインのパラメータを処理します。あなたは余分なプラグインのコマンドを追加する場合を除き、
  30. //  編集しないでください。
  31. //------------------------------------------------------------------------------
  32.    * @param 許可バスト
  33.    * @desc あなたのメッセージバストバストの使用を有効にして、それをプリロードします。
  34.    * @default true
  35.  
  36.    * @param バストフォルダ
  37.    * @desc バストのためのフォルダを設定します。
  38.    * @default pictures
  39.  
  40.    * @param バスト位置
  41.    * @desc バストの位置を設定します。「X-axis,Y-axis」
  42.    * @default 150,200
  43.  
  44.    * @param バスト優先
  45.    * @desc バストのZ位置を設定します。単語「below」または「above」を使用してください。.
  46.    * @default below
  47.  
  48.    * @param 許可パノラマ
  49.    * @desc バックグラウンドの使用を有効にして、それをプリロードします。
  50.    * @default true
  51.  
  52.    * @param パノラマフォルダ
  53.    * @desc 背景ファイルのフォルダを設定します。
  54.    * @default pictures
  55. //==============================================================================
  56.  
  57. //==============================================================================
  58. // ■ Help File
  59. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  60. // このセクションでは、入力のためにエンジン内のヘルプファイルを提供しています。編集しないでください。
  61. //------------------------------------------------------------------------------
  62.    * @help
  63.    * ==========================================================================
  64.    *  ■ Plugin Command
  65.    * ==========================================================================
  66.    * Emoji.setPanorama filename : パノラマファイル名を設定します。
  67.    * Emoji.erasePanorama : 現在のパノラマを消去します。
  68.    *
  69.    * Emoji.mirror true,false : バストをミラーします。
  70.    * --------------------------------------------------------------------------
  71.    *
  72.    * ==========================================================================
  73.    *  ■ Control Character
  74.    * ==========================================================================
  75.    * 一瞬のために何もありません。
  76.    *---------------------------------------------------------------------------
  77. */
  78.  
  79. //==============================================================================
  80. // ■ Emoji_Engine
  81. //------------------------------------------------------------------------------
  82. // the class who handle all the base of my plugins. Can be access via $emoji.
  83. //==============================================================================
  84.  
  85. // anonymous function
  86. (function(){
  87.  
  88. //----------------------------------------------------------------------------
  89. // ○ alias function: get_pluginname
  90. //----------------------------------------------------------------------------
  91. var NP01 = Emoji_Engine.prototype.get_pluginname;
  92. Emoji_Engine.prototype.get_pluginname = function() {
  93.     NP01.call(this);
  94.     this.message_params = this.set_PluginID('EEMV::AdvanceMessageSystem JAPANESE');
  95. };
  96.  
  97. //----------------------------------------------------------------------------
  98. // ● alias function: get_params
  99. //----------------------------------------------------------------------------
  100. var NPN01 = Emoji_Engine.prototype.get_params;
  101. Emoji_Engine.prototype.get_params = function() {
  102.     NPN01.call(this);
  103. // Get Bust Parameters.
  104.     this.enableBust     = this.setBoolean(this.message_params,'許可バスト');
  105.     this.bustFolder     = this.setString(this.message_params,'バストフォルダ');
  106.     this.bustPos        = this.setArray(this.message_params,'バスト位置');
  107.     this.bustPriority   = this.setString(this.message_params,'バスト優先');
  108. // Get Panorama Parameters.
  109.     this.enablePanorama = this.setBoolean(this.message_params,'許可パノラマ');
  110.     this.panoramaFolder = this.setString(this.message_params,'パノラマフォルダ');
  111. };
  112. //===============================================================================
  113. // => END : Emoji_Engine
  114. //===============================================================================
  115.  
  116. //==============================================================================
  117. // ■ Game_Message
  118. //------------------------------------------------------------------------------
  119. // The game object class for the state of the message window that displays text
  120. // or selections, etc.
  121. //==============================================================================
  122.  
  123. //----------------------------------------------------------------------------
  124. // ● alias function: clear
  125. //----------------------------------------------------------------------------
  126. var nio_message_clear = Game_Message.prototype.clear;
  127. Game_Message.prototype.clear = function() {
  128.     nio_message_clear.call(this);
  129.     this._bustName      = "";
  130.     this._bust_index    = "";
  131.   //  this._panoramaName  = ""; {obsolete}
  132.     this._panorama_hue  = 0;
  133.     this._mirror        = false;
  134.     this._flag = false;
  135. };
  136.  
  137.  
  138. //----------------------------------------------------------------------------
  139. // ○ new function: bustName
  140. //----------------------------------------------------------------------------
  141. Game_Message.prototype.bustName = function() {
  142.     return this._bustName;
  143. };
  144. //----------------------------------------------------------------------------
  145. // ○ new function: bustIndex
  146. //----------------------------------------------------------------------------
  147. Game_Message.prototype.bustIndex = function() {
  148.     return this._bust_index;
  149. };
  150.  
  151. //----------------------------------------------------------------------------
  152. // ○ new function: setBust
  153. //----------------------------------------------------------------------------
  154. Game_Message.prototype.setBust = function(filename,index) {
  155.     this._bustName  = filename;
  156.     this._bust_index = index;
  157. };
  158.  
  159. //----------------------------------------------------------------------------
  160. // ○ new function: panoramaName
  161. //----------------------------------------------------------------------------
  162. Game_Message.prototype.panoramaName = function() {
  163.     return this._panoramaName;
  164. };
  165.  
  166. //----------------------------------------------------------------------------
  167. // ○ new function: setPanorama
  168. //----------------------------------------------------------------------------
  169. Game_Message.prototype.setPanorama = function(p_filename,hue) {
  170.     this._panoramaName = p_filename;
  171.     this._panorama_hue  = hue;
  172. };
  173.  
  174. //----------------------------------------------------------------------------
  175. // ○ new function: ismirror
  176. //----------------------------------------------------------------------------
  177. Game_Message.prototype.isMirror = function() {
  178.     return this._mirror;
  179. };
  180.  
  181. //----------------------------------------------------------------------------
  182. // ○ new function: setMirror
  183. //----------------------------------------------------------------------------
  184. Game_Message.prototype.setMirror = function(flag) {
  185.   this._mirror = flag;
  186. };
  187.  
  188. //----------------------------------------------------------------------------
  189. // ○ new function: erasePanorama {obsolete}
  190. //----------------------------------------------------------------------------
  191. Game_Message.prototype.erasePanorama = function(flag) {
  192.   this._flag = flag;
  193. };
  194.  
  195. //----------------------------------------------------------------------------
  196. // ○ new function: callVoice
  197. //----------------------------------------------------------------------------
  198. Game_Message.prototype.callVoice = function(file,volume,pitch,pan) {
  199.   AudioManager.playSe(file,volume,pitch,pan);
  200. };
  201. //===============================================================================
  202. // => END : Game_Message
  203. //===============================================================================
  204.  
  205. //==============================================================================
  206. // ■ Window_Message
  207. //------------------------------------------------------------------------------
  208. // The window for displaying text messages.
  209. //==============================================================================
  210.  
  211. //----------------------------------------------------------------------------
  212. // ● alias function: initialize
  213. //----------------------------------------------------------------------------
  214. var NMW01 = Window_Message.prototype.initialize;
  215. Window_Message.prototype.initialize = function() {
  216.     NMW01.call(this);
  217.  
  218.     this.createPanorama();    
  219.     this.createBust();
  220. };
  221.  
  222. //----------------------------------------------------------------------------
  223. // ● overwrite function: updateLoading
  224. //----------------------------------------------------------------------------
  225. Window_Message.prototype.updateLoading = function() {
  226.     if (this._faceBitmap) {
  227.         if (ImageManager.isReady()) {
  228.       // if enableBust is not enable draw default face and panorama
  229.           if(!$emoji.enableBust) {
  230.             this.drawMessageFace();
  231.             this.drawMessagePanorama();
  232.             this._faceBitmap = null;
  233.             this.panorama_graphics = null;
  234.  
  235.             return false;
  236.           }else{
  237.       // else draw bust and panorma and ignoring face
  238.          if($gameMessage.isMirror()){
  239.               this.spritebust.mirror(true,false);
  240.               this.spritebust.x = 600;
  241.             }else
  242.             {this.spritebust.mirror(false,false);}
  243.           if($gameMessage.erasePanorama()){
  244.             this.panorama.visible = false;
  245.           }else{
  246.             this.panorama.visible = true;
  247.           }
  248.             this.drawMessagePanorama();
  249.             this.drawMessageBust();
  250.             this.bust_graphics = null;
  251.             this.panorama_graphics = null;
  252.             return false;
  253.           }
  254.  
  255.         } else {
  256.             return true;
  257.         }
  258.     } else {
  259.         return false;
  260.  
  261.     }
  262. };
  263.  
  264. //----------------------------------------------------------------------------
  265. // ● overwrite function: newPage
  266. //----------------------------------------------------------------------------
  267. Window_Message.prototype.newPage = function(textState) {
  268.     this.contents.clear();
  269.     this.resetFontSettings();
  270.     this.clearFlags();
  271.     this.loadMessageFace();
  272.     textState.x = this.newLineX();
  273.     textState.y = 0;
  274.     textState.left = this.newLineX();
  275.     textState.height = this.calcTextHeight(textState, false);
  276.     this.load_Panorama();
  277.     this.load_messagebust();
  278. };
  279.  
  280. //----------------------------------------------------------------------------
  281. // ○ new function: load_messagebust
  282. //----------------------------------------------------------------------------
  283. Window_Message.prototype.load_messagebust = function() {
  284.  if($gameMessage.ismirror != true){this.spritebust.x = $emoji.bustPos[0];}
  285.  
  286.  if ($gameMessage.bustName() != "") {
  287.     this.bust_graphics = ImageManager.loadBust($gameMessage.bustName() + '_' + $gameMessage.bustIndex());
  288.  }
  289. };
  290.  
  291. //----------------------------------------------------------------------------
  292. // ○ new function: load_Panorama
  293. //----------------------------------------------------------------------------
  294. Window_Message.prototype.load_Panorama = function() {
  295.   if($gameMessage.panoramaName() != ""){
  296.     this.panorama_graphics = ImageManager.loadPanorama($gameMessage.panoramaName());
  297.   }else{
  298.     this.panorama_graphics = ImageManager.loadPanorama("");
  299.   }
  300. };
  301.  
  302. //----------------------------------------------------------------------------
  303. // ○ new function: create_panorama
  304. //----------------------------------------------------------------------------
  305. Window_Message.prototype.createPanorama = function() {
  306.     if($emoji.enablePanorama){  
  307.     this.panorama = new Sprite();
  308.     this.panorama.x = Graphics.width / 2;
  309.     this.panorama.y = (Graphics.height / 2) - 15;
  310.     this.panorama.setOrigin(0.5,1);
  311.     this.addChildAt(this.panorama, 0);
  312.     this.panorama.visible = false;
  313.     }
  314. };
  315. //----------------------------------------------------------------------------
  316. // ○ new function: drawMessagePanorama
  317. //----------------------------------------------------------------------------
  318. Window_Message.prototype.drawMessagePanorama = function() {
  319.     if($gameMessage.panoramaName() === ""){
  320.       if($gameMessage.erasePanorama){
  321.       this.panorama.bitmap = ImageManager.loadPanorama($gameMessage.panoramaName(),0);
  322.       this.panorama.visible = false;
  323.       }
  324.       } else {
  325.         this.panorama.visible = true;
  326.         this.panorama.bitmap = ImageManager.loadPanorama($gameMessage.panoramaName(),0);
  327.       }
  328. };
  329.  
  330. //----------------------------------------------------------------------------
  331. // ○ new function: createBust
  332. //----------------------------------------------------------------------------
  333. Window_Message.prototype.createBust = function() {
  334.     if($emoji.enableBust){    
  335.         this.spritebust = new Sprite();
  336.         this.spritebust.setOrigin(0.5,1);
  337.         this.spritebust.x = $emoji.bustPos[0];
  338.         this.spritebust.y = $emoji.bustPos[1];
  339.         this.spritebust.visible = false;
  340.       // set the z axis of the sprite.
  341.         switch($emoji.bustPriority.toLowerCase()){
  342.           case 'below' :
  343.            this.addChildAt(this.spritebust,1);
  344.            break;
  345.            case 'above' :
  346.            this.addChildAt(this.spritebust,3);
  347.            break;
  348.         }
  349.    }
  350. };
  351.  
  352. //----------------------------------------------------------------------------
  353. // ○ new function: drawMessageBust
  354. //----------------------------------------------------------------------------
  355. Window_Message.prototype.drawMessageBust = function() {
  356.     if ($gameMessage.bustName() != ""){
  357.         this.spritebust.bitmap  = ImageManager.loadBust($gameMessage.bustName() + '_' + $gameMessage.bustIndex());
  358.         this.spritebust.visible = true;
  359.     }else {
  360.         this.spritebust.bitmap  = ImageManager.loadBust("");
  361.         this.spritebust.visible = false;
  362.     }
  363. };
  364.  
  365. //----------------------------------------------------------------------------
  366. // ● overwrite function: newLineX
  367. //----------------------------------------------------------------------------
  368. Window_Message.prototype.newLineX = function() {
  369.   if($emoji.enableBust){
  370.     if($emoji.bustPriority === 'above'){
  371.       return $gameMessage.bustName() === '' ? 0 : 168;
  372.     } else{
  373.       return 0
  374.     }
  375.   }else{
  376.     return $gameMessage.faceName() === '' ? 0 : 168;
  377.   }
  378. };
  379. //===============================================================================
  380. // => END : Window_Message
  381. //===============================================================================
  382.  
  383. //==============================================================================
  384. // ■ ImageManager
  385. //------------------------------------------------------------------------------
  386. // The static class that loads images, creates bitmap objects and retains them.
  387. //==============================================================================
  388.  
  389. //----------------------------------------------------------------------------
  390. // ○ new function: loadBust
  391. //----------------------------------------------------------------------------
  392. ImageManager.loadBust = function(filename) {
  393.     var pathofile = $emoji.bustFolder;
  394.     return this.loadBitmap('img/'+ pathofile + '/', filename, 0, true);
  395. };
  396.  
  397. //----------------------------------------------------------------------------
  398. // ○ new function: loadPanorama
  399. //----------------------------------------------------------------------------
  400. ImageManager.loadPanorama = function(filename,hue) {
  401.     var pathofile = $emoji.panoramaFolder;
  402.     return this.loadBitmap('img/'+ pathofile + '/', filename,hue,true);
  403. };
  404. //===============================================================================
  405. // => END : ImageManager
  406. //===============================================================================
  407.  
  408. //==============================================================================
  409. // ■ Game_Interpreter
  410. //------------------------------------------------------------------------------
  411. // The interpreter for running event commands.
  412. //==============================================================================
  413.  
  414.  
  415. //----------------------------------------------------------------------------
  416. // ○ new function: inputPanorama
  417. //----------------------------------------------------------------------------
  418. Game_Interpreter.prototype.inputPanorama = function(filename,hue) {
  419.   $gameMessage.setPanorama(filename,hue);
  420.  
  421. };
  422.  
  423. //----------------------------------------------------------------------------
  424. // ○ new function: restartPanorama
  425. //----------------------------------------------------------------------------
  426. Game_Interpreter.prototype.restartPanorama = function() {
  427.   $gameMessage.setPanorama('',0);
  428. };
  429.  
  430. //----------------------------------------------------------------------------
  431. // ○ new function: mirrorBust
  432. //----------------------------------------------------------------------------
  433. Game_Interpreter.prototype.mirrorBust = function(flag) {
  434.   $gameMessage.setMirror(flag);
  435. };
  436.  
  437. //----------------------------------------------------------------------------
  438. // ○ new function: setMirror
  439. //----------------------------------------------------------------------------
  440. var NPC01 = Game_Interpreter.prototype.pluginCommand;
  441. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  442.   NPC01.call(this,command,args);
  443.   if(command === 'Emoji.setPanorama' && !$gameParty.inBattle()){
  444.     this.inputPanorama(args,0);
  445.   }
  446.   if(command === 'Emoji.erasePanorama'){
  447.     this.restartPanorama();
  448.   }
  449.   if(command === 'Emoji.mirror'){
  450.     this.mirrorBust(args)
  451.   }
  452. };
  453.  
  454. //----------------------------------------------------------------------------
  455. // ● overwrite function: command101
  456. //----------------------------------------------------------------------------
  457. Game_Interpreter.prototype.command101 = function() {
  458.     if (!$gameMessage.isBusy()) {
  459.         $gameMessage.setFaceImage(this._params[0], this._params[1]);
  460.         $gameMessage.setBackground(this._params[2]);
  461.         $gameMessage.setPositionType(this._params[3]);
  462.         $gameMessage.setBust(this._params[0],this._params[1]);
  463.         while (this.nextEventCode() === 401) {  // Text data
  464.             this._index++;
  465.             $gameMessage.add(this.currentCommand().parameters[0]);
  466.         }
  467.         switch (this.nextEventCode()) {
  468.         case 102:  // Show Choices
  469.             this._index++;
  470.             this.setupChoices(this.currentCommand().parameters);
  471.             break;
  472.         case 103:  // Input Number
  473.             this._index++;
  474.             this.setupNumInput(this.currentCommand().parameters);
  475.             break;
  476.         case 104:  // Select Item
  477.             this._index++;
  478.             this.setupItemChoice(this.currentCommand().parameters);
  479.             break;
  480.         }
  481.         this._index++;
  482.         this.setWaitMode('message');
  483.     }
  484.     return false;
  485. };
  486. })();
  487. //===============================================================================
  488. // => END : Game_Interpreter
  489. //===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement