赞 | 669 |
VIP | 62 |
好人卡 | 144 |
积分 | 334 |
经验 | 110435 |
最后登录 | 2024-11-1 |
在线时间 | 5108 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 33442
- 在线时间
- 5108 小时
- 注册时间
- 2012-11-19
- 帖子
- 4878
|
初制品。由于要显示的状态文字较多,缩小了字体大小。- #==============================================================================
- class Game_Battler
- attr_accessor :states_turn
- end
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- def make_battler_state_text(battler, width, need_normal)
- brackets_width = self.contents.text_size("[]").width
- if battler.is_a?(Game_Actor)
- text = []
- txt = ""
- if battler.states != []
- txt_1 = "回合后,"
- txt_2 = "% 几率解除。"
- for i in battler.states_turn.keys.clone
- if $data_states[i].rating >= 1
- txt = $data_states[i].name
- txt = "[" + txt + "] " + battler.states_turn[i].to_s + txt_1
- txt = txt + $data_states[i].auto_release_prob.to_s + txt_2
- text.push(txt)
- end
- end
- end
- if text == []
- if need_normal
- text.push("[正常]")
- end
- end
- else
- text = ""
- for i in battler.states
- if $data_states[i].rating >= 1
- if text == ""
- text = $data_states[i].name
- else
- new_text = text + "/" + $data_states[i].name
- text_width = self.contents.text_size(new_text).width
- if text_width > width - brackets_width
- break
- end
- text = new_text
- end
- end
- end
- # 状态名空的字符串是 "[正常]" 的情况下
- if text == ""
- if need_normal
- text = "[正常]"
- end
- else
- # 加上括号
- text = "[" + text + "]"
- end
- end
- return text
- end
- #--------------------------------------------------------------------------
- def draw_actor_state(actor, x, y, width = 120)
- text = make_battler_state_text(actor, width, true)
- self.contents.font.size = 16
- self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
- for i in 0...text.size
- txt = text[i]
- y = i * 24 + y
- self.contents.draw_text(x, y, width, 32, txt)
- end
- self.contents.font.size = 22
- end
- end
复制代码
|
评分
-
查看全部评分
|