| 赞 | 31  | 
 
| VIP | 0 | 
 
| 好人卡 | 0 | 
 
| 积分 | 25 | 
 
| 经验 | 315 | 
 
| 最后登录 | 2025-6-21 | 
 
| 在线时间 | 214 小时 | 
 
 
 
 
 
Lv3.寻梦者 
	- 梦石
 - 0 
 
        - 星屑
 - 2492 
 
        - 在线时间
 - 214 小时
 
        - 注册时间
 - 2017-9-27
 
        - 帖子
 - 613
 
 
 
 | 
	
那你看看这个可以用吗,老鹰的,亲测可用 
- #==============================================================================
 
 - # ■ 装备/敌人战斗中自动附加状态  by 老鹰
 
 - #------------------------------------------------------------------------------
 
 - #   - 新增在战斗中指定时刻,装备携带者/敌人的自动附加指定状态
 
 - #   - 在装备/敌人栏备注内填入下式(可用空格或逗号分隔内部各项)(可重复填入多行)
 
 - #      <状态附加时机: 状态id, 附加概率分子, 附加概率分母, 出现条件>
 
 - #       状态附加时机(替换为下列英语):
 
 - #          Battle Start State  -  战斗开始时
 
 - #          Turn Start State    -  回合开始时  *需碧轨战斗顺序,默认战斗者无该时刻
 
 - #          Action End State    -  行动结束时
 
 - #          Turn End State      -  回合结束时
 
 - #       状态id: 填入需要自动附加的状态id号
 
 - #       附加概率分子、附加概率分母(可选): 状态附加的概率为 分子/分母,不填则为 1
 
 - #       出现条件(可选):被eval后如果返回真,才能进行附加,不填则默认为 真
 
 - #         注: 可用 s 代表 $game_switches, v 代表 $game_variables
 
 - #   - 举例:
 
 - #       在 1 号护甲备注里填入 <Battle Start State: 1>, 1号角色装备中
 
 - #         作用:在战斗开始时,1号角色自动附加一次1号状态
 
 - #       在 2 号护甲备注里填入 <Turn End State: 2, 1,2>,2号角色装备中
 
 - #         作用:在每次回合结束时,2号角色有 1/2 的概率附加2号状态
 
 - #       在 1 号敌人备注里填入 <Action End State: 3, 1,5, $game_switches[1]>
 
 - #         作用:1号敌人每次技能使用结束、且1号开关开启时,有 1/5 的概率附加3号状态
 
 - #   - 实质:在战斗各个时机,角色自身的处理中追加状态的附加
 
 - #==============================================================================
 
 -  
 
 - class Game_Battler < Game_BattlerBase
 
 -   #--------------------------------------------------------------------------
 
 -   # ● 获取需要提取附加状态的对象的数组
 
 -   #--------------------------------------------------------------------------
 
 -   def get_battler_auto_states_notes_array
 
 -     return equips if actor?
 
 -     return [self] if enemy?
 
 -     return []
 
 -   end
 
 -   #--------------------------------------------------------------------------
 
 -   # ● 处理自动状态的附加
 
 -   #--------------------------------------------------------------------------
 
 -   def eagle_check_auto_add_states(type)
 
 -     array = get_battler_auto_states_notes_array
 
 -     case type
 
 -     when :on_battle_start
 
 -       exp = /<Battle Start State:[ ,]*(\d+)[ ,]*(\d*)[ ,]*(\d*)[ ,]*(.*)>/
 
 -     when :on_turn_start
 
 -       exp = /<Turn Start State:[ ,]*(\d+)[ ,]*(\d*)[ ,]*(\d*)[ ,]*(.*)>/
 
 -     when :on_action_end
 
 -       exp = /<Action End State:[ ,]*(\d+)[ ,]*(\d*)[ ,]*(\d*)[ ,]*(.*)>/
 
 -     when :on_turn_end
 
 -       exp = /<Turn End State:[ ,]*(\d+)[ ,]*(\d*)[ ,]*(\d*)[ ,]*(.*)>/
 
 -     end
 
 -     s = $game_switches
 
 -     v = $game_variables
 
 -     array.each do |a|
 
 -       next if a == nil
 
 -       a.note.split(/[\r\n]+/).each do |line|
 
 -         line =~ exp
 
 -         # $1 - 状态id $2$3 - 概率 $4 - eval条件
 
 -         next if $1 == nil
 
 -         next if $4 != "" && eval($4) == false 
 
 -         p1 = $2 == "" ? 1 : $2.to_i
 
 -         p2 = $3 == "" ? 1 : $3.to_i
 
 -         next if rand > (p1 * 1.0 / p2)
 
 -         add_state($1.to_i)
 
 -       end
 
 -     end
 
 -   end
 
 -  
 
 -   #--------------------------------------------------------------------------
 
 -   # ● 战斗开始处理
 
 -   #--------------------------------------------------------------------------
 
 -   alias eagle_battler_auto_states_on_battle_start on_battle_start
 
 -   def on_battle_start
 
 -     eagle_check_auto_add_states(:on_battle_start)
 
 -     eagle_battler_auto_states_on_battle_start
 
 -   end  
 
 -  
 
 -   #--------------------------------------------------------------------------
 
 -   # ○ 回合开始
 
 -   #  需要 碧轨战斗行动顺序系统
 
 -   #--------------------------------------------------------------------------
 
 -   if Scene_Battle.include?(Saba::Kiseki)
 
 -   alias eagle_battler_auto_states_on_turn_start on_turn_start
 
 -   def on_turn_start
 
 -     eagle_check_auto_add_states(:on_turn_start)
 
 -     eagle_battler_auto_states_on_turn_start
 
 -   end
 
 -   end
 
 -  
 
 -   #--------------------------------------------------------------------------
 
 -   # ● 战斗行动结束时的处理
 
 -   #--------------------------------------------------------------------------
 
 -   alias eagle_battler_auto_states_on_action_end on_action_end
 
 -   def on_action_end
 
 -     eagle_check_auto_add_states(:on_action_end)
 
 -     eagle_battler_auto_states_on_action_end
 
 -   end
 
 -   #--------------------------------------------------------------------------
 
 -   # ● 回合结束处理
 
 -   #--------------------------------------------------------------------------
 
 -   alias eagle_battler_auto_states_on_turn_end on_turn_end
 
 -   def on_turn_end
 
 -     eagle_check_auto_add_states(:on_turn_end)
 
 -     eagle_battler_auto_states_on_turn_end
 
 -   end
 
 - end
 
 
  复制代码 |   
 
 
 
 |