Project1

标题: 顺序问题 [打印本页]

作者: cZooCz    时间: 2008-3-19 02:41
标题: 顺序问题
就是我用了个血条脚本怪打我方时··招还没放完主角就先去血了,我放用特技也一样··招还没放完就去SP了…………谁说说是什么问题 [LINE]1,#dddddd[/LINE]此贴于 2008-3-31 5:38:39 被版主水迭澜提醒,请楼主看到后对本贴做出回应。
作者: Iselia雪    时间: 2008-3-19 02:45
提示: 作者被禁止或删除 内容自动屏蔽
作者: 水迭澜    时间: 2008-3-19 02:52
什么脚本?
把血条的刷新改在放完动画以后就行了
作者: cZooCz    时间: 2008-3-19 04:55
准确怎么弄?
作者: cZooCz    时间: 2008-3-19 05:02
经测试知道是那个脚本搞的鬼了用2个如下
  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  3. # ————————————————————————————————————

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

  6. #==============================================================================
  7. # ■ Window_BattleStatus
  8. #==============================================================================
  9. class Window_BattleStatus < Window_Base
  10.   #--------------------------------------------------------------------------
  11.   # ● 公開インスタンス変数
  12.   #--------------------------------------------------------------------------
  13.   attr_accessor :update_cp_only # CPメーターのみの更新
  14.   #--------------------------------------------------------------------------
  15.   # ● オブジェクト初期化
  16.   #--------------------------------------------------------------------------
  17.   alias xrxs_bp7_initialize initialize
  18.   def initialize
  19.     # 初期化
  20.     @previous_hp = []
  21.     @previous_sp = []
  22.     # 呼び戻す
  23.     xrxs_bp7_initialize
  24.     # ↓Full-Viewの場合は下二行の # を消してください。
  25.     self.opacity = 160
  26.     self.back_opacity = 160  
  27.    
  28. =begin   
  29.    @hp = []
  30.    for j in 0...$game_party.actors.size
  31.      @hp[j] = $game_party.actors[j].hp
  32.    end
  33.    @refresh_flag = true
  34.    refresh
  35. =end   
  36.    
  37.    
  38.   end
  39. #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  40.   def draw_battler_graphic(actor, x, y)
  41.     battler=RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  42.     w = battler.width
  43.     h = battler.height
  44.     self.contents.blt(x-w/2, y-h, battler, Rect.new(0, 0, w,h +3),255)
  45.     self.z = 20
  46.   end
  47. #★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

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

复制代码
这是战斗血条脚本
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. class Window_BattleStatus < Window_Base
  5. #--------------------------------------------------------------------------
  6. # ● 初始化对像
  7. #--------------------------------------------------------------------------
  8. def initialize
  9.    super(320 - $game_party.actors.size*80, 320, 160*$game_party.actors.size, 160)
  10.    @w = []
  11.    for i in 0..$game_party.actors.size-1
  12.      @w[i] = Window_Base.new(320 - $game_party.actors.size*80 + i*160,320,160,160)
  13.      @w[i].back_opacity = 0
  14.    end
  15.    self.contents = Bitmap.new(width - 32, height - 32)
  16.    @level_up_flags = [false, false, false, false]


  17.    @hp = []
  18.    for j in 0...$game_party.actors.size
  19.      @hp[j] = $game_party.actors[j].hp
  20.    end
  21.    @refresh_flag = true


  22.    refresh
  23. end
  24. #--------------------------------------------------------------------------
  25. # ● 释放
  26. #--------------------------------------------------------------------------
  27. def dispose
  28.    super
  29.    for w in @w
  30.      w.dispose
  31.    end
  32. end
  33. #--------------------------------------------------------------------------
  34. # ● 设置升级标志
  35. #     actor_index : 角色索引
  36. #--------------------------------------------------------------------------
  37. def level_up(actor_index)
  38.    @level_up_flags[actor_index] = true
  39. end
  40. #--------------------------------------------------------------------------
  41. # ● 刷新
  42. #--------------------------------------------------------------------------
  43. def refresh
  44.    self.contents.clear
  45.    @item_max = $game_party.actors.size
  46.    for i in 0...$game_party.actors.size
  47.      actor = $game_party.actors[i]
  48.      actor_x = i * 160 + 4
  49.      draw_actor_name(actor, actor_x, 0)
  50.      draw_actor_hp(@hp[i], actor_x, 32, 120)
  51.      draw_actor_sp(actor, actor_x, 64, 120)
  52.      if @level_up_flags[i]
  53.        self.contents.font.color = normal_color
  54.        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
  55.      else
  56.        draw_actor_state(actor, actor_x, 96)
  57.      end
  58.    end
  59.    @refresh_flag = false
  60. end
  61. #--------------------------------------------------------------------------
  62. # ● 描绘 HP
  63. #     actor : 角色
  64. #     x     : 描画目标 X 坐标
  65. #     y     : 描画目标 Y 坐标
  66. #     width : 描画目标的宽
  67. #--------------------------------------------------------------------------
  68. def draw_actor_hp(number, x, y, width = 144)
  69.    # 描绘字符串 "HP"
  70.    self.contents.font.color = system_color
  71.    self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
  72.    self.contents.font.color = normal_color
  73.    self.contents.draw_text(x+72, y, 48, 32, number.to_s, 2)   
  74. end
  75. #--------------------------------------------------------------------------
  76. # ● 刷新画面
  77. #--------------------------------------------------------------------------
  78. def update
  79.    super
  80.    # 主界面的不透明度下降
  81.    if $game_temp.battle_main_phase
  82.      self.contents_opacity -= 4 if self.contents_opacity > 191
  83.    else
  84.      self.contents_opacity += 4 if self.contents_opacity < 255
  85.    end
  86.    for i in 0...$game_party.actors.size
  87.      if @hp[i] != $game_party.actors[i].hp
  88.        @refresh_flag = true
  89.        if @hp[i] > $game_party.actors[i].hp
  90.          @hp[i] -= 1
  91.        else
  92.          @hp[i] += 1
  93.        end
  94.      end
  95.    end
  96.    refresh if @refresh_flag
  97. end
  98. end




  99. #==============================================================================
  100. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  101. #==============================================================================



复制代码
不知道怎么说····大家应该看得出··就是这2个脚本我把后者删了就没刷新滞后的现象了怎么解决?
作者: cZooCz    时间: 2008-3-19 20:50
那个高手大大来解决下ing…………
作者: 禾西    时间: 2008-3-19 21:09
腳本2,删掉
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
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
   refresh if @refresh_flag
   for i in 0...$game_party.actors.size
     if @hp != $game_party.actors.hp
       @refresh_flag = true
       if @hp > $game_party.actors.hp
         @hp -= 1
       else
         @hp += 1
       end
     end
   end
end

作者: cZooCz    时间: 2008-3-20 01:58
出错的啊
作者: cZooCz    时间: 2008-3-21 20:41
人呢~?
作者: cZooCz    时间: 2008-3-25 21:04
过了很久了···我来顶贴啦~{/hx}那位大大来看看丫~……




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1