Project1

标题: 如何让队伍第1人不参战,战斗后自动加入在第1位? [打印本页]

作者: 我不宅    时间: 2009-7-1 16:19
标题: 如何让队伍第1人不参战,战斗后自动加入在第1位?
本帖最后由 我不宅 于 2009-7-2 15:42 编辑

如何让队伍第1人不参战,战斗后自动加入在第1位?求做好范例,脚本,或方法,谢谢!
作者: ONEWateR    时间: 2009-7-1 16:55
以前写过一宠物跟随脚本,原理也是差不多~
可以查看查看~
作者: 我不宅    时间: 2009-7-1 16:58
寻找不到是哪个...........传送门.........
作者: kakarot    时间: 2009-7-1 17:15
传送门:(应该是这个吧?)
http://rpg.blue/viewthread.php?tid=105003&highlight=
作者: 我不宅    时间: 2009-7-1 17:16
好人!抱抱!!!!
作者: 我不宅    时间: 2009-7-1 17:19
本帖最后由 我不宅 于 2009-7-1 17:44 编辑

那个......好象没有作用吧!根本就是没用吧!
作者: 我不宅    时间: 2009-7-2 10:10
救救我啊!
作者: ONEWateR    时间: 2009-7-2 10:15
  1. class Scene_Map
  2.   def call_battle
  3.   #--------------------------------------------------------------------------
  4.     $actor_id = []
  5.     for actor in $game_party.actors
  6.       $actor_id.push(actor.id)
  7.     end
  8.     $game_party.remove_actor($actor_id[0])
  9.   #--------------------------------------------------------------------------
  10.     $game_temp.battle_calling = false
  11.     $game_temp.menu_calling = false
  12.     $game_temp.menu_beep = false
  13.     $game_player.make_encounter_count
  14.     $game_temp.map_bgm = $game_system.playing_bgm
  15.     $game_system.bgm_stop
  16.     $game_system.se_play($data_system.battle_start_se)
  17.     $game_system.bgm_play($game_system.battle_bgm)
  18.     $game_player.straighten
  19.     $scene = Scene_Battle.new
  20.   end
  21. end
  22. class Scene_Battle
  23.   def battle_end(result)
  24.   #--------------------------------------------------------------------------
  25.     for i in 0..$actor_id.size-1
  26.       $game_party.actors[i] = $game_actors[$actor_id[i]]
  27.     end
  28.     $game_player.refresh
  29.   #--------------------------------------------------------------------------
  30.     $game_temp.in_battle = false
  31.     $game_party.clear_actions
  32.     for actor in $game_party.actors
  33.       actor.remove_states_battle
  34.     end
  35.     $game_troop.enemies.clear
  36.     if $game_temp.battle_proc != nil
  37.       $game_temp.battle_proc.call(result)
  38.       $game_temp.battle_proc = nil
  39.     end
  40.     $scene = Scene_Map.new
  41.   end
  42. end
复制代码

作者: 我不宅    时间: 2009-7-2 10:18
好人!!!!!!!!!!!!!!!!!!!!!
作者: 我不宅    时间: 2009-7-2 10:29
那个............可以了....然后冲突了.........
就是美化战斗窗口的脚本,309行冲了..........
就是   “actor = $game_party.actors[$status_window_contents]”这里冲了..解决不了...
脚本如下:
#==============================================================================

# ■ 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

#==============================================================================

# ◇ 外部ライブラリ

#==============================================================================

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,使用和转载请保留此信息

#==============================================================================

#==============================================================================

# ■ Window_BattleStatus

#------------------------------------------------------------------------------

#  显示战斗画面同伴状态的窗口。

#==============================================================================

class Window_BattleStatus < Window_Base

#--------------------------------------------------------------------------

# ● 初始化对像

#--------------------------------------------------------------------------

def initialize

   super(0, 320, 160, 160)

   self.contents = Bitmap.new(width - 32, height - 32)

   @level_up_flags = [false, false, false, false]

   refresh

end

#--------------------------------------------------------------------------

# ● 刷新

#--------------------------------------------------------------------------

def refresh

   self.contents.clear

   @item_max = $game_party.actors.size

   actor = $game_party.actors[$status_window_contents]

   actor_x = 21

   self.contents.font.size = 18

   draw_actor_name(actor, 4, 0)

     # 歩行キャラグラフィックの描写

     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.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)

     # 値を更新

end

end



#==============================================================================

# ■ Scene_Map

#------------------------------------------------------------------------------

#  处理地图画面的类。

#==============================================================================



class Scene_Map

#--------------------------------------------------------------------------

# ● 调用战斗

#--------------------------------------------------------------------------

alias call_new call_battle

def call_battle

   call_new

   $status_window_contents = 0

end

end



#==============================================================================

# ■ Scene_Battle

#------------------------------------------------------------------------------

#  处理战斗画面的类。

#==============================================================================

class Scene_Battle  

#--------------------------------------------------------------------------

# ● 设置角色指令窗口

#--------------------------------------------------------------------------

alias:phase3_setup_command_window_2:phase3_setup_command_window

def phase3_setup_command_window

   phase3_setup_command_window_2

   # 设置角色指令窗口的位置

   @actor_command_window.x = 400

end   

#--------------------------------------------------------------------------

# ● 开始同伴命令回合

#--------------------------------------------------------------------------

alias start_phase2_2 start_phase2

def start_phase2

   

   #---<夏娜改>---

   now_actor_index = 0

   while $game_party.actors[now_actor_index].dead?

     now_actor_index += 1

   end

   

   $status_window_contents = now_actor_index

   @status_window.refresh

   start_phase2_2

end

#--------------------------------------------------------------------------

# ● 转到输入下一个角色的命令

#--------------------------------------------------------------------------

def phase3_next_actor



   # 循环

   begin

     # 角色的明灭效果 OFF

     if @active_battler != nil

       @active_battler.blink = false

     end

     # 最后的角色的情况

     if @actor_index == $game_party.actors.size - 1

       # 开始主回合

       start_phase4

       return

     end

     # 推进角色索引

     @actor_index += 1

     @active_battler = $game_party.actors[@actor_index]

     @active_battler.blink = true

   # 如果角色是在无法接受指令的状态就再试

   end until @active_battler.inputable?



   #---<夏娜改>---

   $status_window_contents = @active_battler.index

   @status_window.refresh

   

   # 设置角色的命令窗口

   phase3_setup_command_window

end

#--------------------------------------------------------------------------

# ● 转向前一个角色的命令输入

#--------------------------------------------------------------------------

def phase3_prior_actor



   # 循环

   begin

     # 角色的明灭效果 OFF

     if @active_battler != nil

       @active_battler.blink = false

     end

     # 最初的角色的情况下

     if @actor_index == 0

       # 开始同伴指令回合

       start_phase2

       return

     end

     # 返回角色索引

     @actor_index -= 1

     @active_battler = $game_party.actors[@actor_index]

     @active_battler.blink = true

   # 如果角色是在无法接受指令的状态就再试

   end until @active_battler.inputable?



   #---<夏娜改>---

   $status_window_contents = @active_battler.index

   @status_window.refresh



   

   # 设置角色的命令窗口

   phase3_setup_command_window

end

#--------------------------------------------------------------------------

# ● 刷新画面 (主回合步骤 1 : 准备行动)

#--------------------------------------------------------------------------

def update_phase4_step1

   # 隐藏帮助窗口

   @help_window.visible = false

   # 判定胜败

   if judge

     # 胜利或者失败的情况下 : 过程结束

     return

   end

   # 强制行动的战斗者不存在的情况下

   if $game_temp.forcing_battler == nil

     # 设置战斗事件

     setup_battle_event

     # 执行战斗事件中的情况下

     if $game_system.battle_interpreter.running?

       return

     end

   end

   # 强制行动的战斗者存在的情况下

   if $game_temp.forcing_battler != nil

     # 在头部添加后移动

     @action_battlers.delete($game_temp.forcing_battler)

     @action_battlers.unshift($game_temp.forcing_battler)

   end

   # 未行动的战斗者不存在的情况下 (全员已经行动)

   if @action_battlers.size == 0

     # 开始同伴命令回合

     start_phase2

     return

   end

   # 初始化动画 ID 和公共事件 ID

   @animation1_id = 0

   @animation2_id = 0

   @common_event_id = 0

   # 未行动的战斗者移动到序列的头部

   @active_battler = @action_battlers.shift

   # 如果已经在战斗之外的情况下

   if @active_battler.index == nil

     return

   end

   # 连续伤害

   if @active_battler.hp > 0 and @active_battler.slip_damage?

     @active_battler.slip_damage_effect

     @active_battler.damage_pop = true

   end

   # 自然解除状态

   @active_battler.remove_states_auto

   

   #---<夏娜改>---

   if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?

     $status_window_contents = @active_battler.index

   end

   

   # 刷新状态窗口

   @status_window.refresh

   # 移至步骤 2

   @phase4_step = 2

end

end
作者: ONEWateR    时间: 2009-7-2 10:38
经测试,没冲突,应该是其它脚本吧~
楼主可将工程传上,方便查出“漏洞”~
作者: 我不宅    时间: 2009-7-2 10:42
........好的!
作者: 我不宅    时间: 2009-7-2 10:50
请您自己放入容错脚本...不然老是缺图.............谢谢了!

Project1.rar

281.71 KB, 下载次数: 32


作者: ONEWateR    时间: 2009-7-2 11:20
怎么感觉那脚本好像被人“做了手脚”似的,actor没有定义~
以下是修改了的脚本,请楼主将其原来的脚步覆盖掉~
应该能解决楼主的问题
  1. #==============================================================================

  2. # ■ Window_Base

  3. #==============================================================================

  4. class Window_Base < Window

  5. #--------------------------------------------------------------------------

  6. # ● HPメーター の描画

  7. #--------------------------------------------------------------------------

  8. def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)

  9.    w = width * actor.hp / [actor.maxhp,1].max

  10.    hp_color_1 = Color.new(255, 0, 0, 192)

  11.    hp_color_2 = Color.new(255, 255, 0, 192)

  12.    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))

  13.    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)

  14.    x -= 1

  15.    y += (height/4).floor

  16.    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))

  17.    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)

  18.    x -= 1

  19.    y += (height/4).ceil

  20.    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))

  21.    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)

  22.    x -= 1

  23.    y += (height/4).ceil

  24.    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))

  25.    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)

  26. end

  27. #--------------------------------------------------------------------------

  28. # ● SPメーター の描画

  29. #--------------------------------------------------------------------------

  30. def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)

  31.    w = width * actor.sp / [actor.maxsp,1].max

  32.    hp_color_1 = Color.new( 0, 0, 255, 192)

  33.    hp_color_2 = Color.new( 0, 255, 255, 192)

  34.    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))

  35.    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)

  36.    x -= 1

  37.    y += (height/4).floor

  38.    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))

  39.    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)

  40.    x -= 1

  41.    y += (height/4).ceil

  42.    self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))

  43.    draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)

  44.    x -= 1

  45.    y += (height/4).ceil

  46.    self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))

  47.    draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)

  48. end

  49. #--------------------------------------------------------------------------

  50. # ● 名前の描画

  51. #--------------------------------------------------------------------------

  52. alias xrxs_bp7_draw_actor_name draw_actor_name

  53. def draw_actor_name(actor, x, y)

  54.    xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true

  55. end

  56. #--------------------------------------------------------------------------

  57. # ● ステートの描画

  58. #--------------------------------------------------------------------------

  59. alias xrxs_bp7_draw_actor_state draw_actor_state

  60. def draw_actor_state(actor, x, y, width = 120)

  61.    xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true

  62. end

  63. #--------------------------------------------------------------------------

  64. # ● HP の描画

  65. #--------------------------------------------------------------------------

  66. alias xrxs_bp7_draw_actor_hp draw_actor_hp

  67. def draw_actor_hp(actor, x, y, width = 144)

  68.    xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true

  69. end

  70. #--------------------------------------------------------------------------

  71. # ● SP の描画

  72. #--------------------------------------------------------------------------

  73. alias xrxs_bp7_draw_actor_sp draw_actor_sp

  74. def draw_actor_sp(actor, x, y, width = 144)

  75.    xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true

  76. end

  77. end

  78. #==============================================================================

  79. # ◇ 外部ライブラリ

  80. #==============================================================================

  81. class Window_Base

  82. #--------------------------------------------------------------------------

  83. # ● ライン描画 軽量版 by 桜雅 在土

  84. #--------------------------------------------------------------------------

  85. def draw_lineght(start_x, start_y, end_x, end_y, start_color)

  86.    # 描写距離の計算。大きめに直角時の長さ。

  87.    distance = (start_x - end_x).abs + (start_y - end_y).abs

  88.    # 描写開始

  89.    for i in 1..distance

  90.      x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i

  91.      y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i

  92.      self.contents.set_pixel(x, y, start_color)

  93.    end

  94. end

  95. #--------------------------------------------------------------------------

  96. # ● ライン描画 by 桜雅 在土

  97. #--------------------------------------------------------------------------

  98. def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)

  99.    # 描写距離の計算。大きめに直角時の長さ。

  100.    distance = (start_x - end_x).abs + (start_y - end_y).abs

  101.    # 描写開始

  102.    if end_color == start_color

  103.      for i in 1..distance

  104.        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i

  105.        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i

  106.        if width == 1

  107.          self.contents.set_pixel(x, y, start_color)

  108.        else

  109.          self.contents.fill_rect(x, y, width, width, start_color)

  110.        end

  111.      end

  112.    else

  113.      for i in 1..distance

  114.        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i

  115.        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i

  116.        r = start_color.red * (distance-i)/distance + end_color.red * i/distance

  117.        g = start_color.green * (distance-i)/distance + end_color.green * i/distance

  118.        b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance

  119.        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance

  120.        if width == 1

  121.          self.contents.set_pixel(x, y, Color.new(r, g, b, a))

  122.        else

  123.          self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))

  124.        end

  125.      end

  126.    end

  127. end

  128. end




  129. $actor_index = 0
  130. #==============================================================================

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

  132. #==============================================================================

  133. #==============================================================================

  134. # ■ Window_BattleStatus

  135. #------------------------------------------------------------------------------

  136. #  显示战斗画面同伴状态的窗口。

  137. #==============================================================================

  138. class Window_BattleStatus < Window_Base

  139. #--------------------------------------------------------------------------

  140. # ● 初始化对像

  141. #--------------------------------------------------------------------------

  142. def initialize

  143.    super(0, 320, 160, 160)

  144.    self.contents = Bitmap.new(width - 32, height - 32)

  145.    @level_up_flags = [false, false, false, false]

  146.    refresh

  147. end

  148. #--------------------------------------------------------------------------

  149. # ● 刷新

  150. #--------------------------------------------------------------------------

  151. def refresh

  152.    self.contents.clear

  153.    @item_max = $game_party.actors.size

  154.    actor_x = 21

  155.    self.contents.font.size = 18
  156.    
  157.      actor = $game_party.actors[$actor_index]
  158.    
  159.      # 歩行キャラグラフィックの描写

  160.      draw_actor_graphic(actor, actor_x - 9, 116)

  161.      # HP/SPメーターの描写

  162.      draw_actor_hp_meter_line(actor, actor_x, 52, 96, 12)

  163.      draw_actor_sp_meter_line(actor, actor_x, 84, 96, 12)

  164.      # HP数値の描写

  165.      self.contents.font.color = Color.new(0,0,0,192)

  166.      self.contents.draw_text(actor_x, 40, 96, 24, actor.hp.to_s, 2)

  167.      self.contents.font.color = actor.hp == 0 ? knockout_color :

  168.      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color

  169.      self.contents.draw_text(actor_x-2, 38, 96, 24, actor.hp.to_s, 2)

  170.      # SP数値の描写

  171.      self.contents.font.color = Color.new(0,0,0,192)

  172.      self.contents.draw_text(actor_x, 72, 96, 24, actor.sp.to_s, 2)

  173.      self.contents.font.color = actor.sp == 0 ? knockout_color :

  174.      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color

  175.      self.contents.draw_text(actor_x-2, 70, 96, 24, actor.sp.to_s, 2)

  176.      # 用語「HP」と用語「SP」の描写

  177.      self.contents.font.size = 18 # 用語「HP/SP」の文字の大きさ

  178.      self.contents.font.color = Color.new(0,0,0,192)

  179.      self.contents.draw_text(actor_x+2, 32, 196, 24, $data_system.words.hp)

  180.      self.contents.draw_text(actor_x+2, 64, 196, 24, $data_system.words.sp)

  181.      self.contents.font.color = system_color # 用語「HP/SP」の文字の色

  182.      self.contents.draw_text(actor_x, 30, 196, 24, $data_system.words.hp)

  183.      self.contents.draw_text(actor_x, 62, 196, 24, $data_system.words.sp)

  184.      # ステートの描写

  185.      draw_actor_state(actor, actor_x, 100)

  186.      # 値を更新
  187.      
  188.    
  189. end

  190. end



  191. #==============================================================================

  192. # ■ Scene_Map

  193. #------------------------------------------------------------------------------

  194. #  处理地图画面的类。

  195. #==============================================================================



  196. class Scene_Map

  197. #--------------------------------------------------------------------------

  198. # ● 调用战斗

  199. #--------------------------------------------------------------------------

  200. alias call_new call_battle

  201. def call_battle

  202.    call_new

  203.    $status_window_contents = 0

  204. end

  205. end



  206. #==============================================================================

  207. # ■ Scene_Battle

  208. #------------------------------------------------------------------------------

  209. #  处理战斗画面的类。

  210. #==============================================================================

  211. class Scene_Battle  

  212. #--------------------------------------------------------------------------

  213. # ● 设置角色指令窗口

  214. #--------------------------------------------------------------------------

  215. alias:phase3_setup_command_window_2:phase3_setup_command_window

  216. def phase3_setup_command_window

  217.    phase3_setup_command_window_2

  218.    # 设置角色指令窗口的位置

  219.    @actor_command_window.x = 400

  220. end   

  221. #--------------------------------------------------------------------------

  222. # ● 开始同伴命令回合

  223. #--------------------------------------------------------------------------

  224. alias start_phase2_2 start_phase2

  225. def start_phase2

  226.    

  227.    #---<夏娜改>---

  228.    now_actor_index = 0

  229.    while $game_party.actors[now_actor_index].dead?

  230.      now_actor_index += 1

  231.    end

  232.    

  233.    $status_window_contents = now_actor_index

  234.    @status_window.refresh

  235.    start_phase2_2

  236. end

  237. #--------------------------------------------------------------------------

  238. # ● 转到输入下一个角色的命令

  239. #--------------------------------------------------------------------------

  240. def phase3_next_actor



  241.    # 循环

  242.    begin

  243.      # 角色的明灭效果 OFF

  244.      if @active_battler != nil

  245.        @active_battler.blink = false

  246.      end

  247.      # 最后的角色的情况

  248.      if @actor_index == $game_party.actors.size - 1

  249.        # 开始主回合

  250.        start_phase4

  251.        return

  252.      end

  253.      # 推进角色索引

  254.      @actor_index += 1 ; $actor_index = @actor_index

  255.      @active_battler = $game_party.actors[@actor_index]

  256.      @active_battler.blink = true

  257.    # 如果角色是在无法接受指令的状态就再试

  258.    end until @active_battler.inputable?



  259.    #---<夏娜改>---

  260.    $status_window_contents = @active_battler.index

  261.    @status_window.refresh

  262.    

  263.    # 设置角色的命令窗口

  264.    phase3_setup_command_window

  265. end

  266. #--------------------------------------------------------------------------

  267. # ● 转向前一个角色的命令输入

  268. #--------------------------------------------------------------------------

  269. def phase3_prior_actor



  270.    # 循环

  271.    begin

  272.      # 角色的明灭效果 OFF

  273.      if @active_battler != nil

  274.        @active_battler.blink = false

  275.      end

  276.      # 最初的角色的情况下

  277.      if @actor_index == 0

  278.        # 开始同伴指令回合

  279.        start_phase2

  280.        return

  281.      end

  282.      # 返回角色索引

  283.      @actor_index -= 1

  284.      @active_battler = $game_party.actors[@actor_index]

  285.      @active_battler.blink = true

  286.    # 如果角色是在无法接受指令的状态就再试

  287.    end until @active_battler.inputable?



  288.    #---<夏娜改>---

  289.    $status_window_contents = @active_battler.index

  290.    @status_window.refresh



  291.    

  292.    # 设置角色的命令窗口

  293.    phase3_setup_command_window

  294. end

  295. #--------------------------------------------------------------------------

  296. # ● 刷新画面 (主回合步骤 1 : 准备行动)

  297. #--------------------------------------------------------------------------

  298. def update_phase4_step1

  299.    # 隐藏帮助窗口

  300.    @help_window.visible = false

  301.    # 判定胜败

  302.    if judge

  303.      # 胜利或者失败的情况下 : 过程结束

  304.      return

  305.    end

  306.    # 强制行动的战斗者不存在的情况下

  307.    if $game_temp.forcing_battler == nil

  308.      # 设置战斗事件

  309.      setup_battle_event

  310.      # 执行战斗事件中的情况下

  311.      if $game_system.battle_interpreter.running?

  312.        return

  313.      end

  314.    end

  315.    # 强制行动的战斗者存在的情况下

  316.    if $game_temp.forcing_battler != nil

  317.      # 在头部添加后移动

  318.      @action_battlers.delete($game_temp.forcing_battler)

  319.      @action_battlers.unshift($game_temp.forcing_battler)

  320.    end

  321.    # 未行动的战斗者不存在的情况下 (全员已经行动)

  322.    if @action_battlers.size == 0

  323.      # 开始同伴命令回合

  324.      start_phase2

  325.      return

  326.    end

  327.    # 初始化动画 ID 和公共事件 ID

  328.    @animation1_id = 0

  329.    @animation2_id = 0

  330.    @common_event_id = 0

  331.    # 未行动的战斗者移动到序列的头部

  332.    @active_battler = @action_battlers.shift

  333.    # 如果已经在战斗之外的情况下

  334.    if @active_battler.index == nil

  335.      return

  336.    end

  337.    # 连续伤害

  338.    if @active_battler.hp > 0 and @active_battler.slip_damage?

  339.      @active_battler.slip_damage_effect

  340.      @active_battler.damage_pop = true

  341.    end

  342.    # 自然解除状态

  343.    @active_battler.remove_states_auto

  344.    

  345.    #---<夏娜改>---

  346.    if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?

  347.      $status_window_contents = $actor_index = @active_battler.index

  348.    end

  349.    

  350.    # 刷新状态窗口

  351.    @status_window.refresh

  352.    # 移至步骤 2

  353.    @phase4_step = 2

  354. end

  355. end
复制代码

作者: 我不宅    时间: 2009-7-2 11:36
谢谢!!!!




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