#============================================================================== # ■ 多重ステート表示 Ver. 1.3.0 by Claimh #------------------------------------------------------------------------------ # ・多重にステートがかかっている状態の表示拡張 #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ● 描画用のステート文字列作成 [再定義] # actor : アクター # width : 描画先の幅 # need_normal : [正常] が必要かどうか (true / false) #-------------------------------------------------------------------------- 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[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 text0 = new_text #ステート群0 text = "" new_text = "" text_width = 0 else text = new_text #ステート群1 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 #-------------------------------------------------------------------------- # ● ステートの描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 描画先の幅 #-------------------------------------------------------------------------- alias draw_actor_state_menu draw_actor_state def draw_actor_state(actor, x, y, width = 120) # メニュー時のみ通常表示 if !$scene.is_a?(Scene_Battle) draw_actor_state_menu(actor, x, y, width) return end 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.font.size = 32 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]) self.contents.font.size = Font.default_size self.contents.font.size = 32 end end end