Advertisement
Raizen

Akea Active Time Battle(English)

Mar 31st, 2015
1,536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 24.31 KB | None | 0 0
  1. #=======================================================
  2. #        Akea Active Time Battle
  3. # Author: Raizen
  4. # Community: http://www.centrorpg.com/
  5. # Compatibility: RMVXAce
  6. #
  7. #=======================================================
  8. # Instructions: Put above main and other battle add-ons,
  9. # this script adds the function of active time battles to battles based on Scene_Battle
  10.  
  11. # =========================Don't Modify==============================
  12.  
  13. $imported ||= Hash.new
  14. $imported[:lune_active_battle] = true
  15. module Akea_Active_Battle
  16. Atb_Bar_Pos = []
  17. # =========================Don't Modify==============================
  18.  
  19. # You can put a atb cost for a skill, a skill that doesn't have
  20. # this tag, will deplete the whole atb bar.
  21. # Just put on items or skills this tag on notetags
  22. # <use_atb cost> where cost is the atb cost(1000 is max atb value)
  23. # <use_atb 500> will deplete 500 from atb bar.
  24.  
  25. # This is the update rate of the atb bar, the less, the more precise
  26. # but also requires more from the system
  27.  
  28. Update_Rate = 10
  29.  
  30. # Configure the atb bars here
  31.  
  32. # Put Atb_Bar = 'name_of_image" IF using an image, images are on Folder
  33. # Graphics/Akea
  34. # if you use Atb_Bar = "" it will use default bars for the system.
  35. Atb_Bar = ""
  36.  
  37. # Configure the atb bar positions for each character, IF using
  38. # images, folowing this positions [x, y, z]
  39. Atb_Bar_Pos[0] = [200, 200, 10]
  40. Atb_Bar_Pos[1] = [200, 240, 10]
  41. Atb_Bar_Pos[2] = [200, 280, 10]
  42. Atb_Bar_Pos[3] = [200, 320, 10]
  43.  
  44. # This is how much the atb bar will vary in the start of a battle,
  45. # for examplo Base_Atb_Range = 100, means each battler can start with between
  46. # 0 and 100(max is 1000)
  47. Base_Atb_Range = 200
  48.  
  49. # Put here the quantity of atb each battler will have in case it enters
  50. # the battle with "surprise/preemptive", for example if the character goes
  51. # in preemptive mode, every character of the party will have its atb value
  52. # with the Base_Atb_Preemptive value.
  53. Base_Atb_Preemptive = 1000
  54.  
  55.  
  56.  
  57. # ========================Flee configuration==============================
  58. # Allow fleeing? if true configure the below configs
  59. Allow_Flee = true
  60.  
  61. # Flee Key, use the Key Map from RPG Maker VX Ace
  62. # X = Key A  ;  Y = Key S  ;  Z = Key D
  63. # L = Key Q  ;  R = Key W  ;  Key
  64. # RIGHT ; LEFT
  65. # Up; DOWN =
  66. Flee_Input = :SHIFT
  67.  
  68. # Image that will be in front of the flee_bar
  69. Flee_Back = "base_input_hud"
  70.  
  71. # Bar Image
  72. Flee_Bar = "bar_input"
  73.  
  74. # Select, in case you use a sistem that visualizes the battlers,
  75. # DO NOT set true if you do not use, if you use, you can either choose
  76. # for the script to set the bar position according to the battler(true),
  77. # or according to the screen(false)
  78. Has_Ator = true
  79.  
  80. # Flee bar positions in [x, y]
  81. # Remember, if Has_Ator = true, then the positions are based on the battlers,
  82. # if false then it is the screen.
  83. Flee_Back_Pos = [-60, -80]
  84. Flee_Bar_Pos = [-55, -75]
  85.  
  86.  
  87. # ======================== Formula configuration ==============================
  88.  
  89. # IMPORTANT!!:
  90. # This configuration requires a small knowing of operations in Ruby,
  91. # save the old formulas in case you want to modify the formulas.
  92. # param(6) is the agility atribute.
  93.  
  94. # Escape Formula
  95.   def self.flee_formula(actor, enemy)
  96.     (actor.param(6)/enemy.param(6))/500.0
  97.   end
  98.  
  99. # Atb speed, remember that 1000 is the maximum atb!
  100.   def self.atb_formula(subject)
  101.     30 + subject.param(6)/5
  102.   end
  103.  
  104. end
  105.  
  106.  
  107.  
  108.  
  109. #==============================================================================
  110. # Here Starts the Script!!!
  111. #==============================================================================
  112. #==============================================================================
  113. # ** Game_BattlerBase
  114. #------------------------------------------------------------------------------
  115. #  Esta classe gerencia os battlers. Contém os principais método de
  116. # cálculo da características especiais.
  117. # Esta classe é usada como superclasse da classe Game_Battler.
  118. #==============================================================================
  119.  
  120. class Game_BattlerBase
  121. alias :akea_atb_initialize :initialize
  122.   #--------------------------------------------------------------------------
  123.   # * Variáveis públicas
  124.   #--------------------------------------------------------------------------
  125.   attr_accessor :atb
  126.   def matb;  1000;   end    # MP Máximo
  127.   #--------------------------------------------------------------------------
  128.   # * Inicialização do objeto
  129.   #     actor_id : ID do herói
  130.   #--------------------------------------------------------------------------
  131.   def initialize(*args, &block)
  132.     akea_atb_initialize(*args, &block)
  133.     @atb = 0
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # * Taxa da barra de atb
  137.   #--------------------------------------------------------------------------
  138.   def atb_rate
  139.     @atb.to_f / matb
  140.   end
  141. end
  142. #==============================================================================
  143. # ** Game_Actor
  144. #------------------------------------------------------------------------------
  145. #  Esta classe gerencia os heróis. Ela é utilizada internamente pela classe
  146. # Game_Actors ($game_actors). A instância desta classe é referenciada
  147. # pela classe Game_Party ($game_party).
  148. #==============================================================================
  149.  
  150. class Game_Actor < Game_Battler
  151. alias :akea_atb_next_command :next_command
  152.   #--------------------------------------------------------------------------
  153.   # * Próxima entrada de comandos
  154.   #--------------------------------------------------------------------------
  155.   def next_command
  156.     return false if @atb < matb
  157.     akea_atb_next_command
  158.   end
  159. end
  160. #==============================================================================
  161. # ** Window_BattleStatus
  162. #------------------------------------------------------------------------------
  163. #  Esta janela exibe as condições de todos membros do grupo na tela de batalha.
  164. #==============================================================================
  165.  
  166. class Window_BattleStatus < Window_Selectable
  167. alias :akea_atb_initialize :initialize
  168. alias :akea_atb_dispose :dispose
  169.   #--------------------------------------------------------------------------
  170.   # * Inicialização do objeto
  171.   #--------------------------------------------------------------------------
  172.   def initialize
  173.     create_sprite_bars unless Akea_Active_Battle::Atb_Bar == ''
  174.     akea_atb_initialize
  175.     refresh_atb
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # * Criação dos objetos
  179.   #--------------------------------------------------------------------------
  180.   def create_sprite_bars
  181.     @atb_bars = Array.new
  182.     for n in 0...$game_party.battle_members.size
  183.       @atb_bars[n] = Sprite.new
  184.       @atb_bars[n].bitmap = Cache.akea(Akea_Active_Battle::Atb_Bar)
  185.       @atb_bars[n].x = Akea_Active_Battle::Atb_Bar_Pos[n][0]
  186.       @atb_bars[n].y = Akea_Active_Battle::Atb_Bar_Pos[n][1]
  187.       @atb_bars[n].z = Akea_Active_Battle::Atb_Bar_Pos[n][2]
  188.     end
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # * Atualização da barra de atb
  192.   #--------------------------------------------------------------------------
  193.   def refresh_atb
  194.     Akea_Active_Battle::Atb_Bar == '' ? refresh : refresh_sprite_bars
  195.   end
  196.   #--------------------------------------------------------------------------
  197.   # * Atualização das imagens de atb
  198.   #--------------------------------------------------------------------------
  199.   def refresh_sprite_bars
  200.     $game_party.battle_members.each{|actor| draw_actor_atb_sprite(actor)}
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # * Atualização da barra por personagem
  204.   #--------------------------------------------------------------------------
  205.   def draw_actor_atb_sprite(actor)
  206.     @atb_bars[$game_party.battle_members.index(actor)].zoom_x = actor.atb_rate
  207.   end
  208.   #--------------------------------------------------------------------------
  209.   # * Aquisição da largura da janela
  210.   #--------------------------------------------------------------------------
  211.   def window_width
  212.     Graphics.width
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # * Aquisição da largura da área do medidor
  216.   #--------------------------------------------------------------------------
  217.   def gauge_area_width
  218.     return 348
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # * Desenho da área do medidor (com TP)
  222.   #     rect  : retângulo
  223.   #     actor : herói
  224.   #--------------------------------------------------------------------------
  225.   def draw_gauge_area_with_tp(rect, actor)
  226.     draw_actor_hp(actor, rect.x + 0, rect.y, 72)
  227.     draw_actor_mp(actor, rect.x + 82, rect.y, 64)
  228.     draw_actor_tp(actor, rect.x + 156, rect.y, 64)
  229.     draw_actor_atb(actor, rect.x + 230, rect.y, 64)
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # * Desenho da área do medidor (sem TP)
  233.   #     rect  : retângulo
  234.   #     actor : herói
  235.   #--------------------------------------------------------------------------
  236.   def draw_gauge_area_without_tp(rect, actor)
  237.     draw_actor_hp(actor, rect.x + 0, rect.y, 134)
  238.     draw_actor_mp(actor, rect.x + 120,  rect.y, 76)
  239.     draw_actor_atb(actor, rect.x + 240, rect.y, 76)
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # * Desenho do MP
  243.   #     actor  : herói
  244.   #     x      : coordenada X
  245.   #     y      : coordenada Y
  246.   #     width  : largura
  247.   #--------------------------------------------------------------------------
  248.   def draw_actor_atb(actor, x, y, width = 124)
  249.     draw_gauge(x, y, width, actor.atb_rate, atb_gauge_color1, atb_gauge_color2)
  250.     change_color(system_color)
  251.     draw_text(x, y, 30, line_height, "ATB")
  252.   end
  253.   def atb_gauge_color1;      Color.new(200, 50, 150, 255);  end;    # Sistema
  254.   def atb_gauge_color2;      Color.new(250, 50, 200, 255);  end;    # Perigo
  255.   #--------------------------------------------------------------------------
  256.   # * Dispose dos objetos
  257.   #--------------------------------------------------------------------------
  258.   def dispose
  259.     @atb_bars.each{|bar| bar.bitmap.dispose; bar.dispose} if @atb_bars
  260.     akea_atb_dispose
  261.   end
  262. end
  263.  
  264. #==============================================================================
  265. # ** Scene_Battle
  266. #------------------------------------------------------------------------------
  267. #  Esta classe executa o processamento da tela de batalha.
  268. #==============================================================================
  269.  
  270. class Scene_Battle < Scene_Base
  271. alias :akea_atb_update :update
  272. alias :akea_atb_start :start
  273. alias :akea_atb_start_actor_command_selection :start_actor_command_selection
  274. alias :akea_atb_next_command :next_command
  275. alias :akea_atb_turn_end :turn_end
  276. alias :akea_atb_terminate :terminate
  277.   #--------------------------------------------------------------------------
  278.   # * Fim de turno
  279.   #--------------------------------------------------------------------------
  280.   def turn_end
  281.     if !@actor_atb_array.empty? && $game_party.members[@actor_atb_array.first].dead?
  282.       @actor_atb_array.shift
  283.       @back_flee_atb.opacity = 0
  284.       @bar_flee_atb.opacity = 0  
  285.       @start_flee = true
  286.     end
  287.     akea_atb_turn_end
  288.   end
  289.   #--------------------------------------------------------------------------
  290.   # * Inicialização da cena
  291.   #--------------------------------------------------------------------------
  292.   def start
  293.     akea_initialize_atb_variables
  294.     akea_initialize_atb_states
  295.     akea_atb_start
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # * Inicialização das variáveis
  299.   #--------------------------------------------------------------------------
  300.   def akea_initialize_atb_variables
  301.     @actor_atb_array = []
  302.     @enemy_atb_array = -1
  303.     @back_flee_atb = Sprite.new
  304.     @back_flee_atb.bitmap = Cache.akea(Akea_Active_Battle::Flee_Back)
  305.     @back_flee_atb.x = Akea_Active_Battle::Flee_Back_Pos[0]
  306.     @back_flee_atb.y = Akea_Active_Battle::Flee_Back_Pos[1]
  307.     @back_flee_atb.opacity = 0
  308.     @back_flee_atb.z = 200
  309.     @bar_flee_atb = Sprite.new
  310.     @bar_flee_atb.bitmap = Cache.akea(Akea_Active_Battle::Flee_Bar)
  311.     @bar_flee_atb.x = Akea_Active_Battle::Flee_Bar_Pos[0]
  312.     @bar_flee_atb.y = Akea_Active_Battle::Flee_Bar_Pos[1]
  313.     @bar_flee_atb.opacity = 0
  314.     @bar_flee_atb.zoom_x = 0
  315.     @start_flee = true
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # * Inicialização de status do atb
  319.   #--------------------------------------------------------------------------
  320.   def akea_initialize_atb_states
  321.     if BattleManager.get_preemptive
  322.       $game_party.battle_members.each{|member| member.atb = Akea_Active_Battle::Base_Atb_Preemptive}
  323.       $game_troop.members.each{|member| member.atb = rand(Akea_Active_Battle::Base_Atb_Range)}
  324.     elsif BattleManager.get_surprise
  325.       $game_troop.members.each{|member| member.atb = Akea_Active_Battle::Base_Atb_Preemptive}
  326.       $game_party.battle_members.each{|member| member.atb = rand(Akea_Active_Battle::Base_Atb_Range)}
  327.     else
  328.       all_battle_members.each{|member| member.atb = rand(Akea_Active_Battle::Base_Atb_Range)}
  329.     end
  330.   end
  331.   #--------------------------------------------------------------------------
  332.   # * Atualização da tela
  333.   #--------------------------------------------------------------------------
  334.   def update
  335.     call_update_flee if Akea_Active_Battle::Allow_Flee
  336.     call_update_atb_bar if Graphics.frame_count % Akea_Active_Battle::Update_Rate == 0
  337.     akea_atb_update
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # * Atualização de fuga
  341.   #--------------------------------------------------------------------------
  342.   def call_update_flee
  343.     return unless BattleManager.can_escape?
  344.     return if @actor_atb_array.empty?
  345.     if Input.press?(Akea_Active_Battle::Flee_Input)
  346.       if @start_flee
  347.         if $imported[:lune_animated_battle]
  348.           for n in 0...$game_party.members.size
  349.             change_character_animation(n, Lune_Anime_Battle::Standard['Escape']) if $game_party.members[n].alive?
  350.           end
  351.         end
  352.         if Akea_Active_Battle::Has_Ator
  353.           @back_flee_atb.x = Akea_Active_Battle::Flee_Back_Pos[0] + $game_party.members[@actor_atb_array.first].screen_x
  354.           @back_flee_atb.y = Akea_Active_Battle::Flee_Back_Pos[1] + $game_party.members[@actor_atb_array.first].screen_y
  355.           @bar_flee_atb.x = Akea_Active_Battle::Flee_Bar_Pos[0] + $game_party.members[@actor_atb_array.first].screen_x
  356.           @bar_flee_atb.y = Akea_Active_Battle::Flee_Bar_Pos[1] + $game_party.members[@actor_atb_array.first].screen_y
  357.         end
  358.         @back_flee_atb.opacity = 255
  359.         @bar_flee_atb.opacity = 255
  360.         @bar_flee_atb.zoom_x = 0
  361.       else
  362.         @bar_flee_atb.zoom_x += Akea_Active_Battle.flee_formula($game_party.members[@actor_atb_array.first], $game_troop.alive_members[0])
  363.         @bar_flee_atb.zoom_x = [@bar_flee_atb.zoom_x, 1.0].min
  364.         BattleManager.process_escape if @bar_flee_atb.zoom_x >= 1.0
  365.       end
  366.     else
  367.       if $imported[:lune_animated_battle] && !@start_flee
  368.         for n in 0...$game_party.members.size
  369.           $game_party.battle_members[n].update_current_condition(0)
  370.           change_character_animation(n, $game_party.battle_members[n].current_hp_condition)
  371.         end
  372.       end
  373.       @back_flee_atb.opacity = 0
  374.       @bar_flee_atb.opacity = 0    
  375.     end
  376.     @start_flee = !Input.press?(Akea_Active_Battle::Flee_Input)
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # * Entrada de comandos para o próximo herói
  380.   #--------------------------------------------------------------------------
  381.   def next_command
  382.     if BattleManager.actor
  383.       if Input.press?(Akea_Active_Battle::Flee_Input)
  384.         akea_atb_next_command
  385.         return
  386.       end
  387.       @actor_atb_array.shift
  388.       BattleManager.add_actor_order
  389.     end
  390.      BattleManager.make_actor_index(@actor_atb_array.first) unless @actor_atb_array.empty?
  391.     akea_atb_next_command
  392.   end
  393.   #--------------------------------------------------------------------------
  394.   # * Inicialização da seleção de comandos do grupo
  395.   #--------------------------------------------------------------------------
  396.   def start_party_command_selection
  397.     refresh_status
  398.     @status_window.unselect
  399.     @status_window.open
  400.     if @actor_atb_array.empty?
  401.       return
  402.     end
  403.     if BattleManager.input_start
  404.       next_command
  405.     else
  406.       @party_command_window.deactivate
  407.       turn_start
  408.     end
  409.   end
  410.   #--------------------------------------------------------------------------
  411.   # * Método de atualização do ATB
  412.   #--------------------------------------------------------------------------
  413.   def call_update_atb_bar
  414.     return if (!@actor_atb_array.empty? && !Input.press?(Akea_Active_Battle::Flee_Input)) || BattleManager.has_action?
  415.     $game_troop.alive_members.each{|member|
  416.     member.atb = increment_atb(member)
  417.     if member.atb >= 1000
  418.       @enemy_atb_array = $game_troop.members.index(member)
  419.        BattleManager.add_enemy_order(@enemy_atb_array)
  420.        Akea_Active_Battle.atb_formula(member)
  421.        BattleManager.input_start
  422.       turn_start
  423.       return
  424.     end
  425.     }
  426.     return unless @actor_atb_array.empty?
  427.     $game_party.alive_members.each{|member|
  428.     member.atb = increment_atb(member)
  429.     if member.atb >= 1000
  430.       @actor_atb_array << $game_party.members.index(member)
  431.       @status_window.refresh_atb
  432.       start_party_command_selection
  433.       return
  434.     end
  435.     }
  436.     @status_window.refresh_atb
  437.   end
  438.   #--------------------------------------------------------------------------
  439.   # * Método de incrementação do atb
  440.   #--------------------------------------------------------------------------
  441.   def increment_atb(subject)
  442.     return [subject.atb + Akea_Active_Battle.atb_formula(subject), 1000].min
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # * Inicialização da seleção de comandos do herói
  446.   #--------------------------------------------------------------------------
  447.   def start_actor_command_selection
  448.     return turn_start if BattleManager.has_action?
  449.     akea_atb_start_actor_command_selection
  450.   end
  451.   def prior_command
  452.     start_actor_command_selection
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # * Atualização do viewport de informações
  456.   #--------------------------------------------------------------------------
  457.   def update_info_viewport
  458.     move_info_viewport(128)
  459.   end
  460.   #--------------------------------------------------------------------------
  461.   # * Finalização da batalha
  462.   #--------------------------------------------------------------------------
  463.   def terminate
  464.     @back_flee_atb.bitmap.dispose
  465.     @bar_flee_atb.bitmap.dispose
  466.     @back_flee_atb.dispose
  467.     @bar_flee_atb.dispose
  468.     akea_atb_terminate
  469.   end
  470. end
  471. #==============================================================================
  472. # ** BattleManager
  473. #------------------------------------------------------------------------------
  474. #  Este módulo gerencia o andamento da batalha.
  475. #==============================================================================
  476.  
  477. module BattleManager
  478.   #--------------------------------------------------------------------------
  479.   # * Retorna a variável preemptive
  480.   #--------------------------------------------------------------------------
  481.   def self.get_preemptive
  482.     return @preemptive
  483.   end
  484.   #--------------------------------------------------------------------------
  485.   # * Retorna a variável surprise
  486.   #--------------------------------------------------------------------------
  487.   def self.get_surprise
  488.     return @surprise
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # * Criação da seqüencia de ações
  492.   #--------------------------------------------------------------------------
  493.   def self.add_enemy_order(id)
  494.     @action_battlers = [] unless @action_battlers.is_a?(Array)  
  495.     @action_battlers << $game_troop.members[id]
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # * Adiciona ordem aos battlers
  499.   #--------------------------------------------------------------------------
  500.   def self.add_actor_order
  501.     @action_battlers = [] unless @action_battlers.is_a?(Array)  
  502.     @action_battlers << self.actor
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # * Verifica se há ações
  506.   #--------------------------------------------------------------------------
  507.   def self.has_action?
  508.     @action_battlers.empty? ? false : true
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # * Criação da seqüencia de ações
  512.   #--------------------------------------------------------------------------
  513.   def self.make_action_orders
  514.     return
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # * Próximo comando
  518.   #--------------------------------------------------------------------------
  519.   def self.next_command
  520.     return true
  521.   end
  522.   #--------------------------------------------------------------------------
  523.   # * Comando Anterior
  524.   #--------------------------------------------------------------------------
  525.   def self.prior_command
  526.     return true
  527.   end
  528.   #--------------------------------------------------------------------------
  529.   # * Retorna o índice do ator
  530.   #--------------------------------------------------------------------------
  531.   def self.actor_index
  532.     @actor_index
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # * Força um ator a ser o próximo
  536.   #--------------------------------------------------------------------------
  537.   def self.make_actor_index(index)
  538.     @actor_index = index
  539.   end
  540.   #--------------------------------------------------------------------------
  541.   # * Processar fuga
  542.   #--------------------------------------------------------------------------
  543.   def self.process_escape
  544.     $game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
  545.     success = true
  546.     Sound.play_escape
  547.     if success
  548.       process_abort
  549.     else
  550.       @escape_ratio += 0.1
  551.       $game_message.add('\.' + Vocab::EscapeFailure)
  552.       $game_party.clear_actions
  553.     end
  554.     wait_for_message
  555.     return success
  556.   end
  557. end
  558.  
  559. #==============================================================================
  560. # ** Game_Battler
  561. #------------------------------------------------------------------------------
  562. #  Esta classe gerencia os battlers. Controla a adição de sprites e ações
  563. # dos lutadores durante o combate.
  564. # É usada como a superclasse das classes Game_Enemy e Game_Actor.
  565. #==============================================================================
  566.  
  567. class Game_Battler < Game_BattlerBase
  568. alias :akea_atb_use_Item :use_item
  569.   #--------------------------------------------------------------------------
  570.   # ? Usando habilidade/item
  571.   #     item :  habilidade/item
  572.   #--------------------------------------------------------------------------
  573.   def use_item(item)
  574.     note = /<use_atb *(\d+)?>/i
  575.     item.note =~ note ? @atb -= $1.to_i : @atb = 0
  576.     akea_atb_use_Item(item)
  577.   end
  578. end
  579.  
  580. #==============================================================================
  581. # ** Cache
  582. #------------------------------------------------------------------------------
  583. #  Este modulo carrega cada gráfico, cria um objeto de Bitmap e retém ele.
  584. # Para acelerar o carregamento e preservar memória, este módulo matém o
  585. # objeto de Bitmap em uma Hash interna, permitindo que retorne objetos
  586. # pré-existentes quando mesmo Bitmap é requerido novamente.
  587. #==============================================================================
  588.  
  589. module Cache
  590.   #--------------------------------------------------------------------------
  591.   # * Carregamento dos gráficos de animação
  592.   #     filename : nome do arquivo
  593.   #     hue      : informações da alteração de tonalidade
  594.   #--------------------------------------------------------------------------
  595.   def self.akea(filename)
  596.     load_bitmap("Graphics/Akea/", filename)
  597.   end
  598. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement