扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 162|回复: 0

[转载发布] 战斗指令加入状态选项

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    昨天 18:01
  • 签到天数: 114 天

    连续签到: 4 天

    [LV.6]常住居民II

    2339

    主题

    404

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10635
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13406

    灌水之王

    发表于 2024-4-19 18:27:37 | 显示全部楼层 |阅读模式



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

    我调整脚本将原状态栏调到画面外去(太丑了!),在网上搜到了一个脚本,给战斗指令加入了一个“状态”。现在把修改后的脚本发过来,如果喜欢我这种战斗格式的朋友可以用一下。不要打我~~~
    1. #==============================================================================# ■ 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[index], 1)end#--------------------------------------------------------------------------# ● 更新光标矩形#--------------------------------------------------------------------------def update_cursor_rectself.cursor_rect.set(0 + index * 40, 0, 40, 40)endend复制代码
    复制代码
    把这个,复制并替换到原脚本“Window_PartyCommand”中,注意,要全部替换!
    1. #==============================================================================# ■ Window_BattleStatus#------------------------------------------------------------------------------#  显示战斗画面同伴状态的窗口。#==============================================================================class Window_BattleStatus < Window_Base#--------------------------------------------------------------------------# ● 初始化对像#--------------------------------------------------------------------------def initializesuper(780, 0, 160, 480)self.contents = Bitmap.new(width - 32, height - 32)@level_up_flags = [false, false, false, false]refreshend#--------------------------------------------------------------------------# ● 释放#--------------------------------------------------------------------------def disposesuperend#--------------------------------------------------------------------------# ● 设置升级标志# actor_index : 角色索引#--------------------------------------------------------------------------def level_up(actor_index)@level_up_flags[actor_index] = trueend#--------------------------------------------------------------------------# ● 刷新#--------------------------------------------------------------------------def refreshself.contents.clear@item_max = $game_party.actors.sizefor i in 0...$game_party.actors.sizeactor = $game_party.actors[i]actor_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_flags[i]self.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”
    1. 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, [s1, s2, s3, s4,s5])@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在线咨询功能删除,谢谢。

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    请稍候...
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-15 15:40 , Processed in 0.146581 second(s), 58 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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