Skip to content

Commit

Permalink
Fixed Mushroom Scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SoupPotato committed Sep 22, 2024
1 parent 2d9a9d0 commit 0ffb59b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 59 deletions.
8 changes: 1 addition & 7 deletions constants/event_flags.asm
Original file line number Diff line number Diff line change
Expand Up @@ -769,25 +769,19 @@
const EVENT_ILEX_FOREST_MUSHROOM_1
const EVENT_ILEX_FOREST_MUSHROOM_2
const EVENT_ILEX_FOREST_MUSHROOM_3
const EVENT_ILEX_FOREST_TINY_MUSHROOM_1_SPAWN
const EVENT_ILEX_FOREST_TINY_MUSHROOM_2_SPAWN
const EVENT_ILEX_FOREST_TINY_MUSHROOM_3_SPAWN
const EVENT_ILEX_FOREST_BIG_MUSHROOM_1_SPAWN
const EVENT_ILEX_FOREST_BIG_MUSHROOM_2_SPAWN
const EVENT_ILEX_FOREST_BIG_MUSHROOM_3_SPAWN
const EVENT_GOT_OPAL_SHARDS_FROM_SCIENTIST
const EVENT_MOUNT_MOON_1F_MUSHROOM
const EVENT_MOUNT_MOON_B1F_MUSHROOM
const EVENT_MOUNT_MOON_B2F_MUSHROOM
const EVENT_MOUNT_MOON_1F_TINY_MUSHROOM_SPAWN
const EVENT_MOUNT_MOON_B1F_TINY_MUSHROOM_SPAWN
const EVENT_MOUNT_MOON_B2F_TINY_MUSHROOM_SPAWN
const EVENT_MOUNT_MOON_1F_BIG_MUSHROOM_SPAWN
const EVENT_MOUNT_MOON_B1F_BIG_MUSHROOM_SPAWN
const EVENT_MOUNT_MOON_B2F_BIG_MUSHROOM_SPAWN
const EVENT_MOUNT_MOON_B2F_HIDDEN_MOON_STONE
const EVENT_MOUNT_MOON_B2F_REVIVE
; Unused: next 79 events
; Unused: next 85 events

const_next 1000
; Trainer flags
Expand Down
44 changes: 13 additions & 31 deletions maps/IlexForest.asm
Original file line number Diff line number Diff line change
Expand Up @@ -24,57 +24,42 @@ IlexForestMushroomsAndFarfetchdCallback:
checkflag ENGINE_DAILY_ILEX_FOREST_MUSHROOM_1
iftrue IlexForestMushroom1Picked
clearevent EVENT_ILEX_FOREST_MUSHROOM_1
checkevent EVENT_ILEX_FOREST_BIG_MUSHROOM_1_SPAWN
iftrue IlexForestMushroom1Picked
checkevent EVENT_ILEX_FOREST_TINY_MUSHROOM_1_SPAWN
iftrue IlexForestMushroom1Picked
random 5
ifnotequal 0, .TinyMushroom1
; 20% chance
.BigMushroom1
clearevent EVENT_ILEX_FOREST_BIG_MUSHROOM_1_SPAWN
setevent EVENT_ILEX_FOREST_BIG_MUSHROOM_1_SPAWN
variablesprite SPRITE_MUSHROOM_1, SPRITE_BIG_MUSHROOM
sjump .finishMushroom1
.TinyMushroom1
clearevent EVENT_ILEX_FOREST_TINY_MUSHROOM_1_SPAWN
variablesprite SPRITE_MUSHROOM_1, SPRITE_TINYMUSHROOM
.finishMushroom1
;fallthrough
checkflag ENGINE_DAILY_ILEX_FOREST_MUSHROOM_2
iftrue IlexForestMushroom2Picked
clearevent EVENT_ILEX_FOREST_MUSHROOM_2
checkevent EVENT_ILEX_FOREST_BIG_MUSHROOM_2_SPAWN
iftrue IlexForestMushroom2Picked
checkevent EVENT_ILEX_FOREST_TINY_MUSHROOM_2_SPAWN
iftrue IlexForestMushroom2Picked
random 5
ifnotequal 0, .TinyMushroom2
; 20% chance
.BigMushroom2
clearevent EVENT_ILEX_FOREST_BIG_MUSHROOM_2_SPAWN
setevent EVENT_ILEX_FOREST_BIG_MUSHROOM_2_SPAWN
variablesprite SPRITE_MUSHROOM_2, SPRITE_BIG_MUSHROOM
sjump .finishMushroom2
.TinyMushroom2
clearevent EVENT_ILEX_FOREST_TINY_MUSHROOM_2_SPAWN
variablesprite SPRITE_MUSHROOM_2, SPRITE_TINYMUSHROOM
.finishMushroom2
;fallthrough
checkflag ENGINE_DAILY_ILEX_FOREST_MUSHROOM_3
iftrue IlexForestMushroom3Picked
clearevent EVENT_ILEX_FOREST_MUSHROOM_3
checkevent EVENT_ILEX_FOREST_BIG_MUSHROOM_3_SPAWN
iftrue IlexForestMushroom3Picked
checkevent EVENT_ILEX_FOREST_TINY_MUSHROOM_3_SPAWN
iftrue IlexForestMushroom3Picked
random 5
ifnotequal 0, .TinyMushroom3
; 20% chance
.BigMushroom3
clearevent EVENT_ILEX_FOREST_BIG_MUSHROOM_3_SPAWN
setevent EVENT_ILEX_FOREST_BIG_MUSHROOM_3_SPAWN
variablesprite SPRITE_MUSHROOM_3, SPRITE_BIG_MUSHROOM
sjump .finishMushroom3
.TinyMushroom3
clearevent EVENT_ILEX_FOREST_TINY_MUSHROOM_3_SPAWN
variablesprite SPRITE_MUSHROOM_3, SPRITE_TINYMUSHROOM
.finishMushroom3
;fallthrough
Expand Down Expand Up @@ -162,15 +147,15 @@ IlexForestCharcoalApprenticeScript:

IlexForestMushroom1Picked:
disappear ILEXFOREST_MUSHROOM1
endcallback
sjump IlexForestMushroomsAndFarfetchdCallback.finishMushroom1

IlexForestMushroom2Picked:
disappear ILEXFOREST_MUSHROOM2
endcallback
sjump IlexForestMushroomsAndFarfetchdCallback.finishMushroom2

IlexForestMushroom3Picked:
disappear ILEXFOREST_MUSHROOM3
endcallback
sjump IlexForestMushroomsAndFarfetchdCallback.finishMushroom3

IlexForestFarfetchdScript:
readmem wFarfetchdPosition
Expand Down Expand Up @@ -506,7 +491,7 @@ IlexForestMushroom1: ;Daily
; This whole script is written out rather than as an itemball
scall IlexForestParasBattle
checkevent EVENT_ILEX_FOREST_BIG_MUSHROOM_1_SPAWN
iftrue .skipBigMushroom1
iffalse .skipBigMushroom1
giveitem BIG_MUSHROOM
getitemname STRING_BUFFER_3, BIG_MUSHROOM
iffalse IlexForestNoRoomInBagForBigMushroom
Expand All @@ -518,9 +503,8 @@ IlexForestMushroom1: ;Daily
.BigMushroom1_Finish
disappear ILEXFOREST_MUSHROOM1
setflag ENGINE_DAILY_ILEX_FOREST_MUSHROOM_1
setevent EVENT_ILEX_FOREST_TINY_MUSHROOM_1_SPAWN
setevent EVENT_ILEX_FOREST_BIG_MUSHROOM_1_SPAWN
setevent EVENT_ILEX_FOREST_MUSHROOM_1
clearevent EVENT_ILEX_FOREST_BIG_MUSHROOM_1_SPAWN
opentext
writetext IlexForestFoundMushroomText
playsound SFX_ITEM
Expand All @@ -533,7 +517,7 @@ IlexForestMushroom2: ;Daily
; This whole script is written out rather than as an itemball
scall IlexForestParasBattle
checkevent EVENT_ILEX_FOREST_BIG_MUSHROOM_2_SPAWN
iftrue .skipBigMushroom2
iffalse .skipBigMushroom2
giveitem BIG_MUSHROOM
getitemname STRING_BUFFER_3, BIG_MUSHROOM
iffalse IlexForestNoRoomInBagForBigMushroom
Expand All @@ -545,9 +529,8 @@ IlexForestMushroom2: ;Daily
.BigMushroom2_Finish
disappear ILEXFOREST_MUSHROOM2
setflag ENGINE_DAILY_ILEX_FOREST_MUSHROOM_2
setevent EVENT_ILEX_FOREST_TINY_MUSHROOM_2_SPAWN
setevent EVENT_ILEX_FOREST_BIG_MUSHROOM_2_SPAWN
setevent EVENT_ILEX_FOREST_MUSHROOM_2
clearevent EVENT_ILEX_FOREST_BIG_MUSHROOM_2_SPAWN
opentext
writetext IlexForestFoundMushroomText
playsound SFX_ITEM
Expand All @@ -560,7 +543,7 @@ IlexForestMushroom3: ;Daily
; This whole script is written out rather than as an itemball
scall IlexForestParasBattle
checkevent EVENT_ILEX_FOREST_BIG_MUSHROOM_3_SPAWN
iftrue .skipBigMushroom3
iffalse .skipBigMushroom3
giveitem BIG_MUSHROOM
getitemname STRING_BUFFER_3, BIG_MUSHROOM
iffalse IlexForestNoRoomInBagForBigMushroom
Expand All @@ -572,9 +555,8 @@ IlexForestMushroom3: ;Daily
.BigMushroom3_Finish
disappear ILEXFOREST_MUSHROOM3
setflag ENGINE_DAILY_ILEX_FOREST_MUSHROOM_3
setevent EVENT_ILEX_FOREST_TINY_MUSHROOM_3_SPAWN
setevent EVENT_ILEX_FOREST_BIG_MUSHROOM_3_SPAWN
setevent EVENT_ILEX_FOREST_MUSHROOM_3
clearevent EVENT_ILEX_FOREST_BIG_MUSHROOM_3_SPAWN
opentext
writetext IlexForestFoundMushroomText
playsound SFX_ITEM
Expand Down Expand Up @@ -1202,4 +1184,4 @@ IlexForest_MapEvents:
object_event 27, 1, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, IlexForestEther, EVENT_ILEX_FOREST_ETHER
object_event 23, 22, SPRITE_MUSHROOM_1, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, IlexForestMushroom1, EVENT_ILEX_FOREST_MUSHROOM_1
object_event 27, 12, SPRITE_MUSHROOM_2, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, IlexForestMushroom2, EVENT_ILEX_FOREST_MUSHROOM_2
object_event 0, 9, SPRITE_MUSHROOM_3, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, IlexForestMushroom3, EVENT_ILEX_FOREST_MUSHROOM_3
object_event 8, 6, SPRITE_MUSHROOM_3, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, IlexForestMushroom3, EVENT_ILEX_FOREST_MUSHROOM_3
12 changes: 5 additions & 7 deletions maps/MountMoon1F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ MountMoon1F_MapScripts:
MountMoon1FCheckRivalAndMushroom:
checkflag ENGINE_DAILY_MOUNT_MOON_1F_MUSHROOM
iftrue .finishMushroom
checkevent EVENT_MOUNT_MOON_1F_BIG_MUSHROOM_SPAWN
iftrue .BigMushroom
checkevent EVENT_MOUNT_MOON_1F_TINY_MUSHROOM_SPAWN
iftrue .TinyMushroom
appear MOUNTMOON1F_MUSHROOM
clearevent EVENT_MOUNT_MOON_1F_MUSHROOM
random 5
ifnotequal 0, .TinyMushroom
; 20% chance
Expand All @@ -26,7 +22,6 @@ MountMoon1FCheckRivalAndMushroom:
variablesprite SPRITE_MUSHROOM_1, SPRITE_BIG_MUSHROOM
sjump .finishMushroom
.TinyMushroom
setevent EVENT_MOUNT_MOON_1F_TINY_MUSHROOM_SPAWN
variablesprite SPRITE_MUSHROOM_1, SPRITE_TINYMUSHROOM
.finishMushroom
;fallthrough
Expand All @@ -45,6 +40,10 @@ MountMoon1FRivalEncounterScene:
MountMoon1FNoopScene:
end

MountMoon1FMushroomPicked:
disappear MOUNTMOON1F_MUSHROOM
sjump MountMoon1FCheckRivalAndMushroom.finishMushroom

MountMoon1FRivalBattleScript:
showemote EMOTE_SHOCK, PLAYER, 15
special FadeOutMusic
Expand Down Expand Up @@ -114,7 +113,6 @@ MountMoon1FMushroom: ;Daily
.Mushroom_Finish
disappear MOUNTMOON1F_MUSHROOM
setflag ENGINE_DAILY_MOUNT_MOON_1F_MUSHROOM
clearevent EVENT_MOUNT_MOON_1F_TINY_MUSHROOM_SPAWN
clearevent EVENT_MOUNT_MOON_1F_BIG_MUSHROOM_SPAWN
opentext
writetext MountMoon1FFoundMushroomText
Expand Down
12 changes: 5 additions & 7 deletions maps/MountMoonB1F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ MountMoonB1F_MapScripts:
MountMoonB1FCheckMushroom:
checkflag ENGINE_DAILY_MOUNT_MOON_B1F_MUSHROOM
iftrue .finishMushroom
checkevent EVENT_MOUNT_MOON_B1F_BIG_MUSHROOM_SPAWN
iftrue .BigMushroom
checkevent EVENT_MOUNT_MOON_B1F_TINY_MUSHROOM_SPAWN
iftrue .TinyMushroom
appear MOUNTMOONB1F_MUSHROOM
clearevent EVENT_MOUNT_MOON_B1F_MUSHROOM
random 5
ifnotequal 0, .TinyMushroom
; 20% chance
Expand All @@ -23,7 +19,6 @@ MountMoonB1FCheckMushroom:
variablesprite SPRITE_MUSHROOM_1, SPRITE_BIG_MUSHROOM
sjump .finishMushroom
.TinyMushroom
setevent EVENT_MOUNT_MOON_B1F_TINY_MUSHROOM_SPAWN
variablesprite SPRITE_MUSHROOM_1, SPRITE_TINYMUSHROOM
.finishMushroom
endcallback
Expand All @@ -44,7 +39,6 @@ MountMoonB1FMushroom: ;Daily
.Mushroom_Finish
disappear MOUNTMOONB1F_MUSHROOM
setflag ENGINE_DAILY_MOUNT_MOON_B1F_MUSHROOM
clearevent EVENT_MOUNT_MOON_B1F_TINY_MUSHROOM_SPAWN
clearevent EVENT_MOUNT_MOON_B1F_BIG_MUSHROOM_SPAWN
opentext
writetext MountMoonB1FFoundMushroomText
Expand Down Expand Up @@ -72,6 +66,10 @@ MountMoonB1FParasBattle:
.skip
end

MountMoonB1FMushroomPicked:
disappear MOUNTMOONB1F_MUSHROOM
sjump MountMoonB1FCheckMushroom.finishMushroom

MountMoonB1FNoRoomInBagForTinyMushroom:
opentext
getitemname STRING_BUFFER_3, TINYMUSHROOM
Expand Down
12 changes: 5 additions & 7 deletions maps/MountMoonB2F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ MountMoonB2F_MapScripts:
MountMoonB2FCheckMushroom:
checkflag ENGINE_DAILY_MOUNT_MOON_B2F_MUSHROOM
iftrue .finishMushroom
checkevent EVENT_MOUNT_MOON_B2F_BIG_MUSHROOM_SPAWN
iftrue .BigMushroom
checkevent EVENT_MOUNT_MOON_B2F_TINY_MUSHROOM_SPAWN
iftrue .TinyMushroom
appear MOUNTMOONB2F_MUSHROOM
clearevent EVENT_MOUNT_MOON_B2F_MUSHROOM
random 5
ifnotequal 0, .TinyMushroom
; 20% chance
Expand All @@ -25,7 +21,6 @@ MountMoonB2FCheckMushroom:
variablesprite SPRITE_MUSHROOM_1, SPRITE_BIG_MUSHROOM
sjump .finishMushroom
.TinyMushroom
setevent EVENT_MOUNT_MOON_B2F_TINY_MUSHROOM_SPAWN
variablesprite SPRITE_MUSHROOM_1, SPRITE_TINYMUSHROOM
.finishMushroom
endcallback
Expand All @@ -46,7 +41,6 @@ MountMoonB2FMushroom: ;Daily
.Mushroom_Finish
disappear MOUNTMOONB2F_MUSHROOM
setflag ENGINE_DAILY_MOUNT_MOON_B2F_MUSHROOM
clearevent EVENT_MOUNT_MOON_B2F_TINY_MUSHROOM_SPAWN
clearevent EVENT_MOUNT_MOON_B2F_BIG_MUSHROOM_SPAWN
opentext
writetext MountMoonB2FFoundMushroomText
Expand Down Expand Up @@ -74,6 +68,10 @@ MountMoonB2FParasBattle:
.skip
end

MountMoonB2FMushroomPicked:
disappear MOUNTMOONB2F_MUSHROOM
sjump MountMoonB2FCheckMushroom.finishMushroom

MountMoonB2FNoRoomInBagForTinyMushroom:
opentext
getitemname STRING_BUFFER_3, TINYMUSHROOM
Expand Down

0 comments on commit 0ffb59b

Please sign in to comment.