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

Project1

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

[已经解决] 隐藏单一角色的各项数值

[复制链接]

Lv2.观梦者

梦石
0
星屑
272
在线时间
60 小时
注册时间
2014-2-9
帖子
14
跳转到指定楼层
1
发表于 2021-8-14 04:52:46 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
200星屑
本帖最后由 t0004980 于 2021-8-14 04:56 编辑

之前也有问过,虽然解决一些问题了,但又有新的需求。
状态栏的能力值的文字我无法使他出现。


然后我还想把装备栏的数值也显示成?号

战斗中本来该隐藏数值的角色,还是有HP跟MP
并且不会与其他角色出现错误。
请问这要怎么处理?
这是我的工程
链接: https://pan.baidu.com/s/1ZTb2eb39JLveWnntr2fYsQ 提取码: bmym

最佳答案

查看完整内容

你这个数字是用图片显示的,所以你得做一张???的图片

Lv3.寻梦者

梦石
0
星屑
1122
在线时间
26 小时
注册时间
2021-2-19
帖子
30
2
发表于 2021-8-14 04:52:47 | 只看该作者
你这个数字是用图片显示的,所以你得做一张???的图片
  1. YAMI_NEED2HIDE = [1,2] #角色id
  2. YAMI_REPLACE_TEXT = "???"
  3. YAMI_REPLACE_TEXT_PIC = "popup_maxhp_remove_small"#图片名
  4. class CAO::CM::Canvas
  5.   alias yami_draw_actor_level draw_actor_level
  6.   alias yami_draw_actor_level_g draw_actor_level_g
  7.   alias yami_draw_actor_hp draw_actor_hp
  8.   alias yami_draw_actor_mp draw_actor_mp
  9.   alias yami_draw_actor_param draw_actor_param
  10.   def draw_actor_level(actor, x, y, width = 64)
  11.     if VISIBLE_SYSTEM
  12.       change_color(system_color)
  13.       draw_text(x, y, 32, line_height, Vocab::level_a)
  14.     end
  15.     change_color(normal_color)
  16.     if YAMI_NEED2HIDE.include?(actor.actor.id)
  17.       draw_text(x + width - text_size(YAMI_REPLACE_TEXT).width * 2, y, text_size(YAMI_REPLACE_TEXT).width * 2, line_height, YAMI_REPLACE_TEXT, 2)
  18.       return
  19.     end
  20.     draw_text(x + width - 32, y, 32, line_height, actor.level, 2)
  21.   end
  22.   def draw_actor_level_g(actor, x, y, width = 64)
  23.     draw_gauge(x,y,width,actor.cm_exp_rate,exp_gauge_color1,exp_gauge_color2)
  24.     if VISIBLE_SYSTEM
  25.       change_color(system_color)
  26.       draw_text(x, y, 32, line_height, Vocab::level_a)
  27.     end
  28.     change_color(tp_color(actor))
  29.     if YAMI_NEED2HIDE.include?(actor.actor.id)
  30.       draw_text(x +  width - text_size(YAMI_REPLACE_TEXT).width * 2, y, text_size(YAMI_REPLACE_TEXT).width * 2, line_height, YAMI_REPLACE_TEXT, 2)
  31.       return
  32.     end   
  33.     draw_text(x + width - 32, y, 32, line_height, actor.level, 2)
  34.   end
  35.   def draw_actor_hp(actor, x, y, width = 124)
  36.     draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  37.     if VISIBLE_SYSTEM
  38.       change_color(system_color)
  39.       draw_text(x, y, 30, line_height, Vocab::hp_a)
  40.     end
  41.      if YAMI_NEED2HIDE.include?(actor.actor.id)
  42.       draw_current_and_max_values(x, y, width, YAMI_REPLACE_TEXT, YAMI_REPLACE_TEXT,
  43.         hp_color(actor), normal_color)
  44.       return
  45.     end      
  46.     draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
  47.       hp_color(actor), normal_color)
  48.   end
  49.   def draw_actor_mp(actor, x, y, width = 124)
  50.     draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  51.     if VISIBLE_SYSTEM
  52.       change_color(system_color)
  53.       draw_text(x, y, 30, line_height, Vocab::mp_a)
  54.     end
  55.     if YAMI_NEED2HIDE.include?(actor.actor.id)
  56.       draw_current_and_max_values(x, y, width, YAMI_REPLACE_TEXT, YAMI_REPLACE_TEXT,
  57.         mp_color(actor), normal_color)
  58.       return
  59.     end   
  60.     draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
  61.       mp_color(actor), normal_color)
  62.    end
  63.   def draw_actor_param(actor, x, y, param_id, width = 124)
  64.     if param_id < 0 || param_id > 7
  65.       raise ArgumentError, "能力値の ID は 0 から 7 までの数値です。"
  66.     end
  67.     if VISIBLE_SYSTEM
  68.       change_color(system_color)
  69.       draw_text(x, y, width, line_height, Vocab::param(param_id))
  70.     end
  71.     if YAMI_NEED2HIDE.include?(actor.actor.id)
  72.       draw_text(x, y,text_size(YAMI_REPLACE_TEXT).width * 2, line_height, YAMI_REPLACE_TEXT, 2)
  73.       return
  74.     end
  75.     change_color(normal_color)
  76.     draw_text(x, y, width, line_height, actor.param(param_id), 2)
  77.   end
  78. end
  79. class Window_Base
  80.   def draw_actor_level(actor, x, y)
  81.     change_color(system_color)
  82.     draw_text(x, y, 32, line_height, Vocab::level_a)
  83.     change_color(normal_color)
  84.     if YAMI_NEED2HIDE.include?(actor.actor.id)
  85.       draw_text(x + 32 + 24 - text_size(YAMI_REPLACE_TEXT).width * 2, y, text_size(YAMI_REPLACE_TEXT).width * 2, line_height, YAMI_REPLACE_TEXT, 2)
  86.       return
  87.     end
  88.     draw_text(x + 32, y, 24, line_height, actor.level, 2)
  89.   end
  90.   def draw_actor_hp(actor, x, y, width = 124)
  91.     draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  92.     change_color(system_color)
  93.     draw_text(x, y, 30, line_height, Vocab::hp_a)
  94.     if YAMI_NEED2HIDE.include?(actor.actor.id)
  95.       draw_current_and_max_values(x, y, width, YAMI_REPLACE_TEXT, YAMI_REPLACE_TEXT,
  96.         hp_color(actor), normal_color)
  97.       return
  98.     end   
  99.     draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
  100.       hp_color(actor), normal_color)
  101.   end
  102.   def draw_actor_mp(actor, x, y, width = 124)
  103.     draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  104.     change_color(system_color)
  105.     draw_text(x, y, 30, line_height, Vocab::mp_a)
  106.     if YAMI_NEED2HIDE.include?(actor.actor.id)
  107.       draw_current_and_max_values(x, y, width, YAMI_REPLACE_TEXT, YAMI_REPLACE_TEXT,
  108.         mp_color(actor), normal_color)
  109.       return
  110.     end        
  111.     draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
  112.       mp_color(actor), normal_color)
  113.   end
  114.   def draw_actor_param(actor, x, y, param_id)
  115.     change_color(system_color)
  116.     draw_text(x, y, 120, line_height, Vocab::param(param_id))
  117.     change_color(normal_color)
  118.     if YAMI_NEED2HIDE.include?(actor.actor.id)
  119.       draw_text(x + 120 + 36 - text_size(YAMI_REPLACE_TEXT).width * 2, y, text_size(YAMI_REPLACE_TEXT).width * 2, line_height, YAMI_REPLACE_TEXT, 2)
  120.       return
  121.     end
  122.     draw_text(x + 120, y, 36, line_height, actor.param(param_id), 2)
  123.   end
  124. end
  125. class Window_EquipStatus
  126.   def draw_current_param(x, y, param_id)
  127.     change_color(normal_color)
  128.     if YAMI_NEED2HIDE.include?(@actor.actor.id)
  129.       draw_text(x + 32 - text_size(YAMI_REPLACE_TEXT).width * 2, y, text_size(YAMI_REPLACE_TEXT).width * 2, line_height, YAMI_REPLACE_TEXT, 2)
  130.       return
  131.     end
  132.     draw_text(x, y, 32, line_height, @actor.param(param_id), 2)
  133.   end
  134.   def draw_new_param(x, y, param_id)
  135.     new_value = @temp_actor.param(param_id)
  136.     change_color(param_change_color(new_value - @actor.param(param_id)))
  137.     if YAMI_NEED2HIDE.include?(@actor.actor.id)
  138.       draw_text(x + 32 - text_size(YAMI_REPLACE_TEXT).width * 2, y, text_size(YAMI_REPLACE_TEXT).width * 2, line_height, YAMI_REPLACE_TEXT, 2)
  139.       return
  140.     end   
  141.     draw_text(x, y, 32, line_height, new_value, 2)
  142.   end
  143. end
  144. class Spriteset_BattleStatus
  145.   def create_number(num, max, format)
  146.     return nil unless format[:enabled]
  147.     if @battler.is_a?(Game_Actor) and YAMI_NEED2HIDE.include?(@battler.actor.id) and format != TP_NUMBER_FORMAT
  148.     sprite = Sprite_Hide.new(format, @viewport)
  149.     else
  150.     sprite = Sprite_Number.new(num, max, format, @viewport)
  151.     end
  152.     move(sprite, format)
  153.     return sprite
  154.   end
  155. end
  156. class Sprite_Hide < Sprite_Number
  157.   def initialize(format, viewport = nil)
  158.     super(9999,9999,format,viewport)
  159.     @src_bitmap = Cache.system(YAMI_REPLACE_TEXT_PIC)
  160.     self.bitmap = @src_bitmap
  161.   end  
  162.   def update
  163.   end
  164. end
复制代码

点评

是嘛...我一般都不按规范写,应该不会撞namespace...  发表于 2021-8-14 21:44
其实外站也有位yami,,,所以会不会撞名,,,  发表于 2021-8-14 15:59
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
272
在线时间
60 小时
注册时间
2014-2-9
帖子
14
3
 楼主| 发表于 2021-8-14 04:53:55 | 只看该作者
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-29 10:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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