6.4 update (minus sprites)

This commit is contained in:
infinitefusion
2024-12-21 09:43:11 -05:00
parent f70c2cfde4
commit 1e325366d2
1717 changed files with 140299 additions and 27845 deletions

View File

@@ -63,21 +63,25 @@ end
def setHairColor(hue_shift)
$Trainer.hair_color = hue_shift
refreshPlayerOutfit()
end
def shiftHatColor(incr)
$Trainer.hat_color = 0 if !$Trainer.hat_color
$Trainer.hat_color += incr
refreshPlayerOutfit()
end
def shiftClothesColor(incr)
$Trainer.clothes_color = 0 if !$Trainer.clothes_color
$Trainer.clothes_color += incr
refreshPlayerOutfit()
end
def shiftHairColor(incr)
$Trainer.hair_color = 0 if !$Trainer.hair_color
$Trainer.hair_color += incr
refreshPlayerOutfit()
end
def pbLoadOutfitBitmap(outfitFileName)
@@ -99,25 +103,41 @@ end
def getEasterEggHeldItem()
map = $game_map.map_id
return "HOTDOG" if [141, 194].include?(map) #restaurant
return "SNOWBALL" if [670, 693, 698, 694].include?(map)
return "WALLET" if [432, 433, 434, 435, 436, 292].include?(map) #dept. store
return "ALARMCLOCK" if [43, 48, 67, 68, 69, 70, 71, 73].include?(map) #Player room
return "secrets/HOTDOG" if [141, 194].include?(map) #restaurant
return "secrets/SNOWBALL" if [670, 693, 698, 694].include?(map)
return "secrets/WALLET" if [432, 433, 434, 435, 436, 292].include?(map) #dept. store
return "secrets/ALARMCLOCK" if [43, 48, 67, 68, 69, 70, 71, 73].include?(map) #Player room
return "SAFARIBALL" if [445, 484, 485, 486, 107, 487, 488, 717, 82, 75, 74].include?(map) #Safari Zone
return "secrets/WISP" if [401,402,403,467,468,469].include?(map) #Pokemon Tower
return "secrets/SKULL" if [400].include?(map) #Pokemon Tower ground floor
return "secrets/ROCK" if [349,350,800,].include?(map) #Rock Tunnel
return "secrets/MAGIKARP" if [394,471,189,].include?(map) #Fishing huts
return "secrets/AZUREFLUTE" if [694,].include?(map) && $PokemonBag.pbQuantity(:AZUREFLUTE)>=1 #Ice Mountain peak
return "secrets/BIGSODA" if [436,].include?(map) && $PokemonBag.pbQuantity(:SODAPOP)>=1 #Celadon dept. store top
return "secrets/EGG" if [13,406,214,].include?(map) #Celadon Café
return "secrets/STICK" if [266,].include?(map) #Ilex forest
return nil
end
def getCurrentPokeball()
otherItem = getEasterEggHeldItem()
def getCurrentPokeball(allowEasterEgg=true)
otherItem = getEasterEggHeldItem() if allowEasterEgg
return otherItem if otherItem
firstPokemon = $Trainer.party[0]
return firstPokemon.poke_ball if firstPokemon
return nil
end
def generate_front_trainer_sprite_bitmap(pokeball = nil, clothes_id = nil, hat_id = nil, hair_id = nil,
def generate_front_trainer_sprite_bitmap_from_appearance(trainerAppearance)
echoln caller
echoln trainerAppearance.hat
return generate_front_trainer_sprite_bitmap(false,nil,trainerAppearance.clothes,trainerAppearance.hat,
trainerAppearance.hair,trainerAppearance.skin_color,
trainerAppearance.hair_color,trainerAppearance.hat_color,trainerAppearance.clothes_color)
end
def generate_front_trainer_sprite_bitmap(allowEasterEgg=true, pokeball = nil, clothes_id = nil, hat_id = nil, hair_id = nil,
skin_tone_id = nil, hair_color = nil, hat_color = nil, clothes_color = nil)
echoln hat_id
clothes_id = $Trainer.clothes if !clothes_id
hat_id = $Trainer.hat if !hat_id
hair_id = $Trainer.hair if !hair_id
@@ -130,7 +150,7 @@ def generate_front_trainer_sprite_bitmap(pokeball = nil, clothes_id = nil, hat_i
outfitFilename = getTrainerSpriteOutfitFilename(clothes_id) #_INTL(Settings::PLAYER_GRAPHICS_FOLDER + Settings::PLAYER_CLOTHES_FOLDER + "/clothes_trainer_{1}", $Trainer.clothes)
hatFilename = getTrainerSpriteHatFilename(hat_id) # _INTL(Settings::PLAYER_GRAPHICS_FOLDER + Settings::PLAYER_HAT_FOLDER + "/hat_trainer_{1}", $Trainer.hat)
pokeball = getCurrentPokeball if !pokeball
pokeball = getCurrentPokeball(allowEasterEgg) if !pokeball
ballFilename = getTrainerSpriteBallFilename(pokeball) if pokeball
baseFilePath = getBaseTrainerSpriteFilename(skin_tone_id)
@@ -158,6 +178,7 @@ def generate_front_trainer_sprite_bitmap(pokeball = nil, clothes_id = nil, hat_i
hatBitmap = AnimatedBitmap.new(hatFilename, hat_color_shift) if pbResolveBitmap(hatFilename) #pbLoadOutfitBitmap(hatFilename) if pbResolveBitmap(hatFilename)
baseBitmap.bitmap = baseBitmap.bitmap.clone
baseBitmap.bitmap.blt(0, 0, outfitBitmap.bitmap, outfitBitmap.bitmap.rect) if outfitBitmap
baseBitmap.bitmap.blt(0, 0, hairBitmapWrapper.bitmap, hairBitmapWrapper.bitmap.rect) if hairBitmapWrapper
@@ -167,6 +188,48 @@ def generate_front_trainer_sprite_bitmap(pokeball = nil, clothes_id = nil, hat_i
return baseBitmap
end
def generateNPCClothedBitmapStatic(trainerAppearance,action = "walk")
baseBitmapFilename = getBaseOverworldSpriteFilename(action, trainerAppearance.skin_color)
baseSprite = AnimatedBitmap.new(baseBitmapFilename)
baseBitmap = baseSprite.bitmap.clone # nekkid sprite
outfitFilename = getOverworldOutfitFilename(trainerAppearance.clothes, action)
hairFilename = getOverworldHairFilename(trainerAppearance.hair)
#Clothes
clothes_color_shift = trainerAppearance.clothes_color || 0
clothesBitmap = AnimatedBitmap.new(outfitFilename, clothes_color_shift).bitmap if pbResolveBitmap(outfitFilename)
baseBitmap.blt(0, 0, clothesBitmap, clothesBitmap.rect)
#clothesBitmap.dispose
#Hair
hair_color_shift = trainerAppearance.hair_color || 0
hairBitmap = AnimatedBitmap.new(hairFilename, hair_color_shift).bitmap if pbResolveBitmap(hairFilename)
baseBitmap.blt(0, 0, hairBitmap, hairBitmap.rect)
hat_color_shift = trainerAppearance.hat_color || 0
hatFilename = getOverworldHatFilename(trainerAppearance.hat)
hatBitmapWrapper = AnimatedBitmap.new(hatFilename, hat_color_shift) if pbResolveBitmap(hatFilename)
if hatBitmapWrapper
frame_count = 4 # Assuming 4 frames for hair animation; adjust as needed
hat_frame_bitmap = duplicateHatForFrames(hatBitmapWrapper.bitmap, frame_count)
frame_width = baseSprite.bitmap.width / frame_count # Calculate frame width
frame_count.times do |i|
# Calculate offset for each frame
frame_offset = [i * frame_width, 0]
# Adjust Y offset if frame index is odd
frame_offset[1] -= 2 if i.odd?
positionHat(baseBitmap, hat_frame_bitmap, frame_offset, i, frame_width)
end
end
return baseBitmap
end
def generateClothedBitmapStatic(trainer, action = "walk")
baseBitmapFilename = getBaseOverworldSpriteFilename(action, trainer.skin_tone)
if !pbResolveBitmap(baseBitmapFilename)
@@ -174,39 +237,77 @@ def generateClothedBitmapStatic(trainer, action = "walk")
end
baseSprite = AnimatedBitmap.new(baseBitmapFilename)
baseBitmap = baseSprite.bitmap.clone #nekkid sprite
outfitFilename = getOverworldOutfitFilename(trainer.clothes, action) #
# Clone the base sprite bitmap to create the base for the player's sprite
baseBitmap = baseSprite.bitmap.clone # nekkid sprite
outfitFilename = getOverworldOutfitFilename(trainer.clothes, action)
outfitFilename = getOverworldOutfitFilename(Settings::PLAYER_TEMP_OUTFIT_FALLBACK) if !pbResolveBitmap(outfitFilename)
hairFilename = getOverworldHairFilename(trainer.hair)
hatFilename = getOverworldHatFilename(trainer.hat)
hair_color_shift = trainer.hair_color
hat_color_shift = trainer.hat_color
clothes_color_shift = trainer.clothes_color
# Use default values if color shifts are not set
hair_color_shift = trainer.hair_color || 0
hat_color_shift = trainer.hat_color || 0
clothes_color_shift = trainer.clothes_color || 0
hair_color_shift = 0 if !hair_color_shift
hat_color_shift = 0 if !hat_color_shift
clothes_color_shift = 0 if !clothes_color_shift
#@hat.update(@character_name, hatFilename,hat_color_shift) if @hat
# Use fallback outfit if the specified outfit cannot be resolved
if !pbResolveBitmap(outfitFilename)
outfitFilename = Settings::PLAYER_TEMP_OUTFIT_FALLBACK
end
outfitBitmap = AnimatedBitmap.new(outfitFilename, clothes_color_shift) # if pbResolveBitmap(outfitFilename) #pbLoadOutfitBitmap(outfitFilename) if pbResolveBitmap(outfitFilename)
# Load the outfit and hair bitmaps
outfitBitmap = AnimatedBitmap.new(outfitFilename, clothes_color_shift)
hairBitmapWrapper = AnimatedBitmap.new(hairFilename, hair_color_shift) if pbResolveBitmap(hairFilename)
hatBitmapWrapper = AnimatedBitmap.new(hatFilename, hat_color_shift) if pbResolveBitmap(hatFilename)
# Blit the outfit onto the base sprite
baseBitmap.blt(0, 0, outfitBitmap.bitmap, outfitBitmap.bitmap.rect) if outfitBitmap
#baseBitmap.blt(0, 0, hairBitmapWrapper.bitmap, hairBitmapWrapper.bitmap.rect)
current_offset = 0 #getCurrentSpriteOffset()
current_offset = [0, 0] # Replace this with getCurrentSpriteOffset() if needed
positionHair(baseBitmap, hairBitmapWrapper.bitmap, current_offset) if hairBitmapWrapper
#baseBitmap.blt(0, 0, hatBitmap, hatBitmap.rect) if hatBitmap
# Handle the hat - duplicate it for each frame if necessary
if hatBitmapWrapper
frame_count = 4 # Assuming 4 frames for hair animation; adjust as needed
hat_frame_bitmap = duplicateHatForFrames(hatBitmapWrapper.bitmap, frame_count)
frame_width = baseSprite.bitmap.width / frame_count # Calculate frame width
frame_count.times do |i|
# Calculate offset for each frame
frame_offset = [i * frame_width, 0]
# Adjust Y offset if frame index is odd
frame_offset[1] -= 2 if i.odd?
positionHat(baseBitmap, hat_frame_bitmap, frame_offset, i, frame_width)
end
end
return baseBitmap
end
def positionHair(baseBitmap, hairBirmap, offset)
baseBitmap.blt(offset[0], offset[1], hairBirmap, hairBirmap.rect)
def positionHair(baseBitmap, hairBitmap, offset)
baseBitmap.blt(offset[0], offset[1], hairBitmap, hairBitmap.rect)
end
def positionHat(baseBitmap, hatBitmap, offset, frame_index, frame_width)
# Define a rect for each frame
frame_rect = Rect.new(frame_index * frame_width, 0, frame_width, hatBitmap.height)
# Blit only the part of the hat corresponding to the current frame
baseBitmap.blt(offset[0], offset[1], hatBitmap, frame_rect)
end
def duplicateHatForFrames(hatBitmap, frame_count)
# Create a new bitmap for the duplicated hat frames
frame_width = hatBitmap.width
total_width = frame_width * frame_count
duplicatedBitmap = Bitmap.new(total_width, hatBitmap.height)
# Copy the single hat frame across each required frame
frame_count.times do |i|
duplicatedBitmap.blt(i * frame_width, 0, hatBitmap, hatBitmap.rect)
end
return duplicatedBitmap
end
def add_hat_to_bitmap(bitmap, hat_id, x_pos, y_pos, scale = 1, mirrored = false)
@@ -240,3 +341,4 @@ end

View File

@@ -22,6 +22,66 @@ class OutfitSelector
return list_folders(get_hair_sets_list_path())
end
def generate_hats_choice(baseOptions=true,additionalIds=[],additionalTags=[],filterOutTags=[])
list = []
list += additionalIds
list += search_hats(additionalTags)
if baseOptions
list += get_hats_base_options()
list += search_hats(get_regional_sets_tags())
end
return list
end
def generate_clothes_choice(baseOptions=true,additionalIds=[],additionalTags=[],filterOutTags=[])
list = []
list += additionalIds
list += search_clothes(additionalTags)
if baseOptions
list += get_clothes_base_options()
list += search_clothes(get_regional_sets_tags())
end
return list
end
def generate_hairstyle_choice(baseOptions=true,additionalIds=[],additionalTags=[],filterOutTags=[])
list = []
list += additionalIds
list += search_hairstyles(additionalTags)
if baseOptions
list += get_hairstyle_salon_base_options()
list += search_hairstyles(get_regional_sets_tags())
end
list << HAIR_BALD
return list
end
def get_regional_sets_tags()
regional_tags = []
regional_tags << "kanto" if $game_switches[SWITCH_KANTO_HAIR_COLLECTION]
regional_tags << "johto" if $game_switches[SWITCH_JOHTO_HAIR_COLLECTION]
regional_tags << "hoenn" if $game_switches[SWITCH_HOENN_HAIR_COLLECTION]
regional_tags << "sinnoh" if $game_switches[SWITCH_SINNOH_HAIR_COLLECTION]
regional_tags << "unova" if $game_switches[SWITCH_UNOVA_HAIR_COLLECTION]
regional_tags << "kalos" if $game_switches[SWITCH_KALOS_HAIR_COLLECTION]
regional_tags << "alola" if $game_switches[SWITCH_ALOLA_HAIR_COLLECTION]
regional_tags << "galar" if $game_switches[SWITCH_GALAR_HAIR_COLLECTION]
regional_tags << "paldea" if $game_switches[SWITCH_PALDEA_HAIR_COLLECTION]
return regional_tags
end
def get_hairstyle_salon_base_options()
return search_hairstyles(["default"])
end
def get_clothes_base_options()
return search_clothes(["default"])
end
def get_hats_base_options()
return search_hats(["default"])
end
def parse_hairstyles_folder
hairstyle_types= list_folders(get_hair_sets_list_path())
max_versions_number = 10

View File

@@ -13,7 +13,7 @@ def update_global_hats_list()
# Iterate through the JSON data and create Hat objects
hat_data.each do |data|
tags = data['tags'] ? data['tags'].split(',') : []
tags = data['tags'] ? data['tags'].split(',').map(&:strip) : []
hat = Hat.new(
data['id'],
data['name'],
@@ -34,7 +34,7 @@ def update_global_hairstyles_list()
# Iterate through the JSON data and create Hat objects
hair_data.each do |data|
tags = data['tags'] ? data['tags'].split(',') : []
tags = data['tags'] ? data['tags'].split(',').map(&:strip) : []
hair = Hairstyle.new(
data['id'],
data['name'],
@@ -55,7 +55,7 @@ def update_global_clothes_list()
# Iterate through the JSON data and create Hat objects
outfits_data.each do |data|
tags = data['tags'] ? data['tags'].split(',') : []
tags = data['tags'] ? data['tags'].split(',').map(&:strip) : []
outfit = Clothes.new(
data['id'],
data['name'],

View File

@@ -20,16 +20,33 @@ def filter_clothes(filter_tags = [], only_unlocked = false)
return filter_outfits_by_tag(full_data_list, filter_tags, existing_files_list, unlocked_list, only_unlocked)
end
def filter_clothes_only_not_owned(clothes_ids_list)
filtered_list = []
clothes_ids_list.each do|clothe_id|
filtered_list << clothe_id if !$Trainer.unlocked_clothes.include?(clothe_id)
end
return filtered_list
end
def filter_clothes_only_owned(clothes_ids_list)
filtered_list = []
clothes_ids_list.each do|clothe_id|
filtered_list << clothe_id if $Trainer.unlocked_clothes.include?(clothe_id)
end
return filtered_list
end
#HATS
def search_hats(matching_tags = [], only_unlocked = false)
def search_hats(matching_tags = [],excluding_tags=[], only_unlocked = false)
update_global_outfit_lists()
selector = OutfitSelector.new
full_data_list = $PokemonGlobal.hats_data
existing_files_list = selector.parse_hats_folder()
unlocked_list = $Trainer.unlocked_hats
return search_outfits_by_tag(full_data_list, matching_tags, existing_files_list, unlocked_list, only_unlocked)
return search_outfits_by_tag(full_data_list, matching_tags, existing_files_list, unlocked_list, only_unlocked,excluding_tags)
end
def filter_hats(filter_tags = [], only_unlocked = false)
@@ -38,18 +55,58 @@ def filter_hats(filter_tags = [], only_unlocked = false)
full_data_list = $PokemonGlobal.hats_data
existing_files_list = selector.parse_hats_folder()
echoln existing_files_list
unlocked_list = $Trainer.unlocked_hats
return filter_outfits_by_tag(full_data_list, filter_tags, existing_files_list, unlocked_list, only_unlocked)
end
def filter_hats_only_not_owned(hats_ids_list)
filtered_list = []
hats_ids_list.each do|hat_id|
filtered_list << hat_id if !$Trainer.unlocked_hats.include?(hat_id)
end
return filtered_list
end
def filter_hats_only_owned(hats_ids_list)
filtered_list = []
hats_ids_list.each do|hat_id|
filtered_list << hat_id if $Trainer.unlocked_hats.include?(hat_id)
end
return filtered_list
end
#HAIRSTYLES
def search_hairstyles(matching_tags = [], only_unlocked = false)
update_global_outfit_lists()
selector = OutfitSelector.new
full_data_list = $PokemonGlobal.hairstyles_data
existing_files_list = selector.parse_hairstyle_types_folder()
return search_outfits_by_tag(full_data_list, matching_tags, existing_files_list, [], false)
end
def filter_out_hairstyles(filter_tags = [],base_list = [],require_unlocked=false)
update_global_outfit_lists()
selector = OutfitSelector.new
data_list = $PokemonGlobal.hairstyles_data
existing_files_list = selector.parse_hairstyle_types_folder()
return exclude_outfits_by_tag(data_list, filter_tags, existing_files_list, base_list, false)
end
# Generic searching methods
#Get outfits that have ANY of the tags
def search_outfits_by_tag(outfits_map, matching_tags = [], physical_files_list = [], unlocked_list = [], require_unlocked = false)
def search_outfits_by_tag(outfits_map, matching_tags = [], physical_files_list = [], unlocked_list = [], require_unlocked = false, excluding_tags=[])
filtered_list = []
outfits_map.each do |outfit_id, outfit|
next if outfit.tags.any? { |tag| excluding_tags.include?(tag) }
if outfit.tags.any? { |tag| matching_tags.include?(tag) }
filtered_list << outfit_id if outfit_is_valid?(outfit_id, physical_files_list, unlocked_list, require_unlocked)
end
@@ -70,6 +127,19 @@ def filter_outfits_by_tag(outfits_map, filter_tags = [], physical_files_list = [
return filtered_list
end
#Get all outfits from list that DON'T have a tag
def exclude_outfits_by_tag(outfits_map, filter_tags = [], physical_files_list = [], unlocked_list = [], require_unlocked = false)
update_global_outfit_lists()
filtered_list = []
outfits_map.each do |outfit_id, outfit|
if filter_tags.any? { |tag| !outfit.tags.include?(tag) }
filtered_list << outfit_id if outfit_is_valid?(outfit_id, physical_files_list, unlocked_list, require_unlocked)
end
end
return filtered_list
end
def outfit_is_valid?(outfit_id, physical_files_list, unlocked_list, require_unlocked)
return false if require_unlocked && !unlocked_list.include?(outfit_id)
@@ -85,6 +155,7 @@ end
def get_clothes_by_id(id)
update_global_outfit_lists()
echoln $PokemonGlobal.clothes_data
return $PokemonGlobal.clothes_data.has_key?(id) ? $PokemonGlobal.clothes_data[id] : nil
end

View File

@@ -0,0 +1,185 @@
#set outfit ids,
#
CLOTHES_NORMAL = "normal"
CLOTHES_FIGHTING = "fighting"
CLOTHES_FLYING = "temp"
CLOTHES_POISON = "deadlypoisondanger"
CLOTHES_GROUND = "groundcowboy"
CLOTHES_ROCK = "temp"
CLOTHES_BUG_1 = "bughakama"
CLOTHES_BUG_2 = "bughakamapants"
CLOTHES_GHOST = "temp"
CLOTHES_STEEL_M = "steelworkerM"
CLOTHES_STEEL_F = "steelworkerF"
CLOTHES_FIRE = "firefigther"
CLOTHES_WATER = "waterdress"
CLOTHES_GRASS = "temp"
CLOTHES_ELECTRIC = "urbanelectric"
CLOTHES_PSYCHIC = "temp"
CLOTHES_ICE = "temp"
CLOTHES_DRAGON = "dragonconqueror"
CLOTHES_DARK = "temp"
CLOTHES_FAIRY_M = "mikufairym"
CLOTHES_FAIRY_F = "mikufairyf"
NORMAL_ITEMS = [:NORMALGEM,:MOOMOOMILK,:POTION,:FULLHEAL,:CHILANBERRY,]
FIGHTING_ITEMS = [:FIGHTINGGEM,:PROTEIN,:CHOPLEBERRY,]
FLYING_ITEMS = [:FLYINGGEM,:HEALTHWING,:MUSCLEWING,:RESISTWING,:GENIUSWING,:CLEVERWING,:SWIFTWING,:AIRBALLOON,:PRETTYWING,:COBABERRY, ]
POISON_ITEMS = [:POISONGEM,:ANTIDOTE, :KEBIABERRY, ]
GROUND_ITEMS = [:GROUNDGEM,:SHUCABERRY, ]
ROCK_ITEMS = [:ROCKGEM, :STARDUST,:CHARTIBERRY, ]
BUG_ITEMS = [:BUGGEM,:HONEY,:TANGABERRY, ]
GHOST_ITEMS = [:GHOSTGEM,:KASIBBERRY,]
STEEL_ITEMS = [:STEELGEM,:BABIRIBERRY,:METALPOWDER,]
FIRE_ITEMS = [:FIREGEM,:LAVACOOKIE,:BURNHEAL,:OCCABERRY, ]
WATER_ITEMS = [:WATERGEM,:HEARTSCALE,:PEARL,:PASSHOBERRY ]
GRASS_ITEMS = [:GRASSGEM,:LUMBERRY,:ORANBERRY,:SITRUSBERRY,:GRASSYSEED,:ABSORBBULB,:TINYMUSHROOM, :RINDOBERRY, ]
ELECTRIC_ITEMS = [:ELECTRICGEM,:ELECTRICSEED,:PARLYZHEAL,:CELLBATTERY,:WACANBERRY, ]
PSYCHIC_ITEMS = [:PSYCHICGEM,:PSYCHICSEED, :MENTALHERB, :PAYAPABERRY,]
ICE_ITEMS = [:ICEGEM,:SNOWBALL,:ICEHEAL,:YACHEBERRY, ]
DRAGON_ITEMS = [:DRAGONGEM,:HABANBERRY, ]
DARK_ITEMS = [:DARKGEM,:COLBURBERRY, ]
FAIRY_ITEMS = [:FAIRYGEM,:MISTYSEED, ]
def isWearingElectricOutfit()
return (isWearingClothes(CLOTHES_ELECTRIC))
end
def isWearingNormalOutfit()
return (isWearingClothes(CLOTHES_NORMAL))
end
def isWearingFightingOutfit()
return (isWearingClothes(CLOTHES_FIGHTING))
end
def isWearingFlyingOutfit()
return (isWearingClothes(CLOTHES_FLYING))
end
def isWearingPoisonOutfit()
return (isWearingClothes(CLOTHES_POISON))
end
def isWearingGroundOutfit()
return (isWearingClothes(CLOTHES_GROUND))
end
def isWearingRockOutfit()
return (isWearingClothes(CLOTHES_ROCK))
end
def isWearingBugOutfit()
return ((isWearingClothes(CLOTHES_BUG_1) || isWearingClothes(CLOTHES_BUG_2)))
end
def isWearingGhostOutfit()
return (isWearingClothes(CLOTHES_GHOST))
end
def isWearingSteelOutfit()
return ((isWearingClothes(CLOTHES_STEEL_M) || isWearingClothes(CLOTHES_STEEL_F)))
end
def isWearingFireOutfit()
return (isWearingClothes(CLOTHES_FIRE))
end
def isWearingWaterOutfit()
return (isWearingClothes(CLOTHES_WATER))
end
def isWearingGrassOutfit()
return (isWearingClothes(CLOTHES_GRASS))
end
def isWearingPsychicOutfit()
return (isWearingClothes(CLOTHES_PSYCHIC))
end
def isWearingIceOutfit()
return (isWearingClothes(CLOTHES_ICE))
end
def isWearingDragonOutfit()
return (isWearingClothes(CLOTHES_DRAGON))
end
def isWearingDarkOutfit()
return (isWearingClothes(CLOTHES_DARK))
end
def isWearingFairyOutfit()
return ((isWearingClothes(CLOTHES_FAIRY_M) || isWearingClothes(CLOTHES_FAIRY_F)))
end
def pickUpTypeItemSetBonus()
return if rand(10) != 0
items_list = if isWearingElectricOutfit()
ELECTRIC_ITEMS
elsif isWearingNormalOutfit()
NORMAL_ITEMS
elsif isWearingFightingOutfit()
FIGHTING_ITEMS
elsif isWearingFlyingOutfit()
FLYING_ITEMS
elsif isWearingPoisonOutfit()
POISON_ITEMS
elsif isWearingGroundOutfit()
GROUND_ITEMS
elsif isWearingRockOutfit()
ROCK_ITEMS
elsif isWearingBugOutfit()
BUG_ITEMS
elsif isWearingGhostOutfit()
GHOST_ITEMS
elsif isWearingSteelOutfit()
STEEL_ITEMS
elsif isWearingFireOutfit()
FIRE_ITEMS
elsif isWearingWaterOutfit()
WATER_ITEMS
elsif isWearingGrassOutfit()
GRASS_ITEMS
elsif isWearingPsychicOutfit()
PSYCHIC_ITEMS
elsif isWearingIceOutfit()
ICE_ITEMS
elsif isWearingDragonOutfit()
DRAGON_ITEMS
elsif isWearingDarkOutfit()
DARK_ITEMS
elsif isWearingFairyOutfit()
FAIRY_ITEMS
else
[]
end
if !items_list.empty?
Kernel.pbItemBall(items_list.sample)
end
end

View File

@@ -0,0 +1,118 @@
#Clothes
CLOTHES_TEAM_ROCKET_MALE = "rocketm"
CLOTHES_TEAM_ROCKET_FEMALE = "rocketf"
CLOTHES_OFFICE_WORKER_F = "officeworkerf"
CLOTHES_OFFICE_WORKER_M = "officeworkerm"
CLOTHES_BUSINESS_SUIT = "BusinessSuit"
CLOTHES_ADVENTURER = "fantasyadventurersoutfit"
CLOTHES_EMERALD = "emeraldSPE"
CLOTHES_PIKACHU_ONESIE = "pikaonesie"
CLOTHES_BREEDER="PKMBreeder"
CLOTHES_LASS_YELLOW ="lass"
CLOTHES_LASS_BLUE ="lass2"
DEFAULT_OUTFIT_MALE = "red"
DEFAULT_OUTFIT_FEMALE = "leaf"
STARTING_OUTFIT = "pikajamas"
#Hats
HAT_TEAM_ROCKET = "rocketcap"
HAT_POSTMAN = "postman"
HAT_PIDGEY_NEST = "pidgey"
HAT_SWABLU_NEST = "swablu"
HAT_PIKACHUM_NEST = "pikhatchum"
HAT_PIKACHUF_NEST = "pikhatchuf"
HAT_PARAS_NEST = "headparas"
HAT_EEVEE_NEST = "eevee"
HAT_PARASHROOM = "parashroom"
HAT_AERODACTYL = "aerodactylSkull"
HAT_DUSKULL_MASK = "duskullmask"
HAT_SLEEPMASK = "sleepmask"
HAT_DITTO_MASK = "creepydittomask"
HAT_EGG = "egg"
HAT_DRIFLOON_CAP = "drifloon"
HAT_EMERALD = "emeraldSPEgem"
HAT_SQUIRTLE_SHADES = "squirtlesquadshades"
HAT_WOOPER = "wooperclips"
HAT_PIKACHU_HOOD = "pikaonesie"
HAT_FEZ = "fez"
HAT_HALO = "halo"
HAT_MAGIKARP = "magicap"
HAT_SLOWKING_SHELL = "slowking"
HAT_ZOROARK = "banefulfoxmask"
HAT_FROG = "froghat"
HAT_SANTA = "santa"
HAT_BREEDER_1="breedervisor"
HAT_BREEDER_2="breederbandana"
HAT_BREEDER_2_2="PKMBreeder"
HAT_BREEDER_3="egg"
HAT_BREEDEROUTFIT="PKMBreeder"
FUSION_HAT = "fusionnerd"
FUSION_OUTFIT = "fusionnerd"
HAT_ASH = "ash"
HAT_BIANCA = "bianca"
HAT_CLEFAIRY = "clefairyearheadband"
HAT_FLOWER = "mikufairy"
HAT_CARDBOARD_BOX = "box"
HAT_CAPTAIN = "seacaptain"
HAT_GYM_REWARD_1 = "brockpan"
HAT_GYM_REWARD_2 = "starmieclip"
HAT_GYM_REWARD_3 = "surgeglasses"
HAT_GYM_REWARD_4 = "erikaHeadband"
HAT_GYM_REWARD_5 = "kogascarf"
HAT_GYM_REWARD_6 = "sabrinasballs"
HAT_GYM_REWARD_7 = "blaineGlasses"
HAT_GYM_REWARD_8 = "giovannifedora"
HAT_GYM_REWARD_9 = "luluribbon"
HAT_GYM_REWARD_10 = "kurtsentaihelmet"
HAT_GYM_REWARD_11 = "falknerscage"
HAT_GYM_REWARD_12 = "clairbow"
HAT_GYM_REWARD_13 = "chuckmoustache"
HAT_GYM_REWARD_14 = "prycemask"
HAT_GYM_REWARD_15 = "mortyHeadband"
HAT_GYM_REWARD_16 = "magnemitepin"
#Hairstyles
HAIR_RED = "red"
HAIR_LEAF = "leaf"
HAIR_HEXMANIAC = "HexManiac"
HAIR_LASS = "lass"
HAIR_BALD = "bald"
HAIR_RIVAL = "gary"
HAIR_BROCK = "brock"
HAIR_MISTY1 = "mistyRBY"
HAIR_MISTY2 = "mistyGSC"
HAIR_SURGE = "surge" #does not exist yet
HAIR_ERIKA = "erika"
HAIR_KOGA = "koga" #does not exist yet
HAIR_JANINE = "janine"
HAIR_SABRINA = "sabrina" #does not exist yet
HAIR_BLAINE = "blaine" #does not exist yet
HAIR_GIOVANNI = "giovanni" #does not exist yet
HAIR_WHITNEY = "whitney"
HAIR_KURT = "kurt"
HAIR_FALKNER = "falkner"
HAIR_CLAIR = "clair"
HAIR_CHUCK = "chuck" #does not exist yet
HAIR_PRYCE = "pryce" #does not exist yet
HAIR_MORTY = "morty" #does not exist yet
HAIR_JASMINE = "jasmine" #does not exist yet

View File

@@ -79,6 +79,7 @@ class CharacterSelectMenuPresenter
@name = getDefaultName() if @name == ''
pbSEPlay("GUI trainer card open", 80, 100)
updateDisplayedName(current_index)
applyHair() #for easter egg lol
when OPTION_CONFIRM
pbSEPlay("GUI save choice", 80, 100)
@current_index = @options.length - 1
@@ -111,7 +112,8 @@ class CharacterSelectMenuPresenter
def applyAllSelectedValues
applyGender(@gender)
pbSet(VAR_TRAINER_AGE, @gender)
echoln @age
pbSet(VAR_TRAINER_AGE, @age)
$Trainer.skin_tone = @skinTone
$Trainer.name = @name
end
@@ -214,11 +216,19 @@ class CharacterSelectMenuPresenter
end
def applyHair()
applyHairEasterEggs()
hairColorId = HAIR_COLOR_IDS[@hairColor]
hairId = hairColorId.to_s + "_" + @hairstyle.to_s
$Trainer.hair = hairId
end
def applyHairEasterEggs()
@hairstyle = HAIR_RIVAL if @name == "Gary" && @gender == 1
@hairstyle = HAIR_BROCK if @name == "Brock" && @gender == 1
@hairstyle = HAIR_MISTY if @name == "Misty" && @gender == 0
end
def applyGender(gender_index)
# outfitId = gender + 1
pbSet(VAR_TRAINER_GENDER, gender_index)

View File

@@ -1,4 +1,3 @@
def playOutfitRemovedAnimation()
pbSEPlay("shiny", 80, 60)
$scene.spriteset.addUserAnimation(Settings::OW_SHINE_ANIMATION_ID, $game_player.x, $game_player.y, true)
@@ -9,7 +8,7 @@ def playOutfitChangeAnimation()
$scene.spriteset.addUserAnimation(Settings::OW_SHINE_ANIMATION_ID, $game_player.x, $game_player.y, true)
end
def selectHairstyle(all_unlocked=false)
def selectHairstyle(all_unlocked = false)
selector = OutfitSelector.new
display_outfit_preview()
hat = $Trainer.hat
@@ -22,11 +21,11 @@ def selectHairstyle(all_unlocked=false)
case choice
when 0 #NEXT
playOutfitChangeAnimation()
selector.changeToNextHairstyle(1,all_unlocked)
selector.changeToNextHairstyle(1, all_unlocked)
display_outfit_preview()
when 1 #PREVIOUS
playOutfitChangeAnimation()
selector.changeToNextHairstyle(-1,all_unlocked)
selector.changeToNextHairstyle(-1, all_unlocked)
display_outfit_preview()
when 2 #Toggle hat
pbSEPlay("GUI storage put down", 80, 100)
@@ -44,11 +43,16 @@ def selectHairstyle(all_unlocked=false)
$Trainer.hat = hat
end
def selectHairColor
original_color = $Trainer.hair_color
$game_switches[SWITCH_SELECTING_CLOTHES]=true
$game_map.update
display_outfit_preview()
hat = $Trainer.hat
commands = ["Shift up", "Shift down", "Toggle hat", "Reset", "Back"]
commands = ["Shift up", "Shift down", "Toggle hat", "Reset", "Confirm", "Never Mind"]
previous_input = 0
while (true)
choice = pbShowCommands(nil, commands, commands.length, previous_input)
previous_input = choice
@@ -58,10 +62,12 @@ def selectHairColor
pbSEPlay("GUI storage pick up", 80, 100)
shiftHairColor(10)
display_outfit_preview()
ret = true
when 1 #PREVIOUS
pbSEPlay("GUI storage pick up", 80, 100)
shiftHairColor(-10)
display_outfit_preview()
ret = true
when 2 #Toggle hat
pbSEPlay("GUI storage put down", 80, 100)
if hat == $Trainer.hat
@@ -74,17 +80,27 @@ def selectHairColor
pbSEPlay("GUI storage put down", 80, 100)
$Trainer.hair_color = 0
display_outfit_preview()
ret = false
when 4 #Confirm
break
else
$Trainer.hair_color = original_color
ret = false
break
end
end
hide_outfit_preview()
$Trainer.hat = hat
$game_switches[SWITCH_SELECTING_CLOTHES]=false
$game_map.update
return ret
end
def selectHatColor
original_color = $Trainer.hat_color
display_outfit_preview()
commands = ["Shift up", "Shift down", "Reset", "Back"]
commands = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"]
previous_input = 0
while (true)
choice = pbShowCommands(nil, commands, commands.length, previous_input)
@@ -94,25 +110,37 @@ def selectHatColor
pbSEPlay("GUI storage pick up", 80, 100)
shiftHatColor(10)
display_outfit_preview()
ret = true
when 1 #PREVIOUS
pbSEPlay("GUI storage pick up", 80, 100)
shiftHatColor(-10)
display_outfit_preview()
ret = true
when 2 #Reset
pbSEPlay("GUI storage put down", 80, 100)
$Trainer.hat_color = 0
display_outfit_preview()
refreshPlayerOutfit()
ret = false
when 3 #Confirm
break
else
$Trainer.hat_color = original_color
ret = false
break
end
end
refreshPlayerOutfit()
hide_outfit_preview()
return ret
end
def selectClothesColor
original_color = $Trainer.clothes_color
display_outfit_preview()
commands = ["Shift up", "Shift down", "Reset", "Back"]
commands = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"]
previous_input = 0
ret = false
while (true)
choice = pbShowCommands(nil, commands, commands.length, previous_input)
previous_input = choice
@@ -121,22 +149,32 @@ def selectClothesColor
pbSEPlay("GUI storage pick up", 80, 100)
shiftClothesColor(10)
display_outfit_preview()
ret = true
when 1 #PREVIOUS
pbSEPlay("GUI storage pick up", 80, 100)
shiftClothesColor(-10)
display_outfit_preview()
ret = true
when 2 #Reset
pbSEPlay("GUI storage pick up", 80, 100)
$Trainer.clothes_color = 0
display_outfit_preview()
refreshPlayerOutfit()
ret = false
when 3 #Confirm
break
else
$Trainer.clothes_color = original_color
ret = false
break
end
end
refreshPlayerOutfit()
hide_outfit_preview()
return ret
end
def selectHat(all_unlocked=false)
def selectHat(all_unlocked = false)
selector = OutfitSelector.new
display_outfit_preview()
commands = ["Next hat", "Previous hat", "Remove hat", "Back"]
@@ -147,11 +185,11 @@ def selectHat(all_unlocked=false)
case choice
when 0 #NEXT
playOutfitChangeAnimation()
selector.changeToNextHat(1,all_unlocked)
selector.changeToNextHat(1, all_unlocked)
display_outfit_preview()
when 1 #PREVIOUS
playOutfitChangeAnimation()
selector.changeToNextHat(-1,all_unlocked)
selector.changeToNextHat(-1, all_unlocked)
display_outfit_preview()
when 2 #REMOVE HAT
playOutfitRemovedAnimation()
@@ -169,7 +207,7 @@ def spinCharacter
end
def selectClothes(all_unlocked=false)
def selectClothes(all_unlocked = false)
selector = OutfitSelector.new
display_outfit_preview()
commands = ["Next", "Previous"]
@@ -183,11 +221,11 @@ def selectClothes(all_unlocked=false)
case choice
when 0 #NEXT
playOutfitChangeAnimation()
selector.changeToNextClothes(1,all_unlocked)
selector.changeToNextClothes(1, all_unlocked)
display_outfit_preview()
when 1 #PREVIOUS
playOutfitChangeAnimation()
selector.changeToNextClothes(-1,all_unlocked)
selector.changeToNextClothes(-1, all_unlocked)
display_outfit_preview()
when 2 #REMOVE CLOTHES
break if !$DEBUG
@@ -201,8 +239,6 @@ def selectClothes(all_unlocked=false)
hide_outfit_preview()
end
def place_hat_on_pokemon(pokemon)
hatscreen = PokemonHatPresenter.new(nil, pokemon)
hatscreen.pbStartScreen()

View File

@@ -16,16 +16,17 @@ class PokemonHatPresenter
@original_pokemon_bitmap = nil
end
def getPicturePath()
if @pokemon.isTripleFusion?
picturePath = GameData::Species::getSpecialSpriteName(@pokemon.species_data.id_number)
elsif @pokemon.isFusion?
picturePath = get_fusion_sprite_path(@pokemon.species_data.head_pokemon.id_number, @pokemon.species_data.body_pokemon.id_number)
else
picturePath = get_unfused_sprite_path(@pokemon.species_data.id_number, @pokemon.spriteform_body)
end
return picturePath
end
# def getPicturePath()
# if @pokemon.isTripleFusion?
# picturePath = GameData::Species::getSpecialSpriteName(@pokemon.species_data.id_number)
# elsif @pokemon.isFusion?
# picturePath = get_fusion_sprite_path(@pokemon.species_data.head_pokemon.id_number, @pokemon.species_data.body_pokemon.id_number)
# else
# picturePath = get_unfused_sprite_path(@pokemon.species_data.id_number)
# end
# echoln picturePath
# return picturePath
# end
def pbStartScreen
@view.init_window(self)
@@ -71,13 +72,15 @@ class PokemonHatPresenter
def position_hat
@view.display_move_arrows
min_x, max_x = -64, 88
min_y, max_y = -20, 140
loop do
Graphics.update
Input.update
@x_pos += PIXELS_PER_MOVEMENT if Input.repeat?(Input::RIGHT)
@x_pos -= PIXELS_PER_MOVEMENT if Input.repeat?(Input::LEFT)
@y_pos += PIXELS_PER_MOVEMENT if Input.repeat?(Input::DOWN)
@y_pos -= PIXELS_PER_MOVEMENT if Input.repeat?(Input::UP)
@x_pos += PIXELS_PER_MOVEMENT if Input.repeat?(Input::RIGHT) && @x_pos < max_x
@x_pos -= PIXELS_PER_MOVEMENT if Input.repeat?(Input::LEFT) && @x_pos > min_x
@y_pos += PIXELS_PER_MOVEMENT if Input.repeat?(Input::DOWN) && @y_pos < max_y
@y_pos -= PIXELS_PER_MOVEMENT if Input.repeat?(Input::UP) && @y_pos > min_y
break if Input.trigger?(Input::USE)
return false if Input.trigger?(Input::BACK)
@view.update()
@@ -87,8 +90,25 @@ class PokemonHatPresenter
end
def initialize_bitmap()
picturePath = getPicturePath()
@original_pokemon_bitmap = AnimatedBitmap.new(picturePath)
spriteLoader = BattleSpriteLoader.new
if @pokemon.isTripleFusion?
#todo
elsif @pokemon.isFusion?
@original_pokemon_bitmap = spriteLoader.load_fusion_sprite(@pokemon.head_id(),@pokemon.body_id())
else
echoln @pokemon
echoln @pokemon.species_data
@original_pokemon_bitmap = spriteLoader.load_base_sprite(@pokemon.id_number)
end
# picturePath = getPicturePath()
# if picturePath
# @original_pokemon_bitmap = AnimatedBitmap.new(picturePath)
# else
# @original_pokemon_bitmap = GameData::Species.setAutogenSprite(@pokemon)
# #autogen
# end
@original_pokemon_bitmap.scale_bitmap(Settings::FRONTSPRITE_SCALE)
end

View File

@@ -32,6 +32,10 @@ class PokemonHatView
end
def getWindowWidth()
return @previewwindow.width/2
end
def initialize_arrows()
middle_horizontal = 100
width_horizontal = 90

View File

@@ -23,7 +23,8 @@ class TrainerClothesPreview
end
def show()
@playerBitmap = generate_front_trainer_sprite_bitmap(@pokeball,
@playerBitmap = generate_front_trainer_sprite_bitmap(false,
@pokeball,
@clothes, @hat, @hair,
@skin_tone,
@hair_color, @hat_color, @clothes_color)

View File

@@ -35,7 +35,7 @@ class ClothesMartAdapter < OutfitsMartAdapter
def addItem(item)
changed_clothes = obtainNewClothes(item.id)
changed_clothes = obtainClothes(item.id)
if changed_clothes
@worn_clothes = item.id
end

View File

@@ -1,11 +1,12 @@
def genericOutfitsShopMenu(stock = [], itemType = nil, versions = false)
def genericOutfitsShopMenu(stock = [], itemType = nil, versions = false, isShop=true, message=nil)
commands = []
commands[cmdBuy = commands.length] = _INTL("Buy")
commands[cmdQuit = commands.length] = _INTL("Quit")
cmd = pbMessage(_INTL("Welcome! How may I serve you?"), commands, cmdQuit + 1)
message = _INTL("Welcome! How may I serve you?") if !message
cmd = pbMessage(message, commands, cmdQuit + 1)
loop do
if cmdBuy >= 0 && cmd == cmdBuy
adapter = getAdapter(itemType, stock, true)
adapter = getAdapter(itemType, stock, isShop)
view = ClothesShopView.new()
presenter = getPresenter(itemType, view, stock, adapter, versions)
presenter.pbBuyScreen
@@ -14,8 +15,6 @@ def genericOutfitsShopMenu(stock = [], itemType = nil, versions = false)
pbMessage(_INTL("Please come again!"))
break
end
cmd = pbMessage(_INTL("Is there anything else I can help you with?"),
commands, cmdQuit + 1)
end
end
@@ -41,32 +40,35 @@ end
def list_all_possible_outfits() end
def clothesShop(outfits_list = [])
def clothesShop(outfits_list = [], free=false,customMessage=nil)
stock = []
outfits_list.each { |outfit_id|
outfit = get_clothes_by_id(outfit_id)
stock << outfit if outfit
}
genericOutfitsShopMenu(stock, :CLOTHES)
genericOutfitsShopMenu(stock, :CLOTHES,false,!free,customMessage)
end
def hatShop(outfits_list = [])
def hatShop(outfits_list = [], free=false, customMessage=nil)
stock = []
outfits_list.each { |outfit_id|
outfit = get_hat_by_id(outfit_id)
stock << outfit if outfit
}
genericOutfitsShopMenu(stock, :HAT)
genericOutfitsShopMenu(stock, :HAT,false,!free,customMessage)
end
def hairShop(outfits_list = [])
stock = []
def hairShop(outfits_list = [],free=false, customMessage=nil)
currentHair = getSimplifiedHairIdFromFullID($Trainer.hair)
stock = [:SWAP_COLOR]
#always add current hairstyle as first option (in case the player just wants to swap the color)
stock << get_hair_by_id(currentHair) if $Trainer.hair
outfits_list.each { |outfit_id|
echoln outfit_id
next if outfit_id == currentHair
outfit = get_hair_by_id(outfit_id)
stock << outfit if outfit
}
genericOutfitsShopMenu(stock, :HAIR, true)
genericOutfitsShopMenu(stock, :HAIR, true,!free,customMessage)
end
def openSelectOutfitMenu(stock = [], itemType)
@@ -91,13 +93,14 @@ def changeHatMenu()
outfit = get_hat_by_id(outfit_id)
stock << outfit if outfit
}
stock << :REMOVE_HAT
openSelectOutfitMenu(stock, :HAT)
end
def changeOutfit()
commands = []
commands[cmdClothes = commands.length] = _INTL("Change clothes")
commands[cmdHat = commands.length] = _INTL("Change hat")
commands[cmdClothes = commands.length] = _INTL("Change clothes")
commands[cmdQuit = commands.length] = _INTL("Quit")
cmd = pbMessage(_INTL("What would you like to do?"), commands, cmdQuit + 1)
@@ -112,4 +115,7 @@ def changeOutfit()
break
end
end
end

View File

@@ -44,14 +44,10 @@ class ClothesShopPresenter < PokemonMartScreen
itemname, price.to_s_formatted))
next
end
quantity = 1
if @adapter.getMoney < price
pbDisplayPaused(_INTL("You don't have enough money."))
next
end
added = 0
@adapter.setMoney(@adapter.getMoney - price)
@stock.compact!
pbDisplayPaused(_INTL("Here you are! Thank you!")) { pbSEPlay("Mart buy item") }

View File

@@ -1,14 +1,12 @@
class ClothesShopView < PokemonMart_Scene
def initialize(currency_name="Money")
def initialize(currency_name = "Money")
@currency_name = currency_name
end
def pbStartBuyOrSellScene(buying, stock, adapter)
super(buying, stock, adapter)
@initial_direction = $game_player.direction
@sprites["icon"].visible=false
@sprites["icon"].visible = false
if @adapter.isShop?
@sprites["background"].setBitmap("Graphics/Pictures/martScreenOutfit")
else
@@ -16,7 +14,7 @@ class ClothesShopView < PokemonMart_Scene
end
preview_y = @adapter.isShop? ? 80 : 0
@sprites["trainerPreview"] = TrainerClothesPreview.new(0, preview_y, true,"WALLET")
@sprites["trainerPreview"] = TrainerClothesPreview.new(0, preview_y, true, "WALLET")
@sprites["trainerPreview"].show()
@sprites["moneywindow"].visible = false if !@adapter.isShop?
@@ -26,18 +24,21 @@ class ClothesShopView < PokemonMart_Scene
end
def scroll_map
pbScrollMap(DIRECTION_UP, 5, 5)
pbScrollMap(DIRECTION_RIGHT, 7, 5)
pbScrollMap(DIRECTION_UP, 5, 6)
pbScrollMap(DIRECTION_RIGHT, 7, 6)
@initial_direction = $game_player.direction
$game_player.turn_down
pbRefreshSceneMap
end
def scroll_back_map
@adapter.reset_player_clothes()
pbScrollMap(DIRECTION_LEFT, 7, 5)
pbScrollMap(DIRECTION_DOWN, 5, 5)
pbScrollMap(DIRECTION_LEFT, 7, 6)
pbScrollMap(DIRECTION_DOWN, 5, 6)
$game_player.turn_generic(@initial_direction)
pbRefreshSceneMap
#$scene.reset_map(true)
#pbRefreshSceneMap
# $scene.reset_map(false)
end
def refreshStock(adapter)
@@ -54,11 +55,21 @@ class ClothesShopView < PokemonMart_Scene
itemwindow = @sprites["itemwindow"]
#@sprites["icon"].item = itemwindow.item
#@sprites["icon"].item = itemwindow.item
@sprites["itemtextwindow"].text =
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit.")
item = itemwindow.item
if itemwindow.item
if itemwindow.item.is_a?(Symbol)
text = @adapter.getSpecialItemCaption(item)
else
text = @adapter.getDescription(item)
end
else
text = _INTL("Quit.")
end
@sprites["itemtextwindow"].text = text
itemwindow.refresh
end
@sprites["moneywindow"].text = _INTL("{2}:\r\n<r>{1}", @adapter.getMoneyString,@currency_name)
@sprites["moneywindow"].text = _INTL("{2}:\r\n<r>{1}", @adapter.getMoneyString, @currency_name)
end
def updateTrainerPreview()
@@ -66,13 +77,20 @@ class ClothesShopView < PokemonMart_Scene
end
def displayNewItem(itemwindow)
@adapter.updateTrainerPreview(itemwindow.item,@sprites["trainerPreview"])
@sprites["itemtextwindow"].text =
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit.")
item = itemwindow.item
if item
if item.is_a?(Symbol)
description = @adapter.getSpecialItemDescription(itemwindow.item)
else
description = @adapter.getDescription(itemwindow.item)
end
@adapter.updateTrainerPreview(itemwindow.item, @sprites["trainerPreview"])
else
description = _INTL("Quit.")
end
@sprites["itemtextwindow"].text = description
end
def pbChooseBuyItem
itemwindow = @sprites["itemwindow"]
displayNewItem(itemwindow)
@@ -87,25 +105,27 @@ class ClothesShopView < PokemonMart_Scene
if itemwindow.item != olditem
displayNewItem(itemwindow)
end
if Input.trigger?(Input::AUX1)#L button
@adapter.switchVersion(itemwindow.item,-1)
if Input.trigger?(Input::AUX1) #L button - disabled because same key as speed up...
#@adapter.switchVersion(itemwindow.item, -1)
#updateTrainerPreview()
end
if Input.trigger?(Input::AUX2) #R button
@adapter.switchVersion(itemwindow.item, 1)
updateTrainerPreview()
end
if Input.trigger?(Input::AUX2)#R button
@adapter.switchVersion(itemwindow.item,1)
updateTrainerPreview()
end
if Input.trigger?(Input::SPECIAL)#R button
if Input.trigger?(Input::SPECIAL) #R button
@adapter.toggleEvent(itemwindow.item)
updateTrainerPreview()
end
if Input.trigger?(Input::BACK)
pbPlayCloseMenuSE
return nil
elsif Input.trigger?(Input::USE)
if itemwindow.index < @stock.length
if itemwindow.item.is_a?(Symbol)
@adapter.doSpecialItemAction(itemwindow.item)
updateTrainerPreview()
elsif itemwindow.index < @stock.length
pbRefresh
return @stock[itemwindow.index]
else
@@ -130,10 +150,9 @@ class ClothesShopView < PokemonMart_Scene
super
end
def pbEndBuyScene
@sprites["trainerPreview"].erase()
@sprites["trainerPreview"]=nil
@sprites["trainerPreview"] = nil
pbDisposeSpriteHash(@sprites)
@viewport.dispose
Kernel.pbClearText()

View File

@@ -6,21 +6,37 @@ class HairMartAdapter < OutfitsMartAdapter
def initialize(stock = nil, isShop = nil)
super
@version = getCurrentHairVersion().to_i
@worn_hair = $Trainer.hair
@worn_hat = $Trainer.hat
@hat_visible=false
@hat_visible = false
@removable = true
@previous_item= find_first_item()
end
def switchVersion(item, delta=1)
def find_first_item()
return @items.find { |item| item.is_a?(Outfit) }
end
def switchVersion(item, delta = 1)
if !item.is_a?(Outfit)
item = @previous_item
end
pbSEPlay("GUI party switch", 80, 100)
newVersion = @version+ delta
newVersion = @version + delta
lastVersion = findLastHairVersion(item.id)
newVersion = lastVersion if newVersion <= 0
newVersion = 1 if newVersion > lastVersion
@version = newVersion
end
#player can't "own" hairstyles
# if you want to go back one you had before, you have to pay again
def itemOwned(item)
return false
end
def toggleEvent(item)
pbSEPlay("GUI storage put down", 80, 100)
toggleHatVisibility()
@@ -28,8 +44,8 @@ class HairMartAdapter < OutfitsMartAdapter
def toggleText()
text = ""
text << "Color: L / R\n"
text << "Hat: D\n"
#text << "Color: R, \n"
text << "Toggle Hat: D\n"
end
@@ -39,15 +55,16 @@ class HairMartAdapter < OutfitsMartAdapter
def getPrice(item, selling = nil)
return 0 if !@isShop
trainerStyleID = getSplitHairFilenameAndVersionFromID($Trainer.hair)[0]
return 0 if item == trainerStyleID
return nil if itemOwned(item)
trainer_hair_id = getSplitHairFilenameAndVersionFromID(@worn_hair)[1]
return nil if item.id == trainer_hair_id
return item.price.to_i
end
def getDisplayPrice(item, selling = nil)
trainerStyleID = getSplitHairFilenameAndVersionFromID($Trainer.hair)[0]
return "-" if item == trainerStyleID
trainerStyleID = getSplitHairFilenameAndVersionFromID(@worn_hair)[1]
return "-" if item.id == trainerStyleID
super
end
@@ -64,6 +81,7 @@ class HairMartAdapter < OutfitsMartAdapter
end
def getName(item)
echoln $Trainer.hair
return item.id
end
@@ -84,12 +102,13 @@ class HairMartAdapter < OutfitsMartAdapter
end
def updateTrainerPreview(item, previewWindow)
return if !item
item = @previous_item if !item
item = @previous_item if item.is_a?(Symbol)
@previous_item = find_first_item() if !item.is_a?(Symbol)
displayed_hat = @hat_visible ? @worn_hat : nil
previewWindow.hat=displayed_hat
previewWindow.hat = displayed_hat
$Trainer.hat = displayed_hat
itemId = getCurrentHairId(item.id)
echoln itemId
previewWindow.hair = itemId
$Trainer.hair = itemId
pbRefreshSceneMap
@@ -99,10 +118,8 @@ class HairMartAdapter < OutfitsMartAdapter
def addItem(item)
itemId = getCurrentHairId(item.id)
changed_clothes = obtainNewHairstyle(itemId)
if changed_clothes
@worn_clothes = itemId
end
obtainNewHairstyle(itemId)
@worn_hair = itemId
end
def get_current_clothes()
@@ -112,15 +129,57 @@ class HairMartAdapter < OutfitsMartAdapter
def putOnOutfit(item)
itemFullId = getCurrentHairId(item.id)
putOnHair(item.id, @version)
@worn_clothes = itemFullId
@worn_hair = itemFullId
end
def reset_player_clothes()
$Trainer.hair = @worn_clothes
# can change hair color for free if not changing the style
if getVersionFromFullID(@worn_hair) != @version
worn_id = getSimplifiedHairIdFromFullID(@worn_hair)
if getSimplifiedHairIdFromFullID($Trainer.hair) == worn_id
@worn_hair = getFullHairId(worn_id,@version)
end
end
$Trainer.hair = @worn_hair
$Trainer.hat = @worn_hat
end
def get_unlocked_items_list()
return $Trainer.unlocked_hairstyles
end
def getSpecialItemCaption(specialType)
case specialType
when :SWAP_COLOR
return "Swap Color"
end
return nil
end
def getSpecialItemBaseColor(specialType)
case specialType
when :SWAP_COLOR
return MessageConfig::BLUE_TEXT_MAIN_COLOR
end
return nil
end
def getSpecialItemShadowColor(specialType)
case specialType
when :SWAP_COLOR
return MessageConfig::BLUE_TEXT_SHADOW_COLOR
end
return nil
end
def getSpecialItemDescription(specialType)
return "Swap to the next base hair color."
end
def doSpecialItemAction(specialType)
switchVersion(nil,1)
end
end

View File

@@ -28,9 +28,11 @@ class HairShopPresenter < PokemonMartScreen
itemname = @adapter.getDisplayName(item)
price = @adapter.getPrice(item)
echoln price
if !price.is_a?(Integer)
#@adapter.switchVersion(item,1)
pbDisplayPaused(_INTL("This is your current hairstyle!"))
@adapter.putOnOutfit(item)
next
end
if @adapter.getMoney < price

View File

@@ -8,6 +8,9 @@ class HatsMartAdapter < OutfitsMartAdapter
def toggleEvent(item)
if !@isShop
$Trainer.hat = nil
@worn_clothes = nil
if pbConfirmMessage(_INTL("Do you want to take off your hat?"))
$Trainer.hat = nil
@worn_clothes = nil
@@ -17,9 +20,10 @@ class HatsMartAdapter < OutfitsMartAdapter
end
def toggleText()
return if @isShop
toggleKey = "D"#getMappedKeyFor(Input::SPECIAL)
return "Remove hat: #{toggleKey}"
return
# return if @isShop
# toggleKey = "D"#getMappedKeyFor(Input::SPECIAL)
# return "Remove hat: #{toggleKey}"
end
def getName(item)
@@ -42,15 +46,20 @@ class HatsMartAdapter < OutfitsMartAdapter
end
def updateTrainerPreview(item, previewWindow)
return if !item
previewWindow.hat = item.id
$Trainer.hat = item.id unless $Trainer.hat==nil
if item.is_a?(Outfit)
previewWindow.hat = item.id
$Trainer.hat = item.id# unless $Trainer.hat==nil
else
$Trainer.hat=nil
previewWindow.hat= nil
end
pbRefreshSceneMap
previewWindow.updatePreview()
end
def addItem(item)
changed_clothes = obtainNewHat(item.id)
return unless item.is_a?(Outfit)
changed_clothes = obtainHat(item.id)
if changed_clothes
@worn_clothes = item.id
end
@@ -61,6 +70,7 @@ class HatsMartAdapter < OutfitsMartAdapter
end
def putOnOutfit(item)
return unless item.is_a?(Outfit)
putOnHat(item.id)
@worn_clothes = item.id
end
@@ -72,4 +82,38 @@ class HatsMartAdapter < OutfitsMartAdapter
def get_unlocked_items_list()
return $Trainer.unlocked_hats
end
def getSpecialItemCaption(specialType)
case specialType
when :REMOVE_HAT
return "Remove hat"
end
return nil
end
def getSpecialItemBaseColor(specialType)
case specialType
when :REMOVE_HAT
return MessageConfig::BLUE_TEXT_MAIN_COLOR
end
return nil
end
def getSpecialItemShadowColor(specialType)
case specialType
when :REMOVE_HAT
return MessageConfig::BLUE_TEXT_SHADOW_COLOR
end
return nil
end
def getSpecialItemDescription(specialType)
echoln $Trainer.hair
hair_situation = !$Trainer.hair || getSimplifiedHairIdFromFullID($Trainer.hair) == HAIR_BALD ? "bald head" : "fabulous hair"
return "Go without a hat and show off your #{hair_situation}!"
end
def doSpecialItemAction(specialType)
toggleEvent(nil)
end
end

View File

@@ -46,7 +46,18 @@ def get_hair_sets_list_path()
end
# Input: red_a
def getSimplifiedHairIdFromFullID(full_id)
split_id = getSplitHairFilenameAndVersionFromID(full_id)
return split_id[1] if split_id.length > 1
return ""
end
def getVersionFromFullID(full_id)
split_id = getSplitHairFilenameAndVersionFromID(full_id)
return split_id[0]
end
# Input: 1_red
# Output: ["1","red"]
def getSplitHairFilenameAndVersionFromID(hairstyle_id)
return "" if !hairstyle_id
@@ -60,44 +71,28 @@ def getFullHairId(hairstyle,version)
end
def getOverworldHairFilename(hairstyle_id)
# matches = hairstyle_id.to_s.match(/\A(\d+)([A-Za-z])?\z/)
# return "" if !matches
# hair_id = matches[1]
# version = matches.length > 1 ? matches[2] : "a"
hairstyle_split = getSplitHairFilenameAndVersionFromID(hairstyle_id)
name= hairstyle_split[-1]
version= hairstyle_split[-2]
# match_data = hairstyle_id.match(/(\d+)_/)
# version = match_data[0].to_i if match_data
base_path = Settings::PLAYER_GRAPHICS_FOLDER + Settings::PLAYER_HAIR_FOLDER
dynamic_path = _INTL("/{1}/", name)
filename = _INTL(Settings::PLAYER_HAIR_FOLDER + "_{1}_{2}",version, name)
#filename += version if version
full_path = base_path + dynamic_path + filename
return full_path
end
def getTrainerSpriteHairFilename(hairstyle_id)
# matches = hairstyle_id.to_s.match(/\A(\d+)([A-Za-z])?\z/)
# return "" if !matches
# hair_id = matches[1]
# version = matches.length > 1 ? matches[2] : "a"
return "" if !hairstyle_id
hairstyle_id= hairstyle_id.to_s
hairstyle_split= hairstyle_id.split("_")
name= hairstyle_split[-1]
version= hairstyle_split[-2]
# match_data = hairstyle_id.match(/(\d+)_/)
# version = match_data[0].to_i if match_data
base_path = Settings::PLAYER_GRAPHICS_FOLDER + Settings::PLAYER_HAIR_FOLDER
dynamic_path = _INTL("/{1}/", name)
filename = _INTL(Settings::PLAYER_HAIR_FOLDER + "_trainer_{1}_{2}",version, name)
#filename += version if version
full_path = base_path + dynamic_path + filename
return full_path
end

View File

@@ -1,18 +1,35 @@
def obtainNewHat(outfit_id)
return obtainHat(outfit_id)
end
def obtainNewClothes(outfit_id)
return obtainClothes(outfit_id)
end
def obtainHat(outfit_id)
echoln "obtained new hat: " + outfit_id
outfit = get_hat_by_id(outfit_id)
if !outfit
pbMessage(_INTL("The hat #{outfit_id} is invalid."))
return
end
$Trainer.unlocked_hats << outfit_id if !$Trainer.unlocked_hats.include?(outfit_id)
obtainOutfitMessage(outfit)
if pbConfirmMessage("Would you like to put it on right now?")
putOnHat(outfit_id)
putOnHat(outfit_id, false)
return true
end
return false
end
def obtainNewClothes(outfit_id)
def obtainClothes(outfit_id)
echoln "obtained new clothes: " + outfit_id
outfit = get_clothes_by_id(outfit_id)
if !outfit
pbMessage(_INTL("The clothes #{outfit_id} are invalid."))
return
end
return if !outfit
$Trainer.unlocked_clothes << outfit_id if !$Trainer.unlocked_clothes.include?(outfit_id)
obtainOutfitMessage(outfit)
if pbConfirmMessage("Would you like to put it on right now?")
@@ -23,56 +40,95 @@ def obtainNewClothes(outfit_id)
end
def obtainNewHairstyle(full_outfit_id)
split_outfit_id =getSplitHairFilenameAndVersionFromID(full_outfit_id)
hairstyle_id =split_outfit_id[1]
hairstyle_version= split_outfit_id[0]
outfit = get_hair_by_id(hairstyle_id)
$Trainer.unlocked_clothes << hairstyle_id if !$Trainer.unlocked_hairstyles.include?(hairstyle_id)
split_outfit_id = getSplitHairFilenameAndVersionFromID(full_outfit_id)
hairstyle_id = split_outfit_id[1]
hairstyle = get_hair_by_id(hairstyle_id)
musical_effect = "Key item get"
pbMessage(_INTL("\\me[{1}]Your hairstyle was changed to \\c[1]{2}\\c[0] hairstyle!\\wtnp[30]", musical_effect, outfit.name))
# pbMessage(_INTL("\\me[{1}]You obtained the \\c[1]{2}\\c[0] hairstyle!\\wtnp[30]", musical_effect, outfit.name))
# if pbConfirmMessage("Would you like to use this hairstyle right now?")
# putOnHair(hairstyle_id,hairstyle_version)
# return true
# end
return false
pbMessage(_INTL("\\me[{1}]Your hairstyle was changed to \\c[1]{2}\\c[0] hairstyle!\\wtnp[30]", musical_effect, hairstyle.name))
return true
end
def putOnClothes(outfit_id)
def putOnClothes(outfit_id, silent = false)
$Trainer.last_worn_outfit = $Trainer.clothes
outfit = get_clothes_by_id(outfit_id)
$Trainer.clothes = outfit_id
putOnOutfitMessage(outfit)
$Trainer.clothes_color = nil
$game_map.update
refreshPlayerOutfit()
putOnOutfitMessage(outfit) if !silent
end
def putOnHat(outfit_id)
def putOnHat(outfit_id, silent = false)
$Trainer.last_worn_hat = $Trainer.hat
outfit = get_hat_by_id(outfit_id)
$Trainer.hat = outfit_id
putOnOutfitMessage(outfit)
$Trainer.hat_color = nil
$game_map.
refreshPlayerOutfit()
putOnOutfitMessage(outfit) if !silent
end
def putOnHairFullId(full_outfit_id)
outfit_id = getSplitHairFilenameAndVersionFromID(full_outfit_id)[1]
outfit = get_hair_by_id(outfit_id)
$Trainer.hair = getFullHairId(full_outfit_id)
$Trainer.hair = full_outfit_id
$game_map.update
refreshPlayerOutfit()
putOnOutfitMessage(outfit)
end
def putOnHair(outfit_id, version)
full_id = getFullHairId(outfit_id, version)
putOnHairFullId(full_id)
#outfit = get_hair_by_id(outfit_id)
$Trainer.hair = getFullHairId(outfit_id,version)
#$Trainer.hair =
#putOnOutfitMessage(outfit)
end
def showOutfitPicture(outfit)
begin
outfitPath = outfit.trainer_sprite_path()
viewport = Viewport.new(Graphics.width / 4, 0, Graphics.width / 2, Graphics.height)
bg_sprite = Sprite.new(viewport)
outfit_sprite = Sprite.new(viewport)
outfit_bitmap = AnimatedBitmap.new(outfitPath) if pbResolveBitmap(outfitPath)
bg_bitmap = AnimatedBitmap.new("Graphics/Pictures/Outfits/obtain_bg")
outfit_sprite.bitmap = outfit_bitmap.bitmap
bg_sprite.bitmap = bg_bitmap.bitmap
# bitmap = AnimatedBitmap.new("Graphics/Pictures/Outfits/obtain_bg")
outfit_sprite.x = -50
outfit_sprite.y = 50
outfit_sprite.y -= 120 if outfit.type == :CLOTHES
# outfit_sprite.y = Graphics.height/2
outfit_sprite.zoom_x = 2
outfit_sprite.zoom_y = 2
bg_sprite.x = 0
viewport.z = 99999
# bg_sprite.y = Graphics.height/2
return viewport
rescue
#ignore
end
end
#todo: add a little preview window?
def obtainOutfitMessage(outfit)
pictureViewport = showOutfitPicture(outfit)
musical_effect = "Key item get"
pbMessage(_INTL("\\me[{1}]You obtained a \\c[1]{2}\\c[0]!\\wtnp[30]", musical_effect, outfit.name))
pictureViewport.dispose if pictureViewport
end
def putOnOutfitMessage(outfit)
playOutfitChangeAnimation()
pbMessage(_INTL("You put on the \\c[1]{1}\\c[0]!\\wtnp[30]", outfit.name))
outfitName = outfit.name == "" ? outfit.id : outfit.name
pbMessage(_INTL("You put on the \\c[1]{1}\\c[0]!\\wtnp[30]", outfitName))
end
def refreshPlayerOutfit()
@@ -92,5 +148,155 @@ def findLastHairVersion(hairId)
end
}
return last_version
end
def isWearingClothes(outfitId)
return $Trainer.clothes == outfitId
end
def isWearingHat(outfitId)
return $Trainer.hat == outfitId
end
def isWearingHairstyle(outfitId, version = nil)
current_hair_split_id = getSplitHairFilenameAndVersionFromID($Trainer.hair)
current_id = current_hair_split_id.length >= 1 ? current_hair_split_id[1] : nil
current_version = current_hair_split_id[0]
if version
return outfitId == current_id && version == current_version
end
return outfitId == current_id
end
#Some game switches need to be on/off depending on the outfit that the player is wearing,
# this is called every time you change outfit to make sure that they're always updated correctly
def updateOutfitSwitches(refresh_map = true)
$game_switches[WEARING_ROCKET_OUTFIT] = isWearingTeamRocketOutfit()
#$game_map.update
#$scene.reset_map(true) if refresh_map
#$scene.reset_map(false)
end
def getDefaultClothes()
gender = pbGet(VAR_TRAINER_GENDER)
if gender == GENDER_MALE
return DEFAULT_OUTFIT_MALE
end
return DEFAULT_OUTFIT_FEMALE
end
def hasClothes?(outfit_id)
return $Trainer.unlocked_clothes.include?(outfit_id)
end
def hasHat?(outfit_id)
return $Trainer.unlocked_hats.include?(outfit_id)
end
def getOutfitForPokemon(pokemonSpecies)
possible_clothes = []
possible_hats = []
body_pokemon_id = get_body_species_from_symbol(pokemonSpecies).to_s.downcase
head_pokemon_id = get_head_species_from_symbol(pokemonSpecies).to_s.downcase
body_pokemon_tag = "pokemon-#{body_pokemon_id}"
head_pokemon_tag = "pokemon-#{head_pokemon_id}"
possible_hats += search_hats([body_pokemon_tag])
possible_hats += search_hats([head_pokemon_tag])
possible_clothes += search_clothes([body_pokemon_tag])
possible_clothes += search_clothes([head_pokemon_tag])
if isFusion(getDexNumberForSpecies(pokemonSpecies))
possible_hats += search_hats(["pokemon-fused"], [], false)
possible_clothes += search_clothes(["pokemon-fused"], false)
end
possible_hats = filter_hats_only_not_owned(possible_hats)
possible_clothes = filter_clothes_only_not_owned(possible_clothes)
if !possible_hats.empty?() && !possible_clothes.empty?() #both have values, pick one at random
return [[possible_hats.sample, :HAT], [possible_clothes.sample, :CLOTHES]].sample
elsif !possible_hats.empty?
return [possible_hats.sample, :HAT]
elsif !possible_clothes.empty?
return [possible_clothes.sample, :CLOTHES]
end
return []
end
def hatUnlocked?(hatId)
return $Trainer.unlocked_hats.include?(hatId)
end
def export_current_outfit()
skinTone = $Trainer.skin_tone ? $Trainer.skin_tone : 0
hat = $Trainer.hat ? $Trainer.hat : "nil"
hair_color = $Trainer.hair_color || 0
clothes_color = $Trainer.clothes_color || 0
hat_color = $Trainer.hat_color || 0
exportedString = "TrainerAppearance.new(#{skinTone},\"#{hat}\",\"#{$Trainer.clothes}\",\"#{$Trainer.hair}\",#{hair_color},#{clothes_color},#{hat_color})"
Input.clipboard = exportedString
end
def clearEventCustomAppearance(event_id)
return if !$scene.is_a?(Scene_Map)
event_sprite = $scene.spriteset.character_sprites[@event_id]
for sprite in $scene.spriteset.character_sprites
if sprite.character.id == event_id
event_sprite = sprite
end
end
return if !event_sprite
event_sprite.clearBitmapOverride
end
def setEventAppearance(event_id, trainerAppearance)
return if !$scene.is_a?(Scene_Map)
event_sprite = $scene.spriteset.character_sprites[@event_id]
for sprite in $scene.spriteset.character_sprites
if sprite.character.id == event_id
event_sprite = sprite
end
end
return if !event_sprite
event_sprite.setSpriteToAppearance(trainerAppearance)
end
def getPlayerAppearance()
return TrainerAppearance.new($Trainer.skin_tone,$Trainer.hat,$Trainer.clothes, $Trainer.hair,
$Trainer.hair_color, $Trainer.clothes_color, $Trainer.hat_color)
end
def randomizePlayerOutfitUnlocked()
$Trainer.hat = $Trainer.unlocked_hats.sample
$Trainer.clothes = $Trainer.unlocked_clothes.sample
dye_hat = rand(2)==0
dye_clothes = rand(2)==0
dye_hair = rand(2)==0
$Trainer.hat_color = dye_hat ? rand(255) : 0
$Trainer.clothes_color = dye_clothes ? rand(255) : 0
$Trainer.hair_color = dye_hair ? rand(255) : 0
hair_id = $PokemonGlobal.hairstyles_data.keys.sample
hair_color = [1,2,3,4].sample
$Trainer.hair = getFullHairId(hair_id,hair_color)
end
def randomizePlayerOutfit()
$Trainer.hat = $PokemonGlobal.hats_data.keys.sample
$Trainer.clothes = $PokemonGlobal.clothes_data.keys.sample
$Trainer.hat_color = rand(2)==0 ? rand(255) : 0
$Trainer.clothes_color = rand(2)==0 ? rand(255) : 0
$Trainer.hair_color = rand(2)==0 ? rand(255) : 0
hair_id = $PokemonGlobal.hairstyles_data.keys.sample
hair_color = [1,2,3,4].sample
$Trainer.skin_tone = [1,2,3,4,5,6].sample
$Trainer.hair = getFullHairId(hair_id,hair_color)
end

View File

@@ -12,4 +12,8 @@ class Outfit
@tags = tags
@price = price
end
def trainer_sprite_path()
return nil
end
end

View File

@@ -1,5 +1,11 @@
class Clothes < Outfit
attr_accessor :type
def initialize(id, name, description = '',price=0, tags = [])
super
@type = :CLOTHES
end
def trainer_sprite_path()
return getTrainerSpriteOutfitFilename(self.id)
end
end

View File

@@ -1,5 +1,12 @@
class Hairstyle < Outfit
attr_accessor :type
def initialize(id, name, description = '',price=0, tags = [])
super
@type = :HAIR
end
def trainer_sprite_path()
return getTrainerSpriteHairFilename(self.id)
end
end

View File

@@ -1,5 +1,11 @@
class Hat < Outfit
attr_accessor :type
def initialize(id,name,description='',price=0,tags=[])
super
@type = :HAT
end
def trainer_sprite_path()
return getTrainerSpriteHatFilename(self.id)
end
end