# ▼▲▼ XSEベース ▼▲▼ # # update 2007/ 7/22 # #============================================================================== # カスタマイズポイント #============================================================================== module XSE # # [設定] # # メニューへの戻りインデックス MENU_INDEX = 2 # APの表面上の名称 AP_S = "AP" # [ファイル名] (windowskinフォルダ) NumberS = "NumberS" NumberL = "NumberL" NameLine = "XSE_NameLine" APLine = "XSE_APLine" # ネームプレートの名前描画位置 NP_Y = 36 end #============================================================================== # スキルデータコンバート:AP設定 #============================================================================== module RPG class Skill def ap @eva_f end def eva_f 0 end end end #============================================================================== # AP機構 #============================================================================== module AP_Base attr_accessor :ap attr_accessor :ap_used def ap @ap = 0 if @ap == nil return @ap end def ap_used @ap_used = 0 if @ap_used == nil return @ap_used end def ap_now return self.ap - self.ap_used end end class Game_Actor < Game_Battler include AP_Base end #============================================================================== # 顔グラ土台 #============================================================================== class Game_Battler def face_name return "" end end #============================================================================== # 顔スプライト #============================================================================== class FaceSprite < Sprite def initialize(actor) super() face_name = actor.face_name return if face_name == "" face = RPG::Cache.windowskin(face_name) self.bitmap = Bitmap.new(96,96) self.bitmap.stretch_blt(self.bitmap.rect, face, face.rect) self.x = 0 self.y = 0 self.z = 19 end end #============================================================================== # ネームプレート #============================================================================== class NamePlate < Sprite #-------------------------------------------------------------------------- # オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(actor) @actor = actor super() # フレーム line = RPG::Cache.windowskin(XSE::NameLine) self.bitmap = Bitmap.new([line.width, 192].max, line.height) self.bitmap.blt(0,0,line,line.rect) # アクターの名前 self.bitmap.font.size = 20 self.bitmap.draw_shadow_text(0, XSE::NP_Y, 188, 20, @actor.name,2) # 位置 self.x = 0 self.y = 38 self.z = 21 end end #============================================================================== # Window_XSEInfo #============================================================================== class Window_XSEInfo < Window_Base #-------------------------------------------------------------------------- # 初期化 #-------------------------------------------------------------------------- def initialize(actor) super(-16, 284, 192, 64) self.contents = Bitmap.new(160, 32) self.z = 21 self.opacity = 0 @actor = actor refresh end #-------------------------------------------------------------------------- # リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.size = 18 # line = RPG::Cache.windowskin(XSE::APLine) self.contents.blt(0,0, line, line.rect) # 現在AP skin_l = RPG::Cache.windowskin(XSE::NumberL) self.contents.font.color = system_color self.contents.draw_shadow_text( 2, 8, 64,24, XSE::AP_S, 2) self.contents.blt_number(120,28, skin_l, @actor.ap_now) end end #============================================================================== # 背景 #============================================================================== class MenuBG < Sprite def initialize super() self.bitmap = RPG::Cache.windowskin(XSE::BG) self.z = 1 self.opacity = XSE::BG_OPACITY end end #============================================================================== # フィットウィンドウ機構 #============================================================================== module XRXS_FitWindow def initialize(x,y,w,h) @base = Window_Base.new(x+14,y+14,w-28,h-28) @base.opacity = XSE::OPACITY super self.opacity = 0 end def x=(n) @base.x = n + 14 super end def y=(n) @base.y = n + 14 super end def z=(n) @base.z = n - 1 super end def visible=(b) @base.visible = b super end def dispose @base.dispose super end end #============================================================================== # Window_Help2 #============================================================================== class Window_Help2 < Window_Base include XRXS_FitWindow #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(-32, 0, 704, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = 18 self.z = 51 end #-------------------------------------------------------------------------- # ● テキスト設定 #-------------------------------------------------------------------------- def set_text(text, align = 0) # テキストとアラインメントの少なくとも一方が前回と違っている場合 if text != @text or align != @align # テキストを再描画 self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4+48, 0, self.width - 96, 32, text, align) @text = text @align = align @actor = nil end self.visible = true end end #============================================================================== # □ Bitmapライブラリ --- blt_number --- □ #============================================================================== class Bitmap def blt_number(x, y, skin, number, opacity = 224) a_width = skin.rect.width / 10 rect = Rect.new(0, 0, a_width, skin.rect.height) # numbers = [ number/10000000%10,number/1000000%10,number/100000%10,number/10000%10, number/1000%10, number/100%10, number/10%10, number%10 ] display = false for i in 0...numbers.size n = numbers[i] display |= (n != 0 or i == numbers.size - 1) if display rect.x = n * a_width self.blt(x - (8-i) * a_width, y - skin.rect.height, skin, rect, opacity) end #x += a_width end end end #============================================================================== # 影文字 #============================================================================== class Bitmap def draw_shadow_text(x,y,w,h,text,align=0) save = self.font.color.dup self.font.color = Color.new(0,0,0,160) draw_text(x+1,y+1,w,h,text,align) self.font.color = save draw_text(x,y,w,h,text,align) end end