Advertisement
Dekita

ReSpawn

May 6th, 2013
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. # Snippet to automatically respawn onto an area of the map when gameover.
  2. # usefull for people who want to respawn :)
  3. module ReSpawn
  4. Use_Respawn = true
  5. Map_id = 1
  6. Map_x = 5
  7. Map_y = 5
  8. Direction = 2
  9. end
  10.  
  11. #================
  12. class Scene_Base
  13. #================
  14. include ReSpawn # include module
  15. #--------------------------------------------------------------------------
  16. # * Determine if Game Is Over
  17. # Transition to the game over screen if the entire party is dead.
  18. #--------------------------------------------------------------------------
  19. alias :respawn_check_GO :check_gameover
  20. def check_gameover
  21. if $game_party.all_dead? && Use_Respawn
  22. # To recover all status / hp to avoid scene re-triggering constantly, important !!
  23. $game_party.battle_members.each {|member| member.recover_all }
  24. # Perform Transfer
  25. $game_player.reserve_transfer(Map_id, Map_x, Map_y, Direction)
  26. $game_player.perform_transfer
  27. else
  28. # performs old method, looks like this..
  29. # SceneManager.goto(Scene_Gameover) if $game_party.all_dead?
  30. respawn_check_GO
  31. end
  32. end
  33. end
  34.  
  35. #===============================================================================#
  36. # http://dekitarpg.wordpress.com/ #
  37. #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement