战斗指令加入状态选项
这是我修改原脚本坐标合成的,不要打我,因为我找不到“非原创发布”的地方。。。= =|||
我调整脚本将原状态栏调到画面外去(太丑了!),在网上搜到了一个脚本,给战斗指令加入了一个“状态”。现在把修改后的脚本发过来,如果喜欢我这种战斗格式的朋友可以用一下。不要打我~~~#==============================================================================# ■ Window_PartyCommand#------------------------------------------------------------------------------# 战斗画面、选择战斗与逃跑的窗口。#==============================================================================class Window_PartyCommand < Window_Selectable#--------------------------------------------------------------------------# ● 初始化对像#--------------------------------------------------------------------------def initializesuper(0, 0, 110, 70)self.contents = Bitmap.new(width - 32, height - 32)self.back_opacity = 255@commands = ["战", "逃"]@item_max = 2@column_max = 2draw_item(0, normal_color)draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color)self.active = falseself.visible = falseself.index = 0end#--------------------------------------------------------------------------# ● 描绘项目# index : 项目标号# color : 文字颜色#--------------------------------------------------------------------------def draw_item(index, color)self.contents.font.color = colorrect = Rect.new(8 + index * 40 + 0, 0, 45 - 20, 32)self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))self.contents.draw_text(rect, @commands, 1)end#--------------------------------------------------------------------------# ● 更新光标矩形#--------------------------------------------------------------------------def update_cursor_rectself.cursor_rect.set(0 + index * 40, 0, 40, 40)endend复制代码把这个,复制并替换到原脚本“Window_PartyCommand”中,注意,要全部替换!#==============================================================================# ■ Window_BattleStatus#------------------------------------------------------------------------------# 显示战斗画面同伴状态的窗口。#==============================================================================class Window_BattleStatus < Window_Base#--------------------------------------------------------------------------# ● 初始化对像#--------------------------------------------------------------------------def initializesuper(780, 0, 160, 480)self.contents = Bitmap.new(width - 32, height - 32)@level_up_flags = refreshend#--------------------------------------------------------------------------# ● 释放#--------------------------------------------------------------------------def disposesuperend#--------------------------------------------------------------------------# ● 设置升级标志# actor_index : 角色索引#--------------------------------------------------------------------------def level_up(actor_index)@level_up_flags = trueend#--------------------------------------------------------------------------# ● 刷新#--------------------------------------------------------------------------def refreshself.contents.clear@item_max = $game_party.actors.sizefor i in 0...$game_party.actors.sizeactor = $game_party.actorsactor_x = i * 135 + 0draw_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_flagsself.contents.font.color = normal_colorself.contents.draw_text(actor_x, 96, 120, 32, "升级了!")elsedraw_actor_state(actor, actor_x, 96)endendend#--------------------------------------------------------------------------# ● 刷新画面#--------------------------------------------------------------------------def updatesuper# 主界面的不透明度下降if $game_temp.battle_main_phaseself.contents_opacity -= 4 if self.contents_opacity > 191elseself.contents_opacity += 4 if self.contents_opacity < 255endendend复制代码这个也是同理,要全部替换!替换脚本文件:“Window_BattleStatus”class Scene_Battledef start_status@hzhj_status = Window_Status.new(@active_battler)@hzhj_status.z = 9999@actor_command_window.active = false@actor_command_window.visible = falsereturnenddef end_status@hzhj_status.dispose@hzhj_status = nil@actor_command_window.active = true@actor_command_window.visible = truereturnenddef update_status@hzhj_status.updateif Input.trigger?(Input::B)$game_system.se_play($data_system.cancel_se)end_statusreturnendend#--------------------------------------------------------------------------# ● 主处理#--------------------------------------------------------------------------def main$game_temp.in_battle = true$game_temp.battle_turn = 0$game_temp.battle_event_flags.clear$game_temp.battle_abort = false$game_temp.battle_main_phase = false$game_temp.battleback_name = $game_map.battleback_name$game_temp.forcing_battler = nil# 初始化战斗用事件解释器$game_system.battle_interpreter.setup(nil, 0)# 准备队伍@troop_id = $game_temp.battle_troop_id$game_troop.setup(@troop_id)s1 = $data_system.words.attacks2 = $data_system.words.skills3 = $data_system.words.guards4 = $data_system.words.items5 = "状态"@actor_command_window = Window_Command.new(160, )@actor_command_window.y = 128@actor_command_window.back_opacity = 160@actor_command_window.active = false@actor_command_window.visible = false@party_command_window = Window_PartyCommand.new@help_window = Window_Help.new@help_window.back_opacity = 160@help_window.visible = false@status_window = Window_BattleStatus.new@message_window = Window_Message.new@spriteset = Spriteset_Battle.new@wait_count = 0if $data_system.battle_transition == ""Graphics.transition(20)elseGraphics.transition(40, "Graphics/Transitions/" +$data_system.battle_transition)endstart_phase1loop doGraphics.updateInput.updateupdateif $scene != selfbreakendend$game_map.refreshGraphics.freeze@actor_command_window.dispose@party_command_window.dispose@help_window.dispose@status_window.dispose@message_window.disposeif @skill_window != nil@skill_window.disposeendif @item_window != nil@item_window.disposeendif @hzhj_status != nil@hzhj_status.disposeendif @result_window != nil@result_window.disposeend@spriteset.disposeif $scene.is_a?(Scene_Title)Graphics.transitionGraphics.freezeendif $BTEST and not $scene.is_a?(Scene_Gameover)$scene = nilendend#--------------------------------------------------------------------------# ● 刷新画面 (角色命令回合)#--------------------------------------------------------------------------def update_phase3if @enemy_arrow != nilupdate_phase3_enemy_selectelsif @actor_arrow != nilupdate_phase3_actor_selectelsif @skill_window != nilupdate_phase3_skill_selectelsif @item_window != nilupdate_phase3_item_selectelsif @actor_command_window.activeupdate_phase3_basic_commandelsif @hzhj_status != nilupdate_statusendend#--------------------------------------------------------------------------# ● 刷新画面 (角色命令回合 : 基本命令)#--------------------------------------------------------------------------def update_phase3_basic_commandif Input.trigger?(Input::B)$game_system.se_play($data_system.cancel_se)phase3_prior_actorreturnendif Input.trigger?(Input::C)case @actor_command_window.indexwhen 0 # 攻击$game_system.se_play($data_system.decision_se)@active_battler.current_action.kind = 0@active_battler.current_action.basic = 0start_enemy_selectwhen 1 # 特技$game_system.se_play($data_system.decision_se)@active_battler.current_action.kind = 1start_skill_selectwhen 2 # 防御$game_system.se_play($data_system.decision_se)@active_battler.current_action.kind = 0@active_battler.current_action.basic = 1phase3_next_actorwhen 3 # 物品$game_system.se_play($data_system.decision_se)@active_battler.current_action.kind = 2start_item_selectwhen 4$game_system.se_play($data_system.decision_se)start_statusendreturnendendend复制代码在Main前插入一个脚本,把这里面的内容导入。(这个是搜的哦~~用这个就可以在战斗指令界面加入一个状态查看了。)
呵呵~大家尽管批评,我以后还会更加努力的~
本帖来自P1论坛作者冰舞蝶恋,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=141834若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页:
[1]