Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Craze's Script Asylum - Encounter Management
- # Last Date Updated: 2010.06.10
- # Level: Easy
- #
- # Now you can affect the rate of random encounters, or let the player do so.
- #
- # If you use Battle Engine Melody's <variable x: +y> or <variable x: -y> tags
- # or call common events, you can let the player use items that repel or even
- # encourage enemy encounters.
- #===============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
- #===============================================================================
- # Compatibility
- # -----------------------------------------------------------------------------
- # Note: This script overwrites make_encounter_count. Obviously, do not use this
- # with any other encounter rate-adjusting scripts.
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["EncManagement"] = true
- module CRAZE
- module ENC_MANAGE
- # This is the id of the variable you can manipulate to adjust the game's
- # encounter rate. Positive numbers add more steps between encounters;
- # negative numbers reduce the steps between encounters.
- ENC_RATE_MOD_VAR = 41
- # If this is set to true, the variable above will reset to 0 whenever the
- # player moves to a new map. If this is false, make sure that you event
- # a system that keeps the variable in check.
- RESET_ENC_RATE_ON_TRANSFER = true
- # If this is set to true, the encounter rate will be calculated a little
- # differently than the default. This will tighten the possible range of
- # steps between encounters - encounters will occur after a more predictable
- # distance. If false, the default VX method is used.
- ALTERED_ENC_RATE_METHOD = true
- # These allow you to make sure that the player can never go absolutely
- # crazy with your encounter rate options! These are the minimum and maximum
- # amount of steps that have to occur between random encounters.
- MIN_ENC_RATE = 5
- MAX_ENC_RATE = 300
- end
- end
- #===============================================================================
- # Editing anything past this point may potentially result in causing computer
- # damage, incontinence, or horrible Mousie-based death. Edit at your own risk.
- #===============================================================================
- #==============================================================================
- # Game_Player
- #==============================================================================
- class Game_Player < Game_Character
- #--------------------------------------------------------------------------
- # overwrite method: make_encounter_count
- #--------------------------------------------------------------------------
- def make_encounter_count
- if $game_map.map_id != 0
- if CRAZE::ENC_MANAGE::ALTERED_ENC_RATE_METHOD
- n = $game_map.encounter_step
- n = n + rand(n) + 1 # As if rolling a die and adding max
- else
- n = $game_map.encounter_step
- n = rand(n) + rand(n) + 1 # As if rolling 2 dice
- end
- end
- unless n == nil
- n += $game_variables[CRAZE::ENC_MANAGE::ENC_RATE_MOD_VAR]
- n = [n, CRAZE::ENC_MANAGE::MIN_ENC_RATE].max
- n = [n, CRAZE::ENC_MANAGE::MAX_ENC_RATE].min
- @encounter_count = n
- end
- end
- end # Game_Player
- #==============================================================================
- # Scene_Map
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # alias method: update_transfer_player
- #--------------------------------------------------------------------------
- alias csa_enc_mng_update_transfer_player update_transfer_player unless $@
- def update_transfer_player
- return unless $game_player.transfer?
- reset = CRAZE::ENC_MANAGE::RESET_ENC_RATE_ON_TRANSFER
- $game_variables[CRAZE::ENC_MANAGE::ENC_RATE_MOD_VAR] = 0 if reset
- csa_enc_mng_update_transfer_player
- end
- end # Scene_Map
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement