Adds way to favorite hats and clothes and item to quickly swap to them

This commit is contained in:
chardub
2025-02-18 11:06:14 -05:00
parent 133f01218b
commit 4089c956d7
28 changed files with 230 additions and 184 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
Data/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -22,6 +22,8 @@ class Player < Trainer
attr_accessor :dyed_hats attr_accessor :dyed_hats
attr_accessor :dyed_clothes attr_accessor :dyed_clothes
attr_accessor :favorite_hat
attr_accessor :favorite_clothes
attr_accessor :last_worn_outfit attr_accessor :last_worn_outfit
attr_accessor :last_worn_hat attr_accessor :last_worn_hat
@@ -292,6 +294,8 @@ class Player < Trainer
@dyed_hats = {} @dyed_hats = {}
@dyed_clothes = {} @dyed_clothes = {}
@favorite_hat = nil
@favorite_clothes = nil
@card_background = Settings::DEFAULT_TRAINER_CARD_BG @card_background = Settings::DEFAULT_TRAINER_CARD_BG
@unlocked_card_backgrounds = [@card_background] @unlocked_card_backgrounds = [@card_background]

View File

@@ -19,7 +19,9 @@ class ClothesMartAdapter < OutfitsMartAdapter
def getDisplayName(item) def getDisplayName(item)
return getName(item) if !item.name return getName(item) if !item.name
return item.name name = item.name
name = "* #{name}" if item.id == $Trainer.favorite_clothes
return name
end end
def getDescription(item) def getDescription(item)

View File

@@ -24,6 +24,9 @@ class ClothesShopPresenter < PokemonMartScreen
remove_dye_option_available = $Trainer.hat_color != 0 remove_dye_option_available = $Trainer.hat_color != 0
options << "Remove dye" if remove_dye_option_available options << "Remove dye" if remove_dye_option_available
options << "Mark as favorite" if $Trainer.favorite_hat != item.id
options << "Unmark as favorite" if $Trainer.favorite_hat == item.id
options << "Cancel" options << "Cancel"
# if $Trainer.hat_color != 0 # if $Trainer.hat_color != 0
choice = pbMessage("What would you like to do?", options, -1) choice = pbMessage("What would you like to do?", options, -1)
@@ -43,6 +46,15 @@ class ClothesShopPresenter < PokemonMartScreen
$Trainer.hat_color = 0 $Trainer.hat_color = 0
end end
return true return true
elsif options[choice] == "Mark as favorite"
$Trainer.favorite_hat = item.id
pbSEPlay("GUI storage show party panel")
pbMessage("The #{item.name} is now your favorite!")
echoln "marked #{item.id} as favorite hat"
elsif options[choice] == "Unmark as favorite"
$Trainer.favorite_hat = nil
pbSEPlay("GUI storage show party panel")
pbMessage("The #{item.name} is no longer marked as your favorite!")
end end
echoln "cancelled" echoln "cancelled"
return true return true
@@ -54,16 +66,27 @@ class ClothesShopPresenter < PokemonMartScreen
options = [] options = []
options << "Wear" options << "Wear"
options << "Remove dye" if $Trainer.clothes_color != 0 options << "Remove dye" if $Trainer.clothes_color != 0
options << "Mark as favorite" if $Trainer.favorite_hat != item.id
options << "Unmark as favorite" if $Trainer.favorite_hat == item.id
options << "Cancel" options << "Cancel"
choice = pbMessage("What would you like to do?", options, -1) choice = pbMessage("What would you like to do?", options, -1)
if choice == 0 if choice == 0
putOnClothes(item) putOnClothes(item)
$Trainer.clothes_color = @adapter.get_dye_color(item) $Trainer.clothes_color = @adapter.get_dye_color(item)
return false return false
elsif choice == 1 elsif options[choice] == "Remove dye"
if pbConfirm(_INTL("Are you sure you want to remove the dye from the {1}?", item.name)) if pbConfirm(_INTL("Are you sure you want to remove the dye from the {1}?", item.name))
$Trainer.clothes_color = 0 $Trainer.clothes_color = 0
end end
elsif options[choice] == "Mark as favorite"
$Trainer.favorite_clothes = item.id
pbSEPlay("GUI storage show party panel")
pbMessage("The #{item.name} is now your favorite!")
elsif options[choice] == "Unmark favorite"
$Trainer.favorite_clothes = nil
pbSEPlay("GUI storage show party panel")
pbMessage("The #{item.name} is no longer marked as your favorite!")
end end
return true return true
end end

View File

@@ -32,7 +32,9 @@ class HatsMartAdapter < OutfitsMartAdapter
def getDisplayName(item) def getDisplayName(item)
return getName(item) if !item.name return getName(item) if !item.name
return item.name name = item.name
name = "* #{name}" if item.id == $Trainer.favorite_hat
return name
end end
def getDescription(item) def getDescription(item)
@@ -79,7 +81,7 @@ class HatsMartAdapter < OutfitsMartAdapter
$Trainer.hat_color=0 $Trainer.hat_color=0
previewWindow.hat_color=0 previewWindow.hat_color=0
end end
echoln $Trainer.dyed_hats #echoln $Trainer.dyed_hats
else else
$Trainer.hat_color=0 $Trainer.hat_color=0
previewWindow.hat_color=0 previewWindow.hat_color=0

View File

@@ -1,55 +1,4 @@
ItemHandlers::BattleUseOnBattler.add(:POKEDEX, proc { |item, battler, scene|
#if battler.battle.battlers.length > -1
# scene.pbDisplay(_INTL(" The length is {1}",battler.battle.battlers.length))
# scene.pbDisplay(_INTL("The PokéDex cannot be used on multiple enemies at once!"))
# return false
#end
doublebattle = false
#DOUBLE BATTLES A FAIRE
#variable temporaire doublebattle
if doublebattle
e = battler.pbOpposing2
else
is_trainer = battler.battle.opponent
e1 = battler.pbOpposing1.pokemon
enemyname = e1.name
e1type1 = e1.type1
e1type2 = e1.type2
end
if e1type1 == e1type2
scene.pbDisplay(_INTL("{2} has been identified as a {1} type Pokémon.", PBTypes.getName(e1type1), enemyname))
else
scene.pbDisplay(_INTL("{3} has been identified as a {1}/{2} type Pokémon.", PBTypes.getName(e1type1), PBTypes.getName(e1type2), enemyname))
if $game_switches[10] #BADGE 7
if battler.pbCanIncreaseStatStage?(PBStats::DEFENSE, false)
battler.pbIncreaseStat(PBStats::DEFENSE, 1, true)
end
if battler.pbCanIncreaseStatStage?(PBStats::SPDEF, false)
battler.pbIncreaseStat(PBStats::SPDEF, 1, true)
end
if battler.pbCanIncreaseStatStage?(PBStats::ACCURACY, false)
battler.pbIncreaseStat(PBStats::ACCURACY, 3, true)
end
elsif $game_switches[8] #BADGE 5
if battler.pbCanIncreaseStatStage?(PBStats::ACCURACY, false)
battler.pbIncreaseStat(PBStats::ACCURACY, 3, true)
end
elsif $game_switches[6] #BADGE 3
if battler.pbCanIncreaseStatStage?(PBStats::ACCURACY, false)
battler.pbIncreaseStat(PBStats::ACCURACY, 2, true)
end
elsif $game_switches[8] #BADGE 1
if battler.pbCanIncreaseStatStage?(PBStats::ACCURACY, false)
battler.pbIncreaseStat(PBStats::ACCURACY, 1, true)
end
end
return true
end
})
ItemHandlers::UseInBattle.add(:POKEDOLL, proc { |item, battler, battle| ItemHandlers::UseInBattle.add(:POKEDOLL, proc { |item, battler, battle|
battle.decision = 3 battle.decision = 3
@@ -144,58 +93,7 @@ def useTeleporter()
end end
end end
ItemHandlers::BattleUseOnBattler.add(:POKEDEX, proc { |item, battler, scene|
#if battler.battle.battlers.length > -1
# scene.pbDisplay(_INTL(" The length is {1}",battler.battle.battlers.length))
# scene.pbDisplay(_INTL("The PokéDex cannot be used on multiple enemies at once!"))
# return false
#end
doublebattle = false
#DOUBLE BATTLES A FAIRE
#variable temporaire doublebattle
if doublebattle
e = battler.pbOpposing2
else
is_trainer = battler.battle.opponent
e1 = battler.pbOpposing1.pokemon
enemyname = e1.name
e1type1 = e1.type1
e1type2 = e1.type2
end
if e1type1 == e1type2
scene.pbDisplay(_INTL("{2} has been identified as a {1} type Pokémon.", PBTypes.getName(e1type1), enemyname))
else
scene.pbDisplay(_INTL("{3} has been identified as a {1}/{2} type Pokémon.", PBTypes.getName(e1type1), PBTypes.getName(e1type2), enemyname))
if $game_switches[10] #BADGE 7
if battler.pbCanIncreaseStatStage?(PBStats::DEFENSE, false)
battler.pbIncreaseStat(PBStats::DEFENSE, 1, true)
end
if battler.pbCanIncreaseStatStage?(PBStats::SPDEF, false)
battler.pbIncreaseStat(PBStats::SPDEF, 1, true)
end
if battler.pbCanIncreaseStatStage?(PBStats::ACCURACY, false)
battler.pbIncreaseStat(PBStats::ACCURACY, 3, true)
end
elsif $game_switches[8] #BADGE 5
if battler.pbCanIncreaseStatStage?(PBStats::ACCURACY, false)
battler.pbIncreaseStat(PBStats::ACCURACY, 3, true)
end
elsif $game_switches[6] #BADGE 3
if battler.pbCanIncreaseStatStage?(PBStats::ACCURACY, false)
battler.pbIncreaseStat(PBStats::ACCURACY, 2, true)
end
elsif $game_switches[8] #BADGE 1
if battler.pbCanIncreaseStatStage?(PBStats::ACCURACY, false)
battler.pbIncreaseStat(PBStats::ACCURACY, 1, true)
end
end
return true
end
})
ItemHandlers::UseInBattle.add(:POKEDOLL, proc { |item, battler, battle| ItemHandlers::UseInBattle.add(:POKEDOLL, proc { |item, battler, battle|
battle.decision = 3 battle.decision = 3
@@ -429,6 +327,14 @@ ItemHandlers::UseInField.add(:ROCKETUNIFORM, proc { |item|
next useRocketUniform() next useRocketUniform()
}) })
ItemHandlers::UseFromBag.add(:FAVORITEOUTFIT, proc { |item|
next useFavoriteOutfit()
})
ItemHandlers::UseInField.add(:FAVORITEOUTFIT, proc { |item|
next useFavoriteOutfit()
})
ItemHandlers::UseInField.add(:EMERGENCYWHISTLE, proc { |item| ItemHandlers::UseInField.add(:EMERGENCYWHISTLE, proc { |item|
if isOnPinkanIsland() if isOnPinkanIsland()
pbCommonEvent(COMMON_EVENT_PINKAN_WHISTLE) pbCommonEvent(COMMON_EVENT_PINKAN_WHISTLE)
@@ -471,6 +377,35 @@ ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item|
end end
}) })
def useFavoriteOutfit()
if !$Trainer.favorite_clothes && !$Trainer.favorite_hat
pbMessage(_INTL("You can mark clothes and hats as your favorites in the outfits menu and use this to quickly switch to them!"))
return 0
end
if isWearingFavoriteOutfit()
if (Kernel.pbConfirmMessage("Remove your favorite outfit?"))
if ($Trainer.last_worn_outfit == $Trainer.favorite_clothes && $Trainer.last_worn_hat == $Trainer.favorite_hat)
$Trainer.last_worn_outfit = getDefaultClothes()
end
playOutfitChangeAnimation()
putOnClothes($Trainer.last_worn_outfit, true) if $Trainer.favorite_clothes
putOnHat($Trainer.last_worn_hat, true) if $Trainer.favorite_hat
else
return 0
end
else
if (Kernel.pbConfirmMessage("Put on your favorite outfit?"))
playOutfitChangeAnimation()
putOnClothes($Trainer.favorite_clothes, true) if $Trainer.favorite_clothes
putOnHat($Trainer.favorite_hat, true) if $Trainer.favorite_hat
else
return 0
end
end
end
def useRocketUniform() def useRocketUniform()
return 0 if !$game_switches[SWITCH_JOINED_TEAM_ROCKET] return 0 if !$game_switches[SWITCH_JOINED_TEAM_ROCKET]
if isWearingTeamRocketOutfit() if isWearingTeamRocketOutfit()
@@ -1584,7 +1519,6 @@ def pbFuse(pokemon_body, pokemon_head, splicer_item)
end end
end end
# Todo: refactor this, holy shit this is a mess # Todo: refactor this, holy shit this is a mess
def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil) def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
if pokemon.species_data.id_number > (NB_POKEMON * NB_POKEMON) + NB_POKEMON # triple fusion if pokemon.species_data.id_number > (NB_POKEMON * NB_POKEMON) + NB_POKEMON # triple fusion
@@ -1691,7 +1625,6 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
poke2.debug_shiny = false poke2.debug_shiny = false
end end
if $Trainer.party.length >= 6 if $Trainer.party.length >= 6
if (keepInParty == 0) if (keepInParty == 0)
if isOnPinkanIsland() if isOnPinkanIsland()
@@ -1752,8 +1685,6 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
end end
end end
ItemHandlers::UseOnPokemon.add(:SUPERSPLICERS, proc { |item, pokemon, scene| ItemHandlers::UseOnPokemon.add(:SUPERSPLICERS, proc { |item, pokemon, scene|
next true if pbDNASplicing(pokemon, scene, item) next true if pbDNASplicing(pokemon, scene, item)
}) })

View File

@@ -4,6 +4,18 @@ def isWearingTeamRocketOutfit()
return (isWearingClothes(CLOTHES_TEAM_ROCKET_MALE) || isWearingClothes(CLOTHES_TEAM_ROCKET_FEMALE)) && isWearingHat(HAT_TEAM_ROCKET) return (isWearingClothes(CLOTHES_TEAM_ROCKET_MALE) || isWearingClothes(CLOTHES_TEAM_ROCKET_FEMALE)) && isWearingHat(HAT_TEAM_ROCKET)
end end
def isWearingFavoriteOutfit()
is_wearing_favorite_hat = $Trainer.hat == $Trainer.favorite_hat || !$Trainer.favorite_hat
is_wearing_favorite_clothes = $Trainer.clothes == $Trainer.favorite_clothes || !$Trainer.favorite_clothes
if $Trainer.favorite_hat && !$Trainer.favorite_clothes
return is_wearing_favorite_hat
end
if $Trainer.favorite_clothes && !$Trainer.favorite_hat
return is_wearing_favorite_clothes
end
return is_wearing_favorite_clothes && is_wearing_favorite_hat
end
def obtainRocketOutfit() def obtainRocketOutfit()
Kernel.pbReceiveItem(:ROCKETUNIFORM) Kernel.pbReceiveItem(:ROCKETUNIFORM)
gender = pbGet(VAR_TRAINER_GENDER) gender = pbGet(VAR_TRAINER_GENDER)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,2 @@
1739849259 1739894631
1739849260 1739894631
1739849260
1739849318

View File

@@ -56,3 +56,77 @@ Graphics/CustomBattlers/spritesheets/spritesheets_base/106.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/457.png Graphics/CustomBattlers/spritesheets/spritesheets_base/457.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/457/457.png Graphics/CustomBattlers/spritesheets/spritesheets_custom/457/457.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/25/25a.png Graphics/CustomBattlers/spritesheets/spritesheets_custom/25/25a.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/222.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/183.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/183/183.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/76.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/203.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/203/203.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/2.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/50.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/50/50a.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/323.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/152.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/446.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/93.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/93/93.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/37.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/165.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/165/165.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/30.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/79.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/79/79a.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/157.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/302.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/42.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/227.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/227/227.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/23.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/161.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/161/161.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/310.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/310/310a.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/50/50.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/334.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/334/334.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/29.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/29/29.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/94/94.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/410.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/49.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/49/49.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/308.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/132.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/442.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/442/442b.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/170.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/295.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/381.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/362/362.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/212.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/4.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/4/4.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/55.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/390.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/390/390.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/163.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/438.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/438/438.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/134.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/364.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/447.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/447/447.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/339.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/91.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/91/91.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/169.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/11.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/11/11.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/87.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/263.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/1.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/1/1.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/20.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/32.png
Graphics/CustomBattlers/spritesheets/spritesheets_base/105.png
Graphics/CustomBattlers/spritesheets/spritesheets_custom/105/105.png

BIN
Graphics/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB