Advertisement
Kevany

Keiner_DMEP.js

May 2nd, 2021
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:
  2. * @target MZ
  3. * @plugindesc [v1.0] [en] Stop Event and Player move for event menu.
  4. * [fr] Arrêter les déplacements des Events et du Joueur pour les Event Menu.
  5. * @author Keiner
  6. *
  7. * @help
  8. ====================================================
  9. *                 Introduction
  10. ====================================================
  11. /!\ NE PAS PARTAGER SANS MON ACCORD
  12. *   Si vous voullez vous pouvez me créditer dans votre projet.
  13. *   Ce plugin est gratuit pour son utilisation.
  14.  
  15. Ce plugin permet d'arrêter les déplacements des events et
  16. du joueur.
  17.  
  18. ====================================================
  19. *             UTILISATION DU PLUGIN
  20. ====================================================
  21.  
  22. * Veuiller mettre l'id de l'interrupteur a utiliser,
  23. * a droite dans les paramétres.
  24.  
  25. * Vous avez seulement a activer/désactiver l'interrupteur
  26. * en jeu, pour activer/désactiver les déplacements des
  27. * events et du joueur.
  28.  
  29. * @param switch
  30. * @type number
  31. * @text ID Switch
  32. * @desc Set id switch for on/off move event and player.
  33. * @default 5
  34. *
  35. */
  36.  
  37. var Keiner = Keiner || {};
  38. const pluginNameKDonMove = document.currentScript.src.match(/.+\/(.+)\.js/)[1];
  39. Keiner.donMoveSwitch = PluginManager.parameters(pluginNameKDonMove)['switch'];
  40.  
  41. /*
  42.  [fr] Arrête les events sur la carte.
  43.  [en] Stop move event on the map.
  44. */
  45. Game_Map.prototype.updateEvents = function() {
  46.     if ($gameSwitches.value(Keiner.donMoveSwitch) !== true) {
  47.         for (const event of this.events()) {
  48.             event.update();
  49.         }
  50.     }
  51.     for (const commonEvent of this._commonEvents) {
  52.         commonEvent.update();
  53.     }
  54. };
  55.  
  56. /*
  57.  [fr] Arrête le déplacement du héro.
  58.  [en] Stop move player on the map.
  59. */
  60. Game_Player.prototype.update = function(sceneActive) {
  61.     const lastScrolledX = this.scrolledX();
  62.     const lastScrolledY = this.scrolledY();
  63.     const wasMoving = this.isMoving();
  64.     this.updateDashing();
  65.     if (sceneActive & $gameSwitches.value(Keiner.donMoveSwitch) !== true) {
  66.         this.moveByInput();
  67.     }
  68.     Game_Character.prototype.update.call(this);
  69.     this.updateScroll(lastScrolledX, lastScrolledY);
  70.     this.updateVehicle();
  71.     if (!this.isMoving()) {
  72.         this.updateNonmoving(wasMoving, sceneActive);
  73.     }
  74.     this._followers.update();
  75. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement