mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Initial commit
This commit is contained in:
239
Data/Scripts/009_Scenes/001_Scene_Map.rb
Normal file
239
Data/Scripts/009_Scenes/001_Scene_Map.rb
Normal file
@@ -0,0 +1,239 @@
|
||||
#===============================================================================
|
||||
# ** Modified Scene_Map class for Pokémon.
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
#===============================================================================
|
||||
class Scene_Map
|
||||
attr_reader :spritesetGlobal
|
||||
|
||||
def spriteset
|
||||
for i in @spritesets.values
|
||||
return i if i.map==$game_map
|
||||
end
|
||||
return @spritesets.values[0]
|
||||
end
|
||||
|
||||
def createSpritesets
|
||||
@spritesetGlobal = Spriteset_Global.new
|
||||
@spritesets = {}
|
||||
for map in $MapFactory.maps
|
||||
@spritesets[map.map_id] = Spriteset_Map.new(map)
|
||||
end
|
||||
$MapFactory.setSceneStarted(self)
|
||||
updateSpritesets
|
||||
end
|
||||
|
||||
def createSingleSpriteset(map)
|
||||
temp = $scene.spriteset.getAnimations
|
||||
@spritesets[map] = Spriteset_Map.new($MapFactory.maps[map])
|
||||
$scene.spriteset.restoreAnimations(temp)
|
||||
$MapFactory.setSceneStarted(self)
|
||||
updateSpritesets
|
||||
end
|
||||
|
||||
def disposeSpritesets
|
||||
return if !@spritesets
|
||||
for i in @spritesets.keys
|
||||
next if !@spritesets[i]
|
||||
@spritesets[i].dispose
|
||||
@spritesets[i] = nil
|
||||
end
|
||||
@spritesets.clear
|
||||
@spritesets = {}
|
||||
@spritesetGlobal.dispose
|
||||
@spritesetGlobal = nil
|
||||
end
|
||||
|
||||
def autofade(mapid)
|
||||
playingBGM = $game_system.playing_bgm
|
||||
playingBGS = $game_system.playing_bgs
|
||||
return if !playingBGM && !playingBGS
|
||||
map = pbLoadRxData(sprintf("Data/Map%03d",mapid))
|
||||
if playingBGM && map.autoplay_bgm
|
||||
if (PBDayNight.isNight? rescue false)
|
||||
pbBGMFade(0.8) if playingBGM.name!=map.bgm.name && playingBGM.name!=map.bgm.name+"_n"
|
||||
else
|
||||
pbBGMFade(0.8) if playingBGM.name!=map.bgm.name
|
||||
end
|
||||
end
|
||||
if playingBGS && map.autoplay_bgs
|
||||
pbBGMFade(0.8) if playingBGS.name!=map.bgs.name
|
||||
end
|
||||
Graphics.frame_reset
|
||||
end
|
||||
|
||||
def transfer_player(cancelVehicles=true)
|
||||
$game_temp.player_transferring = false
|
||||
pbCancelVehicles($game_temp.player_new_map_id) if cancelVehicles
|
||||
autofade($game_temp.player_new_map_id)
|
||||
pbBridgeOff
|
||||
if $game_map.map_id!=$game_temp.player_new_map_id
|
||||
$MapFactory.setup($game_temp.player_new_map_id)
|
||||
end
|
||||
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
|
||||
case $game_temp.player_new_direction
|
||||
when 2; $game_player.turn_down
|
||||
when 4; $game_player.turn_left
|
||||
when 6; $game_player.turn_right
|
||||
when 8; $game_player.turn_up
|
||||
end
|
||||
$game_player.straighten
|
||||
$game_map.update
|
||||
disposeSpritesets
|
||||
GC.start
|
||||
createSpritesets
|
||||
if $game_temp.transition_processing
|
||||
$game_temp.transition_processing = false
|
||||
Graphics.transition(20)
|
||||
end
|
||||
$game_map.autoplay
|
||||
Graphics.frame_reset
|
||||
Input.update
|
||||
end
|
||||
|
||||
def call_name
|
||||
$game_temp.name_calling = false
|
||||
$game_player.straighten
|
||||
$game_map.update
|
||||
end
|
||||
|
||||
def call_menu
|
||||
$game_temp.menu_calling = false
|
||||
$game_temp.in_menu = true
|
||||
$game_player.straighten
|
||||
$game_map.update
|
||||
sscene = PokemonPauseMenu_Scene.new
|
||||
sscreen = PokemonPauseMenu.new(sscene)
|
||||
sscreen.pbStartPokemonMenu
|
||||
$game_temp.in_menu = false
|
||||
end
|
||||
|
||||
def call_debug
|
||||
$game_temp.debug_calling = false
|
||||
pbPlayDecisionSE
|
||||
$game_player.straighten
|
||||
pbFadeOutIn { pbDebugMenu }
|
||||
end
|
||||
|
||||
def miniupdate
|
||||
$PokemonTemp.miniupdate = true
|
||||
loop do
|
||||
updateMaps
|
||||
$game_player.update
|
||||
$game_system.update
|
||||
$game_screen.update
|
||||
break unless $game_temp.player_transferring
|
||||
transfer_player
|
||||
break if $game_temp.transition_processing
|
||||
end
|
||||
updateSpritesets
|
||||
$PokemonTemp.miniupdate = false
|
||||
end
|
||||
|
||||
def updateMaps
|
||||
for map in $MapFactory.maps
|
||||
map.update
|
||||
end
|
||||
$MapFactory.updateMaps(self)
|
||||
end
|
||||
|
||||
def updateSpritesets
|
||||
@spritesets = {} if !@spritesets
|
||||
keys = @spritesets.keys.clone
|
||||
for i in keys
|
||||
if !$MapFactory.hasMap?(i)
|
||||
@spritesets[i].dispose if @spritesets[i]
|
||||
@spritesets[i] = nil
|
||||
@spritesets.delete(i)
|
||||
else
|
||||
@spritesets[i].update
|
||||
end
|
||||
end
|
||||
@spritesetGlobal.update
|
||||
for map in $MapFactory.maps
|
||||
@spritesets[map.map_id] = Spriteset_Map.new(map) if !@spritesets[map.map_id]
|
||||
end
|
||||
Events.onMapUpdate.trigger(self)
|
||||
end
|
||||
|
||||
def update
|
||||
loop do
|
||||
updateMaps
|
||||
pbMapInterpreter.update
|
||||
$game_player.update
|
||||
$game_system.update
|
||||
$game_screen.update
|
||||
break unless $game_temp.player_transferring
|
||||
transfer_player
|
||||
break if $game_temp.transition_processing
|
||||
end
|
||||
updateSpritesets
|
||||
if $game_temp.to_title
|
||||
$scene = pbCallTitle
|
||||
return
|
||||
end
|
||||
if $game_temp.transition_processing
|
||||
$game_temp.transition_processing = false
|
||||
if $game_temp.transition_name == ""
|
||||
Graphics.transition(20)
|
||||
else
|
||||
Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name)
|
||||
end
|
||||
end
|
||||
return if $game_temp.message_window_showing
|
||||
if !pbMapInterpreterRunning?
|
||||
if Input.trigger?(Input::C)
|
||||
$PokemonTemp.hiddenMoveEventCalling = true
|
||||
elsif Input.trigger?(Input::B)
|
||||
unless $game_system.menu_disabled or $game_player.moving?
|
||||
$game_temp.menu_calling = true
|
||||
$game_temp.menu_beep = true
|
||||
end
|
||||
elsif Input.trigger?(Input::F5)
|
||||
unless $game_player.moving?
|
||||
$PokemonTemp.keyItemCalling = true
|
||||
end
|
||||
elsif Input.trigger?(Input::A)
|
||||
if $PokemonSystem.runstyle==1
|
||||
$PokemonGlobal.runtoggle = !$PokemonGlobal.runtoggle
|
||||
end
|
||||
elsif Input.press?(Input::F9)
|
||||
$game_temp.debug_calling = true if $DEBUG
|
||||
end
|
||||
end
|
||||
unless $game_player.moving?
|
||||
if $game_temp.name_calling; call_name
|
||||
elsif $game_temp.menu_calling; call_menu
|
||||
elsif $game_temp.debug_calling; call_debug
|
||||
# elsif $game_temp.battle_calling; call_battle
|
||||
# elsif $game_temp.shop_calling; call_shop
|
||||
# elsif $game_temp.save_calling; call_save
|
||||
elsif $PokemonTemp.keyItemCalling
|
||||
$PokemonTemp.keyItemCalling = false
|
||||
$game_player.straighten
|
||||
pbUseKeyItem
|
||||
elsif $PokemonTemp.hiddenMoveEventCalling
|
||||
$PokemonTemp.hiddenMoveEventCalling = false
|
||||
$game_player.straighten
|
||||
Events.onAction.trigger(self)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def main
|
||||
createSpritesets
|
||||
Graphics.transition(20)
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
update
|
||||
break if $scene != self
|
||||
end
|
||||
Graphics.freeze
|
||||
disposeSpritesets
|
||||
if $game_temp.to_title
|
||||
Graphics.transition(20)
|
||||
Graphics.freeze
|
||||
end
|
||||
end
|
||||
end
|
||||
134
Data/Scripts/009_Scenes/002_Scene_Intro.rb
Normal file
134
Data/Scripts/009_Scenes/002_Scene_Intro.rb
Normal file
@@ -0,0 +1,134 @@
|
||||
class IntroEventScene < EventScene
|
||||
TICKS_PER_PIC = 40 # 20 ticks per second, so 2 seconds
|
||||
TICKS_PER_ENTER_FLASH = 40
|
||||
FADE_TICKS = 8
|
||||
|
||||
def initialize(pics,splash,viewport=nil)
|
||||
super(nil)
|
||||
@pics = pics
|
||||
@splash = splash
|
||||
@pic = addImage(0,0,"")
|
||||
@pic.setOpacity(0,0) # set opacity to 0 after waiting 0 frames
|
||||
@pic2 = addImage(0,0,"") # flashing "Press Enter" picture
|
||||
@pic2.setOpacity(0,0)
|
||||
@index = 0
|
||||
data_system = pbLoadRxData("Data/System")
|
||||
pbBGMPlay(data_system.title_bgm)
|
||||
openPic(self,nil)
|
||||
end
|
||||
|
||||
def openPic(scene,args)
|
||||
onCTrigger.clear
|
||||
@pic.name = "Graphics/Titles/"+@pics[@index]
|
||||
# fade to opacity 255 in FADE_TICKS ticks after waiting 0 frames
|
||||
@pic.moveOpacity(0,FADE_TICKS,255)
|
||||
pictureWait
|
||||
@timer = 0 # reset the timer
|
||||
onUpdate.set(method(:picUpdate)) # call picUpdate every frame
|
||||
onCTrigger.set(method(:closePic)) # call closePic when C key is pressed
|
||||
end
|
||||
|
||||
def closePic(scene,args)
|
||||
onUpdate.clear
|
||||
onCTrigger.clear
|
||||
@pic.moveOpacity(0,FADE_TICKS,0)
|
||||
pictureWait
|
||||
@index += 1 # Move to the next picture
|
||||
if @index>=@pics.length
|
||||
openSplash(scene,args)
|
||||
else
|
||||
openPic(scene,args)
|
||||
end
|
||||
end
|
||||
|
||||
def picUpdate(scene,args)
|
||||
@timer += 1
|
||||
if @timer>TICKS_PER_PIC*Graphics.frame_rate/20
|
||||
@timer = 0
|
||||
closePic(scene,args) # Close the picture
|
||||
end
|
||||
end
|
||||
|
||||
def openSplash(scene,args)
|
||||
onUpdate.clear
|
||||
onCTrigger.clear
|
||||
@pic.name = "Graphics/Titles/"+@splash
|
||||
@pic.moveOpacity(0,FADE_TICKS,255)
|
||||
@pic2.name = "Graphics/Titles/start"
|
||||
@pic2.setXY(0,0,322)
|
||||
@pic2.setVisible(0,true)
|
||||
@pic2.moveOpacity(0,FADE_TICKS,255)
|
||||
pictureWait
|
||||
onUpdate.set(method(:splashUpdate)) # call splashUpdate every frame
|
||||
onCTrigger.set(method(:closeSplash)) # call closeSplash when C key is pressed
|
||||
end
|
||||
|
||||
def closeSplash(scene,args)
|
||||
onUpdate.clear
|
||||
onCTrigger.clear
|
||||
# Play random cry
|
||||
cry = pbCryFile(1+rand(PBSpecies.maxValue))
|
||||
pbSEPlay(cry,80,100) if cry
|
||||
@pic.moveXY(0,20,0,0)
|
||||
pictureWait
|
||||
# Fade out
|
||||
@pic.moveOpacity(0,FADE_TICKS,0)
|
||||
@pic2.clearProcesses
|
||||
@pic2.moveOpacity(0,FADE_TICKS,0)
|
||||
pbBGMStop(1.0)
|
||||
pictureWait
|
||||
scene.dispose # Close the scene
|
||||
sscene = PokemonLoad_Scene.new
|
||||
sscreen = PokemonLoadScreen.new(sscene)
|
||||
sscreen.pbStartLoadScreen
|
||||
end
|
||||
|
||||
def closeSplashDelete(scene,args)
|
||||
onUpdate.clear
|
||||
onCTrigger.clear
|
||||
# Play random cry
|
||||
cry = pbCryFile(1+rand(PBSpecies.maxValue))
|
||||
pbSEPlay(cry,80,100) if cry
|
||||
@pic.moveXY(0,20,0,0)
|
||||
pictureWait
|
||||
# Fade out
|
||||
@pic.moveOpacity(0,FADE_TICKS,0)
|
||||
@pic2.clearProcesses
|
||||
@pic2.moveOpacity(0,FADE_TICKS,0)
|
||||
pbBGMStop(1.0)
|
||||
pictureWait
|
||||
scene.dispose # Close the scene
|
||||
sscene = PokemonLoad_Scene.new
|
||||
sscreen = PokemonLoadScreen.new(sscene)
|
||||
sscreen.pbStartDeleteScreen
|
||||
end
|
||||
|
||||
def splashUpdate(scene,args)
|
||||
# Flashing of "Press Enter" picture
|
||||
if !@pic2.running?
|
||||
@pic2.moveOpacity(TICKS_PER_ENTER_FLASH*2/10,TICKS_PER_ENTER_FLASH*4/10,0)
|
||||
@pic2.moveOpacity(TICKS_PER_ENTER_FLASH*6/10,TICKS_PER_ENTER_FLASH*4/10,255)
|
||||
end
|
||||
if Input.press?(Input::DOWN) &&
|
||||
Input.press?(Input::B) &&
|
||||
Input.press?(Input::CTRL)
|
||||
closeSplashDelete(scene,args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class Scene_Intro
|
||||
def initialize(pics, splash = nil)
|
||||
@pics = pics
|
||||
@splash = splash
|
||||
end
|
||||
|
||||
def main
|
||||
Graphics.transition(0)
|
||||
@eventscene = IntroEventScene.new(@pics,@splash)
|
||||
@eventscene.main
|
||||
Graphics.freeze
|
||||
end
|
||||
end
|
||||
46
Data/Scripts/009_Scenes/003_Scene_Controls.rb
Normal file
46
Data/Scripts/009_Scenes/003_Scene_Controls.rb
Normal file
@@ -0,0 +1,46 @@
|
||||
#==============================================================================
|
||||
# * Scene_Controls
|
||||
#------------------------------------------------------------------------------
|
||||
# Shows a help screen listing the keyboard controls.
|
||||
# Display with:
|
||||
# pbEventScreen(ButtonEventScene)
|
||||
#==============================================================================
|
||||
class ButtonEventScene < EventScene
|
||||
def initialize(viewport=nil)
|
||||
super
|
||||
Graphics.freeze
|
||||
addImage(0,0,"Graphics/Pictures/helpbg")
|
||||
@labels=[
|
||||
addLabel(52*2,13*2,Graphics.width*3/4,_INTL("Moves the main character. Also used to scroll through list entries.")),
|
||||
addLabel(52*2,53*2,Graphics.width*3/4,_INTL("Used to confirm a choice, check things, and talk to people.")),
|
||||
addLabel(52*2,93*2,Graphics.width*3/4,_INTL("Used to exit, cancel a choice or mode, and open the pause menu.")),
|
||||
addLabel(52*2,133*2,Graphics.width*3/4,_INTL("Hold down while walking to run.")),
|
||||
addLabel(52*2,157*2,Graphics.width*3/4,_INTL("Press to use a registered Key Item."))
|
||||
]
|
||||
@keys=[
|
||||
addImage(26*2,18*2,"Graphics/Pictures/helpArrowKeys"),
|
||||
addImage(26*2,59*2,"Graphics/Pictures/helpCkey"),
|
||||
addImage(26*2,99*2,"Graphics/Pictures/helpXkey"),
|
||||
addImage(26*2,130*2,"Graphics/Pictures/helpZkey"),
|
||||
addImage(26*2,154*2,"Graphics/Pictures/helpFkey")
|
||||
]
|
||||
for key in @keys
|
||||
key.origin=PictureOrigin::Top
|
||||
end
|
||||
for i in 0...5 # Make everything show (almost) immediately
|
||||
@keys[i].setOrigin(0,PictureOrigin::Top)
|
||||
@keys[i].setOpacity(0,255)
|
||||
end
|
||||
pictureWait # Update event scene with the changes
|
||||
Graphics.transition(20)
|
||||
# Go to next screen when user presses C
|
||||
onCTrigger.set(method(:pbOnScreen1))
|
||||
end
|
||||
|
||||
def pbOnScreen1(scene,args)
|
||||
# End scene
|
||||
Graphics.freeze
|
||||
scene.dispose
|
||||
Graphics.transition(20)
|
||||
end
|
||||
end
|
||||
52
Data/Scripts/009_Scenes/004_Scene_Movie.rb
Normal file
52
Data/Scripts/009_Scenes/004_Scene_Movie.rb
Normal file
@@ -0,0 +1,52 @@
|
||||
#===============================================================================
|
||||
# ** Scene_Movie class, created by SoundSpawn, fixed by Popper.
|
||||
#-------------------------------------------------------------------------------
|
||||
# Instruction
|
||||
# 1) Movies must be in a new folder called "Movies" in your directory.
|
||||
# 2) If you call this script from an event, e.g.
|
||||
# Call Script: $scene = Scene_Movie.new("INTRO")
|
||||
# 3) Have fun playing movies with this script!
|
||||
#===============================================================================
|
||||
class Scene_Movie
|
||||
def initialize(movie)
|
||||
@movie_name = RTP.getPath("Movies\\"+movie+".avi").gsub(/\//,"\\")
|
||||
end
|
||||
|
||||
def main
|
||||
@temp = Win32API.pbFindRgssWindow.to_s
|
||||
movie = Win32API.new('winmm','mciSendString','%w(p,p,l,l)','V')
|
||||
x=movie.call("open \""+@movie_name+
|
||||
"\" alias FILE style 1073741824 parent " + @temp.to_s,0,0,0)
|
||||
@message = Win32API.new('user32','SendMessage','%w(l,l,l,l)','V')
|
||||
@detector = Win32API.new('user32','GetSystemMetrics','%w(l)','L')
|
||||
@width = @detector.call(0)
|
||||
if @width == 640
|
||||
#fullscreen
|
||||
Graphics.update
|
||||
sleep(0.1)
|
||||
Graphics.update
|
||||
sleep(0.1)
|
||||
Graphics.update
|
||||
sleep(0.1)
|
||||
#fullscreen
|
||||
end
|
||||
status = " " * 255
|
||||
x=movie.call("play FILE",0,0,0)
|
||||
loop do
|
||||
sleep(0.1)
|
||||
@message.call(@temp.to_i,11,0,0)
|
||||
Graphics.update
|
||||
@message.call(@temp.to_i,11,1,0)
|
||||
Input.update
|
||||
movie.call("status FILE mode",status,255,0)
|
||||
true_status = status.unpack("aaaa")
|
||||
break if true_status.to_s != "play"
|
||||
if Input.trigger?(Input::B)
|
||||
movie.call("close FILE",0,0,0)
|
||||
$scene = Scene_Map.new
|
||||
break
|
||||
end
|
||||
end
|
||||
$scene = Scene_Map.new
|
||||
end
|
||||
end
|
||||
231
Data/Scripts/009_Scenes/005_Scene_Credits.rb
Normal file
231
Data/Scripts/009_Scenes/005_Scene_Credits.rb
Normal file
@@ -0,0 +1,231 @@
|
||||
# Backgrounds to show in credits. Found in Graphics/Titles/ folder
|
||||
CreditsBackgroundList = ["credits1","credits2","credits3","credits4","credits5"]
|
||||
CreditsMusic = "Credits"
|
||||
CreditsScrollSpeed = 2
|
||||
CreditsFrequency = 9 # Number of seconds per credits slide
|
||||
CREDITS_OUTLINE = Color.new(0,0,128, 255)
|
||||
CREDITS_SHADOW = Color.new(0,0,0, 100)
|
||||
CREDITS_FILL = Color.new(255,255,255, 255)
|
||||
|
||||
#==============================================================================
|
||||
# * Scene_Credits
|
||||
#------------------------------------------------------------------------------
|
||||
# Scrolls the credits you make below. Original Author unknown.
|
||||
#
|
||||
## Edited by MiDas Mike so it doesn't play over the Title, but runs by calling
|
||||
# the following:
|
||||
# $scene = Scene_Credits.new
|
||||
#
|
||||
## New Edit 3/6/2007 11:14 PM by AvatarMonkeyKirby.
|
||||
# Ok, what I've done is changed the part of the script that was supposed to make
|
||||
# the credits automatically end so that way they actually end! Yes, they will
|
||||
# actually end when the credits are finished! So, that will make the people you
|
||||
# should give credit to now is: Unknown, MiDas Mike, and AvatarMonkeyKirby.
|
||||
# -sincerly yours,
|
||||
# Your Beloved
|
||||
# Oh yea, and I also added a line of code that fades out the BGM so it fades
|
||||
# sooner and smoother.
|
||||
#
|
||||
## New Edit 24/1/2012 by Maruno.
|
||||
# Added the ability to split a line into two halves with <s>, with each half
|
||||
# aligned towards the centre. Please also credit me if used.
|
||||
#
|
||||
## New Edit 22/2/2012 by Maruno.
|
||||
# Credits now scroll properly when played with a zoom factor of 0.5. Music can
|
||||
# now be defined. Credits can't be skipped during their first play.
|
||||
#
|
||||
## New Edit 25/3/2020 by Maruno.
|
||||
# Scroll speed is now independent of frame rate. Now supports non-integer values
|
||||
# for CreditsScrollSpeed.
|
||||
#
|
||||
## New Edit 21/8/2020 by Marin.
|
||||
# Now automatically inserts the credits from the plugins that have been
|
||||
# registered through the PluginManager module.
|
||||
#==============================================================================
|
||||
|
||||
class Scene_Credits
|
||||
|
||||
# This next piece of code is the credits.
|
||||
#Start Editing
|
||||
CREDIT=<<_END_
|
||||
|
||||
Your credits go here.
|
||||
|
||||
Your credits go here.
|
||||
|
||||
Your credits go here.
|
||||
|
||||
Your credits go here.
|
||||
|
||||
Your credits go here.
|
||||
|
||||
{INSERTS_PLUGIN_CREDITS_DO_NOT_REMOVE}
|
||||
"Pokémon Essentials" was created by:
|
||||
Flameguru
|
||||
Poccil (Peter O.)
|
||||
Maruno
|
||||
|
||||
With contributions from:
|
||||
AvatarMonkeyKirby<s>Marin
|
||||
Boushy<s>MiDas Mike
|
||||
Brother1440<s>Near Fantastica
|
||||
FL.<s>PinkMan
|
||||
Genzai Kawakami<s>Popper
|
||||
help-14<s>Rataime
|
||||
IceGod64<s>SoundSpawn
|
||||
Jacob O. Wobbrock<s>the__end
|
||||
KitsuneKouta<s>Venom12
|
||||
Lisa Anthony<s>Wachunga
|
||||
Luka S.J.<s>
|
||||
and everyone else who helped out
|
||||
|
||||
|
||||
|
||||
"RPG Maker XP" by:
|
||||
Enterbrain
|
||||
|
||||
Pokémon is owned by:
|
||||
The Pokémon Company
|
||||
Nintendo
|
||||
Affiliated with Game Freak
|
||||
|
||||
This is a non-profit fan-made game.
|
||||
No copyright infringements intended.
|
||||
Please support the official games!
|
||||
|
||||
_END_
|
||||
#Stop Editing
|
||||
|
||||
def main
|
||||
#-------------------------------
|
||||
# Animated Background Setup
|
||||
#-------------------------------
|
||||
@sprite = IconSprite.new(0,0)
|
||||
@backgroundList = CreditsBackgroundList
|
||||
@frameCounter = 0
|
||||
# Number of game frames per background frame
|
||||
@framesPerBackground = CreditsFrequency * Graphics.frame_rate
|
||||
@sprite.setBitmap("Graphics/Titles/"+@backgroundList[0])
|
||||
#------------------
|
||||
# Credits text Setup
|
||||
#------------------
|
||||
plugin_credits = ""
|
||||
PluginManager.plugins.each do |plugin|
|
||||
pcred = PluginManager.credits(plugin)
|
||||
plugin_credits << "\"#{plugin}\" version #{PluginManager.version(plugin)}\n"
|
||||
if pcred.size >= 5
|
||||
plugin_credits << pcred[0] + "\n"
|
||||
i = 1
|
||||
until i >= pcred.size
|
||||
plugin_credits << pcred[i] + "<s>" + (pcred[i + 1] || "") + "\n"
|
||||
i += 2
|
||||
end
|
||||
else
|
||||
pcred.each do |name|
|
||||
plugin_credits << name + "\n"
|
||||
end
|
||||
end
|
||||
plugin_credits << "\n"
|
||||
end
|
||||
CREDIT.gsub!(/{INSERTS_PLUGIN_CREDITS_DO_NOT_REMOVE}/, plugin_credits)
|
||||
credit_lines = CREDIT.split(/\n/)
|
||||
credit_bitmap = Bitmap.new(Graphics.width,32 * credit_lines.size)
|
||||
credit_lines.each_index do |i|
|
||||
line = credit_lines[i]
|
||||
line = line.split("<s>")
|
||||
# LINE ADDED: If you use in your own game, you should remove this line
|
||||
pbSetSystemFont(credit_bitmap) # <--- This line was added
|
||||
x = 0
|
||||
xpos = 0
|
||||
align = 1 # Centre align
|
||||
linewidth = Graphics.width
|
||||
for j in 0...line.length
|
||||
if line.length>1
|
||||
xpos = (j==0) ? 0 : 20 + Graphics.width/2
|
||||
align = (j==0) ? 2 : 0 # Right align : left align
|
||||
linewidth = Graphics.width/2 - 20
|
||||
end
|
||||
credit_bitmap.font.color = CREDITS_SHADOW
|
||||
credit_bitmap.draw_text(xpos,i * 32 + 8,linewidth,32,line[j],align)
|
||||
credit_bitmap.font.color = CREDITS_OUTLINE
|
||||
credit_bitmap.draw_text(xpos + 2,i * 32 - 2,linewidth,32,line[j],align)
|
||||
credit_bitmap.draw_text(xpos,i * 32 - 2,linewidth,32,line[j],align)
|
||||
credit_bitmap.draw_text(xpos - 2,i * 32 - 2,linewidth,32,line[j],align)
|
||||
credit_bitmap.draw_text(xpos + 2,i * 32,linewidth,32,line[j],align)
|
||||
credit_bitmap.draw_text(xpos - 2,i * 32,linewidth,32,line[j],align)
|
||||
credit_bitmap.draw_text(xpos + 2,i * 32 + 2,linewidth,32,line[j],align)
|
||||
credit_bitmap.draw_text(xpos,i * 32 + 2,linewidth,32,line[j],align)
|
||||
credit_bitmap.draw_text(xpos - 2,i * 32 + 2,linewidth,32,line[j],align)
|
||||
credit_bitmap.font.color = CREDITS_FILL
|
||||
credit_bitmap.draw_text(xpos,i * 32,linewidth,32,line[j],align)
|
||||
end
|
||||
end
|
||||
@trim = Graphics.height/10
|
||||
@realOY = -(Graphics.height-@trim) # -430
|
||||
@oyChangePerFrame = CreditsScrollSpeed*20.0/Graphics.frame_rate
|
||||
@credit_sprite = Sprite.new(Viewport.new(0,@trim,Graphics.width,Graphics.height-(@trim*2)))
|
||||
@credit_sprite.bitmap = credit_bitmap
|
||||
@credit_sprite.z = 9998
|
||||
@credit_sprite.oy = @realOY
|
||||
@bg_index = 0
|
||||
@zoom_adjustment = 1.0/$ResizeFactor
|
||||
@last_flag = false
|
||||
#--------
|
||||
# Setup
|
||||
#--------
|
||||
# Stops all audio but background music
|
||||
previousBGM = $game_system.getPlayingBGM
|
||||
pbMEStop
|
||||
pbBGSStop
|
||||
pbSEStop
|
||||
pbBGMFade(2.0)
|
||||
pbBGMPlay(CreditsMusic)
|
||||
Graphics.transition(20)
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
update
|
||||
break if $scene != self
|
||||
end
|
||||
Graphics.freeze
|
||||
@sprite.dispose
|
||||
@credit_sprite.dispose
|
||||
$PokemonGlobal.creditsPlayed = true
|
||||
pbBGMPlay(previousBGM)
|
||||
end
|
||||
|
||||
# Check if the credits should be cancelled
|
||||
def cancel?
|
||||
if Input.trigger?(Input::C) && $PokemonGlobal.creditsPlayed
|
||||
$scene = Scene_Map.new
|
||||
pbBGMFade(1.0)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# Checks if credits bitmap has reached its ending point
|
||||
def last?
|
||||
if @realOY > @credit_sprite.bitmap.height + @trim
|
||||
$scene = ($game_map) ? Scene_Map.new : nil
|
||||
pbBGMFade(2.0)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
def update
|
||||
@frameCounter += 1
|
||||
# Go to next slide
|
||||
if @frameCounter >= @framesPerBackground
|
||||
@frameCounter -= @framesPerBackground
|
||||
@bg_index += 1
|
||||
@bg_index = 0 if @bg_index >= @backgroundList.length
|
||||
@sprite.setBitmap("Graphics/Titles/"+@backgroundList[@bg_index])
|
||||
end
|
||||
return if cancel?
|
||||
return if last?
|
||||
@realOY += @oyChangePerFrame
|
||||
@credit_sprite.oy = @realOY
|
||||
end
|
||||
end
|
||||
1617
Data/Scripts/009_Scenes/006_Transitions.rb
Normal file
1617
Data/Scripts/009_Scenes/006_Transitions.rb
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user