mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping
This commit is contained in:
@@ -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
|
||||
#===============================================================================
|
||||
|
||||
@@ -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
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -110,8 +110,6 @@ class ItemIconSprite < Sprite
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Item held icon (used in the party screen)
|
||||
#===============================================================================
|
||||
|
||||
@@ -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
|
||||
#===============================================================================
|
||||
|
||||
Reference in New Issue
Block a user