赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 556 |
最后登录 | 2014-9-3 |
在线时间 | 0 小时 |
Lv1.梦旅人 幻想
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 0 小时
- 注册时间
- 2007-12-23
- 帖子
- 1016
|
5楼
楼主 |
发表于 2008-3-19 05:02:48
|
只看该作者
经测试知道是那个脚本搞的鬼了用2个如下
- # ————————————————————————————————————
- # 本脚本来自www.66rpg.com,转载请保留此信息
- # ————————————————————————————————————
- # ▼▲▼ XRXS_BP 7. バトルステータス?クリアデザイン ver.1.03 ▼▲▼
- # by 桜雅 在土
- #==============================================================================
- # ■ Window_BattleStatus
- #==============================================================================
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_accessor :update_cp_only # CPメーターのみの更新
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- alias xrxs_bp7_initialize initialize
- def initialize
- # 初期化
- @previous_hp = []
- @previous_sp = []
- # 呼び戻す
- xrxs_bp7_initialize
- # ↓Full-Viewの場合は下二行の # を消してください。
- self.opacity = 160
- self.back_opacity = 160
-
- =begin
- @hp = []
- for j in 0...$game_party.actors.size
- @hp[j] = $game_party.actors[j].hp
- end
- @refresh_flag = true
- refresh
- =end
-
-
- end
- #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
- def draw_battler_graphic(actor, x, y)
- battler=RPG::Cache.battler(actor.battler_name, actor.battler_hue)
- w = battler.width
- h = battler.height
- self.contents.blt(x-w/2, y-h, battler, Rect.new(0, 0, w,h +3),255)
- self.z = 20
- end
- #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- alias xrxs_bp7_refresh refresh
- def refresh
- # CPメーターの更新のみ の場合
- if @update_cp_only
- xrxs_bp7_refresh
- return
- end
- # 変更するものがない場合、飛ばす
- @item_max = $game_party.actors.size
- bool = false
- for i in 0...@item_max
- actor = $game_party.actors[i]
- if (@previous_hp[i] != actor.hp) or (@previous_sp[i] != actor.sp)
- bool = true
- end
- end
- return if bool == false
- # 描写を開始
- self.contents.clear
- for i in 0...@item_max
- actor = $game_party.actors[i]
- actor_x = i * 160 + 21
- # 歩行キャラグラフィックの描写
- draw_battler_graphic(actor, actor_x + 43, 80)
- # HP/SPメーターの描写
-
-
- draw_actor_hp_meter_line(actor, actor_x - 17, 82, 120, 10)
-
-
- draw_actor_sp_meter_line(actor, actor_x - 17, 98, 120, 10)
- # HP数値の描写
- self.contents.font.size = 18 # HP/SP数値の文字の大きさ
- self.contents.font.color = Color.new(0,0,0,192)
- #self.contents.draw_text(actor_x, 72, 96, 24, actor.hp.to_s, 2)
- self.contents.font.color = actor.hp == 0 ? knockout_color :
- actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
- self.contents.draw_text(actor_x-2, 70, 96, 24, actor.hp.to_s, 2)
- # SP数値の描写
- self.contents.font.color = Color.new(0,0,0,192)
- #self.contents.draw_text(actor_x, 88, 96, 24, actor.sp.to_s, 2)
- self.contents.font.color = actor.sp == 0 ? knockout_color :
- actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
- self.contents.draw_text(actor_x-2, 86, 96, 24, actor.sp.to_s, 2)
- # 用語「HP」と用語「SP」の描写
- self.contents.font.size = 18 # 用語「HP/SP」の文字の大きさ
- self.contents.font.color = Color.new(0,0,0,192)
- self.contents.draw_text(actor_x - 7, 74, 196, 24, $data_system.words.hp)
- self.contents.draw_text(actor_x - 7, 90, 196, 24, $data_system.words.sp)
- self.contents.font.color = system_color # 用語「HP/SP」の文字の色
- self.contents.draw_text(actor_x - 7, 72, 196, 24, $data_system.words.hp)
- self.contents.draw_text(actor_x - 7, 88, 196, 24, $data_system.words.sp)
- # ステートの描写
- draw_actor_state(actor, actor_x-20, 103) #X- 55
- # 描画角色姓名
- draw_actor_name(actor, actor_x-15, -8)
- # 値を更新
- @previous_hp[i] = actor.hp
- @previous_sp[i] = actor.sp
- 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
- #--------------------------------------------------------------------------
- # ● 名前の描画
- #--------------------------------------------------------------------------
- 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
- #--------------------------------------------------------------------------
- # ● ステートの描画
- #--------------------------------------------------------------------------
- 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
- #==============================================================================
- # ■ Scene_Battle
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- alias xrxs_bp7_update update
- def update
- xrxs_bp7_update
- # メッセージウィンドウ表示中の場合
- if $game_temp.message_window_showing
- @status_window.update_cp_only = true
- else
- @status_window.update_cp_only = false
- end
- end
- end
- #==============================================================================
- # ◇ 外部ライブラリ
- #==============================================================================
- class Window_Base
- #--------------------------------------------------------------------------
- # ● ライン描画 軽量版 by 桜雅 在土
- #--------------------------------------------------------------------------
- def draw_lineght(start_x, start_y, end_x, end_y, start_color)
- # 描写距離の計算。大きめに直角時の長さ。
- distance = (start_x - end_x).abs + (start_y - end_y).abs
- # 描写開始
- 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.set_pixel(x, y, start_color)
- end
- end
- #--------------------------------------------------------------------------
- # ● ライン描画 by 桜雅 在土
- #--------------------------------------------------------------------------
- def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
- # 描写距離の計算。大きめに直角時の長さ。
- distance = (start_x - end_x).abs + (start_y - end_y).abs
- # 描写開始
- 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
- if width == 1
- self.contents.set_pixel(x, y, start_color)
- else
- self.contents.fill_rect(x, y, width, width, start_color)
- end
- 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
- if width == 1
- self.contents.set_pixel(x, y, Color.new(r, g, b, a))
- else
- self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
- end
- end
- end
- end
- end
复制代码 这是战斗血条脚本
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(320 - $game_party.actors.size*80, 320, 160*$game_party.actors.size, 160)
- @w = []
- for i in 0..$game_party.actors.size-1
- @w[i] = Window_Base.new(320 - $game_party.actors.size*80 + i*160,320,160,160)
- @w[i].back_opacity = 0
- end
- self.contents = Bitmap.new(width - 32, height - 32)
- @level_up_flags = [false, false, false, false]
- @hp = []
- for j in 0...$game_party.actors.size
- @hp[j] = $game_party.actors[j].hp
- end
- @refresh_flag = true
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 释放
- #--------------------------------------------------------------------------
- def dispose
- super
- for w in @w
- w.dispose
- end
- end
- #--------------------------------------------------------------------------
- # ● 设置升级标志
- # actor_index : 角色索引
- #--------------------------------------------------------------------------
- def level_up(actor_index)
- @level_up_flags[actor_index] = true
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- actor_x = i * 160 + 4
- draw_actor_name(actor, actor_x, 0)
- draw_actor_hp(@hp[i], actor_x, 32, 120)
- draw_actor_sp(actor, actor_x, 64, 120)
- if @level_up_flags[i]
- self.contents.font.color = normal_color
- self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
- else
- draw_actor_state(actor, actor_x, 96)
- end
- end
- @refresh_flag = false
- end
- #--------------------------------------------------------------------------
- # ● 描绘 HP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_hp(number, x, y, width = 144)
- # 描绘字符串 "HP"
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
- self.contents.font.color = normal_color
- self.contents.draw_text(x+72, y, 48, 32, number.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 主界面的不透明度下降
- if $game_temp.battle_main_phase
- self.contents_opacity -= 4 if self.contents_opacity > 191
- else
- self.contents_opacity += 4 if self.contents_opacity < 255
- end
- for i in 0...$game_party.actors.size
- if @hp[i] != $game_party.actors[i].hp
- @refresh_flag = true
- if @hp[i] > $game_party.actors[i].hp
- @hp[i] -= 1
- else
- @hp[i] += 1
- end
- end
- end
- refresh if @refresh_flag
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
-
-
复制代码 不知道怎么说····大家应该看得出··就是这2个脚本我把后者删了就没刷新滞后的现象了怎么解决? |
|