Skip to content

Commit

Permalink
Merge branch 'master' into bard-song
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards authored Dec 10, 2024
2 parents 882af85 + 404818e commit 5613ed7
Show file tree
Hide file tree
Showing 65 changed files with 432 additions and 170 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ include audio_rules.mk
# NOTE: Tools must have been built prior (FIXME)
# so you can't really call this rule directly
generated: $(AUTO_GEN_TARGETS)
@: # Silence the "Nothing to be done for `generated'" message, which some people were confusing for an error.


%.s: ;
%.png: ;
Expand Down Expand Up @@ -377,6 +379,7 @@ libagbsyscall:
@$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) MODERN=$(MODERN)

# Elf from object files
LDFLAGS = -Map ../../$(MAP)
$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS) libagbsyscall
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ <objs> <libs> | cat"
Expand Down
7 changes: 7 additions & 0 deletions asm/macros/event.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,13 @@
.4byte \products
.endm

@ Used as the endpoint for a Pokemart item list
.macro pokemartlistend
.2byte ITEM_NONE
release
end
.endm

@ Opens the Pokemart system and treats the list of items as decorations.
@ Products should be a list of .2byte decoration values preceded by an .align 2
.macro pokemartdecoration products:req
Expand Down
30 changes: 26 additions & 4 deletions data/battle_ai_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,8 @@ AI_CV_Disable2:
AI_CV_Disable_End:
end

@ BUG: The original script would score up Counter when the target's types were not physical
@ This is incorrect since Counter only deals double the damage received if hit by a physical attack
AI_CV_Counter:
if_status AI_TARGET, STATUS1_SLEEP, AI_CV_Counter_ScoreDown1
if_status2 AI_TARGET, STATUS2_INFATUATION, AI_CV_Counter_ScoreDown1
Expand All @@ -1625,7 +1627,7 @@ AI_CV_Counter2:
if_random_less_than 100, AI_CV_Counter3
score -1
AI_CV_Counter3:
if_has_move AI_USER, MOVE_MIRROR_COAT, AI_CV_Counter7
if_has_move AI_USER, MOVE_MIRROR_COAT, AI_CV_Counter8
get_last_used_bank_move AI_TARGET
get_move_power_from_result
if_equal 0, AI_CV_Counter5
Expand All @@ -1645,15 +1647,24 @@ AI_CV_Counter5:
if_random_less_than 100, AI_CV_Counter6
score +1
AI_CV_Counter6:
#ifdef BUGFIX
get_target_type1
if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter7
get_target_type2
if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter7
goto AI_CV_Counter_End
#else
get_target_type1
if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter_End
get_target_type2
if_in_bytes AI_CV_Counter_PhysicalTypeList, AI_CV_Counter_End
if_random_less_than 50, AI_CV_Counter_End
#endif
AI_CV_Counter7:
if_random_less_than 100, AI_CV_Counter8
score +4
if_random_less_than 50, AI_CV_Counter_End
AI_CV_Counter8:
if_random_less_than 100, AI_CV_Counter9
score +4
AI_CV_Counter9:
end

AI_CV_Counter_ScoreDown1:
Expand Down Expand Up @@ -2100,6 +2111,8 @@ AI_CV_PsychUp_ScoreDown2:
AI_CV_PsychUp_End:
end

@ BUG: The original script would score up Mirror Coat when the target's types were not special
@ This is incorrect since Mirror Coat only deals double the damage received if hit by a special attack
AI_CV_MirrorCoat:
if_status AI_TARGET, STATUS1_SLEEP, AI_CV_MirrorCoat_ScoreDown1
if_status2 AI_TARGET, STATUS2_INFATUATION, AI_CV_MirrorCoat_ScoreDown1
Expand Down Expand Up @@ -2132,10 +2145,19 @@ AI_CV_MirrorCoat5:
if_random_less_than 100, AI_CV_MirrorCoat6
score +1
AI_CV_MirrorCoat6:
#ifdef BUGFIX
get_target_type1
if_in_bytes AI_CV_MirrorCoat_SpecialTypeList, AI_CV_MirrorCoat7
get_target_type2
if_in_bytes AI_CV_MirrorCoat_SpecialTypeList, AI_CV_MirrorCoat7
goto AI_CV_MirrorCoat_End
#else
get_target_type1
if_in_bytes AI_CV_MirrorCoat_SpecialTypeList, AI_CV_MirrorCoat_End
get_target_type2
if_in_bytes AI_CV_MirrorCoat_SpecialTypeList, AI_CV_MirrorCoat_End
#endif
AI_CV_MirrorCoat7:
if_random_less_than 50, AI_CV_MirrorCoat_End
AI_CV_MirrorCoat_ScoreUp4:
if_random_less_than 100, AI_CV_MirrorCoat_ScoreUp4_End
Expand Down
4 changes: 1 addition & 3 deletions data/maps/BattleFrontier_Mart/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ BattleFrontier_Mart_Pokemart:
.2byte ITEM_ZINC
.2byte ITEM_CARBOS
.2byte ITEM_HP_UP
.2byte ITEM_NONE
release
end
pokemartlistend

BattleFrontier_Mart_EventScript_OldMan::
msgbox BattleFrontier_Mart_Text_ChaperonGrandson, MSGBOX_NPC
Expand Down
4 changes: 1 addition & 3 deletions data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ EverGrandeCity_PokemonLeague_1F_Pokemart:
.2byte ITEM_FULL_HEAL
.2byte ITEM_REVIVE
.2byte ITEM_MAX_REPEL
.2byte ITEM_NONE
release
end
pokemartlistend

@ The door guards only check for FLAG_BADGE06_GET because Winonas badge is the only one that can be skipped
@ Its assumed the player has the remaining badges
Expand Down
4 changes: 1 addition & 3 deletions data/maps/FallarborTown_Mart/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ FallarborTown_Mart_Pokemart:
.2byte ITEM_X_DEFEND
.2byte ITEM_DIRE_HIT
.2byte ITEM_GUARD_SPEC
.2byte ITEM_NONE
release
end
pokemartlistend

FallarborTown_Mart_EventScript_Woman::
msgbox FallarborTown_Mart_Text_DecidingSkittyEvolve, MSGBOX_NPC
Expand Down
8 changes: 2 additions & 6 deletions data/maps/FortreeCity_DecorationShop/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ FortreeCity_DecorationShop_PokemartDecor_Desks:
.2byte DECOR_BRICK_DESK
.2byte DECOR_CAMP_DESK
.2byte DECOR_HARD_DESK
.2byte DECOR_NONE
release
end
pokemartlistend

FortreeCity_DecorationShop_EventScript_ClerkChairs::
lock
Expand All @@ -53,9 +51,7 @@ FortreeCity_DecorationShop_PokemartDecor_Chairs:
.2byte DECOR_BRICK_CHAIR
.2byte DECOR_CAMP_CHAIR
.2byte DECOR_HARD_CHAIR
.2byte DECOR_NONE
release
end
pokemartlistend

FortreeCity_DecorationShop_Text_MerchandiseSentToPC:
.string "Merchandise you buy here is sent to\n"
Expand Down
4 changes: 1 addition & 3 deletions data/maps/FortreeCity_Mart/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ FortreeCity_Mart_Pokemart:
.2byte ITEM_REVIVE
.2byte ITEM_SUPER_REPEL
.2byte ITEM_WOOD_MAIL
.2byte ITEM_NONE
release
end
pokemartlistend

FortreeCity_Mart_EventScript_Woman::
msgbox FortreeCity_Mart_Text_SuperRepelBetter, MSGBOX_NPC
Expand Down
4 changes: 1 addition & 3 deletions data/maps/LavaridgeTown_HerbShop/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ LavaridgeTown_HerbShop_Pokemart:
.2byte ITEM_ENERGY_ROOT
.2byte ITEM_HEAL_POWDER
.2byte ITEM_REVIVAL_HERB
.2byte ITEM_NONE
release
end
pokemartlistend

LavaridgeTown_HerbShop_EventScript_ExpertM::
msgbox LavaridgeTown_HerbShop_Text_HerbalMedicineWorksButMonWillDislike, MSGBOX_NPC
Expand Down
4 changes: 1 addition & 3 deletions data/maps/LavaridgeTown_Mart/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ LavaridgeTown_Mart_Pokemart:
.2byte ITEM_REVIVE
.2byte ITEM_SUPER_REPEL
.2byte ITEM_X_SPEED
.2byte ITEM_NONE
release
end
pokemartlistend

LavaridgeTown_Mart_EventScript_ExpertM::
msgbox LavaridgeTown_Mart_Text_XSpeedFirstStrike, MSGBOX_NPC
Expand Down
8 changes: 2 additions & 6 deletions data/maps/LilycoveCity_DepartmentStore_2F/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ LilycoveCity_DepartmentStore_2F_Pokemart1:
.2byte ITEM_ICE_HEAL
.2byte ITEM_AWAKENING
.2byte ITEM_FLUFFY_TAIL
.2byte ITEM_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_2F_EventScript_ClerkRight::
lock
Expand All @@ -62,9 +60,7 @@ LilycoveCity_DepartmentStore_2F_Pokemart2:
.2byte ITEM_MAX_REPEL
.2byte ITEM_WAVE_MAIL
.2byte ITEM_MECH_MAIL
.2byte ITEM_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_2F_Text_LearnToUseItemsProperly:
.string "Learn to use items properly.\n"
Expand Down
8 changes: 2 additions & 6 deletions data/maps/LilycoveCity_DepartmentStore_3F/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ LilycoveCity_DepartmentStore_3F_Pokemart_Vitamins:
.2byte ITEM_ZINC
.2byte ITEM_CARBOS
.2byte ITEM_HP_UP
.2byte ITEM_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_3F_EventScript_ClerkRight::
lock
Expand All @@ -42,9 +40,7 @@ LilycoveCity_DepartmentStore_3F_Pokemart_StatBoosters:
.2byte ITEM_DIRE_HIT
.2byte ITEM_GUARD_SPEC
.2byte ITEM_X_ACCURACY
.2byte ITEM_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_3F_EventScript_TriathleteM::
msgbox LilycoveCity_DepartmentStore_3F_Text_ItemsBestForTougheningPokemon, MSGBOX_NPC
Expand Down
8 changes: 2 additions & 6 deletions data/maps/LilycoveCity_DepartmentStore_4F/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ LilycoveCity_DepartmentStore_4F_Pokemart_AttackTMs:
.2byte ITEM_TM_THUNDER
.2byte ITEM_TM_BLIZZARD
.2byte ITEM_TM_HYPER_BEAM
.2byte ITEM_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_4F_EventScript_ClerkRight::
lock
Expand All @@ -49,9 +47,7 @@ LilycoveCity_DepartmentStore_4F_Pokemart_DefenseTMs:
.2byte ITEM_TM_SAFEGUARD
.2byte ITEM_TM_REFLECT
.2byte ITEM_TM_LIGHT_SCREEN
.2byte ITEM_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_4F_Text_AttackOrDefenseTM:
.string "Hmm…\p"
Expand Down
16 changes: 4 additions & 12 deletions data/maps/LilycoveCity_DepartmentStore_5F/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ LilycoveCity_DepartmentStore_5F_Pokemart_Dolls:
.2byte DECOR_SKITTY_DOLL
.2byte DECOR_SWABLU_DOLL
.2byte DECOR_GULPIN_DOLL
.2byte DECOR_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_5F_EventScript_ClerkMidLeft::
lock
Expand All @@ -66,9 +64,7 @@ LilycoveCity_DepartmentStore_5F_Pokemart_Cushions:
.2byte DECOR_GRASS_CUSHION
.2byte DECOR_FIRE_CUSHION
.2byte DECOR_WATER_CUSHION
.2byte DECOR_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_5F_EventScript_ClerkMidRight::
lock
Expand All @@ -91,9 +87,7 @@ LilycoveCity_DepartmentStore_5F_Pokemart_Posters:
.2byte DECOR_LONG_POSTER
.2byte DECOR_SEA_POSTER
.2byte DECOR_SKY_POSTER
.2byte DECOR_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_5F_EventScript_ClerkFarRight::
lock
Expand All @@ -117,9 +111,7 @@ LilycoveCity_DepartmentStore_5F_Pokemart_Mats:
.2byte DECOR_GLITTER_MAT
.2byte DECOR_JUMP_MAT
.2byte DECOR_SPIN_MAT
.2byte DECOR_NONE
release
end
pokemartlistend

LilycoveCity_DepartmentStore_5F_EventScript_PokefanF::
msgbox LilycoveCity_DepartmentStore_5F_Text_PlaceFullOfCuteDolls, MSGBOX_NPC
Expand Down
4 changes: 1 addition & 3 deletions data/maps/MauvilleCity_Mart/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ MauvilleCity_Mart_Pokemart:
.2byte ITEM_GUARD_SPEC
.2byte ITEM_DIRE_HIT
.2byte ITEM_X_ACCURACY
.2byte ITEM_NONE
release
end
pokemartlistend

MauvilleCity_Mart_EventScript_ExpertM::
msgbox MauvilleCity_Mart_Text_ItemsToTemporarilyElevateStats, MSGBOX_NPC
Expand Down
4 changes: 1 addition & 3 deletions data/maps/MossdeepCity_Mart/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ MossdeepCity_Mart_Pokemart:
.2byte ITEM_MAX_REPEL
.2byte ITEM_X_ATTACK
.2byte ITEM_X_DEFEND
.2byte ITEM_NONE
release
end
pokemartlistend

MossdeepCity_Mart_EventScript_Woman::
msgbox MossdeepCity_Mart_Text_ReviveIsFantastic, MSGBOX_NPC
Expand Down
8 changes: 2 additions & 6 deletions data/maps/OldaleTown_Mart/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ OldaleTown_Mart_Pokemart_Basic:
.2byte ITEM_ANTIDOTE
.2byte ITEM_PARALYZE_HEAL
.2byte ITEM_AWAKENING
.2byte ITEM_NONE
release
end
pokemartlistend

OldaleTown_Mart_ExpandedItems::
pokemart OldaleTown_Mart_Pokemart_Expanded
Expand All @@ -35,9 +33,7 @@ OldaleTown_Mart_Pokemart_Expanded:
.2byte ITEM_ANTIDOTE
.2byte ITEM_PARALYZE_HEAL
.2byte ITEM_AWAKENING
.2byte ITEM_NONE
release
end
pokemartlistend

OldaleTown_Mart_EventScript_Woman::
lock
Expand Down
8 changes: 2 additions & 6 deletions data/maps/PetalburgCity_Mart/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ PetalburgCity_Mart_Pokemart_Basic:
.2byte ITEM_X_ATTACK
.2byte ITEM_X_DEFEND
.2byte ITEM_ORANGE_MAIL
.2byte ITEM_NONE
release
end
pokemartlistend

PetalburgCity_Mart_EventScript_ExpandedItems::
pokemart PetalburgCity_Mart_Pokemart_Expanded
Expand All @@ -50,9 +48,7 @@ PetalburgCity_Mart_Pokemart_Expanded:
.2byte ITEM_X_ATTACK
.2byte ITEM_X_DEFEND
.2byte ITEM_ORANGE_MAIL
.2byte ITEM_NONE
release
end
pokemartlistend

PetalburgCity_Mart_EventScript_Woman::
msgbox PetalburgCity_Mart_Text_WeakWillGrowStronger, MSGBOX_NPC
Expand Down
4 changes: 1 addition & 3 deletions data/maps/Route104_PrettyPetalFlowerShop/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ Route104_PrettyPetalFlowerShop_Pokemart_Plants:
.2byte DECOR_COLORFUL_PLANT
.2byte DECOR_BIG_PLANT
.2byte DECOR_GORGEOUS_PLANT
.2byte DECOR_NONE
release
end
pokemartlistend

Route104_PrettyPetalFlowerShop_EventScript_WailmerPailGirl::
lock
Expand Down
Loading

0 comments on commit 5613ed7

Please sign in to comment.