设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1342|回复: 2
打印 上一主题 下一主题

血条显示错误是怎么回事?

 关闭 [复制链接]

Lv2.观梦者

梦石
0
星屑
253
在线时间
574 小时
注册时间
2006-8-25
帖子
969
跳转到指定楼层
1
发表于 2007-8-25 22:56:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
脚本 '血条2' 206行发生了 ArgumentError
wrong number of arguments(4 ofr 3)

下面是显示HP/SP条的脚本,我仿写加入了EXP条(虽然不知道其实有没有maxexp这样东西-.-)

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. # ————————————————————————————————————

  5. # ▼▲▼ XRXS_BP 7. バトルステータス?クリアデザイン ver.1.03 ▼▲▼
  6. # by 桜雅 在土

  7. #==============================================================================
  8. # ■ Window_BattleStatus
  9. #==============================================================================
  10. class Window_BattleStatus < Window_Base
  11.   #--------------------------------------------------------------------------
  12.   # ● 公開インスタンス変数
  13.   #--------------------------------------------------------------------------
  14.   attr_accessor :update_cp_only # CPメーターのみの更新
  15.   #--------------------------------------------------------------------------
  16.   # ● オブジェクト初期化
  17.   #--------------------------------------------------------------------------
  18.   alias xrxs_bp7_initialize initialize
  19.   def initialize
  20.     # 初期化
  21.     @previous_hp = []
  22.     @previous_sp = []
  23.     @previous_exp = []
  24.     # 呼び戻す
  25.     xrxs_bp7_initialize
  26.     # ↓Full-Viewの場合は下二行の # を消してください。
  27.     #self.opacity = 0
  28.     #self.back_opacity = 0
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # ● リフレッシュ
  32.   #--------------------------------------------------------------------------
  33.   alias xrxs_bp7_refresh refresh
  34.   def refresh
  35.     # CPメーターの更新のみ の場合
  36.     if @update_cp_only
  37.       xrxs_bp7_refresh
  38.       return
  39.     end
  40.     # 変更するものがない場合、飛ばす
  41.     @item_max = $game_party.actors.size
  42.     bool = false
  43.     for i in 0...@item_max
  44.       actor = $game_party.actors[i]
  45.       if (@previous_hp[i] != actor.hp) or (@previous_sp[i] != actor.sp)
  46.         bool = true
  47.       end
  48.     end
  49.     return if bool == false
  50.     # 描写を開始
  51.     self.contents.clear
  52.     for i in 0...@item_max
  53.       actor = $game_party.actors[i]
  54.       actor_x = i * 160 + 35
  55.       # 歩行キャラグラフィックの描写
  56.       draw_actor_battlegraphic(actor, actor_x - 40, 0)
  57.       # HP/SP/EXPメーターの描写
  58.       draw_actor_hp_meter_line(actor, actor_x, 62, 96, 10)
  59.       draw_actor_sp_meter_line(actor, actor_x, 80, 96, 10)
  60.       draw_actor_exp_meter_line(actor, actor_x, 90, 96, 50)
  61.       # HP数値の描写
  62.       self.contents.font.size = 12 # HP/SP数値の文字の大きさ
  63.       self.contents.font.color = Color.new(0,0,0,192)
  64.       self.contents.draw_text(actor_x-2, 56, 96, 24, actor.hp.to_s, 2)
  65.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  66.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  67.       self.contents.draw_text(actor_x-4, 54, 96, 24, actor.hp.to_s, 2)
  68.       # SP数値の描写
  69.       self.contents.font.color = Color.new(0,0,0,192)
  70.       self.contents.draw_text(actor_x-2, 74, 96, 24, actor.sp.to_s, 2)
  71.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  72.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  73.       self.contents.draw_text(actor_x-4, 72, 96, 24, actor.sp.to_s, 2)
  74.       # EXP数値の描写
  75.       self.contents.font.color = Color.new(0,0,0,192)
  76.       self.contents.draw_text(actor_x-2, 74, 96, 24, actor.exp.to_s, 2)
  77.       self.contents.font.color = actor.exp == 0 ? knockout_color :
  78.       actor.exp <= actor.maxexp / 4 ? crisis_color : normal_color
  79.       self.contents.draw_text(actor_x-4, 72, 96, 24, actor.exp.to_s, 2)
  80.       # 用語「HP」と用語「SP」の描写
  81.       self.contents.font.size = 17 # 用語「HP/SP」の文字の大きさ
  82.       self.contents.font.color = Color.new(0,0,0,0)
  83.       self.contents.draw_text(actor_x+2, 32, 196, 24, $data_system.words.hp)
  84.       self.contents.draw_text(actor_x+2, 64, 196, 24, $data_system.words.sp)
  85.       self.contents.draw_text(actor_x+2, 96, 196, 24, $data_system.words.exp)
  86.       self.contents.font.color = system_color # 用語「HP/SP」の文字の色
  87.       self.contents.draw_text(actor_x, 200, 196, 24, $data_system.words.hp)
  88.       self.contents.draw_text(actor_x, 200, 196, 24, $data_system.words.sp)
  89.       self.contents.draw_text(actor_x, 200, 196, 24, $data_system.words.exp)
  90.       # ステートの描写
  91.       draw_actor_state(actor, actor_x - 14, 102)
  92.       # 値を更新
  93.       @previous_hp[i] = actor.hp
  94.       @previous_hp[i] = actor.hp
  95.       @previous_hp[i] = actor.hp
  96.     end
  97.   end
  98. end
  99. #==============================================================================
  100. # ■ Window_Base
  101. #==============================================================================
  102. class Window_Base < Window
  103.   #--------------------------------------------------------------------------
  104.   # ● HPメーター の描画
  105.   #--------------------------------------------------------------------------
  106.   def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
  107.     w = width * actor.hp / [actor.maxhp,1].max
  108.     hp_color_1 = Color.new(255, 255, 0, 192)
  109.     hp_color_2 = Color.new(255, 0, 0, 192)
  110.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  111.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  112.     x -= 1
  113.     y += (height/4).floor
  114.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  115.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  116.     x -= 1
  117.     y += (height/4).ceil
  118.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  119.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  120.     x -= 1
  121.     y += (height/4).ceil
  122.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  123.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● SPメーター の描画
  127.   #--------------------------------------------------------------------------
  128.   def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
  129.     w = width * actor.sp / [actor.maxsp,1].max
  130.     hp_color_1 = Color.new( 0, 255, 255, 192)
  131.     hp_color_2 = Color.new( 0, 0, 255, 192)
  132.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  133.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  134.     x -= 1
  135.     y += (height/4).floor
  136.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  137.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  138.     x -= 1
  139.     y += (height/4).ceil
  140.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  141.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  142.     x -= 1
  143.     y += (height/4).ceil
  144.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  145.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  146.   end
  147.     #--------------------------------------------------------------------------
  148.   # ● EXPメーター の描画
  149.   #--------------------------------------------------------------------------
  150.   def draw_actor_exp_meter_line(actor, x, y, width = 156, height = 4)
  151.     w = width * actor.exp / [actor.maxexp,1].max
  152.     hp_color_1 = Color.new( 0, 255, 255, 192)
  153.     hp_color_2 = Color.new( 0, 0, 255, 192)
  154.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  155.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  156.     x -= 1
  157.     y += (height/4).floor
  158.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  159.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  160.     x -= 1
  161.     y += (height/4).ceil
  162.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  163.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  164.     x -= 1
  165.     y += (height/4).ceil
  166.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  167.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 名前の描画
  171.   #--------------------------------------------------------------------------
  172.   alias xrxs_bp7_draw_actor_name draw_actor_name
  173.   def draw_actor_name(actor, x, y)
  174.     xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● ステートの描画
  178.   #--------------------------------------------------------------------------
  179.   alias xrxs_bp7_draw_actor_state draw_actor_state
  180.   def draw_actor_state(actor, x, y, width = 120)
  181.     xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● HP の描画
  185.   #--------------------------------------------------------------------------
  186.   alias xrxs_bp7_draw_actor_hp draw_actor_hp
  187.   def draw_actor_hp(actor, x, y, width = 144)
  188.     xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● SP の描画
  192.   #--------------------------------------------------------------------------
  193.   alias xrxs_bp7_draw_actor_sp draw_actor_sp
  194.   def draw_actor_sp(actor, x, y, width = 144)
  195.     xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● SP の描画
  199.   #--------------------------------------------------------------------------
  200.   alias xrxs_bp7_draw_actor_exp draw_actor_exp
  201.   def draw_actor_exp(actor, x, y, width = 144)
  202.     xrxs_bp7_draw_actor_exp(actor, x, y, width) if @draw_ban != true
  203.   end
  204. end
  205. #==============================================================================
  206. # ■ Scene_Battle
  207. #==============================================================================
  208. class Scene_Battle
  209.   #--------------------------------------------------------------------------
  210.   # ● フレーム更新
  211.   #--------------------------------------------------------------------------
  212.   alias xrxs_bp7_update update
  213.   def update
  214.     xrxs_bp7_update
  215.     # メッセージウィンドウ表示中の場合
  216.     if $game_temp.message_window_showing
  217.       @status_window.update_cp_only = true      
  218.     else
  219.       @status_window.update_cp_only = false
  220.     end
  221.   end
  222. end
  223. #==============================================================================
  224. # ◇ 外部ライブラリ
  225. #==============================================================================
  226. class Window_Base
  227.   #--------------------------------------------------------------------------
  228.   # ● ライン描画 軽量版 by 桜雅 在土
  229.   #--------------------------------------------------------------------------
  230.   def draw_lineght(start_x, start_y, end_x, end_y, start_color)
  231.     # 描写距離の計算。大きめに直角時の長さ。
  232.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  233.     # 描写開始
  234.     for i in 1..distance
  235.       x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  236.       y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  237.       self.contents.set_pixel(x, y, start_color)
  238.     end
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● ライン描画 by 桜雅 在土
  242.   #--------------------------------------------------------------------------
  243.   def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  244.     # 描写距離の計算。大きめに直角時の長さ。
  245.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  246.     # 描写開始
  247.     if end_color == start_color
  248.       for i in 1..distance
  249.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  250.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  251.         if width == 1
  252.           self.contents.set_pixel(x, y, start_color)
  253.         else
  254.           self.contents.fill_rect(x, y, width, width, start_color)
  255.         end
  256.       end
  257.     else
  258.       for i in 1..distance
  259.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  260.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  261.         r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  262.         g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  263.         b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  264.         a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  265.         if width == 1
  266.           self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  267.         else
  268.           self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  269.         end
  270.       end
  271.     end
  272.   end
  273. end
  274. #==============================================================================
  275. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  276. #==============================================================================
复制代码

Lv2.观梦者

梦石
0
星屑
253
在线时间
574 小时
注册时间
2006-8-25
帖子
969
2
 楼主| 发表于 2007-8-25 22:56:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
脚本 '血条2' 206行发生了 ArgumentError
wrong number of arguments(4 ofr 3)

下面是显示HP/SP条的脚本,我仿写加入了EXP条(虽然不知道其实有没有maxexp这样东西-.-)

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. # ————————————————————————————————————

  5. # ▼▲▼ XRXS_BP 7. バトルステータス?クリアデザイン ver.1.03 ▼▲▼
  6. # by 桜雅 在土

  7. #==============================================================================
  8. # ■ Window_BattleStatus
  9. #==============================================================================
  10. class Window_BattleStatus < Window_Base
  11.   #--------------------------------------------------------------------------
  12.   # ● 公開インスタンス変数
  13.   #--------------------------------------------------------------------------
  14.   attr_accessor :update_cp_only # CPメーターのみの更新
  15.   #--------------------------------------------------------------------------
  16.   # ● オブジェクト初期化
  17.   #--------------------------------------------------------------------------
  18.   alias xrxs_bp7_initialize initialize
  19.   def initialize
  20.     # 初期化
  21.     @previous_hp = []
  22.     @previous_sp = []
  23.     @previous_exp = []
  24.     # 呼び戻す
  25.     xrxs_bp7_initialize
  26.     # ↓Full-Viewの場合は下二行の # を消してください。
  27.     #self.opacity = 0
  28.     #self.back_opacity = 0
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # ● リフレッシュ
  32.   #--------------------------------------------------------------------------
  33.   alias xrxs_bp7_refresh refresh
  34.   def refresh
  35.     # CPメーターの更新のみ の場合
  36.     if @update_cp_only
  37.       xrxs_bp7_refresh
  38.       return
  39.     end
  40.     # 変更するものがない場合、飛ばす
  41.     @item_max = $game_party.actors.size
  42.     bool = false
  43.     for i in 0...@item_max
  44.       actor = $game_party.actors[i]
  45.       if (@previous_hp[i] != actor.hp) or (@previous_sp[i] != actor.sp)
  46.         bool = true
  47.       end
  48.     end
  49.     return if bool == false
  50.     # 描写を開始
  51.     self.contents.clear
  52.     for i in 0...@item_max
  53.       actor = $game_party.actors[i]
  54.       actor_x = i * 160 + 35
  55.       # 歩行キャラグラフィックの描写
  56.       draw_actor_battlegraphic(actor, actor_x - 40, 0)
  57.       # HP/SP/EXPメーターの描写
  58.       draw_actor_hp_meter_line(actor, actor_x, 62, 96, 10)
  59.       draw_actor_sp_meter_line(actor, actor_x, 80, 96, 10)
  60.       draw_actor_exp_meter_line(actor, actor_x, 90, 96, 50)
  61.       # HP数値の描写
  62.       self.contents.font.size = 12 # HP/SP数値の文字の大きさ
  63.       self.contents.font.color = Color.new(0,0,0,192)
  64.       self.contents.draw_text(actor_x-2, 56, 96, 24, actor.hp.to_s, 2)
  65.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  66.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  67.       self.contents.draw_text(actor_x-4, 54, 96, 24, actor.hp.to_s, 2)
  68.       # SP数値の描写
  69.       self.contents.font.color = Color.new(0,0,0,192)
  70.       self.contents.draw_text(actor_x-2, 74, 96, 24, actor.sp.to_s, 2)
  71.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  72.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  73.       self.contents.draw_text(actor_x-4, 72, 96, 24, actor.sp.to_s, 2)
  74.       # EXP数値の描写
  75.       self.contents.font.color = Color.new(0,0,0,192)
  76.       self.contents.draw_text(actor_x-2, 74, 96, 24, actor.exp.to_s, 2)
  77.       self.contents.font.color = actor.exp == 0 ? knockout_color :
  78.       actor.exp <= actor.maxexp / 4 ? crisis_color : normal_color
  79.       self.contents.draw_text(actor_x-4, 72, 96, 24, actor.exp.to_s, 2)
  80.       # 用語「HP」と用語「SP」の描写
  81.       self.contents.font.size = 17 # 用語「HP/SP」の文字の大きさ
  82.       self.contents.font.color = Color.new(0,0,0,0)
  83.       self.contents.draw_text(actor_x+2, 32, 196, 24, $data_system.words.hp)
  84.       self.contents.draw_text(actor_x+2, 64, 196, 24, $data_system.words.sp)
  85.       self.contents.draw_text(actor_x+2, 96, 196, 24, $data_system.words.exp)
  86.       self.contents.font.color = system_color # 用語「HP/SP」の文字の色
  87.       self.contents.draw_text(actor_x, 200, 196, 24, $data_system.words.hp)
  88.       self.contents.draw_text(actor_x, 200, 196, 24, $data_system.words.sp)
  89.       self.contents.draw_text(actor_x, 200, 196, 24, $data_system.words.exp)
  90.       # ステートの描写
  91.       draw_actor_state(actor, actor_x - 14, 102)
  92.       # 値を更新
  93.       @previous_hp[i] = actor.hp
  94.       @previous_hp[i] = actor.hp
  95.       @previous_hp[i] = actor.hp
  96.     end
  97.   end
  98. end
  99. #==============================================================================
  100. # ■ Window_Base
  101. #==============================================================================
  102. class Window_Base < Window
  103.   #--------------------------------------------------------------------------
  104.   # ● HPメーター の描画
  105.   #--------------------------------------------------------------------------
  106.   def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
  107.     w = width * actor.hp / [actor.maxhp,1].max
  108.     hp_color_1 = Color.new(255, 255, 0, 192)
  109.     hp_color_2 = Color.new(255, 0, 0, 192)
  110.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  111.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  112.     x -= 1
  113.     y += (height/4).floor
  114.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  115.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  116.     x -= 1
  117.     y += (height/4).ceil
  118.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  119.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  120.     x -= 1
  121.     y += (height/4).ceil
  122.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  123.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● SPメーター の描画
  127.   #--------------------------------------------------------------------------
  128.   def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
  129.     w = width * actor.sp / [actor.maxsp,1].max
  130.     hp_color_1 = Color.new( 0, 255, 255, 192)
  131.     hp_color_2 = Color.new( 0, 0, 255, 192)
  132.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  133.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  134.     x -= 1
  135.     y += (height/4).floor
  136.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  137.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  138.     x -= 1
  139.     y += (height/4).ceil
  140.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  141.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  142.     x -= 1
  143.     y += (height/4).ceil
  144.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  145.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  146.   end
  147.     #--------------------------------------------------------------------------
  148.   # ● EXPメーター の描画
  149.   #--------------------------------------------------------------------------
  150.   def draw_actor_exp_meter_line(actor, x, y, width = 156, height = 4)
  151.     w = width * actor.exp / [actor.maxexp,1].max
  152.     hp_color_1 = Color.new( 0, 255, 255, 192)
  153.     hp_color_2 = Color.new( 0, 0, 255, 192)
  154.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  155.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  156.     x -= 1
  157.     y += (height/4).floor
  158.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  159.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  160.     x -= 1
  161.     y += (height/4).ceil
  162.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  163.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  164.     x -= 1
  165.     y += (height/4).ceil
  166.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  167.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 名前の描画
  171.   #--------------------------------------------------------------------------
  172.   alias xrxs_bp7_draw_actor_name draw_actor_name
  173.   def draw_actor_name(actor, x, y)
  174.     xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● ステートの描画
  178.   #--------------------------------------------------------------------------
  179.   alias xrxs_bp7_draw_actor_state draw_actor_state
  180.   def draw_actor_state(actor, x, y, width = 120)
  181.     xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● HP の描画
  185.   #--------------------------------------------------------------------------
  186.   alias xrxs_bp7_draw_actor_hp draw_actor_hp
  187.   def draw_actor_hp(actor, x, y, width = 144)
  188.     xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● SP の描画
  192.   #--------------------------------------------------------------------------
  193.   alias xrxs_bp7_draw_actor_sp draw_actor_sp
  194.   def draw_actor_sp(actor, x, y, width = 144)
  195.     xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● SP の描画
  199.   #--------------------------------------------------------------------------
  200.   alias xrxs_bp7_draw_actor_exp draw_actor_exp
  201.   def draw_actor_exp(actor, x, y, width = 144)
  202.     xrxs_bp7_draw_actor_exp(actor, x, y, width) if @draw_ban != true
  203.   end
  204. end
  205. #==============================================================================
  206. # ■ Scene_Battle
  207. #==============================================================================
  208. class Scene_Battle
  209.   #--------------------------------------------------------------------------
  210.   # ● フレーム更新
  211.   #--------------------------------------------------------------------------
  212.   alias xrxs_bp7_update update
  213.   def update
  214.     xrxs_bp7_update
  215.     # メッセージウィンドウ表示中の場合
  216.     if $game_temp.message_window_showing
  217.       @status_window.update_cp_only = true      
  218.     else
  219.       @status_window.update_cp_only = false
  220.     end
  221.   end
  222. end
  223. #==============================================================================
  224. # ◇ 外部ライブラリ
  225. #==============================================================================
  226. class Window_Base
  227.   #--------------------------------------------------------------------------
  228.   # ● ライン描画 軽量版 by 桜雅 在土
  229.   #--------------------------------------------------------------------------
  230.   def draw_lineght(start_x, start_y, end_x, end_y, start_color)
  231.     # 描写距離の計算。大きめに直角時の長さ。
  232.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  233.     # 描写開始
  234.     for i in 1..distance
  235.       x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  236.       y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  237.       self.contents.set_pixel(x, y, start_color)
  238.     end
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● ライン描画 by 桜雅 在土
  242.   #--------------------------------------------------------------------------
  243.   def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  244.     # 描写距離の計算。大きめに直角時の長さ。
  245.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  246.     # 描写開始
  247.     if end_color == start_color
  248.       for i in 1..distance
  249.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  250.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  251.         if width == 1
  252.           self.contents.set_pixel(x, y, start_color)
  253.         else
  254.           self.contents.fill_rect(x, y, width, width, start_color)
  255.         end
  256.       end
  257.     else
  258.       for i in 1..distance
  259.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  260.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  261.         r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  262.         g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  263.         b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  264.         a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  265.         if width == 1
  266.           self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  267.         else
  268.           self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  269.         end
  270.       end
  271.     end
  272.   end
  273. end
  274. #==============================================================================
  275. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  276. #==============================================================================
复制代码
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-25
帖子
6
3
发表于 2007-8-26 00:24:02 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2026-6-24 19:07

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表