mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Moved methods that return item/trainer graphics, refactored evolution helper methods, rearranged some methods
This commit is contained in:
@@ -257,163 +257,6 @@ end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Load item icons
|
||||
# TODO: Put these methods into GameData::Item.
|
||||
#===============================================================================
|
||||
def pbItemIconFile(item)
|
||||
bitmapFileName = nil
|
||||
if item
|
||||
itm = GameData::Item.get(item)
|
||||
bitmapFileName = sprintf("Graphics/Icons/item%s",itm.id.to_s) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Icons/item%03d",itm.id_number)
|
||||
if !pbResolveBitmap(bitmapFileName) && itm.is_machine?
|
||||
move = itm.move
|
||||
type = GameData::Move.get(move).type
|
||||
bitmapFileName = sprintf("Graphics/Icons/itemMachine%s",type.to_s) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Icons/itemMachine%03d",type)
|
||||
end
|
||||
end
|
||||
bitmapFileName = "Graphics/Icons/item000" if !pbResolveBitmap(bitmapFileName)
|
||||
end
|
||||
else
|
||||
bitmapFileName = sprintf("Graphics/Icons/itemBack")
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
def pbHeldItemIconFile(item) # Used in the party screen
|
||||
return nil if !item || item==0
|
||||
namebase = (GameData::Item.get(item).is_mail?) ? "mail" : "item"
|
||||
bitmapFileName = sprintf("Graphics/Pictures/Party/icon_%s_%s",namebase,GameData::Item.get(item).id.to_s) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Pictures/Party/icon_%s_%03d",namebase,item)
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Pictures/Party/icon_%s",namebase)
|
||||
end
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Load mail background graphics
|
||||
#===============================================================================
|
||||
def pbMailBackFile(item)
|
||||
return nil if !item
|
||||
bitmapFileName = sprintf("Graphics/Pictures/Mail/mail_%s",GameData::Item.get(item).id.to_s) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Pictures/Mail/mail_%03d",item)
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Load NPC charsets
|
||||
#===============================================================================
|
||||
def pbTrainerCharFile(type) # Used by the phone
|
||||
return nil if !type
|
||||
tr_type_data = GameData::TrainerType.get(type)
|
||||
bitmapFileName = sprintf("Graphics/Characters/trchar%s", tr_type_data.id.to_s) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Characters/trchar%03d", tr_type_data.id_number)
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
def pbTrainerCharNameFile(type) # Used by Battle Frontier and compiler
|
||||
return nil if !type
|
||||
tr_type_data = GameData::TrainerType.get(type)
|
||||
bitmapFileName = sprintf("trchar%s", tr_type_data.id.to_s) rescue nil
|
||||
if !pbResolveBitmap(sprintf("Graphics/Characters/" + bitmapFileName))
|
||||
bitmapFileName = sprintf("trchar%03d", tr_type_data.id_number)
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Load trainer sprites
|
||||
#===============================================================================
|
||||
def pbTrainerSpriteFile(type)
|
||||
return nil if !type
|
||||
tr_type_data = GameData::TrainerType.get(type)
|
||||
bitmapFileName = sprintf("Graphics/Trainers/trainer%s", tr_type_data.id.to_s) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Trainers/trainer%03d", tr_type_data.id_number)
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
def pbTrainerSpriteBackFile(type)
|
||||
return nil if !type
|
||||
tr_type_data = GameData::TrainerType.get(type)
|
||||
bitmapFileName = sprintf("Graphics/Trainers/trback%s", tr_type_data.id.to_s) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Trainers/trback%03d", tr_type_data.id_number)
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
def pbPlayerSpriteFile(type)
|
||||
return nil if !type
|
||||
tr_type_data = GameData::TrainerType.get(type)
|
||||
outfit = ($Trainer) ? $Trainer.outfit : 0
|
||||
bitmapFileName = sprintf("Graphics/Trainers/trainer%s_%d", tr_type_data.id.to_s, outfit) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Trainers/trainer%03d_%d", tr_type_data.id_number, outfit)
|
||||
bitmapFileName = pbTrainerSpriteFile(tr_type_data.id) if !pbResolveBitmap(bitmapFileName)
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
def pbPlayerSpriteBackFile(type)
|
||||
return nil if !type
|
||||
tr_type_data = GameData::TrainerType.get(type)
|
||||
outfit = ($Trainer) ? $Trainer.outfit : 0
|
||||
bitmapFileName = sprintf("Graphics/Trainers/trback%s_%d", tr_type_data.id.to_s, outfit) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Trainers/trback%03d_%d", tr_type_data.id_number, outfit)
|
||||
bitmapFileName = pbTrainerSpriteBackFile(tr_type_data.id) if !pbResolveBitmap(bitmapFileName)
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Load player's head icons (used in the Town Map)
|
||||
#===============================================================================
|
||||
def pbTrainerHeadFile(type)
|
||||
return nil if !type
|
||||
tr_type_data = GameData::TrainerType.get(type)
|
||||
bitmapFileName = sprintf("Graphics/Pictures/mapPlayer%s", tr_type_data.id.to_s) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Pictures/mapPlayer%03d", tr_type_data.id_number)
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
def pbPlayerHeadFile(type)
|
||||
return nil if !type
|
||||
tr_type_data = GameData::TrainerType.get(type)
|
||||
outfit = ($Trainer) ? $Trainer.outfit : 0
|
||||
bitmapFileName = sprintf("Graphics/Pictures/mapPlayer%s_%d", tr_type_data.id.to_s, outfit) rescue nil
|
||||
if !pbResolveBitmap(bitmapFileName)
|
||||
bitmapFileName = sprintf("Graphics/Pictures/mapPlayer%03d_%d", tr_type_data.id_number, outfit)
|
||||
bitmapFileName = pbTrainerHeadFile(tr_type_data.id) if !pbResolveBitmap(bitmapFileName)
|
||||
end
|
||||
return bitmapFileName
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Analyse audio files
|
||||
#===============================================================================
|
||||
|
||||
Reference in New Issue
Block a user