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

@@ -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