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

Project1

 找回密码
 注册会员
搜索
查看: 1221|回复: 2
打印 上一主题 下一主题

[已经解决] 【已解决】求助,请问如何隐藏部分角色的数据?

[复制链接]

Lv3.寻梦者

梦石
0
星屑
966
在线时间
87 小时
注册时间
2022-12-26
帖子
98
跳转到指定楼层
1
发表于 2022-12-30 21:10:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 爱羊真知己 于 2023-1-1 16:37 编辑

求助,请问如何隐藏部分角色的数据?即通过给角色添加备注,使其(最大/当前)(HP/MP),(物理/魔法)(攻击/防御)以及敏捷,幸运,等级全部显示为“???”?(菜单中和战斗中都有效,且其他角色以及除数据外其他的东西(如“最大HP”四个字)不受影响)我在论坛里看到别人搜过,但他因为改了战斗窗口导致他的解决方法(脚本)和未改的不兼容……所以我只能再求助一遍了。求大佬解决!
你好!

Lv5.捕梦者

梦石
0
星屑
24317
在线时间
5050 小时
注册时间
2016-3-8
帖子
1620
2
发表于 2022-12-31 21:40:36 | 只看该作者
本帖最后由 alexncf125 于 2022-12-31 21:59 编辑

元旦快乐~
RUBY 代码复制
  1. #在角色备注写上<hide param>和<hide level>
  2.  
  3. module NCF
  4.   module REGEXP
  5.     module ACTOR
  6.       HIDE_LEVEL_PARAM_TEXT = /<(?:HIDE|hide)[ ]\s*(.*)>/i
  7.     end
  8.   end
  9. end
  10.  
  11.  
  12.  
  13. module DataManager
  14.  
  15.   class << self; alias :load_database_hlpt :load_database; end
  16.  
  17.   def self.load_database
  18.     load_database_hlpt
  19.     load_notetags_hlpt
  20.   end
  21.  
  22.   def self.load_notetags_hlpt
  23.     groups = [$data_actors]
  24.     for group in groups
  25.       for obj in group
  26.         next if obj.nil?
  27.         obj.load_notetags_hlpt
  28.       end
  29.     end
  30.   end
  31.  
  32. end
  33.  
  34.  
  35.  
  36. class RPG::Actor
  37.  
  38.   attr_accessor :hide_level_param_text
  39.  
  40.   def load_notetags_hlpt
  41.     @hide_level_param_text = [false, false]
  42.     self.note.split(/[\r\n]+/).each { |line|
  43.       case line
  44.       when NCF::REGEXP::ACTOR::HIDE_LEVEL_PARAM_TEXT
  45.         case $1.upcase
  46.         when "LEVEL"
  47.           @hide_level_param_text[0] = true
  48.         when "PARAM"
  49.           @hide_level_param_text[1] = true
  50.         end
  51.       end
  52.     }
  53.   end
  54.  
  55. end
  56.  
  57.  
  58.  
  59. class Game_Temp
  60.  
  61.   #--------------------------------------------------------------------------
  62.   # ● 定义实例变量
  63.   #--------------------------------------------------------------------------
  64.   attr_accessor :hide_level_param_text
  65.  
  66.   #--------------------------------------------------------------------------
  67.   # ● 初始化對象
  68.   #--------------------------------------------------------------------------
  69.   alias :initialize_hide :initialize
  70.   def initialize
  71.     initialize_hide
  72.     @hide_level_param_text = false
  73.   end
  74.  
  75. end
  76.  
  77.  
  78.  
  79. class Window_Base < Window
  80.  
  81.   #--------------------------------------------------------------------------
  82.   # ● 绘制內容
  83.   #     args : 与 Bitmap#draw_text 相同
  84.   #--------------------------------------------------------------------------
  85.   alias :draw_text_hide :draw_text
  86.   def draw_text(*args)
  87.     args[4] = "???" if $game_temp.hide_level_param_text && args[4].is_a?(Numeric)
  88.     draw_text_hide(*args)
  89.   end
  90.  
  91.   #--------------------------------------------------------------------------
  92.   # ● 绘制等级
  93.   #--------------------------------------------------------------------------
  94.   alias :draw_actor_level_hide :draw_actor_level
  95.   def draw_actor_level(actor, x, y)
  96.     $game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[0]
  97.     draw_actor_level_hide(actor, x, y)
  98.     $game_temp.hide_level_param_text = false
  99.   end
  100.  
  101.   #--------------------------------------------------------------------------
  102.   # ● 绘制 HP
  103.   #--------------------------------------------------------------------------
  104.   alias :draw_actor_hp_hide :draw_actor_hp
  105.   def draw_actor_hp(actor, x, y, width = 124)
  106.     $game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[1]
  107.     draw_actor_hp_hide(actor, x, y, width)
  108.     $game_temp.hide_level_param_text = false
  109.   end
  110.  
  111.   #--------------------------------------------------------------------------
  112.   # ● 绘制 HP
  113.   #--------------------------------------------------------------------------
  114.   alias :draw_actor_mp_hide :draw_actor_mp
  115.   def draw_actor_mp(actor, x, y, width = 124)
  116.     $game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[1]
  117.     draw_actor_mp_hide(actor, x, y, width)
  118.     $game_temp.hide_level_param_text = false
  119.   end
  120.  
  121.   #--------------------------------------------------------------------------
  122.   # ● 绘制 HP
  123.   #--------------------------------------------------------------------------
  124.   alias :draw_actor_tp_hide :draw_actor_tp
  125.   def draw_actor_tp(actor, x, y, width = 124)
  126.     $game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[1]
  127.     draw_actor_tp_hide(actor, x, y, width)
  128.     $game_temp.hide_level_param_text = false
  129.   end
  130.  
  131.   #--------------------------------------------------------------------------
  132.   # ● 绘制能力值
  133.   #--------------------------------------------------------------------------
  134.   alias :draw_actor_param_hide :draw_actor_param
  135.   def draw_actor_param(actor, x, y, param_id)
  136.     $game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[1]
  137.     draw_actor_param_hide(actor, x, y, param_id)
  138.     $game_temp.hide_level_param_text = false
  139.   end
  140.  
  141. end
  142.  
  143.  
  144.  
  145. class Window_EquipStatus < Window_Base
  146.  
  147.   #--------------------------------------------------------------------------
  148.   # ● 绘制当前能力值
  149.   #--------------------------------------------------------------------------
  150.   alias :draw_current_param_hide :draw_current_param
  151.   def draw_current_param(x, y, param_id)
  152.     $game_temp.hide_level_param_text = true if @actor.actor.hide_level_param_text[1]
  153.     draw_current_param_hide(x, y, param_id)
  154.     $game_temp.hide_level_param_text = false
  155.   end
  156.  
  157. end

欢迎进群~

评分

参与人数 1+1 收起 理由
爱羊真知己 + 1 我很赞同

查看全部评分

回复 支持 1 反对 0

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
966
在线时间
87 小时
注册时间
2022-12-26
帖子
98
3
 楼主| 发表于 2022-12-31 22:26:24 | 只看该作者
alexncf125 发表于 2022-12-31 21:40
元旦快乐~#在角色备注写上和

module NCF

谢谢!这个脚本非常有用!
你好!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-29 09:06

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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