Project1

标题: 挖坟]强制战斗指令和每回合行动次数,如何修改才能正常动作 [打印本页]

作者: alexncf125    时间: 2020-9-13 18:35
标题: 挖坟]强制战斗指令和每回合行动次数,如何修改才能正常动作
本帖最后由 alexncf125 于 2020-9-13 20:49 编辑

挖个5年前的坟, https://rpg.blue/thread-376139-1-1.html
LZ的问题是不是要用下方的脚本来解決??
然而没看懂那个10号开关是有什么用途..
RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ YSA Core Script: Fix Force Actions
  4. # -- Last Updated: 2011.12.18
  5. # -- Level: Easy
  6. # -- Requires: none
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YSA-ForceActions"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2011.12.18 - Started Script and Finished.
  17. #
  18. #==============================================================================
  19. # ▼ Introduction
  20. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. # This will fix the mechanic of force actions.
  22. # Firstly, forced battler can be not removed from action list when he is being
  23. # forced through a switch. By default, if a battler have not acted and being forced
  24. # , he will lost his current action.
  25. # Secondly, for advanced users, you can put as many as you like battler in
  26. # force action pending.
  27. #
  28. #==============================================================================
  29. # ▼ Instructions
  30. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  31. # To install this script, open up your script editor and copy/paste this script
  32. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  33. #
  34. #==============================================================================
  35. # ▼ Compatibility
  36. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  37. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  38. # it will run with RPG Maker VX without adjusting.
  39. #
  40. #==============================================================================
  41.  
  42. module YSA
  43.   module FORCE_ACTION
  44.     REMOVE_SWITCH = 10
  45.   end
  46. end
  47.  
  48. #==============================================================================
  49. # ■ BattleManager
  50. #==============================================================================
  51.  
  52. module BattleManager
  53.  
  54.   #--------------------------------------------------------------------------
  55.   # rewrite method: force_action
  56.   #--------------------------------------------------------------------------
  57.   def self.force_action(battler)
  58.     @action_forced = [] if @action_forced == nil
  59.     @action_forced.push(battler)
  60.     @action_battlers.delete(battler) if $game_switches[YSA::FORCE_ACTION::REMOVE_SWITCH]
  61.   end
  62.  
  63.   #--------------------------------------------------------------------------
  64.   # rewrite method: action_forced?
  65.   #--------------------------------------------------------------------------
  66.   def self.action_forced?
  67.     @action_forced != nil
  68.   end
  69.  
  70.   #--------------------------------------------------------------------------
  71.   # rewrite method: action_forced_battler
  72.   #--------------------------------------------------------------------------
  73.   def self.action_forced_battler
  74.     @action_forced.shift
  75.   end
  76.  
  77.   #--------------------------------------------------------------------------
  78.   # rewrite method: clear_action_force
  79.   #--------------------------------------------------------------------------
  80.   def self.clear_action_force
  81.     @action_forced = nil if @action_forced.empty?
  82.   end
  83.  
  84. end # BattleManager
  85.  
  86. #==============================================================================
  87. # ■ Scene_Battle
  88. #==============================================================================
  89.  
  90. class Scene_Battle < Scene_Base
  91.  
  92.   #--------------------------------------------------------------------------
  93.   # rewrite method: process_forced_action
  94.   #--------------------------------------------------------------------------
  95.   def process_forced_action
  96.     while BattleManager.action_forced?
  97.       last_subject = @subject
  98.       @subject = BattleManager.action_forced_battler
  99.       process_action
  100.       @subject = last_subject
  101.       BattleManager.clear_action_force
  102.     end
  103.   end
  104.  
  105. end

作者: soulsaga    时间: 2020-9-19 17:04
如果10号开关打开就会在执行强制行动时删除行动中的战斗者对像
作者: alexncf125    时间: 2020-9-19 17:29
本帖最后由 alexncf125 于 2020-9-19 17:37 编辑
soulsaga 发表于 2020-9-19 17:04
如果10号开关打开就会在执行强制行动时删除行动中的战斗者对像


我没理解错的话, 是:
当10号开关打开时, 变回默认的"战斗者对像在未行动时強制行动,他将会失去原有行动"
By default, if a battler have not acted and being forced, he will lost his current action.
的意思?

当10号开关关闭时, 已強制行动了的战斗者对像不会从行动序列中移除(这句等同于: "战斗者对像在未行动时強制行动,不会失去原有行动"吧?)
forced battler can be not removed from action list when he is being forced through a switch
作者: soulsaga    时间: 2020-9-19 18:08
alexncf125 发表于 2020-9-19 17:29
我没理解错的话, 是:
当10号开关打开时, 变回默认的"战斗者对像在未行动时強制行动,他将会失去原有行动"
...

我不太清楚..你可以试一下?调试出真理..




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