设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2375|回复: 2

[有事请教] 请问这个用战斗图做头像的脚本怎么让他战斗时不使用

[复制链接]

Lv1.梦旅人

梦石
0
星屑
165
在线时间
38 小时
注册时间
2021-6-1
帖子
36
发表于 2021-6-30 18:41:17 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 huangchaoyong 于 2021-7-2 07:41 编辑

RUBY 代码复制
  1. //==============================================================================
  2. // dsSVActorForMenuMZ.js
  3. // Copyright (c) 2015 - 2020 DOURAKU
  4. // Released under the MIT License.
  5. // http://opensource.org/licenses/mit-license.php
  6. //==============================================================================
  7.  
  8. /*:
  9. * @target MZ
  10. * @plugindesc 头像用行走图表示 ver1.0.0
  11. * @author 道楽
  12. *
  13. * @param Actor Motion Idle
  14. * @type string
  15. * @desc 非選択時のアクターのモーション
  16. * @default walk
  17. *
  18. * @param Actor Motion Active
  19. * @type string
  20. * @desc 選択時のアクターのモーション
  21. * @default victory
  22. *
  23. * @param Apply States Motion
  24. * @type boolean
  25. * @desc ステートに設定されている[SV]モーションの影響を与えます
  26. * @default false
  27. *
  28. * @help
  29. * 使用できるモーション名
  30. *   walk     wait
  31. *   chant    guard
  32. *   damage   evade
  33. *   thrust   swing
  34. *   missile  skill
  35. *   spell    item
  36. *   escape   victory
  37. *   dying    abnormal
  38. *   sleep    dead
  39. *
  40. * このプラグインは以下のメモタグの設定ができます。
  41. *
  42. * -----------------------------------------------------------------------------
  43. * ステートに設定するメモタグ
  44. *
  45. * <menuActorMotion:[モーション名]>
  46. *  ステート時にアクターのモーションを変更します
  47. *  [モーション名] - 変更するモーションの名称を設定します(文字列)
  48. *                   「Apply States Motion」がtrueの場合でもこちらが優先されます
  49. */
  50.  
  51. var Imported = Imported || {};
  52. Imported.dsSVActorForMenuMZ = true;
  53.  
  54. (function (exports) {
  55.         'use strict';
  56.  
  57.         exports.Param = (function() {
  58.                 var ret = {};
  59.                 var parameters = PluginManager.parameters("dsSVActorForMenuMZ");
  60.                 ret.ActorMotionIdle = String(parameters["Actor Motion Idle"]);
  61.                 ret.ActorMotionActive = String(parameters["Actor Motion Active"]);
  62.                 ret.ApplyStatesMotion = Boolean(parameters["Apply States Motion"]);
  63.                 return ret;
  64.         })();
  65.  
  66.         //--------------------------------------------------------------------------
  67.         /** SceneManager */
  68.         SceneManager.isCurrentScene = function(sceneClass)
  69.         {
  70.                 return this._scene && this._scene.constructor === sceneClass;
  71.         };
  72.  
  73.         //--------------------------------------------------------------------------
  74.         /** Game_Actor */
  75.         (function () {
  76.                 const base = Game_Actor.prototype.isSpriteVisible;
  77.                 Game_Actor.prototype.isSpriteVisible = function()
  78.                 {
  79.                         if ( !SceneManager.isCurrentScene(Scene_Battle) )
  80.                         {
  81.                                 return true;
  82.                         }
  83.                         return base.call(this);
  84.                 };
  85.         }());
  86.  
  87.         Game_Actor.prototype.motionTypeMenu = function()
  88.         {
  89.                 var states = this.states();
  90.                 if ( states.length > 0 )
  91.                 {
  92.                         if ( states[0].meta.menuActorMotion )
  93.                         {
  94.                                 return states[0].meta.menuActorMotion;
  95.                         }
  96.                 }
  97.                 if ( exports.Param.ApplyStatesMotion )
  98.                 {
  99.                         switch ( this.stateMotionIndex() )
  100.                         {
  101.                         case 1: return "abnormal";
  102.                         case 2: return "sleep";
  103.                         case 3: return "dead";
  104.                         }
  105.                 }
  106.                 return "";
  107.         };
  108.  
  109.         Game_Actor.prototype.motionTypeMenuIdle = function()
  110.         {
  111.                 var motion = this.motionTypeMenu();
  112.                 return (motion !== "") ? motion : exports.Param.ActorMotionIdle;
  113.         };
  114.  
  115.         Game_Actor.prototype.motionTypeMenuActive = function()
  116.         {
  117.                 var motion = this.motionTypeMenu();
  118.                 return (motion !== "") ? motion : exports.Param.ActorMotionActive;
  119.         };
  120.  
  121.         //--------------------------------------------------------------------------
  122.         /** Sprite_ActorMenu */
  123.         exports.Sprite_ActorMenu = (function() {
  124.  
  125.                 function Sprite_ActorMenu()
  126.                 {
  127.                         this.initialize.apply(this, arguments);
  128.                 }
  129.  
  130.                 Sprite_ActorMenu.prototype = Object.create(Sprite_Actor.prototype);
  131.                 Sprite_ActorMenu.prototype.constructor = Sprite_ActorMenu;
  132.  
  133.                 Sprite_ActorMenu.prototype.createMainSprite = function()
  134.                 {
  135.                         Sprite_Actor.prototype.createMainSprite.call(this);
  136.                         this._mainSprite.anchor.y = 0.5;
  137.                 };
  138.  
  139.                 Sprite_ActorMenu.prototype.startIdleMotion = function()
  140.                 {
  141.                         this.startMotion(this._actor.motionTypeMenuIdle());
  142.                 };
  143.  
  144.                 Sprite_ActorMenu.prototype.startActiveMotion = function()
  145.                 {
  146.                         this.startMotion(this._actor.motionTypeMenuActive());
  147.                 };
  148.  
  149.                 Sprite_ActorMenu.prototype.updateMotion = function()
  150.                 {
  151.                         this.updateMotionCount();
  152.                 };
  153.  
  154.                 Sprite_ActorMenu.prototype.updateShadow = function()
  155.                 {
  156.                         this._shadowSprite.hide();
  157.                 };
  158.  
  159.                 // unused
  160.                 Sprite_ActorMenu.prototype.updateDamagePopup = function() {};
  161.                 Sprite_ActorMenu.prototype.startEntryMotion = function() {};
  162.                 Sprite_ActorMenu.prototype.setActorHome = function(index) {};
  163.                 Sprite_ActorMenu.prototype.startMove = function(x, y, duration) {};
  164.                 Sprite_ActorMenu.prototype.moveToStartPosition = function() {};
  165.  
  166.                 return Sprite_ActorMenu;
  167.         })();
  168.  
  169.         //--------------------------------------------------------------------------
  170.         /** Window_StatusBase */
  171.         (function () {
  172.                 const base = Window_StatusBase.prototype.loadFaceImages;
  173.                 Window_StatusBase.prototype.loadFaceImages = function()
  174.                 {
  175.                         for ( const actor of $gameParty.members() )
  176.                         {
  177.                                 ImageManager.loadSvActor(actor.battlerName());
  178.                         }
  179.                 };
  180.         }());
  181.  
  182.         (function () {
  183.                 const base = Window_StatusBase.prototype.paint;
  184.                 Window_StatusBase.prototype.paint = function()
  185.                 {
  186.                         this.hideAdditionalSprites();
  187.                         base.apply(this, arguments);
  188.                 };
  189.         }());
  190.  
  191.         Window_StatusBase.prototype.isActiveSprite = function(index)
  192.         {
  193.                 if ( this.active )
  194.                 {
  195.                         if ( this.cursorAll() )
  196.                         {
  197.                                 return true;
  198.                         }
  199.                         else if ( this.index() >= 0 )
  200.                         {
  201.                                 if ( index === this.index() )
  202.                                 {
  203.                                         return true;
  204.                                 }
  205.                                 if ( index === this._pendingIndex )
  206.                                 {
  207.                                         return true;
  208.                                 }
  209.                         }
  210.                 }
  211.                 return false;
  212.         };
  213.  
  214.         Window_StatusBase.prototype.createActorMenuSprite = function(actor)
  215.         {
  216.                 const key = "actor%1-svactor".format(actor.actorId());
  217.                 var sprite = this.createInnerSprite(key, exports.Sprite_ActorMenu);
  218.                 sprite.setBattler(actor);
  219.                 return sprite;
  220.         };
  221.  
  222.         Window_StatusBase.prototype.placeSVActor = function(actor, x, y, width, height)
  223.         {
  224.                 var sprite = this.createActorMenuSprite(actor);
  225.                 sprite.setHome(x + width / 2, y + height / 2);
  226.                 sprite.startIdleMotion();
  227.                 sprite.show();
  228.         };
  229.  
  230.         Window_StatusBase.prototype.drawActorFace = function(actor, x, y, width, height)
  231.         {
  232.                 width = width || ImageManager.faceWidth;
  233.                 height = height || ImageManager.faceHeight;
  234.                 this.placeSVActor(actor, x, y, width, height);
  235.         };
  236.  
  237.         //--------------------------------------------------------------------------
  238.         /** Window_MenuStatus */
  239.         (function () {
  240.                 const base = Window_MenuStatus.prototype.update;
  241.                 Window_MenuStatus.prototype.update = function()
  242.                 {
  243.                         base.apply(this, arguments);
  244.                         this.updateActorSprites();
  245.                 };
  246.         }());
  247.  
  248.         Window_MenuStatus.prototype.updateActorSprites = function()
  249.         {
  250.                 const maxItem = this.maxItems();
  251.                 const maxVisible = this.maxVisibleItems();
  252.                 const opacity = this.translucentOpacity();
  253.                 const topIndex = this.topIndex();
  254.                 for ( let ii = 0; ii < maxVisible; ii++ )
  255.                 {
  256.                         const index = topIndex + ii;
  257.                         if (index >= maxItem)
  258.                         {
  259.                                 continue;
  260.                         }
  261.                         const actor = this.actor(index);
  262.                         const sprite = this.createActorMenuSprite(actor);
  263.                         sprite.opacity = actor.isBattleMember() ? 255 : opacity;
  264.                         if ( this.isActiveSprite(index) )
  265.                         {
  266.                                 sprite.startActiveMotion();
  267.                         }
  268.                         else
  269.                         {
  270.                                 sprite.startIdleMotion();
  271.                         }
  272.                 }
  273.         };
  274.  
  275.         //--------------------------------------------------------------------------
  276.         /** Window_EquipStatus */
  277.         (function () {
  278.                 const base = Window_EquipStatus.prototype.refresh;
  279.                 Window_EquipStatus.prototype.refresh = function()
  280.                 {
  281.                         this.hideAdditionalSprites();
  282.                         base.apply(this, arguments);
  283.                 };
  284.         }());
  285.  
  286.         //--------------------------------------------------------------------------
  287.         /** Window_BattleStatus */
  288.         (function () {
  289.                 const base = Window_BattleStatus.prototype.update;
  290.                 Window_BattleStatus.prototype.update = function()
  291.                 {
  292.                         base.apply(this, arguments);
  293.                         this.updateActorSprites();
  294.                 };
  295.         }());
  296.  
  297.         Window_BattleStatus.prototype.updateActorSprites = function()
  298.         {
  299.                 const maxItem = this.maxItems();
  300.                 const maxVisible = this.maxVisibleItems();
  301.                 const opacity = this.translucentOpacity();
  302.                 const topIndex = this.topIndex();
  303.                 for ( let ii = 0; ii < maxVisible; ii++ )
  304.                 {
  305.                         const index = topIndex + ii;
  306.                         if (index >= maxItem)
  307.                         {
  308.                                 continue;
  309.                         }
  310.                         const actor = this.actor(index);
  311.                         const sprite = this.createActorMenuSprite(actor);
  312.                         sprite.opacity = actor.isBattleMember() ? 255 : opacity;
  313.                         sprite.startIdleMotion();
  314.                 }
  315.         };
  316.  
  317. }((this.dsSVActorForMenuMZ = this.dsSVActorForMenuMZ || {})));

这个脚本和NRP_DynamicAnimationMZ脚本一起使用时战斗中显示异常能不能把战斗中头像用战斗图表示关闭让战斗恢复原来的显示方法
捕获.PNG
070940vqife60gjd0geij0.gif

Lv3.寻梦者

梦石
0
星屑
2585
在线时间
297 小时
注册时间
2021-5-4
帖子
101
发表于 2021-6-30 20:05:22 | 显示全部楼层
  Window_StatusBase.prototype.placeSVActor = function(actor, x, y, width, height)
        {
                var sprite = this.createActorMenuSprite(actor);
                sprite.setHome(x + width / 2, y + height / 2);
                sprite.startIdleMotion();
                sprite.show();
        };
y+height/2 就是设置高度 增加值就可以了 把除2 拿掉看看高度如何
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
165
在线时间
38 小时
注册时间
2021-6-1
帖子
36
 楼主| 发表于 2021-7-1 06:53:43 | 显示全部楼层
本帖最后由 huangchaoyong 于 2021-7-2 07:35 编辑

sdds.gif dsfs 73.png 战斗中显示异常能不能把战斗中头像用战斗图表示关闭让战斗恢复原来的显示方法
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-3-29 10:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表