Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # The path to the Pokémon that will be shown at the near-ending of the intro.
- POKEMON_PATH = "Pictures/introMarill"
- # The background of the main part of the intro.
- BACKGROUND_PATH = "Pictures/introbg"
- # The path to the Professor's sprite.
- PROFESSOR_PATH = "Pictures/introOak"
- # The path to the base the Professor and the Pokémon stand on.
- PROFESSOR_BASE_PATH = "Pictures/introbase"
- # The path to the music played during the intro. Located in Audio/BGM.
- INTRO_MUSIC_PATH = "begin"
- # What the Professor says at the start of the intro.
- PROFESSOR_SPEECH_START = [
- "Hello! Sorry to keep you waiting!",
- :WAIT_20,
- "Welcome to the world of Pokémon!",
- "My name is Oak.",
- "People call me the Pokémon Professor.",
- :WAIT_16
- ]
- # The gender choices along with their sprites.
- GENDERS = [
- ["a", "boy", "Pictures/introBoy"],
- ["a", "girl", "Pictures/introGirl"]
- ]
- # Whether the Professor should offer basic help to the Player or not.
- PROFESSOR_SPEECH_OFFER_HELP = true
- # The path to the background that will be shown in the "Adventure" help option.
- PROFESSOR_SPEECH_HELP_BACKGROUND = "Pictures/helpadventurebg"
- # The text that will be displayed over the background above.
- PROFESSOR_SPEECH_ADVENTURE = [
- "You are about to enter a world where you will embark on a grand adventure of your very own.",
- "Speak to people and check things wherever you go, be it in towns, roads or caves.",
- "Gather information and hints from every possible source.",
- "New paths will open to you when you help people in need, overcome challenges, and solve mysteries.",
- "At times, you will be challenged by others to a battle.",
- "At other times, wild creatures may stand in your way. By overcoming such hurdles, you will gain great power.",
- "However, your adventure is not solely about becoming powerful.",
- "On your travels, we hope that you will meet countless people and, through them, achieve personal growth.",
- "This is the most important objective of this adventure."
- ]
- # What the Professor says at the end of his speech.
- PROFESSOR_SPEECH_END = [
- "This world is widely inhabited by creatures we call Pokémon.",
- "People and Pokémon live together by supporting each other.",
- "At times, we play with Pokémon, and at other times, we battle with them.",
- :FADE_OUT_POKEMON,
- :WAIT_4,
- "But despite our closeness, we don't know everything about Pokémon yet.",
- "There are still many mysteries to solve.",
- "That's why I study Pokémon every day.",
- :WAIT_10,
- :ASK_GENDER,
- :WAIT_20,
- "\\PN, are you ready?",
- "Your very own Pokémon story is about to unfold.",
- "You'll face fun times and tough challenges.",
- "A world of dreams and adventures with Pokémon awaits! Let's go!",
- :WAIT_30,
- "\\bEnjoy the Starter Kit. Give credit when using it." # = Essentials!
- ]
- #Miscellaneous text messages
- PROFESSOR_SPEECH_NEED_HELP = "If you need help, I am certainly capable of giving it."
- ASK_NAME_MESSAGE = "Now what did you say your name was?"
- CONFIRM_PLAYER_MESSAGE = "So this is you, \\PN?"
- def pbIntro
- raise _INTL("Cannot have less than two genders as option") if GENDERS.size < 2
- pbToneChangeAll(Tone.new(0,0,0,0),20)
- viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
- viewport.z = 99999
- sprites = {}
- sprites[:BG] = Sprite.new(viewport)
- bg = sprites[:BG]
- bg.bitmap = Bitmap.new("Graphics/#{BACKGROUND_PATH}")
- bg.opacity = 0
- bg.z = -1
- sprites[:BASE] = Sprite.new(viewport)
- base = sprites[:BASE]
- base.bitmap = Bitmap.new("Graphics/#{PROFESSOR_BASE_PATH}")
- base.opacity = 0
- base.ox = base.bitmap.width / 2
- base.x = Graphics.width / 2
- base.y = Graphics.height / 2 + 40
- base.z = 0
- sprites[:PROF] = Sprite.new(viewport)
- prof = sprites[:PROF]
- prof.bitmap = Bitmap.new("Graphics/#{PROFESSOR_PATH}")
- prof.opacity = 0
- prof.ox = prof.bitmap.width / 2
- prof.oy = prof.bitmap.height
- prof.x = Graphics.width / 2 - 8
- prof.y = Graphics.height / 2 + 64
- prof.z = 1
- pbBGMFade(2.0)
- pbBGMPlay(INTRO_MUSIC_PATH)
- 10.times do
- Graphics.update
- bg.opacity += 25.5
- end
- 32.times { Graphics.update }
- 32.times { Graphics.update; base.opacity += 8; prof.opacity += 8 }
- 32.times { Graphics.update }
- for msg in PROFESSOR_SPEECH_START
- if msg.to_s.include?("WAIT")
- pbWait(msg.to_s.split('_')[1].to_i)
- else
- Kernel.pbMessage(_INTL(msg))
- end
- end
- loop do
- break if !PROFESSOR_SPEECH_OFFER_HELP
- choice = Kernel.pbMessage(_INTL(PROFESSOR_SPEECH_NEED_HELP),[_INTL("Controls"),
- _INTL("Adventure"),_INTL("No Info Needed")])
- if choice == 0
- pbControlHelp
- elsif choice == 1
- Kernel.pbMessage(_INTL("Well then, without further ado..."))
- sprites[:BG_2] = Sprite.new(@viewport)
- bg2 = sprites[:BG_2]
- bg2.bitmap = Bitmap.new("Graphics/#{PROFESSOR_SPEECH_HELP_BACKGROUND}")
- bg2.opacity = 0
- 16.times {
- Graphics.update
- bg.opacity -= 16
- bg2.opacity += 16
- prof.opacity -= 16
- base.opacity -= 16
- }
- $game_system.message_position = 1
- $game_system.message_frame = 1
- for msg in PROFESSOR_SPEECH_ADVENTURE
- if msg.to_s.include?("WAIT")
- pbWait(msg.to_s.split('_')[1].to_i)
- else
- Kernel.pbMessage(_INTL("<ac>#{msg}</ac>"))
- end
- end
- $game_system.message_position = 2
- $game_system.message_frame = 0
- 16.times {
- Graphics.update
- bg.opacity += 16
- bg2.opacity -= 16
- prof.opacity += 16
- base.opacity += 16
- }
- else
- break
- end
- end
- 20.times { Graphics.update }
- sprites[:POKE] = Sprite.new(viewport)
- poke = sprites[:POKE]
- poke.bitmap = Bitmap.new("Graphics/#{POKEMON_PATH}")
- poke.ox = poke.bitmap.width / 2
- poke.oy = poke.bitmap.height
- poke.x = Graphics.width / 2
- poke.y = Graphics.height / 2 + 64
- poke.z = 2
- poke.opacity = 0
- 16.times { Graphics.update; prof.opacity -= 16}
- 16.times { Graphics.update; poke.opacity += 16 }
- for msg in PROFESSOR_SPEECH_END
- if msg.to_s.include?("WAIT")
- pbWait(msg.to_s.split('_')[1].to_i)
- elsif msg == :FADE_OUT_POKEMON
- 16.times {
- Graphics.update
- prof.opacity += 16
- poke.opacity -= 16
- }
- elsif msg == :ASK_GENDER
- sprites[:CHAR] = Sprite.new(viewport)
- char = sprites[:CHAR]
- genders = []
- for gender in GENDERS
- genders.push(_INTL(gender[1].capitalize))
- end
- msg = "Are you "
- if GENDERS.size > 2
- for i in 0...GENDERS.size
- if i != GENDERS.size - 1
- msg += "#{GENDERS[i][0]} #{GENDERS[i][1]}, "
- else
- msg += "or #{GENDERS[i][0]} #{GENDERS[i][1]}?"
- end
- end
- else
- msg += "#{GENDERS[0][0]} #{GENDERS[0][1]} or #{GENDERS[1][0]} #{GENDERS[1][1]}?"
- end
- 32.times {
- Graphics.update
- prof.opacity -= 8
- base.opacity -= 8
- }
- loop do
- pbWait(4)
- gender = Kernel.pbMessage(_INTL(msg), genders)
- pbChangePlayer(gender)
- char.bitmap = Bitmap.new("Graphics/#{GENDERS[gender][2]}")
- char.ox = char.bitmap.width / 2
- char.oy = char.bitmap.height
- char.x = Graphics.width / 2
- char.y = Graphics.height / 2 + 64
- char.opacity = 0
- 16.times { Graphics.update; char.opacity += 16; base.opacity += 16 }
- Kernel.pbMessage(_INTL(ASK_NAME_MESSAGE))
- pbTrainerName
- if Kernel.pbConfirmMessage(_INTL(CONFIRM_PLAYER_MESSAGE))
- break
- else
- 32.times { Graphics.update; char.opacity -= 8; base.opacity -= 8}
- end
- end
- else
- Kernel.pbMessage(_INTL(msg))
- end
- end
- pbFadeOutAndHide(sprites) { pbBGMFade(2.0) }
- pbDisposeSpriteHash(sprites)
- viewport.dispose
- end
- def pbControlHelp
- vp=Viewport.new(0,0,Graphics.width,Graphics.height)
- vp.z=99999; sp={}
- sp[:bg]=Sprite.new(vp)
- sp[:bg].bitmap=Bitmap.new("Graphics/Pictures/helpbg")
- sp[:bg].opacity=0
- sp[:bmp]=BitmapSprite.new(Graphics.width, Graphics.height, vp)
- sp[:bmp].opacity=0
- bmp=sp[:bmp].bitmap
- pbSetSystemFont(bmp)
- b=Color.new(255,255,255)
- s=Color.new(166,166,166)
- drawTextEx(bmp,112,32,400,2,"Moves the main character. Also used to scroll through list entries.",b,s)
- sp[:dir]=Sprite.new(vp)
- sp[:dir].bitmap=Bitmap.new("Graphics/Pictures/helpArrowKeys")
- sp[:dir].x = 18;sp[:dir].y=42;sp[:dir].opacity=0
- drawTextEx(bmp,112,110,400,2,"Used to confirm a choice, check things, and talk to people.",b,s)
- sp[:c]=Sprite.new(vp)
- sp[:c].bitmap=Bitmap.new("Graphics/Pictures/helpCkey")
- sp[:c].x=34;sp[:c].y=120;sp[:c].opacity=0
- drawTextEx(bmp,112,188,400,2,"Used to exit, cancel a choice or mode, and open the pause menu.",b,s)
- sp[:x]=Sprite.new(vp)
- sp[:x].bitmap=Bitmap.new("Graphics/Pictures/helpXkey")
- sp[:x].x=34;sp[:x].y=198;sp[:x].opacity=0
- drawTextEx(bmp,112,266,400,2,"Hold down while walking to run.",b,s)
- sp[:z]=Sprite.new(vp)
- sp[:z].bitmap=Bitmap.new("Graphics/Pictures/helpZkey")
- sp[:z].x=34;sp[:z].y=262;sp[:z].opacity=0
- drawTextEx(bmp,112,320,400,2,"Press to use a registered Key Item.",b,s)
- sp[:f5]=Sprite.new(vp)
- sp[:f5].bitmap=Bitmap.new("Graphics/Pictures/helpF5key")
- sp[:f5].x=34;sp[:f5].y=316;sp[:f5].opacity=0
- 16.times{Graphics.update;sp.each{|k,v|v.opacity+=16}}
- loop {
- Input.update
- Graphics.update
- if Input.trigger?(Input::C) || Input.trigger?(Input::B)
- 16.times{Graphics.update;sp.each{|k,v|v.opacity-=16}}
- pbDisposeSpriteHash(sp)
- vp.dispose
- break
- end
- }
- end
Add Comment
Please, Sign In to add comment