hair can be one frame long

This commit is contained in:
chardub
2025-02-21 20:38:56 -05:00
parent c6f69edf9c
commit f9095f2d06
26 changed files with 119 additions and 84 deletions

View File

@@ -166,54 +166,5 @@ class Sprite_Wearable < RPG::Sprite
@disposed
end
# def getCurrentSpriteOffset()
# direction = @character.direction
# current_frame = @character.pattern
# case @character_name
# when "run"
# if direction == DIRECTION_DOWN
# return Outfit_Offsets::RUN_OFFSETS_DOWN[current_frame]
# elsif direction == DIRECTION_LEFT
# return Outfit_Offsets::RUN_OFFSETS_LEFT[current_frame]
# elsif direction == DIRECTION_RIGHT
# return Outfit_Offsets::RUN_OFFSETS_RIGHT[current_frame]
# elsif direction == DIRECTION_UP
# return Outfit_Offsets::RUN_OFFSETS_UP[current_frame]
# end
# when "surf"
# #when "dive"
# if direction == DIRECTION_DOWN
# return Outfit_Offsets::SURF_OFFSETS_DOWN[current_frame]
# elsif direction == DIRECTION_LEFT
# return Outfit_Offsets::SURF_OFFSETS_LEFT[current_frame]
# elsif direction == DIRECTION_RIGHT
# return Outfit_Offsets::SURF_OFFSETS_RIGHT[current_frame]
# elsif direction == DIRECTION_UP
# return Outfit_Offsets::SURF_OFFSETS_UP[current_frame]
# end
# when "dive"
# if direction == DIRECTION_DOWN
# return Outfit_Offsets::DIVE_OFFSETS_DOWN[current_frame]
# elsif direction == DIRECTION_LEFT
# return Outfit_Offsets::DIVE_OFFSETS_LEFT[current_frame]
# elsif direction == DIRECTION_RIGHT
# return Outfit_Offsets::DIVE_OFFSETS_RIGHT[current_frame]
# elsif direction == DIRECTION_UP
# return Outfit_Offsets::DIVE_OFFSETS_UP[current_frame]
# end
# when "bike"
# if direction == DIRECTION_DOWN
# return Outfit_Offsets::BIKE_OFFSETS_DOWN[current_frame]
# elsif direction == DIRECTION_LEFT
# return Outfit_Offsets::BIKE_OFFSETS_LEFT[current_frame]
# elsif direction == DIRECTION_RIGHT
# return Outfit_Offsets::BIKE_OFFSETS_RIGHT[current_frame]
# elsif direction == DIRECTION_UP
# return Outfit_Offsets::BIKE_OFFSETS_UP[current_frame]
# end
# end
# return Outfit_Offsets::BASE_OFFSET[current_frame]
# end
end

View File

@@ -13,11 +13,12 @@ class Sprite_Hair < Sprite_Wearable
crop_spritesheet(direction, current_frame, action)
adjust_layer()
set_sprite_position(@action, direction, current_frame)
adjust_position_for_nonAnimated_hairstyles(current_frame)
end
def crop_spritesheet(direction, current_frame, action)
sprite_x = ((current_frame)) * @frameWidth
sprite_x = 0 if @frameWidth == @wearableBitmap.width
# Don't animate surf
sprite_x = 0 if action == "surf"
@@ -25,6 +26,10 @@ class Sprite_Hair < Sprite_Wearable
@sprite.src_rect.set(sprite_x, sprite_y, @frameWidth, @frameHeight)
end
def adjust_position_for_nonAnimated_hairstyles(current_frame)
return if @frameWidth != @wearableBitmap.width
@sprite.y -= 2 if current_frame % 2 == 1
end
def set_sprite_position(action, direction, current_frame)
@sprite.x = @player_sprite.x - @player_sprite.ox
@sprite.y = @player_sprite.y - @player_sprite.oy
@@ -80,7 +85,7 @@ class Sprite_Hair < Sprite_Wearable
apply_sprite_offset(Outfit_Offsets::FISH_OFFSETS_UP, current_frame)
end
end
adjustPositionForScreenScrolling()
end
end

View File

@@ -134,9 +134,10 @@ end
def generate_front_trainer_sprite_bitmap_from_appearance(trainerAppearance)
echoln trainerAppearance.hat
return generate_front_trainer_sprite_bitmap(false,nil,trainerAppearance.clothes,trainerAppearance.hat,nil,
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)
trainerAppearance.hair_color,trainerAppearance.hat_color,trainerAppearance.clothes_color,
trainerAppearance.hat2_color)
end
def generate_front_trainer_sprite_bitmap(allowEasterEgg=true, pokeball = nil,

View File

@@ -112,7 +112,7 @@ HAIR_SURGE = "surge" #does not exist yet
HAIR_ERIKA = "erika"
HAIR_KOGA = "koga" #does not exist yet
HAIR_JANINE = "janine"
HAIR_SABRINA = "sabrina" #does not exist yet
HAIR_SABRINA = "sabrinaGSC"
HAIR_BLAINE = "blaine" #does not exist yet
HAIR_GIOVANNI = "giovanni" #does not exist yet
HAIR_WHITNEY = "whitney"

View File

@@ -313,12 +313,13 @@ def randomizePlayerOutfitUnlocked()
end
def convert_letter_to_number(letter, max_number = nil)
return 0 if !letter
return letter.ord if !max_number
return letter.ord % max_number
end
def generate_appearance_from_name(name)
name_seed_length = 15
name_seed_length = 11
seed = name[0, name_seed_length] # Truncate if longer than 8
seed += seed[0, name_seed_length - seed.length] while seed.length < name_seed_length # Repeat first characters if shorter
@@ -330,29 +331,22 @@ def generate_appearance_from_name(name)
hairstyles_list = $PokemonGlobal.hairstyles_data.keys
hat = hats_list[convert_letter_to_number(seed[0],hats_list.length)]
hat2 = hats_list[convert_letter_to_number(seed[1],hats_list.length)]
hat2 = nil if convert_letter_to_number(seed[2]) % 3 == 0 #1/3 chance of no 2nd hat
hat_color = convert_letter_to_number(seed[1],255)
hat_color = 0 if convert_letter_to_number(seed[2]) % 2 == 0 #1/2 chance of no dyed hat
hat_color = convert_letter_to_number(seed[3],255)
hat_color = 0 if convert_letter_to_number(seed[4]) % 2 == 0 #1/2 chance of no dyed hat
hat2_color = convert_letter_to_number(seed[5],255)
hat2_color = 0 if convert_letter_to_number(seed[6]) % 2 == 0
clothes = clothes_list[convert_letter_to_number(seed[3],clothes_list.length)]
clothes_color = convert_letter_to_number(seed[4],255)
clothes_color = 0 if convert_letter_to_number(seed[5]) % 2 == 0 #1/2 chance of no dyed clothes
clothes = clothes_list[convert_letter_to_number(seed[7],clothes_list.length)]
clothes_color = convert_letter_to_number(seed[8],255)
clothes_color = 0 if convert_letter_to_number(seed[9]) % 2 == 0 #1/2 chance of no dyed clothes
hair_base = hairstyles_list[convert_letter_to_number(seed[10],hairstyles_list.length)]
hair_number = [1,2,3,4][convert_letter_to_number(seed[11],3)]
hair_base = hairstyles_list[convert_letter_to_number(seed[6],hairstyles_list.length)]
hair_number = [1,2,3,4][convert_letter_to_number(seed[7],3)]
hair=getFullHairId(hair_base,hair_number)
hair_color = convert_letter_to_number(seed[12],255)
hair_color = 0 if convert_letter_to_number(seed[13]) % 2 == 0 #1/2 chance of no dyed hair
hair_color = convert_letter_to_number(seed[8],255)
hair_color = 0 if convert_letter_to_number(seed[9]) % 2 == 0 #1/2 chance of no dyed hair
skin_tone = [1,2,3,4,5,6][convert_letter_to_number(seed[14],5)]
echoln clothes
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,hat2,hat2_color)
hair_color, clothes_color, hat_color)
end

View File

@@ -296,7 +296,7 @@ end
def getFusedPokemonIdFromSymbols(body_dex, head_dex)
bodyDexNum = GameData::Species.get(body_dex).id_number
headDexNum = GameData::Species.get(head_dex).id_number
return getFusedPokemonIdFromDexNum(body_dex, head_dex)
return getFusedPokemonIdFromDexNum(bodyDexNum, headDexNum)
end
def generateFusionIcon(dexNum, path)