Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-------------------------------------------------------------------------------
- # Goddess's Light v1.0
- #-- Show a resurrection option on gameover as well as additional holy gifts
- #-- By mjshi
- #-- LONG LIVE TEAM GOOD! -oh wait, with this script, we're basically immortal
- #-------------------------------------------------------------------------------
- # Installation:
- # Put above Main, preferably below all other custom scripts.
- #
- module LIGHT
- #-----------------------------------------------------------------------------
- # **CONFIGURATION**
- #-----------------------------------------------------------------------------
- # What should be the background of the resurrection screen?
- #
- GODDESS = "Graphics/Pictures/goddess.jpg"
- #
- # What should the resurrection window say?
- #
- REVIVE = "Resurrection"
- REWIND = "Rewind Time"
- TO_TITLE = "Ascension"
- #
- #-----------------------------------------------------------------------------
- # Width and location of the resurrection window
- #
- WIDTH = 180 #default 160
- XPOS = (Graphics.width - WIDTH)/2
- YPOS = (Graphics.height/4) * 3
- #
- #-----------------------------------------------------------------------------
- # The ID of the common event to run after the player is resurrected
- #
- RESURRECTION_EVENTID = 1
- #
- #-----------------------------------------------------------------------------
- # How much HP/MP should resurrection restore?
- #-----------------------------------------------------------------------------
- # SPECIAL CASES:
- # RESTORE_HP = "full heal" restores both HP and MP to max.
- # Set RESTORE_MP = "none" if you have RESTORE_HP set to "full heal".
- #-----------------------------------------------------------------------------
- # OTHERWISE:
- # Set RESTORE_HP to a point value (greater than or equal to 1) to restore
- # that much HP.
- # Set RESTORE_HP to a decimal percentage (less than 1) to restore a percentage
- # of HP. The same rules apply for RESTORE_MP.
- #-----------------------------------------------------------------------------
- #
- RESTORE_HP = "full heal"
- RESTORE_MP = 100
- #
- #-----------------------------------------------------------------------------
- # Should there be additional blessings/gifts when you're resurrected?
- #
- BLESSING = false #set to false if not
- # If true, what should the background be?
- BLESSING_BG = "Graphics/Pictures/goddess_blessing.jpg"
- # How wide should the window be? Where should it be?
- BWIDTH = 160
- BXPOS = (Graphics.width - BWIDTH)/2
- BYPOS = YPOS
- # Okay, and what should the gifts be called?
- STRENGTH = "Strength"
- WISDOM = "Wisdom"
- SPEED = "Swiftness"
- # What are the item IDs of the gifts?
- STR_ITEM = 1
- WIS_ITEM = 2
- SPD_ITEM = 3
- #
- #-----------------------------------------------------------------------------
- end
- #--------------------------------------------------------------------#
- # !!! Beware of crashes and errors if you edit beyond this point !!! #
- #--------------------------------------------------------------------#
- class Window_GoddessLight < Window_Command
- def initialize
- super(0, 0)
- end
- def window_width
- return LIGHT::WIDTH
- end
- def visible_line_number
- item_max
- end
- def make_command_list
- add_command(LIGHT::REVIVE, :resurrect)
- add_command(LIGHT::REWIND, :load)
- add_command(LIGHT::TO_TITLE, :title)
- end
- end
- class Window_GoddessBlessing < Window_Command
- def initialize
- super(0, 0)
- end
- def window_width
- return LIGHT::BWIDTH
- end
- def visible_line_number
- item_max
- end
- def make_command_list
- add_command(LIGHT::STRENGTH, :strength)
- add_command(LIGHT::WISDOM, :wisdom)
- add_command(LIGHT::SPEED, :speed)
- end
- end
- class Scene_Gameover < Scene_Base
- def start
- super
- play_gameover_music
- fadeout_frozen_graphics
- create_background
- create_command_window
- end
- def terminate
- super
- dispose_background
- end
- def create_command_window
- @command_window = Window_GoddessLight.new
- @command_window.set_handler(:resurrect, method(:command_resurrect))
- @command_window.set_handler(:load, method(:command_load))
- @command_window.set_handler(:title, method(:command_title))
- @command_window.x = (LIGHT::XPOS)
- @command_window.y = (LIGHT::YPOS)
- end
- def perform_transition
- Graphics.transition(fadein_speed)
- end
- def play_gameover_music
- RPG::BGM.stop
- RPG::BGS.stop
- $data_system.gameover_me.play
- end
- def fadeout_frozen_graphics
- Graphics.transition(fadeout_speed)
- Graphics.freeze
- end
- def create_background
- @sprite = Sprite.new
- @sprite = Sprite.new
- @sprite.bitmap = Bitmap.new(LIGHT::GODDESS)
- end
- def dispose_background
- @sprite.bitmap.dispose
- @sprite.dispose
- end
- def fadein_speed
- return 120
- end
- def fadeout_speed
- return 60
- end
- def command_load
- SceneManager.call(Scene_Load)
- end
- def command_title
- SceneManager.call(Scene_Title)
- end
- def command_resurrect
- if not LIGHT::BLESSING
- resurrect
- else
- blessing
- end
- end
- def blessing
- @sprite.bitmap = Bitmap.new(LIGHT::BLESSING_BG)
- @command_window.hide
- @command_window = Window_GoddessBlessing.new
- @command_window.set_handler(:strength, method(:command_str))
- @command_window.set_handler(:wisdom, method(:command_wis))
- @command_window.set_handler(:speed, method(:command_spd))
- @command_window.x = (LIGHT::BXPOS)
- @command_window.y = (LIGHT::BYPOS)
- @command_window.set_handler(:cancel, method(:command_return_blessing))
- end
- def command_return_blessing
- @command_window.hide
- @sprite.bitmap = Bitmap.new(LIGHT::GODDESS)
- create_command_window
- end
- def command_str
- $game_party.gain_item($data_items[LIGHT::STR_ITEM], 1)
- resurrect
- end
- def command_wis
- $game_party.gain_item($data_items[LIGHT::WIS_ITEM], 1)
- resurrect
- end
- def command_spd
- $game_party.gain_item($data_items[LIGHT::SPD_ITEM], 1)
- resurrect
- end
- def resurrect
- if LIGHT::RESTORE_HP == "full heal"
- $game_party.members.each { |actor| actor.recover_all }
- elsif LIGHT::RESTORE_HP >= 1
- $game_party.members.each { |actor|
- actor.hp += LIGHT::RESTORE_HP
- }
- elsif LIGHT::RESTORE_HP < 1
- $game_party.members.each { |actor|
- actor.hp += actor.mhp * LIGHT::RESTORE_HP
- }
- end
- if LIGHT::RESTORE_MP == "none"
- nil
- elsif LIGHT::RESTORE_MP >= 1
- $game_party.members.each { |actor|
- actor.mp += LIGHT::RESTORE_MP
- }
- elsif LIGHT::RESTORE_MP < 1
- $game_party.members.each { |actor|
- actor.mp += actor.mmp * LIGHT::RESTORE_MP
- }
- end
- revive_end_proc
- end
- def revive_end_proc
- SceneManager.call(Scene_Map)
- $game_temp.reserve_common_event(LIGHT::RESURRECTION_EVENTID)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement