mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
More renaming and rearranging, fixed typo from earlier commit, tweaked splash and title screen code
This commit is contained in:
@@ -152,7 +152,7 @@ class Game_Event < Game_Character
|
||||
def check_event_trigger_touch(x, y)
|
||||
return if $game_system.map_interpreter.running?
|
||||
return if @trigger != 2 # Event touch
|
||||
return if !at_coordinate?($game_player.xm $game_player.y)
|
||||
return if !at_coordinate?($game_player.x, $game_player.y)
|
||||
return if jumping? || over_trigger?
|
||||
start
|
||||
end
|
||||
124
Data/Scripts/014_Trainers/004_Trainer_Deprecated.rb
Normal file
124
Data/Scripts/014_Trainers/004_Trainer_Deprecated.rb
Normal file
@@ -0,0 +1,124 @@
|
||||
#===============================================================================
|
||||
# Deprecated
|
||||
#===============================================================================
|
||||
class PlayerTrainer
|
||||
deprecated_method_alias :fullname, :full_name, removal_in: 'v20'
|
||||
deprecated_method_alias :publicID, :public_ID, removal_in: 'v20'
|
||||
deprecated_method_alias :secretID, :secret_ID, removal_in: 'v20'
|
||||
deprecated_method_alias :getForeignID, :make_foreign_ID, removal_in: 'v20'
|
||||
deprecated_method_alias :trainerTypeName, :trainer_type_name, removal_in: 'v20'
|
||||
deprecated_method_alias :moneyEarned, :base_money, removal_in: 'v20'
|
||||
deprecated_method_alias :skill, :skill_level, removal_in: 'v20'
|
||||
deprecated_method_alias :skillCode, :skill_code, removal_in: 'v20'
|
||||
deprecated_method_alias :hasSkillCode, :has_skill_code?, removal_in: 'v20'
|
||||
deprecated_method_alias :pokemonParty, :pokemon_party, removal_in: 'v20'
|
||||
deprecated_method_alias :ablePokemonParty, :able_party, removal_in: 'v20'
|
||||
deprecated_method_alias :partyCount, :party_count, removal_in: 'v20'
|
||||
deprecated_method_alias :pokemonCount, :pokemon_count, removal_in: 'v20'
|
||||
deprecated_method_alias :ablePokemonCount, :able_pokemon_count, removal_in: 'v20'
|
||||
deprecated_method_alias :firstParty, :first_party, removal_in: 'v20'
|
||||
deprecated_method_alias :firstPokemon, :first_pokemon, removal_in: 'v20'
|
||||
deprecated_method_alias :firstAblePokemon, :first_able_pokemon, removal_in: 'v20'
|
||||
deprecated_method_alias :lastParty, :last_party, removal_in: 'v20'
|
||||
deprecated_method_alias :lastPokemon, :last_pokemon, removal_in: 'v20'
|
||||
deprecated_method_alias :lastAblePokemon, :last_able_pokemon, removal_in: 'v20'
|
||||
deprecated_method_alias :formseen, :seen_forms, removal_in: 'v20'
|
||||
deprecated_method_alias :formlastseen, :last_seen_forms, removal_in: 'v20'
|
||||
deprecated_method_alias :shadowcaught, :owned_shadow, removal_in: 'v20'
|
||||
deprecated_method_alias :numbadges, :badge_count, removal_in: 'v20'
|
||||
deprecated_method_alias :pokedexSeen, :seen_count, removal_in: 'v20'
|
||||
deprecated_method_alias :pokedexOwned, :owned_count, removal_in: 'v20'
|
||||
deprecated_method_alias :numFormsSeen, :seen_forms_count, removal_in: 'v20'
|
||||
deprecated_method_alias :clearPokedex, :clear_pokedex, removal_in: 'v20'
|
||||
deprecated_method_alias :metaID, :character_ID, removal_in: 'v20'
|
||||
deprecated_method_alias :mysterygiftaccess, :mystery_gift_unlocked, removal_in: 'v20'
|
||||
deprecated_method_alias :mysterygift, :mystery_gifts, removal_in: 'v20'
|
||||
deprecated_method_alias :setSeen, :set_seen, removal_in: 'v20'
|
||||
deprecated_method_alias :setOwned, :set_owned, removal_in: 'v20'
|
||||
end
|
||||
|
||||
class PokeBattle_Trainer
|
||||
attr_reader :trainertype, :name, :id, :metaID, :outfit, :language
|
||||
attr_reader :party, :badges, :money
|
||||
attr_reader :seen, :owned, :formseen, :formlastseen, :shadowcaught
|
||||
attr_reader :pokedex, :pokegear
|
||||
attr_reader :mysterygiftaccess, :mysterygift
|
||||
|
||||
def self.convert(trainer)
|
||||
validate trainer => self
|
||||
ret = PlayerTrainer.new(trainer.name, trainer.trainertype)
|
||||
ret.id = trainer.id
|
||||
ret.character_ID = trainer.metaID if trainer.metaID
|
||||
ret.outfit = trainer.outfit if trainer.outfit
|
||||
ret.language = trainer.language if trainer.language
|
||||
trainer.party.each { |p| ret.party.push(PokeBattle_Pokemon.convert(p)) }
|
||||
ret.badges = trainer.badges.clone
|
||||
ret.money = trainer.money
|
||||
trainer.seen.each_with_index { |value, i| ret.set_seen(i) if value }
|
||||
trainer.owned.each_with_index { |value, i| ret.set_owned(i) if value }
|
||||
trainer.formseen.each_with_index do |value, i|
|
||||
ret.seen_forms[GameData::Species.get(i).species] = [value[0].clone, value[1].clone] if value
|
||||
end
|
||||
trainer.formlastseen.each_with_index do |value, i|
|
||||
ret.last_seen_forms[GameData::Species.get(i).species] = value.clone if value
|
||||
end
|
||||
if trainer.shadowcaught
|
||||
trainer.shadowcaught.each_with_index do |value, i|
|
||||
ret.owned_shadow[GameData::Species.get(i).species] = true if value
|
||||
end
|
||||
end
|
||||
ret.pokedex = trainer.pokedex
|
||||
ret.pokegear = trainer.pokegear
|
||||
ret.mystery_gift_unlocked = trainer.mysterygiftaccess if trainer.mysterygiftaccess
|
||||
ret.mystery_gifts = trainer.mysterygift.clone if trainer.mysterygift
|
||||
return ret
|
||||
end
|
||||
end
|
||||
|
||||
# @deprecated Use {Trainer#remove_pokemon_at_index} instead. This alias is slated to be removed in v20.
|
||||
def pbRemovePokemonAt(index)
|
||||
Deprecation.warn_method('pbRemovePokemonAt', 'v20', 'PlayerTrainer#remove_pokemon_at_index')
|
||||
return $Trainer.remove_pokemon_at_index(index)
|
||||
end
|
||||
|
||||
# @deprecated Use {Trainer#has_other_able_pokemon?} instead. This alias is slated to be removed in v20.
|
||||
def pbCheckAble(index)
|
||||
Deprecation.warn_method('pbCheckAble', 'v20', 'PlayerTrainer#has_other_able_pokemon?')
|
||||
return $Trainer.has_other_able_pokemon?(index)
|
||||
end
|
||||
|
||||
# @deprecated Use {Trainer#all_fainted?} instead. This alias is slated to be removed in v20.
|
||||
def pbAllFainted
|
||||
Deprecation.warn_method('pbAllFainted', 'v20', 'PlayerTrainer#all_fainted?')
|
||||
return $Trainer.all_fainted?
|
||||
end
|
||||
|
||||
# @deprecated Use {Trainer#has_species?} instead. This alias is slated to be removed in v20.
|
||||
def pbHasSpecies?(species, form = -1)
|
||||
Deprecation.warn_method('pbHasSpecies?', 'v20', 'PlayerTrainer#has_species?')
|
||||
return $Trainer.has_species?(species, form)
|
||||
end
|
||||
|
||||
# @deprecated Use {Trainer#has_fateful_species?} instead. This alias is slated to be removed in v20.
|
||||
def pbHasFatefulSpecies?(species)
|
||||
Deprecation.warn_method('pbHasSpecies?', 'v20', 'PlayerTrainer#has_fateful_species?')
|
||||
return $Trainer.has_fateful_species?(species)
|
||||
end
|
||||
|
||||
# @deprecated Use {Trainer#has_pokemon_of_type?} instead. This alias is slated to be removed in v20.
|
||||
def pbHasType?(type)
|
||||
Deprecation.warn_method('pbHasType?', 'v20', 'PlayerTrainer#has_pokemon_of_type?')
|
||||
return $Trainer.has_pokemon_of_type?(type)
|
||||
end
|
||||
|
||||
# @deprecated Use {Trainer#get_pokemon_with_move} instead. This alias is slated to be removed in v20.
|
||||
def pbCheckMove(move)
|
||||
Deprecation.warn_method('pbCheckMove', 'v20', 'PlayerTrainer#get_pokemon_with_move')
|
||||
return $Trainer.get_pokemon_with_move(move)
|
||||
end
|
||||
|
||||
# @deprecated Use {Trainer#heal_party} instead. This alias is slated to be removed in v20.
|
||||
def pbHealAll
|
||||
Deprecation.warn_method('pbHealAll', 'v20', 'PlayerTrainer#heal_party')
|
||||
$Trainer.heal_party
|
||||
end
|
||||
@@ -1,119 +1,111 @@
|
||||
class IntroEventScene < EventScene
|
||||
TICKS_PER_PIC = 40 # 20 ticks per second, so 2 seconds
|
||||
TICKS_PER_ENTER_FLASH = 40
|
||||
FADE_TICKS = 8
|
||||
# Splash screen images that appear for a few seconds and then disappear.
|
||||
SPLASH_IMAGES = ['intro1']
|
||||
# The main title screen background image.
|
||||
TITLE_BG_IMAGE = 'splash'
|
||||
TITLE_START_IMAGE = 'start'
|
||||
TITLE_START_IMAGE_X = 0
|
||||
TITLE_START_IMAGE_Y = 322
|
||||
SECONDS_PER_SPLASH = 2
|
||||
TICKS_PER_ENTER_FLASH = 40 # 20 ticks per second
|
||||
FADE_TICKS = 8 # 20 ticks per second
|
||||
|
||||
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)
|
||||
def initialize(viewport = nil)
|
||||
super(viewport)
|
||||
@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) # set opacity to 0 after waiting 0 frames
|
||||
@index = 0
|
||||
pbBGMPlay($data_system.title_bgm)
|
||||
openPic(self,nil)
|
||||
open_splash(self, nil)
|
||||
end
|
||||
|
||||
def openPic(_scene,*args)
|
||||
def open_splash(_scene, *args)
|
||||
onCTrigger.clear
|
||||
@pic.name = "Graphics/Titles/"+@pics[@index]
|
||||
@pic.name = "Graphics/Titles/" + SPLASH_IMAGES[@index]
|
||||
# fade to opacity 255 in FADE_TICKS ticks after waiting 0 frames
|
||||
@pic.moveOpacity(0,FADE_TICKS,255)
|
||||
@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
|
||||
@timer = 0.0 # reset the timer
|
||||
onUpdate.set(method(:splash_update)) # called every frame
|
||||
onCTrigger.set(method(:close_splash)) # called when C key is pressed
|
||||
end
|
||||
|
||||
def closePic(scene,args)
|
||||
def close_splash(scene, args)
|
||||
onUpdate.clear
|
||||
onCTrigger.clear
|
||||
@pic.moveOpacity(0,FADE_TICKS,0)
|
||||
@pic.moveOpacity(0, FADE_TICKS, 0)
|
||||
pictureWait
|
||||
@index += 1 # Move to the next picture
|
||||
if @index>=@pics.length
|
||||
openSplash(scene,args)
|
||||
if @index >= SPLASH_IMAGES.length
|
||||
open_title_screen(scene, args)
|
||||
else
|
||||
openPic(scene,args)
|
||||
open_splash(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
|
||||
def splash_update(scene, args)
|
||||
@timer += Graphics.delta_s
|
||||
close_splash(scene, args) if @timer > SECONDS_PER_SPLASH
|
||||
end
|
||||
|
||||
def openSplash(_scene,*args)
|
||||
def open_title_screen(_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)
|
||||
@pic.name = "Graphics/Titles/" + TITLE_BG_IMAGE
|
||||
@pic.moveOpacity(0, FADE_TICKS, 255)
|
||||
@pic2.name = "Graphics/Titles/" + TITLE_START_IMAGE
|
||||
@pic2.setXY(0, TITLE_START_IMAGE_X, TITLE_START_IMAGE_Y)
|
||||
@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
|
||||
onUpdate.set(method(:title_screen_update)) # called every frame
|
||||
onCTrigger.set(method(:close_title_screen)) # called when C key is pressed
|
||||
end
|
||||
|
||||
def closeSplash(scene,*args)
|
||||
def fade_out_title_screen(scene)
|
||||
onUpdate.clear
|
||||
onCTrigger.clear
|
||||
# Play random cry
|
||||
species_keys = GameData::Species::DATA.keys
|
||||
species_data = GameData::Species.get(species_keys[rand(species_keys.length)])
|
||||
GameData::Species.play_cry_from_species(species_data.species, species_data.form)
|
||||
@pic.moveXY(0,20,0,0)
|
||||
@pic.moveXY(0, 20, 0, 0) # Adds 20 ticks (1 second) pause
|
||||
pictureWait
|
||||
# Fade out
|
||||
@pic.moveOpacity(0,FADE_TICKS,0)
|
||||
@pic.moveOpacity(0, FADE_TICKS, 0)
|
||||
@pic2.clearProcesses
|
||||
@pic2.moveOpacity(0,FADE_TICKS,0)
|
||||
@pic2.moveOpacity(0, FADE_TICKS, 0)
|
||||
pbBGMStop(1.0)
|
||||
pictureWait
|
||||
scene.dispose # Close the scene
|
||||
end
|
||||
|
||||
def close_title_screen(scene, *args)
|
||||
fade_out_title_screen(scene)
|
||||
sscene = PokemonLoad_Scene.new
|
||||
sscreen = PokemonLoadScreen.new(sscene)
|
||||
sscreen.pbStartLoadScreen
|
||||
end
|
||||
|
||||
def closeSplashDelete(scene,*args)
|
||||
onUpdate.clear
|
||||
onCTrigger.clear
|
||||
# Play random cry
|
||||
species_keys = GameData::Species::DATA.keys
|
||||
species_data = GameData::Species.get(species_keys[rand(species_keys.length)])
|
||||
GameData::Species.play_cry_from_species(species_data.species, species_data.form)
|
||||
@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
|
||||
def close_title_screen_delete(scene, *args)
|
||||
fade_out_title_screen(scene)
|
||||
sscene = PokemonLoad_Scene.new
|
||||
sscreen = PokemonLoadScreen.new(sscene)
|
||||
sscreen.pbStartDeleteScreen
|
||||
end
|
||||
|
||||
def splashUpdate(scene,args)
|
||||
def title_screen_update(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)
|
||||
@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::BACK) &&
|
||||
Input.press?(Input::CTRL)
|
||||
closeSplashDelete(scene,args)
|
||||
close_title_screen_delete(scene, args)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -121,14 +113,9 @@ end
|
||||
|
||||
|
||||
class Scene_Intro
|
||||
# Splash screen images that appear for a few seconds and then disappear.
|
||||
INTRO_SPLASHES = ['intro1']
|
||||
# The main title screen background image.
|
||||
TITLE_SCREEN = 'splash'
|
||||
|
||||
def main
|
||||
Graphics.transition(0)
|
||||
@eventscene = IntroEventScene.new(INTRO_SPLASHES, TITLE_SCREEN)
|
||||
@eventscene = IntroEventScene.new
|
||||
@eventscene.main
|
||||
Graphics.freeze
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user