Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping

This commit is contained in:
Maruno17
2023-01-23 22:27:04 +00:00
parent f6213057d8
commit b0b6e675c3
103 changed files with 1099 additions and 1302 deletions

View File

@@ -113,8 +113,9 @@ module ItemHandlers
end
end
#===============================================================================
#
#===============================================================================
def pbCanRegisterItem?(item)
return ItemHandlers.hasUseInFieldHandler(item)
end
@@ -123,8 +124,6 @@ def pbCanUseOnPokemon?(item)
return ItemHandlers.hasUseOnPokemon(item) || GameData::Item.get(item).is_machine?
end
#===============================================================================
# Change a Pokémon's level
#===============================================================================

View File

@@ -1,18 +1,20 @@
#===============================================================================
#
#===============================================================================
class PokemonGlobalMetadata
attr_accessor :pokeradarBattery
end
#===============================================================================
#
#===============================================================================
class Game_Temp
attr_accessor :poke_radar_data # [species, level, chain count, grasses (x,y,ring,rarity)]
end
################################################################################
#===============================================================================
# Using the Poke Radar
################################################################################
#===============================================================================
def pbCanUsePokeRadar?
# Can't use Radar if not in tall grass
terrain = $game_map.terrain_tag($game_player.x, $game_player.y)
@@ -146,9 +148,9 @@ def pbPokeRadarGetEncounter(rarity = 0)
return $PokemonEncounters.choose_wild_pokemon($PokemonEncounters.encounter_type, rarity + 1)
end
################################################################################
#===============================================================================
# Event handlers
################################################################################
#===============================================================================
EventHandlers.add(:on_wild_species_chosen, :poke_radar_chain,
proc { |encounter|
if GameData::EncounterType.get($game_temp.encounter_type).type != :land ||
@@ -246,9 +248,9 @@ EventHandlers.add(:on_enter_map, :cancel_poke_radar,
}
)
################################################################################
#===============================================================================
# Item handlers
################################################################################
#===============================================================================
ItemHandlers::UseInField.add(:POKERADAR, proc { |item|
next pbUsePokeRadar
})

View File

@@ -1,4 +1,6 @@
#===============================================================================
# Data structure representing mail that the Pokémon can hold
#===============================================================================
class Mail
attr_accessor :item, :message, :sender, :poke1, :poke2, :poke3
@@ -12,8 +14,9 @@ class Mail
end
end
#===============================================================================
#
#===============================================================================
def pbMoveToMailbox(pokemon)
$PokemonGlobal.mailbox = [] if !$PokemonGlobal.mailbox
return false if $PokemonGlobal.mailbox.length >= 10

View File

@@ -110,8 +110,6 @@ class ItemIconSprite < Sprite
end
end
#===============================================================================
# Item held icon (used in the party screen)
#===============================================================================

View File

@@ -16,15 +16,15 @@ class PokemonBag
end
def initialize
@pockets = []
@pockets = []
(0..PokemonBag.pocket_count).each { |i| @pockets[i] = [] }
reset_last_selections
@registered_items = []
@registered_items = []
@ready_menu_selection = [0, 0, 1] # Used by the Ready Menu to remember cursor positions
end
def reset_last_selections
@last_viewed_pocket = 1
@last_viewed_pocket = 1
@last_pocket_selections ||= []
(0..PokemonBag.pocket_count).each { |i| @last_pocket_selections[i] = 0 }
end
@@ -39,7 +39,7 @@ class PokemonBag
return @pockets
end
#=============================================================================
#-----------------------------------------------------------------------------
# Gets the index of the current selected item in the pocket
def last_viewed_index(pocket)
@@ -59,7 +59,7 @@ class PokemonBag
@last_pocket_selections[pocket] = value if value <= @pockets[pocket].length
end
#=============================================================================
#-----------------------------------------------------------------------------
def quantity(item)
item_data = GameData::Item.try_get(item)
@@ -139,7 +139,7 @@ class PokemonBag
return ret
end
#=============================================================================
#-----------------------------------------------------------------------------
# Returns whether item has been registered for quick access in the Ready Menu.
def registered?(item)
@@ -161,7 +161,7 @@ class PokemonBag
@registered_items.delete(item_data.id) if item_data
end
#=============================================================================
#-----------------------------------------------------------------------------
private
@@ -193,8 +193,6 @@ class PokemonBag
end
end
#===============================================================================
# The PC item storage object, which actually contains all the items
#===============================================================================
@@ -260,8 +258,6 @@ class PCItemStorage
end
end
#===============================================================================
# Implements methods that act on arrays of items. Each element in an item
# array is itself an array of [itemID, itemCount].
@@ -333,8 +329,6 @@ module ItemStorageHelper
end
end
#===============================================================================
# Deprecated methods
#===============================================================================