Advertisement
roninator2

Jamiras Dragon Quest Battle Mod

Dec 6th, 2024
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.01 KB | None | 0 0
  1. #============================================================================
  2. # [VXAce] Dragon Quest Battle V1.00 (Mod)
  3. #----------------------------------------------------------------------------
  4. # By Roninator2 - For Jamiras843# DQ Battle
  5. # Features:
  6. #     V1.00
  7. #     * Dragon Quest XI Enemy Grouping
  8. #     * Display Enemy number
  9. #     * Always show enemy window during action selection
  10. #============================================================================
  11. class Window_BattleEnemy < Window_Selectable
  12.   def initialize(info_viewport)
  13.     super(200, 296, 344, item_max * 24 + 24)
  14.     refresh  
  15.     self.visible = false
  16.   end
  17.   def col_max
  18.     return 1
  19.   end
  20.   def item_max
  21.     @group = []
  22.     $game_troop.alive_members.each do |e|
  23.       @group << e.enemy_id if !@group.include?(e.enemy_id)
  24.     end
  25.     return @group.size
  26.   end
  27.   def draw_item(index)
  28.     id = $game_troop.alive_members[index].enemy_id
  29.     return if @grplist.include?(id)
  30.     change_color(normal_color)
  31.     name = $game_troop.alive_members[index].name
  32.     draw_text(item_rect_for_text(@ind_line), name)
  33.     draw_text(item_rect_for_text(@ind_line), quantity(index), 2)
  34.     @ind_line += 1
  35.     @grplist.push(id) if !@grplist.include?(id)
  36.   end
  37.   def quantity(index)
  38.     count = 0
  39.     $game_troop.alive_members.each do |e|
  40.       count += 1 if e.enemy_id == $game_troop.alive_members[index].enemy_id
  41.     end
  42.     return count
  43.   end
  44.   def refresh
  45.     contents.clear
  46.     @grplist = []
  47.     @ind_line = 0
  48.     draw_all_items
  49.   end
  50. end
  51. class Scene_Battle < Scene_Base
  52.   def on_enemy_ok
  53.     BattleManager.actor.input.target_index = @enemy_window.enemy.index
  54.     @enemy_window.unselect
  55.     @skill_window.hide
  56.     @item_window.hide
  57.     next_command
  58.   end
  59.   def on_enemy_cancel
  60.     @enemy_window.unselect
  61.     case @actor_command_window.current_symbol
  62.     when :attack
  63.       @actor_command_window.activate
  64.     when :skill
  65.       @skill_window.activate
  66.     when :item
  67.       @item_window.activate
  68.     end
  69.   end
  70.   def create_enemy_window  
  71.     @enemy_window = Window_BattleEnemy.new(@help_window)  
  72.     @enemy_window.set_handler(:ok,     method(:on_enemy_ok))  
  73.     @enemy_window.set_handler(:cancel, method(:on_enemy_cancel))
  74.   end  
  75.   def start_party_command_selection
  76.     @enemy_window.show
  77.     @enemy_window.refresh
  78.     unless scene_changing?    
  79.     refresh_status    
  80.     @DQ_status_window.open    
  81.     if BattleManager.input_start      
  82.       @actor_command_window.close      
  83.       @party_command_window.setup    
  84.     else      
  85.       @party_command_window.deactivate      
  86.       turn_start    
  87.     end  
  88.     end
  89.   end
  90.   def command_escape
  91.     @enemy_window.hide
  92.     turn_start unless BattleManager.process_escape
  93.   end
  94.   def turn_start  
  95.     @party_command_window.close  
  96.     @actor_command_window.close  
  97.     @enemy_window.hide
  98.     @subject =  nil  
  99.     BattleManager.turn_start  
  100.     if Jami_DQ_Battle::HUD_HIDE == true  
  101.       @info_viewport.rect.height = 60  
  102.     end #if HUDE_HIDE  
  103.     @log_window.clear
  104.   end
  105. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement