赞 | 1 |
VIP | 0 |
好人卡 | 3 |
积分 | 6 |
经验 | 16134 |
最后登录 | 2022-10-7 |
在线时间 | 310 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 582
- 在线时间
- 310 小时
- 注册时间
- 2016-2-29
- 帖子
- 210
|
- $imported = {} if $imported.nil?
- $imported["Sub_Party"] = true
- #==============================================================================
- # 全灭后待机成员参战 v1.2
- #------------------------------------------------------------------------------
- # 2015.05.31 by 企鹅达达
- # 2015.06.03 修正事件扣血时不更换队员的bug
- # 2015.06.04 防止整队类脚本对为加入队伍的成员调用draw_actor_simple_status等出错
- #==============================================================================
- # 如题,这个脚本的功能就是让非战斗人员按照序号编成小队,全灭后一个小队一个
- # 小队上场战斗。嗯,感觉不是很好用,反正是自用的╮(╯_╰)╭
- # 用这个脚本建议把濒死设置成战斗后解除,这样可以避免某些小队战斗
- # 时空了一些死掉的队员。
- # 顺带一提这脚本和战斗中整队、战斗中添加成员(比如召唤)类型的脚本天生不对头,
- # 如果因为这些原因报错,本人也无能为力了 ← ←
- #==============================================================================
- #参战时显示的信息,可以使用转义符,%s取代角色名。
- # JION_MESSAGE = "\ec[6]%s\ec[0] 参战!"
- #如果不想要这个信息,可以设置为 nil
- # JION_MESSAGE = nil
- JION_MESSAGE = "%s 参战!"
- # 在菜单里显示的名字,SUB_PARTY_NAME里没有的话会用下面的SUB_PARTY_DEFAULT_NAME
- SUB_PARTY_SHOW_IN_MENU = true
- SUB_PARTY_NAME = ["","",]
- SUB_PARTY_DEFAULT_NAME = ""
- #==============================================================================
- # ■ Game_Battler
- #------------------------------------------------------------------------------
- # 处理战斗者的类。Game_Actor 和 Game_Enemy 类的父类。
- #==============================================================================
- class Game_Battler < Game_BattlerBase
- attr_accessor :battle_formation_order #队伍顺序标记
- #--------------------------------------------------------------------------
- # ● 保存队伍顺序
- #--------------------------------------------------------------------------
- def save_battle_formation_order
- @battle_formation_order = index
- end
- #--------------------------------------------------------------------------
- # ● 行动结束
- #--------------------------------------------------------------------------
- alias sub_party_on_action_end on_action_end
- def on_action_end
- sub_party_on_action_end
- while $game_party.all_dead?
- break if $game_party.sub_party_now >= $game_party.sub_party_max
- $game_party.sub_party_jion_battle
- end
- end
- end
- #==============================================================================
- # ■ Game_Party
- #------------------------------------------------------------------------------
- # 管理队伍的类。保存有金钱及物品的信息。本类的实例请参考 $game_party 。
- #==============================================================================
- class Game_Party < Game_Unit
- attr_accessor :sub_party_now #参战分队编号
- attr_accessor :sub_party_max #参战分队最大编号
- #--------------------------------------------------------------------------
- # ● 战斗开始处理
- #--------------------------------------------------------------------------
- def sub_party_jion_battle
- @sub_party_now += 1
- max_battle_members.times do |i|
- next if all_members[ max_battle_members * @sub_party_now + i ].nil?
- next if all_members[ max_battle_members * @sub_party_now + i ].dead?
- swap_order( i, max_battle_members * @sub_party_now + i)
- if JION_MESSAGE
- # BattleManager.log_window.add_text(sprintf(JION_MESSAGE, $game_party.all_members[i].name))
- # BattleManager.log_window.abs_wait(90)
- $game_message.add(sprintf(JION_MESSAGE, $game_party.all_members[i].name))
- BattleManager.wait_for_message
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 队伍顺序恢复
- #--------------------------------------------------------------------------
- def sub_party_reset_order
- @actors.sort! {|a, b|$game_actors[a].battle_formation_order <=> $game_actors[b].battle_formation_order }
- end
- #--------------------------------------------------------------------------
- # ● 保存队伍顺序
- #--------------------------------------------------------------------------
- def sub_party_save_order
- all_members.each do |member|
- member.save_battle_formation_order
- end
- end
- #--------------------------------------------------------------------------
- # ● 初始化参战分队信息,顺带让第一个有成活队员的分队上阵。
- #--------------------------------------------------------------------------
- def make_sub_party
- @sub_party_now = 0
- @sub_party_max = all_members.size / max_battle_members
- @sub_party_max -= 1 if all_members.size == max_battle_members * @sub_party_max
- while battle_members.select {|member|member.alive?}.empty?
- break if @sub_party_now >= @sub_party_max
- sub_party_jion_battle
- end
- end
- #--------------------------------------------------------------------------
- # ● 战斗开始处理
- #--------------------------------------------------------------------------
- alias sub_party_on_battle_start on_battle_start
- def on_battle_start
- sub_party_save_order
- make_sub_party
- sub_party_on_battle_start
- end
- #--------------------------------------------------------------------------
- # ● 战斗结束处理
- #--------------------------------------------------------------------------
- alias sub_party_on_battle_end on_battle_end
- def on_battle_end
- sub_party_reset_order
- sub_party_on_battle_end
- end
- end
- #==============================================================================
- # ■ Game_Interpreter
- #------------------------------------------------------------------------------
- # 事件指令的解释器。
- # 本类在 Game_Map、Game_Troop、Game_Event 类的内部使用。
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # ● 增减 HP v 1.1更新
- #--------------------------------------------------------------------------
- def command_311
- value = operate_value(@params[2], @params[3], @params[4])
- iterate_actor_var(@params[0], @params[1]) do |actor|
- next if actor.dead?
- actor.change_hp(value, @params[5])
- actor.perform_collapse_effect if actor.dead?
- end
- ##############################################
- if SceneManager.scene_is?(Scene_Battle)
- while $game_party.all_dead?
- break if $game_party.sub_party_now >= $game_party.sub_party_max
- $game_party.sub_party_jion_battle
- end
- end
- ##############################################
- SceneManager.goto(Scene_Gameover) if $game_party.all_dead?
- end
- #--------------------------------------------------------------------------
- # ● 更改状态 v 1.1更新
- #--------------------------------------------------------------------------
- alias sub_party_command_313 command_313
- def command_313
- sub_party_command_313
- ##############################################
- if SceneManager.scene_is?(Scene_Battle)
- while $game_party.all_dead?
- break if $game_party.sub_party_now >= $game_party.sub_party_max
- $game_party.sub_party_jion_battle
- end
- end
- ##############################################
- end
- end
- if SUB_PARTY_SHOW_IN_MENU
- #==============================================================================
- # ■ Window_Base
- #------------------------------------------------------------------------------
- # 游戏中所有窗口的父类
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 绘制分队名
- #--------------------------------------------------------------------------
- def draw_actor_sub_party(actor, x, y, width = 112)
- return if actor.index.nil? # v1.2修改
- change_color(system_color)
- sub_party_index = actor.index / $game_party.max_battle_members
- text = SUB_PARTY_NAME[sub_party_index].nil? ? SUB_PARTY_DEFAULT_NAME : SUB_PARTY_NAME[sub_party_index]
- draw_text(x, y, width, line_height, text)
- change_color(normal_color)
- end
- #--------------------------------------------------------------------------
- # ● 绘制简单的状态
- #--------------------------------------------------------------------------
- alias sub_party_draw_actor_simple_status draw_actor_simple_status
- def draw_actor_simple_status(actor, x, y)
- sub_party_draw_actor_simple_status(actor, x, y)
- draw_actor_sub_party(actor, x-108, y+56)
- end
- end
- #encoding:utf-8
- #==============================================================================
- # ■ Window_Status
- #------------------------------------------------------------------------------
- # 显示队伍成员状态的窗口
- #==============================================================================
- class Window_Status < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 绘制基本区域
- #--------------------------------------------------------------------------
- alias sub_party_draw_basic_info draw_basic_info
- def draw_basic_info(x, y)
- sub_party_draw_basic_info(x, y)
- draw_actor_sub_party(@actor, x -132, y+72, 100)
- end
- end
- end # if SUB_PARTY_SHOW_IN_MENU
复制代码 |
评分
-
查看全部评分
|