Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Credit: bo4p5687
- #---------------------------------------------------------------------------------------------------
- In module PBEvolution
- below
- TradeSpecies = 59
- add
- SweetItem = 60
- def self.maxValue; return 60; end # change max value, here, 60
- #---------------------------------------------------------------------------------------------------
- # Put these lines above Main
- # Create item
- def pbIsSweet?(item)
- ret = pbGetItemData(item,ITEM_TYPE)
- return ret && ret==13
- end
- # Create new method
- class PokemonGlobalMetadata
- attr_accessor :milceryevolve
- alias old_ini initialize
- def initialize
- @milceryevolve = false
- old_ini
- end
- end
- # Create evolution method
- PBEvolution.register(:SweetItem, {
- "sweetItem" => proc { |pkmn, parameter|
- next $PokemonGlobal.milceryevolve
- }
- })
- # Spin
- class Scene_Map
- alias old_update_micery update
- def update
- old_update_micery
- spinEvolve if !$game_player.moving?
- end
- end
- def spinEvolve
- exit = false
- # animation >= 15 (5 seconds)
- # animation >= 30 (10 seconds)
- anywise = false
- clockwise = false
- counterclockwise = false
- animation = 0
- if !pbMapInterpreterRunning?
- if Input.press?(Input::L)
- anywise = true
- clockwise = true
- loop do
- Graphics.update
- Input.update
- pbUpdateSceneMap
- break if exit
- exit = true if Input.press?(Input::B)
- animation += 1
- # Spin
- 4.times do
- exit = true if Input.press?(Input::B)
- $game_player.turn_left_90
- pbWait(3)
- end
- end
- pbWait(2)
- setFormMilcery(anywise,clockwise,counterclockwise,animation)
- anywise = false; clockwise = false; counterclockwise = false
- elsif Input.press?(Input::R)
- anywise = true
- counterclockwise = true
- loop do
- Graphics.update
- Input.update
- pbUpdateSceneMap
- break if exit
- exit = true if Input.press?(Input::B)
- animation += 1
- # Spin
- 4.times do
- exit = true if Input.press?(Input::B)
- $game_player.turn_right_90
- pbWait(3)
- end
- end
- pbWait(2)
- setFormMilcery(anywise,clockwise,counterclockwise,animation)
- anywise = false; clockwise = false; counterclockwise = false
- end
- end
- end
- # Set new time
- module PBDayNight
- def self.isSpecialTime?(time=nil)
- time = pbGetTimeNow if !time
- return (time.hour>=19 && time.hour<20)
- end
- end
- # Set form
- def setFormMilcery(anywise,clockwise,counterclockwise,number)
- $Trainer.party.each do |pkmn|
- evolution = nil
- # Set form
- if pkmn.species==PBSpecies::MILCERY && pbIsSweet?(pkmn.item)
- $PokemonGlobal.milceryevolve = true
- itemSweet = [PBItems::STRAWBERRYSWEET,
- PBItems::BERRYSWEET,
- PBItems::LOVESWEET,
- PBItems::STARSWEET,
- PBItems::CLOVERSWEET,
- PBItems::FLOWERSWEET,
- PBItems::RIBBONSWEET
- ]
- # Spin type (set form)
- if clockwise
- if number <= 15 # 5 seconds
- # Vanilla Cream
- if PBDayNight.isDay?
- (0...itemSweet.size).each{|i|
- evolution = i if pkmn.item == itemSweet[i] }
- # Matcha Cream
- elsif PBDayNight.isNight?
- (0...itemSweet.size).each{|i|
- evolution = 14 + i if pkmn.item == itemSweet[i] }
- end
- else
- # Caramel Swirl
- if PBDayNight.isDay?
- (0...itemSweet.size).each{|i|
- evolution = 49 + i if pkmn.item == itemSweet[i] }
- # Lemon Cream
- elsif PBDayNight.isNight?
- (0...itemSweet.size).each{|i|
- evolution = 28 + i if pkmn.item == itemSweet[i] }
- end
- end
- elsif counterclockwise
- if number <= 15 # 5 seconds
- # Ruby Cream
- if PBDayNight.isDay?
- (0...itemSweet.size).each{|i|
- evolution = 7 + i if pkmn.item == itemSweet[i] }
- # Salted Cream
- elsif PBDayNight.isNight?
- (0...itemSweet.size).each{|i|
- evolution = 35 + i if pkmn.item == itemSweet[i] }
- end
- else
- # Ruby Swirl
- if PBDayNight.isDay?
- (0...itemSweet.size).each{|i|
- evolution = 42 + i if pkmn.item == itemSweet[i] }
- # Mint Cream
- elsif PBDayNight.isNight?
- (0...itemSweet.size).each{|i|
- evolution = 21 + i if pkmn.item == itemSweet[i] }
- end
- end
- end
- if anywise
- # Rainbow Swirl
- if PBDayNight.isSpecialTime? && number > 30 # 10 seconds
- (0...itemSweet.size).each{|i|
- evolution = 56 + i if pkmn.item == itemSweet[i] }
- end
- end
- end
- ret = pbCheckEvolutionEx(pkmn) { |pkmn, method, parameter, new_species|
- success = PBEvolution.call("sweetItem", method, pkmn, parameter)
- next (success) ? new_species : -1 }
- if ret>0
- pbFadeOutInWithMusic {
- pkmn.form = evolution
- evo = PokemonEvolutionScene.new
- evo.pbStartScreen(pkmn,ret)
- evo.pbEvolution(true)
- evo.pbEndScreen }
- $PokemonGlobal.milceryevolve = false
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement