noelburgundy27

SIngle Party EXP Script v0.1a

Jun 6th, 2014
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.95 KB | None | 0 0
  1. =begin
  2. Single Party E"XP Script (ver 0.1a)
  3.  
  4. DESCRIPTION:
  5. Modifies various exp functions so that the entire party has the same EXP.
  6. This uses up a variable in the game, witch you can specify in SETTINGS::SETVAR.
  7. That way everyone catches up in an instant. Initializing becomes useless, except
  8. for equipment.
  9.  
  10. This however, renders rising EXP gain useless.
  11. Adding value to designated variable overshoots EXP bar, but is fixed with a
  12. victory in battle
  13.  
  14. ======================================
  15. Known issues:
  16.  0.1a - When changing the EXP variable directly, EXP overshoots the EXP bar in
  17.         display. Minor glitch. Fixable by battle.
  18. ======================================
  19.  
  20. Instructions:
  21. Paste this script above Main, below Materials, and below other EXP scripts.
  22. It may or may not collide with other EXP scripts. So choose wisely.
  23.  
  24. Script by CaliforniaMacky
  25.  
  26. =end
  27.  
  28. module SETTINGS
  29.   #SETVAR is for setting the variable in the database to hold the Party EXP
  30.   SETVAR  = 1
  31.  
  32.   #HEAL_AFTER_BATTLE sets whether or not to fully heal the party after battle.
  33.   HEAL_AFTER_BATTLE = true
  34. end
  35.  
  36. class Game_Actor < Game_Battler
  37.   def exp
  38.     default = SETTINGS::SETVAR
  39.     $game_variables[default] #@exp[@class_id]
  40.   end
  41. end
  42.  
  43. module BattleManager
  44.   def self.gain_exp
  45.     default = SETTINGS::SETVAR
  46.     $game_variables[default] += $game_troop.exp_total
  47.     $game_party.all_members.each do |actor|
  48.       actor.change_exp($game_variables[default], 0)
  49.     end
  50.     wait_for_message
  51.   end
  52.  
  53.   def self.adjust_exp
  54.     default = SETTINGS::SETVAR
  55.     $game_party.all_members.each do |actor|
  56.       actor.change_exp($game_variables[default], 0)
  57.     end
  58.   end
  59.  
  60.   def self.heal_mofo
  61.     if ((SETTINGS::HEAL_AFTER_BATTLE) == true)
  62.       $game_party.all_members.each { |actor| actor.recover_all } #THIS LINE
  63.     end
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # * Victory Processing
  67.   #--------------------------------------------------------------------------
  68.   def self.process_victory
  69.     play_battle_end_me
  70.     replay_bgm_and_bgs
  71.     $game_message.add(sprintf(Vocab::Victory, $game_party.name))
  72.     display_exp
  73.     gain_gold
  74.     gain_drop_items
  75.     gain_exp
  76.     heal_mofo
  77.     SceneManager.return
  78.     battle_end(0)
  79.     return true
  80.   end
  81.  
  82.   #--------------------------------------------------------------------------
  83.   # * Abort Processing
  84.   #--------------------------------------------------------------------------
  85.   def self.process_abort
  86.     adjust_exp
  87.     heal_mofo
  88.     replay_bgm_and_bgs
  89.     SceneManager.return
  90.     battle_end(1)
  91.     return true
  92.   end
  93.  
  94.   #--------------------------------------------------------------------------
  95.   # * Defeat Processing
  96.   #--------------------------------------------------------------------------
  97.   def self.process_defeat
  98.     adjust_exp
  99.     $game_message.add(sprintf(Vocab::Defeat, $game_party.name))
  100.     wait_for_message
  101.     if @can_lose
  102.       revive_battle_members
  103.       heal_mofo
  104.       replay_bgm_and_bgs
  105.       SceneManager.return
  106.     else
  107.       SceneManager.goto(Scene_Gameover)
  108.     end
  109.     battle_end(2)
  110.     return true
  111.   end
  112. end
  113.  
  114. #=begin
  115. class Game_Actor < Game_Battler
  116.   def exp
  117.     default = SETTINGS::SETVAR
  118.     @exp[@class_id] = $game_variables[default]
  119.   end
  120.  
  121.  
  122.   def init_exp
  123.     default = SETTINGS::SETVAR
  124.     @exp[@class_id] = [$game_variables[default], 0].max#current_level_exp
  125.     last_level = @level
  126.     level_up while !max_level? && self.exp >= next_level_exp
  127.     level_down while self.exp < current_level_exp
  128.   end
  129.  
  130.  
  131.   def change_exp(exp, show)
  132.     default = SETTINGS::SETVAR
  133.     $game_variables[default] = exp
  134.     @exp[@class_id] = [exp, 0].max
  135.     last_level = @level
  136.     last_skills = skills
  137.     level_up while !max_level? && self.exp >= next_level_exp
  138.     level_down while self.exp < current_level_exp
  139.     display_level_up(skills - last_skills) if show && @level > last_level
  140.     refresh
  141.   end
  142. end
  143. #=end
Advertisement
Add Comment
Please, Sign In to add comment