Skip to content

Commit

Permalink
Added Tunnel NPCs
Browse files Browse the repository at this point in the history
They switch based on your color so they don't glow with the light.
  • Loading branch information
pkmncoraldev committed Sep 1, 2023
1 parent 4de9b80 commit ccb6bb4
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion constants/event_flags.asm
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@
const EVENT_HIDE_OW_OBJECTS_PURPLE
const EVENT_HIDE_OW_OBJECTS_TEAL
const EVENT_HIDE_OW_OBJECTS_BROWN
const EVENT_HIDE_OW_OBJECTS_BLUE
const EVENT_EVENTIDE_GYM_RED_SWITCH
const EVENT_EVENTIDE_GYM_BLUE_SWITCH
const EVENT_EVENTIDE_GYM_YELLOW_SWITCH
Expand Down Expand Up @@ -816,6 +817,5 @@
const EVENT_UNUSED_5
const EVENT_UNUSED_6
const EVENT_UNUSED_7
const EVENT_UNUSED_8

NUM_EVENTS EQU const_value
12 changes: 12 additions & 0 deletions engine/color.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,18 @@ LoadMapPals::
ld bc, 8 palettes
ld a, $5 ; BANK(UnknOBPals)
call FarCopyWRAM
ld a, [wPlayerPalette]
cp 1
jr nz, .tunnelcont
ld bc, 17 palettes
ld hl, MapObjectPals
call AddNTimes
ld de, wUnknOBPals + 5 palettes
ld bc, 1 palettes
ld a, $5 ; BANK(UnknOBPals)
call FarCopyWRAM
.tunnelcont
ld a, [wMapNumber]
cp MAP_BAR_BACK_ALLEY
jr z, .alley
Expand Down
2 changes: 2 additions & 0 deletions maps/BrilloGameCorner.asm
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ BrilloGameCornerCallback:
setevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
clearevent EVENT_HIDE_OW_OBJECTS_BLUE
return
.brown
setevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
clearevent EVENT_HIDE_OW_OBJECTS_BLUE
return
BrilloGameCornerSign:
Expand Down
2 changes: 2 additions & 0 deletions maps/Route10East.asm
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ Route10EastCallback:
setevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
clearevent EVENT_HIDE_OW_OBJECTS_BLUE
return
.brown
setevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
clearevent EVENT_HIDE_OW_OBJECTS_BLUE
return
Route10EastWood:
Expand Down
2 changes: 2 additions & 0 deletions maps/Route17North.asm
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ Route17NorthCallback:
setevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
clearevent EVENT_HIDE_OW_OBJECTS_BLUE
jump .cont
.brown
setevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
clearevent EVENT_HIDE_OW_OBJECTS_BLUE
.cont
checktime 1<<NITE
iftrue .changecampfire
Expand Down
22 changes: 21 additions & 1 deletion maps/Route21Tunnel.asm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ Route21Tunnel_MapScriptHeader:
db 1 ; bg events
signpost 12, 21, SIGNPOST_READ, Route21TunnelGate

db 0 ; object events
db 6 ; object events
person_event SPRITE_BIKER, 13, 29, SPRITEMOVEDATA_STANDING_DOWN, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_HIDE_OW_OBJECTS_BLUE
person_event SPRITE_BIKER, 17, 10, SPRITEMOVEDATA_STANDING_UP, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_HIDE_OW_OBJECTS_BLUE
person_event SPRITE_BIKER, 13, 8, SPRITEMOVEDATA_STANDING_DOWN, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_HIDE_OW_OBJECTS_BLUE
person_event SPRITE_BIKER, 13, 29, SPRITEMOVEDATA_STANDING_DOWN, 1, 1, -1, -1, (1 << 3) | PAL_OW_TEAL, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_HIDE_OW_OBJECTS_TEAL
person_event SPRITE_BIKER, 17, 10, SPRITEMOVEDATA_STANDING_UP, 1, 1, -1, -1, (1 << 3) | PAL_OW_TEAL, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_HIDE_OW_OBJECTS_TEAL
person_event SPRITE_BIKER, 13, 8, SPRITEMOVEDATA_STANDING_DOWN, 1, 1, -1, -1, (1 << 3) | PAL_OW_TEAL, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_HIDE_OW_OBJECTS_TEAL


Route21TunnelTrigger0:
Expand All @@ -112,6 +118,19 @@ Route21TunnelTrigger1:
end

Route21TunnelCallback:
readvar VAR_PLAYER_COLOR
if_equal 1, .blue
setevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_BLUE
clearevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
jump .cont
.blue
setevent EVENT_HIDE_OW_OBJECTS_BLUE
clearevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
.cont
checkcode VAR_FACING
if_equal DOWN, .nite
checktime 1<<NITE
Expand Down Expand Up @@ -183,6 +202,7 @@ Route21TunnelLightEntrance:
Route21TunnelLight:
setflag ENGINE_NEAR_CAMPFIRE
loadvar wTimeOfDayPalFlags, $40 | 1
special Special_UpdatePalsInstant
dotrigger $1
end
Expand Down
2 changes: 2 additions & 0 deletions maps/TwinkleTown.asm
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ TwinkleTownCallback:
setevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
clearevent EVENT_HIDE_OW_OBJECTS_BLUE
jump .cont
.brown
setevent EVENT_HIDE_OW_OBJECTS_BROWN
clearevent EVENT_HIDE_OW_OBJECTS_TEAL
clearevent EVENT_HIDE_OW_OBJECTS_PURPLE
clearevent EVENT_HIDE_OW_OBJECTS_BLUE
.cont
checktime 1<<NITE
iftrue .changevending
Expand Down

0 comments on commit ccb6bb4

Please sign in to comment.