Advertisement
ezmash

Keep Moving (Event) (MV)

Nov 4th, 2015
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Keep Moving (Event)
  3. // by Shaz
  4. // Last Updated: 2015.11.04
  5. //=============================================================================
  6.  
  7. /*:
  8.  * @plugindesc Allows an event to continue moving while you interact with it
  9.  * @author Shaz
  10.  *
  11.  * @help
  12.  * This plugin prevents the default behaviour of events, where they stop moving
  13.  * and turn towards the PC when you interact with them.
  14.  *
  15.  * Use the following plugin command on an event page:
  16.  *   KeepMoving
  17.  */
  18.  
  19. (function() {
  20.   var _Game_Event_initMembers = Game_Event.prototype.initMembers;
  21.   Game_Event.prototype.initMembers = function() {
  22.     _Game_Event_initMembers.call(this);
  23.     this._nolock = false;
  24.   };
  25.  
  26.   var _Game_Event_clearPageSettings = Game_Event.prototype.clearPageSettings;
  27.   Game_Event.prototype.clearPageSettings = function() {
  28.     _Game_Event_clearPageSettings.call(this);
  29.     this._nolock = false;
  30.   };
  31.  
  32.   var _Game_Event_setupPageSettings = Game_Event.prototype.setupPageSettings;
  33.   Game_Event.prototype.setupPageSettings = function() {
  34.     _Game_Event_setupPageSettings.call(this);
  35.     if (this.list().some(function(cmd) {
  36.       return cmd.code === 356 && cmd.parameters[0].split(" ").shift().toUpperCase() === "KEEPMOVING";
  37.       })) {
  38.       this._nolock = true;
  39.     }
  40.   };
  41.  
  42.   var _Game_Event_lock = Game_Event.prototype.lock;
  43.   Game_Event.prototype.lock = function() {
  44.     if (!this._nolock) {
  45.       _Game_Event_lock.call(this);
  46.     }
  47.   };
  48. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement