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

Project1

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

[已经解决] 关于多重状态的问题。。。

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1238
在线时间
354 小时
注册时间
2009-9-14
帖子
328
跳转到指定楼层
1
发表于 2018-4-21 17:19:23 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
25星屑
我用状态的方法来制作技能冷却,,为了便于与空的状态分辨,我把技能冷却的状态都起名为“-”
然后,,,我用了这个多重状态的脚本,
如何能让状态名为“-”的状态不显示名字?

比如这个,如何能把状态栏里那个“-”的状态的名字给去掉,但是不影响实际的状态?
以下是我那个多重状态的脚本
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #==============================================================================
  5. # 多重状态     Ver. 1.1                 by Claimh
  6. #------------------------------------------------------------------------------
  7. # [url]http://www.k3.dion.ne.jp/~claimh/[/url]
  8. #==============================================================================
  9. class Window_Base < Window
  10.   #--------------------------------------------------------------------------
  11.   #  生成状态文字
  12.   #--------------------------------------------------------------------------
  13.   def make_battler_state_text_over3(battler, width, need_normal)
  14.     brackets_width = self.contents.text_size("[]").width
  15.     text = ""
  16.     text0 = ""
  17.     ret_text = ["",""]
  18.     for i in battler.states
  19.       if $data_states[i].rating >= 1
  20.         if text == ""
  21.           text = $data_states[i].name
  22.         else
  23.           new_text = text + " " + $data_states[i].name
  24.           text_width = self.contents.text_size(new_text).width
  25.           if text_width > width - brackets_width
  26.             text0 = new_text  
  27.             text = ""
  28.             new_text = ""
  29.             text_width = 0
  30.           else
  31.             text = new_text  
  32.           end
  33.         end
  34.       end
  35.     end
  36.     if text == "" and text0 == ""
  37.       ret_text = [" ", ""]
  38.     elsif text0 == ""
  39.       ret_text[0] = "[" + text + "]"
  40.       ret_text[1] = ""
  41.     else
  42.       ret_text[0] = "[" + text0 + "]"
  43.       if text != ""
  44.         ret_text[1] = "[" + text + "]"
  45.       else
  46.         ret_text[1] = ""
  47.       end
  48.     end
  49.     return ret_text
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # 描绘角色状态
  53.   #--------------------------------------------------------------------------
  54.   def draw_actor_state(actor, x, y, width = 120)
  55.     text = make_battler_state_text_over3(actor, width, true)
  56.     self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
  57.     if text[1] == ""
  58.       self.contents.draw_text(x-5, y, width+5, 32, text[0])
  59.     else
  60.       self.contents.font.size = 20
  61.       self.contents.draw_text(x-5, y - 15 , width+5, 32, text[0])
  62.       self.contents.draw_text(x-5, y + 8, width+5, 32, text[1])
  63.     end
  64.   end
  65. end
  66. #==============================================================================
  67. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  68. #==============================================================================

最佳答案

查看完整内容

悄悄的说, 其实你只要把状态的rating,也就是定量 设置为0 ,那它就不会显示了...... 鼠标点定量的格子, 按F1有惊喜

Lv5.捕梦者

梦石
0
星屑
37759
在线时间
5385 小时
注册时间
2006-11-10
帖子
6545
2
发表于 2018-4-21 17:19:24 | 只看该作者
本帖最后由 灯笼菜刀王 于 2018-4-21 18:35 编辑

悄悄的说,

其实你只要把状态的rating,也就是定量 设置为0 ,那它就不会显示了......

鼠标点定量的格子, 按F1有惊喜

评分

参与人数 1+1 收起 理由
CR~ + 1 靠。。。。。。

查看全部评分

回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
12157
在线时间
4435 小时
注册时间
2014-4-11
帖子
5955

开拓者

3
发表于 2018-4-21 18:02:46 | 只看该作者
本帖最后由 yang1zhi 于 2018-4-21 18:09 编辑

text = $data_states.name
修改为
if  $data_states.name == "-"
text = ""
else
text = $data_states.name
end

修改为
if $data_states.name == "-"
new_text = text + " "
else
new_text = text + " " + $data_states.name
end
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7417
在线时间
947 小时
注册时间
2017-9-27
帖子
583
4
发表于 2018-4-22 10:17:21 | 只看该作者
可以设置不显示状态图标呀,内置的功能。
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 08:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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