Advertisement
modern_algebra

YanflyCoreandEMFCompatibility

Nov 7th, 2015
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. //  YanflyCoreandEMFCompatibility.js
  3. //=============================================================================
  4. //  Version: 1.0.0
  5. //  Date: 7 November 2015
  6. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  7. /*:
  8.  * @author Modern Algebra (rmrk.net)
  9.  * @plugindesc Compatibility patch for Extra Movement Frames and Yanfly Core Engine v. 1.0.5
  10.  *
  11.  * @help Place this plugin immediately below Yanfly Core Engine.
  12.  *
  13.  * Yanfly Core Engine will sometimes prematurely reset the pattern of a
  14.  * sprite, which can be noticeable when a sprite has more than 3 frames. This
  15.  * patch reverses that change.
  16.  */
  17. //=============================================================================
  18.  
  19. /*
  20. Yanfly's code was intended to ensure that an event moving at frequency 5 would
  21. not pause for a frame between movements. That problem might have been fixed
  22. before the official version of RMMV was released, since that does not appear
  23. to be a problem in the default code. I therefore wrote this patch to reverse
  24. Yanfly's changes, since the updated stopping code would sometimes prematurely
  25. reset the animation pattern of sprites.
  26. */
  27.  
  28. (function() {
  29.     if (Imported && Imported.YEP_CoreEngine) {
  30.         //=====================================================================
  31.         // ** Game_CharacterBase
  32.         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  33.         // update - restore the default function
  34.         Game_CharacterBase.prototype.update = function() {
  35.             if (this.isStopping()) {
  36.                 this.updateStop();
  37.             }
  38.             if (this.isJumping()) {
  39.                 this.updateJump();
  40.             } else if (this.isMoving()) {
  41.                 this.updateMove();
  42.             }
  43.             this.updateAnimation();
  44.         };
  45.        
  46.         // updateMove - restore the default function
  47.         Game_CharacterBase.prototype.updateMove = function() {
  48.             Yanfly.Core.Game_CharacterBase_updateMove.call(this);
  49.         };
  50.     } else {
  51.         var path = document.currentScript.src;
  52.         var scriptName = path.substring(path.lastIndexOf('/')+1).match(/^(.+?)(\.[^.]*$|$)/)[1];
  53.         console.log(scriptName + ' was not installed because Yanfly Core Engine is either disable or lower than this patch in the plugin list');
  54.     }
  55.        
  56. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement