Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ==============================================================================
- # ▼▼▼▼▼▼ TroyZ - Preemptive Surprise Toggler ▼▼▼▼▼▼
- # ==============================================================================
- # Script by : Agung Prasetyo(TroyZ)
- # Contact me by : - Email agung.endisnear.xyz@gmail.com
- # - Forum RPGMakerID, username TroyZ
- # - Handphone 085756289121
- # Engine : VXAce
- # Level : Easy
- # Version : 1.0
- # ------------------------------------------------------------------------------
- # Change Logs :
- # 17 June 2013 : Version 1.0 released
- # ------------------------------------------------------------------------------
- # How this work :
- # This little script will give you an ability to control preemptive and surprise
- # battle at exact rate by using switch.
- # ------------------------------------------------------------------------------
- # How to use :
- # Place it between material and main. Set your preemptive and surprise switch
- # in the module. If preemptive switch is ON, the battle will be in a preemptive
- # conditions. If surprise switch is ON, the battle will be in a surprise conditions.
- # If both switches are ON or OFF, then the default preemptive and suprise rate
- # will be used. It works on random encounters and event battle.
- # ------------------------------------------------------------------------------
- # Compatibility issues :
- # I haven't get any compatibility issues actually. If you get some, let me know,
- # and bug fixes will come.
- # ------------------------------------------------------------------------------
- # Who to credit :
- # - Allah swt. : For the chance of living that he has given to me.
- # - Nabi Muhammad saw. : As a leader and messenger and prophet of Muslim.
- # I'm proud to be your follower. :)
- # - Agung Prasetyo(TroyZ) : Thats me, of course, the ones that made this script. :P
- # ------------------------------------------------------------------------------
- # License :
- # - Free Game : Just credit those two first names. My name in the credit?
- # If you pleased, but if you don't, no problem, this is just a simple script actually.
- # - Commercial Game : Same as free game's license.
- # ------------------------------------------------------------------------------
- $imported = {} if $imported.nil?
- $imported[:TroyZ_PreemptiveSurpriseToggler] = true
- module AGUNG
- PREEMPTIVE_SWITCH = 1 # set the preemptive switch. If ON, preemptive battle will come
- SURPRISE_SWITCH = 2 # set the surprise switch. If ON, surprise battle will come
- end
- module BattleManager
- def self.on_encounter
- if $game_switches[AGUNG::PREEMPTIVE_SWITCH] && $game_switches[AGUNG::PREEMPTIVE_SWITCH] != $game_switches[AGUNG::SURPRISE_SWITCH]
- @preemptive = true
- elsif $game_switches[AGUNG::SURPRISE_SWITCH] && $game_switches[AGUNG::PREEMPTIVE_SWITCH] != $game_switches[AGUNG::SURPRISE_SWITCH]
- @surprise = true
- else
- @preemptive = (rand < rate_preemptive)
- @surprise = (rand < rate_surprise && !@preemptive)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement