Project1

标题: 战斗指令加入状态选项 [打印本页]

作者: 冰舞蝶恋    时间: 2010-7-17 16:07
标题: 战斗指令加入状态选项
本帖最后由 后知后觉 于 2010-7-20 12:14 编辑




这是我修改原脚本坐标合成的,不要打我,因为我找不到“非原创发布”的地方。。。= =|||

我调整脚本将原状态栏调到画面外去(太丑了!),在网上搜到了一个脚本,给战斗指令加入了一个“状态”。现在把修改后的脚本发过来,如果喜欢我这种战斗格式的朋友可以用一下。不要打我~~~
  1. #==============================================================================
  2. # ■ Window_PartyCommand
  3. #------------------------------------------------------------------------------
  4. #  战斗画面、选择战斗与逃跑的窗口。
  5. #==============================================================================

  6. class Window_PartyCommand < Window_Selectable
  7. #--------------------------------------------------------------------------
  8. # ● 初始化对像
  9. #--------------------------------------------------------------------------
  10. def initialize
  11. super(0, 0, 110, 70)
  12. self.contents = Bitmap.new(width - 32, height - 32)
  13. self.back_opacity = 255
  14. @commands = ["战", "逃"]
  15. @item_max = 2
  16. @column_max = 2
  17. draw_item(0, normal_color)
  18. draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color)
  19. self.active = false
  20. self.visible = false
  21. self.index = 0
  22. end
  23. #--------------------------------------------------------------------------
  24. # ● 描绘项目
  25. # index : 项目标号
  26. # color : 文字颜色
  27. #--------------------------------------------------------------------------
  28. def draw_item(index, color)
  29. self.contents.font.color = color
  30. rect = Rect.new(8 + index * 40 + 0, 0, 45 - 20, 32)
  31. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  32. self.contents.draw_text(rect, @commands[index], 1)
  33. end
  34. #--------------------------------------------------------------------------
  35. # ● 更新光标矩形
  36. #--------------------------------------------------------------------------
  37. def update_cursor_rect
  38. self.cursor_rect.set(0 + index * 40, 0, 40, 40)
  39. end
  40. end
复制代码
把这个,复制并替换到原脚本“Window_PartyCommand”中,注意,要全部替换!
  1. #==============================================================================
  2. # ■ Window_BattleStatus
  3. #------------------------------------------------------------------------------
  4. #  显示战斗画面同伴状态的窗口。
  5. #==============================================================================

  6. class Window_BattleStatus < Window_Base
  7. #--------------------------------------------------------------------------
  8. # ● 初始化对像
  9. #--------------------------------------------------------------------------
  10. def initialize
  11. super(780, 0, 160, 480)
  12. self.contents = Bitmap.new(width - 32, height - 32)
  13. @level_up_flags = [false, false, false, false]
  14. refresh
  15. end
  16. #--------------------------------------------------------------------------
  17. # ● 释放
  18. #--------------------------------------------------------------------------
  19. def dispose
  20. super
  21. end
  22. #--------------------------------------------------------------------------
  23. # ● 设置升级标志
  24. # actor_index : 角色索引
  25. #--------------------------------------------------------------------------
  26. def level_up(actor_index)
  27. @level_up_flags[actor_index] = true
  28. end
  29. #--------------------------------------------------------------------------
  30. # ● 刷新
  31. #--------------------------------------------------------------------------
  32. def refresh
  33. self.contents.clear
  34. @item_max = $game_party.actors.size
  35. for i in 0...$game_party.actors.size
  36. actor = $game_party.actors[i]
  37. actor_x = i * 135 + 0
  38. draw_actor_name(actor, actor_x, 0)
  39. draw_actor_hp(actor, actor_x, 32, 120)
  40. draw_actor_sp(actor, actor_x, 64, 120)
  41. if @level_up_flags[i]
  42. self.contents.font.color = normal_color
  43. self.contents.draw_text(actor_x, 96, 120, 32, "升级了!")
  44. else
  45. draw_actor_state(actor, actor_x, 96)
  46. end
  47. end
  48. end
  49. #--------------------------------------------------------------------------
  50. # ● 刷新画面
  51. #--------------------------------------------------------------------------
  52. def update
  53. super
  54. # 主界面的不透明度下降
  55. if $game_temp.battle_main_phase
  56. self.contents_opacity -= 4 if self.contents_opacity > 191
  57. else
  58. self.contents_opacity += 4 if self.contents_opacity < 255
  59. end
  60. end
  61. end
复制代码
这个也是同理,要全部替换!替换脚本文件:“Window_BattleStatus”
  1. class Scene_Battle
  2. def start_status
  3. @hzhj_status = Window_Status.new(@active_battler)
  4. @hzhj_status.z = 9999
  5. @actor_command_window.active = false
  6. @actor_command_window.visible = false
  7. return
  8. end
  9. def end_status
  10. @hzhj_status.dispose
  11. @hzhj_status = nil
  12. @actor_command_window.active = true
  13. @actor_command_window.visible = true
  14. return
  15. end
  16. def update_status
  17. @hzhj_status.update
  18. if Input.trigger?(Input::B)
  19. $game_system.se_play($data_system.cancel_se)
  20. end_status
  21. return
  22. end
  23. end
  24. #--------------------------------------------------------------------------
  25. # ● 主处理
  26. #--------------------------------------------------------------------------
  27. def main
  28. $game_temp.in_battle = true
  29. $game_temp.battle_turn = 0
  30. $game_temp.battle_event_flags.clear
  31. $game_temp.battle_abort = false
  32. $game_temp.battle_main_phase = false
  33. $game_temp.battleback_name = $game_map.battleback_name
  34. $game_temp.forcing_battler = nil
  35. # 初始化战斗用事件解释器
  36. $game_system.battle_interpreter.setup(nil, 0)
  37. # 准备队伍
  38. @troop_id = $game_temp.battle_troop_id
  39. $game_troop.setup(@troop_id)
  40. s1 = $data_system.words.attack
  41. s2 = $data_system.words.skill
  42. s3 = $data_system.words.guard
  43. s4 = $data_system.words.item
  44. s5 = "状态"
  45. @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4,s5])
  46. @actor_command_window.y = 128
  47. @actor_command_window.back_opacity = 160
  48. @actor_command_window.active = false
  49. @actor_command_window.visible = false
  50. @party_command_window = Window_PartyCommand.new
  51. @help_window = Window_Help.new
  52. @help_window.back_opacity = 160
  53. @help_window.visible = false
  54. @status_window = Window_BattleStatus.new
  55. @message_window = Window_Message.new
  56. @spriteset = Spriteset_Battle.new
  57. @wait_count = 0
  58. if $data_system.battle_transition == ""
  59. Graphics.transition(20)
  60. else
  61. Graphics.transition(40, "Graphics/Transitions/" +
  62. $data_system.battle_transition)
  63. end
  64. start_phase1
  65. loop do
  66. Graphics.update
  67. Input.update
  68. update
  69. if $scene != self
  70. break
  71. end
  72. end
  73. $game_map.refresh
  74. Graphics.freeze
  75. @actor_command_window.dispose
  76. @party_command_window.dispose
  77. @help_window.dispose
  78. @status_window.dispose
  79. @message_window.dispose
  80. if @skill_window != nil
  81. @skill_window.dispose
  82. end
  83. if @item_window != nil
  84. @item_window.dispose
  85. end
  86. if @hzhj_status != nil
  87. @hzhj_status.dispose
  88. end
  89. if @result_window != nil
  90. @result_window.dispose
  91. end
  92. @spriteset.dispose
  93. if $scene.is_a?(Scene_Title)
  94. Graphics.transition
  95. Graphics.freeze
  96. end
  97. if $BTEST and not $scene.is_a?(Scene_Gameover)
  98. $scene = nil
  99. end
  100. end
  101. #--------------------------------------------------------------------------
  102. # ● 刷新画面 (角色命令回合)
  103. #--------------------------------------------------------------------------
  104. def update_phase3
  105. if @enemy_arrow != nil
  106. update_phase3_enemy_select
  107. elsif @actor_arrow != nil
  108. update_phase3_actor_select
  109. elsif @skill_window != nil
  110. update_phase3_skill_select
  111. elsif @item_window != nil
  112. update_phase3_item_select
  113. elsif @actor_command_window.active
  114. update_phase3_basic_command
  115. elsif @hzhj_status != nil
  116. update_status
  117. end
  118. end
  119. #--------------------------------------------------------------------------
  120. # ● 刷新画面 (角色命令回合 : 基本命令)
  121. #--------------------------------------------------------------------------
  122. def update_phase3_basic_command
  123. if Input.trigger?(Input::B)
  124. $game_system.se_play($data_system.cancel_se)
  125. phase3_prior_actor
  126. return
  127. end
  128. if Input.trigger?(Input::C)
  129. case @actor_command_window.index
  130. when 0 # 攻击
  131. $game_system.se_play($data_system.decision_se)
  132. @active_battler.current_action.kind = 0
  133. @active_battler.current_action.basic = 0
  134. start_enemy_select
  135. when 1 # 特技
  136. $game_system.se_play($data_system.decision_se)
  137. @active_battler.current_action.kind = 1
  138. start_skill_select
  139. when 2 # 防御
  140. $game_system.se_play($data_system.decision_se)
  141. @active_battler.current_action.kind = 0
  142. @active_battler.current_action.basic = 1
  143. phase3_next_actor
  144. when 3 # 物品
  145. $game_system.se_play($data_system.decision_se)
  146. @active_battler.current_action.kind = 2
  147. start_item_select
  148. when 4
  149. $game_system.se_play($data_system.decision_se)
  150. start_status
  151. end
  152. return
  153. end
  154. end
  155. end
复制代码
在Main前插入一个脚本,把这里面的内容导入。(这个是搜的哦~~用这个就可以在战斗指令界面加入一个状态查看了。)

呵呵~大家尽管批评,我以后还会更加努力的~




作者: 六祈    时间: 2010-7-17 22:14
回复 冰舞蝶恋 的帖子
楼主这个界面挺好看的

于是偶就不客气的抱走了~(lz说想要就拿去用吧)
   
作者: 冰舞蝶恋    时间: 2010-7-20 14:03
“帮楼主修改了一下主题的标题”
斑竹,我要声明一下,脚本不是我写的!我只是在原有脚本上改坐标加上搜了一个脚本而已啊!
作者: CortesDevil    时间: 2010-8-15 13:11
字体好有爱阿- -
作者: 越前リョーマ    时间: 2010-8-15 14:36
感觉应该重新写一个窗口,里面可以去掉一些无用的东西,比如装备。




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