Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $imported = {} if $imported.nil?
- $imported["HBK_SSCEOBE"] = 0.60
- #==============================================================================
- # ■ 「SIMPLE STUPID」 Common Event on Battle End
- # by HBK61
- # Requires: N/A
- # Rewrites method:
- # BattleManager#self.process_victory
- # BattleManager#Self.process_escape
- # BattleManager#self.process_defeat
- # Aliases method: N/A
- #
- #==============================================================================
- # CHANGELOG
- # - ver0.60 2012.02.03 Initialization
- #==============================================================================
- # INTRODUCTION
- # - This script allow you to run common event before leaving Battle Scene.
- # You can set which common event to run on win, defeat, and lose.
- #==============================================================================
- # INSTRUCTION
- # - Just edit on CONFIGURATION section below as you wish.
- #==============================================================================
- # TERM OF USE
- # - No need to gimme credit on your game, although its an honour to receive any.
- # - Feel free to use on commercial game.
- # - Feel free to use on adult-themed game.
- # - Feel free to use, edit, delete, wipe, burn, eat, or anything you want to do
- # with this script as long as you don't claim this script as yours.
- #==============================================================================
- # SPECIAL THANKS
- # TheoAllen for the idea
- module HBK
- module BattleEnd
- #--------------------------------------------------------------------------
- # CONFIGURATION
- # If you don't want to run common event, just set the value to 0
- Victory_Common_Event_ID = 1
- Escape_Common_Event_ID = 2
- Defeat_Common_Event_ID = 3
- # WARNING!
- # Do not edit below this point unless you know what to do!
- #--------------------------------------------------------------------------
- end
- end
- module BattleManager
- #--------------------------------------------------------------------------
- # * Victory Processing
- #--------------------------------------------------------------------------
- def self.process_victory
- play_battle_end_me
- replay_bgm_and_bgs
- SceneManager.scene.process_common_event(HBK::BattleEnd::Victory_Common_Event_ID)
- $game_message.add(sprintf(Vocab::Victory, $game_party.name))
- display_exp
- gain_gold
- gain_drop_items
- gain_exp
- SceneManager.return
- battle_end(0)
- return true
- end
- #--------------------------------------------------------------------------
- # * Escape Processing
- #--------------------------------------------------------------------------
- def self.process_escape
- $game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
- success = @preemptive ? true : (rand < @escape_ratio)
- Sound.play_escape
- if success
- SceneManager.scene.process_common_event(HBK::BattleEnd::Escape_Common_Event_ID)
- process_abort
- else
- @escape_ratio += 0.1
- $game_message.add('\.' + Vocab::EscapeFailure)
- $game_party.clear_actions
- end
- wait_for_message
- return success
- end
- #--------------------------------------------------------------------------
- # * Defeat Processing
- #--------------------------------------------------------------------------
- def self.process_defeat
- SceneManager.scene.process_common_event(HBK::BattleEnd::Defeat_Common_Event_ID)
- $game_message.add(sprintf(Vocab::Defeat, $game_party.name))
- wait_for_message
- if @can_lose
- revive_battle_members
- replay_bgm_and_bgs
- SceneManager.return
- else
- SceneManager.goto(Scene_Gameover)
- end
- battle_end(2)
- return true
- end
- end #BattleManager
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # * new method: process_common_event
- #--------------------------------------------------------------------------
- def process_common_event(id)
- return if id == 0
- $game_temp.reserve_common_event(id)
- while !scene_changing?
- $game_troop.interpreter.update
- $game_troop.setup_battle_event
- wait_for_message
- break unless $game_troop.interpreter.running?
- update_for_wait
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment