赞 | 11 |
VIP | 94 |
好人卡 | 57 |
积分 | 39 |
经验 | 47770 |
最后登录 | 2025-6-19 |
在线时间 | 1586 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 3875
- 在线时间
- 1586 小时
- 注册时间
- 2006-5-5
- 帖子
- 2742
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
最近用了下面的脚本,发现其他的都很好,就是不显示角色的名字了。
请问诸位大侠有办法保持它原有功能基础上填加角色名字吗?
- #==============================================================================
- # 本脚本来自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 = 0
- #self.back_opacity = 0
- 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_actor_graphic(actor, actor_x - 9, 116)
- # HP/SPメーターの描写
- draw_actor_hp_meter_line(actor, actor_x, 52, 96, 12)
- draw_actor_sp_meter_line(actor, actor_x, 84, 96, 12)
- # HP数値の描写
- self.contents.font.size = 24 # HP/SP数値の文字の大きさ
- self.contents.font.color = Color.new(0,0,0,192)
- self.contents.draw_text(actor_x, 40, 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, 38, 96, 24, actor.hp.to_s, 2)
- # SP数値の描写
- self.contents.font.color = Color.new(0,0,0,192)
- self.contents.draw_text(actor_x, 72, 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, 70, 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+2, 32, 196, 24, $data_system.words.hp)
- self.contents.draw_text(actor_x+2, 64, 196, 24, $data_system.words.sp)
- self.contents.font.color = system_color # 用語「HP/SP」の文字の色
- self.contents.draw_text(actor_x, 30, 196, 24, $data_system.words.hp)
- self.contents.draw_text(actor_x, 62, 196, 24, $data_system.words.sp)
- # ステートの描写
- draw_actor_state(actor, actor_x, 100)
- # 値を更新
- @previous_hp[i] = actor.hp
- @previous_hp[i] = actor.hp
- 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,1].max
- 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,1].max
- 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_Base < Window
- #--------------------------------------------------------------------------
- # * Draw Slant Bar
- #--------------------------------------------------------------------------
- def draw_slant_bar(x, y, min, max, width = 152, height = 6,
- bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
- # Draw Border
- for i in 0..height
- self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
- end
- # Draw Background
- for i in 1..(height - 1)
- r = 100 * (height - i) / height + 0 * i / height
- g = 100 * (height - i) / height + 0 * i / height
- b = 100 * (height - i) / height + 0 * i / height
- a = 255 * (height - i) / height + 255 * i / height
- self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
- end
- # Draws Bar
- for i in 1..( (min / max.to_f) * width - 1)
- for j in 1..(height - 1)
- r = bar_color.red * (width - i) / width + end_color.red * i / width
- g = bar_color.green * (width - i) / width + end_color.green * i / width
- b = bar_color.blue * (width - i) / width + end_color.blue * i / width
- a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
- self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
- end
- end
- end
- end
- class Window_EnemyHP < Window_Base
-
- def initialize
- super(0, 0, 640, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- refresh
- end
-
- def refresh
- self.contents.clear
- for i in 0...$game_troop.enemies.size
- @enemy = $game_troop.enemies[i]
- @percent = (@enemy.hp * 100) / @enemy.maxhp
- unless @enemy.hp == 0
- draw_slant_bar(@enemy.screen_x - 55, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 75, height = 6, bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
- self.contents.draw_text(@enemy.screen_x - 39, @enemy.screen_y - 22, 100, 32, "#{@percent}" + "%")
- end
- end
- end
- end
-
- class Scene_Battle
-
- alias raz_update update
- alias raz_update_phase5 update_phase5
- alias raz_update_phase4_step1 update_phase4_step1
- alias raz_update_phase4_step5 update_phase4_step5
- alias raz_enemy_hp_main main
-
- def main
- @troop_id = $game_temp.battle_troop_id
- $game_troop.setup(@troop_id)
- @enemy_window = Window_EnemyHP.new
- @enemy_window.z = 95
- raz_enemy_hp_main
- @enemy_window.dispose
- end
-
- def update
- @enemy_window.update
- raz_update
- end
- def update_phase5
- # If wait count is larger than 0
- if @phase5_wait_count > 0
- # Decrease wait count
- @phase5_wait_count -= 1
- # If wait count reaches 0
- if @phase5_wait_count == 0
- @enemy_window.visible = false
- # Show result window
- @result_window.visible = true
- # Clear main phase flag
- $game_temp.battle_main_phase = false
- # Refresh status window
- @status_window.refresh
- @enemy_window.refresh
- end
- return
- end
- raz_update_phase5
- end
- def update_phase4_step1
- raz_update_phase4_step1
- @enemy_window.refresh
- end
- def update_phase4_step5
- # Hide help window
- @help_window.visible = false
- # Refresh status window
- @status_window.refresh
- @enemy_window.refresh
- raz_update_phase4_step5
- end
- end
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(0, 320, 640, 160)
- self.contents = Bitmap.new(width - 32, height - 32)
- @level_up_flags = [false, false, false, false]
- refresh
- end
- #--------------------------------------------------------------------------
- # * Dispose
- #--------------------------------------------------------------------------
- def dispose
- super
- end
- #--------------------------------------------------------------------------
- # * Set Level Up Flag
- # actor_index : actor index
- #--------------------------------------------------------------------------
- def level_up(actor_index)
- @level_up_flags[actor_index] = true
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- 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_slant_bar(actor_x, 55, actor.hp, actor.maxhp, 120)
- draw_slant_bar(actor_x, 88, actor.sp, actor.maxsp, 120, 6, bar_color = Color.new(150, 0, 150, 255), end_color = Color.new(0, 0, 255, 255))
- draw_actor_name(actor, actor_x, 0)
- draw_actor_hp(actor, 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
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- super
- # Slightly lower opacity level during main phase
- 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
- end
- end
复制代码
解答任意一个都可以。 此贴于 2009-3-19 10:23:34 被版主redant提醒,请楼主看到后对本贴做出回应。 此贴于 2009-3-20 9:53:55 被版主redant提醒,请楼主看到后对本贴做出回应。 版务信息:本贴由楼主自主结贴~ |
|