Skip to content

Commit

Permalink
Add a third player gender
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Dec 27, 2019
1 parent fa7261a commit 7ea2180
Show file tree
Hide file tree
Showing 59 changed files with 493 additions and 154 deletions.
4 changes: 4 additions & 0 deletions Makefile
Expand Up @@ -211,13 +211,17 @@ gfx/player/chris.2bpp: rgbgfx += -h
gfx/player/chris_back.2bpp: rgbgfx += -h
gfx/player/kris.2bpp: rgbgfx += -h
gfx/player/kris_back.2bpp: rgbgfx += -h
gfx/player/enby.2bpp: rgbgfx += -h
gfx/player/enby_back.2bpp: rgbgfx += -h

gfx/trainer_card/chris_card.2bpp: rgbgfx += -h
gfx/trainer_card/kris_card.2bpp: rgbgfx += -h
gfx/trainer_card/enby_card.2bpp: rgbgfx += -h
gfx/trainer_card/leaders.2bpp: tools/gfx += --trim-whitespace

gfx/overworld/chris_fish.2bpp: tools/gfx += --trim-whitespace
gfx/overworld/kris_fish.2bpp: tools/gfx += --trim-whitespace
gfx/overworld/enby_fish.2bpp: tools/gfx += --trim-whitespace

gfx/battle/dude.2bpp: rgbgfx += -h

Expand Down
1 change: 1 addition & 0 deletions charmap.asm
Expand Up @@ -174,6 +174,7 @@
charmap "'t", $d5
charmap "'v", $d6

charmap "<ENBY>", $de
charmap "←", $df
charmap "'", $e0
charmap "<PK>", $e1
Expand Down
2 changes: 0 additions & 2 deletions constants/engine_flags.asm
Expand Up @@ -117,8 +117,6 @@
const ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
; wGameTimerPause
const ENGINE_62
; wPlayerGender
const ENGINE_PLAYER_IS_FEMALE
; wCelebiEvent
const ENGINE_FOREST_IS_RESTLESS
; wDailyRematchFlags
Expand Down
2 changes: 1 addition & 1 deletion constants/event_flags.asm
Expand Up @@ -1849,7 +1849,7 @@
const EVENT_COPYCAT_2
const EVENT_GOLDENROD_SALE_OFF
const EVENT_GOLDENROD_SALE_ON
const EVENT_6F2
const EVENT_COPYCAT_3
const EVENT_ILEX_FOREST_APPRENTICE
const EVENT_ILEX_FOREST_CHARCOAL_MASTER
const EVENT_CHARCOAL_KILN_FARFETCH_D
Expand Down
1 change: 1 addition & 0 deletions constants/misc_constants.asm
Expand Up @@ -5,6 +5,7 @@ TRUE EQU 1
; genders
MALE EQU 0
FEMALE EQU 1
ENBY EQU 2

; FlagAction arguments (see home/flag.asm)
const_def
Expand Down
3 changes: 2 additions & 1 deletion constants/script_constants.asm
Expand Up @@ -70,7 +70,8 @@ NUM_STRING_BUFFERS EQU const_value
const VAR_BLUECARDBALANCE ; 18
const VAR_BUENASPASSWORD ; 19
const VAR_KENJI_BREAK ; 1a
NUM_VARS EQU const_value ; 1b
const VAR_PLAYERGENDER ; 1b
NUM_VARS EQU const_value ; 1c

; variable action types
RETVAR_STRBUF2 EQU (0 << 6)
Expand Down
8 changes: 8 additions & 0 deletions constants/sprite_anim_constants.asm
Expand Up @@ -66,6 +66,8 @@ NUM_SPRITE_ANIM_STRUCTS EQU 10 ; see wSpriteAnimationStructs
const SPRITE_ANIM_INDEX_INTRO_UNOWN_F ; 2a
const SPRITE_ANIM_INDEX_INTRO_SUICUNE_AWAY ; 2b
const SPRITE_ANIM_INDEX_CELEBI ; 2c
const SPRITE_ANIM_INDEX_GREEN_WALK ; 2d
const SPRITE_ANIM_INDEX_MAGNET_TRAIN_GREEN ; 2e

; DoAnimFrame.Jumptable indexes (see engine/gfx/sprite_anims.asm)
const_def
Expand Down Expand Up @@ -173,6 +175,8 @@ NUM_SPRITE_ANIM_STRUCTS EQU 10 ; see wSpriteAnimationStructs
const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F ; 3f
const SPRITE_ANIM_FRAMESET_CELEBI_LEFT ; 40
const SPRITE_ANIM_FRAMESET_CELEBI_RIGHT ; 41
const SPRITE_ANIM_FRAMESET_GREEN_WALK ; 42
const SPRITE_ANIM_FRAMESET_MAGNET_TRAIN_GREEN ; 43

; SpriteAnimOAMData indexes (see data/sprite_anims/oam.asm)
const_def
Expand Down Expand Up @@ -316,3 +320,7 @@ NUM_SPRITE_ANIM_STRUCTS EQU 10 ; see wSpriteAnimationStructs
const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_9 ; 89
const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_10 ; 8a
const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_11 ; 8b
const SPRITE_ANIM_OAMSET_GREEN_WALK_1 ; 8c
const SPRITE_ANIM_OAMSET_GREEN_WALK_2 ; 8d
const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_1 ; 8e
const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_2 ; 8f
2 changes: 2 additions & 0 deletions constants/sprite_constants.asm
Expand Up @@ -104,6 +104,8 @@
const SPRITE_ENTEI ; 64
const SPRITE_RAIKOU ; 65
const SPRITE_STANDING_YOUNGSTER ; 66
const SPRITE_ENBY ; 67
const SPRITE_ENBY_BIKE ; 68

; SpriteMons indexes (see data/sprites/sprite_mons.asm)
const_def $80
Expand Down
2 changes: 1 addition & 1 deletion constants/trainer_constants.asm
Expand Up @@ -27,10 +27,10 @@ CHRIS EQU __enum__
KRIS EQU __enum__
trainerclass FALKNER ; 1
const FALKNER1

trainerclass WHITNEY ; 2
const WHITNEY1

CHRYS EQU __enum__
trainerclass BUGSY ; 3
const BUGSY1

Expand Down
3 changes: 0 additions & 3 deletions constants/wram_constants.asm
Expand Up @@ -137,9 +137,6 @@ PLAYERSPRITESETUP_CUSTOM_FACING_F EQU 5
PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F EQU 6
PLAYERSPRITESETUP_RESET_ACTION_F EQU 7

; wPlayerGender:: ; d472
PLAYERGENDER_FEMALE_F EQU 0

; wMapStatus:: ; d432
const_def
const MAPSTATUS_START ; 0
Expand Down
2 changes: 0 additions & 2 deletions data/engine_flags.asm
Expand Up @@ -127,8 +127,6 @@ EngineFlags:

engine_flag wGameTimerPause, GAMETIMERPAUSE_MOBILE_7_F

engine_flag wPlayerGender, PLAYERGENDER_FEMALE_F

engine_flag wCelebiEvent, CELEBIEVENT_FOREST_IS_RESTLESS_F

; rematches
Expand Down
19 changes: 19 additions & 0 deletions data/player_names.asm
Expand Up @@ -35,3 +35,22 @@ FemalePlayerNameArray:
db "JODI@"
db 2 ; displacement
db " NAME @" ; title

EnbyNameMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 0, 10, TEXTBOX_Y - 1
dw .OtherNames
db 1 ; ????
db 0 ; default option

.OtherNames:
db STATICMENU_CURSOR | STATICMENU_PLACE_TITLE | STATICMENU_DISABLE_B ; flags
db 5 ; items
db "NEW NAME@"
EnbyPlayerNameArray:
db "CHRYS@"
db "FRISK@"
db "JORDAN@"
db "REMY@"
db 2 ; displacement
db " NAME @" ; title
16 changes: 16 additions & 0 deletions data/sprite_anims/framesets.asm
Expand Up @@ -66,6 +66,8 @@ SpriteAnimFrameData:
dw .Frameset_IntroUnownF
dw .Frameset_CelebiLeft
dw .Frameset_CelebiRight
dw .Frameset_GreenWalk
dw .Frameset_MagnetTrainGreen

.Frameset_00:
frame SPRITE_ANIM_OAMSET_RED_WALK_1, 32
Expand Down Expand Up @@ -495,3 +497,17 @@ SpriteAnimFrameData:
frame SPRITE_ANIM_OAMSET_CELEBI_1, 8, OAM_X_FLIP
frame SPRITE_ANIM_OAMSET_CELEBI_2, 8, OAM_X_FLIP
endanim

.Frameset_GreenWalk:
frame SPRITE_ANIM_OAMSET_GREEN_WALK_1, 8
frame SPRITE_ANIM_OAMSET_GREEN_WALK_2, 8
frame SPRITE_ANIM_OAMSET_GREEN_WALK_1, 8
frame SPRITE_ANIM_OAMSET_GREEN_WALK_2, 8, OAM_X_FLIP
dorestart

.Frameset_MagnetTrainGreen:
frame SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_1, 8
frame SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_2, 8
frame SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_1, 8
frame SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_2, 8, OAM_X_FLIP
dorestart
18 changes: 18 additions & 0 deletions data/sprite_anims/oam.asm
Expand Up @@ -141,6 +141,10 @@ SpriteAnimOAMData:
dbw $08, .OAMData_GameFreakLogo4_11 ; SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_9
dbw $04, .OAMData_GameFreakLogo4_11 ; SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_10
dbw $00, .OAMData_GameFreakLogo4_11 ; SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_11
dbw $00, .OAMData_GreenWalk ; SPRITE_ANIM_OAMSET_GREEN_WALK_1
dbw $04, .OAMData_GreenWalk ; SPRITE_ANIM_OAMSET_GREEN_WALK_2
dbw $00, .OAMData_MagnetTrainGreen ; SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_1
dbw $04, .OAMData_MagnetTrainGreen ; SPRITE_ANIM_OAMSET_MAGNET_TRAIN_GREEN_2

.OAMData_1x1_Palette0:
db 1
Expand Down Expand Up @@ -1126,3 +1130,17 @@ SpriteAnimOAMData:
dsprite 0, 0, -1, 4, $51, 1
dsprite 0, 0, 0, 4, $52, 1
dsprite 0, 0, 1, 4, $53, 1

.OAMData_GreenWalk:
db 4
dsprite -1, 0, -1, 0, $00, PAL_OW_GREEN
dsprite -1, 0, 0, 0, $01, PAL_OW_GREEN
dsprite 0, 0, -1, 0, $02, PAL_OW_GREEN
dsprite 0, 0, 0, 0, $03, PAL_OW_GREEN

.OAMData_MagnetTrainGreen:
db 4
dsprite -1, 0, -1, 0, $00, PAL_OW_GREEN | PRIORITY
dsprite -1, 0, 0, 0, $01, PAL_OW_GREEN | PRIORITY
dsprite 0, 0, -1, 0, $02, PAL_OW_GREEN | PRIORITY
dsprite 0, 0, 0, 0, $03, PAL_OW_GREEN | PRIORITY
2 changes: 2 additions & 0 deletions data/sprite_anims/sequences.asm
Expand Up @@ -46,3 +46,5 @@ SpriteAnimSeqData:
db SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F, SPRITE_ANIM_SEQ_INTRO_UNOWN_F, $00 ; SPRITE_ANIM_INDEX_INTRO_UNOWN_F
db SPRITE_ANIM_FRAMESET_INTRO_SUICUNE_AWAY, SPRITE_ANIM_SEQ_INTRO_SUICUNE_AWAY, $00 ; SPRITE_ANIM_INDEX_INTRO_SUICUNE_AWAY
db SPRITE_ANIM_FRAMESET_CELEBI_LEFT, SPRITE_ANIM_SEQ_NULL, $00 ; SPRITE_ANIM_INDEX_CELEBI
db SPRITE_ANIM_FRAMESET_GREEN_WALK, SPRITE_ANIM_SEQ_NULL, $00 ; SPRITE_ANIM_INDEX_GREEN_WALK
db SPRITE_ANIM_FRAMESET_MAGNET_TRAIN_GREEN, SPRITE_ANIM_SEQ_NULL, $00 ; SPRITE_ANIM_INDEX_MAGNET_TRAIN_GREEN
7 changes: 7 additions & 0 deletions data/sprites/player_sprites.asm
Expand Up @@ -11,3 +11,10 @@ KrisStateSprites:
db PLAYER_SURF, SPRITE_SURF
db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU
db -1 ; end

EnbyStateSprites:
db PLAYER_NORMAL, SPRITE_ENBY
db PLAYER_BIKE, SPRITE_ENBY_BIKE
db PLAYER_SURF, SPRITE_SURF
db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU
db -1 ; end
2 changes: 2 additions & 0 deletions data/sprites/sprites.asm
Expand Up @@ -108,3 +108,5 @@ OverworldSprites:
overworld_sprite EnteiSpriteGFX, 4, STILL_SPRITE, PAL_OW_RED
overworld_sprite RaikouSpriteGFX, 4, STILL_SPRITE, PAL_OW_RED
overworld_sprite StandingYoungsterSpriteGFX, 12, STANDING_SPRITE, PAL_OW_BLUE
overworld_sprite EnbySpriteGFX, 12, WALKING_SPRITE, PAL_OW_GREEN
overworld_sprite EnbyBikeSpriteGFX, 12, WALKING_SPRITE, PAL_OW_GREEN
4 changes: 2 additions & 2 deletions data/text/common_2.asm
Expand Up @@ -662,8 +662,8 @@ _YouCantUseItInABattleText::
prompt

_AreYouABoyOrAreYouAGirlText::
text "Are you a boy?"
line "Or are you a girl?"
text "Are you a boy, a"
line "girl, or neither?"
done

Text_BattleEffectActivate::
Expand Down
1 change: 1 addition & 0 deletions data/trainers/palettes.asm
Expand Up @@ -9,6 +9,7 @@ INCBIN "gfx/trainers/cal.gbcpal", middle_colors
KrisPalette: ; Kris shares Falkner's palette
INCBIN "gfx/trainers/falkner.gbcpal", middle_colors
INCBIN "gfx/trainers/whitney.gbcpal", middle_colors
EnbyPalette: ; Chrys shares Bugsy's palette
INCBIN "gfx/trainers/bugsy.gbcpal", middle_colors
INCBIN "gfx/trainers/morty.gbcpal", middle_colors
INCBIN "gfx/trainers/pryce.gbcpal", middle_colors
Expand Down
9 changes: 8 additions & 1 deletion engine/battle/core.asm
Expand Up @@ -8982,9 +8982,16 @@ GetTrainerBackpic:
bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
jr nz, .Chris
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
and a ; MALE
jr z, .Chris
dec a ; FEMALE
jr z, .Kris

; It's nonbinary.
farcall GetEnbyBackpic
ret

.Kris:
; It's a girl.
farcall GetKrisBackpic
ret
Expand Down
8 changes: 7 additions & 1 deletion engine/events/fishing_gfx.asm
Expand Up @@ -6,9 +6,12 @@ LoadFishingGFX:

ld de, FishingGFX
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
and a ; MALE
jr z, .got_gender
ld de, KrisFishingGFX
dec a ; FEMALE
jr z, .got_gender
ld de, EnbyFishingGFX
.got_gender

ld hl, vTiles0 tile $02
Expand Down Expand Up @@ -40,3 +43,6 @@ INCBIN "gfx/overworld/chris_fish.2bpp"

KrisFishingGFX:
INCBIN "gfx/overworld/kris_fish.2bpp"

EnbyFishingGFX:
INCBIN "gfx/overworld/enby_fish.2bpp"
5 changes: 4 additions & 1 deletion engine/events/magnet_train.asm
Expand Up @@ -306,9 +306,12 @@ MagnetTrain_Jumptable:
ld a, BANK(wPlayerGender)
ldh [rSVBK], a
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
and a ; MALE
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_MAGNET_TRAIN_BLUE
dec a ; FEMALE
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_MAGNET_TRAIN_GREEN
.got_gender
pop af
ldh [rSVBK], a
Expand Down

0 comments on commit 7ea2180

Please sign in to comment.