updates to version 6.1

This commit is contained in:
infinitefusion
2024-03-28 17:14:35 -04:00
parent e952a6f574
commit 1635409e6d
1151 changed files with 509422 additions and 5972 deletions

View File

@@ -6,7 +6,7 @@
module Settings
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION = '5.0.0'
GAME_VERSION_NUMBER = "6.0.5"
GAME_VERSION_NUMBER = "6.1.0"
POKERADAR_LIGHT_ANIMATION_RED_ID = 17
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18
@@ -20,7 +20,7 @@ module Settings
FUSION_ICON_SPRITE_OFFSET = 10
#Infinite fusion settings
NB_POKEMON = 465
NB_POKEMON = 470
CUSTOM_BASE_SPRITES_FOLDER = "Graphics/CustomBattlers/customBaseSprites/"
CUSTOM_BATTLERS_FOLDER = "Graphics/CustomBattlers/"
CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed/"
@@ -30,12 +30,15 @@ module Settings
CREDITS_FILE_PATH = "Data/SPRITE_CREDS"
VERSION_FILE_PATH = "Data/VERSION"
CUSTOM_SPRITES_FILE_PATH = "Data/CUSTOM_SPRITES"
CUSTOM_DEX_ENTRIES_PATH = "Data/dex.json"
HTTP_CONFIGS_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/Scripts/RemoteUrls.rb"
HTTP_CONFIGS_FILE_PATH = "Data/Scripts/DownloadedSettings.rb"
LEVEL_CAPS=[12,22,26,35,38,45,51,54,62,62,63,64,64,65,67,68]
CUSTOM_ENTRIES_NAME_PLACEHOLDER = "POKENAME"
DEFAULT_SPEED_UP_SPEED=2
FRONTSPRITE_POSITION_OFFSET = 20
FRONTSPRITE_SCALE = 0.6666666666666666
BACKRPSPRITE_SCALE = 1
@@ -46,6 +49,10 @@ module Settings
NO_LEVEL_MODE_LEVEL_INCR = 5.8
NO_LEVEL_MODE_LEVEL_BASE = 6
DISCORD_URL = "https://discord.com/invite/infinitefusion"
WIKI_URL = "https://infinitefusion.fandom.com/"
RIVAL_STARTER_PLACEHOLDER_SPECIES = :MEW #(MEW)
VAR_1_PLACEHOLDER_SPECIES = :DIALGA
VAR_2_PLACEHOLDER_SPECIES = :PALKIA
@@ -444,6 +451,7 @@ module Settings
# ID of the animation played when a berry tree grows a stage while the player
# is on the map (for new plant growth mechanics only).
PLANT_SPARKLE_ANIMATION_ID = 7
SLEEP_ANIMATION_ID = 26
CUT_TREE_ANIMATION_ID = 19
ROCK_SMASH_ANIMATION_ID = 20

View File

@@ -6,6 +6,7 @@
class Scene_Map
attr_reader :spritesetGlobal
attr_reader :map_renderer
attr_accessor :spritesets
def spriteset
for i in @spritesets.values
@@ -209,10 +210,11 @@ class Scene_Map
unless $game_system.menu_disabled || $game_player.moving?
$game_temp.menu_calling = true
$game_temp.menu_beep = true
$scene.spriteset.addUserSprite(LocationWindow.new($game_map.name+ "\n"+ pbGetTimeNow.strftime("%I:%M %p")))
dayOfWeek = getDayOfTheWeek().to_s
$scene.spriteset.addUserSprite(LocationWindow.new($game_map.name+ "\n"+ pbGetTimeNow.strftime("%I:%M %p") + "\n" + dayOfWeek))
end
elsif Input.trigger?(Input::SPECIAL)
unless $game_player.moving?
unless $game_system.menu_disabled || $game_player.moving?
$PokemonTemp.keyItemCalling = true
end
elsif Input.press?(Input::F9)

View File

@@ -324,7 +324,7 @@ class Interpreter
end
# Sets another event's self switch (eg. pbSetSelfSwitch(20, "A", true) ).
def pbSetSelfSwitch(eventid, switch_name, value, mapid = -1)
def pbSetSelfSwitch(eventid, switch_name, value, mapid = -1)
mapid = @map_id if mapid < 0
old_value = $game_self_switches[[mapid, eventid, switch_name]]
$game_self_switches[[mapid, eventid, switch_name]] = value

View File

@@ -21,8 +21,8 @@ class Game_Map
attr_accessor :fog_zoom # fog zoom rate
attr_accessor :fog_sx # fog sx
attr_accessor :fog_sy # fog sy
attr_reader :fog_ox # fog x-coordinate starting point
attr_reader :fog_oy # fog y-coordinate starting point
attr_accessor :fog_ox # fog x-coordinate starting point
attr_accessor :fog_oy # fog y-coordinate starting point
attr_reader :fog_tone # fog color tone
attr_accessor :battleback_name # battleback file name
attr_reader :display_x # display x-coordinate * 128

View File

@@ -25,6 +25,7 @@ class Game_Character
attr_reader :move_speed
attr_accessor :walk_anime
attr_writer :bob_height
attr_accessor :under_everything
def initialize(map = nil)
@map = map
@@ -75,6 +76,7 @@ class Game_Character
@moved_this_frame = false
@locked = false
@prelock_direction = 0
@under_everything=false
end
def at_coordinate?(check_x, check_y)
@@ -231,10 +233,11 @@ class Game_Character
def passable?(x, y, d, strict = false)
return false if self == $game_player && $game_switches[SWITCH_LOCK_PLAYER_MOVEMENT]
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
return false unless self.map.valid?(new_x, new_y)
if self.character_name == "SHARPEDO"
if self.character_name == "SHARPEDO" || self.character_name == "nightmare"
return false if pbFacingTerrainTag().id==:SharpedoObstacle
end
return true if @through
@@ -330,6 +333,7 @@ class Game_Character
end
def screen_z(height = 0)
return -1 if @under_everything
return 999 if @always_on_top
z = screen_y_ground
if @tile_id > 0
@@ -363,6 +367,7 @@ class Game_Character
end
def force_move_route(move_route)
echoln screen_z() if self == $game_player
if @original_move_route == nil
@original_move_route = @move_route
@original_move_route_index = @move_route_index

View File

@@ -9,6 +9,8 @@ class Game_Player < Game_Character
attr_accessor :bump_se
attr_accessor :charsetData
attr_accessor :encounter_count
attr_accessor :x
attr_accessor :y
SCREEN_CENTER_X = (Settings::SCREEN_WIDTH / 2 - Game_Map::TILE_WIDTH / 2) * Game_Map::X_SUBPIXELS
SCREEN_CENTER_Y = (Settings::SCREEN_HEIGHT / 2 - Game_Map::TILE_HEIGHT / 2) * Game_Map::Y_SUBPIXELS

View File

@@ -14,8 +14,9 @@ def pbRemoveDependencies()
pbDeregisterPartner() rescue nil
end
def pbAddDependency(event)
def pbAddDependency(event,follows=true)
$PokemonTemp.dependentEvents.addEvent(event)
$PokemonTemp.dependentEvents.follows_player = follows
end
def pbRemoveDependency(event)
@@ -140,6 +141,7 @@ end
class DependentEvents
attr_reader :lastUpdate
attr_writer :follows_player
def createEvent(eventData)
rpgEvent = RPG::Event.new(eventData[3],eventData[4])
@@ -169,6 +171,7 @@ class DependentEvents
for event in events
@realEvents.push(createEvent(event))
end
@follows_player=true
end
def pbEnsureEvent(event, newMapID)
@@ -213,6 +216,7 @@ class DependentEvents
facings.push(d) # Get forward facing
end
mapTile=nil
if areConnected
bestRelativePos=-1
oldthrough=follower.through
@@ -251,6 +255,7 @@ class DependentEvents
mapTile=passable ? mapTile : nil
end
if mapTile && follower.map.map_id==mapTile[0]
return if !@follows_player
# Follower is on same map
newX=mapTile[1]
newY=mapTile[2]
@@ -258,6 +263,13 @@ class DependentEvents
deltaY=(d == 2 ? -1 : d == 8 ? 1 : 0)
posX = newX + deltaX
posY = newY + deltaY
# if !@follows_player
# posX=follower.original_x
# posY=follower.original_y
#
# end
follower.move_speed=leader.move_speed # sync movespeed
if (follower.x-newX==-1 && follower.y==newY) ||
(follower.x-newX==1 && follower.y==newY) ||
@@ -337,13 +349,20 @@ class DependentEvents
leader=$game_player
for i in 0...events.length
event=@realEvents[i]
pbFollowEventAcrossMaps(leader,event,false,i==0)
# Update X and Y for this event
events[i][3]=event.x
events[i][4]=event.y
events[i][5]=event.direction
# Set leader to this event
leader=event
if !@follows_player
pbRemoveDependencies if leader.map.map_id != event.map.map_id
pbFollowEventAcrossMaps(leader,event,false,i==0)
events[i][3]=event.original_x
events[i][4]=event.original_y
else
pbFollowEventAcrossMaps(leader,event,false,i==0)
# Update X and Y for this event
events[i][3]=event.x
events[i][4]=event.y
events[i][5]=event.direction
# Set leader to this event
leader=event
end
end
end
@@ -372,6 +391,8 @@ class DependentEvents
events=$PokemonGlobal.dependentEvents
return if events.length==0
for i in 0...events.length
break if !@follows_player
event=@realEvents[i]
next if !@realEvents[i]
event.transparent=$game_player.transparent
@@ -388,6 +409,7 @@ class DependentEvents
events[i][5]=event.direction
end
# Check event triggers
#
if Input.trigger?(Input::USE) && !$game_temp.in_menu && !$game_temp.in_battle &&
!$game_player.move_route_forcing && !$game_temp.message_window_showing &&
!pbMapInterpreterRunning?
@@ -471,6 +493,8 @@ class DependentEvents
def addEvent(event,eventName=nil,commonEvent=nil)
return if !event
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][0]==$game_map.map_id && events[i][1]==event.id
# Already exists

View File

@@ -48,7 +48,7 @@ module GameData
end
if !self::DATA.has_key?(other)
echoln _INTL("Unknown ID {1}.", other)
#echoln _INTL("Unknown ID {1}.", other)
return self::get(:PIKACHU)
end
@@ -266,6 +266,7 @@ module GameData
TrainerType.load
Trainer.load
TrainerModern.load
TrainerExpert.load
Metadata.load
MapMetadata.load
end

View File

@@ -218,6 +218,14 @@ module GameData
return @id_number > Settings::NB_POKEMON
end
def get_body_species
return @species
end
def get_head_species
return @species
end
def hasType?(type)
type = GameData::Type.get(type).id
return self.types.include?(type)

View File

@@ -0,0 +1,14 @@
module GameData
class TrainerExpert < Trainer
DATA_FILENAME = "trainers_expert.dat"
end
end
#===============================================================================
# Deprecated methods
#===============================================================================
# @deprecated This alias is slated to be removed in v20.
def pbGetTrainerData(tr_type, tr_name, tr_version = 0)
Deprecation.warn_method('pbGetTrainerData', 'v20', 'GameData::Trainer.get(tr_type, tr_name, tr_version)')
return GameData::Trainer.get(tr_type, tr_name, tr_version)
end

View File

@@ -599,6 +599,54 @@ class PokeBattle_Battler
GameData::Species.sprite_filename(pokemon.dexNum, spriteform_body,spriteform_head)
end
def playChangeFormAnimation(animation = "UltraBurst2")
@battle.scene.pbChangePokemon(self, @pokemon)
@battle.scene.pbCommonAnimation(animation, self)
@battle.scene.pbRefreshOne(@index)
end
def changeSpecies(pokemon, speciesToReplace,newSpecies, animation = "UltraBurst2")
if pokemon.isFusion?()
replaceFusionSpecies(pokemon,speciesToReplace,newSpecies)
else
changeSpeciesSpecific(pokemon,newSpecies)
end
playChangeFormAnimation(animation)
end
# def changeUnfusedSpecies(pokemon, newSpecies, animation = "UltraBurst2")
#
# end
#For meloetta form change
def changeFormSpecies(oldForm, newForm,animation = "UltraBurst2")
@pokemon.changeFormSpecies(oldForm,newForm)
playChangeFormAnimation(animation)
# is_already_old_form = @pokemon.isFusionOf(oldForm) #A 466
# is_already_new_form = @pokemon.isFusionOf(newForm) #P
#
#
# #reverse the fusion if it's a meloA and meloP fusion
# # There's probably a smarter way to do this but laziness lol
# if is_already_old_form && is_already_new_form
# if @pokemon.species_data.get_body_species() == oldForm
# changeSpeciesSpecific(@pokemon,getFusedPokemonIdFromSymbols(newForm,oldForm))
# else
# changeSpeciesSpecific(@pokemon,getFusedPokemonIdFromSymbols(oldForm,newForm))
# end
# playChangeFormAnimation(animation)
# else
# changeSpecies(@pokemon, oldForm, newForm, animation) if is_already_old_form
# changeSpecies(@pokemon, newForm, oldForm, animation) if is_already_new_form
# end
end
def changeForm(newForm, formChangingSpecies, animation = "UltraBurst2")
spriteform_body = newForm if @pokemon.hasBodyOf?(formChangingSpecies)
spriteform_head = newForm if @pokemon.hasHeadOf?(formChangingSpecies)
@@ -617,9 +665,7 @@ class PokeBattle_Battler
@pokemon.spriteform_body = spriteform_body
@pokemon.spriteform_head = spriteform_head
end
@battle.scene.pbChangePokemon(self, @pokemon)
@battle.scene.pbCommonAnimation(animation, self)
@battle.scene.pbRefreshOne(@index)
playChangeFormAnimation(animation)
end
#=============================================================================

File diff suppressed because it is too large Load Diff

View File

@@ -2993,10 +2993,10 @@ class PokeBattle_Move_0EB < PokeBattle_Move
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
if @battle.wildBattle? && target.level>user.level
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
# if @battle.wildBattle? && target.level>user.level
# @battle.pbDisplay(_INTL("But it failed!"))
# return true
# end
if @battle.trainerBattle?
canSwitch = false
@battle.eachInTeamFromBattlerIndex(target.index) do |_pkmn,i|

View File

@@ -2069,17 +2069,29 @@ class PokeBattle_Move_164 < PokeBattle_Move_163
@calcCategory = (realAtk > realSpAtk) ? 0 : 1
if user.hasActiveItem?(:NECROZIUM) && (user.isFusionOf(:NECROZMA) && !user.pokemon.spriteform_body && !user.pokemon.spriteform_head)
user.type2 = :DRAGON if user.pokemon.hasBodyOf?(:NECROZMA)
user.attack*=1.3
user.spatk*=1.3
user.defense*=0.5
user.spdef*=0.5
user.speed*=1.5
user.changeForm(1,:NECROZMA)
# user.type2 = :DRAGON if user.pokemon.hasBodyOf?(:NECROZMA)
# user.attack*=1.3
# user.spatk*=1.3
# user.defense*=0.5
# user.spdef*=0.5
# user.speed*=1.5
user.changeFormSpecies(:NECROZMA,:U_NECROZMA,"UltraBurst2")
#user.changeForm(1,:NECROZMA)
end
end
end
#change back at the end of battle
Events.onEndBattle += proc { |_sender,_e|
$Trainer.party.each_with_index do |value, i|
pokemon = $Trainer.party[i]
if pokemon.isFusionOf(:U_NECROZMA)
pokemon.changeFormSpecies(:U_NECROZMA,:NECROZMA)
end
end
}
#===============================================================================
# Negates the target's ability while it remains on the field, if it has already
# performed its action this round. (Core Enforcer)

View File

@@ -12,42 +12,57 @@ module PokeBattle_BattleCommon
end
# Store the Pokémon
currentBox = @peer.pbCurrentBox
storedBox = @peer.pbStorePokemon(pbPlayer,pkmn)
if storedBox<0
pbDisplayPaused(_INTL("{1} has been added to your party.",pkmn.name))
@initialItems[0][pbPlayer.party.length-1] = pkmn.item_id if @initialItems
storedBox = @peer.pbStorePokemon(pbPlayer, pkmn)
if storedBox < 0
pbDisplayPaused(_INTL("{1} has been added to your party.", pkmn.name))
@initialItems[0][pbPlayer.party.length - 1] = pkmn.item_id if @initialItems
return
end
# Messages saying the Pokémon was stored in a PC box
creator = @peer.pbGetStorageCreatorName
creator = @peer.pbGetStorageCreatorName
curBoxName = @peer.pbBoxName(currentBox)
boxName = @peer.pbBoxName(storedBox)
if storedBox!=currentBox
boxName = @peer.pbBoxName(storedBox)
if storedBox != currentBox
if creator
pbDisplayPaused(_INTL("Box \"{1}\" on {2}'s PC was full.",curBoxName,creator))
pbDisplayPaused(_INTL("Box \"{1}\" on {2}'s PC was full.", curBoxName, creator))
else
pbDisplayPaused(_INTL("Box \"{1}\" on someone's PC was full.",curBoxName))
pbDisplayPaused(_INTL("Box \"{1}\" on someone's PC was full.", curBoxName))
end
pbDisplayPaused(_INTL("{1} was transferred to box \"{2}\".",pkmn.name,boxName))
pbDisplayPaused(_INTL("{1} was transferred to box \"{2}\".", pkmn.name, boxName))
else
if creator
pbDisplayPaused(_INTL("{1} was transferred to {2}'s PC.",pkmn.name,creator))
pbDisplayPaused(_INTL("{1} was transferred to {2}'s PC.", pkmn.name, creator))
else
pbDisplayPaused(_INTL("{1} was transferred to someone's PC.",pkmn.name))
pbDisplayPaused(_INTL("{1} was transferred to someone's PC.", pkmn.name))
end
pbDisplayPaused(_INTL("It was stored in box \"{1}\".",boxName))
pbDisplayPaused(_INTL("It was stored in box \"{1}\".", boxName))
end
end
#def pbChoosePokemon(variableNumber, nameVarNumber, ableProc = nil, allowIneligible = false)
# def swapCaughtPokemon(caughtPokemon)
# pbChoosePokemon(1,2,
# proc {|poke|
# !poke.egg? &&
# !(poke.isShadow? rescue false)
# })
# index = pbGet(1)
# return false if index == -1
# $PokemonStorage.pbStoreCaught($Trainer.party[index])
# pbRemovePokemonAt(index)
# pbStorePokemon(caughtPokemon)
# return true
# end
# Register all caught Pokémon in the Pokédex, and store them.
def pbRecordAndStoreCaughtPokemon
@caughtPokemon.each do |pkmn|
pbPlayer.pokedex.register(pkmn) # In case the form changed upon leaving battle
pbPlayer.pokedex.register(pkmn) # In case the form changed upon leaving battle
# Record the Pokémon's species as owned in the Pokédex
if !pbPlayer.owned?(pkmn.species)
pbPlayer.pokedex.set_owned(pkmn.species)
if $Trainer.has_pokedex
pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.",pkmn.name))
pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.", pkmn.name))
pbPlayer.pokedex.register_last_seen(pkmn)
@scene.pbShowPokedex(pkmn.species)
end
@@ -55,7 +70,7 @@ module PokeBattle_BattleCommon
# Record a Shadow Pokémon's species as having been caught
pbPlayer.pokedex.set_shadow_pokemon_owned(pkmn.species) if pkmn.shadowPokemon?
# Store caught Pokémon
pbStorePokemon(pkmn)
promptCaughtPokemonAction(pkmn)
if $game_switches[AUTOSAVE_CATCH_SWITCH]
Kernel.tryAutosave()
end
@@ -64,10 +79,34 @@ module PokeBattle_BattleCommon
@caughtPokemon.clear
end
# def promptCaughtPokemonAction(pokemon)
# pickedOption = false
# return pbStorePokemon(pokemon) if !$Trainer.party_full?
#
# while !pickedOption
# command = pbMessage(_INTL("\\ts[]Your team is full!"),
# [_INTL("Add to your party"), _INTL("Store to PC"),], 2)
# echoln ("command " + command.to_s)
# case command
# when 0 #SWAP
# if swapCaughtPokemon(pokemon)
# echoln pickedOption
# pickedOption = true
# end
# else
# #STORE
# pbStorePokemon(pokemon)
# echoln pickedOption
# pickedOption = true
# end
# end
#
# end
#=============================================================================
# Throw a Poké Ball
#=============================================================================
def pbThrowPokeBall(idxBattler,ball,catch_rate=nil,showPlayer=false)
def pbThrowPokeBall(idxBattler, ball, catch_rate = nil, showPlayer = false)
# Determine which Pokémon you're throwing the Poké Ball at
battler = nil
if opposes?(idxBattler)
@@ -85,58 +124,58 @@ module PokeBattle_BattleCommon
itemName = GameData::Item.get(ball).name
if battler.fainted?
if itemName.starts_with_vowel?
pbDisplay(_INTL("{1} threw an {2}!",pbPlayer.name,itemName))
pbDisplay(_INTL("{1} threw an {2}!", pbPlayer.name, itemName))
else
pbDisplay(_INTL("{1} threw a {2}!",pbPlayer.name,itemName))
pbDisplay(_INTL("{1} threw a {2}!", pbPlayer.name, itemName))
end
pbDisplay(_INTL("But there was no target..."))
return
end
if itemName.starts_with_vowel?
pbDisplayBrief(_INTL("{1} threw an {2}!",pbPlayer.name,itemName))
pbDisplayBrief(_INTL("{1} threw an {2}!", pbPlayer.name, itemName))
else
pbDisplayBrief(_INTL("{1} threw a {2}!",pbPlayer.name,itemName))
pbDisplayBrief(_INTL("{1} threw a {2}!", pbPlayer.name, itemName))
end
# Animation of opposing trainer blocking Poké Balls (unless it's a Snag Ball
# at a Shadow Pokémon)
if trainerBattle? && !(GameData::Item.get(ball).is_snag_ball? && battler.shadowPokemon?)
@scene.pbThrowAndDeflect(ball,1)
@scene.pbThrowAndDeflect(ball, 1)
pbDisplay(_INTL("The Trainer blocked your Poké Ball! Don't be a thief!"))
return
elsif $game_switches[SWITCH_CANNOT_CATCH_POKEMON]
@scene.pbThrowAndDeflect(ball,1)
@scene.pbThrowAndDeflect(ball, 1)
pbDisplay(_INTL("The Pokémon is impossible to catch!"))
return
end
# Calculate the number of shakes (4=capture)
pkmn = battler.pokemon
@criticalCapture = false
numShakes = pbCaptureCalc(pkmn,battler,catch_rate,ball)
numShakes = pbCaptureCalc(pkmn, battler, catch_rate, ball)
PBDebug.log("[Threw Poké Ball] #{itemName}, #{numShakes} shakes (4=capture)")
# Animation of Ball throw, absorb, shake and capture/burst out
@scene.pbThrow(ball,numShakes,@criticalCapture,battler.index,showPlayer)
@scene.pbThrow(ball, numShakes, @criticalCapture, battler.index, showPlayer)
# Outcome message
case numShakes
when 0
pbDisplay(_INTL("Oh no! The Pokémon broke free!"))
BallHandlers.onFailCatch(ball,self,battler)
BallHandlers.onFailCatch(ball, self, battler)
when 1
pbDisplay(_INTL("Aww! It appeared to be caught!"))
BallHandlers.onFailCatch(ball,self,battler)
BallHandlers.onFailCatch(ball, self, battler)
when 2
pbDisplay(_INTL("Aargh! Almost had it!"))
BallHandlers.onFailCatch(ball,self,battler)
BallHandlers.onFailCatch(ball, self, battler)
when 3
pbDisplay(_INTL("Gah! It was so close, too!"))
BallHandlers.onFailCatch(ball,self,battler)
BallHandlers.onFailCatch(ball, self, battler)
when 4
if $game_switches[SWITCH_SILVERBOSS_BATTLE]
pkmn.species=:PALDIATINA
pkmn.species = :PALDIATINA
pkmn.name = "Paldiatina"
end
pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pkmn.name))
@scene.pbThrowSuccess # Play capture success jingle
pbRemoveFromParty(battler.index,battler.pokemonIndex)
pbDisplayBrief(_INTL("Gotcha! {1} was caught!", pkmn.name))
@scene.pbThrowSuccess # Play capture success jingle
pbRemoveFromParty(battler.index, battler.pokemonIndex)
# Gain Exp
if Settings::GAIN_EXP_FOR_CAPTURE
battler.captured = true
@@ -145,21 +184,21 @@ module PokeBattle_BattleCommon
end
battler.pbReset
if pbAllFainted?(battler.index)
@decision = (trainerBattle?) ? 1 : 4 # Battle ended by win/capture
@decision = (trainerBattle?) ? 1 : 4 # Battle ended by win/capture
end
# Modify the Pokémon's properties because of the capture
if GameData::Item.get(ball).is_snag_ball?
pkmn.owner = Pokemon::Owner.new_from_trainer(pbPlayer)
end
BallHandlers.onCatch(ball,self,pkmn)
BallHandlers.onCatch(ball, self, pkmn)
pkmn.poke_ball = ball
pkmn.makeUnmega if pkmn.mega?
pkmn.makeUnprimal
pkmn.update_shadow_moves if pkmn.shadowPokemon?
pkmn.record_first_moves
# Reset form
pkmn.forced_form = nil if MultipleForms.hasFunction?(pkmn.species,"getForm")
@peer.pbOnLeavingBattle(self,pkmn,true,true)
pkmn.forced_form = nil if MultipleForms.hasFunction?(pkmn.species, "getForm")
@peer.pbOnLeavingBattle(self, pkmn, true, true)
# Make the Poké Ball and data box disappear
@scene.pbHideCaptureBall(idxBattler)
# Save the Pokémon for storage at the end of battle
@@ -170,7 +209,7 @@ module PokeBattle_BattleCommon
#=============================================================================
# Calculate how many shakes a thrown Poké Ball will make (4 = capture)
#=============================================================================
def pbCaptureCalc(pkmn,battler,catch_rate,ball)
def pbCaptureCalc(pkmn, battler, catch_rate, ball)
return 4 if $DEBUG && Input.press?(Input::CTRL)
# Get a catch rate if one wasn't provided
catch_rate = pkmn.species_data.catch_rate if !catch_rate
@@ -179,14 +218,14 @@ module PokeBattle_BattleCommon
:KARTANA, :GUZZLORD, :POIPOLE, :NAGANADEL, :STAKATAKA,
:BLACEPHALON].include?(pkmn.species)
if !ultraBeast || ball == :BEASTBALL
catch_rate = BallHandlers.modifyCatchRate(ball,catch_rate,self,battler,ultraBeast)
catch_rate = BallHandlers.modifyCatchRate(ball, catch_rate, self, battler, ultraBeast)
else
catch_rate /= 10
end
# First half of the shakes calculation
a = battler.totalhp
b = battler.hp
x = ((3*a-2*b)*catch_rate.to_f)/(3*a)
x = ((3 * a - 2 * b) * catch_rate.to_f) / (3 * a)
# Calculation modifiers
if battler.status == :SLEEP || battler.status == :FROZEN
x *= 2.5
@@ -194,33 +233,38 @@ module PokeBattle_BattleCommon
x *= 1.5
end
x = x.floor
x = 1 if x<1
x = 1 if x < 1
# Definite capture, no need to perform randomness checks
return 4 if x>=255 || BallHandlers.isUnconditional?(ball,self,battler)
return 4 if x >= 255 || BallHandlers.isUnconditional?(ball, self, battler)
# Second half of the shakes calculation
y = ( 65536 / ((255.0/x)**0.1875) ).floor
y = (65536 / ((255.0 / x) ** 0.1875)).floor
# Critical capture check
if Settings::ENABLE_CRITICAL_CAPTURES
c = 0
numOwned = $Trainer.pokedex.owned_count
if numOwned>600; c = x*5/12
elsif numOwned>450; c = x*4/12
elsif numOwned>300; c = x*3/12
elsif numOwned>150; c = x*2/12
elsif numOwned>30; c = x/12
if numOwned > 600;
c = x * 5 / 12
elsif numOwned > 450;
c = x * 4 / 12
elsif numOwned > 300;
c = x * 3 / 12
elsif numOwned > 150;
c = x * 2 / 12
elsif numOwned > 30;
c = x / 12
end
# Calculate the number of shakes
if c>0 && pbRandom(256)<c
if c > 0 && pbRandom(256) < c
@criticalCapture = true
return 4 if pbRandom(65536)<y
return 4 if pbRandom(65536) < y
return 0
end
end
# Calculate the number of shakes
numShakes = 0
for i in 0...4
break if numShakes<i
numShakes += 1 if pbRandom(65536)<y
break if numShakes < i
numShakes += 1 if pbRandom(65536) < y
end
return numShakes
end

View File

@@ -173,11 +173,20 @@ class PokeBattle_Battle
def wildBattle?; return @opponent.nil?; end
def trainerBattle?; return !@opponent.nil?; end
def get_default_battle_format()
case $PokemonSystem.battle_type
when 0 then return [1, 1]
when 1 then return [2, 2]
when 2 then return [3, 3]
end
return [1,1]
end
# Sets the number of battler slots on each side of the field independently.
# For "1v2" names, the first number is for the player's side and the second
# number is for the opposing side.
def setBattleMode(mode)
default = $game_variables[VAR_DEFAULT_BATTLE_TYPE].is_a?(Array) ? $game_variables[VAR_DEFAULT_BATTLE_TYPE] : [1,1]
default = get_default_battle_format()
@sideSizes =
case mode
when "triple", "3v3" then [3, 3]

View File

@@ -38,7 +38,47 @@ class LocationWindow
end
end
class NightmareSprite < SpriteWrapper
attr_reader :radius
def initialize(viewport=nil)
super(viewport)
@darkness = BitmapWrapper.new(Graphics.width,Graphics.height)
@radius = radiusMin
self.bitmap = @darkness
self.z = 99998
refresh
end
def dispose
@darkness.dispose
super
end
def radiusMin; return 64; end # Before using Flash
def radiusMax; return 176; end # After using Flash
def radius=(value)
@radius = value
refresh
end
def refresh
@darkness.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0,255))
cx = Graphics.width/2
cy = Graphics.height/2
cradius = @radius
numfades = 5
for i in 1..numfades
for j in cx-cradius..cx+cradius
diff2 = (cradius * cradius) - ((j - cx) * (j - cx))
diff = Math.sqrt(diff2)
@darkness.fill_rect(j,cy-diff,1,diff*2,Color.new(0,0,0,255.0*(numfades-i)/numfades))
end
cradius = (cradius*0.9).floor
end
end
end
#===============================================================================
# Visibility circle in dark maps

View File

@@ -83,6 +83,7 @@ end
#===============================================================================
def pbStartOver(gameover=false)
$game_variables[VAR_CURRENT_GYM_TYPE]=-1
$game_switches[SWITCH_LOCK_PLAYER_MOVEMENT]=false
if pbInBugContest?
pbBugContestStartOver
return

View File

@@ -42,6 +42,11 @@ def pbBatteryLow?
return false
end
def pbOnBattery?
pstate = System.power_state
return pstate[:discharging]
end
Events.onMapUpdate += proc { |_sender, _e|
if !$PokemonTemp.batterywarning && pbBatteryLow?
if !$game_temp.in_menu && !$game_temp.in_battle &&

View File

@@ -242,6 +242,8 @@ def pbCanTripleBattle?
return $PokemonGlobal.partner && $Trainer.able_pokemon_count >= 2
end
#===============================================================================
# Start a wild battle
#===============================================================================
@@ -257,6 +259,7 @@ def pbWildBattleCore(*args)
$PokemonGlobal.nextBattleME = nil
$PokemonGlobal.nextBattleCaptureME = nil
$PokemonGlobal.nextBattleBack = nil
$PokemonTemp.forced_alt_sprites=nil
pbMEStop
return 1 # Treat it as a win
end
@@ -331,6 +334,30 @@ def pbWildBattleCore(*args)
return decision
end
def pbWildDoubleBattleSpecific(pokemon1,pokemon2, outcomeVar=1, canRun=true, canLose=false)
# Set some battle rules
setBattleRule("outcomeVar",outcomeVar) if outcomeVar!=1
setBattleRule("cannotRun") if !canRun
setBattleRule("canLose") if canLose
setBattleRule("double")
# Perform the battle
decision = pbWildBattleCore(pokemon1, pokemon2)
return (decision!=2 && decision!=5)
end
def pbWildBattleSpecific(pokemon, outcomeVar=1, canRun=true, canLose=false)
# Set some battle rules
setBattleRule("outcomeVar",outcomeVar) if outcomeVar!=1
setBattleRule("cannotRun") if !canRun
setBattleRule("canLose") if canLose
# Perform the battle
decision = pbWildBattleCore(pokemon)
# Used by the Poké Radar to update/break the chain
#Events.onWildBattleEnd.trigger(nil,species,level,decision)
# Return false if the player lost or drew the battle, and true if any other result
return (decision!=2 && decision!=5)
end
#===============================================================================
# Standard methods that start a wild battle of various sizes
#===============================================================================
@@ -423,6 +450,7 @@ def pbTrainerBattleCore(*args)
$PokemonGlobal.nextBattleME = nil
$PokemonGlobal.nextBattleCaptureME = nil
$PokemonGlobal.nextBattleBack = nil
$PokemonTemp.forced_alt_sprites=nil
pbMEStop
return ($Trainer.able_pokemon_count == 0) ? 0 : 1 # Treat it as undecided/a win
end

View File

@@ -112,6 +112,7 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
$PokemonGlobal.nextBattleME = nil
$PokemonGlobal.nextBattleCaptureME = nil
$PokemonGlobal.nextBattleBack = nil
$PokemonTemp.forced_alt_sprites=nil
$PokemonEncounters.reset_step_count
# Fade back to the overworld
viewport.color = Color.new(0,0,0,255)

View File

@@ -636,6 +636,54 @@ HiddenMoveHandlers::UseMove.add(:HEADBUTT, proc { |move, pokemon|
pbHeadbuttEffect(facingEvent)
})
HiddenMoveHandlers::CanUseMove.add(:RELICSONG, proc { |move, pokemon, showmsg|
if !(pokemon.isFusionOf(:MELOETTA_A) || pokemon.isFusionOf(:MELOETTA_P))
pbMessage(_INTL("It won't have any effect")) if showmsg
next false
end
next true
})
HiddenMoveHandlers::UseMove.add(:RELICSONG, proc { |move, pokemon|
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
end
changeMeloettaForm(pokemon)
})
def changeMeloettaForm(pokemon)
is_meloetta_A = pokemon.isFusionOf(:MELOETTA_A)
is_meloetta_P = pokemon.isFusionOf(:MELOETTA_P)
if !pokemon.isFusion?
if is_meloetta_A
changeSpeciesSpecific(pokemon, :MELOETTA_P)
pbMessage(_INTL("{1} changed to the Pirouette form!", pokemon.name))
end
if is_meloetta_P
changeSpeciesSpecific(pokemon, :MELOETTA_A)
pbMessage(_INTL("{1} changed to the Aria form!", pokemon.name))
end
return
end
if is_meloetta_A && is_meloetta_P
if pokemon.species_data.get_body_species() == :MELOETTA_A
changeSpeciesSpecific(pokemon, :B467H466)
else
changeSpeciesSpecific(pokemon, :B466H467)
end
pbMessage(_INTL("{1} changed form!", pokemon.name))
else
if is_meloetta_P
replaceFusionSpecies(pokemon, :MELOETTA_P, :MELOETTA_A)
pbMessage(_INTL("{1} changed to the Aria form!", pokemon.name))
end
if is_meloetta_A
replaceFusionSpecies(pokemon, :MELOETTA_A, :MELOETTA_P)
pbMessage(_INTL("{1} changed to the Pirouette form!", pokemon.name))
end
end
end
#===============================================================================
# Rock Smash
#===============================================================================

View File

@@ -230,6 +230,37 @@ class Pokemon
return @form
end
def changeFormSpecies(oldForm, newForm)
is_already_old_form = self.isFusionOf(oldForm) #A 466
is_already_new_form = self.isFusionOf(newForm) #P
#reverse the fusion if it's a meloA and meloP fusion
# There's probably a smarter way to do this but laziness lol
if is_already_old_form && is_already_new_form
if self.species_data.get_body_species() == oldForm
changeSpeciesSpecific(self,getFusedPokemonIdFromSymbols(newForm,oldForm))
else
changeSpeciesSpecific(self,getFusedPokemonIdFromSymbols(oldForm,newForm))
end
else
changeSpecies(self, oldForm, newForm) if is_already_old_form
changeSpecies(self, newForm, oldForm) if is_already_new_form
end
calc_stats
end
def changeSpecies(pokemon, speciesToReplace,newSpecies)
if pokemon.isFusion?()
replaceFusionSpecies(pokemon,speciesToReplace,newSpecies)
else
changeSpeciesSpecific(pokemon,newSpecies)
end
$Trainer.pokedex.set_seen(pokemon.species)
$Trainer.pokedex.set_owned(pokemon.species)
end
def form_simple
return @forced_form || @form
end

View File

@@ -7,11 +7,12 @@ def getTrainersDataMode
mode = GameData::Trainer
if $game_switches && $game_switches[SWITCH_MODERN_MODE]
mode = GameData::TrainerModern
elsif $game_switches && $game_switches[SWITCH_EXPERT_MODE]
mode = GameData::TrainerExpert
end
return mode
end
def pbLoadTrainer(tr_type, tr_name, tr_version = 0)
tr_type_data = GameData::TrainerType.try_get(tr_type)
raise _INTL("Trainer type {1} does not exist.", tr_type) if !tr_type_data
@@ -24,7 +25,7 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
party = []
for i in 0...Settings::MAX_PARTY_SIZE
if i == 0
pbMessage(_INTL("Please enter the first Pokémon.",i))
pbMessage(_INTL("Please enter the first Pokémon.", i))
else
break if !pbConfirmMessage(_INTL("Add another Pokémon?"))
end
@@ -35,7 +36,7 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
params.setRange(1, GameData::GrowthRate.max_level)
params.setDefaultValue(10)
level = pbMessageChooseNumber(_INTL("Set the level for {1} (max. #{params.maxNumber}).",
GameData::Species.get(species).name), params)
GameData::Species.get(species).name), params)
party.push([species, level])
break
else
@@ -47,17 +48,17 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
trainer = [tr_type, tr_name, [], party, tr_version]
if save_changes
trainer_hash = {
:id_number => getTrainersDataMode::DATA.keys.length / 2,
:id_number => getTrainersDataMode::DATA.keys.length / 2,
:trainer_type => tr_type,
:name => tr_name,
:version => tr_version,
:pokemon => []
:name => tr_name,
:version => tr_version,
:pokemon => []
}
party.each do |pkmn|
trainer_hash[:pokemon].push({
:species => pkmn[0],
:level => pkmn[1]
})
:species => pkmn[0],
:level => pkmn[1]
})
end
# Add trainer's data to records
trainer_hash[:id] = [trainer_hash[:trainer_type], trainer_hash[:name], trainer_hash[:version]]
@@ -99,7 +100,7 @@ def pbTrainerCheck(tr_type, tr_name, max_battles, tr_version = 0)
return true if getTrainersDataMode.exists?(tr_type, tr_name, tr_version)
# Add new trainer
if pbConfirmMessage(_INTL("Add new trainer variant {1} (of {2}) for {3} {4}?",
tr_version, max_battles, tr_type.to_s, tr_name))
tr_version, max_battles, tr_type.to_s, tr_name))
pbNewTrainer(tr_type, tr_name, tr_version)
end
return true
@@ -129,7 +130,7 @@ def pbMissingTrainer(tr_type, tr_name, tr_version)
pbMessage(message)
return 1
end
message = ""
message = ""
if tr_version != 0
message = _INTL("Add new trainer ({1}, {2}, ID {3})?", tr_type.to_s, tr_name, tr_version)
else

View File

@@ -359,6 +359,9 @@ class HallOfFame_Scene
if $game_switches[SWITCH_MODERN_MODE]
gameMode = "Modern mode"
end
if $game_switches[SWITCH_EXPERT_MODE]
gameMode = "Expert mode"
end
if $game_switches[SWITCH_SINGLE_POKEMON_MODE]
pokemon_number = pbGet(VAR_SINGLE_POKEMON_MODE)
if pokemon_number.is_a?(Integer) && pokemon_number >0

View File

@@ -61,26 +61,30 @@ Fused Pokemon Sprites :
Japeal - Pokefusion 2
http://japeal.com/pkm
Special thanks to Aegide for helping to
rip the sprites and to the owners of Japeal
for accepting to share their generated sprites.
Special thanks to Aegide and Reizod for helping to
download the autogenerated sprites and to the owners of Japeal
for accepting to share their sprites.
Maps:
Chardub, Kiwikelly
Chardub
Kiwikelly
Some of the maps were based on work by:
BenGames, Zeak6464
Gameplay / Story:
Chardub
The story and dialogues were based
Gameplay / Story :
Chardub
Kiwikelly
Most of the story and dialogues were based
off Pokémon Red and Blue, as well as
Pokémon Gold and Silver.
Both games are made by Game Freak.
Sprites pack managers
Custom sprites collecting and handling
Kiwikelly, Payapon, Thornsoflight
Sprite Managers
Discord custom sprites coordination
avianAnnihilator<s>Blaquaza
BéBoutton<s>CaBiNE
CoramSun<s>hero.drawing

View File

@@ -158,19 +158,19 @@ class PokemonPauseMenu
else
#if $Trainer.pokedex.accessible_dexes.length == 1
$PokemonGlobal.pokedexDex = $Trainer.pokedex.accessible_dexes[0]
pbFadeOutIn {
scene = PokemonPokedex_Scene.new
screen = PokemonPokedexScreen.new(scene)
screen.pbStartScreen
@scene.pbRefresh
}
# pbFadeOutIn {
# scene = PokemonPokedex_Scene.new
# screen = PokemonPokedexScreen.new(scene)
# screen.pbStartScreen
# @scene.pbRefresh
# }
# else
# pbFadeOutIn {
# scene = PokemonPokedexMenu_Scene.new
# screen = PokemonPokedexMenuScreen.new(scene)
# screen.pbStartScreen
# @scene.pbRefresh
# }
pbFadeOutIn {
scene = PokemonPokedexMenu_Scene.new
screen = PokemonPokedexMenuScreen.new(scene)
screen.pbStartScreen
@scene.pbRefresh
}
# end
end
elsif cmdPokemon >= 0 && command == cmdPokemon

View File

@@ -96,7 +96,7 @@ class PokemonPokedexMenuScreen
dexnames = Settings.pokedex_names
$Trainer.pokedex.accessible_dexes.each do |dex|
if dexnames[dex].nil?
commands.push(_INTL("Pokédex"))
commands.push(_INTL("Full Pokédex"))
elsif dexnames[dex].is_a?(Array)
commands.push(dexnames[dex][0])
else
@@ -106,16 +106,20 @@ class PokemonPokedexMenuScreen
$Trainer.pokedex.owned_count(dex),
pbGetRegionalDexLength(dex)])
end
commands.push(_INTL("Owned Pokémon"))
commands.push(_INTL("Exit"))
@scene.pbStartScene(commands,commands2)
loop do
cmd = @scene.pbScene
break if cmd<0 || cmd>=commands2.length # Cancel/Exit
$PokemonGlobal.pokedexDex = $Trainer.pokedex.accessible_dexes[cmd]
break if cmd<0 || cmd>1 # Cancel/Exit
$PokemonGlobal.pokedexDex = $Trainer.pokedex.accessible_dexes[0]
only_owned = cmd == 1
pbFadeOutIn {
scene = PokemonPokedex_Scene.new
screen = PokemonPokedexScreen.new(scene)
screen.pbStartScreen
screen.pbStartScreen(only_owned)
}
end
@scene.pbEndScene

View File

@@ -231,7 +231,8 @@ class PokemonPokedex_Scene
pbUpdateSpriteHash(@sprites)
end
def pbStartScene
def pbStartScene(filter_owned=false)
@filter_owned=filter_owned
@sliderbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_slider")
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Pokedex/icon_types"))
@shapebitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_shapes")
@@ -345,7 +346,7 @@ class PokemonPokedex_Scene
# end
def pbGetDexList()
def pbGetDexList(filter_owned=false)
dexlist=[]
regionalSpecies=[]
for i in 1..PBSpecies.maxValue
@@ -354,8 +355,10 @@ class PokemonPokedex_Scene
for i in 1...PBSpecies.maxValue
nationalSpecies=i
if $Trainer.seen?(nationalSpecies)
species = GameData::Species.get(nationalSpecies)
dexlist.push([species.id_number,species.real_name,0,0,i+1,0])
if !filter_owned || $Trainer.owned?(nationalSpecies)
species = GameData::Species.get(nationalSpecies)
dexlist.push([species.id_number,species.real_name,0,0,i+1,0])
end
end
end
return dexlist
@@ -365,7 +368,7 @@ class PokemonPokedex_Scene
if index == nil
index = 0
end
dexlist = pbGetDexList
dexlist = pbGetDexList(@filter_owned)
case $PokemonGlobal.pokedexMode
when MODENUMERICAL
# Hide the Dex number 0 species if unseen
@@ -1179,7 +1182,7 @@ class PokemonPokedex_Scene
return 0
end
def pbPokedex
def pbPokedex()
pbActivateWindow(@sprites,"pokedex") {
loop do
Graphics.update
@@ -1222,9 +1225,9 @@ class PokemonPokedexScreen
@scene = scene
end
def pbStartScreen
@scene.pbStartScene
@scene.pbPokedex
def pbStartScreen(filter_owned=false)
@scene.pbStartScene(filter_owned)
@scene.pbPokedex()
@scene.pbEndScene
end
end

View File

@@ -190,7 +190,8 @@ class PokemonPokedexInfo_Scene
end
# species_data = pbGetSpeciesData(@species)
species_data = GameData::Species.get_species_form(@species, @form)
@sprites["infosprite"].setSpeciesBitmap(@species, @gender, @form)
@sprites["infosprite"].setSpeciesBitmap(@species)#, @gender, @form)
# if @sprites["formfront"]
# @sprites["formfront"].setSpeciesBitmap(@species,@gender,@form)
# end
@@ -278,6 +279,8 @@ class PokemonPokedexInfo_Scene
overlay = @sprites["overlay"].bitmap
base = Color.new(88, 88, 80)
shadow = Color.new(168, 184, 184)
shadowCustom = Color.new(160, 200, 150)
imagepos = []
if @brief
imagepos.push([_INTL("Graphics/Pictures/Pokedex/overlay_info"), 0, 0])
@@ -313,8 +316,16 @@ class PokemonPokedexInfo_Scene
textpos.push([_ISPRINTF("{1:.1f} kg", weight / 10.0), 482, 184, 1, base, shadow])
end
# Draw the Pokédex entry text
# drawTextEx(overlay, 40, 244, Graphics.width - (40 * 2), 4, # overlay, x, y, width, num lines
# species_data.pokedex_entry, base, shadow)
#
#
customEntry = getCustomEntryText(species_data)
entryText = customEntry ? customEntry : species_data.pokedex_entry
shadowColor = customEntry ? shadowCustom : shadow
drawTextEx(overlay, 40, 244, Graphics.width - (40 * 2), 4, # overlay, x, y, width, num lines
species_data.pokedex_entry, base, shadow)
entryText, base, shadowColor)
# Draw the footprint
footprintfile = GameData::Species.footprint_filename(@species, @form)
if footprintfile
@@ -351,6 +362,43 @@ class PokemonPokedexInfo_Scene
pbDrawImagePositions(overlay, imagepos)
end
def reloadDexEntry()
overlay = @sprites["overlay"].bitmap
overlay.clear
drawPageInfo
end
def isAutogenSprite(sprite_path)
return !sprite_path.include?(Settings::CUSTOM_BATTLERS_FOLDER)
end
def getCustomEntryText(species_data)
sprite_bitmap= GameData::Species.sprite_bitmap(species_data.species)
return nil if isAutogenSprite(sprite_bitmap.path)
spritename = sprite_bitmap.filename
possibleCustomEntries = getCustomDexEntry(spritename)
if possibleCustomEntries && possibleCustomEntries.length > 0
customEntry = possibleCustomEntries.sample
customEntry = customEntry.gsub(Settings::CUSTOM_ENTRIES_NAME_PLACEHOLDER,species_data.name)
end
return customEntry
end
def getCustomDexEntry(sprite)
json_data = File.read(Settings::CUSTOM_DEX_ENTRIES_PATH)
parsed_data = HTTPLite::JSON.parse(json_data)
entries = parsed_data.select { |entry| entry["sprite"] == sprite }
if entries.any?
return entries.map { |entry| entry["entry"] }
else
echoln "No custom entry found for sprite " + sprite.to_s
return nil
end
end
def pbFindEncounter(enc_types, species)
return false if !enc_types
enc_types.each_value do |slots|
@@ -526,6 +574,7 @@ class PokemonPokedexInfo_Scene
dorefresh = false
if Input.trigger?(Input::ACTION)
pbSEStop
#reloadDexEntry()
Pokemon.play_cry(@species, @form) if @page == 1
elsif Input.trigger?(Input::BACK)
pbPlayCloseMenuSE

View File

@@ -1203,7 +1203,6 @@ class PokemonPartyScreen
cmdItem = -1
# Build the commands
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdNickname = commands.length] = _INTL("Nickname") if !pkmn.egg?
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
if !pkmn.egg?
# Check for hidden moves and add any that were found
@@ -1222,6 +1221,7 @@ class PokemonPartyScreen
commands[cmdItem = commands.length] = _INTL("Item")
end
end
commands[cmdNickname = commands.length] = _INTL("Nickname") if !pkmn.egg?
commands[commands.length] = _INTL("Cancel")
command = @scene.pbShowCommands(_INTL("Do what with {1}?", pkmn.name), commands)
havecommand = false

View File

@@ -102,6 +102,8 @@ end
#
#===============================================================================
class PokemonSummary_Scene
NB_PAGES = 5
def pbUpdate
pbUpdateSpriteHash(@sprites)
end
@@ -307,7 +309,7 @@ class PokemonSummary_Scene
base = Color.new(248, 248, 248)
shadow = Color.new(104, 104, 104)
# Set background image
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_#{page}")
@sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_#{page}") if page < NB_PAGES
imagepos = []
# Show the Poké Ball containing the Pokémon
ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball)
@@ -334,7 +336,7 @@ class PokemonSummary_Scene
end
# Show shininess star
if @pokemon.shiny?
addShinyStarsToGraphicsArray(imagepos,2,134,@pokemon.bodyShiny?,@pokemon.headShiny?,@pokemon.debugShiny?,nil,nil,nil,nil,true)
addShinyStarsToGraphicsArray(imagepos, 2, 134, @pokemon.bodyShiny?, @pokemon.headShiny?, @pokemon.debugShiny?, nil, nil, nil, nil, true)
#imagepos.push([sprintf("Graphics/Pictures/shiny"), 2, 134])
end
# Draw all images
@@ -344,7 +346,7 @@ class PokemonSummary_Scene
_INTL("TRAINER MEMO"),
_INTL("SKILLS"),
_INTL("MOVES"),
_INTL("RIBBONS")][page - 1]
_INTL("MOVES")][page - 1]
textpos = [
[pagename, 26, 10, 0, base, shadow],
[@pokemon.name, 46, 56, 0, base, shadow],
@@ -383,6 +385,23 @@ class PokemonSummary_Scene
end
def drawPageOne
# dex_no_y=74
# species_y=106
# type_y=138
# type_y_offset=8
#
# fusion_head_y=170
# fusion_body_y=202
dex_no_y = 74
species_y = 74
type_y = 106
type_y_offset = 8
ot_y = 138
fusion_head_y = 170
fusion_body_y = 202
overlay = @sprites["overlay"].bitmap
base = Color.new(248, 248, 248)
shadow = Color.new(104, 104, 104)
@@ -399,16 +418,32 @@ class PokemonSummary_Scene
end
# Write various bits of text
textpos = [
[_INTL("Dex No."), 238, 74, 0, base, shadow],
[_INTL("Species"), 238, 106, 0, base, shadow],
[@pokemon.speciesName, 435, 106, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Type"), 238, 138, 0, base, shadow],
[_INTL("OT"), 238, 170, 0, base, shadow],
[_INTL("ID No."), 238, 202, 0, base, shadow],
#[_INTL("Dex No."), 238, dex_no_y, 0, base, shadow],
[_INTL("Species"), 238, species_y, 0, base, shadow],
[@pokemon.speciesName, 435, species_y, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Type"), 238, type_y, 0, base, shadow],
[_INTL("OT"), 238, ot_y, 0, base, shadow],
# [_INTL("ID No."), 238, id_no_y, 0, base, shadow],
]
# Write the Regional/National Dex number
dexnum = GameData::Species.get(@pokemon.species).id_number
dexnumshift = false
if @pokemon.isFusion?
headName = getPokemon(@pokemon.species_data.get_head_species).name
bodyName = getPokemon(@pokemon.species_data.get_body_species).name
textpos << [_INTL("Head"), 238, fusion_head_y, 0, base, shadow]
textpos << [headName, 435, fusion_head_y, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)]
textpos << [_INTL("Body"), 238, fusion_body_y, 0, base, shadow]
textpos << [bodyName, 435, fusion_body_y, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)]
else
dexnum = GameData::Species.get(@pokemon.species).id_number
textpos << [_INTL("Dex No"), 238, fusion_head_y, 0, base, shadow]
textpos << [sprintf("%03d", dexnum), 435, fusion_head_y, 2, dexNumBase, dexNumShadow]
end
# # Write the Regional/National Dex number
# dexnum = GameData::Species.get(@pokemon.species).id_number
# dexnumshift = false
# if $Trainer.pokedex.unlocked?(-1) # National Dex is unlocked
# dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(-1)
# else
@@ -422,16 +457,16 @@ class PokemonSummary_Scene
# break
# end
# end
if dexnum <= 0
textpos.push(["???", 435, 74, 2, dexNumBase, dexNumShadow])
else
dexnum -= 1 if dexnumshift
textpos.push([sprintf("%03d", dexnum), 435, 74, 2, dexNumBase, dexNumShadow])
end
# if dexnum <= 0
# textpos.push(["???", 435, 74, 2, dexNumBase, dexNumShadow])
# else
# dexnum -= 1 if dexnumshift
# textpos.push([sprintf("%03d", dexnum), 435, 74, 2, dexNumBase, dexNumShadow])
# end
# Write Original Trainer's name and ID number
if @pokemon.owner.name.empty?
textpos.push([_INTL("RENTAL"), 435, 170, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push(["?????", 435, 202, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("RENTAL"), 435, ot_y, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
#textpos.push(["?????", 435, 202, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
else
ownerbase = Color.new(64, 64, 64)
ownershadow = Color.new(176, 176, 176)
@@ -443,27 +478,27 @@ class PokemonSummary_Scene
ownerbase = Color.new(248, 56, 32)
ownershadow = Color.new(224, 152, 144)
end
textpos.push([@pokemon.owner.name, 435, 170, 2, ownerbase, ownershadow])
textpos.push([sprintf("%05d", @pokemon.owner.public_id), 435, 202, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([@pokemon.owner.name, 435, ot_y, 2, ownerbase, ownershadow])
#textpos.push([sprintf("%05d", @pokemon.owner.public_id), 435, 202, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
end
# Write Exp text OR heart gauge message (if a Shadow Pokémon)
if @pokemon.shadowPokemon?
textpos.push([_INTL("Heart Gauge"), 238, 234, 0, base, shadow])
heartmessage = [_INTL("The door to its heart is open! Undo the final lock!"),
_INTL("The door to its heart is almost fully open."),
_INTL("The door to its heart is nearly open."),
_INTL("The door to its heart is opening wider."),
_INTL("The door to its heart is opening up."),
_INTL("The door to its heart is tightly shut.")][@pokemon.heartStage]
memo = sprintf("<c3=404040,B0B0B0>%s\n", heartmessage)
drawFormattedTextEx(overlay, 234, 304, 264, memo)
else
endexp = @pokemon.growth_rate.minimum_exp_for_level(@pokemon.level + 1)
textpos.push([_INTL("Exp. Points"), 238, 234, 0, base, shadow])
textpos.push([@pokemon.exp.to_s_formatted, 488, 266, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("To Next Lv."), 238, 298, 0, base, shadow])
textpos.push([(endexp - @pokemon.exp).to_s_formatted, 488, 330, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)])
end
# if @pokemon.shadowPokemon?
# textpos.push([_INTL("Heart Gauge"), 238, 234, 0, base, shadow])
# heartmessage = [_INTL("The door to its heart is open! Undo the final lock!"),
# _INTL("The door to its heart is almost fully open."),
# _INTL("The door to its heart is nearly open."),
# _INTL("The door to its heart is opening wider."),
# _INTL("The door to its heart is opening up."),
# _INTL("The door to its heart is tightly shut.")][@pokemon.heartStage]
# memo = sprintf("<c3=404040,B0B0B0>%s\n", heartmessage)
# drawFormattedTextEx(overlay, 234, 304, 264, memo)
# else
endexp = @pokemon.growth_rate.minimum_exp_for_level(@pokemon.level + 1)
textpos.push([_INTL("Exp. Points"), 238, 234, 0, base, shadow])
textpos.push([@pokemon.exp.to_s_formatted, 488, 266, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("To Next Lv."), 238, 298, 0, base, shadow])
textpos.push([(endexp - @pokemon.exp).to_s_formatted, 488, 330, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)])
#end
# Draw all text
pbDrawTextPositions(overlay, textpos)
# Draw Pokémon type(s)
@@ -471,11 +506,13 @@ class PokemonSummary_Scene
type2_number = GameData::Type.get(@pokemon.type2).id_number
type1rect = Rect.new(0, type1_number * 28, 64, 28)
type2rect = Rect.new(0, type2_number * 28, 64, 28)
type_graphics_y = type_y + type_y_offset
if @pokemon.type1 == @pokemon.type2
overlay.blt(402, 146, @typebitmap.bitmap, type1rect)
overlay.blt(402, type_graphics_y, @typebitmap.bitmap, type1rect)
else
overlay.blt(370, 146, @typebitmap.bitmap, type1rect)
overlay.blt(436, 146, @typebitmap.bitmap, type2rect)
overlay.blt(370, type_graphics_y, @typebitmap.bitmap, type1rect)
overlay.blt(436, type_graphics_y, @typebitmap.bitmap, type2rect)
end
# Draw Exp bar
if @pokemon.level < GameData::GrowthRate.max_level
@@ -689,7 +726,6 @@ class PokemonSummary_Scene
# end
# end
# Draw all text
pbDrawTextPositions(overlay, textpos)
# Draw HP bar
@@ -868,32 +904,45 @@ class PokemonSummary_Scene
end
def drawPageFive
overlay = @sprites["overlay"].bitmap
@sprites["uparrow"].visible = false
@sprites["downarrow"].visible = false
# Write various bits of text
textpos = [
[_INTL("No. of Ribbons:"), 234, 326, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[@pokemon.numRibbons.to_s, 450, 326, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
]
# Draw all text
pbDrawTextPositions(overlay, textpos)
# Show all ribbons
imagepos = []
coord = 0
for i in @ribbonOffset * 4...@ribbonOffset * 4 + 12
break if !@pokemon.ribbons[i]
ribbon_data = GameData::Ribbon.get(@pokemon.ribbons[i])
ribn = ribbon_data.id_number - 1
imagepos.push(["Graphics/Pictures/ribbons",
230 + 68 * (coord % 4), 78 + 68 * (coord / 4).floor,
64 * (ribn % 8), 64 * (ribn / 8).floor, 64, 64])
coord += 1
end
# Draw all images
pbDrawImagePositions(overlay, imagepos)
return if !$Trainer.has_pokedex
$Trainer.pokedex.register_last_seen(@pokemon)
pbFadeOutIn {
scene = PokemonPokedexInfo_Scene.new
screen = PokemonPokedexInfoScreen.new(scene)
screen.pbStartSceneSingle(@pokemon.species)
}
pbChangePokemon
@page -= 1
drawPageFour #stay on the same page
end
# def drawPageFive
# overlay = @sprites["overlay"].bitmap
# @sprites["uparrow"].visible = false
# @sprites["downarrow"].visible = false
# # Write various bits of text
# textpos = [
# [_INTL("No. of Ribbons:"), 234, 326, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)],
# [@pokemon.numRibbons.to_s, 450, 326, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
# ]
# # Draw all text
# pbDrawTextPositions(overlay, textpos)
# # Show all ribbons
# imagepos = []
# coord = 0
# for i in @ribbonOffset * 4...@ribbonOffset * 4 + 12
# break if !@pokemon.ribbons[i]
# ribbon_data = GameData::Ribbon.get(@pokemon.ribbons[i])
# ribn = ribbon_data.id_number - 1
# imagepos.push(["Graphics/Pictures/ribbons",
# 230 + 68 * (coord % 4), 78 + 68 * (coord / 4).floor,
# 64 * (ribn % 8), 64 * (ribn / 8).floor, 64, 64])
# coord += 1
# end
# # Draw all images
# pbDrawImagePositions(overlay, imagepos)
# end
def drawSelectedRibbon(ribbonid)
# Draw all of page five
drawPage(5)
@@ -1232,7 +1281,7 @@ class PokemonSummary_Scene
commands[cmdGiveItem = commands.length] = _INTL("Give item")
commands[cmdTakeItem = commands.length] = _INTL("Take item") if @pokemon.hasItem?
end
commands[cmdPokedex = commands.length] = _INTL("View Pokédex") if $Trainer.has_pokedex
commands[cmdPokedex = commands.length] = _INTL("View Pokédex") if $Trainer.has_pokedex
end
commands[cmdMark = commands.length] = _INTL("Mark")
commands[commands.length] = _INTL("Cancel")
@@ -1256,6 +1305,7 @@ class PokemonSummary_Scene
screen = PokemonPokedexInfoScreen.new(scene)
screen.pbStartSceneSingle(@pokemon.species)
}
pbChangePokemon
dorefresh = true
elsif cmdMark >= 0 && command == cmdMark
dorefresh = pbMarking(@pokemon)
@@ -1320,9 +1370,10 @@ class PokemonSummary_Scene
pbMoveSelection
dorefresh = true
elsif @page == 5
@page -= 1
pbPlayDecisionSE
pbRibbonSelection
dorefresh = true
#pbRibbonSelection
#dorefresh = true
elsif !@inbattle
pbPlayDecisionSE
dorefresh = pbOptions
@@ -1354,14 +1405,18 @@ class PokemonSummary_Scene
dorefresh = true
end
elsif Input.trigger?(Input::RIGHT) && !@pokemon.egg?
oldpage = @page
@page += 1
@page = 1 if @page < 1
@page = 5 if @page > 5
if @page != oldpage # Move to next page
pbSEPlay("GUI summary change page")
@ribbonOffset = 0
dorefresh = true
if @page == 4 && !$Trainer.has_pokedex
pbSEPlay("GUI sel buzzer")
else
oldpage = @page
@page += 1
@page = 1 if @page < 1
@page = 5 if @page > 5
if @page != oldpage # Move to next page
pbSEPlay("GUI summary change page")
@ribbonOffset = 0
dorefresh = true
end
end
end
if dorefresh

View File

@@ -17,6 +17,8 @@ class PokemonSystem
attr_accessor :level_caps
attr_accessor :battle_type
attr_accessor :download_sprites
attr_accessor :speedup
attr_accessor :speedup_speed
def initialize
@textspeed = 1 # Text speed (0=slow, 1=normal, 2=fast)
@@ -32,8 +34,9 @@ class PokemonSystem
@textinput = 1 # Text input mode (0=cursor, 1=keyboard)
@quicksurf = 0
@battle_type = 0
@speedup = 0 #0= hold, 1=toggle
@speedup_speed = 3 #for hold only
@download_sprites = 0
end
end
@@ -197,10 +200,10 @@ class Window_PokemonOption < Window_DrawableCommand
@selBaseColor = Color.new(31 * 8, 6 * 8, 3 * 8)
@selShadowColor = Color.new(31 * 8, 17 * 8, 16 * 8)
@optvalues = []
@mustUpdateOptions = false
@mustUpdateOptions = false
@mustUpdateDescription = false
@selected_position = 0
@allow_arrows_jump=false
@allow_arrows_jump = false
for i in 0...@options.length
@optvalues[i] = 0
end
@@ -439,6 +442,14 @@ class PokemonOption_Scene
end
}, "Sets the volume for sound effects"
)
options << EnumOption.new(_INTL("Default Movement"), [_INTL("Walking"), _INTL("Running")],
proc { $PokemonSystem.runstyle },
proc { |value| $PokemonSystem.runstyle = value },
["Default to walking when not holding the Run key",
"Default to running when not holding the Run key"]
)
options << EnumOption.new(_INTL("Text Speed"), [_INTL("Normal"), _INTL("Fast")],
proc { $PokemonSystem.textspeed },
proc { |value|
@@ -446,6 +457,36 @@ class PokemonOption_Scene
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
}, "Sets the speed at which the text is displayed"
)
if $game_switches
options <<
EnumOption.new(_INTL("Autosave"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[AUTOSAVE_ENABLED_SWITCH] ? 0 : 1 },
proc { |value|
if !$game_switches[AUTOSAVE_ENABLED_SWITCH] && value == 0
@autosave_menu = true
openAutosaveMenu()
end
$game_switches[AUTOSAVE_ENABLED_SWITCH] = value == 0
},
"Automatically saves when healing at Pokémon centers"
)
end
options << EnumOption.new(_INTL("Speed-up type"), [_INTL("Hold"), _INTL("Toggle")],
proc { $PokemonSystem.speedup },
proc { |value|
$PokemonSystem.speedup = value
}, "Pick how you want speed-up to be enabled"
)
options << SliderOption.new(_INTL("Speed-up speed"), 1, 10, 1,
proc { $PokemonSystem.speedup_speed },
proc { |value|
$PokemonSystem.speedup_speed = value
}, "Sets by how much to speed up the game when holding the speed up button (Default: 3x)"
)
# if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) #beat the league
# options << EnumOption.new(_INTL("Text Speed"), [_INTL("Normal"), _INTL("Fast"), _INTL("Instant")],
# proc { $PokemonSystem.textspeed },
@@ -465,7 +506,7 @@ class PokemonOption_Scene
# end
options <<
EnumOption.new(_INTL("Download sprites"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.download_sprites},
proc { $PokemonSystem.download_sprites },
proc { |value|
$PokemonSystem.download_sprites = value
},
@@ -474,22 +515,6 @@ class PokemonOption_Scene
if $game_switches
options <<
EnumOption.new(_INTL("Autosave"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[AUTOSAVE_ENABLED_SWITCH] ? 0 : 1 },
proc { |value|
if !$game_switches[AUTOSAVE_ENABLED_SWITCH] && value == 0
@autosave_menu = true
openAutosaveMenu()
end
$game_switches[AUTOSAVE_ENABLED_SWITCH] = value == 0
},
"Automatically saves when healing at Pokémon centers"
)
end
if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) #beat the league
options <<
EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")],
@@ -522,12 +547,6 @@ class PokemonOption_Scene
"No prompt to switch Pokémon before the opponent sends the next one"]
)
options << EnumOption.new(_INTL("Default Movement"), [_INTL("Walking"), _INTL("Running")],
proc { $PokemonSystem.runstyle },
proc { |value| $PokemonSystem.runstyle = value },
["Default to walking when not holding the Run key",
"Default to running when not holding the Run key"]
)
options << NumberOption.new(_INTL("Speech Frame"), 1, Settings::SPEECH_WINDOWSKINS.length,
proc { $PokemonSystem.textskin },

View File

@@ -56,7 +56,9 @@ def pbNicknameAndStore(pkmn)
$Trainer.pokedex.set_seen(pkmn.species)
$Trainer.pokedex.set_owned(pkmn.species)
pbNickname(pkmn)
pbStorePokemon(pkmn)
promptCaughtPokemonAction(pkmn)
#pbStorePokemon(pkmn)
end
#===============================================================================

View File

@@ -1,3 +1,5 @@
require 'zlib'
#===============================================================================
# Records which file, section and line are currently being read
#===============================================================================
@@ -737,7 +739,7 @@ module Compiler
def main
return
#return
return if !$DEBUG
begin
dataFiles = [

View File

@@ -358,37 +358,38 @@ class RandomizerItemOptionsScene < PokemonOption_Scene
def pbGetOptions(inloadscreen = false)
options = [
EnumOption.new(_INTL("Type"), [_INTL("Mapped"), _INTL("Dynamic")],
proc {
if $game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC]
1
else
0
end
},
proc { |value|
if value == 0
$game_switches[SWITCH_RANDOM_ITEMS_MAPPED] = true
$game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC] = false
else
value == 1
$game_switches[SWITCH_RANDOM_ITEMS_MAPPED] = false
$game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC] = true
end
},
[
"Random items are decided at the start of the game",
"Random items are decided as you obtain them"],
# EnumOption.new(_INTL("Type"), [_INTL("Mapped"), _INTL("Dynamic")],
# proc {
# if $game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC]
# 1
# else
# 0
# end
# },
# proc { |value|
# if value == 0
# $game_switches[SWITCH_RANDOM_ITEMS_MAPPED] = true
# $game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC] = false
# else
# value == 1
# $game_switches[SWITCH_RANDOM_ITEMS_MAPPED] = false
# $game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC] = true
# end
# },
# [
# "Random items are decided at the start of the game",
# "Random items are decided as you obtain them"],
# proc { $game_switches[SWITCH_RANDOM_ITEMS_FULL] ? 0 : 1 },
# proc { |value|
# $game_switches[SWITCH_RANDOM_ITEMS_MAPPED] = value == 0
# $game_switches[SWITCH_RANDOM_ITEMS_FULL] = value == 1
# }, ["Random items are decided at the start of the game", "Random items are decided as you obtain them"]
),
#),
EnumOption.new(_INTL("Found items"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[SWITCH_RANDOM_FOUND_ITEMS] ? 0 : 1 },
proc { |value|
$game_switches[SWITCH_RANDOM_FOUND_ITEMS] = value == 0
$game_switches[SWITCH_RANDOM_ITEMS_MAPPED] = value == 0
$game_switches[SWITCH_RANDOM_ITEMS] = $game_switches[SWITCH_RANDOM_FOUND_ITEMS] || $game_switches[SWITCH_RANDOM_GIVEN_ITEMS]
}, "Randomize the items picked up on the ground"
),

View File

@@ -31,9 +31,9 @@ def getRandomGivenTM(item)
newItem = $PokemonGlobal.randomTMsHash[item.id]
return GameData::Item.get(newItem) if newItem != nil
end
if $game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC]
return pbGetRandomTM
end
# if $game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC]
# return pbGetRandomTM
# end
return item
end
@@ -57,30 +57,31 @@ def getMappedRandomItem(item)
end
def getDynamicRandomItem(item)
#keyItem ou HM -> on randomize pas
return item if item.is_key_item?
return item if item.is_HM?
return item if NON_RANDOMIZE_ITEMS.include?(item.id)
#TM
if (item.is_TM?)
return $game_switches[SWITCH_RANDOM_TMS] ? pbGetRandomTM() : item
end
#item normal
return item if !$game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC] || !$game_switches[SWITCH_RANDOM_ITEMS]
#berries
return pbGetRandomBerry() if item.is_berry?
items_list = GameData::Item.list_all
newItem_id = items_list.keys.sample
newItem = GameData::Item.get(newItem_id)
while (newItem.is_machine? || newItem.is_key_item? || INVALID_ITEMS.include?(newItem))
newItem_id = items_list.keys.sample
newItem = GameData::Item.get(newItem_id)
end
return newItem
return item
# #keyItem ou HM -> on randomize pas
# return item if item.is_key_item?
# return item if item.is_HM?
# return item if NON_RANDOMIZE_ITEMS.include?(item.id)
#
# #TM
# if (item.is_TM?)
# return $game_switches[SWITCH_RANDOM_TMS] ? pbGetRandomTM() : item
# end
# #item normal
# return item if !$game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC] || !$game_switches[SWITCH_RANDOM_ITEMS]
#
#
# #berries
# return pbGetRandomBerry() if item.is_berry?
#
# items_list = GameData::Item.list_all
# newItem_id = items_list.keys.sample
# newItem = GameData::Item.get(newItem_id)
# while (newItem.is_machine? || newItem.is_key_item? || INVALID_ITEMS.include?(newItem))
# newItem_id = items_list.keys.sample
# newItem = GameData::Item.get(newItem_id)
# end
# return newItem
end
def pbGetRandomItem(item_id)
@@ -89,8 +90,8 @@ def pbGetRandomItem(item_id)
return item if !($game_switches[SWITCH_RANDOM_ITEMS] || $game_switches[SWITCH_RANDOM_TMS])
if $game_switches[SWITCH_RANDOM_ITEMS_MAPPED]
return getMappedRandomItem(item)
elsif $game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC]
return getDynamicRandomItem(item)
# elsif $game_switches[SWITCH_RANDOM_ITEMS_DYNAMIC]
# return getDynamicRandomItem(item)
end
return item
end

View File

@@ -303,6 +303,8 @@ def getTrainersDataMode
mode = GameData::Trainer
if $game_switches && $game_switches[SWITCH_MODERN_MODE]
mode = GameData::TrainerModern
elsif $game_switches && $game_switches[SWITCH_EXPERT_MODE]
mode = GameData::TrainerExpert
end
return mode
end

View File

@@ -96,6 +96,15 @@ module GameData
return id.to_s.match(/(?<=H)\d+/)[0].to_i
end
def get_body_species
return @body_pokemon
end
def get_head_species
return @head_pokemon
end
def adjust_stats_with_evs
GameData::Stat.each_main do |s|
@base_stats[s.id] = 1 if !@base_stats[s.id] || @base_stats[s.id] <= 0

View File

@@ -257,7 +257,7 @@ module GameData
["Scep", "tile"],
["Torch", "chic"],
["Com", "busken"],
["Blaz", "ziken"],
["Bla", "ziken"],
["Mud", "kip"],
["Marsh", "tomp"],
["Swamp", "pert"],
@@ -400,7 +400,7 @@ module GameData
["Starav", "avia"],
["Starap", "raptor"],
["Bi", "doof"],
["Biba", "rel"],
["Bi", "barel"],
["Kri", "ketot"],
["Kricke", "tune"],
["Shi", "nx"],
@@ -595,10 +595,10 @@ module GameData
["Frill", "illish"],
["Jelli", "cent"],
["Alomo", "mola"],
["Jolti", "tik"],
["Jol", "tik"],
["Galvan", "tula"],
["Ferros", "seed"],
["Ferrot", "thorn"],
["Ferro", "seed"],
["Ferron ", "thorn"],
["Kli", "ink"],
["Kla", "ang"],
["Klink", "klang"],
@@ -1124,6 +1124,11 @@ module GameData
463 => 744,
464 => 745,
465 => 745,
466 => 648,
467 => 648,
468 => 488,
469 => 779,
470 => 800,
}
end

View File

@@ -21,10 +21,12 @@ SWITCH_REVERSED_MODE = 47
SWITCH_GAME_DIFFICULTY_EASY = 665
SWITCH_GAME_DIFFICULTY_HARD = 666
SWITCH_MODERN_MODE=974
SWITCH_EXPERT_MODE=772
SWITCH_V5_1=825
SWITCH_NO_LEVELS_MODE=774
SWITCH_DOUBLE_ABILITIES=773
SWITCH_SINGLE_SPECIES_MODE=790
#Game progression switches
SWITCH_DURING_INTRO = 917
SWITCH_CHOOSING_STARTER=3
@@ -65,6 +67,8 @@ SWITCH_PICKED_ANORITH_FOSSIL= 90
SWITCH_PICKED_ARMOR_FOSSIL= 616
SWITCH_PICKED_SKULL_FOSSIL= 617
SWITCH_NIGHTMARE_EFFECT= 805
VAR_ORICORIO_FLOWERS = 276
#Randomizer Switches
@@ -121,6 +125,14 @@ SWITCH_SUPER_SLOW_SPEED=649
SWITCH_LOUNGE_BATTLE_LEVEL = 240
SWITCH_CANNOT_CATCH_POKEMON = 75
SWITCH_LOCK_PLAYER_MOVEMENT = 815
SWITCH_BAND_DRUMMER = 1004
SWITCH_BAND_ACOUSTIC_GUITAR = 1005
SWITCH_BAND_ELECTRIC_GUITAR = 1006
SWITCH_BAND_HARP = 1007
SWITCH_BAND_FLUTE = 1008
#############
# VARIABLES #
#############
@@ -159,10 +171,13 @@ VAR_STAT_NB_SECRETS=193
VAR_STAT_FUSION_QUIZ_HIGHEST_SCORE=267
VAR_STAT_FUSION_QUIZ_NB_TIMES=268
VAR_STAT_FUSION_QUIZ_TOTAL_PTS=269
VAR_KARMA=222
VAR_LUNAR_FEATHERS=282
VAR_FOSSIL=271
VAR_BATTLE_TOWER_MIN_BST = 257
VAR_BATTLE_TOWER_MAX_BST = 258
@@ -180,12 +195,44 @@ VAR_RANDOMIZER_TRAINER_BST=195
VAR_GYM_TYPES_ARRAY=151
VAR_CURRENT_GYM_TYPE=152
#constellations
VAR_CONSTELLATION_IVYSAUR=301
VAR_CONSTELLATION_WARTORTLE=302
VAR_CONSTELLATION_ARCANINE=303
VAR_CONSTELLATION_MACHOKE=304
VAR_CONSTELLATION_RAPIDASH=305
VAR_CONSTELLATION_GYARADOS=306
VAR_CONSTELLATION_ARTICUNO=307
VAR_CONSTELLATION_MEW=308
VAR_CONSTELLATION_POLITOED=309
VAR_CONSTELLATION_URSARING=310
VAR_CONSTELLATION_LUGIA=311
VAR_CONSTELLATION_HOOH=312
VAR_CONSTELLATION_CELEBI=313
VAR_CONSTELLATION_SLAKING=314
VAR_CONSTELLATION_JIRACHI=315
VAR_CONSTELLATION_TYRANTRUM=316
VAR_CONSTELLATION_SHARPEDO=317
VAR_CONSTELLATION_ARCEUS=318
VAR_LATEST_CONSTELLATION=319
##############
# COMMON EVENTS
################
COMMON_EVENT_REGI_TABLET = 84
COMMON_EVENT_SILHOUETTE = 87
COMMON_EVENT_HOTEL = 12
COMMON_EVENT_SINGLESPECIES_MODE = 73
##############
# ANIMATIONS
################
DUST_ANIMATION_ID=2
VIRUS_ANIMATION_ID=10
#############
# OTHERS #
#############
@@ -194,6 +241,13 @@ DIRECTION_RIGHT = 6
DIRECTION_DOWN = 2
DIRECTION_UP = 8
DUST_ANIMATION_ID=2
VAR_SPEED_UP_TOGGLE_SPEED=23
MAP_TEMPLATE_EVENTS = 175
TEMPLATE_EVENT_SILHOUETTE = 7
SWITCH_TRIPLE_BOSS_BATTLE = 824
SWITCH_SILVERBOSS_BATTLE = 675
MELOETTA_BAND_NAME = "Miss Melody and the Mystic Musicians"
SUCKY_BAND_NAME = "MooMoo Milk"

View File

@@ -1,7 +1,7 @@
module PBSpecies
#couldn't figure out how to get the size of GameData::Species so fuck it, here's the hardcoded value
def PBSpecies.maxValue
return NB_POKEMON*NB_POKEMON
return (NB_POKEMON*NB_POKEMON)+NB_POKEMON
end
def PBSpecies.getName(species)

View File

@@ -165,12 +165,12 @@ class FusionTutorService
compatibleMoves << :THOUSANDWAVES if is_fusion_of([:STUNFISK, :QUAGSIRE, :SWAMPERT])
compatibleMoves << :FREEZESHOCK if is_fusion_of([:KYUREM, :ARTICUNO]) && hasType(:ELECTRIC)
compatibleMoves << :ICEBURN if is_fusion_of([:KYUREM, :ARTICUNO]) && hasType(:FIRE)
compatibleMoves << :RELICSONG if is_fusion_of([:JYNX, :LAPRAS, :JIGGLYPUFF, :WIGGLYTUFF, :MISDREAVUS, :MISMAGIUS])
#compatibleMoves << :RELICSONG if is_fusion_of([:JYNX, :LAPRAS, :JIGGLYPUFF, :WIGGLYTUFF, :MISDREAVUS, :MISMAGIUS])
compatibleMoves << :HAPPYHOUR if is_fusion_of([:MEOWTH, :JIRACHI, :DELIBIRD, :MUNCHLAX, :SNORLAX, :PIKACHU, :RAICHU])
compatibleMoves << :HOLDHANDS if is_fusion_of([:CHARMANDER, :BULBASAUR, :SQUIRTLE, :PIKACHU, :TOGEPI])
#compatibleMoves << :PRISMATICLASER if is_fusion_of([:LANTURN, :AMPHAROS, :HOOH, :DEOXYS, :MEWTWO, :MEW]) && hasType(:PSYCHIC)
#compatibleMoves << :PHOTONGEYSER if is_fusion_of([:LANTURN, :AMPHAROS, :HOOH, :MEW, :MEWTWO, :DEOXYS]) && hasType(:PSYCHIC)
compatibleMoves << :LUNARDANCE if is_fusion_of([:CLEFAIRY, :CLEFABLE, :STARYU, :STARMIE])
# compatibleMoves << :LUNARDANCE if is_fusion_of([:CLEFAIRY, :CLEFABLE, :STARYU, :STARMIE])
compatibleMoves << :DIAMONDSTORM if ((hasType(:FAIRY) && hasType(:ROCK)) || (hasType(:ROCK) && hasType(:STEEL))) || is_fusion_of([:DIALGA, :STEELIX])
compatibleMoves << :SUNSTEELSTRIKE if is_fusion_of([:CHARIZARD, :VOLCARONA, :FLAREON, :NINETALES, :ENTEI, :HOOH, :RAPIDASH]) && hasType(:STEEL)
compatibleMoves << :DOUBLEIRONBASH if canLearnMove(:DOUBLESLAP) && hasType(:STEEL)

View File

@@ -71,8 +71,9 @@ module GameData
end
def self.front_sprite_bitmap(dex_number, spriteform_body = nil, spriteform_head = nil, isShiny = false, bodyShiny = false, headShiny = false)
spriteform_body = nil if spriteform_body == 0
spriteform_head = nil if spriteform_head == 0
spriteform_body = nil# if spriteform_body == 0
spriteform_head = nil# if spriteform_head == 0
#TODO Remove spriteform mechanic entirely
#la méthode est utilisé ailleurs avec d'autres arguments (gender, form, etc.) mais on les veut pas
if dex_number.is_a?(Symbol)
@@ -267,6 +268,16 @@ class PokemonGlobalMetadata
attr_accessor :autogen_sprites_cache
end
#To force a specific sprites before a battle
#
# ex:
# $PokemonTemp.forced_alt_sprites={"20.25" => "20.25a"}
#
class PokemonTemp
attr_accessor :forced_alt_sprites
end
#todo: refactor into smaller methods
def get_fusion_sprite_path(head_id, body_id, spriteform_body = nil, spriteform_head = nil)
$PokemonGlobal.autogen_sprites_cache = {} if $PokemonGlobal && !$PokemonGlobal.autogen_sprites_cache
#Todo: ça va chier si on fusionne une forme d'un pokemon avec une autre forme, mais pas un problème pour tout de suite
@@ -278,23 +289,33 @@ def get_fusion_sprite_path(head_id, body_id, spriteform_body = nil, spriteform_h
dex_num = getSpeciesIdForFusion(head_id, body_id)
substitution_id = dex_num.to_s + form_suffix
if alt_sprites_substitutions_available && $PokemonGlobal.alt_sprite_substitutions.keys.include?(substitution_id)
substitutionPath= $PokemonGlobal.alt_sprite_substitutions[substitution_id]
return substitutionPath if pbResolveBitmap(substitutionPath)
end
random_alt = get_random_alt_letter_for_custom(head_id, body_id) #nil if no main
random_alt = "" if !random_alt
#Try local custom sprite
spriteform_body_letter = spriteform_body ? "_" + spriteform_body.to_s : ""
spriteform_head_letter = spriteform_head ? "_" + spriteform_head.to_s : ""
filename = _INTL("{1}{2}.{3}{4}{5}.png", head_id, spriteform_head_letter, body_id, spriteform_body_letter, random_alt)
pokemon_name = _INTL("{1}{2}.{3}{4}",head_id, spriteform_head_letter, body_id, spriteform_body_letter)
#get altSprite letter
random_alt = get_random_alt_letter_for_custom(head_id, body_id) #nil if no main
random_alt = "" if !random_alt
forcingSprite=false
if $PokemonTemp.forced_alt_sprites && $PokemonTemp.forced_alt_sprites.key?(pokemon_name)
random_alt = $PokemonTemp.forced_alt_sprites[pokemon_name]
forcingSprite=true
end
filename = _INTL("{1}{2}.png", pokemon_name, random_alt)
#Try local custom sprite
local_custom_path = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + head_id.to_s + spriteform_head_letter + "/" + filename
if pbResolveBitmap(local_custom_path)
record_sprite_substitution(substitution_id, local_custom_path)
record_sprite_substitution(substitution_id, local_custom_path) if !forcingSprite
return local_custom_path
end
#if the game has loaded an autogen earlier, no point in trying to redownload, so load that instead
@@ -303,7 +324,7 @@ def get_fusion_sprite_path(head_id, body_id, spriteform_body = nil, spriteform_h
#Try to download custom sprite if none found locally
downloaded_custom = download_custom_sprite(head_id, body_id, spriteform_body_letter, spriteform_head_letter, random_alt)
if downloaded_custom
record_sprite_substitution(substitution_id, downloaded_custom)
record_sprite_substitution(substitution_id, downloaded_custom) if !forcingSprite
return downloaded_custom
end
@@ -370,16 +391,23 @@ def list_alt_sprite_letters(spriteName)
end
end
def map_alt_sprite_letters_for_pokemon(spriteName)
alt_sprites = {}
File.foreach(Settings::CREDITS_FILE_PATH) do |line|
row = line.split(',')
sprite_name = row[0]
if sprite_name.start_with?(spriteName) && sprite_name.length > spriteName.length
letter = sprite_name[spriteName.length]
if letter.match?(/[a-zA-Z]/)
main_or_alt = row[2] ? row[2] : nil
alt_sprites[letter] = main_or_alt
if sprite_name.start_with?(spriteName)
if sprite_name.length > spriteName.length #alt letter
letter = sprite_name[spriteName.length]
if letter.match?(/[a-zA-Z]/)
main_or_alt = row[2] ? row[2] : nil
alt_sprites[letter] = main_or_alt
end
else #letterless
main_or_alt = row[2] ? row[2] : nil
alt_sprites[""] = main_or_alt
end
end
end

View File

@@ -208,10 +208,10 @@ def playPokeFluteAnimation
pbUpdateSceneMap
end
def restoreDefaultCharacterSprite(charset_number=0)
def restoreDefaultCharacterSprite(charset_number = 0)
meta = GameData::Metadata.get_player($Trainer.character_ID)
$game_player.setDefaultCharName(nil, 0, false)
$game_player.character_name =meta[1]
$game_player.character_name = meta[1]
Graphics.update
Input.update
pbUpdateSceneMap
@@ -431,6 +431,7 @@ KANTO_OUTDOOR_MAPS = [
167, #Crimson city
303, #indigo plateau
380, #Pewter city
827, #Mt. Moon summit
#
# DUNGEONS
#
@@ -464,6 +465,7 @@ KANTO_OUTDOOR_MAPS = [
467, #Pokemon Tower
468, #Pokemon Tower
469, #Pokemon Tower
]
KANTO_DARKNESS_STAGE_1 = [
50, #Lavender town
@@ -528,6 +530,7 @@ KANTO_DARKNESS_STAGE_3 = [
228, #Route 20 underwater 2
98, #Cinnabar island
58, #Route 21
827, #Mt. Moon summit
]
KANTO_DARKNESS_STAGE_4 = KANTO_OUTDOOR_MAPS
@@ -599,8 +602,6 @@ def has_species_or_fusion?(species, form = -1)
return $Trainer.pokemon_party.any? { |p| p && p.isSpecies?(species) || p.isFusionOf(species) }
end
#Solution: position of boulders [[x,y],[x,y],etc.]
def validate_regirock_ice_puzzle(solution)
for boulder_position in solution
@@ -609,32 +610,31 @@ def validate_regirock_ice_puzzle(solution)
# echoln ""
# echoln x.to_s + ", " + y.to_s
# echoln $game_map.event_at_position(x,y)
return false if !$game_map.event_at_position(x,y)
return false if !$game_map.event_at_position(x, y)
end
echoln "all boulders in place"
return true
end
def unpress_all_regirock_steel_switches()
switch_ids = [75,77,76,67, 74,68, 73,72,70,69]
switch_ids = [75, 77, 76, 67, 74, 68, 73, 72, 70, 69]
regi_map = 813
switch_ids.each do |event_id|
pbSetSelfSwitch(event_id,"A",false,regi_map)
pbSetSelfSwitch(event_id, "A", false, regi_map)
end
end
def validate_regirock_steel_puzzle()
expected_pressed_switches = [75,77,74,68,73,69]
expected_unpressed_switches = [76,67,72,70]
switch_ids = [75,77,76,67,
74,68,
73,72,70,69]
expected_pressed_switches = [75, 77, 74, 68, 73, 69]
expected_unpressed_switches = [76, 67, 72, 70]
switch_ids = [75, 77, 76, 67,
74, 68,
73, 72, 70, 69]
pressed_switches =[]
pressed_switches = []
unpressed_switches = []
switch_ids.each do |switch_id|
is_pressed = pbGetSelfSwitch(switch_id,"A")
is_pressed = pbGetSelfSwitch(switch_id, "A")
if is_pressed
pressed_switches << switch_id
else
@@ -642,25 +642,23 @@ def validate_regirock_steel_puzzle()
end
end
for event_id in switch_ids
is_pressed = pbGetSelfSwitch(event_id,"A")
is_pressed = pbGetSelfSwitch(event_id, "A")
return false if !is_pressed && expected_pressed_switches.include?(event_id)
return false if is_pressed && expected_unpressed_switches.include?(event_id)
end
return true
end
def registeel_ice_press_switch(letter)
order = pbGet(1)
solution = "ssBSBGG"#GGSBBss"
solution = "ssBSBGG" #GGSBBss"
registeel_ice_reset_switches() if !order.is_a?(String)
order << letter
pbSet(1,order)
pbSet(1, order)
if order == solution
echoln "OK"
pbSEPlay("Evolution start",nil,130)
pbSEPlay("Evolution start", nil, 130)
elsif order.length >= solution.length
registeel_ice_reset_switches()
end
@@ -668,50 +666,354 @@ def registeel_ice_press_switch(letter)
end
def registeel_ice_reset_switches()
switches_events = [66,78,84,85,86,87,88]
switches_events = [66, 78, 84, 85, 86, 87, 88]
switches_events.each do |switch_id|
pbSetSelfSwitch(switch_id, "A", false)
echoln "reset" + switch_id.to_s
end
pbSet(1,"")
pbSet(1, "")
end
def regirock_steel_move_boulder()
switches_position = [
[16,21],[18,21],[20,21],[22,21],
[16,23], [22,23],
[16,25],[18,25],[20,25],[22,25]
[16, 21], [18, 21], [20, 21], [22, 21],
[16, 23], [22, 23],
[16, 25], [18, 25], [20, 25], [22, 25]
]
boulder_event = get_self
old_x = boulder_event.x
old_y = boulder_event.y
stepped_off_switch = switches_position.find { |position| position[0] == old_x && position[1] == old_y }
pbPushThisBoulder()
boulder_event = get_self
if stepped_off_switch
switch_event = $game_map.get_event_at_position(old_x,old_y,[boulder_event.id])
switch_event = $game_map.get_event_at_position(old_x, old_y, [boulder_event.id])
echoln switch_event.id if switch_event
pbSEPlay("Entering Door",nil,80)
pbSEPlay("Entering Door", nil, 80)
pbSetSelfSwitch(switch_event.id, "A", false) if switch_event
end
stepped_on_switch = switches_position.find { |position| position[0] == boulder_event.x && position[1] == boulder_event.y }
if stepped_on_switch
switch_event = $game_map.get_event_at_position(boulder_event.x,boulder_event.y,[boulder_event.id])
switch_event = $game_map.get_event_at_position(boulder_event.x, boulder_event.y, [boulder_event.id])
echoln switch_event.id if switch_event
pbSEPlay("Entering Door")
pbSetSelfSwitch(switch_event.id, "A", true) if switch_event
end
end
def displayRandomizerErrorMessage()
Kernel.pbMessage(_INTL("The randomizer has encountered an error. You should try to re-randomize your game as soon as possible."))
Kernel.pbMessage(_INTL("You can do this on the top floor of Pokémon Centers."))
end
#ex:Game_Event.new
# forced_sprites = {"1.133" => "a"}
# setForcedAltSprites(forced_sprites)
#
def setForcedAltSprites(forcedSprites_map)
$PokemonTemp.forced_alt_sprites = forcedSprites_map
end
def playMeloettaBandMusic()
unlocked_members = []
unlocked_members << :DRUM if $game_switches[SWITCH_BAND_DRUMMER]
unlocked_members << :AGUITAR if $game_switches[SWITCH_BAND_ACOUSTIC_GUITAR]
unlocked_members << :EGUITAR if $game_switches[SWITCH_BAND_ELECTRIC_GUITAR]
unlocked_members << :FLUTE if $game_switches[SWITCH_BAND_FLUTE]
unlocked_members << :HARP if $game_switches[SWITCH_BAND_HARP]
echoln unlocked_members
echoln (unlocked_members & [:DRUM, :AGUITAR, :EGUITAR, :FLUTE, :HARP])
track = "band/band_1"
if unlocked_members == [:DRUM, :AGUITAR, :EGUITAR, :FLUTE, :HARP]
track = "band/band_full"
else
if unlocked_members.include?(:FLUTE)
track = "band/band_5a"
elsif unlocked_members.include?(:HARP)
track = "band/band_5b"
else
if unlocked_members.include?(:EGUITAR) && unlocked_members.include?(:AGUITAR)
track = "band/band_4"
elsif unlocked_members.include?(:AGUITAR)
track = "band/band_3a"
elsif unlocked_members.include?(:EGUITAR)
track = "band/band_3b"
elsif unlocked_members.include?(:DRUM)
track = "band/band_2"
end
end
end
echoln track
pbBGMPlay(track)
end
def setPokemonMoves(pokemon, move_ids = [])
moves = []
move_ids.each { |move_id|
moves << Pokemon::Move.new(move_id)
}
pokemon.moves = moves
end
def isTuesdayNight()
day = getDayOfTheWeek()
hour = pbGetTimeNow().hour
echoln hour
return (day == :TUESDAY && hour >= 20) || (day == :WEDNESDAY && hour < 5)
end
def apply_concert_lighting(light, duration = 1)
tone = Tone.new(0, 0, 0)
case light
when :GUITAR_HIT
tone = Tone.new(-50, -100, -50)
when :VERSE_1
tone = Tone.new(-90, -110, -50)
when :VERSE_2_LIGHT
tone = Tone.new(-40, -80, -30)
when :VERSE_2_DIM
tone = Tone.new(-60, -100, -50)
when :CHORUS_1
tone = Tone.new(0, -80, -50)
when :CHORUS_2
tone = Tone.new(0, -50, -80)
when :CHORUS_3
tone = Tone.new(0, -80, -80)
when :CHORUS_END
tone = Tone.new(-68, 0, -102)
when :MELOETTA_1
tone = Tone.new(-60, -50, 20)
end
$game_screen.start_tone_change(tone, duration)
end
def replaceFusionSpecies(pokemon, speciesToChange, newSpecies)
currentBody = pokemon.species_data.get_body_species()
currentHead = pokemon.species_data.get_head_species()
should_update_body = currentBody == speciesToChange
should_update_head = currentHead == speciesToChange
return if !should_update_body && !should_update_head
newSpeciesBody = should_update_body ? newSpecies : currentBody
newSpeciesHead = should_update_head ? newSpecies : currentHead
newSpecies = getFusionSpecies(newSpeciesBody, newSpeciesHead)
pokemon.species = newSpecies
end
def changeSpeciesSpecific(pokemon, newSpecies)
pokemon.species = newSpecies
$Trainer.pokedex.set_seen(newSpecies)
$Trainer.pokedex.set_owned(newSpecies)
end
def getNextLunarFeatherHint()
nb_feathers = pbGet(VAR_LUNAR_FEATHERS)
case nb_feathers
when 0
return "Find the first feather in the northernmost dwelling in the city of sunsets..."
when 1
return "Amidst a playground for Pokémon youngsters, the second feather hides, surrounded by innocence."
when 2
return "Find the next one in the inn where water meets rest"
when 3
return "Find the next one inside the lone house in the city at the edge of civilization."
when 4
return "The final feather lies back in the refuge for orphaned Pokémon..."
else
return "Lie in the bed... Bring me the feathers..."
end
end
def clearAllSelfSwitches(mapID, switch = "A", newValue = false)
map = $MapFactory.getMap(mapID, false)
map.events.each { |event_array|
event_id = event_array[0]
pbSetSelfSwitch(event_id, switch, newValue, mapID)
}
end
#@formatter:off
def get_constellation_variable(pokemon)
case pokemon
when :IVYSAUR; return VAR_CONSTELLATION_IVYSAUR
when :WARTORTLE; return VAR_CONSTELLATION_WARTORTLE
when :ARCANINE; return VAR_CONSTELLATION_ARCANINE
when :MACHOKE; return VAR_CONSTELLATION_MACHOKE
when :RAPIDASH; return VAR_CONSTELLATION_RAPIDASH
when :GYARADOS; return VAR_CONSTELLATION_GYARADOS
when :ARTICUNO; return VAR_CONSTELLATION_ARTICUNO
when :MEW; return VAR_CONSTELLATION_MEW
# when :POLITOED; return VAR_CONSTELLATION_POLITOED
# when :URSARING; return VAR_CONSTELLATION_URSARING
# when :LUGIA; return VAR_CONSTELLATION_LUGIA
# when :HOOH; return VAR_CONSTELLATION_HOOH
# when :CELEBI; return VAR_CONSTELLATION_CELEBI
# when :SLAKING; return VAR_CONSTELLATION_SLAKING
# when :JIRACHI; return VAR_CONSTELLATION_JIRACHI
# when :TYRANTRUM; return VAR_CONSTELLATION_TYRANTRUM
# when :SHARPEDO; return VAR_CONSTELLATION_SHARPEDO
# when :ARCEUS; return VAR_CONSTELLATION_ARCEUS
end
end
#@formatter:on
def promptCaughtPokemonAction(pokemon)
pickedOption = false
return pbStorePokemon(pokemon) if !$Trainer.party_full?
while !pickedOption
command = pbMessage(_INTL("\\ts[]Your team is full!"),
[_INTL("Add to your party"), _INTL("Store to PC"),], 2)
echoln ("command " + command.to_s)
case command
when 0 #SWAP
if swapCaughtPokemon(pokemon)
echoln pickedOption
pickedOption = true
end
else
#STORE
pbStorePokemon(pokemon)
echoln pickedOption
pickedOption = true
end
end
end
#def pbChoosePokemon(variableNumber, nameVarNumber, ableProc = nil, allowIneligible = false)
def swapCaughtPokemon(caughtPokemon)
pbChoosePokemon(1, 2,
proc { |poke|
!poke.egg? &&
!(poke.isShadow? rescue false)
})
index = pbGet(1)
return false if index == -1
$PokemonStorage.pbStoreCaught($Trainer.party[index])
pbRemovePokemonAt(index)
pbStorePokemon(caughtPokemon)
return true
end
def constellation_add_star(pokemon)
star_variables = get_constellation_variable(pokemon)
pbSEPlay("GUI trainer card open", 80)
nb_stars = pbGet(star_variables)
pbSet(star_variables, nb_stars + 1)
end
def clear_all_images()
for i in 1..99
echoln i.to_s + " : " + $game_screen.pictures[i].name
$game_screen.pictures[i].erase
end
end
def exportTeamForShowdown()
message=""
for pokemon in $Trainer.party
message << exportFusedPokemonForShowdown(pokemon)
message << "\n"
end
Input.clipboard = message
end
# Clefnair (Clefable) @ Life Orb
# Ability: Magic Guard
# Level: 33
# Fusion: Dragonair
# EVs: 252 HP / 252 SpD / 4 Spe
# Modest Nature
# - Dazzling Gleam
# - Dragon Breath
# - Wish
# - Water Pulse
def exportFusedPokemonForShowdown(pokemon)
if pokemon.species_data.is_a?(GameData::FusedSpecies)
head_pokemon_species = pokemon.species_data.head_pokemon
species_name = head_pokemon_species.name
else
species_name = pokemon.species_data.real_name
end
if pokemon.item
nameLine = _INTL("{1} ({2}) @ {3}", pokemon.name, species_name, pokemon.item.name)
else
nameLine = _INTL("{1} ({2})", pokemon.name, species_name)
end
abilityLine = _INTL("Ability: {1}", pokemon.ability.name)
levelLine = _INTL("Level: {1}", pokemon.level)
fusionLine=""
if pokemon.species_data.is_a?(GameData::FusedSpecies)
body_pokemon_species = pokemon.species_data.body_pokemon
fusionLine = _INTL("Fusion: {1}\n", body_pokemon_species.name)
end
evsLine = calculateEvLineForShowdown(pokemon)
ivsLine = calculateIvLineForShowdown(pokemon)
move1 = "", move2="", move3="", move4 = ""
move1 = _INTL("- {1}", GameData::Move.get(pokemon.moves[0].id).real_name) if pokemon.moves[0]
move2 = _INTL("- {1}", GameData::Move.get(pokemon.moves[1].id).real_name) if pokemon.moves[1]
move3 = _INTL("- {1}", GameData::Move.get(pokemon.moves[2].id).real_name) if pokemon.moves[2]
move4 = _INTL("- {1}", GameData::Move.get(pokemon.moves[3].id).real_name) if pokemon.moves[3]
ret = nameLine + "\n" +
abilityLine + "\n" +
levelLine + "\n" +
fusionLine +
evsLine + "\n" +
ivsLine + "\n" +
move1 + "\n" +
move2 + "\n" +
move3 + "\n" +
move4 + "\n"
return ret
end
def calculateEvLineForShowdown(pokemon)
evsLine = "EVs: "
evsLine << _INTL("{1} HP /", pokemon.ev[:HP])
evsLine << _INTL("{1} Atk / ", pokemon.ev[:ATTACK])
evsLine << _INTL("{1} Def / ", pokemon.ev[:DEFENSE])
evsLine << _INTL("{1} SpA / ", pokemon.ev[:SPECIAL_ATTACK])
evsLine << _INTL("{1} SpD / ", pokemon.ev[:SPECIAL_DEFENSE])
evsLine << _INTL("{1} Spe / ", pokemon.ev[:SPEED])
return evsLine
end
def calculateIvLineForShowdown(pokemon)
ivLine = "IVs: "
ivLine << _INTL("{1} HP / ", pokemon.iv[:HP])
ivLine << _INTL("{1} Atk / ", pokemon.iv[:ATTACK])
ivLine << _INTL("{1} Def / ", pokemon.iv[:DEFENSE])
ivLine << _INTL("{1} SpA / ", pokemon.iv[:SPECIAL_ATTACK])
ivLine << _INTL("{1} SpD / ", pokemon.iv[:SPECIAL_DEFENSE])
ivLine << _INTL("{1} Spe", pokemon.iv[:SPEED])
return ivLine
end
def openUrlInBrowser(url="")
begin
# Open the URL in the default web browser
system("xdg-open", url) || system("open", url) || system("start", url)
rescue
Input.clipboard = url
pbMessage("The game could not open the link in the browser")
pbMessage("The link has been copied to your clipboard instead")
end
end

View File

@@ -150,6 +150,12 @@ def getFusedPokemonIdFromDexNum(body_dex, head_dex)
return ("B" + body_dex.to_s + "H" + head_dex.to_s).to_sym
end
def getFusedPokemonIdFromSymbols(body_dex, head_dex)
bodyDexNum = GameData::Species.get(body_dex).id_number
headDexNum = GameData::Species.get(head_dex).id_number
return getFusedPokemonIdFromDexNum(body_dex,head_dex)
end
def getPokemon(dexNum)
if dexNum.is_a?(Integer)
if dexNum > NB_POKEMON

View File

@@ -49,6 +49,7 @@ def download_pokemon_sprite_if_missing(body, head)
get_fusion_sprite_path(head, body)
end
def download_sprite(base_path, head_id, body_id, saveLocation = "Graphics/temp", alt_letter = "", spriteformBody_suffix = "", spriteformHead_suffix = "")
begin
head_id = (head_id.to_s) + spriteformHead_suffix
@@ -75,7 +76,7 @@ def download_sprite(base_path, head_id, body_id, saveLocation = "Graphics/temp",
echoln _INTL("\nDownloaded file from {1} to {2}", base_path, saveLocation)
return downloaded_file_name
end
echoln "tried to download " + base_path
echoln "tried to download " + url
return nil
rescue MKXPError, Errno::ENOENT
return nil
@@ -110,6 +111,20 @@ def download_custom_sprite(head_id, body_id, spriteformBody_suffix = "", spritef
return nil
end
def download_custom_sprite_filename(filename)
head_id = (head_id.to_s) + spriteformHead_suffix.to_s
body_id = (body_id.to_s) + spriteformBody_suffix.to_s
return nil if $PokemonSystem.download_sprites != 0
url = Settings::CUSTOM_SPRITES_REPO_URL + "{1}.{2}{3}.png"
destPath = _INTL("{1}{2}", Settings::CUSTOM_BATTLERS_FOLDER_INDEXED, head_id)
if !Dir.exist?(destPath)
Dir.mkdir(destPath)
end
sprite = download_sprite(_INTL(url, head_id, body_id,alt_letter), head_id, body_id, destPath, alt_letter)
return sprite if sprite
return nil
end
#todo refactor & put custom base sprites in same folder as fusion sprites
def download_unfused_main_sprite(dex_num, alt_letter="")
base_url = alt_letter == "" ? Settings::BASE_POKEMON_SPRITES_REPO_URL : Settings::BASE_POKEMON_ALT_SPRITES_REPO_URL

View File

@@ -333,28 +333,7 @@ class PokemonLoadScreen
end
end
def detectFakeDownload()
blacklist = ["pokemoninfinitefusion.net"]
current_user_directory=Dir.pwd
for keyword in blacklist
if current_user_directory.include?(keyword)
pbMessage("The game has detected that it has been installed from an illegitimate source which likely contains viruses.")
pbMessage("Please delete the game and reinstall it from the Discord or subreddit")
pbMessage("discord.gg/infinitefusion\nreddit.com/r/pokemoninfinitefusion")
pbMessage("Please also make sure to report the website you originally downloaded the game from to Google.")
return true
end
end
return false
end
def fakeWebsiteDisclaimer()
pbMessage("Reminder: This game does NOT have an official website. The ONLY official sources for the game are game's official discord or subreddit.")
end
def pbStartLoadScreen
return if detectFakeDownload
fakeWebsiteDisclaimer()
updateHttpSettingsFile
updateCreditsFile
newer_version = find_newer_available_version
@@ -406,6 +385,8 @@ class PokemonLoadScreen
end
commands[cmd_options = commands.length] = _INTL('Options')
commands[cmd_language = commands.length] = _INTL('Language') if Settings::LANGUAGES.length >= 2
commands[cmd_discord = commands.length] = _INTL('Discord')
commands[cmd_wiki = commands.length] = _INTL('Wiki')
commands[cmd_debug = commands.length] = _INTL('Debug') if $DEBUG
commands[cmd_quit = commands.length] = _INTL('Quit Game')
cmd_left = -3
@@ -445,6 +426,10 @@ class PokemonLoadScreen
Game.start_new(@save_data[:bag], @save_data[:storage_system], @save_data[:player])
@save_data[:player].new_game_plus_unlocked = true
return
when cmd_discord
openUrlInBrowser(Settings::DISCORD_URL)
when cmd_wiki
openUrlInBrowser(Settings::WIKI_URL)
when cmd_mystery_gift
pbFadeOutIn { pbDownloadMysteryGift(@save_data[:player]) }
when cmd_options

View File

@@ -357,6 +357,58 @@ ItemHandlers::UseFromBag.add(:DEBUGGER, proc { |item|
end
})
def useSleepingBag()
currentSecondsValue = pbGet(UnrealTime::EXTRA_SECONDS)
choices = ["1 hour", "6 hours", "12 hours", "24 hours", "Cancel"]
choice = Kernel.pbMessage("Sleep for how long?", choices, choices.length)
echoln choice
return 0 if choice == choices.length-1
oldDay = getDayOfTheWeek()
timeAdded =0
case choice
when 0
timeAdded=3600
when 1
timeAdded=21600
when 2
timeAdded=43200
when 3
timeAdded=86400
end
pbSet(UnrealTime::EXTRA_SECONDS,currentSecondsValue+timeAdded)
pbSEPlay("Sleep",100)
pbFadeOutIn {
Kernel.pbMessage(_INTL("{1} slept for a while...",$Trainer.name))
}
time = pbGetTimeNow.strftime("%I:%M %p")
newDay = getDayOfTheWeek()
if newDay != oldDay
Kernel.pbMessage(_INTL("The current time is now {1} on {2}.",time,newDay.downcase.capitalize))
else
Kernel.pbMessage(_INTL("The current time is now {1}.",time))
end
return 1
end
ItemHandlers::UseFromBag.add(:SLEEPINGBAG, proc { |item|
mapMetadata = GameData::MapMetadata.try_get($game_map.map_id)
if !mapMetadata || !mapMetadata.outdoor_map
Kernel.pbMessage(_INTL("Can't use that here..."))
next 0
end
next useSleepingBag()
})
ItemHandlers::UseInField.add(:SLEEPINGBAG, proc { |item|
mapMetadata = GameData::MapMetadata.try_get($game_map.map_id)
if !mapMetadata || !mapMetadata.outdoor_map
Kernel.pbMessage(_INTL("Can't use that here..."))
next 0
end
next useSleepingBag()
})
ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item|
TOTAL_SPIRITS_NEEDED = 108
nbSpirits = pbGet(VAR_ODDKEYSTONE_NB)
@@ -1601,9 +1653,11 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
end
end
#On ajoute l'autre dans le pokedex aussi
#On ajoute les poke au pokedex
$Trainer.pokedex.set_seen(poke1.species)
$Trainer.pokedex.set_owned(poke1.species)
$Trainer.pokedex.set_seen(poke2.species)
$Trainer.pokedex.set_owned(poke2.species)
pokemon.species = poke1.species
pokemon.level = poke1.level

View File

@@ -164,6 +164,13 @@ QUESTS = [
Quest.new(55, "The Cursed Forest", "A child wants you to find a floating tree stump in Ilex Forest. What could she be talking about?", questBranchHotels, "BW109", "Goldenrod City", defaultQuestColor),
Quest.new(56, "Bitey Pokémon", "A fisherman wants to know what is the sharp-toothed Pokémon that bit him in the Safari Zone's lake.", questBranchHotels, "BW (71)", "Fuchsia City", defaultQuestColor),
Quest.new(57, "A legendary band (Part 1)", "The singer of a band in Saffron City wants you to help them recruit a drummer. They think they've heard some drumming around Crimson City...", questBranchField, "BW107", "Saffron City", specialQuestColor),
Quest.new(58, "A legendary band (Part 2)", "The drummer from a legendary Pokéband wants you to find its former bandmates. The band manager talked about two former guitarists...", questBranchField, "band_drummer", "Saffron City", specialQuestColor),
Quest.new(59, "A legendary band (Part 3)", "The drummer from a legendary Pokéband wants you to find its former bandmates. There are rumors about strange music that was heard around the region.", questBranchField, "band_drummer", "Saffron City", specialQuestColor),
Quest.new(60, "A legendary band (Part 4)", "You assembled the full band! Come watch the show on Saturday night.", questBranchField, "BW117", "Saffron City", specialQuestColor),
Quest.new(61, "Mysterious Lunar feathers", "A mysterious entity asked you to collect Lunar Feather for them. It said that they will come at night to tell you where look. Whoever that may be...", questBranchField, "lunarFeather", "Lavender Town", specialQuestColor),
# attention: c'est un array et non un hash... l'id est en fait l'index, donc il est important de garder l'ordre
#out of order quests
#42 (cinnabar)

View File

@@ -0,0 +1,148 @@
class PokemonTemp
def pbClearSilhouetteEvents()
echoln @tempEvents
@tempEvents.keys.each {|map_id|
map = $MapFactory.getMap(map_id,false)
@tempEvents[map_id].each { |event|
#this deletes the event after a small fadeout
$game_self_switches[[map_id, event.id, "B"]] = true if map.events[event.id]
}
}
@tempEvents={}
@silhouetteDirection=nil
end
end
def isNightmareEffect()
#return false
#return true
return $game_switches[SWITCH_NIGHTMARE_EFFECT] && pbGet(VAR_KARMA)<= 0 && PBDayNight.isNight?
end
# def playNightmareEffect()
# frame=1
# while true
# frame +=1
# frame = 1 if frame >4
# filename = "nightmare"+frame.to_s
# picture = Game_Picture.new(40)
# picture.show(filename, 0, 0, 0, 200, 200, 255, 0)
# pbWait(3)
# picture.erase
# end
#
# end
Events.onStepTaken += proc { |sender, e|
next if !$PokemonTemp.silhouetteDirection
if $PokemonTemp.silhouetteDirection && $PokemonTemp.silhouetteDirection == $game_player.direction
$PokemonTemp.pbClearSilhouetteEvents
$PokemonTemp.silhouetteDirection = nil
end
}
Events.onStepTaken += proc { |sender, e|
next if !$scene.is_a?(Scene_Map)
next if !isNightmareEffect()
steps_constant_offset = 40
steps_chance=100
minimum_steps=10
steps_nb = rand(steps_chance)+pbGet(VAR_KARMA)+steps_constant_offset
steps_nb = minimum_steps if steps_nb<minimum_steps
next if $PokemonGlobal.stepcount % steps_nb != 0
$PokemonTemp.pbClearSilhouetteEvents
spawnSilhouette()
}
Events.onMapChange += proc { |sender, e|
next if $PokemonTemp.tempEvents.empty?
$PokemonTemp.pbClearTempEvents()
}
def getRandomPositionOnPerimeter(width, height, center_x, center_y, variance=0,edge=nil)
half_width = width / 2.0
half_height = height / 2.0
# Randomly select one of the four edges of the rectangle
edge = rand(4) if !edge
case edge
when 0 # Top edge
random_x = center_x + rand(-half_width..half_width)
random_y = center_y - half_height
when 1 # Bottom edge
random_x = center_x + rand(-half_width..half_width)
random_y = center_y + half_height
when 2 # Left edge
random_x = center_x - half_width
random_y = center_y + rand(-half_height..half_height)
when 3 # Right edge
random_x = center_x + half_width
random_y = center_y + rand(-half_height..half_height)
end
return random_x.round, random_y.round
end
# def launchSilhouetteCommonEvent(event)
# $scene.spriteset.addUserAnimation(VIRUS_ANIMATION_ID, event.x, event.y, true)
# $PokemonTemp.pbClearTempEvents
# $PokemonTemp.silhouetteDirection = nil
# pbCommonEvent(COMMON_EVENT_SILHOUETTE)
# end
#
# Faces the same way as player
# Disappears as soon as player takes a step in same direction as event
# -> when talk to it:
# ghost animation
# Message:
# A voice echoed from somewhere...
# [NEXT HINT] (ex: The house in Vermillion City...)
#
def generate_silhouette_event(id)
$game_self_switches[[MAP_TEMPLATE_EVENTS, TEMPLATE_EVENT_SILHOUETTE, "A"]] = false
$game_self_switches[[MAP_TEMPLATE_EVENTS, TEMPLATE_EVENT_SILHOUETTE, "B"]] = false
template_event = $MapFactory.getMap(MAP_TEMPLATE_EVENTS,false).events[TEMPLATE_EVENT_SILHOUETTE]
new_event= template_event.event.dup
new_event.name = "temp_silhouette"
new_event.id = id
return new_event
end
def spawnSilhouette()
found_available_position = false
max_tries = 10
current_try = 0
while !found_available_position
x, y = getRandomPositionOnPerimeter(15, 11, $game_player.x, $game_player.y, 2)
found_available_position = true if $game_map.passable?(x, y, $game_player.direction)
current_try += 1
return if current_try > max_tries
end
key_id = ($game_map.events.keys.max || -1) + 1
rpgEvent = generate_silhouette_event(key_id)
#rpgEvent = RPG::Event.new(x,y)
gameEvent = Game_Event.new($game_map.map_id, rpgEvent, $game_map)
direction = $game_player.direction #[2,4,6,8].sample
gameEvent.direction = direction
$PokemonTemp.silhouetteDirection = direction
$game_map.events[key_id] = gameEvent
gameEvent.moveto(x, y)
#-------------------------------------------------------------------------
#updating the sprites
sprite = Sprite_Character.new(Spriteset_Map.viewport, $game_map.events[key_id])
$scene.spritesets[$game_map.map_id] = Spriteset_Map.new($game_map) if $scene.spritesets[$game_map.map_id] == nil
$scene.spritesets[$game_map.map_id].character_sprites.push(sprite)
#$PokemonTemp.addTempEvent($game_map.map_id, gameEvent)
end

View File

@@ -55,8 +55,15 @@ module Graphics
$GameSpeed = 0 if $GameSpeed >= SPEEDUP_STAGES.size
end
$frame += 1
speedStage = SPEEDUP_STAGES[$GameSpeed]
speedStage=5 if $DEBUG && Input.press?(Input::SHIFT)
if $PokemonSystem && $PokemonSystem.speedup == 1
speedStage = SPEEDUP_STAGES[$GameSpeed]
else
speedStage = 1
if Input.press?(Input::AUX1) && $CanToggle
$PokemonSystem.speedup_speed = Settings::DEFAULT_SPEED_UP_SPEED if !$PokemonSystem.speedup_speed || $PokemonSystem.speedup_speed==0
speedStage=$PokemonSystem.speedup_speed+1
end
end
return unless $frame % speedStage == 0
fast_forward_update
$frame = 0

View File

@@ -0,0 +1,34 @@
class PokemonTemp
attr_accessor :tempEvents
attr_accessor :silhouetteDirection
def tempEvents
@tempEvents = {} if !@tempEvents
return @tempEvents
end
def pbClearTempEvents()
@tempEvents.keys.each {|map_id|
map = $MapFactory.getMap(map_id)
@tempEvents[map_id].each { |event|
map.events[event.id].erase if map.events[event.id]
}
}
@tempEvents={}
@silhouetteDirection=nil
end
def addTempEvent(map,event)
@tempEvents = {} if !@tempEvents
mapEvents = @tempEvents.has_key?(map) ? @tempEvents[map] : []
mapEvents.push(event)
@tempEvents[map] = mapEvents
end
end

View File

@@ -100,6 +100,11 @@ class PokemonPokedexInfo_Scene
end
def get_currently_selected_sprite()
species_id = getDexNumberForSpecies(@species).to_s
$PokemonGlobal.alt_sprite_substitutions = {} if !$PokemonGlobal.alt_sprite_substitutions
return $PokemonGlobal.alt_sprite_substitutions[species_id]
end
def set_displayed_to_current_alt(altsList)
species_id = getDexNumberForSpecies(@species).to_s
@@ -215,7 +220,6 @@ class PokemonPokedexInfo_Scene
while !found_last_form
form_index += 1
form_path = Settings::BATTLERS_FOLDER + body_id.to_s + "_" + form_index.to_s
echoln form_path
if File.directory?(form_path)
forms_list << form_index
else

View File

@@ -57,12 +57,12 @@
#
module UnrealTime
# Set false to disable this system (returns Time.now)
ENABLED=true
ENABLED = true
# Time proportion here.
# So if it is 100, one second in real time will be 100 seconds in game.
# If it is 60, one second in real time will be one minute in game.
PROPORTION=60
PROPORTION = 60
# Starting on Essentials v17, the map tone only try to refresh tone each 30
# real time seconds.
@@ -73,68 +73,71 @@ module UnrealTime
# Make this true to time only pass at field (Scene_Map)
# A note to scripters: To make time pass on other scenes, put line
# '$PokemonGlobal.addNewFrameCount' near to line 'Graphics.update'
TIME_STOPS=true
TIME_STOPS = true
# Make this true to time pass in battle, during turns and command selection.
# This won't affect the Pokémon and Bag submenus.
# Only works if TIME_STOPS=true.
BATTLE_PASS=true
BATTLE_PASS = true
# Make this true to time pass when the Dialog box or the main menu are open.
# This won't affect the submenus like Pokémon and Bag.
# Only works if TIME_STOPS=true.
TALK_PASS=true
TALK_PASS = true
# Choose switch number that when true the time won't pass (or -1 to cancel).
# Only works if TIME_STOPS=true.
SWITCH_STOPS=-1
SWITCH_STOPS = -1
# Choose variable(s) number(s) that can hold time passage (or -1 to cancel).
# Look at description for more details.
EXTRA_SECONDS=79
EXTRA_DAYS=-1
EXTRA_SECONDS = 79
EXTRA_DAYS = -1
WEEK_DAY_VARIABLE = 280
WEEK_DAYS = [:MONDAY,:TUESDAY,:WEDNESDAY,:THURSDAY,:FRIDAY,:SATURDAY,:SUNDAY]
# Initial date. In sequence: Year, month, day, hour and minutes.
# Method UnrealTime.reset resets time back to this time.
def self.initial_date
return Time.local(2000,1,1, 4,0)
return Time.local(2000, 1, 1, 4, 0)
end
# Advance to next time. If time already passed, advance
# into the time on the next day.
# Hour is 0..23
def self.advance_to(hour,min=0,sec=0)
def self.advance_to(hour, min = 0, sec = 0)
if hour < 0 || hour > 23
raise RangeError, "hour is #{hour}, should be 0..23"
end
day_seconds = 60*60*24
seconds_now = pbGetTimeNow.hour*60*60+pbGetTimeNow.min*60+pbGetTimeNow.sec
target_seconds = hour*60*60+min*60+sec
seconds_added = target_seconds-seconds_now
seconds_added += day_seconds if seconds_added<0
$PokemonGlobal.newFrameCount+=seconds_added
day_seconds = 60 * 60 * 24
seconds_now = pbGetTimeNow.hour * 60 * 60 + pbGetTimeNow.min * 60 + pbGetTimeNow.sec
target_seconds = hour * 60 * 60 + min * 60 + sec
seconds_added = target_seconds - seconds_now
seconds_added += day_seconds if seconds_added < 0
$PokemonGlobal.newFrameCount += seconds_added
PBDayNight.sheduleToneRefresh
end
# Resets time to initial_date.
def self.reset
raise "Method doesn't work when TIME_STOPS is false!" if !TIME_STOPS
$game_variables[EXTRA_SECONDS]=0 if EXTRA_DAYS>0
$game_variables[EXTRA_DAYS]=0 if EXTRA_DAYS>0
$PokemonGlobal.newFrameCount=0
$PokemonGlobal.extraYears=0
$game_variables[EXTRA_SECONDS] = 0 if EXTRA_DAYS > 0
$game_variables[EXTRA_DAYS] = 0 if EXTRA_DAYS > 0
$PokemonGlobal.newFrameCount = 0
$PokemonGlobal.extraYears = 0
PBDayNight.sheduleToneRefresh
end
# Does the same thing as EXTRA_SECONDS variable.
def self.add_seconds(seconds)
raise "Method doesn't work when TIME_STOPS is false!" if !TIME_STOPS
$PokemonGlobal.newFrameCount+=(seconds*Graphics.frame_rate)/PROPORTION.to_f
$PokemonGlobal.newFrameCount += (seconds * Graphics.frame_rate) / PROPORTION.to_f
PBDayNight.sheduleToneRefresh
end
def self.add_days(days)
add_seconds(60*60*24*days)
add_seconds(60 * 60 * 24 * days)
end
NEED_32_BIT_FIX = [''].pack('p').size <= 4
@@ -149,11 +152,11 @@ module PBDayNight
class << self
if method_defined?(:getTone) && UnrealTime::TONE_CHECK_INTERVAL > 0
def getTone
@cachedTone = Tone.new(0,0,0) if !@cachedTone
@cachedTone = Tone.new(0, 0, 0) if !@cachedTone
return @cachedTone if !Settings::TIME_SHADING
toneNeedUpdate = (!@dayNightToneLastUpdate ||
Graphics.frame_count-@dayNightToneLastUpdate >=
Graphics.frame_rate*UnrealTime::TONE_CHECK_INTERVAL
Graphics.frame_count - @dayNightToneLastUpdate >=
Graphics.frame_rate * UnrealTime::TONE_CHECK_INTERVAL
)
if toneNeedUpdate
getToneInternal
@@ -170,43 +173,48 @@ module PBDayNight
end
end
def getDayOfTheWeek()
day_of_week = (pbGetTimeNow.day % UnrealTime::WEEK_DAYS.length).to_i
return UnrealTime::WEEK_DAYS[day_of_week]
end
def pbGetTimeNow
return Time.now if !$PokemonGlobal || !UnrealTime::ENABLED
day_seconds = 60*60*24
day_seconds = 60 * 60 * 24
if UnrealTime::TIME_STOPS
# Sum the extra values to newFrameCount
if UnrealTime::EXTRA_SECONDS>0
if UnrealTime::EXTRA_SECONDS > 0
UnrealTime.add_seconds(pbGet(UnrealTime::EXTRA_SECONDS))
$game_variables[UnrealTime::EXTRA_SECONDS]=0
$game_variables[UnrealTime::EXTRA_SECONDS] = 0
end
if UnrealTime::EXTRA_DAYS>0
UnrealTime.add_seconds(day_seconds*pbGet(UnrealTime::EXTRA_DAYS))
$game_variables[UnrealTime::EXTRA_DAYS]=0
if UnrealTime::EXTRA_DAYS > 0
UnrealTime.add_seconds(day_seconds * pbGet(UnrealTime::EXTRA_DAYS))
$game_variables[UnrealTime::EXTRA_DAYS] = 0
end
elsif UnrealTime::EXTRA_SECONDS>0 && UnrealTime::EXTRA_DAYS>0
elsif UnrealTime::EXTRA_SECONDS > 0 && UnrealTime::EXTRA_DAYS > 0
# Checks to regulate the max/min values at UnrealTime::EXTRA_SECONDS
while pbGet(UnrealTime::EXTRA_SECONDS)>=day_seconds
$game_variables[UnrealTime::EXTRA_SECONDS]-=day_seconds
$game_variables[UnrealTime::EXTRA_DAYS]+=1
while pbGet(UnrealTime::EXTRA_SECONDS) >= day_seconds
$game_variables[UnrealTime::EXTRA_SECONDS] -= day_seconds
$game_variables[UnrealTime::EXTRA_DAYS] += 1
end
while pbGet(UnrealTime::EXTRA_SECONDS)<=-day_seconds
$game_variables[UnrealTime::EXTRA_SECONDS]+=day_seconds
$game_variables[UnrealTime::EXTRA_DAYS]-=1
while pbGet(UnrealTime::EXTRA_SECONDS) <= -day_seconds
$game_variables[UnrealTime::EXTRA_SECONDS] += day_seconds
$game_variables[UnrealTime::EXTRA_DAYS] -= 1
end
end
start_time=UnrealTime.initial_date
start_time = UnrealTime.initial_date
if UnrealTime::TIME_STOPS
time_played=$PokemonGlobal.newFrameCount
time_played = $PokemonGlobal.newFrameCount
else
time_played=Graphics.frame_count
time_played = Graphics.frame_count
end
time_played=(time_played*UnrealTime::PROPORTION)/Graphics.frame_rate
time_jumped=0
if UnrealTime::EXTRA_SECONDS>-1
time_jumped+=pbGet(UnrealTime::EXTRA_SECONDS)
time_played = (time_played * UnrealTime::PROPORTION) / Graphics.frame_rate
time_jumped = 0
if UnrealTime::EXTRA_SECONDS > -1
time_jumped += pbGet(UnrealTime::EXTRA_SECONDS)
end
if UnrealTime::EXTRA_DAYS>-1
time_jumped+=pbGet(UnrealTime::EXTRA_DAYS)*day_seconds
if UnrealTime::EXTRA_DAYS > -1
time_jumped += pbGet(UnrealTime::EXTRA_DAYS) * day_seconds
end
time_ret = 0
# Before Essentials V19, there is a year limit. To prevent crashes due to this
@@ -215,13 +223,13 @@ def pbGetTimeNow
# $PokemonGlobal.extraYears. You can sum your actual year with this extraYears
# when displaying years.
loop do
time_fix=0
if $PokemonGlobal.extraYears!=0
time_fix = $PokemonGlobal.extraYears*day_seconds*(365*6+1)/6
time_fix = 0
if $PokemonGlobal.extraYears != 0
time_fix = $PokemonGlobal.extraYears * day_seconds * (365 * 6 + 1) / 6
end
time_ret=start_time+(time_played+time_jumped-time_fix)
break if !UnrealTime::NEED_32_BIT_FIX || time_ret.year<2036
$PokemonGlobal.extraYears+=6
time_ret = start_time + (time_played + time_jumped - time_fix)
break if !UnrealTime::NEED_32_BIT_FIX || time_ret.year < 2036
$PokemonGlobal.extraYears += 6
end
return time_ret
end
@@ -232,18 +240,18 @@ if UnrealTime::ENABLED
attr_accessor :extraYears
def addNewFrameCount
return if (UnrealTime::SWITCH_STOPS>0 &&
return if (UnrealTime::SWITCH_STOPS > 0 &&
$game_switches[UnrealTime::SWITCH_STOPS])
self.newFrameCount+=1
self.newFrameCount += 1
end
def newFrameCount
@newFrameCount=0 if !@newFrameCount
@newFrameCount = 0 if !@newFrameCount
return @newFrameCount
end
def extraYears
@extraYears=0 if !@extraYears
@extraYears = 0 if !@extraYears
return @extraYears
end
end
@@ -251,6 +259,7 @@ if UnrealTime::ENABLED
if UnrealTime::TIME_STOPS
class Scene_Map
alias :updateold :update
def update
$PokemonGlobal.addNewFrameCount
updateold
@@ -258,6 +267,7 @@ if UnrealTime::ENABLED
if UnrealTime::TALK_PASS
alias :miniupdateold :miniupdate
def miniupdate
$PokemonGlobal.addNewFrameCount
miniupdateold
@@ -268,6 +278,7 @@ if UnrealTime::ENABLED
if UnrealTime::BATTLE_PASS
class PokeBattle_Scene
alias :pbGraphicsUpdateold :pbGraphicsUpdate
def pbGraphicsUpdate
$PokemonGlobal.addNewFrameCount
pbGraphicsUpdateold

View File

@@ -43,8 +43,6 @@ def handleReplaceExistingSprites()
end
end
def pbCallTitle
#return Scene_DebugIntro.new if $DEBUG
return Scene_Intro.new

View File

@@ -9,4 +9,7 @@ module Settings
CUSTOM_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/CustomBattlers/"
BASE_POKEMON_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/autogen-fusion-sprites/-/raw/master/Battlers/"
BASE_POKEMON_ALT_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/Other/BaseSprites/"
DISCORD_URL = "https://discord.com/invite/infinitefusion"
WIKI_URL = "https://infinitefusion.fandom.com/"
end