# ▽△▽ XRXSv9. BaST-VX.BS1. 縦型バトルステータス ▽△▽ # # publish 2010/ 3/ 5 # update - 4/21b # #============================================================================== # カスタマイズコマンド #============================================================================== module XRXSV9 # # 上に表示する? # BSonHead = false # # 表示 # BSFACEOY = 12 # 顔グラフィックカットY位置 BSOPACITY = 160 # 顔グラフィック不透明度 BSMAXWIDTH = 128 # 人数が少ない時の一人分の最大横幅 end #============================================================================== # 上に表示する場合の定義 #============================================================================== if XRXSV9::BSonHead class Game_Battler def battlestatus_y return 128 end def battlestatus_cp_y return 128 end end class Game_Actor < Game_Battler def battlestatus_offset return 0 end end class Scene_Battle < Scene_Base def battlestatus_offset return 0 end end class Window_BattleStatus < Window_Selectable def initialize super(0, 0, 416, 128) refresh self.active = false end end end #============================================================================== # バトルメッセージデザイン #============================================================================== class Window_BattleStatus < Window_Selectable #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear @spacing = 1 @item_max = $game_party.members.size @column_max = @item_max for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) self.contents.font.color = normal_color actor = $game_party.members[index] x = actor.battlestatus_x x -= (rect.width / 2) + 2 drawable_width = rect.width - 4 draw_actor_halfface(actor , x, 0, drawable_width) draw_actor_name(actor, x, 0) draw_actor_state(actor, x, 22, drawable_width) draw_actor_hp(actor, x, 44, drawable_width) draw_actor_mp(actor, x, 68, drawable_width) end #-------------------------------------------------------------------------- # ● カーソルの更新 #-------------------------------------------------------------------------- def update_cursor if @index < 0 self.cursor_rect.empty else self.cursor_rect = item_rect(@index) end end #-------------------------------------------------------------------------- # アクターの半顔グラフィックの描画 #-------------------------------------------------------------------------- def draw_actor_halfface(actor, x, y, drawable_width) n = (drawable_width - 96) / 2 x += n if n > 0 face_space = [drawable_width, 96].min face_ox = (96 - face_space) / 2 bitmap = Cache.face(actor.face_name) rect = Rect.new(0, 0, face_space, 44) rect.x = actor.face_index % 4 * 96 + face_ox rect.y = actor.face_index / 4 * 96 + XRXSV9::BSFACEOY self.contents.blt(x, y, bitmap, rect, XRXSV9::BSOPACITY) bitmap.dispose end #-------------------------------------------------------------------------- # ● 項目を描画する矩形の取得 #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = [item_width, XRXSV9::BSMAXWIDTH].min rect.height = self.contents.height rect.x = index % @column_max * (item_width + @spacing) + (item_width - rect.width) / 2 rect.y = index / @column_max * rect.height return rect end #-------------------------------------------------------------------------- # 1項目の横幅 #-------------------------------------------------------------------------- def item_width return (self.contents.width + @spacing) / @column_max - @spacing end end