Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # ** Scene_iPod
- # ** Created by xLeD and Harshboy (Scene_Jukebox)
- # ** Modified by Mutant Yoshi
- #-------------------------------------------------------------------------------
- # This class performs menu screen processing.
- #===============================================================================
- RADIO_BUENA_SWITCH = 128# Switch if password is unclaimed
- RADIO_BUENA_VARIABLE = 101 # variable of password text
- RADIO_BUENA=[_INTL("Welcome back to Buena's Password!"),
- _INTL("If you're hearing this program, then you're a Trainer looking to get a special prize!"),
- _INTL("All you have to do is remember tonight's password!"),
- _INTL("This week's secret password is..."),
- "",
- _INTL("Now remember that! All you have to do is head to room 2C of the Neon City Radio Tower and say the password!"),
- _INTL("If you get it right, I'll give you a special prize!"),
- _INTL("Remember to tune in every Saturday, 8 PM! Don't be late!")]
- RADIO_LOTTO=[_INTL("Hello once again! Thank-you for tuning into the Lottery Station!"),
- _INTL("If you have a Pokemon with a Trainer ID that matches with our winning Lottery Number, bring it into the Radio Tower in Neon City ASAP."),
- _INTL("This week's winning lottery number is..."),
- "",
- _INTL("Now hurry, because this won't last long. If this is your winning lucky Lottery number, turn it in now before Sunday ends!"),
- _INTL("Thanks, once again, for tuning into the Lottery Station!"),
- _INTL("For those of you that missed it or those just now tuning in, let's repeat this week's winning number."),
- _INTL("Remember: To turn in your winning Lottery number, bring your Pokemon directly to the Radio Tower in Neon City.")]
- RADIO_MESSAGE_1=[_INTL("almost poisonously"),
- _INTL("aptly named and"),
- _INTL("heart-meltingly"),
- _INTL("provocatively"),
- _INTL("so flipped out and"),
- _INTL("so mischievously"),
- _INTL("so very topically"),
- _INTL("so unbearably"),
- _INTL("sure addictively"),
- _INTL("sweet and adorably"),
- _INTL("undeniably kind of"),
- _INTL("wiggly and slickly"),
- _INTL("well, impressively")]
- RADIO_MESSAGE_2=[_INTL("bold, sort of."),
- _INTL("cute"),
- _INTL("exciting"),
- _INTL("friendly."),
- _INTL("frightening."),
- _INTL("guarded."),
- _INTL("hot, hot, hot!"),
- _INTL("inspiring."),
- _INTL("lovely."),
- _INTL("fascinating!"),
- _INTL("pleasant."),
- _INTL("powerful."),
- _INTL("speedy."),
- _INTL("stimulating."),
- _INTL("suave & debonair!"),
- _INTL("weird.")]
- class PokemonGlobalMetadata
- attr_accessor :station
- attr_accessor :dailypkmn
- end
- class PokemonTemp
- attr_accessor :radioline
- end
- module PBDayNight
- # Returns true if it's Time for Buena's show
- class << self
- def isBuenaTime?(time=nil)
- time=pbGetTimeNow if !time
- return (time.hour>=20 and time.wday==6)
- end
- end
- end
- class Scene_Radio
- #-----------------------------------------------------------------------------
- # * Object Initialization
- # menu_index : command cursor's initial position
- #-----------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- end
- #-----------------------------------------------------------------------------
- # * Main Processing
- #-----------------------------------------------------------------------------
- def main
- # Make song command window
- fadein = true
- # Makes the text window
- @sprites={}
- @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
- @viewport.z=99999
- @sprites["background"] = IconSprite.new(0,0)
- @sprites["background"].setBitmap("Graphics/Pictures/radiobg")
- @sprites["background"].z=255
- @sprites["needle"]=IconSprite.new(0,0,@viewport)
- @sprites["needle"].setBitmap("Graphics/Pictures/radioNeedle")
- if !$PokemonGlobal.station
- $PokemonGlobal.station=2
- end
- @sprites["needle"].x=316 + ($PokemonGlobal.station-2)*8
- @sprites["needle"].y=84
- @choices=[
- _INTL("0"),
- _INTL("1"),
- _INTL("2"),
- _INTL("3"),
- _INTL("4"),
- _INTL("5"),
- _INTL("6"),
- _INTL("7"),
- _INTL("8"),
- _INTL("9"),
- _INTL("10")
- ]
- @sprites["header"]=Window_UnformattedTextPokemon.newWithSize(_INTL("Radio"),
- 2,-18,128,64,@viewport)
- @sprites["header"].baseColor=Color.new(248,248,248)
- @sprites["header"].shadowColor=Color.new(0,0,0)
- @sprites["header"].windowskin=nil
- =begin
- @sprites["command_window"] = Window_CommandPokemon.new(@choices,324)
- @sprites["command_window"].windowskin=nil
- @sprites["command_window"].index = @menu_index
- @sprites["command_window"].height = 64#224
- @sprites["command_window"].width = 324
- @sprites["command_window"].x = 110
- @sprites["command_window"].y = 92
- @sprites["command_window"].z = 256
- =end
- @custom=false
- # Execute transition
- Graphics.transition
- # Main loop
- loop do
- # Update game screen
- Graphics.update
- # Update input information
- Input.update
- # Frame update
- update
- # Abort loop if screen is changed
- if $scene != self
- break
- end
- end
- # Prepares for transition
- Graphics.freeze
- # Disposes the windows
- pbDisposeSpriteHash(@sprites)
- @viewport.dispose
- end
- #-----------------------------------------------------------------------------
- # * Frame Update
- #-----------------------------------------------------------------------------
- def update
- # Update windows
- @sprites["needle"].x=316 + ($PokemonGlobal.station-2)*8
- pbUpdateSpriteHash(@sprites)
- update_command
- return
- end
- #-----------------------------------------------------------------------------
- # * Frame Update (when command window is active)
- #-----------------------------------------------------------------------------
- def updateCustom
- if Input.trigger?(Input::B)
- @sprites["command_window"].commands=@choices
- @sprites["command_window"].index=3
- @custom=false
- return
- end
- if Input.trigger?(Input::C)
- $PokemonMap.whiteFluteUsed=false if $PokemonMap
- $PokemonMap.blackFluteUsed=false if $PokemonMap
- if @sprites["command_window"].index==0
- $game_system.setDefaultBGM(nil)
- $game_map.autoplay
- else
- $game_system.setDefaultBGM(
- @sprites["command_window"].commands[@sprites["command_window"].index]
- )
- end
- end
- end
- def update_command
- # If B button was pressed
- if Input.trigger?(Input::B)
- pbPlayCancelSE()
- # Switch to map screen
- $scene = Scene_Pokegear.new
- return
- end
- if Input.trigger?(Input::LEFT)
- $PokemonGlobal.station-=1
- $PokemonGlobal.station = 2 if $PokemonGlobal.station < 2
- end
- if Input.trigger?(Input::RIGHT)
- $PokemonGlobal.station +=1
- $PokemonGlobal.station = 15 if $PokemonGlobal.station >15
- end
- # If C button was pressed
- #if Input.trigger?(Input::C)
- # Branch by command window cursor position
- pbPlayRadioStation($PokemonGlobal.station)
- case $PokemonGlobal.station
- when 4
- @sprites["header"]=Window_UnformattedTextPokemon.newWithSize(_INTL("Oak's Talkshow"),20,104,228,64,@viewport)
- when 7
- if pbIsWeekday(-1,0,2,4,6)
- @sprites["header"]=Window_UnformattedTextPokemon.newWithSize(_INTL("Pokémon March"),20,104,228,64,@viewport)
- else
- @sprites["header"]=Window_UnformattedTextPokemon.newWithSize(_INTL("Pokémon Lullaby"),20,104,228,64,@viewport)
- end
- when 8
- @sprites["header"]=Window_UnformattedTextPokemon.newWithSize(_INTL("Lottery Channel"),20,104,228,64,@viewport)
- when 11
- @sprites["header"]=Window_UnformattedTextPokemon.newWithSize(_INTL("Buena's Password"),20,104,228,64,@viewport)
- else
- @sprites["header"]=Window_UnformattedTextPokemon.newWithSize(_INTL(""),20,104,228,64,@viewport)
- end
- return
- end
- end
- def pbPlayRadioStation(stat)
- case stat
- when 4
- pbBGMPlay("Radio - Oak", 100, 100)
- $PokemonMap.whiteFluteUsed=false if $PokemonMap
- $PokemonMap.blackFluteUsed=false if $PokemonMap
- if !$PokemonTemp.radioline or $PokemonTemp.radioline>2
- $PokemonTemp.radioline=0
- $PokemonGlobal.dailypkmn=randpoke
- end
- msgwindow=Kernel.pbCreateMessageWindow
- Kernel.pbMessageDisplay(msgwindow,pokemessage($PokemonGlobal.dailypkmn,$PokemonTemp.radioline)+"\\wtnp[20]")
- Kernel.pbDisposeMessageWindow(msgwindow)
- $PokemonTemp.radioline+=1
- when 7
- if pbIsWeekday(-1,0,2,4,6)
- pbBGMPlay("Radio - March", 100, 100)
- $PokemonMap.whiteFluteUsed=true if $PokemonMap
- $PokemonMap.blackFluteUsed=false if $PokemonMap
- else
- pbBGMPlay("Radio - Lullaby", 100, 100)
- $PokemonMap.blackFluteUsed=true if $PokemonMap
- $PokemonMap.whiteFluteUsed=false if $PokemonMap
- end
- when 8
- pbBGMPlay("DL_Luckyno", 100, 100)
- $PokemonMap.whiteFluteUsed=false if $PokemonMap
- $PokemonMap.blackFluteUsed=false if $PokemonMap
- if !$PokemonTemp.radioline
- $PokemonTemp.radioline=0
- elsif $PokemonTemp.radioline>7
- $PokemonTemp.radioline=2
- end
- pbSetLotteryNumber
- msgwindow=Kernel.pbCreateMessageWindow
- msg=RADIO_LOTTO[$PokemonTemp.radioline]
- if msg==""
- msg = _INTL("{1}!",pbGet(1))
- end
- Kernel.pbMessageDisplay(msgwindow,msg+"\\wtnp[20]")
- Kernel.pbDisposeMessageWindow(msgwindow)
- $PokemonTemp.radioline+=1
- when 11
- pbBGMPlay("pkc_buena", 100, 100)
- $PokemonMap.whiteFluteUsed=false if $PokemonMap
- $PokemonMap.blackFluteUsed=false if $PokemonMap
- if !$PokemonTemp.radioline
- $PokemonTemp.radioline=0
- end
- if $PokemonTemp.radioline<=7 and PBDayNight.isBuenaTime?
- buenapassword
- msgwindow=Kernel.pbCreateMessageWindow
- msg=RADIO_BUENA[$PokemonTemp.radioline]
- if msg==""
- msg = _INTL("{1}!",pbGet(RADIO_BUENA_VARIABLE))
- end
- Kernel.pbMessageDisplay(msgwindow,msg+"\\wtnp[20]")
- Kernel.pbDisposeMessageWindow(msgwindow)
- $PokemonTemp.radioline+=1
- end
- else
- $game_map.autoplay
- $PokemonMap.whiteFluteUsed=false if $PokemonMap
- $PokemonMap.blackFluteUsed=false if $PokemonMap
- if !$PokemonTemp.radioline or $PokemonTemp.radioline>0
- $PokemonTemp.radioline=nil
- end
- end
- end
- def pokemessage(species,line)
- case line
- when 0
- return _INTL("\\xn[Oak]On their travels, some trainers may have seen {1}.",PBSpecies.getName(species))
- when 1 # Location
- encdata=load_data("Data/encounters.dat")
- for enc in encdata.keys.sort_by { rand }
- enctypes=encdata[enc][1]
- if pbFindEncounter(enctypes,species)
- return _INTL("\\xn[Oak]{1} can be found at {2}.",PBSpecies.getName(species),
- pbGetMessage(MessageTypes::MapNames,enc))
- end
- end
- return _INTL("\\xn[Oak]It's not easy to come across {1}.",PBSpecies.getName(species))
- when 2
- return _INTL("\\xn[Oak]In my opinion, {1} is {2} {3}",PBSpecies.getName(species),
- RADIO_MESSAGE_1[rand(RADIO_MESSAGE_1.size)],
- RADIO_MESSAGE_2[rand(RADIO_MESSAGE_2.size)])
- end
- end
- def randpoke
- ret=rand(PBSpecies.maxValue - 1) + 1
- # Implement blacklists here
- while !$Trainer.seen[ret]
- ret=rand(PBSpecies.maxValue - 1) + 1
- end
- return ret
- end
- def buenapassword
- if !$game_variables[RADIO_BUENA_VARIABLE] or $game_variables[RADIO_BUENA_VARIABLE].numeric?
- var=nil
- case rand(4)
- when 0 # Pokemon
- var=PBSpecies.getName(rand(PBSpecies.maxValue - 1) + 1)
- when 1 # Types
- var=rand(PBTypes.maxValue)
- while var == 9
- var=rand(PBTypes.maxValue)
- end
- var=PBTypes.getName(var)
- when 2 # Items
- var=PBItems.getName(rand(PBItems.maxValue - 1) + 1)
- when 3 # Abilities
- var=PBAbilities.getName(rand(PBAbilities.maxValue - 1) + 1)
- end
- $game_variables[RADIO_BUENA_VARIABLE]=var
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement