..:: Ring Menu - Show Player Position - R1::..

Thảo luận trong 'Game Development' bắt đầu bởi omegawhile, 7/12/04.

  1. omegawhile

    omegawhile Youtube Master Race

    Tham gia ngày:
    25/11/04
    Bài viết:
    17
    Show Location Edit by : Dubealex
    Original by: ?? (From XRXS)
    Original Edited By: MakirouAru

    [​IMG]

    Make an new Script before Main and name it Ring_Menu, then, put this in it.

    Ring_Menu code:


     
  2. omegawhile

    omegawhile Youtube Master Race

    Tham gia ngày:
    25/11/04
    Bài viết:
    17
    The script will folllow those screenshots.
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    I edited this script to add more features in it.

    List of new features I added:

    Show Monster Name
    Use HTML Hexadecimal Code in Color Change Command \c
    Show Map Name
    Show Item Price
    Change Font from inside the message box
    Show Hero's Class Name

    List of original features (Still in it of course !) :

    Use a letter by letter text dialog, as in RM2K
    Able to set the letter by letter ON and OFF
    Show a picture in a dialog (Used as a face graphic, but can be anything.)
    Show Window on top of a specific event
    Show Window on top of the player
    Make a window with no borders and no background
    Show Variable Value
    Show Items Names
    Show Weapons Name
    Show Armors Name
    Show Skills Name
    Change text color
    Change text speed
    Change text size
    Add wait in a message dialog
    Wait for action (confirm) key to continue message
    Auto-Close message box
    Show the gold window on screen
    Show Heros Name
    Can play an audio SE file for each letter printed (As in Shining Force)
    Show a name window to show text and save space in your message box
    Line indentation
    Subscript
    Change text opacity
    Show an image in the dialog box (Anywhere in it)

    I will show you the script, then I will list all the commands you can use in your message dialog and some customization notes:

    Script Installation:



    You have to create a new class named Advanced_Message just above MAIN and paste that code in it:

    Advanced_Message code:

    # ▼▲▼ XRXS 9. メッセージ表示フルグレードアップ ver..12d ▼▲▼
    # Original Script by 桜雅 在土, 和希, RaTTiE
    # Script from: http://f26.aaacafe.ne.jp/~xxms/RPGXP_XRXS9.htm
    #
    #Advanced Version by: dubealex
    #
    #To found all my NEW features, press CONTROL+F and search for the word "#NEW"
    #To found the code where the "Skip Letter By Letter mode", search for "# SKIP"
    #
    # You can found all the command list on my website
    # rmxp.dubealex.com
    # Go in the "Script" section.


    #==============================================================================
    # ■ Window_Message
    #==============================================================================
    class Window_Message < Window_Selectable
    # 一文字ずつ描写
    DEFAULT_TYPING_ENABLE = true # falseにすると瞬間表示
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化
    #--------------------------------------------------------------------------
    alias xrxs9_initialize initialize
    def initialize

    $fontface = $defaultfonttype
    $fontsize = $defaultfontsize

    # IF for any reasons the FONT doesn't appears in your game, this is
    # because you are using a different version of RMXP. Look in the class MAIN
    # (under this one)
    # Go at line #10 and #12, and just copy the word that begins with a $ sign
    # and replace what is after the equal sign on lign #27 and 28 of this class.

    xrxs9_initialize
    # 再生サウンド名がない場合は""とする
    if $soundname_on_speak == nil then
    $soundname_on_speak = ""
    end
    # 外字ファイルパス設定
    $gaiji_file = "./Graphics/Gaiji/sample.png"
    # 外字データ読み込み
    if FileTest.exist?($gaiji_file)
    @gaiji_cache = Bitmap.new($gaiji_file)
    else
    @gaigi_cache = nil
    end
    # 文字透過転送用バッファ
    @opacity_text_buf = Bitmap.new(32, 32)
    end
    #--------------------------------------------------------------------------
    # ● メッセージ終了処理
    #--------------------------------------------------------------------------
    alias xrxs9_terminate_message terminate_message
    def terminate_message
    if @name_window_frame != nil
    @name_window_frame.dispose
    @name_window_frame = nil
    end
    if @name_window_text != nil
    @name_window_text.dispose
    @name_window_text = nil
    end
    xrxs9_terminate_message
    end
    #--------------------------------------------------------------------------
    # ● リフレッシュ
    #--------------------------------------------------------------------------
    def refresh
    # 初期化
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.name = $fontface
    @x = @y = @max_x = @max_y = @indent = @lines = 0
    @face_indent = 0
    @opacity = 255
    @cursor_width = 0
    @write_speed = 0
    @write_wait = 0
    @mid_stop = false
    @face_file = nil
    # @popchar が -2 の場合、標準位置。-1の場合、文字センター。
    # 0以上の場合 キャラポップ。0は主人公、1以降はイベント。
    @popchar = -2
    # 選択肢なら字下げを行う
    if $game_temp.choice_start == 0
    @x = 8
    end
    # 表示待ちのメッセージが・る場合
    if $game_temp.message_text != nil
    @now_text = $game_temp.message_text
    # 顔表示指定\Fが・るか?
    if (/\A\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
    # ファイルチェック
    if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
    # 顔グラを描画
    @face_file = $1 + ".png"
    self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
    # 全行 128ピクセルのインデントを入れる。
    @x = @face_indent = 128
    end
    @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
    end
    # 制御文字処理
    begin
    last_text = @now_text.clone
    # \Vを独自ルーチンに変更(追加部分)
    @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
    end until @now_text == last_text
    @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
    $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
    end

    #NEW
    #Dubealex Show Monster Name Feature
    @now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) do
    $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : ""
    end
    #End new command

    #NEW
    #Dubealex Show Item Price Feature
    @now_text.gsub!(/\\[Pp]rice\[([0-9]+)\]/) do
    $data_items[$1.to_i] != nil ? $data_items[$1.to_i].price : ""
    end
    #End new command

    #NEW
    #Dubealex Show Hero Class Name Feature
    @now_text.gsub!(/\\[Cc]lass\[([0-9]+)\]/) do
    $data_classes[$data_actors[$1.to_i].class_id] != nil ? $data_classes[$data_actors[$1.to_i].class_id].name : ""
    end
    #End new command

    #NEW
    #Dubealex Show Current Map Name Feature
    @now_text.gsub!(/\\[Mm]ap/) do
    $game_map.name != nil ? $game_map.name : ""
    end
    #End new command

    # \nameが・るか?
    name_window_set = false
    if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
    # 値を設定
    name_window_set = true
    name_text = $1
    # \name[]部分を削除
    @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
    end
    # ウィンドウ位置判定
    if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
    @popchar = $1.to_i
    if @popchar == -1
    @x = @indent = 48
    @y = 4
    end
    @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
    end
    # ウィンドウ幅の取得
    @max_choice_x = 0
    if @popchar >= 0
    @text_save = @now_text.clone
    @max_x = 0
    @max_y = 4
    for i in 0..3
    line = @now_text.split(/\n/)[3-i]
    @max_y -= 1 if line == nil and @max_y <= 4-i
    next if line == nil
    line.gsub!(/\\\w\[(\w+)\]/) { "" }
    cx = contents.text_size(line).width
    @max_x = cx if cx > @max_x
    if i >= $game_temp.choice_start
    @max_choice_x = cx if cx > @max_choice_x
    end
    end
    self.width = @max_x + 32 + @face_indent
    self.height = (@max_y - 1) * 32 + 64
    @max_choice_x -= 68
    @max_choice_x -= @face_indent*216/128
    else
    @max_x = self.width - 32 - @face_indent
    for i in 0..3
    line = @now_text.split(/\n/)
    next if line == nil
    line.gsub!(/\\\w\[(\w+)\]/) { "" }
    cx = contents.text_size(line).width
    if i >= $game_temp.choice_start
    @max_choice_x = cx if cx > @max_choice_x
    end
    end
    @max_choice_x += 8
    end
    # 選択肢ならカーソルの幅を更新
    @cursor_width = 0
    #if @lines >= $game_temp.choice_start
    # @cursor_width = [@cursor_width, @max_choice_x - @face_indent].max
    #end
    # 便宜上、"\\\\" を "\000" に変換
    @now_text.gsub!(/\\\\/) { "\000" }
    # "\\C" を "\001" に、"\\G" を "\002" に、
    # "\\S" を "\003" に、"\\A" を "\004" に変換
    @now_text.gsub!(/\\[Cc]\[([0123456789ABCDEF#]+)\]/) { "\001[#{$1}]" }
    @now_text.gsub!(/\\[Gg]/) { "\002" }
    @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
    @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }

    #NEW
    #Dubealex Font Change Features
    @now_text.gsub!(/\\[Tt]\[(.*?)\]/) { "\050[#{$1}]" }
    #End of dubealex feature

    @now_text.gsub!(/\\[.]/) { "\005" }
    @now_text.gsub!(/\\[|]/) { "\006" }
    # 競合すると何かと気まずいので、\016以降を使用する
    @now_text.gsub!(/\\[>]/) { "\016" }
    @now_text.gsub!(/\\[<]/) { "\017" }
    @now_text.gsub!(/\\[!]/) { "\020" }
    @now_text.gsub!(/\\[~]/) { "\021" }
    @now_text.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" }
    # インデント設定(追加部分)
    @now_text.gsub!(/\\[Ii]/) { "\023" }
    # テキスト透過率指定(追加部分)
    @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
    # テキストサイズ指定(追加部分)
    @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
    # 空白挿入(追加部分)
    @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
    # ルビ表示(追加部分)
    @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "\027[#{$1}]" }
    # ここで一旦ウィンドウ位置更新
    reset_window
    # \nameが・るか?
    if name_window_set
    # オフセット位置
    off_x = 0
    off_y = -10
    # 枠だけウィンドウの作成(余白を 2 に設定)
    space = 2
    x = self.x + off_x - space / 2
    y = self.y + off_y - space / 2
    w = self.contents.text_size(name_text).width + 8 + space
    h = 26 + space
    @name_window_frame = Window_Frame.new(x, y, w, h)
    @name_window_frame.z = self.z + 1
    # 擬似的な空中文字描写ウィンドウを作成
    x = self.x + off_x + 4
    y = self.y + off_y
    @name_window_text = Air_Text.new(x, y, name_text)
    @name_window_text.z = self.z + 2
    end
    end
    # ウィンドウを更新
    reset_window
    # 選択肢の場合
    if $game_temp.choice_max > 0
    @item_max = $game_temp.choice_max
    self.active = true
    self.index = 0
    end
    # 数値入力の場合
    if $game_temp.num_input_variable_id > 0
    digits_max = $game_temp.num_input_digits_max
    number = $game_variables[$game_temp.num_input_variable_id]
    @input_number_window = Window_InputNumber.new(digits_max)
    @input_number_window.number = number
    @input_number_window.x = self.x + 8
    @input_number_window.y = self.y + $game_temp.num_input_start * 32
    end
    end
    #--------------------------------------------------------------------------
    # ● フレーム更新
    #--------------------------------------------------------------------------
    def update
    super
    # フェードインの場合
    if @fade_in
    self.contents_opacity += 24
    if @input_number_window != nil
    @input_number_window.contents_opacity += 24
    end
    if self.contents_opacity == 255
    @fade_in = false
    end
    return
    end
    @now_text = nil if @now_text == "" # 変換
    # 表示待ちのメッセージが・る場合
    if @now_text != nil and @mid_stop == false
    if @write_wait > 0
    @write_wait -= 1
    return
    end
    text_not_skip = DEFAULT_TYPING_ENABLE
    while true
    # 最大 x y の保存。
    @max_x = @x if @max_x < @x
    @max_y = @y if @max_y < @y
    # c に 1 文字を取得 (文字が取得できなくなるまでループ)
    if (c = @now_text.slice!(/./m)) != nil
    # \\ の場合
    if c == "\000"
    # 本来の文字に戻す
    c = "\\"
    end
    # \C[n] の場合

    if c == "\001"
    @now_text.sub!(/\[([0123456789ABCDEF#]+)\]/, "")
    temp_color = $1
    color = temp_color.to_i
    leading_x = temp_color.to_s.slice!(/./m)
    if leading_x == "#"
    self.contents.font.color = hex_color(temp_color)
    next
    end
    if color >= 0 and color <= 7
    self.contents.font.color = text_color(color)
    end
    next
    end

    # \G の場合
    if c == "\002"
    # ゴールドウィンドウを作成
    if @gold_window == nil and @popchar <= 0
    @gold_window = Window_Gold.new
    @gold_window.x = 560 - @gold_window.width
    if $game_temp.in_battle
    @gold_window.y = 192
    else
    @gold_window.y = self.y >= 128 ? 32 : 384
    end
    @gold_window.opacity = self.opacity
    @gold_window.back_opacity = self.back_opacity
    end
    # 次の文字へ
    c = ""
    end
    # \S[n] の場合
    if c == "\003"
    # 文字色を変更
    @now_text.sub!(/\[([0-9]+)\]/, "")
    speed = $1.to_i
    if speed >= 0 and speed <= 19
    @write_speed = speed
    end
    # 次の文字へ
    c = ""
    end
    # \A[soundname] の場合
    if c == "\004"
    # 再生ファイルを変更するための準備
    @now_text.sub!(/\[(.*?)\]/, "")
    buftxt = $1.dup.to_s
    # 再生ファイル名に"/"が・るか?
    if buftxt.match(/\//) == nil and buftxt != "" then
    # なければ"Audio/SE/"を結合する
    $soundname_on_speak = "Audio/SE/" + buftxt
    else
    # ・ればそのままコピー
    $soundname_on_speak = buftxt.dup
    end
    # 次の文字へ
    c = ""
    elsif c == "\004"
    # 次の文字へ
    c = ""
    end
    # \. の場合
    if c == "\005"
    @write_wait += 5
    c = ""
    end
    # \| の場合
    if c == "\006"
    @write_wait += 20
    c = ""
    end
    # \> の場合
    if c == "\016"
    text_not_skip = false
    c = ""
    end
    # \<の場合
    if c == "\017"
    text_not_skip = true
    c = ""
    end
    # \!の場合
    if c == "\020"
    @mid_stop = true
    c = ""
    end
    # \~の場合
    if c == "\021"
    terminate_message
    return
    end
    # \Iの場合(追加部分)
    if c == "\023"
    # 今の@xをインデント位置に設定
    @indent = @x
    c = ""
    end
    # \Oの場合(追加部分)
    if c == "\024"
    @now_text.sub!(/\[([0-9]+)\]/, "")
    @opacity = $1.to_i
    color = self.contents.font.color
    self.contents.font.name = $fontface
    self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255)
    c = ""
    end
    # \Hの場合(追加部分)
    if c == "\025"
    @now_text.sub!(/\[([0-9]+)\]/, "")
    self.contents.font.size = [[$1.to_i, 6].max, 32].min
    c = ""
    end
    # \Bの場合(追加部分)
    if c == "\026"
    @now_text.sub!(/\[([0-9]+)\]/, "")
    @x += $1.to_i
    c = ""
    end

    #NEW
    #Dubealex Font Change Command
    if c == "\050"
    @now_text.sub!(/\[(.*?)\]/, "")
    buftxt = $1.dup.to_s
    if buftxt.match(/\//) == nil and buftxt != "" then
    self.contents.font.name = buftxt
    end
    c = ""
    end
    #end of font change command

    # \Rの場合(追加部分)
    if c == "\027"
    @now_text.sub!(/\[(.*?)\]/, "")
    # 文字を描画
    @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
    # 文字描写のSEを演奏
    if $soundname_on_speak != ""
    Audio.se_play($soundname_on_speak)
    end
    c = ""
    end
    # アイコン描画用シーケンスの場合(追加部分)
    if c == "\030"
    # アイコンファイル名を取得
    @now_text.sub!(/\[(.*?)\]/, "")
    # アイコンを描画
    self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
    # 文字描写のSEを演奏
    if $soundname_on_speak != ""
    Audio.se_play($soundname_on_speak)
    end
    @x += 24
    # 次の文字へ
    c = ""
    end
    # 改行文字の場合
    if c == "\n"
    # y に 1 を加算
    @lines += 1
    @y += 1
    @x = 0 + @indent + @face_indent
    # 選択肢なら字下げを行う
    if @lines >= $game_temp.choice_start
    @x = 8 + @indent + @face_indent
    # カーソルの更新
    @cursor_width = @max_choice_x
    end
    # 次の文字へ
    c = ""
    end
    # 外字表示の場合
    if c == "\022"
    # []部分の除去
    @now_text.sub!(/\[([0-9]+)\]/, "")
    # 外字を表示
    @x += gaiji_draw(4 + @x, @y * line_height + (line_height - self.contents.font.size), $1.to_i)
    # 次の文字へ
    c = ""
    end
    if c != ""
    # 文字を描画
    self.contents.draw_text(0+@x, 32 * @y, 40, 32, c)
    @x += self.contents.text_size(c).width
    # 文字描写のSEを演奏
    if $soundname_on_speak != "" then
    Audio.se_play($soundname_on_speak)
    end
    end
    # Bボタンが押された場合

    # SKIP
    # This allow you to SKIP the letter by letter using a button
    # At your own choice
    # Here's how to customize it:
    # Replace the letter in the end of the line "if Input.trigger?(Input::C)"
    # That is on line #512
    # By the letter of your choice:
    #
    # B = Escape, 0 (On The NumPad), X
    # C = Enter, Space Bar and C
    # A = Shift, Z
    if Input.press?(Input::C)
    text_not_skip = false
    end
    else
    text_not_skip = true
    break
    end
    # 終了判定
    if text_not_skip
    break
    end
    end
    @write_wait += @write_speed
    return
    end
    # 数値入力中の場合
    if @input_number_window != nil
    @input_number_window.update
    # 決定
    if Input.trigger?(Input::C)
    $game_system.se_play($data_system.decision_se)
    $game_variables[$game_temp.num_input_variable_id] =
    @input_number_window.number
    $game_map.need_refresh = true
    # 数値入力ウィンドウを解放
    @input_number_window.dispose
    @input_number_window = nil
    terminate_message
    end
    return
    end
    # メッセージ表示中の場合
    if @contents_showing
    # 選択肢の表示中でなければポーズサインを表示
    if $game_temp.choice_max == 0
    self.pause = true
    end


    if Input.trigger?(Input::B)
    if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
    $game_system.se_play($data_system.cancel_se)
    $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
    terminate_message
    end
    end

    if Input.trigger?(Input::C)
    if $game_temp.choice_max > 0
    $game_system.se_play($data_system.decision_se)
    $game_temp.choice_proc.call(self.index)
    end
    if @mid_stop
    @mid_stop = false
    return
    else
    terminate_message
    end
    end
    return
    end
    # フェードアウト中以外で表示待ちのメッセージか選択肢が・る場合
    if @fade_out == false and $game_temp.message_text != nil
    @contents_showing = true
    $game_temp.message_window_showing = true
    refresh
    Graphics.frame_reset
    self.visible = true
    self.contents_opacity = 0
    if @input_number_window != nil
    @input_number_window.contents_opacity = 0
    end
    @fade_in = true
    return
    end
    # 表示すべきメッセージがないが、ウィンドウが可視状態の場合
    if self.visible
    @fade_out = true
    self.opacity -= 48
    if self.opacity == 0
    self.visible = false
    @fade_out = false
    $game_temp.message_window_showing = false
    end
    return
    end
    end
    #--------------------------------------------------------------------------
    # ● キャラクターの取得
    # parameter : パラメータ
    #--------------------------------------------------------------------------
    def get_character(parameter)
    # パラメータで分岐
    case parameter
    when 0 # プレイヤー
    return $game_player
    else # 特定のイベント
    events = $game_map.events
    return events == nil ? nil : events[parameter]
    end
    end
    #--------------------------------------------------------------------------
    # ● ウィンドウの位置と不透明度の設定
    #--------------------------------------------------------------------------
    def reset_window
    # 判定
    if @popchar >= 0
    events = $game_map.events
    if events != nil
    character = get_character(@popchar)
    x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
    y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
    self.x = x
    self.y = y
    end
    elsif @popchar == -1
    self.x = -4
    self.y = -4
    self.width = 648
    self.height = 488
    else
    if $game_temp.in_battle
    self.y = 16
    else
    case $game_system.message_position
    when 0 # 上
    self.y = 16
    when 1 # 中
    self.y = 160
    when 2 # 下
    self.y = 304
    end
    self.x = 80
    if @face_file == nil
    self.width = 480
    else
    self.width = 600
    self.x -= 60
    end
    self.height = 160
    end
    end
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
    self.contents.font.color = normal_color
    self.contents.font.name = $fontface
    if @face_file != nil
    self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
    end
    if @popchar == -1
    self.opacity = 255
    self.back_opacity = 0
    elsif $game_system.message_frame == 0
    self.opacity = 255
    self.back_opacity = 160
    else
    self.opacity = 0
    self.back_opacity = 160
    end
    end
    #--------------------------------------------------------------------------
    # ● 外字描画
    #--------------------------------------------------------------------------
    # x   :x座標
    # y   :y座標
    # num  :外字番号
    # 返り値:外字幅(@x増加値)
    #--------------------------------------------------------------------------
    def gaiji_draw(x, y, num)
    # 外字データが存在しない場合は何もしない
    if @gaiji_cache == nil
    return 0
    else
    # 指定した外字がキャッシュ範囲を超えている場合は何もしない
    if @gaiji_cache.width < num * 24
    return 0
    end

    # 文字サイズを計算
    if self.contents.font.size >= 20 and self.contents.font.size <= 24
    size = 24
    else
    size = self.contents.font.size * 100 * 24 / 2200
    end

    # 外字データをstretch_bltで転送
    self.contents.stretch_blt(Rect.new(x, y, size, size), @gaiji_cache, Rect.new(num * 24, 0, 24, 24))

    # 文字描写のSEを演奏
    if $soundname_on_speak != "" then
    Audio.se_play($soundname_on_speak)
    end

    # 文字サイズを返す
    return size
    end
    end
    #--------------------------------------------------------------------------
    # ● line_height
    #--------------------------------------------------------------------------
    # 返り値:行の高さ(@y増加値)を返します。
    #--------------------------------------------------------------------------
    def line_height
    # 現状、選択肢等に対応ができない為、自動的に32を返します。
    return 32

    # 文字サイズを計算
    if self.contents.font.size >= 20 and self.contents.font.size <= 24
    return 32
    else
    return self.contents.font.size * 15 / 10
    end
    end
    #--------------------------------------------------------------------------
    # ● ルビ文字描画
    #--------------------------------------------------------------------------
    # target :描画対象。Bitmapクラスを指定。
    # x :x座標
    # y :y座標
    # str  :描画文字列。本文,ルビの形式で入力。
    #      ,区切りが2つ以上・った場合は自動的に無視される。
    # opacity:透過率(0~255)
    # 返り値 :文字幅(@x増加値)。
    #--------------------------------------------------------------------------
    def ruby_draw_text(target, x, y, str,opacity)
    # フォントサイズをバックアップしておく
    sizeback = target.font.size
    # ルビサイズの計算
    target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
    rubysize = [rubysize, 6].max

    # opacityに規定値以上の値が入っている場合は修正。
    opacity = [[opacity, 0].max, 255].min
    # strをsplitで分割し、split_sに格納
    split_s = str.split(/,/)

    # split_sがnilの場合は""にしておく(誤動作防止)
    split_s[0] == nil ? split_s[0] = "" : nil
    split_s[1] == nil ? split_s[1] = "" : nil

    # heightとwidthを計算
    height = sizeback + rubysize
    width = target.text_size(split_s[0]).width

    # バッファ用の幅計算(ルビの幅が本文の幅を越える可能性が・る為)
    target.font.size = rubysize
    ruby_width = target.text_size(split_s[1]).width
    target.font.size = sizeback

    buf_width = [target.text_size(split_s[0]).width, ruby_width].max

    # 本文の描画幅とルビの描画幅の差を1/2にして変数に格納(後で使用)
    width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0

    # opacityが255(透過なし)の場合は通常描画
    if opacity == 255
    # ルビの描画
    target.font.size = rubysize
    target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
    target.font.size = sizeback
    # 本文の描画
    target.draw_text(x, y, width, target.font.size, split_s[0])
    return width
    else
    # 表示テキストのheight、widthがバッファサイズを上回る場合は
    # バッファを再生成する。
    if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
    @opacity_text_buf.dispose
    @opacity_text_buf = Bitmap.new(buf_width, height)
    # そうでない場合はバッファクリア。
    else
    @opacity_text_buf.clear
    end
    # バッファにテキスト描画
    # ルビの描画
    @opacity_text_buf.font.size = rubysize
    @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
    @opacity_text_buf.font.size = sizeback
    # 本文の描画
    @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
    # ルビの幅が本文の幅を下回る場合
    if sub_x >= 0
    target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
    # ルビの幅が本文の幅を上回る場合
    else
    target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
    end
    # 文字サイズを返す
    return width
    end
    end
    #--------------------------------------------------------------------------
    # ● \V変換
    #--------------------------------------------------------------------------
    # option :オプション。無指定又は規定外の場合はindexのユーザ変数値を返す。
    # index :インデックス
    # 返り値 :変換結果(アイコン表示用シーケンス込み)
    #--------------------------------------------------------------------------
    def convart_value(option, index)
    # optionがnilの場合は""に直す(誤動作防止)
    option == nil ? option = "" : nil

    # optionはdowncaseしておく。
    option.downcase!

    # \030はアイコン表示用のシーケンス。\030[アイコンファイル名]で定義。
    case option
    when "i"
    unless $data_items[index].name == nil
    r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
    end
    when "w"
    unless $data_weapons[index].name == nil
    r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
    end
    when "a"
    unless $data_armors[index].name == nil
    r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
    end
    when "s"
    unless $data_skills[index].name == nil
    r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
    end
    else
    r = $game_variables[index]
    end

    r == nil ? r = "" : nil
    return r
    end
    #--------------------------------------------------------------------------
    # ● 解放
    #--------------------------------------------------------------------------
    def dispose
    terminate_message

    # 外字キャッシュ開放
    if @gaiji_cache != nil
    unless @gaiji_cache.disposed?
    @gaiji_cache.dispose
    end
    end

    # 文字透過転送用バッファ開放
    unless @opacity_text_buf.disposed?
    @opacity_text_buf.dispose
    end

    $game_temp.message_window_showing = false
    if @input_number_window != nil
    @input_number_window.dispose
    end
    super
    end
    #--------------------------------------------------------------------------
    # ● カーソルの矩形更新
    #--------------------------------------------------------------------------
    def update_cursor_rect
    if @index >= 0
    n = $game_temp.choice_start + @index
    self.cursor_rect.set(8 + @indent + @face_indent, n * 32, @cursor_width, 32)
    else
    self.cursor_rect.empty
    end
    end
    end
    #==============================================================================
    # ■ Window_Frame (枠だけで中身の無いウィンドウ)
    #==============================================================================
    class Window_Frame < Window_Base
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化
    #--------------------------------------------------------------------------
    def initialize(x, y, width, height)
    super(x, y, width, height)
    self.contents = nil
    #self.back_opacity = 240
    end
    #--------------------------------------------------------------------------
    # ● 解放
    #--------------------------------------------------------------------------
    def dispose
    super
    end
    end

    #===================================================
    # ▼ CLASS Game_Map Additional Code Begins
    #===================================================
    class Game_Map

    #Dubealex Addition (from XRXS) to show Map Name on screen
    def name
    $map_infos[@map_id]
    end
    end

    #===================================================
    # ▲ CLASS Game_Map Additional Code Ends
    #===================================================


    #===================================================
    # ▼ CLASS Scene_Title Additional Code Begins
    #===================================================
    class Scene_Title

    #Dubealex Addition (from XRXS) to show Map Name on screen
    $map_infos = load_data("Data/MapInfos.rxdata")
    for key in $map_infos.keys
    $map_infos[key] = $map_infos[key].name
    end
    end

    #===================================================
    # ▲ CLASS Scene_Title Additional Code Ends
    #===================================================


    #===================================================
    # ▼ CLASS Window_Base Additional Code Begins
    #===================================================
    class Window_Base < Window

    #Dubealex Addition (from Phylomorphis) to use Hex Code Colors
    def hex_color(string)
    red = 0
    green = 0
    blue = 0
    if string.size != 6
    print("Hex strings must be six characters long.")
    print("White text will be used.")
    return Color.new(255, 255, 255, 255)
    end
    for i in 1..6
    s = string.slice!(/./m)
    if s == "#"
    print("Hex color string may not contain the \"#\" character.")
    print("White text will be used.")
    return Color.new(255, 255, 255, 255)
    end
    value = hex_convert(s)
    if value == -1
    print("Error converting hex value.")
    print("White text will be used.")
    return Color.new(255, 255, 255, 255)
    end
    case i
    when 1
    red += value * 16
    when 2
    red += value
    when 3
    green += value * 16
    when 4
    green += value
    when 5
    blue += value * 16
    when 6
    blue += value
    end
    end
    return Color.new(red, green, blue, 255)
    end
    #----------------------------
    def hex_convert(character)
    case character
    when "0"
    return 0
    when "1"
    return 1
    when "2"
    return 2
    when "3"
    return 3
    when "4"
    return 4
    when "5"
    return 5
    when "6"
    return 6
    when "7"
    return 7
    when "8"
    return 8
    when "9"
    return 9
    when "A"
    return 10
    when "B"
    return 11
    when "C"
    return 12
    when "D"
    return 13
    when "E"
    return 14
    when "F"
    return 15
    end
    return -1
    end
    end
    #===================================================
    # ▲ CLASS Window_Base Additional Code Ends
    #===================================================


    #==============================================================================
    # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
    #==============================================================================
    class Air_Text < Window_Base
    #--------------------------------------------------------------------------
    # ● オブジェクト初期化
    #--------------------------------------------------------------------------
    def initialize(x, y, designate_text)
    super(x-16, y-16, 32 + designate_text.size * 12, 56)
    self.opacity = 0
    self.back_opacity = 0
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
    w = self.contents.width
    h = self.contents.height
    self.contents.font.name = $fontface
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, w, h, designate_text)
    end
    #--------------------------------------------------------------------------
    # ● 解放
    #--------------------------------------------------------------------------
    def dispose
    self.contents.clear
    super
    end
    end


    Commands List :



    Those commands are all to be used inside a Message Event.

    Remember that you can skip the letter by letter effect by pressing ENTER during a dialog. You can choose the button you want, just follow the instruction in the script's comments !

    (1) Show a picture in a message dialog:

    \f[FileName]

    FileName must be a PNG of 96X96 stored in the directory Graphics\Pictures

    (2) Show window on top of player/event and more:

    \p[Event ID]
    \P[0]
    \p[-1]

    Using "\p[Event ID]" will put the window on top of the specified Event ID.
    Using "\p[0]" will put the window on top of the player.
    Using "\p[-1]" will make a window without background and without borders.

    (3) Show Variable and other stuff:

    \v[XId]

    To show a variable content, use "\v[Variable ID]" as usual.
    You can show name of Item, Weapon, Armor and skills using the following letter:

    S=Skills
    A=Armors
    W=Weapons
    I=Items

    So, as example, if you want to show the name of Item ID #1, you would do this: \v[i1]

    (4) Change text color (New feature by Dubealex!):

    \c[Number]
    \c[#000000]

    The Number represent the colors set in the class Window_Base starting at line #39. You can modify those or add more. This is the default way to use the command \c.

    The new feature to use HTML Hex Code: You must begin the code with a # character, followed by 6 character. You can use any HTML Hex Color Chart to choose a color from. Here's a example: \c[#FF00FF]

    TRICK: Easy color guide for Hex Code... Remember the computer primary colors, RGB --> Red - Green - Blue... then, it is the same order in Hex Code,look:

    Red --> FF0000
    Green --> 00FF00
    Blue --> 0000FF

    You can then use any Hex Color Chart you can found on the web to use ANY color anytime without modifying the Window_Base color chart. Cool isn't ?


    (5) Change text speed:

    \s[Number]

    The Number must be between 1 and 19, 19 being the slowest.

    (6) Change text size:

    \h[Number]

    The Number must be between 6 and 32, 32 being the biggest.

    (7) Special characters, like text wait:

    \| --> Wait for 1 second
    \. --> Wait for .25 second
    \~ --> Auto close window at last letter
    \! --> Wait for key input from the player
    \\ --> Will show the backslash \ character

    (8) Show the gold window on screen:

    \g

    (9) Show the hero's name:

    \n[Hero ID]

    (10) Show the monster's name (Feature by dubealex!):

    \m[Monster ID]

    (11) Show an item's price (Feature by dubealex!):

    \Price[Item ID]

    (12) Show an hero's class name (Feature by dubealex!):

    \Class[Hero ID]

    (13) Show the current map name (Feature added by dubealex!):

    \Map

    (14) Set the letter by letter mode ON and OFF:

    \< --> Will set it ON
    \> --> Will set it OFF

    (15) Change the font in a message box (Feature added by dubealex!):

    \t[FontName]

    Remember that the FontName is case sensitive, so arial isn't the same as Arial. (Capital letters). And you cannot use the parenthesis () symbol in your messages, you can use square brackets [ ] instead.

    (16) Link an audio file like in Shining Force to the text effect:

    \a[FileName]

    FileName must be in directory Audio\SE
    Remember to set that effect OFF when you dont need it anymore using \a[]
    Leaving the brackets empty, or else the SE will be heard on all window from this point on.

    (17) Show the name window on top of the message dialog:

    \Name[stuff]

    You can replace stuff by the word you want, and you can also use other command like \n[1] to show the hero's name in it ! (And almost any other commands !)

    (18) Indent the text on the line:

    \i

    (19) Use superscript style letters:

    \[First]second

    The "First" will be at normal size, and "SECOND" will be a little bit higher on the line.

    (20) Change text opacity:

    \o[Number]

    The Number must be between 0 and 255. 255 being opaque at 100%.

    (21) Show a gaigi image:

    \e[Number]

    This will show the file named sample.png that is in the folder Graphics\Gaiji
    If the Number is 0, RPG Maker will show the top left part of the image. To show the right part of the image, increase that number.

    Customization Notes:





    (1) Change the color of the Name Window

    Since you cannot use the command \c[Number] in the Name Window, I added this part to show you how to choose the color you want. I will tell 2 different method, one is simple but allow to use 1 color, the other one is a little bit different, but allows you to change the color anytime during the game.

    Go to the line #1034 of the class Advanced_Message, (Wich fall in class Air_Text) you should see that code around:

    def initialize(x, y, designate_text) super(x-16, y-16, 32 + designate_text.size * 12, 56) self.opacity = 0 self.back_opacity = 0 self.contents = Bitmap.new(self.width - 32, self.height - 32) w = self.contents.width h = self.contents.height self.contents.font.name = $fontface self.contents.font.color = normal_color self.contents.draw_text(0, 0, w, h, designate_text)endThe line in BOLT is the actual line #1034 you need to modify. You have to change what is after the equal sign by something else; here goes:

    self.contents.font.color = text_color(5)

    Where the number in red (5) represent the color ID# you want to use. All those colors are actually coded in the class Window_Base starting at line #39. You can thus add or modify those colors.

    But what if you need to have more than one color in the name window, as a color for girl and another for boys ? Easy, just use that line then:

    self.contents.font.color = text_color($game_variables[1])

    Where $game_variables[1] represent a variable of your game, and the number between brackets [1] represents its ID#. This means you can do a variable operation to set the color ID you want in that variable, and the Name Window will use it ! Then, its easy, everytime you need to change the Name Window text color, you simply do a variable operation before your message event.

    (2) Use the Window Skin you want for the Name Window:

    This will allow you to use 2 different Window Skin at the same time; one for the main message box, and another one for the Name Window. Thanks to Ryughen for posting this info on the X-RPG post.

    Go in the class Advanced_Message, and go to line #886, click ENTER to add a line there:

    self.windowskin = RPG::Cache.windowskin("name_window")

    Where name_window is the actual filename of your window skin. (Must be in Graphics\Windowskin of course). You can omit the file extension, or write it, it does work either way.


    (3) To change the position and size of the Name Window:

    Ok, here's the tutorial on how to modify the Name Window:

    Go to the line #235 of the script, you will see this code:


    if name_window_set
    # ƒIƒtƒZƒbƒgˆÊ'u
    off_x = 0
    off_y = -10
    # ˜g‚¾‚¯ƒEƒBƒ“ƒhƒE‚̍쐬(—]”'‚ð 2 ‚ɐÝ'è)
    space = 2
    x = self.x + off_x - space / 2
    y = self.y + off_y - space / 2
    w = self.contents.text_size(name_text).width + 8 + space
    h = 25 + space
    @name_window_frame = Window_Frame.new(x, y, w, h)
    @name_window_frame.z = self.z + 1
    # ‹[Ž—“I‚È‹ó'†•¶Žš•`ŽÊƒEƒBƒ“ƒhƒE‚ðì¬
    x = self.x + off_x + 4
    y = self.y + off_y
    @name_window_text = Air_Text.new(x, y, name_text)
    @name_window_text.z = self.z + 2
    end
    end


    Okay - first thing first, explanation of what does what:

    Line 237: off_x = 0
    Modify this value ( 0 ) to another to move the window on the X axis - Meaning horizontally. A negative number will move it to the left, and positive to the right. I.E Put 100 and it will be to the right. So you can align the window where you want.

    Line 238: off_y = -10
    The same as line 237, but Y axis, meaning vertically.

    Line 243: w = self.contents.text_size(name_text).width + 8 + space
    This will change the width of the window. Change the number in red by what you want. By default, it takes the size of the text you input, so don't put a number smaller than 8.

    Line 244: h = 25 + space
    This does as line 243, but for the heigh of the window.

    Then, you simply play with those values to get the size and position correct, and have fun ! You can even make the name window appears to the right of the message box, to the bottom, on top left of the screen, do whatever you want !
     
  3. omegawhile

    omegawhile Youtube Master Race

    Tham gia ngày:
    25/11/04
    Bài viết:
    17
    [​IMG]

    FEATURES :
    -ATB System
    -Cool Looking HP and SP Bars
    -After Battle Autoheal (Can be removed)
    -A "Run" Option in each of the character's windows
    -Level Up Statistics
    -Battle Status Elements (When your Poisoned, your character turnes purple and flashes, etc.)

    Create a new Script right over top of Main and name it New_Battle and put the code in it :

    New_Battle code:

    #==============================================================================
    # New_Battle
    #------------------------------------------------------------------------------
    # Compiled By : MakirouAru
    #==============================================================================
    # ¥£¥ XRXS_BP 3. Ÿ—˜ŽžHP‰ñ•œ ver.1.01 ¥£¥
    # by fukuyama, ÷‰ë Ý“y

    # Battle_End_Recovery
    #
    # í“¬Œã‚̉ñ•œˆ—ƒ‚ƒWƒ…[ƒ‹
    #
    # Request: stay
    # Script: fukuyama
    # Test: ƒmƒRƒmŽq
    #
    # URL: http://www4.big.or.jp/~fukuyama/rgss/Battle_End_Recovery.txt
    #

    module Battle_End_Recovery

    module Scene_Battle_Module

    # ‰ñ•œ—¦•Ï”‚ÌID
    @@recovery_rate_variable_id = nil

    # ‰ñ•œ—¦‚̎擾
    def battle_end_recovery_rate
    if @@recovery_rate_variable_id.nil?
    @@recovery_rate_variable_id =
    $data_system.variables.index 'í“¬Œã‚̉ñ•œ—¦'
    if @@recovery_rate_variable_id.nil?
    @@recovery_rate_variable_id = false
    end
    end
    return 0 unless @@recovery_rate_variable_id
    return $game_variables[@@recovery_rate_variable_id]
    end

    # í“¬Œã‚̉ñ•œˆ—
    def battle_end_recovery

    # ‰ñ•œ—¦
    recovery_rate = battle_end_recovery_rate

    # ‰ñ•œ—¦•Ï”‚ª‚OˆÈŠO‚©‚ƒAƒNƒ^[‚ª¶‘¶‚µ‚Ä‚¢‚éê‡Aí“¬Œã‚̉ñ•œˆ—‚ðs‚¤
    if recovery_rate != 0 and not actor.dead?

    # ƒp[ƒeƒB‚̃AƒNƒ^[–ˆ‚Ƀ‹[ƒv
    $game_party.actors.each do |actor|

    # ‰ñ•œ—ÊŒvŽZ
    recovery_hp = (actor.maxhp / 100.0 * recovery_rate).truncate
    recovery_sp = (actor.maxsp / 100.0 * recovery_rate).truncate

    # ŽÀÛ‚ɉñ•œ
    actor.hp += recovery_hp
    actor.sp += recovery_sp

    # ƒAƒjƒ[ƒVƒ‡ƒ“Ý’è
    actor.damage = - recovery_hp
    actor.damage_pop = true

    end

    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðXV
    @status_window.refresh

    end
    end

    end # module Scene_Battle_Module
    end # module Battle_End_Recovery

    #------------------------------
    # í“¬ƒV[ƒ“‚̍Ēè‹`
    #------------------------------
    class Scene_Battle

    # Scene_Battle—pƒ‚ƒWƒ…[ƒ‹‚ðƒCƒ“ƒNƒ‹[ƒh
    include Battle_End_Recovery::Scene_Battle_Module

    # Œ³‚̃tƒF[ƒY‚TŠJŽn‚É•Ê–¼‚ð‚‚¯‚é
    alias battle_end_recovery_original_start_phase5 start_phase5

    # ƒtƒF[ƒY‚TŠJŽn‚ðÄ’è‹`
    def start_phase5

    # í“¬Œã‚̉ñ•œˆ—‚ðŒÄ‚яo‚·
    battle_end_recovery

    # Œ³‚̃tƒF[ƒY‚TŠJŽn‚ðŒÄ‚яo‚·
    battle_end_recovery_original_start_phase5

    end
    end

    # Battle_End_Recovery
    # ¥£¥ XRXS_BP10. LEVEL UP!ƒEƒBƒ“ƒhƒE ¥£¥
    # by ÷‰ë Ý“y

    $data_system_level_up_se = "" # ƒŒƒxƒ‹ƒAƒbƒvSEB""‚Å–³‚µB
    $data_system_level_up_me = "Audio/ME/007-Fanfare01" # ƒŒƒxƒ‹ƒAƒbƒvME

    #==============================================================================
    # ¡ Window_LevelUpWindow
    #------------------------------------------------------------------------------
    # @ƒoƒgƒ‹I—¹ŽžAƒŒƒxƒ‹ƒAƒbƒv‚µ‚½ê‡‚ɃXƒe[ƒ^ƒX‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
    #==============================================================================
    class Window_LevelUpWindow < Window_Base
    #--------------------------------------------------------------------------
    # œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
    #--------------------------------------------------------------------------
    def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
    super(0, 128, 160, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.visible = false
    refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
    end
    #--------------------------------------------------------------------------
    # œ ƒŠƒtƒŒƒbƒVƒ…
    #--------------------------------------------------------------------------
    def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.font.name = "Arial"
    self.contents.font.size = 14
    self.contents.draw_text( 0, 0, 160, 24, "LEVEL UP!!")
    self.contents.font.size = 18
    self.contents.draw_text( 0, 28, 160, 24, $data_system.words.hp)
    self.contents.draw_text( 0, 50, 160, 24, $data_system.words.sp)
    self.contents.font.size = 14
    self.contents.draw_text( 0, 72, 80, 24, $data_system.words.str)
    self.contents.draw_text( 0, 94, 80, 24, $data_system.words.dex)
    self.contents.draw_text( 0, 116, 80, 24, $data_system.words.agi)
    self.contents.draw_text( 0, 138, 80, 24, $data_system.words.int)
    self.contents.draw_text(92, 0, 128, 24, "¨")
    self.contents.draw_text(76, 28, 128, 24, "=")
    self.contents.draw_text(76, 50, 128, 24, "=")
    self.contents.draw_text(76, 72, 128, 24, "=")
    self.contents.draw_text(76, 94, 128, 24, "=")
    self.contents.draw_text(76, 116, 128, 24, "=")
    self.contents.draw_text(76, 138, 128, 24, "=")
    self.contents.font.color = normal_color
    self.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2)
    self.contents.draw_text( 0, 28, 72, 24, "+" + up_hp.to_s, 2)
    self.contents.draw_text( 0, 50, 72, 24, "+" + up_sp.to_s, 2)
    self.contents.draw_text( 0, 72, 72, 24, "+" + up_str.to_s, 2)
    self.contents.draw_text( 0, 94, 72, 24, "+" + up_dex.to_s, 2)
    self.contents.draw_text( 0, 116, 72, 24, "+" + up_agi.to_s, 2)
    self.contents.draw_text( 0, 138, 72, 24, "+" + up_int.to_s, 2)
    self.contents.font.size = 20
    self.contents.draw_text( 0, 0, 128, 24, actor.level.to_s, 2)
    self.contents.draw_text( 0, 26, 128, 24, actor.maxhp.to_s, 2)
    self.contents.draw_text( 0, 48, 128, 24, actor.maxsp.to_s, 2)
    self.contents.draw_text( 0, 70, 128, 24, actor.str.to_s, 2)
    self.contents.draw_text( 0, 92, 128, 24, actor.dex.to_s, 2)
    self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)
    self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)
    end
    end
    #==============================================================================
    # ¡ Window_BattleStatus
    #==============================================================================
    class Window_BattleStatus < Window_Base
    #--------------------------------------------------------------------------
    # œ ’ljÁEŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
    #--------------------------------------------------------------------------
    attr_accessor :level_up_flags # LEVEL UP!•\Ž¦
    end
    #==============================================================================
    # ¡ Game_Battler
    #==============================================================================
    class Game_Battler
    #--------------------------------------------------------------------------
    # œ ’ljÁEŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
    #--------------------------------------------------------------------------
    attr_accessor :exp_gain_ban # EXPŽæ“¾ˆêŽž‹ÖŽ~
    #--------------------------------------------------------------------------
    # œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
    #--------------------------------------------------------------------------
    alias xrxs_bp10_initialize initialize
    def initialize
    @exp_gain_ban = false
    xrxs_bp10_initialize
    end
    #--------------------------------------------------------------------------
    # œ ƒXƒe[ƒg [EXP ‚ðŠl“¾‚Å‚«‚È‚¢] ”»’è
    #--------------------------------------------------------------------------
    alias xrxs_bp10_cant_get_exp? cant_get_exp?
    def cant_get_exp?
    if @exp_gain_ban == true
    return true
    else
    return xrxs_bp10_cant_get_exp?
    end
    end
    end
    #==============================================================================
    # ¡ Scene_Battle
    #==============================================================================
    class Scene_Battle
    #--------------------------------------------------------------------------
    # œ ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒYŠJŽn
    #--------------------------------------------------------------------------
    alias xrxs_bp10_start_phase5 start_phase5
    def start_phase5
    # EXP Šl“¾‹ÖŽ~
    for i in 0...$game_party.actors.size
    $game_party.actors.exp_gain_ban = true
    end
    xrxs_bp10_start_phase5
    # EXP Šl“¾‹ÖŽ~‚̉ðœ
    for i in 0...$game_party.actors.size
    $game_party.actors.exp_gain_ban = false
    end
    # EXP‚ð‰Šú‰»
    @exp_gained = 0
    for enemy in $game_troop.enemies
    # Šl“¾ EXP‚ð’ljÁ # ƒGƒlƒ~[‚ª‰B‚êó‘Ô‚Å‚È‚¢ê‡
    @exp_gained += enemy.exp if not enemy.hidden
    end
    # Ý’è
    @phase5_step = 0
    @exp_gain_actor = -1
    # ƒŠƒUƒ‹ƒgƒEƒBƒ“ƒhƒE‚ð•\Ž¦
    @result_window.y -= 64
    @result_window.visible = true
    # ƒŒƒxƒ‹ƒAƒbƒv”»’è‚Ö
    phase5_next_levelup
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒY)
    #--------------------------------------------------------------------------
    alias xrxs_bp10_update_phase5 update_phase5
    def update_phase5
    case @phase5_step
    when 1
    update_phase5_step1
    else
    xrxs_bp10_update_phase5
    # ƒŒƒxƒ‹ƒAƒbƒv‚µ‚Ä‚¢‚éê‡‚Í‹­§ƒoƒgƒ‹I—¹
    battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0
    end
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒY 1 : ƒŒƒxƒ‹ƒAƒbƒv)
    #--------------------------------------------------------------------------
    def update_phase5_step1
    # C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
    if Input.trigger?(Input::C)
    # ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚ÄŽŸ‚̃AƒNƒ^[‚Ö
    @levelup_window.visible = false if @levelup_window != nil
    @status_window.level_up_flags[@exp_gain_actor] = false
    phase5_next_levelup
    end
    end
    #--------------------------------------------------------------------------
    # œ ŽŸ‚̃AƒNƒ^[‚̃Œƒxƒ‹ƒAƒbƒv•\Ž¦‚Ö
    #--------------------------------------------------------------------------
    def phase5_next_levelup
    begin
    # ŽŸ‚̃AƒNƒ^[‚Ö
    @exp_gain_actor += 1
    # ÅŒã‚̃AƒNƒ^[‚̏ꍇ
    if @exp_gain_actor >= $game_party.actors.size
    # ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒYŠJŽn
    @phase5_step = 0
    return
    end
    actor = $game_party.actors[@exp_gain_actor]
    if actor.cant_get_exp? == false
    # Œ»Ý‚Ì”\—Í’l‚ð•ÛŽ
    last_level = actor.level
    last_maxhp = actor.maxhp
    last_maxsp = actor.maxsp
    last_str = actor.str
    last_dex = actor.dex
    last_agi = actor.agi
    last_int = actor.int
    # ŒoŒ±’lŽæ“¾‚ÌŒˆ’è“IuŠÔ(“ä
    actor.exp += @exp_gained
    # ”»’è
    if actor.level > last_level
    # ƒŒƒxƒ‹ƒAƒbƒv‚µ‚½ê‡
    @status_window.level_up(@exp_gain_actor)
    if $data_system_level_up_se != ""
    Audio.se_stop
    Audio.se_play($data_system_level_up_se)
    end
    if $data_system_level_up_me != ""
    Audio.me_stop
    Audio.me_play($data_system_level_up_me)
    end
    @levelup_window = Window_LevelUpWindow.new(actor, last_level,
    actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str,
    actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int)
    @levelup_window.x = 160 * @exp_gain_actor
    @levelup_window.visible = true
    @phase5_wait_count = 40
    @phase5_step = 1
    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
    @status_window.refresh
    return
    end
    end
    end until false
    end
    end
    # ¥£¥ XRXS_17. ƒXƒŠƒbƒvƒ_ƒ[ƒW–hŒä^Œø‰Ê—ʏڍ׉» ver.1.51 ¥£¥
    # by ÷‰ë Ý“y, fukuyama

    #==============================================================================
    # ¡ Game_Battler
    #==============================================================================
    class Game_Battler
    #--------------------------------------------------------------------------
    # œ ƒXƒŠƒbƒvƒ_ƒ[ƒW‚ÌŒø‰Ê“K—p
    #--------------------------------------------------------------------------
    alias xrxs_bp7_slip_damage_effect slip_damage_effect
    def slip_damage_effect
    # ”’l‚̏‰Šú‰»
    slip_damage_percent = 0
    slip_damage_plus = 0
    # Œ»Ý•t‰Á‚³‚ê‚Ä‚¢‚éƒXƒe[ƒg‚Ì’†‚©‚çƒXƒŠƒbƒvƒ_ƒ[ƒW—L‚è‚̃‚ƒm‚ð’T‚·
    for i in @states
    if $data_states.slip_damage
    # ‚»‚̃Xƒe[ƒg‚ªŽ‚Á‚Ä‚¢‚éƒXƒŠƒbƒvƒ_ƒ[ƒW‚Ì
    # Lvƒvƒ‰ƒXƒXƒe[ƒg‚Ü‚½‚ÍLvƒ}ƒCƒiƒXƒXƒe[ƒg‚ð”»’èB
    for j in $data_states.plus_state_set
    if $data_states[j] != nil
    if $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)(%|“)/
    slip_damage_percent += $1.to_i
    elsif $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)$/
    slip_damage_plus += $1.to_i
    end
    end
    end
    for j in $data_states.minus_state_set
    if $data_states[j] != nil
    if $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)(%|“)/
    slip_damage_percent -= $1.to_i
    elsif $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)$/
    slip_damage_plus -= $1.to_i
    end
    end
    end
    end
    end
    if slip_damage_percent == 0 and slip_damage_plus == 0
    xrxs_bp7_slip_damage_effect
    else
    # –h‹ï‚ªƒXƒŠƒbƒv–hŒä‚ª‚ ‚éê‡‚ð”»’è
    for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
    armor = $data_armors
    next if armor == nil
    for j in armor.guard_state_set
    if $data_states[j] != nil
    if $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)(%|“)/
    if slip_damage_percent > 0
    slip_damage_percent = [slip_damage_percent - $1.to_i, 0].max
    end
    end
    if $data_states[j].name =~ /^ƒXƒŠƒbƒv([0-9]+)$/
    if slip_damage_percent > 0
    slip_damage_plus = [slip_damage_plus - $1.to_i, 0].max
    end
    end
    end
    end
    end
    # ƒ_ƒ[ƒW‚ðÝ’è
    self.damage = self.maxhp * slip_damage_percent / 100 + slip_damage_plus
    # •ªŽU
    if self.damage.abs > 0
    amp = [self.damage.abs * 15 / 100, 1].max
    self.damage += rand(amp+1) + rand(amp+1) - amp
    end
    # HP ‚©‚çƒ_ƒ[ƒW‚ðŒ¸ŽZ
    self.hp -= self.damage
    # ƒƒ\ƒbƒhI—¹
    return true
    end
    end
    end
    # ¥£¥ XRXS_BP 1. CP§“±“ü ver.15 ¥£¥
    # by ÷‰ë Ý“y, ˜aŠó, Jack-R

    #==============================================================================
    # ¡ Scene_Battle_CP
    #==============================================================================
    class Scene_Battle_CP
    #--------------------------------------------------------------------------
    # œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
    #--------------------------------------------------------------------------
    attr_accessor :stop # CP‰ÁŽZƒXƒgƒbƒv
    #----------------------------------------------------------------------------
    # œ ƒIƒuƒWƒFƒNƒg‚̏‰Šú‰»
    #----------------------------------------------------------------------------
    def initialize
    @battlers = []
    @cancel = false
    @agi_total = 0
    # ”z—ñ @count_battlers ‚ð‰Šú‰»
    @count_battlers = []
    # ƒGƒlƒ~[‚ð”z—ñ @count_battlers ‚ɒljÁ
    for enemy in $game_troop.enemies
    @count_battlers.push(enemy)
    end
    # ƒAƒNƒ^[‚ð”z—ñ @count_battlers ‚ɒljÁ
    for actor in $game_party.actors
    @count_battlers.push(actor)
    end
    for battler in @count_battlers
    @agi_total += battler.agi
    end
    for battler in @count_battlers
    battler.cp = [[65535 * (rand(15) + 85) / 100 * battler.agi / @agi_total * 4, 0].max, 65535].min
    end
    end
    #----------------------------------------------------------------------------
    # œ CPƒJƒEƒ“ƒg‚ÌŠJŽn
    #----------------------------------------------------------------------------
    def start
    if @cp_thread != nil then
    return
    end
    @cancel = false
    @stop = false
    # ‚±‚±‚©‚çƒXƒŒƒbƒh
    @cp_thread = Thread.new do
    while @cancel != true
    if @stop != true
    self.update # XV
    sleep(0.05)
    end
    end
    end
    # ‚±‚±‚܂ŃXƒŒƒbƒh
    end
    #----------------------------------------------------------------------------
    # œ CPƒJƒEƒ“ƒgƒAƒbƒv
    #----------------------------------------------------------------------------
    def update
    if @count_battlers != nil then
    for battler in @count_battlers
    # s“®o—ˆ‚È‚¯‚ê‚Ζ³Ž‹
    if battler.dead? == true #or battler.movable? == false then
    battler.cp = 0
    next
    end
    # ‚±‚±‚Ì 1.3‚ð•Ï‚¦‚邱‚ƂŁ«ƒXƒs[ƒh‚ð•ÏX‰Â”\B‚½‚¾‚µ¬”“_‚ÍŽg—p‚·‚邱‚ƁB
    battler.cp = [[battler.cp + 1.3 * 4096 * battler.agi / @agi_total, 0].max, 65535].min
    end
    end
    end
    #----------------------------------------------------------------------------
    # œ CPƒJƒEƒ“ƒg‚ÌŠJŽn
    #----------------------------------------------------------------------------
    def stop
    @cancel = true
    if @cp_thread != nil then
    @cp_thread.join
    @cp_thread = nil
    end
    end
    end
    #==============================================================================
    # ¡ Game_Battler
    #==============================================================================
    class Game_Battler
    attr_accessor :now_guarding # Œ»Ý–hŒä’†ƒtƒ‰ƒO
    attr_accessor :cp # Œ»ÝCP
    attr_accessor :slip_state_update_ban # ƒXƒŠƒbƒvEƒXƒe[ƒgŽ©“®ˆ—‚Ì‹ÖŽ~
    #--------------------------------------------------------------------------
    # œ ƒRƒ}ƒ“ƒh“ü—͉”\”»’è
    #--------------------------------------------------------------------------
    def inputable?
    return (not @hidden and restriction <= 1 and @cp >=65535)
    end
    #--------------------------------------------------------------------------
    # œ ƒXƒe[ƒg [ƒXƒŠƒbƒvƒ_ƒ[ƒW] ”»’è
    #--------------------------------------------------------------------------
    alias xrxs_bp1_slip_damage? slip_damage?
    def slip_damage?
    return false if @slip_state_update_ban
    return xrxs_bp1_slip_damage?
    end
    #--------------------------------------------------------------------------
    # œ ƒXƒe[ƒgŽ©‘R‰ðœ (ƒ^[ƒ“‚²‚ƂɌĂяo‚µ)
    #--------------------------------------------------------------------------
    alias xrxs_bp1_remove_states_auto remove_states_auto
    def remove_states_auto
    return if @slip_state_update_ban
    xrxs_bp1_remove_states_auto
    end
    end
    #==============================================================================
    # ¡ Game_Actor
    #==============================================================================
    class Game_Actor < Game_Battler
    #--------------------------------------------------------------------------
    # œ ƒZƒbƒgƒAƒbƒv
    #--------------------------------------------------------------------------
    alias xrxs_bp1_setup setup
    def setup(actor_id)
    xrxs_bp1_setup(actor_id)
    @hate = 100 # init-value is 100
    @cp = 0
    @now_guarding = false
    @slip_state_update_ban = false
    end
    end
    #==============================================================================
    # ¡ Game_Enemy
    #==============================================================================
    class Game_Enemy < Game_Battler
    #--------------------------------------------------------------------------
    # œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
    #--------------------------------------------------------------------------
    alias xrxs_bp1_initialize initialize
    def initialize(troop_id, member_index)
    xrxs_bp1_initialize(troop_id, member_index)
    @hate = 100 # init-value is 100
    @cp = 0
    @now_guarding = false
    @slip_state_update_ban = false
    end
    end
    #==============================================================================
    # ¡ Window_BattleStatus
    #==============================================================================
    class Window_BattleStatus < Window_Base
    #--------------------------------------------------------------------------
    # œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
    #--------------------------------------------------------------------------
    attr_accessor :update_cp_only # CPƒ[ƒ^[‚݂̂̍XV
    #--------------------------------------------------------------------------
    # œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
    #--------------------------------------------------------------------------
    alias xrxs_bp1_initialize initialize
    def initialize
    @update_cp_only = false
    xrxs_bp1_initialize
    end
    #--------------------------------------------------------------------------
    # œ ƒŠƒtƒŒƒbƒVƒ…
    #--------------------------------------------------------------------------
    alias xrxs_bp1_refresh refresh
    def refresh
    if @update_cp_only == false
    xrxs_bp1_refresh
    end
    for i in 0...$game_party.actors.size
    actor = $game_party.actors
    actor_x = i * 160 + 4
    draw_actor_cp_meter(actor, actor_x, 96, 120, 0)
    end
    end
    #--------------------------------------------------------------------------
    # œ CPƒ[ƒ^[ ‚Ì•`‰æ
    #--------------------------------------------------------------------------
    def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
    self.contents.font.color = system_color
    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
    if actor.cp == nil
    actor.cp = 0
    end
    w = width * [actor.cp,65535].min / 65535
    self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
    self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
    self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
    self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
    end
    end
    #==============================================================================
    # ¡ Scene_Battle
    #==============================================================================
    class Scene_Battle
    # ‚±‚±‚ÉŒø‰Ê‰¹‚ðÝ’è‚·‚é‚ƁAƒAƒNƒ^[ƒRƒ}ƒ“ƒh‚ªƒ|ƒbƒv‚µ‚½‚Æ‚«‚ÉŒø‰Ê‰¹‚ðÄ¶
    $data_system_command_up_se = ""
    #--------------------------------------------------------------------------
    # œ ƒoƒgƒ‹I—¹
    # result : Œ‹‰Ê (0:Ÿ—˜ 1:”s–k 2:“¦‘–)
    #--------------------------------------------------------------------------
    alias xrxs_bp1_battle_end battle_end
    def battle_end(result)
    # CPƒJƒEƒ“ƒg’âŽ~
    @cp_thread.stop
    xrxs_bp1_battle_end(result)
    end
    #--------------------------------------------------------------------------
    # œ ƒvƒŒƒoƒgƒ‹ƒtƒF[ƒYŠJŽn
    #--------------------------------------------------------------------------
    alias xrxs_bp1_start_phase1 start_phase1
    def start_phase1
    @agi_total = 0
    @cp_thread = Scene_Battle_CP.new
    # ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðÄì¬
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, "Run"])
    @actor_command_window.y = 128
    @actor_command_window.back_opacity = 160
    @actor_command_window.active = false
    @actor_command_window.visible = false
    @actor_command_window.draw_item(4, $game_temp.battle_can_escape ? @actor_command_window.normal_color : @actor_command_window.disabled_color)
    xrxs_bp1_start_phase1
    end
    #--------------------------------------------------------------------------
    # œ ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF[ƒYŠJŽn
    #--------------------------------------------------------------------------
    alias xrxs_bp1_start_phase2 start_phase2
    def start_phase2
    xrxs_bp1_start_phase2
    @party_command_window.active = false
    @party_command_window.visible = false
    # ŽŸ‚Ö
    start_phase3
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF[ƒY)
    #--------------------------------------------------------------------------
    alias xrxs_bp1_update_phase2 update_phase2
    def update_phase2
    # C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
    if Input.trigger?(Input::C)
    # ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
    case @party_command_window.index
    when 0 # í‚¤
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    @cp_thread.start
    # ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒYŠJŽn
    start_phase3
    end
    return
    end
    xrxs_bp1_update_phase2
    end
    #--------------------------------------------------------------------------
    # œ ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
    #--------------------------------------------------------------------------
    def phase3_next_actor
    # ƒ‹[ƒv
    begin
    # ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
    if @active_battler != nil
    @active_battler.blink = false
    end
    # ÅŒã‚̃AƒNƒ^[‚̏ꍇ
    if @actor_index == $game_party.actors.size-1
    # ƒƒCƒ“ƒtƒF[ƒYŠJŽn
    @cp_thread.start
    start_phase4
    return
    end
    # ƒAƒNƒ^[‚̃Cƒ“ƒfƒbƒNƒX‚ði‚ß‚é
    @actor_index += 1
    @active_battler = $game_party.actors[@actor_index]
    @active_battler.blink = true
    if @active_battler.inputable? == false
    @active_battler.current_action.kind = -1
    end
    # ƒAƒNƒ^[‚ªƒRƒ}ƒ“ƒh“ü—Í‚ðŽó‚¯•t‚¯‚È‚¢ó‘Ô‚È‚ç‚à‚¤ˆê“x
    end until @active_battler.inputable?
    @cp_thread.stop
    # ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðƒZƒbƒgƒAƒbƒv
    @active_battler.now_guarding = false
    phase3_setup_command_window
    end
    #--------------------------------------------------------------------------
    # œ ‘O‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
    #--------------------------------------------------------------------------
    def phase3_prior_actor
    # ƒ‹[ƒv
    begin
    # ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
    if @active_battler != nil
    @active_battler.blink = false
    end
    # Å‰‚̃AƒNƒ^[‚̏ꍇ
    if @actor_index == 0
    # Å‰‚Ö–ß‚é
    start_phase3
    return
    end
    # ƒAƒNƒ^[‚̃Cƒ“ƒfƒbƒNƒX‚ð–ß‚·
    @actor_index -= 1
    @active_battler = $game_party.actors[@actor_index]
    @active_battler.blink = true
    # ƒAƒNƒ^[‚ªƒRƒ}ƒ“ƒh“ü—Í‚ðŽó‚¯•t‚¯‚È‚¢ó‘Ô‚È‚ç‚à‚¤ˆê“x
    end until @active_battler.inputable?
    @cp_thread.stop
    # ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðƒZƒbƒgƒAƒbƒv
    @active_battler.now_guarding = false
    phase3_setup_command_window
    end
    #--------------------------------------------------------------------------
    # œ ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃ZƒbƒgƒAƒbƒv
    #--------------------------------------------------------------------------
    alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
    def phase3_setup_command_window
    # Œø‰Ê‰¹‚̍ж
    Audio.se_play($data_system_command_up_se) if $data_system_command_up_se != ""
    # –ß‚·
    xrxs_bp1_phase3_setup_command_window
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒY : Šî–{ƒRƒ}ƒ“ƒh)
    #--------------------------------------------------------------------------
    alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
    def update_phase3_basic_command
    # C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
    if Input.trigger?(Input::C)
    # ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
    case @actor_command_window.index
    when 4 # “¦‚°‚é
    if $game_temp.battle_can_escape
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ƒAƒNƒVƒ‡ƒ“‚ðÝ’è
    @active_battler.current_action.kind = 0
    @active_battler.current_action.basic = 4
    # ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
    phase3_next_actor
    else
    # ƒuƒU[ SE ‚ð‰‰‘t
    $game_system.se_play($data_system.buzzer_se)
    end
    return
    end
    end
    xrxs_bsp1_update_phase3_basic_command
    end
    #--------------------------------------------------------------------------
    # œ ƒƒCƒ“ƒtƒF[ƒYŠJŽn
    #--------------------------------------------------------------------------
    alias xrxs_bp1_start_phase4 start_phase4
    def start_phase4
    xrxs_bp1_start_phase4
    # ƒGƒlƒ~[ƒAƒNƒVƒ‡ƒ“ì¬
    for enemy in $game_troop.enemies
    if enemy.cp < 65535
    enemy.current_action.clear
    enemy.current_action.kind = -1 # ƒ^[ƒ“”ò‚΂µB
    next
    end
    enemy.make_action
    end
    # s“®‡˜ì¬
    make_action_orders
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 1 : ƒAƒNƒVƒ‡ƒ“€”õ)
    #--------------------------------------------------------------------------
    alias xrxs_bp1_update_phase4_step1 update_phase4_step1
    def update_phase4_step1
    # ‰Šú‰»
    @phase4_act_continuation = 0
    # Ÿ”s”»’è
    if judge
    @cp_thread.stop
    # Ÿ—˜‚Ü‚½‚Í”s–k‚̏ꍇ : ƒƒ\ƒbƒhI—¹
    return
    end
    # –¢s“®ƒoƒgƒ‰[”z—ñ‚̐擪‚©‚çŽæ“¾
    @active_battler = @action_battlers[0]
    # ƒXƒe[ƒ^ƒXXV‚ðCP‚¾‚¯‚ÉŒÀ’èB
    @status_window.update_cp_only = true
    # ƒXƒe[ƒgXV‚ð‹ÖŽ~B
    @active_battler.slip_state_update_ban = true if @active_battler != nil
    # –ß‚·
    xrxs_bp1_update_phase4_step1
    # ‹ÖŽ~‚ð‰ðœ
    @status_window.update_cp_only = false
    @active_battler.slip_state_update_ban = false if @active_battler != nil
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 2 : ƒAƒNƒVƒ‡ƒ“ŠJŽn)
    #--------------------------------------------------------------------------
    alias xrxs_bp1_update_phase4_step2 update_phase4_step2
    def update_phase4_step2
    # ‹­§ƒAƒNƒVƒ‡ƒ“‚Å‚È‚¯‚ê‚Î
    unless @active_battler.current_action.forcing
    # CP‚ª‘«‚è‚Ä‚¢‚È‚¢ê‡
    if @phase4_act_continuation == 0 and @active_battler.cp < 65535
    @phase4_step = 6
    return
    end
    # §–ñ‚ª [“G‚ð’ʏíUŒ‚‚·‚é] ‚© [–¡•û‚ð’ʏíUŒ‚‚·‚é] ‚̏ꍇ
    if @active_battler.restriction == 2 or @active_battler.restriction == 3
    # ƒAƒNƒVƒ‡ƒ“‚ɍUŒ‚‚ðÝ’è
    @active_battler.current_action.kind = 0
    @active_battler.current_action.basic = 0
    end
    # §–ñ‚ª [s“®‚Å‚«‚È‚¢] ‚̏ꍇ
    if @active_battler.restriction == 4
    # ƒAƒNƒVƒ‡ƒ“‹­§‘Ώۂ̃oƒgƒ‰[‚ðƒNƒŠƒA
    $game_temp.forcing_battler = nil
    if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
    # ƒXƒe[ƒgŽ©‘R‰ðœ
    @active_battler.remove_states_auto
    # CPÁ”ï
    @active_battler.cp = [(@active_battler.cp - 65535),0].max
    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
    @status_window.refresh
    end
    # ƒXƒeƒbƒv 1 ‚Ɉڍs
    @phase4_step = 1
    return
    end
    end
    # ƒAƒNƒVƒ‡ƒ“‚ÌŽí•Ê‚Å•ªŠò
    case @active_battler.current_action.kind
    when 0
    # UŒ‚¥–hŒäE“¦‚°‚éE‰½‚à‚µ‚È‚¢Žž‚Ì‹¤’ʏÁ”ïCP
    @active_battler.cp -= 0 if @phase4_act_continuation == 0
    when 1
    # ƒXƒLƒ‹Žg—pŽž‚̏Á”ïCP
    @active_battler.cp -= 65535 if @phase4_act_continuation == 0
    when 2
    # ƒAƒCƒeƒ€Žg—pŽž‚̏Á”ïCP
    @active_battler.cp -= 65535 if @phase4_act_continuation == 0
    when -1
    # CP‚ª—­‚Ü‚Á‚Ä‚¢‚È‚¢
    @phase4_step = 6
    return
    end
    # CP‰ÁŽZ‚ðˆêŽž’âŽ~‚·‚é
    @cp_thread.stop = true
    # ƒXƒe[ƒgŽ©‘R‰ðœ
    @active_battler.remove_states_auto
    xrxs_bp1_update_phase4_step2
    end
    #--------------------------------------------------------------------------
    # œ Šî–{ƒAƒNƒVƒ‡ƒ“ Œ‹‰Êì¬
    #--------------------------------------------------------------------------
    alias xrxs_bp1_make_basic_action_result make_basic_action_result
    def make_basic_action_result
    # UŒ‚‚̏ꍇ
    if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
    @active_battler.cp -= 65535 # UŒ‚Žž‚ÌCPÁ”ï
    end
    # –hŒä‚̏ꍇ
    if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
    @active_battler.cp -= 32767 # –hŒäŽž‚ÌCPÁ”ï
    end
    # “G‚Ì“¦‚°‚é‚̏ꍇ
    if @active_battler.is_a?(Game_Enemy) and
    @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
    @active_battler.cp -= 65535 # “¦‘–Žž‚ÌCPÁ”ï
    end
    # ‰½‚à‚µ‚È‚¢‚̏ꍇ
    if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
    @active_battler.cp -= 32767 # ‰½‚à‚µ‚È‚¢Žž‚ÌCPÁ”ï
    end
    # “¦‚°‚é‚̏ꍇ
    if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
    @active_battler.cp -= 65535 # “¦‘–Žž‚ÌCPÁ”ï
    # “¦‘–‰Â”\‚Å‚Í‚È‚¢ê‡
    if $game_temp.battle_can_escape == false
    # ƒuƒU[ SE ‚ð‰‰‘t
    $game_system.se_play($data_system.buzzer_se)
    return
    end
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # “¦‘–ˆ—
    update_phase2_escape
    return
    end
    xrxs_bp1_make_basic_action_result
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 5 : ƒ_ƒ[ƒW•\Ž¦)
    #--------------------------------------------------------------------------
    alias xrxs_bp1_update_phase4_step5 update_phase4_step5
    def update_phase4_step5
    # ƒXƒŠƒbƒvƒ_ƒ[ƒW
    if @active_battler.hp > 0 and @active_battler.slip_damage?
    @active_battler.slip_damage_effect
    @active_battler.damage_pop = true
    end
    xrxs_bp1_update_phase4_step5
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 6 : ƒŠƒtƒŒƒbƒVƒ…)
    #--------------------------------------------------------------------------
    alias xrxs_bp1_update_phase4_step6 update_phase4_step6
    def update_phase4_step6
    # CP‰ÁŽZ‚ðÄŠJ‚·‚é
    @cp_thread.stop = false
    # ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ð‰B‚·
    @help_window.visible = false
    xrxs_bp1_update_phase4_step6
    end
    end
    # ¥£¥ XRXS_BP 7. ƒoƒgƒ‹ƒXƒe[ƒ^ƒXEƒNƒŠƒAƒfƒUƒCƒ“ ver.1.02 ¥£¥
    # by ÷‰ë Ý“y, TOMY

    #==============================================================================
    # ¡ Window_BattleStatus
    #==============================================================================
    class Window_BattleStatus < Window_Base
    #--------------------------------------------------------------------------
    # œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
    #--------------------------------------------------------------------------
    attr_accessor :update_cp_only # CPƒ[ƒ^[‚݂̂̍XV
    #--------------------------------------------------------------------------
    # œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
    #--------------------------------------------------------------------------
    alias xrxs_bp7_initialize initialize
    def initialize
    xrxs_bp7_initialize
    # «Full-View‚̏ꍇ‚͉º“ñs‚Ì # ‚ðÁ‚µ‚Ä‚­‚¾‚³‚¢B
    #self.opacity = 0
    #self.back_opacity = 0
    end
    #--------------------------------------------------------------------------
    # œ ƒŠƒtƒŒƒbƒVƒ…
    #--------------------------------------------------------------------------
    alias xrxs_bp7_refresh refresh
    def refresh
    if @update_cp_only
    xrxs_bp7_refresh
    return
    end
    # •`ŽÊ‚ð‹ÖŽ~‚µ‚È‚ª‚ç–ß‚·
    @draw_ban = true
    xrxs_bp7_refresh
    # •`ŽÊ‚Ì‹ÖŽ~‚ð‰ðœ
    @draw_ban = false
    # •`ŽÊ‚ðŠJŽn
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
    actor = $game_party.actors
    actor_x = i * 160 + 21
    # •àsƒLƒƒƒ‰ƒOƒ‰ƒtƒBƒbƒN‚Ì•`ŽÊ
    draw_actor_graphic(actor, actor_x - 9, 116)
    # HP/SPƒ[ƒ^[‚Ì•`ŽÊ
    draw_actor_hp_meter_line(actor, actor_x, 72, 96, 12)
    draw_actor_sp_meter_line(actor, actor_x, 104, 96, 12)
    # HP”’l‚Ì•`ŽÊ
    self.contents.font.size = 24 # HP/SP”’l‚Ì•¶Žš‚Ì‘å‚«‚³
    self.contents.font.color = actor.hp == 0 ? knockout_color :
    actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    draw_shadow_text(actor_x-2, 58, 96, 24, actor.hp.to_s, 2)
    # SP”’l‚Ì•`ŽÊ
    self.contents.font.color = actor.sp == 0 ? knockout_color :
    actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    draw_shadow_text(actor_x-2, 90, 96, 24, actor.sp.to_s, 2)
    # —pŒêuHPv‚Æ—pŒêuSPv‚Ì•`ŽÊ
    self.contents.font.size = 12 # —pŒêuHP/SPv‚Ì•¶Žš‚Ì‘å‚«‚³
    self.contents.font.color = system_color # —pŒêuHP/SPv‚Ì•¶Žš‚̐F
    draw_shadow_text(actor_x, 60, 96, 12, $data_system.words.hp)
    draw_shadow_text(actor_x, 92, 96, 12, $data_system.words.sp)

    draw_actor_state(actor, actor_x, 100)
    end
    end
    end
    #==============================================================================
    # ¡ Window_Base
    #==============================================================================
    class Window_Base < Window
    #--------------------------------------------------------------------------
    # œ HPƒ[ƒ^[ ‚Ì•`‰æ
    #--------------------------------------------------------------------------
    def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
    w = width * actor.hp / actor.maxhp
    hp_color_1 = Color.new(255, 0, 0, 192)
    hp_color_2 = Color.new(255, 255, 0, 192)
    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
    x -= 1
    y += (height/4).floor
    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
    x -= 1
    y += (height/4).ceil
    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
    x -= 1
    y += (height/4).ceil
    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
    end
    #--------------------------------------------------------------------------
    # œ SPƒ[ƒ^[ ‚Ì•`‰æ
    #--------------------------------------------------------------------------
    def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
    w = width * actor.sp / actor.maxsp
    hp_color_1 = Color.new( 0, 0, 255, 192)
    hp_color_2 = Color.new( 0, 255, 255, 192)
    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
    x -= 1
    y += (height/4).floor
    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
    x -= 1
    y += (height/4).ceil
    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
    x -= 1
    y += (height/4).ceil
    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
    end
    #--------------------------------------------------------------------------
    # œ –¼‘O‚Ì•`‰æ
    #--------------------------------------------------------------------------
    alias xrxs_bp7_draw_actor_name draw_actor_name
    def draw_actor_name(actor, x, y)
    xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
    end
    #--------------------------------------------------------------------------
    # œ ƒXƒe[ƒg‚Ì•`‰æ
    #--------------------------------------------------------------------------
    alias xrxs_bp7_draw_actor_state draw_actor_state
    def draw_actor_state(actor, x, y, width = 120)
    xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
    end
    #--------------------------------------------------------------------------
    # œ HP ‚Ì•`‰æ
    #--------------------------------------------------------------------------
    alias xrxs_bp7_draw_actor_hp draw_actor_hp
    def draw_actor_hp(actor, x, y, width = 144)
    xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
    end
    #--------------------------------------------------------------------------
    # œ SP ‚Ì•`‰æ
    #--------------------------------------------------------------------------
    alias xrxs_bp7_draw_actor_sp draw_actor_sp
    def draw_actor_sp(actor, x, y, width = 144)
    xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
    end
    end
    #==============================================================================
    # ž ŠO•”ƒ‰ƒCƒuƒ‰ƒŠ
    #==============================================================================
    class Window_Base
    #--------------------------------------------------------------------------
    # œ ƒ‰ƒCƒ“•`‰æ by ÷‰ë Ý“y
    #--------------------------------------------------------------------------
    def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
    # •`ŽÊ‹——£‚ÌŒvŽZB‘å‚«‚ß‚É’¼ŠpŽž‚Ì’·‚³B
    distance = (start_x - end_x).abs + (start_y - end_y).abs
    # •`ŽÊŠJŽn
    if end_color == start_color
    for i in 1..distance
    x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
    y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
    self.contents.fill_rect(x, y, width, width, start_color)
    end
    else
    for i in 1..distance
    x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
    y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
    r = start_color.red * (distance-i)/distance + end_color.red * i/distance
    g = start_color.green * (distance-i)/distance + end_color.green * i/distance
    b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
    a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
    self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
    end
    end
    end

    #--------------------------------------------------------------------------
    # œ ‰e•¶Žš•`‰æ by TOMY
    #--------------------------------------------------------------------------
    def draw_shadow_text(x, y, width, height, string, align = 0)
    # Œ³‚̐F‚ð•Û‘¶‚µ‚Ä‚¨‚­
    color = self.contents.font.color.dup
    # •Žš‚ʼne•`‰æ
    self.contents.font.color = Color.new(0, 0, 0)
    self.contents.draw_text(x + 2, y + 2, width, height, string, align)
    # Œ³‚̐F‚É–ß‚µ‚Ä•`‰æ
    self.contents.font.color = color
    self.contents.draw_text(x, y, width, height, string, align)
    end
    end
     
  4. omegawhile

    omegawhile Youtube Master Race

    Tham gia ngày:
    25/11/04
    Bài viết:
    17
    [​IMG]
    [​IMG]
    [​IMG]

    This script upgrades the window that shows whether characters can equip the item selected in the shop goods window, and their stat changes from doing so. This script shows the changes in all seven stats that can change from equipping either a weapon or armor. Also, instead of showing the character names in the normal color or disabled color, this scirpt makes it show that the character's graphic is shown in color if they can equip the item, or black and white if they can't. To use this script, replace the entire Window_ShopStatus class with the one provided, and add the new methods Window_Base#up_color and Window_Base#down_color, unless you already have them added from using my equip window script.

    class Window_ShopStatus < Window_Base
    # ---------------------------------------
    def initialize
    super(368, 128, 272, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    @item = nil
    @sprite1 = nil
    @sprite2 = nil
    @sprite3 = nil
    @sprite4 = nil
    @walk = [false, false, false, false]
    @count = 0
    refresh
    end
    # ---------------------------------------
    def refresh
    self.contents.clear
    if @sprite1 != nil
    @sprite1.dispose
    @sprite1 = nil
    end
    if @sprite2 != nil
    @sprite2.dispose
    @sprite2 = nil
    end
    if @sprite3 != nil
    @sprite3.dispose
    @sprite3 = nil
    end
    if @sprite4 != nil
    @sprite4.dispose
    @sprite4 = nil
    end
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    if @item == nil
    return
    end
    case @item
    when RPG::Item
    number = $game_party.item_number(@item.id)
    when RPG::Weapon
    number = $game_party.weapon_number(@item.id)
    when RPG::Armor
    number = $game_party.armor_number(@item.id)
    end
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 200, 32, "Possessed:")
    self.contents.font.color = normal_color
    self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
    if @item.is_a?(RPG::Item)
    @walk = [false, false, false, false]
    return
    end
    for i in 0...$game_party.actors.size
    actor = $game_party.actors
    if @item.is_a?(RPG::Weapon)
    item1 = $data_weapons[actor.weapon_id]
    elsif @item.kind == 0
    item1 = $data_armors[actor.armor1_id]
    elsif @item.kind == 1
    item1 = $data_armors[actor.armor2_id]
    elsif @item.kind == 2
    item1 = $data_armors[actor.armor3_id]
    else
    item1 = $data_armors[actor.armor4_id]
    end
    if not actor.equippable?(@item)
    @walk = false
    draw_actor_graphic(actor, 380, 194 + 64 * i, i, 0)
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    self.contents.font.color = normal_color
    self.contents.draw_text(32, 54 + 64 * i, 150, 32, "Cannot Equip")
    end
    if actor.equippable?(@item)
    @walk = true
    draw_actor_graphic(actor, 380, 194 + 64 * i, i, 1)
    atk1 = 0
    atk2 = 0
    eva1 = 0
    eva2 = 0
    str1 = 0
    str2 = 0
    dex1 = 0
    dex2 = 0
    agi1 = 0
    agi2 = 0
    int1 = 0
    int2 = 0
    pdf1 = 0
    pdf2 = 0
    mdf1 = 0
    mdf2 = 0
    eva1 = 0
    eva2 = 0
    str1 = item1 != nil ? item1.str_plus : 0
    str2 = @item != nil ? @item.str_plus : 0
    dex1 = item1 != nil ? item1.dex_plus : 0
    dex2 = @item != nil ? @item.dex_plus : 0
    agi1 = item1 != nil ? item1.agi_plus : 0
    agi2 = @item != nil ? @item.agi_plus : 0
    int1 = item1 != nil ? item1.int_plus : 0
    int2 = @item != nil ? @item.int_plus : 0
    pdf1 = item1 != nil ? item1.pdef : 0
    pdf2 = @item != nil ? @item.pdef : 0
    mdf1 = item1 != nil ? item1.mdef : 0
    mdf2 = @item != nil ? @item.mdef : 0
    if @item.is_a?(RPG::Weapon)
    atk1 = item1 != nil ? item1.atk : 0
    atk2 = @item != nil ? @item.atk : 0
    end
    if @item.is_a?(RPG::Armor)
    eva1 = item1 != nil ? item1.eva : 0
    eva2 = @item != nil ? @item.eva : 0
    end
    str_change = str2 - str1
    dex_change = dex2 - dex1
    agi_change = agi2 - agi1
    int_change = int2 - int1
    pdf_change = pdf2 - pdf1
    mdf_change = mdf2 - mdf1
    atk_change = atk2 - atk1
    eva_change = eva2 - eva1
    if item1 == nil
    name1 = ""
    else
    name1 = item1.name
    end
    if @item == nil
    name2 = ""
    else
    name2 = @item.name
    end
    if str_change == 0 && dex_change == 0 && agi_change == 0 &&
    pdf_change == 0 && mdf_change == 0 && atk_change == 0 &&
    eva_change == 0 && name1 != name2
    self.contents.draw_text(32, 54 + 64 * i, 150, 32, "No Change")
    end
    if name1 == name2
    self.contents.draw_text(32, 54 + 64 * i, 200, 32, "Currently Equipped")
    end
    self.contents.font.name = "Arial"
    self.contents.font.size = 16
    self.contents.font.color = normal_color
    if @item.is_a?(RPG::Weapon) && atk_change != 0
    self.contents.draw_text(32, 42 + 64 * i, 32, 32, "ATK")
    end
    if @item.is_a?(RPG::Armor) && eva_change != 0
    self.contents.draw_text(32, 42 + 64 * i, 32, 32, "EVA")
    end
    if pdf_change != 0
    self.contents.draw_text(32, 58 + 64 * i, 32, 32, "PDF")
    end
    if mdf_change != 0
    self.contents.draw_text(32, 74 + 64 * i, 32, 32, "MDF")
    end
    if str_change != 0
    self.contents.draw_text(112, 42 + 64 * i, 32, 32, "STR")
    end
    if dex_change != 0
    self.contents.draw_text(112, 58 + 64 * i, 32, 32, "DEX")
    end
    if agi_change != 0
    self.contents.draw_text(112, 74 + 64 * i, 32, 32, "AGI")
    end
    if str_change != 0
    self.contents.draw_text(192, 42 + 64 * i, 32, 32, "INT")
    end
    if @item.is_a?(RPG::Weapon) && atk_change > 0
    self.contents.font.color = up_color
    s = atk_change.abs.to_s
    self.contents.draw_text(60, 42 + 64 * i, 4, 32, "+")
    self.contents.draw_text(62, 42 + 64 * i, 24, 32, s, 2)
    end
    if @item.is_a?(RPG::Weapon) && atk_change < 0
    self.contents.font.color = down_color
    s = atk_change.abs.to_s
    self.contents.draw_text(60, 42 + 64 * i, 4, 32, "-")
    self.contents.draw_text(62, 42 + 64 * i, 24, 32, s, 2)
    end
    if @item.is_a?(RPG::Armor) && eva_change > 0
    self.contents.font.color = up_color
    s = eva_change.abs.to_s
    self.contents.draw_text(60, 42 + 64 * i, 4, 32, "+")
    self.contents.draw_text(62, 42 + 64 * i, 24, 32, s, 2)
    end
    if @item.is_a?(RPG::Armor) && eva_change < 0
    self.contents.font.color = down_color
    s = eva_change.abs.to_s
    self.contents.draw_text(60, 42 + 64 * i, 4, 32, "-")
    self.contents.draw_text(62, 42 + 64 * i, 24, 32, s, 2)
    end
    if pdf_change > 0
    self.contents.font.color = up_color
    s = pdf_change.abs.to_s
    self.contents.draw_text(60, 58 + 64 * i, 4, 32, "+")
    self.contents.draw_text(62, 58 + 64 * i, 24, 32, s, 2)
    end
    if pdf_change < 0
    self.contents.font.color = down_color
    s = pdf_change.abs.to_s
    self.contents.draw_text(60, 58 + 64 * i, 4, 32, "-")
    self.contents.draw_text(62, 58 + 64 * i, 24, 32, s, 2)
    end
    if mdf_change > 0
    self.contents.font.color = up_color
    s = mdf_change.abs.to_s
    self.contents.draw_text(60, 74 + 64 * i, 4, 32, "+")
    self.contents.draw_text(62, 74 + 64 * i, 24, 32, s, 2)
    end
    if mdf_change < 0
    self.contents.font.color = down_color
    s = mdf_change.abs.to_s
    self.contents.draw_text(60, 74 + 64 * i, 4, 32, "-")
    self.contents.draw_text(62, 74 + 64 * i, 24, 32, s, 2)
    end
    if str_change > 0
    self.contents.font.color = up_color
    s = str_change.abs.to_s
    self.contents.draw_text(140, 42 + 64 * i, 4, 32, "+")
    self.contents.draw_text(142, 42 + 64 * i, 24, 32, s, 2)
    end
    if str_change < 0
    self.contents.font.color = down_color
    s = str_change.abs.to_s
    self.contents.draw_text(140, 42 + 64 * i, 4, 32, "-")
    self.contents.draw_text(142, 42 + 64 * i, 24, 32, s, 2)
    end
    if dex_change > 0
    self.contents.font.color = up_color
    s = dex_change.abs.to_s
    self.contents.draw_text(140, 58 + 64 * i, 4, 32, "+")
    self.contents.draw_text(142, 58 + 64 * i, 24, 32, s, 2)
    end
    if dex_change < 0
    self.contents.font.color = down_color
    s = dex_change.abs.to_s
    self.contents.draw_text(140, 58 + 64 * i, 4, 32, "-")
    self.contents.draw_text(142, 58 + 64 * i, 24, 32, s, 2)
    end
    if agi_change > 0
    self.contents.font.color = up_color
    s = agi_change.abs.to_s
    self.contents.draw_text(140, 74 + 64 * i, 4, 32, "+")
    self.contents.draw_text(142, 74 + 64 * i, 24, 32, s, 2)
    end
    if agi_change < 0
    self.contents.font.color = down_color
    s = agi_change.abs.to_s
    self.contents.draw_text(140, 74 + 64 * i, 4, 32, "-")
    self.contents.draw_text(142, 74 + 64 * i, 24, 32, s, 2)
    end
    if int_change > 0
    self.contents.font.color = up_color
    s = int_change.abs.to_s
    self.contents.draw_text(214, 42 + 64 * i, 4, 32, "+")
    self.contents.draw_text(216, 42 + 64 * i, 24, 32, s, 2)
    end
    if int_change < 0
    self.contents.font.color = down_color
    s = int_change.abs.to_s
    self.contents.draw_text(214, 42 + 64 * i, 4, 32, "-")
    self.contents.draw_text(216, 42 + 64 * i, 24, 32, s, 2)
    end
    end
    end
    end
    # ---------------------------------------
    def item=(item)
    if @item != item
    @item = item
    refresh
    end
    end
    # ---------------------------------------
    def draw_actor_graphic(actor, x, y, id, tone_id)
    if id == 0
    @v1 = Viewport.new(380, 194, 32, 48)
    @v1.z = 9998
    @sprite1 = Sprite.new(@v1)
    @sprite1.bitmap = RPG::Cache.character(actor.character_name,
    actor.character_hue)
    if tone_id == 0
    @sprite1.tone = Tone.new(0, 0, 0, 255)
    else
    @sprite1.tone = Tone.new(0, 0, 0, 0)
    end
    @sprite1.visible = true
    end
    if id == 1
    @v2 = Viewport.new(380, 258, 32, 48)
    @v2.z = 9999
    @sprite2 = Sprite.new(@v2)
    @sprite2.bitmap = RPG::Cache.character(actor.character_name,
    actor.character_hue)
    if tone_id == 0
    @sprite2.tone = Tone.new(0, 0, 0, 255)
    else
    @sprite2.tone = Tone.new(0, 0, 0, 0)
    end
    @sprite2.visible = true
    end
    if id == 2
    @v3 = Viewport.new(380, 322, 32, 48)
    @v3.z = 9999
    @sprite3 = Sprite.new(@v3)
    @sprite3.bitmap = RPG::Cache.character(actor.character_name,
    actor.character_hue)
    if tone_id == 0
    @sprite3.tone = Tone.new(0, 0, 0, 255)
    else
    @sprite3.tone = Tone.new(0, 0, 0, 0)
    end
    @sprite3.visible = true
    end
    if id == 3
    @v4 = Viewport.new(380, 386, 32, 48)
    @v4.z = 9999
    @sprite4 = Sprite.new(@v4)
    @sprite4.bitmap = RPG::Cache.character(actor.character_name,
    actor.character_hue)
    if tone_id == 0
    @sprite4.tone = Tone.new(0, 0, 0, 255)
    else
    @sprite4.tone = Tone.new(0, 0, 0, 0)
    end
    @sprite4.visible = true
    end
    end
    # ---------------------------------------
    def update
    super
    @count += 1
    for i in 0..@walk.size
    if @walk == false
    case i
    when 0
    if @sprite1 != nil
    @sprite1.ox = 0
    end
    when 1
    if @sprite2 != nil
    @sprite2.ox = 0
    end
    when 2
    if @sprite3 != nil
    @sprite3.ox = 0
    end
    when 3
    if @sprite4 != nil
    @sprite4.ox = 0
    end
    end
    end
    end
    if @count == 0
    for i in 0..@walk.size
    if @walk == true
    case i
    when 0
    if @sprite1 != nil
    @sprite1.ox = 0
    end
    when 1
    if @sprite2 != nil
    @sprite2.ox = 0
    end
    when 2
    if @sprite3 != nil
    @sprite3.ox = 0
    end
    when 3
    if @sprite4 != nil
    @sprite4.ox = 0
    end
    end
    end
    end
    end
    if @count == 5
    for i in 0..@walk.size
    if @walk == true
    case i
    when 0
    if @sprite1 != nil
    @sprite1.ox = 32
    end
    when 1
    if @sprite2 != nil
    @sprite2.ox = 32
    end
    when 2
    if @sprite3 != nil
    @sprite3.ox = 32
    end
    when 3
    if @sprite4 != nil
    @sprite4.ox = 32
    end
    end
    end
    end
    end
    if @count == 10
    for i in 0..@walk.size
    if @walk == true
    case i
    when 0
    if @sprite1 != nil
    @sprite1.ox = 64
    end
    when 1
    if @sprite2 != nil
    @sprite2.ox = 64
    end
    when 2
    if @sprite3 != nil
    @sprite3.ox = 64
    end
    when 3
    if @sprite4 != nil
    @sprite4.ox = 64
    end
    end
    end
    end
    end
    if @count == 15
    @count = 0
    end
    end
    end


    ----

    class Window_Base < Window
    [...]
    # --------------------------------
    def up_color
    return Color.new(74, 210, 74)
    end
    # --------------------------------
    def down_color
    return Color.new(170, 170, 170)
    end
     
  5. omegawhile

    omegawhile Youtube Master Race

    Tham gia ngày:
    25/11/04
    Bài viết:
    17

Chia sẻ trang này