Advertisement
nio_kasgami

Emoji Engine Ultimate Bust Beta

Feb 19th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:
  2.  * 絵文字エンジン - カットシーン"高度なバストシステムEX」
  3.  * Require : EmojiBase V2
  4. */
  5.  
  6. //==============================================================================
  7. // ■ Sprite_Bust
  8. //------------------------------------------------------------------------------
  9. // the class who handle the Message Sprite processing.
  10. //==============================================================================
  11.  
  12. function Sprite_Bust() {this.initialize.apply(this,arguments);}
  13.  Sprite_Bust.prototype.constructor = Sprite_Bust;
  14.  
  15.  //----------------------------------------------------------------------------
  16.  // ○ new inheritance: Sprite
  17.  //----------------------------------------------------------------------------
  18.  Sprite_Bust.prototype = Object.create(Sprite.prototype);
  19.  
  20.  //----------------------------------------------------------------------------
  21.  // ★ new accessors : bustA, bustB, bustC
  22.  //----------------------------------------------------------------------------
  23.  Object.defineProperties(Sprite_Bust.prototype, {
  24.     // get Bust A bitmap name.
  25.     bustA: { get: function() { return this._bustA; }, configurable: true },
  26.     // get Bust B bitmap name.
  27.     bustB: { get: function() { return this._bustB; }, configurable: true },
  28.     // get Bust C bitmap name.
  29.     bustC: { get: function() { return this._bustC; }, configurable: true }
  30.  });
  31.  
  32.  //----------------------------------------------------------------------------
  33.  // ○ new public function: initialize
  34.  //----------------------------------------------------------------------------
  35.  Sprite_Bust.prototype.initialize = function() {
  36.     this._initMember();
  37.  };
  38.  
  39.  //----------------------------------------------------------------------------
  40.  // ○ new private function: _initMember
  41.  //----------------------------------------------------------------------------
  42.  Sprite_Bust.prototype._initMember = function(){
  43.     this._bustA = $gameMessage.bustAName();
  44.     this._bustB = $gameMessage.bustBName();
  45.     this._bustC = $gameMessage.bustCName();
  46.  
  47.     this._homePos = Emoji.BustHomePose;
  48.     this._finalPos = Emoji.BustFinalPose;
  49.  };
  50.  
  51.  //----------------------------------------------------------------------------
  52.  // ○ new public function: update
  53.  //----------------------------------------------------------------------------
  54.  Sprite_Bust.prototype.update = function() {};
  55.  
  56. //===============================================================================
  57. // => END : Sprite_Bust
  58. //===============================================================================
  59.  
  60. // Sprite_Panorama
  61. function Sprite_Panorama() { this.initialize.apply(this,arguments);}
  62.  Sprite_Panorama.prototype.constructor = Sprite_Panorama;
  63.  
  64.  Sprite_Panorama.prototype = Object.create(Sprite.prototype);
  65.  
  66. // End Sprite_Panorama
  67.  
  68.  Emoji.alias.spritesetMapCreate = Spriteset_Map.prototype.create;
  69.  Spriteset_Map.prototype.create = function(){
  70.     Emoji.alias.spritesetMapCreate.call(this);
  71.     this.createBust();
  72.  };
  73.  
  74.  Spriteset_Map.prototype.createBust = function() {
  75.     this._spriteBust = [];
  76.     var maxBust = 3; // do not forget that spriteBust is a array
  77.     for (var i = 0; i < maxBust; i++){
  78.         this._spriteBust[i] = new Sprite_Bust();
  79.         this._baseSprite.addChild(this._spriteBust[i]);
  80.     }
  81.  };
  82.  
  83.  Spriteset_Map.prototype.bustName = function(index) {
  84.     switch(index){
  85.         case 0 :
  86.         return $gameMessage.bustA();
  87.         break;
  88.         case 1 :
  89.         return $gameMessage.bustB();
  90.         break;
  91.         case 2 :
  92.         return $gameMessage.bustC();
  93.         break;
  94.     }
  95.  };
  96.  Sprite_Bust.prototype.updateBust = function() {
  97.     var bustName = this.BustName();
  98.     var maxBust = 3;
  99.     for (var i = 0; i < maxBust; i++){
  100.         this._spriteBust[i].setSprite(bustName(i);
  101.         if(this._spriteBust[i].x != this._spriteBust[i].finalPos() && $gameMessage.isBusy()){
  102.             this._spriteBust[i].appear();
  103.         }
  104.         else if(this._spriteBust[i].isActive() && $gameMessage.isBusy()){
  105.             this._spriteBust[i].dimmer(false);
  106.         }
  107.         else if(this._spriteBust[i].isActive != false){
  108.             this._spriteBust[i].dimmer(true);
  109.         }
  110.  
  111.     }
  112.  };
  113.  
  114. Emoji.alias.SpritesetMapUpdate = Spriteset_Map.prototype.update;
  115. Spriteset_Map.prototype.update = function() {
  116.     Emoji.alias.SpritesetMapUpdate.call(this);
  117.     this.updateBust();
  118. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement