Advertisement
Rafael_Sol_Maker

RAFAEL_SOL_MAKER's VX SMALL TWEAKS v1.1a

Nov 19th, 2011
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #===============================================================================
  2. #               RAFAEL_SOL_MAKER's VX SMALL TWEAKS v1.1a (9 in 1)
  3. #-------------------------------------------------------------------------------
  4. # Description:  Collection of small adjustments to improve the usability of VX
  5. #               and fix some bugs or inconveniences.
  6. #               Among the 9 adjustments, this version of the script includes:
  7. #               - Set the message of escape from battle
  8. #               - Adjust the making of enemies' names
  9. #               - Recover HP and MP when you level up
  10. #               - The encounter rate will be halved if you are in a vehicle
  11. #               - Airship now triggers events with priority 'Above the Hero'
  12. #               - Corrected position of battlers (resolution add-on, optional)
  13. #               - Sound effect in the expressions
  14. #               - Modify the starting party's money with ease
  15. #               - Change easily the flight altitude of the Airship
  16. #-------------------------------------------------------------------------------
  17. # How to Use: -
  18. #-------------------------------------------------------------------------------
  19. # Special Thanks: João B, Yellow Magic, Maliki79, ScreWe.
  20. #                 (http://www.rpgrevolution.com/)
  21. #-------------------------------------------------------------------------------
  22. #===============================================================================
  23.  
  24. module PowerPackVX_General_Configs  
  25.   # BASIC ENGINE ADJUSTS
  26.   Recover_When_Level_Up = true  # Recover HP and MP when level up?
  27.   Starting_Money = 150          # Starting Money
  28.   Airship_Altitude = 48         # Airship altitude
  29. end
  30.  
  31. module Vocab  
  32.   # EDITED TERMS
  33.   EscapeStart   = "The %s's party tries to escape..."  
  34.   EscapeFailure = "Your party couldn't escape!"  
  35.   # NEW TERMS
  36.   EscapeEnd     = "Your party escaped with success."
  37. end
  38.  
  39. module Sound
  40.   # SOUND EFFECT FOR EXPRESSIONS
  41.   def self.play_baloon
  42.     Audio.se_play('Audio/SE/Jump1', 100, 100)
  43.   end  
  44. end
  45.  
  46. #===============================================================================
  47. # Adjust on the escape battle message
  48. #===============================================================================
  49. class Scene_Battle < Scene_Base
  50.  
  51.   def process_escape
  52.     @info_viewport.visible = false
  53.     @message_window.visible = true
  54.     text = sprintf(Vocab::EscapeStart, $game_party.name)
  55.     $game_message.texts.push(text)
  56.     wait_text = '\.\.'
  57.     if $game_troop.preemptive
  58.       success = true
  59.     else
  60.       success = (rand(100) < @escape_ratio)
  61.     end    
  62.     if success
  63.       Sound.play_escape
  64.       $game_message.texts.push(wait_text + Vocab::EscapeEnd)
  65.       wait_for_message
  66.       battle_end(1)
  67.     else
  68.       @escape_ratio += 10
  69.       $game_message.texts.push(wait_text + Vocab::EscapeFailure)
  70.       wait_for_message
  71.       $game_party.clear_actions
  72.       start_main
  73.     end
  74.   end
  75.  
  76. end
  77.  
  78. #===============================================================================
  79. # Adjust on the making of unique enemies names
  80. #===============================================================================
  81. class Game_Troop < Game_Unit
  82.  
  83.   alias sol_maker_make_unique_names make_unique_names unless $@
  84.   def make_unique_names
  85.     sol_maker_make_unique_names
  86.     for enemy in members
  87.       enemy.letter = ' ' + enemy.letter
  88.     end
  89.   end
  90.  
  91. end
  92.  
  93. #===============================================================================
  94. # Recover HP and MP when level up
  95. #===============================================================================
  96. class Game_Actor < Game_Battler  
  97.   include PowerPackVX_General_Configs
  98.  
  99.   alias sol_maker_level_up level_up unless $@
  100.   def level_up
  101.     sol_maker_level_up
  102.     if Recover_When_Level_Up
  103.       self.hp += maxhp; self.mp += maxmp
  104.     end
  105.   end
  106.  
  107. end
  108.  
  109. #===============================================================================
  110. # If you are in a vehicle, the encounter rate will be halved
  111. #===============================================================================
  112. class Game_Player < Game_Character
  113.  
  114.   def update_encounter
  115.     return if in_airship?
  116.     return if $TEST and Input.press?(Input::CTRL)  
  117.     if $game_map.bush?(@x, @y)
  118.       if in_vehicle?
  119.         @encounter_count = @encounter_count.to_f - 1
  120.       else
  121.         @encounter_count -= 2
  122.       end
  123.     else
  124.       if in_vehicle?
  125.         @encounter_count = @encounter_count.to_f - 0.5
  126.       else
  127.         @encounter_count -= 1
  128.       end
  129.     end    
  130.   end
  131.  
  132. #===============================================================================
  133. # Events with priority 'Above the Hero' can be triggered in Airship
  134. #===============================================================================  
  135.   def check_touch_event
  136.     return check_event_trigger_here([1,2])
  137.   end
  138.   def check_action_event
  139.     return true if check_event_trigger_here([0])
  140.     return check_event_trigger_there([0,1,2])
  141.   end
  142.  
  143.   alias sol_maker_check_event_trigger_here check_event_trigger_here unless $@
  144.   def check_event_trigger_here(triggers)    
  145.     return false if $game_map.interpreter.running? # Repeated command...
  146.    
  147.     for event in $game_map.events_xy(@x, @y)
  148.       return false if in_airship? and event.priority_type != 2  
  149.     end
  150.     sol_maker_check_event_trigger_here(triggers)    
  151.   end
  152.  
  153.   alias sol_maker_check_event_trigger_there check_event_trigger_there unless $@
  154.   def check_event_trigger_there(triggers)
  155.     return false if $game_map.interpreter.running? # Repeated command...
  156.    
  157.     front_x = $game_map.x_with_direction(@x, @direction)
  158.     front_y = $game_map.y_with_direction(@y, @direction)
  159.     for event in $game_map.events_xy(front_x, front_y)
  160.       return false if in_airship? and event.priority_type != 2
  161.     end
  162.     sol_maker_check_event_trigger_there(triggers)
  163.   end
  164.  
  165. end
  166.  
  167. #===============================================================================
  168. #  Battlers(monsters) now have corrected positions on all resolutions
  169. #===============================================================================
  170. class Sprite_Battler < Sprite_Base
  171.  
  172.   def update
  173.     super
  174.     if @battler == nil
  175.       self.bitmap = nil
  176.     else
  177.       @use_sprite = @battler.use_sprite?
  178.       if @use_sprite
  179.         ax =  @battler.screen_x.to_f * (Graphics.width.to_f / 544)
  180.         ay =  @battler.screen_y.to_f * (Graphics.height.to_f / 416)
  181.         self.x = ax.to_i        
  182.         self.y = ay.to_i
  183.         self.z = @battler.screen_z
  184.         update_battler_bitmap
  185.       end
  186.       setup_new_effect
  187.       update_effect
  188.     end
  189.   end
  190.  
  191. end
  192.  
  193. #===============================================================================
  194. # Sound Effect for Expressions
  195. #===============================================================================
  196. class Sprite_Character < Sprite_Base
  197.  
  198.   alias sol_maker_start_balloon start_balloon unless $@
  199.   def start_balloon
  200.     Sound.play_baloon
  201.     sol_maker_start_balloon
  202.   end
  203.  
  204. end
  205.  
  206. #===============================================================================
  207. # Change the money at the beginning of the game
  208. #===============================================================================
  209. class Game_Party < Game_Unit  
  210.   include PowerPackVX_General_Configs
  211.  
  212.   alias sol_maker_initialize initialize unless $@
  213.   def initialize
  214.     sol_maker_initialize
  215.     @gold = Starting_Money
  216.   end
  217.  
  218. end
  219.  
  220. #===============================================================================
  221. # Change the Airship altitude
  222. #===============================================================================  
  223. class Game_Vehicle < Game_Character
  224.   MAX_ALTITUDE = PowerPackVX_General_Configs::Airship_Altitude
  225. end
  226.  
  227.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement