Advertisement
Rafael_Sol_Maker

PACOTE DE CORREÇÕES PARA RMVXACE DO YANFLY

Feb 27th, 2012
583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 14.93 KB | None | 0 0
  1. #==============================================================================
  2. # PACOTE DE CORREÇÕES PARA RMVXACE DO YANFLY:
  3. # Pacote com algumas correções básicas para RMVXAce, tirando as modificações e
  4. # possibilidades de customização do script original. Essencial para corrigir
  5. # vários bugs do jogo já presentes na engine padrão do RGSS3;
  6. # Baseado no "Yanfly Engine Ace - Ace Core Engine v1.00 Versão Traduzida".
  7. #
  8. # Todos os créditos vão para:
  9. # - Yanfly (http://yanflychannel.wordpress.com/)
  10. # Tradução do cabeçalho para Português por:
  11. # - Tradutor (http://makercafe.blogspot.com/)
  12. # Edições e adaptações por:
  13. # - Rafael_Sol_Maker (http://www.condadobraveheart.com/)
  14. #
  15. #==============================================================================
  16.  
  17. #==============================================================================
  18. # INSTRUÇÕES:
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # Para instalar este script, abra seu editor de scripts copie e cole este script
  21. # em um slot aberto abaixo de "Scripts Adicionais", mas acima de Main. Lembre-se
  22. # de salvar.
  23. #
  24. #==============================================================================
  25. # COMPATIBILIDADE:
  26. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # Este script é feito estritamente para o RPG Maker VX Ace. É improvável que
  28. # seja executado com o RPG Maker VX sem que precise de ajustes.
  29. #
  30. #==============================================================================
  31.  
  32. #==============================================================================
  33. # CONTEÚDOS DO SCRIPT:
  34. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  35. # Correção de Erro: Sobreposição da Animação
  36. # -----------------------------------------------------------------------------
  37. # - É o mesmo erro do VX. Quando uma animação de tela inteira é reproduzida
  38. # contra um grupo de inimigos, o bitmap da animação é na verdade reproduzido
  39. # várias vezes, causando uma extrema sobreposição quando há muitos inimigos na
  40. # tela. Essa correção fará com que a animação se reproduza apenas uma vez.
  41. #
  42. # -----------------------------------------------------------------------------
  43. # Correção de Erro: Correção da Ordem do Turno da Batalha
  44. # -----------------------------------------------------------------------------
  45. # - Mesmo erro do VX. Para aqueles que usam o sistema de batalha padrão, uma vez
  46. # que um turno começou, a ordem de ação se configura e é inalterada durante o
  47. # restante do turno. Quaisquer alterações na AGI do combatente não serão feitas,
  48. # mesmo que o combatente receba um acréscimo ou decréscimo na AGI.
  49. # Essa correção faz com que a AGI seja atualizada corretamente a cada ação.
  50. #
  51. # -----------------------------------------------------------------------------
  52. # Correção de Erro: Correção da Sobreposição dos Medidores
  53. # -----------------------------------------------------------------------------
  54. # - Mesmo erro do VX. Quando algumas variáveis excedem determinados valores, os
  55. # medidores podem extrapolar a largura para a qual eles foram originalmente
  56. # projetados. Essa correção irá evitar que os medidores passem da largura
  57. # máxima. (N.E.: E ainda coloca uma borda em volta deles!)
  58. #
  59. # -----------------------------------------------------------------------------
  60. # Correção de Erro: Rolagem do Menu Segurando L e R
  61. # -----------------------------------------------------------------------------
  62. # - Antes, no VX, você podia navegar através de menus rapidamente pressionando
  63. # os botões L e R (Q e W no teclado). Essa correção recupera a capacidade de
  64. # percorrer os menus dessa forma.
  65. #
  66. # -----------------------------------------------------------------------------
  67. # Correção de Erro: Rolagem no Mapa, Se Menor que a Tela
  68. # -----------------------------------------------------------------------------
  69. # - Uma pequena correção que permita que mapas menores que a tela (17x13, na
  70. # resolução padrão) apresentem erros na hora do movimento da tela , o "scroll".
  71. # É útil principalmente para quem utiliza a resolução de 640x480, e faz mapas
  72. # do tamanho mínimo que o editor permite.
  73. #
  74. #==============================================================================
  75.  
  76. #==============================================================================
  77. # ¦ BattleManager
  78. #==============================================================================
  79.  
  80. module BattleManager
  81.  
  82.   #--------------------------------------------------------------------------
  83.   # overwrite method: turn_start
  84.   #--------------------------------------------------------------------------
  85.   def self.turn_start
  86.     @phase = :turn
  87.     clear_actor
  88.     $game_troop.increase_turn
  89.     @performed_battlers = []
  90.     make_action_orders
  91.   end
  92.  
  93.   #--------------------------------------------------------------------------
  94.   # overwrite method: next_subject
  95.   #--------------------------------------------------------------------------
  96.   def self.next_subject
  97.     @performed_battlers = [] if @performed_battlers.nil?
  98.     loop do
  99.       @action_battlers -= @performed_battlers
  100.       battler = @action_battlers.shift
  101.       return nil unless battler
  102.       next unless battler.index && battler.alive?
  103.       return battler
  104.     end
  105.   end
  106.  
  107. end # BattleManager
  108.  
  109. #==============================================================================
  110. # ¦ Game_Battler
  111. #==============================================================================
  112.  
  113. class Game_Battler < Game_BattlerBase
  114.  
  115.   #--------------------------------------------------------------------------
  116.   # public instance variables
  117.   #--------------------------------------------------------------------------
  118.   attr_accessor :pseudo_ani_id
  119.  
  120.   #--------------------------------------------------------------------------
  121.   # alias method: clear_sprite_effects
  122.   #--------------------------------------------------------------------------
  123.   alias game_battler_clear_sprite_effects_ace clear_sprite_effects
  124.   def clear_sprite_effects
  125.     game_battler_clear_sprite_effects_ace
  126.     @pseudo_ani_id = 0
  127.   end
  128.  
  129. end # Game_Battler
  130.  
  131. #==============================================================================
  132. # ¦ Game_Troop
  133. #==============================================================================
  134.  
  135. class Game_Troop < Game_Unit
  136.  
  137.   #--------------------------------------------------------------------------
  138.   # overwrite method: setup
  139.   #--------------------------------------------------------------------------
  140.   def setup(troop_id)
  141.     clear
  142.     @troop_id = troop_id
  143.     @enemies = []
  144.     troop.members.each do |member|
  145.       next unless $data_enemies[member.enemy_id]
  146.       enemy = Game_Enemy.new(@enemies.size, member.enemy_id)
  147.       enemy.hide if member.hidden
  148.       enemy.screen_x = member.x + (Graphics.width - 544)/2
  149.       enemy.screen_y = member.y + (Graphics.height - 416)
  150.       @enemies.push(enemy)
  151.     end
  152.     init_screen_tone
  153.     make_unique_names
  154.   end
  155.  
  156. end # Game_Troop
  157.  
  158. #==============================================================================
  159. # ¦ Game_Map
  160. #==============================================================================
  161.  
  162. class Game_Map
  163.  
  164.   #--------------------------------------------------------------------------
  165.   # overwrite method: scroll_down
  166.   #--------------------------------------------------------------------------
  167.   def scroll_down(distance)
  168.     if loop_vertical?
  169.       @display_y += distance
  170.       @display_y %= @map.height * 256
  171.       @parallax_y += distance
  172.     else
  173.       last_y = @display_y
  174.       dh = Graphics.height > height * 32 ? height : (Graphics.height / 32)
  175.       @display_y = [@display_y + distance, (height - dh) * 256].min
  176.       @parallax_y += @display_y - last_y
  177.     end
  178.   end
  179.  
  180.   #--------------------------------------------------------------------------
  181.   # overwrite method: scroll_right
  182.   #--------------------------------------------------------------------------
  183.   def scroll_right(distance)
  184.     if loop_horizontal?
  185.       @display_x += distance
  186.       @display_x %= @map.width * 256
  187.       @parallax_x += distance
  188.     else
  189.       last_x = @display_x
  190.       dw = Graphics.width > width * 32 ? width : (Graphics.width / 32)
  191.       @display_x = [@display_x + distance, (width - dw) * 256].min
  192.       @parallax_x += @display_x - last_x
  193.     end
  194.   end
  195.  
  196. end # Game_Map
  197.  
  198. #==============================================================================
  199. # ¦ Game_Event
  200. #==============================================================================
  201.  
  202. class Game_Event < Game_Character
  203.  
  204.   #--------------------------------------------------------------------------
  205.   # overwrite method: near_the_screen?
  206.   #--------------------------------------------------------------------------
  207.   def near_the_screen?(dx = nil, dy = nil)
  208.     dx = [Graphics.width, $game_map.width * 256].min/32 - 5 if dx.nil?
  209.     dy = [Graphics.height, $game_map.height * 256].min/32 - 5 if dy.nil?
  210.     ax = $game_map.adjust_x(@real_x) - Graphics.width / 2 / 32
  211.     ay = $game_map.adjust_y(@real_y) - Graphics.height / 2 / 32
  212.     ax >= -dx && ax <= dx && ay >= -dy && ay <= dy
  213.   end
  214.  
  215. end # Game_Event
  216.  
  217. #==============================================================================
  218. # ¦ Sprite_Base
  219. #==============================================================================
  220.  
  221. class Sprite_Base < Sprite
  222.  
  223.   #--------------------------------------------------------------------------
  224.   # new method: start_pseudo_animation
  225.   #--------------------------------------------------------------------------
  226.   def start_pseudo_animation(animation, mirror = false)
  227.     dispose_animation
  228.     @animation = animation
  229.     return if @animation.nil?
  230.     @ani_mirror = mirror
  231.     set_animation_rate
  232.     @ani_duration = @animation.frame_max * @ani_rate + 1
  233.     @ani_sprites = []
  234.   end
  235.  
  236. end # Sprite_Base
  237.  
  238. #==============================================================================
  239. # ¦ Sprite_Battler
  240. #==============================================================================
  241.  
  242. class Sprite_Battler < Sprite_Base
  243.  
  244.   #--------------------------------------------------------------------------
  245.   # alias method: setup_new_animation
  246.   #--------------------------------------------------------------------------
  247.   alias sprite_battler_setup_new_animation_ace setup_new_animation
  248.   def setup_new_animation
  249.     sprite_battler_setup_new_animation_ace
  250.     return if @battler.pseudo_ani_id <= 0
  251.     animation = $data_animations[@battler.pseudo_ani_id]
  252.     mirror = @battler.animation_mirror
  253.     start_pseudo_animation(animation, mirror)
  254.     @battler.pseudo_ani_id = 0
  255.   end
  256.  
  257. end # Sprite_Battler
  258.  
  259. #==============================================================================
  260. # ¦ Spriteset_Map
  261. #==============================================================================
  262.  
  263. class Spriteset_Map
  264.  
  265.   #--------------------------------------------------------------------------
  266.   # overwrite method: create_viewports
  267.   #--------------------------------------------------------------------------
  268.   def create_viewports
  269.     if Graphics.width > $game_map.width * 32 and !$game_map.loop_horizontal?
  270.       dx = (Graphics.width - $game_map.width * 32) / 2
  271.     else
  272.       dx = 0
  273.     end
  274.     dw = [Graphics.width, $game_map.width * 32].min
  275.     dw = Graphics.width if $game_map.loop_horizontal?
  276.     if Graphics.height > $game_map.height * 32 and !$game_map.loop_vertical?
  277.       dy = (Graphics.height - $game_map.height * 32) / 2
  278.     else
  279.       dy = 0
  280.     end
  281.     dh = [Graphics.height, $game_map.height * 32].min
  282.     dh = Graphics.height if $game_map.loop_vertical?
  283.     @viewport1 = Viewport.new(dx, dy, dw, dh)
  284.     @viewport2 = Viewport.new(dx, dy, dw, dh)
  285.     @viewport3 = Viewport.new(dx, dy, dw, dh)
  286.     @viewport2.z = 50
  287.     @viewport3.z = 100
  288.   end
  289.  
  290. end # Spriteset_Map
  291.  
  292. #==============================================================================
  293. # ¦ Window_Base
  294. #==============================================================================
  295.  
  296. class Window_Base < Window  
  297.  
  298.   #--------------------------------------------------------------------------
  299.   # overwrite method: draw_gauge
  300.   #--------------------------------------------------------------------------
  301.   def draw_gauge(dx, dy, dw, rate, color1, color2)
  302.     dw -= 2
  303.     fill_w = [(dw * rate).to_i, dw].min
  304.     gauge_h = 6
  305.     gauge_y = dy + line_height - 2 - gauge_h
  306.     outline_colour = gauge_back_color
  307.     outline_colour.alpha = translucent_alpha
  308.     contents.fill_rect(dx, gauge_y - 1, dw + 2, gauge_h + 2, outline_colour)
  309.     dx += 1
  310.     contents.fill_rect(dx, gauge_y, dw, gauge_h, gauge_back_color)
  311.     contents.gradient_fill_rect(dx, gauge_y, fill_w, gauge_h, color1, color2)
  312.   end
  313.  
  314. end # Window_Base
  315.  
  316. #==============================================================================
  317. # ¦ Window_Selectable
  318. #==============================================================================
  319.  
  320. class Window_Selectable < Window_Base
  321.  
  322.   #--------------------------------------------------------------------------
  323.   # overwrite method: process_cursor_move
  324.   #--------------------------------------------------------------------------  
  325.   def process_cursor_move
  326.     return unless cursor_movable?
  327.     last_index = @index
  328.     cursor_down (Input.trigger?(:DOWN))  if Input.repeat?(:DOWN)
  329.     cursor_up   (Input.trigger?(:UP))    if Input.repeat?(:UP)
  330.     cursor_right(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
  331.     cursor_left (Input.trigger?(:LEFT))  if Input.repeat?(:LEFT)
  332.     cursor_pagedown   if !handle?(:pagedown) && Input.repeat?(:R)
  333.     cursor_pageup     if !handle?(:pageup)   && Input.repeat?(:L)
  334.     Sound.play_cursor if @index != last_index
  335.   end
  336.    
  337. end # Window_Selectable
  338.  
  339. #==============================================================================
  340. # ¦ Scene_Battle
  341. #==============================================================================
  342.  
  343. class Scene_Battle < Scene_Base
  344.  
  345.   #--------------------------------------------------------------------------
  346.   # overwrite method: show_normal_animation
  347.   #--------------------------------------------------------------------------
  348.   def show_normal_animation(targets, animation_id, mirror = false)
  349.     animation = $data_animations[animation_id]
  350.     return if animation.nil?
  351.     ani_check = false
  352.     targets.each do |target|
  353.       if ani_check
  354.         target.pseudo_ani_id = animation_id
  355.       else
  356.         target.animation_id = animation_id
  357.       end
  358.       target.animation_mirror = mirror
  359.       abs_wait_short unless animation.to_screen?
  360.       ani_check = true if animation.to_screen?
  361.     end
  362.     abs_wait_short if animation.to_screen?
  363.   end
  364.  
  365. end # Scene_Battle
  366.  
  367. #==============================================================================
  368. #
  369. # FIM DO ARQUIVO
  370. #
  371. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement