MUSHRA

NEW ATB

Jul 23rd, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 25.99 KB | None | 0 0
  1. #==============================================================================
  2. # +++ MOG - AT System  (v0.4 Beta) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com/
  6. #==============================================================================
  7. # Sistema de batalha de turnos em tempo real.
  8. #==============================================================================
  9.  
  10. #==============================================================================
  11. # ● Histórico (Version History)
  12. #==============================================================================
  13. # v 0.4 - Corrigido o erro de crash randômico. (relativo a dispose de imagem.)
  14. #       - Corrigido o erro de crash randômico. (relativo ao turno.)
  15. #       - Corrigido o bug de travar a tela na execução da mensagem de batalha.
  16. # v 0.3 - Corrigido o Bug da janela de comando ao apertar a tecla Cancel.
  17. #       - Corrigido o Bug de não apresentar a janela de status no começo.
  18. #       - Melhor codificação para aumentar a compatibilidade.
  19. #       - Opção de definir a posição do medidor de AT pelo X&Y do battler.
  20. # v 0.2 - Corrigido o bug da seleção do alvo para ações de cast time.
  21. # v 0.1 - Primeiro lançamento.
  22. #==============================================================================
  23.  
  24. #==============================================================================
  25. # ● Imagens Necessárias
  26. #==============================================================================
  27. # Serão necessários as imagens:
  28. #
  29. # Battle_AT_Layout.png
  30. # Battle_AT_Meter.png
  31. #
  32. # Na pasta GRAPHICS/SYSTEM/
  33. #
  34. #==============================================================================
  35. # ● AT SYSTEM
  36. #==============================================================================
  37. # A velocidade de AT é baseaddo na agilidade do Battler.
  38. # Em caso de batalhas preventivas (Preemptive) os aliados começarão com AT em
  39. # 80% e os inimigos começarão com AT em 0 (Zero)
  40. # Em batalhas surpresas (Surprise) é o inverso das batalhas preventivas.
  41. # Em batalhas normais todos os battlers começarão com AT em 40%.
  42. #==============================================================================
  43. # ● CAST TIME
  44. #==============================================================================
  45. # Para definir uma habilidade ou item com a função de Cast Time basta definir
  46. # o valor da velocidade (Speed) diferente de 0 (Zero).
  47. #
  48. # NOTA - Não é possível ativar 2 ou mais habilidades com a função Cast Time no
  49. # mesmo turno. (Caso você esteja usando características de Multi Action em
  50. # seu projeto.)
  51. #==============================================================================
  52. module MOG_AT_SYSTEM
  53.   # Tipo de posicionamento da Hud.
  54.   # 0 - Fixed position.
  55.   # 1 - Position based on the value of X and Y battler.
  56.   HUD_POSITION_TYPE = 0
  57.   #Posição geral (Inicial) da Hud.
  58.   HUD_POSITION = [0,25]
  59.   #Posição do medidor de AT
  60.   AT_METER_POSITION = [29,1]
  61.   #Definição da posição do espaço da HUD entre os membros do grupo.
  62.   #
  63.   #MEMBERS_SPACE = [Horizontal ,Vertical]
  64.   #
  65.   MEMBERS_SPACE = [0,75]
  66.   #Velocidade de animação do medidor de at, defina 0 se não quiser a animação.
  67.   AT_METER_FLOW_SPEED = 3
  68.   #Prioridade da Hud.
  69.   BATTLE_HUD_Z = 90
  70.   #Som quando o sistema AT estiver no maximo
  71.   SE_ACTIVE = "Decision2"
  72.   #Definição do valor de AT para ativar a ação.(Gauge Meter).
  73.   AT_GAUGE_METER = 5000
  74.   # Definição do tipo de duração (Contagem/formula) de um turno.
  75.   # Essa definição influência na ativação dos eventos de batalha.
  76.   # (BATTLE EVENTS)
  77.   #
  78.   # 0 - Duração de um turno é um valor fixo.
  79.   # 1 - Duration of a turn is multiplied by the amount of batllers.
  80.   # 2 - Duration of a shift is based on average speed of the battlers
  81.   #
  82.   TURN_DURATION_TYPE = 1
  83.   # Definição de valor usado para calcular a duração de um turno.
  84.   TURN_DURATION = 60
  85.   # Definição da animação quando o battler usa habilidades de carregamento.
  86.   CAST_ANIMATION = 49
  87.   # Ativar a janela de LOG, deixe desativado se desejar uma batalha mais
  88.   # dinâmica.
  89.   WAIT_LOG_WINDOW = true
  90.   # Ativar a mensagem inicial com os nomes dos inimigos.
  91.   MESSAGE_ENEMY_APPEAR = true
  92.   # Definition of the position of the message window.
  93.   # 0 - Superior
  94.   # 1 - Centro
  95.   # 2 - Inferior  
  96.   MESSAGE_POSITION = 2
  97. end
  98.  
  99. #==============================================================================
  100. # ■ Game_System
  101. #==============================================================================
  102. class Game_System
  103.  
  104.   attr_accessor :at_max
  105.  
  106.   #--------------------------------------------------------------------------
  107.   # ● Initialize
  108.   #--------------------------------------------------------------------------        
  109.   alias mog_at_system_initialize initialize
  110.   def initialize
  111.       @at_max = [[MOG_AT_SYSTEM::AT_GAUGE_METER, 999999].min, 100].max
  112.       mog_at_system_initialize
  113.   end
  114.  
  115. end
  116.  
  117. #==============================================================================
  118. # ■ BattleManager
  119. #==============================================================================
  120. module BattleManager
  121.  
  122.   #--------------------------------------------------------------------------
  123.   # ● Battle Start
  124.   #--------------------------------------------------------------------------  
  125.   def self.battle_start
  126.       $game_system.battle_count += 1
  127.       $game_party.on_battle_start
  128.       $game_troop.on_battle_start
  129.       if MOG_AT_SYSTEM::MESSAGE_ENEMY_APPEAR
  130.          $game_troop.enemy_names.each do |name|
  131.          $game_message.add(sprintf(Vocab::Emerge, name))
  132.          end
  133.       end
  134.       if @preemptive
  135.          $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  136.       elsif @surprise
  137.          $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  138.       end
  139.       wait_for_message
  140.   end
  141.  
  142.   #--------------------------------------------------------------------------
  143.   # ● Input Start
  144.   #--------------------------------------------------------------------------
  145.   def self.input_start_at(battler)
  146.       if @phase != :input
  147.          @phase = :input
  148.          battler.make_actions
  149.          clear_actor
  150.       end
  151.       return !@surprise && battler.inputable?
  152.   end
  153.  
  154.   #--------------------------------------------------------------------------
  155.   # ● Turn Start
  156.   #--------------------------------------------------------------------------
  157.   def self.turn_start
  158.       @phase = :turn
  159.       clear_actor
  160.       make_action_orders
  161.   end  
  162.  
  163.   #--------------------------------------------------------------------------
  164.   # ● Preemtive Attack
  165.   #--------------------------------------------------------------------------  
  166.   def self.preemptive_attack
  167.       @preemptive
  168.   end  
  169.  
  170.   #--------------------------------------------------------------------------
  171.   # ● Suprise Attack
  172.   #--------------------------------------------------------------------------    
  173.   def self.surprise_attack
  174.       @surprise
  175.   end    
  176.  
  177. end  
  178.  
  179. #==============================================================================
  180. # ■ Game Action
  181. #==============================================================================
  182. class Game_Action  
  183.  
  184.   #--------------------------------------------------------------------------
  185.   # ● Prepare
  186.   #--------------------------------------------------------------------------            
  187.   alias mog_at_system_prepare prepare
  188.   def prepare
  189.       mog_at_system_prepare
  190.       set_cast_action
  191.   end
  192.  
  193.   #--------------------------------------------------------------------------
  194.   # ● Set Cast Action
  195.   #--------------------------------------------------------------------------              
  196.   def set_cast_action
  197.       return if forcing
  198.       if @item.object != nil and @item.object.speed != 0 and @subject.at_cast.empty?
  199.          @subject.at_cast = [@item.object,@item.object.speed.abs,@target_index]
  200.          @item.object = nil
  201.          @subject.animation_id = MOG_AT_SYSTEM::CAST_ANIMATION
  202.          @subject.at = 0
  203.          BattleManager.turn_end if @subject.auto_battle?
  204.       elsif !@subject.at_cast.empty?
  205.          if @subject.at_cast[1] == 0
  206.             @item.object = @subject.at_cast[0]
  207.             @target_index = @subject.at_cast[2]            
  208.             @subject.at_cast.clear
  209.          else  
  210.             @item.object = nil
  211.          end
  212.       end  
  213.   end  
  214.  
  215. end
  216.  
  217.  
  218. #==============================================================================
  219. # ■ Game Battler Base
  220. #==============================================================================
  221. class Game_BattlerBase  
  222.  
  223.   #--------------------------------------------------------------------------
  224.   # ● Inputable?
  225.   #--------------------------------------------------------------------------            
  226.   def inputable?
  227.       normal? && !auto_battle? && self.at == $game_system.at_max
  228.   end
  229.  
  230. end
  231.  
  232. #==============================================================================
  233. # ■ Game_Battler
  234. #==============================================================================
  235. class Game_Battler < Game_BattlerBase
  236.  
  237.    attr_accessor :at
  238.    attr_accessor :at_cast
  239.    
  240.   #--------------------------------------------------------------------------
  241.   # ● Initialize
  242.   #--------------------------------------------------------------------------      
  243.    alias mog_at_system_initialize initialize
  244.    def initialize
  245.        mog_at_system_initialize
  246.        @at = 0
  247.        @at_cast = []
  248.        @at_cast_selectable = true
  249.    end
  250.      
  251.   #--------------------------------------------------------------------------
  252.   # ● At
  253.   #--------------------------------------------------------------------------          
  254.    def at
  255.        n = at_active? ? $game_system.at_max : 0
  256.        return [[@at, n].min, 0].max
  257.    end  
  258.    
  259.   #--------------------------------------------------------------------------
  260.   # ● At Active
  261.   #--------------------------------------------------------------------------            
  262.    def at_active?
  263.        return false if restriction >= 4
  264.        return false if self.hp == 0
  265.        return true
  266.    end  
  267.    
  268.   #--------------------------------------------------------------------------
  269.   # ● Added New State
  270.   #--------------------------------------------------------------------------  
  271.   alias mog_at_system_add_new_state add_new_state
  272.   def add_new_state(state_id)
  273.       mog_at_system_add_new_state(state_id)
  274.       if restriction == 0 or restriction == 4
  275.          self.at_cast.clear
  276.          self.at = 0
  277.       end  
  278.   end  
  279.  
  280.   #--------------------------------------------------------------------------
  281.   # ● Make Damage Value
  282.   #--------------------------------------------------------------------------
  283.   alias mog_animation_plus_make_damage_value make_damage_value
  284.   def make_damage_value(user, item)
  285.       mog_animation_plus_make_damage_value(user, item)
  286.       self.animation_id = $1.to_i if item.note =~ /<Hit Animation = (\d+)>/i
  287.   end
  288.    
  289. end
  290.  
  291. #==============================================================================
  292. # ■ Game Enemy
  293. #==============================================================================
  294. class Game_Enemy < Game_Battler
  295.  
  296.   #--------------------------------------------------------------------------
  297.   # ● Tranform
  298.   #--------------------------------------------------------------------------  
  299.    alias mog_at_system_transform transform
  300.    def transform(enemy_id)
  301.        mog_at_system_transform(enemy_id)
  302.        self.at = 0
  303.        self.at_cast.clear
  304.    end
  305. end  
  306.  
  307. if !MOG_AT_SYSTEM::WAIT_LOG_WINDOW
  308. #==============================================================================
  309. # ■ BattleManager
  310. #==============================================================================
  311. class Window_BattleLog < Window_Selectable
  312.  
  313.   #--------------------------------------------------------------------------
  314.   # ● Refresh
  315.   #--------------------------------------------------------------------------    
  316.   def refresh
  317.   end  
  318.  
  319.   #--------------------------------------------------------------------------
  320.   # ● Message Speed
  321.   #--------------------------------------------------------------------------    
  322.   def message_speed
  323.       return 5
  324.   end
  325.  
  326. end
  327. end
  328.  
  329. #==============================================================================
  330. # ■ Scene Battle
  331. #==============================================================================
  332. class Scene_Battle < Scene_Base
  333.   include MOG_AT_SYSTEM
  334.  
  335.   #--------------------------------------------------------------------------
  336.   # ● AT Wait
  337.   #--------------------------------------------------------------------------        
  338.   alias mog_at_system_start start
  339.   def start
  340.       reset_at_parameter  
  341.       mog_at_system_start
  342.   end  
  343.    
  344.   #--------------------------------------------------------------------------
  345.   # ● Battle Start
  346.   #--------------------------------------------------------------------------
  347.   def battle_start
  348.       BattleManager.battle_start
  349.       process_event
  350.       set_turn_duration
  351.   end
  352.    
  353.   #--------------------------------------------------------------------------
  354.   # ● Reset AT Parameter
  355.   #--------------------------------------------------------------------------  
  356.   def reset_at_parameter
  357.       @at_phase = 0
  358.       n_at = $game_system.at_max * 40 / 100
  359.       p_at = $game_system.at_max * 90 / 100
  360.       s_at = 0
  361.       all_battle_members.each do |battler|
  362.           if BattleManager.preemptive_attack
  363.              battler.at = p_at if battler.is_a?(Game_Actor)
  364.              battler.at = s_at if battler.is_a?(Game_Enemy)
  365.           elsif BattleManager.surprise_attack  
  366.              battler.at = p_at if battler.is_a?(Game_Enemy)
  367.              battler.at = s_at if battler.is_a?(Game_Actor)
  368.           else  
  369.              battler.at = n_at
  370.           end
  371.           if battler.at >= $game_system.at_max
  372.              battler.at = $game_system.at_max - 1
  373.           end
  374.           battler.at = 0 if battler.at < 0  
  375.           battler.at_cast.clear
  376.         end
  377.   end
  378.  
  379.   #--------------------------------------------------------------------------
  380.   # ● Set Turn Duration
  381.   #--------------------------------------------------------------------------
  382.   def set_turn_duration
  383.       max_battlers = all_battle_members.size > 0 ? all_battle_members.size : 1
  384.       case TURN_DURATION_TYPE
  385.         when 1
  386.            n  = TURN_DURATION * max_battlers
  387.         when 2
  388.            turn_sp = 0
  389.            all_battle_members.each do |battler|
  390.                turn_sp += battler.agi
  391.            end  
  392.            n = TURN_DURATION + (turn_sp / max_battlers)
  393.         else
  394.            n = TURN_DURATION
  395.       end
  396.       turn_time_max = [[n, 9999].min, 120].max
  397.       @turn_duration = [0, turn_time_max]
  398.       if @status_window != nil
  399.          @status_window.open
  400.       end  
  401.   end  
  402.  
  403.   #--------------------------------------------------------------------------
  404.   # ● Turn End
  405.   #--------------------------------------------------------------------------
  406.   def turn_end
  407.       @at_phase = 0
  408.       all_battle_members.each do |battler|
  409.          if battler.at >= $game_system.at_max
  410.             battler.at = 0
  411.             battler.on_turn_end
  412.             refresh_status
  413.             @log_window.display_auto_affected_status(battler)
  414.             @log_window.wait_and_clear
  415.          end
  416.       end
  417.       BattleManager.turn_end
  418.   end
  419.    
  420.   #--------------------------------------------------------------------------
  421.   # ● Update Turn Duration
  422.   #--------------------------------------------------------------------------            
  423.   def update_turn_duration
  424.       return if @turn_duration == nil or @turn_duration[0] == nil
  425.       @turn_duration[0] += 1
  426.       if @turn_duration[0] >= @turn_duration[1]
  427.          @turn_duration[0] = 0
  428.          $game_troop.increase_turn
  429.          process_event
  430.       end  
  431.   end
  432.  
  433.   #--------------------------------------------------------------------------
  434.   # ● Update AT System
  435.   #--------------------------------------------------------------------------          
  436.   def update_at_system
  437.       reset_at_parameter if @at_phase == nil
  438.       set_turn_duration if @turn_duration == nil
  439.       return if !can_update_at?
  440.       update_turn_duration
  441.       all_battle_members.each do |battler|
  442.           if !battler.at_cast.empty?
  443.              battler.at_cast[1] -= 1
  444.              if battler.at_cast[1] <= 0
  445.                 execute_at_cast(battler)
  446.                 break
  447.              end
  448.           else
  449.              battler.at += battler.agi
  450.           end    
  451.           if battler.at >= $game_system.at_max
  452.              update_at_actor(battler)
  453.              update_at_enemy(battler)
  454.              battler.current_action.prepare if battler.current_action
  455.              if battler.at_cast.empty?
  456.                 @at_phase = 1
  457.                 turn_start if battler.is_a?(Game_Enemy)
  458.              end            
  459.              break
  460.           end  
  461.       end  
  462.   end
  463.    
  464.   #--------------------------------------------------------------------------
  465.   # ● Execute AT CAST
  466.   #--------------------------------------------------------------------------            
  467.   def execute_at_cast(battler)
  468.       @subject = battler
  469.       battler.make_actions  
  470.       turn_start
  471.   end  
  472.  
  473.   #--------------------------------------------------------------------------
  474.   # ● Update AT Actor
  475.   #--------------------------------------------------------------------------            
  476.   def update_at_actor(battler)    
  477.       return if !battler.is_a?(Game_Actor)
  478.       Audio.se_play("Audio/SE/" + SE_ACTIVE,100,100)  
  479.       start_party_command_selection_at(battler)
  480.   end
  481.  
  482.   #--------------------------------------------------------------------------
  483.   # ● Update AT Enemy
  484.   #--------------------------------------------------------------------------            
  485.   def update_at_enemy(battler)    
  486.       return if !battler.is_a?(Game_Enemy)
  487.       battler.make_actions
  488.   end    
  489.  
  490.   #--------------------------------------------------------------------------
  491.   # ● Can Update AT
  492.   #--------------------------------------------------------------------------            
  493.   def can_update_at?
  494.       return false if @at_phase != 0
  495.       return false if $game_message.visible
  496.       return false if BattleManager.in_turn?
  497.       return true
  498.   end    
  499.  
  500.   #--------------------------------------------------------------------------
  501.   # ● Star Party Command Selection at
  502.   #--------------------------------------------------------------------------
  503.   def start_party_command_selection_at(battler)
  504.       unless scene_changing?
  505.          refresh_status
  506.          @status_window.unselect
  507.          @status_window.open
  508.          if BattleManager.input_start_at(battler)
  509.             @actor_command_window.close
  510.             next_command
  511.          else
  512.            turn_start
  513.          end
  514.       end
  515.   end  
  516.  
  517.   #--------------------------------------------------------------------------
  518.   # ● Update Basic
  519.   #--------------------------------------------------------------------------        
  520.   alias mog_at_system_update_basic update_basic
  521.   def update_basic
  522.       mog_at_system_update_basic
  523.       update_at_system
  524.       update_party_command
  525.       $game_message.position = MESSAGE_POSITION
  526.   end
  527.  
  528.   #--------------------------------------------------------------------------
  529.   # ● Update Party Command
  530.   #--------------------------------------------------------------------------      
  531.   def update_party_command
  532.       return if !@party_command_window.active
  533.       return if !@actor_command_window.visible
  534.       return if $game_message.visible
  535.       if Input.trigger?(:B)
  536.          next_command
  537.          Sound.play_cancel
  538.          @party_command_window.active = false
  539.       end  
  540.   end
  541.      
  542. end
  543.  
  544. #==============================================================================
  545. # ■ AT Meter
  546. #==============================================================================
  547. class AT_Meter
  548.  
  549.   include MOG_AT_SYSTEM
  550.  
  551.   #--------------------------------------------------------------------------
  552.   # ● Initialize
  553.   #--------------------------------------------------------------------------    
  554.   def initialize(actor)
  555.       dispose
  556.       @actor = actor
  557.       if HUD_POSITION_TYPE == 1 and @actor.use_sprite?
  558.          @x = HUD_POSITION[0] +  @actor.screen_x rescue 0
  559.          @y = HUD_POSITION[1] +  @actor.screnn_y rescue 0
  560.       else  
  561.          @x = HUD_POSITION[0] + (MEMBERS_SPACE[0] * @actor.index)
  562.          @y = HUD_POSITION[1] + (MEMBERS_SPACE[1] * @actor.index)        
  563.       end
  564.       pre_cache
  565.       create_layout
  566.       create_at_meter
  567.   end
  568.  
  569.   #--------------------------------------------------------------------------
  570.   # ● Pre Cache
  571.   #--------------------------------------------------------------------------      
  572.   def pre_cache
  573.       @meter = Cache.system("Battle_AT_Meter")  
  574.       @meter_cw = @meter.width / 3
  575.       @meter_ch = @meter.height / 3
  576.   end
  577.  
  578.   #--------------------------------------------------------------------------
  579.   # ● Create Layout
  580.   #--------------------------------------------------------------------------      
  581.   def create_layout
  582.       @layout = Sprite.new
  583.       @layout.bitmap = Cache.system("Battle_AT_Layout")
  584.       @layout.z = BATTLE_HUD_Z
  585.       @layout.x = @x
  586.       @layout.y = @y
  587.   end
  588.  
  589.   #--------------------------------------------------------------------------
  590.   # ● Create AT Meter
  591.   #--------------------------------------------------------------------------      
  592.   def create_at_meter
  593.       @at_meter = Sprite.new
  594.       @at_meter.bitmap = Bitmap.new(@meter_cw,@meter_ch)
  595.       @at_meter.z =  BATTLE_HUD_Z + 50
  596.       @at_meter.x = @x + AT_METER_POSITION[0]
  597.       @at_meter.y = @y + AT_METER_POSITION[1]
  598.       @at_flow = rand(@meter_cw * 2)
  599.       at_flow_update
  600.   end  
  601.  
  602.   #--------------------------------------------------------------------------
  603.   # ● Dispose
  604.   #--------------------------------------------------------------------------    
  605.   def dispose
  606.       return if @layout == nil
  607.       @layout.bitmap.dispose
  608.       @layout.dispose
  609.       @layout = nil
  610.       @at_meter.bitmap.dispose
  611.       @at_meter.dispose
  612.   end  
  613.  
  614.   #--------------------------------------------------------------------------
  615.   # ● Update
  616.   #--------------------------------------------------------------------------  
  617.   def update
  618.       return if @layout == nil
  619.       at_position
  620.       at_flow_update
  621.   end
  622.  
  623.   #--------------------------------------------------------------------------
  624.   # ● Update
  625.   #--------------------------------------------------------------------------    
  626.   def at_position
  627.       return unless HUD_POSITION_TYPE == 1 and @actor.use_sprite?
  628.       @x = HUD_POSITION[0] +  @actor.screen_x rescue 0
  629.       @y = HUD_POSITION[1] +  @actor.screnn_y rescue 0
  630.       @layout.x = @x
  631.       @layout.y = @y
  632.       @at_meter.x = @x + AT_METER_POSITION[0]
  633.       @at_meter.y = @y + AT_METER_POSITION[1]
  634.   end
  635.    
  636.   #--------------------------------------------------------------------------
  637.   # ● AT Flow Update
  638.   #--------------------------------------------------------------------------
  639.   def at_flow_update
  640.       @at_meter.bitmap.clear
  641.       if !@actor.at_cast.empty?
  642.          max_cast = @actor.at_cast[0].speed.abs != 0 ? @actor.at_cast[0].speed.abs : 1
  643.          at_width = @meter_cw * @actor.at_cast[1] / max_cast
  644.          ch = @meter_ch * 2
  645.       else
  646.          at_width = @meter_cw * @actor.at / $game_system.at_max
  647.          ch = @actor.at < $game_system.at_max ? 0 : @meter_ch
  648.       end  
  649.       src_rect = Rect.new(@at_flow, ch,at_width, @meter_ch)
  650.       @at_meter.bitmap.blt(0,0, @meter, src_rect)
  651.       @at_flow += AT_METER_FLOW_SPEED
  652.       @at_flow = 0 if @at_flow >=  @meter_cw * 2      
  653.   end  
  654.  
  655. end  
  656.  
  657. #==============================================================================
  658. # ■ Spriteset Battle
  659. #==============================================================================
  660. class Spriteset_Battle
  661.  
  662.   #--------------------------------------------------------------------------
  663.   # ● Initialize
  664.   #--------------------------------------------------------------------------          
  665.   alias mog_at_system_initialize initialize
  666.   def initialize
  667.       mog_at_system_initialize
  668.       create_at_meter
  669.   end  
  670.  
  671.   #--------------------------------------------------------------------------
  672.   # ● Create AT Meter
  673.   #--------------------------------------------------------------------------            
  674.   def create_at_meter
  675.       dispose_at_meter
  676.       @at_meter = []
  677.       for i in $game_party.members
  678.           @at_meter.push(AT_Meter.new(i))
  679.       end      
  680.   end  
  681.  
  682.   #--------------------------------------------------------------------------
  683.   # ● Dispose
  684.   #--------------------------------------------------------------------------      
  685.   alias mog_at_system_dispose dispose
  686.   def dispose
  687.       mog_at_system_dispose
  688.       dispose_at_meter
  689.   end
  690.    
  691.   #--------------------------------------------------------------------------
  692.   # ● Dispose AT Meter
  693.   #--------------------------------------------------------------------------        
  694.   def dispose_at_meter
  695.       return if @at_meter == nil
  696.       @at_meter.each {|sprite| sprite.dispose }
  697.       @at_meter.clear
  698.       @at_meter = nil
  699.   end  
  700.  
  701.   #--------------------------------------------------------------------------
  702.   # ● Update
  703.   #--------------------------------------------------------------------------        
  704.   alias mog_at_system_update update
  705.   def update
  706.       mog_at_system_update
  707.       update_at_meter
  708.   end  
  709.  
  710.   #--------------------------------------------------------------------------
  711.   # ● Update AT Meter
  712.   #--------------------------------------------------------------------------          
  713.   def update_at_meter
  714.       return if @at_meter == nil
  715.       @at_meter.each {|sprite| sprite.update }
  716.   end  
  717.  
  718. end
  719.  
  720. $mog_rgss3_at_system = true
Advertisement
Add Comment
Please, Sign In to add comment