设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 888|回复: 0
打印 上一主题 下一主题

[已经解决] 关于YEA的战斗信息窗口脚本和战斗指令脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
61
在线时间
696 小时
注册时间
2011-1-4
帖子
208
跳转到指定楼层
1
发表于 2015-2-12 20:46:14 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 cjlzbb 于 2015-2-12 21:10 编辑

自己解决了……随便瞎搞搞定了
方法:先把第一个脚本里所有的party替换成actor,Party替换成Actor,然后对着第二个脚本里Window_PartyCommand里涉及到CombatLog的在Window_ActorCommand里仿写一遍
@taroxd ,麻烦改下帖子前缀




发现这两个脚本用起来挺好玩的,
战斗信息窗口就是额外加了个窗口显示出从战斗开始到现在的所有战斗信息
战斗指令的脚本是用来修改队伍指令和角色战斗指令的

想问的是,
脚本中的打开信息窗口的指令是在PartyCommand里面的,
怎样才能在ActorCommand里添加这个指令呢



第一个是信息窗口的脚本
第二个是战斗指令的
效果截图在最后面

PS:为毛别人发脚本都可以折叠起来的?这样子好长呀
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Combat Log Display v1.02
  4. # -- Last Updated: 2012.01.24
  5. # -- Level: Easy
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-CombatLogDisplay"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.24 - Bug Fixed: Confirm window crash with Battle Command List.
  15. # 2012.01.16 - Prevented subsequent line inserts.
  16. # 2011.12.10 - Started Script and Finished.
  17. #
  18. #==============================================================================
  19. # ▼ Introduction
  20. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. # Sometimes text appears way too fast in the battle system or sometimes players
  22. # may miss what kind of information was delivered on-screen. For times like
  23. # that, being able to access the combat log would be important. The combat log
  24. # records all of the text that appears in the battle log window at the top.
  25. # The player can access the combat log display any time during action selection
  26. # phase. Sometimes, players can even review over the combat log to try and
  27. # figure out any kinds of patterns enemies may even have.
  28. #
  29. #==============================================================================
  30. # ▼ Instructions
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # To install this script, open up your script editor and copy/paste this script
  33. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  34. #
  35. #==============================================================================
  36. # ▼ Compatibility
  37. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  38. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  39. # it will run with RPG Maker VX without adjusting.
  40. #
  41. #==============================================================================

  42. module YEA
  43.   module COMBAT_LOG
  44.    
  45.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  46.     # - Combat Log Settings -
  47.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  48.     # Adjust the settings here to modify how the combat log works for your
  49.     # game. You can change the command name and extra text that gets fitted
  50.     # into the combat log over time. If you don't want specific text to appear,
  51.     # just set the text to "" and nothing will show.
  52.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  53.     COMMAND_NAME      = "CombatLog"    # Command list name.
  54.     LINE_COLOUR       = 0              # Line colour for separators.
  55.     LINE_COLOUR_ALPHA = 48             # Opacity of the line colour.
  56.     TEXT_BATTLE_START = "\\c[4]Battle Start!"           # Battle start text.
  57.     TEXT_TURN_NUMBER  = "\\c[4]Turn Number: \\c[6]%d"   # Turn number text.
  58.    
  59.   end # COMBAT_LOG
  60. end # YEA

  61. #==============================================================================
  62. # ▼ Editting anything past this point may potentially result in causing
  63. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  64. # halitosis so edit at your own risk.
  65. #==============================================================================

  66. #==============================================================================
  67. # ■ Window_BattleLog
  68. #==============================================================================

  69. class Window_BattleLog < Window_Selectable
  70.   
  71.   #--------------------------------------------------------------------------
  72.   # new method: combatlog_window=
  73.   #--------------------------------------------------------------------------
  74.   def combatlog_window=(window)
  75.     @combatlog_window = window
  76.   end
  77.   
  78.   #--------------------------------------------------------------------------
  79.   # new method: combatlog
  80.   #--------------------------------------------------------------------------
  81.   def combatlog(text)
  82.     return if @combatlog_window.nil?
  83.     return if text == ""
  84.     @combatlog_window.add_line(text)
  85.   end
  86.   
  87.   #--------------------------------------------------------------------------
  88.   # alias method: add_text
  89.   #--------------------------------------------------------------------------
  90.   alias window_battlelog_add_text_cld add_text
  91.   def add_text(text)
  92.     combatlog(text)
  93.     window_battlelog_add_text_cld(text)
  94.   end
  95.   
  96.   #--------------------------------------------------------------------------
  97.   # alias method: replace_text
  98.   #--------------------------------------------------------------------------
  99.   alias window_battlelog_replace_text_cld replace_text
  100.   def replace_text(text)
  101.     combatlog(text)
  102.     window_battlelog_replace_text_cld(text)
  103.   end
  104.   
  105.   #--------------------------------------------------------------------------
  106.   # Start Ace Battle Engine Compatibility
  107.   #--------------------------------------------------------------------------
  108.   if $imported["YEA-BattleEngine"]
  109.   
  110.   #--------------------------------------------------------------------------
  111.   # alias method: display_current_state
  112.   #--------------------------------------------------------------------------
  113.   alias window_battlelog_display_current_state_cld display_current_state
  114.   def display_current_state(subject)
  115.     window_battlelog_display_current_state_cld(subject)
  116.     return if YEA::BATTLE::MSG_CURRENT_STATE
  117.     return if subject.most_important_state_text.empty?
  118.     combatlog(subject.name + subject.most_important_state_text)
  119.   end
  120.   
  121.   #--------------------------------------------------------------------------
  122.   # alias method: display_use_item
  123.   #--------------------------------------------------------------------------
  124.   alias window_battlelog_display_use_item_cld display_use_item
  125.   def display_use_item(subject, item)
  126.     window_battlelog_display_use_item_cld(subject, item)
  127.     return if YEA::BATTLE::MSG_CURRENT_ACTION
  128.     if item.is_a?(RPG::Skill)
  129.       combatlog(subject.name + item.message1)
  130.       unless item.message2.empty?
  131.         combatlog(item.message2)
  132.       end
  133.     else
  134.       combatlog(sprintf(Vocab::UseItem, subject.name, item.name))
  135.     end
  136.   end
  137.   
  138.   #--------------------------------------------------------------------------
  139.   # alias method: display_counter
  140.   #--------------------------------------------------------------------------
  141.   alias window_battlelog_display_counter_cld display_counter
  142.   def display_counter(target, item)
  143.     window_battlelog_display_counter_cld(target, item)
  144.     return if YEA::BATTLE::MSG_COUNTERATTACK
  145.     combatlog(sprintf(Vocab::CounterAttack, target.name))
  146.   end
  147.   
  148.   #--------------------------------------------------------------------------
  149.   # alias method: display_reflection
  150.   #--------------------------------------------------------------------------
  151.   alias window_battlelog_display_reflection_cld display_reflection
  152.   def display_reflection(target, item)
  153.     window_battlelog_display_reflection_cld(target, item)
  154.     return if YEA::BATTLE::MSG_REFLECT_MAGIC
  155.     combatlog(sprintf(Vocab::MagicReflection, target.name))
  156.   end
  157.   
  158.   #--------------------------------------------------------------------------
  159.   # alias method: display_substitute
  160.   #--------------------------------------------------------------------------
  161.   alias window_battlelog_display_substitute_cld display_substitute
  162.   def display_substitute(substitute, target)
  163.     window_battlelog_display_substitute_cld(substitute, target)
  164.     return if YEA::BATTLE::MSG_SUBSTITUTE_HIT
  165.     combatlog(sprintf(Vocab::Substitute, substitute.name, target.name))
  166.   end
  167.   
  168.   #--------------------------------------------------------------------------
  169.   # alias method: display_failure
  170.   #--------------------------------------------------------------------------
  171.   alias window_battlelog_display_failure_cld display_failure
  172.   def display_failure(target, item)
  173.     window_battlelog_display_failure_cld(target, item)
  174.     return if YEA::BATTLE::MSG_FAILURE_HIT
  175.     if target.result.hit? && !target.result.success
  176.       combatlog(sprintf(Vocab::ActionFailure, target.name))
  177.     end
  178.   end
  179.   
  180.   #--------------------------------------------------------------------------
  181.   # alias method: display_critical
  182.   #--------------------------------------------------------------------------
  183.   alias window_battlelog_display_critical_cld display_critical
  184.   def display_critical(target, item)
  185.     window_battlelog_display_critical_cld(target, item)
  186.     return if YEA::BATTLE::MSG_CRITICAL_HIT
  187.     if target.result.critical
  188.       text = target.actor? ? Vocab::CriticalToActor : Vocab::CriticalToEnemy
  189.       combatlog(text)
  190.     end
  191.   end
  192.   
  193.   #--------------------------------------------------------------------------
  194.   # alias method: display_miss
  195.   #--------------------------------------------------------------------------
  196.   alias window_battlelog_display_miss_cld display_miss
  197.   def display_miss(target, item)
  198.     window_battlelog_display_miss_cld(target, item)
  199.     return if YEA::BATTLE::MSG_HIT_MISSED
  200.     if !item || item.physical?
  201.       fmt = target.actor? ? Vocab::ActorNoHit : Vocab::EnemyNoHit
  202.     else
  203.       fmt = Vocab::ActionFailure
  204.     end
  205.     combatlog(sprintf(fmt, target.name))
  206.   end
  207.   
  208.   #--------------------------------------------------------------------------
  209.   # alias method: display_evasion
  210.   #--------------------------------------------------------------------------
  211.   alias window_battlelog_display_evasion_cld display_evasion
  212.   def display_evasion(target, item)
  213.     window_battlelog_display_evasion_cld(target, item)
  214.     return if YEA::BATTLE::MSG_EVASION
  215.     if !item || item.physical?
  216.       fmt = Vocab::Evasion
  217.     else
  218.       fmt = Vocab::MagicEvasion
  219.     end
  220.     combatlog(sprintf(fmt, target.name))
  221.   end
  222.   
  223.   #--------------------------------------------------------------------------
  224.   # alias method: display_hp_damage
  225.   #--------------------------------------------------------------------------
  226.   alias window_battlelog_display_hp_damage_cld display_hp_damage
  227.   def display_hp_damage(target, item)
  228.     window_battlelog_display_hp_damage_cld(target, item)
  229.     return if YEA::BATTLE::MSG_HP_DAMAGE
  230.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  231.     combatlog(target.result.hp_damage_text)
  232.   end
  233.   
  234.   #--------------------------------------------------------------------------
  235.   # alias method: display_mp_damage
  236.   #--------------------------------------------------------------------------
  237.   alias window_battlelog_display_mp_damage_cld display_mp_damage
  238.   def display_mp_damage(target, item)
  239.     window_battlelog_display_mp_damage_cld(target, item)
  240.     return if YEA::BATTLE::MSG_MP_DAMAGE
  241.     combatlog(target.result.mp_damage_text)
  242.   end
  243.   
  244.   #--------------------------------------------------------------------------
  245.   # alias method: display_tp_damage
  246.   #--------------------------------------------------------------------------
  247.   alias window_battlelog_display_tp_damage_cld display_tp_damage
  248.   def display_tp_damage(target, item)
  249.     window_battlelog_display_tp_damage_cld(target, item)
  250.     return if YEA::BATTLE::MSG_TP_DAMAGE
  251.     combatlog(target.result.tp_damage_text)
  252.   end
  253.   
  254.   #--------------------------------------------------------------------------
  255.   # alias method: display_added_states
  256.   #--------------------------------------------------------------------------
  257.   alias window_battlelog_display_added_states_cld display_added_states
  258.   def display_added_states(target)
  259.     window_battlelog_display_added_states_cld(target)
  260.     return if YEA::BATTLE::MSG_ADDED_STATES
  261.     target.result.added_state_objects.each do |state|
  262.       state_msg = target.actor? ? state.message1 : state.message2
  263.       next if state_msg.empty?
  264.       combatlog(target.name + state_msg)
  265.     end
  266.   end
  267.   
  268.   #--------------------------------------------------------------------------
  269.   # alias method: display_removed_states
  270.   #--------------------------------------------------------------------------
  271.   alias window_battlelog_display_removed_states_cld display_removed_states
  272.   def display_removed_states(target)
  273.     window_battlelog_display_removed_states_cld(target)
  274.     return if YEA::BATTLE::MSG_REMOVED_STATES
  275.     target.result.removed_state_objects.each do |state|
  276.       next if state.message4.empty?
  277.       combatlog(target.name + state.message4)
  278.     end
  279.   end
  280.   
  281.   #--------------------------------------------------------------------------
  282.   # alias method: display_buffs
  283.   #--------------------------------------------------------------------------
  284.   alias window_battlelog_display_buffs_cld display_buffs
  285.   def display_buffs(target, buffs, fmt)
  286.     window_battlelog_display_buffs_cld(target, buffs, fmt)
  287.     return if YEA::BATTLE::MSG_CHANGED_BUFFS
  288.     buffs.each do |param_id|
  289.       combatlog(sprintf(fmt, target.name, Vocab::param(param_id)))
  290.     end
  291.   end
  292.   
  293.   #--------------------------------------------------------------------------
  294.   # End Ace Battle Engine Compatibility
  295.   #--------------------------------------------------------------------------
  296.   end # $imported["YEA-BattleEngine"]
  297.   
  298. end # Window_BattleLog

  299. #==============================================================================
  300. # ■ Window_CombatLog
  301. #==============================================================================

  302. class Window_CombatLog < Window_Selectable
  303.   
  304.   #--------------------------------------------------------------------------
  305.   # initialize
  306.   #--------------------------------------------------------------------------
  307.   def initialize
  308.     @data = []
  309.     super(0, 0, Graphics.width, Graphics.height-120)
  310.     deactivate
  311.     hide
  312.   end
  313.   
  314.   #--------------------------------------------------------------------------
  315.   # add_line
  316.   #--------------------------------------------------------------------------
  317.   def add_line(text)
  318.     return if text == "-" && @data[@data.size - 1] == "-"
  319.     @data.push(text)
  320.   end
  321.   
  322.   #--------------------------------------------------------------------------
  323.   # refresh
  324.   #--------------------------------------------------------------------------
  325.   def refresh
  326.     create_contents
  327.     draw_all_items
  328.   end
  329.   
  330.   #--------------------------------------------------------------------------
  331.   # item_max
  332.   #--------------------------------------------------------------------------
  333.   def item_max; return @data.size; end
  334.   
  335.   #--------------------------------------------------------------------------
  336.   # draw_item
  337.   #--------------------------------------------------------------------------
  338.   def draw_item(index)
  339.     text = @data[index]
  340.     return if text.nil?
  341.     rect = item_rect_for_text(index)
  342.     if text == "-"
  343.       draw_horz_line(rect.y)
  344.     else
  345.       draw_text_ex(rect.x, rect.y, text)
  346.     end
  347.   end
  348.   
  349.   #--------------------------------------------------------------------------
  350.   # draw_horz_line
  351.   #--------------------------------------------------------------------------
  352.   def draw_horz_line(y)
  353.     line_y = y + line_height / 2 - 1
  354.     contents.fill_rect(4, line_y, contents_width-8, 2, line_colour)
  355.   end
  356.   
  357.   #--------------------------------------------------------------------------
  358.   # line_colour
  359.   #--------------------------------------------------------------------------
  360.   def line_colour
  361.     colour = text_color(YEA::COMBAT_LOG::LINE_COLOUR)
  362.     colour.alpha = YEA::COMBAT_LOG::LINE_COLOUR_ALPHA
  363.     return colour
  364.   end
  365.   
  366.   #--------------------------------------------------------------------------
  367.   # show
  368.   #--------------------------------------------------------------------------
  369.   def show
  370.     super
  371.     refresh
  372.     activate
  373.     select([item_max-1, 0].max)
  374.   end
  375.   
  376.   #--------------------------------------------------------------------------
  377.   # hide
  378.   #--------------------------------------------------------------------------
  379.   def hide
  380.     deactivate
  381.     super
  382.   end
  383.   
  384. end # Window_CombatLog

  385. #==============================================================================
  386. # ■ Window_PartyCommand
  387. #==============================================================================

  388. class Window_PartyCommand < Window_Command
  389.   
  390.   #--------------------------------------------------------------------------
  391.   # alias method: make_command_list
  392.   #--------------------------------------------------------------------------
  393.   alias window_partycommand_make_command_list_cld make_command_list
  394.   def make_command_list
  395.     window_partycommand_make_command_list_cld
  396.     return if $imported["YEA-BattleCommandList"]
  397.     add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog)
  398.   end
  399.   
  400. end # Window_PartyCommand

  401. #==============================================================================
  402. # ■ Scene_Battle
  403. #==============================================================================

  404. class Scene_Battle < Scene_Base
  405.   
  406.   #--------------------------------------------------------------------------
  407.   # alias method: create_log_window
  408.   #--------------------------------------------------------------------------
  409.   alias scene_battle_create_log_window_cld create_log_window
  410.   def create_log_window
  411.     scene_battle_create_log_window_cld
  412.     create_combatlog_window
  413.   end
  414.   
  415.   #--------------------------------------------------------------------------
  416.   # new method: create_combatlog_window
  417.   #--------------------------------------------------------------------------
  418.   def create_combatlog_window
  419.     @combatlog_window = Window_CombatLog.new
  420.     @log_window.combatlog_window = @combatlog_window
  421.     @combatlog_window.set_handler(:cancel, method(:close_combatlog))
  422.     @combatlog_window.add_line("-")
  423.     @combatlog_window.add_line(YEA::COMBAT_LOG::TEXT_BATTLE_START)
  424.     @combatlog_window.add_line("-")
  425.   end
  426.   
  427.   #--------------------------------------------------------------------------
  428.   # new method: open_combatlog
  429.   #--------------------------------------------------------------------------
  430.   def open_combatlog
  431.     @combatlog_window.show
  432.   end
  433.   
  434.   #--------------------------------------------------------------------------
  435.   # new method: close_combatlog
  436.   #--------------------------------------------------------------------------
  437.   def close_combatlog
  438.     @combatlog_window.hide
  439.     if $imported["YEA-BattleCommandList"]
  440.       if !@confirm_command_window.nil? && @confirm_command_window.visible
  441.         @confirm_command_window.activate
  442.       else
  443.         @party_command_window.activate
  444.       end
  445.     else
  446.       @party_command_window.activate
  447.     end
  448.   end
  449.   
  450.   #--------------------------------------------------------------------------
  451.   # alias method: create_party_command_window
  452.   #--------------------------------------------------------------------------
  453.   alias create_party_command_window_cld create_party_command_window
  454.   def create_party_command_window
  455.     create_party_command_window_cld
  456.     @party_command_window.set_handler(:combatlog, method(:open_combatlog))
  457.   end
  458.   
  459.   #--------------------------------------------------------------------------
  460.   # alias method: turn_start
  461.   #--------------------------------------------------------------------------
  462.   alias scene_battle_turn_start_cld turn_start
  463.   def turn_start
  464.     scene_battle_turn_start_cld
  465.     @combatlog_window.add_line("-")
  466.     text = sprintf(YEA::COMBAT_LOG::TEXT_TURN_NUMBER, $game_troop.turn_count)
  467.     @combatlog_window.add_line(text)
  468.     @combatlog_window.add_line("-")
  469.   end
  470.   
  471.   #--------------------------------------------------------------------------
  472.   # alias method: execute_action
  473.   #--------------------------------------------------------------------------
  474.   alias scene_battle_execute_action_cld execute_action
  475.   def execute_action
  476.     @combatlog_window.add_line("-")
  477.     scene_battle_execute_action_cld
  478.     @combatlog_window.add_line("-")
  479.   end
  480.   
  481.   #--------------------------------------------------------------------------
  482.   # alias method: turn_end
  483.   #--------------------------------------------------------------------------
  484.   alias scene_battle_turn_end_cld turn_end
  485.   def turn_end
  486.     scene_battle_turn_end_cld
  487.     @combatlog_window.add_line("-")
  488.   end
  489.   
  490. end # Scene_Battle

  491. #==============================================================================
  492. #
  493. # ▼ End of File
  494. #
  495. #==============================================================================
复制代码
  1. #==============================================================================
  2. #
  3. # 仴 Yanfly Engine Ace - Battle Command List v1.09b
  4. # -- Last Updated: 2012.12.18
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-BattleCommandList"] = true

  11. #==============================================================================
  12. # 仴 Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.12.18 - Completely fixed the command hide switch bug.
  15. # 2012.12.17 - Fixed Bug with command hide until switch.
  16. # 2012.01.10 - Compatibility Update: Battle System FTB
  17. # 2011.12.30 - Bug Fixed: Disappearing windows when no confirm window is used.
  18. # 2011.12.26 - Bug Fixed: Actor Command Window disappears without Battle Engine
  19. #              Ace installed.
  20. # 2011.12.19 - Compatibility Update: Class System
  21. #            - New Actor Command: Subclass List
  22. # 2011.12.17 - Bug Fixed: Item command from Actor Command Window fixed.
  23. # 2011.12.15 - Bug Fixed: Prevented multiple actions per battler.
  24. # 2011.12.13 - Compatibility Update: Command Equip
  25. #              Compatibility Update: Add-On: Command Party
  26. # 2011.12.12 - Compatibility Update: Command Autobattle
  27. # 2011.12.10 - Started Script and Finished.
  28. #            - Compatibility Update: Combat Log Display
  29. #
  30. #==============================================================================
  31. # 仴 Introduction
  32. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  33. # This script allows you to change the order to commands that appear in battle
  34. # for the Party Command Window and Actor Command Window. In addition to the
  35. # ability to change the order commands appear, you may also add commands to the
  36. # Actor Command Window that can trigger the usage of skills and/or items. The
  37. # Confirm Command Window is also a new addition that appears at the end of the
  38. # action select phase (after the last actor has made a choice) before entering
  39. # the battle phase.
  40. #
  41. #==============================================================================
  42. # 仴 Instructions
  43. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  44. # To install this script, open up your script editor and copy/paste this script
  45. # to an open slot below 仴 Materials/慺嵽 but above 仴 Main. Remember to save.
  46. #
  47. # -----------------------------------------------------------------------------
  48. # Actor Notetags - These notetags go in the actors notebox in the database.
  49. # -----------------------------------------------------------------------------
  50. # <command list>
  51. #  string
  52. #  string
  53. # </command list>
  54. # These lines go inside of an actor's notebox to adjust the battle commands
  55. # that appear in the actor's Actor Command Window. Refer to the module as to
  56. # what to use for the strings. If a custom command list is used for an actor,
  57. # it will take priority over its class's custom command list, which takes place
  58. # over the default command list.
  59. #
  60. # -----------------------------------------------------------------------------
  61. # Class Notetags - These notetags go in the class notebox in the database.
  62. # -----------------------------------------------------------------------------
  63. # <command list>
  64. #  string
  65. #  string
  66. # </command list>
  67. # These lines go inside of a class's notebox to adjust the battle commands
  68. # that appear in the actor's Actor Command Window. Refer to the module as to
  69. # what to use for the strings. A custom command list for a class does not take
  70. # priority over an actor's custom command list, but it does take priority over
  71. # the default command list.
  72. #
  73. # -----------------------------------------------------------------------------
  74. # Skill Notetags - These notetags go in the skill notebox in the database.
  75. # -----------------------------------------------------------------------------
  76. # <command name: string>
  77. # If this skill is being used as a command, it will use "string" to replace the
  78. # skill's name in the command list window.
  79. #
  80. # <command hide until learn>
  81. # This hides the command until the actor has learned the respective skill for
  82. # the command to appear in the actor's command list.
  83. #
  84. # <command hide until usable>
  85. # This hides the command until the actor is capable of using the command by
  86. # meeting TP costs or MP costs.
  87. #
  88. # <command hide until switch: x>
  89. # This switch x is OFF, then the command remains hidden. If the switch is ON,
  90. # then the command becomes enabled and appears in the command list.
  91. #
  92. # -----------------------------------------------------------------------------
  93. # Item Notetags - These notetags go in the item notebox in the database.
  94. # -----------------------------------------------------------------------------
  95. # <command name: string>
  96. # If this item is being used as a command, it will use "string" to replace the
  97. # item's name in the command list window.
  98. #
  99. # <command hide until usable>
  100. # This hides the command until the actor is capable of using the command as
  101. # long as that item is usable normally.
  102. #
  103. # <command hide until switch: x>
  104. # This switch x is OFF, then the command remains hidden. If the switch is ON,
  105. # then the command becomes enabled and appears in the command list.
  106. #
  107. #==============================================================================
  108. # 仴 Compatibility
  109. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  110. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  111. # it will run with RPG Maker VX without adjusting.
  112. #
  113. # For maximum compatibility with Yanfly Engine Ace - Ace Battle Engine, place
  114. # this script under Ace Battle Engine.
  115. #
  116. #==============================================================================

  117. module YEA
  118.   module BATTLE_COMMANDS
  119.    
  120.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  121.     # - Party Command Window Settings -
  122.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  123.     # This section adjusts the commands for the Party Command Window. Rearrange
  124.     # commands as you see fit or add in new ones. Here's a list of which
  125.     # command does what:
  126.     #
  127.     # -------------------------------------------------------------------------
  128.     # :command         Description
  129.     # -------------------------------------------------------------------------
  130.     # :fight           Enters the command selection phase for actors. Default.
  131.     # :escape          Party attempts to escape from battle. Default.
  132.     #
  133.     # :combatlog       Requires YEA - Combat Log Display.
  134.     # :autobattle      Requires YEA - Command Autobattle.
  135.     # :party           Requires YEA - Party System Add-On: Command Party.
  136.     #
  137.     # And that's all of the currently available commands. This list will be
  138.     # updated as more scripts become available.
  139.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  140.     # This array arranges the order of which the commands appear in the Party
  141.     # Command window.
  142.     PARTY_COMMANDS =[
  143.       :fight,
  144.       :autobattle,
  145.       :party,
  146.       :combatlog,
  147.     # :custom1,
  148.     # :custom2,
  149.       :escape,
  150.     ] # Do not remove this.
  151.    
  152.     #--------------------------------------------------------------------------
  153.     # - Party Command Custom Commands -
  154.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  155.     # For those who use scripts to that may produce unique effects in battle,
  156.     # use this hash to manage the custom commands for the Party Command Window.
  157.     # You can disable certain commands or prevent them from appearing by using
  158.     # switches. If you don't wish to bind them to a switch, set the proper
  159.     # switch to 0 for it to have no impact.
  160.     #--------------------------------------------------------------------------
  161.     CUSTOM_PARTY_COMMANDS ={
  162.     # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  163.       :custom1 => [ "Custom Name",            0,         0, :command_name1],
  164.       :custom2 => [ "Custom Name",           13,         0, :command_name2],
  165.     } # Do not remove this.
  166.    
  167.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  168.     # - Actor Command Window Settings -
  169.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  170.     # This section only adjusts the default commands for actors. If you wish
  171.     # for an actor to have a unique command list, use the notetags listed in
  172.     # the instructions to apply them. The custom command lists for actors will
  173.     # override this command list.
  174.     #
  175.     # Here's a list of which command does what:
  176.     #
  177.     # -------------------------------------------------------------------------
  178.     # :command         Description
  179.     # -------------------------------------------------------------------------
  180.     # "ATTACK"         Normal attack for actor. Default.
  181.     # "SKILL LIST"     All of the skill types the actor can use. Default.
  182.     # "DEFEND"         Set defend action for actor. Default.
  183.     # "ITEMS"          Opens up the item menu for the actor. Default.
  184.     #
  185.     # "SKILL TYPE X"   Specifically puts in skill type X if actor has it.
  186.     # "SKILL X"        Uses Skill X in that slot.
  187.     # "ITEM X"         Uses Item X in that slot.
  188.     #
  189.     # "AUTOBATTLE"     Requires YEA - Command Autobattle.
  190.     # "EQUIP"          Requires YEA - Command Equip
  191.     # "SUBCLASS LIST"  Requires YEA - Class System. Adds subclass skill types.
  192.     #
  193.     # And that's all of the currently available commands. This list will be
  194.     # updated as more scripts become available.
  195.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  196.     # This array arranges the order of which the commands appear in the Actor
  197.     # Command window if the actor does not have a custom command list.
  198.     DEFAULT_ACTOR_COMMANDS =[
  199.     # "AUTOBATTLE",
  200.       "ATTACK",
  201.       "SKILL LIST",
  202.       "SUBCLASS LIST",
  203.       "DEFEND",
  204.       "ITEMS",
  205.       "EQUIP",
  206.     ] # Do not remove this.
  207.    
  208.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  209.     # - Confirm Command Window Settings -
  210.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  211.     # The confirm window is something new that's been added. It shows after the
  212.     # last actor has made a decision as to what actions the player wishes to
  213.     # take for the turn Here's a list of which command does what:
  214.     #
  215.     # -------------------------------------------------------------------------
  216.     # :command         Description
  217.     # -------------------------------------------------------------------------
  218.     # :execute         Start the battle turn. Comes with this script.
  219.     #
  220.     # :combatlog       Requires YEA - Combat Log Display.
  221.     #
  222.     # And that's all of the currently available commands. This list will be
  223.     # updated as more scripts become available.
  224.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  225.     USE_CONFIRM_WINDOW = true    # Set to false if you don't wish to use it.
  226.    
  227.     # This array arranges the order of which the commands appear in the Party
  228.     # Command window.
  229.     CONFIRM_COMMANDS =[
  230.       :execute,
  231.       :combatlog,
  232.     # :custom1,
  233.     # :custom2,
  234.     ] # Do not remove this.
  235.    
  236.     # This sets what text appears for the execute command.
  237.     EXECUTE_VOCAB = "Execute"
  238.    
  239.     #--------------------------------------------------------------------------
  240.     # - Confirm Command Custom Commands -
  241.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  242.     # For those who use scripts to that may produce unique effects in battle,
  243.     # use this hash to manage the custom commands for the Confirm Command
  244.     # Window. You can disable certain commands or prevent them from appearing
  245.     # by using switches. If you don't wish to bind them to a switch, set the
  246.     # proper switch to 0 for it to have no impact.
  247.     #--------------------------------------------------------------------------
  248.     CUSTOM_CONFIRM_COMMANDS ={
  249.     # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  250.       :custom1 => [ "Custom Name",            0,          0, :command_name1],
  251.       :custom2 => [ "Custom Text",           13,          0, :command_name2],
  252.     } # Do not remove this.
  253.    
  254.   end # BATTLE_COMMANDS
  255. end # YEA

  256. #==============================================================================
  257. # 仴 Editting anything past this point may potentially result in causing
  258. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  259. # halitosis so edit at your own risk.
  260. #==============================================================================

  261. module YEA
  262.   module REGEXP
  263.   module BASEITEM
  264.    
  265.     COMMAND_LIST_ON  = /<(?:COMMAND_LIST|command list)>/i
  266.     COMMAND_LIST_OFF = /<\/(?:COMMAND_LIST|command list)>/i
  267.    
  268.   end # BASEITEM
  269.   module USABLEITEM
  270.    
  271.     COMMAND_NAME = /<(?:COMMAND NAME|command name):[ ](.*)>/i
  272.     COMMAND_HIDE_LEARN =
  273.       /<(?:COMMAND_HIDE_UNTIL_LEARN|command hide until learn)>/i
  274.     COMMAND_HIDE_USABLE =
  275.       /<(?:COMMAND_HIDE_UNTIL_USABLE|command hide until usable)>/i
  276.     COMMAND_HIDE_SWITCH =
  277.       /<(?:COMMAND_HIDE_UNTIL_SWITCH|command hide until switch):[ ](\d+)>/i
  278.    
  279.   end # USABLEITEM
  280.   end # REGEXP
  281. end # YEA

  282. #==============================================================================
  283. # 仭 DataManager
  284. #==============================================================================

  285. module DataManager
  286.   
  287.   #--------------------------------------------------------------------------
  288.   # alias method: load_database
  289.   #--------------------------------------------------------------------------
  290.   class <<self; alias load_database_bcl load_database; end
  291.   def self.load_database
  292.     load_database_bcl
  293.     load_notetags_bcl
  294.   end
  295.   
  296.   #--------------------------------------------------------------------------
  297.   # new method: load_notetags_bcl
  298.   #--------------------------------------------------------------------------
  299.   def self.load_notetags_bcl
  300.     groups = [$data_actors, $data_classes, $data_skills, $data_items]
  301.     for group in groups
  302.       for obj in group
  303.         next if obj.nil?
  304.         obj.load_notetags_bcl
  305.       end
  306.     end
  307.   end
  308.   
  309. end # DataManager

  310. #==============================================================================
  311. # 仭 RPG::BaseItem
  312. #==============================================================================

  313. class RPG::BaseItem
  314.   
  315.   #--------------------------------------------------------------------------
  316.   # public instance variables
  317.   #--------------------------------------------------------------------------
  318.   attr_accessor :battle_commands
  319.   
  320.   #--------------------------------------------------------------------------
  321.   # common cache: load_notetags_bcl
  322.   #--------------------------------------------------------------------------
  323.   def load_notetags_bcl
  324.     @battle_commands = []
  325.     @command_list = false
  326.     #---
  327.     self.note.split(/[\r\n]+/).each { |line|
  328.       case line
  329.       #---
  330.       when YEA::REGEXP::BASEITEM::COMMAND_LIST_ON
  331.         @command_list = true
  332.       when YEA::REGEXP::BASEITEM::COMMAND_LIST_OFF
  333.         @command_list = false
  334.       else
  335.         next unless @command_list
  336.         @battle_commands.push(line.to_s.upcase)
  337.       #---
  338.       end
  339.     } # self.note.split
  340.     #---
  341.     if @battle_commands == [] and self.is_a?(RPG::Class)
  342.       @battle_commands = YEA::BATTLE_COMMANDS::DEFAULT_ACTOR_COMMANDS
  343.     end
  344.   end
  345.   
  346. end # RPG::BaseItem

  347. #==============================================================================
  348. # 仭 RPG::UsableItem
  349. #==============================================================================

  350. class RPG::UsableItem < RPG::BaseItem
  351.   
  352.   #--------------------------------------------------------------------------
  353.   # public instance variables
  354.   #--------------------------------------------------------------------------
  355.   attr_accessor :command_name
  356.   attr_accessor :command_hide_until_learn
  357.   attr_accessor :command_hide_until_usable
  358.   attr_accessor :command_hide_until_switch
  359.   
  360.   #--------------------------------------------------------------------------
  361.   # common cache: load_notetags_bcl
  362.   #--------------------------------------------------------------------------
  363.   def load_notetags_bcl
  364.     @command_name = @name.clone
  365.     @command_hide_until_switch = 0
  366.     #---
  367.     self.note.split(/[\r\n]+/).each { |line|
  368.       case line
  369.       #---
  370.       when YEA::REGEXP::USABLEITEM::COMMAND_NAME
  371.         @command_name = $1.to_s
  372.       when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_LEARN
  373.         @command_hide_until_learn = true
  374.       when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_USABLE
  375.         @command_hide_until_usable = true
  376.       when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_SWITCH
  377.         @command_hide_until_switch = $1.to_i
  378.       #---
  379.       end
  380.     } # self.note.split
  381.     #---
  382.   end
  383.   
  384. end # RPG::UsableItem

  385. #==============================================================================
  386. # 仭 Game_Actor
  387. #==============================================================================

  388. class Game_Actor < Game_Battler
  389.   
  390.   #--------------------------------------------------------------------------
  391.   # new method: battle_commands
  392.   #--------------------------------------------------------------------------
  393.   def battle_commands
  394.     return self.actor.battle_commands unless actor.battle_commands == []
  395.     return self.class.battle_commands
  396.   end
  397.   
  398.   #--------------------------------------------------------------------------
  399.   # new method: next_command_valid?
  400.   #--------------------------------------------------------------------------
  401.   def next_command_valid?
  402.     if $imported["YEA-BattleSystem-FTB"] && BattleManager.btype?(:ftb)
  403.       return false
  404.     end
  405.     return false if @action_input_index >= @actions.size - 1
  406.     return true
  407.   end
  408.   
  409. end # Game_Actor

  410. #==============================================================================
  411. # 仭 Window_PartyCommand
  412. #==============================================================================

  413. class Window_PartyCommand < Window_Command
  414.   
  415.   #--------------------------------------------------------------------------
  416.   # overwrite method: make_command_list
  417.   #--------------------------------------------------------------------------
  418.   def make_command_list
  419.     for command in YEA::BATTLE_COMMANDS::PARTY_COMMANDS
  420.       case command
  421.       when :fight
  422.         add_command(Vocab::fight, :fight)
  423.       when :escape
  424.         add_command(Vocab::escape, :escape, BattleManager.can_escape?)
  425.       when :combatlog
  426.         next unless $imported["YEA-CombatLogDisplay"]
  427.         add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog)
  428.       when :autobattle
  429.         next unless $imported["YEA-CommandAutobattle"]
  430.         add_autobattle_command
  431.       when :party
  432.         next unless $imported["YEA-PartySystem"]
  433.         next unless $imported["YEA-CommandParty"]
  434.         add_party_command
  435.       else
  436.         process_custom_command(command)
  437.       end
  438.     end
  439.   end
  440.   
  441.   #--------------------------------------------------------------------------
  442.   # new method: process_custom_command
  443.   #--------------------------------------------------------------------------
  444.   def process_custom_command(command)
  445.     return unless YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS.include?(command)
  446.     show = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][2]
  447.     continue = show <= 0 ? true : $game_switches[show]
  448.     return unless continue
  449.     text = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][0]
  450.     switch = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][1]
  451.     enabled = switch <= 0 ? true : $game_switches[switch]
  452.     add_command(text, command, enabled)
  453.   end
  454.   
  455. end # Window_PartyCommand

  456. #==============================================================================
  457. # 仭 Window_ConfirmCommand
  458. #==============================================================================

  459. class Window_ConfirmCommand < Window_Command
  460.   
  461.   #--------------------------------------------------------------------------
  462.   # initialize
  463.   #--------------------------------------------------------------------------
  464.   def initialize
  465.     super(0, 0)
  466.     deactivate
  467.     hide
  468.   end
  469.   
  470.   #--------------------------------------------------------------------------
  471.   # window_width
  472.   #--------------------------------------------------------------------------
  473.   def window_width; return 128; end
  474.   
  475.   #--------------------------------------------------------------------------
  476.   # visible_line_number
  477.   #--------------------------------------------------------------------------
  478.   def visible_line_number; return 4; end
  479.   
  480.   #--------------------------------------------------------------------------
  481.   # overwrite method: make_command_list
  482.   #--------------------------------------------------------------------------
  483.   def make_command_list
  484.     for command in YEA::BATTLE_COMMANDS::CONFIRM_COMMANDS
  485.       case command
  486.       when :execute
  487.         text = YEA::BATTLE_COMMANDS::EXECUTE_VOCAB
  488.         add_command(text, :execute)
  489.       when :combatlog
  490.         next unless $imported["YEA-CombatLogDisplay"]
  491.         add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog)
  492.       else
  493.         process_custom_command(command)
  494.       end
  495.     end
  496.   end
  497.   
  498.   #--------------------------------------------------------------------------
  499.   # new method: process_custom_command
  500.   #--------------------------------------------------------------------------
  501.   def process_custom_command(command)
  502.     return unless YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS.include?(command)
  503.     show = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][2]
  504.     continue = show <= 0 ? true : $game_switches[show]
  505.     return unless continue
  506.     text = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][0]
  507.     switch = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][1]
  508.     enabled = switch <= 0 ? true : $game_switches[switch]
  509.     add_command(text, command, enabled)
  510.   end
  511.   
  512.   #--------------------------------------------------------------------------
  513.   # setup
  514.   #--------------------------------------------------------------------------
  515.   def setup
  516.     clear_command_list
  517.     make_command_list
  518.     refresh
  519.     select(0)
  520.     activate
  521.     self.openness = 255
  522.     show
  523.   end
  524.   
  525.   #--------------------------------------------------------------------------
  526.   # process_handling
  527.   #--------------------------------------------------------------------------
  528.   if $imported["YEA-BattleEngine"]
  529.   def process_handling
  530.     return unless open? && active
  531.     return process_dir4 if Input.repeat?(:LEFT)
  532.     return super
  533.   end
  534.   
  535.   #--------------------------------------------------------------------------
  536.   # process_dir4
  537.   #--------------------------------------------------------------------------
  538.   def process_dir4
  539.     Sound.play_cursor
  540.     Input.update
  541.     deactivate
  542.     call_handler(:dir4)
  543.   end
  544.   end # $imported["YEA-BattleEngine"]
  545.   
  546. end # Window_ConfirmCommand

  547. #==============================================================================
  548. # 仭 Window_ActorCommand
  549. #==============================================================================

  550. class Window_ActorCommand < Window_Command
  551.   
  552.   #--------------------------------------------------------------------------
  553.   # alias method: setup
  554.   #--------------------------------------------------------------------------
  555.   alias window_actorcommand_setup_bcl setup
  556.   def setup(actor)
  557.     window_actorcommand_setup_bcl(actor)
  558.     show
  559.   end
  560.   
  561.   #--------------------------------------------------------------------------
  562.   # overwrite method: make_command_list
  563.   #--------------------------------------------------------------------------
  564.   def make_command_list
  565.     return if @actor.nil?
  566.     @stype_list = []
  567.     for command in @actor.battle_commands
  568.       case command.upcase
  569.       #---
  570.       when /ATTACK/i
  571.         add_attack_command
  572.       when /SKILL LIST/i
  573.         add_skill_commands
  574.       when /DEFEND/i
  575.         add_guard_command
  576.       when /ITEMS/i
  577.         add_item_command
  578.       #---
  579.       when /SKILL TYPE[ ](\d+)/i
  580.         add_skill_type_command($1.to_i)
  581.       when /SKILL[ ](\d+)/i
  582.         add_skill_id_command($1.to_i)
  583.       when /ITEM[ ](\d+)/i
  584.         add_item_id_command($1.to_i)
  585.       #---
  586.       when /AUTOBATTLE/i
  587.         next unless $imported["YEA-CommandAutobattle"]
  588.         add_autobattle_command
  589.       when /EQUIP/i
  590.         next unless $imported["YEA-CommandEquip"]
  591.         add_equip_command
  592.       when /SUBCLASS LIST/i
  593.         add_subclass_skill_types
  594.       #---
  595.       else; next        
  596.       end
  597.     end
  598.   end
  599.   
  600.   #--------------------------------------------------------------------------
  601.   # overwrite method: add_skill_commands
  602.   #--------------------------------------------------------------------------
  603.   def add_skill_commands
  604.     @actor.added_skill_types.each do |stype_id|
  605.       next if @stype_list.include?(stype_id)
  606.       next if include_subclass_type?(stype_id)
  607.       add_skill_type_command(stype_id)
  608.     end
  609.   end
  610.   
  611.   #--------------------------------------------------------------------------
  612.   # new method: include_subclass_type?
  613.   #--------------------------------------------------------------------------
  614.   def include_subclass_type?(stype_id)
  615.     return false unless $imported["YEA-ClassSystem"]
  616.     return @actor.subclass_skill_types.include?(stype_id)
  617.   end
  618.   
  619.   #--------------------------------------------------------------------------
  620.   # new method: add_subclass_skill_types
  621.   #--------------------------------------------------------------------------
  622.   def add_subclass_skill_types
  623.     return unless $imported["YEA-ClassSystem"]
  624.     return if @actor.subclass.nil?
  625.     @actor.subclass_skill_types.sort.each do |stype_id|
  626.       next if @stype_list.include?(stype_id)
  627.       add_skill_type_command(stype_id)
  628.     end
  629.   end
  630.   
  631.   #--------------------------------------------------------------------------
  632.   # new method: add_skill_type_command
  633.   #--------------------------------------------------------------------------
  634.   def add_skill_type_command(stype_id)
  635.     return unless @actor.added_skill_types.include?(stype_id)
  636.     return if @stype_list.include?(stype_id)
  637.     @stype_list.push(stype_id)
  638.     name = $data_system.skill_types[stype_id]
  639.     add_command(name, :skill, true, stype_id)
  640.   end
  641.   
  642.   #--------------------------------------------------------------------------
  643.   # new method: add_skill_id_command
  644.   #--------------------------------------------------------------------------
  645.   def add_skill_id_command(skill_id)
  646.     return if $data_skills[skill_id].nil?
  647.     return unless add_use_skill?(skill_id)
  648.     name = $data_skills[skill_id].command_name
  649.     add_command(name, :use_skill, use_skill_valid?(skill_id), skill_id)
  650.   end
  651.   
  652.   #--------------------------------------------------------------------------
  653.   # new method: add_use_skill?
  654.   #--------------------------------------------------------------------------
  655.   def add_use_skill?(skill_id)
  656.     skill = $data_skills[skill_id]
  657.     return false if hide_until_learn?(skill)
  658.     return false if hide_until_usable?(skill)
  659.     return false if hide_until_switch?(skill)
  660.     return true
  661.   end
  662.   
  663.   #--------------------------------------------------------------------------
  664.   # new method: hide_until_learn?
  665.   #--------------------------------------------------------------------------
  666.   def hide_until_learn?(skill)
  667.     return false unless skill.command_hide_until_learn
  668.     return false if @actor.skill_learn?(skill)
  669.     return false if @actor.added_skills.include?(skill.id)
  670.     return true
  671.   end
  672.   
  673.   #--------------------------------------------------------------------------
  674.   # new method: hide_until_usable?
  675.   #--------------------------------------------------------------------------
  676.   def hide_until_usable?(skill)
  677.     return false unless skill.command_hide_until_usable
  678.     return false if @actor.usable?(skill)
  679.     return true
  680.   end
  681.   
  682.   #--------------------------------------------------------------------------
  683.   # new method: hide_until_switch?
  684.   #--------------------------------------------------------------------------
  685.   def hide_until_switch?(skill)
  686.     return false unless skill.command_hide_until_switch > 0
  687.     return false if $game_switches[skill.command_hide_until_switch]
  688.     return true
  689.   end
  690.   
  691.   #--------------------------------------------------------------------------
  692.   # new method: use_skill_valid?
  693.   #--------------------------------------------------------------------------
  694.   def use_skill_valid?(skill_id)
  695.     skill = $data_skills[skill_id]
  696.     return false unless @actor.skill_conditions_met?(skill)
  697.     return true
  698.   end
  699.   
  700.   #--------------------------------------------------------------------------
  701.   # new method: add_item_id_command
  702.   #--------------------------------------------------------------------------
  703.   def add_item_id_command(item_id)
  704.     return if $data_items[item_id].nil?
  705.     return unless add_use_item?(item_id)
  706.     name = $data_items[item_id].command_name
  707.     add_command(name, :use_item, use_item_valid?(item_id), item_id)
  708.   end
  709.   
  710.   #--------------------------------------------------------------------------
  711.   # new method: add_use_item?
  712.   #--------------------------------------------------------------------------
  713.   def add_use_item?(item_id)
  714.     item = $data_items[item_id]
  715.     return false if hide_until_usable?(item)
  716.     return false if hide_until_switch?(item)
  717.     return true
  718.   end
  719.   
  720.   #--------------------------------------------------------------------------
  721.   # new method: use_item_valid?
  722.   #--------------------------------------------------------------------------
  723.   def use_item_valid?(item_id)
  724.     item = $data_items[item_id]
  725.     return false unless @actor.item_conditions_met?(item)
  726.     return true
  727.   end
  728.   
  729. end # Window_ActorCommand

  730. #==============================================================================
  731. # 仭 Scene_Battle
  732. #==============================================================================

  733. class Scene_Battle < Scene_Base
  734.   
  735.   #--------------------------------------------------------------------------
  736.   # alias method: create_all_windows
  737.   #--------------------------------------------------------------------------
  738.   alias scene_battle_create_all_windows_bcl create_all_windows
  739.   def create_all_windows
  740.     scene_battle_create_all_windows_bcl
  741.     create_confirm_command_window
  742.   end
  743.   
  744.   #--------------------------------------------------------------------------
  745.   # alias method: create_party_command_window
  746.   #--------------------------------------------------------------------------
  747.   alias create_party_command_window_bcl create_party_command_window
  748.   def create_party_command_window
  749.     create_party_command_window_bcl
  750.     process_custom_party_commands
  751.   end
  752.   
  753.   #--------------------------------------------------------------------------
  754.   # new method: process_custom_party_commands
  755.   #--------------------------------------------------------------------------
  756.   def process_custom_party_commands
  757.     for command in YEA::BATTLE_COMMANDS::PARTY_COMMANDS
  758.       next unless YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS.include?(command)
  759.       called_method = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][3]
  760.       @party_command_window.set_handler(command, method(called_method))
  761.     end
  762.   end
  763.   
  764.   #--------------------------------------------------------------------------
  765.   # alias method: create_actor_command_window
  766.   #--------------------------------------------------------------------------
  767.   alias create_actor_command_window_bcl create_actor_command_window
  768.   def create_actor_command_window
  769.     create_actor_command_window_bcl
  770.     @actor_command_window.set_handler(:use_skill, method(:command_use_skill))
  771.     @actor_command_window.set_handler(:use_item, method(:command_use_item))
  772.   end
  773.   
  774.   #--------------------------------------------------------------------------
  775.   # alias method: start_actor_command_selection
  776.   #--------------------------------------------------------------------------
  777.   alias start_actor_command_selection_bcl start_actor_command_selection
  778.   def start_actor_command_selection
  779.     @confirm_command_window.hide unless @confirm_command_window.nil?
  780.     start_actor_command_selection_bcl
  781.     @actor_command_window.show
  782.   end
  783.   
  784.   #--------------------------------------------------------------------------
  785.   # new method: command_use_skill
  786.   #--------------------------------------------------------------------------
  787.   def command_use_skill
  788.     @skill = $data_skills[@actor_command_window.current_ext]
  789.     BattleManager.actor.input.set_skill(@skill.id)
  790.     BattleManager.actor.last_skill.object = @skill
  791.     status_redraw_target(BattleManager.actor)
  792.     if $imported["YEA-BattleEngine"]
  793.       $game_temp.battle_aid = @skill
  794.       if @skill.for_opponent?
  795.         select_enemy_selection
  796.       elsif @skill.for_friend?
  797.         select_actor_selection
  798.       else
  799.         next_command
  800.         $game_temp.battle_aid = nil
  801.       end
  802.     else
  803.       if [email protected]_selection?
  804.         next_command
  805.       elsif @skill.for_opponent?
  806.         select_enemy_selection
  807.       else
  808.         select_actor_selection
  809.       end
  810.     end
  811.   end
  812.   
  813.   #--------------------------------------------------------------------------
  814.   # new method: command_use_item
  815.   #--------------------------------------------------------------------------
  816.   def command_use_item
  817.     @item = $data_items[@actor_command_window.current_ext]
  818.     BattleManager.actor.input.set_item(@item.id)
  819.     status_redraw_target(BattleManager.actor)
  820.     if $imported["YEA-BattleEngine"]
  821.       $game_temp.battle_aid = @item
  822.       if @item.for_opponent?
  823.         select_enemy_selection
  824.       elsif @item.for_friend?
  825.         select_actor_selection
  826.       else
  827.         next_command
  828.         $game_temp.battle_aid = nil
  829.       end
  830.     else
  831.       if [email protected]_selection?
  832.         next_command
  833.       elsif @item.for_opponent?
  834.         select_enemy_selection
  835.       else
  836.         select_actor_selection
  837.       end
  838.     end
  839.   end
  840.   
  841.   #--------------------------------------------------------------------------
  842.   # alias method: on_actor_ok
  843.   #--------------------------------------------------------------------------
  844.   alias scene_battle_on_actor_ok_bcl on_actor_ok
  845.   def on_actor_ok
  846.     scene_battle_on_actor_ok_bcl
  847.     return if !@confirm_command_window.nil? && @confirm_command_window.visible
  848.     @actor_command_window.show
  849.   end
  850.   
  851.   #--------------------------------------------------------------------------
  852.   # alias method: on_actor_cancel
  853.   #--------------------------------------------------------------------------
  854.   alias scene_battle_on_actor_cancel_bcl on_actor_cancel
  855.   def on_actor_cancel
  856.     scene_battle_on_actor_cancel_bcl
  857.     case @actor_command_window.current_symbol
  858.     when :use_skill, :use_item
  859.       @help_window.hide
  860.       @status_window.show
  861.       @actor_command_window.activate
  862.       status_redraw_target(BattleManager.actor)
  863.     end
  864.   end
  865.   
  866.   #--------------------------------------------------------------------------
  867.   # alias method: on_enemy_ok
  868.   #--------------------------------------------------------------------------
  869.   alias scene_battle_on_enemy_ok_bcl on_enemy_ok
  870.   def on_enemy_ok
  871.     scene_battle_on_enemy_ok_bcl
  872.     return if !@confirm_command_window.nil? && @confirm_command_window.visible
  873.     @actor_command_window.show
  874.   end
  875.   
  876.   #--------------------------------------------------------------------------
  877.   # alias method: on_enemy_cancel
  878.   #--------------------------------------------------------------------------
  879.   alias scene_battle_on_enemy_cancel_bcl on_enemy_cancel
  880.   def on_enemy_cancel
  881.     scene_battle_on_enemy_cancel_bcl
  882.     case @actor_command_window.current_symbol
  883.     when :use_skill, :use_item
  884.       @help_window.hide
  885.       @status_window.show
  886.       @actor_command_window.activate
  887.       status_redraw_target(BattleManager.actor)
  888.     end
  889.   end
  890.   
  891.   #--------------------------------------------------------------------------
  892.   # new method: status_redraw_target
  893.   #--------------------------------------------------------------------------
  894.   def status_redraw_target(target)
  895.     return unless target.actor?
  896.     @status_window.draw_item($game_party.battle_members.index(target))
  897.   end
  898.   
  899.   #--------------------------------------------------------------------------
  900.   # new method: create_confirm_command_window
  901.   #--------------------------------------------------------------------------
  902.   def create_confirm_command_window
  903.     return unless YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW
  904.     @confirm_command_window = Window_ConfirmCommand.new
  905.     @confirm_command_window.viewport = @info_viewport
  906.     @confirm_command_window.set_handler(:execute, method(:command_execute))
  907.     @confirm_command_window.set_handler(:cancel, method(:on_confirm_cancel))
  908.     @confirm_command_window.set_handler(:dir4, method(:on_confirm_cancel))
  909.     @confirm_command_window.unselect
  910.     @confirm_command_window.x = Graphics.width
  911.     process_custom_confirm_commands
  912.     process_confirm_compatibility_commands
  913.   end
  914.   
  915.   #--------------------------------------------------------------------------
  916.   # new method: process_custom_confirm_commands
  917.   #--------------------------------------------------------------------------
  918.   def process_custom_confirm_commands
  919.     for command in YEA::BATTLE_COMMANDS::CONFIRM_COMMANDS
  920.       next unless YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS.include?(command)
  921.       called_method = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][3]
  922.       @party_command_window.set_handler(command, method(called_method))
  923.     end
  924.   end
  925.   
  926.   #--------------------------------------------------------------------------
  927.   # new method: process_confirm_compatibility_commands
  928.   #--------------------------------------------------------------------------
  929.   def process_confirm_compatibility_commands
  930.     #---
  931.     if $imported["YEA-CombatLogDisplay"]
  932.       @confirm_command_window.set_handler(:combatlog, method(:open_combatlog))
  933.     end
  934.     #---
  935.   end
  936.   
  937.   #--------------------------------------------------------------------------
  938.   # new method: start_confirm_command_selection
  939.   #--------------------------------------------------------------------------
  940.   def start_confirm_command_selection
  941.     if $imported["YEA-BattleEngine"]
  942.       @status_window.show
  943.       redraw_current_status
  944.       @status_aid_window.hide
  945.     end
  946.     @status_window.unselect
  947.     @actor_command_window.hide
  948.     @confirm_command_window.setup
  949.   end
  950.   
  951.   #--------------------------------------------------------------------------
  952.   # new method: on_confirm_cancel
  953.   #--------------------------------------------------------------------------
  954.   def on_confirm_cancel
  955.     @confirm_command_window.hide unless @confirm_command_window.nil?
  956.     @actor_command_window.show
  957.     @actor_command_window.setup(BattleManager.actor)
  958.     @status_window.select(BattleManager.actor.index)
  959.     prior_command unless BattleManager.actor.inputable?
  960.   end
  961.   
  962.   #--------------------------------------------------------------------------
  963.   # alias method: next_command
  964.   #--------------------------------------------------------------------------
  965.   alias scene_battle_next_command_bcl next_command
  966.   def next_command
  967.     if prompt_next_actor?
  968.       scene_battle_next_command_bcl
  969.     elsif YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW
  970.       start_confirm_command_selection
  971.     else
  972.       turn_start
  973.     end
  974.   end
  975.   
  976.   #--------------------------------------------------------------------------
  977.   # new method: prompt_next_actor?
  978.   #--------------------------------------------------------------------------
  979.   def prompt_next_actor?
  980.     index = @status_window.index
  981.     last_index = $game_party.battle_members.size - 1
  982.     for member in $game_party.battle_members.reverse
  983.       break if member.inputable?
  984.       last_index -= 1
  985.     end
  986.     if index >= last_index
  987.       actor = $game_party.battle_members[index]
  988.       return true if prompt_ftb_action?(actor)
  989.       return true if actor.next_command_valid?
  990.       return false if YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW
  991.     end
  992.     return true
  993.   end
  994.   
  995.   #--------------------------------------------------------------------------
  996.   # new method: prompt_ftb_action?
  997.   #--------------------------------------------------------------------------
  998.   def prompt_ftb_action?(actor)
  999.     return false unless $imported["YEA-BattleEngine"]
  1000.     return false unless $imported["YEA-BattleSystem-FTB"]
  1001.     return false unless BattleManager.btype?(:ftb)
  1002.     return actor.current_action.valid?
  1003.   end
  1004.   
  1005.   #--------------------------------------------------------------------------
  1006.   # new method: command_execute
  1007.   #--------------------------------------------------------------------------
  1008.   def command_execute
  1009.     @confirm_command_window.close
  1010.     turn_start
  1011.   end
  1012.   
  1013.   #--------------------------------------------------------------------------
  1014.   # new method: command_name1
  1015.   #--------------------------------------------------------------------------
  1016.   def command_name1
  1017.     # Do nothing.
  1018.   end
  1019.   
  1020.   #--------------------------------------------------------------------------
  1021.   # new method: command_name2
  1022.   #--------------------------------------------------------------------------
  1023.   def command_name2
  1024.     # Do nothing.
  1025.   end
  1026.   
  1027. end # Scene_Battle

  1028. #==============================================================================
  1029. #
  1030. # 仴 End of File
  1031. #
  1032. #==============================================================================
复制代码

01.png (303.23 KB, 下载次数: 20)

01.png

02.png (270.61 KB, 下载次数: 19)

02.png

03.png (284.61 KB, 下载次数: 21)

03.png
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-15 15:56

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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