mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-07-22 07:37:00 +00:00
Update 6.8
This commit is contained in:
@@ -42,8 +42,6 @@ def list_available_outfits(directory, versions = [], unlocked = [], prefix_filte
|
||||
else
|
||||
outfits = list_all_numeric_folders(directory)
|
||||
end
|
||||
# #echoln outfits
|
||||
# return outfits #todo: remove this return for unlockable outfits
|
||||
available_outfits = []
|
||||
for outfit in outfits
|
||||
if !unlocked || unlocked.include?(outfit)
|
||||
@@ -91,6 +89,13 @@ def shiftHairColor(incr)
|
||||
refreshPlayerOutfit()
|
||||
end
|
||||
|
||||
def shiftBikeColor(incr)
|
||||
$Trainer.bike_color = 0 if !$Trainer.bike_color
|
||||
$Trainer.bike_color += incr
|
||||
echoln "Bike color: #{$Trainer.bike_color}"
|
||||
refreshPlayerOutfit()
|
||||
end
|
||||
|
||||
def pbLoadOutfitBitmap(outfitFileName)
|
||||
begin
|
||||
outfitBitmap = RPG::Cache.load_bitmap("", outfitFileName)
|
||||
@@ -109,6 +114,7 @@ def setHat(hat_id)
|
||||
end
|
||||
|
||||
def getEasterEggHeldItem()
|
||||
return unless Settings::KANTO #todo: add hoenn map ids too
|
||||
map = $game_map.map_id
|
||||
return "secrets/HOTDOG" if [141, 194].include?(map) #restaurant
|
||||
return "secrets/SNOWBALL" if [670, 693, 698, 694].include?(map)
|
||||
@@ -140,7 +146,6 @@ def getCurrentPokeball(allowEasterEgg=true)
|
||||
end
|
||||
|
||||
def generate_front_trainer_sprite_bitmap_from_appearance(trainerAppearance,is_trainer=true)
|
||||
echoln trainerAppearance.hat
|
||||
return generate_front_trainer_sprite_bitmap(false,nil,trainerAppearance.clothes,trainerAppearance.hat,trainerAppearance.hat2,
|
||||
trainerAppearance.hair,trainerAppearance.skin_color,
|
||||
trainerAppearance.hair_color,trainerAppearance.hat_color,trainerAppearance.clothes_color,
|
||||
@@ -152,7 +157,6 @@ def generate_front_trainer_sprite_bitmap(allowEasterEgg=true, pokeball = nil,
|
||||
clothes_id = nil, hat_id = nil, hat2_id=nil, hair_id = nil,
|
||||
skin_tone_id = nil, hair_color = nil, hat_color = nil, clothes_color = nil,
|
||||
hat2_color = nil, is_trainer=true)
|
||||
|
||||
clothes_id = $Trainer.clothes if !clothes_id && is_trainer
|
||||
hat_id = $Trainer.hat if !hat_id && is_trainer
|
||||
hat2_id = $Trainer.hat2 if !hat2_id && is_trainer
|
||||
|
||||
@@ -52,7 +52,7 @@ class OutfitSelector
|
||||
list += get_hairstyle_salon_base_options()
|
||||
list += search_hairstyles(get_regional_sets_tags())
|
||||
end
|
||||
list << HAIR_BALD
|
||||
list << HAIR_BALD if Settings::KANTO
|
||||
return list
|
||||
end
|
||||
|
||||
|
||||
@@ -14,12 +14,26 @@ 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(',').map(&:strip) : []
|
||||
storeLocations = data['storelocation'] ? data['storelocation'].split(',').map(&:strip) : []
|
||||
tags += storeLocations
|
||||
|
||||
regionTags = data['regiontags'] ? data['regiontags'].split(',').map(&:strip) : []
|
||||
tags += regionTags
|
||||
|
||||
pokemonTags = data['pokemontags'] ? data['pokemontags'].split(',').map(&:strip) : []
|
||||
pokemonTags.each do |tag|
|
||||
tags << "pokemon-#{tag.downcase}"
|
||||
end
|
||||
contest_conditions = data['contestcondition'] ? data['contestcondition'].split(',').map(&:strip) : []
|
||||
|
||||
hat = Hat.new(
|
||||
data['id'],
|
||||
data['name'],
|
||||
data['description'],
|
||||
_OUTFIT_INTL(data['name']),
|
||||
_OUTFIT_INTL(data['description']),
|
||||
data['price'],
|
||||
tags
|
||||
tags,
|
||||
storeLocations,
|
||||
contest_conditions
|
||||
)
|
||||
$PokemonGlobal.hats_data[hat.id] = hat
|
||||
end
|
||||
@@ -35,17 +49,27 @@ 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(',').map(&:strip) : []
|
||||
storeLocations = data['storelocation'] ? data['storelocation'].split(',').map(&:strip) : []
|
||||
tags += storeLocations
|
||||
|
||||
regionTags = data['regiontags'] ? data['regiontags'].split(',').map(&:strip) : []
|
||||
tags += regionTags
|
||||
|
||||
hair = Hairstyle.new(
|
||||
data['id'],
|
||||
data['name'],
|
||||
data['description'],
|
||||
_OUTFIT_INTL(data['name']),
|
||||
_OUTFIT_INTL(data['description']),
|
||||
data['price'],
|
||||
tags
|
||||
tags,
|
||||
storeLocations
|
||||
)
|
||||
$PokemonGlobal.hairstyles_data[hair.id] = hair
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
def update_global_clothes_list()
|
||||
file_path = Settings::CLOTHES_DATA_PATH
|
||||
json_data = File.read(file_path)
|
||||
@@ -56,12 +80,25 @@ 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(',').map(&:strip) : []
|
||||
storeLocations = data['storelocation'] ? data['storelocation'].split(',').map(&:strip) : []
|
||||
tags += storeLocations
|
||||
|
||||
regionTags = data['regiontags'] ? data['regiontags'].split(',').map(&:strip) : []
|
||||
tags += regionTags
|
||||
|
||||
pokemonTags = data['pokemontags'] ? data['pokemontags'].split(',').map(&:strip) : []
|
||||
pokemonTags.each do |tag|
|
||||
tags << "pokemon-#{tag.downcase}"
|
||||
end
|
||||
contest_conditions = data['contestcondition'] ? data['contestcondition'].split(',').map(&:strip) : []
|
||||
outfit = Clothes.new(
|
||||
data['id'],
|
||||
data['name'],
|
||||
data['description'],
|
||||
_OUTFIT_INTL(data['name']),
|
||||
_OUTFIT_INTL(data['description']),
|
||||
data['price'],
|
||||
tags
|
||||
tags,
|
||||
storeLocations,
|
||||
contest_conditions
|
||||
)
|
||||
$PokemonGlobal.clothes_data[outfit.id] = outfit
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ CLOTHES_ROCK = "temp"
|
||||
CLOTHES_BUG_1 = "bughakama"
|
||||
CLOTHES_BUG_2 = "bughakamapants"
|
||||
|
||||
CLOTHES_GHOST = "temp"
|
||||
CLOTHES_GHOST = "ghostoutfit"
|
||||
|
||||
CLOTHES_STEEL_M = "steelworkerM"
|
||||
CLOTHES_STEEL_F = "steelworkerF"
|
||||
@@ -24,12 +24,14 @@ CLOTHES_STEEL_F = "steelworkerF"
|
||||
CLOTHES_FIRE = "fire"
|
||||
|
||||
CLOTHES_WATER = "waterdress"
|
||||
CLOTHES_WATER_NEUTRAL = "waterneutral"
|
||||
|
||||
CLOTHES_GRASS = "temp"
|
||||
CLOTHES_GRASS = "grassexpert"
|
||||
|
||||
CLOTHES_ELECTRIC = "urbanelectric"
|
||||
|
||||
CLOTHES_PSYCHIC = "temp"
|
||||
CLOTHES_PSYCHIC_M = "psyshamanm"
|
||||
CLOTHES_PSYCHIC_F = "psyshamanf"
|
||||
|
||||
CLOTHES_ICE = "iceoutfit"
|
||||
|
||||
@@ -41,6 +43,8 @@ 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, ]
|
||||
@@ -106,7 +110,7 @@ def isWearingFireOutfit()
|
||||
end
|
||||
|
||||
def isWearingWaterOutfit()
|
||||
return (isWearingClothes(CLOTHES_WATER))
|
||||
return (isWearingClothes(CLOTHES_WATER) || isWearingClothes(CLOTHES_WATER_NEUTRAL))
|
||||
end
|
||||
|
||||
def isWearingGrassOutfit()
|
||||
@@ -114,7 +118,7 @@ def isWearingGrassOutfit()
|
||||
end
|
||||
|
||||
def isWearingPsychicOutfit()
|
||||
return (isWearingClothes(CLOTHES_PSYCHIC))
|
||||
return ((isWearingClothes(CLOTHES_PSYCHIC_M) || isWearingClothes(CLOTHES_PSYCHIC_F)))
|
||||
end
|
||||
|
||||
def isWearingIceOutfit()
|
||||
@@ -134,8 +138,23 @@ def isWearingFairyOutfit()
|
||||
end
|
||||
|
||||
|
||||
def isWearingNurseOutfit()
|
||||
return (isWearingClothes(CLOTHES_NURSE))
|
||||
end
|
||||
|
||||
|
||||
def nurseOutfitHeal
|
||||
if isWearingNurseOutfit()
|
||||
$Trainer.party.each do |pokemon|
|
||||
next if pokemon.fainted?
|
||||
new_hp = pokemon.hp + (pokemon.totalhp/16)
|
||||
if new_hp > pokemon.totalhp
|
||||
pokemon.hp=pokemon.totalhp
|
||||
else
|
||||
pokemon.hp=new_hp
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def pickUpTypeItemSetBonus()
|
||||
return if rand(10) != 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Clothes
|
||||
# Clothes
|
||||
CLOTHES_TEAM_ROCKET_MALE = "rocketm"
|
||||
CLOTHES_TEAM_ROCKET_FEMALE = "rocketf"
|
||||
|
||||
@@ -11,39 +11,77 @@ CLOTHES_EMERALD = "emeraldSPE"
|
||||
CLOTHES_PIKACHU_ONESIE = "pikaonesie"
|
||||
|
||||
CLOTHES_GLITCH = "glitzerset"
|
||||
CLOTHES_BREEDER="PKMBreeder"
|
||||
CLOTHES_BREEDER = "PKMBreeder"
|
||||
|
||||
CLOTHES_FOSSIL_M ="sado"
|
||||
CLOTHES_FOSSIL_F ="sada"
|
||||
CLOTHES_FOSSIL_M = "sado"
|
||||
CLOTHES_FOSSIL_F = "sada"
|
||||
|
||||
CLOTHES_TREVENANT= "trevenantforestkingcloak"
|
||||
CLOTHES_TREVENANT = "trevenantforestkingcloak"
|
||||
|
||||
CLOTHES_WAITRESS = "maid"
|
||||
CLOTHES_WAITER = "butler"
|
||||
|
||||
CLOTHES_LASS_YELLOW ="lass"
|
||||
CLOTHES_LASS_BLUE ="lass2"
|
||||
|
||||
CLOTHES_ROCKET_WHITE_M ="RocketJames"
|
||||
CLOTHES_ROCKET_WHITE_F ="RocketJessie"
|
||||
CLOTHES_LASS_YELLOW = "lass"
|
||||
CLOTHES_LASS_BLUE = "lass2"
|
||||
|
||||
CLOTHES_ROCKET_WHITE_M = "RocketJames"
|
||||
CLOTHES_ROCKET_WHITE_F = "RocketJessie"
|
||||
CLOTHES_POLICE = "policeuniform"
|
||||
|
||||
DEFAULT_OUTFIT_MALE = "red"
|
||||
DEFAULT_OUTFIT_FEMALE = "leaf"
|
||||
STARTING_OUTFIT = "pikajamas"
|
||||
|
||||
CLOTHES_BRENDAN = "red" #todo
|
||||
CLOTHES_MAY = "leaf" #todo
|
||||
CLOTHES_BRENDAN = "brendanRS"
|
||||
CLOTHES_MAY = "mayRS"
|
||||
|
||||
#Hats
|
||||
CLOTHES_TEAM_MAGMA_M = "magmaRSE"
|
||||
CLOTHES_TEAM_MAGMA_F = "magmarsef"
|
||||
|
||||
CLOTHES_TEAM_AQUA_M = "teamaquaM"
|
||||
CLOTHES_TEAM_AQUA_F = "teamaquaF"
|
||||
|
||||
CLOTHES_ADVENTURER_M = "adventurer_m"
|
||||
CLOTHES_ADVENTURER_F = "adventurer_f"
|
||||
CLOTHES_VETERAN = "VeteranM"
|
||||
|
||||
CLOTHES_NURSE = "nursejoy"
|
||||
|
||||
CLOTHES_BUG_CATCHER_RSE = "BugCatcherRSE"
|
||||
|
||||
CLOTHES_BUG_CATCHER_ORAS = "BugCatcherORAS"
|
||||
HAT_BUG_CATCHER_ORAS = "BugCatcherORAS"
|
||||
|
||||
CLOTHES_FISHERMAN_ORAS = "FishermanORAS"
|
||||
HAT_FISHERMAN_ORAS = "FishermanORAS"
|
||||
|
||||
CLOTHES_YOUNGSTER_RSE = "YoungsterRSE"
|
||||
CLOTHES_YOUNGSTER_ORAS = "youngsterORAS"
|
||||
CLOTHES_YOUNGSTER_HGSS = "YoungsterHGSS"
|
||||
|
||||
CLOTHES_LADY = "lady"
|
||||
CLOTHES_PSYSHAMAN_M = "psyshaman"
|
||||
CLOTHES_PSYSHAMAN_F = "psyshamanf"
|
||||
|
||||
|
||||
CLOTHES_SWIMMING_M = "BlackSwimTrunks"
|
||||
CLOTHES_SAILOR = "WingullOutfit"
|
||||
HAT_SAILOR = "WingullOutfit"
|
||||
# Hats
|
||||
HAT_TEAM_ROCKET = "rocketcap"
|
||||
HAT_POSTMAN = "postman"
|
||||
HAT_PIDGEY_NEST = "pidgey"
|
||||
HAT_SWABLU_NEST = "swablu"
|
||||
HAT_ZIGZAGOON_NEST = "zigzaghat"
|
||||
HAT_RALTS_NEST = "ralts"
|
||||
HAT_RALTS_SHINY_NEST = "raltsshiny"
|
||||
|
||||
HAT_PIKACHUM_NEST = "pikhatchum"
|
||||
HAT_PIKACHUF_NEST = "pikhatchuf"
|
||||
HAT_PARAS_NEST = "headparas"
|
||||
HAT_EEVEE_NEST = "eevee"
|
||||
HAT_GOOMY_NEST = "headgoomy"
|
||||
|
||||
HAT_SILPHSCOPE = "silphscope"
|
||||
HAT_BRENDAN = "brendanRSE"
|
||||
HAT_MAY = "mayRSE"
|
||||
@@ -54,6 +92,14 @@ HAT_LUCHA = "hawluchamask"
|
||||
HAT_EEVEE_EARS = "eeveeears"
|
||||
HAT_PARASHROOM = "parashroom"
|
||||
HAT_AERODACTYL = "aerodactylSkull"
|
||||
HAT_TYRUNT = "tyruntmask"
|
||||
|
||||
HAT_POOCHYENA_MASK = "PoochyenaHead"
|
||||
HAT_LOTAD_MASK = "LotadHead"
|
||||
HAT_ZIGZAGOON_MASK = "ZigzagoonHead"
|
||||
HAT_WURMPLE_MASK = "WurmpleHead"
|
||||
|
||||
|
||||
HAT_DUSKULL_MASK = "duskullmask"
|
||||
HAT_SLEEPMASK = "sleepmask"
|
||||
HAT_DITTO_MASK = "creepydittomask"
|
||||
@@ -68,27 +114,32 @@ HAT_HALO = "halo"
|
||||
HAT_MAGIKARP = "magicap"
|
||||
HAT_SLOWKING_SHELL = "slowking"
|
||||
HAT_TENTACRUEL = "tentacruel"
|
||||
|
||||
HAT_HELMET = "helmet"
|
||||
HAT_POLICE = "policeuniform"
|
||||
HAT_ZOROARK = "banefulfoxmask"
|
||||
HAT_FROG = "froghat"
|
||||
HAT_SANTA = "santa"
|
||||
HAT_QMARKS = "glitzerset"
|
||||
HAT_SUDOWOODO = "sudowoodohorns"
|
||||
|
||||
HAT_TREVENANT="trevenantforestkingcrown"
|
||||
|
||||
HAT_SPROUT = "sprout"
|
||||
HAT_TREVENANT = "trevenantforestkingcrown"
|
||||
HAT_CHEF = "cheftoque"
|
||||
HAT_CLOWN = "clownnose"
|
||||
HAT_WHITE_HAND = "whitehand"
|
||||
HAT_COFFEE = "cupofcoffee"
|
||||
|
||||
HAT_BREEDER_1="breedervisor"
|
||||
HAT_BREEDER_2="breederbandana"
|
||||
HAT_BREEDER_2_2="PKMBreeder"
|
||||
HAT_BREEDER_1 = "breedervisor"
|
||||
HAT_BREEDER_2 = "breederbandana"
|
||||
HAT_BREEDER_2_2 = "PKMBreeder"
|
||||
|
||||
HAT_BREEDER_3="egg"
|
||||
HAT_BREEDER_3 = "egg"
|
||||
|
||||
HAT_BREEDEROUTFIT="PKMBreeder"
|
||||
HAT_BREEDEROUTFIT = "PKMBreeder"
|
||||
|
||||
HAT_WAITRESS = "maid"
|
||||
|
||||
HAT_PIRATE = "piratehat"
|
||||
|
||||
FUSION_HAT = "fusionnerd"
|
||||
FUSION_OUTFIT = "fusionnerd"
|
||||
|
||||
@@ -106,15 +157,24 @@ HAT_SCRIBBLES3 = "scribbles3"
|
||||
HAT_SCRIBBLES4 = "scribbles4"
|
||||
|
||||
HAT_CARDBOARD_BOX = "box"
|
||||
HAT_SLUDGE = "sludge"
|
||||
|
||||
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_GRADUATION = "professorhat"
|
||||
|
||||
HAT_NURSE_BLANK = "nursejoy"
|
||||
HAT_NURSE = "nursejoyhat"
|
||||
HAT_TRUMPET = "trumpet"
|
||||
|
||||
HAT_GYM_REWARD_1 = Settings::KANTO ? "brockpan" : "aronmask"
|
||||
HAT_GYM_REWARD_2 = Settings::KANTO ? "starmieclip" : "brawlyshades"
|
||||
HAT_GYM_REWARD_3 = Settings::KANTO ? "surgeglasses" : "magnemitepin"
|
||||
HAT_GYM_REWARD_4 = Settings::KANTO ? "erikaHeadband" : "flannerybeanie"
|
||||
HAT_GYM_REWARD_5 = Settings::KANTO ? "kogascarf" : "eeveeears"
|
||||
HAT_GYM_REWARD_6 = Settings::KANTO ? "sabrinasballs" : "winona"
|
||||
HAT_GYM_REWARD_7 = Settings::KANTO ? "blaineGlasses" : "sabrinasballs"
|
||||
HAT_GYM_REWARD_8 = Settings::KANTO ? "giovannifedora" : "starmieclip"
|
||||
HAT_GYM_REWARD_9 = "luluribbon"
|
||||
HAT_GYM_REWARD_10 = "kurtsentaihelmet"
|
||||
HAT_GYM_REWARD_11 = "falknerscage"
|
||||
@@ -124,8 +184,26 @@ HAT_GYM_REWARD_14 = "prycemask"
|
||||
HAT_GYM_REWARD_15 = "mortyHeadband"
|
||||
HAT_GYM_REWARD_16 = "magnemitepin"
|
||||
|
||||
HAT_DESIGNER_KANTO = "red"
|
||||
HAT_DESIGNER_JOHTO = "gold"
|
||||
HAT_DESIGNER_HOENN = HAT_ASH
|
||||
HAT_DESIGNER_SINNOH = "dawnDPP"
|
||||
HAT_DESIGNER_UNOVA = "hilbert"
|
||||
HAT_DESIGNER_KALOS = "serena"
|
||||
HAT_DESIGNER_ALOLA = "seleneUSUM"
|
||||
|
||||
#Hairstyles
|
||||
HAT_TEAM_MAGMA = "magmaRSE"
|
||||
HAT_TEAM_AQUA = "aquaRSE"
|
||||
|
||||
HAT_TEAM_MAGMA_ALT = "magmaORAS"
|
||||
HAT_TEAM_AQUA_ALT = "aquaORAS"
|
||||
|
||||
HAT_RED = "red"
|
||||
HAT_LEAF = "leaf"
|
||||
|
||||
HAT_VIKING = "hornedhelm"
|
||||
HAT_CROWN = "crown"
|
||||
# Hairstyles
|
||||
HAIR_RED = "red"
|
||||
HAIR_LEAF = "leaf"
|
||||
|
||||
@@ -133,36 +211,48 @@ HAIR_HEXMANIAC = "HexManiac"
|
||||
HAIR_LASS = "lass"
|
||||
|
||||
HAIR_BALD = "bald"
|
||||
HAIR_BALD_POLISHED = "polishedbald"
|
||||
|
||||
HAIR_RIVAL = "gary"
|
||||
HAIR_BROCK = "brock"
|
||||
HAIR_MISTY1 = "mistyRBY"
|
||||
HAIR_MISTY2 = "mistyGSC"
|
||||
|
||||
HAIR_SURGE = "surge" #does not exist yet
|
||||
HAIR_SURGE = "surge" # does not exist yet
|
||||
HAIR_ERIKA = "erika"
|
||||
HAIR_KOGA = "koga" #does not exist yet
|
||||
HAIR_KOGA = "koga" # does not exist yet
|
||||
HAIR_JANINE = "janine"
|
||||
HAIR_SABRINA = "sabrinaGSC"
|
||||
HAIR_BLAINE = "blaine" #does not exist yet
|
||||
HAIR_GIOVANNI = "giovanni" #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
|
||||
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
|
||||
|
||||
HAIR_ROXANNE = "roxanne"
|
||||
HAIR_BRAWLY = "brawly"
|
||||
HAIR_WATTSON = "wattson"
|
||||
|
||||
HAIR_HOOH = "ho-oh"
|
||||
HAIR_CRESSELIA = "lunarbob"
|
||||
HAIR_LYCANROC="lycanrocshorthair"
|
||||
HAIR_HAPPINY="happinysuit"
|
||||
HAIR_LATIAS="SpecialLatias"
|
||||
HAIR_GARDEVOIR="gardevoir"
|
||||
HAIR_EEVEE="eeveetail"
|
||||
HAIR_LEAFEON="leafeonbob"
|
||||
HAIR_ORICORIO="oricoriopuffs"
|
||||
HAIR_LYCANROC = "lycanrocshorthair"
|
||||
HAIR_HAPPINY = "happinysuit"
|
||||
HAIR_LATIAS = "SpecialLatias"
|
||||
HAIR_GARDEVOIR = "gardevoir"
|
||||
HAIR_EEVEE = "eeveetail"
|
||||
HAIR_LEAFEON = "leafeonbob"
|
||||
HAIR_ORICORIO = "oricoriopuffs"
|
||||
HAIR_TYRANITAR = "tyranaspikes"
|
||||
HAIR_TORCHIC = "torchictuft"
|
||||
HAIR_MUDKIP = "mudkipflip"
|
||||
HAIR_MAWILE = "mawile"
|
||||
HAIR_ROSERADE_M = "roseradeM"
|
||||
HAIR_ROSERADE_F = "roseradeF"
|
||||
|
||||
HAIR_BRENDAN = "buzzcut"
|
||||
HAIR_BRENDAN = "brendan"
|
||||
HAIR_MAY = "may"
|
||||
@@ -4,7 +4,6 @@ class CharacterSelectionMenuView
|
||||
attr_accessor :sprites
|
||||
attr_accessor :textValues
|
||||
|
||||
|
||||
OPTIONS_START_Y = 66
|
||||
CURSOR_Y_MARGIN = 50
|
||||
CURSOR_X_MARGIN = 76
|
||||
@@ -14,42 +13,37 @@ class CharacterSelectionMenuView
|
||||
|
||||
OPTIONS_LABEL_X = 50
|
||||
|
||||
|
||||
OPTIONS_LABEL_WIDTH = 100
|
||||
|
||||
OPTIONS_VALUE_X = 194
|
||||
SELECTOR_X = 120
|
||||
SELECTOR_STAGGER_OFFSET=26
|
||||
|
||||
SELECTOR_STAGGER_OFFSET = 26
|
||||
|
||||
ARROW_LEFT_X_POSITION = 75
|
||||
ARROW_RIGHT_X_POSITION = 275
|
||||
ARROWS_Y_OFFSET = 10#20
|
||||
ARROWS_Y_OFFSET = 10 # 20
|
||||
|
||||
CONFIRM_X = 296
|
||||
CONFIRM_Y= 322
|
||||
CONFIRM_Y = 322
|
||||
|
||||
STAGGER_OFFSET_1 = 26
|
||||
STAGGER_OFFSET_2 = 50
|
||||
|
||||
|
||||
|
||||
def initialize
|
||||
@presenter = CharacterSelectMenuPresenter.new(self)
|
||||
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
||||
@sprites = {}
|
||||
@textValues={}
|
||||
@max_index=5
|
||||
@textValues = {}
|
||||
@max_index = 5
|
||||
end
|
||||
|
||||
def init_graphics()
|
||||
@sprites["bg"] = IconSprite.new(@viewport)
|
||||
@sprites["bg"].setBitmap("Graphics/Pictures/trainer_application_form")
|
||||
|
||||
|
||||
@sprites["select"] = IconSprite.new(@viewport)
|
||||
@sprites["select"].setBitmap("Graphics/Pictures/cc_selection_box")
|
||||
@sprites["select"].x = get_cursor_x_position(0)#OPTIONS_LABEL_X + OPTIONS_LABEL_WIDTH + CURSOR_X_MARGIN
|
||||
@sprites["select"].x = get_cursor_x_position(0) # OPTIONS_LABEL_X + OPTIONS_LABEL_WIDTH + CURSOR_X_MARGIN
|
||||
@sprites["select"].y = OPTIONS_START_Y
|
||||
@sprites["select"].visible = true
|
||||
|
||||
@@ -59,43 +53,48 @@ class CharacterSelectionMenuView
|
||||
@sprites["leftarrow"].visible = false
|
||||
@sprites["leftarrow"].play
|
||||
|
||||
|
||||
@sprites["rightarrow"] = AnimatedSprite.new("Graphics/Pictures/rightarrow", 8, 40, 28, 2, @viewport)
|
||||
@sprites["rightarrow"].x = ARROW_RIGHT_X_POSITION
|
||||
@sprites["rightarrow"].y = 0
|
||||
@sprites["rightarrow"].visible = false
|
||||
@sprites["rightarrow"].play
|
||||
|
||||
@presenter.setInitialValues()
|
||||
end
|
||||
|
||||
|
||||
def setMaxIndex(maxIndex)
|
||||
@max_index=maxIndex
|
||||
@max_index = maxIndex
|
||||
end
|
||||
|
||||
def init_labels()
|
||||
Kernel.pbDisplayText("Confirm", (CONFIRM_X+CURSOR_X_MARGIN), CONFIRM_Y)
|
||||
|
||||
#Labels are directly in the image
|
||||
|
||||
# current_Y = OPTIONS_START_Y
|
||||
# for option in @presenter.options
|
||||
# x_pos = option == "Confirm" ? OPTIONS_VALUE_X : OPTIONS_LABEL_X
|
||||
#
|
||||
# Kernel.pbDisplayText(option, x_pos, current_Y)
|
||||
# current_Y += CURSOR_Y_MARGIN
|
||||
# end
|
||||
@textValues["confirm"].dispose if @textValues["confirm"]
|
||||
yposition = CONFIRM_Y
|
||||
xposition = CONFIRM_X+CURSOR_X_MARGIN
|
||||
|
||||
baseColor= baseColor ? baseColor : Color.new(72,72,72)
|
||||
shadowColor= shadowColor ? shadowColor : Color.new(160,160,160)
|
||||
@textValues["confirm"] = BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
|
||||
textPosition=[
|
||||
[_INTL("Confirm"),xposition,yposition,2,baseColor,shadowColor],
|
||||
]
|
||||
pbSetSystemFont(@textValues["confirm"].bitmap)
|
||||
pbDrawTextPositions(@textValues["confirm"].bitmap,textPosition)
|
||||
#Kernel.pbDisplayText("Confirm", (CONFIRM_X+CURSOR_X_MARGIN), CONFIRM_Y)
|
||||
end
|
||||
|
||||
|
||||
|
||||
def start
|
||||
init_graphics()
|
||||
init_labels()
|
||||
@presenter.setInitialValues()
|
||||
@presenter.main()
|
||||
end
|
||||
|
||||
def start_rival
|
||||
init_graphics()
|
||||
@sprites["bg"].setBitmap("Graphics/Pictures/trainer_application_form_rival")
|
||||
init_labels()
|
||||
@presenter.main_rival()
|
||||
end
|
||||
|
||||
def get_cursor_y_position(index)
|
||||
return CONFIRM_Y if index == @max_index
|
||||
return index * CURSOR_Y_MARGIN + OPTIONS_START_Y
|
||||
@@ -122,52 +121,48 @@ class CharacterSelectionMenuView
|
||||
return 0
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
def showSideArrows(y_index)
|
||||
y_position = get_cursor_y_position(y_index)
|
||||
|
||||
@sprites["rightarrow"].y=y_position+ARROWS_Y_OFFSET
|
||||
@sprites["leftarrow"].y=y_position+ARROWS_Y_OFFSET
|
||||
@sprites["rightarrow"].y = y_position + ARROWS_Y_OFFSET
|
||||
@sprites["leftarrow"].y = y_position + ARROWS_Y_OFFSET
|
||||
|
||||
@sprites["leftarrow"].x=getTextBoxStaggerOffset(y_index)+ARROW_LEFT_X_POSITION
|
||||
@sprites["rightarrow"].x= getTextBoxStaggerOffset(y_index)+ARROW_RIGHT_X_POSITION
|
||||
@sprites["leftarrow"].x = getTextBoxStaggerOffset(y_index) + ARROW_LEFT_X_POSITION
|
||||
@sprites["rightarrow"].x = getTextBoxStaggerOffset(y_index) + ARROW_RIGHT_X_POSITION
|
||||
|
||||
@sprites["rightarrow"].visible=true
|
||||
@sprites["leftarrow"].visible=true
|
||||
@sprites["rightarrow"].visible = true
|
||||
@sprites["leftarrow"].visible = true
|
||||
end
|
||||
|
||||
def hideSideArrows()
|
||||
@sprites["rightarrow"].visible=false
|
||||
@sprites["leftarrow"].visible=false
|
||||
@sprites["rightarrow"].visible = false
|
||||
@sprites["leftarrow"].visible = false
|
||||
end
|
||||
|
||||
def displayAge(age,y_index)
|
||||
def displayAge(age, y_index)
|
||||
y_position = get_cursor_y_position(y_index)
|
||||
x_position = get_value_x_position(y_index)
|
||||
Kernel.pbClearNumber()
|
||||
Kernel.pbDisplayNumber(age,x_position,y_position)
|
||||
Kernel.pbDisplayNumber(age, x_position, y_position)
|
||||
end
|
||||
|
||||
def displayText(spriteId,text,y_index)
|
||||
def displayText(spriteId, text, y_index)
|
||||
@textValues[spriteId].dispose if @textValues[spriteId]
|
||||
yposition = get_cursor_y_position(y_index)
|
||||
xposition = get_value_x_position(y_index)
|
||||
|
||||
baseColor= baseColor ? baseColor : Color.new(72,72,72)
|
||||
shadowColor= shadowColor ? shadowColor : Color.new(160,160,160)
|
||||
@textValues[spriteId] = BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
|
||||
text1=_INTL(text)
|
||||
textPosition=[
|
||||
[text1,xposition,yposition,2,baseColor,shadowColor],
|
||||
baseColor = baseColor ? baseColor : Color.new(72, 72, 72)
|
||||
shadowColor = shadowColor ? shadowColor : Color.new(160, 160, 160)
|
||||
@textValues[spriteId] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
||||
text1 = _INTL(text)
|
||||
textPosition = [
|
||||
[text1, xposition, yposition, 2, baseColor, shadowColor],
|
||||
]
|
||||
pbSetSystemFont(@textValues[spriteId].bitmap)
|
||||
pbDrawTextPositions(@textValues[spriteId].bitmap,textPosition)
|
||||
pbDrawTextPositions(@textValues[spriteId].bitmap, textPosition)
|
||||
|
||||
end
|
||||
|
||||
|
||||
def updateGraphics()
|
||||
Graphics.update
|
||||
Input.update
|
||||
@@ -177,5 +172,4 @@ class CharacterSelectionMenuView
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
class CharacterSelectMenuPresenter
|
||||
attr_accessor :options
|
||||
attr_reader :current_index
|
||||
|
||||
OPTION_NAME = 'Name'
|
||||
OPTION_AGE = "Age"
|
||||
OPTION_GENDER = "Gender"
|
||||
OPTION_HAIR = "Hair"
|
||||
OPTION_SKIN = "Skin"
|
||||
OPTION_CONFIRM = "Confirm"
|
||||
OPTION_NAME = _INTL("Name")
|
||||
OPTION_AGE = _INTL("Age")
|
||||
OPTION_GENDER = _INTL("Gender")
|
||||
OPTION_HAIR = _INTL("Hair")
|
||||
OPTION_SKIN = _INTL("Skin")
|
||||
OPTION_CONFIRM = _INTL("Confirm")
|
||||
|
||||
MIN_AGE = 10
|
||||
MAX_AGE = 17
|
||||
|
||||
MIN_SKIN_COLOR = 1
|
||||
MAX_SKIN_COLOR = 6
|
||||
SKIN_COLOR_IDS = ["Type A", "Type B", "Type C", "Type D", "Type E", "Type F"]
|
||||
GENDERS_IDS = ["Female", "Male"]
|
||||
SKIN_COLOR_IDS = [_INTL("Type A"), _INTL("Type B"), _INTL("Type C"), _INTL("Type D"), _INTL("Type E"), _INTL("Type F")]
|
||||
GENDERS_IDS = [_INTL("Female"), _INTL("Male")]
|
||||
|
||||
HAIR_COLOR_IDS = [1, 2, 3, 4]
|
||||
HAIR_COLOR_NAMES = ["Blonde", "Light Brown", "Dark Brown", "Black"]
|
||||
HAIR_COLOR_NAMES = [_INTL("Blonde"), _INTL("Light Brown"), _INTL("Dark Brown"), _INTL("Black")]
|
||||
|
||||
#ids for displayed text sprites
|
||||
NAME_TEXT_ID = "name"
|
||||
@@ -35,6 +34,7 @@ class CharacterSelectMenuPresenter
|
||||
@hairstyle = "red"
|
||||
@hairColor = 2
|
||||
|
||||
@is_player= true
|
||||
@options = [OPTION_NAME, OPTION_GENDER, OPTION_AGE, OPTION_SKIN, OPTION_HAIR, OPTION_CONFIRM]
|
||||
|
||||
@trainerPreview = TrainerClothesPreview.new(300, 80, false, "POKEBALL")
|
||||
@@ -42,9 +42,44 @@ class CharacterSelectMenuPresenter
|
||||
@closed = false
|
||||
@current_index = 0
|
||||
@view.setMaxIndex(@options.length - 1)
|
||||
@rival = false
|
||||
end
|
||||
|
||||
#For selecting the rival in Hoenn
|
||||
def main_rival()
|
||||
trainer_hair = $Trainer.hair
|
||||
trainer_hat = $Trainer.hat
|
||||
trainer_clothes = $Trainer.clothes
|
||||
trainer_skinTone = $Trainer.skin_tone
|
||||
trainer_name = $Trainer.name
|
||||
@trainerPreview.set_trainer(false)
|
||||
$Trainer.hat = nil
|
||||
@options = [OPTION_NAME, OPTION_SKIN, OPTION_HAIR, OPTION_CONFIRM]
|
||||
@view.setMaxIndex(@options.length - 1)
|
||||
if isPlayerMale
|
||||
@hairstyle = getDefaultHair(GENDER_FEMALE)
|
||||
$Trainer.clothes = getDefaultClothes(GENDER_FEMALE)
|
||||
$Trainer.hair = getDefaultHair(GENDER_FEMALE)
|
||||
else
|
||||
@hairstyle = getDefaultHair(GENDER_MALE)
|
||||
$Trainer.clothes = getDefaultClothes(GENDER_MALE)
|
||||
$Trainer.hair = getDefaultHair(GENDER_MALE)
|
||||
end
|
||||
@rival = true
|
||||
setInitialValuesRival()
|
||||
main()
|
||||
$Trainer.init_rival_appearance($Trainer.skin_tone, $Trainer.hair)
|
||||
pbSet(VAR_RIVAL_NAME, @name)
|
||||
$Trainer.hair = trainer_hair
|
||||
$Trainer.hat = trainer_hat
|
||||
$Trainer.clothes = trainer_clothes
|
||||
$Trainer.skin_tone = trainer_skinTone
|
||||
$Trainer.name = trainer_name
|
||||
$scene.reset_player_sprite
|
||||
end
|
||||
|
||||
def main()
|
||||
#@trainerPreview.show()
|
||||
pbSEPlay("GUI naming tab swap start", 80, 100)
|
||||
@current_index = 0
|
||||
loop do
|
||||
@@ -66,6 +101,7 @@ class CharacterSelectMenuPresenter
|
||||
|
||||
def updateTrainerPreview
|
||||
@trainerPreview.resetOutfits
|
||||
@trainerPreview.hat2=nil
|
||||
@trainerPreview.updatePreview
|
||||
end
|
||||
|
||||
@@ -74,7 +110,7 @@ class CharacterSelectMenuPresenter
|
||||
case selected_option
|
||||
when OPTION_NAME
|
||||
pbSEPlay("GUI summary change page", 80, 100)
|
||||
@name = pbEnterPlayerName(_INTL("Enter your name"), 0, Settings::MAX_PLAYER_NAME_SIZE)
|
||||
@name = pbEnterPlayerName(_INTL("Name?"), 0, Settings::MAX_PLAYER_NAME_SIZE, @name)
|
||||
@name = getDefaultName() if @name == ''
|
||||
pbSEPlay("GUI trainer card open", 80, 100)
|
||||
updateDisplayedName(current_index)
|
||||
@@ -102,6 +138,9 @@ class CharacterSelectMenuPresenter
|
||||
end
|
||||
|
||||
def getDefaultName()
|
||||
if @rival
|
||||
return init_rival_name
|
||||
end
|
||||
return getPlayerDefaultName(@gender)
|
||||
end
|
||||
|
||||
@@ -111,7 +150,6 @@ class CharacterSelectMenuPresenter
|
||||
|
||||
def applyAllSelectedValues
|
||||
applyGender(@gender)
|
||||
echoln @age
|
||||
pbSet(VAR_TRAINER_AGE, @age)
|
||||
$Trainer.skin_tone = @skinTone
|
||||
$Trainer.name = @name
|
||||
@@ -135,9 +173,21 @@ class CharacterSelectMenuPresenter
|
||||
@current_index = @options.length - 1 if @current_index <= -1
|
||||
|
||||
update_cursor(@current_index)
|
||||
setHatVisibility(@current_index)
|
||||
return @current_index
|
||||
end
|
||||
|
||||
def setHatVisibility(index)
|
||||
return if @rival
|
||||
case @options[index]
|
||||
when OPTION_HAIR
|
||||
$Trainer.hat=nil
|
||||
else
|
||||
$Trainer.hat = getDefaultHat(@gender)
|
||||
end
|
||||
updateTrainerPreview
|
||||
end
|
||||
|
||||
def update_cursor(index)
|
||||
@view.sprites["select"].y = @view.get_cursor_y_position(index)
|
||||
@view.sprites["select"].x = @view.get_cursor_x_position(index)
|
||||
@@ -146,7 +196,7 @@ class CharacterSelectMenuPresenter
|
||||
end
|
||||
|
||||
def close_menu
|
||||
@trainerPreview.erase()
|
||||
@trainerPreview.erase
|
||||
Kernel.pbClearNumber()
|
||||
Kernel.pbClearText()
|
||||
pbDisposeSpriteHash(@view.sprites)
|
||||
@@ -229,6 +279,7 @@ class CharacterSelectMenuPresenter
|
||||
end
|
||||
|
||||
def applyGender(gender_index)
|
||||
return if @rival
|
||||
# outfitId = gender + 1
|
||||
pbSet(VAR_TRAINER_GENDER, gender_index)
|
||||
|
||||
@@ -273,4 +324,16 @@ class CharacterSelectMenuPresenter
|
||||
updateTrainerPreview()
|
||||
end
|
||||
|
||||
def setInitialValuesRival()
|
||||
hairIndex = getOptionIndex(OPTION_HAIR)
|
||||
skinIndex = getOptionIndex(OPTION_SKIN)
|
||||
|
||||
@name = init_rival_name
|
||||
updateDisplayedName(getOptionIndex(OPTION_NAME))
|
||||
|
||||
setHairColor(hairIndex, 0)
|
||||
setSkinColor(skinIndex, 0)
|
||||
updateTrainerPreview()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ def selectHairstyle(all_unlocked = false)
|
||||
selector = OutfitSelector.new
|
||||
display_outfit_preview()
|
||||
hat = $Trainer.hat
|
||||
commands = ["Next style", "Previous style", "Toggle hat", "Back"]
|
||||
commands = [_INTL("Next style"), _INTL("Previous style"), _INTL("Toggle hat"), _INTL("Back")]
|
||||
previous_input = 0
|
||||
# To enable turning the common event that lets you turn around while in the dialog box
|
||||
while (true)
|
||||
@@ -56,6 +56,45 @@ def swapToNextHairVersion()
|
||||
$Trainer.hair = getFullHairId(hair_style,newVersion)
|
||||
end
|
||||
|
||||
|
||||
def select_bike_color
|
||||
original_color = $Trainer.bike_color
|
||||
$game_switches[SWITCH_SELECTING_CLOTHES]=true
|
||||
$game_map.update
|
||||
commands = [_INTL("Shift up"), _INTL("Shift down"), _INTL("Default"), _INTL("Confirm"), _INTL("Never Mind")]
|
||||
previous_input = 0
|
||||
|
||||
while true
|
||||
choice = pbShowCommands(nil, commands, commands.length, previous_input)
|
||||
previous_input = choice
|
||||
case choice
|
||||
when 0 #NEXT
|
||||
pbSEPlay("GUI storage pick up", 80, 100)
|
||||
shiftBikeColor(10)
|
||||
ret = true
|
||||
when 1 #PREVIOUS
|
||||
pbSEPlay("GUI storage pick up", 80, 100)
|
||||
shiftBikeColor(-10)
|
||||
ret = true
|
||||
when 2 #Reset
|
||||
pbSEPlay("GUI storage put down", 80, 100)
|
||||
$Trainer.bike_color = 0
|
||||
refreshPlayerOutfit
|
||||
ret = original_color != 0
|
||||
when 3 #Confirm
|
||||
break
|
||||
else
|
||||
pbSEPlay("GUI storage put down", 80, 100)
|
||||
$Trainer.bike_color = original_color
|
||||
ret = false
|
||||
break
|
||||
end
|
||||
end
|
||||
$game_switches[SWITCH_SELECTING_CLOTHES]=false
|
||||
$game_map.update
|
||||
return ret
|
||||
end
|
||||
|
||||
def selectHairColor
|
||||
original_color = $Trainer.hair_color
|
||||
original_hair = $Trainer.hair
|
||||
@@ -63,7 +102,8 @@ def selectHairColor
|
||||
$game_map.update
|
||||
display_outfit_preview()
|
||||
hat = $Trainer.hat
|
||||
commands = ["Swap base color", "Shift up", "Shift down", "Toggle hat", "Remove dye", "Confirm", "Never Mind"]
|
||||
hat2 = $Trainer.hat2
|
||||
commands = [_INTL("Swap base color"), _INTL("Shift up"), _INTL("Shift down"), _INTL("Toggle hat"), _INTL("Remove dye"), _INTL("Confirm"), _INTL("Never Mind")]
|
||||
previous_input = 0
|
||||
|
||||
while (true)
|
||||
@@ -89,8 +129,10 @@ def selectHairColor
|
||||
pbSEPlay("GUI storage put down", 80, 100)
|
||||
if hat == $Trainer.hat
|
||||
$Trainer.hat = nil
|
||||
$Trainer.hat2 = nil
|
||||
else
|
||||
$Trainer.hat = hat
|
||||
$Trainer.hat2 = hat2
|
||||
end
|
||||
display_outfit_preview()
|
||||
when 4 #Reset
|
||||
@@ -109,6 +151,7 @@ def selectHairColor
|
||||
end
|
||||
hide_outfit_preview()
|
||||
$Trainer.hat = hat
|
||||
$Trainer.hat2 = hat2
|
||||
$game_switches[SWITCH_SELECTING_CLOTHES]=false
|
||||
$game_map.update
|
||||
return ret
|
||||
@@ -118,7 +161,7 @@ end
|
||||
def selectHatColor(secondary_hat=false)
|
||||
original_color = secondary_hat ? $Trainer.hat2_color : $Trainer.hat_color
|
||||
display_outfit_preview()
|
||||
commands = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"]
|
||||
commands = [_INTL("Shift up"), _INTL("Shift down"), _INTL("Reset"), _INTL("Confirm"), _INTL("Never Mind")]
|
||||
previous_input = 0
|
||||
while (true)
|
||||
choice = pbShowCommands(nil, commands, commands.length, previous_input)
|
||||
@@ -158,7 +201,7 @@ end
|
||||
def selectClothesColor
|
||||
original_color = $Trainer.clothes_color
|
||||
display_outfit_preview()
|
||||
commands = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"]
|
||||
commands = [_INTL("Shift up"), _INTL("Shift down"), _INTL("Reset"), _INTL("Confirm"), _INTL("Never Mind")]
|
||||
previous_input = 0
|
||||
ret = false
|
||||
while (true)
|
||||
@@ -197,7 +240,7 @@ end
|
||||
def selectHat(all_unlocked = false)
|
||||
selector = OutfitSelector.new
|
||||
display_outfit_preview()
|
||||
commands = ["Next hat", "Previous hat", "Remove hat", "Back"]
|
||||
commands = [_INTL("Next hat"), _INTL("Previous hat"), _INTL("Remove hat"), _INTL("Back")]
|
||||
previous_input = 0
|
||||
while (true)
|
||||
choice = pbShowCommands(nil, commands, commands.length, previous_input)
|
||||
@@ -230,10 +273,10 @@ end
|
||||
def selectClothes(all_unlocked = false)
|
||||
selector = OutfitSelector.new
|
||||
display_outfit_preview()
|
||||
commands = ["Next", "Previous"]
|
||||
commands = [_INTL("Next"), _INTL("Previous")]
|
||||
#commands << "Remove clothes (DEBUG)" if $DEBUG
|
||||
commands << "Remove" if $DEBUG
|
||||
commands << "Back"
|
||||
commands << _INTL("Remove") if $DEBUG
|
||||
commands << _INTL("Back")
|
||||
previous_input = 0
|
||||
while (true)
|
||||
choice = pbShowCommands(nil, commands, commands.length, previous_input)
|
||||
@@ -262,4 +305,4 @@ end
|
||||
def place_hat_on_pokemon(pokemon)
|
||||
hatscreen = PokemonHatPresenter.new(nil, pokemon)
|
||||
hatscreen.pbStartScreen()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -146,15 +146,18 @@ class PokemonHatPresenter
|
||||
def initialize_bitmap()
|
||||
spriteLoader = BattleSpriteLoader.new
|
||||
|
||||
if @pokemon.isTripleFusion?
|
||||
#todo
|
||||
elsif @pokemon.isFusion?
|
||||
@original_pokemon_bitmap = spriteLoader.load_fusion_sprite(@pokemon.head_id(),@pokemon.body_id())
|
||||
if $PokemonSystem.random_sprites
|
||||
@original_pokemon_bitmap = spriteLoader.load_pif_sprite_pokemon(@pokemon)
|
||||
else
|
||||
echoln @pokemon
|
||||
echoln @pokemon.species_data
|
||||
@original_pokemon_bitmap = spriteLoader.load_base_sprite(@pokemon.id_number)
|
||||
if @pokemon.isTripleFusion?
|
||||
#todo
|
||||
elsif @pokemon.isFusion?
|
||||
@original_pokemon_bitmap = spriteLoader.load_fusion_sprite(@pokemon.head_id(),@pokemon.body_id())
|
||||
else
|
||||
@original_pokemon_bitmap = spriteLoader.load_base_sprite(@pokemon.id_number)
|
||||
end
|
||||
end
|
||||
|
||||
@original_pokemon_bitmap.scale_bitmap(Settings::FRONTSPRITE_SCALE)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class TrainerClothesPreview
|
||||
attr_writer :pokeball, :clothes, :hat, :hat2, :hair, :skin_tone, :hair_color, :hat_color,:hat2_color, :clothes_color
|
||||
|
||||
def initialize(x = 0, y = 0, windowed = true, pokeball = nil)
|
||||
def initialize(x = 0, y = 0, windowed = true, pokeball = nil, is_trainer = true)
|
||||
@playerBitmap = nil
|
||||
@playerSprite = nil
|
||||
@x_pos = x
|
||||
@@ -9,6 +9,7 @@ class TrainerClothesPreview
|
||||
@windowed = windowed
|
||||
|
||||
@pokeball = pokeball
|
||||
@is_trainer = is_trainer
|
||||
resetOutfits()
|
||||
end
|
||||
|
||||
@@ -28,6 +29,10 @@ class TrainerClothesPreview
|
||||
end
|
||||
end
|
||||
|
||||
def set_trainer(value)
|
||||
@is_trainer = value
|
||||
end
|
||||
|
||||
def resetOutfits()
|
||||
@clothes = $Trainer.clothes
|
||||
@hat = $Trainer.hat
|
||||
@@ -46,7 +51,8 @@ class TrainerClothesPreview
|
||||
@clothes,
|
||||
@hat,@hat2, @hair,
|
||||
@skin_tone,
|
||||
@hair_color, @hat_color, @clothes_color, @hat2_color)
|
||||
@hair_color, @hat_color, @clothes_color, @hat2_color,
|
||||
@is_trainer)
|
||||
initialize_preview()
|
||||
end
|
||||
|
||||
|
||||
@@ -7,22 +7,32 @@ class OutfitsMartAdapter < PokemonMartAdapter
|
||||
WORN_ITEM_SHADOW_COLOR = MessageConfig::BLUE_TEXT_SHADOW_COLOR
|
||||
|
||||
|
||||
REGIONAL_SET_BASE_COLOR = Color.new(76,72,104)
|
||||
REGIONAL_SET_SHADOW_COLOR = Color.new(173,165,189)
|
||||
|
||||
CITY_EXCLUSIVE_BASE_COLOR = Color.new(61 , 125, 70) #Color.new(72 , 104, 83)
|
||||
CITY_EXCLUSIVE_SHADOW_COLOR = Color.new(165, 189, 178)
|
||||
|
||||
def initialize(stock = [], isShop = true, isSecondaryHat = false)
|
||||
def initialize(stock = [], isShop = true, isSecondaryHat = false, prices_override = {})
|
||||
@is_secondary_hat = isSecondaryHat
|
||||
@items = stock
|
||||
@worn_clothes = get_current_clothes()
|
||||
@isShop = isShop
|
||||
@version = nil
|
||||
@prices_override = prices_override
|
||||
$Trainer.dyed_hats = {} if !$Trainer.dyed_hats
|
||||
$Trainer.dyed_clothes = {} if !$Trainer.dyed_clothes
|
||||
|
||||
|
||||
@REGIONAL_SET_BASE_COLOR = Color.new(76,72,104)
|
||||
@REGIONAL_SET_SHADOW_COLOR = Color.new(173,165,189)
|
||||
|
||||
@CITY_EXCLUSIVE_BASE_COLOR = Color.new(61 , 125, 70) #Color.new(72 , 104, 83)
|
||||
@CITY_EXCLUSIVE_SHADOW_COLOR = Color.new(165, 189, 178)
|
||||
|
||||
if isDarkMode
|
||||
@REGIONAL_SET_BASE_COLOR, @REGIONAL_SET_SHADOW_COLOR = @REGIONAL_SET_SHADOW_COLOR, @REGIONAL_SET_BASE_COLOR
|
||||
@CITY_EXCLUSIVE_BASE_COLOR, @CITY_EXCLUSIVE_SHADOW_COLOR = @CITY_EXCLUSIVE_SHADOW_COLOR, @CITY_EXCLUSIVE_BASE_COLOR
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def list_regional_set_items()
|
||||
return []
|
||||
end
|
||||
@@ -69,6 +79,9 @@ class OutfitsMartAdapter < PokemonMartAdapter
|
||||
|
||||
def getPrice(item, selling = nil)
|
||||
return 0 if !@isShop
|
||||
if @prices_override && @prices_override.has_key?(item.id)
|
||||
return @prices_override[item.id]
|
||||
end
|
||||
return nil if itemOwned(item)
|
||||
return item.price.to_i
|
||||
end
|
||||
@@ -101,6 +114,7 @@ class OutfitsMartAdapter < PokemonMartAdapter
|
||||
end
|
||||
|
||||
def isItemInRegionalSet(item)
|
||||
return false if Settings::HOENN
|
||||
return item.is_in_regional_set
|
||||
end
|
||||
|
||||
@@ -109,27 +123,40 @@ class OutfitsMartAdapter < PokemonMartAdapter
|
||||
end
|
||||
|
||||
def getBaseColorOverride(item)
|
||||
return REGIONAL_SET_BASE_COLOR if isItemInRegionalSet(item)
|
||||
return CITY_EXCLUSIVE_BASE_COLOR if isItemCityExclusive(item)
|
||||
return @REGIONAL_SET_BASE_COLOR if isItemInRegionalSet(item)
|
||||
return @CITY_EXCLUSIVE_BASE_COLOR if isItemCityExclusive(item)
|
||||
return nil
|
||||
end
|
||||
|
||||
def getShadowColorOverride(item)
|
||||
return REGIONAL_SET_SHADOW_COLOR if isItemInRegionalSet(item)
|
||||
return CITY_EXCLUSIVE_SHADOW_COLOR if isItemCityExclusive(item)
|
||||
return @REGIONAL_SET_SHADOW_COLOR if isItemInRegionalSet(item)
|
||||
return @CITY_EXCLUSIVE_SHADOW_COLOR if isItemCityExclusive(item)
|
||||
return nil
|
||||
end
|
||||
|
||||
def getMoney
|
||||
super
|
||||
if Settings::HOENN
|
||||
return $Trainer.cosmetics_money
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
def getMoneyString
|
||||
super
|
||||
if Settings::HOENN
|
||||
$Trainer.cosmetics_money = 0 unless $Trainer.cosmetics_money
|
||||
return pbGetCosmeticsMoneyString
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
def setMoney(value)
|
||||
super
|
||||
if Settings::HOENN
|
||||
$Trainer.cosmetics_money = value
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
def getItemIconRect(_item)
|
||||
|
||||
@@ -10,8 +10,8 @@ class ClothesMartAdapter < OutfitsMartAdapter
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(stock = nil, isShop = nil)
|
||||
super
|
||||
def initialize(stock = nil, isShop = nil, prices_override = {})
|
||||
super(stock,isShop,false,prices_override)
|
||||
end
|
||||
|
||||
def getName(item)
|
||||
@@ -22,6 +22,7 @@ class ClothesMartAdapter < OutfitsMartAdapter
|
||||
|
||||
def getDescription(item)
|
||||
return DEFAULT_DESCRIPTION if !item.description
|
||||
|
||||
return item.description
|
||||
end
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
def genericOutfitsShopMenu(stock = [], itemType = nil, versions = false, isShop=true, message=nil)
|
||||
def genericOutfitsShopMenu(stock = [], itemType = nil, versions = false, isShop=true, message=nil, price_overrides = {})
|
||||
commands = []
|
||||
commands[cmdBuy = commands.length] = _INTL("Buy")
|
||||
commands[cmdQuit = commands.length] = _INTL("Quit")
|
||||
@@ -6,13 +6,13 @@ def genericOutfitsShopMenu(stock = [], itemType = nil, versions = false, isShop=
|
||||
cmd = pbMessage(message, commands, cmdQuit + 1)
|
||||
loop do
|
||||
if cmdBuy >= 0 && cmd == cmdBuy
|
||||
adapter = getAdapter(itemType, stock, isShop)
|
||||
adapter = getAdapter(itemType, stock, isShop,false,price_overrides)
|
||||
view = ClothesShopView.new()
|
||||
presenter = getPresenter(itemType, view, stock, adapter, versions)
|
||||
presenter.pbBuyScreen
|
||||
break
|
||||
else
|
||||
pbMessage(_INTL("Please come again!"))
|
||||
pbMessage(_INTL("Please come again!")) unless message
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -29,14 +29,14 @@ def getPresenter(itemType, view, stock, adapter, versions)
|
||||
end
|
||||
end
|
||||
|
||||
def getAdapter(itemType, stock, isShop, is_secondary=false)
|
||||
def getAdapter(itemType, stock, isShop, is_secondary=false, prices_override={})
|
||||
case itemType
|
||||
when :CLOTHES
|
||||
return ClothesMartAdapter.new(stock, isShop)
|
||||
return ClothesMartAdapter.new(stock, isShop,prices_override)
|
||||
when :HAT
|
||||
return HatsMartAdapter.new(stock, isShop,is_secondary)
|
||||
return HatsMartAdapter.new(stock, isShop,is_secondary,prices_override)
|
||||
when :HAIR
|
||||
return HairMartAdapter.new(stock, isShop)
|
||||
return HairMartAdapter.new(stock, isShop,prices_override)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -60,7 +60,7 @@ def hatShop(outfits_list = [], free=false, customMessage=nil)
|
||||
genericOutfitsShopMenu(stock, :HAT,false,!free,customMessage)
|
||||
end
|
||||
|
||||
def hairShop(outfits_list = [],free=false, customMessage=nil)
|
||||
def hairShop(outfits_list = [],free=false, customMessage=nil,price_overrides={})
|
||||
currentHair = getSimplifiedHairIdFromFullID($Trainer.hair)
|
||||
stock = [:SWAP_COLOR]
|
||||
#always add current hairstyle as first option (in case the player just wants to swap the color)
|
||||
@@ -70,7 +70,19 @@ def hairShop(outfits_list = [],free=false, customMessage=nil)
|
||||
outfit = get_hair_by_id(outfit_id)
|
||||
stock << outfit if outfit
|
||||
}
|
||||
genericOutfitsShopMenu(stock, :HAIR, true,!free,customMessage)
|
||||
|
||||
genericOutfitsShopMenu(stock, :HAIR, true,!free,customMessage, price_overrides)
|
||||
end
|
||||
|
||||
def pokemonHairstylesShop()
|
||||
hairShop([HAIR_EEVEE,HAIR_TORCHIC,
|
||||
HAIR_MUDKIP, HAIR_MAWILE,
|
||||
HAIR_ROSERADE_M,HAIR_ROSERADE_F,
|
||||
HAIR_LYCANROC, HAIR_HAPPINY,
|
||||
HAIR_GARDEVOIR, HAIR_LEAFEON,
|
||||
HAIR_ORICORIO,HAIR_TYRANITAR,
|
||||
HAIR_HOOH,HAIR_CRESSELIA,
|
||||
HAIR_LATIAS,])
|
||||
end
|
||||
|
||||
def switchHatsPosition()
|
||||
|
||||
@@ -24,18 +24,10 @@ class ClothesShopPresenter < PokemonMartScreen
|
||||
end
|
||||
|
||||
def swapHats()
|
||||
echoln "hat 1: #{$Trainer.hat}"
|
||||
echoln "hat 2: #{$Trainer.hat2}"
|
||||
|
||||
|
||||
$Trainer.hat, $Trainer.hat2 = $Trainer.hat2, $Trainer.hat
|
||||
|
||||
pbSEPlay("GUI naming tab swap start")
|
||||
new_selected_hat = @adapter.is_secondary_hat ? $Trainer.hat2 : $Trainer.hat
|
||||
echoln "hat 1: #{$Trainer.hat}"
|
||||
echoln "hat 2: #{$Trainer.hat2}"
|
||||
echoln "new selected hat: #{new_selected_hat}"
|
||||
|
||||
@scene.select_specific_item(new_selected_hat,true)
|
||||
@scene.updatePreviewWindow
|
||||
end
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
class ClothesShopView < PokemonMart_Scene
|
||||
|
||||
def initialize(currency_name = "Money")
|
||||
def initialize(currency_name = _INTL("Money"))
|
||||
@currency_name = currency_name
|
||||
@currency_name = COSMETIC_CURRENCY_NAME if Settings::HOENN
|
||||
end
|
||||
|
||||
def pbStartBuyOrSellScene(buying, stock, adapter)
|
||||
@@ -18,8 +19,9 @@ class ClothesShopView < PokemonMart_Scene
|
||||
|
||||
@sprites["trainerPreview"].show()
|
||||
@sprites["moneywindow"].visible = false if !@adapter.isShop?
|
||||
@sprites["itemwindow"].setAllowPageJump(false)
|
||||
|
||||
Kernel.pbDisplayText(@adapter.toggleText, 80, 200, 99999) if @adapter.toggleText
|
||||
Kernel.pbDisplayText(@adapter.toggleText, 100, 240, 99999) if @adapter.toggleText
|
||||
|
||||
end
|
||||
|
||||
@@ -46,13 +48,27 @@ class ClothesShopView < PokemonMart_Scene
|
||||
@initial_direction = $game_player.direction
|
||||
$game_player.turn_down
|
||||
pbRefreshSceneMap
|
||||
|
||||
# pbSEPlay("GUI menu open")
|
||||
# $game_player.center($game_player.x+7, $game_player.y-5)
|
||||
# @initial_direction = $game_player.direction
|
||||
# $game_player.turn_down
|
||||
# Graphics.update
|
||||
# Input.update
|
||||
# pbRefreshSceneMap
|
||||
end
|
||||
|
||||
def scroll_back_map
|
||||
|
||||
@adapter.reset_player_clothes()
|
||||
pbScrollMap(DIRECTION_LEFT, 7, 6)
|
||||
pbScrollMap(DIRECTION_DOWN, 5, 6)
|
||||
$game_player.turn_generic(@initial_direction)
|
||||
|
||||
# $game_player.center($game_player.x, $game_player.y)
|
||||
# Graphics.update
|
||||
# Input.update
|
||||
# pbRefreshSceneMap
|
||||
end
|
||||
|
||||
def refreshStock(adapter)
|
||||
@@ -75,7 +91,7 @@ class ClothesShopView < PokemonMart_Scene
|
||||
text = @adapter.getDescription(item)
|
||||
end
|
||||
else
|
||||
text = _INTL("Quit.")
|
||||
text = getQuitDescription
|
||||
end
|
||||
@sprites["itemtextwindow"].text = text
|
||||
itemwindow.refresh
|
||||
@@ -98,11 +114,14 @@ class ClothesShopView < PokemonMart_Scene
|
||||
end
|
||||
@adapter.updateTrainerPreview(itemwindow.item, @sprites["trainerPreview"])
|
||||
else
|
||||
description = _INTL("Quit.")
|
||||
description = getQuitDescription
|
||||
end
|
||||
@sprites["itemtextwindow"].text = description
|
||||
end
|
||||
|
||||
def getQuitDescription
|
||||
return _INTL("Outfits are submitted by the community. More will be added with future updates.")
|
||||
end
|
||||
def updatePreviewWindow
|
||||
itemwindow= @sprites["itemwindow"]
|
||||
@adapter.updateTrainerPreview(itemwindow.item, @sprites["trainerPreview"])
|
||||
@@ -123,15 +142,15 @@ class ClothesShopView < PokemonMart_Scene
|
||||
if itemwindow.item != olditem
|
||||
displayNewItem(itemwindow)
|
||||
end
|
||||
if Input.trigger?(Input::AUX1) #L button - disabled because same key as speed up...
|
||||
#@adapter.switchVersion(itemwindow.item, -1)
|
||||
#updateTrainerPreview()
|
||||
if Input.trigger?(Input::L) #X button
|
||||
@adapter.switchVersion(itemwindow.item, -1)
|
||||
updateTrainerPreview()
|
||||
end
|
||||
|
||||
if Input.trigger?(Input::AUX2) || Input.trigger?(Input::SHIFT) #R button
|
||||
if Input.trigger?(Input::R) #Y button
|
||||
switchItemVersion(itemwindow)
|
||||
end
|
||||
if Input.trigger?(Input::SPECIAL) #R button
|
||||
if Input.trigger?(Input::SPECIAL) #Z button
|
||||
@adapter.toggleEvent(itemwindow.item)
|
||||
updateTrainerPreview()
|
||||
end
|
||||
|
||||
@@ -4,9 +4,8 @@ class HairMartAdapter < OutfitsMartAdapter
|
||||
|
||||
POSSIBLE_VERSIONS = (1..9).to_a
|
||||
|
||||
def initialize(stock = nil, isShop = nil)
|
||||
super
|
||||
|
||||
def initialize(stock = nil, isShop = nil, prices_override = {})
|
||||
super(stock,isShop,false,prices_override)
|
||||
@version = getCurrentHairVersion().to_i
|
||||
@worn_hair = $Trainer.hair
|
||||
@worn_hat = $Trainer.hat
|
||||
@@ -61,9 +60,10 @@ class HairMartAdapter < OutfitsMartAdapter
|
||||
|
||||
def getPrice(item, selling = nil)
|
||||
return 0 if !@isShop
|
||||
if @prices_override && @prices_override.has_key?(item.id)
|
||||
return @prices_override[item.id]
|
||||
end
|
||||
trainer_hair_id = getSplitHairFilenameAndVersionFromID(@worn_hair)[1]
|
||||
|
||||
|
||||
return nil if item.id == trainer_hair_id
|
||||
return item.price.to_i
|
||||
end
|
||||
@@ -87,7 +87,6 @@ class HairMartAdapter < OutfitsMartAdapter
|
||||
end
|
||||
|
||||
def getName(item)
|
||||
echoln $Trainer.hair
|
||||
return item.id
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class HatShopView < ClothesShopView
|
||||
|
||||
def initialize(currency_name = "Money")
|
||||
def initialize(currency_name = _INTL("Money"))
|
||||
@currency_name = currency_name
|
||||
end
|
||||
|
||||
@@ -97,11 +97,15 @@ class HatShopView < ClothesShopView
|
||||
@adapter.updateTrainerPreview(itemwindow.item, @sprites["trainerPreview"])
|
||||
displayLayerIcons(item)
|
||||
else
|
||||
description = _INTL("Quit.")
|
||||
description = getQuitDescription
|
||||
end
|
||||
@sprites["itemtextwindow"].text = description
|
||||
end
|
||||
|
||||
def getQuitDescription
|
||||
return _INTL("Hats are submitted by the community. More will be added with future updates.")
|
||||
end
|
||||
|
||||
def updateTrainerPreview()
|
||||
super
|
||||
updateSelectedLayerGraphicsVisibility
|
||||
|
||||
@@ -5,14 +5,14 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
DEFAULT_NAME = "[unknown]"
|
||||
DEFAULT_DESCRIPTION = "A headgear that trainers can wear."
|
||||
|
||||
def initialize(stock = nil, isShop = nil, isSecondaryHat = false)
|
||||
super(stock,isShop,isSecondaryHat)
|
||||
@worn_clothes = $Trainer.hat
|
||||
@worn_clothes2 = $Trainer.hat2
|
||||
def initialize(stock = nil, isShop = nil, isSecondaryHat = false, prices_override = {})
|
||||
super(stock, isShop, isSecondaryHat, prices_override)
|
||||
@worn_clothes = $Trainer.hat
|
||||
@worn_clothes2 = $Trainer.hat2
|
||||
@second_hat_visible = true
|
||||
end
|
||||
|
||||
#Used in shops only
|
||||
# Used in shops only
|
||||
def toggleSecondHat()
|
||||
@second_hat_visible = !@second_hat_visible
|
||||
$Trainer.hat2 = @second_hat_visible ? @worn_clothes2 : nil
|
||||
@@ -22,7 +22,7 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
if isShop?
|
||||
toggleSecondHat
|
||||
else
|
||||
$Trainer.set_hat(nil,@is_secondary_hat)
|
||||
$Trainer.set_hat(nil, @is_secondary_hat)
|
||||
@worn_clothes = nil
|
||||
end
|
||||
end
|
||||
@@ -42,7 +42,7 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
# return "Remove hat: #{toggleKey}"
|
||||
end
|
||||
|
||||
def switchVersion(item,delta=1)
|
||||
def switchVersion(item, delta = 1)
|
||||
pbSEPlay("GUI storage put down", 80, 100)
|
||||
return toggleSecondHat if isShop?
|
||||
@is_secondary_hat = !@is_secondary_hat
|
||||
@@ -67,12 +67,12 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
hat1 = @is_secondary_hat ? get_hat_by_id($Trainer.hat) : item
|
||||
hat2 = @is_secondary_hat ? item : get_hat_by_id($Trainer.hat2)
|
||||
|
||||
previewWindow.set_hat(hat1.id,false) if hat1
|
||||
previewWindow.set_hat(hat2.id,true) if hat2
|
||||
previewWindow.set_hat(nil,true) if !@second_hat_visible #for toggling in shops
|
||||
previewWindow.set_hat(hat1.id, false) if hat1
|
||||
previewWindow.set_hat(hat2.id, true) if hat2
|
||||
previewWindow.set_hat(nil, true) if !@second_hat_visible # for toggling in shops
|
||||
|
||||
hat1_color=0
|
||||
hat2_color=0
|
||||
hat1_color = 0
|
||||
hat2_color = 0
|
||||
hat1_color = $Trainer.dyed_hats[hat1.id] if hat1 && $Trainer.dyed_hats.include?(hat1.id)
|
||||
hat2_color = $Trainer.dyed_hats[hat2.id] if hat2 && $Trainer.dyed_hats.include?(hat2.id)
|
||||
previewWindow.hat_color = hat1_color
|
||||
@@ -84,36 +84,34 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
$Trainer.hat2_color = hat2_color
|
||||
|
||||
else
|
||||
$Trainer.set_hat(nil,@is_secondary_hat)
|
||||
previewWindow.set_hat(nil,@is_secondary_hat)
|
||||
$Trainer.set_hat(nil, @is_secondary_hat)
|
||||
previewWindow.set_hat(nil, @is_secondary_hat)
|
||||
end
|
||||
|
||||
|
||||
pbRefreshSceneMap
|
||||
previewWindow.updatePreview()
|
||||
end
|
||||
|
||||
|
||||
def get_dye_color(item_id)
|
||||
return if !item_id
|
||||
return 0 if isShop?
|
||||
$Trainer.dyed_hats= {} if ! $Trainer.dyed_hats
|
||||
$Trainer.dyed_hats = {} if !$Trainer.dyed_hats
|
||||
if $Trainer.dyed_hats.include?(item_id)
|
||||
return $Trainer.dyed_hats[item_id]
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
|
||||
def set_dye_color(item,previewWindow,is_secondary_hat=false)
|
||||
def set_dye_color(item, previewWindow, is_secondary_hat = false)
|
||||
return if !item
|
||||
if !isShop?
|
||||
|
||||
else
|
||||
$Trainer.set_hat_color(0,is_secondary_hat)
|
||||
previewWindow.hat_color=0
|
||||
$Trainer.set_hat_color(0, is_secondary_hat)
|
||||
previewWindow.hat_color = 0
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# def set_dye_color(item,previewWindow,is_secondary_hat=false)
|
||||
# return if !item
|
||||
# if !isShop?
|
||||
@@ -138,10 +136,9 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
# end
|
||||
# end
|
||||
|
||||
|
||||
def addItem(item)
|
||||
return unless item.is_a?(Outfit)
|
||||
changed_clothes = obtainHat(item.id,@is_secondary_hat)
|
||||
changed_clothes = obtainHat(item.id, @is_secondary_hat)
|
||||
if changed_clothes
|
||||
@worn_clothes = item.id
|
||||
end
|
||||
@@ -159,8 +156,8 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
|
||||
def putOnSelectedOutfit()
|
||||
|
||||
putOnHat($Trainer.hat,true,false) if $Trainer.hat
|
||||
putOnHat($Trainer.hat2,true,true) if $Trainer.hat2
|
||||
putOnHat($Trainer.hat, true, false) if $Trainer.hat
|
||||
putOnHat($Trainer.hat2, true, true) if $Trainer.hat2
|
||||
|
||||
@worn_clothes = $Trainer.hat
|
||||
@worn_clothes2 = $Trainer.hat2
|
||||
@@ -171,16 +168,16 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
|
||||
def putOnOutfit(item)
|
||||
return unless item.is_a?(Outfit)
|
||||
putOnHat(item.id,false,@is_secondary_hat)
|
||||
putOnHat(item.id, false, @is_secondary_hat)
|
||||
@worn_clothes = item.id
|
||||
end
|
||||
|
||||
def reset_player_clothes()
|
||||
$Trainer.set_hat(@worn_clothes,false)
|
||||
$Trainer.set_hat(@worn_clothes2,true)
|
||||
$Trainer.set_hat(@worn_clothes, false)
|
||||
$Trainer.set_hat(@worn_clothes2, true)
|
||||
|
||||
$Trainer.set_hat_color($Trainer.dyed_hats[@worn_clothes],false) if $Trainer.dyed_hats && $Trainer.dyed_hats[@worn_clothes]
|
||||
$Trainer.set_hat_color($Trainer.dyed_hats[@worn_clothes2],true) if $Trainer.dyed_hats && $Trainer.dyed_hats[@worn_clothes2]
|
||||
$Trainer.set_hat_color($Trainer.dyed_hats[@worn_clothes], false) if $Trainer.dyed_hats && $Trainer.dyed_hats[@worn_clothes]
|
||||
$Trainer.set_hat_color($Trainer.dyed_hats[@worn_clothes2], true) if $Trainer.dyed_hats && $Trainer.dyed_hats[@worn_clothes2]
|
||||
end
|
||||
|
||||
def get_unlocked_items_list()
|
||||
@@ -190,7 +187,7 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
def getSpecialItemCaption(specialType)
|
||||
case specialType
|
||||
when :REMOVE_HAT
|
||||
return "Remove hat"
|
||||
return _INTL("Remove hat")
|
||||
end
|
||||
return nil
|
||||
end
|
||||
@@ -210,13 +207,18 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
def isBald?
|
||||
return true unless $Trainer.hair
|
||||
bald_ids = [HAIR_BALD, HAIR_BALD_POLISHED]
|
||||
hair_id = getSimplifiedHairIdFromFullID($Trainer.hair)
|
||||
return bald_ids.include?(hair_id)
|
||||
end
|
||||
def getSpecialItemDescription(specialType)
|
||||
hair_situation = !$Trainer.hair || getSimplifiedHairIdFromFullID($Trainer.hair) == HAIR_BALD ? "bald head" : "fabulous hair"
|
||||
return "Go without a hat and show off your #{hair_situation}!"
|
||||
hair_situation = isBald?() ? "bald head" : "fabulous hair"
|
||||
return _INTL("Go without a hat and show off your {1}!",hair_situation)
|
||||
end
|
||||
|
||||
def doSpecialItemAction(specialType,item=nil)
|
||||
def doSpecialItemAction(specialType, item = nil)
|
||||
toggleEvent(item)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -73,7 +73,7 @@ class HairStyleSelectionMenuView
|
||||
end
|
||||
|
||||
def init_labels()
|
||||
Kernel.pbDisplayText("Confirm", (CONFIRM_X+CURSOR_X_MARGIN), CONFIRM_Y)
|
||||
Kernel.pbDisplayText(_INTL("Confirm"), (CONFIRM_X+CURSOR_X_MARGIN), CONFIRM_Y)
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -2,16 +2,16 @@ class HairstyleSelectionMenuPresenter
|
||||
attr_accessor :options
|
||||
attr_reader :current_index
|
||||
|
||||
OPTION_STYLE = 'Hairstyle'
|
||||
OPTION_STYLE = "Hairstyle"
|
||||
OPTION_BASE_COLOR = "Base color"
|
||||
OPTION_DYE = "Dye"
|
||||
|
||||
HAIR_COLOR_NAMES = ["Blonde", "Light Brown", "Dark Brown", "Black"]
|
||||
HAIR_COLOR_NAMES = ["Blonde","Light Brown", "Dark Brown", "Black"]
|
||||
HAIR_COLOR_IDS = [1, 2, 3, 4]
|
||||
|
||||
#ids for displayed text sprites
|
||||
STYLE_TEXT_ID = "style"
|
||||
BASECOLOR_TEXT_ID = "baseCplor"
|
||||
BASECOLOR_TEXT_ID = "baseColor"
|
||||
DYE_TEXT_ID = "dye"
|
||||
|
||||
def initialize(view)
|
||||
|
||||
@@ -123,4 +123,11 @@ def getTrainerSpriteBallFilename(pokeball)
|
||||
base_path = Settings::PLAYER_GRAPHICS_FOLDER + Settings::PLAYER_BALL_FOLDER
|
||||
|
||||
return base_path + "/" + pokeball.to_s
|
||||
end
|
||||
|
||||
def getOverworldBicycleTrickFilename
|
||||
return Settings::PLAYER_GRAPHICS_FOLDER + BASE_FOLDER + "/" + BASE_OVERWORLD_FOLDER + "/bicycle/bike_trick"
|
||||
end
|
||||
def getOverworldBicycleFilename
|
||||
return Settings::PLAYER_GRAPHICS_FOLDER + BASE_FOLDER + "/" + BASE_OVERWORLD_FOLDER + "/bicycle/bike"
|
||||
end
|
||||
@@ -7,7 +7,6 @@ def obtainNewClothes(outfit_id)
|
||||
end
|
||||
|
||||
def obtainHat(outfit_id,secondary=false)
|
||||
echoln "obtained new hat: " + outfit_id
|
||||
outfit = get_hat_by_id(outfit_id)
|
||||
if !outfit
|
||||
pbMessage(_INTL("The hat {1} is invalid.", outfit_id))
|
||||
@@ -36,7 +35,7 @@ def unlockHat(outfit_id)
|
||||
end
|
||||
|
||||
def obtainClothes(outfit_id)
|
||||
echoln "obtained new clothes: " + outfit_id
|
||||
echoln "obtained new clothes: #{outfit_id}"
|
||||
outfit = get_clothes_by_id(outfit_id)
|
||||
if !outfit
|
||||
pbMessage(_INTL("The clothes {1} are invalid.", outfit_id))
|
||||
@@ -52,11 +51,22 @@ def obtainClothes(outfit_id)
|
||||
return false
|
||||
end
|
||||
|
||||
def unlockClothes(outfit_id)
|
||||
outfit = get_clothes_by_id(outfit_id)
|
||||
if !outfit
|
||||
pbMessage(_INTL("The clothes {1} are invalid.", outfit_id))
|
||||
return
|
||||
end
|
||||
return if !outfit
|
||||
$Trainer.unlocked_clothes << outfit_id if !$Trainer.unlocked_clothes.include?(outfit_id)
|
||||
return false
|
||||
end
|
||||
|
||||
def obtainNewHairstyle(full_outfit_id)
|
||||
split_outfit_id = getSplitHairFilenameAndVersionFromID(full_outfit_id)
|
||||
hairstyle_id = split_outfit_id[1]
|
||||
hairstyle = get_hair_by_id(hairstyle_id)
|
||||
musical_effect = _INTL("Key item get")
|
||||
musical_effect = "Key item get"
|
||||
pbMessage(_INTL("\\me[{1}]Your hairstyle was changed to \\c[1]{2}\\c[0] hairstyle!\\wtnp[30]", musical_effect, hairstyle.name))
|
||||
return true
|
||||
end
|
||||
@@ -152,7 +162,7 @@ end
|
||||
|
||||
def obtainOutfitMessage(outfit)
|
||||
pictureViewport = showOutfitPicture(outfit)
|
||||
musical_effect = _INTL("Key item get")
|
||||
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
|
||||
@@ -185,10 +195,12 @@ def findLastHairVersion(hairId)
|
||||
end
|
||||
|
||||
def isWearingClothes(outfitId)
|
||||
return false unless $Trainer
|
||||
return $Trainer.clothes == outfitId
|
||||
end
|
||||
|
||||
def isWearingHat(outfitId)
|
||||
return false unless $Trainer
|
||||
return $Trainer.hat == outfitId || $Trainer.hat2 == outfitId
|
||||
end
|
||||
|
||||
@@ -225,9 +237,25 @@ def hasClothes?(outfit_id)
|
||||
end
|
||||
|
||||
def hasHat?(outfit_id)
|
||||
$Trainer.unlocked_hats = [] unless $Trainer.unlocked_hats
|
||||
return $Trainer.unlocked_hats.include?(outfit_id)
|
||||
end
|
||||
|
||||
def getHatForPokemon(pokemonSpecies)
|
||||
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_hats = filter_hats_only_not_owned(possible_hats)
|
||||
unless possible_hats.empty?()
|
||||
return possible_hats.sample
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
def getOutfitForPokemon(pokemonSpecies)
|
||||
possible_clothes = []
|
||||
possible_hats = []
|
||||
@@ -384,10 +412,6 @@ def generate_appearance_from_name(name)
|
||||
hair_color = convert_letter_to_number(seed[8],max_dye_color)
|
||||
hair_color = 0 if convert_letter_to_number(seed[9]) % 2 == 0 #1/2 chance of no dyed hair
|
||||
|
||||
echoln hair_color
|
||||
echoln clothes_color
|
||||
echoln hat_color
|
||||
|
||||
skin_tone = [1,2,3,4,5,6][convert_letter_to_number(seed[10],5)]
|
||||
return TrainerAppearance.new(skin_tone,hat,clothes, hair,
|
||||
hair_color, clothes_color, hat_color,
|
||||
@@ -395,17 +419,25 @@ def generate_appearance_from_name(name)
|
||||
|
||||
end
|
||||
|
||||
def get_random_appearance()
|
||||
def get_random_appearance(include_hat2=true, hat_dye_chance=30, clothes_dye_chance=30,hair_dye_chance=30)
|
||||
hat = $PokemonGlobal.hats_data.keys.sample
|
||||
hat2 = $PokemonGlobal.hats_data.keys.sample
|
||||
hat2 = nil if(rand(3)==0)
|
||||
if include_hat2
|
||||
hat2 = $PokemonGlobal.hats_data.keys.sample
|
||||
hat2 = nil if(rand(3)==0)
|
||||
end
|
||||
|
||||
clothes = $PokemonGlobal.clothes_data.keys.sample
|
||||
hat_color = rand(2)==0 ? rand(255) : 0
|
||||
hat2_color = rand(2)==0 ? rand(255) : 0
|
||||
if rand(100) <= hat_dye_chance
|
||||
hat_color = rand(2)==0 ? rand(255) : 0
|
||||
hat2_color = rand(2)==0 ? rand(255) : 0
|
||||
end
|
||||
if rand(100) <= clothes_dye_chance
|
||||
clothes_color = rand(2)==0 ? rand(255) : 0
|
||||
end
|
||||
|
||||
clothes_color = rand(2)==0 ? rand(255) : 0
|
||||
hair_color = rand(2)==0 ? rand(255) : 0
|
||||
if rand(100) <= hair_dye_chance
|
||||
hair_color = rand(2)==0 ? rand(255) : 0
|
||||
end
|
||||
|
||||
hair_id = $PokemonGlobal.hairstyles_data.keys.sample
|
||||
hair_color = [1,2,3,4].sample
|
||||
@@ -416,6 +448,28 @@ def get_random_appearance()
|
||||
hair_color, clothes_color, hat_color,hat2)
|
||||
end
|
||||
|
||||
def get_random_hat_contest(contest_condition,max_attempts=20)
|
||||
current_attempt = 0
|
||||
while current_attempt < max_attempts
|
||||
hat_id = $PokemonGlobal.hats_data.keys.sample
|
||||
hat = $PokemonGlobal.hats_data[hat_id]
|
||||
return hat.id if (hat.contest_condition.include?(contest_condition.downcase))
|
||||
current_attempt += 1
|
||||
end
|
||||
return hat.id
|
||||
end
|
||||
|
||||
def get_random_clothes_contest(contest_condition,max_attempts=20)
|
||||
current_attempt = 0
|
||||
while current_attempt < max_attempts
|
||||
clothes_id = $PokemonGlobal.clothes_data.keys.sample
|
||||
clothes = $PokemonGlobal.clothes_data[clothes_id]
|
||||
return clothes.id if (clothes.contest_condition.include?(contest_condition.downcase))
|
||||
current_attempt += 1
|
||||
end
|
||||
return clothes.id
|
||||
end
|
||||
|
||||
def randomizePlayerOutfit()
|
||||
$Trainer.hat = $PokemonGlobal.hats_data.keys.sample
|
||||
$Trainer.hat2 = $PokemonGlobal.hats_data.keys.sample
|
||||
@@ -432,9 +486,10 @@ def randomizePlayerOutfit()
|
||||
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
|
||||
|
||||
|
||||
|
||||
def select_hat()
|
||||
hats_list = $Trainer.unlocked_hats
|
||||
options = []
|
||||
@@ -447,6 +502,9 @@ def select_hat()
|
||||
return selected_hat_id
|
||||
end
|
||||
|
||||
def has_trumpet_hat?
|
||||
return $Trainer.unlocked_hats.include?(HAT_TRUMPET)
|
||||
end
|
||||
def canPutHatOnPokemon(pokemon)
|
||||
return !pokemon.egg? && !pokemon.isTripleFusion? && $game_switches[SWITCH_UNLOCKED_POKEMON_HATS]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,10 +4,12 @@ class Outfit
|
||||
attr_accessor :description
|
||||
attr_accessor :tags
|
||||
attr_accessor :price
|
||||
attr_accessor :store_location
|
||||
|
||||
attr_accessor :is_in_regional_set
|
||||
attr_accessor :is_in_city_exclusive_set
|
||||
|
||||
attr_accessor :contest_condition
|
||||
|
||||
|
||||
|
||||
@@ -25,18 +27,20 @@ class Outfit
|
||||
CITY_OUTFIT_TAGS.any? { |city| tags.include?(city) }
|
||||
end
|
||||
|
||||
def initialize(id, name, description = '',price=0, tags = [])
|
||||
def initialize(id, name, description = '',price=0, tags = [], store_locations = [], contest_conditions = [])
|
||||
@id = id
|
||||
@name = name
|
||||
@description = description
|
||||
@name = _INTL(name)
|
||||
@description = _INTL(description)
|
||||
@tags = tags
|
||||
@price = price
|
||||
|
||||
@is_in_regional_set = check_if_regional_set(tags)
|
||||
@is_in_city_exclusive_set = check_if_city_set(tags)
|
||||
@store_location = store_locations
|
||||
@contest_condition = contest_conditions
|
||||
end
|
||||
|
||||
def trainer_sprite_path()
|
||||
return nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Clothes < Outfit
|
||||
attr_accessor :type
|
||||
def initialize(id, name, description = '',price=0, tags = [])
|
||||
def initialize(id, name, description = '',price=0, tags = [], store_locations = [], contest_condition=[])
|
||||
super
|
||||
@type = :CLOTHES
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Hairstyle < Outfit
|
||||
attr_accessor :type
|
||||
def initialize(id, name, description = '',price=0, tags = [])
|
||||
def initialize(id, name, description = '',price=0, tags = [], store_locations = [])
|
||||
super
|
||||
@type = :HAIR
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Hat < Outfit
|
||||
attr_accessor :type
|
||||
def initialize(id,name,description='',price=0,tags=[])
|
||||
def initialize(id,name,description='',price=0,tags=[], store_locations = [], contest_condition=[])
|
||||
super
|
||||
@type = :HAT
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user