Advertisement
TechSkylander1518

Script Exp Yield (v20)

Dec 21st, 2022
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.66 KB | None | 0 0
  1. module GameData
  2.   class Species
  3.    
  4.     FIRST_STAGE_MULT  = 4.0
  5.     SECOND_STAGE_MULT = 7.0
  6.     THIRD_STAGE_MULT  = 9.0
  7.     SOLO_MULT         = 7.0
  8.     LEGENDARY_MULT    = 9.0
  9.     BONUS_MULT        = 2.5
  10.    
  11.     def evo_stage_array
  12.       base = get_baby_species
  13.       ret = [base]
  14.       unless base==species
  15.         base_data = GameData::Species.get(base)
  16.         base_data.get_evolutions(true).each do |evo|   # [new_species, method, parameter, boolean]
  17.           ret.push(evo[0]) if evo[0] == species || evo[0] == get_previous_species
  18.         end
  19.       end
  20.       unless ret[1]==species || !ret[1]
  21.         stage1_data = GameData::Species.get(ret[1])
  22.         stage1_data.get_evolutions(true).each do |evo|   # [new_species, method, parameter, boolean]
  23.           ret.push(evo[0]) if evo[0] == species || evo[0] == get_previous_species
  24.         end
  25.       end
  26.       get_evolutions(true).each do |evo|   # [new_species, method, parameter, boolean]
  27.         unless evo[3]
  28.           ret.push(evo[0])
  29.           break
  30.         end
  31.       end
  32.       ret.push(species) if !ret.include?(species) #Prevents issues with Pokemon where method is None
  33.       return ret
  34.     end
  35.    
  36.     def calculated_exp
  37.       array = evo_stage_array
  38.       bst = base_stat_total.to_f
  39.       stage = array.index(species)
  40.       mult = [FIRST_STAGE_MULT,SECOND_STAGE_MULT,THIRD_STAGE_MULT][stage]
  41.       mult = SOLO_MULT if array.length == 1
  42.       mult = LEGENDARY_MULT if array.length == 1 && egg_groups.include?(:Undiscovered)
  43.       mult *= BONUS_MULT if [:HAPPINY,:CHANSEY,:BLISSEY,:AUDINO].include?(species)
  44.       ret = ((bst * mult)/20.0).round.to_i
  45.       return ret
  46.     end
  47.    
  48.   end
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement