Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:
  2.  * @plugindesc Some plugin description
  3.  * @author eastw
  4.  *
  5.  * @help This plugin does not provide plugin commands.
  6.  *
  7.  */
  8.  
  9. /*:ja
  10.  * @plugindesc Some plugin desc
  11.  * @author eastw
  12.  *
  13.  *
  14.  */
  15.  
  16. //Graphic actor presentation
  17. function GActor() {
  18.     this.init();
  19. }
  20. GActor.prototype.constructor = GActor;
  21.  
  22. GActor.prototype.init = function() {
  23.     this._actor = 'riven';
  24.     this._emotion = 'normal';
  25.     this._hide = false;
  26.     this._sprite = new Sprite_Riven();
  27.     this._sprite.createBitmap(this._actor, this._emotion);
  28. };
  29.  
  30. GActor.prototype.hide = function() {
  31.     this._hide = true;
  32. };
  33. GActor.prototype.show = function() {
  34.     this._hide = false;
  35. };
  36.  
  37. GActor.prototype.isHidden = function() {
  38.     return this._hide;
  39. };
  40.  
  41. GActor.prototype.setActor = function(actor) {
  42.     this._actor = actor;
  43. };
  44.  
  45. GActor.prototype.showEmotion = function(emotion) {
  46.     this._emotion = emotion;
  47.     this._sprite.createBitmap(this._actor, this._emotion);
  48.     this.show();
  49. };
  50.  
  51. GActor.prototype.getSprite = function() {
  52.     return this._sprite;
  53. };
  54.  
  55.  
  56. var ga_init = Game_System.prototype.initialize;
  57. Game_Interpreter.prototype.initialize = function() {
  58.     ga_init.call(this);
  59.     this._gActor = null;
  60. };
  61.  
  62. var gs_init = Game_System.prototype.initialize;
  63. Game_System.prototype.initialize = function() {
  64.     gs_init.call(this);
  65.     this._gActor = new GActor();
  66. };
  67.  
  68. Game_System.prototype.getGActor = function() {
  69.     return this._gActor;
  70. };
  71.  
  72. Game_Interpreter.prototype.getGActor = function() {
  73.     return $gameSystem.getGActor();
  74. };
  75.  
  76.  
  77. function Sprite_Riven() {
  78.     this.initialize.apply(this, arguments);
  79. }
  80.  
  81. Sprite_Riven.prototype = Object.create(Sprite_Base.prototype);
  82. Sprite_Riven.prototype.constructor = Sprite_Riven;
  83.  
  84. Sprite_Riven.prototype.initialize = function() {
  85.     Sprite_Base.prototype.initialize.call(this);
  86. };
  87.  
  88. Sprite_Riven.prototype.createBitmap = function(actor, emotion) {
  89.     this.bitmap = ImageManager.loadPicture(actor + '/' + emotion);
  90. };
  91.  
  92. Sprite_Riven.prototype.update = function() {
  93.     Sprite_Base.prototype.update.call(this);
  94.     this.updatePosition();
  95. };
  96.  
  97. Sprite_Riven.prototype.updatePosition = function() {
  98.     this.x = Graphics.boxWidth / 2 - 100;
  99.     this.y = Graphics.boxHeight - 413;
  100.     if ($gameSystem.getGActor().isHidden()) {
  101.         this.opacity = 0;
  102.     } else {
  103.         this.opacity = 500;
  104.     }
  105. };
  106.  
  107. Scene_Map.prototype.createRivenSprite = function() {
  108.     this._riven = $gameSystem.getGActor().getSprite();
  109.     this.addChild(this._riven);
  110. };
  111.  
  112. var scene_map_terminate = Scene_Map.prototype.terminate;
  113. Scene_Map.prototype.terminate = function() {
  114.     scene_map_terminate.call(this);
  115.     this.removeChild(this._riven);
  116. };
  117.  
  118. Scene_Map.prototype.createDisplayObjects = function() {
  119.     this.createSpriteset();
  120.     this.createRivenSprite(); //if create below then sprite on top
  121.     this.createMapNameWindow();
  122.     this.createWindowLayer();
  123.     this.createAllWindows();
  124. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement