查看: 104|回复: 0

[转载发布] 请问这个用战斗图做头像的脚本怎么让他战斗时不使用

[复制链接]
  • TA的每日心情
    开心
    2024-5-10 09:55
  • 签到天数: 37 天

    连续签到: 3 天

    [LV.5]常住居民I

    2028

    主题

    32

    回帖

    7260

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

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


                 本帖来自P1论坛作者huangchaoyong,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=486185  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
    天天去同能,天天有童年!
    回复 论坛版权

    使用道具 举报

    ahome_bigavatar:guest
    ahome_bigavatar:welcomelogin
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2024-5-20 18:28 , Processed in 0.047201 second(s), 41 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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