Secondary Hat (WIP)

This commit is contained in:
chardub
2025-02-18 23:01:49 -05:00
parent 1c665bf636
commit 76ecb4e2e0
15 changed files with 247 additions and 219 deletions

View File

@@ -3,12 +3,14 @@ class Sprite_Player < Sprite_Character
super
@viewport = viewport
@outfit_bitmap = nil
@hat_bitmap = nil
# @hat_bitmap = nil
# @hat2_bitmap = nil
hatFilename = ""
hairFilename = ""
@hair = Sprite_Hair.new(self, hairFilename, @character_name, @viewport)
@hat = Sprite_Hat.new(self, hatFilename, @character_name, @viewport)
@hat2 = Sprite_Hat.new(self, hatFilename, @character_name, @viewport,3)
@previous_skinTone = 0
@@ -30,12 +32,14 @@ class Sprite_Player < Sprite_Character
def applyDayNightTone
super
pbDayNightTint(@hat.sprite) if @hat && @hat.sprite.bitmap
pbDayNightTint(@hat2.sprite) if @hat2 && @hat2.sprite.bitmap
pbDayNightTint(@hair.sprite) if @hair && @hair.sprite.bitmap
end
def opacity=(value)
super
@hat.sprite.opacity= value if @hat && @hat.sprite.bitmap
@hat2.sprite.opacity= value if @hat2 && @hat2.sprite.bitmap
@hair.sprite.opacity= value if @hair && @hair.sprite.bitmap
end
@@ -46,6 +50,7 @@ class Sprite_Player < Sprite_Character
@previous_action = @character_name
@hair.animate(@character_name) if @hair
@hat.animate(@character_name) if @hat
@hat2.animate(@character_name) if @hat2
return @current_bitmap
end
@@ -58,22 +63,28 @@ class Sprite_Player < Sprite_Character
outfitFilename = getOverworldOutfitFilename(Settings::PLAYER_TEMP_OUTFIT_FALLBACK) if !pbResolveBitmap(outfitFilename)
hairFilename = getOverworldHairFilename($Trainer.hair)
hatFilename = getOverworldHatFilename($Trainer.hat)
hat2Filename = getOverworldHatFilename($Trainer.hat2)
hair_color_shift = $Trainer.hair_color
hat_color_shift = $Trainer.hat_color
hat2_color_shift = $Trainer.hat2_color
clothes_color_shift = $Trainer.clothes_color
hair_color_shift = 0 if !hair_color_shift
hat_color_shift = 0 if !hat_color_shift
hat2_color_shift = 0 if !hat2_color_shift
clothes_color_shift = 0 if !clothes_color_shift
@hair.update(@character_name, hairFilename, hair_color_shift) if @hair
@hat.update(@character_name, hatFilename, hat_color_shift) if @hat
@hat2.update(@character_name, hat2Filename, hat2_color_shift) if @hat2
if !pbResolveBitmap(outfitFilename)
raise "No temp clothes graphics available"
end
outfitBitmap = AnimatedBitmap.new(outfitFilename, clothes_color_shift) if pbResolveBitmap(outfitFilename) #pbLoadOutfitBitmap(outfitFilename) if pbResolveBitmap(outfitFilename)
outfitBitmap = AnimatedBitmap.new(outfitFilename, clothes_color_shift) if pbResolveBitmap(outfitFilename)
baseBitmap.blt(0, 0, outfitBitmap.bitmap, outfitBitmap.bitmap.rect) if outfitBitmap
@previous_action = @character_name
return baseBitmap
@@ -89,6 +100,7 @@ class Sprite_Player < Sprite_Character
def dispose
super
@hat.dispose if @hat
@hat2.dispose if @hat2
@hair.dispose if @hair
end