Merge branch '_RHH/upcoming' into _RHH/pr/upcoming/lighting-expansion-v2

This commit is contained in:
Eduardo Quezada 2024-09-11 08:09:09 -03:00
commit fc1212b060
702 changed files with 15318 additions and 5537 deletions

View File

@ -41,11 +41,16 @@ REVISION := 0
TEST ?= 0
ANALYZE ?= 0
UNUSED_ERROR ?= 0
DEBUG ?= 0
ifeq (check,$(MAKECMDGOALS))
TEST := 1
endif
ifeq (debug,$(MAKECMDGOALS))
DEBUG := 1
endif
CPP := $(PREFIX)cpp
ROM_NAME := pokeemerald.gba
@ -60,6 +65,7 @@ MAP = $(ROM:.gba=.map)
SYM = $(ROM:.gba=.sym)
TEST_OBJ_DIR_NAME := build/modern-test
DEBUG_OBJ_DIR_NAME := build/modern-debug
TESTELF = $(ROM:.gba=-test.elf)
HEADLESSELF = $(ROM:.gba=-test-headless.elf)
@ -86,7 +92,8 @@ TEST_BUILDDIR = $(OBJ_DIR)/$(TEST_SUBDIR)
ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=1
CC1 = $(shell $(PATH_ARMCC) --print-prog-name=cc1) -quiet
override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init
override CFLAGS += -mthumb -mthumb-interwork -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init
ifeq ($(ANALYZE),1)
override CFLAGS += -fanalyzer
endif
@ -101,6 +108,12 @@ OBJ_DIR := $(OBJ_DIR_NAME)
LIBPATH := -L "$(dir $(shell $(PATH_ARMCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_ARMCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_ARMCC) -mthumb -print-file-name=libc.a))"
LIB := $(LIBPATH) -lc -lnosys -lgcc -L../../libagbsyscall -lagbsyscall
ifeq ($(DEBUG),1)
override CFLAGS += -Og -g
else
override CFLAGS += -O2
endif
ifeq ($(TESTELF),$(MAKECMDGOALS))
TEST := 1
endif
@ -108,6 +121,10 @@ endif
ifeq ($(TEST),1)
OBJ_DIR := $(TEST_OBJ_DIR_NAME)
endif
ifeq ($(DEBUG),1)
OBJ_DIR := $(DEBUG_OBJ_DIR_NAME)
endif
CPPFLAGS := -iquote include -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=1 -DTESTING=$(TEST)
@ -146,7 +163,7 @@ MAKEFLAGS += --no-print-directory
# Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION:
.PHONY: all rom clean compare tidy tools check-tools mostlyclean clean-tools clean-check-tools $(TOOLDIRS) $(CHECKTOOLDIRS) libagbsyscall agbcc modern tidymodern tidynonmodern check history
.PHONY: all rom clean compare tidy tools check-tools mostlyclean clean-tools clean-check-tools $(TOOLDIRS) $(CHECKTOOLDIRS) libagbsyscall agbcc modern tidymodern tidynonmodern check history debug
infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))
@ -154,7 +171,7 @@ infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst
# Disable dependency scanning for clean/tidy/tools
# Use a separate minimal makefile for speed
# Since we don't need to reload most of this makefile
ifeq (,$(filter-out all rom compare agbcc modern check libagbsyscall syms $(TESTELF),$(MAKECMDGOALS)))
ifeq (,$(filter-out all rom compare agbcc modern check libagbsyscall syms $(TESTELF) debug,$(MAKECMDGOALS)))
$(call infoshell, $(MAKE) -f make_tools.mk)
else
NODEP ?= 1
@ -246,7 +263,7 @@ clean-tools:
clean-check-tools:
@$(foreach tooldir,$(CHECKTOOLDIRS),$(MAKE) clean -C $(tooldir);)
mostlyclean: tidynonmodern tidymodern tidycheck
mostlyclean: tidynonmodern tidymodern tidycheck tidydebug
find sound -iname '*.bin' -exec rm {} +
rm -f $(MID_SUBDIR)/*.s
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} +
@ -256,7 +273,7 @@ mostlyclean: tidynonmodern tidymodern tidycheck
rm -f $(AUTO_GEN_TARGETS)
@$(MAKE) clean -C libagbsyscall
tidy: tidymodern tidycheck
tidy: tidymodern tidycheck tidydebug
tidymodern:
rm -f $(ROM_NAME) $(ELF_NAME) $(MAP_NAME)
@ -266,6 +283,8 @@ tidycheck:
rm -f $(TESTELF) $(HEADLESSELF)
rm -rf $(TEST_OBJ_DIR_NAME)
tidydebug:
rm -rf $(DEBUG_OBJ_DIR_NAME)
include graphics_file_rules.mk
include map_data_rules.mk
@ -305,6 +324,11 @@ ifeq ($(DINFO),1)
override CFLAGS += -g
endif
ifeq ($(NOOPT),1)
override CFLAGS := $(filter-out -O1 -Og -O2,$(CFLAGS))
override CFLAGS += -O0
endif
# The dep rules have to be explicit or else missing files won't be reported.
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
# It doesn't look like $(shell) can be deferred so there might not be a better way.
@ -443,6 +467,8 @@ agbcc:
modern: all
debug: all
LD_SCRIPT_TEST := ld_script_test.ld
$(OBJ_DIR)/ld_script_test.ld: $(LD_SCRIPT_TEST) $(LD_SCRIPT_DEPS)

View File

@ -507,9 +507,9 @@
.byte \battler
.endm
.macro trainerslidein battler:req
.macro trainerslidein position:req
.byte 0x53
.byte \battler
.byte \position
.endm
.macro playse song:req
@ -1674,14 +1674,62 @@
callnative BS_FickleBeamDamageCalculation
.endm
@ various command changed to more readable macros
.macro cancelmultiturnmoves battler:req
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
.macro trytarshot failInstr:req
callnative BS_TryTarShot
.4byte \failInstr
.endm
.macro jumpifteainvulnerable battler:req, jumpInstr:req
callnative BS_TeatimeInvul
.byte \battler
.4byte \jumpInstr
.endm
.macro jumpifteanoberry failInstr:req
callnative BS_TeatimeTargets
.4byte \failInstr
.endm
.macro trywindriderpower battler:req, failInstr:req
callnative BS_TryWindRiderPower
.byte \battler
.4byte \failInstr
.endm
.macro activateweatherchangeabilities battler:req
callnative BS_ActivateWeatherChangeAbilities
.byte \battler
.endm
.macro activateterrainchangeabilities battler:req
callnative BS_ActivateTerrainChangeAbilities
.byte \battler
.endm
@ Stores Healing Wish effect.
.macro storehealingwish battler:req
various \battler, VARIOUS_STORE_HEALING_WISH
callnative BS_StoreHealingWish
.byte \battler
.endm
.macro hitswitchtargetfailed
callnative BS_HitSwitchTargetFailed
.endm
.macro tryrevivalblessing, failInstr:req
callnative BS_TryRevivalBlessing
.4byte \failInstr
.endm
.macro jumpifblockedbysoundproof battler:req, failInstr:req
callnative BS_JumpIfBlockedBySoundproof
.byte \battler
.4byte \failInstr
.endm
@ various command changed to more readable macros
.macro cancelmultiturnmoves battler:req
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
.endm
.macro setmagiccoattarget battler:req
@ -2210,11 +2258,6 @@
.4byte \failInstr
.endm
.macro trytarshot battler:req, failInstr:req
various \battler, VARIOUS_TRY_TAR_SHOT
.4byte \failInstr
.endm
.macro cantarshotwork battler:req, failInstr:req
various \battler, VARIOUS_CAN_TAR_SHOT_WORK
.4byte \failInstr
@ -2230,16 +2273,6 @@
.4byte \failInstr
.endm
.macro jumpifteanoberry jumpInstr:req
various BS_ATTACKER, VARIOUS_TEATIME_TARGETS
.4byte \jumpInstr
.endm
.macro jumpifteainvulnerable battler:req, jumpInstr:req
various \battler, VARIOUS_TEATIME_INVUL
.4byte \jumpInstr
.endm
.macro curecertainstatuses battler:req
various \battler, VARIOUS_CURE_CERTAIN_STATUSES
.endm
@ -2284,19 +2317,6 @@
.byte \stat
.endm
.macro trywindriderpower battler:req, failInstr:req
various \battler, VARIOUS_TRY_WIND_RIDER_POWER
.4byte \failInstr
.endm
.macro activateweatherchangeabilities battler:req
various \battler, VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES
.endm
.macro activateterrainchangeabilities battler:req
various \battler, VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7
@ -2491,15 +2511,6 @@
waitmessage B_WAIT_TIME_LONG
.endm
.macro hitswitchtargetfailed
various 0, VARIOUS_HIT_SWITCH_TARGET_FAILED
.endm
.macro tryrevivalblessing, jumpInstr:req
various 0, VARIOUS_TRY_REVIVAL_BLESSING
.4byte \jumpInstr
.endm
@ Will jump to script pointer if the specified battler has or has not fainted.
.macro jumpiffainted battler:req, value:req, ptr:req
getbattlerfainted \battler

View File

@ -2323,3 +2323,20 @@
.macro togglefakertc
callnative Script_ToggleFakeRtc
.endm
@ ============================ @
@ ITEM DESCRIPTION HEADER MACROS
@ Used with OW_SHOW_ITEM_DESCRIPTIONS config
.macro showitemdescription
callnative ScriptShowItemDescription
.byte 0
.endm
.macro showberrydescription
callnative ScriptShowItemDescription
.byte 1
.endm
.macro hideitemdescription
callnative ScriptHideItemDescription
.endm

View File

@ -45,6 +45,7 @@ SUPER_ER = 2C
LV = 34
'=' = 35
';' = 36
V_D_ARROW = 38
'¿' = 51
'¡' = 52
PK = 53

File diff suppressed because it is too large Load Diff

View File

@ -508,7 +508,7 @@ BattleScript_EffectAttackUpUserAlly_TryAlly:
BattleScript_EffectAttackUpUserAlly_End:
goto BattleScript_MoveEnd
BattleScript_EffectAttackUpUserAlly_TryAlly_:
jumpifability BS_ATTACKER_PARTNER, ABILITY_SOUNDPROOF, BattleScript_EffectAttackUpUserAlly_TryAllyBlocked
jumpifblockedbysoundproof BS_ATTACKER_PARTNER, BattleScript_EffectAttackUpUserAlly_TryAllyBlocked
setstatchanger STAT_ATK, 1, FALSE
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_EffectAttackUpUserAlly_End
jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectAttackUpUserAlly_AllyAnim
@ -902,7 +902,7 @@ BattleScript_EffectTarShot::
printfromtable gStatDownStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_TryTarShot:
trytarshot BS_TARGET, BattleScript_MoveEnd
trytarshot BattleScript_MoveEnd
printstring STRINGID_PKMNBECAMEWEAKERTOFIRE
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
@ -1838,7 +1838,7 @@ BattleScript_HitSwitchTargetForceRandomSwitchFailed:
goto BattleScript_MoveEnd
BattleScript_EffectToxicThread::
setstatchanger STAT_SPEED, 2, TRUE
setstatchanger STAT_SPEED, 1, TRUE
attackcanceler
jumpifsubstituteblocks BattleScript_FailedFromAtkString
jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_SPEED, MIN_STAT_STAGE, BattleScript_ToxicThreadWorks
@ -4281,7 +4281,7 @@ BattleScript_EffectPerishSong::
waitmessage B_WAIT_TIME_LONG
setbyte gBattlerTarget, 0
BattleScript_PerishSongLoop::
jumpifability BS_TARGET, ABILITY_SOUNDPROOF, BattleScript_PerishSongBlocked
jumpifblockedbysoundproof BS_TARGET, BattleScript_PerishSongBlocked
jumpifpranksterblocked BS_TARGET, BattleScript_PerishSongNotAffected
BattleScript_PerishSongLoopIncrement::
addbyte gBattlerTarget, 1
@ -5603,13 +5603,13 @@ BattleScript_LocalTrainerBattleWon::
BattleScript_LocalTwoTrainersDefeated::
printstring STRINGID_TWOENEMIESDEFEATED
BattleScript_LocalBattleWonLoseTexts::
trainerslidein BS_ATTACKER
trainerslidein BS_OPPONENT1
waitstate
printstring STRINGID_TRAINER1LOSETEXT
jumpifnotbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_LocalBattleWonReward
trainerslideout B_POSITION_OPPONENT_LEFT
trainerslideout BS_OPPONENT1
waitstate
trainerslidein BS_FAINTED
trainerslidein BS_OPPONENT2
waitstate
printstring STRINGID_TRAINER2LOSETEXT
BattleScript_LocalBattleWonReward::
@ -5661,15 +5661,15 @@ BattleScript_LocalBattleLostPrintTrainersWinText::
waitstate
returnopponentmon2toball BS_ATTACKER
waitstate
trainerslidein BS_ATTACKER
trainerslidein BS_OPPONENT1
waitstate
printstring STRINGID_TRAINER1WINTEXT
jumpifbattletype BATTLE_TYPE_TOWER_LINK_MULTI, BattleScript_LocalBattleLostDoTrainer2WinText
jumpifnotbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_LocalBattleLostEnd_
BattleScript_LocalBattleLostDoTrainer2WinText::
trainerslideout B_POSITION_OPPONENT_LEFT
trainerslideout BS_OPPONENT1
waitstate
trainerslidein BS_FAINTED
trainerslidein BS_OPPONENT2
waitstate
printstring STRINGID_TRAINER2WINTEXT
BattleScript_LocalBattleLostEnd_::
@ -5680,12 +5680,12 @@ BattleScript_FrontierLinkBattleLost::
waitstate
returnopponentmon2toball BS_ATTACKER
waitstate
trainerslidein BS_ATTACKER
trainerslidein BS_OPPONENT1
waitstate
printstring STRINGID_TRAINER1WINTEXT
trainerslideout B_POSITION_OPPONENT_LEFT
trainerslideout BS_OPPONENT1
waitstate
trainerslidein BS_FAINTED
trainerslidein BS_OPPONENT2
waitstate
printstring STRINGID_TRAINER2WINTEXT
jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_FrontierLinkBattleLostEnd
@ -5708,12 +5708,12 @@ BattleScript_TowerLinkBattleWon::
playtrainerdefeatbgm BS_ATTACKER
printstring STRINGID_BATTLEEND
waitmessage B_WAIT_TIME_LONG
trainerslidein BS_ATTACKER
trainerslidein BS_OPPONENT1
waitstate
printstring STRINGID_TRAINER1LOSETEXT
trainerslideout B_POSITION_OPPONENT_LEFT
trainerslideout BS_OPPONENT1
waitstate
trainerslidein BS_FAINTED
trainerslidein BS_OPPONENT2
waitstate
printstring STRINGID_TRAINER2LOSETEXT
jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_TowerLinkBattleWonEnd
@ -5730,13 +5730,13 @@ BattleScript_FrontierTrainerBattleWon::
BattleScript_FrontierTrainerBattleWon_TwoDefeated:
printstring STRINGID_TWOENEMIESDEFEATED
BattleScript_FrontierTrainerBattleWon_LoseTexts:
trainerslidein BS_ATTACKER
trainerslidein BS_OPPONENT1
waitstate
printstring STRINGID_TRAINER1LOSETEXT
jumpifnotbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_TryPickUpItems
trainerslideout B_POSITION_OPPONENT_LEFT
trainerslideout BS_OPPONENT1
waitstate
trainerslidein BS_FAINTED
trainerslidein BS_OPPONENT2
waitstate
printstring STRINGID_TRAINER2LOSETEXT
BattleScript_TryPickUpItems:

View File

@ -238,7 +238,7 @@ BattleScript_ActionWallyThrow:
waitmessage B_WAIT_TIME_LONG
returnatktoball
waitstate
trainerslidein BS_TARGET
trainerslidein BS_PLAYER1
waitstate
printstring STRINGID_YOUTHROWABALLNOWRIGHT
waitmessage B_WAIT_TIME_LONG
@ -246,10 +246,10 @@ BattleScript_ActionWallyThrow:
BattleScript_TrainerASlideMsgRet::
handletrainerslidemsg BS_SCRIPTING, 0
trainerslidein B_POSITION_OPPONENT_LEFT
trainerslidein BS_OPPONENT1
handletrainerslidemsg BS_SCRIPTING, 1
waitstate
trainerslideout B_POSITION_OPPONENT_LEFT
trainerslideout BS_OPPONENT1
waitstate
handletrainerslidemsg BS_SCRIPTING, 2
return
@ -260,10 +260,10 @@ BattleScript_TrainerASlideMsgEnd2::
BattleScript_TrainerBSlideMsgRet::
handletrainerslidemsg BS_SCRIPTING, 0
trainerslidein B_POSITION_OPPONENT_RIGHT
trainerslidein BS_OPPONENT2
handletrainerslidemsg BS_SCRIPTING, 1
waitstate
trainerslideout B_POSITION_OPPONENT_RIGHT
trainerslideout BS_OPPONENT2
waitstate
handletrainerslidemsg BS_SCRIPTING, 2
return

View File

@ -1103,7 +1103,6 @@ EventScript_VsSeekerChargingDone::
.include "data/text/contest_strings.inc"
.include "data/text/contest_link.inc"
.include "data/text/contest_painting.inc"
.include "data/text/trick_house_mechadolls.inc"
.include "data/scripts/tv.inc"
.include "data/text/tv.inc"
.include "data/scripts/interview.inc"

View File

@ -111,6 +111,7 @@ MtChimney_EventScript_LavaCookieLady::
msgbox MtChimney_Text_ThankYouDear, MSGBOX_DEFAULT
checkitemspace ITEM_LAVA_COOKIE
call_if_eq VAR_RESULT, TRUE, MtChimney_EventScript_RemoveMoney
.if OW_SHOW_ITEM_DESCRIPTIONS == OW_ITEM_DESCRIPTIONS_OFF
giveitem ITEM_LAVA_COOKIE
goto_if_eq VAR_RESULT, FALSE, MtChimney_EventScript_BagIsFull
hidemoneybox
@ -122,6 +123,19 @@ MtChimney_EventScript_BagIsFull::
hidemoneybox
release
end
.else
hidemoneybox
giveitem ITEM_LAVA_COOKIE
goto_if_eq VAR_RESULT, FALSE, MtChimney_EventScript_BagIsFull
release
end
MtChimney_EventScript_BagIsFull::
msgbox gText_TooBadBagIsFull, MSGBOX_DEFAULT
release
end
.endif @ OW_SHOW_ITEM_DESCRIPTIONS
MtChimney_EventScript_RemoveMoney::
removemoney 200

View File

@ -52,8 +52,13 @@ Route109_SeashoreHouse_EventScript_BuySodaPop::
msgbox Route109_SeashoreHouse_Text_HereYouGo, MSGBOX_DEFAULT
removemoney 300
updatemoneybox
.if OW_SHOW_ITEM_DESCRIPTIONS != OW_ITEM_DESCRIPTIONS_OFF
hidemoneybox
giveitem ITEM_SODA_POP
.else
giveitem ITEM_SODA_POP
hidemoneybox
.endif
release
end

View File

@ -176,6 +176,8 @@ BerryTree_EventScript_PickBerry::
special IncrementDailyPickedBerries
special ObjectEventInteractionRemoveBerryTree
message BerryTree_Text_PickedTheBerry
delay 10
showberrydescription
playfanfare MUS_OBTAIN_BERRY
waitmessage
waitfanfare
@ -183,6 +185,7 @@ BerryTree_EventScript_PickBerry::
message BerryTree_Text_PutAwayBerry
waitmessage
waitbuttonpress
hideitemdescription
release
end

View File

@ -1,4 +1,3 @@
.if DEBUG_OVERWORLD_MENU == TRUE
Debug_MessageEnd:
waitmessage
waitbuttonpress
@ -448,5 +447,3 @@ Debug_EventScript_EWRAMCounters::
Debug_EventScript_EWRAMCounters_Text::
.string "Follower Steps: {STR_VAR_1}.\n"
.string "Fishing Chain: {STR_VAR_2}.$"
.endif

View File

@ -2,6 +2,7 @@
.set AMOUNT, VAR_0x8001
Std_ObtainItem::
copyvar VAR_0x8006, ITEMID
additem ITEMID, AMOUNT
copyvar VAR_0x8007, VAR_RESULT
call EventScript_ObtainItemMessage
@ -58,8 +59,11 @@ EventScript_ObtainedItem::
EventScript_ObtainedItemMessage:
message gText_ObtainedTheItem
EventScript_ContinueObtainedItem:
delay 10
showitemdescription
waitfanfare
msgbox gText_PutItemInPocket, MSGBOX_DEFAULT
hideitemdescription
setvar VAR_RESULT, TRUE
return
@ -103,6 +107,7 @@ Std_FindItem::
lock
faceplayer
waitse
copyvar VAR_0x8006, ITEMID
copyvar VAR_0x8004, ITEMID
copyvar VAR_0x8005, AMOUNT
checkitemspace ITEMID, AMOUNT
@ -118,20 +123,25 @@ Std_FindItem::
EventScript_PickUpItem::
removeobject VAR_LAST_TALKED
additem VAR_0x8004, VAR_0x8005
copyvar VAR_0x8006 VAR_0x8004
specialvar VAR_RESULT, BufferTMHMMoveName
copyvar VAR_0x8008, VAR_RESULT
call_if_eq VAR_0x8008, TRUE, EventScript_FoundTMHM
call_if_eq VAR_0x8008, FALSE, EventScript_FoundItem
delay 10
showitemdescription
waitfanfare
waitmessage
bufferitemnameplural STR_VAR_2, VAR_0x8004, VAR_0x8005
pyramid_inchallenge
goto_if_eq VAR_RESULT, TRUE, EventScript_PutBattlePyramidItemInBag
msgbox gText_PutItemInPocket, MSGBOX_DEFAULT
hideitemdescription
return
EventScript_PutBattlePyramidItemInBag::
msgbox gText_PlayerPutItemInBag, MSGBOX_DEFAULT
hideitemdescription
return
EventScript_FoundTMHM::
@ -165,6 +175,7 @@ EventScript_NoRoomToPickUpItem::
EventScript_HiddenItemScript::
lockall
waitse
copyvar VAR_0x8006, VAR_0x8005
additem VAR_0x8005
copyvar VAR_0x8007, VAR_RESULT
bufferitemnameplural STR_VAR_2, VAR_0x8005, 1
@ -194,11 +205,14 @@ EventScript_FoundHiddenItem::
end
EventScript_PutHiddenItemInPocket::
delay 10
showitemdescription
waitmessage
waitfanfare
bufferitemnameplural STR_VAR_2, VAR_0x8004, 1
copyvar VAR_0x8004, VAR_0x8008
msgbox gText_PutItemInPocket, MSGBOX_DEFAULT
hideitemdescription
special TryPutTreasureInvestigatorsOnAir
special SetHiddenItemFlag
releaseall

View File

@ -1,134 +0,0 @@
gTrickHouse_Mechadoll_Oddish::
.string "ODDISH$"
gTrickHouse_Mechadoll_Poochyena::
.string "POOCHYENA$"
gTrickHouse_Mechadoll_Taillow::
.string "TAILLOW$"
gTrickHouse_Mechadoll_Azurill::
.string "AZURILL$"
gTrickHouse_Mechadoll_Lotad::
.string "LOTAD$"
gTrickHouse_Mechadoll_Wingull::
.string "WINGULL$"
gTrickHouse_Mechadoll_Dustox::
.string "DUSTOX$"
gTrickHouse_Mechadoll_Zubat::
.string "ZUBAT$"
gTrickHouse_Mechadoll_Nincada::
.string "NINCADA$"
gTrickHouse_Mechadoll_Ralts::
.string "RALTS$"
gTrickHouse_Mechadoll_Zigzagoon::
.string "ZIGZAGOON$"
gTrickHouse_Mechadoll_Slakoth::
.string "SLAKOTH$"
gTrickHouse_Mechadoll_Poochyena2::
.string "POOCHYENA$"
gTrickHouse_Mechadoll_Shroomish::
.string "SHROOMISH$"
gTrickHouse_Mechadoll_Zigzagoon2::
.string "ZIGZAGOON$"
gTrickHouse_Mechadoll_Poochyena3::
.string "POOCHYENA$"
gTrickHouse_Mechadoll_Zubat2::
.string "ZUBAT$"
gTrickHouse_Mechadoll_Carvanha::
.string "CARVANHA$"
gTrickHouse_Mechadoll_BurnHeal::
.string "BURN HEAL$"
gTrickHouse_Mechadoll_HarborMail::
.string "HARBOR MAIL$"
gTrickHouse_Mechadoll_SamePrice::
.string "Same price$"
gTrickHouse_Mechadoll_60Yen::
.string "¥60$"
gTrickHouse_Mechadoll_55Yen::
.string "¥55$"
gTrickHouse_Mechadoll_Nothing::
.string "Nothing$"
gTrickHouse_Mechadoll_CostMore::
.string "They will cost more.$"
gTrickHouse_Mechadoll_CostLess::
.string "They will cost less.$"
gTrickHouse_Mechadoll_SamePrice2::
.string "Same price$"
gTrickHouse_Mechadoll_Male::
.string "Male$"
gTrickHouse_Mechadoll_Female::
.string "Female$"
gTrickHouse_Mechadoll_Neither::
.string "Neither$"
gTrickHouse_Mechadoll_ElderlyMen::
.string "Elderly men$"
gTrickHouse_Mechadoll_ElderlyLadies::
.string "Elderly ladies$"
gTrickHouse_Mechadoll_SameNumber::
.string "Same number$"
gTrickHouse_Mechadoll_None::
.string "None$"
gTrickHouse_Mechadoll_One::
.string "1$"
gTrickHouse_Mechadoll_Two::
.string "2$"
gTrickHouse_Mechadoll_Two2::
.string "2$"
gTrickHouse_Mechadoll_Three::
.string "3$"
gTrickHouse_Mechadoll_Four::
.string "4$"
gTrickHouse_Mechadoll_Six::
.string "6$"
gTrickHouse_Mechadoll_Seven::
.string "7$"
gTrickHouse_Mechadoll_Eight::
.string "8$"
gTrickHouse_Mechadoll_Six2::
.string "6$"
gTrickHouse_Mechadoll_Seven2::
.string "7$"
gTrickHouse_Mechadoll_Eight2::
.string "8$"

View File

@ -27,6 +27,16 @@ If you are not using competitive syntax parties, instead access the trainer data
# What AI Flags does pokeemerald-expansion have?
This section lists all of expansions AI Flags and briefly describes the effect they have on the AIs behaviour. In all cases, please check the corresponding function or surrounding code around their implementation for more details. Some of these functions are vanilla, some share a name with vanilla but have been modified to varying degrees, and some are completely new.
## Composite AI Flags
Expansion has two "composite" AI flags, `AI_FLAG_BASIC_TRAINER` and `AI_FLAG_SMART_TRAINER`. This means that these flags have no unique functionality themselves, and can instead be thought of as groups of other flags that are all enabled when this flag is enabled. The idea behind these flags is that if you don't care to manage the detailed behaviour of a particular trainer, you can use these as a baseline instead, and expansion will keep them updated for you.
`AI_FLAG_BASIC_TRAINER` is expansion's version of generic, normal AI behaviour. It includes `AI_FLAG_CHECK_BAD_MOVE` (don't use bad moves), `AI_FLAG_TRY_TO_FAINT` (faint the player where possible), and `AI_FLAG_CHECK_VIABILITY` (choose the most effective move to use in the current context). Trainers with this flag will still be smarter than they are in vanilla as there have been dramatic improvements made to move selection, but not incredibly so. Trainers with this flag should feel like normal trainers. In general we recommend these three flags be used in all cases, unless you specifically want a trainer who makes obvious mistakes in battle.
`AI_FLAG_SMART_TRAINER` is expansion's version of a "smart AI". It includes everything in `AI_FLAG_BASIC_TRAINER` along with `AI_FLAG_SMART_SWITCHING` (make smart decisions about when to switch), `AI_FLAG_SMART_MON_CHOICES` (make smart decisions about what mon to send in after a switch / KO), and `AI_FLAG_OMNISCIENT` (awareness of what moves, items, and abilities the player's mons have to better inform decisions). Expansion will keep this updated to represent the most objectively intelligent behaviour our flags are capable of producing.
Expansion has LOADS of flags, which will be covered in the rest of this guide. If you don't want to engage with detailed trainer AI tuning though, you can just use these two composite flags, and trust that expansion will keep their contents updated to always represent the most standard and the smartest behaviour we can.
## `AI_FLAG_CHECK_BAD_MOVE`
The AI will avoid using moves that are likely to fail in the current situation. This flag helps prevent the AI from making ineffective choices, such as using moves into immunities, into invulnerable states, or when the moves are otherwise hindered by abilities, terrain, or status conditions.
@ -42,8 +52,8 @@ This flag is divided into two components to calculate the best available move fo
This is different to `AI_FLAG_CHECK_BAD_MOVE` as it calculates how poor a move is and not whether it will fail or not.
## `AI_FLAG_SETUP_FIRST_TURN`
AI will prioritize using setup moves on the first turn. These include stat buffs, field effects, status moves, etc.
## `AI_FLAG_FORCE_SETUP_FIRST_TURN`
AI will prioritize using setup moves on the first turn at the expense of all else. These include stat buffs, field effects, status moves, etc. AI_FLAG_CHECK_VIABILITY will instead do this when the AI determines it makes sense.
This is just a flat increase without any consideration of whether it makes sense to use the move or not. For better move choice quality for those moves, `AI_FLAG_CHECK_VIABILITY` should be used.

View File

@ -53,6 +53,7 @@
#define CHAR_EQUALS 0x35
#define CHAR_SEMICOLON 0x36
#define CHAR_BARD_WORD_DELIMIT 0x37 // Empty space to separate words in Bard's song
#define CHAR_V_D_ARROW 0x38
#define CHAR_INV_QUESTION_MARK 0x51
#define CHAR_INV_EXCL_MARK 0x52
#define CHAR_PK 0x53

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
237 28 36
251 239 143
247 228 69
234 209 76
222 186 48
160 113 22
255 255 16
213 222 32
255 255 255
222 153 4
222 171 55
230 188 67
247 210 69
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
237 28 36
185 255 175
142 243 140
56 177 78
78 214 109
48 126 26
44 177 68
65 206 48
8 248 0
24 189 2
90 189 77
97 210 101
137 226 120
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
237 28 36
253 242 242
251 225 225
255 210 226
255 198 218
255 181 206
244 159 183
247 187 187
249 210 210
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
237 28 36
213 206 232
206 186 224
203 168 232
204 145 230
192 87 219
156 51 183
111 36 130
210 51 171
247 4 107
67 21 79
203 113 225
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
255 0 0
140 214 132
115 181 132
115 181 99
90 148 90
90 148 74
74 115 41
74 107 57
57 82 24
49 82 41
66 74 33
33 57 16
41 49 16
49 41 8
16 24 0
140 222 173

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 963 B

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
78 82 106
252 252 253
0 0 0
196 199 216
118 120 134
163 165 177
52 55 73
129 45 84
255 144 196
140 20 41
196 85 137
215 27 60
113 113 118
78 82 106
27 33 45

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
78 82 106
238 235 242
0 0 0
170 175 201
93 108 175
131 145 176
36 79 29
129 45 84
255 144 196
140 20 41
196 85 137
215 27 60
78 82 106
49 74 117
25 18 61

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
0 0 0
101 201 58
61 130 49
34 62 30
190 194 173
253 255 244
83 97 78
153 224 73
55 19 30
206 131 81
95 37 58
140 60 80
169 79 52
83 44 34
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
0 0 0
44 141 56
45 103 45
22 49 17
198 201 130
251 255 178
116 114 76
184 230 77
21 22 32
195 157 84
43 36 53
67 56 84
155 117 55
95 71 33
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
0 0 0
149 49 49
228 76 77
181 59 59
80 76 78
243 242 244
239 239 134
78 75 174
30 29 70
189 188 186
193 178 99
52 50 114
99 108 39
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
0 0 0
147 146 142
222 219 225
243 242 244
43 51 60
140 155 166
255 193 125
37 184 233
26 99 136
103 121 140
255 153 40
30 152 187
104 54 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
65 69 90
102 149 227
75 122 154
0 0 0
188 239 248
91 111 138
218 145 35
125 166 166
125 166 166
255 209 74
92 131 133
255 194 11
182 120 29
144 144 144
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
68 95 116
134 249 249
67 194 175
0 0 0
188 239 248
91 111 138
218 145 35
125 166 166
188 239 248
255 209 74
92 131 133
252 142 179
201 100 144
144 144 144
0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1009 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
124 42 41
228 34 18
232 83 44
239 228 48
230 140 184
221 183 7
0 0 0
52 51 50
95 86 83
221 183 7
27 33 34
189 28 15
232 232 248
239 228 48
117 97 4

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
124 42 41
228 34 18
232 83 44
239 228 48
230 140 184
221 183 7
0 0 0
52 51 50
95 86 83
146 173 218
27 33 34
189 28 15
232 232 248
177 196 229
117 97 4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 737 B

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
29 36 44
85 185 157
67 91 92
57 115 90
163 225 231
110 140 166
0 0 0
247 198 0
126 108 37
60 56 57
101 20 32
101 20 32
249 57 57
160 184 200
232 232 248

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
12 17 16
187 230 226
64 109 121
46 95 110
100 192 198
87 128 130
0 0 0
247 198 0
126 108 37
46 48 48
200 28 139
231 82 179
231 82 179
152 183 185
232 232 248

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 B

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
6 84 64
150 150 192
164 110 65
228 167 83
242 229 85
232 232 248
176 176 208
27 171 141
0 0 0
242 229 85
33 115 101
91 83 77
128 119 106
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
105 91 35
150 150 192
171 75 73
255 127 109
242 229 85
232 232 248
176 176 208
251 253 78
0 0 0
255 127 109
170 155 51
91 83 77
128 119 106
0 0 0
0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1019 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
15 15 15
69 60 65
80 29 37
102 91 96
239 227 225
185 170 175
147 125 133
123 130 123
255 251 255
198 198 204
77 74 75
80 29 37
153 62 73
232 232 248
230 76 98

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
15 15 15
74 57 66
52 41 48
102 91 96
239 227 225
185 170 175
147 125 133
123 130 123
255 251 255
198 198 204
160 74 85
84 81 81
136 134 133
232 232 248
171 167 168

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
91 79 91
134 108 134
192 159 186
0 0 0
66 43 32
203 178 107
156 125 85
103 44 48
173 105 66
132 73 55
21 21 21
255 79 34
156 125 85
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
91 79 91
134 108 134
192 159 186
0 0 0
91 88 68
219 216 181
160 155 126
71 58 39
186 160 105
129 111 73
21 21 21
243 179 139
0 0 0
71 58 39
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
0 0 0
97 68 39
204 164 102
176 140 85
21 21 21
210 117 83
191 89 60
126 58 39
75 58 52
107 83 75
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
0 0 0
121 118 77
214 209 157
159 155 104
21 21 21
210 117 83
191 89 60
126 58 39
87 96 60
113 125 76
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
0 0 0
107 70 62
218 225 208
94 98 87
132 41 42
227 63 70
190 197 184
178 49 55
95 134 103
130 212 128
219 217 113
255 172 205
178 49 55
222 139 164
136 149 125

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
0 0 0
64 60 56
208 200 168
136 112 88
56 48 104
112 80 216
160 152 120
80 64 160
95 134 103
130 212 128
219 217 113
216 80 136
178 49 55
178 49 55
136 149 125

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
36 72 40
15 15 15
240 251 227
0 0 0
166 180 150
113 131 92
77 145 79
121 185 123
62 117 63
46 48 47
255 145 21
63 154 95
47 104 60
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
49 58 89
15 15 15
240 251 227
0 0 0
166 180 150
113 131 92
166 152 70
236 240 79
85 71 21
46 48 47
255 145 21
99 161 158
73 107 134
0 0 0
0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
19 59 113
146 173 218
177 196 229
100 137 198
0 0 0
104 111 176
37 37 75
14 23 39
81 73 133
177 119 176
27 33 34
177 196 229
232 232 248
52 51 50
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
19 59 113
146 173 218
177 196 229
100 137 198
0 0 0
104 111 176
37 37 75
14 23 39
81 73 133
177 119 176
27 33 34
239 228 48
232 232 248
52 51 50
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
16 16 16
250 250 250
216 215 211
168 115 143
223 160 187
0 0 0
139 139 141
187 196 196
96 95 94
96 95 94
139 139 141
64 64 64
215 215 215
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
16 16 16
81 81 98
62 62 74
234 73 55
249 141 115
0 0 0
43 43 51
170 170 170
43 43 51
139 139 141
216 215 211
23 23 28
250 250 250
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
139 139 141
216 215 211
0 0 0
250 250 250
223 160 187
168 115 143
250 250 250
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
53 53 60
132 141 147
0 0 0
183 188 191
234 73 55
192 53 37
250 250 250
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
169 26 14
71 11 5
45 124 235
232 83 44
220 86 182
228 34 18
0 0 0
134 55 55
39 42 42
179 74 75
95 86 83
230 136 11
169 26 14
232 232 248
228 34 18

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
169 26 14
71 11 5
45 124 235
232 83 44
220 86 182
228 34 18
0 0 0
134 55 55
39 42 42
179 74 75
95 86 83
230 136 11
45 124 235
232 232 248
220 86 182

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 B

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 B

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
160 32 16
0 0 0
244 52 47
243 94 56
240 167 85
121 23 13
252 245 155
28 64 33
108 19 6
91 152 90
131 184 132
215 232 215
232 232 248
241 248 241
72 116 71

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
115 197 164
69 67 68
0 0 0
94 94 94
0 192 249
119 236 233
48 46 47
186 254 253
28 64 33
27 24 26
91 152 90
131 184 132
215 232 215
232 232 248
241 248 241
72 116 71

Some files were not shown because too many files have changed in this diff Show More