Advertisement
TechSkylander1518

Battle Size Options for Essentials v20

May 19th, 2022
836
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class PokemonSystem
  2.   attr_accessor :battlesize
  3.  
  4.   def initialize
  5.     @textspeed     = 1     # Text speed (0=slow, 1=normal, 2=fast)
  6.     @battlescene   = 0     # Battle effects (animations) (0=on, 1=off)
  7.     @battlestyle   = 0     # Battle style (0=switch, 1=set)
  8.     @sendtoboxes   = 0     # Send to Boxes (0=manual, 1=automatic)
  9.     @givenicknames = 0     # Give nicknames (0=give, 1=don't give)
  10.     @frame         = 0     # Default window frame (see also Settings::MENU_WINDOWSKINS)
  11.     @textskin      = 0     # Speech frame
  12.     @screensize    = (Settings::SCREEN_SCALE * 2).floor - 1   # 0=half size, 1=full size, 2=full-and-a-half size, 3=double size
  13.     @language      = 0     # Language (see also Settings::LANGUAGES in script PokemonSystem)
  14.     @runstyle      = 0     # Default movement speed (0=walk, 1=run)
  15.     @bgmvolume     = 100   # Volume of background music and ME
  16.     @sevolume      = 100   # Volume of sound effects
  17.     @textinput     = 0     # Text input mode (0=cursor, 1=keyboard)
  18.     @battlesize    = 0     # Battle size (0 = single, 1 = double 2 = triple)
  19.   end
  20. end
  21.  
  22. MenuHandlers.add(:options_menu, :text_input_style, {
  23.   "name"        => _INTL("Battle Size"),
  24.   "order"       => 55,
  25.   "type"        => EnumOption,
  26.   "parameters"  => [_INTL("Single"), _INTL("Double"), _INTL("Triple")],
  27.   "description" => _INTL("Choose the size battles are fought in."),
  28.   "get_proc"    => proc { next $PokemonSystem.battlesize },
  29.   "set_proc"    => proc { |value, _scene| $PokemonSystem.battlesize = value }
  30. })
  31.  
  32.  
  33. EventHandlers.add(:on_trainer_load, :battle_size_option,
  34.   proc { |trainer|
  35.     if !$game_temp.battle_rules["size"] && trainer
  36.     case $PokemonSystem.battlesize
  37.       when 1
  38.           setBattleRule("double") if pbCanDoubleBattle?
  39.       when 2
  40.           setBattleRule("triple") if pbCanTripleBattle?
  41.           setBattleRule("double") if !pbCanTripleBattle? && pbCanDoubleBattle?
  42.       end
  43.     end
  44.   }
  45. )
Advertisement
RAW Paste Data Copied
Advertisement