# # 特定のステート名を非表示化 #  (C)2006 TYPE74RX-T # # アクター側の[正常] 表示が必要かどうか (true:表示 false:非表示) module RX_T_State NEED_NORMAL = true end class Window_Base < Window #-------------------------------------------------------------------------- # ● 描画用のステート文字列作成 # actor : アクター # width : 描画先の幅 # need_normal : [正常] が必要かどうか (true / false) #-------------------------------------------------------------------------- def make_battler_state_text(battler, width, need_normal) # 括弧の幅を取得 brackets_width = self.contents.text_size("[]").width # ステート名の文字列を作成 text = "" for i in battler.states if $data_states[i].rating >= 1 state_name = "" unseen_status = false unseen_status = $data_states[i].guard_element_set.include?($data_system.elements.index("非表示ステート")) unless unseen_status state_name = $data_states[i].name end if text == "" text = state_name else if state_name == "" new_text = text + state_name else new_text = text + "/" + state_name end 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 # 完成した文字列を返す return text end #-------------------------------------------------------------------------- # ● ステートの描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 描画先の幅 #-------------------------------------------------------------------------- def draw_actor_state(actor, x, y, width = 120) text = make_battler_state_text(actor, width, RX_T_State::NEED_NORMAL) self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color self.contents.draw_text(x, y, width, 32, text) end end