查看: 3536|回复: 3

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

[复制链接]
梦石
0
星屑
1328
在线时间
354 小时
注册时间
2009-9-14
回帖
211
发表于 2018-4-21 17:19:23 | 显示全部楼层 |阅读模式
悬赏25星屑已解决
我用状态的方法来制作技能冷却,,为了便于与空的状态分辨,我把技能冷却的状态都起名为“-”
然后,,,我用了这个多重状态的脚本,
如何能让状态名为“-”的状态不显示名字?
12321312.png
比如这个,如何能把状态栏里那个“-”的状态的名字给去掉,但是不影响实际的状态?
以下是我那个多重状态的脚本
[pre lang="ruby"]#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 多重状态     Ver. 1.1                 by Claimh
#------------------------------------------------------------------------------
# http://www.k3.dion.ne.jp/~claimh/
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  #  生成状态文字
  #--------------------------------------------------------------------------
  def make_battler_state_text_over3(battler, width, need_normal)
    brackets_width = self.contents.text_size("[]").width
    text = ""
    text0 = ""
    ret_text = ["",""]
    for i in battler.states
      if $data_states.rating >= 1
        if text == ""
          text = $data_states.name
        else
          new_text = text + " " + $data_states.name
          text_width = self.contents.text_size(new_text).width
          if text_width > width - brackets_width
            text0 = new_text  
            text = ""
            new_text = ""
            text_width = 0
          else
            text = new_text  
          end
        end
      end
    end
    if text == "" and text0 == ""
      ret_text = [" ", ""]
    elsif text0 == ""
      ret_text[0] = "[" + text + "]"
      ret_text[1] = ""
    else
      ret_text[0] = "[" + text0 + "]"
      if text != ""
        ret_text[1] = "[" + text + "]"
      else
        ret_text[1] = ""
      end
    end
    return ret_text
  end
  #--------------------------------------------------------------------------
  # 描绘角色状态
  #--------------------------------------------------------------------------
  def draw_actor_state(actor, x, y, width = 120)
    text = make_battler_state_text_over3(actor, width, true)
    self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
    if text[1] == ""
      self.contents.draw_text(x-5, y, width+5, 32, text[0])
    else
      self.contents.font.size = 20
      self.contents.draw_text(x-5, y - 15 , width+5, 32, text[0])
      self.contents.draw_text(x-5, y + 8, width+5, 32, text[1])
    end
  end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#============================================================================== [/pre]

最佳答案

查看完整内容

悄悄的说, 其实你只要把状态的rating,也就是定量 设置为0 ,那它就不会显示了...... 鼠标点定量的格子, 按F1有惊喜
梦石
0
星屑
42235
在线时间
6017 小时
注册时间
2006-11-10
回帖
6966
发表于 2018-4-21 17:19:24 | 显示全部楼层
本帖最后由 灯笼菜刀王 于 2018-4-21 18:35 编辑

悄悄的说,

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

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

评分

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

查看全部评分

回复

使用道具 举报

梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

发表于 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
回复

使用道具 举报

梦石
0
星屑
7427
在线时间
948 小时
注册时间
2017-9-27
回帖
566
发表于 2018-4-22 10:17:21 | 显示全部楼层
可以设置不显示状态图标呀,内置的功能。
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部