赞 | 0 |
VIP | 27 |
好人卡 | 4 |
积分 | 1 |
经验 | 1135 |
最后登录 | 2013-3-2 |
在线时间 | 18 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 18 小时
- 注册时间
- 2012-1-26
- 帖子
- 22
|
- # ————————————————————————————————————
- # 本脚本来自www.66rpg.com,转载请保留此信息
- # ————————————————————————————————————
- class Game_Actor < Game_Battler
- def now_exp
- return @exp - @exp_list[@level]
- end
- def next_exp
- return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
- end
- end
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● HP ゲージの描画
- #--------------------------------------------------------------------------
- alias :draw_actor_hp_original :draw_actor_hp
- def draw_actor_hp(actor, x, y, width = 144)
- if actor.maxhp != 0
- rate = actor.hp.to_f / actor.maxhp
- else
- rate = 0
- end
- plus_x = 0
- rate_x = 0
- plus_y = 25
- plus_width = 0
- rate_width = 100
- height = 10
- align1 = 1
- align2 = 2
- align3 = 0
- grade1 = 1
- grade2 = 0
- color1 = Color.new(0, 0, 0, 192)
- color2 = Color.new(255, 255, 192, 192)
- color3 = Color.new(0, 0, 0, 192)
- color4 = Color.new(64, 0, 0, 192)
- color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
- color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
- if actor.maxhp != 0
- hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
- else
- hp = 0
- end
- gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
- width, plus_width + width * rate_width / 100,
- height, hp, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- draw_actor_hp_original(actor, x, y, width)
- end
- #--------------------------------------------------------------------------
- # ● SP ゲージの描画
- #--------------------------------------------------------------------------
- # オリジナルのSP描画を draw_actor_sp_original と名前変更
- alias :draw_actor_sp_original :draw_actor_sp
- def draw_actor_sp(actor, x, y, width = 144)
- # 変数rateに 現在のSP/MSPを代入
- if actor.maxsp != 0
- rate = actor.sp.to_f / actor.maxsp
- else
- rate = 1
- end
- # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
- # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
- # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
- # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
- # align3:ゲージタイプ 0:左詰め 1:右詰め
- plus_x = 0
- rate_x = 0
- plus_y = 25
- plus_width = 0
- rate_width = 100
- height = 10
- align1 = 1
- align2 = 2
- align3 = 0
- # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
- # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション(激重))
- grade1 = 1
- grade2 = 0
- # 色設定。color1:外枠,color2:中枠
- # color3:空ゲージダークカラー,color4:空ゲージライトカラー
- # color5:実ゲージダークカラー,color6:実ゲージライトカラー
- color1 = Color.new(0, 0, 0, 192)
- color2 = Color.new(255, 255, 192, 192)
- color3 = Color.new(0, 0, 0, 192)
- color4 = Color.new(0, 64, 0, 192)
- color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
- color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
- # 変数spに描画するゲージの幅を代入
- if actor.maxsp != 0
- sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
- else
- sp = (width + plus_width) * rate_width / 100
- end
- # ゲージの描画
- gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
- width, plus_width + width * rate_width / 100,
- height, sp, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- # オリジナルのSP描画処理を呼び出し
- draw_actor_sp_original(actor, x, y, width)
- end
- #--------------------------------------------------------------------------
- # ● EXP ゲージの描画
- #--------------------------------------------------------------------------
- # オリジナルのEXP描画を draw_actor_sp_original と名前変更
- alias :draw_actor_exp_original :draw_actor_exp
- def draw_actor_exp(actor, x, y, width = 144)
- # 変数rateに 現在のexp/nextexpを代入
- if actor.next_exp != 0
- rate = actor.now_exp.to_f / actor.next_exp
- else
- rate = 1
- end
- # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
- # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
- # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
- # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
- # align3:ゲージタイプ 0:左詰め 1:右詰め
- plus_x = 0
- rate_x = 0
- plus_y = 25
- plus_width = 0
- rate_width = 100
- height = 10
- align1 = 1
- align2 = 2
- align3 = 0
- # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
- # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション(激重))
- grade1 = 1
- grade2 = 0
- # 色設定。color1:外枠,color2:中枠
- # color3:空ゲージダークカラー,color4:空ゲージライトカラー
- # color5:実ゲージダークカラー,color6:実ゲージライトカラー
- color1 = Color.new(0, 0, 0, 192)
- color2 = Color.new(255, 255, 192, 192)
- color3 = Color.new(0, 0, 0, 192)
- color4 = Color.new(64, 0, 0, 192)
- color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
- color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)
- # 変数expに描画するゲージの幅を代入
- if actor.next_exp != 0
- exp = (width + plus_width) * actor.now_exp * rate_width / 100 / actor.next_exp
- else
- exp = (width + plus_width) * rate_width / 100
- end
- # ゲージの描画
- gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
- width, plus_width + width * rate_width / 100,
- height, exp, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- # オリジナルのEXP描画処理を呼び出し
- draw_actor_exp_original(actor, x, y+10)
- end
- #--------------------------------------------------------------------------
- # ● 延迟时间描画
- #--------------------------------------------------------------------------
- def draw_actor_delay_time(actor, x, y, width = 144)
- # 変数rateに 現在のSP/MSPを代入
- if actor.delay_time_max != 0
- rate = actor.delay_time.to_f / actor.delay_time_max
- else
- rate = 0
- end
- # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
- # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
- # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
- # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
- # align3:ゲージタイプ 0:左詰め 1:右詰め
- plus_x = 0
- rate_x = 0
- plus_y = 25
- plus_width = 0
- rate_width = 100
- height = 10
- align1 = 1
- align2 = 2
- align3 = 0
- # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
- # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション(激重))
- grade1 = 1
- grade2 = 0
- # 色設定。color1:外枠,color2:中枠
- # color3:空ゲージダークカラー,color4:空ゲージライトカラー
- # color5:実ゲージダークカラー,color6:実ゲージライトカラー
- color1 = Color.new(0, 0, 0, 192)
- color2 = Color.new(255, 255, 192, 192)
- color3 = Color.new(0, 0, 0, 192)
- color4 = Color.new(0, 64, 0, 192)
- color5 = Color.new(100 * rate, 100 * rate, 0, 192)
- color6 = Color.new(255 * rate, 255 * rate, 0, 192)
- # 変数spに描画するゲージの幅を代入
- if actor.delay_time_max != 0
- sp = (width + plus_width) * actor.delay_time * rate_width / 100 / actor.delay_time_max
- else
- sp = (width + plus_width) * rate_width / 100
- end
- # ゲージの描画
- gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
- width, plus_width + width * rate_width / 100,
- height, sp, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- # 描绘字符串 "行动时间"
- self.contents.font.color = system_color
- self.contents.font.size = 20
- self.contents.draw_text(x, y, 120, 32, 'Delay')
- self.contents.font.color = normal_color
- self.contents.draw_text(x, y, 120, 32, actor.delay_time.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 咏唱时间描画
- #--------------------------------------------------------------------------
- def draw_actor_casting_time(actor, x, y, width = 144)
- # 変数rateに 現在のSP/MSPを代入
- time = actor.casting_time_max - actor.casting_time
- if actor.casting_time_max != 0
- rate = time.to_f / actor.casting_time_max
- else
- rate = 0
- end
- # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
- # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
- # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
- # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
- # align3:ゲージタイプ 0:左詰め 1:右詰め
- plus_x = 0
- rate_x = 0
- plus_y = 25
- plus_width = 0
- rate_width = 100
- height = 10
- align1 = 1
- align2 = 2
- align3 = 0
- # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
- # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション(激重))
- grade1 = 1
- grade2 = 0
- # 色設定。color1:外枠,color2:中枠
- # color3:空ゲージダークカラー,color4:空ゲージライトカラー
- # color5:実ゲージダークカラー,color6:実ゲージライトカラー
- color1 = Color.new(0, 0, 0, 192)
- color2 = Color.new(255, 255, 192, 192)
- color3 = Color.new(0, 0, 0, 192)
- color4 = Color.new(0, 64, 0, 192)
- color5 = Color.new(100 * rate, 100 * rate, 0, 192)
- color6 = Color.new(255 * rate, 255 * rate, 0, 192)
- # 変数spに描画するゲージの幅を代入
- if actor.casting_time_max != 0
- sp = (width + plus_width) * time * rate_width / 100 / actor.casting_time_max
- else
- sp = (width + plus_width) * rate_width / 100
- end
- # ゲージの描画
- gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
- width, plus_width + width * rate_width / 100,
- height, sp, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- # 描绘字符串 "行动时间"
- self.contents.font.color = system_color
- self.contents.font.size = 20
- self.contents.draw_text(x, y, 120, 32, 'Cast')
- self.contents.font.color = normal_color
- self.contents.draw_text(x, y, 120, 32, time.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● ゲージの描画
- #--------------------------------------------------------------------------
- def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- case align1
- when 1
- x += (rect_width - width) / 2
- when 2
- x += rect_width - width
- end
- case align2
- when 1
- y -= height / 2
- when 2
- y -= height
- end
- # 枠描画
- self.contents.fill_rect(x, y, width, height, color1)
- self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
- if align3 == 0
- if grade1 == 2
- grade1 = 3
- end
- if grade2 == 2
- grade2 = 3
- end
- end
- if (align3 == 1 and grade1 == 0) or grade1 > 0
- color = color3
- color3 = color4
- color4 = color
- end
- if (align3 == 1 and grade2 == 0) or grade2 > 0
- color = color5
- color5 = color6
- color6 = color
- end
- # 空ゲージの描画
- self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
- color3, color4, grade1)
- if align3 == 1
- x += width - gauge
- end
- # 実ゲージの描画
- self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
- color5, color6, grade2)
- end
- end
- #------------------------------------------------------------------------------
- # Bitmapクラスに新たな機能を追加します。
- #==============================================================================
- class Bitmap
- #--------------------------------------------------------------------------
- # ● 矩形をグラデーション表示
- # color1 : スタートカラー
- # color2 : エンドカラー
- # align : 0:横にグラデーション
- # 1:縦にグラデーション
- # 2:斜めにグラデーション(激重につき注意)
- #--------------------------------------------------------------------------
- def gradation_rect(x, y, width, height, color1, color2, align = 0)
- if align == 0
- for i in x...x + width
- red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
- green = color1.green +
- (color2.green - color1.green) * (i - x) / (width - 1)
- blue = color1.blue +
- (color2.blue - color1.blue) * (i - x) / (width - 1)
- alpha = color1.alpha +
- (color2.alpha - color1.alpha) * (i - x) / (width - 1)
- color = Color.new(red, green, blue, alpha)
- fill_rect(i, y, 1, height, color)
- end
- elsif align == 1
- for i in y...y + height
- red = color1.red +
- (color2.red - color1.red) * (i - y) / (height - 1)
- green = color1.green +
- (color2.green - color1.green) * (i - y) / (height - 1)
- blue = color1.blue +
- (color2.blue - color1.blue) * (i - y) / (height - 1)
- alpha = color1.alpha +
- (color2.alpha - color1.alpha) * (i - y) / (height - 1)
- color = Color.new(red, green, blue, alpha)
- fill_rect(x, i, width, 1, color)
- end
- elsif align == 2
- for i in x...x + width
- for j in y...y + height
- red = color1.red + (color2.red - color1.red) *
- ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- green = color1.green + (color2.green - color1.green) *
- ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- blue = color1.blue + (color2.blue - color1.blue) *
- ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- alpha = color1.alpha + (color2.alpha - color1.alpha) *
- ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- color = Color.new(red, green, blue, alpha)
- set_pixel(i, j, color)
- end
- end
- elsif align == 3
- for i in x...x + width
- for j in y...y + height
- red = color1.red + (color2.red - color1.red) *
- ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- green = color1.green + (color2.green - color1.green) *
- ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- blue = color1.blue + (color2.blue - color1.blue) *
- ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- alpha = color1.alpha + (color2.alpha - color1.alpha) *
- ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- color = Color.new(red, green, blue, alpha)
- set_pixel(i, j, color)
- end
- end
- end
- end
- end
复制代码- #============================================================================================
- # 本脚本来自www.66RPG.com,转载和使用请保留此信息
- #============================================================================================
- # ▼▲▼ XRXS26BX. +BUZZデザイン ▼▲▼ built 033109
- # by 桜雅 在土
- #==============================================================================
- # □ 初始化定义
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #
- # 不显示能力值的角色编号
- #
- NO_PARAMETER_ACTORS = []
- end
- #==============================================================================
- # ■ Window_MenuStatus
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include XRXS26
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :newitem_window
- attr_reader :bottomkeyhelp_window
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- alias xrxs26bx_initialize initialize
- def initialize
- # 呼び戻す
- xrxs26bx_initialize
- # 寄生してウィンドウを作成
- # ボトルキーヘルプウィンドウ
- @bottomkeyhelp_window = Window_BottomKeyHelp.new
- @bottomkeyhelp_window.visible = false
- # 設定変更
- self.height = 448
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- @column_max = 2
- y = (FRONT_MEMBER_LIMIT+1)/2 * 64 + 28
- self.contents.font.size = 16
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 92, 28, "队伍中")
- self.contents.draw_text(4, y, 92, 28, "休息中")
- for i in 0...$game_party.actors.size
- x = 64 + i%2 * 224
- y = i/2 * 72 + 24
- actor = $game_party.actors[i]
- if i >= FRONT_MEMBER_LIMIT
- y += 32
- self.contents.font.color = disabled_color
- self.contents.draw_text(x, y, 120, 32, actor.name)
- else
- draw_actor_name(actor , x , y )
- end
- draw_actor_graphic(actor, x - 40, y + 64)
- unless NO_PARAMETER_ACTORS.include?(actor.id)
- draw_actor_level(actor , x + 94, y )
- draw_actor_hp(actor , x, y + 16)
- draw_actor_sp(actor , x, y + 32)
- draw_actor_exp(actor , x, y + 48)
- draw_actor_state(actor , x, y + 48)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ フレーム更新
- #--------------------------------------------------------------------------
- def update
- # ウィンドウを更新
- @bottomkeyhelp_window.update
- super
- end
- #--------------------------------------------------------------------------
- # ○ 解放
- #--------------------------------------------------------------------------
- def dispose
- @bottomkeyhelp_window.dispose
- super
- end
- #--------------------------------------------------------------------------
- # ● カーソルの矩形更新
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- y = @index/2 * 72 + 28
- if @index >= FRONT_MEMBER_LIMIT
- y += 32
- end
- self.cursor_rect.set(@index%2 * 224, y, 224, 72)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- alias xrxs26bx_update update
- def update
- # 登録
- if @bottomkeyhelp_window.nil?
- @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
- @bottomkeyhelp_window.visible =false
- set_keyhelp1
- end
- # 呼び戻す
- xrxs26bx_update
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26bx_update_command update_command
- def update_command
- # 呼び戻す
- xrxs26bx_update_command
- # 入れ替え移行キーが押されたとき
- if @command_window.index == -1 and @status_window.active
- set_keyhelp2
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26bx_update_status update_status
- def update_status
- # 保存
- last_index = @status_window.index2
- # 呼び戻す
- xrxs26bx_update_status
- #
- if last_index != @status_window.index2
- # 一人目を選択した場合
- if @status_window.index2 >= 0
- set_keyhelp3
- else
- set_keyhelp2
- end
- end
- # 戻った場合
- unless @status_window.active
- set_keyhelp1
- end
- end
- #--------------------------------------------------------------------------
- # ○ キーヘルプを設定 1
- #--------------------------------------------------------------------------
- def set_keyhelp1
- @bottomkeyhelp_window.clear
- @bottomkeyhelp_window.add("B","关闭本窗口")
- @bottomkeyhelp_window.add("C","确定")
- @bottomkeyhelp_window.add("→","人物顺序调整")
- end
- #--------------------------------------------------------------------------
- # ○ キーヘルプを設定 2
- #--------------------------------------------------------------------------
- def set_keyhelp2
- @bottomkeyhelp_window.clear
- @bottomkeyhelp_window.add("←,B","返回")
- @bottomkeyhelp_window.add("C","第一个人物确定")
- end
- #--------------------------------------------------------------------------
- # ○ キーヘルプを設定 3
- #--------------------------------------------------------------------------
- def set_keyhelp3
- @bottomkeyhelp_window.clear
- @bottomkeyhelp_window.add("B","返回")
- @bottomkeyhelp_window.add("C","第二个人物确定")
- end
- end
-
- #==============================================================================
- # □ Window_BottomKeyHelp
- #------------------------------------------------------------------------------
- # 画面下で操作説明をする透明なウィンドウです。
- #==============================================================================
- class Window_BottomKeyHelp < Window_Base
- #--------------------------------------------------------------------------
- # ○ オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- super(0, 432, 640, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- clear
- end
- #--------------------------------------------------------------------------
- # ○ クリア
- #--------------------------------------------------------------------------
- def clear
- self.contents.clear
- @now_x = 608
- end
- #--------------------------------------------------------------------------
- # ○ 追加
- #--------------------------------------------------------------------------
- def add(key, explanation)
- # 計算
- self.contents.font.size = 20
- x = self.contents.text_size(key).width
- self.contents.font.size = 16
- x += self.contents.text_size(explanation).width + 8
- @now_x -= x
- # 描写
- self.contents.font.size = 20
- self.contents.font.color = system_color
- self.contents.draw_text(@now_x, 0, x, 32, key, 0)
- self.contents.font.size = 16
- self.contents.font.color = normal_color
- self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
- # 余白
- @now_x -= 32
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 |
|