diff --git a/Makefile b/Makefile index 696820cd9..2b997fee5 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,8 @@ ROMTESTHYDRA := tools/mgba-rom-test-hydra/mgba-rom-test-hydra$(EXE) PERL := perl -TOOLDIRS := $(filter-out tools/mgba tools/agbcc tools/binutils,$(wildcard tools/*)) +TOOLDIRS := tools/aif2pcm tools/bin2c tools/gbafix tools/gbagfx tools/jsonproc tools/mapjson tools/mid2agb tools/preproc tools/ramscrgen tools/rsfont tools/scaninc +CHECKTOOLDIRS = tools/patchelf tools/mgba-rom-test-hydra TOOLBASE = $(TOOLDIRS:tools/%=%) TOOLS = $(foreach tool,$(TOOLBASE),tools/$(tool)/$(tool)$(EXE)) @@ -158,7 +159,7 @@ MAKEFLAGS += --no-print-directory # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) libagbsyscall modern tidymodern tidynonmodern check +.PHONY: all rom clean compare tidy tools check-tools mostlyclean clean-tools clean-check-tools $(TOOLDIRS) $(CHECKTOOLDIRS) libagbsyscall modern tidymodern tidynonmodern check infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) @@ -176,9 +177,9 @@ endif ifeq (,$(MAKECMDGOALS)) SCAN_DEPS ?= 1 else - # clean, tidy, tools, mostlyclean, clean-tools, $(TOOLDIRS), tidymodern, tidynonmodern don't even build the ROM + # clean, tidy, tools, check-tools, mostlyclean, clean-tools, clean-check-tools, $(TOOLDIRS), $(CHECKTOOLDIRS), tidymodern, tidynonmodern don't even build the ROM # libagbsyscall does its own thing - ifeq (,$(filter-out clean tidy tools mostlyclean clean-tools $(TOOLDIRS) tidymodern tidynonmodern libagbsyscall,$(MAKECMDGOALS))) + ifeq (,$(filter-out clean tidy tools mostlyclean clean-tools $(TOOLDIRS) clean-check-tools $(CHECKTOOLDIRS) tidymodern tidynonmodern libagbsyscall,$(MAKECMDGOALS))) SCAN_DEPS ?= 0 else SCAN_DEPS ?= 1 @@ -229,11 +230,16 @@ all: rom tools: $(TOOLDIRS) +check-tools: $(CHECKTOOLDIRS) + syms: $(SYM) $(TOOLDIRS): @$(MAKE) -C $@ +$(CHECKTOOLDIRS): + @$(MAKE) -C $@ + rom: $(ROM) ifeq ($(COMPARE),1) @$(SHA1) rom.sha1 @@ -242,11 +248,14 @@ endif # For contributors to make sure a change didn't affect the contents of the ROM. compare: all -clean: mostlyclean clean-tools +clean: mostlyclean clean-tools clean-check-tools clean-tools: @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) +clean-check-tools: + @$(foreach tooldir,$(CHECKTOOLDIRS),$(MAKE) clean -C $(tooldir);) + mostlyclean: tidynonmodern tidymodern rm -f $(SAMPLE_SUBDIR)/*.bin rm -f $(CRY_SUBDIR)/*.bin @@ -455,11 +464,11 @@ LD_SCRIPT_TEST := ld_script_test.txt $(OBJ_DIR)/ld_script_test.ld: $(LD_SCRIPT_TEST) $(LD_SCRIPT_DEPS) cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT_TEST) > ld_script_test.ld -$(TESTELF): $(OBJ_DIR)/ld_script_test.ld $(OBJS) $(TEST_OBJS) libagbsyscall +$(TESTELF): $(OBJ_DIR)/ld_script_test.ld $(OBJS) $(TEST_OBJS) libagbsyscall tools check-tools @echo "cd $(OBJ_DIR) && $(LD) -T ld_script_test.ld -o ../../$@ " @cd $(OBJ_DIR) && $(LD) $(TESTLDFLAGS) -T ld_script_test.ld -o ../../$@ $(OBJS_REL) $(TEST_OBJS_REL) $(LIB) $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent - $(PATCHELF) pokeemerald-test.elf gTestRunnerArgv "$(TESTS)\0" + $(PATCHELF) $(TESTELF) gTestRunnerArgv "$(TESTS)\0" ifeq ($(GITHUB_REPOSITORY_OWNER),rh-hideout) TEST_SKIP_IS_FAIL := \x01 diff --git a/asm/macros/battle_anim_script.inc b/asm/macros/battle_anim_script.inc index a98a344fa..85320bd3b 100644 --- a/asm/macros/battle_anim_script.inc +++ b/asm/macros/battle_anim_script.inc @@ -271,6 +271,50 @@ .byte 0x2f .endm + @ same as createvisualtask except takes in battlerargindex, which is the battle anim arg index of the battler to loop through + .macro createvisualtaskontargets addr:req, priority:req, battlerargindex:req, argv:vararg + .byte 0x30 + .4byte \addr + .byte \priority + .byte \battlerargindex + .byte (.Lcreatetask_\@_2 - .Lcreatetask_\@_1) / 2 @ num_args +.Lcreatetask_\@_1: + .2byte \argv +.Lcreatetask_\@_2: + .endm + + @ same as createsprite except takes in battlerargindex, which is the battle anim arg index of the battler to loop through + .macro createspriteontargets template:req, anim_battler:req, subpriority_offset:req, battlerargindex:req, argv:vararg + .byte 0x31 + .4byte \template + .if \anim_battler == ANIM_TARGET + .byte 0x80 | (\subpriority_offset & 0x7F) + .else + .byte (\subpriority_offset & 0x7F) + .endif + .byte \battlerargindex + .byte (.Lsprite_\@_2 - .Lsprite_\@_1) / 2 +.Lsprite_\@_1: + .2byte \argv +.Lsprite_\@_2: + .endm + + @ does not overwrite gBattleAnimArgs[battlerargindex], some sprite templates are too dependent on the value (e.g. heal block) + .macro createspriteontargets_onpos template:req, anim_battler:req, subpriority_offset:req, battlerargindex:req, argv:vararg + .byte 0x32 + .4byte \template + .if \anim_battler == ANIM_TARGET + .byte 0x80 | (\subpriority_offset & 0x7F) + .else + .byte (\subpriority_offset & 0x7F) + .endif + .byte \battlerargindex + .byte (.Lsprite_\@_2 - .Lsprite_\@_1) / 2 +.Lsprite_\@_1: + .2byte \argv +.Lsprite_\@_2: + .endm + @ useful macros .macro jumpreteq value:req, ptr:req jumpargeq ARG_RET_ID, \value, \ptr diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 4d0b9a614..c96b5fdd2 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -3,9 +3,9 @@ .byte 0x0 .endm - .macro accuracycheck failPtr:req, move:req + .macro accuracycheck failInstr:req, move:req .byte 0x1 - .4byte \failPtr + .4byte \failInstr .2byte \move .endm @@ -116,11 +116,11 @@ .4byte NULL .endm - .macro tryfaintmon_spikes battler:req, ptr:req + .macro tryfaintmon_spikes battler:req, instr:req .byte 0x19 .byte \battler .byte TRUE - .4byte \ptr + .4byte \instr .endm .macro dofaintanimation battler:req @@ -133,65 +133,65 @@ .byte \battler .endm - .macro jumpifstatus battler:req, status1:req, ptr:req + .macro jumpifstatus battler:req, flags:req, jumpInstr:req .byte 0x1c .byte \battler - .4byte \status1 - .4byte \ptr + .4byte \flags + .4byte \jumpInstr .endm - .macro jumpifstatus2 battler:req, status2:req, ptr:req + .macro jumpifstatus2 battler:req, flags:req, jumpInstr:req .byte 0x1d .byte \battler - .4byte \status2 - .4byte \ptr + .4byte \flags + .4byte \jumpInstr .endm - .macro jumpifability battler:req, ability:req, ptr:req + .macro jumpifability battler:req, ability:req, jumpInstr:req .byte 0x1e .byte \battler .2byte \ability - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifsideaffecting battler:req, sidestatus:req, ptr:req + .macro jumpifsideaffecting battler:req, flags:req, jumpInstr:req .byte 0x1f .byte \battler - .4byte \sidestatus - .4byte \ptr + .4byte \flags + .4byte \jumpInstr .endm - .macro jumpifstat battler:req, ifflag:req, stat:req, value:req, ptr + .macro jumpifstat battler:req, comparison:req, stat:req, value:req, jumpInstr:req .byte 0x20 .byte \battler - .byte \ifflag + .byte \comparison .byte \stat .byte \value - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifstatus3condition battler:req, status3:req, condition:req, ptr:req + .macro jumpifstatus3condition battler:req, flags:req, jumpIfTrue:req, jumpInstr:req .byte 0x21 .byte \battler - .4byte \status3 - .byte \condition - .4byte \ptr + .4byte \flags + .byte \jumpIfTrue + .4byte \jumpInstr .endm - .macro jumpbasedontype battler:req, type:req, case:req, ptr:req + .macro jumpbasedontype battler:req, type:req, jumpIfType:req, jumpInstr:req .byte 0x22 .byte \battler .byte \type - .byte \case - .4byte \ptr + .byte \jumpIfType + .4byte \jumpInstr .endm - .macro jumpiftype battler:req, type:req, ptr:req - jumpbasedontype \battler, \type, 1, \ptr + .macro jumpiftype battler:req, type:req, jumpInstr:req + jumpbasedontype \battler, \type, TRUE, \jumpInstr .endm - .macro jumpifnottype battler:req, type:req, ptr:req - jumpbasedontype \battler, \type, 0, \ptr + .macro jumpifnottype battler:req, type:req, jumpInstr:req + jumpbasedontype \battler, \type, FALSE, \jumpInstr .endm .macro getexp battler:req @@ -199,9 +199,9 @@ .byte \battler .endm - .macro checkteamslost ptr:req + .macro checkteamslost jumpInstr:req .byte 0x24 - .4byte \ptr + .4byte \jumpInstr .endm .macro movevaluescleanup @@ -213,72 +213,72 @@ .byte \value .endm - .macro decrementmultihit value:req + .macro decrementmultihit loopInstr:req .byte 0x27 - .4byte \value + .4byte \loopInstr .endm - .macro goto ptr:req + .macro goto instr:req .byte 0x28 - .4byte \ptr + .4byte \instr .endm - .macro jumpifbyte ifflag:req, val:req, byte:req, ptr:req + .macro jumpifbyte comparison:req, bytePtr:req, value:req, jumpInstr:req .byte 0x29 - .byte \ifflag - .4byte \val - .byte \byte - .4byte \ptr + .byte \comparison + .4byte \bytePtr + .byte \value + .4byte \jumpInstr .endm - .macro jumpifhalfword ifflag:req, val:req, hword:req, ptr:req + .macro jumpifhalfword comparison:req, halfwordPtr:req, value:req, jumpInstr:req .byte 0x2a - .byte \ifflag - .4byte \val - .2byte \hword - .4byte \ptr + .byte \comparison + .4byte \halfwordPtr + .2byte \value + .4byte \jumpInstr .endm - .macro jumpifword ifflag:req, val:req, word:req, ptr:req + .macro jumpifword comparison:req, wordPtr:req, value:req, jumpInstr:req .byte 0x2b - .byte \ifflag - .4byte \val - .4byte \word - .4byte \ptr + .byte \comparison + .4byte \wordPtr + .4byte \value + .4byte \jumpInstr .endm - .macro jumpifarrayequal val1:req, val2:req, size:req, ptr:req + .macro jumpifarrayequal array1:req, array2:req, size:req, jumpInstr:req .byte 0x2c - .4byte \val1 - .4byte \val2 + .4byte \array1 + .4byte \array2 .byte \size - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifarraynotequal val1:req, val2:req, size:req, ptr:req + .macro jumpifarraynotequal array1:req, array2:req, size:req, jumpInstr:req .byte 0x2d - .4byte \val1 - .4byte \val2 + .4byte \array1 + .4byte \array2 .byte \size - .4byte \ptr + .4byte \jumpInstr .endm - .macro setbyte ptr:req, byte:req + .macro setbyte bytePtr:req, value:req .byte 0x2e - .4byte \ptr - .byte \byte + .4byte \bytePtr + .byte \value .endm - .macro addbyte ptr:req, byte:req + .macro addbyte bytePtr:req, value:req .byte 0x2f - .4byte \ptr - .byte \byte + .4byte \bytePtr + .byte \value .endm - .macro subbyte ptr:req, byte:req + .macro subbyte bytePtr:req, value:req .byte 0x30 - .4byte \ptr - .byte \byte + .4byte \bytePtr + .byte \value .endm .macro copyarray dest:req, src:req, size:req @@ -288,53 +288,53 @@ .byte \size .endm - .macro copyarraywithindex dest:req, src:req, index:req, size:req + .macro copyarraywithindex dest:req, src:req, indexPtr:req, size:req .byte 0x32 .4byte \dest .4byte \src - .4byte \index + .4byte \indexPtr .byte \size .endm - .macro orbyte ptr:req, byte:req + .macro orbyte bytePtr:req, value:req .byte 0x33 - .4byte \ptr - .byte \byte + .4byte \bytePtr + .byte \value .endm - .macro orhalfword ptr:req, hword:req + .macro orhalfword halfwordPtr:req, value:req .byte 0x34 - .4byte \ptr - .2byte \hword + .4byte \halfwordPtr + .2byte \value .endm - .macro orword ptr:req, word:req + .macro orword wordPtr:req, value:req .byte 0x35 - .4byte \ptr - .4byte \word + .4byte \wordPtr + .4byte \value .endm - .macro bicbyte ptr:req, byte:req + .macro bicbyte bytePtr:req, value:req .byte 0x36 - .4byte \ptr - .byte \byte + .4byte \bytePtr + .byte \value .endm - .macro bichalfword ptr:req, hword:req + .macro bichalfword halfwordPtr:req, value:req .byte 0x37 - .4byte \ptr - .2byte \hword + .4byte \halfwordPtr + .2byte \value .endm - .macro bicword ptr:req, word:req + .macro bicword wordPtr:req, value:req .byte 0x38 - .4byte \ptr - .4byte \word + .4byte \wordPtr + .4byte \value .endm - .macro pause time:req + .macro pause frames:req .byte 0x39 - .2byte \time + .2byte \frames .endm .macro waitstate @@ -362,53 +362,53 @@ .byte 0x3f .endm - .macro jumpifaffectedbyprotect ptr:req + .macro jumpifaffectedbyprotect failInstr:req .byte 0x40 - .4byte \ptr + .4byte \failInstr .endm - .macro call ptr:req + .macro call instr:req .byte 0x41 - .4byte \ptr + .4byte \instr .endm .macro setroost .byte 0x42 .endm - .macro jumpifabilitypresent ability:req, ptr:req + .macro jumpifabilitypresent ability:req, jumpInstr:req .byte 0x43 .2byte \ability - .4byte \ptr + .4byte \jumpInstr .endm .macro endselectionscript .byte 0x44 .endm - .macro playanimation battler:req, animType:req, arg=NULL + .macro playanimation battler:req, animId:req, argPtr=NULL .byte 0x45 .byte \battler - .byte \animType - .4byte \arg + .byte \animId + .4byte \argPtr .endm - .macro playanimation_var battler:req, animType:req, arg=NULL + .macro playanimation_var battler:req, animIdPtr:req, argPtr=NULL .byte 0x46 .byte \battler - .4byte \animType - .4byte \arg + .4byte \animIdPtr + .4byte \argPtr .endm .macro setgraphicalstatchangevalues .byte 0x47 .endm - .macro playstatchangeanimation battler:req, stats:req, statchange:req + .macro playstatchangeanimation battler:req, stats:req, flags:req .byte 0x48 .byte \battler .byte \stats - .byte \statchange + .byte \flags .endm .macro moveend endMode:req, endState:req @@ -449,9 +449,9 @@ moveend 2, \to .endm - .macro sethealblock ptr:req + .macro sethealblock failInstr:req .byte 0x4a - .4byte \ptr + .4byte \failInstr .endm .macro returnatktoball @@ -468,22 +468,22 @@ .byte \battler .endm - .macro switchinanim battler:req, dontclearsubstitutebit:req + .macro switchinanim battler:req, dontClearSubstitute:req .byte 0x4e .byte \battler - .byte \dontclearsubstitutebit + .byte \dontClearSubstitute .endm - .macro jumpifcantswitch battler:req, ptr:req + .macro jumpifcantswitch battler:req, jumpInstr:req .byte 0x4f .byte \battler - .4byte \ptr + .4byte \jumpInstr .endm - .macro openpartyscreen battler:req, ptr:req + .macro openpartyscreen battler:req, failInstr:req .byte 0x50 .byte \battler - .4byte \ptr + .4byte \failInstr .endm .macro switchhandleorder battler:req, state:req @@ -526,21 +526,21 @@ .byte \battler .endm - .macro handlelearnnewmove learnedMovePtr:req, nothingToLearnPtr:req, isFirstMove:req + .macro handlelearnnewmove learnedMoveInstr:req, nothingToLearnInstr:req, isFirstMove:req .byte 0x59 - .4byte \learnedMovePtr - .4byte \nothingToLearnPtr + .4byte \learnedMoveInstr + .4byte \nothingToLearnInstr .byte \isFirstMove .endm - .macro yesnoboxlearnmove forgotMovePtr:req + .macro yesnoboxlearnmove forgotMoveInstr:req .byte 0x5a - .4byte \forgotMovePtr + .4byte \forgotMoveInstr .endm - .macro yesnoboxstoplearningmove noPtr:req + .macro yesnoboxstoplearningmove noInstr:req .byte 0x5b - .4byte \noPtr + .4byte \noInstr .endm .macro hitanimation battler:req @@ -607,9 +607,9 @@ .byte 0x68 .endm - .macro setgravity ptr:req + .macro setgravity failInstr:req .byte 0x69 - .4byte \ptr + .4byte \failInstr .endm .macro removeitem battler:req @@ -647,9 +647,9 @@ .byte 0x71 .endm - .macro jumpifplayerran ptr:req + .macro jumpifplayerran jumpInstr:req .byte 0x72 - .4byte \ptr + .4byte \jumpInstr .endm .macro hpthresholds battler:req @@ -684,14 +684,14 @@ .byte 0x79 .endm - .macro jumpifnexttargetvalid ptr:req + .macro jumpifnexttargetvalid jumpInstr:req .byte 0x7a - .4byte \ptr + .4byte \jumpInstr .endm - .macro tryhealhalfhealth ptr:req, battler:req + .macro tryhealhalfhealth failInstr:req, battler:req .byte 0x7b - .4byte \ptr + .4byte \failInstr .byte \battler .endm @@ -716,24 +716,24 @@ .byte \mode .endm - .macro trysetrest ptr:req + .macro trysetrest failInstr:req .byte 0x81 - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifnotfirstturn ptr:req + .macro jumpifnotfirstturn jumpInstr:req .byte 0x82 - .4byte \ptr + .4byte \jumpInstr .endm - .macro setmiracleeye ptr:req + .macro setmiracleeye failInstr:req .byte 0x83 - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifcantmakeasleep ptr:req + .macro jumpifuproarwakes jumpInstr:req .byte 0x84 - .4byte \ptr + .4byte \jumpInstr .endm .macro stockpile id:req @@ -741,24 +741,24 @@ .byte \id .endm - .macro stockpiletobasedamage ptr:req + .macro stockpiletobasedamage failInstr:req .byte 0x86 - .4byte \ptr + .4byte \failInstr .endm - .macro stockpiletohpheal ptr:req + .macro stockpiletohpheal failInstr:req .byte 0x87 - .4byte \ptr + .4byte \failInstr .endm .macro setdrainedhp .byte 0x88 .endm - .macro statbuffchange flags:req, jumpptr:req + .macro statbuffchange flags:req, failInstr:req .byte 0x89 .2byte \flags - .4byte \jumpptr + .4byte \failInstr .endm .macro normalisebuffs @@ -773,23 +773,23 @@ .byte 0x8c .endm - .macro setmultihitcounter val:req + .macro setmultihitcounter value:req .byte 0x8d - .byte \val + .byte \value .endm .macro initmultihitstring .byte 0x8e .endm - .macro forcerandomswitch ptr:req + .macro forcerandomswitch failInstr:req .byte 0x8f - .4byte \ptr + .4byte \failInstr .endm - .macro tryconversiontypechange ptr:req + .macro tryconversiontypechange failInstr:req .byte 0x90 - .4byte \ptr + .4byte \failInstr .endm .macro givepaydaymoney @@ -800,9 +800,9 @@ .byte 0x92 .endm - .macro tryKO ptr:req + .macro tryKO failInstr:req .byte 0x93 - .4byte \ptr + .4byte \failInstr .endm .macro damagetohalftargethp @@ -817,9 +817,9 @@ .byte 0x96 .endm - .macro tryinfatuating ptr:req + .macro tryinfatuating failInstr:req .byte 0x97 - .4byte \ptr + .4byte \failInstr .endm .macro updatestatusicon battler:req @@ -843,9 +843,9 @@ .byte 0x9c .endm - .macro mimicattackcopy ptr:req + .macro mimicattackcopy failInstr:req .byte 0x9d - .4byte \ptr + .4byte \failInstr .endm .macro metronome @@ -860,48 +860,48 @@ .byte 0xa0 .endm - .macro counterdamagecalculator ptr:req + .macro counterdamagecalculator failInstr:req .byte 0xa1 - .4byte \ptr + .4byte \failInstr .endm - .macro mirrorcoatdamagecalculator ptr:req + .macro mirrorcoatdamagecalculator failInstr:req .byte 0xa2 - .4byte \ptr + .4byte \failInstr .endm - .macro disablelastusedattack ptr:req + .macro disablelastusedattack failInstr:req .byte 0xa3 - .4byte \ptr + .4byte \failInstr .endm - .macro trysetencore ptr:req + .macro trysetencore failInstr:req .byte 0xa4 - .4byte \ptr + .4byte \failInstr .endm - .macro painsplitdmgcalc ptr:req + .macro painsplitdmgcalc failInstr:req .byte 0xa5 - .4byte \ptr + .4byte \failInstr .endm - .macro settypetorandomresistance ptr:req + .macro settypetorandomresistance failInstr:req .byte 0xa6 - .4byte \ptr + .4byte \failInstr .endm .macro setalwayshitflag .byte 0xa7 .endm - .macro copymovepermanently ptr:req + .macro copymovepermanently failInstr:req .byte 0xa8 - .4byte \ptr + .4byte \failInstr .endm - .macro trychoosesleeptalkmove ptr:req + .macro trychoosesleeptalkmove failInstr:req .byte 0xa9 - .4byte \ptr + .4byte \failInstr .endm .macro setdestinybond @@ -912,56 +912,56 @@ .byte 0xab .endm - .macro settailwind ptr:req + .macro settailwind failInstr:req .byte 0xac - .4byte \ptr + .4byte \failInstr .endm - .macro tryspiteppreduce ptr:req + .macro tryspiteppreduce failInstr:req .byte 0xad - .4byte \ptr + .4byte \failInstr .endm .macro healpartystatus .byte 0xae .endm - .macro cursetarget ptr:req + .macro cursetarget failInstr:req .byte 0xaf - .4byte \ptr + .4byte \failInstr .endm - .macro trysetspikes ptr:req + .macro trysetspikes failInstr:req .byte 0xb0 - .4byte \ptr + .4byte \failInstr .endm .macro setforesight .byte 0xb1 .endm - .macro trysetperishsong ptr:req + .macro trysetperishsong failInstr:req .byte 0xb2 - .4byte \ptr + .4byte \failInstr .endm .macro handlerollout .byte 0xb3 .endm - .macro jumpifconfusedandstatmaxed stat:req, ptr:req + .macro jumpifconfusedandstatmaxed stat:req, jumpInstr:req .byte 0xb4 .byte \stat - .4byte \ptr + .4byte \jumpInstr .endm .macro handlefurycutter .byte 0xb5 .endm - .macro setembargo ptr:req + .macro setembargo failInstr:req .byte 0xb6 - .4byte \ptr + .4byte \failInstr .endm .macro presentdamagecalculation @@ -976,23 +976,23 @@ .byte 0xb9 .endm - .macro jumpifnopursuitswitchdmg ptr:req + .macro jumpifnopursuitswitchdmg jumpInstr:req .byte 0xba - .4byte \ptr + .4byte \jumpInstr .endm .macro setsunny .byte 0xbb .endm - .macro maxattackhalvehp ptr:req + .macro maxattackhalvehp failInstr:req .byte 0xbc - .4byte \ptr + .4byte \failInstr .endm - .macro copyfoestats ptr:req + .macro copyfoestats unused:req .byte 0xbd - .4byte \ptr + .4byte \unused .endm .macro rapidspinfree @@ -1003,29 +1003,29 @@ .byte 0xbf .endm - .macro recoverbasedonsunlight ptr:req + .macro recoverbasedonsunlight failInstr:req .byte 0xc0 - .4byte \ptr + .4byte \failInstr .endm - .macro setstickyweb ptr:req + .macro setstickyweb failInstr:req .byte 0xc1 - .4byte \ptr + .4byte \failInstr .endm .macro selectfirstvalidtarget .byte 0xc2 .endm - .macro trysetfutureattack ptr:req + .macro trysetfutureattack failInstr:req .byte 0xc3 - .4byte \ptr + .4byte \failInstr .endm - .macro trydobeatup endPtr=NULL, failPtr=NULL + .macro trydobeatup endInstr, failInstr .byte 0xc4 - .4byte \endPtr - .4byte \failPtr + .4byte \endInstr + .4byte \failInstr .endm .macro setsemiinvulnerablebit @@ -1044,9 +1044,9 @@ .byte 0xc8 .endm - .macro trymemento ptr:req + .macro trymemento failInstr:req .byte 0xc9 - .4byte \ptr + .4byte \failInstr .endm .macro setforcedtarget @@ -1061,105 +1061,105 @@ .byte 0xcc .endm - .macro cureifburnedparalysedorpoisoned ptr:req + .macro cureifburnedparalysedorpoisoned failInstr:req .byte 0xcd - .4byte \ptr + .4byte \failInstr .endm - .macro settorment ptr:req + .macro settorment failInstr:req .byte 0xce - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifnodamage ptr:req + .macro jumpifnodamage jumpInstr:req .byte 0xcf - .4byte \ptr + .4byte \jumpInstr .endm - .macro settaunt ptr:req + .macro settaunt failInstr:req .byte 0xd0 - .4byte \ptr + .4byte \failInstr .endm - .macro trysethelpinghand ptr:req + .macro trysethelpinghand failInstr:req .byte 0xd1 - .4byte \ptr + .4byte \failInstr .endm - .macro tryswapitems ptr:req + .macro tryswapitems failInstr:req .byte 0xd2 - .4byte \ptr + .4byte \failInstr .endm - .macro trycopyability ptr:req + .macro trycopyability failInstr:req .byte 0xd3 - .4byte \ptr + .4byte \failInstr .endm - .macro trywish turnNumber:req, ptr:req + .macro trywish turnNumber:req, failInstr:req .byte 0xd4 .byte \turnNumber - .4byte \ptr + .4byte \failInstr .endm - .macro settoxicspikes ptr:req + .macro settoxicspikes failInstr:req .byte 0xd5 - .4byte \ptr + .4byte \failInstr .endm - .macro setgastroacid ptr:req + .macro setgastroacid failInstr:req .byte 0xd6 - .4byte \ptr + .4byte \failInstr .endm - .macro setyawn ptr:req + .macro setyawn failInstr:req .byte 0xd7 - .4byte \ptr + .4byte \failInstr .endm - .macro setdamagetohealthdifference ptr:req + .macro setdamagetohealthdifference failInstr:req .byte 0xd8 - .4byte \ptr + .4byte \failInstr .endm .macro setroom .byte 0xd9 .endm - .macro tryswapabilities ptr:req + .macro tryswapabilities failInstr:req .byte 0xda - .4byte \ptr + .4byte \failInstr .endm - .macro tryimprison ptr:req + .macro tryimprison failInstr:req .byte 0xdb - .4byte \ptr + .4byte \failInstr .endm - .macro setstealthrock ptr:req + .macro setstealthrock failInstr:req .byte 0xdc - .4byte \ptr + .4byte \failInstr .endm - .macro setuserstatus3 flags:req, ptr:req + .macro setuserstatus3 flags:req, failInstr:req .byte 0xdd .4byte \flags - .4byte \ptr + .4byte \failInstr .endm - .macro assistattackselect ptr:req + .macro assistattackselect failInstr:req .byte 0xde - .4byte \ptr + .4byte \failInstr .endm - .macro trysetmagiccoat ptr:req + .macro trysetmagiccoat failInstr:req .byte 0xdf - .4byte \ptr + .4byte \failInstr .endm - .macro trysetsnatch ptr:req + .macro trysetsnatch failInstr:req .byte 0xe0 - .4byte \ptr + .4byte \failInstr .endm .macro unused2 ptr:req @@ -1172,10 +1172,10 @@ .byte \battler .endm - .macro jumpifhasnohp battler:req, ptr:req + .macro jumpifhasnohp battler:req, jumpInstr:req .byte 0xe3 .byte \battler - .4byte \ptr + .4byte \jumpInstr .endm .macro getsecretpowereffect @@ -1194,29 +1194,29 @@ .byte 0xe7 .endm - .macro settypebasedhalvers ptr:req + .macro settypebasedhalvers failInstr:req .byte 0xe8 - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifsubstituteblocks ptr:req + .macro jumpifsubstituteblocks jumpInstr:req .byte 0xe9 - .4byte \ptr + .4byte \jumpInstr .endm - .macro tryrecycleitem ptr:req + .macro tryrecycleitem failInstr:req .byte 0xea - .4byte \ptr + .4byte \failInstr .endm - .macro settypetoterrain ptr:req + .macro settypetoterrain failInstr:req .byte 0xeb - .4byte \ptr + .4byte \failInstr .endm - .macro pursuitdoubles ptr:req + .macro pursuitdoubles failInstr:req .byte 0xec - .4byte \ptr + .4byte \failInstr .endm .macro snatchsetbattlers @@ -1235,18 +1235,18 @@ .byte 0xf0 .endm - .macro trysetcaughtmondexflags ptr:req + .macro trysetcaughtmondexflags failInstr:req .byte 0xf1 - .4byte \ptr + .4byte \failInstr .endm .macro displaydexinfo .byte 0xf2 .endm - .macro trygivecaughtmonnick ptr:req + .macro trygivecaughtmonnick successInstr:req .byte 0xf3 - .4byte \ptr + .4byte \successInstr .endm .macro subattackerhpbydmg @@ -1270,9 +1270,9 @@ .byte \position .endm - .macro settelekinesis ptr:req + .macro settelekinesis failInstr:req .byte 0xf9 - .4byte \ptr + .4byte \failInstr .endm .macro swapstatstages stat:req @@ -1285,9 +1285,9 @@ .byte \stat .endm - .macro jumpifoppositegenders ptr:req + .macro jumpifoppositegenders jumpInstr:req .byte 0xfc - .4byte \ptr + .4byte \jumpInstr .endm .macro unused ptr:req @@ -1295,27 +1295,33 @@ .4byte \ptr .endm - .macro tryworryseed ptr:req + .macro tryworryseed failInstr:req .byte 0xfe - .4byte \ptr + .4byte \failInstr .endm - + .macro callnative func:req .byte 0xff .4byte \func .endm @ callnative macros - .macro metalburstdamagecalculator ptr:req + .macro metalburstdamagecalculator failInstr:req callnative BS_CalcMetalBurstDmg - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifholdeffect battler:req, holdEffect:req, ptr:req + .macro jumpifholdeffect battler:req, holdEffect:req, jumpInstr:req callnative BS_JumpIfHoldEffect .byte \battler .2byte \holdEffect - .4byte \ptr + .4byte \jumpInstr + .endm + + .macro jumpifmorethanhalfHP battler:req, jumpInstr:req + callnative BS_JumpIfMoreThanHalfHP + .byte \battler + .4byte \jumpInstr .endm @ various command changed to more readable macros @@ -1323,6 +1329,11 @@ various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES .endm + @ Stores Healing Wish effect. + .macro storehealingwish battler:req + various \battler, VARIOUS_STORE_HEALING_WISH + .endm + .macro setmagiccoattarget battler:req various \battler, VARIOUS_SET_MAGIC_COAT_TARGET .endm @@ -1480,82 +1491,82 @@ .2byte \move .endm - .macro setluckychant battler:req, ptr:req + .macro setluckychant battler:req, failInstr:req various \battler VARIOUS_SET_LUCKY_CHANT - .4byte \ptr + .4byte \failInstr .endm - .macro suckerpunchcheck ptr:req + .macro suckerpunchcheck failInstr:req various BS_ATTACKER, VARIOUS_SUCKER_PUNCH_CHECK - .4byte \ptr + .4byte \failInstr .endm - .macro setabilitysimple battler:req, ptr:req + .macro setabilitysimple battler:req, failInstr:req various \battler VARIOUS_SET_SIMPLE_BEAM - .4byte \ptr + .4byte \failInstr .endm - .macro tryentrainment ptr:req + .macro tryentrainment failInstr:req various BS_ATTACKER, VARIOUS_TRY_ENTRAINMENT - .4byte \ptr + .4byte \failInstr .endm .macro setlastusedability battler:req various \battler, VARIOUS_SET_LAST_USED_ABILITY .endm - .macro tryhealpulse battler:req, ptr:req + .macro tryhealpulse battler:req, failInstr:req various \battler, VARIOUS_TRY_HEAL_PULSE - .4byte \ptr + .4byte \failInstr .endm - .macro tryquash ptr:req + .macro tryquash failInstr:req various BS_ATTACKER, VARIOUS_TRY_QUASH - .4byte \ptr + .4byte \failInstr .endm - .macro tryafteryou ptr:req + .macro tryafteryou failInstr:req various BS_ATTACKER, VARIOUS_AFTER_YOU - .4byte \ptr + .4byte \failInstr .endm - .macro trybestow ptr:req + .macro trybestow failInstr:req various BS_ATTACKER, VARIOUS_BESTOW - .4byte \ptr + .4byte \failInstr .endm .macro invertstatstages battler:req various \battler, VARIOUS_INVERT_STAT_STAGES .endm - .macro setterrain ptr:req + .macro setterrain failInstr:req various BS_ATTACKER, VARIOUS_SET_TERRAIN - .4byte \ptr + .4byte \failInstr .endm - .macro trymefirst ptr:req + .macro trymefirst failInstr:req various BS_ATTACKER, VARIOUS_TRY_ME_FIRST - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifbattleend ptr:req + .macro jumpifbattleend jumpInstr:req various BS_ATTACKER, VARIOUS_JUMP_IF_BATTLE_END - .4byte \ptr + .4byte \jumpInstr .endm - .macro tryelectrify ptr:req + .macro tryelectrify failInstr:req various BS_ATTACKER, VARIOUS_TRY_ELECTRIFY - .4byte \ptr + .4byte \failInstr .endm - .macro tryreflecttype ptr:req + .macro tryreflecttype failInstr:req various BS_ATTACKER, VARIOUS_TRY_REFLECT_TYPE - .4byte \ptr + .4byte \failInstr .endm - .macro trysoak ptr:req + .macro trysoak failInstr:req various BS_ATTACKER, VARIOUS_TRY_SOAK - .4byte \ptr + .4byte \failInstr .endm .macro handlemegaevo battler:req, case:req @@ -1573,33 +1584,33 @@ .byte \case .endm - .macro jumpifcantuselastresort battler:req, ptr:req + .macro jumpifcantuselastresort battler:req, jumpInstr:req various \battler, VARIOUS_TRY_LAST_RESORT - .4byte \ptr + .4byte \jumpInstr .endm .macro argumentstatuseffect various BS_ATTACKER, VARIOUS_ARGUMENT_STATUS_EFFECT .endm - .macro tryhitswitchtarget ptr:req + .macro tryhitswitchtarget failInstr:req various BS_ATTACKER, VARIOUS_TRY_HIT_SWITCH_TARGET - .4byte \ptr + .4byte \failInstr .endm - .macro tryautotomize battler:req, ptr:req + .macro tryautotomize battler:req, failInstr:req various \battler, VARIOUS_TRY_AUTOTOMIZE - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifcantusesynchronoise ptr:req + .macro jumpifcantusesynchronoise jumpInstr:req various BS_ATTACKER, VARIOUS_TRY_SYNCHRONOISE - .4byte \ptr + .4byte \jumpInstr .endm - .macro trycopycat ptr:req + .macro trycopycat failInstr:req various BS_ATTACKER, VARIOUS_TRY_COPYCAT - .4byte \ptr + .4byte \failInstr .endm .macro showabilitypopup battler:req @@ -1610,20 +1621,20 @@ various \battler, VARIOUS_UPDATE_ABILITY_POPUP .endm - .macro defogclear battler:req, clear:req, ptr:req + .macro defogclear battler:req, clear:req, failInstr:req various \battler, VARIOUS_DEFOG .byte \clear - .4byte \ptr + .4byte \failInstr .endm - .macro jumpiftargetally ptr:req + .macro jumpiftargetally jumpInstr:req various BS_ATTACKER, VARIOUS_JUMP_IF_TARGET_ALLY - .4byte \ptr + .4byte \jumpInstr .endm - .macro trypsychoshift ptr:req + .macro trypsychoshift failInstr:req various BS_ATTACKER, VARIOUS_PSYCHO_SHIFT - .4byte \ptr + .4byte \failInstr .endm .macro curestatus battler:req @@ -1638,14 +1649,14 @@ various BS_ATTACKER, VARIOUS_ARGUMENT_TO_MOVE_EFFECT .endm - .macro jumpifnotgrounded battler:req, ptr:req + .macro jumpifnotgrounded battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_NOT_GROUNDED - .4byte \ptr + .4byte \jumpInstr .endm - .macro handletrainerslidemsg battler:req, field:req + .macro handletrainerslidemsg battler:req, case:req various \battler, VARIOUS_HANDLE_TRAINER_SLIDE_MSG - .byte \field + .byte \case .endm .macro trytrainerslidefirstdownmsg battler:req @@ -1660,14 +1671,14 @@ various \battler, VARIOUS_SET_AURORA_VEIL .endm - .macro trysetthirdtype battler:req, ptr:req + .macro trysetthirdtype battler:req, failInstr:req various \battler, VARIOUS_TRY_THIRD_TYPE - .4byte \ptr + .4byte \failInstr .endm - .macro tryaccupressure battler:req, ptr:req + .macro tryaccupressure battler:req, failInstr:req various \battler, VARIOUS_ACUPRESSURE - .4byte \ptr + .4byte \failInstr .endm .macro setpowder battler:req @@ -1682,24 +1693,24 @@ various \battler, VARIOUS_GRAVITY_ON_AIRBORNE_MONS .endm - .macro checkgrassyterrainheal battler:req, ptr:req + .macro checkgrassyterrainheal battler:req, failInstr:req various \battler, VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifnotberry battler:req, ptr:req + .macro jumpifnotberry battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_NOT_BERRY - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifroarfails ptr:req + .macro jumpifroarfails jumpInstr:req various BS_ATTACKER, VARIOUS_JUMP_IF_ROAR_FAILS - .4byte \ptr + .4byte \jumpInstr .endm - .macro tryinstruct ptr:req + .macro tryinstruct failInstr:req various BS_ATTACKER, VARIOUS_TRY_INSTRUCT - .4byte \ptr + .4byte \failInstr .endm .macro settracedability battler:req @@ -1714,19 +1725,19 @@ various \battler, VARIOUS_TRY_ILLUSION_OFF .endm - .macro spriteignore0hp val:req + .macro spriteignore0hp value:req various BS_ATTACKER, VARIOUS_SET_SPRITEIGNORE0HP - .byte \val + .byte \value .endm - .macro getstatvalue battler:req, statId:req + .macro getstatvalue battler:req, stat:req various \battler, VARIOUS_GET_STAT_VALUE - .byte \statId + .byte \stat .endm - .macro jumpiffullhp battler:req, ptr:req + .macro jumpiffullhp battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_FULL_HP - .4byte \ptr + .4byte \jumpInstr .endm .macro losetype battler:req, type:req @@ -1738,60 +1749,60 @@ various \battler, VARIOUS_TRY_FRISK .endm - .macro jumpifshieldsdown battler:req, ptr:req + .macro jumpifshieldsdown battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED - .4byte \ptr + .4byte \jumpInstr .endm - .macro trypoisontype attacker:req, target:req, ptr:req + .macro trypoisontype attacker:req, target:req, failInstr:req various \attacker, VARIOUS_POISON_TYPE_IMMUNITY .byte \target - .4byte \ptr + .4byte \failInstr .endm - .macro tryparalyzetype attacker:req, target:req, ptr:req + .macro tryparalyzetype attacker:req, target:req, failInstr:req various \attacker, VARIOUS_PARALYZE_TYPE_IMMUNITY .byte \target - .4byte \ptr + .4byte \failInstr .endm - .macro trysetfairylock ptr:req + .macro trysetfairylock failInstr:req various BS_ATTACKER, VARIOUS_TRY_FAIRY_LOCK - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifnoally battler:req, ptr:req + .macro jumpifnoally battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_NO_ALLY - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifnoholdeffect battler:req, holdEffet:req, ptr:req + .macro jumpifnoholdeffect battler:req, holdEffect:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_NO_HOLD_EFFECT - .byte \holdEffet - .4byte \ptr + .byte \holdEffect + .4byte \jumpInstr .endm - .macro infatuatewithbattler battler1:req, battler2:req - various \battler1, VARIOUS_INFATUATE_WITH_BATTLER - .byte \battler2 + .macro infatuatewithbattler battler:req, infatuateWith:req + various \battler, VARIOUS_INFATUATE_WITH_BATTLER + .byte \infatuateWith .endm .macro setlastuseditem battler:req various \battler, VARIOUS_SET_LAST_USED_ITEM .endm - .macro jumpifabsent battler:req, ptr:req + .macro jumpifabsent battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_ABSENT - .4byte \ptr + .4byte \jumpInstr .endm .macro destroyabilitypopup various BS_ABILITY_BATTLER, VARIOUS_DESTROY_ABILITY_POPUP .endm - .macro gettotemboost ptr:req + .macro gettotemboost jumpInstr:req various BS_ATTACKER, VARIOUS_TOTEM_BOOST - .4byte \ptr + .4byte \jumpInstr .endm .macro tryactivategrimneigh, battler:req @@ -1802,9 +1813,9 @@ various BS_ATTACKER, VARIOUS_SET_Z_EFFECT .endm - .macro consumeberry battler:req, frombattler:req + .macro consumeberry battler:req, fromBattler:req various \battler, VARIOUS_CONSUME_BERRY - .byte \frombattler + .byte \fromBattler .endm .macro activateitemeffects battler:req @@ -1815,44 +1826,44 @@ various 0, VARIOUS_PICKPOCKET .endm - .macro doterrainseed battler:req, ptr:req + .macro doterrainseed battler:req, failInstr:req various \battler, VARIOUS_TERRAIN_SEED - .4byte \ptr + .4byte \failInstr .endm .macro makeinvisible battler:req various \battler, VARIOUS_MAKE_INVISIBLE .endm - .macro tryroomservice battler:req, ptr:req + .macro tryroomservice battler:req, failInstr:req various \battler, VARIOUS_ROOM_SERVICE - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifterrainaffected battler:req, terrainFlags:req, ptr:req + .macro jumpifterrainaffected battler:req, terrainFlags:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_TERRAIN_AFFECTED .4byte \terrainFlags - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifpranksterblocked battler:req, ptr:req + .macro jumpifpranksterblocked battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_PRANKSTER_BLOCKED - .4byte \ptr + .4byte \jumpInstr .endm - .macro eeriespellppreduce ptr:req + .macro eeriespellppreduce failInstr:req various BS_TARGET, VARIOUS_EERIE_SPELL_PP_REDUCE - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifteamhealthy battler:req, ptr:req + .macro jumpifteamhealthy battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_TEAM_HEALTHY - .4byte \ptr + .4byte \jumpInstr .endm - .macro tryhealquarterhealth battler:req, ptr:req + .macro tryhealquarterhealth battler:req, failInstr:req various \battler, VARIOUS_TRY_HEAL_QUARTER_HP - .4byte \ptr + .4byte \failInstr .endm .macro removeterrain @@ -1867,73 +1878,73 @@ various BS_TARGET, VARIOUS_SET_ATTACKER_STICKY_WEB_USER .endm - .macro getrototillertargets ptr:req + .macro getrototillertargets failInstr:req various BS_ATTACKER, VARIOUS_GET_ROTOTILLER_TARGETS - .4byte \ptr + .4byte \failInstr .endm - .macro jumpifnotrototilleraffected battler:req, ptr:req + .macro jumpifnotrototilleraffected battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED - .4byte \ptr + .4byte \jumpInstr .endm .macro tryactivatebattlebond battler:req various \battler, VARIOUS_TRY_ACTIVATE_BATTLE_BOND .endm - .macro jumpifcantreverttoprimal ptr:req + .macro jumpifcantreverttoprimal jumpInstr:req various BS_ATTACKER, VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL - .4byte \ptr + .4byte \jumpInstr .endm .macro applyplasmafists various BS_ATTACKER, VARIOUS_APPLY_PLASMA_FISTS .endm - .macro jumpifweatheraffected battler:req, weather:req, ptr:req + .macro jumpifweatheraffected battler:req, flags:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_WEATHER_AFFECTED - .4byte \weather - .4byte \ptr + .4byte \flags + .4byte \jumpInstr .endm - .macro jumpifspecies battler:req, species:req, ptr:req + .macro jumpifspecies battler:req, species:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_SPECIES .2byte \species - .4byte \ptr + .4byte \jumpInstr .endm .macro tryendneutralizinggas battler:req various \battler, VARIOUS_TRY_END_NEUTRALIZING_GAS .endm - .macro trynoretreat battler:req, ptr:req + .macro trynoretreat battler:req, failInstr:req various \battler, VARIOUS_TRY_NO_RETREAT - .4byte \ptr + .4byte \failInstr .endm - .macro trytarshot battler:req, ptr:req + .macro trytarshot battler:req, failInstr:req various \battler, VARIOUS_TRY_TAR_SHOT - .4byte \ptr + .4byte \failInstr .endm - .macro cantarshotwork battler:req, ptr:req + .macro cantarshotwork battler:req, failInstr:req various \battler, VARIOUS_CAN_TAR_SHOT_WORK - .4byte \ptr + .4byte \failInstr .endm - .macro checkpoltergeist battler:req, ptr:req + .macro checkpoltergeist battler:req, failInstr:req various \battler, VARIOUS_CHECK_POLTERGEIST - .4byte \ptr + .4byte \failInstr .endm - .macro setoctolock battler:req, ptr:req + .macro setoctolock battler:req, failInstr:req various \battler, VARIOUS_SET_OCTOLOCK - .4byte \ptr + .4byte \failInstr .endm - .macro cutonethirdhpraisestats ptr:req + .macro cutonethirdhpraisestats failInstr:req various BS_ATTACKER, VARIOUS_CUT_1_3_HP_RAISE_STATS - .4byte \ptr + .4byte \failInstr .endm .macro photongeysercheck battler:req @@ -1943,35 +1954,35 @@ .macro shellsidearmcheck various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK .endm - - .macro jumpifrodaffected battler:req, ptr:req + + .macro jumpifrodaffected battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_ROD - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifabsorbaffected battler:req, ptr:req + .macro jumpifabsorbaffected battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_ABSORB - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifmotoraffected battler:req, ptr:req + .macro jumpifmotoraffected battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_MOTOR - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifteanoberry ptr:req + .macro jumpifteanoberry jumpInstr:req various BS_ATTACKER, VARIOUS_TEATIME_TARGETS - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifteainvulnerable battler:req, ptr:req + .macro jumpifteainvulnerable battler:req, jumpInstr:req various \battler, VARIOUS_TEATIME_INVUL - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpifcantfling battler:req, ptr:req + .macro jumpifcantfling battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_CANT_FLING - .4byte \ptr + .4byte \jumpInstr .endm .macro curecertainstatuses battler:req @@ -1982,15 +1993,15 @@ various \battler, VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES .endm - .macro jumpiflastuseditemberry ptr:req + .macro jumpiflastuseditemberry jumpInstr:req various BS_ATTACKER, VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY - .4byte \ptr + .4byte \jumpInstr .endm - .macro jumpiflastuseditemholdeffect battler:req, holdEffect:req, ptr:req + .macro jumpiflastuseditemholdeffect battler:req, holdEffect:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT .byte \holdEffect - .4byte \ptr + .4byte \jumpInstr .endm .macro savebattleritem battler:req @@ -2021,19 +2032,19 @@ various \battler, VARIOUS_GET_BATTLER_SIDE .endm - .macro checkparentalbondcounter counter:req, ptr:req + .macro checkparentalbondcounter counter:req, jumpInstr:req various BS_ATTACKER, VARIOUS_CHECK_PARENTAL_BOND_COUNTER .byte \counter - .4byte \ptr + .4byte \jumpInstr .endm .macro swapstats stat:req various BS_ATTACKER, VARIOUS_SWAP_STATS .byte \stat .endm - .macro trywindriderpower battler:req, ptr:req + .macro trywindriderpower battler:req, failInstr:req various \battler, VARIOUS_TRY_WIND_RIDER_POWER - .4byte \ptr + .4byte \failInstr .endm .macro activateweatherchangeabilities battler:req @@ -2044,11 +2055,6 @@ various \battler, VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES .endm - .macro jumpifnovalidtargets ptr:req - various BS_ATTACKER, VARIOUS_JUMP_IF_NO_VALID_TARGETS - .4byte \ptr - .endm - @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7 @@ -2091,44 +2097,44 @@ copyarray \dst, \src, 0x4 .endm - .macro jumpifbytenotequal byte1:req, byte2:req, jumpptr:req - jumpifarraynotequal \byte1, \byte2, 0x1, \jumpptr + .macro jumpifbytenotequal byte1:req, byte2:req, jumpInstr:req + jumpifarraynotequal \byte1, \byte2, 0x1, \jumpInstr .endm - .macro jumpifbyteequal byte1:req, byte2:req, jumpptr:req - jumpifarrayequal \byte1, \byte2, 0x1, \jumpptr + .macro jumpifbyteequal byte1:req, byte2:req, jumpInstr:req + jumpifarrayequal \byte1, \byte2, 0x1, \jumpInstr .endm - .macro jumpifmove move:req, jumpptr:req - jumpifhalfword CMP_EQUAL, gCurrentMove, \move, \jumpptr + .macro jumpifmove move:req, jumpInstr:req + jumpifhalfword CMP_EQUAL, gCurrentMove, \move, \jumpInstr .endm - .macro jumpifnotmove move:req, jumpptr:req - jumpifhalfword CMP_NOT_EQUAL, gCurrentMove, \move, \jumpptr + .macro jumpifnotmove move:req, jumpInstr:req + jumpifhalfword CMP_NOT_EQUAL, gCurrentMove, \move, \jumpInstr .endm - .macro jumpifnotchosenmove move:req, jumpptr:req - jumpifhalfword CMP_NOT_EQUAL, gChosenMove, \move, \jumpptr + .macro jumpifnotchosenmove move:req, jumpInstr:req + jumpifhalfword CMP_NOT_EQUAL, gChosenMove, \move, \jumpInstr .endm - .macro jumpifstatus3 battler:req, status:req, jumpptr:req - jumpifstatus3condition \battler, \status, FALSE, \jumpptr + .macro jumpifstatus3 battler:req, flags:req, jumpInstr:req + jumpifstatus3condition \battler, \flags, FALSE, \jumpInstr .endm - .macro jumpifnostatus3 battler:req, status:req, jumpptr:req - jumpifstatus3condition \battler, \status, TRUE, \jumpptr + .macro jumpifnostatus3 battler:req, flags:req, jumpInstr:req + jumpifstatus3condition \battler, \flags, TRUE, \jumpInstr .endm - .macro jumpifmovehadnoeffect jumpptr:req - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_NO_EFFECT, \jumpptr + .macro jumpifmovehadnoeffect jumpInstr:req + jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_NO_EFFECT, \jumpInstr .endm - .macro jumpifbattletype flags:req, jumpptr:req - jumpifword CMP_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr + .macro jumpifbattletype flags:req, jumpInstr:req + jumpifword CMP_COMMON_BITS, gBattleTypeFlags, \flags, \jumpInstr .endm - .macro jumpifnotbattletype flags:req, jumpptr:req - jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr + .macro jumpifnotbattletype flags:req, jumpInstr:req + jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpInstr .endm .macro dmg_1_8_targethp @@ -2147,42 +2153,42 @@ manipulatedamage DMG_1_2_ATTACKER_HP .endm - .macro jumpifflowerveil jumpptr:req + .macro jumpifflowerveil jumpInstr:req jumpifnottype BS_TARGET, TYPE_GRASS, 1f - jumpifability BS_TARGET_SIDE, ABILITY_FLOWER_VEIL, \jumpptr + jumpifability BS_TARGET_SIDE, ABILITY_FLOWER_VEIL, \jumpInstr 1: .endm - .macro jumpifflowerveilattacker jumpptr:req + .macro jumpifflowerveilattacker jumpInstr:req jumpifnottype BS_ATTACKER, TYPE_GRASS, 1f - jumpifability BS_ATTACKER_SIDE, ABILITY_FLOWER_VEIL, \jumpptr + jumpifability BS_ATTACKER_SIDE, ABILITY_FLOWER_VEIL, \jumpInstr 1: .endm - .macro setallytonexttarget jumpptr:req + .macro setallytonexttarget jumpInstr:req jumpifbyte CMP_GREATER_THAN, gBattlerTarget, 0x1, 1f addbyte gBattlerTarget, 0x2 - goto \jumpptr + goto \jumpInstr 1: subbyte gBattlerTarget, 0x2 - goto \jumpptr + goto \jumpInstr .endm - .macro jumpifleafguardprotected battler:req, jumpptr:req + .macro jumpifleafguardprotected battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED - .4byte \jumpptr + .4byte \jumpInstr .endm - .macro jumpifsafeguard jumpptr:req + .macro jumpifsafeguard jumpInstr:req jumpifability BS_ATTACKER, ABILITY_INFILTRATOR, 1f - jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, \jumpptr + jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, \jumpInstr 1: .endm @ Will jump to script pointer if the target weighs less than 200 kg, or 441 lbs. - .macro jumpifunder200 battler:req, ptr:req + .macro jumpifunder200 battler:req, failInstr:req various \battler, VARIOUS_JUMP_IF_UNDER_200 - .4byte \ptr + .4byte \failInstr .endm @ Sets the sky drop status and does all other necessary operations @@ -2192,9 +2198,9 @@ @ Clears the sky drop status and does all other necessary operations. @ If the target fainted in before this script is called, it goes to the given script. - .macro clearskydrop ptr:req + .macro clearskydrop failInstr:req various 0, VARIOUS_CLEAR_SKY_DROP - .4byte \ptr + .4byte \failInstr .endm @ Accounts for if the target of Sky Drop was in confuse_lock when the attacker falls asleep due to Yawn. @@ -2238,7 +2244,16 @@ waitmessage B_WAIT_TIME_LONG .endm - .macro jumpifemergencyexited battler:req, ptr:req + .macro jumpifemergencyexited battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_EMERGENCY_EXITED + .4byte \jumpInstr + .endm + + .macro jumpifshelltrap battler:req, ptr:req + various \battler, VARIOUS_JUMP_IF_SHELL_TRAP .4byte \ptr .endm + + .macro hitswitchtargetfailed + various 0, VARIOUS_HIT_SWITCH_TARGET_FAILED + .endm diff --git a/common_syms/window.txt b/common_syms/window.txt index 416d9d732..24c093a22 100644 --- a/common_syms/window.txt +++ b/common_syms/window.txt @@ -1,5 +1,2 @@ -gUnusedWindowVar1 -gUnusedWindowVar2 gTransparentTileNumber -gUnusedWindowVar3 gWindowBgTilemapBuffers diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 06a24c592..cd011c0f4 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -1492,22 +1492,22 @@ Move_HEAL_BLOCK: loadspritegfx ANIM_TAG_BLUE_STAR monbg ANIM_TARGET createsoundtask SoundTask_PlaySeChangingVolume, SE_M_ABSORB_2, SOUND_PAN_TARGET, 256, -16, 0, 2 - createsprite gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, 0, -5, 1, 0 + createspriteontargets_onpos gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, 2, 0, -5, ANIM_TARGET, 0 delay 7 - createsprite gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, -15, 10, 1, 0 + createspriteontargets_onpos gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, 2, -15, 10, ANIM_TARGET, 0 delay 7 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1 | 4, 4, 2, 12, 0, RGB_BLACK - createsprite gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, 0, -5, 1, 0 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_DEF_SIDE, 4, 2, 12, 0, RGB_BLACK + createspriteontargets_onpos gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, 2, 0, -5, ANIM_TARGET, 0 delay 7 - createsprite gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, -15, 10, 1, 0 + createspriteontargets_onpos gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, 2, -15, 10, ANIM_TARGET, 0 delay 7 - createsprite gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, -15, -15, 1, 0 + createspriteontargets_onpos gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, 2, -15, -15, ANIM_TARGET, 0 delay 7 - createsprite gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, 10, -5, 1, 0 + createspriteontargets_onpos gHealingBlueStarSpriteTemplate, ANIM_TARGET, 2, 2, 10, -5, ANIM_TARGET, 0 delay 7 waitforvisualfinish delay 11 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1 | 4, 4, 2, 0, 12, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_DEF_SIDE, 4, 2, 0, 12, RGB_BLACK waitforvisualfinish clearmonbg ANIM_TARGET end @@ -2644,7 +2644,6 @@ GigaImpactContinuity: delay 11 createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 26, 0, 0, 5 delay 6 - waitbgfadeout createsprite gBasicHitSplatSpriteTemplate, 4, 4, -10, 0, 1, 0 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET delay 1 @@ -3036,24 +3035,24 @@ Move_MUD_BOMB: end Move_PSYCHO_CUT: - loadspritegfx ANIM_TAG_SPIRAL - loadspritegfx ANIM_TAG_PSYCHO_CUT + loadspritegfx ANIM_TAG_SPIRAL + loadspritegfx ANIM_TAG_PSYCHO_CUT loadspritegfx ANIM_TAG_CROSS_IMPACT - monbg ANIM_ATK_PARTNER + monbg ANIM_ATK_PARTNER createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_CROSS_IMPACT, 0, 9, 9, RGB_PURPLE createvisualtask AnimTask_SwayMon, 5, 0, 6, 2048, 2, ANIM_ATTACKER createsprite gPsychoCutSpiralSpriteTemplate, 2, 4, 0, 0, 0, 0 createvisualtask AnimTask_BlendBattleAnimPal, 1, 1, 2, 0, 4, RGB_BLACK createvisualtask AnimTask_BlendBattleAnimPal, 1, 2, 2, 0, 10, RGB(20, 12, 23) delay 30 - clearmonbg ANIM_ATK_PARTNER - waitforvisualfinish - monbg ANIM_TARGET - splitbgprio ANIM_TARGET - setalpha 12, 8 - playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER, + clearmonbg ANIM_ATK_PARTNER + waitforvisualfinish + monbg ANIM_TARGET + splitbgprio ANIM_TARGET + setalpha 12, 8 + playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER, createsprite gPsychoCutSpriteTemplate, ANIM_TARGET, 2, 20, 0, -8, 0, 20 - waitforvisualfinish + waitforvisualfinish createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 7, 0, 9, 1 createsprite gCrossImpactSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 1, 20 createvisualtask AnimTask_BlendBattleAnimPal, 1, 1, 2, 4, 0, RGB_BLACK @@ -4333,12 +4332,12 @@ Move_SPACIAL_REND: waitbgfadein loopsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET, 3, 5 createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 0, 10, SOUND_PAN_ATTACKER, 0xb0, 0x28 - createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 5, 0, 10, 0xff40, 0xf0, 0x28 - createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 5, 0, 10, SOUND_PAN_ATTACKER, 0xff60, 0x28 - createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 5, 0, 10, 0xff40, 0xff90, 0x28 - createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 5, 0, 10, 0xa0, 0x30, 0x28 - createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 5, 0, 10, 0xff20, 0xffe0, 0x28 - createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 5, 0, 10, 0x70, 0xff80, 0x28 + createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 0, 10, 0xff40, 0xf0, 0x28 + createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 0, 10, SOUND_PAN_ATTACKER, 0xff60, 0x28 + createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 0, 10, 0xff40, 0xff90, 0x28 + createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 0, 10, 0xa0, 0x30, 0x28 + createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 0, 10, 0xff20, 0xffe0, 0x28 + createsprite gSpacialRendBladesTemplate2, ANIM_TARGET, 1, 0, 10, 0x70, 0xff80, 0x28 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 waitforvisualfinish restorebg @@ -6406,11 +6405,7 @@ Move_ELECTROWEB: clearmonbg ANIM_DEF_PARTNER delay 1 createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 9, 0, RGB_BLACK - - @ ElectricityEffect looks ugly against both opponents, to do later - jumpifdoublebattle Move_ELECTROWEB_Wait - - call ElectricityEffect + call ElectricityEffect_OnTargets Move_ELECTROWEB_Wait: waitforvisualfinish end @@ -9279,16 +9274,16 @@ Move_EERIE_IMPULSE:: Move_VENOM_DRENCH:: loadspritegfx ANIM_TAG_POISON_BUBBLE monbg ANIM_DEF_PARTNER - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xfffb 0x1 0xfffb 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xfffb 0x1 0xfffb 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x5 0x0 0x6 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x5 0x0 0x6 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x13 0x1 0xa 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x13 0x1 0xa 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xffe9 0x2 0xfff6 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xffe9 0x2 0xfff6 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 call AcidDrench @@ -9297,28 +9292,28 @@ Move_VENOM_DRENCH:: clearmonbg ANIM_DEF_PARTNER end AcidDrench: - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xffec 0x0 0xfff6 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xffec 0x0 0xfff6 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x1c 0x1 0xa 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x1c 0x1 0xa 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xfff6 0x1 0xfffb 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xfff6 0x1 0xfffb 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xa 0x0 0x6 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xa 0x0 0x6 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x18 0x1 0xa 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x18 0x1 0xa 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xffe0 0x2 0xfff6 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xffe0 0x2 0xfff6 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xffec 0x0 0xfff6 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0xffec 0x0 0xfff6 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 - launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x1e 0x2 0xa 0x0 + launchtemplate gVenomDrenchAcidTemplate 0x82, 0x4, 0x1e 0x2 0xa 1 playsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET delay 0x2 return @@ -10176,6 +10171,7 @@ Move_ORIGIN_PULSE:: launchtemplate gOriginPulseOrbInwardTemplate 0x82 0x5 0x1 0x0 0xFF2A 0xFFAA 0x10 @between left and upper left launchtemplate gOriginPulseOrbInwardTemplate 0x82 0x5 0x1 0x0 0xFFDA 0xFF94 0x10 @between up and upper left waitforvisualfinish + createvisualtaskontargets AnimTask_ShakeMon2, 5, 0, ANIM_TARGET, 2, 0, 18, 1 monbg ANIM_DEF_PARTNER launchtemplate gOriginPulseBasicSplatTemplate 0x83 0x4 0xffb0 0xfff0 0x1 0x1 stopsound @@ -12040,168 +12036,168 @@ ShellTrapUnleash: monbg ANIM_TARGET waitplaysewithpan SE_M_REFLECT, SOUND_PAN_ATTACKER, 0x10 delay 0x6 - launchtemplate gShellTrapYellowImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapYellowImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapYellowImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapYellowImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapYellowImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapYellowImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapYellowImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapYellowImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapYellowImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapYellowImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapYellowImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapYellowImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapYellowImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapYellowImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapYellowImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapYellowImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapYellowImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapYellowImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x0 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x38, 0x0 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x2 - launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x4 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x38, 0x4 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x2 - launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x8 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x38, 0x8 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x2 - launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0xc - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x38, 0xc + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x2 - launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x10 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x38, 0x10 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x2 - launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x14 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x38, 0x14 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x2 - launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x18 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x38, 0x18 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 - launchtemplate gShellTrapRedImpactTemplate 0x2 0x4 0x0 0x0 0x0 0x2 + createsprite gShellTrapRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x2 delay 0x5 waitforvisualfinish call ShellTrapFireLaunch1 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0x0 0x0 0x0 0x38 0x4 0x4 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0x0, 0x0, 0x0, 0x38, 0x4, 0x4, 0x1 delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xfff6 0x0 0xfff6 0x38 0x4 0x4 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xfff6, 0x0, 0xfff6, 0x38, 0x4, 0x4, 0x1 delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xa 0x0 0xa 0x38 0xfffc 0x3 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xa, 0x0, 0xa, 0x38, 0xfffc, 0x3, 0x1 delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xffec 0x0 0xffec 0x38 0xfffc 0x5 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xffec, 0x0, 0xffec, 0x38, 0xfffc, 0x5, 0x1 delay 0x3 call ShellTrapFireLaunch2 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 delay 0x3 waitforvisualfinish clearmonbg ANIM_TARGET end ShellTrapFireLaunch1: - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0x0 0x0 0x0 0x38 0x4 0x4 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0x0, 0x0, 0x0, 0x38, 0x4, 0x4, 0x1 delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xfff6 0x0 0xfff6 0x38 0x4 0x4 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xfff6, 0x0, 0xfff6, 0x38, 0x4, 0x4, 0x1 delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xa 0x0 0xa 0x38 0xfffc 0x3 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xa, 0x0, 0xa, 0x38, 0xfffc, 0x3, 0x1 delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xffec 0x0 0xffec 0x38 0xfffc 0x5 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xffec, 0x0, 0xffec, 0x38, 0xfffc, 0x5, 0x1 delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xf 0x0 0xf 0x38 0x4 0x4 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xf, 0x0, 0xf, 0x38, 0x4, 0x4, 0x1 delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xffec 0x0 0xffec 0x38 0x4 0x4 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xffec, 0x0, 0xffec, 0x38, 0x4, 0x4, 0x1 delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0x14 0x0 0x14 0x38 0x4 0x4 0x1 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0x14, 0x0, 0x14, 0x38, 0x4, 0x4, 0x1 delay 0x3 return ShellTrapFireLaunch2: - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0x0 0x0 0x0 0x38 0x4 0x4 0x1 - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0x0, 0x0, 0x0, 0x38, 0x4, 0x4, 0x1 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xfff6 0x0 0xfff6 0x38 0x4 0x4 0x1 - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xfff6, 0x0, 0xfff6, 0x38, 0x4, 0x4, 0x1 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xa 0x0 0xa 0x38 0xfffc 0x3 0x1 - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xa, 0x0, 0xa, 0x38, 0xfffc, 0x3, 0x1 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xffec 0x0 0xffec 0x38 0xfffc 0x5 0x1 - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xffec, 0x0, 0xffec, 0x38, 0xfffc, 0x5, 0x1 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xf 0x0 0xf 0x38 0x4 0x4 0x1 - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xf, 0x0, 0xf, 0x38, 0x4, 0x4, 0x1 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0xffec 0x0 0xffec 0x38 0x4 0x4 0x1 - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xffec, 0x0, 0xffec, 0x38, 0x4, 0x4, 0x1 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 - launchtemplate gShellTrapFireHitsTemplate 0x28 0x8 0x0 0x14 0x0 0x14 0x38 0x4 0x4 0x1 - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x0003 0x0000 0x0006 0x0001 + createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0x14, 0x0, 0x14, 0x38, 0x4, 0x4, 0x1 + createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 return @@ -14003,11 +13999,12 @@ Move_STRANGE_STEAM:: clearmonbg ANIM_DEF_PARTNER end StrangeSteamCloud: - launchtemplate gStrangeSteamPinkCloudTemplate 0x82 0x5 0xf 0xf 0x14 0x0 0x0 - launchtemplate gStrangeSteamGreenCloudTemplate 0x82 0x5 0xf 0xf 0x14 0xa 0x5 - launchtemplate gStrangeSteamPinkCloudTemplate 0x82 0x5 0xf 0xf 0x14 0xfff6 0xfffb - launchtemplate gStrangeSteamGreenCloudTemplate 0x82 0x5 0xf 0xf 0x14 0x14 0xa - launchtemplate gStrangeSteamBlueCloudTemplate 0x82 0x5 0xf 0xf 0x14 0xffec 0xfff6 + createsprite gStrangeSteamPinkCloudTemplate, ANIM_TARGET, 2, 0xf, 0xf, 0x14, 0, 0 + createsprite gStrangeSteamGreenCloudTemplate, ANIM_TARGET, 2, 0xf, 0xf, 0x14, 0xa, 0x5 + createsprite gStrangeSteamPinkCloudTemplate, ANIM_TARGET, 2, 0xf, 0xf, 0x14, 0xfff6, 0xfffb + delay 0x1 + createsprite gStrangeSteamGreenCloudTemplate, ANIM_TARGET, 2, 0xf, 0xf, 0x14, 0x14, 0xa + createsprite gStrangeSteamBlueCloudTemplate, ANIM_TARGET, 2, 0xf, 0xf, 0x14, 0xffec, 0xfff6 delay 0x2 return @@ -14371,6 +14368,21 @@ Move_SCORCHING_SANDS:: Move_JUNGLE_HEALING:: goto Move_AROMATHERAPY +Move_SILK_TRAP:: + loadspritegfx ANIM_TAG_PROTECT + loadspritegfx ANIM_TAG_SPIDER_WEB + splitbgprio ANIM_ATTACKER + playsewithpan SE_M_STRING_SHOT2, SOUND_PAN_TARGET + createsprite gSpiderWebSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, FALSE + waitforvisualfinish + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_PROTECT, 0, 10, 10, RGB_LIME_GREEN + monbg ANIM_ATK_PARTNER + waitplaysewithpan SE_M_REFLECT, SOUND_PAN_ATTACKER, 0x10 + createsprite gProtectSpriteTemplate, ANIM_ATTACKER, 2, 24, 0, 90 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + end + Move_WICKED_BLOW:: Move_SURGING_STRIKES:: Move_THUNDER_CAGE:: @@ -14406,7 +14418,6 @@ Move_SANDSEAR_STORM:: Move_LUNAR_BLESSING:: Move_TAKE_HEART:: Move_TERA_BLAST:: -Move_SILK_TRAP:: Move_AXE_KICK:: Move_LAST_RESPECTS:: Move_LUMINA_CRASH:: @@ -21119,7 +21130,11 @@ Move_POISON_GAS: createsprite gPoisonGasCloudSpriteTemplate, ANIM_TARGET, 0, 64, 0, 0, -32, -6, 4192, 1072, 0 delay 40 loopsewithpan SE_M_MIST, SOUND_PAN_TARGET, 28, 6 +.if B_UPDATED_MOVE_DATA >= GEN_5 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_DEF_SIDE, 6, 2, 0, 12, RGB(26, 0, 26) +.else createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 6, 2, 0, 12, RGB(26, 0, 26) +.endif waitforvisualfinish blendoff clearmonbg ANIM_DEF_PARTNER @@ -23357,15 +23372,15 @@ Move_OVERHEAT: waitforvisualfinish createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, -5, 3, ANIM_TARGET, 0 playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 10, 0, 25, 1 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 10, 0, 25, 1 delay 6 - createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 8, -5, ANIM_TARGET, 0 + createspriteontargets gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 2, 8, -5, ANIM_TARGET, 0 playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET delay 8 - createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 10, 10, ANIM_TARGET, 0 + createspriteontargets gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 2, 10, 10, ANIM_TARGET, 0 playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET delay 8 - createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0, 0, ANIM_TARGET, 0 + createspriteontargets gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 2, 0, 0, ANIM_TARGET, 0 playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET createvisualtask AnimTask_CopyPalFadedToUnfaded, 5, 1 delay 1 @@ -24208,6 +24223,25 @@ ElectricityEffectNoSound: createsprite gElectricitySpriteTemplate, ANIM_TARGET, 2, -20, 15, 5, 1, ANIM_TARGET return +ElectricityEffect_OnTargets: + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET + createspriteontargets gElectricitySpriteTemplate, ANIM_TARGET, 2, 4, 5, 0, 5, 0, ANIM_TARGET + delay 2 + createspriteontargets gElectricitySpriteTemplate, ANIM_TARGET, 2, 4, -5, 10, 5, 1, ANIM_TARGET + delay 2 + createspriteontargets gElectricitySpriteTemplate, ANIM_TARGET, 2, 4, 15, 20, 5, 2, ANIM_TARGET + delay 2 + createspriteontargets gElectricitySpriteTemplate, ANIM_TARGET, 2, 4, -15, -10, 5, 0, ANIM_TARGET + delay 2 + createspriteontargets gElectricitySpriteTemplate, ANIM_TARGET, 2, 4, 25, 0, 5, 1, ANIM_TARGET + delay 2 + createspriteontargets gElectricitySpriteTemplate, ANIM_TARGET, 2, 4, -8, 8, 5, 2, ANIM_TARGET + delay 2 + createspriteontargets gElectricitySpriteTemplate, ANIM_TARGET, 2, 4, 2, -8, 5, 0, ANIM_TARGET + delay 2 + createspriteontargets gElectricitySpriteTemplate, ANIM_TARGET, 2, 4, -20, 15, 5, 1, ANIM_TARGET + return + ConfusionEffect: loopsewithpan SE_M_DIZZY_PUNCH, SOUND_PAN_TARGET, 13, 6 createsprite gConfusionDuckSpriteTemplate, ANIM_TARGET, 2, 0, -15, 0, 3, 90 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 1064bb128..70730d2a9 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -250,7 +250,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_GYRO_BALL .4byte BattleScript_EffectHit @ EFFECT_ECHOED_VOICE .4byte BattleScript_EffectHit @ EFFECT_PAYBACK - .4byte BattleScript_EffectHit @ EFFECT_ROUND + .4byte BattleScript_EffectRound @ EFFECT_ROUND .4byte BattleScript_EffectHit @ EFFECT_BRINE .4byte BattleScript_EffectHit @ EFFECT_VENOSHOCK .4byte BattleScript_EffectHit @ EFFECT_RETALIATE @@ -416,6 +416,8 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectSpecialAttackUpHit @ EFFECT_SPECIAL_ATTACK_UP_HIT .4byte BattleScript_EffectVictoryDance @ EFFECT_VICTORY_DANCE .4byte BattleScript_EffectTeatime @ EFFECT_TEATIME + .4byte BattleScript_EffectAttackUpUserAlly @ EFFECT_ATTACK_UP_USER_ALLY + .4byte BattleScript_EffectShellTrap @ EFFECT_SHELL_TRAP .4byte BattleScript_EffectCeaselessEdge @ EFFECT_CEASELESS_EDGE .4byte BattleScript_EffectDireClaw @ EFFECT_DIRE_CLAW .4byte BattleScript_EffectStoneAxe @ EFFECT_STONE_AXE @@ -487,6 +489,43 @@ BattleScript_SpikesActivate:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_EffectAttackUpUserAlly: + jumpifnoally BS_ATTACKER, BattleScript_EffectAttackUp + attackcanceler + attackstring + ppreduce + jumpifstat BS_ATTACKER, CMP_NOT_EQUAL, STAT_ATK, MAX_STAT_STAGE, BattleScript_EffectAttackUpUserAlly_Works + jumpifstat BS_ATTACKER_PARTNER, CMP_EQUAL, STAT_ATK, MAX_STAT_STAGE, BattleScript_ButItFailed +BattleScript_EffectAttackUpUserAlly_Works: + attackanimation + waitanimation + setstatchanger STAT_ATK, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_EffectAttackUpUserAlly_TryAlly + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectAttackUpUserAllyUser_PrintString + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 +BattleScript_EffectAttackUpUserAllyUser_PrintString: + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_EffectAttackUpUserAlly_TryAlly: + setallytonexttarget BattleScript_EffectAttackUpUserAlly_TryAlly_ +BattleScript_EffectAttackUpUserAlly_End: + goto BattleScript_MoveEnd +BattleScript_EffectAttackUpUserAlly_TryAlly_: + 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 + pause B_WAIT_TIME_SHORTEST + printstring STRINGID_TARGETSTATWONTGOHIGHER + waitmessage B_WAIT_TIME_LONG + goto BattleScript_EffectAttackUpUserAlly_End +BattleScript_EffectAttackUpUserAlly_AllyAnim: + setgraphicalstatchangevalues + playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_EffectAttackUpUserAlly_Ends + BattleScript_EffectTeatime:: attackcanceler attackstring @@ -589,6 +628,23 @@ BattleScript_AffectionBasedStatusHeal_Continue: waitstate end2 +BattleScript_ShellTrapSetUp:: + printstring STRINGID_EMPTYSTRING3 + waitmessage 0x1 + playanimation BS_ATTACKER, B_ANIM_SHELL_TRAP_SETUP, NULL + printstring STRINGID_PREPARESHELLTRAP + waitmessage B_WAIT_TIME_LONG + end2 + +BattleScript_EffectShellTrap:: + attackcanceler + jumpifshelltrap BS_ATTACKER, BattleScript_HitFromAccCheck + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING | HITMARKER_NO_PPDEDUCT, BattleScript_MoveEnd + ppreduce + printstring STRINGID_SHELLTRAPDIDNTWORK + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + BattleScript_EffectSteelBeam:: attackcanceler attackstring @@ -1353,8 +1409,12 @@ BattleScript_JungleHealingTryRestoreAlly: goto BattleScript_MoveEnd BattleScript_EffectAttackerDefenseDownHit: + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING | HITMARKER_NO_PPDEDUCT, BattleScript_NoMoveEffect setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN goto BattleScript_EffectHit +BattleScript_NoMoveEffect: + setmoveeffect 0 + goto BattleScript_EffectHit BattleScript_EffectRelicSong: setmoveeffect MOVE_EFFECT_RELIC_SONG | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN @@ -1438,7 +1498,7 @@ BattleScript_DoubleShockRemoveType:: printstring STRINGID_ATTACKERLOSTELECTRICTYPE waitmessage B_WAIT_TIME_LONG return - + BattleScript_EffectPurify: attackcanceler attackstring @@ -2156,9 +2216,14 @@ BattleScript_EffectHitSwitchTarget: moveendall jumpifability BS_TARGET, ABILITY_SUCTION_CUPS, BattleScript_AbilityPreventsPhasingOut jumpifstatus3 BS_TARGET, STATUS3_ROOTED, BattleScript_PrintMonIsRooted - tryhitswitchtarget BattleScript_EffectHitSwitchTargetMoveEnd -BattleScript_EffectHitSwitchTargetMoveEnd: - end + tryhitswitchtarget BattleScript_MoveEnd + forcerandomswitch BattleScript_HitSwitchTargetForceRandomSwitchFailed + goto BattleScript_MoveEnd + +BattleScript_HitSwitchTargetForceRandomSwitchFailed: + hitswitchtargetfailed + setbyte sSWITCH_CASE, B_SWITCH_NORMAL + goto BattleScript_MoveEnd BattleScript_EffectClearSmog: setmoveeffect MOVE_EFFECT_CLEAR_SMOG @@ -2725,6 +2790,8 @@ BattleScript_EffectHealingWish: instanthpdrop BS_ATTACKER setatkhptozero tryfaintmon BS_ATTACKER + storehealingwish BS_ATTACKER +.if B_HEALING_WISH_SWITCH <= GEN_4 openpartyscreen BS_ATTACKER, BattleScript_EffectHealingWishEnd switchoutabilities BS_ATTACKER waitstate @@ -2739,11 +2806,19 @@ BattleScript_EffectHealingWish: printstring STRINGID_SWITCHINMON switchinanim BS_ATTACKER, TRUE waitstate + switchineffects BS_ATTACKER +.endif +BattleScript_EffectHealingWishEnd: + moveendall + end + +BattleScript_HealingWishActivates:: setbyte cMULTISTRING_CHOOSER, 0 - jumpifnotchosenmove MOVE_LUNAR_DANCE, BattleScript_EffectHealingWishNewMon + goto BattleScript_EffectHealingWishRestore +BattleScript_LunarDanceActivates:: setbyte cMULTISTRING_CHOOSER, 1 restorepp BS_ATTACKER -BattleScript_EffectHealingWishNewMon: +BattleScript_EffectHealingWishRestore: printfromtable gHealingWishStringIds waitmessage B_WAIT_TIME_LONG playanimation BS_ATTACKER, B_ANIM_WISH_HEAL @@ -2758,10 +2833,7 @@ BattleScript_EffectHealingWishNewMon: waitstate printstring STRINGID_HEALINGWISHHEALED waitmessage B_WAIT_TIME_LONG - switchineffects BS_ATTACKER -BattleScript_EffectHealingWishEnd: - moveendall - end + return BattleScript_EffectWorrySeed: attackcanceler @@ -3125,7 +3197,7 @@ BattleScript_EffectHitEscape: jumpifbyte CMP_NOT_EQUAL gBattleOutcome 0, BattleScript_HitEscapeEnd jumpifbattletype BATTLE_TYPE_ARENA, BattleScript_HitEscapeEnd jumpifcantswitch SWITCH_IGNORE_ESCAPE_PREVENTION | BS_ATTACKER, BattleScript_HitEscapeEnd - jumpifemergencyexited BS_TARGET, BattleScript_HitEscapeEnd + jumpifemergencyexited BS_TARGET, BattleScript_HitEscapeEnd openpartyscreen BS_ATTACKER, BattleScript_HitEscapeEnd switchoutabilities BS_ATTACKER waitstate @@ -3152,6 +3224,10 @@ BattleScript_EffectPlaceholder: printstring STRINGID_NOTDONEYET goto BattleScript_MoveEnd +BattleScript_EffectRound: + setmoveeffect MOVE_EFFECT_ROUND + goto BattleScript_EffectHit + BattleScript_EffectHit:: BattleScript_HitFromAtkCanceler:: attackcanceler @@ -3237,13 +3313,15 @@ BattleScript_EffectSleep:: ppreduce jumpifsubstituteblocks BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_SLEEP, BattleScript_AlreadyAsleep - jumpifcantmakeasleep BattleScript_CantMakeAsleep - jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects - jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_LeafGuardProtects + jumpifuproarwakes BattleScript_CantMakeAsleep + jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects + jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_AbilityProtectsDoesntAffect + jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_AbilityProtectsDoesntAffect jumpifflowerveil BattleScript_FlowerVeilProtects jumpifability BS_TARGET_SIDE, ABILITY_SWEET_VEIL, BattleScript_SweetVeilProtects - jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects - jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_AbilityProtectsDoesntAffect + jumpifshieldsdown BS_TARGET, BattleScript_AbilityProtectsDoesntAffect jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifterrainaffected BS_TARGET, STATUS_FIELD_ELECTRIC_TERRAIN, BattleScript_ElectricTerrainPrevents jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents @@ -3323,15 +3401,23 @@ BattleScript_PastelVeilProtects: orhalfword gMoveResultFlags, MOVE_RESULT_FAILED goto BattleScript_MoveEnd -BattleScript_LeafGuardProtectsRet:: +BattleScript_AbilityProtectsDoesntAffectRet:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp printstring STRINGID_ITDOESNTAFFECT waitmessage B_WAIT_TIME_LONG return -BattleScript_LeafGuardProtects: - call BattleScript_LeafGuardProtectsRet +BattleScript_AbilityProtectsDoesntAffect: + call BattleScript_AbilityProtectsDoesntAffectRet + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + +BattleScript_InsomniaProtects: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSTAYEDAWAKEUSING + waitmessage B_WAIT_TIME_LONG orhalfword gMoveResultFlags, MOVE_RESULT_FAILED goto BattleScript_MoveEnd @@ -3421,26 +3507,19 @@ BattleScript_EffectParalyzeHit:: setmoveeffect MOVE_EFFECT_PARALYSIS goto BattleScript_EffectHit -BattleScript_EffectExplosion:: - attackcanceler - attackstring - ppreduce -@ Below jumps to BattleScript_DampStopsExplosion if it fails (only way it can) - tryexplosion - setatkhptozero - waitstate - jumpifbyte CMP_NO_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_MISSED, BattleScript_ExplosionDoAnimStartLoop +BattleScript_EffectExplosion_AnimDmgRet: + jumpifbyte CMP_NO_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_MISSED, BattleScript_ExplosionAnimRet call BattleScript_PreserveMissedBitDoMoveAnim - goto BattleScript_ExplosionLoop -BattleScript_ExplosionDoAnimStartLoop: + goto BattleScript_ExplosionDmgRet +BattleScript_ExplosionAnimRet: attackanimation waitanimation -BattleScript_ExplosionLoop: +BattleScript_ExplosionDmgRet: movevaluescleanup critcalc damagecalc adjustdamage - accuracycheck BattleScript_ExplosionMissed, ACC_CURR_MOVE + accuracycheck BattleScript_ExplosionMissedRet, ACC_CURR_MOVE effectivenesssound hitanimation BS_TARGET waitstate @@ -3451,17 +3530,25 @@ BattleScript_ExplosionLoop: resultmessage waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET - moveendto MOVEEND_NEXT_TARGET - jumpifnexttargetvalid BattleScript_ExplosionLoop - tryfaintmon BS_ATTACKER - moveendcase MOVEEND_CLEAR_BITS - end -BattleScript_ExplosionMissed: +BattleScript_ExplosionAnimEndRet_Return: + return +BattleScript_ExplosionMissedRet: effectivenesssound resultmessage waitmessage B_WAIT_TIME_LONG - moveendto MOVEEND_NEXT_TARGET - jumpifnexttargetvalid BattleScript_ExplosionLoop + goto BattleScript_ExplosionAnimEndRet_Return + +BattleScript_EffectExplosion:: + attackcanceler + attackstring + ppreduce +@ Below jumps to BattleScript_DampStopsExplosion if it fails (only way it can) + tryexplosion + waitstate +BattleScript_EffectExplosion_AnimDmgFaintAttacker: + call BattleScript_EffectExplosion_AnimDmgRet + moveendall + setatkhptozero tryfaintmon BS_ATTACKER end @@ -3469,14 +3556,28 @@ BattleScript_EffectMindBlown:: attackcanceler attackstring ppreduce - tryexplosion + jumpifbyte CMP_GREATER_THAN, sB_ANIM_TARGETS_HIT, 0, BattleScript_EffectMindBlown_NoHpLoss + jumpifabilitypresent ABILITY_DAMP, BattleScript_MindBlownDamp + jumpifmorethanhalfHP BS_ATTACKER, BattleScript_EffectMindBlown_HpDown + setbyte sMULTIHIT_EFFECT, 0 @ Note to faint the attacker + instanthpdrop BS_ATTACKER + waitstate + goto BattleScript_EffectExplosion_AnimDmgFaintAttacker +BattleScript_EffectMindBlown_NoHpLoss: + jumpifbyte CMP_EQUAL, sMULTIHIT_EFFECT, 0, BattleScript_EffectExplosion_AnimDmgFaintAttacker + goto BattleScript_EffectMindBlown_AnimDmgNoFaint +BattleScript_MindBlownDamp: + copybyte gBattlerTarget, gBattlerAbility + goto BattleScript_DampStopsExplosion +BattleScript_EffectMindBlown_HpDown: + setbyte sMULTIHIT_EFFECT, 1 @ Note to not faint the attacker dmg_1_2_attackerhp healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER waitstate - jumpifbyte CMP_NO_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_MISSED, BattleScript_ExplosionDoAnimStartLoop - call BattleScript_PreserveMissedBitDoMoveAnim - goto BattleScript_ExplosionLoop +BattleScript_EffectMindBlown_AnimDmgNoFaint: + call BattleScript_EffectExplosion_AnimDmgRet + goto BattleScript_MoveEnd BattleScript_PreserveMissedBitDoMoveAnim: bichalfword gMoveResultFlags, MOVE_RESULT_MISSED @@ -3645,7 +3746,7 @@ BattleScript_MirrorArmorReflect:: call BattleScript_AbilityPopUp jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss BattleScript_MirrorArmorReflectStatLoss: - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_MIRROR_ARMOR | STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim goto BattleScript_MirrorArmorReflectWontFall BattleScript_MirrorArmorReflectAnim: @@ -3716,7 +3817,6 @@ BattleScript_EffectRoar:: accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON accuracycheck BattleScript_MoveMissedPause, ACC_CURR_MOVE jumpifbattletype BATTLE_TYPE_ARENA, BattleScript_ButItFailed -BattleScript_ForceRandomSwitch:: forcerandomswitch BattleScript_ButItFailed BattleScript_EffectMultiHit:: @@ -3834,12 +3934,12 @@ BattleScript_EffectToxic:: attackstring ppreduce jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected - jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects - jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_LeafGuardProtects + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_AbilityProtectsDoesntAffect + jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_AbilityProtectsDoesntAffect jumpifability BS_TARGET_SIDE, ABILITY_PASTEL_VEIL, BattleScript_PastelVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects - jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_AbilityProtectsDoesntAffect + jumpifshieldsdown BS_TARGET, BattleScript_AbilityProtectsDoesntAffect jumpifsubstituteblocks BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_AlreadyPoisoned jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed @@ -3897,7 +3997,9 @@ BattleScript_EffectRest:: ppreduce jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_RestIsAlreadyAsleep jumpifability BS_ATTACKER, ABILITY_COMATOSE, BattleScript_RestIsAlreadyAsleep - jumpifcantmakeasleep BattleScript_RestCantSleep + jumpifuproarwakes BattleScript_RestCantSleep + jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects + jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects trysetrest BattleScript_AlreadyAtFullHp pause B_WAIT_TIME_SHORT printfromtable gRestUsedStringIds @@ -4173,12 +4275,12 @@ BattleScript_EffectPoison:: attackstring ppreduce jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected - jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects - jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_LeafGuardProtects + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_AbilityProtectsDoesntAffect + jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_AbilityProtectsDoesntAffect jumpifability BS_TARGET_SIDE, ABILITY_PASTEL_VEIL, BattleScript_PastelVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects - jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_AbilityProtectsDoesntAffect + jumpifshieldsdown BS_TARGET, BattleScript_AbilityProtectsDoesntAffect jumpifsubstituteblocks BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_POISON, BattleScript_AlreadyPoisoned jumpifstatus BS_TARGET, STATUS1_TOXIC_POISON, BattleScript_AlreadyPoisoned @@ -4200,16 +4302,17 @@ BattleScript_EffectParalyze: attackstring ppreduce jumpifability BS_TARGET, ABILITY_LIMBER, BattleScript_LimberProtected - jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects - jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_LeafGuardProtects + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_AbilityProtectsDoesntAffect + jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_AbilityProtectsDoesntAffect jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects - jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_AbilityProtectsDoesntAffect + jumpifshieldsdown BS_TARGET, BattleScript_AbilityProtectsDoesntAffect jumpifsubstituteblocks BattleScript_ButItFailed typecalc BattleScript_BattleScript_EffectParalyzeNoTypeCalc: jumpifmovehadnoeffect BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_PARALYSIS, BattleScript_AlreadyParalyzed + jumpifabsorbaffected BS_TARGET, BattleScript_VoltAbsorbHeal tryparalyzetype BS_ATTACKER, BS_TARGET, BattleScript_NotAffected jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents @@ -4224,6 +4327,11 @@ BattleScript_BattleScript_EffectParalyzeNoTypeCalc: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_VoltAbsorbHeal: + copybyte gBattlerAbility, gBattlerTarget + tryhealquarterhealth BS_TARGET BattleScript_MonMadeMoveUseless @ Check if max hp + goto BattleScript_MoveHPDrain + BattleScript_AlreadyParalyzed: setalreadystatusedmoveattempt BS_ATTACKER pause B_WAIT_TIME_SHORT @@ -5630,11 +5738,11 @@ BattleScript_EffectWillOWisp:: jumpiftype BS_TARGET, TYPE_FIRE, BattleScript_NotAffected jumpifability BS_TARGET, ABILITY_WATER_VEIL, BattleScript_WaterVeilPrevents jumpifability BS_TARGET, ABILITY_WATER_BUBBLE, BattleScript_WaterVeilPrevents - jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects - jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_LeafGuardProtects + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_AbilityProtectsDoesntAffect + jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_AbilityProtectsDoesntAffect jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects - jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_AbilityProtectsDoesntAffect + jumpifshieldsdown BS_TARGET, BattleScript_AbilityProtectsDoesntAffect jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE @@ -5726,6 +5834,9 @@ BattleScript_EffectFollowMe:: attackcanceler attackstring ppreduce + .if B_UPDATED_MOVE_DATA >= GEN_6 + jumpifnotbattletype BATTLE_TYPE_DOUBLE, BattleScript_ButItFailed + .endif setforcedtarget attackanimation waitanimation @@ -5921,27 +6032,28 @@ BattleScript_EffectYawn:: attackcanceler attackstring ppreduce - jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_PrintBankAbilityMadeIneffective - jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective - jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBankAbilityMadeIneffective - jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_LeafGuardProtects + jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_PrintBattlerAbilityMadeIneffective + jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBattlerAbilityMadeIneffective + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBattlerAbilityMadeIneffective + jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_AbilityProtectsDoesntAffect jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects - jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_AbilityProtectsDoesntAffect + jumpifshieldsdown BS_TARGET, BattleScript_AbilityProtectsDoesntAffect jumpifsubstituteblocks BattleScript_ButItFailed jumpifsafeguard BattleScript_SafeguardProtected accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON - jumpifcantmakeasleep BattleScript_ButItFailed + jumpifuproarwakes BattleScript_ButItFailed setyawn BattleScript_ButItFailed attackanimation waitanimation printstring STRINGID_PKMNWASMADEDROWSY waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_PrintBankAbilityMadeIneffective:: +BattleScript_PrintBattlerAbilityMadeIneffective:: copybyte sBATTLER, gBattlerAbility BattleScript_PrintAbilityMadeIneffective:: pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp printstring STRINGID_PKMNSXMADEITINEFFECTIVE waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd @@ -7691,6 +7803,9 @@ BattleScript_MagicCoatBounce:: attackstring ppreduce pause B_WAIT_TIME_SHORT + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0, BattleScript_MagicCoatBounce_Print + call BattleScript_AbilityPopUp +BattleScript_MagicCoatBounce_Print: printfromtable gMagicCoatBounceStringIds waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_ALLOW_NO_PP @@ -7966,6 +8081,16 @@ BattleScript_AftermathDmg:: tryfaintmon BS_ATTACKER return +BattleScript_DampPreventsAftermath:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + pause 40 + copybyte gBattlerAbility, sBATTLER + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSABILITYPREVENTSABILITY + waitmessage B_WAIT_TIME_LONG + return + BattleScript_MoveUsedIsAsleep:: printstring STRINGID_PKMNFASTASLEEP waitmessage B_WAIT_TIME_LONG @@ -8339,9 +8464,9 @@ BattleScript_AbilityRaisesDefenderStat:: BattleScript_AbilityPopUp: .if B_ABILITY_POP_UP == TRUE showabilitypopup BS_ABILITY_BATTLER - recordability BS_ABILITY_BATTLER pause 40 .endif + recordability BS_ABILITY_BATTLER sethword sABILITY_OVERWRITE, 0 return @@ -8552,7 +8677,6 @@ BattleScript_TryAdrenalineOrbRet: return BattleScript_IntimidateActivates:: - jumpifnovalidtargets BattleScript_IntimidateEnd showabilitypopup BS_ATTACKER pause B_WAIT_TIME_LONG destroyabilitypopup @@ -9111,16 +9235,6 @@ BattleScript_BattlerAbilityStatRaiseOnSwitchIn:: waitmessage B_WAIT_TIME_LONG end3 -BattleScript_TargetAbilityStatRaiseOnMoveEnd:: - call BattleScript_AbilityPopUp - statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, NULL - setgraphicalstatchangevalues - playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 - waitanimation - printstring STRINGID_ABILITYRAISEDSTATDRASTICALLY - waitmessage B_WAIT_TIME_LONG - return - BattleScript_ScriptingAbilityStatRaise:: copybyte gBattlerAbility, sBATTLER call BattleScript_AbilityPopUp @@ -10287,3 +10401,8 @@ BattleScript_PokemonCantUseTheMove:: printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd + +BattleScript_CouldntFullyProtect:: + printstring STRINGID_COULDNTFULLYPROTECT + waitmessage B_WAIT_TIME_LONG + return diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index 9b26cbd0d..21a12d886 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -192,16 +192,30 @@ BattleScript_ActionWallyThrow: waitmessage B_WAIT_TIME_LONG end2 -BattleScript_TrainerSlideMsgRet:: +BattleScript_TrainerASlideMsgRet:: handletrainerslidemsg BS_SCRIPTING, 0 - trainerslidein 1 + trainerslidein B_POSITION_OPPONENT_LEFT handletrainerslidemsg BS_SCRIPTING, 1 waitstate - trainerslideout 1 - handletrainerslidemsg BS_SCRIPTING, 2 + trainerslideout B_POSITION_OPPONENT_LEFT waitstate + handletrainerslidemsg BS_SCRIPTING, 2 return -BattleScript_TrainerSlideMsgEnd2:: - call BattleScript_TrainerSlideMsgRet +BattleScript_TrainerASlideMsgEnd2:: + call BattleScript_TrainerASlideMsgRet + end2 + +BattleScript_TrainerBSlideMsgRet:: + handletrainerslidemsg BS_SCRIPTING, 0 + trainerslidein B_POSITION_OPPONENT_RIGHT + handletrainerslidemsg BS_SCRIPTING, 1 + waitstate + trainerslideout B_POSITION_OPPONENT_RIGHT + waitstate + handletrainerslidemsg BS_SCRIPTING, 2 + return + +BattleScript_TrainerBSlideMsgEnd2:: + call BattleScript_TrainerBSlideMsgRet end2 diff --git a/data/maps/BirthIsland_Exterior/scripts.inc b/data/maps/BirthIsland_Exterior/scripts.inc index 68d3124d9..d2174eee9 100644 --- a/data/maps/BirthIsland_Exterior/scripts.inc +++ b/data/maps/BirthIsland_Exterior/scripts.inc @@ -48,21 +48,24 @@ BirthIsland_Exterior_EventScript_Triangle:: special DoDeoxysRockInteraction waitstate switch VAR_RESULT - case 0, BirthIsland_Exterior_EventScript_NotSolved1 - case 1, BirthIsland_Exterior_EventScript_NotSolved2 - case 2, BirthIsland_Exterior_EventScript_Deoxys - case 3, BirthIsland_Exterior_EventScript_NotSolved3 + case DEOXYS_ROCK_FAILED, BirthIsland_Exterior_EventScript_Failed + case DEOXYS_ROCK_PROGRESSED, BirthIsland_Exterior_EventScript_Progressed + case DEOXYS_ROCK_SOLVED, BirthIsland_Exterior_EventScript_Deoxys + case DEOXYS_ROCK_COMPLETE, BirthIsland_Exterior_EventScript_Complete end -BirthIsland_Exterior_EventScript_NotSolved1:: +@ The actual rock triangle movement is handled by DoDeoxysRockInteraction. +@ Unless the player has solved the puzzle and needs to encounter Deoxys, +@ there's nothing else the script needs to do. +BirthIsland_Exterior_EventScript_Failed:: release end -BirthIsland_Exterior_EventScript_NotSolved2:: +BirthIsland_Exterior_EventScript_Progressed:: release end -BirthIsland_Exterior_EventScript_NotSolved3:: +BirthIsland_Exterior_EventScript_Complete:: release end diff --git a/data/maps/PetalburgCity/scripts.inc b/data/maps/PetalburgCity/scripts.inc index 3609b2622..a9dd1014f 100644 --- a/data/maps/PetalburgCity/scripts.inc +++ b/data/maps/PetalburgCity/scripts.inc @@ -38,7 +38,7 @@ PetalburgCity_OnFrame: PetalburgCity_EventScript_WallyTutorial:: lockall special SavePlayerParty - special PutZigzagoonInPlayerParty + special LoadWallyZigzagoon applymovement LOCALID_WALLY, PetalburgCity_Movement_WallyTutorialWally applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_WallyTutorialPlayer waitmovement 0 diff --git a/data/specials.inc b/data/specials.inc index 9c336b376..8e81ff847 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -311,7 +311,7 @@ gSpecials:: def_special TryUpdateRusturfTunnelState def_special IsGrassTypeInParty def_special DoContestHallWarp - def_special PutZigzagoonInPlayerParty + def_special LoadWallyZigzagoon def_special IsStarterInParty def_special CopyCurSecretBaseOwnerName_StrVar1 def_special ScriptCheckFreePokemonStorageSpace diff --git a/gflib/window.c b/gflib/window.c index ff9e8a6e0..1621a0884 100644 --- a/gflib/window.c +++ b/gflib/window.c @@ -4,11 +4,8 @@ #include "bg.h" #include "blit.h" -u32 gUnusedWindowVar1; -u32 gUnusedWindowVar2; // This global is set to 0 and never changed. u8 gTransparentTileNumber; -u32 gUnusedWindowVar3; void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS]; extern u32 gWindowTileAutoAllocEnabled; diff --git a/gflib/window.h b/gflib/window.h index 583e7e167..0000dd864 100644 --- a/gflib/window.h +++ b/gflib/window.h @@ -74,8 +74,5 @@ void CopyWindowToVram8Bit(u8 windowId, u8 mode); extern struct Window gWindows[]; extern void *gWindowBgTilemapBuffers[]; -extern u32 gUnusedWindowVar1; -extern u32 gUnusedWindowVar2; -extern u32 gUnusedWindowVar3; #endif // GUARD_WINDOW_H diff --git a/graphics/battle_anims/backgrounds/giga_impact_contest.bin b/graphics/battle_anims/backgrounds/giga_impact_contest.bin index 03c709bb9..ce383cf24 100644 --- a/graphics/battle_anims/backgrounds/giga_impact_contest.bin +++ b/graphics/battle_anims/backgrounds/giga_impact_contest.bin @@ -1,3 +1,3 @@ -$$$$$$$$$ D!E!F!G!H!I!@!$$$$$$$$$ $$$$$$$$$ -! ! ! !!!!$$$$$$$$$ !!!!!!!$$$$$$$$$ *!+!,!-!.!/!"!$$$$$$$$$ :!;!!?!2!$$$$$$$$$ J!K!L!M!N!O!B!,,,,,,,,,((((((((((((((((J)K)L)M)N)O)B),,,,,,,,,((((((((((((((((:);)<)=)>)?)2),,,,,,,,,((((((((((((((((*)+),)-).)/)"),,,,,,,,,(((((((((((((((())))))),,,,,,,,,(((((((((((((((( -) ) ) )))),,,,,,,,,(((((((((((((((((((((((,,,,,,,,,((((((((((((((((D)E)F)G)H)I)@) \ No newline at end of file +         $$ $$$$$ +             $$ $$$$$        ! " # $ % & ' (  ) * + , ,$+$*$)$ ($'$&$%$- . / 0 1 2 3 4 5 6 7 8 9 : ; < = > >$=$<$;$:$9$8$7$6$ ? @ A B C D E E F F$E E D$C$B$A$@$?$G H I J K L M N O P Q E E E E Q$P$O$N$M$L$K$R S T U V W X Y Z [ \ ] ^ _ ` a b E E E E E E E E b$a$`$_$^$ c d e f g h i j k ^(_(`(a(b(E E E E E E E E b,a,`,_,^, c(d(e(f(g(h(i(j(k( K(L(M(N(O(P(Q(E E E E Q,P,O,N,M,L,K,R(S(T( U(V(W(X(Y(Z([(\(](?(@(A(B(C(D(E E F(F,E E D,C,B,A,@,?,G(H(I(J( 6(7(8(9(:(;(<(=(>(>,=,<,;,:,9,8,7,6, %(&('((( )(*(+(,(,,+,*,), (,',&,%,-(.( /(0(1( 2(3(4(5( ((((( ((,, ,,,,, ((( (((( ( !("(#($( ((((( ((,, ,,,,, +( ( ( (( (( \ No newline at end of file diff --git a/graphics/battle_anims/backgrounds/giga_impact_contest.png b/graphics/battle_anims/backgrounds/giga_impact_contest.png new file mode 100644 index 000000000..80698b8d8 Binary files /dev/null and b/graphics/battle_anims/backgrounds/giga_impact_contest.png differ diff --git a/graphics/battle_anims/sprites/new/teapot.png b/graphics/battle_anims/sprites/new/teapot.png index 6be0680df..0e2660641 100644 Binary files a/graphics/battle_anims/sprites/new/teapot.png and b/graphics/battle_anims/sprites/new/teapot.png differ diff --git a/graphics/battle_anims/sprites/omega_symbol.png b/graphics/battle_anims/sprites/omega_symbol.png index a821d5e40..150501367 100644 Binary files a/graphics/battle_anims/sprites/omega_symbol.png and b/graphics/battle_anims/sprites/omega_symbol.png differ diff --git a/graphics/battle_interface/alpha_indicator.png b/graphics/battle_interface/alpha_indicator.png index 0e302576b..66f37f1d3 100644 Binary files a/graphics/battle_interface/alpha_indicator.png and b/graphics/battle_interface/alpha_indicator.png differ diff --git a/graphics/battle_interface/omega_indicator.png b/graphics/battle_interface/omega_indicator.png index c56d51c15..f321fc826 100644 Binary files a/graphics/battle_interface/omega_indicator.png and b/graphics/battle_interface/omega_indicator.png differ diff --git a/graphics/battle_interface/z_move_trigger.png b/graphics/battle_interface/z_move_trigger.png index 5e27dbabb..d719494d9 100644 Binary files a/graphics/battle_interface/z_move_trigger.png and b/graphics/battle_interface/z_move_trigger.png differ diff --git a/graphics/berries/babiri.png b/graphics/berries/babiri.png index 056353bab..bd9222899 100644 Binary files a/graphics/berries/babiri.png and b/graphics/berries/babiri.png differ diff --git a/graphics/berries/charti.png b/graphics/berries/charti.png index 9f119ebac..399cd626e 100644 Binary files a/graphics/berries/charti.png and b/graphics/berries/charti.png differ diff --git a/graphics/berries/chilan.png b/graphics/berries/chilan.png index 8f717bb82..286ed5c3f 100644 Binary files a/graphics/berries/chilan.png and b/graphics/berries/chilan.png differ diff --git a/graphics/berries/chople.png b/graphics/berries/chople.png index 0b4b28014..345eae24b 100644 Binary files a/graphics/berries/chople.png and b/graphics/berries/chople.png differ diff --git a/graphics/berries/coba.png b/graphics/berries/coba.png index 18283bd79..7824d8449 100644 Binary files a/graphics/berries/coba.png and b/graphics/berries/coba.png differ diff --git a/graphics/berries/colbur.png b/graphics/berries/colbur.png index d422a826e..bb1560b22 100644 Binary files a/graphics/berries/colbur.png and b/graphics/berries/colbur.png differ diff --git a/graphics/berries/haban.png b/graphics/berries/haban.png index 87b27fb26..6dc0f0190 100644 Binary files a/graphics/berries/haban.png and b/graphics/berries/haban.png differ diff --git a/graphics/berries/kasib.png b/graphics/berries/kasib.png index f1b09244b..3cba928ce 100644 Binary files a/graphics/berries/kasib.png and b/graphics/berries/kasib.png differ diff --git a/graphics/berries/kebia.png b/graphics/berries/kebia.png index e0dfefd67..b4ed7dc43 100644 Binary files a/graphics/berries/kebia.png and b/graphics/berries/kebia.png differ diff --git a/graphics/berries/kee.png b/graphics/berries/kee.png index 1c83b65b1..37e1dc087 100644 Binary files a/graphics/berries/kee.png and b/graphics/berries/kee.png differ diff --git a/graphics/berries/micle.png b/graphics/berries/micle.png index bbe6011b4..953523dd8 100644 Binary files a/graphics/berries/micle.png and b/graphics/berries/micle.png differ diff --git a/graphics/berries/occa.png b/graphics/berries/occa.png index 1ad829e5f..1d2af365f 100644 Binary files a/graphics/berries/occa.png and b/graphics/berries/occa.png differ diff --git a/graphics/berries/passho.png b/graphics/berries/passho.png index c54147545..156dc18d1 100644 Binary files a/graphics/berries/passho.png and b/graphics/berries/passho.png differ diff --git a/graphics/berries/rindo.png b/graphics/berries/rindo.png index 91e895d04..741077893 100644 Binary files a/graphics/berries/rindo.png and b/graphics/berries/rindo.png differ diff --git a/graphics/berries/roseli.png b/graphics/berries/roseli.png index 4eb675a44..9fb4c8f8d 100644 Binary files a/graphics/berries/roseli.png and b/graphics/berries/roseli.png differ diff --git a/graphics/berries/rowap.png b/graphics/berries/rowap.png index bbeee3f3b..decb5a2a9 100644 Binary files a/graphics/berries/rowap.png and b/graphics/berries/rowap.png differ diff --git a/graphics/berries/shuca.png b/graphics/berries/shuca.png index 618f3abac..8ddc54748 100644 Binary files a/graphics/berries/shuca.png and b/graphics/berries/shuca.png differ diff --git a/graphics/berries/tanga.png b/graphics/berries/tanga.png index 702da676f..6b9076b60 100644 Binary files a/graphics/berries/tanga.png and b/graphics/berries/tanga.png differ diff --git a/graphics/berries/wacan.png b/graphics/berries/wacan.png index 5d88c95bd..d79c025e6 100644 Binary files a/graphics/berries/wacan.png and b/graphics/berries/wacan.png differ diff --git a/graphics/berries/yache.png b/graphics/berries/yache.png index 3f3978277..43ebf0768 100644 Binary files a/graphics/berries/yache.png and b/graphics/berries/yache.png differ diff --git a/graphics/expansion_intro/credits.pal b/graphics/expansion_intro/credits.pal new file mode 100644 index 000000000..5f6c06d72 --- /dev/null +++ b/graphics/expansion_intro/credits.pal @@ -0,0 +1,259 @@ +JASC-PAL +0100 +256 +0 0 0 +255 255 255 +222 222 222 +222 222 214 +198 198 198 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +255 255 255 +247 247 247 +231 231 231 +222 222 222 +222 222 214 +214 214 214 +198 198 198 +181 181 181 +165 165 165 +148 148 148 +132 132 132 +115 115 115 +99 99 99 +82 82 82 +66 66 66 +49 49 49 +33 33 33 +16 16 16 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/expansion_intro/powered_by.bin b/graphics/expansion_intro/powered_by.bin new file mode 100644 index 000000000..13187db91 Binary files /dev/null and b/graphics/expansion_intro/powered_by.bin differ diff --git a/graphics/expansion_intro/powered_by.png b/graphics/expansion_intro/powered_by.png new file mode 100644 index 000000000..910053f64 Binary files /dev/null and b/graphics/expansion_intro/powered_by.png differ diff --git a/graphics/expansion_intro/rhh_credits.bin b/graphics/expansion_intro/rhh_credits.bin new file mode 100644 index 000000000..44ec5e7e4 Binary files /dev/null and b/graphics/expansion_intro/rhh_credits.bin differ diff --git a/graphics/expansion_intro/rhh_credits.png b/graphics/expansion_intro/rhh_credits.png new file mode 100644 index 000000000..02e1dd3b6 Binary files /dev/null and b/graphics/expansion_intro/rhh_credits.png differ diff --git a/graphics/expansion_intro/sprites/dizzy_egg.png b/graphics/expansion_intro/sprites/dizzy_egg.png new file mode 100644 index 000000000..cd03ffc15 Binary files /dev/null and b/graphics/expansion_intro/sprites/dizzy_egg.png differ diff --git a/graphics/expansion_intro/sprites/porygon.png b/graphics/expansion_intro/sprites/porygon.png new file mode 100644 index 000000000..020198df6 Binary files /dev/null and b/graphics/expansion_intro/sprites/porygon.png differ diff --git a/graphics/expansion_intro/sprites/shiny.pal b/graphics/expansion_intro/sprites/shiny.pal new file mode 100644 index 000000000..1950f6e0b --- /dev/null +++ b/graphics/expansion_intro/sprites/shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +199 225 209 +248 248 248 +197 197 197 +139 213 238 +89 189 230 +7 172 213 +7 131 164 +7 89 114 +246 213 246 +238 172 238 +255 97 207 +197 56 165 +123 40 88 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/items/icons/ability_capsule.png b/graphics/items/icons/ability_capsule.png index 4cb366137..49a70ffa5 100755 Binary files a/graphics/items/icons/ability_capsule.png and b/graphics/items/icons/ability_capsule.png differ diff --git a/graphics/items/icons/ability_patch.png b/graphics/items/icons/ability_patch.png index acbef7462..8f14ab7ee 100644 Binary files a/graphics/items/icons/ability_patch.png and b/graphics/items/icons/ability_patch.png differ diff --git a/graphics/items/icons/absorb_bulb.png b/graphics/items/icons/absorb_bulb.png index d958ab368..a63f7a8bc 100755 Binary files a/graphics/items/icons/absorb_bulb.png and b/graphics/items/icons/absorb_bulb.png differ diff --git a/graphics/items/icons/air_balloon.png b/graphics/items/icons/air_balloon.png index 6ed3a9ad2..dbcff6d13 100755 Binary files a/graphics/items/icons/air_balloon.png and b/graphics/items/icons/air_balloon.png differ diff --git a/graphics/items/icons/armor_fossil.png b/graphics/items/icons/armor_fossil.png index a24d2ec4d..7647f9db5 100755 Binary files a/graphics/items/icons/armor_fossil.png and b/graphics/items/icons/armor_fossil.png differ diff --git a/graphics/items/icons/babiri_berry.png b/graphics/items/icons/babiri_berry.png index aeca14e70..72141937b 100755 Binary files a/graphics/items/icons/babiri_berry.png and b/graphics/items/icons/babiri_berry.png differ diff --git a/graphics/items/icons/big_malasada.png b/graphics/items/icons/big_malasada.png index d24cd9e00..a65102777 100755 Binary files a/graphics/items/icons/big_malasada.png and b/graphics/items/icons/big_malasada.png differ diff --git a/graphics/items/icons/big_root.png b/graphics/items/icons/big_root.png index e857cc5f3..ef20e8ea5 100644 Binary files a/graphics/items/icons/big_root.png and b/graphics/items/icons/big_root.png differ diff --git a/graphics/items/icons/black_apricorn.png b/graphics/items/icons/black_apricorn.png index c80707e06..470e77fcf 100755 Binary files a/graphics/items/icons/black_apricorn.png and b/graphics/items/icons/black_apricorn.png differ diff --git a/graphics/items/icons/black_sludge.png b/graphics/items/icons/black_sludge.png index 2e1fac755..9987ef73b 100644 Binary files a/graphics/items/icons/black_sludge.png and b/graphics/items/icons/black_sludge.png differ diff --git a/graphics/items/icons/blue_apricorn.png b/graphics/items/icons/blue_apricorn.png index 35d0ed23b..9e1b19fb3 100755 Binary files a/graphics/items/icons/blue_apricorn.png and b/graphics/items/icons/blue_apricorn.png differ diff --git a/graphics/items/icons/bug_gem.png b/graphics/items/icons/bug_gem.png index 0561d24d0..4d6904668 100644 Binary files a/graphics/items/icons/bug_gem.png and b/graphics/items/icons/bug_gem.png differ diff --git a/graphics/items/icons/bug_memory.png b/graphics/items/icons/bug_memory.png index 5c4c09098..87f558fee 100755 Binary files a/graphics/items/icons/bug_memory.png and b/graphics/items/icons/bug_memory.png differ diff --git a/graphics/items/icons/burn_drive.png b/graphics/items/icons/burn_drive.png index c83fbd335..9486eff48 100644 Binary files a/graphics/items/icons/burn_drive.png and b/graphics/items/icons/burn_drive.png differ diff --git a/graphics/items/icons/cell_battery.png b/graphics/items/icons/cell_battery.png index 6183bdb08..23fde6a29 100755 Binary files a/graphics/items/icons/cell_battery.png and b/graphics/items/icons/cell_battery.png differ diff --git a/graphics/items/icons/charti_berry.png b/graphics/items/icons/charti_berry.png index 8848e18d4..a59e62009 100755 Binary files a/graphics/items/icons/charti_berry.png and b/graphics/items/icons/charti_berry.png differ diff --git a/graphics/items/icons/chilan_berry.png b/graphics/items/icons/chilan_berry.png index d1516f732..c78465aa2 100755 Binary files a/graphics/items/icons/chilan_berry.png and b/graphics/items/icons/chilan_berry.png differ diff --git a/graphics/items/icons/chill_drive.png b/graphics/items/icons/chill_drive.png index a2c7e98a6..d3d5e019c 100644 Binary files a/graphics/items/icons/chill_drive.png and b/graphics/items/icons/chill_drive.png differ diff --git a/graphics/items/icons/choice_scarf.png b/graphics/items/icons/choice_scarf.png index 51157fcc2..99e126453 100644 Binary files a/graphics/items/icons/choice_scarf.png and b/graphics/items/icons/choice_scarf.png differ diff --git a/graphics/items/icons/choice_specs.png b/graphics/items/icons/choice_specs.png index 6c64cb26e..7c90bdcff 100644 Binary files a/graphics/items/icons/choice_specs.png and b/graphics/items/icons/choice_specs.png differ diff --git a/graphics/items/icons/chople_berry.png b/graphics/items/icons/chople_berry.png index 3fa84f379..22f4f2426 100755 Binary files a/graphics/items/icons/chople_berry.png and b/graphics/items/icons/chople_berry.png differ diff --git a/graphics/items/icons/coba_berry.png b/graphics/items/icons/coba_berry.png index 5ac21683e..05f117f4b 100755 Binary files a/graphics/items/icons/coba_berry.png and b/graphics/items/icons/coba_berry.png differ diff --git a/graphics/items/icons/colbur_berry.png b/graphics/items/icons/colbur_berry.png index 56d46a52a..9e7850943 100755 Binary files a/graphics/items/icons/colbur_berry.png and b/graphics/items/icons/colbur_berry.png differ diff --git a/graphics/items/icons/cover_fossil.png b/graphics/items/icons/cover_fossil.png index bc8bbe69b..1202bb455 100755 Binary files a/graphics/items/icons/cover_fossil.png and b/graphics/items/icons/cover_fossil.png differ diff --git a/graphics/items/icons/custap_berry.png b/graphics/items/icons/custap_berry.png index 3fa594667..56f1492c3 100755 Binary files a/graphics/items/icons/custap_berry.png and b/graphics/items/icons/custap_berry.png differ diff --git a/graphics/items/icons/damp_rock.png b/graphics/items/icons/damp_rock.png index fe908739e..97c75b08f 100644 Binary files a/graphics/items/icons/damp_rock.png and b/graphics/items/icons/damp_rock.png differ diff --git a/graphics/items/icons/dark_gem.png b/graphics/items/icons/dark_gem.png index 947f04167..8999ca25a 100644 Binary files a/graphics/items/icons/dark_gem.png and b/graphics/items/icons/dark_gem.png differ diff --git a/graphics/items/icons/dark_memory.png b/graphics/items/icons/dark_memory.png index 258bd309b..3cb69c7a5 100755 Binary files a/graphics/items/icons/dark_memory.png and b/graphics/items/icons/dark_memory.png differ diff --git a/graphics/items/icons/dawn_stone.png b/graphics/items/icons/dawn_stone.png index 0465d18ba..a0db01532 100755 Binary files a/graphics/items/icons/dawn_stone.png and b/graphics/items/icons/dawn_stone.png differ diff --git a/graphics/items/icons/destiny_knot.png b/graphics/items/icons/destiny_knot.png index ceeb38d5c..ce8b18f93 100644 Binary files a/graphics/items/icons/destiny_knot.png and b/graphics/items/icons/destiny_knot.png differ diff --git a/graphics/items/icons/douse_drive.png b/graphics/items/icons/douse_drive.png index eee5ae35f..f59616159 100644 Binary files a/graphics/items/icons/douse_drive.png and b/graphics/items/icons/douse_drive.png differ diff --git a/graphics/items/icons/draco_plate.png b/graphics/items/icons/draco_plate.png index 9b08c31c8..21339c048 100644 Binary files a/graphics/items/icons/draco_plate.png and b/graphics/items/icons/draco_plate.png differ diff --git a/graphics/items/icons/dragon_gem.png b/graphics/items/icons/dragon_gem.png index 2d41c858c..f071726a1 100644 Binary files a/graphics/items/icons/dragon_gem.png and b/graphics/items/icons/dragon_gem.png differ diff --git a/graphics/items/icons/dragon_memory.png b/graphics/items/icons/dragon_memory.png index d073dace3..3888b3f3a 100755 Binary files a/graphics/items/icons/dragon_memory.png and b/graphics/items/icons/dragon_memory.png differ diff --git a/graphics/items/icons/dread_plate.png b/graphics/items/icons/dread_plate.png index f93493f97..8679df524 100644 Binary files a/graphics/items/icons/dread_plate.png and b/graphics/items/icons/dread_plate.png differ diff --git a/graphics/items/icons/dubious_disc.png b/graphics/items/icons/dubious_disc.png index bf2ab2fc0..bd0e7f775 100755 Binary files a/graphics/items/icons/dubious_disc.png and b/graphics/items/icons/dubious_disc.png differ diff --git a/graphics/items/icons/dusk_stone.png b/graphics/items/icons/dusk_stone.png index e928b2516..3d3669bb4 100755 Binary files a/graphics/items/icons/dusk_stone.png and b/graphics/items/icons/dusk_stone.png differ diff --git a/graphics/items/icons/earth_plate.png b/graphics/items/icons/earth_plate.png index 688b24be3..e79dff33c 100644 Binary files a/graphics/items/icons/earth_plate.png and b/graphics/items/icons/earth_plate.png differ diff --git a/graphics/items/icons/eject_button.png b/graphics/items/icons/eject_button.png index a0492ed6e..ada08cbb7 100755 Binary files a/graphics/items/icons/eject_button.png and b/graphics/items/icons/eject_button.png differ diff --git a/graphics/items/icons/electirizer.png b/graphics/items/icons/electirizer.png index 73f6f8f26..f0351e64d 100755 Binary files a/graphics/items/icons/electirizer.png and b/graphics/items/icons/electirizer.png differ diff --git a/graphics/items/icons/electric_gem.png b/graphics/items/icons/electric_gem.png index 88e604f18..e17e3f4d1 100644 Binary files a/graphics/items/icons/electric_gem.png and b/graphics/items/icons/electric_gem.png differ diff --git a/graphics/items/icons/electric_memory.png b/graphics/items/icons/electric_memory.png index ce9a8f362..0ab5da377 100755 Binary files a/graphics/items/icons/electric_memory.png and b/graphics/items/icons/electric_memory.png differ diff --git a/graphics/items/icons/eviolite.png b/graphics/items/icons/eviolite.png index c08cc5950..b8bc613f8 100644 Binary files a/graphics/items/icons/eviolite.png and b/graphics/items/icons/eviolite.png differ diff --git a/graphics/items/icons/expert_belt.png b/graphics/items/icons/expert_belt.png index bc0045490..62d4b8bc2 100644 Binary files a/graphics/items/icons/expert_belt.png and b/graphics/items/icons/expert_belt.png differ diff --git a/graphics/items/icons/fairy_gem.png b/graphics/items/icons/fairy_gem.png index 871f74426..5fe8f6ed9 100644 Binary files a/graphics/items/icons/fairy_gem.png and b/graphics/items/icons/fairy_gem.png differ diff --git a/graphics/items/icons/fairy_memory.png b/graphics/items/icons/fairy_memory.png index fba869128..5d472d966 100755 Binary files a/graphics/items/icons/fairy_memory.png and b/graphics/items/icons/fairy_memory.png differ diff --git a/graphics/items/icons/fighting_gem.png b/graphics/items/icons/fighting_gem.png index 7f4fc8b97..229376779 100644 Binary files a/graphics/items/icons/fighting_gem.png and b/graphics/items/icons/fighting_gem.png differ diff --git a/graphics/items/icons/fighting_memory.png b/graphics/items/icons/fighting_memory.png index ad21a2d07..f46e89d73 100755 Binary files a/graphics/items/icons/fighting_memory.png and b/graphics/items/icons/fighting_memory.png differ diff --git a/graphics/items/icons/fire_gem.png b/graphics/items/icons/fire_gem.png index deb8979bd..d6caa7d3d 100644 Binary files a/graphics/items/icons/fire_gem.png and b/graphics/items/icons/fire_gem.png differ diff --git a/graphics/items/icons/fire_memory.png b/graphics/items/icons/fire_memory.png index 33116aed1..bc62b02c1 100755 Binary files a/graphics/items/icons/fire_memory.png and b/graphics/items/icons/fire_memory.png differ diff --git a/graphics/items/icons/fist_plate.png b/graphics/items/icons/fist_plate.png index 0142938d5..7e6cb2b92 100644 Binary files a/graphics/items/icons/fist_plate.png and b/graphics/items/icons/fist_plate.png differ diff --git a/graphics/items/icons/flame_plate.png b/graphics/items/icons/flame_plate.png index 6f78e5d02..42a3564ea 100644 Binary files a/graphics/items/icons/flame_plate.png and b/graphics/items/icons/flame_plate.png differ diff --git a/graphics/items/icons/float_stone.png b/graphics/items/icons/float_stone.png index 61f096fc3..a421d553f 100644 Binary files a/graphics/items/icons/float_stone.png and b/graphics/items/icons/float_stone.png differ diff --git a/graphics/items/icons/flying_gem.png b/graphics/items/icons/flying_gem.png index 563e80f3b..eb328c85e 100644 Binary files a/graphics/items/icons/flying_gem.png and b/graphics/items/icons/flying_gem.png differ diff --git a/graphics/items/icons/flying_memory.png b/graphics/items/icons/flying_memory.png index da413ba1f..e38f24004 100755 Binary files a/graphics/items/icons/flying_memory.png and b/graphics/items/icons/flying_memory.png differ diff --git a/graphics/items/icons/focus_sash.png b/graphics/items/icons/focus_sash.png index e0df9798e..a09d2d26b 100644 Binary files a/graphics/items/icons/focus_sash.png and b/graphics/items/icons/focus_sash.png differ diff --git a/graphics/items/icons/full_incense.png b/graphics/items/icons/full_incense.png index 230927e08..a44f6bffa 100755 Binary files a/graphics/items/icons/full_incense.png and b/graphics/items/icons/full_incense.png differ diff --git a/graphics/items/icons/ghost_gem.png b/graphics/items/icons/ghost_gem.png index 96e320e21..c4813ee29 100644 Binary files a/graphics/items/icons/ghost_gem.png and b/graphics/items/icons/ghost_gem.png differ diff --git a/graphics/items/icons/ghost_memory.png b/graphics/items/icons/ghost_memory.png index 3041643aa..2a9b4f659 100755 Binary files a/graphics/items/icons/ghost_memory.png and b/graphics/items/icons/ghost_memory.png differ diff --git a/graphics/items/icons/gracidea.png b/graphics/items/icons/gracidea.png index 31bac3846..fdbd8c8af 100755 Binary files a/graphics/items/icons/gracidea.png and b/graphics/items/icons/gracidea.png differ diff --git a/graphics/items/icons/grass_gem.png b/graphics/items/icons/grass_gem.png index df57119b2..756a769ca 100644 Binary files a/graphics/items/icons/grass_gem.png and b/graphics/items/icons/grass_gem.png differ diff --git a/graphics/items/icons/grass_memory.png b/graphics/items/icons/grass_memory.png index 646568c41..4ef16802d 100755 Binary files a/graphics/items/icons/grass_memory.png and b/graphics/items/icons/grass_memory.png differ diff --git a/graphics/items/icons/green_apricorn.png b/graphics/items/icons/green_apricorn.png index dc821541b..da60f8544 100755 Binary files a/graphics/items/icons/green_apricorn.png and b/graphics/items/icons/green_apricorn.png differ diff --git a/graphics/items/icons/grip_claw.png b/graphics/items/icons/grip_claw.png index d76c6b75c..dfe2b5509 100644 Binary files a/graphics/items/icons/grip_claw.png and b/graphics/items/icons/grip_claw.png differ diff --git a/graphics/items/icons/griseous_orb.png b/graphics/items/icons/griseous_orb.png index 5140ea3ac..e306e5866 100644 Binary files a/graphics/items/icons/griseous_orb.png and b/graphics/items/icons/griseous_orb.png differ diff --git a/graphics/items/icons/ground_gem.png b/graphics/items/icons/ground_gem.png index 27a8bf69d..21fab57b0 100644 Binary files a/graphics/items/icons/ground_gem.png and b/graphics/items/icons/ground_gem.png differ diff --git a/graphics/items/icons/ground_memory.png b/graphics/items/icons/ground_memory.png index 0f9f31734..45ac4379e 100755 Binary files a/graphics/items/icons/ground_memory.png and b/graphics/items/icons/ground_memory.png differ diff --git a/graphics/items/icons/haban_berry.png b/graphics/items/icons/haban_berry.png index f413ea9e1..7171d2b07 100755 Binary files a/graphics/items/icons/haban_berry.png and b/graphics/items/icons/haban_berry.png differ diff --git a/graphics/items/icons/heat_rock.png b/graphics/items/icons/heat_rock.png index 60eae8169..cbfa59858 100644 Binary files a/graphics/items/icons/heat_rock.png and b/graphics/items/icons/heat_rock.png differ diff --git a/graphics/items/icons/ice_gem.png b/graphics/items/icons/ice_gem.png index db87018fe..e9c28f050 100644 Binary files a/graphics/items/icons/ice_gem.png and b/graphics/items/icons/ice_gem.png differ diff --git a/graphics/items/icons/ice_memory.png b/graphics/items/icons/ice_memory.png index c0f7cd76e..5dad66f87 100755 Binary files a/graphics/items/icons/ice_memory.png and b/graphics/items/icons/ice_memory.png differ diff --git a/graphics/items/icons/ice_stone.png b/graphics/items/icons/ice_stone.png index ee5309544..5f5a7958a 100755 Binary files a/graphics/items/icons/ice_stone.png and b/graphics/items/icons/ice_stone.png differ diff --git a/graphics/items/icons/icicle_plate.png b/graphics/items/icons/icicle_plate.png index 2d3e27bbb..7a74d45a5 100644 Binary files a/graphics/items/icons/icicle_plate.png and b/graphics/items/icons/icicle_plate.png differ diff --git a/graphics/items/icons/icy_rock.png b/graphics/items/icons/icy_rock.png index 800b12ec8..56fe8cf41 100644 Binary files a/graphics/items/icons/icy_rock.png and b/graphics/items/icons/icy_rock.png differ diff --git a/graphics/items/icons/insect_plate.png b/graphics/items/icons/insect_plate.png index 993e420da..23bee9093 100644 Binary files a/graphics/items/icons/insect_plate.png and b/graphics/items/icons/insect_plate.png differ diff --git a/graphics/items/icons/iron_ball.png b/graphics/items/icons/iron_ball.png index e1f82bde1..994641c8d 100644 Binary files a/graphics/items/icons/iron_ball.png and b/graphics/items/icons/iron_ball.png differ diff --git a/graphics/items/icons/iron_plate.png b/graphics/items/icons/iron_plate.png index 08a3cb8b9..d4a778e4d 100644 Binary files a/graphics/items/icons/iron_plate.png and b/graphics/items/icons/iron_plate.png differ diff --git a/graphics/items/icons/jaboca_berry.png b/graphics/items/icons/jaboca_berry.png index da6d029b0..41cbeb174 100755 Binary files a/graphics/items/icons/jaboca_berry.png and b/graphics/items/icons/jaboca_berry.png differ diff --git a/graphics/items/icons/jaw_fossil.png b/graphics/items/icons/jaw_fossil.png index a52a7579f..5691efc13 100755 Binary files a/graphics/items/icons/jaw_fossil.png and b/graphics/items/icons/jaw_fossil.png differ diff --git a/graphics/items/icons/kasib_berry.png b/graphics/items/icons/kasib_berry.png index c09fa20de..a62c3e95c 100755 Binary files a/graphics/items/icons/kasib_berry.png and b/graphics/items/icons/kasib_berry.png differ diff --git a/graphics/items/icons/kebia_berry.png b/graphics/items/icons/kebia_berry.png index a4b5a4393..ba679f626 100755 Binary files a/graphics/items/icons/kebia_berry.png and b/graphics/items/icons/kebia_berry.png differ diff --git a/graphics/items/icons/kee_berry.png b/graphics/items/icons/kee_berry.png index 83749d1b8..bbd6c53cf 100755 Binary files a/graphics/items/icons/kee_berry.png and b/graphics/items/icons/kee_berry.png differ diff --git a/graphics/items/icons/lagging_tail.png b/graphics/items/icons/lagging_tail.png index 3299515b6..3d35e633c 100644 Binary files a/graphics/items/icons/lagging_tail.png and b/graphics/items/icons/lagging_tail.png differ diff --git a/graphics/items/icons/life_orb.png b/graphics/items/icons/life_orb.png index 9a9ed7c68..68aaa8e51 100644 Binary files a/graphics/items/icons/life_orb.png and b/graphics/items/icons/life_orb.png differ diff --git a/graphics/items/icons/light_clay.png b/graphics/items/icons/light_clay.png index 7cc3e6380..0007ea8c8 100644 Binary files a/graphics/items/icons/light_clay.png and b/graphics/items/icons/light_clay.png differ diff --git a/graphics/items/icons/lucarionite.png b/graphics/items/icons/lucarionite.png index ea4955c8a..b42991487 100644 Binary files a/graphics/items/icons/lucarionite.png and b/graphics/items/icons/lucarionite.png differ diff --git a/graphics/items/icons/luck_incense.png b/graphics/items/icons/luck_incense.png index 396ab2f61..6a14050cf 100755 Binary files a/graphics/items/icons/luck_incense.png and b/graphics/items/icons/luck_incense.png differ diff --git a/graphics/items/icons/luminous_moss.png b/graphics/items/icons/luminous_moss.png index 6ee31c5e1..b15ba36d8 100755 Binary files a/graphics/items/icons/luminous_moss.png and b/graphics/items/icons/luminous_moss.png differ diff --git a/graphics/items/icons/lustrous_orb.png b/graphics/items/icons/lustrous_orb.png index 08b452aba..ab931ff46 100644 Binary files a/graphics/items/icons/lustrous_orb.png and b/graphics/items/icons/lustrous_orb.png differ diff --git a/graphics/items/icons/magmarizer.png b/graphics/items/icons/magmarizer.png index fcaf04b44..41a1b50ca 100755 Binary files a/graphics/items/icons/magmarizer.png and b/graphics/items/icons/magmarizer.png differ diff --git a/graphics/items/icons/maranga_berry.png b/graphics/items/icons/maranga_berry.png index 2551c0167..d56ce9643 100755 Binary files a/graphics/items/icons/maranga_berry.png and b/graphics/items/icons/maranga_berry.png differ diff --git a/graphics/items/icons/meadow_plate.png b/graphics/items/icons/meadow_plate.png index 5cec7fc16..6571446bb 100644 Binary files a/graphics/items/icons/meadow_plate.png and b/graphics/items/icons/meadow_plate.png differ diff --git a/graphics/items/icons/metronome.png b/graphics/items/icons/metronome.png index 4aa57f95e..4270fcaed 100644 Binary files a/graphics/items/icons/metronome.png and b/graphics/items/icons/metronome.png differ diff --git a/graphics/items/icons/micle_berry.png b/graphics/items/icons/micle_berry.png index 74e011d0e..5e108e5a1 100755 Binary files a/graphics/items/icons/micle_berry.png and b/graphics/items/icons/micle_berry.png differ diff --git a/graphics/items/icons/mind_plate.png b/graphics/items/icons/mind_plate.png index dfe89ddbb..12af8f9ea 100644 Binary files a/graphics/items/icons/mind_plate.png and b/graphics/items/icons/mind_plate.png differ diff --git a/graphics/items/icons/muscle_band.png b/graphics/items/icons/muscle_band.png index b374760a7..1954f8a56 100644 Binary files a/graphics/items/icons/muscle_band.png and b/graphics/items/icons/muscle_band.png differ diff --git a/graphics/items/icons/normal_gem.png b/graphics/items/icons/normal_gem.png index c57142c32..5d8cbf7bf 100644 Binary files a/graphics/items/icons/normal_gem.png and b/graphics/items/icons/normal_gem.png differ diff --git a/graphics/items/icons/occa_berry.png b/graphics/items/icons/occa_berry.png index 05d9860fb..aa37cf3f6 100755 Binary files a/graphics/items/icons/occa_berry.png and b/graphics/items/icons/occa_berry.png differ diff --git a/graphics/items/icons/odd_incense.png b/graphics/items/icons/odd_incense.png index 11c7d24f7..9d5f7d2ab 100755 Binary files a/graphics/items/icons/odd_incense.png and b/graphics/items/icons/odd_incense.png differ diff --git a/graphics/items/icons/odd_keystone.png b/graphics/items/icons/odd_keystone.png index 8ef2d3cdb..8da9f26aa 100755 Binary files a/graphics/items/icons/odd_keystone.png and b/graphics/items/icons/odd_keystone.png differ diff --git a/graphics/items/icons/old_gateau.png b/graphics/items/icons/old_gateau.png index 064c997a5..93edb8f97 100755 Binary files a/graphics/items/icons/old_gateau.png and b/graphics/items/icons/old_gateau.png differ diff --git a/graphics/items/icons/oval_stone.png b/graphics/items/icons/oval_stone.png index 27e0a7ccf..08e8d96be 100755 Binary files a/graphics/items/icons/oval_stone.png and b/graphics/items/icons/oval_stone.png differ diff --git a/graphics/items/icons/passho_berry.png b/graphics/items/icons/passho_berry.png index cdf375607..c23145cd9 100755 Binary files a/graphics/items/icons/passho_berry.png and b/graphics/items/icons/passho_berry.png differ diff --git a/graphics/items/icons/payapa_berry.png b/graphics/items/icons/payapa_berry.png index fe021c473..fd9ac891a 100755 Binary files a/graphics/items/icons/payapa_berry.png and b/graphics/items/icons/payapa_berry.png differ diff --git a/graphics/items/icons/pink_apricorn.png b/graphics/items/icons/pink_apricorn.png index abcedcba4..817e0140c 100755 Binary files a/graphics/items/icons/pink_apricorn.png and b/graphics/items/icons/pink_apricorn.png differ diff --git a/graphics/items/icons/pink_nectar.png b/graphics/items/icons/pink_nectar.png index 21e88d302..9fbe0f76b 100755 Binary files a/graphics/items/icons/pink_nectar.png and b/graphics/items/icons/pink_nectar.png differ diff --git a/graphics/items/icons/plume_fossil.png b/graphics/items/icons/plume_fossil.png index cf98166b3..3662964ab 100755 Binary files a/graphics/items/icons/plume_fossil.png and b/graphics/items/icons/plume_fossil.png differ diff --git a/graphics/items/icons/poison_gem.png b/graphics/items/icons/poison_gem.png index ab339eb71..8e7885527 100644 Binary files a/graphics/items/icons/poison_gem.png and b/graphics/items/icons/poison_gem.png differ diff --git a/graphics/items/icons/poison_memory.png b/graphics/items/icons/poison_memory.png index e665d8176..270c8697d 100755 Binary files a/graphics/items/icons/poison_memory.png and b/graphics/items/icons/poison_memory.png differ diff --git a/graphics/items/icons/poke_radar.png b/graphics/items/icons/poke_radar.png index f0de8796a..ca4e0477a 100644 Binary files a/graphics/items/icons/poke_radar.png and b/graphics/items/icons/poke_radar.png differ diff --git a/graphics/items/icons/power_anklet.png b/graphics/items/icons/power_anklet.png index 3a2091c8e..be1982645 100755 Binary files a/graphics/items/icons/power_anklet.png and b/graphics/items/icons/power_anklet.png differ diff --git a/graphics/items/icons/power_band.png b/graphics/items/icons/power_band.png index a88e5391b..d46374279 100755 Binary files a/graphics/items/icons/power_band.png and b/graphics/items/icons/power_band.png differ diff --git a/graphics/items/icons/power_belt.png b/graphics/items/icons/power_belt.png index e4273f85c..456793fb9 100755 Binary files a/graphics/items/icons/power_belt.png and b/graphics/items/icons/power_belt.png differ diff --git a/graphics/items/icons/power_bracer.png b/graphics/items/icons/power_bracer.png index 54aa34844..9d3d37781 100755 Binary files a/graphics/items/icons/power_bracer.png and b/graphics/items/icons/power_bracer.png differ diff --git a/graphics/items/icons/power_herb.png b/graphics/items/icons/power_herb.png index 947996c4c..68225447f 100644 Binary files a/graphics/items/icons/power_herb.png and b/graphics/items/icons/power_herb.png differ diff --git a/graphics/items/icons/power_lens.png b/graphics/items/icons/power_lens.png index b18d91186..742db4b4d 100755 Binary files a/graphics/items/icons/power_lens.png and b/graphics/items/icons/power_lens.png differ diff --git a/graphics/items/icons/power_weight.png b/graphics/items/icons/power_weight.png index 149679c38..221416007 100755 Binary files a/graphics/items/icons/power_weight.png and b/graphics/items/icons/power_weight.png differ diff --git a/graphics/items/icons/prism_scale.png b/graphics/items/icons/prism_scale.png index 335816ddb..f992c3bd8 100755 Binary files a/graphics/items/icons/prism_scale.png and b/graphics/items/icons/prism_scale.png differ diff --git a/graphics/items/icons/protector.png b/graphics/items/icons/protector.png index fa88ae155..5ba93c919 100755 Binary files a/graphics/items/icons/protector.png and b/graphics/items/icons/protector.png differ diff --git a/graphics/items/icons/psychic_gem.png b/graphics/items/icons/psychic_gem.png index 6b84f38da..b73184955 100644 Binary files a/graphics/items/icons/psychic_gem.png and b/graphics/items/icons/psychic_gem.png differ diff --git a/graphics/items/icons/psychic_memory.png b/graphics/items/icons/psychic_memory.png index beda2c22d..6a5aea79a 100755 Binary files a/graphics/items/icons/psychic_memory.png and b/graphics/items/icons/psychic_memory.png differ diff --git a/graphics/items/icons/pure_incense.png b/graphics/items/icons/pure_incense.png index 8657683b1..eb5345f01 100755 Binary files a/graphics/items/icons/pure_incense.png and b/graphics/items/icons/pure_incense.png differ diff --git a/graphics/items/icons/purple_nectar.png b/graphics/items/icons/purple_nectar.png index 59111f1e4..f792b5ff5 100755 Binary files a/graphics/items/icons/purple_nectar.png and b/graphics/items/icons/purple_nectar.png differ diff --git a/graphics/items/icons/quick_powder.png b/graphics/items/icons/quick_powder.png index d83b0b506..fa56dcca7 100644 Binary files a/graphics/items/icons/quick_powder.png and b/graphics/items/icons/quick_powder.png differ diff --git a/graphics/items/icons/rare_bone.png b/graphics/items/icons/rare_bone.png index 80b4af9d5..eb5665a35 100755 Binary files a/graphics/items/icons/rare_bone.png and b/graphics/items/icons/rare_bone.png differ diff --git a/graphics/items/icons/razor_claw.png b/graphics/items/icons/razor_claw.png index 59c27fc80..e9530521c 100755 Binary files a/graphics/items/icons/razor_claw.png and b/graphics/items/icons/razor_claw.png differ diff --git a/graphics/items/icons/razor_fang.png b/graphics/items/icons/razor_fang.png index dd54b98e7..17dd1a042 100755 Binary files a/graphics/items/icons/razor_fang.png and b/graphics/items/icons/razor_fang.png differ diff --git a/graphics/items/icons/reaper_cloth.png b/graphics/items/icons/reaper_cloth.png index 73f087442..f4f0bfdb4 100755 Binary files a/graphics/items/icons/reaper_cloth.png and b/graphics/items/icons/reaper_cloth.png differ diff --git a/graphics/items/icons/red_apricorn.png b/graphics/items/icons/red_apricorn.png index 52d219c07..aaa952f77 100755 Binary files a/graphics/items/icons/red_apricorn.png and b/graphics/items/icons/red_apricorn.png differ diff --git a/graphics/items/icons/red_card.png b/graphics/items/icons/red_card.png index 1d07d827f..88c8bf0c1 100755 Binary files a/graphics/items/icons/red_card.png and b/graphics/items/icons/red_card.png differ diff --git a/graphics/items/icons/red_nectar.png b/graphics/items/icons/red_nectar.png index 1d2058dca..73710370e 100755 Binary files a/graphics/items/icons/red_nectar.png and b/graphics/items/icons/red_nectar.png differ diff --git a/graphics/items/icons/rindo_berry.png b/graphics/items/icons/rindo_berry.png index 4729e188c..56a144e95 100755 Binary files a/graphics/items/icons/rindo_berry.png and b/graphics/items/icons/rindo_berry.png differ diff --git a/graphics/items/icons/ring_target.png b/graphics/items/icons/ring_target.png index fae2b944b..08b044df7 100755 Binary files a/graphics/items/icons/ring_target.png and b/graphics/items/icons/ring_target.png differ diff --git a/graphics/items/icons/rock_gem.png b/graphics/items/icons/rock_gem.png index 6d6070b51..fdf634b73 100644 Binary files a/graphics/items/icons/rock_gem.png and b/graphics/items/icons/rock_gem.png differ diff --git a/graphics/items/icons/rock_incense.png b/graphics/items/icons/rock_incense.png index 04a3d1b5c..a79f08927 100755 Binary files a/graphics/items/icons/rock_incense.png and b/graphics/items/icons/rock_incense.png differ diff --git a/graphics/items/icons/rock_memory.png b/graphics/items/icons/rock_memory.png index 32d46fea4..9e6ce8fdb 100755 Binary files a/graphics/items/icons/rock_memory.png and b/graphics/items/icons/rock_memory.png differ diff --git a/graphics/items/icons/rocky_helmet.png b/graphics/items/icons/rocky_helmet.png index 006a9f8aa..72613a206 100755 Binary files a/graphics/items/icons/rocky_helmet.png and b/graphics/items/icons/rocky_helmet.png differ diff --git a/graphics/items/icons/rose_incense.png b/graphics/items/icons/rose_incense.png index c6b6abcc3..95bfc77e1 100755 Binary files a/graphics/items/icons/rose_incense.png and b/graphics/items/icons/rose_incense.png differ diff --git a/graphics/items/icons/roseli_berry.png b/graphics/items/icons/roseli_berry.png index 7487cb2a4..11756b42d 100755 Binary files a/graphics/items/icons/roseli_berry.png and b/graphics/items/icons/roseli_berry.png differ diff --git a/graphics/items/icons/rowap_berry.png b/graphics/items/icons/rowap_berry.png index a25d39838..318ff9bd1 100755 Binary files a/graphics/items/icons/rowap_berry.png and b/graphics/items/icons/rowap_berry.png differ diff --git a/graphics/items/icons/sachet.png b/graphics/items/icons/sachet.png index 32c566a91..e1b277408 100755 Binary files a/graphics/items/icons/sachet.png and b/graphics/items/icons/sachet.png differ diff --git a/graphics/items/icons/safety_goggles.png b/graphics/items/icons/safety_goggles.png index 7a1efab67..2381790f2 100644 Binary files a/graphics/items/icons/safety_goggles.png and b/graphics/items/icons/safety_goggles.png differ diff --git a/graphics/items/icons/sail_fossil.png b/graphics/items/icons/sail_fossil.png index 4c6514820..acf7f13ba 100755 Binary files a/graphics/items/icons/sail_fossil.png and b/graphics/items/icons/sail_fossil.png differ diff --git a/graphics/items/icons/shed_shell.png b/graphics/items/icons/shed_shell.png index 6e02ff4a3..a3df4d15c 100644 Binary files a/graphics/items/icons/shed_shell.png and b/graphics/items/icons/shed_shell.png differ diff --git a/graphics/items/icons/shiny_charm.png b/graphics/items/icons/shiny_charm.png index 3829154cd..fd2c97ac8 100644 Binary files a/graphics/items/icons/shiny_charm.png and b/graphics/items/icons/shiny_charm.png differ diff --git a/graphics/items/icons/shiny_stone.png b/graphics/items/icons/shiny_stone.png index d48db4d86..a54091d4a 100755 Binary files a/graphics/items/icons/shiny_stone.png and b/graphics/items/icons/shiny_stone.png differ diff --git a/graphics/items/icons/shock_drive.png b/graphics/items/icons/shock_drive.png index 2ac62f6ce..99f8e512c 100644 Binary files a/graphics/items/icons/shock_drive.png and b/graphics/items/icons/shock_drive.png differ diff --git a/graphics/items/icons/shuca_berry.png b/graphics/items/icons/shuca_berry.png index cc9967187..f26a80f7a 100755 Binary files a/graphics/items/icons/shuca_berry.png and b/graphics/items/icons/shuca_berry.png differ diff --git a/graphics/items/icons/skull_fossil.png b/graphics/items/icons/skull_fossil.png index 186898346..2f82900c1 100755 Binary files a/graphics/items/icons/skull_fossil.png and b/graphics/items/icons/skull_fossil.png differ diff --git a/graphics/items/icons/sky_plate.png b/graphics/items/icons/sky_plate.png index f64b14aff..0d2a910bc 100644 Binary files a/graphics/items/icons/sky_plate.png and b/graphics/items/icons/sky_plate.png differ diff --git a/graphics/items/icons/smooth_rock.png b/graphics/items/icons/smooth_rock.png index 8db8ef11f..31715570f 100644 Binary files a/graphics/items/icons/smooth_rock.png and b/graphics/items/icons/smooth_rock.png differ diff --git a/graphics/items/icons/snowball.png b/graphics/items/icons/snowball.png index 3ba834ae3..516b1cbd8 100755 Binary files a/graphics/items/icons/snowball.png and b/graphics/items/icons/snowball.png differ diff --git a/graphics/items/icons/splash_plate.png b/graphics/items/icons/splash_plate.png index b290e8100..c75fe5473 100644 Binary files a/graphics/items/icons/splash_plate.png and b/graphics/items/icons/splash_plate.png differ diff --git a/graphics/items/icons/spooky_plate.png b/graphics/items/icons/spooky_plate.png index 215657bcc..d3dbfaf0c 100644 Binary files a/graphics/items/icons/spooky_plate.png and b/graphics/items/icons/spooky_plate.png differ diff --git a/graphics/items/icons/steel_gem.png b/graphics/items/icons/steel_gem.png index 252dc2d47..65495811f 100644 Binary files a/graphics/items/icons/steel_gem.png and b/graphics/items/icons/steel_gem.png differ diff --git a/graphics/items/icons/steel_memory.png b/graphics/items/icons/steel_memory.png index b9329e2d0..b404ad320 100755 Binary files a/graphics/items/icons/steel_memory.png and b/graphics/items/icons/steel_memory.png differ diff --git a/graphics/items/icons/sticky_barb.png b/graphics/items/icons/sticky_barb.png index 735d3a051..8147e8de7 100644 Binary files a/graphics/items/icons/sticky_barb.png and b/graphics/items/icons/sticky_barb.png differ diff --git a/graphics/items/icons/stone_plate.png b/graphics/items/icons/stone_plate.png index 8af90a8a6..4aa9ba284 100644 Binary files a/graphics/items/icons/stone_plate.png and b/graphics/items/icons/stone_plate.png differ diff --git a/graphics/items/icons/sweet_heart.png b/graphics/items/icons/sweet_heart.png index 06b592022..6c9ece30d 100755 Binary files a/graphics/items/icons/sweet_heart.png and b/graphics/items/icons/sweet_heart.png differ diff --git a/graphics/items/icons/tanga_berry.png b/graphics/items/icons/tanga_berry.png index 37f8e2465..1c552fb6d 100755 Binary files a/graphics/items/icons/tanga_berry.png and b/graphics/items/icons/tanga_berry.png differ diff --git a/graphics/items/icons/toxic_orb.png b/graphics/items/icons/toxic_orb.png index d63ad4fa3..4b385799c 100644 Binary files a/graphics/items/icons/toxic_orb.png and b/graphics/items/icons/toxic_orb.png differ diff --git a/graphics/items/icons/toxic_plate.png b/graphics/items/icons/toxic_plate.png index de64d6c20..f282c0f3a 100644 Binary files a/graphics/items/icons/toxic_plate.png and b/graphics/items/icons/toxic_plate.png differ diff --git a/graphics/items/icons/wacan_berry.png b/graphics/items/icons/wacan_berry.png index af113c9b5..61e94c642 100755 Binary files a/graphics/items/icons/wacan_berry.png and b/graphics/items/icons/wacan_berry.png differ diff --git a/graphics/items/icons/water_gem.png b/graphics/items/icons/water_gem.png index 79e0ca07f..555d92ccc 100644 Binary files a/graphics/items/icons/water_gem.png and b/graphics/items/icons/water_gem.png differ diff --git a/graphics/items/icons/water_memory.png b/graphics/items/icons/water_memory.png index d7096f57c..054c05d11 100755 Binary files a/graphics/items/icons/water_memory.png and b/graphics/items/icons/water_memory.png differ diff --git a/graphics/items/icons/wave_incense.png b/graphics/items/icons/wave_incense.png index aec3fd05e..5fc560eb8 100755 Binary files a/graphics/items/icons/wave_incense.png and b/graphics/items/icons/wave_incense.png differ diff --git a/graphics/items/icons/weakness_policy.png b/graphics/items/icons/weakness_policy.png index d8f0b4553..76d26e7e4 100755 Binary files a/graphics/items/icons/weakness_policy.png and b/graphics/items/icons/weakness_policy.png differ diff --git a/graphics/items/icons/whipped_dream.png b/graphics/items/icons/whipped_dream.png index 9cf9c959a..0d3b42498 100755 Binary files a/graphics/items/icons/whipped_dream.png and b/graphics/items/icons/whipped_dream.png differ diff --git a/graphics/items/icons/white_apricorn.png b/graphics/items/icons/white_apricorn.png index c2ea56174..976779af7 100755 Binary files a/graphics/items/icons/white_apricorn.png and b/graphics/items/icons/white_apricorn.png differ diff --git a/graphics/items/icons/wide_lens.png b/graphics/items/icons/wide_lens.png index ea432dc8d..dd1e92c2c 100644 Binary files a/graphics/items/icons/wide_lens.png and b/graphics/items/icons/wide_lens.png differ diff --git a/graphics/items/icons/wise_glasses.png b/graphics/items/icons/wise_glasses.png index a3982f181..5500baa32 100644 Binary files a/graphics/items/icons/wise_glasses.png and b/graphics/items/icons/wise_glasses.png differ diff --git a/graphics/items/icons/x_special_defense.png b/graphics/items/icons/x_special_defense.png index 54a3e00fd..18dd6d5cc 100755 Binary files a/graphics/items/icons/x_special_defense.png and b/graphics/items/icons/x_special_defense.png differ diff --git a/graphics/items/icons/yache_berry.png b/graphics/items/icons/yache_berry.png index 08bb40fcf..1d53ed633 100755 Binary files a/graphics/items/icons/yache_berry.png and b/graphics/items/icons/yache_berry.png differ diff --git a/graphics/items/icons/yellow_apricorn.png b/graphics/items/icons/yellow_apricorn.png index 4dd12c5eb..293b4054f 100755 Binary files a/graphics/items/icons/yellow_apricorn.png and b/graphics/items/icons/yellow_apricorn.png differ diff --git a/graphics/items/icons/yellow_nectar.png b/graphics/items/icons/yellow_nectar.png index fff8ae697..c097f4092 100755 Binary files a/graphics/items/icons/yellow_nectar.png and b/graphics/items/icons/yellow_nectar.png differ diff --git a/graphics/items/icons/zap_plate.png b/graphics/items/icons/zap_plate.png index 80fed9a1e..3e355ca99 100644 Binary files a/graphics/items/icons/zap_plate.png and b/graphics/items/icons/zap_plate.png differ diff --git a/graphics/items/icons/zoom_lens.png b/graphics/items/icons/zoom_lens.png index 167619aa6..c5350960e 100644 Binary files a/graphics/items/icons/zoom_lens.png and b/graphics/items/icons/zoom_lens.png differ diff --git a/graphics/object_events/pics/berry_trees/chople.png b/graphics/object_events/pics/berry_trees/chople.png index fc70a9af5..5377a7fa4 100644 Binary files a/graphics/object_events/pics/berry_trees/chople.png and b/graphics/object_events/pics/berry_trees/chople.png differ diff --git a/graphics/object_events/pics/berry_trees/custap.png b/graphics/object_events/pics/berry_trees/custap.png index 3cb5ccfb1..a64a89275 100644 Binary files a/graphics/object_events/pics/berry_trees/custap.png and b/graphics/object_events/pics/berry_trees/custap.png differ diff --git a/graphics/object_events/pics/berry_trees/jaboca.png b/graphics/object_events/pics/berry_trees/jaboca.png index 36e51eb01..a85ca438d 100644 Binary files a/graphics/object_events/pics/berry_trees/jaboca.png and b/graphics/object_events/pics/berry_trees/jaboca.png differ diff --git a/graphics/object_events/pics/berry_trees/kasib.png b/graphics/object_events/pics/berry_trees/kasib.png index b8a8401e8..dcd988ecd 100644 Binary files a/graphics/object_events/pics/berry_trees/kasib.png and b/graphics/object_events/pics/berry_trees/kasib.png differ diff --git a/graphics/object_events/pics/berry_trees/kebia.png b/graphics/object_events/pics/berry_trees/kebia.png index 03efc73c1..413ef9b4b 100644 Binary files a/graphics/object_events/pics/berry_trees/kebia.png and b/graphics/object_events/pics/berry_trees/kebia.png differ diff --git a/graphics/object_events/pics/berry_trees/micle.png b/graphics/object_events/pics/berry_trees/micle.png index 365ff43b2..b7d05e5dd 100644 Binary files a/graphics/object_events/pics/berry_trees/micle.png and b/graphics/object_events/pics/berry_trees/micle.png differ diff --git a/graphics/object_events/pics/berry_trees/occa.png b/graphics/object_events/pics/berry_trees/occa.png index 8685264f9..cd90f4885 100644 Binary files a/graphics/object_events/pics/berry_trees/occa.png and b/graphics/object_events/pics/berry_trees/occa.png differ diff --git a/graphics/object_events/pics/berry_trees/payapa.png b/graphics/object_events/pics/berry_trees/payapa.png index 14aed0c23..99233cab7 100644 Binary files a/graphics/object_events/pics/berry_trees/payapa.png and b/graphics/object_events/pics/berry_trees/payapa.png differ diff --git a/graphics/object_events/pics/berry_trees/roseli.png b/graphics/object_events/pics/berry_trees/roseli.png index f59bf93a2..6e8aab158 100644 Binary files a/graphics/object_events/pics/berry_trees/roseli.png and b/graphics/object_events/pics/berry_trees/roseli.png differ diff --git a/graphics/object_events/pics/berry_trees/shuca.png b/graphics/object_events/pics/berry_trees/shuca.png index 4e95bb4f6..dec160ae6 100644 Binary files a/graphics/object_events/pics/berry_trees/shuca.png and b/graphics/object_events/pics/berry_trees/shuca.png differ diff --git a/graphics/object_events/pics/berry_trees/tanga.png b/graphics/object_events/pics/berry_trees/tanga.png index 28e86f6f4..0bba806bc 100644 Binary files a/graphics/object_events/pics/berry_trees/tanga.png and b/graphics/object_events/pics/berry_trees/tanga.png differ diff --git a/graphics/pokemon/abomasnow/front.png b/graphics/pokemon/abomasnow/front.png deleted file mode 100644 index eec72b647..000000000 Binary files a/graphics/pokemon/abomasnow/front.png and /dev/null differ diff --git a/graphics/pokemon/abra/anim_front.png b/graphics/pokemon/abra/anim_front.png index 725024737..fbbf2d583 100644 Binary files a/graphics/pokemon/abra/anim_front.png and b/graphics/pokemon/abra/anim_front.png differ diff --git a/graphics/pokemon/abra/front.png b/graphics/pokemon/abra/front.png deleted file mode 100644 index 4fa83f553..000000000 Binary files a/graphics/pokemon/abra/front.png and /dev/null differ diff --git a/graphics/pokemon/abra/normal.pal b/graphics/pokemon/abra/normal.pal index 96bbd5db7..8c4d72e5c 100644 --- a/graphics/pokemon/abra/normal.pal +++ b/graphics/pokemon/abra/normal.pal @@ -4,14 +4,14 @@ JASC-PAL 152 208 160 88 56 8 120 96 24 -248 224 40 -72 48 64 -200 184 32 -240 240 160 +255 230 41 +90 57 8 +205 189 32 +246 246 164 168 136 24 -152 120 120 +172 131 41 16 16 16 -104 72 64 +131 98 8 208 176 80 176 160 152 0 0 0 diff --git a/graphics/pokemon/absol/front.png b/graphics/pokemon/absol/front.png deleted file mode 100644 index 0026dd274..000000000 Binary files a/graphics/pokemon/absol/front.png and /dev/null differ diff --git a/graphics/pokemon/accelgor/front.png b/graphics/pokemon/accelgor/front.png deleted file mode 100644 index 1f55e29ac..000000000 Binary files a/graphics/pokemon/accelgor/front.png and /dev/null differ diff --git a/graphics/pokemon/aegislash/blade/front.png b/graphics/pokemon/aegislash/blade/front.png deleted file mode 100644 index 288bdf5eb..000000000 Binary files a/graphics/pokemon/aegislash/blade/front.png and /dev/null differ diff --git a/graphics/pokemon/aegislash/front.png b/graphics/pokemon/aegislash/front.png deleted file mode 100644 index 2e468aa8e..000000000 Binary files a/graphics/pokemon/aegislash/front.png and /dev/null differ diff --git a/graphics/pokemon/aerodactyl/anim_front.png b/graphics/pokemon/aerodactyl/anim_front.png index 4129852f9..2d36a2ad2 100644 Binary files a/graphics/pokemon/aerodactyl/anim_front.png and b/graphics/pokemon/aerodactyl/anim_front.png differ diff --git a/graphics/pokemon/aerodactyl/front.png b/graphics/pokemon/aerodactyl/front.png deleted file mode 100644 index da85d812a..000000000 Binary files a/graphics/pokemon/aerodactyl/front.png and /dev/null differ diff --git a/graphics/pokemon/aerodactyl/normal.pal b/graphics/pokemon/aerodactyl/normal.pal index a88533ce2..08e33fcd6 100644 --- a/graphics/pokemon/aerodactyl/normal.pal +++ b/graphics/pokemon/aerodactyl/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -120 104 128 -64 48 96 -184 184 224 -152 144 160 -112 80 144 -144 96 200 -168 128 216 +115 98 131 +65 49 98 +189 189 222 +156 139 172 +115 82 148 +148 98 205 +172 131 222 16 16 16 248 248 248 200 200 200 -56 112 80 -128 32 64 -200 56 72 -224 136 152 +49 115 41 +131 32 65 +205 57 74 +230 139 156 72 56 80 diff --git a/graphics/pokemon/aggron/front.png b/graphics/pokemon/aggron/front.png deleted file mode 100644 index 0d59202ca..000000000 Binary files a/graphics/pokemon/aggron/front.png and /dev/null differ diff --git a/graphics/pokemon/aipom/front.png b/graphics/pokemon/aipom/front.png deleted file mode 100644 index 227584fcb..000000000 Binary files a/graphics/pokemon/aipom/front.png and /dev/null differ diff --git a/graphics/pokemon/alakazam/anim_front.png b/graphics/pokemon/alakazam/anim_front.png index 2a75e717d..2f49747fb 100644 Binary files a/graphics/pokemon/alakazam/anim_front.png and b/graphics/pokemon/alakazam/anim_front.png differ diff --git a/graphics/pokemon/alakazam/front.png b/graphics/pokemon/alakazam/front.png deleted file mode 100644 index 6ba500cdb..000000000 Binary files a/graphics/pokemon/alakazam/front.png and /dev/null differ diff --git a/graphics/pokemon/alakazam/normal.pal b/graphics/pokemon/alakazam/normal.pal index bffaed05e..de1ad1131 100644 --- a/graphics/pokemon/alakazam/normal.pal +++ b/graphics/pokemon/alakazam/normal.pal @@ -3,14 +3,14 @@ JASC-PAL 16 152 208 160 112 88 8 -248 232 24 -200 176 16 +255 238 41 +213 189 16 16 16 16 -248 240 168 -104 72 64 -72 48 64 -200 184 168 -152 120 120 +255 246 172 +131 98 8 +82 49 8 +213 180 82 +180 131 41 88 88 88 248 248 248 176 176 168 diff --git a/graphics/pokemon/alcremie/caramel_swirl/front.png b/graphics/pokemon/alcremie/caramel_swirl/front.png index 42f6c0482..3b52242b1 100644 Binary files a/graphics/pokemon/alcremie/caramel_swirl/front.png and b/graphics/pokemon/alcremie/caramel_swirl/front.png differ diff --git a/graphics/pokemon/alcremie/lemon_cream/front.png b/graphics/pokemon/alcremie/lemon_cream/front.png index b913e40be..4fff85bc5 100644 Binary files a/graphics/pokemon/alcremie/lemon_cream/front.png and b/graphics/pokemon/alcremie/lemon_cream/front.png differ diff --git a/graphics/pokemon/alcremie/matcha_cream/back.png b/graphics/pokemon/alcremie/matcha_cream/back.png index 8f93ef92e..2ef7e2d3b 100644 Binary files a/graphics/pokemon/alcremie/matcha_cream/back.png and b/graphics/pokemon/alcremie/matcha_cream/back.png differ diff --git a/graphics/pokemon/alcremie/matcha_cream/front.png b/graphics/pokemon/alcremie/matcha_cream/front.png index 39c3ab855..7dfe1b307 100644 Binary files a/graphics/pokemon/alcremie/matcha_cream/front.png and b/graphics/pokemon/alcremie/matcha_cream/front.png differ diff --git a/graphics/pokemon/alcremie/mint_cream/front.png b/graphics/pokemon/alcremie/mint_cream/front.png index 68d3b5a4c..e019cb098 100644 Binary files a/graphics/pokemon/alcremie/mint_cream/front.png and b/graphics/pokemon/alcremie/mint_cream/front.png differ diff --git a/graphics/pokemon/alcremie/rainbow_swirl/back.png b/graphics/pokemon/alcremie/rainbow_swirl/back.png index e7f558454..06abc6812 100644 Binary files a/graphics/pokemon/alcremie/rainbow_swirl/back.png and b/graphics/pokemon/alcremie/rainbow_swirl/back.png differ diff --git a/graphics/pokemon/alcremie/ruby_cream/front.png b/graphics/pokemon/alcremie/ruby_cream/front.png index 7196c7054..3f59ec810 100644 Binary files a/graphics/pokemon/alcremie/ruby_cream/front.png and b/graphics/pokemon/alcremie/ruby_cream/front.png differ diff --git a/graphics/pokemon/alcremie/salted_cream/front.png b/graphics/pokemon/alcremie/salted_cream/front.png index 08a75d2e8..13cc028c4 100644 Binary files a/graphics/pokemon/alcremie/salted_cream/front.png and b/graphics/pokemon/alcremie/salted_cream/front.png differ diff --git a/graphics/pokemon/alomomola/front.png b/graphics/pokemon/alomomola/front.png deleted file mode 100644 index bbf90238b..000000000 Binary files a/graphics/pokemon/alomomola/front.png and /dev/null differ diff --git a/graphics/pokemon/altaria/back.png b/graphics/pokemon/altaria/back.png index 2f69affea..77b89ed0b 100644 Binary files a/graphics/pokemon/altaria/back.png and b/graphics/pokemon/altaria/back.png differ diff --git a/graphics/pokemon/altaria/front.png b/graphics/pokemon/altaria/front.png deleted file mode 100644 index d22c4b80c..000000000 Binary files a/graphics/pokemon/altaria/front.png and /dev/null differ diff --git a/graphics/pokemon/amaura/front.png b/graphics/pokemon/amaura/front.png deleted file mode 100644 index c9dbac518..000000000 Binary files a/graphics/pokemon/amaura/front.png and /dev/null differ diff --git a/graphics/pokemon/ambipom/front.png b/graphics/pokemon/ambipom/front.png deleted file mode 100644 index 064cbb4e6..000000000 Binary files a/graphics/pokemon/ambipom/front.png and /dev/null differ diff --git a/graphics/pokemon/amoonguss/front.png b/graphics/pokemon/amoonguss/front.png deleted file mode 100644 index baec9f8dd..000000000 Binary files a/graphics/pokemon/amoonguss/front.png and /dev/null differ diff --git a/graphics/pokemon/ampharos/anim_front.png b/graphics/pokemon/ampharos/anim_front.png index 1b3930f64..4e71838b0 100644 Binary files a/graphics/pokemon/ampharos/anim_front.png and b/graphics/pokemon/ampharos/anim_front.png differ diff --git a/graphics/pokemon/ampharos/back.png b/graphics/pokemon/ampharos/back.png index 80fdc1f23..7cba18fe4 100644 Binary files a/graphics/pokemon/ampharos/back.png and b/graphics/pokemon/ampharos/back.png differ diff --git a/graphics/pokemon/ampharos/front.png b/graphics/pokemon/ampharos/front.png deleted file mode 100644 index cc9711f87..000000000 Binary files a/graphics/pokemon/ampharos/front.png and /dev/null differ diff --git a/graphics/pokemon/ampharos/normal.pal b/graphics/pokemon/ampharos/normal.pal index dd9818d6b..af1e4ae87 100644 --- a/graphics/pokemon/ampharos/normal.pal +++ b/graphics/pokemon/ampharos/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 16 16 16 -88 80 88 -248 192 16 -200 136 16 -128 88 48 -192 0 0 -248 232 72 -248 32 32 -248 248 248 -168 0 0 -176 176 176 -224 224 224 -248 176 160 -127 63 75 -198 121 121 +90 90 90 +255 197 16 +205 139 16 +131 90 49 +197 65 0 +255 238 74 +255 98 0 +255 255 255 +139 32 0 +172 172 172 +230 230 230 +255 98 0 +90 0 0 +197 65 0 diff --git a/graphics/pokemon/anorith/front.png b/graphics/pokemon/anorith/front.png deleted file mode 100644 index e08948a30..000000000 Binary files a/graphics/pokemon/anorith/front.png and /dev/null differ diff --git a/graphics/pokemon/arbok/anim_front.png b/graphics/pokemon/arbok/anim_front.png index a9d2c95e7..351274bd8 100644 Binary files a/graphics/pokemon/arbok/anim_front.png and b/graphics/pokemon/arbok/anim_front.png differ diff --git a/graphics/pokemon/arbok/front.png b/graphics/pokemon/arbok/front.png deleted file mode 100644 index 532677a86..000000000 Binary files a/graphics/pokemon/arbok/front.png and /dev/null differ diff --git a/graphics/pokemon/arbok/normal.pal b/graphics/pokemon/arbok/normal.pal index d921ec974..8ef9ad315 100644 --- a/graphics/pokemon/arbok/normal.pal +++ b/graphics/pokemon/arbok/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 16 16 16 -160 128 192 -192 160 232 -120 96 168 -80 56 120 -192 192 192 -248 248 248 -160 56 96 -216 96 112 -192 64 24 -240 112 72 -240 176 200 -232 224 80 +164 131 197 +197 164 238 +123 98 172 +82 57 123 +197 197 197 +255 255 255 +156 16 0 +197 65 24 +156 16 0 +197 65 24 +246 115 74 +197 180 0 120 96 168 0 0 0 diff --git a/graphics/pokemon/arcanine/anim_front.png b/graphics/pokemon/arcanine/anim_front.png index 1fc6e9806..907e6d12b 100644 Binary files a/graphics/pokemon/arcanine/anim_front.png and b/graphics/pokemon/arcanine/anim_front.png differ diff --git a/graphics/pokemon/arcanine/front.png b/graphics/pokemon/arcanine/front.png deleted file mode 100644 index 752a55c9c..000000000 Binary files a/graphics/pokemon/arcanine/front.png and /dev/null differ diff --git a/graphics/pokemon/arcanine/normal.pal b/graphics/pokemon/arcanine/normal.pal index e00259609..0d552ffc3 100644 --- a/graphics/pokemon/arcanine/normal.pal +++ b/graphics/pokemon/arcanine/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -112 96 32 +148 98 32 16 16 16 -248 232 152 -216 192 120 -96 48 0 -224 104 16 -184 80 8 +255 246 148 +238 197 115 +98 16 0 +238 115 49 +197 82 90 216 216 208 248 248 240 88 104 112 -248 136 24 +255 156 106 168 48 16 -184 152 88 +148 98 32 0 0 0 0 0 0 diff --git a/graphics/pokemon/arceus/front.png b/graphics/pokemon/arceus/front.png deleted file mode 100644 index c143e4e69..000000000 Binary files a/graphics/pokemon/arceus/front.png and /dev/null differ diff --git a/graphics/pokemon/archen/front.png b/graphics/pokemon/archen/front.png deleted file mode 100644 index ebd166254..000000000 Binary files a/graphics/pokemon/archen/front.png and /dev/null differ diff --git a/graphics/pokemon/archeops/front.png b/graphics/pokemon/archeops/front.png deleted file mode 100644 index bbbf6e3a2..000000000 Binary files a/graphics/pokemon/archeops/front.png and /dev/null differ diff --git a/graphics/pokemon/ariados/anim_front.png b/graphics/pokemon/ariados/anim_front.png index c579c4c01..024aa0beb 100644 Binary files a/graphics/pokemon/ariados/anim_front.png and b/graphics/pokemon/ariados/anim_front.png differ diff --git a/graphics/pokemon/ariados/front.png b/graphics/pokemon/ariados/front.png deleted file mode 100644 index 8d11202a2..000000000 Binary files a/graphics/pokemon/ariados/front.png and /dev/null differ diff --git a/graphics/pokemon/ariados/normal.pal b/graphics/pokemon/ariados/normal.pal index 5939c4fcb..66aaa7bdb 100644 --- a/graphics/pokemon/ariados/normal.pal +++ b/graphics/pokemon/ariados/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -104 80 24 -248 216 64 +106 82 24 +255 222 65 0 0 0 -192 176 72 -152 88 192 -184 128 224 -96 48 152 -136 32 0 -200 40 56 -240 72 112 -240 136 152 -104 104 104 -184 184 184 -248 248 248 -80 0 0 +197 180 74 +156 90 197 +189 131 230 +98 49 156 +139 32 0 +197 65 65 +255 90 74 +255 139 115 +106 106 106 +189 189 189 +255 255 255 +139 32 0 diff --git a/graphics/pokemon/armaldo/front.png b/graphics/pokemon/armaldo/front.png deleted file mode 100644 index 2ab629340..000000000 Binary files a/graphics/pokemon/armaldo/front.png and /dev/null differ diff --git a/graphics/pokemon/aromatisse/front.png b/graphics/pokemon/aromatisse/front.png deleted file mode 100644 index 3fcd8c4f6..000000000 Binary files a/graphics/pokemon/aromatisse/front.png and /dev/null differ diff --git a/graphics/pokemon/aron/front.png b/graphics/pokemon/aron/front.png deleted file mode 100644 index 72b0da8ec..000000000 Binary files a/graphics/pokemon/aron/front.png and /dev/null differ diff --git a/graphics/pokemon/articuno/anim_front.png b/graphics/pokemon/articuno/anim_front.png index 25fe5e13b..80cacd739 100644 Binary files a/graphics/pokemon/articuno/anim_front.png and b/graphics/pokemon/articuno/anim_front.png differ diff --git a/graphics/pokemon/articuno/front.png b/graphics/pokemon/articuno/front.png deleted file mode 100644 index d24f9a762..000000000 Binary files a/graphics/pokemon/articuno/front.png and /dev/null differ diff --git a/graphics/pokemon/articuno/normal.pal b/graphics/pokemon/articuno/normal.pal index cb595f23e..eaaff4482 100644 --- a/graphics/pokemon/articuno/normal.pal +++ b/graphics/pokemon/articuno/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -0 80 112 -144 192 248 -0 120 184 -104 168 240 +32 82 156 +148 197 255 +41 115 189 +123 164 255 16 16 16 8 48 80 32 136 176 -144 192 248 +148 197 255 248 248 248 184 40 56 -88 56 24 -176 144 112 -136 104 80 +90 57 24 +180 148 115 +139 106 82 200 224 248 192 200 200 diff --git a/graphics/pokemon/audino/front.png b/graphics/pokemon/audino/front.png deleted file mode 100644 index 5aad0eb99..000000000 Binary files a/graphics/pokemon/audino/front.png and /dev/null differ diff --git a/graphics/pokemon/aurorus/front.png b/graphics/pokemon/aurorus/front.png deleted file mode 100644 index 00a50a272..000000000 Binary files a/graphics/pokemon/aurorus/front.png and /dev/null differ diff --git a/graphics/pokemon/avalugg/front.png b/graphics/pokemon/avalugg/front.png deleted file mode 100644 index 76bce5667..000000000 Binary files a/graphics/pokemon/avalugg/front.png and /dev/null differ diff --git a/graphics/pokemon/axew/front.png b/graphics/pokemon/axew/front.png deleted file mode 100644 index 993b44321..000000000 Binary files a/graphics/pokemon/axew/front.png and /dev/null differ diff --git a/graphics/pokemon/azelf/front.png b/graphics/pokemon/azelf/front.png deleted file mode 100644 index 67d155bbf..000000000 Binary files a/graphics/pokemon/azelf/front.png and /dev/null differ diff --git a/graphics/pokemon/azumarill/front.png b/graphics/pokemon/azumarill/front.png deleted file mode 100644 index 6513b5f21..000000000 Binary files a/graphics/pokemon/azumarill/front.png and /dev/null differ diff --git a/graphics/pokemon/azurill/front.png b/graphics/pokemon/azurill/front.png deleted file mode 100644 index 269e181dc..000000000 Binary files a/graphics/pokemon/azurill/front.png and /dev/null differ diff --git a/graphics/pokemon/bagon/back.png b/graphics/pokemon/bagon/back.png index fe88902d1..1bab33f32 100644 Binary files a/graphics/pokemon/bagon/back.png and b/graphics/pokemon/bagon/back.png differ diff --git a/graphics/pokemon/bagon/front.png b/graphics/pokemon/bagon/front.png deleted file mode 100644 index 21314fe08..000000000 Binary files a/graphics/pokemon/bagon/front.png and /dev/null differ diff --git a/graphics/pokemon/baltoy/front.png b/graphics/pokemon/baltoy/front.png deleted file mode 100644 index c1bdd8e90..000000000 Binary files a/graphics/pokemon/baltoy/front.png and /dev/null differ diff --git a/graphics/pokemon/banette/front.png b/graphics/pokemon/banette/front.png deleted file mode 100644 index 48a48753e..000000000 Binary files a/graphics/pokemon/banette/front.png and /dev/null differ diff --git a/graphics/pokemon/barbaracle/front.png b/graphics/pokemon/barbaracle/front.png deleted file mode 100644 index 268ee3cc7..000000000 Binary files a/graphics/pokemon/barbaracle/front.png and /dev/null differ diff --git a/graphics/pokemon/barboach/front.png b/graphics/pokemon/barboach/front.png deleted file mode 100644 index 78f0c69eb..000000000 Binary files a/graphics/pokemon/barboach/front.png and /dev/null differ diff --git a/graphics/pokemon/basculin/blue_striped/back.png b/graphics/pokemon/basculin/blue_striped/back.png index fbe338ab8..9578c6665 100644 Binary files a/graphics/pokemon/basculin/blue_striped/back.png and b/graphics/pokemon/basculin/blue_striped/back.png differ diff --git a/graphics/pokemon/basculin/blue_striped/icon.png b/graphics/pokemon/basculin/blue_striped/icon.png index f0450849a..d84ec283f 100644 Binary files a/graphics/pokemon/basculin/blue_striped/icon.png and b/graphics/pokemon/basculin/blue_striped/icon.png differ diff --git a/graphics/pokemon/basculin/front.png b/graphics/pokemon/basculin/front.png deleted file mode 100644 index ac3f6ded3..000000000 Binary files a/graphics/pokemon/basculin/front.png and /dev/null differ diff --git a/graphics/pokemon/bastiodon/front.png b/graphics/pokemon/bastiodon/front.png deleted file mode 100644 index c662e853c..000000000 Binary files a/graphics/pokemon/bastiodon/front.png and /dev/null differ diff --git a/graphics/pokemon/bayleef/anim_front.png b/graphics/pokemon/bayleef/anim_front.png index 3b5b90f51..05f44e73b 100644 Binary files a/graphics/pokemon/bayleef/anim_front.png and b/graphics/pokemon/bayleef/anim_front.png differ diff --git a/graphics/pokemon/bayleef/front.png b/graphics/pokemon/bayleef/front.png deleted file mode 100644 index 24cec2bcb..000000000 Binary files a/graphics/pokemon/bayleef/front.png and /dev/null differ diff --git a/graphics/pokemon/bayleef/normal.pal b/graphics/pokemon/bayleef/normal.pal index 2602bc257..d055dd935 100644 --- a/graphics/pokemon/bayleef/normal.pal +++ b/graphics/pokemon/bayleef/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -40 80 8 -80 120 8 -136 184 48 -104 152 16 +41 82 8 +82 123 8 +139 189 49 +106 156 16 16 16 16 -168 128 40 -104 80 0 -248 232 160 -216 184 112 -248 248 248 -248 240 200 -208 56 0 -208 136 80 -96 96 96 -192 192 192 +164 131 24 +106 82 0 +246 230 74 +222 189 41 +255 255 255 +255 255 139 +172 49 0 +213 139 82 +98 98 98 +197 197 197 diff --git a/graphics/pokemon/beartic/back.png b/graphics/pokemon/beartic/back.png index f8bb2707d..ab4586f69 100644 Binary files a/graphics/pokemon/beartic/back.png and b/graphics/pokemon/beartic/back.png differ diff --git a/graphics/pokemon/beartic/front.png b/graphics/pokemon/beartic/front.png deleted file mode 100644 index 18d3083c2..000000000 Binary files a/graphics/pokemon/beartic/front.png and /dev/null differ diff --git a/graphics/pokemon/beautifly/front.png b/graphics/pokemon/beautifly/front.png deleted file mode 100644 index 41d5bc0ca..000000000 Binary files a/graphics/pokemon/beautifly/front.png and /dev/null differ diff --git a/graphics/pokemon/beedrill/anim_front.png b/graphics/pokemon/beedrill/anim_front.png index 26e0ea3cf..05e48a56c 100644 Binary files a/graphics/pokemon/beedrill/anim_front.png and b/graphics/pokemon/beedrill/anim_front.png differ diff --git a/graphics/pokemon/beedrill/front.png b/graphics/pokemon/beedrill/front.png deleted file mode 100644 index b38fb8993..000000000 Binary files a/graphics/pokemon/beedrill/front.png and /dev/null differ diff --git a/graphics/pokemon/beedrill/normal.pal b/graphics/pokemon/beedrill/normal.pal index 6499a81c2..5dcebed76 100644 --- a/graphics/pokemon/beedrill/normal.pal +++ b/graphics/pokemon/beedrill/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 120 144 -184 168 192 -248 248 248 +139 123 148 +189 172 197 +255 255 255 24 24 24 -216 200 240 -80 88 120 -120 88 0 -200 152 16 -248 240 160 -248 200 72 -152 0 8 -208 24 48 -248 144 104 -152 120 0 +222 205 246 +82 90 123 +131 74 0 +230 148 32 +255 246 164 +255 205 74 +156 0 8 +213 24 49 +255 148 106 +180 98 16 232 224 248 diff --git a/graphics/pokemon/beheeyem/front.png b/graphics/pokemon/beheeyem/front.png deleted file mode 100644 index b8817b50b..000000000 Binary files a/graphics/pokemon/beheeyem/front.png and /dev/null differ diff --git a/graphics/pokemon/beldum/front.png b/graphics/pokemon/beldum/front.png deleted file mode 100644 index 065d7a854..000000000 Binary files a/graphics/pokemon/beldum/front.png and /dev/null differ diff --git a/graphics/pokemon/bellossom/front.png b/graphics/pokemon/bellossom/front.png deleted file mode 100644 index c0b1a0e3d..000000000 Binary files a/graphics/pokemon/bellossom/front.png and /dev/null differ diff --git a/graphics/pokemon/bellsprout/anim_front.png b/graphics/pokemon/bellsprout/anim_front.png index caf929916..d148f8134 100644 Binary files a/graphics/pokemon/bellsprout/anim_front.png and b/graphics/pokemon/bellsprout/anim_front.png differ diff --git a/graphics/pokemon/bellsprout/front.png b/graphics/pokemon/bellsprout/front.png deleted file mode 100644 index 4a6d8523b..000000000 Binary files a/graphics/pokemon/bellsprout/front.png and /dev/null differ diff --git a/graphics/pokemon/bellsprout/normal.pal b/graphics/pokemon/bellsprout/normal.pal index a03d87f63..3a2a60032 100644 --- a/graphics/pokemon/bellsprout/normal.pal +++ b/graphics/pokemon/bellsprout/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -168 120 64 -248 248 176 -240 240 88 -88 56 0 -208 200 72 +148 106 65 +255 255 255 +255 238 164 +90 57 0 +230 189 131 248 248 248 16 16 16 144 104 64 -152 32 72 -232 168 176 -64 104 16 -232 136 160 -120 192 80 -208 96 136 -96 160 64 +115 32 0 +230 139 148 +65 106 16 +213 98 106 +123 197 82 +180 65 49 +98 164 65 diff --git a/graphics/pokemon/bergmite/front.png b/graphics/pokemon/bergmite/front.png deleted file mode 100644 index 852664889..000000000 Binary files a/graphics/pokemon/bergmite/front.png and /dev/null differ diff --git a/graphics/pokemon/bibarel/front.png b/graphics/pokemon/bibarel/front.png deleted file mode 100644 index 1963eb81a..000000000 Binary files a/graphics/pokemon/bibarel/front.png and /dev/null differ diff --git a/graphics/pokemon/bidoof/anim_frontf.png b/graphics/pokemon/bidoof/anim_frontf.png index 9585a6015..a62f24b7d 100644 Binary files a/graphics/pokemon/bidoof/anim_frontf.png and b/graphics/pokemon/bidoof/anim_frontf.png differ diff --git a/graphics/pokemon/bidoof/backf.png b/graphics/pokemon/bidoof/backf.png index 5f6bc7e8b..a76560fe4 100644 Binary files a/graphics/pokemon/bidoof/backf.png and b/graphics/pokemon/bidoof/backf.png differ diff --git a/graphics/pokemon/bidoof/front.png b/graphics/pokemon/bidoof/front.png deleted file mode 100644 index 299e48749..000000000 Binary files a/graphics/pokemon/bidoof/front.png and /dev/null differ diff --git a/graphics/pokemon/binacle/front.png b/graphics/pokemon/binacle/front.png deleted file mode 100644 index c3d184282..000000000 Binary files a/graphics/pokemon/binacle/front.png and /dev/null differ diff --git a/graphics/pokemon/bisharp/front.png b/graphics/pokemon/bisharp/front.png deleted file mode 100644 index 003da831f..000000000 Binary files a/graphics/pokemon/bisharp/front.png and /dev/null differ diff --git a/graphics/pokemon/blastoise/anim_front.png b/graphics/pokemon/blastoise/anim_front.png index ed0b15e70..26034c90e 100644 Binary files a/graphics/pokemon/blastoise/anim_front.png and b/graphics/pokemon/blastoise/anim_front.png differ diff --git a/graphics/pokemon/blastoise/back.png b/graphics/pokemon/blastoise/back.png index af667e7a4..672de5497 100644 Binary files a/graphics/pokemon/blastoise/back.png and b/graphics/pokemon/blastoise/back.png differ diff --git a/graphics/pokemon/blastoise/front.png b/graphics/pokemon/blastoise/front.png deleted file mode 100644 index 6c87e4fd3..000000000 Binary files a/graphics/pokemon/blastoise/front.png and /dev/null differ diff --git a/graphics/pokemon/blastoise/normal.pal b/graphics/pokemon/blastoise/normal.pal index d21a9f013..08c199736 100644 --- a/graphics/pokemon/blastoise/normal.pal +++ b/graphics/pokemon/blastoise/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 248 192 248 -88 136 192 -48 88 144 -128 192 248 -96 168 240 -72 72 72 -16 16 16 -200 200 208 -96 88 56 -144 144 144 -136 104 80 -248 248 248 -208 200 128 -248 240 184 -200 144 96 +32 98 172 +8 57 98 +148 172 230 +90 139 205 +74 74 74 +0 0 0 +205 205 213 +90 57 24 +148 148 148 +139 98 65 +255 255 255 +213 172 74 +246 213 156 +213 172 74 156 136 80 diff --git a/graphics/pokemon/blastoise/shiny.pal b/graphics/pokemon/blastoise/shiny.pal index 505ad8494..ff27dbbdc 100644 --- a/graphics/pokemon/blastoise/shiny.pal +++ b/graphics/pokemon/blastoise/shiny.pal @@ -15,5 +15,5 @@ JASC-PAL 248 248 248 184 176 96 240 224 192 -216 184 144 +189 180 90 112 144 72 diff --git a/graphics/pokemon/blaziken/front.png b/graphics/pokemon/blaziken/front.png deleted file mode 100644 index 5336ff9b3..000000000 Binary files a/graphics/pokemon/blaziken/front.png and /dev/null differ diff --git a/graphics/pokemon/blissey/front.png b/graphics/pokemon/blissey/front.png deleted file mode 100644 index 629594beb..000000000 Binary files a/graphics/pokemon/blissey/front.png and /dev/null differ diff --git a/graphics/pokemon/blitzle/front.png b/graphics/pokemon/blitzle/front.png deleted file mode 100644 index 8eb3033d2..000000000 Binary files a/graphics/pokemon/blitzle/front.png and /dev/null differ diff --git a/graphics/pokemon/boldore/front.png b/graphics/pokemon/boldore/front.png deleted file mode 100644 index d5fef1c2f..000000000 Binary files a/graphics/pokemon/boldore/front.png and /dev/null differ diff --git a/graphics/pokemon/bonsly/front.png b/graphics/pokemon/bonsly/front.png deleted file mode 100644 index 328a0b031..000000000 Binary files a/graphics/pokemon/bonsly/front.png and /dev/null differ diff --git a/graphics/pokemon/bouffalant/front.png b/graphics/pokemon/bouffalant/front.png deleted file mode 100644 index e3562d816..000000000 Binary files a/graphics/pokemon/bouffalant/front.png and /dev/null differ diff --git a/graphics/pokemon/braixen/front.png b/graphics/pokemon/braixen/front.png deleted file mode 100644 index bb090c9d1..000000000 Binary files a/graphics/pokemon/braixen/front.png and /dev/null differ diff --git a/graphics/pokemon/braviary/front.png b/graphics/pokemon/braviary/front.png deleted file mode 100644 index 8efa81512..000000000 Binary files a/graphics/pokemon/braviary/front.png and /dev/null differ diff --git a/graphics/pokemon/breloom/back.png b/graphics/pokemon/breloom/back.png index e8a71c913..9616b0795 100644 Binary files a/graphics/pokemon/breloom/back.png and b/graphics/pokemon/breloom/back.png differ diff --git a/graphics/pokemon/breloom/front.png b/graphics/pokemon/breloom/front.png deleted file mode 100644 index ebfe14335..000000000 Binary files a/graphics/pokemon/breloom/front.png and /dev/null differ diff --git a/graphics/pokemon/bronzong/front.png b/graphics/pokemon/bronzong/front.png deleted file mode 100644 index 8ede6d683..000000000 Binary files a/graphics/pokemon/bronzong/front.png and /dev/null differ diff --git a/graphics/pokemon/bronzor/front.png b/graphics/pokemon/bronzor/front.png deleted file mode 100644 index 71a928cc3..000000000 Binary files a/graphics/pokemon/bronzor/front.png and /dev/null differ diff --git a/graphics/pokemon/budew/back.png b/graphics/pokemon/budew/back.png index 4c8478e2a..33a92ba75 100644 Binary files a/graphics/pokemon/budew/back.png and b/graphics/pokemon/budew/back.png differ diff --git a/graphics/pokemon/budew/front.png b/graphics/pokemon/budew/front.png deleted file mode 100644 index 09a81838a..000000000 Binary files a/graphics/pokemon/budew/front.png and /dev/null differ diff --git a/graphics/pokemon/buizel/front.png b/graphics/pokemon/buizel/front.png deleted file mode 100644 index e52b77c57..000000000 Binary files a/graphics/pokemon/buizel/front.png and /dev/null differ diff --git a/graphics/pokemon/bulbasaur/front.png b/graphics/pokemon/bulbasaur/front.png deleted file mode 100644 index cd7a485b9..000000000 Binary files a/graphics/pokemon/bulbasaur/front.png and /dev/null differ diff --git a/graphics/pokemon/buneary/front.png b/graphics/pokemon/buneary/front.png deleted file mode 100644 index efb01359d..000000000 Binary files a/graphics/pokemon/buneary/front.png and /dev/null differ diff --git a/graphics/pokemon/bunnelby/front.png b/graphics/pokemon/bunnelby/front.png deleted file mode 100644 index d307c4ff3..000000000 Binary files a/graphics/pokemon/bunnelby/front.png and /dev/null differ diff --git a/graphics/pokemon/burmy/front.png b/graphics/pokemon/burmy/front.png deleted file mode 100644 index 20e449da8..000000000 Binary files a/graphics/pokemon/burmy/front.png and /dev/null differ diff --git a/graphics/pokemon/burmy/sandy_cloak/front.png b/graphics/pokemon/burmy/sandy_cloak/front.png deleted file mode 100644 index 13f9c353a..000000000 Binary files a/graphics/pokemon/burmy/sandy_cloak/front.png and /dev/null differ diff --git a/graphics/pokemon/burmy/trash_cloak/front.png b/graphics/pokemon/burmy/trash_cloak/front.png deleted file mode 100644 index 39004627d..000000000 Binary files a/graphics/pokemon/burmy/trash_cloak/front.png and /dev/null differ diff --git a/graphics/pokemon/butterfree/anim_front.png b/graphics/pokemon/butterfree/anim_front.png index ee2ef504a..27b059980 100644 Binary files a/graphics/pokemon/butterfree/anim_front.png and b/graphics/pokemon/butterfree/anim_front.png differ diff --git a/graphics/pokemon/butterfree/front.png b/graphics/pokemon/butterfree/front.png deleted file mode 100644 index fb8f2bc34..000000000 Binary files a/graphics/pokemon/butterfree/front.png and /dev/null differ diff --git a/graphics/pokemon/butterfree/normal.pal b/graphics/pokemon/butterfree/normal.pal index 8467d6e81..ab84ea009 100644 --- a/graphics/pokemon/butterfree/normal.pal +++ b/graphics/pokemon/butterfree/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 0 0 0 -48 48 48 -64 48 96 -128 120 144 -232 232 248 -96 80 120 -184 184 224 -224 96 128 -96 48 56 -248 152 176 +49 49 82 +90 74 115 +131 131 189 +238 238 255 +115 98 172 +189 189 230 +230 98 131 +98 49 57 +255 156 180 48 48 80 -216 48 48 -80 120 192 -104 184 200 +222 49 49 +82 123 197 +106 189 205 240 248 248 diff --git a/graphics/pokemon/cacnea/front.png b/graphics/pokemon/cacnea/front.png deleted file mode 100644 index 2fa30c173..000000000 Binary files a/graphics/pokemon/cacnea/front.png and /dev/null differ diff --git a/graphics/pokemon/cacturne/front.png b/graphics/pokemon/cacturne/front.png deleted file mode 100644 index 0e7587f6f..000000000 Binary files a/graphics/pokemon/cacturne/front.png and /dev/null differ diff --git a/graphics/pokemon/camerupt/front.png b/graphics/pokemon/camerupt/front.png deleted file mode 100644 index 9baaa98c7..000000000 Binary files a/graphics/pokemon/camerupt/front.png and /dev/null differ diff --git a/graphics/pokemon/carbink/front.png b/graphics/pokemon/carbink/front.png deleted file mode 100644 index 31db1394a..000000000 Binary files a/graphics/pokemon/carbink/front.png and /dev/null differ diff --git a/graphics/pokemon/carnivine/front.png b/graphics/pokemon/carnivine/front.png deleted file mode 100644 index 2d26ac904..000000000 Binary files a/graphics/pokemon/carnivine/front.png and /dev/null differ diff --git a/graphics/pokemon/carracosta/front.png b/graphics/pokemon/carracosta/front.png deleted file mode 100644 index 7297c4b24..000000000 Binary files a/graphics/pokemon/carracosta/front.png and /dev/null differ diff --git a/graphics/pokemon/carvanha/back.png b/graphics/pokemon/carvanha/back.png index 6b2b3ca27..e461b970c 100644 Binary files a/graphics/pokemon/carvanha/back.png and b/graphics/pokemon/carvanha/back.png differ diff --git a/graphics/pokemon/carvanha/front.png b/graphics/pokemon/carvanha/front.png deleted file mode 100644 index b5b9ec4d1..000000000 Binary files a/graphics/pokemon/carvanha/front.png and /dev/null differ diff --git a/graphics/pokemon/cascoon/front.png b/graphics/pokemon/cascoon/front.png deleted file mode 100644 index 54081095c..000000000 Binary files a/graphics/pokemon/cascoon/front.png and /dev/null differ diff --git a/graphics/pokemon/castform/rainy/icon.png b/graphics/pokemon/castform/rainy/icon.png index 2bca7dedd..c61d0e5f0 100644 Binary files a/graphics/pokemon/castform/rainy/icon.png and b/graphics/pokemon/castform/rainy/icon.png differ diff --git a/graphics/pokemon/castform/snowy/icon.png b/graphics/pokemon/castform/snowy/icon.png index 6ab5a1549..e8651ef41 100644 Binary files a/graphics/pokemon/castform/snowy/icon.png and b/graphics/pokemon/castform/snowy/icon.png differ diff --git a/graphics/pokemon/castform/sunny/icon.png b/graphics/pokemon/castform/sunny/icon.png index 56a9ee514..a59112839 100644 Binary files a/graphics/pokemon/castform/sunny/icon.png and b/graphics/pokemon/castform/sunny/icon.png differ diff --git a/graphics/pokemon/caterpie/anim_front.png b/graphics/pokemon/caterpie/anim_front.png index 9ac8da377..1762f778d 100644 Binary files a/graphics/pokemon/caterpie/anim_front.png and b/graphics/pokemon/caterpie/anim_front.png differ diff --git a/graphics/pokemon/caterpie/front.png b/graphics/pokemon/caterpie/front.png deleted file mode 100644 index 1898998b9..000000000 Binary files a/graphics/pokemon/caterpie/front.png and /dev/null differ diff --git a/graphics/pokemon/caterpie/normal.pal b/graphics/pokemon/caterpie/normal.pal index 6120e433b..76bf98f54 100644 --- a/graphics/pokemon/caterpie/normal.pal +++ b/graphics/pokemon/caterpie/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -128 56 72 -248 120 64 -248 176 56 -248 64 64 -32 120 72 -168 240 64 -16 16 16 -24 88 64 -104 208 48 -48 168 64 -240 232 136 -208 184 128 -120 128 72 +123 57 74 +255 123 65 +255 180 57 +255 65 65 +32 123 74 +172 246 65 +0 0 0 +24 90 65 +106 213 49 +49 172 65 +246 238 139 +213 189 131 +123 131 74 72 200 40 240 232 136 diff --git a/graphics/pokemon/celebi/back.png b/graphics/pokemon/celebi/back.png index d21d8e38c..759bfc96a 100644 Binary files a/graphics/pokemon/celebi/back.png and b/graphics/pokemon/celebi/back.png differ diff --git a/graphics/pokemon/celebi/front.png b/graphics/pokemon/celebi/front.png deleted file mode 100644 index 492be76a9..000000000 Binary files a/graphics/pokemon/celebi/front.png and /dev/null differ diff --git a/graphics/pokemon/chandelure/front.png b/graphics/pokemon/chandelure/front.png deleted file mode 100644 index 4dfc4d189..000000000 Binary files a/graphics/pokemon/chandelure/front.png and /dev/null differ diff --git a/graphics/pokemon/chansey/anim_front.png b/graphics/pokemon/chansey/anim_front.png index 487cdb2b4..ca17d1a70 100644 Binary files a/graphics/pokemon/chansey/anim_front.png and b/graphics/pokemon/chansey/anim_front.png differ diff --git a/graphics/pokemon/chansey/front.png b/graphics/pokemon/chansey/front.png deleted file mode 100644 index c032d0faf..000000000 Binary files a/graphics/pokemon/chansey/front.png and /dev/null differ diff --git a/graphics/pokemon/chansey/normal.pal b/graphics/pokemon/chansey/normal.pal index 384b9e8c5..698af3b61 100644 --- a/graphics/pokemon/chansey/normal.pal +++ b/graphics/pokemon/chansey/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -224 120 128 -152 64 80 -248 224 232 -248 208 224 -152 48 80 -232 120 136 -240 152 168 +230 123 131 +139 65 65 +255 230 230 +255 213 222 +139 65 65 +238 123 123 +246 164 156 248 248 248 16 16 16 -56 136 184 -232 168 184 -168 160 112 -112 104 72 -224 216 184 +139 65 65 +246 164 180 +172 164 115 +115 106 74 +230 222 189 0 0 0 diff --git a/graphics/pokemon/charizard/anim_front.png b/graphics/pokemon/charizard/anim_front.png index b3421924f..f3b62d8fd 100644 Binary files a/graphics/pokemon/charizard/anim_front.png and b/graphics/pokemon/charizard/anim_front.png differ diff --git a/graphics/pokemon/charizard/front.png b/graphics/pokemon/charizard/front.png deleted file mode 100644 index 97a6fd5ef..000000000 Binary files a/graphics/pokemon/charizard/front.png and /dev/null differ diff --git a/graphics/pokemon/charizard/normal.pal b/graphics/pokemon/charizard/normal.pal index 87269fdd3..db32d4324 100644 --- a/graphics/pokemon/charizard/normal.pal +++ b/graphics/pokemon/charizard/normal.pal @@ -7,13 +7,13 @@ JASC-PAL 240 160 16 232 176 88 248 224 104 -200 80 64 +205 82 65 16 16 16 -232 128 40 +238 131 41 8 64 80 32 112 144 200 200 200 248 248 248 0 128 248 -232 216 120 -232 176 88 +238 222 123 +238 180 90 diff --git a/graphics/pokemon/charmander/front.png b/graphics/pokemon/charmander/front.png deleted file mode 100644 index eb0a9590d..000000000 Binary files a/graphics/pokemon/charmander/front.png and /dev/null differ diff --git a/graphics/pokemon/charmeleon/front.png b/graphics/pokemon/charmeleon/front.png deleted file mode 100644 index bdbd577e2..000000000 Binary files a/graphics/pokemon/charmeleon/front.png and /dev/null differ diff --git a/graphics/pokemon/chatot/front.png b/graphics/pokemon/chatot/front.png deleted file mode 100644 index 41d53718e..000000000 Binary files a/graphics/pokemon/chatot/front.png and /dev/null differ diff --git a/graphics/pokemon/cherrim/sunshine/icon.png b/graphics/pokemon/cherrim/sunshine/icon.png index 2c23461bb..333e22bb5 100644 Binary files a/graphics/pokemon/cherrim/sunshine/icon.png and b/graphics/pokemon/cherrim/sunshine/icon.png differ diff --git a/graphics/pokemon/cherubi/front.png b/graphics/pokemon/cherubi/front.png deleted file mode 100644 index 75b735e57..000000000 Binary files a/graphics/pokemon/cherubi/front.png and /dev/null differ diff --git a/graphics/pokemon/chesnaught/front.png b/graphics/pokemon/chesnaught/front.png deleted file mode 100644 index 5e2191810..000000000 Binary files a/graphics/pokemon/chesnaught/front.png and /dev/null differ diff --git a/graphics/pokemon/chespin/anim_front.png b/graphics/pokemon/chespin/anim_front.png index b55bb128c..af2f036fa 100644 Binary files a/graphics/pokemon/chespin/anim_front.png and b/graphics/pokemon/chespin/anim_front.png differ diff --git a/graphics/pokemon/chespin/front.png b/graphics/pokemon/chespin/front.png deleted file mode 100644 index f12f3a873..000000000 Binary files a/graphics/pokemon/chespin/front.png and /dev/null differ diff --git a/graphics/pokemon/chikorita/anim_front.png b/graphics/pokemon/chikorita/anim_front.png index ebba2d94f..c12f9f5f0 100644 Binary files a/graphics/pokemon/chikorita/anim_front.png and b/graphics/pokemon/chikorita/anim_front.png differ diff --git a/graphics/pokemon/chikorita/front.png b/graphics/pokemon/chikorita/front.png deleted file mode 100644 index 687e8ee36..000000000 Binary files a/graphics/pokemon/chikorita/front.png and /dev/null differ diff --git a/graphics/pokemon/chikorita/normal.pal b/graphics/pokemon/chikorita/normal.pal index 0cda9b7dd..a89f73e98 100644 --- a/graphics/pokemon/chikorita/normal.pal +++ b/graphics/pokemon/chikorita/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 192 192 248 -80 136 32 -64 96 24 -144 208 96 -104 176 72 +98 139 41 +65 98 24 +131 230 49 +106 180 41 0 0 0 -96 96 56 -152 152 88 -224 232 168 -240 240 208 -184 200 120 -192 192 192 -248 248 248 -96 64 88 -192 40 40 -232 120 120 +65 90 24 +131 148 82 +213 246 139 +238 255 197 +180 205 106 +197 197 197 +255 255 255 +98 65 90 +197 41 41 +238 123 123 diff --git a/graphics/pokemon/chimchar/front.png b/graphics/pokemon/chimchar/front.png deleted file mode 100644 index 1a0e606a8..000000000 Binary files a/graphics/pokemon/chimchar/front.png and /dev/null differ diff --git a/graphics/pokemon/chimecho/front.png b/graphics/pokemon/chimecho/front.png deleted file mode 100644 index 7d9992580..000000000 Binary files a/graphics/pokemon/chimecho/front.png and /dev/null differ diff --git a/graphics/pokemon/chinchou/anim_front.png b/graphics/pokemon/chinchou/anim_front.png index 370a5a99d..1b7e9ee03 100644 Binary files a/graphics/pokemon/chinchou/anim_front.png and b/graphics/pokemon/chinchou/anim_front.png differ diff --git a/graphics/pokemon/chinchou/front.png b/graphics/pokemon/chinchou/front.png deleted file mode 100644 index 348090d34..000000000 Binary files a/graphics/pokemon/chinchou/front.png and /dev/null differ diff --git a/graphics/pokemon/chinchou/normal.pal b/graphics/pokemon/chinchou/normal.pal index a2d9c8aca..5af02cce9 100644 --- a/graphics/pokemon/chinchou/normal.pal +++ b/graphics/pokemon/chinchou/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -88 112 192 -40 80 144 -120 152 216 -184 152 32 -240 216 56 -184 192 232 -8 40 88 +90 115 197 +41 82 148 +106 164 230 +197 148 0 +255 205 82 +148 205 230 +8 41 90 0 0 0 -128 96 80 -80 40 24 -248 232 128 -216 184 48 -144 160 224 -176 0 0 +131 98 82 +82 41 24 +255 238 131 +230 180 41 +123 189 230 +180 0 0 0 0 0 diff --git a/graphics/pokemon/chingling/front.png b/graphics/pokemon/chingling/front.png deleted file mode 100644 index d8092f393..000000000 Binary files a/graphics/pokemon/chingling/front.png and /dev/null differ diff --git a/graphics/pokemon/cinccino/back.png b/graphics/pokemon/cinccino/back.png index 6855ace88..b97531f9f 100644 Binary files a/graphics/pokemon/cinccino/back.png and b/graphics/pokemon/cinccino/back.png differ diff --git a/graphics/pokemon/cinccino/front.png b/graphics/pokemon/cinccino/front.png deleted file mode 100644 index 12d953daf..000000000 Binary files a/graphics/pokemon/cinccino/front.png and /dev/null differ diff --git a/graphics/pokemon/cinderace/back.png b/graphics/pokemon/cinderace/back.png index 701208e67..6af38da2b 100644 Binary files a/graphics/pokemon/cinderace/back.png and b/graphics/pokemon/cinderace/back.png differ diff --git a/graphics/pokemon/cinderace/front.png b/graphics/pokemon/cinderace/front.png index fe11d997e..d4b086a78 100644 Binary files a/graphics/pokemon/cinderace/front.png and b/graphics/pokemon/cinderace/front.png differ diff --git a/graphics/pokemon/clamperl/front.png b/graphics/pokemon/clamperl/front.png deleted file mode 100644 index dab2d9881..000000000 Binary files a/graphics/pokemon/clamperl/front.png and /dev/null differ diff --git a/graphics/pokemon/clauncher/front.png b/graphics/pokemon/clauncher/front.png deleted file mode 100644 index ade9f6518..000000000 Binary files a/graphics/pokemon/clauncher/front.png and /dev/null differ diff --git a/graphics/pokemon/clawitzer/front.png b/graphics/pokemon/clawitzer/front.png deleted file mode 100644 index 8c6c2f048..000000000 Binary files a/graphics/pokemon/clawitzer/front.png and /dev/null differ diff --git a/graphics/pokemon/claydol/front.png b/graphics/pokemon/claydol/front.png deleted file mode 100644 index cc2f1c16e..000000000 Binary files a/graphics/pokemon/claydol/front.png and /dev/null differ diff --git a/graphics/pokemon/clefable/anim_front.png b/graphics/pokemon/clefable/anim_front.png index e4a6228e1..279172929 100644 Binary files a/graphics/pokemon/clefable/anim_front.png and b/graphics/pokemon/clefable/anim_front.png differ diff --git a/graphics/pokemon/clefable/back.png b/graphics/pokemon/clefable/back.png index 2d7cbbdef..11b37f35f 100644 Binary files a/graphics/pokemon/clefable/back.png and b/graphics/pokemon/clefable/back.png differ diff --git a/graphics/pokemon/clefable/front.png b/graphics/pokemon/clefable/front.png deleted file mode 100644 index c3c70dc1e..000000000 Binary files a/graphics/pokemon/clefable/front.png and /dev/null differ diff --git a/graphics/pokemon/clefable/normal.pal b/graphics/pokemon/clefable/normal.pal index 69bf321d7..242352f05 100644 --- a/graphics/pokemon/clefable/normal.pal +++ b/graphics/pokemon/clefable/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -80 64 56 +82 65 57 16 16 16 -120 104 96 -136 72 80 -216 96 96 -248 192 176 -232 144 144 -184 88 120 -104 72 80 -208 120 160 +123 106 98 +139 74 82 +222 98 98 +255 197 180 +238 148 148 +189 90 123 +82 49 74 +213 123 164 248 248 248 -128 128 128 -208 120 136 -136 72 80 +131 131 131 +213 123 139 +222 57 90 104 72 80 diff --git a/graphics/pokemon/clefable/shiny.pal b/graphics/pokemon/clefable/shiny.pal index 11daecf72..0ab423cdc 100644 --- a/graphics/pokemon/clefable/shiny.pal +++ b/graphics/pokemon/clefable/shiny.pal @@ -15,5 +15,5 @@ JASC-PAL 248 248 248 128 128 128 208 136 152 -184 96 96 +222 57 90 80 48 72 diff --git a/graphics/pokemon/clefairy/anim_front.png b/graphics/pokemon/clefairy/anim_front.png index ecbe37a1b..5f7e02a6e 100644 Binary files a/graphics/pokemon/clefairy/anim_front.png and b/graphics/pokemon/clefairy/anim_front.png differ diff --git a/graphics/pokemon/clefairy/front.png b/graphics/pokemon/clefairy/front.png deleted file mode 100644 index 613905a3a..000000000 Binary files a/graphics/pokemon/clefairy/front.png and /dev/null differ diff --git a/graphics/pokemon/clefairy/normal.pal b/graphics/pokemon/clefairy/normal.pal index 6d31bfa49..ac2d66f74 100644 --- a/graphics/pokemon/clefairy/normal.pal +++ b/graphics/pokemon/clefairy/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 80 88 -184 128 136 -248 208 184 -112 72 56 -88 48 32 -152 128 112 +156 82 82 +230 123 123 +255 213 189 +115 74 57 +90 49 32 +156 131 115 16 16 16 -248 168 168 -144 144 144 -248 248 248 -232 64 56 -64 120 168 +255 172 172 +148 148 148 +255 255 255 +238 65 57 +148 148 148 176 56 40 0 0 0 0 0 0 diff --git a/graphics/pokemon/cleffa/anim_front.png b/graphics/pokemon/cleffa/anim_front.png index 2f3e541f7..9f2ee497f 100644 Binary files a/graphics/pokemon/cleffa/anim_front.png and b/graphics/pokemon/cleffa/anim_front.png differ diff --git a/graphics/pokemon/cleffa/front.png b/graphics/pokemon/cleffa/front.png deleted file mode 100644 index a8d989f26..000000000 Binary files a/graphics/pokemon/cleffa/front.png and /dev/null differ diff --git a/graphics/pokemon/cleffa/normal.pal b/graphics/pokemon/cleffa/normal.pal index d6dafd798..c4944c7c6 100644 --- a/graphics/pokemon/cleffa/normal.pal +++ b/graphics/pokemon/cleffa/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 168 80 80 -248 208 200 -248 160 160 -200 128 128 -80 48 40 -88 48 32 -112 72 56 +255 213 205 +255 164 164 +205 131 131 +98 32 24 +115 74 49 +156 98 8 16 16 16 -152 128 112 +197 139 41 248 248 248 -248 112 80 -248 152 120 -192 64 64 +205 131 131 +255 164 164 +156 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/cloyster/anim_front.png b/graphics/pokemon/cloyster/anim_front.png index 4ed517f83..bce084388 100644 Binary files a/graphics/pokemon/cloyster/anim_front.png and b/graphics/pokemon/cloyster/anim_front.png differ diff --git a/graphics/pokemon/cloyster/front.png b/graphics/pokemon/cloyster/front.png deleted file mode 100644 index 1d9237036..000000000 Binary files a/graphics/pokemon/cloyster/front.png and /dev/null differ diff --git a/graphics/pokemon/cloyster/normal.pal b/graphics/pokemon/cloyster/normal.pal index 2e777740f..725b26809 100644 --- a/graphics/pokemon/cloyster/normal.pal +++ b/graphics/pokemon/cloyster/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -104 88 144 -184 168 232 -136 120 184 -40 32 72 +123 82 131 +213 189 238 +172 123 189 +74 32 82 16 16 16 -192 192 192 -64 64 64 +197 197 197 +65 65 65 248 248 248 -144 144 144 -96 96 96 -56 40 104 -112 104 176 -64 56 152 -160 120 184 +148 148 148 +98 98 98 +82 41 90 +131 90 164 +106 65 131 +164 123 189 120 96 176 diff --git a/graphics/pokemon/cobalion/front.png b/graphics/pokemon/cobalion/front.png deleted file mode 100644 index c57b709d3..000000000 Binary files a/graphics/pokemon/cobalion/front.png and /dev/null differ diff --git a/graphics/pokemon/cofagrigus/front.png b/graphics/pokemon/cofagrigus/front.png deleted file mode 100644 index c48dbdaa4..000000000 Binary files a/graphics/pokemon/cofagrigus/front.png and /dev/null differ diff --git a/graphics/pokemon/combee/front.png b/graphics/pokemon/combee/front.png deleted file mode 100644 index 4c1368df4..000000000 Binary files a/graphics/pokemon/combee/front.png and /dev/null differ diff --git a/graphics/pokemon/combusken/front.png b/graphics/pokemon/combusken/front.png deleted file mode 100644 index 2c2b6a5a1..000000000 Binary files a/graphics/pokemon/combusken/front.png and /dev/null differ diff --git a/graphics/pokemon/conkeldurr/front.png b/graphics/pokemon/conkeldurr/front.png deleted file mode 100644 index bfa9221f9..000000000 Binary files a/graphics/pokemon/conkeldurr/front.png and /dev/null differ diff --git a/graphics/pokemon/corphish/front.png b/graphics/pokemon/corphish/front.png deleted file mode 100644 index 3a78a7b01..000000000 Binary files a/graphics/pokemon/corphish/front.png and /dev/null differ diff --git a/graphics/pokemon/corsola/front.png b/graphics/pokemon/corsola/front.png deleted file mode 100644 index b82fbceb5..000000000 Binary files a/graphics/pokemon/corsola/front.png and /dev/null differ diff --git a/graphics/pokemon/corsola/galarian/front.png b/graphics/pokemon/corsola/galarian/front.png index e9b4a7ded..19d22f3b8 100644 Binary files a/graphics/pokemon/corsola/galarian/front.png and b/graphics/pokemon/corsola/galarian/front.png differ diff --git a/graphics/pokemon/cottonee/front.png b/graphics/pokemon/cottonee/front.png deleted file mode 100644 index 0e807ff42..000000000 Binary files a/graphics/pokemon/cottonee/front.png and /dev/null differ diff --git a/graphics/pokemon/cradily/front.png b/graphics/pokemon/cradily/front.png deleted file mode 100644 index 0280dedf9..000000000 Binary files a/graphics/pokemon/cradily/front.png and /dev/null differ diff --git a/graphics/pokemon/cranidos/back.png b/graphics/pokemon/cranidos/back.png index 54947660c..39aacf0ba 100644 Binary files a/graphics/pokemon/cranidos/back.png and b/graphics/pokemon/cranidos/back.png differ diff --git a/graphics/pokemon/cranidos/front.png b/graphics/pokemon/cranidos/front.png deleted file mode 100644 index 000533a92..000000000 Binary files a/graphics/pokemon/cranidos/front.png and /dev/null differ diff --git a/graphics/pokemon/crawdaunt/front.png b/graphics/pokemon/crawdaunt/front.png deleted file mode 100644 index ede486992..000000000 Binary files a/graphics/pokemon/crawdaunt/front.png and /dev/null differ diff --git a/graphics/pokemon/cresselia/front.png b/graphics/pokemon/cresselia/front.png deleted file mode 100644 index 56a6f004f..000000000 Binary files a/graphics/pokemon/cresselia/front.png and /dev/null differ diff --git a/graphics/pokemon/croagunk/front.png b/graphics/pokemon/croagunk/front.png deleted file mode 100644 index 6725ae39e..000000000 Binary files a/graphics/pokemon/croagunk/front.png and /dev/null differ diff --git a/graphics/pokemon/crobat/anim_front.png b/graphics/pokemon/crobat/anim_front.png index abf3b22be..9275d8309 100644 Binary files a/graphics/pokemon/crobat/anim_front.png and b/graphics/pokemon/crobat/anim_front.png differ diff --git a/graphics/pokemon/crobat/front.png b/graphics/pokemon/crobat/front.png deleted file mode 100644 index e0b69bad7..000000000 Binary files a/graphics/pokemon/crobat/front.png and /dev/null differ diff --git a/graphics/pokemon/crobat/normal.pal b/graphics/pokemon/crobat/normal.pal index c8b289770..5db72c9cf 100644 --- a/graphics/pokemon/crobat/normal.pal +++ b/graphics/pokemon/crobat/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -96 24 120 -120 72 152 -176 120 200 +90 41 115 +131 74 205 +205 139 246 16 16 16 -8 64 104 -32 104 144 -160 88 200 -72 152 184 -208 144 0 -248 208 0 -176 0 0 -104 104 104 -160 160 160 -248 248 248 +8 65 106 +32 106 148 +172 90 255 +74 156 189 +213 148 0 +255 213 0 +180 0 0 +106 106 106 +164 164 164 +255 255 255 0 0 0 diff --git a/graphics/pokemon/croconaw/anim_front.png b/graphics/pokemon/croconaw/anim_front.png index bdd5340fd..3fc9ff81f 100644 Binary files a/graphics/pokemon/croconaw/anim_front.png and b/graphics/pokemon/croconaw/anim_front.png differ diff --git a/graphics/pokemon/croconaw/front.png b/graphics/pokemon/croconaw/front.png deleted file mode 100644 index b1cd5b3b6..000000000 Binary files a/graphics/pokemon/croconaw/front.png and /dev/null differ diff --git a/graphics/pokemon/croconaw/normal.pal b/graphics/pokemon/croconaw/normal.pal index 95fb4e450..1a33a193e 100644 --- a/graphics/pokemon/croconaw/normal.pal +++ b/graphics/pokemon/croconaw/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -128 0 8 -248 136 128 +156 16 32 +255 172 90 16 16 16 -240 80 88 -200 40 56 -32 96 120 -32 136 184 -104 200 200 -136 232 224 -248 248 248 -120 0 0 -224 64 32 -104 80 0 -200 184 96 -248 224 136 +255 74 74 +213 24 16 +32 98 123 +32 139 189 +106 205 205 +139 238 230 +255 255 255 +123 0 0 +230 65 32 +139 98 0 +238 180 74 +255 255 98 diff --git a/graphics/pokemon/crustle/front.png b/graphics/pokemon/crustle/front.png deleted file mode 100644 index 44fa563a2..000000000 Binary files a/graphics/pokemon/crustle/front.png and /dev/null differ diff --git a/graphics/pokemon/cryogonal/front.png b/graphics/pokemon/cryogonal/front.png deleted file mode 100644 index e3cd4c10f..000000000 Binary files a/graphics/pokemon/cryogonal/front.png and /dev/null differ diff --git a/graphics/pokemon/cubchoo/front.png b/graphics/pokemon/cubchoo/front.png deleted file mode 100644 index 82e5e9194..000000000 Binary files a/graphics/pokemon/cubchoo/front.png and /dev/null differ diff --git a/graphics/pokemon/cubone/anim_front.png b/graphics/pokemon/cubone/anim_front.png index 8294ce638..5b98b8d8a 100644 Binary files a/graphics/pokemon/cubone/anim_front.png and b/graphics/pokemon/cubone/anim_front.png differ diff --git a/graphics/pokemon/cubone/front.png b/graphics/pokemon/cubone/front.png deleted file mode 100644 index f26df5792..000000000 Binary files a/graphics/pokemon/cubone/front.png and /dev/null differ diff --git a/graphics/pokemon/cubone/normal.pal b/graphics/pokemon/cubone/normal.pal index e18a70567..8613b94a2 100644 --- a/graphics/pokemon/cubone/normal.pal +++ b/graphics/pokemon/cubone/normal.pal @@ -2,14 +2,14 @@ JASC-PAL 0100 16 152 208 160 -128 128 128 +139 131 106 248 248 248 -0 0 0 -192 192 208 -80 80 56 -144 104 88 -192 152 72 -80 56 16 +41 41 41 +197 197 213 +82 82 57 +148 106 90 +197 156 74 +82 57 16 200 168 136 240 208 176 224 224 232 diff --git a/graphics/pokemon/cursola/front.png b/graphics/pokemon/cursola/front.png index 01f189f5c..d4811ab1e 100644 Binary files a/graphics/pokemon/cursola/front.png and b/graphics/pokemon/cursola/front.png differ diff --git a/graphics/pokemon/cyndaquil/anim_front.png b/graphics/pokemon/cyndaquil/anim_front.png index bfdf5a622..3649ae50e 100644 Binary files a/graphics/pokemon/cyndaquil/anim_front.png and b/graphics/pokemon/cyndaquil/anim_front.png differ diff --git a/graphics/pokemon/cyndaquil/front.png b/graphics/pokemon/cyndaquil/front.png deleted file mode 100644 index 448a51f8a..000000000 Binary files a/graphics/pokemon/cyndaquil/front.png and /dev/null differ diff --git a/graphics/pokemon/cyndaquil/normal.pal b/graphics/pokemon/cyndaquil/normal.pal index f5182e5ee..b600ed85e 100644 --- a/graphics/pokemon/cyndaquil/normal.pal +++ b/graphics/pokemon/cyndaquil/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -216 0 0 -248 56 0 -16 56 80 -48 104 128 -96 168 184 -248 152 0 +222 0 0 +255 90 0 +41 82 82 +57 98 123 +98 131 156 +255 156 0 16 16 16 -248 216 16 -16 40 48 -200 168 80 -248 240 160 -120 96 32 -216 176 120 -168 168 168 +255 222 0 +24 57 74 +197 164 106 +255 238 164 +123 98 32 +230 205 106 +172 172 172 248 248 248 diff --git a/graphics/pokemon/darkrai/front.png b/graphics/pokemon/darkrai/front.png deleted file mode 100644 index e3f284abd..000000000 Binary files a/graphics/pokemon/darkrai/front.png and /dev/null differ diff --git a/graphics/pokemon/darmanitan/front.png b/graphics/pokemon/darmanitan/front.png deleted file mode 100644 index 137b407ba..000000000 Binary files a/graphics/pokemon/darmanitan/front.png and /dev/null differ diff --git a/graphics/pokemon/darmanitan/zen_mode/front.png b/graphics/pokemon/darmanitan/zen_mode/front.png deleted file mode 100644 index 84ace43cf..000000000 Binary files a/graphics/pokemon/darmanitan/zen_mode/front.png and /dev/null differ diff --git a/graphics/pokemon/darmanitan/zen_mode/icon.png b/graphics/pokemon/darmanitan/zen_mode/icon.png index f9e867478..b563d4f2a 100644 Binary files a/graphics/pokemon/darmanitan/zen_mode/icon.png and b/graphics/pokemon/darmanitan/zen_mode/icon.png differ diff --git a/graphics/pokemon/darumaka/front.png b/graphics/pokemon/darumaka/front.png deleted file mode 100644 index 92a3645d2..000000000 Binary files a/graphics/pokemon/darumaka/front.png and /dev/null differ diff --git a/graphics/pokemon/dedenne/front.png b/graphics/pokemon/dedenne/front.png deleted file mode 100644 index 05e9403c5..000000000 Binary files a/graphics/pokemon/dedenne/front.png and /dev/null differ diff --git a/graphics/pokemon/deerling/autumn/icon.png b/graphics/pokemon/deerling/autumn/icon.png index 7c14c05cb..4181194e1 100644 Binary files a/graphics/pokemon/deerling/autumn/icon.png and b/graphics/pokemon/deerling/autumn/icon.png differ diff --git a/graphics/pokemon/deerling/front.png b/graphics/pokemon/deerling/front.png deleted file mode 100644 index cade6f0db..000000000 Binary files a/graphics/pokemon/deerling/front.png and /dev/null differ diff --git a/graphics/pokemon/deerling/summer/icon.png b/graphics/pokemon/deerling/summer/icon.png index 7a95355c3..c3358ab9f 100644 Binary files a/graphics/pokemon/deerling/summer/icon.png and b/graphics/pokemon/deerling/summer/icon.png differ diff --git a/graphics/pokemon/deerling/winter/icon.png b/graphics/pokemon/deerling/winter/icon.png index a7259c67e..6528ea971 100644 Binary files a/graphics/pokemon/deerling/winter/icon.png and b/graphics/pokemon/deerling/winter/icon.png differ diff --git a/graphics/pokemon/deino/front.png b/graphics/pokemon/deino/front.png deleted file mode 100644 index 835771003..000000000 Binary files a/graphics/pokemon/deino/front.png and /dev/null differ diff --git a/graphics/pokemon/delcatty/front.png b/graphics/pokemon/delcatty/front.png deleted file mode 100644 index bdb666e03..000000000 Binary files a/graphics/pokemon/delcatty/front.png and /dev/null differ diff --git a/graphics/pokemon/delibird/front.png b/graphics/pokemon/delibird/front.png deleted file mode 100644 index a0eaf79af..000000000 Binary files a/graphics/pokemon/delibird/front.png and /dev/null differ diff --git a/graphics/pokemon/delphox/front.png b/graphics/pokemon/delphox/front.png deleted file mode 100644 index 939b538c4..000000000 Binary files a/graphics/pokemon/delphox/front.png and /dev/null differ diff --git a/graphics/pokemon/deoxys/attack/front.png b/graphics/pokemon/deoxys/attack/front.png deleted file mode 100644 index 5080dd28e..000000000 Binary files a/graphics/pokemon/deoxys/attack/front.png and /dev/null differ diff --git a/graphics/pokemon/deoxys/defense/front.png b/graphics/pokemon/deoxys/defense/front.png deleted file mode 100644 index 2e21b5592..000000000 Binary files a/graphics/pokemon/deoxys/defense/front.png and /dev/null differ diff --git a/graphics/pokemon/deoxys/front.png b/graphics/pokemon/deoxys/front.png deleted file mode 100644 index 5c2c25314..000000000 Binary files a/graphics/pokemon/deoxys/front.png and /dev/null differ diff --git a/graphics/pokemon/deoxys/speed/front.png b/graphics/pokemon/deoxys/speed/front.png deleted file mode 100644 index 776d0083b..000000000 Binary files a/graphics/pokemon/deoxys/speed/front.png and /dev/null differ diff --git a/graphics/pokemon/dewgong/anim_front.png b/graphics/pokemon/dewgong/anim_front.png index 441976782..a76739550 100644 Binary files a/graphics/pokemon/dewgong/anim_front.png and b/graphics/pokemon/dewgong/anim_front.png differ diff --git a/graphics/pokemon/dewgong/back.png b/graphics/pokemon/dewgong/back.png index 1d5e35fdf..90b5ae680 100644 Binary files a/graphics/pokemon/dewgong/back.png and b/graphics/pokemon/dewgong/back.png differ diff --git a/graphics/pokemon/dewgong/front.png b/graphics/pokemon/dewgong/front.png deleted file mode 100644 index afaaaf5c3..000000000 Binary files a/graphics/pokemon/dewgong/front.png and /dev/null differ diff --git a/graphics/pokemon/dewgong/normal.pal b/graphics/pokemon/dewgong/normal.pal index ea9cd39ea..15ddd52bd 100644 --- a/graphics/pokemon/dewgong/normal.pal +++ b/graphics/pokemon/dewgong/normal.pal @@ -3,13 +3,13 @@ JASC-PAL 16 153 210 164 106 123 164 -69 73 96 -161 167 204 -219 235 249 +65 82 98 +156 164 189 +230 230 246 16 16 16 -192 207 226 +213 205 238 255 255 255 -114 92 75 +131 123 123 112 40 40 232 128 120 0 0 0 diff --git a/graphics/pokemon/dewott/front.png b/graphics/pokemon/dewott/front.png deleted file mode 100644 index d8665e601..000000000 Binary files a/graphics/pokemon/dewott/front.png and /dev/null differ diff --git a/graphics/pokemon/dialga/front.png b/graphics/pokemon/dialga/front.png deleted file mode 100644 index e4a6172ac..000000000 Binary files a/graphics/pokemon/dialga/front.png and /dev/null differ diff --git a/graphics/pokemon/diancie/front.png b/graphics/pokemon/diancie/front.png deleted file mode 100644 index c99768d64..000000000 Binary files a/graphics/pokemon/diancie/front.png and /dev/null differ diff --git a/graphics/pokemon/diggersby/front.png b/graphics/pokemon/diggersby/front.png deleted file mode 100644 index 90ff136ab..000000000 Binary files a/graphics/pokemon/diggersby/front.png and /dev/null differ diff --git a/graphics/pokemon/diglett/anim_front.png b/graphics/pokemon/diglett/anim_front.png index 9bea44acb..a652b6645 100644 Binary files a/graphics/pokemon/diglett/anim_front.png and b/graphics/pokemon/diglett/anim_front.png differ diff --git a/graphics/pokemon/diglett/front.png b/graphics/pokemon/diglett/front.png deleted file mode 100644 index 34bb253af..000000000 Binary files a/graphics/pokemon/diglett/front.png and /dev/null differ diff --git a/graphics/pokemon/diglett/normal.pal b/graphics/pokemon/diglett/normal.pal index b8930cba2..0e0e4694c 100644 --- a/graphics/pokemon/diglett/normal.pal +++ b/graphics/pokemon/diglett/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -160 88 88 -216 152 88 -192 112 64 -88 48 24 -248 248 248 +164 90 90 +222 156 90 +197 115 65 +90 49 24 +255 255 255 16 16 16 -192 32 136 -144 64 112 -248 176 224 -232 120 184 -96 96 104 -136 136 144 -56 56 56 -176 184 192 +213 57 74 +115 0 24 +255 172 148 +255 106 90 +131 123 74 +180 172 115 +90 82 32 +230 230 180 0 0 0 diff --git a/graphics/pokemon/ditto/back.png b/graphics/pokemon/ditto/back.png index 9768f89a1..5bea88a4a 100644 Binary files a/graphics/pokemon/ditto/back.png and b/graphics/pokemon/ditto/back.png differ diff --git a/graphics/pokemon/ditto/front.png b/graphics/pokemon/ditto/front.png deleted file mode 100644 index 73603b303..000000000 Binary files a/graphics/pokemon/ditto/front.png and /dev/null differ diff --git a/graphics/pokemon/dodrio/anim_front.png b/graphics/pokemon/dodrio/anim_front.png index a569e5893..43c37974f 100644 Binary files a/graphics/pokemon/dodrio/anim_front.png and b/graphics/pokemon/dodrio/anim_front.png differ diff --git a/graphics/pokemon/dodrio/front.png b/graphics/pokemon/dodrio/front.png deleted file mode 100644 index 5edcba27c..000000000 Binary files a/graphics/pokemon/dodrio/front.png and /dev/null differ diff --git a/graphics/pokemon/dodrio/normal.pal b/graphics/pokemon/dodrio/normal.pal index e4205972a..1569ba019 100644 --- a/graphics/pokemon/dodrio/normal.pal +++ b/graphics/pokemon/dodrio/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -64 64 64 +65 65 65 16 16 16 -104 104 104 -160 120 88 -88 48 32 -200 152 80 +131 131 131 +164 123 90 +90 65 32 +205 156 82 248 248 248 -96 88 64 -232 216 168 -176 160 120 -112 40 40 -232 128 120 -176 64 64 -240 128 160 -248 208 224 +98 90 65 +238 222 172 +180 164 123 +180 65 65 +246 131 164 +180 65 65 +246 131 164 +255 213 230 diff --git a/graphics/pokemon/doduo/front.png b/graphics/pokemon/doduo/front.png deleted file mode 100644 index 6222a7e27..000000000 Binary files a/graphics/pokemon/doduo/front.png and /dev/null differ diff --git a/graphics/pokemon/donphan/front.png b/graphics/pokemon/donphan/front.png deleted file mode 100644 index cb344b85b..000000000 Binary files a/graphics/pokemon/donphan/front.png and /dev/null differ diff --git a/graphics/pokemon/doublade/front.png b/graphics/pokemon/doublade/front.png deleted file mode 100644 index b2bd15029..000000000 Binary files a/graphics/pokemon/doublade/front.png and /dev/null differ diff --git a/graphics/pokemon/dragalge/front.png b/graphics/pokemon/dragalge/front.png deleted file mode 100644 index be813026f..000000000 Binary files a/graphics/pokemon/dragalge/front.png and /dev/null differ diff --git a/graphics/pokemon/dragonair/front.png b/graphics/pokemon/dragonair/front.png deleted file mode 100644 index 91fea694e..000000000 Binary files a/graphics/pokemon/dragonair/front.png and /dev/null differ diff --git a/graphics/pokemon/dragonite/anim_front.png b/graphics/pokemon/dragonite/anim_front.png index b0a230528..2e067903b 100644 Binary files a/graphics/pokemon/dragonite/anim_front.png and b/graphics/pokemon/dragonite/anim_front.png differ diff --git a/graphics/pokemon/dragonite/front.png b/graphics/pokemon/dragonite/front.png deleted file mode 100644 index 0d4314b70..000000000 Binary files a/graphics/pokemon/dragonite/front.png and /dev/null differ diff --git a/graphics/pokemon/dragonite/normal.pal b/graphics/pokemon/dragonite/normal.pal index 493e8a7f7..665b93fbb 100644 --- a/graphics/pokemon/dragonite/normal.pal +++ b/graphics/pokemon/dragonite/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 152 88 72 -248 232 184 -208 136 48 -232 184 136 +255 238 189 +213 139 49 +238 189 139 248 200 104 -232 176 72 +238 180 74 88 56 32 248 248 248 200 200 200 16 16 16 96 96 96 -32 80 64 -24 104 96 -32 160 120 -152 128 88 +16 65 49 +24 106 98 +32 164 123 +172 139 65 diff --git a/graphics/pokemon/drapion/front.png b/graphics/pokemon/drapion/front.png deleted file mode 100644 index 57734a284..000000000 Binary files a/graphics/pokemon/drapion/front.png and /dev/null differ diff --git a/graphics/pokemon/dratini/front.png b/graphics/pokemon/dratini/front.png deleted file mode 100644 index ee6f3bc45..000000000 Binary files a/graphics/pokemon/dratini/front.png and /dev/null differ diff --git a/graphics/pokemon/drifblim/front.png b/graphics/pokemon/drifblim/front.png deleted file mode 100644 index f6cf9d5f9..000000000 Binary files a/graphics/pokemon/drifblim/front.png and /dev/null differ diff --git a/graphics/pokemon/drifloon/front.png b/graphics/pokemon/drifloon/front.png deleted file mode 100644 index dea6e8871..000000000 Binary files a/graphics/pokemon/drifloon/front.png and /dev/null differ diff --git a/graphics/pokemon/drilbur/front.png b/graphics/pokemon/drilbur/front.png deleted file mode 100644 index 1bb3bb20d..000000000 Binary files a/graphics/pokemon/drilbur/front.png and /dev/null differ diff --git a/graphics/pokemon/drowzee/front.png b/graphics/pokemon/drowzee/front.png deleted file mode 100644 index b1296df0e..000000000 Binary files a/graphics/pokemon/drowzee/front.png and /dev/null differ diff --git a/graphics/pokemon/druddigon/front.png b/graphics/pokemon/druddigon/front.png deleted file mode 100644 index a522546a2..000000000 Binary files a/graphics/pokemon/druddigon/front.png and /dev/null differ diff --git a/graphics/pokemon/ducklett/front.png b/graphics/pokemon/ducklett/front.png deleted file mode 100644 index f86b61a3d..000000000 Binary files a/graphics/pokemon/ducklett/front.png and /dev/null differ diff --git a/graphics/pokemon/dugtrio/anim_front.png b/graphics/pokemon/dugtrio/anim_front.png index 80339c70d..12a88a418 100644 Binary files a/graphics/pokemon/dugtrio/anim_front.png and b/graphics/pokemon/dugtrio/anim_front.png differ diff --git a/graphics/pokemon/dugtrio/front.png b/graphics/pokemon/dugtrio/front.png deleted file mode 100644 index 4e1b6c280..000000000 Binary files a/graphics/pokemon/dugtrio/front.png and /dev/null differ diff --git a/graphics/pokemon/dugtrio/normal.pal b/graphics/pokemon/dugtrio/normal.pal index 592302dc8..834d6d4db 100644 --- a/graphics/pokemon/dugtrio/normal.pal +++ b/graphics/pokemon/dugtrio/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -160 88 88 -216 152 88 -88 48 24 -192 112 64 -248 248 248 +164 90 90 +222 156 90 +90 49 24 +197 115 65 +255 255 255 16 16 16 -144 64 112 -248 176 224 -232 120 184 -192 32 136 -96 96 104 -136 136 144 -56 56 56 -176 184 192 +115 0 24 +255 172 148 +255 106 90 +213 57 74 +131 123 74 +180 172 115 +90 82 32 +230 230 180 0 0 0 diff --git a/graphics/pokemon/dunsparce/back.png b/graphics/pokemon/dunsparce/back.png index 03dc3acbb..c19d4b5db 100644 Binary files a/graphics/pokemon/dunsparce/back.png and b/graphics/pokemon/dunsparce/back.png differ diff --git a/graphics/pokemon/dunsparce/front.png b/graphics/pokemon/dunsparce/front.png deleted file mode 100644 index 660f5e1a1..000000000 Binary files a/graphics/pokemon/dunsparce/front.png and /dev/null differ diff --git a/graphics/pokemon/duosion/front.png b/graphics/pokemon/duosion/front.png deleted file mode 100644 index acf0c1c0d..000000000 Binary files a/graphics/pokemon/duosion/front.png and /dev/null differ diff --git a/graphics/pokemon/durant/front.png b/graphics/pokemon/durant/front.png deleted file mode 100644 index 0320e654f..000000000 Binary files a/graphics/pokemon/durant/front.png and /dev/null differ diff --git a/graphics/pokemon/dusclops/front.png b/graphics/pokemon/dusclops/front.png deleted file mode 100644 index 58a0d15ab..000000000 Binary files a/graphics/pokemon/dusclops/front.png and /dev/null differ diff --git a/graphics/pokemon/dusknoir/front.png b/graphics/pokemon/dusknoir/front.png deleted file mode 100644 index 95a5ccea9..000000000 Binary files a/graphics/pokemon/dusknoir/front.png and /dev/null differ diff --git a/graphics/pokemon/duskull/front.png b/graphics/pokemon/duskull/front.png deleted file mode 100644 index 33903c773..000000000 Binary files a/graphics/pokemon/duskull/front.png and /dev/null differ diff --git a/graphics/pokemon/dustox/front.png b/graphics/pokemon/dustox/front.png deleted file mode 100644 index 356320c18..000000000 Binary files a/graphics/pokemon/dustox/front.png and /dev/null differ diff --git a/graphics/pokemon/dwebble/front.png b/graphics/pokemon/dwebble/front.png deleted file mode 100644 index 560295f56..000000000 Binary files a/graphics/pokemon/dwebble/front.png and /dev/null differ diff --git a/graphics/pokemon/eelektrik/front.png b/graphics/pokemon/eelektrik/front.png deleted file mode 100644 index 6bb7cc764..000000000 Binary files a/graphics/pokemon/eelektrik/front.png and /dev/null differ diff --git a/graphics/pokemon/eelektross/front.png b/graphics/pokemon/eelektross/front.png deleted file mode 100644 index b1ae70adb..000000000 Binary files a/graphics/pokemon/eelektross/front.png and /dev/null differ diff --git a/graphics/pokemon/eevee/anim_front.png b/graphics/pokemon/eevee/anim_front.png index d419e87fc..7f45d8592 100644 Binary files a/graphics/pokemon/eevee/anim_front.png and b/graphics/pokemon/eevee/anim_front.png differ diff --git a/graphics/pokemon/eevee/anim_frontf.png b/graphics/pokemon/eevee/anim_frontf.png index 48cb88317..2f9da3756 100644 Binary files a/graphics/pokemon/eevee/anim_frontf.png and b/graphics/pokemon/eevee/anim_frontf.png differ diff --git a/graphics/pokemon/eevee/backf.png b/graphics/pokemon/eevee/backf.png index 7689d995b..6c265361f 100644 Binary files a/graphics/pokemon/eevee/backf.png and b/graphics/pokemon/eevee/backf.png differ diff --git a/graphics/pokemon/eevee/front.png b/graphics/pokemon/eevee/front.png deleted file mode 100644 index 1a2292913..000000000 Binary files a/graphics/pokemon/eevee/front.png and /dev/null differ diff --git a/graphics/pokemon/eevee/frontf.png b/graphics/pokemon/eevee/frontf.png index f7241f496..3eb2e2c96 100644 Binary files a/graphics/pokemon/eevee/frontf.png and b/graphics/pokemon/eevee/frontf.png differ diff --git a/graphics/pokemon/eevee/normal.pal b/graphics/pokemon/eevee/normal.pal index 43bc46c9b..ecb420948 100644 --- a/graphics/pokemon/eevee/normal.pal +++ b/graphics/pokemon/eevee/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -160 96 72 -112 72 72 -208 152 72 -16 16 16 -56 40 24 -96 48 32 -184 152 120 -224 192 144 +165 99 74 +115 74 74 +214 156 74 +0 0 0 +82 49 33 +82 49 33 +189 156 123 +230 197 148 248 248 248 -248 224 168 +255 230 173 224 184 120 96 72 56 0 0 0 diff --git a/graphics/pokemon/egg/front.png b/graphics/pokemon/egg/front.png deleted file mode 100644 index d9680a899..000000000 Binary files a/graphics/pokemon/egg/front.png and /dev/null differ diff --git a/graphics/pokemon/ekans/anim_front.png b/graphics/pokemon/ekans/anim_front.png index abea49e51..1441532a4 100644 Binary files a/graphics/pokemon/ekans/anim_front.png and b/graphics/pokemon/ekans/anim_front.png differ diff --git a/graphics/pokemon/ekans/front.png b/graphics/pokemon/ekans/front.png deleted file mode 100644 index 721886da3..000000000 Binary files a/graphics/pokemon/ekans/front.png and /dev/null differ diff --git a/graphics/pokemon/ekans/normal.pal b/graphics/pokemon/ekans/normal.pal index 10208771e..54db617b6 100644 --- a/graphics/pokemon/ekans/normal.pal +++ b/graphics/pokemon/ekans/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -88 16 72 -160 72 160 -216 160 232 -192 96 200 -120 48 104 -176 152 48 -248 224 120 +90 16 74 +164 74 139 +238 164 213 +205 98 180 +123 49 106 +180 123 49 +255 213 106 16 16 16 -208 184 72 -160 56 96 +230 172 90 +156 16 0 88 72 48 -216 96 112 -224 168 192 +197 65 24 +246 115 74 248 224 152 0 0 0 diff --git a/graphics/pokemon/electabuzz/front.png b/graphics/pokemon/electabuzz/front.png deleted file mode 100644 index 0459ecb3b..000000000 Binary files a/graphics/pokemon/electabuzz/front.png and /dev/null differ diff --git a/graphics/pokemon/electivire/front.png b/graphics/pokemon/electivire/front.png deleted file mode 100644 index 41bf884b5..000000000 Binary files a/graphics/pokemon/electivire/front.png and /dev/null differ diff --git a/graphics/pokemon/electrike/front.png b/graphics/pokemon/electrike/front.png deleted file mode 100644 index 3e2b74a75..000000000 Binary files a/graphics/pokemon/electrike/front.png and /dev/null differ diff --git a/graphics/pokemon/electrode/anim_front.png b/graphics/pokemon/electrode/anim_front.png index e2342827e..f5fee3039 100644 Binary files a/graphics/pokemon/electrode/anim_front.png and b/graphics/pokemon/electrode/anim_front.png differ diff --git a/graphics/pokemon/electrode/front.png b/graphics/pokemon/electrode/front.png deleted file mode 100644 index e448ff25d..000000000 Binary files a/graphics/pokemon/electrode/front.png and /dev/null differ diff --git a/graphics/pokemon/electrode/normal.pal b/graphics/pokemon/electrode/normal.pal index 187f196ea..293f41bff 100644 --- a/graphics/pokemon/electrode/normal.pal +++ b/graphics/pokemon/electrode/normal.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 152 208 160 -88 80 80 -160 160 160 -232 232 232 +90 82 82 +164 156 156 +238 238 238 248 248 248 -200 200 224 +205 205 222 16 16 16 -200 40 64 -248 80 32 -240 160 136 -128 16 16 -232 56 48 +213 49 65 +255 82 32 +255 131 90 +131 16 16 +238 65 49 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/elekid/back.png b/graphics/pokemon/elekid/back.png index 09028a7d9..c0b5f8cb7 100644 Binary files a/graphics/pokemon/elekid/back.png and b/graphics/pokemon/elekid/back.png differ diff --git a/graphics/pokemon/elekid/front.png b/graphics/pokemon/elekid/front.png deleted file mode 100644 index dc1c694b2..000000000 Binary files a/graphics/pokemon/elekid/front.png and /dev/null differ diff --git a/graphics/pokemon/elgyem/front.png b/graphics/pokemon/elgyem/front.png deleted file mode 100644 index f1a930f82..000000000 Binary files a/graphics/pokemon/elgyem/front.png and /dev/null differ diff --git a/graphics/pokemon/emboar/front.png b/graphics/pokemon/emboar/front.png deleted file mode 100644 index 009ecfd4d..000000000 Binary files a/graphics/pokemon/emboar/front.png and /dev/null differ diff --git a/graphics/pokemon/emolga/front.png b/graphics/pokemon/emolga/front.png deleted file mode 100644 index 23a5856b4..000000000 Binary files a/graphics/pokemon/emolga/front.png and /dev/null differ diff --git a/graphics/pokemon/empoleon/front.png b/graphics/pokemon/empoleon/front.png deleted file mode 100644 index 3b3dff0bc..000000000 Binary files a/graphics/pokemon/empoleon/front.png and /dev/null differ diff --git a/graphics/pokemon/entei/front.png b/graphics/pokemon/entei/front.png deleted file mode 100644 index efed934d7..000000000 Binary files a/graphics/pokemon/entei/front.png and /dev/null differ diff --git a/graphics/pokemon/escavalier/front.png b/graphics/pokemon/escavalier/front.png deleted file mode 100644 index eb56edb91..000000000 Binary files a/graphics/pokemon/escavalier/front.png and /dev/null differ diff --git a/graphics/pokemon/espeon/back.png b/graphics/pokemon/espeon/back.png index 0eb826823..e88821875 100644 Binary files a/graphics/pokemon/espeon/back.png and b/graphics/pokemon/espeon/back.png differ diff --git a/graphics/pokemon/espeon/front.png b/graphics/pokemon/espeon/front.png deleted file mode 100644 index 9c0cc5bba..000000000 Binary files a/graphics/pokemon/espeon/front.png and /dev/null differ diff --git a/graphics/pokemon/espurr/front.png b/graphics/pokemon/espurr/front.png deleted file mode 100644 index c07972d97..000000000 Binary files a/graphics/pokemon/espurr/front.png and /dev/null differ diff --git a/graphics/pokemon/excadrill/front.png b/graphics/pokemon/excadrill/front.png deleted file mode 100644 index 35cb0a172..000000000 Binary files a/graphics/pokemon/excadrill/front.png and /dev/null differ diff --git a/graphics/pokemon/exeggcute/anim_front.png b/graphics/pokemon/exeggcute/anim_front.png index 502e226db..dc17ffb12 100644 Binary files a/graphics/pokemon/exeggcute/anim_front.png and b/graphics/pokemon/exeggcute/anim_front.png differ diff --git a/graphics/pokemon/exeggcute/front.png b/graphics/pokemon/exeggcute/front.png deleted file mode 100644 index 49dc90ad3..000000000 Binary files a/graphics/pokemon/exeggcute/front.png and /dev/null differ diff --git a/graphics/pokemon/exeggcute/normal.pal b/graphics/pokemon/exeggcute/normal.pal index b3489a08c..5b12b18d4 100644 --- a/graphics/pokemon/exeggcute/normal.pal +++ b/graphics/pokemon/exeggcute/normal.pal @@ -2,15 +2,15 @@ JASC-PAL 0100 16 152 208 160 -192 112 144 -136 56 88 -248 208 216 +197 115 148 +139 32 32 +255 213 222 16 16 16 -248 232 136 -200 136 8 +255 238 139 +205 139 8 248 248 248 -248 232 232 -216 216 216 +255 238 238 +222 222 222 224 176 184 232 192 192 0 0 0 diff --git a/graphics/pokemon/exeggutor/anim_front.png b/graphics/pokemon/exeggutor/anim_front.png index 44351f59b..c55e603a0 100644 Binary files a/graphics/pokemon/exeggutor/anim_front.png and b/graphics/pokemon/exeggutor/anim_front.png differ diff --git a/graphics/pokemon/exeggutor/front.png b/graphics/pokemon/exeggutor/front.png deleted file mode 100644 index 7f825b094..000000000 Binary files a/graphics/pokemon/exeggutor/front.png and /dev/null differ diff --git a/graphics/pokemon/exeggutor/normal.pal b/graphics/pokemon/exeggutor/normal.pal index 7af14aec0..7430557a4 100644 --- a/graphics/pokemon/exeggutor/normal.pal +++ b/graphics/pokemon/exeggutor/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 0 176 232 -32 72 16 +82 98 41 16 16 16 -56 128 32 -88 192 64 -72 160 48 -96 72 56 -208 200 112 -240 240 144 +115 172 49 +189 255 115 +156 213 74 +82 65 16 +230 172 90 +255 246 139 248 248 168 248 248 248 -120 120 72 -112 40 40 -136 104 72 -232 128 120 -192 144 112 +123 82 16 +164 106 32 +139 115 65 +230 172 90 +180 156 74 diff --git a/graphics/pokemon/exploud/front.png b/graphics/pokemon/exploud/front.png deleted file mode 100644 index 03eb4fa59..000000000 Binary files a/graphics/pokemon/exploud/front.png and /dev/null differ diff --git a/graphics/pokemon/farfetchd/anim_front.png b/graphics/pokemon/farfetchd/anim_front.png index 6554a4c9f..c96acae39 100644 Binary files a/graphics/pokemon/farfetchd/anim_front.png and b/graphics/pokemon/farfetchd/anim_front.png differ diff --git a/graphics/pokemon/farfetchd/front.png b/graphics/pokemon/farfetchd/front.png deleted file mode 100644 index ea6aa6637..000000000 Binary files a/graphics/pokemon/farfetchd/front.png and /dev/null differ diff --git a/graphics/pokemon/farfetchd/normal.pal b/graphics/pokemon/farfetchd/normal.pal index 306a547b1..8e8af6711 100644 --- a/graphics/pokemon/farfetchd/normal.pal +++ b/graphics/pokemon/farfetchd/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -144 88 104 -96 64 56 -192 152 144 +132 107 33 +90 58 0 +181 148 82 16 16 16 -80 152 0 -232 232 216 -144 208 72 -192 176 152 -208 208 208 -200 168 160 +0 156 33 +230 230 165 +66 222 66 +197 206 132 +214 214 214 +230 197 123 248 248 248 -200 248 136 -248 216 104 -240 176 64 -184 112 24 +206 255 140 +255 222 107 +247 181 66 +189 115 25 diff --git a/graphics/pokemon/fearow/anim_front.png b/graphics/pokemon/fearow/anim_front.png index d9650bc87..9a9e669e0 100644 Binary files a/graphics/pokemon/fearow/anim_front.png and b/graphics/pokemon/fearow/anim_front.png differ diff --git a/graphics/pokemon/fearow/back.png b/graphics/pokemon/fearow/back.png index 429ab9a4b..6ab9e169e 100644 Binary files a/graphics/pokemon/fearow/back.png and b/graphics/pokemon/fearow/back.png differ diff --git a/graphics/pokemon/fearow/front.png b/graphics/pokemon/fearow/front.png deleted file mode 100644 index 6cb779e78..000000000 Binary files a/graphics/pokemon/fearow/front.png and /dev/null differ diff --git a/graphics/pokemon/fearow/normal.pal b/graphics/pokemon/fearow/normal.pal index 555e50474..43c311727 100644 --- a/graphics/pokemon/fearow/normal.pal +++ b/graphics/pokemon/fearow/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -160 104 48 -96 64 40 -232 232 152 -16 16 16 -192 136 48 -176 32 32 -112 32 32 -224 64 64 -160 64 64 -248 128 104 -224 208 176 -248 248 248 -168 160 104 -232 168 160 +139 82 49 +98 57 32 +213 164 90 +0 0 0 +180 115 32 +123 32 32 +230 65 65 +180 32 32 +255 131 106 +98 90 57 +230 213 180 +255 255 255 +238 213 180 +172 164 106 208 128 128 diff --git a/graphics/pokemon/fearow/shiny.pal b/graphics/pokemon/fearow/shiny.pal index 66bce8b73..7b60073d7 100644 --- a/graphics/pokemon/fearow/shiny.pal +++ b/graphics/pokemon/fearow/shiny.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 136 48 -96 96 32 -208 216 88 -16 16 16 -176 184 32 -208 120 0 -136 48 0 -248 160 0 -208 120 0 -248 232 64 -224 208 176 -248 248 248 -168 160 104 -248 232 64 -248 160 0 +139 139 49 +98 57 32 +213 222 90 +0 0 0 +180 189 32 +139 49 0 +255 164 0 +213 123 0 +255 238 65 +98 98 57 +230 222 180 +255 255 255 +238 246 197 +172 172 106 +208 128 128 diff --git a/graphics/pokemon/feebas/front.png b/graphics/pokemon/feebas/front.png deleted file mode 100644 index 2b746a493..000000000 Binary files a/graphics/pokemon/feebas/front.png and /dev/null differ diff --git a/graphics/pokemon/fennekin/front.png b/graphics/pokemon/fennekin/front.png deleted file mode 100644 index 272ff9274..000000000 Binary files a/graphics/pokemon/fennekin/front.png and /dev/null differ diff --git a/graphics/pokemon/feraligatr/anim_front.png b/graphics/pokemon/feraligatr/anim_front.png index d644a30ae..26df70b9e 100644 Binary files a/graphics/pokemon/feraligatr/anim_front.png and b/graphics/pokemon/feraligatr/anim_front.png differ diff --git a/graphics/pokemon/feraligatr/front.png b/graphics/pokemon/feraligatr/front.png deleted file mode 100644 index dda82ea74..000000000 Binary files a/graphics/pokemon/feraligatr/front.png and /dev/null differ diff --git a/graphics/pokemon/feraligatr/normal.pal b/graphics/pokemon/feraligatr/normal.pal index 166ae9add..3322ac24e 100644 --- a/graphics/pokemon/feraligatr/normal.pal +++ b/graphics/pokemon/feraligatr/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -128 0 8 -248 136 128 +131 0 8 +255 139 131 16 16 16 -240 80 88 -8 104 144 -64 208 232 -40 152 184 -136 232 248 -248 248 248 -192 192 192 -248 184 112 -128 88 0 -248 224 136 -200 184 96 +246 82 90 +41 74 139 +90 180 246 +57 139 205 +139 213 255 +255 255 255 +197 197 197 +255 230 139 +106 82 0 +255 230 139 +205 189 98 0 0 0 diff --git a/graphics/pokemon/ferroseed/front.png b/graphics/pokemon/ferroseed/front.png deleted file mode 100644 index 8242059a0..000000000 Binary files a/graphics/pokemon/ferroseed/front.png and /dev/null differ diff --git a/graphics/pokemon/ferrothorn/front.png b/graphics/pokemon/ferrothorn/front.png deleted file mode 100644 index eeee76f76..000000000 Binary files a/graphics/pokemon/ferrothorn/front.png and /dev/null differ diff --git a/graphics/pokemon/finneon/front.png b/graphics/pokemon/finneon/front.png deleted file mode 100644 index 635dcfc7e..000000000 Binary files a/graphics/pokemon/finneon/front.png and /dev/null differ diff --git a/graphics/pokemon/flaaffy/anim_front.png b/graphics/pokemon/flaaffy/anim_front.png index 0cc7d0439..c09ccf492 100644 Binary files a/graphics/pokemon/flaaffy/anim_front.png and b/graphics/pokemon/flaaffy/anim_front.png differ diff --git a/graphics/pokemon/flaaffy/front.png b/graphics/pokemon/flaaffy/front.png deleted file mode 100644 index 373ff986f..000000000 Binary files a/graphics/pokemon/flaaffy/front.png and /dev/null differ diff --git a/graphics/pokemon/flaaffy/normal.pal b/graphics/pokemon/flaaffy/normal.pal index 9b6781342..5dd45e400 100644 --- a/graphics/pokemon/flaaffy/normal.pal +++ b/graphics/pokemon/flaaffy/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -176 176 208 -248 248 248 -128 112 136 -200 216 240 +189 189 213 +255 255 255 +131 115 139 +222 230 246 16 16 16 -72 72 88 -208 96 120 -248 176 200 -248 136 152 -248 200 208 -136 32 48 -64 112 168 -80 128 192 -128 192 248 -40 64 136 +74 74 90 +222 65 98 +255 164 164 +255 115 115 +255 189 189 +164 0 16 +82 131 197 +82 131 197 +131 197 255 +41 65 139 diff --git a/graphics/pokemon/flabebe/back.png b/graphics/pokemon/flabebe/back.png index 143601c63..9a2a8367a 100644 Binary files a/graphics/pokemon/flabebe/back.png and b/graphics/pokemon/flabebe/back.png differ diff --git a/graphics/pokemon/flabebe/blue_flower/icon.png b/graphics/pokemon/flabebe/blue_flower/icon.png index 3f354f4f1..bdac1f46e 100644 Binary files a/graphics/pokemon/flabebe/blue_flower/icon.png and b/graphics/pokemon/flabebe/blue_flower/icon.png differ diff --git a/graphics/pokemon/flabebe/front.png b/graphics/pokemon/flabebe/front.png deleted file mode 100644 index 835047c90..000000000 Binary files a/graphics/pokemon/flabebe/front.png and /dev/null differ diff --git a/graphics/pokemon/flabebe/orange_flower/icon.png b/graphics/pokemon/flabebe/orange_flower/icon.png index 39ce13bf2..1c34927aa 100644 Binary files a/graphics/pokemon/flabebe/orange_flower/icon.png and b/graphics/pokemon/flabebe/orange_flower/icon.png differ diff --git a/graphics/pokemon/flabebe/white_flower/icon.png b/graphics/pokemon/flabebe/white_flower/icon.png index ac706407a..85aebadd1 100644 Binary files a/graphics/pokemon/flabebe/white_flower/icon.png and b/graphics/pokemon/flabebe/white_flower/icon.png differ diff --git a/graphics/pokemon/flabebe/yellow_flower/icon.png b/graphics/pokemon/flabebe/yellow_flower/icon.png index a1cef6e26..2ad8437e3 100644 Binary files a/graphics/pokemon/flabebe/yellow_flower/icon.png and b/graphics/pokemon/flabebe/yellow_flower/icon.png differ diff --git a/graphics/pokemon/flareon/anim_front.png b/graphics/pokemon/flareon/anim_front.png index fcb04af2a..1a13e5df4 100644 Binary files a/graphics/pokemon/flareon/anim_front.png and b/graphics/pokemon/flareon/anim_front.png differ diff --git a/graphics/pokemon/flareon/front.png b/graphics/pokemon/flareon/front.png deleted file mode 100644 index 7f233214c..000000000 Binary files a/graphics/pokemon/flareon/front.png and /dev/null differ diff --git a/graphics/pokemon/flareon/icon.png b/graphics/pokemon/flareon/icon.png index 96092e7ee..92f4dad53 100644 Binary files a/graphics/pokemon/flareon/icon.png and b/graphics/pokemon/flareon/icon.png differ diff --git a/graphics/pokemon/flareon/normal.pal b/graphics/pokemon/flareon/normal.pal index 648c2c51c..e16f62e9c 100644 --- a/graphics/pokemon/flareon/normal.pal +++ b/graphics/pokemon/flareon/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -112 88 64 -224 192 136 -248 240 160 -96 40 32 -192 160 104 -16 16 16 -216 64 80 -112 32 24 -248 112 72 -32 32 104 +115 90 65 +255 205 148 +255 238 164 +115 32 24 +197 164 106 +0 0 0 +222 74 57 +164 65 65 +255 115 90 +0 0 0 248 248 248 0 0 0 0 0 0 diff --git a/graphics/pokemon/fletchinder/front.png b/graphics/pokemon/fletchinder/front.png deleted file mode 100644 index 86ff4500f..000000000 Binary files a/graphics/pokemon/fletchinder/front.png and /dev/null differ diff --git a/graphics/pokemon/fletchling/front.png b/graphics/pokemon/fletchling/front.png deleted file mode 100644 index 53713836d..000000000 Binary files a/graphics/pokemon/fletchling/front.png and /dev/null differ diff --git a/graphics/pokemon/floatzel/front.png b/graphics/pokemon/floatzel/front.png deleted file mode 100644 index 6ff6ec136..000000000 Binary files a/graphics/pokemon/floatzel/front.png and /dev/null differ diff --git a/graphics/pokemon/floette/blue_flower/icon.png b/graphics/pokemon/floette/blue_flower/icon.png index 734c6eb4a..aa2227c43 100644 Binary files a/graphics/pokemon/floette/blue_flower/icon.png and b/graphics/pokemon/floette/blue_flower/icon.png differ diff --git a/graphics/pokemon/floette/eternal_flower/back.png b/graphics/pokemon/floette/eternal_flower/back.png index edcf0ef2c..450120721 100644 Binary files a/graphics/pokemon/floette/eternal_flower/back.png and b/graphics/pokemon/floette/eternal_flower/back.png differ diff --git a/graphics/pokemon/floette/eternal_flower/front.png b/graphics/pokemon/floette/eternal_flower/front.png index 56d9a7166..5d0a8c7df 100644 Binary files a/graphics/pokemon/floette/eternal_flower/front.png and b/graphics/pokemon/floette/eternal_flower/front.png differ diff --git a/graphics/pokemon/floette/eternal_flower/icon.png b/graphics/pokemon/floette/eternal_flower/icon.png index 42931825c..a1e0d3c51 100644 Binary files a/graphics/pokemon/floette/eternal_flower/icon.png and b/graphics/pokemon/floette/eternal_flower/icon.png differ diff --git a/graphics/pokemon/floette/front.png b/graphics/pokemon/floette/front.png deleted file mode 100644 index d8d85450b..000000000 Binary files a/graphics/pokemon/floette/front.png and /dev/null differ diff --git a/graphics/pokemon/floette/orange_flower/icon.png b/graphics/pokemon/floette/orange_flower/icon.png index 3c839277c..07b6d9a09 100644 Binary files a/graphics/pokemon/floette/orange_flower/icon.png and b/graphics/pokemon/floette/orange_flower/icon.png differ diff --git a/graphics/pokemon/floette/white_flower/icon.png b/graphics/pokemon/floette/white_flower/icon.png index a1975ff13..5c86b2634 100644 Binary files a/graphics/pokemon/floette/white_flower/icon.png and b/graphics/pokemon/floette/white_flower/icon.png differ diff --git a/graphics/pokemon/floette/yellow_flower/icon.png b/graphics/pokemon/floette/yellow_flower/icon.png index 4a9dc4257..29049f106 100644 Binary files a/graphics/pokemon/floette/yellow_flower/icon.png and b/graphics/pokemon/floette/yellow_flower/icon.png differ diff --git a/graphics/pokemon/florges/back.png b/graphics/pokemon/florges/back.png index d1515c2ae..d0d918fab 100644 Binary files a/graphics/pokemon/florges/back.png and b/graphics/pokemon/florges/back.png differ diff --git a/graphics/pokemon/florges/blue_flower/icon.png b/graphics/pokemon/florges/blue_flower/icon.png index d0dc98cb1..8a4743f4f 100644 Binary files a/graphics/pokemon/florges/blue_flower/icon.png and b/graphics/pokemon/florges/blue_flower/icon.png differ diff --git a/graphics/pokemon/florges/front.png b/graphics/pokemon/florges/front.png deleted file mode 100644 index fe77fe4e6..000000000 Binary files a/graphics/pokemon/florges/front.png and /dev/null differ diff --git a/graphics/pokemon/florges/orange_flower/icon.png b/graphics/pokemon/florges/orange_flower/icon.png index 5bcb76de3..a8239748c 100644 Binary files a/graphics/pokemon/florges/orange_flower/icon.png and b/graphics/pokemon/florges/orange_flower/icon.png differ diff --git a/graphics/pokemon/florges/white_flower/icon.png b/graphics/pokemon/florges/white_flower/icon.png index 06cccec6c..11b04c54e 100644 Binary files a/graphics/pokemon/florges/white_flower/icon.png and b/graphics/pokemon/florges/white_flower/icon.png differ diff --git a/graphics/pokemon/florges/yellow_flower/icon.png b/graphics/pokemon/florges/yellow_flower/icon.png index c3a571607..8fab7804f 100644 Binary files a/graphics/pokemon/florges/yellow_flower/icon.png and b/graphics/pokemon/florges/yellow_flower/icon.png differ diff --git a/graphics/pokemon/flygon/front.png b/graphics/pokemon/flygon/front.png deleted file mode 100644 index 64b9467a5..000000000 Binary files a/graphics/pokemon/flygon/front.png and /dev/null differ diff --git a/graphics/pokemon/foongus/front.png b/graphics/pokemon/foongus/front.png deleted file mode 100644 index 0d584f1da..000000000 Binary files a/graphics/pokemon/foongus/front.png and /dev/null differ diff --git a/graphics/pokemon/forretress/front.png b/graphics/pokemon/forretress/front.png deleted file mode 100644 index dde5eac09..000000000 Binary files a/graphics/pokemon/forretress/front.png and /dev/null differ diff --git a/graphics/pokemon/fraxure/front.png b/graphics/pokemon/fraxure/front.png deleted file mode 100644 index 5171acb52..000000000 Binary files a/graphics/pokemon/fraxure/front.png and /dev/null differ diff --git a/graphics/pokemon/frillish/front.png b/graphics/pokemon/frillish/front.png deleted file mode 100644 index cd48a39ac..000000000 Binary files a/graphics/pokemon/frillish/front.png and /dev/null differ diff --git a/graphics/pokemon/froakie/front.png b/graphics/pokemon/froakie/front.png deleted file mode 100644 index aa16e3120..000000000 Binary files a/graphics/pokemon/froakie/front.png and /dev/null differ diff --git a/graphics/pokemon/frogadier/front.png b/graphics/pokemon/frogadier/front.png deleted file mode 100644 index e99089269..000000000 Binary files a/graphics/pokemon/frogadier/front.png and /dev/null differ diff --git a/graphics/pokemon/froslass/front.png b/graphics/pokemon/froslass/front.png deleted file mode 100644 index 28597b428..000000000 Binary files a/graphics/pokemon/froslass/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/dandy_trim/front.png b/graphics/pokemon/furfrou/dandy_trim/front.png deleted file mode 100644 index ffb12c4f0..000000000 Binary files a/graphics/pokemon/furfrou/dandy_trim/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/dandy_trim/icon.png b/graphics/pokemon/furfrou/dandy_trim/icon.png index 86089db3c..9e20ab1c4 100644 Binary files a/graphics/pokemon/furfrou/dandy_trim/icon.png and b/graphics/pokemon/furfrou/dandy_trim/icon.png differ diff --git a/graphics/pokemon/furfrou/debutante_trim/front.png b/graphics/pokemon/furfrou/debutante_trim/front.png deleted file mode 100644 index 2ccf422ae..000000000 Binary files a/graphics/pokemon/furfrou/debutante_trim/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/debutante_trim/icon.png b/graphics/pokemon/furfrou/debutante_trim/icon.png index 05d1c448a..04860b16d 100644 Binary files a/graphics/pokemon/furfrou/debutante_trim/icon.png and b/graphics/pokemon/furfrou/debutante_trim/icon.png differ diff --git a/graphics/pokemon/furfrou/diamond_trim/front.png b/graphics/pokemon/furfrou/diamond_trim/front.png deleted file mode 100644 index 393a40588..000000000 Binary files a/graphics/pokemon/furfrou/diamond_trim/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/diamond_trim/icon.png b/graphics/pokemon/furfrou/diamond_trim/icon.png index 50934adad..f5ce645e4 100644 Binary files a/graphics/pokemon/furfrou/diamond_trim/icon.png and b/graphics/pokemon/furfrou/diamond_trim/icon.png differ diff --git a/graphics/pokemon/furfrou/front.png b/graphics/pokemon/furfrou/front.png deleted file mode 100644 index 037c54037..000000000 Binary files a/graphics/pokemon/furfrou/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/heart_trim/front.png b/graphics/pokemon/furfrou/heart_trim/front.png deleted file mode 100644 index 17b2f3dbb..000000000 Binary files a/graphics/pokemon/furfrou/heart_trim/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/heart_trim/icon.png b/graphics/pokemon/furfrou/heart_trim/icon.png index f8a6b1531..70049dc53 100644 Binary files a/graphics/pokemon/furfrou/heart_trim/icon.png and b/graphics/pokemon/furfrou/heart_trim/icon.png differ diff --git a/graphics/pokemon/furfrou/kabuki_trim/front.png b/graphics/pokemon/furfrou/kabuki_trim/front.png deleted file mode 100644 index c1efac1c0..000000000 Binary files a/graphics/pokemon/furfrou/kabuki_trim/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/kabuki_trim/icon.png b/graphics/pokemon/furfrou/kabuki_trim/icon.png index da2a254b6..bc81044fb 100644 Binary files a/graphics/pokemon/furfrou/kabuki_trim/icon.png and b/graphics/pokemon/furfrou/kabuki_trim/icon.png differ diff --git a/graphics/pokemon/furfrou/la_reine_trim/front.png b/graphics/pokemon/furfrou/la_reine_trim/front.png deleted file mode 100644 index 7527d59ec..000000000 Binary files a/graphics/pokemon/furfrou/la_reine_trim/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/la_reine_trim/icon.png b/graphics/pokemon/furfrou/la_reine_trim/icon.png index 9a9881c19..4451c0c16 100644 Binary files a/graphics/pokemon/furfrou/la_reine_trim/icon.png and b/graphics/pokemon/furfrou/la_reine_trim/icon.png differ diff --git a/graphics/pokemon/furfrou/matron_trim/front.png b/graphics/pokemon/furfrou/matron_trim/front.png deleted file mode 100644 index afcb90c7a..000000000 Binary files a/graphics/pokemon/furfrou/matron_trim/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/matron_trim/icon.png b/graphics/pokemon/furfrou/matron_trim/icon.png index b57900751..6d379a8ca 100644 Binary files a/graphics/pokemon/furfrou/matron_trim/icon.png and b/graphics/pokemon/furfrou/matron_trim/icon.png differ diff --git a/graphics/pokemon/furfrou/pharaoh_trim/front.png b/graphics/pokemon/furfrou/pharaoh_trim/front.png deleted file mode 100644 index 987c7a7a4..000000000 Binary files a/graphics/pokemon/furfrou/pharaoh_trim/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/pharaoh_trim/icon.png b/graphics/pokemon/furfrou/pharaoh_trim/icon.png index a54c76608..f674c8b47 100644 Binary files a/graphics/pokemon/furfrou/pharaoh_trim/icon.png and b/graphics/pokemon/furfrou/pharaoh_trim/icon.png differ diff --git a/graphics/pokemon/furfrou/star_trim/front.png b/graphics/pokemon/furfrou/star_trim/front.png deleted file mode 100644 index a95314321..000000000 Binary files a/graphics/pokemon/furfrou/star_trim/front.png and /dev/null differ diff --git a/graphics/pokemon/furfrou/star_trim/icon.png b/graphics/pokemon/furfrou/star_trim/icon.png index 90623f6d7..7d571808e 100644 Binary files a/graphics/pokemon/furfrou/star_trim/icon.png and b/graphics/pokemon/furfrou/star_trim/icon.png differ diff --git a/graphics/pokemon/furret/anim_front.png b/graphics/pokemon/furret/anim_front.png index bd0119c56..6e84d7410 100644 Binary files a/graphics/pokemon/furret/anim_front.png and b/graphics/pokemon/furret/anim_front.png differ diff --git a/graphics/pokemon/furret/front.png b/graphics/pokemon/furret/front.png deleted file mode 100644 index bab4d95b6..000000000 Binary files a/graphics/pokemon/furret/front.png and /dev/null differ diff --git a/graphics/pokemon/furret/normal.pal b/graphics/pokemon/furret/normal.pal index 661f34207..e1a23347b 100644 --- a/graphics/pokemon/furret/normal.pal +++ b/graphics/pokemon/furret/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -80 40 32 -208 176 104 -120 64 56 -32 32 40 -192 152 64 -232 208 160 -152 96 72 -168 128 40 -248 248 192 -248 248 248 -112 112 112 -152 0 0 -248 144 96 +82 41 32 +230 197 74 +123 65 57 +32 32 41 +197 156 65 +255 238 148 +156 98 74 +172 131 41 +255 255 197 +255 255 255 +115 115 115 +156 0 0 +255 148 98 120 64 56 0 0 0 diff --git a/graphics/pokemon/gabite/front.png b/graphics/pokemon/gabite/front.png deleted file mode 100644 index 3495a5f18..000000000 Binary files a/graphics/pokemon/gabite/front.png and /dev/null differ diff --git a/graphics/pokemon/gallade/front.png b/graphics/pokemon/gallade/front.png deleted file mode 100644 index 93f200159..000000000 Binary files a/graphics/pokemon/gallade/front.png and /dev/null differ diff --git a/graphics/pokemon/galvantula/back.png b/graphics/pokemon/galvantula/back.png index f15a60a3d..4d872ac6b 100644 Binary files a/graphics/pokemon/galvantula/back.png and b/graphics/pokemon/galvantula/back.png differ diff --git a/graphics/pokemon/galvantula/front.png b/graphics/pokemon/galvantula/front.png deleted file mode 100644 index 980ca86f9..000000000 Binary files a/graphics/pokemon/galvantula/front.png and /dev/null differ diff --git a/graphics/pokemon/garbodor/front.png b/graphics/pokemon/garbodor/front.png deleted file mode 100644 index 959931034..000000000 Binary files a/graphics/pokemon/garbodor/front.png and /dev/null differ diff --git a/graphics/pokemon/garchomp/front.png b/graphics/pokemon/garchomp/front.png deleted file mode 100644 index e84e0270f..000000000 Binary files a/graphics/pokemon/garchomp/front.png and /dev/null differ diff --git a/graphics/pokemon/gardevoir/front.png b/graphics/pokemon/gardevoir/front.png deleted file mode 100644 index 2bfc83879..000000000 Binary files a/graphics/pokemon/gardevoir/front.png and /dev/null differ diff --git a/graphics/pokemon/gastly/anim_front.png b/graphics/pokemon/gastly/anim_front.png index 3c5f16339..ff6c6591a 100644 Binary files a/graphics/pokemon/gastly/anim_front.png and b/graphics/pokemon/gastly/anim_front.png differ diff --git a/graphics/pokemon/gastly/front.png b/graphics/pokemon/gastly/front.png deleted file mode 100644 index b5131034e..000000000 Binary files a/graphics/pokemon/gastly/front.png and /dev/null differ diff --git a/graphics/pokemon/gastly/normal.pal b/graphics/pokemon/gastly/normal.pal index c4bfdcbd8..7541f1751 100644 --- a/graphics/pokemon/gastly/normal.pal +++ b/graphics/pokemon/gastly/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -176 144 184 -136 104 144 -104 72 120 -16 8 8 +213 172 205 +189 148 180 +139 98 131 +57 41 57 16 16 16 -56 40 40 -96 80 72 +115 74 106 +139 98 131 112 72 104 -248 248 248 -120 56 56 -184 80 88 +255 255 255 +180 41 16 +222 82 57 208 168 192 216 216 216 -152 88 112 -192 144 168 +180 41 16 +222 82 57 diff --git a/graphics/pokemon/gastrodon/east_sea/front.png b/graphics/pokemon/gastrodon/east_sea/front.png deleted file mode 100644 index ca68f56d3..000000000 Binary files a/graphics/pokemon/gastrodon/east_sea/front.png and /dev/null differ diff --git a/graphics/pokemon/gastrodon/east_sea/icon.png b/graphics/pokemon/gastrodon/east_sea/icon.png index 4eec76873..33ba3c5c5 100644 Binary files a/graphics/pokemon/gastrodon/east_sea/icon.png and b/graphics/pokemon/gastrodon/east_sea/icon.png differ diff --git a/graphics/pokemon/gastrodon/front.png b/graphics/pokemon/gastrodon/front.png deleted file mode 100644 index b28352aed..000000000 Binary files a/graphics/pokemon/gastrodon/front.png and /dev/null differ diff --git a/graphics/pokemon/genesect/front.png b/graphics/pokemon/genesect/front.png deleted file mode 100644 index fff9ce885..000000000 Binary files a/graphics/pokemon/genesect/front.png and /dev/null differ diff --git a/graphics/pokemon/gengar/anim_front.png b/graphics/pokemon/gengar/anim_front.png index 8cd8a8667..038bc71fc 100644 Binary files a/graphics/pokemon/gengar/anim_front.png and b/graphics/pokemon/gengar/anim_front.png differ diff --git a/graphics/pokemon/gengar/front.png b/graphics/pokemon/gengar/front.png deleted file mode 100644 index d9a054a1e..000000000 Binary files a/graphics/pokemon/gengar/front.png and /dev/null differ diff --git a/graphics/pokemon/gengar/normal.pal b/graphics/pokemon/gengar/normal.pal index efa15a3b0..16892bb23 100644 --- a/graphics/pokemon/gengar/normal.pal +++ b/graphics/pokemon/gengar/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -88 72 152 -176 136 184 +90 74 156 +180 139 189 16 16 16 -144 112 176 -72 40 72 -120 96 160 -248 24 24 -248 96 96 -184 168 184 -248 240 248 -104 96 120 -216 208 216 +148 115 180 +74 41 74 +123 98 164 +255 90 90 +255 148 148 +189 172 189 +255 246 255 +106 98 123 +222 213 222 168 16 16 72 40 72 0 0 0 diff --git a/graphics/pokemon/geodude/anim_front.png b/graphics/pokemon/geodude/anim_front.png index 2346e37bb..e5e28131d 100644 Binary files a/graphics/pokemon/geodude/anim_front.png and b/graphics/pokemon/geodude/anim_front.png differ diff --git a/graphics/pokemon/geodude/back.png b/graphics/pokemon/geodude/back.png index 45eba4d1c..bd2cbeac6 100644 Binary files a/graphics/pokemon/geodude/back.png and b/graphics/pokemon/geodude/back.png differ diff --git a/graphics/pokemon/geodude/front.png b/graphics/pokemon/geodude/front.png deleted file mode 100644 index c01d52995..000000000 Binary files a/graphics/pokemon/geodude/front.png and /dev/null differ diff --git a/graphics/pokemon/geodude/normal.pal b/graphics/pokemon/geodude/normal.pal index 9dc93a2b2..29e9e7409 100644 --- a/graphics/pokemon/geodude/normal.pal +++ b/graphics/pokemon/geodude/normal.pal @@ -2,14 +2,14 @@ JASC-PAL 0100 16 152 208 160 -104 104 80 -64 56 48 -200 200 176 -184 176 160 -152 144 120 +106 106 82 +65 57 49 +197 213 172 +180 180 156 +156 148 131 16 16 16 -200 216 200 -248 248 248 +205 222 205 +255 255 255 56 40 56 136 16 16 232 128 120 diff --git a/graphics/pokemon/gible/front.png b/graphics/pokemon/gible/front.png deleted file mode 100644 index d3d5b4873..000000000 Binary files a/graphics/pokemon/gible/front.png and /dev/null differ diff --git a/graphics/pokemon/gigalith/front.png b/graphics/pokemon/gigalith/front.png deleted file mode 100644 index 9cf2b0446..000000000 Binary files a/graphics/pokemon/gigalith/front.png and /dev/null differ diff --git a/graphics/pokemon/girafarig/front.png b/graphics/pokemon/girafarig/front.png deleted file mode 100644 index 2a43c76e5..000000000 Binary files a/graphics/pokemon/girafarig/front.png and /dev/null differ diff --git a/graphics/pokemon/giratina/front.png b/graphics/pokemon/giratina/front.png deleted file mode 100644 index d0004746a..000000000 Binary files a/graphics/pokemon/giratina/front.png and /dev/null differ diff --git a/graphics/pokemon/giratina/origin/front.png b/graphics/pokemon/giratina/origin/front.png deleted file mode 100644 index 14f631d09..000000000 Binary files a/graphics/pokemon/giratina/origin/front.png and /dev/null differ diff --git a/graphics/pokemon/glaceon/back.png b/graphics/pokemon/glaceon/back.png index 1f5343537..1acee66de 100644 Binary files a/graphics/pokemon/glaceon/back.png and b/graphics/pokemon/glaceon/back.png differ diff --git a/graphics/pokemon/glaceon/front.png b/graphics/pokemon/glaceon/front.png deleted file mode 100644 index 463bd723d..000000000 Binary files a/graphics/pokemon/glaceon/front.png and /dev/null differ diff --git a/graphics/pokemon/glalie/front.png b/graphics/pokemon/glalie/front.png deleted file mode 100644 index cb6ecd492..000000000 Binary files a/graphics/pokemon/glalie/front.png and /dev/null differ diff --git a/graphics/pokemon/glameow/front.png b/graphics/pokemon/glameow/front.png deleted file mode 100644 index bd72d82c1..000000000 Binary files a/graphics/pokemon/glameow/front.png and /dev/null differ diff --git a/graphics/pokemon/gligar/front.png b/graphics/pokemon/gligar/front.png deleted file mode 100644 index 5164cb452..000000000 Binary files a/graphics/pokemon/gligar/front.png and /dev/null differ diff --git a/graphics/pokemon/gliscor/front.png b/graphics/pokemon/gliscor/front.png deleted file mode 100644 index 24be70580..000000000 Binary files a/graphics/pokemon/gliscor/front.png and /dev/null differ diff --git a/graphics/pokemon/gloom/anim_front.png b/graphics/pokemon/gloom/anim_front.png index 3ade71dc7..9f9ea94c6 100644 Binary files a/graphics/pokemon/gloom/anim_front.png and b/graphics/pokemon/gloom/anim_front.png differ diff --git a/graphics/pokemon/gloom/front.png b/graphics/pokemon/gloom/front.png deleted file mode 100644 index d4727f034..000000000 Binary files a/graphics/pokemon/gloom/front.png and /dev/null differ diff --git a/graphics/pokemon/gloom/normal.pal b/graphics/pokemon/gloom/normal.pal index aced223e7..6d66df35c 100644 --- a/graphics/pokemon/gloom/normal.pal +++ b/graphics/pokemon/gloom/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 88 40 0 -128 56 24 -240 128 96 -168 80 56 +131 57 24 +205 115 74 +172 82 57 16 16 16 -240 128 96 -224 80 32 +255 189 65 +255 115 0 240 232 184 -168 56 32 -136 32 16 -56 96 136 -16 48 72 -112 144 168 -176 88 192 -152 160 200 +197 115 41 +139 57 24 +74 106 123 +16 49 74 +123 131 164 +180 90 197 +156 164 205 diff --git a/graphics/pokemon/gogoat/front.png b/graphics/pokemon/gogoat/front.png deleted file mode 100644 index 3653876d5..000000000 Binary files a/graphics/pokemon/gogoat/front.png and /dev/null differ diff --git a/graphics/pokemon/golbat/anim_front.png b/graphics/pokemon/golbat/anim_front.png index eb6f8ad38..661f81d46 100644 Binary files a/graphics/pokemon/golbat/anim_front.png and b/graphics/pokemon/golbat/anim_front.png differ diff --git a/graphics/pokemon/golbat/front.png b/graphics/pokemon/golbat/front.png deleted file mode 100644 index 2898946b5..000000000 Binary files a/graphics/pokemon/golbat/front.png and /dev/null differ diff --git a/graphics/pokemon/golbat/normal.pal b/graphics/pokemon/golbat/normal.pal index 93d12fcf4..048e118a7 100644 --- a/graphics/pokemon/golbat/normal.pal +++ b/graphics/pokemon/golbat/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -40 120 152 -24 56 80 +98 131 205 +57 57 123 0 0 0 -136 200 224 -72 160 200 -168 80 168 -144 56 120 -96 16 80 -200 104 176 -96 96 96 -208 208 208 -248 248 248 +172 205 255 +90 172 238 +172 82 172 +148 57 123 +98 16 82 +205 106 180 +98 98 98 +213 213 213 +255 255 255 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/goldeen/front.png b/graphics/pokemon/goldeen/front.png deleted file mode 100644 index 4f4b6db93..000000000 Binary files a/graphics/pokemon/goldeen/front.png and /dev/null differ diff --git a/graphics/pokemon/golduck/anim_front.png b/graphics/pokemon/golduck/anim_front.png index f3c5674a7..e48d06735 100644 Binary files a/graphics/pokemon/golduck/anim_front.png and b/graphics/pokemon/golduck/anim_front.png differ diff --git a/graphics/pokemon/golduck/front.png b/graphics/pokemon/golduck/front.png deleted file mode 100644 index fe9836e68..000000000 Binary files a/graphics/pokemon/golduck/front.png and /dev/null differ diff --git a/graphics/pokemon/golduck/normal.pal b/graphics/pokemon/golduck/normal.pal index f3b96e83f..9caf6c3b4 100644 --- a/graphics/pokemon/golduck/normal.pal +++ b/graphics/pokemon/golduck/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -64 72 112 -104 176 224 +49 82 106 +139 172 213 16 16 16 -72 120 168 -216 24 24 -248 248 248 -136 0 0 -240 104 104 -208 208 208 -136 112 56 -248 240 176 -192 160 72 -240 216 128 -168 48 16 +123 123 180 +222 24 24 +255 255 255 +139 0 0 +255 172 172 +213 213 213 +115 106 16 +255 255 164 +164 164 57 +213 213 106 +139 0 0 160 216 248 diff --git a/graphics/pokemon/golem/anim_front.png b/graphics/pokemon/golem/anim_front.png index a551e71dc..cd5af1012 100644 Binary files a/graphics/pokemon/golem/anim_front.png and b/graphics/pokemon/golem/anim_front.png differ diff --git a/graphics/pokemon/golem/front.png b/graphics/pokemon/golem/front.png deleted file mode 100644 index c03692638..000000000 Binary files a/graphics/pokemon/golem/front.png and /dev/null differ diff --git a/graphics/pokemon/golem/normal.pal b/graphics/pokemon/golem/normal.pal index a1af492ea..0006a7dca 100644 --- a/graphics/pokemon/golem/normal.pal +++ b/graphics/pokemon/golem/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -64 64 56 -128 136 128 -104 104 80 -160 168 160 +65 74 16 +139 148 65 +98 106 32 +180 189 98 16 16 16 -112 112 112 -248 248 248 -88 72 72 -200 200 200 -192 168 168 -152 128 128 -216 192 184 -176 0 0 -248 80 80 +115 115 115 +255 255 255 +90 74 16 +205 205 205 +213 180 90 +156 139 82 +246 222 139 +180 0 0 +255 82 82 168 32 0 diff --git a/graphics/pokemon/golett/back.png b/graphics/pokemon/golett/back.png index d3b7ad67e..5a2ae2208 100644 Binary files a/graphics/pokemon/golett/back.png and b/graphics/pokemon/golett/back.png differ diff --git a/graphics/pokemon/golett/front.png b/graphics/pokemon/golett/front.png deleted file mode 100644 index f58715bb9..000000000 Binary files a/graphics/pokemon/golett/front.png and /dev/null differ diff --git a/graphics/pokemon/golurk/front.png b/graphics/pokemon/golurk/front.png deleted file mode 100644 index 225a6a142..000000000 Binary files a/graphics/pokemon/golurk/front.png and /dev/null differ diff --git a/graphics/pokemon/goodra/front.png b/graphics/pokemon/goodra/front.png deleted file mode 100644 index cb0b50ca9..000000000 Binary files a/graphics/pokemon/goodra/front.png and /dev/null differ diff --git a/graphics/pokemon/goomy/front.png b/graphics/pokemon/goomy/front.png deleted file mode 100644 index b61c3e2d3..000000000 Binary files a/graphics/pokemon/goomy/front.png and /dev/null differ diff --git a/graphics/pokemon/gorebyss/front.png b/graphics/pokemon/gorebyss/front.png deleted file mode 100644 index 09a8a3587..000000000 Binary files a/graphics/pokemon/gorebyss/front.png and /dev/null differ diff --git a/graphics/pokemon/gothita/front.png b/graphics/pokemon/gothita/front.png deleted file mode 100644 index e7052bf8d..000000000 Binary files a/graphics/pokemon/gothita/front.png and /dev/null differ diff --git a/graphics/pokemon/gothitelle/front.png b/graphics/pokemon/gothitelle/front.png deleted file mode 100644 index 7178f82fb..000000000 Binary files a/graphics/pokemon/gothitelle/front.png and /dev/null differ diff --git a/graphics/pokemon/gothorita/front.png b/graphics/pokemon/gothorita/front.png deleted file mode 100644 index 7f6f07418..000000000 Binary files a/graphics/pokemon/gothorita/front.png and /dev/null differ diff --git a/graphics/pokemon/gourgeist/back.png b/graphics/pokemon/gourgeist/back.png index b572c429b..76da39f22 100644 Binary files a/graphics/pokemon/gourgeist/back.png and b/graphics/pokemon/gourgeist/back.png differ diff --git a/graphics/pokemon/gourgeist/front.png b/graphics/pokemon/gourgeist/front.png deleted file mode 100644 index 577d182b4..000000000 Binary files a/graphics/pokemon/gourgeist/front.png and /dev/null differ diff --git a/graphics/pokemon/gourgeist/large/back.png b/graphics/pokemon/gourgeist/large/back.png index 2d0751fa7..a84d9aa51 100644 Binary files a/graphics/pokemon/gourgeist/large/back.png and b/graphics/pokemon/gourgeist/large/back.png differ diff --git a/graphics/pokemon/gourgeist/large/front.png b/graphics/pokemon/gourgeist/large/front.png deleted file mode 100644 index 552cd4b88..000000000 Binary files a/graphics/pokemon/gourgeist/large/front.png and /dev/null differ diff --git a/graphics/pokemon/gourgeist/small/back.png b/graphics/pokemon/gourgeist/small/back.png index 1865e7c27..97a44f72b 100644 Binary files a/graphics/pokemon/gourgeist/small/back.png and b/graphics/pokemon/gourgeist/small/back.png differ diff --git a/graphics/pokemon/gourgeist/small/front.png b/graphics/pokemon/gourgeist/small/front.png deleted file mode 100644 index b3b659bdf..000000000 Binary files a/graphics/pokemon/gourgeist/small/front.png and /dev/null differ diff --git a/graphics/pokemon/gourgeist/super/back.png b/graphics/pokemon/gourgeist/super/back.png index f669c4987..3d6a97ef5 100644 Binary files a/graphics/pokemon/gourgeist/super/back.png and b/graphics/pokemon/gourgeist/super/back.png differ diff --git a/graphics/pokemon/gourgeist/super/front.png b/graphics/pokemon/gourgeist/super/front.png deleted file mode 100644 index 14c8143d2..000000000 Binary files a/graphics/pokemon/gourgeist/super/front.png and /dev/null differ diff --git a/graphics/pokemon/granbull/front.png b/graphics/pokemon/granbull/front.png deleted file mode 100644 index 9ad102c74..000000000 Binary files a/graphics/pokemon/granbull/front.png and /dev/null differ diff --git a/graphics/pokemon/graveler/anim_front.png b/graphics/pokemon/graveler/anim_front.png index 06680ed00..f00ad98d8 100644 Binary files a/graphics/pokemon/graveler/anim_front.png and b/graphics/pokemon/graveler/anim_front.png differ diff --git a/graphics/pokemon/graveler/front.png b/graphics/pokemon/graveler/front.png deleted file mode 100644 index 359e642c4..000000000 Binary files a/graphics/pokemon/graveler/front.png and /dev/null differ diff --git a/graphics/pokemon/graveler/normal.pal b/graphics/pokemon/graveler/normal.pal index 1c31789ba..7a0929c16 100644 --- a/graphics/pokemon/graveler/normal.pal +++ b/graphics/pokemon/graveler/normal.pal @@ -2,14 +2,14 @@ JASC-PAL 0100 16 152 208 160 -72 63 48 -216 208 184 -176 176 152 -136 136 112 -104 104 80 -15 15 15 -248 248 248 -224 104 120 +74 65 49 +213 213 172 +180 180 156 +148 139 123 +106 106 82 +0 0 0 +255 255 255 +189 74 57 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/greninja/ash/front.png b/graphics/pokemon/greninja/ash/front.png deleted file mode 100644 index a76b97dca..000000000 Binary files a/graphics/pokemon/greninja/ash/front.png and /dev/null differ diff --git a/graphics/pokemon/greninja/ash/icon.png b/graphics/pokemon/greninja/ash/icon.png index 5c096c165..ac461847c 100644 Binary files a/graphics/pokemon/greninja/ash/icon.png and b/graphics/pokemon/greninja/ash/icon.png differ diff --git a/graphics/pokemon/greninja/front.png b/graphics/pokemon/greninja/front.png deleted file mode 100644 index 81faac3bf..000000000 Binary files a/graphics/pokemon/greninja/front.png and /dev/null differ diff --git a/graphics/pokemon/grimer/anim_front.png b/graphics/pokemon/grimer/anim_front.png index 33cf98a68..7cc6b2453 100644 Binary files a/graphics/pokemon/grimer/anim_front.png and b/graphics/pokemon/grimer/anim_front.png differ diff --git a/graphics/pokemon/grimer/front.png b/graphics/pokemon/grimer/front.png deleted file mode 100644 index d4e6f6b7a..000000000 Binary files a/graphics/pokemon/grimer/front.png and /dev/null differ diff --git a/graphics/pokemon/grimer/normal.pal b/graphics/pokemon/grimer/normal.pal index 9e51961b9..b7c371b48 100644 --- a/graphics/pokemon/grimer/normal.pal +++ b/graphics/pokemon/grimer/normal.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 152 208 160 -136 112 152 -200 168 224 -96 56 120 -232 208 240 -168 128 192 +156 106 156 +222 172 222 +98 57 123 +238 222 238 +180 139 180 16 16 16 -120 72 128 +123 74 131 248 248 248 -120 128 160 -56 56 56 -152 168 200 +131 139 156 +65 74 90 +172 180 189 208 208 216 0 0 0 0 0 0 diff --git a/graphics/pokemon/grotle/front.png b/graphics/pokemon/grotle/front.png deleted file mode 100644 index f52ebe6d6..000000000 Binary files a/graphics/pokemon/grotle/front.png and /dev/null differ diff --git a/graphics/pokemon/groudon/front.png b/graphics/pokemon/groudon/front.png deleted file mode 100644 index 56e10fbcc..000000000 Binary files a/graphics/pokemon/groudon/front.png and /dev/null differ diff --git a/graphics/pokemon/grovyle/front.png b/graphics/pokemon/grovyle/front.png deleted file mode 100644 index 810306218..000000000 Binary files a/graphics/pokemon/grovyle/front.png and /dev/null differ diff --git a/graphics/pokemon/growlithe/anim_front.png b/graphics/pokemon/growlithe/anim_front.png index eddcd6853..a3e0fbe5b 100644 Binary files a/graphics/pokemon/growlithe/anim_front.png and b/graphics/pokemon/growlithe/anim_front.png differ diff --git a/graphics/pokemon/growlithe/back.png b/graphics/pokemon/growlithe/back.png index ff46b992b..7c7d03df4 100644 Binary files a/graphics/pokemon/growlithe/back.png and b/graphics/pokemon/growlithe/back.png differ diff --git a/graphics/pokemon/growlithe/front.png b/graphics/pokemon/growlithe/front.png deleted file mode 100644 index 743dfb2f9..000000000 Binary files a/graphics/pokemon/growlithe/front.png and /dev/null differ diff --git a/graphics/pokemon/growlithe/normal.pal b/graphics/pokemon/growlithe/normal.pal index cd520d3be..7517c2929 100644 --- a/graphics/pokemon/growlithe/normal.pal +++ b/graphics/pokemon/growlithe/normal.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 152 208 160 -112 96 32 -248 240 160 -184 152 120 +115 98 32 +255 246 164 +197 172 98 16 16 16 -216 200 128 -192 76 8 -120 64 0 -248 152 48 -248 120 24 -136 112 88 -48 56 64 +222 205 123 +197 82 82 +115 57 16 +255 180 82 +238 139 74 +115 98 32 +106 106 106 88 88 120 248 248 240 216 216 208 diff --git a/graphics/pokemon/grumpig/front.png b/graphics/pokemon/grumpig/front.png deleted file mode 100644 index c5b65ca3b..000000000 Binary files a/graphics/pokemon/grumpig/front.png and /dev/null differ diff --git a/graphics/pokemon/gulpin/front.png b/graphics/pokemon/gulpin/front.png deleted file mode 100644 index d1efac94d..000000000 Binary files a/graphics/pokemon/gulpin/front.png and /dev/null differ diff --git a/graphics/pokemon/gurdurr/back.png b/graphics/pokemon/gurdurr/back.png index 0230e7f88..9888f01b5 100644 Binary files a/graphics/pokemon/gurdurr/back.png and b/graphics/pokemon/gurdurr/back.png differ diff --git a/graphics/pokemon/gurdurr/front.png b/graphics/pokemon/gurdurr/front.png deleted file mode 100644 index 710ec3b85..000000000 Binary files a/graphics/pokemon/gurdurr/front.png and /dev/null differ diff --git a/graphics/pokemon/gyarados/anim_front.png b/graphics/pokemon/gyarados/anim_front.png index 5d00da42b..688fed9fe 100644 Binary files a/graphics/pokemon/gyarados/anim_front.png and b/graphics/pokemon/gyarados/anim_front.png differ diff --git a/graphics/pokemon/gyarados/front.png b/graphics/pokemon/gyarados/front.png deleted file mode 100644 index f437da767..000000000 Binary files a/graphics/pokemon/gyarados/front.png and /dev/null differ diff --git a/graphics/pokemon/gyarados/normal.pal b/graphics/pokemon/gyarados/normal.pal index 09c401078..23fb19297 100644 --- a/graphics/pokemon/gyarados/normal.pal +++ b/graphics/pokemon/gyarados/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -24 24 24 -96 96 128 -24 96 144 -168 184 224 -24 64 112 -0 168 208 -16 128 152 -240 240 240 -120 216 232 -240 224 168 -200 168 120 -88 72 48 -104 24 32 -184 48 96 -232 96 64 +25 25 25 +115 123 123 +25 99 148 +214 222 247 +25 66 115 +66 181 239 +33 140 173 +247 247 247 +123 214 239 +247 230 173 +206 181 123 +90 66 33 +107 25 33 +189 49 99 +239 99 66 diff --git a/graphics/pokemon/happiny/front.png b/graphics/pokemon/happiny/front.png deleted file mode 100644 index 547c652ed..000000000 Binary files a/graphics/pokemon/happiny/front.png and /dev/null differ diff --git a/graphics/pokemon/hariyama/front.png b/graphics/pokemon/hariyama/front.png deleted file mode 100644 index 4a21a2a0b..000000000 Binary files a/graphics/pokemon/hariyama/front.png and /dev/null differ diff --git a/graphics/pokemon/haunter/front.png b/graphics/pokemon/haunter/front.png deleted file mode 100644 index f9434ad09..000000000 Binary files a/graphics/pokemon/haunter/front.png and /dev/null differ diff --git a/graphics/pokemon/hawlucha/front.png b/graphics/pokemon/hawlucha/front.png deleted file mode 100644 index 5293bee35..000000000 Binary files a/graphics/pokemon/hawlucha/front.png and /dev/null differ diff --git a/graphics/pokemon/haxorus/front.png b/graphics/pokemon/haxorus/front.png deleted file mode 100644 index e5c216c13..000000000 Binary files a/graphics/pokemon/haxorus/front.png and /dev/null differ diff --git a/graphics/pokemon/heatmor/front.png b/graphics/pokemon/heatmor/front.png deleted file mode 100644 index 0b912da48..000000000 Binary files a/graphics/pokemon/heatmor/front.png and /dev/null differ diff --git a/graphics/pokemon/heatran/front.png b/graphics/pokemon/heatran/front.png deleted file mode 100644 index e446b445d..000000000 Binary files a/graphics/pokemon/heatran/front.png and /dev/null differ diff --git a/graphics/pokemon/heliolisk/front.png b/graphics/pokemon/heliolisk/front.png deleted file mode 100644 index 4ec5b5c22..000000000 Binary files a/graphics/pokemon/heliolisk/front.png and /dev/null differ diff --git a/graphics/pokemon/helioptile/front.png b/graphics/pokemon/helioptile/front.png deleted file mode 100644 index a48717980..000000000 Binary files a/graphics/pokemon/helioptile/front.png and /dev/null differ diff --git a/graphics/pokemon/heracross/front.png b/graphics/pokemon/heracross/front.png deleted file mode 100644 index db9b244da..000000000 Binary files a/graphics/pokemon/heracross/front.png and /dev/null differ diff --git a/graphics/pokemon/herdier/front.png b/graphics/pokemon/herdier/front.png deleted file mode 100644 index b28db7c31..000000000 Binary files a/graphics/pokemon/herdier/front.png and /dev/null differ diff --git a/graphics/pokemon/hippopotas/front.png b/graphics/pokemon/hippopotas/front.png deleted file mode 100644 index ea6fc8584..000000000 Binary files a/graphics/pokemon/hippopotas/front.png and /dev/null differ diff --git a/graphics/pokemon/hippowdon/back.png b/graphics/pokemon/hippowdon/back.png index f6a4cbf28..b2f8daff3 100644 Binary files a/graphics/pokemon/hippowdon/back.png and b/graphics/pokemon/hippowdon/back.png differ diff --git a/graphics/pokemon/hippowdon/front.png b/graphics/pokemon/hippowdon/front.png deleted file mode 100644 index 3dd7b8f84..000000000 Binary files a/graphics/pokemon/hippowdon/front.png and /dev/null differ diff --git a/graphics/pokemon/hitmonchan/anim_front.png b/graphics/pokemon/hitmonchan/anim_front.png index 7930fe60a..71d40fb78 100644 Binary files a/graphics/pokemon/hitmonchan/anim_front.png and b/graphics/pokemon/hitmonchan/anim_front.png differ diff --git a/graphics/pokemon/hitmonchan/back.png b/graphics/pokemon/hitmonchan/back.png index 229bf0da8..d87ab20f7 100644 Binary files a/graphics/pokemon/hitmonchan/back.png and b/graphics/pokemon/hitmonchan/back.png differ diff --git a/graphics/pokemon/hitmonchan/front.png b/graphics/pokemon/hitmonchan/front.png deleted file mode 100644 index 0721d04c0..000000000 Binary files a/graphics/pokemon/hitmonchan/front.png and /dev/null differ diff --git a/graphics/pokemon/hitmonchan/normal.pal b/graphics/pokemon/hitmonchan/normal.pal index 52b91591d..212460931 100644 --- a/graphics/pokemon/hitmonchan/normal.pal +++ b/graphics/pokemon/hitmonchan/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -96 72 72 -200 176 120 +90 65 16 +205 180 123 16 16 16 -160 136 112 -232 208 152 -248 240 248 -96 72 112 -64 128 248 -184 48 72 -248 144 88 -224 96 72 -136 32 0 -144 136 176 -176 168 208 +164 139 115 +238 213 156 +255 246 255 +98 74 115 +98 74 115 +189 49 74 +255 148 90 +230 98 74 +139 32 0 +164 156 164 +197 180 197 232 128 120 diff --git a/graphics/pokemon/hitmonlee/anim_front.png b/graphics/pokemon/hitmonlee/anim_front.png index 7bcda55b2..89d69129d 100644 Binary files a/graphics/pokemon/hitmonlee/anim_front.png and b/graphics/pokemon/hitmonlee/anim_front.png differ diff --git a/graphics/pokemon/hitmonlee/front.png b/graphics/pokemon/hitmonlee/front.png deleted file mode 100644 index 42d195080..000000000 Binary files a/graphics/pokemon/hitmonlee/front.png and /dev/null differ diff --git a/graphics/pokemon/hitmonlee/normal.pal b/graphics/pokemon/hitmonlee/normal.pal index ea2f5b7c4..ef9db0963 100644 --- a/graphics/pokemon/hitmonlee/normal.pal +++ b/graphics/pokemon/hitmonlee/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -128 88 56 -160 120 112 -200 160 128 -96 56 24 -232 192 160 -112 96 96 -16 16 16 +131 90 57 +164 123 115 +205 164 131 +98 57 24 +238 197 164 +115 98 98 +41 41 41 248 248 248 208 200 200 -88 72 48 -184 176 104 -232 224 176 -184 176 104 +90 74 41 +189 180 106 +238 230 180 +189 180 106 240 224 168 0 0 0 diff --git a/graphics/pokemon/hitmontop/front.png b/graphics/pokemon/hitmontop/front.png deleted file mode 100644 index 28118af28..000000000 Binary files a/graphics/pokemon/hitmontop/front.png and /dev/null differ diff --git a/graphics/pokemon/ho_oh/front.png b/graphics/pokemon/ho_oh/front.png deleted file mode 100644 index 4c32adca9..000000000 Binary files a/graphics/pokemon/ho_oh/front.png and /dev/null differ diff --git a/graphics/pokemon/honchkrow/front.png b/graphics/pokemon/honchkrow/front.png deleted file mode 100644 index 9681f682f..000000000 Binary files a/graphics/pokemon/honchkrow/front.png and /dev/null differ diff --git a/graphics/pokemon/honedge/front.png b/graphics/pokemon/honedge/front.png deleted file mode 100644 index 923e4563d..000000000 Binary files a/graphics/pokemon/honedge/front.png and /dev/null differ diff --git a/graphics/pokemon/hoopa/back.png b/graphics/pokemon/hoopa/back.png index a3d76883c..64912b323 100644 Binary files a/graphics/pokemon/hoopa/back.png and b/graphics/pokemon/hoopa/back.png differ diff --git a/graphics/pokemon/hoopa/footprint.png b/graphics/pokemon/hoopa/footprint.png index b7c5cea6a..90b234496 100644 Binary files a/graphics/pokemon/hoopa/footprint.png and b/graphics/pokemon/hoopa/footprint.png differ diff --git a/graphics/pokemon/hoopa/front.png b/graphics/pokemon/hoopa/front.png deleted file mode 100644 index 2f463cdbc..000000000 Binary files a/graphics/pokemon/hoopa/front.png and /dev/null differ diff --git a/graphics/pokemon/hoopa/unbound/front.png b/graphics/pokemon/hoopa/unbound/front.png deleted file mode 100644 index 2df1d6a20..000000000 Binary files a/graphics/pokemon/hoopa/unbound/front.png and /dev/null differ diff --git a/graphics/pokemon/hoopa/unbound/icon.png b/graphics/pokemon/hoopa/unbound/icon.png index ca3bd7764..4c77ca1e2 100644 Binary files a/graphics/pokemon/hoopa/unbound/icon.png and b/graphics/pokemon/hoopa/unbound/icon.png differ diff --git a/graphics/pokemon/hoothoot/anim_front.png b/graphics/pokemon/hoothoot/anim_front.png index 585fc6518..e25d4a4fc 100644 Binary files a/graphics/pokemon/hoothoot/anim_front.png and b/graphics/pokemon/hoothoot/anim_front.png differ diff --git a/graphics/pokemon/hoothoot/front.png b/graphics/pokemon/hoothoot/front.png deleted file mode 100644 index 0cc035380..000000000 Binary files a/graphics/pokemon/hoothoot/front.png and /dev/null differ diff --git a/graphics/pokemon/hoothoot/normal.pal b/graphics/pokemon/hoothoot/normal.pal index 213e6acaa..725429834 100644 --- a/graphics/pokemon/hoothoot/normal.pal +++ b/graphics/pokemon/hoothoot/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 16 16 16 -64 64 64 -152 104 48 -120 88 80 -80 48 0 -184 136 64 -200 160 120 -104 48 24 -184 88 40 -240 96 48 -232 168 144 -216 184 152 -248 224 192 -248 248 248 -120 120 120 +65 65 65 +156 106 49 +115 74 24 +82 49 0 +189 139 65 +205 164 123 +106 49 24 +189 90 41 +246 98 49 +238 172 148 +222 189 156 +255 230 197 +255 255 255 +123 123 123 diff --git a/graphics/pokemon/hoppip/front.png b/graphics/pokemon/hoppip/front.png deleted file mode 100644 index 42f0e5c8e..000000000 Binary files a/graphics/pokemon/hoppip/front.png and /dev/null differ diff --git a/graphics/pokemon/horsea/anim_front.png b/graphics/pokemon/horsea/anim_front.png index 887708af4..3094e3704 100644 Binary files a/graphics/pokemon/horsea/anim_front.png and b/graphics/pokemon/horsea/anim_front.png differ diff --git a/graphics/pokemon/horsea/front.png b/graphics/pokemon/horsea/front.png deleted file mode 100644 index 42d59bfe3..000000000 Binary files a/graphics/pokemon/horsea/front.png and /dev/null differ diff --git a/graphics/pokemon/horsea/normal.pal b/graphics/pokemon/horsea/normal.pal index ba233c7c1..ef39fd81c 100644 --- a/graphics/pokemon/horsea/normal.pal +++ b/graphics/pokemon/horsea/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -32 88 112 -64 152 184 -112 208 240 -184 240 248 +57 82 98 +106 148 180 +164 197 238 +189 222 255 16 16 16 248 248 248 -208 208 208 -248 112 112 -144 128 96 -248 240 192 -208 192 136 -192 40 40 +213 213 213 +255 115 115 +156 131 74 +255 255 172 +222 197 74 +255 115 115 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/houndoom/front.png b/graphics/pokemon/houndoom/front.png deleted file mode 100644 index 8ebef8181..000000000 Binary files a/graphics/pokemon/houndoom/front.png and /dev/null differ diff --git a/graphics/pokemon/houndour/front.png b/graphics/pokemon/houndour/front.png deleted file mode 100644 index 39d1ce974..000000000 Binary files a/graphics/pokemon/houndour/front.png and /dev/null differ diff --git a/graphics/pokemon/huntail/front.png b/graphics/pokemon/huntail/front.png deleted file mode 100644 index 9a5c28850..000000000 Binary files a/graphics/pokemon/huntail/front.png and /dev/null differ diff --git a/graphics/pokemon/hydreigon/front.png b/graphics/pokemon/hydreigon/front.png deleted file mode 100644 index 68aa66cd8..000000000 Binary files a/graphics/pokemon/hydreigon/front.png and /dev/null differ diff --git a/graphics/pokemon/hypno/front.png b/graphics/pokemon/hypno/front.png deleted file mode 100644 index 391eaba23..000000000 Binary files a/graphics/pokemon/hypno/front.png and /dev/null differ diff --git a/graphics/pokemon/igglybuff/anim_front.png b/graphics/pokemon/igglybuff/anim_front.png index e96608aa1..79068d36f 100644 Binary files a/graphics/pokemon/igglybuff/anim_front.png and b/graphics/pokemon/igglybuff/anim_front.png differ diff --git a/graphics/pokemon/igglybuff/front.png b/graphics/pokemon/igglybuff/front.png deleted file mode 100644 index 2d0dad2a8..000000000 Binary files a/graphics/pokemon/igglybuff/front.png and /dev/null differ diff --git a/graphics/pokemon/igglybuff/normal.pal b/graphics/pokemon/igglybuff/normal.pal index 4bf00fcd7..c0e93f53e 100644 --- a/graphics/pokemon/igglybuff/normal.pal +++ b/graphics/pokemon/igglybuff/normal.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 152 208 160 -136 64 64 -248 200 208 -248 168 184 -200 104 96 +156 24 82 +255 205 213 +255 172 189 +180 82 115 16 16 16 -240 120 144 -224 40 16 -136 0 0 -248 248 248 -184 0 0 -128 0 0 +230 131 156 +230 41 16 +139 0 0 +255 255 255 +189 0 0 +139 0 0 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/illumise/front.png b/graphics/pokemon/illumise/front.png deleted file mode 100644 index f91f5c935..000000000 Binary files a/graphics/pokemon/illumise/front.png and /dev/null differ diff --git a/graphics/pokemon/infernape/front.png b/graphics/pokemon/infernape/front.png deleted file mode 100644 index 6bb4d332c..000000000 Binary files a/graphics/pokemon/infernape/front.png and /dev/null differ diff --git a/graphics/pokemon/inkay/front.png b/graphics/pokemon/inkay/front.png deleted file mode 100644 index 2fca9044a..000000000 Binary files a/graphics/pokemon/inkay/front.png and /dev/null differ diff --git a/graphics/pokemon/ivysaur/front.png b/graphics/pokemon/ivysaur/front.png deleted file mode 100644 index 4259abad0..000000000 Binary files a/graphics/pokemon/ivysaur/front.png and /dev/null differ diff --git a/graphics/pokemon/jellicent/backf.png b/graphics/pokemon/jellicent/backf.png index 6471d3bac..f6f0b0605 100644 Binary files a/graphics/pokemon/jellicent/backf.png and b/graphics/pokemon/jellicent/backf.png differ diff --git a/graphics/pokemon/jellicent/front.png b/graphics/pokemon/jellicent/front.png deleted file mode 100644 index 584c7f09b..000000000 Binary files a/graphics/pokemon/jellicent/front.png and /dev/null differ diff --git a/graphics/pokemon/jellicent/icon.png b/graphics/pokemon/jellicent/icon.png index 3b508d92c..0a6f313ce 100644 Binary files a/graphics/pokemon/jellicent/icon.png and b/graphics/pokemon/jellicent/icon.png differ diff --git a/graphics/pokemon/jellicent/iconf.png b/graphics/pokemon/jellicent/iconf.png index a6abfa5ce..f9caf9f13 100644 Binary files a/graphics/pokemon/jellicent/iconf.png and b/graphics/pokemon/jellicent/iconf.png differ diff --git a/graphics/pokemon/jigglypuff/anim_front.png b/graphics/pokemon/jigglypuff/anim_front.png index a10a835b4..d6eb61c1d 100644 Binary files a/graphics/pokemon/jigglypuff/anim_front.png and b/graphics/pokemon/jigglypuff/anim_front.png differ diff --git a/graphics/pokemon/jigglypuff/back.png b/graphics/pokemon/jigglypuff/back.png index a51544283..1cf980c17 100644 Binary files a/graphics/pokemon/jigglypuff/back.png and b/graphics/pokemon/jigglypuff/back.png differ diff --git a/graphics/pokemon/jigglypuff/front.png b/graphics/pokemon/jigglypuff/front.png deleted file mode 100644 index 78c30c532..000000000 Binary files a/graphics/pokemon/jigglypuff/front.png and /dev/null differ diff --git a/graphics/pokemon/jigglypuff/normal.pal b/graphics/pokemon/jigglypuff/normal.pal index 4bc2c0fb5..6f4d96e9d 100644 --- a/graphics/pokemon/jigglypuff/normal.pal +++ b/graphics/pokemon/jigglypuff/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -136 64 64 -248 168 184 -240 120 144 +164 16 32 +255 172 164 +230 115 131 16 16 16 -112 64 24 -248 248 248 -24 112 192 -16 72 136 -16 176 232 -200 184 248 +115 65 24 +255 255 255 +115 98 222 +65 49 156 +148 131 255 +205 189 255 168 16 0 232 64 48 0 0 0 diff --git a/graphics/pokemon/jirachi/front.png b/graphics/pokemon/jirachi/front.png deleted file mode 100644 index 0d94f9c43..000000000 Binary files a/graphics/pokemon/jirachi/front.png and /dev/null differ diff --git a/graphics/pokemon/jolteon/anim_front.png b/graphics/pokemon/jolteon/anim_front.png index b43c1de38..b5c8be0af 100644 Binary files a/graphics/pokemon/jolteon/anim_front.png and b/graphics/pokemon/jolteon/anim_front.png differ diff --git a/graphics/pokemon/jolteon/front.png b/graphics/pokemon/jolteon/front.png deleted file mode 100644 index 83fae9488..000000000 Binary files a/graphics/pokemon/jolteon/front.png and /dev/null differ diff --git a/graphics/pokemon/jolteon/normal.pal b/graphics/pokemon/jolteon/normal.pal index da74dabb8..0655e391c 100644 --- a/graphics/pokemon/jolteon/normal.pal +++ b/graphics/pokemon/jolteon/normal.pal @@ -3,16 +3,16 @@ JASC-PAL 16 152 208 160 16 16 16 -128 104 40 -200 168 72 -128 104 40 +90 74 16 +205 172 74 +172 139 57 152 120 64 -248 248 136 -248 216 80 +255 255 139 +255 222 82 72 8 128 248 248 248 -72 72 80 -192 200 208 +82 82 82 +197 197 197 128 128 136 0 0 0 0 0 0 diff --git a/graphics/pokemon/joltik/front.png b/graphics/pokemon/joltik/front.png deleted file mode 100644 index 845a9a104..000000000 Binary files a/graphics/pokemon/joltik/front.png and /dev/null differ diff --git a/graphics/pokemon/jumpluff/front.png b/graphics/pokemon/jumpluff/front.png deleted file mode 100644 index 3a0922741..000000000 Binary files a/graphics/pokemon/jumpluff/front.png and /dev/null differ diff --git a/graphics/pokemon/jynx/anim_front.png b/graphics/pokemon/jynx/anim_front.png index c5f4b8aba..de426d41a 100644 Binary files a/graphics/pokemon/jynx/anim_front.png and b/graphics/pokemon/jynx/anim_front.png differ diff --git a/graphics/pokemon/jynx/front.png b/graphics/pokemon/jynx/front.png deleted file mode 100644 index df2603da7..000000000 Binary files a/graphics/pokemon/jynx/front.png and /dev/null differ diff --git a/graphics/pokemon/jynx/normal.pal b/graphics/pokemon/jynx/normal.pal index 0990038df..a4e996cb4 100644 --- a/graphics/pokemon/jynx/normal.pal +++ b/graphics/pokemon/jynx/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -144 120 64 -240 224 152 -208 184 104 -248 248 216 +139 98 74 +255 230 82 +222 172 49 +255 246 189 0 0 0 -96 64 128 -176 104 216 -184 184 200 +98 65 131 +180 106 222 +189 189 205 248 248 248 -240 48 88 -248 112 112 -144 72 184 -184 48 96 -128 40 72 -96 96 120 +246 49 90 +255 115 115 +148 74 189 +189 49 98 +131 41 74 +98 98 123 diff --git a/graphics/pokemon/kabuto/front.png b/graphics/pokemon/kabuto/front.png deleted file mode 100644 index 47d4d3df8..000000000 Binary files a/graphics/pokemon/kabuto/front.png and /dev/null differ diff --git a/graphics/pokemon/kabutops/front.png b/graphics/pokemon/kabutops/front.png deleted file mode 100644 index d89cb33ca..000000000 Binary files a/graphics/pokemon/kabutops/front.png and /dev/null differ diff --git a/graphics/pokemon/kadabra/anim_front.png b/graphics/pokemon/kadabra/anim_front.png index 91b225ed6..67f232894 100644 Binary files a/graphics/pokemon/kadabra/anim_front.png and b/graphics/pokemon/kadabra/anim_front.png differ diff --git a/graphics/pokemon/kadabra/front.png b/graphics/pokemon/kadabra/front.png deleted file mode 100644 index a3e193116..000000000 Binary files a/graphics/pokemon/kadabra/front.png and /dev/null differ diff --git a/graphics/pokemon/kadabra/normal.pal b/graphics/pokemon/kadabra/normal.pal index 8082ea708..a69a8d21c 100644 --- a/graphics/pokemon/kadabra/normal.pal +++ b/graphics/pokemon/kadabra/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 112 16 -96 72 8 -248 232 40 -208 184 8 +139 115 16 +98 74 8 +255 238 41 +213 189 8 16 16 16 -224 56 40 -72 48 64 -152 120 120 +230 57 41 +90 57 8 +164 115 41 216 216 216 248 248 248 88 88 88 -104 72 64 +123 82 8 176 176 176 248 248 184 200 168 168 diff --git a/graphics/pokemon/kakuna/anim_front.png b/graphics/pokemon/kakuna/anim_front.png index 586e41597..e86330ea3 100644 Binary files a/graphics/pokemon/kakuna/anim_front.png and b/graphics/pokemon/kakuna/anim_front.png differ diff --git a/graphics/pokemon/kakuna/front.png b/graphics/pokemon/kakuna/front.png deleted file mode 100644 index 679c4b3e0..000000000 Binary files a/graphics/pokemon/kakuna/front.png and /dev/null differ diff --git a/graphics/pokemon/kakuna/normal.pal b/graphics/pokemon/kakuna/normal.pal index 0e0f89567..91ff072e5 100644 --- a/graphics/pokemon/kakuna/normal.pal +++ b/graphics/pokemon/kakuna/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -200 152 16 -152 120 0 -240 200 48 -248 240 200 -120 88 0 -72 56 0 -56 56 56 -104 104 104 +222 164 82 +180 123 0 +246 213 74 +255 246 205 +139 90 0 +90 57 0 +57 57 57 +106 106 106 16 16 16 -248 248 248 +255 255 255 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/kangaskhan/anim_front.png b/graphics/pokemon/kangaskhan/anim_front.png index fe0ca6cb1..d0b912052 100644 Binary files a/graphics/pokemon/kangaskhan/anim_front.png and b/graphics/pokemon/kangaskhan/anim_front.png differ diff --git a/graphics/pokemon/kangaskhan/front.png b/graphics/pokemon/kangaskhan/front.png deleted file mode 100644 index 03e477946..000000000 Binary files a/graphics/pokemon/kangaskhan/front.png and /dev/null differ diff --git a/graphics/pokemon/kangaskhan/normal.pal b/graphics/pokemon/kangaskhan/normal.pal index b59f028cf..ebc1af260 100644 --- a/graphics/pokemon/kangaskhan/normal.pal +++ b/graphics/pokemon/kangaskhan/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -72 56 40 -80 88 88 -136 136 128 -248 232 176 -216 200 136 +82 65 16 +106 106 82 +139 148 98 +255 255 148 +238 213 156 16 16 16 248 248 248 200 200 200 -192 144 128 -136 104 96 -168 16 0 -216 184 168 -184 184 248 -128 128 168 +189 148 115 +148 115 106 +189 24 24 +222 172 131 +222 180 213 +148 106 139 144 96 104 diff --git a/graphics/pokemon/karrablast/front.png b/graphics/pokemon/karrablast/front.png deleted file mode 100644 index 4d2edf923..000000000 Binary files a/graphics/pokemon/karrablast/front.png and /dev/null differ diff --git a/graphics/pokemon/kecleon/front.png b/graphics/pokemon/kecleon/front.png deleted file mode 100644 index 2674a0d16..000000000 Binary files a/graphics/pokemon/kecleon/front.png and /dev/null differ diff --git a/graphics/pokemon/keldeo/front.png b/graphics/pokemon/keldeo/front.png deleted file mode 100644 index ffc17bf57..000000000 Binary files a/graphics/pokemon/keldeo/front.png and /dev/null differ diff --git a/graphics/pokemon/keldeo/resolute/back.png b/graphics/pokemon/keldeo/resolute/back.png index bce78acd9..28654de7d 100644 Binary files a/graphics/pokemon/keldeo/resolute/back.png and b/graphics/pokemon/keldeo/resolute/back.png differ diff --git a/graphics/pokemon/keldeo/resolute/icon.png b/graphics/pokemon/keldeo/resolute/icon.png index 717097290..8da8ea26c 100644 Binary files a/graphics/pokemon/keldeo/resolute/icon.png and b/graphics/pokemon/keldeo/resolute/icon.png differ diff --git a/graphics/pokemon/kingdra/front.png b/graphics/pokemon/kingdra/front.png deleted file mode 100644 index bdce13253..000000000 Binary files a/graphics/pokemon/kingdra/front.png and /dev/null differ diff --git a/graphics/pokemon/kingler/anim_front.png b/graphics/pokemon/kingler/anim_front.png index faf8692ed..d25447163 100644 Binary files a/graphics/pokemon/kingler/anim_front.png and b/graphics/pokemon/kingler/anim_front.png differ diff --git a/graphics/pokemon/kingler/front.png b/graphics/pokemon/kingler/front.png deleted file mode 100644 index 7d63b980c..000000000 Binary files a/graphics/pokemon/kingler/front.png and /dev/null differ diff --git a/graphics/pokemon/kingler/normal.pal b/graphics/pokemon/kingler/normal.pal index f04446375..d05177eee 100644 --- a/graphics/pokemon/kingler/normal.pal +++ b/graphics/pokemon/kingler/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -128 40 8 -248 136 80 -176 88 72 +131 41 8 +255 139 82 +180 90 74 16 16 16 -240 192 136 -72 48 32 -216 168 152 -112 80 16 -88 64 48 -248 240 216 -160 104 64 -248 248 248 -184 184 224 +246 197 139 +74 49 32 +222 172 156 +115 82 16 +90 65 49 +255 246 222 +164 106 65 +255 255 255 +189 189 230 0 0 0 0 0 0 diff --git a/graphics/pokemon/kirlia/front.png b/graphics/pokemon/kirlia/front.png deleted file mode 100644 index c1858f769..000000000 Binary files a/graphics/pokemon/kirlia/front.png and /dev/null differ diff --git a/graphics/pokemon/klang/front.png b/graphics/pokemon/klang/front.png deleted file mode 100644 index 6cfd82984..000000000 Binary files a/graphics/pokemon/klang/front.png and /dev/null differ diff --git a/graphics/pokemon/klefki/front.png b/graphics/pokemon/klefki/front.png deleted file mode 100644 index 3f3e4db3b..000000000 Binary files a/graphics/pokemon/klefki/front.png and /dev/null differ diff --git a/graphics/pokemon/klink/front.png b/graphics/pokemon/klink/front.png deleted file mode 100644 index 3af6a70b0..000000000 Binary files a/graphics/pokemon/klink/front.png and /dev/null differ diff --git a/graphics/pokemon/klinklang/front.png b/graphics/pokemon/klinklang/front.png deleted file mode 100644 index f49e126ee..000000000 Binary files a/graphics/pokemon/klinklang/front.png and /dev/null differ diff --git a/graphics/pokemon/koffing/anim_front.png b/graphics/pokemon/koffing/anim_front.png index 3a5446cf1..fbe8c25e6 100644 Binary files a/graphics/pokemon/koffing/anim_front.png and b/graphics/pokemon/koffing/anim_front.png differ diff --git a/graphics/pokemon/koffing/front.png b/graphics/pokemon/koffing/front.png deleted file mode 100644 index 095559560..000000000 Binary files a/graphics/pokemon/koffing/front.png and /dev/null differ diff --git a/graphics/pokemon/koffing/normal.pal b/graphics/pokemon/koffing/normal.pal index b1ecd15d4..3bc7ed3d8 100644 --- a/graphics/pokemon/koffing/normal.pal +++ b/graphics/pokemon/koffing/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -192 184 128 -224 216 152 -152 144 88 -112 88 152 -200 184 232 -168 144 200 -72 40 88 +238 213 106 +246 238 148 +197 180 41 +115 90 156 +205 189 238 +172 148 205 +74 41 90 16 16 16 248 248 248 216 216 216 -176 88 120 -232 112 136 -200 200 168 -240 232 200 +180 90 123 +238 115 139 +205 205 172 +246 238 205 0 0 0 diff --git a/graphics/pokemon/krabby/anim_front.png b/graphics/pokemon/krabby/anim_front.png index 670f8b537..294beebb2 100644 Binary files a/graphics/pokemon/krabby/anim_front.png and b/graphics/pokemon/krabby/anim_front.png differ diff --git a/graphics/pokemon/krabby/front.png b/graphics/pokemon/krabby/front.png deleted file mode 100644 index 7e919a9be..000000000 Binary files a/graphics/pokemon/krabby/front.png and /dev/null differ diff --git a/graphics/pokemon/krabby/normal.pal b/graphics/pokemon/krabby/normal.pal index e95b7c742..04c1672e7 100644 --- a/graphics/pokemon/krabby/normal.pal +++ b/graphics/pokemon/krabby/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -176 88 72 -248 136 80 -248 176 144 -128 40 8 +222 57 57 +255 115 49 +255 164 98 +156 41 8 16 16 16 -88 64 48 -216 168 152 -128 96 32 -168 128 72 -248 240 216 +90 65 32 +205 172 139 +115 82 16 +172 131 74 +255 230 197 248 248 248 -216 216 216 +222 222 222 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/kricketot/anim_frontf.png b/graphics/pokemon/kricketot/anim_frontf.png index 86b2f773a..f7403b91c 100644 Binary files a/graphics/pokemon/kricketot/anim_frontf.png and b/graphics/pokemon/kricketot/anim_frontf.png differ diff --git a/graphics/pokemon/kricketot/backf.png b/graphics/pokemon/kricketot/backf.png index 9bafab879..7726df0d6 100644 Binary files a/graphics/pokemon/kricketot/backf.png and b/graphics/pokemon/kricketot/backf.png differ diff --git a/graphics/pokemon/kricketot/front.png b/graphics/pokemon/kricketot/front.png deleted file mode 100644 index e158a0a79..000000000 Binary files a/graphics/pokemon/kricketot/front.png and /dev/null differ diff --git a/graphics/pokemon/kricketune/front.png b/graphics/pokemon/kricketune/front.png deleted file mode 100644 index 65de302a5..000000000 Binary files a/graphics/pokemon/kricketune/front.png and /dev/null differ diff --git a/graphics/pokemon/krokorok/front.png b/graphics/pokemon/krokorok/front.png deleted file mode 100644 index ab3c240f1..000000000 Binary files a/graphics/pokemon/krokorok/front.png and /dev/null differ diff --git a/graphics/pokemon/krookodile/front.png b/graphics/pokemon/krookodile/front.png deleted file mode 100644 index 3654e8360..000000000 Binary files a/graphics/pokemon/krookodile/front.png and /dev/null differ diff --git a/graphics/pokemon/kyogre/front.png b/graphics/pokemon/kyogre/front.png deleted file mode 100644 index 59ceadbf7..000000000 Binary files a/graphics/pokemon/kyogre/front.png and /dev/null differ diff --git a/graphics/pokemon/kyurem/black/front.png b/graphics/pokemon/kyurem/black/front.png deleted file mode 100644 index 45b31238f..000000000 Binary files a/graphics/pokemon/kyurem/black/front.png and /dev/null differ diff --git a/graphics/pokemon/kyurem/front.png b/graphics/pokemon/kyurem/front.png deleted file mode 100644 index c558f9172..000000000 Binary files a/graphics/pokemon/kyurem/front.png and /dev/null differ diff --git a/graphics/pokemon/kyurem/white/front.png b/graphics/pokemon/kyurem/white/front.png deleted file mode 100644 index 7b587c7d2..000000000 Binary files a/graphics/pokemon/kyurem/white/front.png and /dev/null differ diff --git a/graphics/pokemon/lairon/front.png b/graphics/pokemon/lairon/front.png deleted file mode 100644 index de830e306..000000000 Binary files a/graphics/pokemon/lairon/front.png and /dev/null differ diff --git a/graphics/pokemon/lampent/front.png b/graphics/pokemon/lampent/front.png deleted file mode 100644 index 2d249ae93..000000000 Binary files a/graphics/pokemon/lampent/front.png and /dev/null differ diff --git a/graphics/pokemon/landorus/front.png b/graphics/pokemon/landorus/front.png deleted file mode 100644 index e16bea46b..000000000 Binary files a/graphics/pokemon/landorus/front.png and /dev/null differ diff --git a/graphics/pokemon/landorus/therian/front.png b/graphics/pokemon/landorus/therian/front.png deleted file mode 100644 index 47f617e4f..000000000 Binary files a/graphics/pokemon/landorus/therian/front.png and /dev/null differ diff --git a/graphics/pokemon/lanturn/anim_front.png b/graphics/pokemon/lanturn/anim_front.png index 69166b66b..b84c0a77f 100644 Binary files a/graphics/pokemon/lanturn/anim_front.png and b/graphics/pokemon/lanturn/anim_front.png differ diff --git a/graphics/pokemon/lanturn/front.png b/graphics/pokemon/lanturn/front.png deleted file mode 100644 index d17887059..000000000 Binary files a/graphics/pokemon/lanturn/front.png and /dev/null differ diff --git a/graphics/pokemon/lanturn/normal.pal b/graphics/pokemon/lanturn/normal.pal index 792d90f29..377916306 100644 --- a/graphics/pokemon/lanturn/normal.pal +++ b/graphics/pokemon/lanturn/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 120 88 -248 216 96 -224 184 48 -88 112 192 -144 160 224 -176 136 32 -48 56 96 -120 152 216 -16 16 16 -248 248 248 -80 64 40 -184 192 232 -160 48 72 -232 96 88 -168 0 0 +123 98 74 +255 222 98 +230 180 82 +74 123 205 +123 172 238 +172 148 65 +41 49 115 +98 148 230 +0 0 0 +255 255 255 +65 49 16 +164 205 255 +164 49 74 +238 98 90 +164 49 74 diff --git a/graphics/pokemon/lapras/anim_front.png b/graphics/pokemon/lapras/anim_front.png index 394a3029d..ac69884f4 100644 Binary files a/graphics/pokemon/lapras/anim_front.png and b/graphics/pokemon/lapras/anim_front.png differ diff --git a/graphics/pokemon/lapras/back.png b/graphics/pokemon/lapras/back.png index 3d336d51a..60d5f840d 100644 Binary files a/graphics/pokemon/lapras/back.png and b/graphics/pokemon/lapras/back.png differ diff --git a/graphics/pokemon/lapras/front.png b/graphics/pokemon/lapras/front.png deleted file mode 100644 index f831c07ba..000000000 Binary files a/graphics/pokemon/lapras/front.png and /dev/null differ diff --git a/graphics/pokemon/lapras/normal.pal b/graphics/pokemon/lapras/normal.pal index cc9c65f46..52f74091b 100644 --- a/graphics/pokemon/lapras/normal.pal +++ b/graphics/pokemon/lapras/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -24 64 80 -8 8 8 -64 160 224 -56 120 160 -112 192 240 -232 232 240 -104 80 64 -144 136 160 -216 192 128 -136 160 144 -80 80 104 -168 176 200 +24 65 82 +0 0 0 +65 164 230 +57 123 164 +115 197 246 +246 238 230 +90 74 65 +164 148 148 +222 197 131 +139 164 148 +82 82 106 +213 205 197 240 216 168 232 128 120 0 0 0 diff --git a/graphics/pokemon/larvesta/front.png b/graphics/pokemon/larvesta/front.png deleted file mode 100644 index b2e83baac..000000000 Binary files a/graphics/pokemon/larvesta/front.png and /dev/null differ diff --git a/graphics/pokemon/larvitar/back.png b/graphics/pokemon/larvitar/back.png index 1a05a964a..2facd5cb5 100644 Binary files a/graphics/pokemon/larvitar/back.png and b/graphics/pokemon/larvitar/back.png differ diff --git a/graphics/pokemon/larvitar/front.png b/graphics/pokemon/larvitar/front.png deleted file mode 100644 index 1974d2843..000000000 Binary files a/graphics/pokemon/larvitar/front.png and /dev/null differ diff --git a/graphics/pokemon/latias/front.png b/graphics/pokemon/latias/front.png deleted file mode 100644 index cb84e81c0..000000000 Binary files a/graphics/pokemon/latias/front.png and /dev/null differ diff --git a/graphics/pokemon/latios/front.png b/graphics/pokemon/latios/front.png deleted file mode 100644 index 283e968b7..000000000 Binary files a/graphics/pokemon/latios/front.png and /dev/null differ diff --git a/graphics/pokemon/leafeon/front.png b/graphics/pokemon/leafeon/front.png deleted file mode 100644 index 7ea19f1b5..000000000 Binary files a/graphics/pokemon/leafeon/front.png and /dev/null differ diff --git a/graphics/pokemon/leavanny/front.png b/graphics/pokemon/leavanny/front.png deleted file mode 100644 index fe45f277d..000000000 Binary files a/graphics/pokemon/leavanny/front.png and /dev/null differ diff --git a/graphics/pokemon/ledian/anim_front.png b/graphics/pokemon/ledian/anim_front.png index 57d90f93b..c866d2769 100644 Binary files a/graphics/pokemon/ledian/anim_front.png and b/graphics/pokemon/ledian/anim_front.png differ diff --git a/graphics/pokemon/ledian/front.png b/graphics/pokemon/ledian/front.png deleted file mode 100644 index a51f2884e..000000000 Binary files a/graphics/pokemon/ledian/front.png and /dev/null differ diff --git a/graphics/pokemon/ledian/normal.pal b/graphics/pokemon/ledian/normal.pal index 370e37e2c..8e4f8a63a 100644 --- a/graphics/pokemon/ledian/normal.pal +++ b/graphics/pokemon/ledian/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 16 16 16 -80 80 80 -192 56 88 -248 128 128 -112 32 16 -248 72 64 -0 64 112 +82 82 82 +197 57 90 +255 131 131 +115 32 16 +255 74 65 +0 16 90 248 248 248 -0 128 184 -176 176 176 -160 120 0 -200 176 56 -240 224 112 -208 208 208 +0 106 222 +180 180 180 +164 123 0 +205 180 57 +246 230 115 +213 213 213 80 80 80 diff --git a/graphics/pokemon/ledyba/anim_front.png b/graphics/pokemon/ledyba/anim_front.png index 38bdd1df2..4239a2776 100644 Binary files a/graphics/pokemon/ledyba/anim_front.png and b/graphics/pokemon/ledyba/anim_front.png differ diff --git a/graphics/pokemon/ledyba/front.png b/graphics/pokemon/ledyba/front.png deleted file mode 100644 index 10e52bbc7..000000000 Binary files a/graphics/pokemon/ledyba/front.png and /dev/null differ diff --git a/graphics/pokemon/ledyba/normal.pal b/graphics/pokemon/ledyba/normal.pal index eb13383da..cb287fc01 100644 --- a/graphics/pokemon/ledyba/normal.pal +++ b/graphics/pokemon/ledyba/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 16 16 16 -88 80 80 -104 40 24 -176 64 48 -240 88 24 -248 152 32 -208 200 200 -248 248 248 -168 160 160 -208 176 120 -248 224 152 -248 248 184 -160 120 0 -104 96 176 -72 48 112 +90 82 82 +106 41 24 +180 65 49 +246 90 24 +255 156 32 +213 205 205 +255 255 255 +172 164 164 +213 180 123 +255 230 156 +255 255 189 +164 123 0 +106 98 180 +74 49 115 diff --git a/graphics/pokemon/lickilicky/front.png b/graphics/pokemon/lickilicky/front.png deleted file mode 100644 index e9905f1a6..000000000 Binary files a/graphics/pokemon/lickilicky/front.png and /dev/null differ diff --git a/graphics/pokemon/lickitung/front.png b/graphics/pokemon/lickitung/front.png deleted file mode 100644 index 6a7177e79..000000000 Binary files a/graphics/pokemon/lickitung/front.png and /dev/null differ diff --git a/graphics/pokemon/liepard/front.png b/graphics/pokemon/liepard/front.png deleted file mode 100644 index 2a9d2abca..000000000 Binary files a/graphics/pokemon/liepard/front.png and /dev/null differ diff --git a/graphics/pokemon/lileep/front.png b/graphics/pokemon/lileep/front.png deleted file mode 100644 index 21f36a6ea..000000000 Binary files a/graphics/pokemon/lileep/front.png and /dev/null differ diff --git a/graphics/pokemon/lilligant/front.png b/graphics/pokemon/lilligant/front.png deleted file mode 100644 index 170a97c17..000000000 Binary files a/graphics/pokemon/lilligant/front.png and /dev/null differ diff --git a/graphics/pokemon/lillipup/front.png b/graphics/pokemon/lillipup/front.png deleted file mode 100644 index 50bf52ed1..000000000 Binary files a/graphics/pokemon/lillipup/front.png and /dev/null differ diff --git a/graphics/pokemon/linoone/front.png b/graphics/pokemon/linoone/front.png deleted file mode 100644 index 955510bdd..000000000 Binary files a/graphics/pokemon/linoone/front.png and /dev/null differ diff --git a/graphics/pokemon/litleo/front.png b/graphics/pokemon/litleo/front.png deleted file mode 100644 index c34e0b74b..000000000 Binary files a/graphics/pokemon/litleo/front.png and /dev/null differ diff --git a/graphics/pokemon/litwick/front.png b/graphics/pokemon/litwick/front.png deleted file mode 100644 index e0b19ccb6..000000000 Binary files a/graphics/pokemon/litwick/front.png and /dev/null differ diff --git a/graphics/pokemon/lombre/front.png b/graphics/pokemon/lombre/front.png deleted file mode 100644 index 022c1c008..000000000 Binary files a/graphics/pokemon/lombre/front.png and /dev/null differ diff --git a/graphics/pokemon/lopunny/front.png b/graphics/pokemon/lopunny/front.png deleted file mode 100644 index 44e188d0f..000000000 Binary files a/graphics/pokemon/lopunny/front.png and /dev/null differ diff --git a/graphics/pokemon/lotad/front.png b/graphics/pokemon/lotad/front.png deleted file mode 100644 index efc92a04b..000000000 Binary files a/graphics/pokemon/lotad/front.png and /dev/null differ diff --git a/graphics/pokemon/loudred/front.png b/graphics/pokemon/loudred/front.png deleted file mode 100644 index 29c1e1baf..000000000 Binary files a/graphics/pokemon/loudred/front.png and /dev/null differ diff --git a/graphics/pokemon/lucario/back.png b/graphics/pokemon/lucario/back.png index d8063193d..24e8a6023 100644 Binary files a/graphics/pokemon/lucario/back.png and b/graphics/pokemon/lucario/back.png differ diff --git a/graphics/pokemon/lucario/front.png b/graphics/pokemon/lucario/front.png deleted file mode 100644 index c4b7a41c2..000000000 Binary files a/graphics/pokemon/lucario/front.png and /dev/null differ diff --git a/graphics/pokemon/ludicolo/front.png b/graphics/pokemon/ludicolo/front.png deleted file mode 100644 index 98ac42818..000000000 Binary files a/graphics/pokemon/ludicolo/front.png and /dev/null differ diff --git a/graphics/pokemon/lugia/front.png b/graphics/pokemon/lugia/front.png deleted file mode 100644 index 124a6f626..000000000 Binary files a/graphics/pokemon/lugia/front.png and /dev/null differ diff --git a/graphics/pokemon/lumineon/front.png b/graphics/pokemon/lumineon/front.png deleted file mode 100644 index 3aae9837f..000000000 Binary files a/graphics/pokemon/lumineon/front.png and /dev/null differ diff --git a/graphics/pokemon/lunatone/front.png b/graphics/pokemon/lunatone/front.png deleted file mode 100644 index 279f1578d..000000000 Binary files a/graphics/pokemon/lunatone/front.png and /dev/null differ diff --git a/graphics/pokemon/luvdisc/front.png b/graphics/pokemon/luvdisc/front.png deleted file mode 100644 index 24ac5a6f9..000000000 Binary files a/graphics/pokemon/luvdisc/front.png and /dev/null differ diff --git a/graphics/pokemon/luxio/back.png b/graphics/pokemon/luxio/back.png index b86883b1f..8ee3ca65b 100644 Binary files a/graphics/pokemon/luxio/back.png and b/graphics/pokemon/luxio/back.png differ diff --git a/graphics/pokemon/luxio/front.png b/graphics/pokemon/luxio/front.png deleted file mode 100644 index f8a883afc..000000000 Binary files a/graphics/pokemon/luxio/front.png and /dev/null differ diff --git a/graphics/pokemon/luxray/back.png b/graphics/pokemon/luxray/back.png index 005e8e5a5..b8625a41a 100644 Binary files a/graphics/pokemon/luxray/back.png and b/graphics/pokemon/luxray/back.png differ diff --git a/graphics/pokemon/luxray/front.png b/graphics/pokemon/luxray/front.png deleted file mode 100644 index 12381ea36..000000000 Binary files a/graphics/pokemon/luxray/front.png and /dev/null differ diff --git a/graphics/pokemon/lycanroc/dusk/front.png b/graphics/pokemon/lycanroc/dusk/front.png index 772f59c6a..0784c7baf 100644 Binary files a/graphics/pokemon/lycanroc/dusk/front.png and b/graphics/pokemon/lycanroc/dusk/front.png differ diff --git a/graphics/pokemon/lycanroc/midnight/front.png b/graphics/pokemon/lycanroc/midnight/front.png index 1c4059d90..2a792d2af 100644 Binary files a/graphics/pokemon/lycanroc/midnight/front.png and b/graphics/pokemon/lycanroc/midnight/front.png differ diff --git a/graphics/pokemon/machamp/anim_front.png b/graphics/pokemon/machamp/anim_front.png index 3bc4a8594..8778b19b1 100644 Binary files a/graphics/pokemon/machamp/anim_front.png and b/graphics/pokemon/machamp/anim_front.png differ diff --git a/graphics/pokemon/machamp/back.png b/graphics/pokemon/machamp/back.png index e50390563..a5744c58c 100644 Binary files a/graphics/pokemon/machamp/back.png and b/graphics/pokemon/machamp/back.png differ diff --git a/graphics/pokemon/machamp/front.png b/graphics/pokemon/machamp/front.png deleted file mode 100644 index d0aced4d2..000000000 Binary files a/graphics/pokemon/machamp/front.png and /dev/null differ diff --git a/graphics/pokemon/machamp/normal.pal b/graphics/pokemon/machamp/normal.pal index 024d63ca6..b08105e30 100644 --- a/graphics/pokemon/machamp/normal.pal +++ b/graphics/pokemon/machamp/normal.pal @@ -2,13 +2,13 @@ JASC-PAL 0100 16 152 208 160 -80 80 104 -120 136 160 -144 176 192 +65 82 98 +131 139 148 +164 180 180 0 0 0 112 96 72 -232 208 184 -176 160 128 +74 74 98 +172 156 65 184 0 0 248 248 248 128 112 40 diff --git a/graphics/pokemon/machamp/shiny.pal b/graphics/pokemon/machamp/shiny.pal index 24be63926..3bbeb6722 100644 --- a/graphics/pokemon/machamp/shiny.pal +++ b/graphics/pokemon/machamp/shiny.pal @@ -7,7 +7,7 @@ JASC-PAL 152 184 88 8 8 8 80 64 24 -216 208 144 +49 74 0 160 152 80 184 32 32 248 248 248 diff --git a/graphics/pokemon/machoke/anim_front.png b/graphics/pokemon/machoke/anim_front.png index c8c9f731e..3286b07fc 100644 Binary files a/graphics/pokemon/machoke/anim_front.png and b/graphics/pokemon/machoke/anim_front.png differ diff --git a/graphics/pokemon/machoke/front.png b/graphics/pokemon/machoke/front.png deleted file mode 100644 index 0b84d0621..000000000 Binary files a/graphics/pokemon/machoke/front.png and /dev/null differ diff --git a/graphics/pokemon/machoke/normal.pal b/graphics/pokemon/machoke/normal.pal index ab90d151b..1dab6bec2 100644 --- a/graphics/pokemon/machoke/normal.pal +++ b/graphics/pokemon/machoke/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -112 96 72 +82 57 0 16 16 16 -232 208 184 -176 160 128 -120 136 160 -144 176 192 -72 72 96 -168 200 216 -192 16 16 +238 230 139 +205 189 98 +139 115 180 +189 156 230 +106 49 131 +205 189 230 +197 0 0 248 248 248 -224 80 56 +156 57 123 240 224 120 72 72 96 200 176 96 -128 112 40 +131 115 41 diff --git a/graphics/pokemon/machop/anim_front.png b/graphics/pokemon/machop/anim_front.png index 2c1f083ae..ed54423a3 100644 Binary files a/graphics/pokemon/machop/anim_front.png and b/graphics/pokemon/machop/anim_front.png differ diff --git a/graphics/pokemon/machop/front.png b/graphics/pokemon/machop/front.png deleted file mode 100644 index b94735495..000000000 Binary files a/graphics/pokemon/machop/front.png and /dev/null differ diff --git a/graphics/pokemon/machop/normal.pal b/graphics/pokemon/machop/normal.pal index 2f6bba75b..7274f6250 100644 --- a/graphics/pokemon/machop/normal.pal +++ b/graphics/pokemon/machop/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -104 80 32 -240 232 136 -168 152 88 -200 184 96 -16 16 16 -144 192 192 -80 120 120 -168 216 200 -40 72 80 -248 248 248 -232 72 72 -176 0 0 -112 160 160 +107 82 33 +239 230 140 +173 156 90 +206 189 99 +0 0 0 +148 189 189 +90 123 107 +173 214 197 +41 74 82 +255 255 255 +239 82 82 +181 0 0 +115 165 165 240 80 80 -248 128 144 +255 132 140 diff --git a/graphics/pokemon/magby/front.png b/graphics/pokemon/magby/front.png deleted file mode 100644 index 389af0d03..000000000 Binary files a/graphics/pokemon/magby/front.png and /dev/null differ diff --git a/graphics/pokemon/magcargo/front.png b/graphics/pokemon/magcargo/front.png deleted file mode 100644 index dda50c3f8..000000000 Binary files a/graphics/pokemon/magcargo/front.png and /dev/null differ diff --git a/graphics/pokemon/magearna/back.png b/graphics/pokemon/magearna/back.png index c66e5f3a8..e29c4ad6c 100644 Binary files a/graphics/pokemon/magearna/back.png and b/graphics/pokemon/magearna/back.png differ diff --git a/graphics/pokemon/magearna/front.png b/graphics/pokemon/magearna/front.png index 18e73e31a..20db67ab6 100644 Binary files a/graphics/pokemon/magearna/front.png and b/graphics/pokemon/magearna/front.png differ diff --git a/graphics/pokemon/magearna/original_color/back.png b/graphics/pokemon/magearna/original_color/back.png index 7472bcbac..cf9c0e323 100644 Binary files a/graphics/pokemon/magearna/original_color/back.png and b/graphics/pokemon/magearna/original_color/back.png differ diff --git a/graphics/pokemon/magearna/original_color/front.png b/graphics/pokemon/magearna/original_color/front.png index 4cc57d909..afeb78dae 100644 Binary files a/graphics/pokemon/magearna/original_color/front.png and b/graphics/pokemon/magearna/original_color/front.png differ diff --git a/graphics/pokemon/magearna/original_color/icon.png b/graphics/pokemon/magearna/original_color/icon.png index a51a74e11..057698e41 100644 Binary files a/graphics/pokemon/magearna/original_color/icon.png and b/graphics/pokemon/magearna/original_color/icon.png differ diff --git a/graphics/pokemon/magikarp/anim_front.png b/graphics/pokemon/magikarp/anim_front.png index 42dc57805..6b7d130f6 100644 Binary files a/graphics/pokemon/magikarp/anim_front.png and b/graphics/pokemon/magikarp/anim_front.png differ diff --git a/graphics/pokemon/magikarp/front.png b/graphics/pokemon/magikarp/front.png deleted file mode 100644 index aea8a95eb..000000000 Binary files a/graphics/pokemon/magikarp/front.png and /dev/null differ diff --git a/graphics/pokemon/magikarp/normal.pal b/graphics/pokemon/magikarp/normal.pal index 453ba5b1f..b96d5fa4f 100644 --- a/graphics/pokemon/magikarp/normal.pal +++ b/graphics/pokemon/magikarp/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -120 96 80 +123 98 82 248 216 40 -184 32 80 +189 57 57 240 96 24 248 248 248 -80 80 96 -136 136 160 -128 0 64 +82 82 98 +139 139 164 +131 0 65 248 152 96 0 0 0 200 200 208 -224 136 160 -248 184 192 +255 156 98 +255 230 197 184 56 56 192 168 112 diff --git a/graphics/pokemon/magmar/anim_front.png b/graphics/pokemon/magmar/anim_front.png index 4ea85a978..a57d2c848 100644 Binary files a/graphics/pokemon/magmar/anim_front.png and b/graphics/pokemon/magmar/anim_front.png differ diff --git a/graphics/pokemon/magmar/front.png b/graphics/pokemon/magmar/front.png deleted file mode 100644 index ec95e3e8f..000000000 Binary files a/graphics/pokemon/magmar/front.png and /dev/null differ diff --git a/graphics/pokemon/magmar/normal.pal b/graphics/pokemon/magmar/normal.pal index c81dbd0e3..82ab177c4 100644 --- a/graphics/pokemon/magmar/normal.pal +++ b/graphics/pokemon/magmar/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -192 120 16 -120 80 48 -248 232 72 -224 184 48 -248 240 200 -248 72 48 +197 123 16 +123 82 49 +255 238 74 +230 189 49 +255 246 205 +255 74 49 16 16 16 -104 32 32 -200 16 64 -248 136 96 -64 72 88 +106 32 32 +205 16 65 +255 139 98 +98 98 98 248 248 248 -248 192 152 -192 192 192 -200 152 120 +255 205 189 +197 197 197 +255 139 98 diff --git a/graphics/pokemon/magmortar/front.png b/graphics/pokemon/magmortar/front.png deleted file mode 100644 index 38f46e85e..000000000 Binary files a/graphics/pokemon/magmortar/front.png and /dev/null differ diff --git a/graphics/pokemon/magnemite/anim_front.png b/graphics/pokemon/magnemite/anim_front.png index 96ddc9bc2..cca53cadd 100644 Binary files a/graphics/pokemon/magnemite/anim_front.png and b/graphics/pokemon/magnemite/anim_front.png differ diff --git a/graphics/pokemon/magnemite/front.png b/graphics/pokemon/magnemite/front.png deleted file mode 100644 index 9a9148728..000000000 Binary files a/graphics/pokemon/magnemite/front.png and /dev/null differ diff --git a/graphics/pokemon/magnemite/normal.pal b/graphics/pokemon/magnemite/normal.pal index f67d59686..50084032f 100644 --- a/graphics/pokemon/magnemite/normal.pal +++ b/graphics/pokemon/magnemite/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 136 136 -232 248 248 -208 208 208 -80 72 72 +139 139 139 +222 255 230 +213 213 213 +82 74 74 16 16 16 -56 48 48 -248 64 64 -192 32 32 -128 168 184 -192 224 232 -64 96 112 -80 200 240 -40 128 168 +57 49 49 +255 139 74 +238 24 0 +139 180 164 +180 213 189 +90 131 98 +82 205 246 +41 131 172 168 168 168 -232 248 248 +255 255 255 diff --git a/graphics/pokemon/magneton/anim_front.png b/graphics/pokemon/magneton/anim_front.png index 9d36e2396..f54516b95 100644 Binary files a/graphics/pokemon/magneton/anim_front.png and b/graphics/pokemon/magneton/anim_front.png differ diff --git a/graphics/pokemon/magneton/front.png b/graphics/pokemon/magneton/front.png deleted file mode 100644 index e0a94e0fb..000000000 Binary files a/graphics/pokemon/magneton/front.png and /dev/null differ diff --git a/graphics/pokemon/magneton/normal.pal b/graphics/pokemon/magneton/normal.pal index 8938cb90a..55f2f9d99 100644 --- a/graphics/pokemon/magneton/normal.pal +++ b/graphics/pokemon/magneton/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -80 72 72 -56 48 48 -248 64 64 +82 74 74 +57 49 49 +255 139 74 16 16 16 -192 32 32 -136 136 136 -80 200 240 -232 248 248 -40 128 168 +238 24 0 +139 139 139 +82 205 246 +213 213 213 +41 131 172 208 208 208 -64 96 112 -184 208 224 -112 160 176 +74 98 74 +180 213 189 +131 156 156 248 248 248 168 168 168 diff --git a/graphics/pokemon/magnezone/front.png b/graphics/pokemon/magnezone/front.png deleted file mode 100644 index 1a2b3ff38..000000000 Binary files a/graphics/pokemon/magnezone/front.png and /dev/null differ diff --git a/graphics/pokemon/makuhita/front.png b/graphics/pokemon/makuhita/front.png deleted file mode 100644 index 438ac8283..000000000 Binary files a/graphics/pokemon/makuhita/front.png and /dev/null differ diff --git a/graphics/pokemon/malamar/front.png b/graphics/pokemon/malamar/front.png deleted file mode 100644 index bbb95da6c..000000000 Binary files a/graphics/pokemon/malamar/front.png and /dev/null differ diff --git a/graphics/pokemon/mamoswine/front.png b/graphics/pokemon/mamoswine/front.png deleted file mode 100644 index 2b7945603..000000000 Binary files a/graphics/pokemon/mamoswine/front.png and /dev/null differ diff --git a/graphics/pokemon/manaphy/front.png b/graphics/pokemon/manaphy/front.png deleted file mode 100644 index ed6a5e4b2..000000000 Binary files a/graphics/pokemon/manaphy/front.png and /dev/null differ diff --git a/graphics/pokemon/mandibuzz/front.png b/graphics/pokemon/mandibuzz/front.png deleted file mode 100644 index acd99e1e3..000000000 Binary files a/graphics/pokemon/mandibuzz/front.png and /dev/null differ diff --git a/graphics/pokemon/manectric/front.png b/graphics/pokemon/manectric/front.png deleted file mode 100644 index c82e63447..000000000 Binary files a/graphics/pokemon/manectric/front.png and /dev/null differ diff --git a/graphics/pokemon/mankey/anim_front.png b/graphics/pokemon/mankey/anim_front.png index 5ad7a32bf..453750f97 100644 Binary files a/graphics/pokemon/mankey/anim_front.png and b/graphics/pokemon/mankey/anim_front.png differ diff --git a/graphics/pokemon/mankey/front.png b/graphics/pokemon/mankey/front.png deleted file mode 100644 index fbbe3e1fc..000000000 Binary files a/graphics/pokemon/mankey/front.png and /dev/null differ diff --git a/graphics/pokemon/mankey/normal.pal b/graphics/pokemon/mankey/normal.pal index fff90ad75..b0b0e0fbf 100644 --- a/graphics/pokemon/mankey/normal.pal +++ b/graphics/pokemon/mankey/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -112 64 0 -216 160 112 +115 65 0 +222 164 115 16 16 16 -192 112 72 -240 216 176 -208 168 152 +197 115 74 +246 222 180 +213 172 156 248 248 248 248 120 104 -224 120 120 -200 88 64 -248 168 168 -240 216 224 +180 65 49 +238 115 98 +238 115 98 +238 180 139 248 192 168 248 232 224 104 72 48 diff --git a/graphics/pokemon/mantine/front.png b/graphics/pokemon/mantine/front.png deleted file mode 100644 index ed3bd56b1..000000000 Binary files a/graphics/pokemon/mantine/front.png and /dev/null differ diff --git a/graphics/pokemon/mantyke/front.png b/graphics/pokemon/mantyke/front.png deleted file mode 100644 index b06a66d0a..000000000 Binary files a/graphics/pokemon/mantyke/front.png and /dev/null differ diff --git a/graphics/pokemon/maractus/front.png b/graphics/pokemon/maractus/front.png deleted file mode 100644 index 3ba7400be..000000000 Binary files a/graphics/pokemon/maractus/front.png and /dev/null differ diff --git a/graphics/pokemon/mareep/anim_front.png b/graphics/pokemon/mareep/anim_front.png index 5c67de509..47961b201 100644 Binary files a/graphics/pokemon/mareep/anim_front.png and b/graphics/pokemon/mareep/anim_front.png differ diff --git a/graphics/pokemon/mareep/back.png b/graphics/pokemon/mareep/back.png index 027ad17ce..c0d26a07b 100644 Binary files a/graphics/pokemon/mareep/back.png and b/graphics/pokemon/mareep/back.png differ diff --git a/graphics/pokemon/mareep/front.png b/graphics/pokemon/mareep/front.png deleted file mode 100644 index 703f09066..000000000 Binary files a/graphics/pokemon/mareep/front.png and /dev/null differ diff --git a/graphics/pokemon/mareep/normal.pal b/graphics/pokemon/mareep/normal.pal index eaefbe935..c8e45e1a4 100644 --- a/graphics/pokemon/mareep/normal.pal +++ b/graphics/pokemon/mareep/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -224 168 0 -200 176 136 -248 248 248 -248 216 0 -128 112 80 +230 172 0 +205 156 82 +255 255 255 +255 222 0 +156 98 32 16 16 16 -248 224 184 -224 200 160 -56 64 64 -224 168 16 -248 216 8 -136 144 144 -0 72 144 -80 128 184 -112 160 240 +255 255 189 +238 205 115 +82 82 82 +164 164 164 +180 123 0 +82 131 189 +0 74 148 +115 164 246 +98 148 222 diff --git a/graphics/pokemon/mareep/shiny.pal b/graphics/pokemon/mareep/shiny.pal index caa76333c..de18d5b3b 100644 --- a/graphics/pokemon/mareep/shiny.pal +++ b/graphics/pokemon/mareep/shiny.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 216 168 0 -200 144 176 +208 96 184 248 248 248 240 216 0 -152 80 120 +168 24 136 16 16 16 248 200 248 -224 176 216 +232 152 216 80 80 80 -216 168 0 -240 216 0 160 160 160 +168 120 0 +48 136 184 16 72 144 -48 144 192 -112 192 240 +128 192 240 +80 168 224 diff --git a/graphics/pokemon/marill/front.png b/graphics/pokemon/marill/front.png deleted file mode 100644 index d56a82fc4..000000000 Binary files a/graphics/pokemon/marill/front.png and /dev/null differ diff --git a/graphics/pokemon/marowak/anim_front.png b/graphics/pokemon/marowak/anim_front.png index 83117e3b2..f1a22033e 100644 Binary files a/graphics/pokemon/marowak/anim_front.png and b/graphics/pokemon/marowak/anim_front.png differ diff --git a/graphics/pokemon/marowak/front.png b/graphics/pokemon/marowak/front.png deleted file mode 100644 index 74a26b00f..000000000 Binary files a/graphics/pokemon/marowak/front.png and /dev/null differ diff --git a/graphics/pokemon/marowak/normal.pal b/graphics/pokemon/marowak/normal.pal index 119c76e9b..6aa7063f2 100644 --- a/graphics/pokemon/marowak/normal.pal +++ b/graphics/pokemon/marowak/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 128 152 +139 139 106 248 248 248 16 16 16 -192 192 200 -80 80 96 +197 197 205 +82 74 57 224 224 232 -88 64 16 -192 152 72 -144 104 80 +90 65 16 +197 156 74 +148 106 82 224 176 120 176 144 136 120 88 80 -176 160 128 -128 112 88 -224 200 160 +230 148 82 +189 115 57 +246 197 148 diff --git a/graphics/pokemon/marshadow/front.png b/graphics/pokemon/marshadow/front.png deleted file mode 100644 index 14a1503bd..000000000 Binary files a/graphics/pokemon/marshadow/front.png and /dev/null differ diff --git a/graphics/pokemon/marshtomp/back.png b/graphics/pokemon/marshtomp/back.png index b04c6cc5c..baa4e481b 100644 Binary files a/graphics/pokemon/marshtomp/back.png and b/graphics/pokemon/marshtomp/back.png differ diff --git a/graphics/pokemon/marshtomp/front.png b/graphics/pokemon/marshtomp/front.png deleted file mode 100644 index ead3658ed..000000000 Binary files a/graphics/pokemon/marshtomp/front.png and /dev/null differ diff --git a/graphics/pokemon/masquerain/front.png b/graphics/pokemon/masquerain/front.png deleted file mode 100644 index 853e08a17..000000000 Binary files a/graphics/pokemon/masquerain/front.png and /dev/null differ diff --git a/graphics/pokemon/mawile/front.png b/graphics/pokemon/mawile/front.png deleted file mode 100644 index 9f8bddbfd..000000000 Binary files a/graphics/pokemon/mawile/front.png and /dev/null differ diff --git a/graphics/pokemon/medicham/front.png b/graphics/pokemon/medicham/front.png deleted file mode 100644 index 63734b124..000000000 Binary files a/graphics/pokemon/medicham/front.png and /dev/null differ diff --git a/graphics/pokemon/meditite/front.png b/graphics/pokemon/meditite/front.png deleted file mode 100644 index c1c0dcd06..000000000 Binary files a/graphics/pokemon/meditite/front.png and /dev/null differ diff --git a/graphics/pokemon/meganium/anim_front.png b/graphics/pokemon/meganium/anim_front.png index 6352e96e2..b89016f3c 100644 Binary files a/graphics/pokemon/meganium/anim_front.png and b/graphics/pokemon/meganium/anim_front.png differ diff --git a/graphics/pokemon/meganium/front.png b/graphics/pokemon/meganium/front.png deleted file mode 100644 index 2a813e118..000000000 Binary files a/graphics/pokemon/meganium/front.png and /dev/null differ diff --git a/graphics/pokemon/meganium/normal.pal b/graphics/pokemon/meganium/normal.pal index d594136b8..75da9204b 100644 --- a/graphics/pokemon/meganium/normal.pal +++ b/graphics/pokemon/meganium/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 248 192 248 -248 216 32 -96 72 0 -224 168 0 -152 168 80 -80 104 24 -208 232 136 -184 208 104 +255 222 32 +98 74 0 +230 172 0 +106 172 65 +16 115 41 +189 255 123 +139 222 49 16 16 16 -248 248 248 -248 56 88 -120 16 56 -240 160 152 -200 32 56 -200 200 200 -104 104 104 +255 255 255 +255 57 90 +123 16 57 +246 164 156 +205 32 57 +205 205 205 +106 106 106 diff --git a/graphics/pokemon/meloetta/front.png b/graphics/pokemon/meloetta/front.png deleted file mode 100644 index fad54a0b0..000000000 Binary files a/graphics/pokemon/meloetta/front.png and /dev/null differ diff --git a/graphics/pokemon/meowstic/female/front.png b/graphics/pokemon/meowstic/female/front.png deleted file mode 100644 index d65446893..000000000 Binary files a/graphics/pokemon/meowstic/female/front.png and /dev/null differ diff --git a/graphics/pokemon/meowstic/front.png b/graphics/pokemon/meowstic/front.png deleted file mode 100644 index 5ec230fb7..000000000 Binary files a/graphics/pokemon/meowstic/front.png and /dev/null differ diff --git a/graphics/pokemon/meowth/anim_front.png b/graphics/pokemon/meowth/anim_front.png index 1c699350c..b6ebbfab9 100644 Binary files a/graphics/pokemon/meowth/anim_front.png and b/graphics/pokemon/meowth/anim_front.png differ diff --git a/graphics/pokemon/meowth/back.png b/graphics/pokemon/meowth/back.png index b3153d495..7c87e642f 100644 Binary files a/graphics/pokemon/meowth/back.png and b/graphics/pokemon/meowth/back.png differ diff --git a/graphics/pokemon/meowth/front.png b/graphics/pokemon/meowth/front.png deleted file mode 100644 index 3f9bc67ad..000000000 Binary files a/graphics/pokemon/meowth/front.png and /dev/null differ diff --git a/graphics/pokemon/meowth/normal.pal b/graphics/pokemon/meowth/normal.pal index 8368723fb..133349470 100644 --- a/graphics/pokemon/meowth/normal.pal +++ b/graphics/pokemon/meowth/normal.pal @@ -5,15 +5,15 @@ JASC-PAL 152 104 0 248 224 128 16 16 16 -144 88 0 +148 90 0 248 248 248 248 208 0 200 160 0 192 120 8 216 184 56 216 216 216 -192 120 144 +255 115 82 232 152 48 -248 248 200 -112 72 40 +148 65 0 +213 90 57 0 0 0 diff --git a/graphics/pokemon/meowth/shiny.pal b/graphics/pokemon/meowth/shiny.pal index 396e16873..0aba58a22 100644 --- a/graphics/pokemon/meowth/shiny.pal +++ b/graphics/pokemon/meowth/shiny.pal @@ -3,7 +3,7 @@ JASC-PAL 16 152 208 160 144 72 24 -248 216 144 +255 205 131 16 16 16 136 72 24 248 248 248 @@ -14,6 +14,6 @@ JASC-PAL 224 224 224 248 112 80 248 128 144 -248 232 176 -152 56 72 +172 41 57 +213 90 57 0 0 0 diff --git a/graphics/pokemon/mesprit/front.png b/graphics/pokemon/mesprit/front.png deleted file mode 100644 index 0ca08f734..000000000 Binary files a/graphics/pokemon/mesprit/front.png and /dev/null differ diff --git a/graphics/pokemon/metagross/front.png b/graphics/pokemon/metagross/front.png deleted file mode 100644 index 43a762538..000000000 Binary files a/graphics/pokemon/metagross/front.png and /dev/null differ diff --git a/graphics/pokemon/metang/front.png b/graphics/pokemon/metang/front.png deleted file mode 100644 index da3998543..000000000 Binary files a/graphics/pokemon/metang/front.png and /dev/null differ diff --git a/graphics/pokemon/metapod/front.png b/graphics/pokemon/metapod/front.png deleted file mode 100644 index cde83b1f0..000000000 Binary files a/graphics/pokemon/metapod/front.png and /dev/null differ diff --git a/graphics/pokemon/mew/anim_front.png b/graphics/pokemon/mew/anim_front.png index a993b8110..8ce4efeb2 100644 Binary files a/graphics/pokemon/mew/anim_front.png and b/graphics/pokemon/mew/anim_front.png differ diff --git a/graphics/pokemon/mew/front.png b/graphics/pokemon/mew/front.png deleted file mode 100644 index ad13c8ece..000000000 Binary files a/graphics/pokemon/mew/front.png and /dev/null differ diff --git a/graphics/pokemon/mew/normal.pal b/graphics/pokemon/mew/normal.pal index 1b2aafb65..872a4b8d8 100644 --- a/graphics/pokemon/mew/normal.pal +++ b/graphics/pokemon/mew/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -176 96 144 -248 208 232 -232 128 176 -88 40 80 -248 176 208 +180 98 148 +255 213 238 +238 131 180 +106 49 90 +255 180 213 0 0 0 248 240 248 -128 168 240 -40 96 224 -48 64 96 +131 172 246 +41 98 230 +24 57 106 240 176 128 0 0 0 0 0 0 diff --git a/graphics/pokemon/mewtwo/anim_front.png b/graphics/pokemon/mewtwo/anim_front.png index c787ffa80..149ec2322 100644 Binary files a/graphics/pokemon/mewtwo/anim_front.png and b/graphics/pokemon/mewtwo/anim_front.png differ diff --git a/graphics/pokemon/mewtwo/front.png b/graphics/pokemon/mewtwo/front.png deleted file mode 100644 index 9d31937c2..000000000 Binary files a/graphics/pokemon/mewtwo/front.png and /dev/null differ diff --git a/graphics/pokemon/mewtwo/normal.pal b/graphics/pokemon/mewtwo/normal.pal index 66aa6cac4..c938e5394 100644 --- a/graphics/pokemon/mewtwo/normal.pal +++ b/graphics/pokemon/mewtwo/normal.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 152 208 160 -128 120 152 -224 224 240 -56 56 80 -184 176 200 +131 123 156 +222 213 230 +57 57 82 +180 172 197 0 0 0 -240 240 248 -120 56 128 -168 80 192 +238 230 238 +106 49 156 +148 65 189 240 240 240 -176 104 200 -56 32 80 +180 74 238 +57 32 82 216 216 216 248 248 248 0 0 0 diff --git a/graphics/pokemon/mienfoo/front.png b/graphics/pokemon/mienfoo/front.png deleted file mode 100644 index 51cc46ada..000000000 Binary files a/graphics/pokemon/mienfoo/front.png and /dev/null differ diff --git a/graphics/pokemon/mienshao/front.png b/graphics/pokemon/mienshao/front.png deleted file mode 100644 index 6c1ca33a3..000000000 Binary files a/graphics/pokemon/mienshao/front.png and /dev/null differ diff --git a/graphics/pokemon/mightyena/front.png b/graphics/pokemon/mightyena/front.png deleted file mode 100644 index e7ddfbcf7..000000000 Binary files a/graphics/pokemon/mightyena/front.png and /dev/null differ diff --git a/graphics/pokemon/milotic/front.png b/graphics/pokemon/milotic/front.png deleted file mode 100644 index 08f338984..000000000 Binary files a/graphics/pokemon/milotic/front.png and /dev/null differ diff --git a/graphics/pokemon/miltank/front.png b/graphics/pokemon/miltank/front.png deleted file mode 100644 index 4ac2687e1..000000000 Binary files a/graphics/pokemon/miltank/front.png and /dev/null differ diff --git a/graphics/pokemon/mime_jr/front.png b/graphics/pokemon/mime_jr/front.png deleted file mode 100644 index c3519f6c9..000000000 Binary files a/graphics/pokemon/mime_jr/front.png and /dev/null differ diff --git a/graphics/pokemon/mimikyu/busted/back.png b/graphics/pokemon/mimikyu/busted/back.png index 732fe1234..1d1804435 100644 Binary files a/graphics/pokemon/mimikyu/busted/back.png and b/graphics/pokemon/mimikyu/busted/back.png differ diff --git a/graphics/pokemon/mimikyu/busted/front.png b/graphics/pokemon/mimikyu/busted/front.png index c9c36c1f4..09e78fac9 100644 Binary files a/graphics/pokemon/mimikyu/busted/front.png and b/graphics/pokemon/mimikyu/busted/front.png differ diff --git a/graphics/pokemon/mimikyu/busted/icon.png b/graphics/pokemon/mimikyu/busted/icon.png index 9a1cf38c4..3ba567ab3 100644 Binary files a/graphics/pokemon/mimikyu/busted/icon.png and b/graphics/pokemon/mimikyu/busted/icon.png differ diff --git a/graphics/pokemon/minccino/back.png b/graphics/pokemon/minccino/back.png index c2b32adba..92eb266fd 100644 Binary files a/graphics/pokemon/minccino/back.png and b/graphics/pokemon/minccino/back.png differ diff --git a/graphics/pokemon/minccino/front.png b/graphics/pokemon/minccino/front.png deleted file mode 100644 index a9b05cdc0..000000000 Binary files a/graphics/pokemon/minccino/front.png and /dev/null differ diff --git a/graphics/pokemon/minior/core/back.png b/graphics/pokemon/minior/core/back.png index 6b0b565f4..af768d469 100644 Binary files a/graphics/pokemon/minior/core/back.png and b/graphics/pokemon/minior/core/back.png differ diff --git a/graphics/pokemon/minior/core/blue/icon.png b/graphics/pokemon/minior/core/blue/icon.png index bda398288..0dbb8fe0e 100644 Binary files a/graphics/pokemon/minior/core/blue/icon.png and b/graphics/pokemon/minior/core/blue/icon.png differ diff --git a/graphics/pokemon/minior/core/front.png b/graphics/pokemon/minior/core/front.png index e9dba883a..ab7e89615 100644 Binary files a/graphics/pokemon/minior/core/front.png and b/graphics/pokemon/minior/core/front.png differ diff --git a/graphics/pokemon/minior/core/green/icon.png b/graphics/pokemon/minior/core/green/icon.png index 529e60520..dc36402de 100644 Binary files a/graphics/pokemon/minior/core/green/icon.png and b/graphics/pokemon/minior/core/green/icon.png differ diff --git a/graphics/pokemon/minior/core/indigo/icon.png b/graphics/pokemon/minior/core/indigo/icon.png index f24a887bf..a27482ea1 100644 Binary files a/graphics/pokemon/minior/core/indigo/icon.png and b/graphics/pokemon/minior/core/indigo/icon.png differ diff --git a/graphics/pokemon/minior/core/orange/icon.png b/graphics/pokemon/minior/core/orange/icon.png index c588e1dd7..6dea4aca6 100644 Binary files a/graphics/pokemon/minior/core/orange/icon.png and b/graphics/pokemon/minior/core/orange/icon.png differ diff --git a/graphics/pokemon/minior/core/violet/icon.png b/graphics/pokemon/minior/core/violet/icon.png index 207c3f455..609ace524 100644 Binary files a/graphics/pokemon/minior/core/violet/icon.png and b/graphics/pokemon/minior/core/violet/icon.png differ diff --git a/graphics/pokemon/minior/core/yellow/icon.png b/graphics/pokemon/minior/core/yellow/icon.png index 270115f68..b0cfaa1c3 100644 Binary files a/graphics/pokemon/minior/core/yellow/icon.png and b/graphics/pokemon/minior/core/yellow/icon.png differ diff --git a/graphics/pokemon/minun/back.png b/graphics/pokemon/minun/back.png index 1e9d01ea3..f8b11aba9 100644 Binary files a/graphics/pokemon/minun/back.png and b/graphics/pokemon/minun/back.png differ diff --git a/graphics/pokemon/minun/front.png b/graphics/pokemon/minun/front.png deleted file mode 100644 index fa72433dc..000000000 Binary files a/graphics/pokemon/minun/front.png and /dev/null differ diff --git a/graphics/pokemon/misdreavus/front.png b/graphics/pokemon/misdreavus/front.png deleted file mode 100644 index b46d709a9..000000000 Binary files a/graphics/pokemon/misdreavus/front.png and /dev/null differ diff --git a/graphics/pokemon/mismagius/front.png b/graphics/pokemon/mismagius/front.png deleted file mode 100644 index 5d68e8b70..000000000 Binary files a/graphics/pokemon/mismagius/front.png and /dev/null differ diff --git a/graphics/pokemon/moltres/anim_front.png b/graphics/pokemon/moltres/anim_front.png index 04e279d07..15a023223 100644 Binary files a/graphics/pokemon/moltres/anim_front.png and b/graphics/pokemon/moltres/anim_front.png differ diff --git a/graphics/pokemon/moltres/front.png b/graphics/pokemon/moltres/front.png deleted file mode 100644 index ac717bb48..000000000 Binary files a/graphics/pokemon/moltres/front.png and /dev/null differ diff --git a/graphics/pokemon/moltres/normal.pal b/graphics/pokemon/moltres/normal.pal index 6698521da..a675d27dc 100644 --- a/graphics/pokemon/moltres/normal.pal +++ b/graphics/pokemon/moltres/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -208 8 8 -232 96 56 -112 64 16 -248 192 72 -16 8 8 -216 144 16 -248 160 72 -248 208 96 -248 232 96 -56 56 112 +213 8 8 +238 98 57 +115 65 16 +255 197 74 +0 0 0 +222 148 16 +255 164 74 +255 213 98 +255 238 98 +0 0 0 248 248 248 -80 56 56 -136 96 72 -176 136 96 -96 96 96 +82 57 41 +139 98 74 +180 139 98 +98 98 98 diff --git a/graphics/pokemon/monferno/front.png b/graphics/pokemon/monferno/front.png deleted file mode 100644 index 08ac29b53..000000000 Binary files a/graphics/pokemon/monferno/front.png and /dev/null differ diff --git a/graphics/pokemon/mothim/front.png b/graphics/pokemon/mothim/front.png deleted file mode 100644 index b18fffe17..000000000 Binary files a/graphics/pokemon/mothim/front.png and /dev/null differ diff --git a/graphics/pokemon/mr_mime/anim_front.png b/graphics/pokemon/mr_mime/anim_front.png index afdc8878e..0b80ad02b 100644 Binary files a/graphics/pokemon/mr_mime/anim_front.png and b/graphics/pokemon/mr_mime/anim_front.png differ diff --git a/graphics/pokemon/mr_mime/back.png b/graphics/pokemon/mr_mime/back.png index d5fbd0396..b9e15eacf 100644 Binary files a/graphics/pokemon/mr_mime/back.png and b/graphics/pokemon/mr_mime/back.png differ diff --git a/graphics/pokemon/mr_mime/front.png b/graphics/pokemon/mr_mime/front.png deleted file mode 100644 index 13f5a8ff7..000000000 Binary files a/graphics/pokemon/mr_mime/front.png and /dev/null differ diff --git a/graphics/pokemon/mr_mime/normal.pal b/graphics/pokemon/mr_mime/normal.pal index 32ba22300..2affaeea8 100644 --- a/graphics/pokemon/mr_mime/normal.pal +++ b/graphics/pokemon/mr_mime/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -16 40 56 -16 72 112 -96 136 184 +16 49 74 +16 74 115 +98 139 189 16 16 16 -104 64 72 -248 224 224 -248 200 208 -216 168 176 +106 57 49 +255 238 238 +255 205 205 +222 164 164 248 248 248 -184 192 200 -248 88 104 -112 48 56 -184 72 112 -248 168 176 +205 205 213 +255 90 106 +115 49 57 +189 74 115 +255 172 180 208 48 32 diff --git a/graphics/pokemon/mudkip/front.png b/graphics/pokemon/mudkip/front.png deleted file mode 100644 index 7c83c421f..000000000 Binary files a/graphics/pokemon/mudkip/front.png and /dev/null differ diff --git a/graphics/pokemon/muk/anim_front.png b/graphics/pokemon/muk/anim_front.png index d2da551df..8f78e22e9 100644 Binary files a/graphics/pokemon/muk/anim_front.png and b/graphics/pokemon/muk/anim_front.png differ diff --git a/graphics/pokemon/muk/front.png b/graphics/pokemon/muk/front.png deleted file mode 100644 index 3684a6eda..000000000 Binary files a/graphics/pokemon/muk/front.png and /dev/null differ diff --git a/graphics/pokemon/muk/normal.pal b/graphics/pokemon/muk/normal.pal index 43d09a88d..f35af64a4 100644 --- a/graphics/pokemon/muk/normal.pal +++ b/graphics/pokemon/muk/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -120 72 128 -224 184 232 -192 160 200 -160 120 168 -88 48 112 +123 74 131 +230 189 238 +197 164 205 +164 123 172 +90 49 115 16 16 16 248 248 248 -152 184 208 -64 72 96 -120 128 152 +172 180 189 +65 74 90 +131 139 156 224 208 232 0 0 0 0 0 0 diff --git a/graphics/pokemon/munchlax/front.png b/graphics/pokemon/munchlax/front.png deleted file mode 100644 index 243df8dd0..000000000 Binary files a/graphics/pokemon/munchlax/front.png and /dev/null differ diff --git a/graphics/pokemon/munna/front.png b/graphics/pokemon/munna/front.png deleted file mode 100644 index 3abe09025..000000000 Binary files a/graphics/pokemon/munna/front.png and /dev/null differ diff --git a/graphics/pokemon/murkrow/front.png b/graphics/pokemon/murkrow/front.png deleted file mode 100644 index de8f7cd5d..000000000 Binary files a/graphics/pokemon/murkrow/front.png and /dev/null differ diff --git a/graphics/pokemon/musharna/front.png b/graphics/pokemon/musharna/front.png deleted file mode 100644 index 75addd095..000000000 Binary files a/graphics/pokemon/musharna/front.png and /dev/null differ diff --git a/graphics/pokemon/natu/anim_front.png b/graphics/pokemon/natu/anim_front.png index 4ba2a6eee..8ac7b53c0 100644 Binary files a/graphics/pokemon/natu/anim_front.png and b/graphics/pokemon/natu/anim_front.png differ diff --git a/graphics/pokemon/natu/front.png b/graphics/pokemon/natu/front.png deleted file mode 100644 index c77e0f9bd..000000000 Binary files a/graphics/pokemon/natu/front.png and /dev/null differ diff --git a/graphics/pokemon/natu/normal.pal b/graphics/pokemon/natu/normal.pal index 0d9796fa5..1b1f57e13 100644 --- a/graphics/pokemon/natu/normal.pal +++ b/graphics/pokemon/natu/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 0 176 232 -128 40 0 -248 88 88 -216 40 88 -72 144 64 -40 104 40 -112 184 64 -144 216 64 -16 16 16 -128 96 32 -248 224 40 -216 168 40 -248 248 248 -80 80 80 -200 200 200 -144 144 144 +131 41 0 +246 90 90 +213 41 90 +74 148 65 +41 106 41 +115 189 65 +148 213 65 +41 41 41 +131 98 32 +255 222 41 +213 172 41 +255 255 255 +82 82 82 +205 205 205 +148 148 148 diff --git a/graphics/pokemon/necrozma/dawn_wings/back.png b/graphics/pokemon/necrozma/dawn_wings/back.png index 2c3fcb400..be258fb08 100644 Binary files a/graphics/pokemon/necrozma/dawn_wings/back.png and b/graphics/pokemon/necrozma/dawn_wings/back.png differ diff --git a/graphics/pokemon/necrozma/dawn_wings/front.png b/graphics/pokemon/necrozma/dawn_wings/front.png index e8f31dc49..a5c75ea2b 100644 Binary files a/graphics/pokemon/necrozma/dawn_wings/front.png and b/graphics/pokemon/necrozma/dawn_wings/front.png differ diff --git a/graphics/pokemon/necrozma/dawn_wings/icon.png b/graphics/pokemon/necrozma/dawn_wings/icon.png index 558ff6088..c5fde92c4 100644 Binary files a/graphics/pokemon/necrozma/dawn_wings/icon.png and b/graphics/pokemon/necrozma/dawn_wings/icon.png differ diff --git a/graphics/pokemon/necrozma/dusk_mane/back.png b/graphics/pokemon/necrozma/dusk_mane/back.png index 1a1b9e07e..96621697c 100644 Binary files a/graphics/pokemon/necrozma/dusk_mane/back.png and b/graphics/pokemon/necrozma/dusk_mane/back.png differ diff --git a/graphics/pokemon/necrozma/dusk_mane/front.png b/graphics/pokemon/necrozma/dusk_mane/front.png index c9a72135e..f2b88ee0c 100644 Binary files a/graphics/pokemon/necrozma/dusk_mane/front.png and b/graphics/pokemon/necrozma/dusk_mane/front.png differ diff --git a/graphics/pokemon/necrozma/dusk_mane/icon.png b/graphics/pokemon/necrozma/dusk_mane/icon.png index 90c74736e..e0e4ef479 100644 Binary files a/graphics/pokemon/necrozma/dusk_mane/icon.png and b/graphics/pokemon/necrozma/dusk_mane/icon.png differ diff --git a/graphics/pokemon/necrozma/ultra/back.png b/graphics/pokemon/necrozma/ultra/back.png index 798e1290f..1dcdc3835 100644 Binary files a/graphics/pokemon/necrozma/ultra/back.png and b/graphics/pokemon/necrozma/ultra/back.png differ diff --git a/graphics/pokemon/necrozma/ultra/front.png b/graphics/pokemon/necrozma/ultra/front.png index fc57cce63..0eac6b0fe 100644 Binary files a/graphics/pokemon/necrozma/ultra/front.png and b/graphics/pokemon/necrozma/ultra/front.png differ diff --git a/graphics/pokemon/necrozma/ultra/icon.png b/graphics/pokemon/necrozma/ultra/icon.png index e41c58de6..8adcbb3f5 100644 Binary files a/graphics/pokemon/necrozma/ultra/icon.png and b/graphics/pokemon/necrozma/ultra/icon.png differ diff --git a/graphics/pokemon/nidoking/anim_front.png b/graphics/pokemon/nidoking/anim_front.png index 1645f15e0..79d0a3542 100644 Binary files a/graphics/pokemon/nidoking/anim_front.png and b/graphics/pokemon/nidoking/anim_front.png differ diff --git a/graphics/pokemon/nidoking/front.png b/graphics/pokemon/nidoking/front.png deleted file mode 100644 index cc9ad6d08..000000000 Binary files a/graphics/pokemon/nidoking/front.png and /dev/null differ diff --git a/graphics/pokemon/nidoking/normal.pal b/graphics/pokemon/nidoking/normal.pal index bbed53d87..84b8d0f6c 100644 --- a/graphics/pokemon/nidoking/normal.pal +++ b/graphics/pokemon/nidoking/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -104 48 120 -216 144 240 +90 41 106 +222 148 246 16 16 16 -208 112 232 -160 80 144 -40 120 144 -24 68 96 -64 144 192 -248 248 248 -192 192 160 -168 16 0 -112 112 88 -232 64 48 -240 240 248 +213 115 238 +164 82 148 +41 123 148 +0 74 98 +65 148 197 +255 255 255 +197 197 164 +172 16 0 +115 115 90 +230 65 49 +230 230 213 232 232 216 diff --git a/graphics/pokemon/nidoqueen/anim_front.png b/graphics/pokemon/nidoqueen/anim_front.png index 58950bb34..0f69643eb 100644 Binary files a/graphics/pokemon/nidoqueen/anim_front.png and b/graphics/pokemon/nidoqueen/anim_front.png differ diff --git a/graphics/pokemon/nidoqueen/back.png b/graphics/pokemon/nidoqueen/back.png index e983016e2..90a8cca1c 100644 Binary files a/graphics/pokemon/nidoqueen/back.png and b/graphics/pokemon/nidoqueen/back.png differ diff --git a/graphics/pokemon/nidoqueen/front.png b/graphics/pokemon/nidoqueen/front.png deleted file mode 100644 index b66809612..000000000 Binary files a/graphics/pokemon/nidoqueen/front.png and /dev/null differ diff --git a/graphics/pokemon/nidoqueen/normal.pal b/graphics/pokemon/nidoqueen/normal.pal index b1c43f5f8..3901338e3 100644 --- a/graphics/pokemon/nidoqueen/normal.pal +++ b/graphics/pokemon/nidoqueen/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -72 128 184 -120 184 248 -40 80 128 +98 139 172 +90 180 205 +49 74 74 16 16 16 -160 128 104 -128 96 96 -96 72 72 -152 216 248 +189 172 90 +115 90 41 +115 90 41 +156 213 222 208 208 208 248 248 248 -200 184 144 -232 232 168 -248 248 208 +189 172 90 +230 205 139 +238 230 164 112 40 40 232 128 120 diff --git a/graphics/pokemon/nidoran_f/anim_front.png b/graphics/pokemon/nidoran_f/anim_front.png index 15d742ab9..8261f4d77 100644 Binary files a/graphics/pokemon/nidoran_f/anim_front.png and b/graphics/pokemon/nidoran_f/anim_front.png differ diff --git a/graphics/pokemon/nidoran_f/front.png b/graphics/pokemon/nidoran_f/front.png deleted file mode 100644 index 1e84b1d99..000000000 Binary files a/graphics/pokemon/nidoran_f/front.png and /dev/null differ diff --git a/graphics/pokemon/nidoran_f/normal.pal b/graphics/pokemon/nidoran_f/normal.pal index 16d475109..6f2e8898b 100644 --- a/graphics/pokemon/nidoran_f/normal.pal +++ b/graphics/pokemon/nidoran_f/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -120 128 184 -64 64 120 -152 176 216 -200 216 240 -56 104 144 -32 152 160 +115 131 172 +90 65 131 +172 172 205 +213 213 255 +52 109 179 +65 139 230 16 16 16 248 248 248 -184 48 72 -232 232 248 -248 80 64 -216 216 216 +189 49 74 +238 238 255 +255 82 65 +222 222 222 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/nidoran_m/anim_front.png b/graphics/pokemon/nidoran_m/anim_front.png index dc2eff8a0..5f0990c40 100644 Binary files a/graphics/pokemon/nidoran_m/anim_front.png and b/graphics/pokemon/nidoran_m/anim_front.png differ diff --git a/graphics/pokemon/nidoran_m/front.png b/graphics/pokemon/nidoran_m/front.png deleted file mode 100644 index c94dfdc0e..000000000 Binary files a/graphics/pokemon/nidoran_m/front.png and /dev/null differ diff --git a/graphics/pokemon/nidoran_m/normal.pal b/graphics/pokemon/nidoran_m/normal.pal index fb292bfd0..711acdb79 100644 --- a/graphics/pokemon/nidoran_m/normal.pal +++ b/graphics/pokemon/nidoran_m/normal.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 152 208 160 -184 96 192 -224 152 208 -96 64 104 +189 98 197 +230 156 213 +98 65 106 16 16 16 -232 184 232 -0 96 64 -0 160 112 -200 200 200 -248 104 80 -248 248 248 -216 64 40 +238 189 238 +0 98 65 +0 164 115 +205 205 205 +255 106 82 +255 255 255 +222 65 41 176 24 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/nidorina/anim_front.png b/graphics/pokemon/nidorina/anim_front.png index 9d4f3853b..51ba5cb07 100644 Binary files a/graphics/pokemon/nidorina/anim_front.png and b/graphics/pokemon/nidorina/anim_front.png differ diff --git a/graphics/pokemon/nidorina/front.png b/graphics/pokemon/nidorina/front.png deleted file mode 100644 index c5e3e7b85..000000000 Binary files a/graphics/pokemon/nidorina/front.png and /dev/null differ diff --git a/graphics/pokemon/nidorina/normal.pal b/graphics/pokemon/nidorina/normal.pal index 1ad762c66..bab15d82f 100644 --- a/graphics/pokemon/nidorina/normal.pal +++ b/graphics/pokemon/nidorina/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 153 210 164 -91 143 173 -186 220 226 -44 76 114 +90 148 180 +197 230 238 +57 90 98 16 16 16 -141 190 201 -24 56 112 -16 96 176 +139 197 205 +24 57 115 +55 95 176 72 128 240 255 255 255 214 214 214 -192 32 16 -248 144 112 -232 72 56 +197 32 16 +255 156 139 +238 74 57 131 131 131 0 0 0 diff --git a/graphics/pokemon/nidorino/anim_front.png b/graphics/pokemon/nidorino/anim_front.png index 30369bf7e..9fd1786bc 100644 Binary files a/graphics/pokemon/nidorino/anim_front.png and b/graphics/pokemon/nidorino/anim_front.png differ diff --git a/graphics/pokemon/nidorino/back.png b/graphics/pokemon/nidorino/back.png index e5868c58e..a7078074e 100644 Binary files a/graphics/pokemon/nidorino/back.png and b/graphics/pokemon/nidorino/back.png differ diff --git a/graphics/pokemon/nidorino/front.png b/graphics/pokemon/nidorino/front.png deleted file mode 100644 index 67cfc4922..000000000 Binary files a/graphics/pokemon/nidorino/front.png and /dev/null differ diff --git a/graphics/pokemon/nidorino/normal.pal b/graphics/pokemon/nidorino/normal.pal index 1c2aee97c..a668ac118 100644 --- a/graphics/pokemon/nidorino/normal.pal +++ b/graphics/pokemon/nidorino/normal.pal @@ -2,13 +2,13 @@ JASC-PAL 0100 16 152 208 160 -88 56 96 -200 128 216 +90 57 98 +205 131 222 16 16 16 -224 168 232 -144 96 152 -0 144 96 -72 200 160 +230 172 238 +148 90 180 +0 148 98 +74 205 164 248 248 248 128 128 128 192 192 192 diff --git a/graphics/pokemon/nincada/front.png b/graphics/pokemon/nincada/front.png deleted file mode 100644 index 1c408a81d..000000000 Binary files a/graphics/pokemon/nincada/front.png and /dev/null differ diff --git a/graphics/pokemon/ninetales/anim_front.png b/graphics/pokemon/ninetales/anim_front.png index 643f1ef8c..2959ce9fe 100644 Binary files a/graphics/pokemon/ninetales/anim_front.png and b/graphics/pokemon/ninetales/anim_front.png differ diff --git a/graphics/pokemon/ninetales/back.png b/graphics/pokemon/ninetales/back.png index 5507f9e37..507b27859 100644 Binary files a/graphics/pokemon/ninetales/back.png and b/graphics/pokemon/ninetales/back.png differ diff --git a/graphics/pokemon/ninetales/front.png b/graphics/pokemon/ninetales/front.png deleted file mode 100644 index 7b33c6f41..000000000 Binary files a/graphics/pokemon/ninetales/front.png and /dev/null differ diff --git a/graphics/pokemon/ninetales/normal.pal b/graphics/pokemon/ninetales/normal.pal index e0dfb21c5..021c15775 100644 --- a/graphics/pokemon/ninetales/normal.pal +++ b/graphics/pokemon/ninetales/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -200 152 72 -128 96 24 -240 224 120 +205 156 74 +131 98 24 +246 230 123 16 16 16 -224 192 80 -176 72 48 -248 248 248 -248 104 40 -248 160 56 -232 128 40 +230 197 82 +180 16 0 +255 255 255 +255 106 41 +255 172 49 +255 148 16 168 16 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/ninjask/front.png b/graphics/pokemon/ninjask/front.png deleted file mode 100644 index f7c0d20dc..000000000 Binary files a/graphics/pokemon/ninjask/front.png and /dev/null differ diff --git a/graphics/pokemon/noctowl/anim_front.png b/graphics/pokemon/noctowl/anim_front.png index e6ff6d210..751b21e93 100644 Binary files a/graphics/pokemon/noctowl/anim_front.png and b/graphics/pokemon/noctowl/anim_front.png differ diff --git a/graphics/pokemon/noctowl/front.png b/graphics/pokemon/noctowl/front.png deleted file mode 100644 index 6665234c0..000000000 Binary files a/graphics/pokemon/noctowl/front.png and /dev/null differ diff --git a/graphics/pokemon/noctowl/normal.pal b/graphics/pokemon/noctowl/normal.pal index cf763b733..0e4e0b077 100644 --- a/graphics/pokemon/noctowl/normal.pal +++ b/graphics/pokemon/noctowl/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -176 120 80 -96 64 48 -240 224 168 -120 88 72 -216 184 144 -64 40 32 -200 144 112 +172 123 74 +98 65 49 +255 246 180 +123 90 74 +222 205 90 +65 41 32 +213 148 98 16 16 16 -96 96 96 -248 248 248 -192 48 24 -152 0 0 -192 192 192 -144 88 56 -160 128 104 +98 98 98 +255 255 255 +197 49 24 +156 0 0 +197 197 197 +148 90 57 +164 131 106 diff --git a/graphics/pokemon/noibat/front.png b/graphics/pokemon/noibat/front.png deleted file mode 100644 index 6934317f2..000000000 Binary files a/graphics/pokemon/noibat/front.png and /dev/null differ diff --git a/graphics/pokemon/noivern/front.png b/graphics/pokemon/noivern/front.png deleted file mode 100644 index 252a56fb4..000000000 Binary files a/graphics/pokemon/noivern/front.png and /dev/null differ diff --git a/graphics/pokemon/nosepass/front.png b/graphics/pokemon/nosepass/front.png deleted file mode 100644 index 695577233..000000000 Binary files a/graphics/pokemon/nosepass/front.png and /dev/null differ diff --git a/graphics/pokemon/numel/front.png b/graphics/pokemon/numel/front.png deleted file mode 100644 index 2df10f3c7..000000000 Binary files a/graphics/pokemon/numel/front.png and /dev/null differ diff --git a/graphics/pokemon/nuzleaf/front.png b/graphics/pokemon/nuzleaf/front.png deleted file mode 100644 index 173398f52..000000000 Binary files a/graphics/pokemon/nuzleaf/front.png and /dev/null differ diff --git a/graphics/pokemon/octillery/front.png b/graphics/pokemon/octillery/front.png deleted file mode 100644 index 2fc250c8d..000000000 Binary files a/graphics/pokemon/octillery/front.png and /dev/null differ diff --git a/graphics/pokemon/oddish/anim_front.png b/graphics/pokemon/oddish/anim_front.png index cd1f5e16c..9634703b1 100644 Binary files a/graphics/pokemon/oddish/anim_front.png and b/graphics/pokemon/oddish/anim_front.png differ diff --git a/graphics/pokemon/oddish/back.png b/graphics/pokemon/oddish/back.png index 21a343a9d..7d96a680f 100644 Binary files a/graphics/pokemon/oddish/back.png and b/graphics/pokemon/oddish/back.png differ diff --git a/graphics/pokemon/oddish/front.png b/graphics/pokemon/oddish/front.png deleted file mode 100644 index 345e4c509..000000000 Binary files a/graphics/pokemon/oddish/front.png and /dev/null differ diff --git a/graphics/pokemon/oddish/normal.pal b/graphics/pokemon/oddish/normal.pal index 0a9d87c1a..30c3a2645 100644 --- a/graphics/pokemon/oddish/normal.pal +++ b/graphics/pokemon/oddish/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 248 192 192 -48 136 16 -32 88 8 -56 184 32 -136 200 88 +139 172 49 +74 90 32 +156 213 74 +197 230 123 16 16 16 -56 96 136 -112 144 168 -136 168 192 -232 56 48 -40 56 72 +90 106 131 +115 148 164 +148 180 197 +238 57 49 +41 57 74 178 92 121 214 149 172 0 0 0 diff --git a/graphics/pokemon/omanyte/anim_front.png b/graphics/pokemon/omanyte/anim_front.png index d6d8d6705..9a51401e8 100644 Binary files a/graphics/pokemon/omanyte/anim_front.png and b/graphics/pokemon/omanyte/anim_front.png differ diff --git a/graphics/pokemon/omanyte/front.png b/graphics/pokemon/omanyte/front.png deleted file mode 100644 index eb805c417..000000000 Binary files a/graphics/pokemon/omanyte/front.png and /dev/null differ diff --git a/graphics/pokemon/omanyte/normal.pal b/graphics/pokemon/omanyte/normal.pal index 24f024ad2..696dba994 100644 --- a/graphics/pokemon/omanyte/normal.pal +++ b/graphics/pokemon/omanyte/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -96 80 48 +98 82 49 152 128 104 -224 216 128 -192 168 112 -248 232 192 +230 222 131 +197 172 115 +255 238 197 0 0 0 -64 104 168 -56 64 128 -96 184 240 -56 152 200 +65 106 172 +57 65 131 +98 189 246 +57 156 205 248 248 248 192 192 192 104 104 104 diff --git a/graphics/pokemon/omastar/front.png b/graphics/pokemon/omastar/front.png deleted file mode 100644 index 87796c37d..000000000 Binary files a/graphics/pokemon/omastar/front.png and /dev/null differ diff --git a/graphics/pokemon/onix/anim_front.png b/graphics/pokemon/onix/anim_front.png index 65409126f..ea35bcfc9 100644 Binary files a/graphics/pokemon/onix/anim_front.png and b/graphics/pokemon/onix/anim_front.png differ diff --git a/graphics/pokemon/onix/front.png b/graphics/pokemon/onix/front.png deleted file mode 100644 index e28cd8a82..000000000 Binary files a/graphics/pokemon/onix/front.png and /dev/null differ diff --git a/graphics/pokemon/onix/normal.pal b/graphics/pokemon/onix/normal.pal index 871cca5d8..339177663 100644 --- a/graphics/pokemon/onix/normal.pal +++ b/graphics/pokemon/onix/normal.pal @@ -2,12 +2,12 @@ JASC-PAL 0100 16 152 208 160 -72 64 72 -112 104 128 -200 200 208 -152 144 152 +82 74 74 +131 123 123 +246 238 238 +189 180 180 16 16 16 -176 176 184 +222 213 213 248 248 248 248 248 248 0 0 0 diff --git a/graphics/pokemon/oricorio/pau/back.png b/graphics/pokemon/oricorio/pau/back.png index f2771b8b5..7969b5019 100644 Binary files a/graphics/pokemon/oricorio/pau/back.png and b/graphics/pokemon/oricorio/pau/back.png differ diff --git a/graphics/pokemon/oricorio/pau/front.png b/graphics/pokemon/oricorio/pau/front.png index b6c6f6733..004b8cc9c 100644 Binary files a/graphics/pokemon/oricorio/pau/front.png and b/graphics/pokemon/oricorio/pau/front.png differ diff --git a/graphics/pokemon/oricorio/pau/icon.png b/graphics/pokemon/oricorio/pau/icon.png index a4ba46d2b..c3353a924 100644 Binary files a/graphics/pokemon/oricorio/pau/icon.png and b/graphics/pokemon/oricorio/pau/icon.png differ diff --git a/graphics/pokemon/oricorio/pom_pom/back.png b/graphics/pokemon/oricorio/pom_pom/back.png index 78eadc3fe..f6f22ae1b 100644 Binary files a/graphics/pokemon/oricorio/pom_pom/back.png and b/graphics/pokemon/oricorio/pom_pom/back.png differ diff --git a/graphics/pokemon/oricorio/pom_pom/front.png b/graphics/pokemon/oricorio/pom_pom/front.png index 44deb56e8..5ed6c71b5 100644 Binary files a/graphics/pokemon/oricorio/pom_pom/front.png and b/graphics/pokemon/oricorio/pom_pom/front.png differ diff --git a/graphics/pokemon/oricorio/pom_pom/icon.png b/graphics/pokemon/oricorio/pom_pom/icon.png index ead80b6a2..9f83917ba 100644 Binary files a/graphics/pokemon/oricorio/pom_pom/icon.png and b/graphics/pokemon/oricorio/pom_pom/icon.png differ diff --git a/graphics/pokemon/oricorio/sensu/back.png b/graphics/pokemon/oricorio/sensu/back.png index 694e30afd..25ed57b0c 100644 Binary files a/graphics/pokemon/oricorio/sensu/back.png and b/graphics/pokemon/oricorio/sensu/back.png differ diff --git a/graphics/pokemon/oricorio/sensu/front.png b/graphics/pokemon/oricorio/sensu/front.png index 470f68471..5abc5e547 100644 Binary files a/graphics/pokemon/oricorio/sensu/front.png and b/graphics/pokemon/oricorio/sensu/front.png differ diff --git a/graphics/pokemon/oricorio/sensu/icon.png b/graphics/pokemon/oricorio/sensu/icon.png index 1bbb78de1..9828bb206 100644 Binary files a/graphics/pokemon/oricorio/sensu/icon.png and b/graphics/pokemon/oricorio/sensu/icon.png differ diff --git a/graphics/pokemon/oshawott/front.png b/graphics/pokemon/oshawott/front.png deleted file mode 100644 index 4a0a0004a..000000000 Binary files a/graphics/pokemon/oshawott/front.png and /dev/null differ diff --git a/graphics/pokemon/pachirisu/front.png b/graphics/pokemon/pachirisu/front.png deleted file mode 100644 index 7d60cf8df..000000000 Binary files a/graphics/pokemon/pachirisu/front.png and /dev/null differ diff --git a/graphics/pokemon/palkia/front.png b/graphics/pokemon/palkia/front.png deleted file mode 100644 index 4e2d3f513..000000000 Binary files a/graphics/pokemon/palkia/front.png and /dev/null differ diff --git a/graphics/pokemon/palpitoad/front.png b/graphics/pokemon/palpitoad/front.png deleted file mode 100644 index 05b2a8b24..000000000 Binary files a/graphics/pokemon/palpitoad/front.png and /dev/null differ diff --git a/graphics/pokemon/pancham/front.png b/graphics/pokemon/pancham/front.png deleted file mode 100644 index 79cd40df4..000000000 Binary files a/graphics/pokemon/pancham/front.png and /dev/null differ diff --git a/graphics/pokemon/pangoro/front.png b/graphics/pokemon/pangoro/front.png deleted file mode 100644 index 9de90108a..000000000 Binary files a/graphics/pokemon/pangoro/front.png and /dev/null differ diff --git a/graphics/pokemon/panpour/front.png b/graphics/pokemon/panpour/front.png deleted file mode 100644 index bc17b1fbc..000000000 Binary files a/graphics/pokemon/panpour/front.png and /dev/null differ diff --git a/graphics/pokemon/pansage/front.png b/graphics/pokemon/pansage/front.png deleted file mode 100644 index 63e3125ca..000000000 Binary files a/graphics/pokemon/pansage/front.png and /dev/null differ diff --git a/graphics/pokemon/pansear/front.png b/graphics/pokemon/pansear/front.png deleted file mode 100644 index c7dc3a5b8..000000000 Binary files a/graphics/pokemon/pansear/front.png and /dev/null differ diff --git a/graphics/pokemon/paras/anim_front.png b/graphics/pokemon/paras/anim_front.png index 54a56c933..3b00df10a 100644 Binary files a/graphics/pokemon/paras/anim_front.png and b/graphics/pokemon/paras/anim_front.png differ diff --git a/graphics/pokemon/paras/back.png b/graphics/pokemon/paras/back.png index a0e9981f5..8e22aadc5 100644 Binary files a/graphics/pokemon/paras/back.png and b/graphics/pokemon/paras/back.png differ diff --git a/graphics/pokemon/paras/front.png b/graphics/pokemon/paras/front.png deleted file mode 100644 index 9f89688fd..000000000 Binary files a/graphics/pokemon/paras/front.png and /dev/null differ diff --git a/graphics/pokemon/paras/normal.pal b/graphics/pokemon/paras/normal.pal index fcf39cf9f..08c060f7a 100644 --- a/graphics/pokemon/paras/normal.pal +++ b/graphics/pokemon/paras/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -192 64 64 -96 56 64 -248 104 104 -200 176 32 -248 216 80 +189 65 65 +98 41 41 +246 106 106 +197 180 32 +255 213 82 16 16 16 112 72 24 -65 40 16 -232 128 40 -168 144 72 -176 96 32 -248 168 96 -88 88 88 -248 248 248 -200 200 200 +57 41 16 +230 131 41 +255 246 255 +180 98 32 +255 172 98 +90 90 90 +205 205 205 +164 164 205 diff --git a/graphics/pokemon/paras/shiny.pal b/graphics/pokemon/paras/shiny.pal index 0eda93cf3..d5b733479 100644 --- a/graphics/pokemon/paras/shiny.pal +++ b/graphics/pokemon/paras/shiny.pal @@ -11,7 +11,7 @@ JASC-PAL 104 40 16 56 32 8 224 96 48 -168 144 72 +255 246 255 176 48 40 240 144 96 88 88 88 diff --git a/graphics/pokemon/parasect/front.png b/graphics/pokemon/parasect/front.png deleted file mode 100644 index 5a841ffbc..000000000 Binary files a/graphics/pokemon/parasect/front.png and /dev/null differ diff --git a/graphics/pokemon/patrat/front.png b/graphics/pokemon/patrat/front.png deleted file mode 100644 index 3bc72d582..000000000 Binary files a/graphics/pokemon/patrat/front.png and /dev/null differ diff --git a/graphics/pokemon/pawniard/front.png b/graphics/pokemon/pawniard/front.png deleted file mode 100644 index 4d5434548..000000000 Binary files a/graphics/pokemon/pawniard/front.png and /dev/null differ diff --git a/graphics/pokemon/pelipper/front.png b/graphics/pokemon/pelipper/front.png deleted file mode 100644 index 145bb8e25..000000000 Binary files a/graphics/pokemon/pelipper/front.png and /dev/null differ diff --git a/graphics/pokemon/persian/back.png b/graphics/pokemon/persian/back.png index ad7a9d4a6..1ec5e9993 100644 Binary files a/graphics/pokemon/persian/back.png and b/graphics/pokemon/persian/back.png differ diff --git a/graphics/pokemon/persian/front.png b/graphics/pokemon/persian/front.png deleted file mode 100644 index 650de8dd7..000000000 Binary files a/graphics/pokemon/persian/front.png and /dev/null differ diff --git a/graphics/pokemon/petilil/front.png b/graphics/pokemon/petilil/front.png deleted file mode 100644 index 735abb0fc..000000000 Binary files a/graphics/pokemon/petilil/front.png and /dev/null differ diff --git a/graphics/pokemon/phanpy/back.png b/graphics/pokemon/phanpy/back.png index 65e0f1d51..a46f6d774 100644 Binary files a/graphics/pokemon/phanpy/back.png and b/graphics/pokemon/phanpy/back.png differ diff --git a/graphics/pokemon/phanpy/front.png b/graphics/pokemon/phanpy/front.png deleted file mode 100644 index 22ef30963..000000000 Binary files a/graphics/pokemon/phanpy/front.png and /dev/null differ diff --git a/graphics/pokemon/phantump/front.png b/graphics/pokemon/phantump/front.png deleted file mode 100644 index 2471e2301..000000000 Binary files a/graphics/pokemon/phantump/front.png and /dev/null differ diff --git a/graphics/pokemon/phione/front.png b/graphics/pokemon/phione/front.png deleted file mode 100644 index 10f7d01b5..000000000 Binary files a/graphics/pokemon/phione/front.png and /dev/null differ diff --git a/graphics/pokemon/pichu/front.png b/graphics/pokemon/pichu/front.png deleted file mode 100644 index f8974c37b..000000000 Binary files a/graphics/pokemon/pichu/front.png and /dev/null differ diff --git a/graphics/pokemon/pichu/spiky_eared/icon.png b/graphics/pokemon/pichu/spiky_eared/icon.png index 93107b1d3..3a407bc6c 100644 Binary files a/graphics/pokemon/pichu/spiky_eared/icon.png and b/graphics/pokemon/pichu/spiky_eared/icon.png differ diff --git a/graphics/pokemon/pidgeot/anim_front.png b/graphics/pokemon/pidgeot/anim_front.png index 2843c169a..e926c550c 100644 Binary files a/graphics/pokemon/pidgeot/anim_front.png and b/graphics/pokemon/pidgeot/anim_front.png differ diff --git a/graphics/pokemon/pidgeot/front.png b/graphics/pokemon/pidgeot/front.png deleted file mode 100644 index 9576ab1ad..000000000 Binary files a/graphics/pokemon/pidgeot/front.png and /dev/null differ diff --git a/graphics/pokemon/pidgeot/normal.pal b/graphics/pokemon/pidgeot/normal.pal index 7231eedde..c387bd5b8 100644 --- a/graphics/pokemon/pidgeot/normal.pal +++ b/graphics/pokemon/pidgeot/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -88 64 40 +90 57 41 16 16 16 -192 144 80 -152 96 56 -200 192 120 -248 240 176 +172 123 90 +115 82 74 +230 180 98 +255 230 139 248 240 120 248 152 112 -248 96 64 -120 32 32 -192 56 24 -192 176 192 -248 248 248 -248 176 192 -192 136 128 +238 98 65 +139 57 32 +213 49 24 +197 180 197 +255 255 255 +230 164 156 +189 123 123 diff --git a/graphics/pokemon/pidgeotto/anim_front.png b/graphics/pokemon/pidgeotto/anim_front.png index 9d28c7568..ddae428c4 100644 Binary files a/graphics/pokemon/pidgeotto/anim_front.png and b/graphics/pokemon/pidgeotto/anim_front.png differ diff --git a/graphics/pokemon/pidgeotto/back.png b/graphics/pokemon/pidgeotto/back.png index 8f5f1635a..bf79cc14a 100644 Binary files a/graphics/pokemon/pidgeotto/back.png and b/graphics/pokemon/pidgeotto/back.png differ diff --git a/graphics/pokemon/pidgeotto/front.png b/graphics/pokemon/pidgeotto/front.png deleted file mode 100644 index bc3d85388..000000000 Binary files a/graphics/pokemon/pidgeotto/front.png and /dev/null differ diff --git a/graphics/pokemon/pidgeotto/normal.pal b/graphics/pokemon/pidgeotto/normal.pal index a0ecd9339..6c8b9ef6f 100644 --- a/graphics/pokemon/pidgeotto/normal.pal +++ b/graphics/pokemon/pidgeotto/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 40 24 -184 56 32 -232 96 64 -16 16 16 +123 49 32 +197 49 41 +238 98 65 +32 32 32 144 64 72 -176 104 56 +131 82 49 248 248 248 -104 56 40 +65 41 32 120 120 128 -224 160 160 -192 112 120 -184 160 104 -216 208 144 -240 232 176 -208 144 36 +255 172 115 +213 213 222 +172 123 90 +230 189 90 +255 230 139 +172 123 90 diff --git a/graphics/pokemon/pidgey/anim_front.png b/graphics/pokemon/pidgey/anim_front.png index 351dd0a09..393024270 100644 Binary files a/graphics/pokemon/pidgey/anim_front.png and b/graphics/pokemon/pidgey/anim_front.png differ diff --git a/graphics/pokemon/pidgey/back.png b/graphics/pokemon/pidgey/back.png index 8d18f2a39..2097d2dee 100644 Binary files a/graphics/pokemon/pidgey/back.png and b/graphics/pokemon/pidgey/back.png differ diff --git a/graphics/pokemon/pidgey/front.png b/graphics/pokemon/pidgey/front.png deleted file mode 100644 index 985ca1286..000000000 Binary files a/graphics/pokemon/pidgey/front.png and /dev/null differ diff --git a/graphics/pokemon/pidgey/normal.pal b/graphics/pokemon/pidgey/normal.pal index 4488d161d..da639746d 100644 --- a/graphics/pokemon/pidgey/normal.pal +++ b/graphics/pokemon/pidgey/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 128 72 48 -216 152 40 -184 112 64 -120 104 48 -200 184 96 +205 131 90 +164 98 90 +164 98 90 +230 189 98 16 16 16 -240 232 152 +255 238 156 128 128 128 -128 56 64 +189 41 32 184 184 184 -224 160 160 +255 172 115 248 248 248 -192 112 120 -176 152 88 +238 98 65 +205 131 90 64 32 16 diff --git a/graphics/pokemon/pidove/front.png b/graphics/pokemon/pidove/front.png deleted file mode 100644 index 590619087..000000000 Binary files a/graphics/pokemon/pidove/front.png and /dev/null differ diff --git a/graphics/pokemon/pignite/front.png b/graphics/pokemon/pignite/front.png deleted file mode 100644 index 39c020d57..000000000 Binary files a/graphics/pokemon/pignite/front.png and /dev/null differ diff --git a/graphics/pokemon/pikachu/alola_cap/back.png b/graphics/pokemon/pikachu/alola_cap/back.png index eb78995e3..110eab45b 100644 Binary files a/graphics/pokemon/pikachu/alola_cap/back.png and b/graphics/pokemon/pikachu/alola_cap/back.png differ diff --git a/graphics/pokemon/pikachu/alola_cap/front.png b/graphics/pokemon/pikachu/alola_cap/front.png index 658157930..2de876f50 100644 Binary files a/graphics/pokemon/pikachu/alola_cap/front.png and b/graphics/pokemon/pikachu/alola_cap/front.png differ diff --git a/graphics/pokemon/pikachu/alola_cap/icon.png b/graphics/pokemon/pikachu/alola_cap/icon.png index 8ebbfd5a3..c2ad26a4b 100644 Binary files a/graphics/pokemon/pikachu/alola_cap/icon.png and b/graphics/pokemon/pikachu/alola_cap/icon.png differ diff --git a/graphics/pokemon/pikachu/anim_front.png b/graphics/pokemon/pikachu/anim_front.png index 494c29e17..6deb20d71 100644 Binary files a/graphics/pokemon/pikachu/anim_front.png and b/graphics/pokemon/pikachu/anim_front.png differ diff --git a/graphics/pokemon/pikachu/belle/back.png b/graphics/pokemon/pikachu/belle/back.png index d90d9ba3b..b9b187565 100644 Binary files a/graphics/pokemon/pikachu/belle/back.png and b/graphics/pokemon/pikachu/belle/back.png differ diff --git a/graphics/pokemon/pikachu/belle/front.png b/graphics/pokemon/pikachu/belle/front.png index 7f521f287..27e11f42e 100644 Binary files a/graphics/pokemon/pikachu/belle/front.png and b/graphics/pokemon/pikachu/belle/front.png differ diff --git a/graphics/pokemon/pikachu/belle/icon.png b/graphics/pokemon/pikachu/belle/icon.png index 2263ec539..c3374c4bb 100644 Binary files a/graphics/pokemon/pikachu/belle/icon.png and b/graphics/pokemon/pikachu/belle/icon.png differ diff --git a/graphics/pokemon/pikachu/cosplay/back.png b/graphics/pokemon/pikachu/cosplay/back.png index d01bdd1f0..524417f1c 100644 Binary files a/graphics/pokemon/pikachu/cosplay/back.png and b/graphics/pokemon/pikachu/cosplay/back.png differ diff --git a/graphics/pokemon/pikachu/cosplay/front.png b/graphics/pokemon/pikachu/cosplay/front.png index a59ab675a..bcbe13ee8 100644 Binary files a/graphics/pokemon/pikachu/cosplay/front.png and b/graphics/pokemon/pikachu/cosplay/front.png differ diff --git a/graphics/pokemon/pikachu/cosplay/icon.png b/graphics/pokemon/pikachu/cosplay/icon.png index ec128341e..38d9443a4 100644 Binary files a/graphics/pokemon/pikachu/cosplay/icon.png and b/graphics/pokemon/pikachu/cosplay/icon.png differ diff --git a/graphics/pokemon/pikachu/front.png b/graphics/pokemon/pikachu/front.png deleted file mode 100644 index 9b1b6b0a0..000000000 Binary files a/graphics/pokemon/pikachu/front.png and /dev/null differ diff --git a/graphics/pokemon/pikachu/hoenn_cap/back.png b/graphics/pokemon/pikachu/hoenn_cap/back.png index a00abae92..a257b1e99 100644 Binary files a/graphics/pokemon/pikachu/hoenn_cap/back.png and b/graphics/pokemon/pikachu/hoenn_cap/back.png differ diff --git a/graphics/pokemon/pikachu/hoenn_cap/front.png b/graphics/pokemon/pikachu/hoenn_cap/front.png index 19bbcdfe6..2c9749ee2 100644 Binary files a/graphics/pokemon/pikachu/hoenn_cap/front.png and b/graphics/pokemon/pikachu/hoenn_cap/front.png differ diff --git a/graphics/pokemon/pikachu/hoenn_cap/icon.png b/graphics/pokemon/pikachu/hoenn_cap/icon.png index 63ebc8d5a..c9f88f5e3 100644 Binary files a/graphics/pokemon/pikachu/hoenn_cap/icon.png and b/graphics/pokemon/pikachu/hoenn_cap/icon.png differ diff --git a/graphics/pokemon/pikachu/kalos_cap/back.png b/graphics/pokemon/pikachu/kalos_cap/back.png index 3623d801d..c0a4b7526 100644 Binary files a/graphics/pokemon/pikachu/kalos_cap/back.png and b/graphics/pokemon/pikachu/kalos_cap/back.png differ diff --git a/graphics/pokemon/pikachu/kalos_cap/front.png b/graphics/pokemon/pikachu/kalos_cap/front.png index e03175dc4..b8d995d87 100644 Binary files a/graphics/pokemon/pikachu/kalos_cap/front.png and b/graphics/pokemon/pikachu/kalos_cap/front.png differ diff --git a/graphics/pokemon/pikachu/kalos_cap/icon.png b/graphics/pokemon/pikachu/kalos_cap/icon.png index 1d224061e..0e93d93b7 100644 Binary files a/graphics/pokemon/pikachu/kalos_cap/icon.png and b/graphics/pokemon/pikachu/kalos_cap/icon.png differ diff --git a/graphics/pokemon/pikachu/libre/back.png b/graphics/pokemon/pikachu/libre/back.png index db535bbda..f92d401f7 100644 Binary files a/graphics/pokemon/pikachu/libre/back.png and b/graphics/pokemon/pikachu/libre/back.png differ diff --git a/graphics/pokemon/pikachu/libre/front.png b/graphics/pokemon/pikachu/libre/front.png index b83d135ac..234ad40f9 100644 Binary files a/graphics/pokemon/pikachu/libre/front.png and b/graphics/pokemon/pikachu/libre/front.png differ diff --git a/graphics/pokemon/pikachu/libre/icon.png b/graphics/pokemon/pikachu/libre/icon.png index f7908eab3..38ce2cc69 100644 Binary files a/graphics/pokemon/pikachu/libre/icon.png and b/graphics/pokemon/pikachu/libre/icon.png differ diff --git a/graphics/pokemon/pikachu/normal.pal b/graphics/pokemon/pikachu/normal.pal index 3d734a17d..8f402fd44 100644 --- a/graphics/pokemon/pikachu/normal.pal +++ b/graphics/pokemon/pikachu/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -16 16 16 -40 40 40 -88 56 32 -80 80 80 -248 192 32 -152 80 0 -248 232 80 -224 144 0 -248 248 168 -248 248 248 -232 88 64 -200 32 24 +0 0 0 +41 41 41 +99 49 8 +82 82 90 +247 189 33 +156 82 0 +247 230 82 +222 148 0 +255 247 165 +255 255 255 +230 90 66 +197 33 25 168 48 16 224 80 56 0 0 0 diff --git a/graphics/pokemon/pikachu/original_cap/back.png b/graphics/pokemon/pikachu/original_cap/back.png index c60155b42..4f5d09e27 100644 Binary files a/graphics/pokemon/pikachu/original_cap/back.png and b/graphics/pokemon/pikachu/original_cap/back.png differ diff --git a/graphics/pokemon/pikachu/original_cap/front.png b/graphics/pokemon/pikachu/original_cap/front.png index 1d265d0c9..bb8d5931e 100644 Binary files a/graphics/pokemon/pikachu/original_cap/front.png and b/graphics/pokemon/pikachu/original_cap/front.png differ diff --git a/graphics/pokemon/pikachu/original_cap/icon.png b/graphics/pokemon/pikachu/original_cap/icon.png index 68179437b..6a356991e 100644 Binary files a/graphics/pokemon/pikachu/original_cap/icon.png and b/graphics/pokemon/pikachu/original_cap/icon.png differ diff --git a/graphics/pokemon/pikachu/partner_cap/icon.png b/graphics/pokemon/pikachu/partner_cap/icon.png index eff6d7dcd..78630c664 100644 Binary files a/graphics/pokemon/pikachu/partner_cap/icon.png and b/graphics/pokemon/pikachu/partner_cap/icon.png differ diff --git a/graphics/pokemon/pikachu/ph_d/back.png b/graphics/pokemon/pikachu/ph_d/back.png index 568fbf91e..83ee2a559 100644 Binary files a/graphics/pokemon/pikachu/ph_d/back.png and b/graphics/pokemon/pikachu/ph_d/back.png differ diff --git a/graphics/pokemon/pikachu/ph_d/front.png b/graphics/pokemon/pikachu/ph_d/front.png index 002237607..75034ed9d 100644 Binary files a/graphics/pokemon/pikachu/ph_d/front.png and b/graphics/pokemon/pikachu/ph_d/front.png differ diff --git a/graphics/pokemon/pikachu/ph_d/icon.png b/graphics/pokemon/pikachu/ph_d/icon.png index b6bff4216..50357beb5 100644 Binary files a/graphics/pokemon/pikachu/ph_d/icon.png and b/graphics/pokemon/pikachu/ph_d/icon.png differ diff --git a/graphics/pokemon/pikachu/pop_star/back.png b/graphics/pokemon/pikachu/pop_star/back.png index 8cfc7abe8..6840627cd 100644 Binary files a/graphics/pokemon/pikachu/pop_star/back.png and b/graphics/pokemon/pikachu/pop_star/back.png differ diff --git a/graphics/pokemon/pikachu/pop_star/front.png b/graphics/pokemon/pikachu/pop_star/front.png index 550cb7ab6..e092dfa5c 100644 Binary files a/graphics/pokemon/pikachu/pop_star/front.png and b/graphics/pokemon/pikachu/pop_star/front.png differ diff --git a/graphics/pokemon/pikachu/pop_star/icon.png b/graphics/pokemon/pikachu/pop_star/icon.png index 04a399165..c22ef85a4 100644 Binary files a/graphics/pokemon/pikachu/pop_star/icon.png and b/graphics/pokemon/pikachu/pop_star/icon.png differ diff --git a/graphics/pokemon/pikachu/rock_star/back.png b/graphics/pokemon/pikachu/rock_star/back.png index 982fd0ba3..fd86f4d59 100644 Binary files a/graphics/pokemon/pikachu/rock_star/back.png and b/graphics/pokemon/pikachu/rock_star/back.png differ diff --git a/graphics/pokemon/pikachu/rock_star/front.png b/graphics/pokemon/pikachu/rock_star/front.png index d8498a981..17a102c0b 100644 Binary files a/graphics/pokemon/pikachu/rock_star/front.png and b/graphics/pokemon/pikachu/rock_star/front.png differ diff --git a/graphics/pokemon/pikachu/rock_star/icon.png b/graphics/pokemon/pikachu/rock_star/icon.png index 46f106e44..96a732790 100644 Binary files a/graphics/pokemon/pikachu/rock_star/icon.png and b/graphics/pokemon/pikachu/rock_star/icon.png differ diff --git a/graphics/pokemon/pikachu/sinnoh_cap/back.png b/graphics/pokemon/pikachu/sinnoh_cap/back.png index f23a19428..24d429bc4 100644 Binary files a/graphics/pokemon/pikachu/sinnoh_cap/back.png and b/graphics/pokemon/pikachu/sinnoh_cap/back.png differ diff --git a/graphics/pokemon/pikachu/sinnoh_cap/front.png b/graphics/pokemon/pikachu/sinnoh_cap/front.png index dc2712fdf..91d91acc2 100644 Binary files a/graphics/pokemon/pikachu/sinnoh_cap/front.png and b/graphics/pokemon/pikachu/sinnoh_cap/front.png differ diff --git a/graphics/pokemon/pikachu/sinnoh_cap/icon.png b/graphics/pokemon/pikachu/sinnoh_cap/icon.png index e53e37cd4..a127ebcb3 100644 Binary files a/graphics/pokemon/pikachu/sinnoh_cap/icon.png and b/graphics/pokemon/pikachu/sinnoh_cap/icon.png differ diff --git a/graphics/pokemon/pikachu/unova_cap/back.png b/graphics/pokemon/pikachu/unova_cap/back.png index d7947b57b..2191a0f4c 100644 Binary files a/graphics/pokemon/pikachu/unova_cap/back.png and b/graphics/pokemon/pikachu/unova_cap/back.png differ diff --git a/graphics/pokemon/pikachu/unova_cap/front.png b/graphics/pokemon/pikachu/unova_cap/front.png index 6647c4686..fbc8a3a61 100644 Binary files a/graphics/pokemon/pikachu/unova_cap/front.png and b/graphics/pokemon/pikachu/unova_cap/front.png differ diff --git a/graphics/pokemon/pikachu/unova_cap/icon.png b/graphics/pokemon/pikachu/unova_cap/icon.png index 6d4480928..1dbc18cfa 100644 Binary files a/graphics/pokemon/pikachu/unova_cap/icon.png and b/graphics/pokemon/pikachu/unova_cap/icon.png differ diff --git a/graphics/pokemon/piloswine/front.png b/graphics/pokemon/piloswine/front.png deleted file mode 100644 index 1969f28ae..000000000 Binary files a/graphics/pokemon/piloswine/front.png and /dev/null differ diff --git a/graphics/pokemon/pineco/front.png b/graphics/pokemon/pineco/front.png deleted file mode 100644 index eec63a8ec..000000000 Binary files a/graphics/pokemon/pineco/front.png and /dev/null differ diff --git a/graphics/pokemon/pinsir/anim_front.png b/graphics/pokemon/pinsir/anim_front.png index 00a5050da..9dd53e423 100644 Binary files a/graphics/pokemon/pinsir/anim_front.png and b/graphics/pokemon/pinsir/anim_front.png differ diff --git a/graphics/pokemon/pinsir/front.png b/graphics/pokemon/pinsir/front.png deleted file mode 100644 index b0543cab8..000000000 Binary files a/graphics/pokemon/pinsir/front.png and /dev/null differ diff --git a/graphics/pokemon/pinsir/normal.pal b/graphics/pokemon/pinsir/normal.pal index 118638fc1..9e89703bd 100644 --- a/graphics/pokemon/pinsir/normal.pal +++ b/graphics/pokemon/pinsir/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -72 64 56 -128 112 96 -216 216 216 -176 160 144 -184 176 184 +74 65 57 +131 115 98 +238 230 205 +180 164 148 +213 197 180 248 248 248 0 0 0 -120 96 88 -168 152 136 -200 184 176 -80 56 48 -152 136 112 +131 106 82 +197 172 139 +230 213 180 +90 65 49 +164 139 106 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/piplup/front.png b/graphics/pokemon/piplup/front.png deleted file mode 100644 index c2ce15cdc..000000000 Binary files a/graphics/pokemon/piplup/front.png and /dev/null differ diff --git a/graphics/pokemon/plusle/front.png b/graphics/pokemon/plusle/front.png deleted file mode 100644 index 87b761219..000000000 Binary files a/graphics/pokemon/plusle/front.png and /dev/null differ diff --git a/graphics/pokemon/politoed/front.png b/graphics/pokemon/politoed/front.png deleted file mode 100644 index 74d705c10..000000000 Binary files a/graphics/pokemon/politoed/front.png and /dev/null differ diff --git a/graphics/pokemon/poliwag/anim_front.png b/graphics/pokemon/poliwag/anim_front.png index ab30eaa66..53a5e3754 100644 Binary files a/graphics/pokemon/poliwag/anim_front.png and b/graphics/pokemon/poliwag/anim_front.png differ diff --git a/graphics/pokemon/poliwag/front.png b/graphics/pokemon/poliwag/front.png deleted file mode 100644 index 6ca996b39..000000000 Binary files a/graphics/pokemon/poliwag/front.png and /dev/null differ diff --git a/graphics/pokemon/poliwag/normal.pal b/graphics/pokemon/poliwag/normal.pal index ce4fa2191..09bad1cd3 100644 --- a/graphics/pokemon/poliwag/normal.pal +++ b/graphics/pokemon/poliwag/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -24 56 112 -136 160 224 -80 128 192 -56 88 128 -248 248 248 +24 57 115 +139 164 230 +82 131 197 +57 90 131 +255 255 255 16 16 16 -96 96 112 -192 192 208 -248 208 240 -248 176 224 -216 120 184 -232 232 248 -56 112 168 +98 98 98 +180 172 189 +255 189 172 +255 106 106 +189 90 74 +205 205 205 +57 115 172 0 0 0 0 0 0 diff --git a/graphics/pokemon/poliwhirl/anim_front.png b/graphics/pokemon/poliwhirl/anim_front.png index 1f3d22d94..87cb52b3a 100644 Binary files a/graphics/pokemon/poliwhirl/anim_front.png and b/graphics/pokemon/poliwhirl/anim_front.png differ diff --git a/graphics/pokemon/poliwhirl/front.png b/graphics/pokemon/poliwhirl/front.png deleted file mode 100644 index f61d52be2..000000000 Binary files a/graphics/pokemon/poliwhirl/front.png and /dev/null differ diff --git a/graphics/pokemon/poliwhirl/normal.pal b/graphics/pokemon/poliwhirl/normal.pal index 94840ecf3..ac25d75a6 100644 --- a/graphics/pokemon/poliwhirl/normal.pal +++ b/graphics/pokemon/poliwhirl/normal.pal @@ -2,11 +2,11 @@ JASC-PAL 0100 16 152 208 160 -24 56 112 -56 88 128 -80 128 192 +32 57 98 +82 90 131 +115 131 197 248 248 248 -56 112 168 +115 131 197 80 80 80 184 184 192 15 15 15 @@ -14,6 +14,6 @@ JASC-PAL 120 120 120 136 152 160 240 240 248 -208 208 216 +213 213 222 0 0 0 0 0 0 diff --git a/graphics/pokemon/poliwrath/anim_front.png b/graphics/pokemon/poliwrath/anim_front.png index 2e320c589..3e63a0c1a 100644 Binary files a/graphics/pokemon/poliwrath/anim_front.png and b/graphics/pokemon/poliwrath/anim_front.png differ diff --git a/graphics/pokemon/poliwrath/front.png b/graphics/pokemon/poliwrath/front.png deleted file mode 100644 index 98b4814b6..000000000 Binary files a/graphics/pokemon/poliwrath/front.png and /dev/null differ diff --git a/graphics/pokemon/poliwrath/normal.pal b/graphics/pokemon/poliwrath/normal.pal index f3ae4d584..e1f44100a 100644 --- a/graphics/pokemon/poliwrath/normal.pal +++ b/graphics/pokemon/poliwrath/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -56 88 128 -136 160 224 -24 56 112 -80 128 192 +82 90 131 +180 189 230 +32 57 90 +115 131 197 16 16 16 -248 248 248 -200 200 216 -176 176 192 -72 80 80 -120 120 128 +255 255 255 +213 213 222 +189 189 189 +82 82 82 +123 123 123 232 232 248 -144 160 168 +164 164 164 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/ponyta/front.png b/graphics/pokemon/ponyta/front.png deleted file mode 100644 index 5e60ecaec..000000000 Binary files a/graphics/pokemon/ponyta/front.png and /dev/null differ diff --git a/graphics/pokemon/poochyena/front.png b/graphics/pokemon/poochyena/front.png deleted file mode 100644 index 03cc345b0..000000000 Binary files a/graphics/pokemon/poochyena/front.png and /dev/null differ diff --git a/graphics/pokemon/porygon/front.png b/graphics/pokemon/porygon/front.png deleted file mode 100644 index 52d47ce11..000000000 Binary files a/graphics/pokemon/porygon/front.png and /dev/null differ diff --git a/graphics/pokemon/porygon2/front.png b/graphics/pokemon/porygon2/front.png deleted file mode 100644 index 84f153fc7..000000000 Binary files a/graphics/pokemon/porygon2/front.png and /dev/null differ diff --git a/graphics/pokemon/porygon_z/front.png b/graphics/pokemon/porygon_z/front.png deleted file mode 100644 index 1f39bffa5..000000000 Binary files a/graphics/pokemon/porygon_z/front.png and /dev/null differ diff --git a/graphics/pokemon/primeape/anim_front.png b/graphics/pokemon/primeape/anim_front.png index e07e1e7d7..dbb5d7f0d 100644 Binary files a/graphics/pokemon/primeape/anim_front.png and b/graphics/pokemon/primeape/anim_front.png differ diff --git a/graphics/pokemon/primeape/front.png b/graphics/pokemon/primeape/front.png deleted file mode 100644 index c764645ef..000000000 Binary files a/graphics/pokemon/primeape/front.png and /dev/null differ diff --git a/graphics/pokemon/primeape/normal.pal b/graphics/pokemon/primeape/normal.pal index 9e19a46d7..015a68508 100644 --- a/graphics/pokemon/primeape/normal.pal +++ b/graphics/pokemon/primeape/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -88 48 0 -152 104 104 -200 136 88 +90 49 0 +156 106 106 +205 139 90 0 0 0 -96 72 32 -248 224 176 -64 64 64 -224 184 152 -120 120 120 -248 248 208 -248 144 88 +98 74 32 +255 230 180 +65 65 65 +230 189 156 +123 123 123 +255 255 213 +255 148 90 248 248 248 -224 120 120 -248 168 168 +189 74 49 +255 148 90 224 176 136 diff --git a/graphics/pokemon/prinplup/front.png b/graphics/pokemon/prinplup/front.png deleted file mode 100644 index a4b84554d..000000000 Binary files a/graphics/pokemon/prinplup/front.png and /dev/null differ diff --git a/graphics/pokemon/probopass/front.png b/graphics/pokemon/probopass/front.png deleted file mode 100644 index 21916b376..000000000 Binary files a/graphics/pokemon/probopass/front.png and /dev/null differ diff --git a/graphics/pokemon/psyduck/anim_front.png b/graphics/pokemon/psyduck/anim_front.png index 4129b5ea9..0b89ba374 100644 Binary files a/graphics/pokemon/psyduck/anim_front.png and b/graphics/pokemon/psyduck/anim_front.png differ diff --git a/graphics/pokemon/psyduck/front.png b/graphics/pokemon/psyduck/front.png deleted file mode 100644 index 138c13a95..000000000 Binary files a/graphics/pokemon/psyduck/front.png and /dev/null differ diff --git a/graphics/pokemon/psyduck/normal.pal b/graphics/pokemon/psyduck/normal.pal index 78d95442f..7e2179a0b 100644 --- a/graphics/pokemon/psyduck/normal.pal +++ b/graphics/pokemon/psyduck/normal.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 152 208 160 -120 120 120 +123 123 123 16 16 16 -144 88 16 -224 160 80 -248 208 72 -248 224 160 -216 176 80 -248 248 248 -128 88 0 -248 232 184 -240 216 136 +148 90 16 +230 164 82 +255 213 74 +255 230 164 +222 180 82 +255 255 255 +131 90 0 +255 238 189 +246 222 139 248 232 184 0 0 0 0 0 0 diff --git a/graphics/pokemon/pumpkaboo/back.png b/graphics/pokemon/pumpkaboo/back.png index 586016235..9744f3966 100644 Binary files a/graphics/pokemon/pumpkaboo/back.png and b/graphics/pokemon/pumpkaboo/back.png differ diff --git a/graphics/pokemon/pumpkaboo/front.png b/graphics/pokemon/pumpkaboo/front.png deleted file mode 100644 index d55ed24ab..000000000 Binary files a/graphics/pokemon/pumpkaboo/front.png and /dev/null differ diff --git a/graphics/pokemon/pumpkaboo/large/back.png b/graphics/pokemon/pumpkaboo/large/back.png index 571144ecf..e5deba0d7 100644 Binary files a/graphics/pokemon/pumpkaboo/large/back.png and b/graphics/pokemon/pumpkaboo/large/back.png differ diff --git a/graphics/pokemon/pumpkaboo/large/front.png b/graphics/pokemon/pumpkaboo/large/front.png deleted file mode 100644 index d3df6bca4..000000000 Binary files a/graphics/pokemon/pumpkaboo/large/front.png and /dev/null differ diff --git a/graphics/pokemon/pumpkaboo/small/back.png b/graphics/pokemon/pumpkaboo/small/back.png index 23283b1b3..5d7c21e34 100644 Binary files a/graphics/pokemon/pumpkaboo/small/back.png and b/graphics/pokemon/pumpkaboo/small/back.png differ diff --git a/graphics/pokemon/pumpkaboo/small/front.png b/graphics/pokemon/pumpkaboo/small/front.png deleted file mode 100644 index 8f22eea38..000000000 Binary files a/graphics/pokemon/pumpkaboo/small/front.png and /dev/null differ diff --git a/graphics/pokemon/pumpkaboo/super/back.png b/graphics/pokemon/pumpkaboo/super/back.png index f14291657..85cc83e2c 100644 Binary files a/graphics/pokemon/pumpkaboo/super/back.png and b/graphics/pokemon/pumpkaboo/super/back.png differ diff --git a/graphics/pokemon/pumpkaboo/super/front.png b/graphics/pokemon/pumpkaboo/super/front.png deleted file mode 100644 index 3a5d1c1d2..000000000 Binary files a/graphics/pokemon/pumpkaboo/super/front.png and /dev/null differ diff --git a/graphics/pokemon/pupitar/front.png b/graphics/pokemon/pupitar/front.png deleted file mode 100644 index cc7fda715..000000000 Binary files a/graphics/pokemon/pupitar/front.png and /dev/null differ diff --git a/graphics/pokemon/purrloin/front.png b/graphics/pokemon/purrloin/front.png deleted file mode 100644 index 0d329d15c..000000000 Binary files a/graphics/pokemon/purrloin/front.png and /dev/null differ diff --git a/graphics/pokemon/purugly/front.png b/graphics/pokemon/purugly/front.png deleted file mode 100644 index 4d8a5da49..000000000 Binary files a/graphics/pokemon/purugly/front.png and /dev/null differ diff --git a/graphics/pokemon/pyroar/front.png b/graphics/pokemon/pyroar/front.png deleted file mode 100644 index a7e266167..000000000 Binary files a/graphics/pokemon/pyroar/front.png and /dev/null differ diff --git a/graphics/pokemon/pyroar/icon.png b/graphics/pokemon/pyroar/icon.png index cd0b94401..e00595a15 100644 Binary files a/graphics/pokemon/pyroar/icon.png and b/graphics/pokemon/pyroar/icon.png differ diff --git a/graphics/pokemon/quagsire/front.png b/graphics/pokemon/quagsire/front.png deleted file mode 100644 index 41b4ad26b..000000000 Binary files a/graphics/pokemon/quagsire/front.png and /dev/null differ diff --git a/graphics/pokemon/question_mark/circled/front.png b/graphics/pokemon/question_mark/circled/front.png deleted file mode 100644 index 3056402db..000000000 Binary files a/graphics/pokemon/question_mark/circled/front.png and /dev/null differ diff --git a/graphics/pokemon/question_mark/double/front.png b/graphics/pokemon/question_mark/double/front.png deleted file mode 100644 index f23b08476..000000000 Binary files a/graphics/pokemon/question_mark/double/front.png and /dev/null differ diff --git a/graphics/pokemon/quilava/anim_front.png b/graphics/pokemon/quilava/anim_front.png index 1c2709eb4..e65df1688 100644 Binary files a/graphics/pokemon/quilava/anim_front.png and b/graphics/pokemon/quilava/anim_front.png differ diff --git a/graphics/pokemon/quilava/back.png b/graphics/pokemon/quilava/back.png index e6911c2b8..282cfea20 100644 Binary files a/graphics/pokemon/quilava/back.png and b/graphics/pokemon/quilava/back.png differ diff --git a/graphics/pokemon/quilava/front.png b/graphics/pokemon/quilava/front.png deleted file mode 100644 index 061f31998..000000000 Binary files a/graphics/pokemon/quilava/front.png and /dev/null differ diff --git a/graphics/pokemon/quilava/normal.pal b/graphics/pokemon/quilava/normal.pal index c6f175d1e..c59061cc8 100644 --- a/graphics/pokemon/quilava/normal.pal +++ b/graphics/pokemon/quilava/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -216 0 0 -248 88 0 -248 208 0 -248 152 0 -40 104 104 -40 64 96 -56 136 144 +222 0 0 +255 90 0 +255 213 0 +255 156 0 +24 98 131 +49 65 106 +65 156 172 16 16 16 168 0 0 248 248 248 -176 152 80 -248 232 160 -224 200 104 -136 96 32 +180 156 82 +255 238 164 +230 205 106 +139 98 32 16 48 56 diff --git a/graphics/pokemon/quilladin/front.png b/graphics/pokemon/quilladin/front.png deleted file mode 100644 index 4a6264fa4..000000000 Binary files a/graphics/pokemon/quilladin/front.png and /dev/null differ diff --git a/graphics/pokemon/qwilfish/front.png b/graphics/pokemon/qwilfish/front.png deleted file mode 100644 index 6fd19c134..000000000 Binary files a/graphics/pokemon/qwilfish/front.png and /dev/null differ diff --git a/graphics/pokemon/raichu/anim_front.png b/graphics/pokemon/raichu/anim_front.png index 57ee98c40..792c3ffa6 100644 Binary files a/graphics/pokemon/raichu/anim_front.png and b/graphics/pokemon/raichu/anim_front.png differ diff --git a/graphics/pokemon/raichu/front.png b/graphics/pokemon/raichu/front.png deleted file mode 100644 index e1050a3d4..000000000 Binary files a/graphics/pokemon/raichu/front.png and /dev/null differ diff --git a/graphics/pokemon/raichu/normal.pal b/graphics/pokemon/raichu/normal.pal index 2b912d23c..6594ba18b 100644 --- a/graphics/pokemon/raichu/normal.pal +++ b/graphics/pokemon/raichu/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -88 40 40 -136 96 16 -16 16 16 -112 64 48 -248 184 0 -96 64 32 -248 216 88 -240 168 40 -224 120 48 -248 232 208 -192 88 48 -168 24 8 -224 184 128 -96 96 104 -56 56 64 +90 41 41 +139 98 16 +0 0 0 +115 65 49 +255 189 0 +148 65 65 +255 222 90 +246 172 41 +222 123 49 +255 238 213 +189 90 49 +189 24 8 +255 213 90 +98 98 106 +57 57 65 diff --git a/graphics/pokemon/raikou/front.png b/graphics/pokemon/raikou/front.png deleted file mode 100644 index b729a2c37..000000000 Binary files a/graphics/pokemon/raikou/front.png and /dev/null differ diff --git a/graphics/pokemon/ralts/front.png b/graphics/pokemon/ralts/front.png deleted file mode 100644 index 6831c3897..000000000 Binary files a/graphics/pokemon/ralts/front.png and /dev/null differ diff --git a/graphics/pokemon/rampardos/front.png b/graphics/pokemon/rampardos/front.png deleted file mode 100644 index 09fa06dfb..000000000 Binary files a/graphics/pokemon/rampardos/front.png and /dev/null differ diff --git a/graphics/pokemon/rapidash/front.png b/graphics/pokemon/rapidash/front.png deleted file mode 100644 index d0fb296f5..000000000 Binary files a/graphics/pokemon/rapidash/front.png and /dev/null differ diff --git a/graphics/pokemon/raticate/anim_front.png b/graphics/pokemon/raticate/anim_front.png index d612bbad9..c6d38b5c2 100644 Binary files a/graphics/pokemon/raticate/anim_front.png and b/graphics/pokemon/raticate/anim_front.png differ diff --git a/graphics/pokemon/raticate/front.png b/graphics/pokemon/raticate/front.png deleted file mode 100644 index 8e9f34722..000000000 Binary files a/graphics/pokemon/raticate/front.png and /dev/null differ diff --git a/graphics/pokemon/raticate/normal.pal b/graphics/pokemon/raticate/normal.pal index 88e7b2244..b02c703c2 100644 --- a/graphics/pokemon/raticate/normal.pal +++ b/graphics/pokemon/raticate/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -144 76 8 -192 128 80 -248 200 152 +148 82 16 +197 131 82 +255 205 156 16 16 16 -104 56 0 -208 160 64 -176 120 64 -224 184 80 -184 192 200 -248 248 248 -128 88 40 -240 224 144 -208 192 104 -112 112 112 -160 128 48 +106 57 0 +197 148 57 +164 115 41 +222 180 74 +180 180 180 +255 255 255 +131 90 41 +246 246 164 +238 205 115 +115 115 115 +164 131 49 diff --git a/graphics/pokemon/rattata/anim_front.png b/graphics/pokemon/rattata/anim_front.png index 08f52ed89..47d2ebff1 100644 Binary files a/graphics/pokemon/rattata/anim_front.png and b/graphics/pokemon/rattata/anim_front.png differ diff --git a/graphics/pokemon/rattata/front.png b/graphics/pokemon/rattata/front.png deleted file mode 100644 index 957a686e1..000000000 Binary files a/graphics/pokemon/rattata/front.png and /dev/null differ diff --git a/graphics/pokemon/rattata/normal.pal b/graphics/pokemon/rattata/normal.pal index 87fc380cb..8c69af29f 100644 --- a/graphics/pokemon/rattata/normal.pal +++ b/graphics/pokemon/rattata/normal.pal @@ -12,8 +12,8 @@ JASC-PAL 205 205 205 164 115 8 230 90 115 -248 248 248 +255 255 255 164 24 57 98 74 8 -88 88 88 -120 80 136 +90 90 90 +0 0 0 diff --git a/graphics/pokemon/rayquaza/front.png b/graphics/pokemon/rayquaza/front.png deleted file mode 100644 index 57123a773..000000000 Binary files a/graphics/pokemon/rayquaza/front.png and /dev/null differ diff --git a/graphics/pokemon/regice/front.png b/graphics/pokemon/regice/front.png deleted file mode 100644 index e369c6344..000000000 Binary files a/graphics/pokemon/regice/front.png and /dev/null differ diff --git a/graphics/pokemon/regigigas/front.png b/graphics/pokemon/regigigas/front.png deleted file mode 100644 index 7cb87a1cc..000000000 Binary files a/graphics/pokemon/regigigas/front.png and /dev/null differ diff --git a/graphics/pokemon/regirock/front.png b/graphics/pokemon/regirock/front.png deleted file mode 100644 index 4ba1f41d8..000000000 Binary files a/graphics/pokemon/regirock/front.png and /dev/null differ diff --git a/graphics/pokemon/registeel/front.png b/graphics/pokemon/registeel/front.png deleted file mode 100644 index 844ab20c0..000000000 Binary files a/graphics/pokemon/registeel/front.png and /dev/null differ diff --git a/graphics/pokemon/relicanth/back.png b/graphics/pokemon/relicanth/back.png index cf4886a6b..678602343 100644 Binary files a/graphics/pokemon/relicanth/back.png and b/graphics/pokemon/relicanth/back.png differ diff --git a/graphics/pokemon/relicanth/front.png b/graphics/pokemon/relicanth/front.png deleted file mode 100644 index 552b2421d..000000000 Binary files a/graphics/pokemon/relicanth/front.png and /dev/null differ diff --git a/graphics/pokemon/remoraid/front.png b/graphics/pokemon/remoraid/front.png deleted file mode 100644 index 8cf4b8664..000000000 Binary files a/graphics/pokemon/remoraid/front.png and /dev/null differ diff --git a/graphics/pokemon/reshiram/back.png b/graphics/pokemon/reshiram/back.png index d62cdbdb5..2738d144e 100644 Binary files a/graphics/pokemon/reshiram/back.png and b/graphics/pokemon/reshiram/back.png differ diff --git a/graphics/pokemon/reshiram/front.png b/graphics/pokemon/reshiram/front.png deleted file mode 100644 index 22d7be6e5..000000000 Binary files a/graphics/pokemon/reshiram/front.png and /dev/null differ diff --git a/graphics/pokemon/reuniclus/front.png b/graphics/pokemon/reuniclus/front.png deleted file mode 100644 index d189c0bf4..000000000 Binary files a/graphics/pokemon/reuniclus/front.png and /dev/null differ diff --git a/graphics/pokemon/rhydon/anim_front.png b/graphics/pokemon/rhydon/anim_front.png index d93763b8d..bd8e5391e 100644 Binary files a/graphics/pokemon/rhydon/anim_front.png and b/graphics/pokemon/rhydon/anim_front.png differ diff --git a/graphics/pokemon/rhydon/front.png b/graphics/pokemon/rhydon/front.png deleted file mode 100644 index fbae08b97..000000000 Binary files a/graphics/pokemon/rhydon/front.png and /dev/null differ diff --git a/graphics/pokemon/rhydon/normal.pal b/graphics/pokemon/rhydon/normal.pal index 235d7f7dc..2658775bc 100644 --- a/graphics/pokemon/rhydon/normal.pal +++ b/graphics/pokemon/rhydon/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -104 112 136 -56 64 80 -152 168 192 +139 139 148 +82 82 90 +197 197 189 16 16 16 -184 200 216 +230 230 222 248 248 248 224 224 216 -112 88 48 -224 208 168 -176 160 112 -128 48 40 -184 88 80 +115 90 49 +255 238 197 +180 164 115 +164 49 16 +230 82 57 160 48 16 -224 80 56 -96 64 104 +230 82 57 +115 32 16 diff --git a/graphics/pokemon/rhyhorn/anim_front.png b/graphics/pokemon/rhyhorn/anim_front.png index 67f81580e..99cdb4107 100644 Binary files a/graphics/pokemon/rhyhorn/anim_front.png and b/graphics/pokemon/rhyhorn/anim_front.png differ diff --git a/graphics/pokemon/rhyhorn/front.png b/graphics/pokemon/rhyhorn/front.png deleted file mode 100644 index 0dbb06a1a..000000000 Binary files a/graphics/pokemon/rhyhorn/front.png and /dev/null differ diff --git a/graphics/pokemon/rhyhorn/normal.pal b/graphics/pokemon/rhyhorn/normal.pal index afba6e501..19493646a 100644 --- a/graphics/pokemon/rhyhorn/normal.pal +++ b/graphics/pokemon/rhyhorn/normal.pal @@ -2,14 +2,14 @@ JASC-PAL 0100 16 152 208 160 -120 136 152 -80 88 112 -192 208 216 -48 48 64 +139 148 156 +98 98 131 +222 230 230 +57 57 82 248 248 248 -152 176 192 +164 189 197 16 16 16 -168 56 40 +172 57 41 88 8 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/rhyperior/front.png b/graphics/pokemon/rhyperior/front.png deleted file mode 100644 index 7c20072cf..000000000 Binary files a/graphics/pokemon/rhyperior/front.png and /dev/null differ diff --git a/graphics/pokemon/riolu/back.png b/graphics/pokemon/riolu/back.png index ebb100ba1..10d47dfd5 100644 Binary files a/graphics/pokemon/riolu/back.png and b/graphics/pokemon/riolu/back.png differ diff --git a/graphics/pokemon/riolu/front.png b/graphics/pokemon/riolu/front.png deleted file mode 100644 index fbba5f54b..000000000 Binary files a/graphics/pokemon/riolu/front.png and /dev/null differ diff --git a/graphics/pokemon/roggenrola/front.png b/graphics/pokemon/roggenrola/front.png deleted file mode 100644 index b63929ad2..000000000 Binary files a/graphics/pokemon/roggenrola/front.png and /dev/null differ diff --git a/graphics/pokemon/roselia/front.png b/graphics/pokemon/roselia/front.png deleted file mode 100644 index ea92a4474..000000000 Binary files a/graphics/pokemon/roselia/front.png and /dev/null differ diff --git a/graphics/pokemon/roserade/front.png b/graphics/pokemon/roserade/front.png deleted file mode 100644 index 34c283b96..000000000 Binary files a/graphics/pokemon/roserade/front.png and /dev/null differ diff --git a/graphics/pokemon/rotom/fan/front.png b/graphics/pokemon/rotom/fan/front.png deleted file mode 100644 index 30f58175e..000000000 Binary files a/graphics/pokemon/rotom/fan/front.png and /dev/null differ diff --git a/graphics/pokemon/rotom/front.png b/graphics/pokemon/rotom/front.png deleted file mode 100644 index f6141a709..000000000 Binary files a/graphics/pokemon/rotom/front.png and /dev/null differ diff --git a/graphics/pokemon/rotom/frost/front.png b/graphics/pokemon/rotom/frost/front.png deleted file mode 100644 index d94fd9376..000000000 Binary files a/graphics/pokemon/rotom/frost/front.png and /dev/null differ diff --git a/graphics/pokemon/rotom/heat/front.png b/graphics/pokemon/rotom/heat/front.png deleted file mode 100644 index 59878b8bb..000000000 Binary files a/graphics/pokemon/rotom/heat/front.png and /dev/null differ diff --git a/graphics/pokemon/rotom/mow/front.png b/graphics/pokemon/rotom/mow/front.png deleted file mode 100644 index 41031736f..000000000 Binary files a/graphics/pokemon/rotom/mow/front.png and /dev/null differ diff --git a/graphics/pokemon/rotom/wash/front.png b/graphics/pokemon/rotom/wash/front.png deleted file mode 100644 index 5313d0302..000000000 Binary files a/graphics/pokemon/rotom/wash/front.png and /dev/null differ diff --git a/graphics/pokemon/rufflet/front.png b/graphics/pokemon/rufflet/front.png deleted file mode 100644 index b3e83329b..000000000 Binary files a/graphics/pokemon/rufflet/front.png and /dev/null differ diff --git a/graphics/pokemon/sableye/front.png b/graphics/pokemon/sableye/front.png deleted file mode 100644 index 02d95cca0..000000000 Binary files a/graphics/pokemon/sableye/front.png and /dev/null differ diff --git a/graphics/pokemon/salamence/front.png b/graphics/pokemon/salamence/front.png deleted file mode 100644 index 6f1a13419..000000000 Binary files a/graphics/pokemon/salamence/front.png and /dev/null differ diff --git a/graphics/pokemon/samurott/front.png b/graphics/pokemon/samurott/front.png deleted file mode 100644 index ceef8bab9..000000000 Binary files a/graphics/pokemon/samurott/front.png and /dev/null differ diff --git a/graphics/pokemon/sandile/front.png b/graphics/pokemon/sandile/front.png deleted file mode 100644 index 21ff3c968..000000000 Binary files a/graphics/pokemon/sandile/front.png and /dev/null differ diff --git a/graphics/pokemon/sandshrew/anim_front.png b/graphics/pokemon/sandshrew/anim_front.png index 907d47dd2..be1d37650 100644 Binary files a/graphics/pokemon/sandshrew/anim_front.png and b/graphics/pokemon/sandshrew/anim_front.png differ diff --git a/graphics/pokemon/sandshrew/front.png b/graphics/pokemon/sandshrew/front.png deleted file mode 100644 index 7d373f122..000000000 Binary files a/graphics/pokemon/sandshrew/front.png and /dev/null differ diff --git a/graphics/pokemon/sandshrew/normal.pal b/graphics/pokemon/sandshrew/normal.pal index 0107394ec..a2d45c33b 100644 --- a/graphics/pokemon/sandshrew/normal.pal +++ b/graphics/pokemon/sandshrew/normal.pal @@ -2,11 +2,11 @@ JASC-PAL 0100 16 152 208 160 -128 96 16 -232 216 16 -200 184 176 +131 98 16 +238 222 16 +205 189 180 16 16 16 -200 176 0 +205 180 0 176 128 16 232 232 200 16 56 120 @@ -15,5 +15,5 @@ JASC-PAL 232 216 200 128 128 128 200 200 200 -0 0 0 +115 74 24 0 0 0 diff --git a/graphics/pokemon/sandslash/anim_front.png b/graphics/pokemon/sandslash/anim_front.png index 00f895d9a..99b6417fb 100644 Binary files a/graphics/pokemon/sandslash/anim_front.png and b/graphics/pokemon/sandslash/anim_front.png differ diff --git a/graphics/pokemon/sandslash/front.png b/graphics/pokemon/sandslash/front.png deleted file mode 100644 index 6e8842c62..000000000 Binary files a/graphics/pokemon/sandslash/front.png and /dev/null differ diff --git a/graphics/pokemon/sandslash/normal.pal b/graphics/pokemon/sandslash/normal.pal index 21eebe9eb..ff473ca5e 100644 --- a/graphics/pokemon/sandslash/normal.pal +++ b/graphics/pokemon/sandslash/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -72 56 16 -168 128 48 +74 57 16 +172 131 49 16 16 16 -128 104 56 -136 96 24 -208 168 32 -88 72 0 -240 208 32 -248 248 248 -136 136 136 -216 200 184 +148 123 0 +139 98 24 +213 172 32 +90 74 0 +246 213 32 +255 255 255 +139 139 139 +222 213 180 200 200 208 48 48 72 -80 80 80 +82 82 82 0 0 0 diff --git a/graphics/pokemon/sawk/front.png b/graphics/pokemon/sawk/front.png deleted file mode 100644 index a3ab00548..000000000 Binary files a/graphics/pokemon/sawk/front.png and /dev/null differ diff --git a/graphics/pokemon/sawsbuck/autumn/back.png b/graphics/pokemon/sawsbuck/autumn/back.png index 029ddf1d6..3d32c819b 100644 Binary files a/graphics/pokemon/sawsbuck/autumn/back.png and b/graphics/pokemon/sawsbuck/autumn/back.png differ diff --git a/graphics/pokemon/sawsbuck/autumn/icon.png b/graphics/pokemon/sawsbuck/autumn/icon.png index 082cb94ea..bbbabecf1 100644 Binary files a/graphics/pokemon/sawsbuck/autumn/icon.png and b/graphics/pokemon/sawsbuck/autumn/icon.png differ diff --git a/graphics/pokemon/sawsbuck/front.png b/graphics/pokemon/sawsbuck/front.png deleted file mode 100644 index 71aed05e3..000000000 Binary files a/graphics/pokemon/sawsbuck/front.png and /dev/null differ diff --git a/graphics/pokemon/sawsbuck/summer/back.png b/graphics/pokemon/sawsbuck/summer/back.png index dc4071e2e..aee6937c4 100644 Binary files a/graphics/pokemon/sawsbuck/summer/back.png and b/graphics/pokemon/sawsbuck/summer/back.png differ diff --git a/graphics/pokemon/sawsbuck/summer/icon.png b/graphics/pokemon/sawsbuck/summer/icon.png index e699823cd..6d46101dd 100644 Binary files a/graphics/pokemon/sawsbuck/summer/icon.png and b/graphics/pokemon/sawsbuck/summer/icon.png differ diff --git a/graphics/pokemon/sawsbuck/winter/icon.png b/graphics/pokemon/sawsbuck/winter/icon.png index b7e7a3600..ecb6ce1ad 100644 Binary files a/graphics/pokemon/sawsbuck/winter/icon.png and b/graphics/pokemon/sawsbuck/winter/icon.png differ diff --git a/graphics/pokemon/scatterbug/front.png b/graphics/pokemon/scatterbug/front.png deleted file mode 100644 index 0a8f680ca..000000000 Binary files a/graphics/pokemon/scatterbug/front.png and /dev/null differ diff --git a/graphics/pokemon/sceptile/front.png b/graphics/pokemon/sceptile/front.png deleted file mode 100644 index f49aef765..000000000 Binary files a/graphics/pokemon/sceptile/front.png and /dev/null differ diff --git a/graphics/pokemon/scizor/front.png b/graphics/pokemon/scizor/front.png deleted file mode 100644 index f872c488b..000000000 Binary files a/graphics/pokemon/scizor/front.png and /dev/null differ diff --git a/graphics/pokemon/scolipede/front.png b/graphics/pokemon/scolipede/front.png deleted file mode 100644 index 7d254636f..000000000 Binary files a/graphics/pokemon/scolipede/front.png and /dev/null differ diff --git a/graphics/pokemon/scrafty/front.png b/graphics/pokemon/scrafty/front.png deleted file mode 100644 index 642dcb966..000000000 Binary files a/graphics/pokemon/scrafty/front.png and /dev/null differ diff --git a/graphics/pokemon/scraggy/front.png b/graphics/pokemon/scraggy/front.png deleted file mode 100644 index 1cade69cc..000000000 Binary files a/graphics/pokemon/scraggy/front.png and /dev/null differ diff --git a/graphics/pokemon/scyther/anim_front.png b/graphics/pokemon/scyther/anim_front.png index eb115b910..c253d771b 100644 Binary files a/graphics/pokemon/scyther/anim_front.png and b/graphics/pokemon/scyther/anim_front.png differ diff --git a/graphics/pokemon/scyther/front.png b/graphics/pokemon/scyther/front.png deleted file mode 100644 index 81f2bf619..000000000 Binary files a/graphics/pokemon/scyther/front.png and /dev/null differ diff --git a/graphics/pokemon/scyther/normal.pal b/graphics/pokemon/scyther/normal.pal index 6030b0486..c1e4c692e 100644 --- a/graphics/pokemon/scyther/normal.pal +++ b/graphics/pokemon/scyther/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 0 176 232 -64 88 24 -184 224 112 +65 90 32 +189 230 115 16 16 16 -136 120 80 -248 232 208 -136 200 112 -224 208 168 -88 152 72 -208 232 232 -248 248 248 -160 176 200 -104 104 112 +156 139 49 +255 246 213 +139 205 115 +230 213 172 +90 156 74 +222 222 222 +255 255 255 +189 189 189 +115 115 115 232 216 176 224 208 168 0 0 0 diff --git a/graphics/pokemon/seadra/anim_front.png b/graphics/pokemon/seadra/anim_front.png index d141ec042..5c64799f7 100644 Binary files a/graphics/pokemon/seadra/anim_front.png and b/graphics/pokemon/seadra/anim_front.png differ diff --git a/graphics/pokemon/seadra/front.png b/graphics/pokemon/seadra/front.png deleted file mode 100644 index 9cf3daf51..000000000 Binary files a/graphics/pokemon/seadra/front.png and /dev/null differ diff --git a/graphics/pokemon/seadra/normal.pal b/graphics/pokemon/seadra/normal.pal index b650994c2..c8e35d939 100644 --- a/graphics/pokemon/seadra/normal.pal +++ b/graphics/pokemon/seadra/normal.pal @@ -2,15 +2,15 @@ JASC-PAL 0100 16 152 208 160 -64 152 192 -56 104 136 -168 232 248 +106 131 156 +74 106 131 +172 213 238 16 16 16 -104 200 232 -128 104 96 -248 232 192 +131 172 205 +123 98 32 +255 255 172 248 248 248 -216 176 128 +222 197 82 48 56 96 128 168 200 0 0 0 diff --git a/graphics/pokemon/seaking/anim_front.png b/graphics/pokemon/seaking/anim_front.png index 52407b3b8..d67854c51 100644 Binary files a/graphics/pokemon/seaking/anim_front.png and b/graphics/pokemon/seaking/anim_front.png differ diff --git a/graphics/pokemon/seaking/front.png b/graphics/pokemon/seaking/front.png deleted file mode 100644 index 6f728a24b..000000000 Binary files a/graphics/pokemon/seaking/front.png and /dev/null differ diff --git a/graphics/pokemon/seaking/normal.pal b/graphics/pokemon/seaking/normal.pal index 9fc7fb8a2..56ac07e6d 100644 --- a/graphics/pokemon/seaking/normal.pal +++ b/graphics/pokemon/seaking/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 128 152 -184 192 208 -240 240 248 -80 80 80 +123 131 139 +189 189 205 +246 246 255 +82 82 90 16 16 16 -224 192 160 -192 64 40 -144 48 24 -224 112 64 -240 144 96 -216 216 224 -88 88 112 -128 72 80 -240 168 192 -184 120 144 +255 222 189 +197 65 41 +148 49 24 +230 115 65 +246 148 98 +222 222 230 +90 90 98 +164 57 65 +255 197 205 +246 123 90 diff --git a/graphics/pokemon/sealeo/back.png b/graphics/pokemon/sealeo/back.png index 162838a2c..84a89788b 100644 Binary files a/graphics/pokemon/sealeo/back.png and b/graphics/pokemon/sealeo/back.png differ diff --git a/graphics/pokemon/sealeo/front.png b/graphics/pokemon/sealeo/front.png deleted file mode 100644 index 87d8fdb2f..000000000 Binary files a/graphics/pokemon/sealeo/front.png and /dev/null differ diff --git a/graphics/pokemon/seedot/front.png b/graphics/pokemon/seedot/front.png deleted file mode 100644 index 2ffd8d666..000000000 Binary files a/graphics/pokemon/seedot/front.png and /dev/null differ diff --git a/graphics/pokemon/seel/anim_front.png b/graphics/pokemon/seel/anim_front.png index 1bdfb7aa2..4361b9086 100644 Binary files a/graphics/pokemon/seel/anim_front.png and b/graphics/pokemon/seel/anim_front.png differ diff --git a/graphics/pokemon/seel/front.png b/graphics/pokemon/seel/front.png deleted file mode 100644 index 7ca1efc7e..000000000 Binary files a/graphics/pokemon/seel/front.png and /dev/null differ diff --git a/graphics/pokemon/seel/normal.pal b/graphics/pokemon/seel/normal.pal index f7f97e3fb..286841570 100644 --- a/graphics/pokemon/seel/normal.pal +++ b/graphics/pokemon/seel/normal.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -80 96 112 -144 160 192 -224 232 248 -184 208 232 +65 82 131 +148 156 180 +230 230 246 +213 205 238 16 16 16 248 248 248 -40 168 160 -104 88 16 -176 144 64 -240 224 184 +41 172 164 +106 90 16 +180 148 65 +246 230 189 136 48 32 208 112 88 248 168 168 diff --git a/graphics/pokemon/seismitoad/front.png b/graphics/pokemon/seismitoad/front.png deleted file mode 100644 index e87b7a4a0..000000000 Binary files a/graphics/pokemon/seismitoad/front.png and /dev/null differ diff --git a/graphics/pokemon/sentret/anim_front.png b/graphics/pokemon/sentret/anim_front.png index 820a036ac..9986d9d94 100644 Binary files a/graphics/pokemon/sentret/anim_front.png and b/graphics/pokemon/sentret/anim_front.png differ diff --git a/graphics/pokemon/sentret/front.png b/graphics/pokemon/sentret/front.png deleted file mode 100644 index 650589130..000000000 Binary files a/graphics/pokemon/sentret/front.png and /dev/null differ diff --git a/graphics/pokemon/sentret/normal.pal b/graphics/pokemon/sentret/normal.pal index 1e09bf2d7..093a3581d 100644 --- a/graphics/pokemon/sentret/normal.pal +++ b/graphics/pokemon/sentret/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -72 48 32 -56 8 0 -96 64 48 +74 49 32 +57 8 0 +98 65 49 16 16 16 -176 32 64 -216 64 72 -136 88 64 -200 160 128 -184 128 88 -248 248 248 -160 112 72 -56 24 16 -200 200 192 +180 32 65 +222 65 74 +139 90 65 +205 164 131 +189 131 90 +255 255 255 +164 115 74 +57 24 16 +205 205 197 0 0 0 0 0 0 diff --git a/graphics/pokemon/serperior/front.png b/graphics/pokemon/serperior/front.png deleted file mode 100644 index 8f26506a6..000000000 Binary files a/graphics/pokemon/serperior/front.png and /dev/null differ diff --git a/graphics/pokemon/servine/front.png b/graphics/pokemon/servine/front.png deleted file mode 100644 index ab5a141b9..000000000 Binary files a/graphics/pokemon/servine/front.png and /dev/null differ diff --git a/graphics/pokemon/seviper/front.png b/graphics/pokemon/seviper/front.png deleted file mode 100644 index c80d9c80f..000000000 Binary files a/graphics/pokemon/seviper/front.png and /dev/null differ diff --git a/graphics/pokemon/sewaddle/front.png b/graphics/pokemon/sewaddle/front.png deleted file mode 100644 index 7f01fe90c..000000000 Binary files a/graphics/pokemon/sewaddle/front.png and /dev/null differ diff --git a/graphics/pokemon/sharpedo/front.png b/graphics/pokemon/sharpedo/front.png deleted file mode 100644 index 67db44c34..000000000 Binary files a/graphics/pokemon/sharpedo/front.png and /dev/null differ diff --git a/graphics/pokemon/shaymin/front.png b/graphics/pokemon/shaymin/front.png deleted file mode 100644 index f8e316903..000000000 Binary files a/graphics/pokemon/shaymin/front.png and /dev/null differ diff --git a/graphics/pokemon/shaymin/sky/front.png b/graphics/pokemon/shaymin/sky/front.png deleted file mode 100644 index 190c4ebf6..000000000 Binary files a/graphics/pokemon/shaymin/sky/front.png and /dev/null differ diff --git a/graphics/pokemon/shedinja/front.png b/graphics/pokemon/shedinja/front.png deleted file mode 100644 index 9c217d773..000000000 Binary files a/graphics/pokemon/shedinja/front.png and /dev/null differ diff --git a/graphics/pokemon/shelgon/front.png b/graphics/pokemon/shelgon/front.png deleted file mode 100644 index 713ba5226..000000000 Binary files a/graphics/pokemon/shelgon/front.png and /dev/null differ diff --git a/graphics/pokemon/shellder/front.png b/graphics/pokemon/shellder/front.png deleted file mode 100644 index 4c3e7f522..000000000 Binary files a/graphics/pokemon/shellder/front.png and /dev/null differ diff --git a/graphics/pokemon/shellos/east_sea/back.png b/graphics/pokemon/shellos/east_sea/back.png index 0613c7a58..2cb650a28 100644 Binary files a/graphics/pokemon/shellos/east_sea/back.png and b/graphics/pokemon/shellos/east_sea/back.png differ diff --git a/graphics/pokemon/shellos/east_sea/front.png b/graphics/pokemon/shellos/east_sea/front.png deleted file mode 100644 index 79d1c97cc..000000000 Binary files a/graphics/pokemon/shellos/east_sea/front.png and /dev/null differ diff --git a/graphics/pokemon/shellos/east_sea/icon.png b/graphics/pokemon/shellos/east_sea/icon.png index befc659c1..35610eb27 100644 Binary files a/graphics/pokemon/shellos/east_sea/icon.png and b/graphics/pokemon/shellos/east_sea/icon.png differ diff --git a/graphics/pokemon/shellos/front.png b/graphics/pokemon/shellos/front.png deleted file mode 100644 index 0d1be14f6..000000000 Binary files a/graphics/pokemon/shellos/front.png and /dev/null differ diff --git a/graphics/pokemon/shelmet/front.png b/graphics/pokemon/shelmet/front.png deleted file mode 100644 index e881e7149..000000000 Binary files a/graphics/pokemon/shelmet/front.png and /dev/null differ diff --git a/graphics/pokemon/shieldon/front.png b/graphics/pokemon/shieldon/front.png deleted file mode 100644 index d668a7b76..000000000 Binary files a/graphics/pokemon/shieldon/front.png and /dev/null differ diff --git a/graphics/pokemon/shiftry/front.png b/graphics/pokemon/shiftry/front.png deleted file mode 100644 index 15e263cb9..000000000 Binary files a/graphics/pokemon/shiftry/front.png and /dev/null differ diff --git a/graphics/pokemon/shinx/anim_frontf.png b/graphics/pokemon/shinx/anim_frontf.png index 226c6f3bd..2ee34f096 100644 Binary files a/graphics/pokemon/shinx/anim_frontf.png and b/graphics/pokemon/shinx/anim_frontf.png differ diff --git a/graphics/pokemon/shinx/backf.png b/graphics/pokemon/shinx/backf.png index 24108fbf3..805ee62ee 100644 Binary files a/graphics/pokemon/shinx/backf.png and b/graphics/pokemon/shinx/backf.png differ diff --git a/graphics/pokemon/shinx/front.png b/graphics/pokemon/shinx/front.png deleted file mode 100644 index f6d437c6e..000000000 Binary files a/graphics/pokemon/shinx/front.png and /dev/null differ diff --git a/graphics/pokemon/shroomish/front.png b/graphics/pokemon/shroomish/front.png deleted file mode 100644 index 0a4389204..000000000 Binary files a/graphics/pokemon/shroomish/front.png and /dev/null differ diff --git a/graphics/pokemon/shuckle/front.png b/graphics/pokemon/shuckle/front.png deleted file mode 100644 index 0b00c414d..000000000 Binary files a/graphics/pokemon/shuckle/front.png and /dev/null differ diff --git a/graphics/pokemon/shuppet/back.png b/graphics/pokemon/shuppet/back.png index 61efa5110..c25c8567e 100644 Binary files a/graphics/pokemon/shuppet/back.png and b/graphics/pokemon/shuppet/back.png differ diff --git a/graphics/pokemon/shuppet/front.png b/graphics/pokemon/shuppet/front.png deleted file mode 100644 index e2633121a..000000000 Binary files a/graphics/pokemon/shuppet/front.png and /dev/null differ diff --git a/graphics/pokemon/sigilyph/front.png b/graphics/pokemon/sigilyph/front.png deleted file mode 100644 index 8ce63b837..000000000 Binary files a/graphics/pokemon/sigilyph/front.png and /dev/null differ diff --git a/graphics/pokemon/silcoon/front.png b/graphics/pokemon/silcoon/front.png deleted file mode 100644 index e6f2a614c..000000000 Binary files a/graphics/pokemon/silcoon/front.png and /dev/null differ diff --git a/graphics/pokemon/silvally/back.png b/graphics/pokemon/silvally/back.png index 3994f8bf2..94c3826cb 100644 Binary files a/graphics/pokemon/silvally/back.png and b/graphics/pokemon/silvally/back.png differ diff --git a/graphics/pokemon/silvally/front.png b/graphics/pokemon/silvally/front.png index a0caf35b6..01d9f14a9 100644 Binary files a/graphics/pokemon/silvally/front.png and b/graphics/pokemon/silvally/front.png differ diff --git a/graphics/pokemon/simipour/front.png b/graphics/pokemon/simipour/front.png deleted file mode 100644 index 3ea50454c..000000000 Binary files a/graphics/pokemon/simipour/front.png and /dev/null differ diff --git a/graphics/pokemon/simisage/front.png b/graphics/pokemon/simisage/front.png deleted file mode 100644 index 22e5dff39..000000000 Binary files a/graphics/pokemon/simisage/front.png and /dev/null differ diff --git a/graphics/pokemon/simisear/front.png b/graphics/pokemon/simisear/front.png deleted file mode 100644 index c8ce5ef58..000000000 Binary files a/graphics/pokemon/simisear/front.png and /dev/null differ diff --git a/graphics/pokemon/sirfetchd/front.png b/graphics/pokemon/sirfetchd/front.png index a7ac2a974..3ae79de6e 100644 Binary files a/graphics/pokemon/sirfetchd/front.png and b/graphics/pokemon/sirfetchd/front.png differ diff --git a/graphics/pokemon/skarmory/front.png b/graphics/pokemon/skarmory/front.png deleted file mode 100644 index 719acd0f8..000000000 Binary files a/graphics/pokemon/skarmory/front.png and /dev/null differ diff --git a/graphics/pokemon/skiddo/front.png b/graphics/pokemon/skiddo/front.png deleted file mode 100644 index 1f7d3545e..000000000 Binary files a/graphics/pokemon/skiddo/front.png and /dev/null differ diff --git a/graphics/pokemon/skiploom/front.png b/graphics/pokemon/skiploom/front.png deleted file mode 100644 index 8bbabfd30..000000000 Binary files a/graphics/pokemon/skiploom/front.png and /dev/null differ diff --git a/graphics/pokemon/skitty/front.png b/graphics/pokemon/skitty/front.png deleted file mode 100644 index 2a7321c26..000000000 Binary files a/graphics/pokemon/skitty/front.png and /dev/null differ diff --git a/graphics/pokemon/skorupi/front.png b/graphics/pokemon/skorupi/front.png deleted file mode 100644 index 480051932..000000000 Binary files a/graphics/pokemon/skorupi/front.png and /dev/null differ diff --git a/graphics/pokemon/skrelp/front.png b/graphics/pokemon/skrelp/front.png deleted file mode 100644 index 91991a86c..000000000 Binary files a/graphics/pokemon/skrelp/front.png and /dev/null differ diff --git a/graphics/pokemon/skuntank/front.png b/graphics/pokemon/skuntank/front.png deleted file mode 100644 index d188535e2..000000000 Binary files a/graphics/pokemon/skuntank/front.png and /dev/null differ diff --git a/graphics/pokemon/slaking/front.png b/graphics/pokemon/slaking/front.png deleted file mode 100644 index bc7ed93b0..000000000 Binary files a/graphics/pokemon/slaking/front.png and /dev/null differ diff --git a/graphics/pokemon/slakoth/front.png b/graphics/pokemon/slakoth/front.png deleted file mode 100644 index e40b34fb2..000000000 Binary files a/graphics/pokemon/slakoth/front.png and /dev/null differ diff --git a/graphics/pokemon/sliggoo/front.png b/graphics/pokemon/sliggoo/front.png deleted file mode 100644 index 1a7f094cd..000000000 Binary files a/graphics/pokemon/sliggoo/front.png and /dev/null differ diff --git a/graphics/pokemon/slowbro/anim_front.png b/graphics/pokemon/slowbro/anim_front.png index f944ffb99..0030c9563 100644 Binary files a/graphics/pokemon/slowbro/anim_front.png and b/graphics/pokemon/slowbro/anim_front.png differ diff --git a/graphics/pokemon/slowbro/front.png b/graphics/pokemon/slowbro/front.png deleted file mode 100644 index 4ec5e110f..000000000 Binary files a/graphics/pokemon/slowbro/front.png and /dev/null differ diff --git a/graphics/pokemon/slowbro/normal.pal b/graphics/pokemon/slowbro/normal.pal index 83a239b6d..ae4d12a99 100644 --- a/graphics/pokemon/slowbro/normal.pal +++ b/graphics/pokemon/slowbro/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -120 48 48 -232 104 120 -248 144 144 +123 49 49 +230 106 123 +255 148 148 24 24 24 -248 192 176 +255 189 172 248 248 248 216 216 208 -88 88 88 -144 144 144 -128 88 32 -184 184 184 -248 240 176 -240 216 128 -208 160 96 +82 82 90 +139 148 148 +131 90 32 +180 189 189 +255 238 180 +238 213 131 +205 164 98 232 80 40 diff --git a/graphics/pokemon/slowking/front.png b/graphics/pokemon/slowking/front.png deleted file mode 100644 index d9af555c2..000000000 Binary files a/graphics/pokemon/slowking/front.png and /dev/null differ diff --git a/graphics/pokemon/slowpoke/front.png b/graphics/pokemon/slowpoke/front.png deleted file mode 100644 index aa53f9c55..000000000 Binary files a/graphics/pokemon/slowpoke/front.png and /dev/null differ diff --git a/graphics/pokemon/slugma/front.png b/graphics/pokemon/slugma/front.png deleted file mode 100644 index a64ce0042..000000000 Binary files a/graphics/pokemon/slugma/front.png and /dev/null differ diff --git a/graphics/pokemon/slurpuff/front.png b/graphics/pokemon/slurpuff/front.png deleted file mode 100644 index fab831b36..000000000 Binary files a/graphics/pokemon/slurpuff/front.png and /dev/null differ diff --git a/graphics/pokemon/smeargle/front.png b/graphics/pokemon/smeargle/front.png deleted file mode 100644 index 1804f2514..000000000 Binary files a/graphics/pokemon/smeargle/front.png and /dev/null differ diff --git a/graphics/pokemon/smoochum/front.png b/graphics/pokemon/smoochum/front.png deleted file mode 100644 index 6f4927480..000000000 Binary files a/graphics/pokemon/smoochum/front.png and /dev/null differ diff --git a/graphics/pokemon/sneasel/front.png b/graphics/pokemon/sneasel/front.png deleted file mode 100644 index d422fe52e..000000000 Binary files a/graphics/pokemon/sneasel/front.png and /dev/null differ diff --git a/graphics/pokemon/snivy/front.png b/graphics/pokemon/snivy/front.png deleted file mode 100644 index 040a32f83..000000000 Binary files a/graphics/pokemon/snivy/front.png and /dev/null differ diff --git a/graphics/pokemon/snorlax/anim_front.png b/graphics/pokemon/snorlax/anim_front.png index 94d9d4784..cfcd8e4ae 100644 Binary files a/graphics/pokemon/snorlax/anim_front.png and b/graphics/pokemon/snorlax/anim_front.png differ diff --git a/graphics/pokemon/snorlax/front.png b/graphics/pokemon/snorlax/front.png deleted file mode 100644 index eff039d3d..000000000 Binary files a/graphics/pokemon/snorlax/front.png and /dev/null differ diff --git a/graphics/pokemon/snorlax/normal.pal b/graphics/pokemon/snorlax/normal.pal index 5b782626d..b639f9037 100644 --- a/graphics/pokemon/snorlax/normal.pal +++ b/graphics/pokemon/snorlax/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 16 16 8 -16 48 56 -80 136 168 -48 88 120 -32 64 96 -112 168 192 -216 192 176 -248 232 208 +16 57 65 +82 139 172 +49 90 123 +16 57 65 +115 164 189 +230 197 172 +246 230 189 248 248 248 112 112 112 -160 128 104 -232 208 184 +164 115 82 +246 213 189 200 200 200 -96 80 64 +98 65 32 16 48 56 diff --git a/graphics/pokemon/snorunt/front.png b/graphics/pokemon/snorunt/front.png deleted file mode 100644 index 02c956098..000000000 Binary files a/graphics/pokemon/snorunt/front.png and /dev/null differ diff --git a/graphics/pokemon/snover/front.png b/graphics/pokemon/snover/front.png deleted file mode 100644 index 9dff7b2a5..000000000 Binary files a/graphics/pokemon/snover/front.png and /dev/null differ diff --git a/graphics/pokemon/snubbull/back.png b/graphics/pokemon/snubbull/back.png index 3cd368840..fa403eba3 100644 Binary files a/graphics/pokemon/snubbull/back.png and b/graphics/pokemon/snubbull/back.png differ diff --git a/graphics/pokemon/snubbull/front.png b/graphics/pokemon/snubbull/front.png deleted file mode 100644 index fa6456d89..000000000 Binary files a/graphics/pokemon/snubbull/front.png and /dev/null differ diff --git a/graphics/pokemon/solosis/front.png b/graphics/pokemon/solosis/front.png deleted file mode 100644 index 6be1e5a06..000000000 Binary files a/graphics/pokemon/solosis/front.png and /dev/null differ diff --git a/graphics/pokemon/solrock/front.png b/graphics/pokemon/solrock/front.png deleted file mode 100644 index 24336f16b..000000000 Binary files a/graphics/pokemon/solrock/front.png and /dev/null differ diff --git a/graphics/pokemon/spearow/anim_front.png b/graphics/pokemon/spearow/anim_front.png index 055e84677..c52e1ce2a 100644 Binary files a/graphics/pokemon/spearow/anim_front.png and b/graphics/pokemon/spearow/anim_front.png differ diff --git a/graphics/pokemon/spearow/front.png b/graphics/pokemon/spearow/front.png deleted file mode 100644 index 68621040a..000000000 Binary files a/graphics/pokemon/spearow/front.png and /dev/null differ diff --git a/graphics/pokemon/spearow/normal.pal b/graphics/pokemon/spearow/normal.pal index f03dd0e30..8eda920f0 100644 --- a/graphics/pokemon/spearow/normal.pal +++ b/graphics/pokemon/spearow/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -152 80 24 -192 104 32 -64 40 24 -232 168 80 -16 16 16 -232 80 72 -168 64 72 -192 176 152 -248 248 248 -248 208 200 -248 160 136 -255 255 0 -120 40 40 -136 120 96 -96 80 72 +156 82 24 +197 106 32 +106 65 24 +238 172 82 +0 0 0 +238 82 74 +172 65 74 +230 213 180 +255 255 255 +255 213 205 +255 164 139 +197 180 156 +123 41 41 +139 123 98 +98 82 74 diff --git a/graphics/pokemon/spearow/shiny.pal b/graphics/pokemon/spearow/shiny.pal index 240a50c94..9f44b1ba5 100644 --- a/graphics/pokemon/spearow/shiny.pal +++ b/graphics/pokemon/spearow/shiny.pal @@ -13,7 +13,7 @@ JASC-PAL 248 248 248 248 248 160 240 232 96 -248 216 24 +201 191 147 160 104 32 144 136 104 80 72 56 diff --git a/graphics/pokemon/spewpa/front.png b/graphics/pokemon/spewpa/front.png deleted file mode 100644 index 4f6a6269e..000000000 Binary files a/graphics/pokemon/spewpa/front.png and /dev/null differ diff --git a/graphics/pokemon/spheal/back.png b/graphics/pokemon/spheal/back.png index e859b980f..5c23636ed 100644 Binary files a/graphics/pokemon/spheal/back.png and b/graphics/pokemon/spheal/back.png differ diff --git a/graphics/pokemon/spheal/front.png b/graphics/pokemon/spheal/front.png deleted file mode 100644 index 2063a772b..000000000 Binary files a/graphics/pokemon/spheal/front.png and /dev/null differ diff --git a/graphics/pokemon/spinarak/anim_front.png b/graphics/pokemon/spinarak/anim_front.png index d5837da99..0e2d525c4 100644 Binary files a/graphics/pokemon/spinarak/anim_front.png and b/graphics/pokemon/spinarak/anim_front.png differ diff --git a/graphics/pokemon/spinarak/front.png b/graphics/pokemon/spinarak/front.png deleted file mode 100644 index 36c6e8f60..000000000 Binary files a/graphics/pokemon/spinarak/front.png and /dev/null differ diff --git a/graphics/pokemon/spinarak/normal.pal b/graphics/pokemon/spinarak/normal.pal index 22db1c2ce..ccdc73a40 100644 --- a/graphics/pokemon/spinarak/normal.pal +++ b/graphics/pokemon/spinarak/normal.pal @@ -4,16 +4,16 @@ JASC-PAL 0 176 232 16 16 16 48 72 16 -40 96 96 +16 16 16 136 224 48 168 240 96 80 176 104 96 152 160 -112 88 32 -192 176 24 -72 72 72 +131 106 41 +197 180 24 +106 106 115 248 248 248 -248 224 72 -200 192 192 -144 48 40 -248 88 72 +255 230 74 +189 197 197 +123 49 65 +238 90 90 diff --git a/graphics/pokemon/spinarak/shiny.pal b/graphics/pokemon/spinarak/shiny.pal index 970ece98d..9c966c9e6 100644 --- a/graphics/pokemon/spinarak/shiny.pal +++ b/graphics/pokemon/spinarak/shiny.pal @@ -4,7 +4,7 @@ JASC-PAL 168 224 24 16 16 16 40 56 104 -32 56 96 +16 16 16 136 176 232 176 216 248 104 128 184 diff --git a/graphics/pokemon/spinda/front.png b/graphics/pokemon/spinda/front.png deleted file mode 100644 index 4d298366f..000000000 Binary files a/graphics/pokemon/spinda/front.png and /dev/null differ diff --git a/graphics/pokemon/spiritomb/front.png b/graphics/pokemon/spiritomb/front.png deleted file mode 100644 index bcfd704f6..000000000 Binary files a/graphics/pokemon/spiritomb/front.png and /dev/null differ diff --git a/graphics/pokemon/spoink/front.png b/graphics/pokemon/spoink/front.png deleted file mode 100644 index 4d5e236fe..000000000 Binary files a/graphics/pokemon/spoink/front.png and /dev/null differ diff --git a/graphics/pokemon/spritzee/front.png b/graphics/pokemon/spritzee/front.png deleted file mode 100644 index 76f1554b8..000000000 Binary files a/graphics/pokemon/spritzee/front.png and /dev/null differ diff --git a/graphics/pokemon/squirtle/anim_front.png b/graphics/pokemon/squirtle/anim_front.png index b125bbdfb..5c32cf67f 100644 Binary files a/graphics/pokemon/squirtle/anim_front.png and b/graphics/pokemon/squirtle/anim_front.png differ diff --git a/graphics/pokemon/squirtle/back.png b/graphics/pokemon/squirtle/back.png index 42cbb8f5e..a57207153 100644 Binary files a/graphics/pokemon/squirtle/back.png and b/graphics/pokemon/squirtle/back.png differ diff --git a/graphics/pokemon/squirtle/front.png b/graphics/pokemon/squirtle/front.png deleted file mode 100644 index f8854997d..000000000 Binary files a/graphics/pokemon/squirtle/front.png and /dev/null differ diff --git a/graphics/pokemon/squirtle/normal.pal b/graphics/pokemon/squirtle/normal.pal index c66f21e48..b2282cee8 100644 --- a/graphics/pokemon/squirtle/normal.pal +++ b/graphics/pokemon/squirtle/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -72 160 200 -40 104 144 -128 216 248 -112 192 240 +90 156 164 +41 115 131 +180 230 238 +139 197 205 16 16 16 208 200 200 248 248 248 -200 40 48 +131 41 0 88 64 32 -176 96 16 -160 128 48 -200 168 88 -240 224 136 -80 48 40 -208 112 16 +189 106 0 +205 123 41 +230 172 90 +255 213 106 +98 41 0 +213 148 82 diff --git a/graphics/pokemon/squirtle/shiny.pal b/graphics/pokemon/squirtle/shiny.pal index f069e2dfa..ff20b8f51 100644 --- a/graphics/pokemon/squirtle/shiny.pal +++ b/graphics/pokemon/squirtle/shiny.pal @@ -9,7 +9,7 @@ JASC-PAL 16 16 16 208 200 200 248 248 248 -200 80 160 +128 56 0 128 56 0 88 168 40 200 136 32 diff --git a/graphics/pokemon/stantler/front.png b/graphics/pokemon/stantler/front.png deleted file mode 100644 index 3c4e0b08f..000000000 Binary files a/graphics/pokemon/stantler/front.png and /dev/null differ diff --git a/graphics/pokemon/staraptor/front.png b/graphics/pokemon/staraptor/front.png deleted file mode 100644 index dbb5a2f95..000000000 Binary files a/graphics/pokemon/staraptor/front.png and /dev/null differ diff --git a/graphics/pokemon/staravia/back.png b/graphics/pokemon/staravia/back.png index 6d24ce412..672f9ca56 100644 Binary files a/graphics/pokemon/staravia/back.png and b/graphics/pokemon/staravia/back.png differ diff --git a/graphics/pokemon/staravia/front.png b/graphics/pokemon/staravia/front.png deleted file mode 100644 index bd7c8ab4f..000000000 Binary files a/graphics/pokemon/staravia/front.png and /dev/null differ diff --git a/graphics/pokemon/starly/front.png b/graphics/pokemon/starly/front.png deleted file mode 100644 index c188a7ff5..000000000 Binary files a/graphics/pokemon/starly/front.png and /dev/null differ diff --git a/graphics/pokemon/starmie/anim_front.png b/graphics/pokemon/starmie/anim_front.png index 5bc72ff51..0a912a022 100644 Binary files a/graphics/pokemon/starmie/anim_front.png and b/graphics/pokemon/starmie/anim_front.png differ diff --git a/graphics/pokemon/starmie/front.png b/graphics/pokemon/starmie/front.png deleted file mode 100644 index ab2abd1a0..000000000 Binary files a/graphics/pokemon/starmie/front.png and /dev/null differ diff --git a/graphics/pokemon/starmie/normal.pal b/graphics/pokemon/starmie/normal.pal index 82ffa3fa9..2a266fc3f 100644 --- a/graphics/pokemon/starmie/normal.pal +++ b/graphics/pokemon/starmie/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -88 80 152 -48 56 112 -208 184 240 -144 128 184 -176 152 216 +90 82 156 +49 57 115 +213 172 238 +139 115 189 +180 139 213 0 0 0 -88 64 48 -232 216 80 -248 248 152 -176 160 48 -144 112 64 -240 192 216 -200 32 88 -240 80 112 -136 16 80 +90 65 49 +238 197 74 +255 230 148 +197 148 32 +148 115 65 +246 197 222 +205 32 90 +246 82 115 +139 16 82 diff --git a/graphics/pokemon/staryu/anim_front.png b/graphics/pokemon/staryu/anim_front.png index ad2250818..38d62ffc8 100644 Binary files a/graphics/pokemon/staryu/anim_front.png and b/graphics/pokemon/staryu/anim_front.png differ diff --git a/graphics/pokemon/staryu/front.png b/graphics/pokemon/staryu/front.png deleted file mode 100644 index ffb70b69d..000000000 Binary files a/graphics/pokemon/staryu/front.png and /dev/null differ diff --git a/graphics/pokemon/staryu/normal.pal b/graphics/pokemon/staryu/normal.pal index 7d0a10b2a..0b6d5cc3d 100644 --- a/graphics/pokemon/staryu/normal.pal +++ b/graphics/pokemon/staryu/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -144 104 56 -96 48 48 -216 176 96 +156 106 57 +98 49 49 +222 180 98 0 0 0 -120 80 56 -192 144 72 -128 104 64 -248 240 160 -88 64 48 -232 216 48 -200 144 40 -240 136 136 -240 192 184 -192 32 88 +123 82 57 +213 156 82 +131 106 65 +255 246 164 +90 65 49 +238 222 49 +205 148 41 +246 65 65 +246 197 189 +172 32 16 248 248 248 diff --git a/graphics/pokemon/steelix/front.png b/graphics/pokemon/steelix/front.png deleted file mode 100644 index a00376baf..000000000 Binary files a/graphics/pokemon/steelix/front.png and /dev/null differ diff --git a/graphics/pokemon/stoutland/front.png b/graphics/pokemon/stoutland/front.png deleted file mode 100644 index bd5570182..000000000 Binary files a/graphics/pokemon/stoutland/front.png and /dev/null differ diff --git a/graphics/pokemon/stunfisk/front.png b/graphics/pokemon/stunfisk/front.png deleted file mode 100644 index 4e46cfa8f..000000000 Binary files a/graphics/pokemon/stunfisk/front.png and /dev/null differ diff --git a/graphics/pokemon/stunky/front.png b/graphics/pokemon/stunky/front.png deleted file mode 100644 index da228e831..000000000 Binary files a/graphics/pokemon/stunky/front.png and /dev/null differ diff --git a/graphics/pokemon/sudowoodo/front.png b/graphics/pokemon/sudowoodo/front.png deleted file mode 100644 index df699a5c7..000000000 Binary files a/graphics/pokemon/sudowoodo/front.png and /dev/null differ diff --git a/graphics/pokemon/suicune/front.png b/graphics/pokemon/suicune/front.png deleted file mode 100644 index b1ff2a841..000000000 Binary files a/graphics/pokemon/suicune/front.png and /dev/null differ diff --git a/graphics/pokemon/sunflora/front.png b/graphics/pokemon/sunflora/front.png deleted file mode 100644 index ebdac3a02..000000000 Binary files a/graphics/pokemon/sunflora/front.png and /dev/null differ diff --git a/graphics/pokemon/sunkern/front.png b/graphics/pokemon/sunkern/front.png deleted file mode 100644 index 72c2510ce..000000000 Binary files a/graphics/pokemon/sunkern/front.png and /dev/null differ diff --git a/graphics/pokemon/surskit/front.png b/graphics/pokemon/surskit/front.png deleted file mode 100644 index 32508e31f..000000000 Binary files a/graphics/pokemon/surskit/front.png and /dev/null differ diff --git a/graphics/pokemon/swablu/back.png b/graphics/pokemon/swablu/back.png index 2bab92da6..e146b2c0c 100644 Binary files a/graphics/pokemon/swablu/back.png and b/graphics/pokemon/swablu/back.png differ diff --git a/graphics/pokemon/swablu/front.png b/graphics/pokemon/swablu/front.png deleted file mode 100644 index b7d58d06b..000000000 Binary files a/graphics/pokemon/swablu/front.png and /dev/null differ diff --git a/graphics/pokemon/swadloon/front.png b/graphics/pokemon/swadloon/front.png deleted file mode 100644 index 1b7f74db5..000000000 Binary files a/graphics/pokemon/swadloon/front.png and /dev/null differ diff --git a/graphics/pokemon/swalot/back.png b/graphics/pokemon/swalot/back.png index 487b4f888..ec9fdaef2 100644 Binary files a/graphics/pokemon/swalot/back.png and b/graphics/pokemon/swalot/back.png differ diff --git a/graphics/pokemon/swalot/front.png b/graphics/pokemon/swalot/front.png deleted file mode 100644 index 6ae76a4f3..000000000 Binary files a/graphics/pokemon/swalot/front.png and /dev/null differ diff --git a/graphics/pokemon/swampert/front.png b/graphics/pokemon/swampert/front.png deleted file mode 100644 index 7a86a418d..000000000 Binary files a/graphics/pokemon/swampert/front.png and /dev/null differ diff --git a/graphics/pokemon/swanna/front.png b/graphics/pokemon/swanna/front.png deleted file mode 100644 index e1b58cf39..000000000 Binary files a/graphics/pokemon/swanna/front.png and /dev/null differ diff --git a/graphics/pokemon/swellow/front.png b/graphics/pokemon/swellow/front.png deleted file mode 100644 index 32345b406..000000000 Binary files a/graphics/pokemon/swellow/front.png and /dev/null differ diff --git a/graphics/pokemon/swinub/front.png b/graphics/pokemon/swinub/front.png deleted file mode 100644 index ec1915009..000000000 Binary files a/graphics/pokemon/swinub/front.png and /dev/null differ diff --git a/graphics/pokemon/swirlix/front.png b/graphics/pokemon/swirlix/front.png deleted file mode 100644 index fb40d972f..000000000 Binary files a/graphics/pokemon/swirlix/front.png and /dev/null differ diff --git a/graphics/pokemon/swoobat/front.png b/graphics/pokemon/swoobat/front.png deleted file mode 100644 index 7a4ccae93..000000000 Binary files a/graphics/pokemon/swoobat/front.png and /dev/null differ diff --git a/graphics/pokemon/sylveon/front.png b/graphics/pokemon/sylveon/front.png deleted file mode 100644 index dbed23108..000000000 Binary files a/graphics/pokemon/sylveon/front.png and /dev/null differ diff --git a/graphics/pokemon/taillow/front.png b/graphics/pokemon/taillow/front.png deleted file mode 100644 index 3e4be10ea..000000000 Binary files a/graphics/pokemon/taillow/front.png and /dev/null differ diff --git a/graphics/pokemon/talonflame/front.png b/graphics/pokemon/talonflame/front.png deleted file mode 100644 index 2fd619c53..000000000 Binary files a/graphics/pokemon/talonflame/front.png and /dev/null differ diff --git a/graphics/pokemon/tangela/anim_front.png b/graphics/pokemon/tangela/anim_front.png index 1a768a091..9785af465 100644 Binary files a/graphics/pokemon/tangela/anim_front.png and b/graphics/pokemon/tangela/anim_front.png differ diff --git a/graphics/pokemon/tangela/front.png b/graphics/pokemon/tangela/front.png deleted file mode 100644 index 34f9ff5fb..000000000 Binary files a/graphics/pokemon/tangela/front.png and /dev/null differ diff --git a/graphics/pokemon/tangela/normal.pal b/graphics/pokemon/tangela/normal.pal index d90fcacca..03893711c 100644 --- a/graphics/pokemon/tangela/normal.pal +++ b/graphics/pokemon/tangela/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -40 88 128 -80 152 192 -56 112 168 -16 40 72 +65 123 148 +148 213 246 +90 164 205 +32 65 82 16 16 16 -80 80 80 -176 176 176 +82 82 82 +180 180 180 248 248 248 -112 40 40 -168 40 64 -248 128 128 -216 72 104 +115 41 41 +172 41 65 +255 131 131 +222 74 106 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/tangrowth/front.png b/graphics/pokemon/tangrowth/front.png deleted file mode 100644 index ae389e74a..000000000 Binary files a/graphics/pokemon/tangrowth/front.png and /dev/null differ diff --git a/graphics/pokemon/tapu_bulu/front.png b/graphics/pokemon/tapu_bulu/front.png deleted file mode 100644 index ef0eb3357..000000000 Binary files a/graphics/pokemon/tapu_bulu/front.png and /dev/null differ diff --git a/graphics/pokemon/tapu_fini/front.png b/graphics/pokemon/tapu_fini/front.png deleted file mode 100644 index ccf8d39e9..000000000 Binary files a/graphics/pokemon/tapu_fini/front.png and /dev/null differ diff --git a/graphics/pokemon/tapu_koko/front.png b/graphics/pokemon/tapu_koko/front.png deleted file mode 100644 index d6a5fd655..000000000 Binary files a/graphics/pokemon/tapu_koko/front.png and /dev/null differ diff --git a/graphics/pokemon/tapu_lele/front.png b/graphics/pokemon/tapu_lele/front.png deleted file mode 100644 index 31f5d1c1a..000000000 Binary files a/graphics/pokemon/tapu_lele/front.png and /dev/null differ diff --git a/graphics/pokemon/tauros/anim_front.png b/graphics/pokemon/tauros/anim_front.png index 1d186f77b..1b0092dd3 100644 Binary files a/graphics/pokemon/tauros/anim_front.png and b/graphics/pokemon/tauros/anim_front.png differ diff --git a/graphics/pokemon/tauros/front.png b/graphics/pokemon/tauros/front.png deleted file mode 100644 index 587db94cd..000000000 Binary files a/graphics/pokemon/tauros/front.png and /dev/null differ diff --git a/graphics/pokemon/tauros/normal.pal b/graphics/pokemon/tauros/normal.pal index 1bb372aa7..5115a389e 100644 --- a/graphics/pokemon/tauros/normal.pal +++ b/graphics/pokemon/tauros/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -56 56 72 -104 104 128 +57 57 74 +106 106 131 0 0 0 -72 56 40 -120 104 96 -80 72 64 -136 96 32 -216 160 72 -152 144 136 -200 200 216 -152 152 168 -80 56 16 -224 192 120 -176 128 48 +74 57 41 +139 106 82 +98 74 49 +139 98 32 +222 164 74 +172 139 115 +205 205 222 +156 156 172 +82 57 16 +230 197 123 +180 131 49 248 248 248 diff --git a/graphics/pokemon/teddiursa/front.png b/graphics/pokemon/teddiursa/front.png deleted file mode 100644 index 9412d0c7f..000000000 Binary files a/graphics/pokemon/teddiursa/front.png and /dev/null differ diff --git a/graphics/pokemon/tentacool/anim_front.png b/graphics/pokemon/tentacool/anim_front.png index 4ccacc344..e6ff75c7a 100644 Binary files a/graphics/pokemon/tentacool/anim_front.png and b/graphics/pokemon/tentacool/anim_front.png differ diff --git a/graphics/pokemon/tentacool/front.png b/graphics/pokemon/tentacool/front.png deleted file mode 100644 index 460479345..000000000 Binary files a/graphics/pokemon/tentacool/front.png and /dev/null differ diff --git a/graphics/pokemon/tentacool/normal.pal b/graphics/pokemon/tentacool/normal.pal index 2f409fd92..ab750d2ed 100644 --- a/graphics/pokemon/tentacool/normal.pal +++ b/graphics/pokemon/tentacool/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -40 88 112 -104 16 40 -152 208 240 -104 184 224 -168 32 64 -248 248 248 -232 184 200 -216 80 128 -48 144 192 -16 16 16 -208 208 208 -80 80 88 -184 184 184 -112 104 120 -152 144 160 +32 82 131 +106 16 16 +131 213 246 +106 180 230 +180 41 32 +255 255 255 +255 197 189 +255 82 74 +65 148 172 +0 0 0 +213 213 213 +82 82 32 +213 197 148 +131 131 65 +180 172 115 diff --git a/graphics/pokemon/tentacruel/anim_front.png b/graphics/pokemon/tentacruel/anim_front.png index d401d1eaf..e4e7c3cc8 100644 Binary files a/graphics/pokemon/tentacruel/anim_front.png and b/graphics/pokemon/tentacruel/anim_front.png differ diff --git a/graphics/pokemon/tentacruel/front.png b/graphics/pokemon/tentacruel/front.png deleted file mode 100644 index b751ed684..000000000 Binary files a/graphics/pokemon/tentacruel/front.png and /dev/null differ diff --git a/graphics/pokemon/tentacruel/normal.pal b/graphics/pokemon/tentacruel/normal.pal index c28517e86..878043437 100644 --- a/graphics/pokemon/tentacruel/normal.pal +++ b/graphics/pokemon/tentacruel/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -40 88 112 -144 208 240 -104 16 40 -88 176 216 -48 144 184 +32 82 131 +131 205 230 +131 16 16 +106 180 230 +65 148 172 16 16 16 -216 80 128 -232 184 200 -248 248 248 -168 32 64 -208 208 208 -80 80 88 -152 144 160 -104 112 104 -184 184 184 +246 65 82 +255 189 172 +255 255 255 +180 41 32 +213 213 213 +82 82 32 +180 172 115 +131 131 65 +230 213 164 diff --git a/graphics/pokemon/tepig/front.png b/graphics/pokemon/tepig/front.png deleted file mode 100644 index 0e706ecad..000000000 Binary files a/graphics/pokemon/tepig/front.png and /dev/null differ diff --git a/graphics/pokemon/terrakion/front.png b/graphics/pokemon/terrakion/front.png deleted file mode 100644 index 53b731785..000000000 Binary files a/graphics/pokemon/terrakion/front.png and /dev/null differ diff --git a/graphics/pokemon/throh/front.png b/graphics/pokemon/throh/front.png deleted file mode 100644 index 82351e40b..000000000 Binary files a/graphics/pokemon/throh/front.png and /dev/null differ diff --git a/graphics/pokemon/thundurus/front.png b/graphics/pokemon/thundurus/front.png deleted file mode 100644 index b8ff39958..000000000 Binary files a/graphics/pokemon/thundurus/front.png and /dev/null differ diff --git a/graphics/pokemon/thundurus/therian/front.png b/graphics/pokemon/thundurus/therian/front.png deleted file mode 100644 index 4d1543d59..000000000 Binary files a/graphics/pokemon/thundurus/therian/front.png and /dev/null differ diff --git a/graphics/pokemon/timburr/front.png b/graphics/pokemon/timburr/front.png deleted file mode 100644 index b79489a86..000000000 Binary files a/graphics/pokemon/timburr/front.png and /dev/null differ diff --git a/graphics/pokemon/tirtouga/front.png b/graphics/pokemon/tirtouga/front.png deleted file mode 100644 index 3228a2f66..000000000 Binary files a/graphics/pokemon/tirtouga/front.png and /dev/null differ diff --git a/graphics/pokemon/togekiss/front.png b/graphics/pokemon/togekiss/front.png deleted file mode 100644 index 0a699e780..000000000 Binary files a/graphics/pokemon/togekiss/front.png and /dev/null differ diff --git a/graphics/pokemon/togepi/anim_front.png b/graphics/pokemon/togepi/anim_front.png index 07d7f05b8..9fc22b9f8 100644 Binary files a/graphics/pokemon/togepi/anim_front.png and b/graphics/pokemon/togepi/anim_front.png differ diff --git a/graphics/pokemon/togepi/front.png b/graphics/pokemon/togepi/front.png deleted file mode 100644 index e6520872b..000000000 Binary files a/graphics/pokemon/togepi/front.png and /dev/null differ diff --git a/graphics/pokemon/togepi/normal.pal b/graphics/pokemon/togepi/normal.pal index 0fb20049a..3d6967dca 100644 --- a/graphics/pokemon/togepi/normal.pal +++ b/graphics/pokemon/togepi/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -144 112 88 +148 115 90 0 0 0 -240 232 192 -200 176 112 -112 72 72 -240 208 160 -168 32 32 -248 248 248 -120 136 144 -208 216 216 -72 128 192 -216 112 104 -192 64 64 -176 176 192 -48 96 168 +246 238 197 +205 156 115 +115 74 74 +246 213 164 +172 32 32 +255 255 255 +123 139 148 +213 222 222 +74 131 197 +222 115 106 +197 65 65 +180 180 197 +49 98 172 diff --git a/graphics/pokemon/togetic/anim_front.png b/graphics/pokemon/togetic/anim_front.png index 1079c2b01..c88c0e4d6 100644 Binary files a/graphics/pokemon/togetic/anim_front.png and b/graphics/pokemon/togetic/anim_front.png differ diff --git a/graphics/pokemon/togetic/back.png b/graphics/pokemon/togetic/back.png index 755fcf595..76312f9b8 100644 Binary files a/graphics/pokemon/togetic/back.png and b/graphics/pokemon/togetic/back.png differ diff --git a/graphics/pokemon/togetic/front.png b/graphics/pokemon/togetic/front.png deleted file mode 100644 index 0bacb627e..000000000 Binary files a/graphics/pokemon/togetic/front.png and /dev/null differ diff --git a/graphics/pokemon/togetic/normal.pal b/graphics/pokemon/togetic/normal.pal index 0b1731459..951bc0f04 100644 --- a/graphics/pokemon/togetic/normal.pal +++ b/graphics/pokemon/togetic/normal.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 152 208 160 -112 120 128 -248 248 248 +115 123 131 +255 255 255 0 0 0 -168 192 184 -208 232 232 -216 64 56 -184 24 8 -40 144 224 -16 96 184 -192 48 32 -136 16 16 +172 197 189 +213 238 238 +222 65 57 +189 24 8 +41 148 230 +16 98 189 +222 65 57 +189 24 8 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/torchic/front.png b/graphics/pokemon/torchic/front.png deleted file mode 100644 index b4e2066d1..000000000 Binary files a/graphics/pokemon/torchic/front.png and /dev/null differ diff --git a/graphics/pokemon/torkoal/front.png b/graphics/pokemon/torkoal/front.png deleted file mode 100644 index abe45c343..000000000 Binary files a/graphics/pokemon/torkoal/front.png and /dev/null differ diff --git a/graphics/pokemon/tornadus/front.png b/graphics/pokemon/tornadus/front.png deleted file mode 100644 index b121301dd..000000000 Binary files a/graphics/pokemon/tornadus/front.png and /dev/null differ diff --git a/graphics/pokemon/tornadus/therian/front.png b/graphics/pokemon/tornadus/therian/front.png deleted file mode 100644 index b168d3bd9..000000000 Binary files a/graphics/pokemon/tornadus/therian/front.png and /dev/null differ diff --git a/graphics/pokemon/tornadus/therian/icon.png b/graphics/pokemon/tornadus/therian/icon.png index dd6db6b5c..fea79288d 100644 Binary files a/graphics/pokemon/tornadus/therian/icon.png and b/graphics/pokemon/tornadus/therian/icon.png differ diff --git a/graphics/pokemon/torterra/front.png b/graphics/pokemon/torterra/front.png deleted file mode 100644 index 2ef06d2f0..000000000 Binary files a/graphics/pokemon/torterra/front.png and /dev/null differ diff --git a/graphics/pokemon/totodile/anim_front.png b/graphics/pokemon/totodile/anim_front.png index 49e4fee75..25e0a234e 100644 Binary files a/graphics/pokemon/totodile/anim_front.png and b/graphics/pokemon/totodile/anim_front.png differ diff --git a/graphics/pokemon/totodile/front.png b/graphics/pokemon/totodile/front.png deleted file mode 100644 index ba9c9994b..000000000 Binary files a/graphics/pokemon/totodile/front.png and /dev/null differ diff --git a/graphics/pokemon/totodile/normal.pal b/graphics/pokemon/totodile/normal.pal index bf7ef18af..ce70fb252 100644 --- a/graphics/pokemon/totodile/normal.pal +++ b/graphics/pokemon/totodile/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 208 152 184 -32 136 184 -40 88 128 -80 192 216 -152 224 248 +49 131 197 +49 90 131 +106 180 230 +148 213 255 16 16 16 -248 248 248 -64 64 72 -176 176 176 -120 24 0 -152 80 88 -200 64 32 -232 120 120 -144 128 32 -248 224 136 +255 255 255 +49 90 131 +180 180 180 +123 24 0 +180 74 82 +205 65 32 +230 123 123 +172 131 41 +255 197 82 184 104 104 diff --git a/graphics/pokemon/totodile/shiny.pal b/graphics/pokemon/totodile/shiny.pal index 6c3f51204..3bc0bc64c 100644 --- a/graphics/pokemon/totodile/shiny.pal +++ b/graphics/pokemon/totodile/shiny.pal @@ -8,7 +8,7 @@ JASC-PAL 168 248 216 16 16 16 248 248 248 -56 56 56 +24 104 72 176 176 176 24 72 128 136 64 64 diff --git a/graphics/pokemon/toxicroak/front.png b/graphics/pokemon/toxicroak/front.png deleted file mode 100644 index 27acc59b7..000000000 Binary files a/graphics/pokemon/toxicroak/front.png and /dev/null differ diff --git a/graphics/pokemon/tranquill/front.png b/graphics/pokemon/tranquill/front.png deleted file mode 100644 index 2294a1f13..000000000 Binary files a/graphics/pokemon/tranquill/front.png and /dev/null differ diff --git a/graphics/pokemon/trapinch/front.png b/graphics/pokemon/trapinch/front.png deleted file mode 100644 index a74591721..000000000 Binary files a/graphics/pokemon/trapinch/front.png and /dev/null differ diff --git a/graphics/pokemon/treecko/front.png b/graphics/pokemon/treecko/front.png deleted file mode 100644 index 6869c279b..000000000 Binary files a/graphics/pokemon/treecko/front.png and /dev/null differ diff --git a/graphics/pokemon/trevenant/front.png b/graphics/pokemon/trevenant/front.png deleted file mode 100644 index 5dae0e09a..000000000 Binary files a/graphics/pokemon/trevenant/front.png and /dev/null differ diff --git a/graphics/pokemon/tropius/front.png b/graphics/pokemon/tropius/front.png deleted file mode 100644 index 4bece6d40..000000000 Binary files a/graphics/pokemon/tropius/front.png and /dev/null differ diff --git a/graphics/pokemon/trubbish/front.png b/graphics/pokemon/trubbish/front.png deleted file mode 100644 index 75fb61a26..000000000 Binary files a/graphics/pokemon/trubbish/front.png and /dev/null differ diff --git a/graphics/pokemon/turtwig/front.png b/graphics/pokemon/turtwig/front.png deleted file mode 100644 index 59d3efa89..000000000 Binary files a/graphics/pokemon/turtwig/front.png and /dev/null differ diff --git a/graphics/pokemon/tympole/front.png b/graphics/pokemon/tympole/front.png deleted file mode 100644 index d1b5dfd48..000000000 Binary files a/graphics/pokemon/tympole/front.png and /dev/null differ diff --git a/graphics/pokemon/tynamo/front.png b/graphics/pokemon/tynamo/front.png deleted file mode 100644 index 47d48757e..000000000 Binary files a/graphics/pokemon/tynamo/front.png and /dev/null differ diff --git a/graphics/pokemon/typhlosion/anim_front.png b/graphics/pokemon/typhlosion/anim_front.png index a4f46ae24..bc4b7c45c 100644 Binary files a/graphics/pokemon/typhlosion/anim_front.png and b/graphics/pokemon/typhlosion/anim_front.png differ diff --git a/graphics/pokemon/typhlosion/back.png b/graphics/pokemon/typhlosion/back.png index 3252c26e9..81bcbd42b 100644 Binary files a/graphics/pokemon/typhlosion/back.png and b/graphics/pokemon/typhlosion/back.png differ diff --git a/graphics/pokemon/typhlosion/front.png b/graphics/pokemon/typhlosion/front.png deleted file mode 100644 index 79830374f..000000000 Binary files a/graphics/pokemon/typhlosion/front.png and /dev/null differ diff --git a/graphics/pokemon/typhlosion/normal.pal b/graphics/pokemon/typhlosion/normal.pal index 8315b8af8..b0b35155f 100644 --- a/graphics/pokemon/typhlosion/normal.pal +++ b/graphics/pokemon/typhlosion/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -216 0 0 -248 96 0 -248 216 0 -248 152 0 -40 88 120 -24 40 48 -56 128 136 -160 136 72 -248 232 144 -104 80 40 +222 0 0 +255 98 0 +255 222 0 +255 156 0 +65 90 148 +8 32 90 +65 131 164 +164 139 74 +255 238 148 +106 82 41 16 16 16 -248 248 248 -208 192 112 -128 72 72 -48 64 112 +255 255 255 +213 197 115 +0 0 0 +32 65 106 diff --git a/graphics/pokemon/tyranitar/front.png b/graphics/pokemon/tyranitar/front.png deleted file mode 100644 index 2032b956a..000000000 Binary files a/graphics/pokemon/tyranitar/front.png and /dev/null differ diff --git a/graphics/pokemon/tyrantrum/front.png b/graphics/pokemon/tyrantrum/front.png deleted file mode 100644 index 3aa035a52..000000000 Binary files a/graphics/pokemon/tyrantrum/front.png and /dev/null differ diff --git a/graphics/pokemon/tyrogue/front.png b/graphics/pokemon/tyrogue/front.png deleted file mode 100644 index 0fcc422d5..000000000 Binary files a/graphics/pokemon/tyrogue/front.png and /dev/null differ diff --git a/graphics/pokemon/tyrunt/front.png b/graphics/pokemon/tyrunt/front.png deleted file mode 100644 index fc2d2aa53..000000000 Binary files a/graphics/pokemon/tyrunt/front.png and /dev/null differ diff --git a/graphics/pokemon/umbreon/front.png b/graphics/pokemon/umbreon/front.png deleted file mode 100644 index 82a649940..000000000 Binary files a/graphics/pokemon/umbreon/front.png and /dev/null differ diff --git a/graphics/pokemon/unfezant/backf.png b/graphics/pokemon/unfezant/backf.png index cded84b12..f9624417f 100644 Binary files a/graphics/pokemon/unfezant/backf.png and b/graphics/pokemon/unfezant/backf.png differ diff --git a/graphics/pokemon/unfezant/front.png b/graphics/pokemon/unfezant/front.png deleted file mode 100644 index cea0bc3ab..000000000 Binary files a/graphics/pokemon/unfezant/front.png and /dev/null differ diff --git a/graphics/pokemon/unfezant/icon.png b/graphics/pokemon/unfezant/icon.png index 8b61d1bfb..785bd89a9 100644 Binary files a/graphics/pokemon/unfezant/icon.png and b/graphics/pokemon/unfezant/icon.png differ diff --git a/graphics/pokemon/unown/b/front.png b/graphics/pokemon/unown/b/front.png deleted file mode 100644 index fbe2e4623..000000000 Binary files a/graphics/pokemon/unown/b/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/c/front.png b/graphics/pokemon/unown/c/front.png deleted file mode 100644 index c5ef1c457..000000000 Binary files a/graphics/pokemon/unown/c/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/d/front.png b/graphics/pokemon/unown/d/front.png deleted file mode 100644 index c39b26120..000000000 Binary files a/graphics/pokemon/unown/d/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/e/front.png b/graphics/pokemon/unown/e/front.png deleted file mode 100644 index 81e3f9c93..000000000 Binary files a/graphics/pokemon/unown/e/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/exclamation_mark/front.png b/graphics/pokemon/unown/exclamation_mark/front.png deleted file mode 100644 index 86f329f92..000000000 Binary files a/graphics/pokemon/unown/exclamation_mark/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/f/front.png b/graphics/pokemon/unown/f/front.png deleted file mode 100644 index 8e61eb768..000000000 Binary files a/graphics/pokemon/unown/f/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/front.png b/graphics/pokemon/unown/front.png deleted file mode 100644 index 697de36dc..000000000 Binary files a/graphics/pokemon/unown/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/g/front.png b/graphics/pokemon/unown/g/front.png deleted file mode 100644 index 4f665124a..000000000 Binary files a/graphics/pokemon/unown/g/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/h/front.png b/graphics/pokemon/unown/h/front.png deleted file mode 100644 index f8ab66963..000000000 Binary files a/graphics/pokemon/unown/h/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/i/front.png b/graphics/pokemon/unown/i/front.png deleted file mode 100644 index ebc8a51a9..000000000 Binary files a/graphics/pokemon/unown/i/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/j/front.png b/graphics/pokemon/unown/j/front.png deleted file mode 100644 index 4c1f4ed2e..000000000 Binary files a/graphics/pokemon/unown/j/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/k/front.png b/graphics/pokemon/unown/k/front.png deleted file mode 100644 index 8ccce125e..000000000 Binary files a/graphics/pokemon/unown/k/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/l/front.png b/graphics/pokemon/unown/l/front.png deleted file mode 100644 index 6bb837167..000000000 Binary files a/graphics/pokemon/unown/l/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/m/front.png b/graphics/pokemon/unown/m/front.png deleted file mode 100644 index 981c7f801..000000000 Binary files a/graphics/pokemon/unown/m/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/n/front.png b/graphics/pokemon/unown/n/front.png deleted file mode 100644 index cff797db4..000000000 Binary files a/graphics/pokemon/unown/n/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/o/front.png b/graphics/pokemon/unown/o/front.png deleted file mode 100644 index 8b8e81295..000000000 Binary files a/graphics/pokemon/unown/o/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/p/front.png b/graphics/pokemon/unown/p/front.png deleted file mode 100644 index 99a7c98e2..000000000 Binary files a/graphics/pokemon/unown/p/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/q/front.png b/graphics/pokemon/unown/q/front.png deleted file mode 100644 index fe94c27fa..000000000 Binary files a/graphics/pokemon/unown/q/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/question_mark/front.png b/graphics/pokemon/unown/question_mark/front.png deleted file mode 100644 index ee0ad284c..000000000 Binary files a/graphics/pokemon/unown/question_mark/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/r/front.png b/graphics/pokemon/unown/r/front.png deleted file mode 100644 index 4e2a40007..000000000 Binary files a/graphics/pokemon/unown/r/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/s/front.png b/graphics/pokemon/unown/s/front.png deleted file mode 100644 index a144e27f5..000000000 Binary files a/graphics/pokemon/unown/s/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/t/front.png b/graphics/pokemon/unown/t/front.png deleted file mode 100644 index 4d5fa8b98..000000000 Binary files a/graphics/pokemon/unown/t/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/u/front.png b/graphics/pokemon/unown/u/front.png deleted file mode 100644 index 39503f01c..000000000 Binary files a/graphics/pokemon/unown/u/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/v/front.png b/graphics/pokemon/unown/v/front.png deleted file mode 100644 index f014289bd..000000000 Binary files a/graphics/pokemon/unown/v/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/w/front.png b/graphics/pokemon/unown/w/front.png deleted file mode 100644 index 829804ebf..000000000 Binary files a/graphics/pokemon/unown/w/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/x/front.png b/graphics/pokemon/unown/x/front.png deleted file mode 100644 index 053e2ee08..000000000 Binary files a/graphics/pokemon/unown/x/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/y/front.png b/graphics/pokemon/unown/y/front.png deleted file mode 100644 index d8f40e27e..000000000 Binary files a/graphics/pokemon/unown/y/front.png and /dev/null differ diff --git a/graphics/pokemon/unown/z/front.png b/graphics/pokemon/unown/z/front.png deleted file mode 100644 index 054eacb6d..000000000 Binary files a/graphics/pokemon/unown/z/front.png and /dev/null differ diff --git a/graphics/pokemon/ursaring/front.png b/graphics/pokemon/ursaring/front.png deleted file mode 100644 index 0229df204..000000000 Binary files a/graphics/pokemon/ursaring/front.png and /dev/null differ diff --git a/graphics/pokemon/uxie/front.png b/graphics/pokemon/uxie/front.png deleted file mode 100644 index 3d923f443..000000000 Binary files a/graphics/pokemon/uxie/front.png and /dev/null differ diff --git a/graphics/pokemon/vanillish/front.png b/graphics/pokemon/vanillish/front.png deleted file mode 100644 index eb3237a5c..000000000 Binary files a/graphics/pokemon/vanillish/front.png and /dev/null differ diff --git a/graphics/pokemon/vanillite/front.png b/graphics/pokemon/vanillite/front.png deleted file mode 100644 index dfcfb42c7..000000000 Binary files a/graphics/pokemon/vanillite/front.png and /dev/null differ diff --git a/graphics/pokemon/vanilluxe/front.png b/graphics/pokemon/vanilluxe/front.png deleted file mode 100644 index 168c54b67..000000000 Binary files a/graphics/pokemon/vanilluxe/front.png and /dev/null differ diff --git a/graphics/pokemon/vaporeon/anim_front.png b/graphics/pokemon/vaporeon/anim_front.png index 3d7011269..de15a8c7c 100644 Binary files a/graphics/pokemon/vaporeon/anim_front.png and b/graphics/pokemon/vaporeon/anim_front.png differ diff --git a/graphics/pokemon/vaporeon/front.png b/graphics/pokemon/vaporeon/front.png deleted file mode 100644 index e0e276556..000000000 Binary files a/graphics/pokemon/vaporeon/front.png and /dev/null differ diff --git a/graphics/pokemon/vaporeon/normal.pal b/graphics/pokemon/vaporeon/normal.pal index 3655a6b0d..90de2a96c 100644 --- a/graphics/pokemon/vaporeon/normal.pal +++ b/graphics/pokemon/vaporeon/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -16 72 96 -16 112 144 -184 168 88 -104 96 32 -136 136 136 +16 74 98 +16 115 148 +189 172 90 +106 98 32 +139 139 139 16 16 16 -248 248 248 -248 224 160 -200 200 200 -88 192 224 -128 216 248 -64 152 184 -80 16 112 -120 8 40 -208 80 112 +255 255 255 +255 230 164 +205 205 205 +90 197 230 +131 222 255 +65 156 189 +82 16 115 +123 8 41 +213 82 115 diff --git a/graphics/pokemon/venipede/front.png b/graphics/pokemon/venipede/front.png deleted file mode 100644 index ebabe585c..000000000 Binary files a/graphics/pokemon/venipede/front.png and /dev/null differ diff --git a/graphics/pokemon/venomoth/anim_front.png b/graphics/pokemon/venomoth/anim_front.png index c0c2cd340..834bf6fbc 100644 Binary files a/graphics/pokemon/venomoth/anim_front.png and b/graphics/pokemon/venomoth/anim_front.png differ diff --git a/graphics/pokemon/venomoth/front.png b/graphics/pokemon/venomoth/front.png deleted file mode 100644 index b4eba1b5c..000000000 Binary files a/graphics/pokemon/venomoth/front.png and /dev/null differ diff --git a/graphics/pokemon/venomoth/normal.pal b/graphics/pokemon/venomoth/normal.pal index 2e1ee16bf..92234d0a0 100644 --- a/graphics/pokemon/venomoth/normal.pal +++ b/graphics/pokemon/venomoth/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 112 88 120 -152 136 184 -240 216 248 -216 192 232 +156 139 189 +246 222 255 +213 172 222 16 16 16 -208 168 216 -96 72 112 -232 192 248 -152 136 184 +213 172 222 +98 74 115 +238 197 255 +156 139 189 248 248 248 -184 200 224 -96 80 56 -160 128 120 -192 168 136 +172 197 197 +98 82 57 +164 131 123 +197 172 139 224 224 224 diff --git a/graphics/pokemon/venonat/anim_front.png b/graphics/pokemon/venonat/anim_front.png index 201b5db4f..11187e0e1 100644 Binary files a/graphics/pokemon/venonat/anim_front.png and b/graphics/pokemon/venonat/anim_front.png differ diff --git a/graphics/pokemon/venonat/front.png b/graphics/pokemon/venonat/front.png deleted file mode 100644 index 522f87ef5..000000000 Binary files a/graphics/pokemon/venonat/front.png and /dev/null differ diff --git a/graphics/pokemon/venonat/normal.pal b/graphics/pokemon/venonat/normal.pal index 42a121e7c..237a56d26 100644 --- a/graphics/pokemon/venonat/normal.pal +++ b/graphics/pokemon/venonat/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -120 120 120 -248 248 248 -208 208 216 +123 123 123 +255 255 255 +213 213 213 16 16 16 -72 64 144 -112 112 184 -80 24 48 -176 64 88 -232 104 160 -240 144 200 -48 48 80 -112 64 40 -232 184 152 -184 144 104 +98 74 123 +139 106 164 +82 16 16 +180 65 90 +255 90 90 +255 172 180 +49 41 82 +115 65 41 +238 189 156 +189 148 106 144 136 200 diff --git a/graphics/pokemon/venusaur/front.png b/graphics/pokemon/venusaur/front.png deleted file mode 100644 index 0d21e669d..000000000 Binary files a/graphics/pokemon/venusaur/front.png and /dev/null differ diff --git a/graphics/pokemon/vespiquen/front.png b/graphics/pokemon/vespiquen/front.png deleted file mode 100644 index cc731fc7b..000000000 Binary files a/graphics/pokemon/vespiquen/front.png and /dev/null differ diff --git a/graphics/pokemon/vibrava/front.png b/graphics/pokemon/vibrava/front.png deleted file mode 100644 index d3dca4c68..000000000 Binary files a/graphics/pokemon/vibrava/front.png and /dev/null differ diff --git a/graphics/pokemon/victini/front.png b/graphics/pokemon/victini/front.png deleted file mode 100644 index 6901f6fb3..000000000 Binary files a/graphics/pokemon/victini/front.png and /dev/null differ diff --git a/graphics/pokemon/victreebel/anim_front.png b/graphics/pokemon/victreebel/anim_front.png index 119d4105c..a8ecbdb46 100644 Binary files a/graphics/pokemon/victreebel/anim_front.png and b/graphics/pokemon/victreebel/anim_front.png differ diff --git a/graphics/pokemon/victreebel/front.png b/graphics/pokemon/victreebel/front.png deleted file mode 100644 index c87545b1d..000000000 Binary files a/graphics/pokemon/victreebel/front.png and /dev/null differ diff --git a/graphics/pokemon/victreebel/normal.pal b/graphics/pokemon/victreebel/normal.pal index fe0893abb..ef9c40982 100644 --- a/graphics/pokemon/victreebel/normal.pal +++ b/graphics/pokemon/victreebel/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 0 176 232 -96 80 40 -40 96 40 -160 120 48 -16 16 16 -112 208 120 -88 160 96 -200 104 128 -232 152 168 +98 82 41 +16 98 57 +164 123 49 +0 0 0 +139 197 123 +74 164 123 +197 90 32 +238 139 82 248 248 248 200 216 208 -216 184 80 +222 189 82 144 152 32 -232 208 104 -240 232 144 -120 40 40 +238 213 106 +246 238 148 +131 24 0 diff --git a/graphics/pokemon/vigoroth/front.png b/graphics/pokemon/vigoroth/front.png deleted file mode 100644 index b3840cd1b..000000000 Binary files a/graphics/pokemon/vigoroth/front.png and /dev/null differ diff --git a/graphics/pokemon/vileplume/anim_front.png b/graphics/pokemon/vileplume/anim_front.png index f482d7130..0169b8f34 100644 Binary files a/graphics/pokemon/vileplume/anim_front.png and b/graphics/pokemon/vileplume/anim_front.png differ diff --git a/graphics/pokemon/vileplume/front.png b/graphics/pokemon/vileplume/front.png deleted file mode 100644 index 1a14c31a3..000000000 Binary files a/graphics/pokemon/vileplume/front.png and /dev/null differ diff --git a/graphics/pokemon/vileplume/normal.pal b/graphics/pokemon/vileplume/normal.pal index 817796bf8..f7f01cae2 100644 --- a/graphics/pokemon/vileplume/normal.pal +++ b/graphics/pokemon/vileplume/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -192 48 72 -152 56 64 -248 96 96 -248 200 208 -240 48 48 -240 168 176 +189 49 74 +123 24 16 +255 98 98 +255 205 213 +238 49 49 +246 172 180 16 16 16 -248 160 40 -176 96 32 +255 164 41 +180 98 32 40 40 40 -200 144 32 -24 40 64 -48 72 112 -80 112 152 +197 139 32 +24 41 74 +57 82 82 +90 98 131 40 40 40 diff --git a/graphics/pokemon/virizion/front.png b/graphics/pokemon/virizion/front.png deleted file mode 100644 index 6c1f3a36c..000000000 Binary files a/graphics/pokemon/virizion/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/archipelago/front.png b/graphics/pokemon/vivillon/archipelago/front.png deleted file mode 100644 index 7fb1becc1..000000000 Binary files a/graphics/pokemon/vivillon/archipelago/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/continental/front.png b/graphics/pokemon/vivillon/continental/front.png deleted file mode 100644 index 785e6371e..000000000 Binary files a/graphics/pokemon/vivillon/continental/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/continental/icon.png b/graphics/pokemon/vivillon/continental/icon.png index 51c770f56..e4fdf6d21 100644 Binary files a/graphics/pokemon/vivillon/continental/icon.png and b/graphics/pokemon/vivillon/continental/icon.png differ diff --git a/graphics/pokemon/vivillon/elegant/front.png b/graphics/pokemon/vivillon/elegant/front.png deleted file mode 100644 index d4e09f2a7..000000000 Binary files a/graphics/pokemon/vivillon/elegant/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/elegant/icon.png b/graphics/pokemon/vivillon/elegant/icon.png index 221935a21..f6c4772ae 100644 Binary files a/graphics/pokemon/vivillon/elegant/icon.png and b/graphics/pokemon/vivillon/elegant/icon.png differ diff --git a/graphics/pokemon/vivillon/fancy/front.png b/graphics/pokemon/vivillon/fancy/front.png deleted file mode 100644 index ad26aa479..000000000 Binary files a/graphics/pokemon/vivillon/fancy/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/fancy/icon.png b/graphics/pokemon/vivillon/fancy/icon.png index 22fe6f1a0..10d9a2e9b 100644 Binary files a/graphics/pokemon/vivillon/fancy/icon.png and b/graphics/pokemon/vivillon/fancy/icon.png differ diff --git a/graphics/pokemon/vivillon/front.png b/graphics/pokemon/vivillon/front.png deleted file mode 100644 index cd1bdfbd7..000000000 Binary files a/graphics/pokemon/vivillon/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/garden/front.png b/graphics/pokemon/vivillon/garden/front.png deleted file mode 100644 index bcdc18e85..000000000 Binary files a/graphics/pokemon/vivillon/garden/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/garden/icon.png b/graphics/pokemon/vivillon/garden/icon.png index 03032ba4d..868f8c7fe 100644 Binary files a/graphics/pokemon/vivillon/garden/icon.png and b/graphics/pokemon/vivillon/garden/icon.png differ diff --git a/graphics/pokemon/vivillon/high_plains/front.png b/graphics/pokemon/vivillon/high_plains/front.png deleted file mode 100644 index d8bae72c4..000000000 Binary files a/graphics/pokemon/vivillon/high_plains/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/jungle/front.png b/graphics/pokemon/vivillon/jungle/front.png deleted file mode 100644 index 1ab8f99ea..000000000 Binary files a/graphics/pokemon/vivillon/jungle/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/jungle/icon.png b/graphics/pokemon/vivillon/jungle/icon.png index 8d83dd429..1a3249596 100644 Binary files a/graphics/pokemon/vivillon/jungle/icon.png and b/graphics/pokemon/vivillon/jungle/icon.png differ diff --git a/graphics/pokemon/vivillon/marine/front.png b/graphics/pokemon/vivillon/marine/front.png deleted file mode 100644 index 5ec8a8c46..000000000 Binary files a/graphics/pokemon/vivillon/marine/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/marine/icon.png b/graphics/pokemon/vivillon/marine/icon.png index 045cb38dd..72ef85f21 100644 Binary files a/graphics/pokemon/vivillon/marine/icon.png and b/graphics/pokemon/vivillon/marine/icon.png differ diff --git a/graphics/pokemon/vivillon/meadow/front.png b/graphics/pokemon/vivillon/meadow/front.png deleted file mode 100644 index 698ac4233..000000000 Binary files a/graphics/pokemon/vivillon/meadow/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/modern/front.png b/graphics/pokemon/vivillon/modern/front.png deleted file mode 100644 index 2bf593a48..000000000 Binary files a/graphics/pokemon/vivillon/modern/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/modern/icon.png b/graphics/pokemon/vivillon/modern/icon.png index 239e8887a..2aa35c48e 100644 Binary files a/graphics/pokemon/vivillon/modern/icon.png and b/graphics/pokemon/vivillon/modern/icon.png differ diff --git a/graphics/pokemon/vivillon/monsoon/front.png b/graphics/pokemon/vivillon/monsoon/front.png deleted file mode 100644 index 5dc642900..000000000 Binary files a/graphics/pokemon/vivillon/monsoon/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/monsoon/icon.png b/graphics/pokemon/vivillon/monsoon/icon.png index 6430f1f1b..2eb6221ef 100644 Binary files a/graphics/pokemon/vivillon/monsoon/icon.png and b/graphics/pokemon/vivillon/monsoon/icon.png differ diff --git a/graphics/pokemon/vivillon/ocean/front.png b/graphics/pokemon/vivillon/ocean/front.png deleted file mode 100644 index fcdcf11a7..000000000 Binary files a/graphics/pokemon/vivillon/ocean/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/ocean/icon.png b/graphics/pokemon/vivillon/ocean/icon.png index bde8c0519..ac083f289 100644 Binary files a/graphics/pokemon/vivillon/ocean/icon.png and b/graphics/pokemon/vivillon/ocean/icon.png differ diff --git a/graphics/pokemon/vivillon/poke_ball/front.png b/graphics/pokemon/vivillon/poke_ball/front.png deleted file mode 100644 index c474cf54c..000000000 Binary files a/graphics/pokemon/vivillon/poke_ball/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/poke_ball/icon.png b/graphics/pokemon/vivillon/poke_ball/icon.png index 2620f928a..9305c2b8a 100644 Binary files a/graphics/pokemon/vivillon/poke_ball/icon.png and b/graphics/pokemon/vivillon/poke_ball/icon.png differ diff --git a/graphics/pokemon/vivillon/polar/front.png b/graphics/pokemon/vivillon/polar/front.png deleted file mode 100644 index 2f182203e..000000000 Binary files a/graphics/pokemon/vivillon/polar/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/polar/icon.png b/graphics/pokemon/vivillon/polar/icon.png index 4ca4400cd..dd12dbd25 100644 Binary files a/graphics/pokemon/vivillon/polar/icon.png and b/graphics/pokemon/vivillon/polar/icon.png differ diff --git a/graphics/pokemon/vivillon/river/front.png b/graphics/pokemon/vivillon/river/front.png deleted file mode 100644 index 18cf0efd2..000000000 Binary files a/graphics/pokemon/vivillon/river/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/river/icon.png b/graphics/pokemon/vivillon/river/icon.png index a7427d685..d33d8271c 100644 Binary files a/graphics/pokemon/vivillon/river/icon.png and b/graphics/pokemon/vivillon/river/icon.png differ diff --git a/graphics/pokemon/vivillon/sandstorm/front.png b/graphics/pokemon/vivillon/sandstorm/front.png deleted file mode 100644 index 7c9158050..000000000 Binary files a/graphics/pokemon/vivillon/sandstorm/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/sandstorm/icon.png b/graphics/pokemon/vivillon/sandstorm/icon.png index e90306872..e5e0b987e 100644 Binary files a/graphics/pokemon/vivillon/sandstorm/icon.png and b/graphics/pokemon/vivillon/sandstorm/icon.png differ diff --git a/graphics/pokemon/vivillon/savanna/front.png b/graphics/pokemon/vivillon/savanna/front.png deleted file mode 100644 index dab3efbec..000000000 Binary files a/graphics/pokemon/vivillon/savanna/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/savanna/icon.png b/graphics/pokemon/vivillon/savanna/icon.png index 2665f3456..37fc6570d 100644 Binary files a/graphics/pokemon/vivillon/savanna/icon.png and b/graphics/pokemon/vivillon/savanna/icon.png differ diff --git a/graphics/pokemon/vivillon/sun/front.png b/graphics/pokemon/vivillon/sun/front.png deleted file mode 100644 index 532b4a019..000000000 Binary files a/graphics/pokemon/vivillon/sun/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/sun/icon.png b/graphics/pokemon/vivillon/sun/icon.png index 7b7974210..0a8af5e68 100644 Binary files a/graphics/pokemon/vivillon/sun/icon.png and b/graphics/pokemon/vivillon/sun/icon.png differ diff --git a/graphics/pokemon/vivillon/tundra/front.png b/graphics/pokemon/vivillon/tundra/front.png deleted file mode 100644 index 36239fbe9..000000000 Binary files a/graphics/pokemon/vivillon/tundra/front.png and /dev/null differ diff --git a/graphics/pokemon/vivillon/tundra/icon.png b/graphics/pokemon/vivillon/tundra/icon.png index 8d38291d4..711ae44ee 100644 Binary files a/graphics/pokemon/vivillon/tundra/icon.png and b/graphics/pokemon/vivillon/tundra/icon.png differ diff --git a/graphics/pokemon/volbeat/front.png b/graphics/pokemon/volbeat/front.png deleted file mode 100644 index e4f17ee4d..000000000 Binary files a/graphics/pokemon/volbeat/front.png and /dev/null differ diff --git a/graphics/pokemon/volcanion/front.png b/graphics/pokemon/volcanion/front.png deleted file mode 100644 index 2a35f607d..000000000 Binary files a/graphics/pokemon/volcanion/front.png and /dev/null differ diff --git a/graphics/pokemon/volcarona/front.png b/graphics/pokemon/volcarona/front.png deleted file mode 100644 index d36a22a25..000000000 Binary files a/graphics/pokemon/volcarona/front.png and /dev/null differ diff --git a/graphics/pokemon/voltorb/anim_front.png b/graphics/pokemon/voltorb/anim_front.png index d1928a122..740cfa4f3 100644 Binary files a/graphics/pokemon/voltorb/anim_front.png and b/graphics/pokemon/voltorb/anim_front.png differ diff --git a/graphics/pokemon/voltorb/front.png b/graphics/pokemon/voltorb/front.png deleted file mode 100644 index 0bf80d9ac..000000000 Binary files a/graphics/pokemon/voltorb/front.png and /dev/null differ diff --git a/graphics/pokemon/voltorb/normal.pal b/graphics/pokemon/voltorb/normal.pal index d60934515..79af1efd7 100644 --- a/graphics/pokemon/voltorb/normal.pal +++ b/graphics/pokemon/voltorb/normal.pal @@ -3,15 +3,15 @@ JASC-PAL 16 152 208 160 16 16 16 -128 16 16 -208 32 72 -240 96 80 -240 56 80 -248 120 120 -248 168 152 -200 48 96 -216 208 208 -176 168 184 +131 16 16 +213 49 65 +255 82 32 +238 65 49 +255 131 90 +255 172 156 +213 49 65 +222 213 213 +180 172 189 248 248 248 88 80 80 136 128 128 diff --git a/graphics/pokemon/vullaby/front.png b/graphics/pokemon/vullaby/front.png deleted file mode 100644 index a24b2aafb..000000000 Binary files a/graphics/pokemon/vullaby/front.png and /dev/null differ diff --git a/graphics/pokemon/vulpix/anim_front.png b/graphics/pokemon/vulpix/anim_front.png index 2e1f7b084..0b9401e50 100644 Binary files a/graphics/pokemon/vulpix/anim_front.png and b/graphics/pokemon/vulpix/anim_front.png differ diff --git a/graphics/pokemon/vulpix/front.png b/graphics/pokemon/vulpix/front.png deleted file mode 100644 index 4de0d78f1..000000000 Binary files a/graphics/pokemon/vulpix/front.png and /dev/null differ diff --git a/graphics/pokemon/vulpix/normal.pal b/graphics/pokemon/vulpix/normal.pal index acc496df3..aefc8e87c 100644 --- a/graphics/pokemon/vulpix/normal.pal +++ b/graphics/pokemon/vulpix/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -112 32 0 -248 144 88 -216 112 40 -184 72 40 +115 32 0 +255 148 90 +222 115 41 +189 74 41 16 16 16 -112 48 0 -184 112 88 -224 144 104 -168 88 8 -200 120 40 -248 248 248 +115 49 0 +189 115 90 +230 148 106 +172 90 8 +205 123 41 +255 255 255 160 120 112 168 0 0 -240 184 120 +246 189 123 0 0 0 diff --git a/graphics/pokemon/wailmer/front.png b/graphics/pokemon/wailmer/front.png deleted file mode 100644 index 3c887adf8..000000000 Binary files a/graphics/pokemon/wailmer/front.png and /dev/null differ diff --git a/graphics/pokemon/wailord/front.png b/graphics/pokemon/wailord/front.png deleted file mode 100644 index 9f337fd82..000000000 Binary files a/graphics/pokemon/wailord/front.png and /dev/null differ diff --git a/graphics/pokemon/walrein/front.png b/graphics/pokemon/walrein/front.png deleted file mode 100644 index 7dc56050a..000000000 Binary files a/graphics/pokemon/walrein/front.png and /dev/null differ diff --git a/graphics/pokemon/wartortle/anim_front.png b/graphics/pokemon/wartortle/anim_front.png index a732c60db..3cd3f59e1 100644 Binary files a/graphics/pokemon/wartortle/anim_front.png and b/graphics/pokemon/wartortle/anim_front.png differ diff --git a/graphics/pokemon/wartortle/front.png b/graphics/pokemon/wartortle/front.png deleted file mode 100644 index 8a5639d01..000000000 Binary files a/graphics/pokemon/wartortle/front.png and /dev/null differ diff --git a/graphics/pokemon/wartortle/normal.pal b/graphics/pokemon/wartortle/normal.pal index 9c3c1d6f5..c2c7c0db7 100644 --- a/graphics/pokemon/wartortle/normal.pal +++ b/graphics/pokemon/wartortle/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 153 210 164 -136 168 248 -248 248 248 +139 172 246 +255 255 255 16 16 16 -192 200 232 -40 80 136 -96 120 200 -216 240 248 -172 200 248 -80 48 40 -144 112 88 -200 184 144 -48 64 72 -248 240 208 +189 197 230 +41 65 106 +98 123 197 +213 238 246 +172 197 255 +106 74 24 +148 98 98 +172 139 98 +49 65 74 +222 197 139 200 48 0 -152 128 72 +139 90 32 diff --git a/graphics/pokemon/watchog/front.png b/graphics/pokemon/watchog/front.png deleted file mode 100644 index 82cfc39e5..000000000 Binary files a/graphics/pokemon/watchog/front.png and /dev/null differ diff --git a/graphics/pokemon/weavile/front.png b/graphics/pokemon/weavile/front.png deleted file mode 100644 index 90ad62cb9..000000000 Binary files a/graphics/pokemon/weavile/front.png and /dev/null differ diff --git a/graphics/pokemon/weedle/anim_front.png b/graphics/pokemon/weedle/anim_front.png index 34dc029e2..da10f827f 100644 Binary files a/graphics/pokemon/weedle/anim_front.png and b/graphics/pokemon/weedle/anim_front.png differ diff --git a/graphics/pokemon/weedle/front.png b/graphics/pokemon/weedle/front.png deleted file mode 100644 index 7c0d01400..000000000 Binary files a/graphics/pokemon/weedle/front.png and /dev/null differ diff --git a/graphics/pokemon/weedle/normal.pal b/graphics/pokemon/weedle/normal.pal index a42d955fb..b1d97250e 100644 --- a/graphics/pokemon/weedle/normal.pal +++ b/graphics/pokemon/weedle/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 136 144 -248 248 248 -88 88 96 -192 192 192 -144 88 8 -232 168 64 -200 112 16 -104 56 8 -248 208 120 +139 139 148 +255 255 255 +90 90 98 +197 197 197 +148 90 8 +238 172 65 +205 115 16 +106 57 8 +255 230 123 24 24 24 -144 64 112 -232 120 184 -248 176 224 -248 216 200 +156 41 32 +222 90 82 +238 156 139 +255 222 205 0 0 0 diff --git a/graphics/pokemon/weepinbell/anim_front.png b/graphics/pokemon/weepinbell/anim_front.png index d33c4aa59..56d2b2012 100644 Binary files a/graphics/pokemon/weepinbell/anim_front.png and b/graphics/pokemon/weepinbell/anim_front.png differ diff --git a/graphics/pokemon/weepinbell/front.png b/graphics/pokemon/weepinbell/front.png deleted file mode 100644 index c381e5332..000000000 Binary files a/graphics/pokemon/weepinbell/front.png and /dev/null differ diff --git a/graphics/pokemon/weepinbell/normal.pal b/graphics/pokemon/weepinbell/normal.pal index bf05a1549..27931063f 100644 --- a/graphics/pokemon/weepinbell/normal.pal +++ b/graphics/pokemon/weepinbell/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 0 176 232 -8 88 48 -56 168 88 -152 216 128 -96 72 48 -160 120 48 -16 16 16 -248 240 168 -248 224 104 -104 192 80 -208 192 80 -120 40 40 -248 248 248 -176 64 72 -232 152 168 -200 104 128 +8 90 49 +57 172 90 +156 222 131 +98 74 49 +164 123 49 +0 0 0 +255 246 172 +255 230 106 +106 197 82 +213 197 82 +123 41 41 +255 255 255 +180 65 74 +238 156 172 +205 106 131 diff --git a/graphics/pokemon/weezing/anim_front.png b/graphics/pokemon/weezing/anim_front.png index 95a9ba30f..096b1f911 100644 Binary files a/graphics/pokemon/weezing/anim_front.png and b/graphics/pokemon/weezing/anim_front.png differ diff --git a/graphics/pokemon/weezing/front.png b/graphics/pokemon/weezing/front.png deleted file mode 100644 index 3ea4fb6dd..000000000 Binary files a/graphics/pokemon/weezing/front.png and /dev/null differ diff --git a/graphics/pokemon/weezing/normal.pal b/graphics/pokemon/weezing/normal.pal index 6ef5ecad9..715cd4c89 100644 --- a/graphics/pokemon/weezing/normal.pal +++ b/graphics/pokemon/weezing/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 0 176 232 -184 184 136 -216 216 184 -152 152 96 -128 88 136 -184 136 200 -96 48 120 -160 104 176 -208 160 216 +197 213 139 +246 238 148 +197 180 41 +131 90 139 +189 139 205 +98 49 123 +164 106 180 +213 164 222 16 16 16 -248 248 248 -184 184 184 -208 208 176 -168 160 80 -152 80 96 -208 112 128 +255 255 255 +189 189 189 +172 164 82 +172 164 82 +156 82 98 +213 115 131 diff --git a/graphics/pokemon/whimsicott/front.png b/graphics/pokemon/whimsicott/front.png deleted file mode 100644 index 013719675..000000000 Binary files a/graphics/pokemon/whimsicott/front.png and /dev/null differ diff --git a/graphics/pokemon/whirlipede/front.png b/graphics/pokemon/whirlipede/front.png deleted file mode 100644 index 624335082..000000000 Binary files a/graphics/pokemon/whirlipede/front.png and /dev/null differ diff --git a/graphics/pokemon/whiscash/back.png b/graphics/pokemon/whiscash/back.png index 8741f6e9a..07e3fb0f6 100644 Binary files a/graphics/pokemon/whiscash/back.png and b/graphics/pokemon/whiscash/back.png differ diff --git a/graphics/pokemon/whiscash/front.png b/graphics/pokemon/whiscash/front.png deleted file mode 100644 index d62e69f3c..000000000 Binary files a/graphics/pokemon/whiscash/front.png and /dev/null differ diff --git a/graphics/pokemon/whismur/front.png b/graphics/pokemon/whismur/front.png deleted file mode 100644 index 3a4c69d47..000000000 Binary files a/graphics/pokemon/whismur/front.png and /dev/null differ diff --git a/graphics/pokemon/wigglytuff/anim_front.png b/graphics/pokemon/wigglytuff/anim_front.png index 01ffab90d..232f9c38c 100644 Binary files a/graphics/pokemon/wigglytuff/anim_front.png and b/graphics/pokemon/wigglytuff/anim_front.png differ diff --git a/graphics/pokemon/wigglytuff/front.png b/graphics/pokemon/wigglytuff/front.png deleted file mode 100644 index 26ab75305..000000000 Binary files a/graphics/pokemon/wigglytuff/front.png and /dev/null differ diff --git a/graphics/pokemon/wigglytuff/normal.pal b/graphics/pokemon/wigglytuff/normal.pal index ff6efc68a..9e5a19944 100644 --- a/graphics/pokemon/wigglytuff/normal.pal +++ b/graphics/pokemon/wigglytuff/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -136 64 64 -248 248 248 -112 112 112 -224 216 224 +139 65 65 +255 255 255 +115 115 115 +230 222 230 16 16 16 -248 168 184 -240 120 144 -200 104 96 -248 216 200 -24 112 192 -16 72 136 -16 176 232 -112 64 24 -224 48 48 +255 172 189 +246 123 148 +205 106 98 +255 222 205 +82 164 139 +32 90 98 +148 222 205 +115 65 24 +230 49 49 0 0 0 diff --git a/graphics/pokemon/wingull/back.png b/graphics/pokemon/wingull/back.png index dd40dda6b..b419bf641 100644 Binary files a/graphics/pokemon/wingull/back.png and b/graphics/pokemon/wingull/back.png differ diff --git a/graphics/pokemon/wingull/front.png b/graphics/pokemon/wingull/front.png deleted file mode 100644 index dc5fe2e80..000000000 Binary files a/graphics/pokemon/wingull/front.png and /dev/null differ diff --git a/graphics/pokemon/wobbuffet/front.png b/graphics/pokemon/wobbuffet/front.png deleted file mode 100644 index a8efd17ef..000000000 Binary files a/graphics/pokemon/wobbuffet/front.png and /dev/null differ diff --git a/graphics/pokemon/woobat/front.png b/graphics/pokemon/woobat/front.png deleted file mode 100644 index 793607dc8..000000000 Binary files a/graphics/pokemon/woobat/front.png and /dev/null differ diff --git a/graphics/pokemon/wooper/front.png b/graphics/pokemon/wooper/front.png deleted file mode 100644 index ad14f25b2..000000000 Binary files a/graphics/pokemon/wooper/front.png and /dev/null differ diff --git a/graphics/pokemon/wormadam/front.png b/graphics/pokemon/wormadam/front.png deleted file mode 100644 index 575460ac0..000000000 Binary files a/graphics/pokemon/wormadam/front.png and /dev/null differ diff --git a/graphics/pokemon/wormadam/sandy_cloak/front.png b/graphics/pokemon/wormadam/sandy_cloak/front.png deleted file mode 100644 index 5d08516fd..000000000 Binary files a/graphics/pokemon/wormadam/sandy_cloak/front.png and /dev/null differ diff --git a/graphics/pokemon/wormadam/trash_cloak/front.png b/graphics/pokemon/wormadam/trash_cloak/front.png deleted file mode 100644 index a15ba6b90..000000000 Binary files a/graphics/pokemon/wormadam/trash_cloak/front.png and /dev/null differ diff --git a/graphics/pokemon/wurmple/front.png b/graphics/pokemon/wurmple/front.png deleted file mode 100644 index bad155a3d..000000000 Binary files a/graphics/pokemon/wurmple/front.png and /dev/null differ diff --git a/graphics/pokemon/wynaut/front.png b/graphics/pokemon/wynaut/front.png deleted file mode 100644 index 197d67fdf..000000000 Binary files a/graphics/pokemon/wynaut/front.png and /dev/null differ diff --git a/graphics/pokemon/xatu/anim_front.png b/graphics/pokemon/xatu/anim_front.png index b6968e775..c3d314384 100644 Binary files a/graphics/pokemon/xatu/anim_front.png and b/graphics/pokemon/xatu/anim_front.png differ diff --git a/graphics/pokemon/xatu/front.png b/graphics/pokemon/xatu/front.png deleted file mode 100644 index 93c794763..000000000 Binary files a/graphics/pokemon/xatu/front.png and /dev/null differ diff --git a/graphics/pokemon/xatu/normal.pal b/graphics/pokemon/xatu/normal.pal index eb20bf6ae..05aeca9fc 100644 --- a/graphics/pokemon/xatu/normal.pal +++ b/graphics/pokemon/xatu/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 0 176 232 -72 144 64 -144 208 64 -40 104 40 -176 136 32 -112 184 64 -248 184 48 -136 88 0 +74 148 65 +148 213 65 +41 106 41 +180 139 32 +115 189 65 +255 189 49 +139 90 0 16 16 16 -248 248 248 -144 144 144 -80 80 80 -128 40 0 -176 48 0 -200 200 200 -232 56 0 +255 255 255 +148 148 148 +82 82 82 +131 41 0 +180 49 0 +205 205 205 +238 57 0 diff --git a/graphics/pokemon/xerneas/active/front.png b/graphics/pokemon/xerneas/active/front.png deleted file mode 100644 index b291e10f4..000000000 Binary files a/graphics/pokemon/xerneas/active/front.png and /dev/null differ diff --git a/graphics/pokemon/xerneas/back.png b/graphics/pokemon/xerneas/back.png index 30654685a..5f38d48dd 100644 Binary files a/graphics/pokemon/xerneas/back.png and b/graphics/pokemon/xerneas/back.png differ diff --git a/graphics/pokemon/xerneas/front.png b/graphics/pokemon/xerneas/front.png index d219e463b..357f3b429 100644 Binary files a/graphics/pokemon/xerneas/front.png and b/graphics/pokemon/xerneas/front.png differ diff --git a/graphics/pokemon/xerneas/icon.png b/graphics/pokemon/xerneas/icon.png index f59ee416f..31036c9ee 100644 Binary files a/graphics/pokemon/xerneas/icon.png and b/graphics/pokemon/xerneas/icon.png differ diff --git a/graphics/pokemon/yamask/front.png b/graphics/pokemon/yamask/front.png deleted file mode 100644 index 28a564b55..000000000 Binary files a/graphics/pokemon/yamask/front.png and /dev/null differ diff --git a/graphics/pokemon/yanma/front.png b/graphics/pokemon/yanma/front.png deleted file mode 100644 index 54d4f54cd..000000000 Binary files a/graphics/pokemon/yanma/front.png and /dev/null differ diff --git a/graphics/pokemon/yanmega/front.png b/graphics/pokemon/yanmega/front.png deleted file mode 100644 index 943aa095a..000000000 Binary files a/graphics/pokemon/yanmega/front.png and /dev/null differ diff --git a/graphics/pokemon/yveltal/front.png b/graphics/pokemon/yveltal/front.png deleted file mode 100644 index 7a259c513..000000000 Binary files a/graphics/pokemon/yveltal/front.png and /dev/null differ diff --git a/graphics/pokemon/zangoose/front.png b/graphics/pokemon/zangoose/front.png deleted file mode 100644 index d9640b842..000000000 Binary files a/graphics/pokemon/zangoose/front.png and /dev/null differ diff --git a/graphics/pokemon/zapdos/anim_front.png b/graphics/pokemon/zapdos/anim_front.png index 1c0c87904..f1079f7b7 100644 Binary files a/graphics/pokemon/zapdos/anim_front.png and b/graphics/pokemon/zapdos/anim_front.png differ diff --git a/graphics/pokemon/zapdos/back.png b/graphics/pokemon/zapdos/back.png index 00b3410dd..0b7cc3c7b 100644 Binary files a/graphics/pokemon/zapdos/back.png and b/graphics/pokemon/zapdos/back.png differ diff --git a/graphics/pokemon/zapdos/front.png b/graphics/pokemon/zapdos/front.png deleted file mode 100644 index c88ae03a3..000000000 Binary files a/graphics/pokemon/zapdos/front.png and /dev/null differ diff --git a/graphics/pokemon/zapdos/normal.pal b/graphics/pokemon/zapdos/normal.pal index 5551ab973..7f2ac1295 100644 --- a/graphics/pokemon/zapdos/normal.pal +++ b/graphics/pokemon/zapdos/normal.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -152 120 16 -248 224 168 -72 48 16 -0 32 56 -208 168 8 +156 123 16 +255 230 164 +82 57 16 +0 0 0 +213 172 8 8 16 16 -248 208 64 +255 213 65 248 248 248 -248 184 104 -240 144 24 -192 104 24 +255 189 106 +246 148 24 +197 106 24 152 136 48 -216 216 216 +222 222 222 104 104 104 163 48 48 diff --git a/graphics/pokemon/zebstrika/front.png b/graphics/pokemon/zebstrika/front.png deleted file mode 100644 index 8d0970282..000000000 Binary files a/graphics/pokemon/zebstrika/front.png and /dev/null differ diff --git a/graphics/pokemon/zekrom/front.png b/graphics/pokemon/zekrom/front.png deleted file mode 100644 index 265903400..000000000 Binary files a/graphics/pokemon/zekrom/front.png and /dev/null differ diff --git a/graphics/pokemon/zigzagoon/front.png b/graphics/pokemon/zigzagoon/front.png deleted file mode 100644 index da1a3a6ad..000000000 Binary files a/graphics/pokemon/zigzagoon/front.png and /dev/null differ diff --git a/graphics/pokemon/zoroark/front.png b/graphics/pokemon/zoroark/front.png deleted file mode 100644 index 365e9ca96..000000000 Binary files a/graphics/pokemon/zoroark/front.png and /dev/null differ diff --git a/graphics/pokemon/zorua/front.png b/graphics/pokemon/zorua/front.png deleted file mode 100644 index 58f3f3a7c..000000000 Binary files a/graphics/pokemon/zorua/front.png and /dev/null differ diff --git a/graphics/pokemon/zubat/anim_front.png b/graphics/pokemon/zubat/anim_front.png index b6b809271..6cdc6af98 100644 Binary files a/graphics/pokemon/zubat/anim_front.png and b/graphics/pokemon/zubat/anim_front.png differ diff --git a/graphics/pokemon/zubat/front.png b/graphics/pokemon/zubat/front.png deleted file mode 100644 index 83ba7c583..000000000 Binary files a/graphics/pokemon/zubat/front.png and /dev/null differ diff --git a/graphics/pokemon/zubat/normal.pal b/graphics/pokemon/zubat/normal.pal index f21f16cf5..13f001cc1 100644 --- a/graphics/pokemon/zubat/normal.pal +++ b/graphics/pokemon/zubat/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 16 16 16 -96 120 176 -184 200 248 -136 176 232 -72 64 120 -96 120 176 -176 80 152 -112 32 88 -208 112 184 -248 248 248 +99 123 181 +189 206 255 +140 181 239 +74 66 123 +99 123 181 +181 82 156 +115 33 90 +214 115 189 +255 255 255 208 208 208 -96 96 96 +99 99 99 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/zweilous/front.png b/graphics/pokemon/zweilous/front.png deleted file mode 100644 index d6e4b809d..000000000 Binary files a/graphics/pokemon/zweilous/front.png and /dev/null differ diff --git a/graphics/pokemon/zygarde/10_percent/front.png b/graphics/pokemon/zygarde/10_percent/front.png deleted file mode 100644 index f475e6cff..000000000 Binary files a/graphics/pokemon/zygarde/10_percent/front.png and /dev/null differ diff --git a/graphics/pokemon/zygarde/10_percent/icon.png b/graphics/pokemon/zygarde/10_percent/icon.png index 3d968a6b6..222eb1b80 100644 Binary files a/graphics/pokemon/zygarde/10_percent/icon.png and b/graphics/pokemon/zygarde/10_percent/icon.png differ diff --git a/graphics/pokemon/zygarde/complete/front.png b/graphics/pokemon/zygarde/complete/front.png deleted file mode 100644 index 891af9222..000000000 Binary files a/graphics/pokemon/zygarde/complete/front.png and /dev/null differ diff --git a/graphics/pokemon/zygarde/complete/icon.png b/graphics/pokemon/zygarde/complete/icon.png index 8575e8d58..663b98fd7 100644 Binary files a/graphics/pokemon/zygarde/complete/icon.png and b/graphics/pokemon/zygarde/complete/icon.png differ diff --git a/graphics/pokemon/zygarde/front.png b/graphics/pokemon/zygarde/front.png deleted file mode 100644 index 5f63fc2d8..000000000 Binary files a/graphics/pokemon/zygarde/front.png and /dev/null differ diff --git a/include/battle.h b/include/battle.h index 110c252bc..1ae49b1a2 100644 --- a/include/battle.h +++ b/include/battle.h @@ -70,20 +70,15 @@ struct DisableStruct s8 stockpileBeforeDef; s8 stockpileBeforeSpDef; u8 substituteHP; - u8 disableTimer:4; - u8 disableTimerStartValue:4; u8 encoredMovePos; + u8 disableTimer:4; u8 encoreTimer:4; - u8 encoreTimerStartValue:4; u8 perishSongTimer:4; - u8 perishSongTimerStartValue:4; u8 furyCutterCounter; u8 rolloutTimer:4; u8 rolloutTimerStartValue:4; u8 chargeTimer:4; - u8 chargeTimerStartValue:4; u8 tauntTimer:4; - u8 tauntTimer2:4; u8 battlerPreventingEscape; u8 battlerWithSureHit; u8 isFirstTurn; @@ -99,8 +94,8 @@ struct DisableStruct u8 healBlockTimer; u8 laserFocusTimer; u8 throatChopTimer; - u8 usedMoves:4; u8 wrapTurns; + u8 usedMoves:4; u8 noRetreat:1; u8 tarShot:1; u8 octolock:1; @@ -148,6 +143,7 @@ struct ProtectStruct u16 quickDraw:1; u16 beakBlastCharge:1; u16 quash:1; + u16 shellTrap:1; u16 silkTrapped:1; u32 physicalDmg; u32 specialDmg; @@ -196,6 +192,7 @@ struct SpecialStatus u8 weatherAbilityDone:1; u8 terrainAbilityDone:1; u8 emergencyExited:1; + u8 afterYou:1; }; struct SideTimer @@ -255,6 +252,7 @@ struct AI_SavedBattleMon u16 moves[MAX_MON_MOVES]; u16 heldItem; u16 species; + u8 types[3]; }; struct AiPartyMon @@ -648,6 +646,8 @@ struct BattleStruct struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member) u8 blunderPolicy:1; // should blunder policy activate u8 swapDamageCategory:1; // Photon Geyser, Shell Side Arm, Light That Burns the Sky + u8 forcedSwitch:4; // For each battler + u8 switchInAbilityPostponed:4; // To not activate against an empty field, each bit for battler u8 ballSpriteIds[2]; // item gfx, window gfx u8 stickyWebUser; u8 appearedInBattle; // Bitfield to track which Pokemon appeared in battle. Used for Burmy's form change @@ -655,9 +655,13 @@ struct BattleStruct // When using a move which hits multiple opponents which is then bounced by a target, we need to make sure, the move hits both opponents, the one with bounce, and the one without. u8 attackerBeforeBounce:2; u8 beatUpSlot:3; + bool8 hitSwitchTargetFailed:1; u8 targetsDone[MAX_BATTLERS_COUNT]; // Each battler as a bit. u16 overwrittenAbilities[MAX_BATTLERS_COUNT]; // abilities overwritten during battle (keep separate from battle history in case of switching) bool8 allowedToChangeFormInWeather[PARTY_SIZE][2]; // For each party member and side, used by Ice Face. + u8 battleBondTransformed[NUM_BATTLE_SIDES]; // Bitfield for each party. + u8 storedHealingWish:4; // Each battler as a bit. + u8 storedLunarDance:4; // Each battler as a bit. }; #define F_DYNAMIC_TYPE_1 (1 << 6) diff --git a/include/battle_anim.h b/include/battle_anim.h index c4b29d26e..a3677bd98 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -160,7 +160,7 @@ void AnimThrowProjectile(struct Sprite *sprite); void GetBgDataForTransform(struct BattleAnimBgData *dest, u8 battlerId); u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId); void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite); -void TradeMenuBouncePartySprites(struct Sprite *sprite); +void Trade_MoveSelectedMonToTarget(struct Sprite *sprite); void DestroyAnimVisualTaskAndDisableBlend(u8 taskId); void DestroySpriteAndFreeResources_(struct Sprite *sprite); void SetBattlerSpriteYOffsetFromOtherYScale(u8 spriteId, u8 otherSpriteId); diff --git a/include/battle_message.h b/include/battle_message.h index 9f6905abd..19f8bc4ca 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -237,7 +237,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst); void BattlePutTextOnWindow(const u8 *text, u8 windowId); void SetPpNumbersPaletteInMoveSelection(void); u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp); -bool32 ShouldDoTrainerSlide(u32 battlerId, u32 trainerId, u32 which); +u32 ShouldDoTrainerSlide(u32 battlerId, u32 which); // return 1 for TrainerA, 2 forTrainerB void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst); extern struct BattleMsgData *gBattleMsgDataPtr; diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index 60fd9b156..c3d6831e9 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -44,6 +44,7 @@ u16 GetSecretPowerMoveEffect(void); void StealTargetItem(u8 battlerStealer, u8 battlerItem); u8 GetCatchingBattler(void); u32 GetHighestStatId(u32 battlerId); +bool32 DoSwitchInAbilitiesItems(u32 battlerId); extern void (* const gBattleScriptingCommandsTable[])(void); extern const u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4]; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 94baab173..c4b15d9f1 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -256,7 +256,6 @@ extern const u8 BattleScript_SturdiedMsg[]; extern const u8 BattleScript_GravityEnds[]; extern const u8 BattleScript_MoveStatDrain[]; extern const u8 BattleScript_MoveStatDrain_PPLoss[]; -extern const u8 BattleScript_TargetAbilityStatRaiseOnMoveEnd[]; extern const u8 BattleScript_TargetsStatWasMaxedOut[]; extern const u8 BattleScript_AttackerAbilityStatRaise[]; extern const u8 BattleScript_AttackerAbilityStatRaiseEnd3[]; @@ -293,12 +292,13 @@ extern const u8 BattleScript_WishMegaEvolution[]; extern const u8 BattleScript_MoveEffectRecoilWithStatus[]; extern const u8 BattleScript_EffectWithChance[]; extern const u8 BattleScript_MoveEffectClearSmog[]; -extern const u8 BattleScript_ForceRandomSwitch[]; extern const u8 BattleScript_SideStatusWoreOffReturn[]; extern const u8 BattleScript_MoveEffectSmackDown[]; extern const u8 BattleScript_MoveEffectFlameBurst[]; -extern const u8 BattleScript_TrainerSlideMsgRet[]; -extern const u8 BattleScript_TrainerSlideMsgEnd2[]; +extern const u8 BattleScript_TrainerASlideMsgRet[]; +extern const u8 BattleScript_TrainerASlideMsgEnd2[]; +extern const u8 BattleScript_TrainerBSlideMsgRet[]; +extern const u8 BattleScript_TrainerBSlideMsgEnd2[]; extern const u8 BattleScript_MoveEffectFeint[]; extern const u8 BattleScript_ProteanActivates[]; extern const u8 BattleScript_DazzlingProtected[]; @@ -451,6 +451,11 @@ extern const u8 BattleScript_EarthEaterActivates[]; extern const u8 BattleScript_MimicryActivates_End3[]; extern const u8 BattleScript_IceFaceNullsDamage[]; extern const u8 BattleScript_BattlerFormChangeWithStringEnd3[]; +extern const u8 BattleScript_DampPreventsAftermath[]; +extern const u8 BattleScript_HealingWishActivates[]; +extern const u8 BattleScript_LunarDanceActivates[]; +extern const u8 BattleScript_ShellTrapSetUp[]; +extern const u8 BattleScript_CouldntFullyProtect[]; extern const u8 BattleScript_StealthRockActivates[]; extern const u8 BattleScript_SpikesActivate[]; diff --git a/include/battle_util.h b/include/battle_util.h index 1c3f486cd..0661081e4 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -64,6 +64,35 @@ struct TypePower u16 effect; }; +enum +{ + CANCELLER_FLAGS, + CANCELLER_SKY_DROP, + CANCELLER_ASLEEP, + CANCELLER_FROZEN, + CANCELLER_TRUANT, + CANCELLER_RECHARGE, + CANCELLER_FLINCH, + CANCELLER_DISABLED, + CANCELLER_GRAVITY, + CANCELLER_HEAL_BLOCKED, + CANCELLER_TAUNTED, + CANCELLER_IMPRISONED, + CANCELLER_CONFUSED, + CANCELLER_PARALYSED, + CANCELLER_IN_LOVE, + CANCELLER_BIDE, + CANCELLER_THAW, + CANCELLER_POWDER_MOVE, + CANCELLER_POWDER_STATUS, + CANCELLER_THROAT_CHOP, + CANCELLER_MULTIHIT_MOVES, + CANCELLER_Z_MOVES, + CANCELLER_END, + CANCELLER_PSYCHIC_TERRAIN, + CANCELLER_END2, +}; + extern const struct TypePower gNaturalGiftTable[]; void HandleAction_ThrowBall(void); @@ -152,6 +181,7 @@ void UndoMegaEvolution(u32 monId); void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut); bool32 DoBattlersShareType(u32 battler1, u32 battler2); bool32 CanBattlerGetOrLoseItem(u8 battlerId, u16 itemId); +u32 GetIllusionMonSpecies(u32 battlerId); struct Pokemon *GetIllusionMonPtr(u32 battlerId); void ClearIllusionMon(u32 battlerId); bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId); diff --git a/include/config.h b/include/config.h index 3a2461717..2ad84f29c 100644 --- a/include/config.h +++ b/include/config.h @@ -73,4 +73,7 @@ #define GEN_9 6 #define GEN_LATEST GEN_8 +// General settings +#define EXPANSION_INTRO TRUE // If TRUE, a custom RHH intro will play after the vanilla copyright screen. + #endif // GUARD_CONFIG_H diff --git a/include/config/battle.h b/include/config/battle.h index 6dea72b40..a8f4a3e8b 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -95,6 +95,8 @@ #define B_BEAT_UP GEN_LATEST // In Gen5+, Beat Up uses a different formula to calculate its damage, and deals Dark-type damage. Prior to Gen 5, each hit also announces the party member's name. #define B_DARK_VOID_FAIL GEN_LATEST // In Gen7+, only Darkrai can use Dark Void. #define B_BURN_HIT_THAW GEN_LATEST // In Gen6+, damaging moves with a chance of burn will thaw the target, regardless if they're fire-type moves or not. +#define B_HEALING_WISH_SWITCH GEN_LATEST // In Gen5+, the mon receiving Healing Wish is sent out at the end of the turn. + // Additionally, in gen8+ the Healing Wish's effect will be stored until the user switches into a statused or hurt mon. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/include/config/pokemon.h b/include/config/pokemon.h index 4cb2271d5..ce5faf2a6 100644 --- a/include/config/pokemon.h +++ b/include/config/pokemon.h @@ -13,11 +13,14 @@ #define P_EGG_HATCH_LEVEL GEN_LATEST // Since Gen 4, Pokémon will hatch from eggs at level 1 instead of 5. #define P_BALL_INHERITING GEN_LATEST // Since Gen 6, Eggs from the Daycare will inherit the Poké Ball from their mother. From Gen7 onwards, the father can pass it down as well, as long as it's of the same species as the mother. -// Other settings +// Species-specific settings #define P_SHEDINJA_BALL GEN_LATEST // Since Gen 4, Shedinja requires a Poké Ball for its evolution. In Gen 3, Shedinja inherits Nincada's Ball. -#define P_LEGENDARY_PERFECT_IVS GEN_LATEST // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs. #define P_KADABRA_EVERSTONE GEN_LATEST // Since Gen 4, Kadabra can evolve even when holding an Everstone. #define P_HIPPO_GENDER_DIFF_ICONS TRUE // If TRUE, will give Hippopotas and Hippowdon custom icons for their female forms. +#define P_SHUCKLE_BERRY_JUICE TRUE // In Gen 2, Shuckle had a 1/16 chance of converting Berry that it's holding into Berry Juice. Setting this to TRUE will allow to do this with an Oran Berry, which is the spiritual succesor of the Berry item. + +// Other settings +#define P_LEGENDARY_PERFECT_IVS GEN_LATEST // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs. // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. diff --git a/include/constants/battle.h b/include/constants/battle.h index e7e65951b..01e98ca7a 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -371,11 +371,12 @@ #define MOVE_EFFECT_RELIC_SONG 69 #define MOVE_EFFECT_TRAP_BOTH 70 #define MOVE_EFFECT_DOUBLE_SHOCK 71 -#define MOVE_EFFECT_DIRE_CLAW 72 -#define MOVE_EFFECT_STEALTH_ROCK 73 -#define MOVE_EFFECT_SPIKES 74 +#define MOVE_EFFECT_ROUND 72 +#define MOVE_EFFECT_DIRE_CLAW 73 +#define MOVE_EFFECT_STEALTH_ROCK 74 +#define MOVE_EFFECT_SPIKES 75 -#define NUM_MOVE_EFFECTS 75 +#define NUM_MOVE_EFFECTS 76 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index a3acd69fc..0adee76c9 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -397,11 +397,13 @@ #define EFFECT_SPECIAL_ATTACK_UP_HIT 391 #define EFFECT_VICTORY_DANCE 392 #define EFFECT_TEATIME 393 -#define EFFECT_CEASELESS_EDGE 394 -#define EFFECT_DIRE_CLAW 395 -#define EFFECT_STONE_AXE 396 -#define EFFECT_BARB_BARRAGE 397 +#define EFFECT_ATTACK_UP_USER_ALLY 394 // Howl 8th Gen +#define EFFECT_SHELL_TRAP 395 +#define EFFECT_CEASELESS_EDGE 396 +#define EFFECT_DIRE_CLAW 397 +#define EFFECT_STONE_AXE 398 +#define EFFECT_BARB_BARRAGE 399 -#define NUM_BATTLE_MOVE_EFFECTS 398 +#define NUM_BATTLE_MOVE_EFFECTS 400 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_pyramid.h b/include/constants/battle_pyramid.h index 297f3b1ff..ac80a2d7d 100644 --- a/include/constants/battle_pyramid.h +++ b/include/constants/battle_pyramid.h @@ -1,7 +1,7 @@ #ifndef GUARD_CONSTANTS_BATTLE_PYRAMID_H #define GUARD_CONSTANTS_BATTLE_PYRAMID_H -#define TOTAL_ROUNDS 20 +#define TOTAL_PYRAMID_ROUNDS 20 #define PICKUP_ITEMS_PER_ROUND 10 #define HINT_EXIT_DIRECTION 0 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 123fb5d49..26064bcfb 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -74,6 +74,7 @@ #define BS_PLAYER2 13 // for Cmd_updatestatusicon #define BS_OPPONENT2 14 #define BS_ABILITY_BATTLER 15 +#define BS_ATTACKER_PARTNER 16 // Cmd_accuracycheck #define NO_ACC_CALC_CHECK_LOCK_ON 0xFFFF @@ -254,8 +255,10 @@ #define VARIOUS_TRY_WIND_RIDER_POWER 163 #define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 164 #define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 165 -#define VARIOUS_JUMP_IF_NO_VALID_TARGETS 166 -#define VARIOUS_JUMP_IF_EMERGENCY_EXITED 167 +#define VARIOUS_JUMP_IF_EMERGENCY_EXITED 166 +#define VARIOUS_STORE_HEALING_WISH 167 +#define VARIOUS_HIT_SWITCH_TARGET_FAILED 168 +#define VARIOUS_JUMP_IF_SHELL_TRAP 169 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 @@ -273,6 +276,7 @@ // Cmd_statbuffchange #define STAT_CHANGE_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange +#define STAT_CHANGE_MIRROR_ARMOR (1 << 1) // Stat change redirection caused by Mirror Armor ability. #define STAT_CHANGE_NOT_PROTECT_AFFECTED (1 << 5) #define STAT_CHANGE_UPDATE_MOVE_EFFECT (1 << 6) diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f63aa79bc..f3e702ec4 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -638,8 +638,12 @@ #define STRINGID_ELECTRICTERRAINACTIVATEDABILITY 636 #define STRINGID_ABILITYWEAKENEDFSURROUNDINGMONSSTAT 637 #define STRINGID_ATTACKERGAINEDSTRENGTHFROMTHEFALLEN 638 +#define STRINGID_PKMNSABILITYPREVENTSABILITY 639 +#define STRINGID_PREPARESHELLTRAP 640 +#define STRINGID_SHELLTRAPDIDNTWORK 641 +#define STRINGID_COULDNTFULLYPROTECT 642 -#define BATTLESTRINGS_COUNT 639 +#define BATTLESTRINGS_COUNT 643 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, @@ -740,7 +744,6 @@ // gUproarAwakeStringIds #define B_MSG_CANT_SLEEP_UPROAR 0 #define B_MSG_UPROAR_KEPT_AWAKE 1 -#define B_MSG_STAYED_AWAKE_USING 2 // gUproarOverTurnStringIds #define B_MSG_UPROAR_CONTINUES 0 diff --git a/include/constants/field_specials.h b/include/constants/field_specials.h index a01151378..665940331 100644 --- a/include/constants/field_specials.h +++ b/include/constants/field_specials.h @@ -80,4 +80,10 @@ #define FANCOUNTER_FINISHED_CONTEST 2 #define FANCOUNTER_USED_BATTLE_TOWER 3 +// Return values for DoDeoxysRockInteraction +#define DEOXYS_ROCK_FAILED 0 +#define DEOXYS_ROCK_PROGRESSED 1 +#define DEOXYS_ROCK_SOLVED 2 +#define DEOXYS_ROCK_COMPLETE 3 + #endif // GUARD_CONSTANTS_FIELD_SPECIALS_H diff --git a/include/constants/rgb.h b/include/constants/rgb.h index 3e0bf6fe0..f73ab53b4 100644 --- a/include/constants/rgb.h +++ b/include/constants/rgb.h @@ -8,6 +8,7 @@ #define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) #define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r)) #define _RGB(r, g, b) ((((b) & 0x1F) << 10) + (((g) & 0x1F) << 5) + ((r) & 0x1F)) +#define RGB2GBA(r, g, b) (((r >> 3) & 31) | (((g >> 3) & 31) << 5) | (((b >> 3) & 31) << 10)) #define RGB_ALPHA (1 << 15) #define IS_ALPHA(color) ((color) & RGB_ALPHA) @@ -23,4 +24,6 @@ #define RGB_CYAN RGB(0, 31, 31) #define RGB_WHITEALPHA (RGB_WHITE | RGB_ALPHA) +#define RGB_LIME_GREEN RGB2GBA(222, 230, 49) + #endif // GUARD_RGB_H diff --git a/include/constants/trade.h b/include/constants/trade.h index e8afc2a77..e387d13cd 100644 --- a/include/constants/trade.h +++ b/include/constants/trade.h @@ -4,29 +4,19 @@ #define TRADE_PLAYER 0 #define TRADE_PARTNER 1 -#define LINK_TRADE_TIMEOUT 300 - // In-game Trade IDs #define INGAME_TRADE_SEEDOT 0 #define INGAME_TRADE_PLUSLE 1 #define INGAME_TRADE_HORSEA 2 #define INGAME_TRADE_MEOWTH 3 -// Flag IDs for sending link data -#define INITIATE_TRADE 1 -#define CANCEL_TRADE 2 -#define WANTS_TO_TRADE 1 -#define WANTS_TO_CANCEL 2 -#define READY_FINISH_TRADE 1 -#define FINISH_TRADE 2 - // Return values for CanTradeSelectedMon and CanSpinTradeMon -#define CAN_TRADE_MON 0 -#define CANT_TRADE_LAST_MON 1 -#define CANT_TRADE_NATIONAL 2 -#define CANT_TRADE_EGG_YET 3 -#define CANT_TRADE_INVALID_MON 4 -#define CANT_TRADE_EGG_YET2 5 +#define CAN_TRADE_MON 0 +#define CANT_TRADE_LAST_MON 1 +#define CANT_TRADE_NATIONAL 2 +#define CANT_TRADE_EGG_YET 3 +#define CANT_TRADE_INVALID_MON 4 +#define CANT_TRADE_PARTNER_EGG_YET 5 // Return values for CheckValidityOfTradeMons #define PLAYER_MON_INVALID 0 @@ -38,63 +28,6 @@ #define TRADE_PLAYER_NOT_READY 1 #define TRADE_PARTNER_NOT_READY 2 -// Indexes for sTradeActionTexts -#define TRADE_TEXT_CANCEL 0 -#define TRADE_TEXT_CHOOSE_MON 1 -#define TRADE_TEXT_SUMMARY 2 -#define TRADE_TEXT_TRADE 3 -#define TRADE_TEXT_CANCEL_TRADE 4 -#define TRADE_TEXT_JP_QUIT 5 - -// Checked to confirm DrawTradeMenuParty has reached final state -#define DRAW_PARTY_FINISH 5 - -// Message indexes for sTradeMessages -#define TRADE_MSG_STANDBY 0 -#define TRADE_MSG_CANCELED 1 -#define TRADE_MSG_ONLY_MON1 2 -#define TRADE_MSG_ONLY_MON2 3 -#define TRADE_MSG_WAITING_FOR_FRIEND 4 -#define TRADE_MSG_FRIEND_WANTS_TO_TRADE 5 -#define TRADE_MSG_MON_CANT_BE_TRADED 6 -#define TRADE_MSG_EGG_CANT_BE_TRADED 7 -#define TRADE_MSG_FRIENDS_MON_CANT_BE_TRADED 8 - -// IDs for QueueAction -#define QUEUE_SEND_DATA 0 -#define QUEUE_STANDBY 1 -#define QUEUE_ONLY_MON1 2 -#define QUEUE_ONLY_MON2 3 -#define QUEUE_UNUSED1 4 -#define QUEUE_UNUSED2 5 -#define QUEUE_MON_CANT_BE_TRADED 6 -#define QUEUE_EGG_CANT_BE_TRADED 7 -#define QUEUE_FRIENDS_MON_CANT_BE_TRADED 8 - -#define QUEUE_DELAY_MSG 3 -#define QUEUE_DELAY_DATA 5 - -// IDs for CallTradeMenuFunc -#define TRADEMENUFUNC_MAIN_MENU 0 -#define TRADEMENUFUNC_SELECTED_MON 1 -#define TRADEMENUFUNC_SHOW_MON_SUMMARY 2 -#define TRADEMENUFUNC_CONFIRM_OR_CANCEL_TRADE 3 -#define TRADEMENUFUNC_CANCEL_TRADE_PROMPT 4 -#define TRADEMENUFUNC_UNUSED_5 5 -#define TRADEMENUFUNC_BOTH_MONS_SELECTED 6 -#define TRADEMENUFUNC_CONFIRM_TRADE_PROMPT 7 -#define TRADEMENUFUNC_REDRAW_MAIN_MENU 8 -#define TRADEMENUFUNC_LINK_TRADE_FADE_OUT 9 -#define TRADEMENUFUNC_LINK_TRADE_WAIT_FADE 10 -#define TRADEMENUFUNC_CANCEL_TRADE_1 11 -#define TRADEMENUFUNC_CANCEL_TRADE_2 12 -#define TRADEMENUFUNC_START_LINK_TRADE 13 -#define TRADEMENUFUNC_DELAY_TRADE_CONFIRM 14 -#define TRADEMENUFUNC_UNUSED_15 15 -#define TRADEMENUFUNC_LINK_TRADE_WAIT_QUEUE 16 -#define TRADEMENUFUNC_PARTNER_MON_INVALID 17 -#define TRADEMENUFUNC_STANDBY 100 - // Message indexes for sUnionRoomTradeMessages #define UR_TRADE_MSG_NONE 0 #define UR_TRADE_MSG_NOT_MON_PARTNER_WANTS 1 diff --git a/include/expansion_intro.h b/include/expansion_intro.h new file mode 100644 index 000000000..7d8d31677 --- /dev/null +++ b/include/expansion_intro.h @@ -0,0 +1,9 @@ +#ifndef GUARD_EXPANSION_INTRO_H +#define GUARD_EXPANSION_INTRO_H + +#if EXPANSION_INTRO == TRUE +void CB2_ExpansionIntro(void); +void Task_HandleExpansionIntro(u8 taskId); +#endif + +#endif /* GUARD_EXPANSION_INTRO_H */ diff --git a/include/graphics.h b/include/graphics.h index e5a47ca88..f00c72788 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -867,9 +867,9 @@ extern const u32 gMonFrontPic_Mimikyu[]; extern const u32 gMonFrontPic_Bruxish[]; extern const u32 gMonFrontPic_Drampa[]; extern const u32 gMonFrontPic_Dhelmise[]; -extern const u32 gMonFrontPic_Jangmoo[]; -extern const u32 gMonFrontPic_Hakamoo[]; -extern const u32 gMonFrontPic_Kommoo[]; +extern const u32 gMonFrontPic_JangmoO[]; +extern const u32 gMonFrontPic_HakamoO[]; +extern const u32 gMonFrontPic_KommoO[]; extern const u32 gMonFrontPic_TapuKoko[]; extern const u32 gMonFrontPic_TapuLele[]; extern const u32 gMonFrontPic_TapuBulu[]; @@ -2081,9 +2081,9 @@ extern const u32 gMonBackPic_Mimikyu[]; extern const u32 gMonBackPic_Bruxish[]; extern const u32 gMonBackPic_Drampa[]; extern const u32 gMonBackPic_Dhelmise[]; -extern const u32 gMonBackPic_Jangmoo[]; -extern const u32 gMonBackPic_Hakamoo[]; -extern const u32 gMonBackPic_Kommoo[]; +extern const u32 gMonBackPic_JangmoO[]; +extern const u32 gMonBackPic_HakamoO[]; +extern const u32 gMonBackPic_KommoO[]; extern const u32 gMonBackPic_TapuKoko[]; extern const u32 gMonBackPic_TapuLele[]; extern const u32 gMonBackPic_TapuBulu[]; @@ -3287,9 +3287,9 @@ extern const u32 gMonPalette_Mimikyu[]; extern const u32 gMonPalette_Bruxish[]; extern const u32 gMonPalette_Drampa[]; extern const u32 gMonPalette_Dhelmise[]; -extern const u32 gMonPalette_Jangmoo[]; -extern const u32 gMonPalette_Hakamoo[]; -extern const u32 gMonPalette_Kommoo[]; +extern const u32 gMonPalette_JangmoO[]; +extern const u32 gMonPalette_HakamoO[]; +extern const u32 gMonPalette_KommoO[]; extern const u32 gMonPalette_TapuKoko[]; extern const u32 gMonPalette_TapuLele[]; extern const u32 gMonPalette_TapuBulu[]; @@ -4520,9 +4520,9 @@ extern const u32 gMonShinyPalette_Mimikyu[]; extern const u32 gMonShinyPalette_Bruxish[]; extern const u32 gMonShinyPalette_Drampa[]; extern const u32 gMonShinyPalette_Dhelmise[]; -extern const u32 gMonShinyPalette_Jangmoo[]; -extern const u32 gMonShinyPalette_Hakamoo[]; -extern const u32 gMonShinyPalette_Kommoo[]; +extern const u32 gMonShinyPalette_JangmoO[]; +extern const u32 gMonShinyPalette_HakamoO[]; +extern const u32 gMonShinyPalette_KommoO[]; extern const u32 gMonShinyPalette_TapuKoko[]; extern const u32 gMonShinyPalette_TapuLele[]; extern const u32 gMonShinyPalette_TapuBulu[]; @@ -5747,9 +5747,9 @@ extern const u8 gMonIcon_Mimikyu[]; extern const u8 gMonIcon_Bruxish[]; extern const u8 gMonIcon_Drampa[]; extern const u8 gMonIcon_Dhelmise[]; -extern const u8 gMonIcon_Jangmoo[]; -extern const u8 gMonIcon_Hakamoo[]; -extern const u8 gMonIcon_Kommoo[]; +extern const u8 gMonIcon_JangmoO[]; +extern const u8 gMonIcon_HakamoO[]; +extern const u8 gMonIcon_KommoO[]; extern const u8 gMonIcon_TapuKoko[]; extern const u8 gMonIcon_TapuLele[]; extern const u8 gMonIcon_TapuBulu[]; @@ -6960,9 +6960,9 @@ extern const u8 gMonFootprint_Mimikyu[]; extern const u8 gMonFootprint_Bruxish[]; extern const u8 gMonFootprint_Drampa[]; extern const u8 gMonFootprint_Dhelmise[]; -extern const u8 gMonFootprint_Jangmo_o[]; -extern const u8 gMonFootprint_Hakamo_o[]; -extern const u8 gMonFootprint_Kommo_o[]; +extern const u8 gMonFootprint_JangmoO[]; +extern const u8 gMonFootprint_HakamoO[]; +extern const u8 gMonFootprint_KommoO[]; extern const u8 gMonFootprint_Tapu_Koko[]; extern const u8 gMonFootprint_Tapu_Lele[]; extern const u8 gMonFootprint_Tapu_Bulu[]; @@ -9981,6 +9981,7 @@ extern const u32 gBattleAnimBgTilemap_GigaImpactPlayer[]; extern const u32 gBattleAnimBgTilemap_GigaImpactOpponent[]; extern const u32 gBattleAnimBgTilemap_GigaImpactContest[]; extern const u32 gBattleAnimBgImage_GigaImpact[]; +extern const u32 gBattleAnimBgImage_GigaImpactContest[]; extern const u32 gBattleAnimBgPalette_GigaImpact[]; extern const u32 gBattleAnimBgImage_SpacialRend[]; extern const u32 gBattleAnimBgPalette_SpacialRend[]; diff --git a/include/intro.h b/include/intro.h index 8ba030a28..1c89c6595 100644 --- a/include/intro.h +++ b/include/intro.h @@ -9,5 +9,8 @@ void CB2_InitCopyrightScreenAfterBootup(void); void CB2_InitCopyrightScreenAfterTitleScreen(void); void PanFadeAndZoomScreen(u16, u16, u16, u16); +void MainCB2_Intro(void); +void Task_Scene1_Load(u8); + #endif // GUARD_INTRO_H diff --git a/include/link_rfu.h b/include/link_rfu.h index cf4bb2ca7..f3ae61afb 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -83,7 +83,7 @@ struct RfuGameCompatibilityData u16 hasNews:1; u16 hasCard:1; u16 unknown:1; // Never read - u16 isChampion:1; + u16 canLinkNationally:1; u16 hasNationalDex:1; u16 gameClear:1; u16 version:4; diff --git a/include/menu_specialized.h b/include/menu_specialized.h index 10a211046..06a188b8a 100644 --- a/include/menu_specialized.h +++ b/include/menu_specialized.h @@ -15,6 +15,15 @@ enum { MAILBOXWIN_COUNT }; +// Window IDs for the move relearner +enum { + RELEARNERWIN_DESC_BATTLE, + RELEARNERWIN_DESC_CONTEST, + RELEARNERWIN_MOVE_LIST, + RELEARNERWIN_MSG, + RELEARNERWIN_YESNO, +}; + enum { TAG_CONDITION_MON = 100, TAG_CONDITION_BALL, @@ -117,11 +126,11 @@ void DestroyConditionSparkleSprites(struct Sprite **sprites); void FreeConditionSparkles(struct Sprite **sprites); // Move relearner -void MoveRelearnerPrintText(u8 *str); +void MoveRelearnerPrintMessage(u8 *str); bool16 MoveRelearnerRunTextPrinters(void); void MoveRelearnerCreateYesNoMenu(void); u8 LoadMoveRelearnerMovesList(const struct ListMenuItem *items, u16 numChoices); -void InitMoveRelearnerWindows(bool8 useContextWindow); +void InitMoveRelearnerWindows(bool8 useContestWindow); // Level up window void DrawLevelUpWindowPg1(u16 windowId, u16 *statsBefore, u16 *statsAfter, u8 bgClr, u8 fgClr, u8 shadowClr); diff --git a/include/mystery_gift_menu.h b/include/mystery_gift_menu.h index dc30d3051..665c4596e 100644 --- a/include/mystery_gift_menu.h +++ b/include/mystery_gift_menu.h @@ -5,11 +5,11 @@ extern bool8 gGiftIsFromEReader; u16 GetMysteryGiftBaseBlock(void); void CB2_MysteryGiftEReader(void); -void PrintMysteryGiftOrEReaderTopMenu(bool8 isJapanese, bool32 usePickOkCancel); +void PrintMysteryGiftOrEReaderHeader(bool8 isJapanese, bool32 usePickOkCancel); void MG_DrawCheckerboardPattern(u32 bg); void MainCB_FreeAllBuffersAndReturnToInitTitleScreen(void); bool32 PrintMysteryGiftMenuMessage(u8 *textState, const u8 *str); -void AddTextPrinterToWindow1(const u8 *src); +void MG_AddMessageTextPrinter(const u8 *src); void CB2_InitEReader(void); void CB2_InitMysteryGift(void); void MG_DrawTextBorder(u8 windowId); diff --git a/include/pokemon.h b/include/pokemon.h index 89910d6ee..05b9d1ac9 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -294,7 +294,7 @@ struct BattlePokemon /*0x59*/ u8 metLevel; }; -struct SpeciesInfo +struct SpeciesInfo /*0x24*/ { /* 0x00 */ u8 baseHP; /* 0x01 */ u8 baseAttack; @@ -304,25 +304,26 @@ struct SpeciesInfo /* 0x05 */ u8 baseSpDefense; /* 0x06 */ u8 types[2]; /* 0x08 */ u8 catchRate; - /* 0x09 */ u16 expYield; - /* 0x0A */ u16 evYield_HP:2; - /* 0x0A */ u16 evYield_Attack:2; - /* 0x0A */ u16 evYield_Defense:2; - /* 0x0A */ u16 evYield_Speed:2; - /* 0x0B */ u16 evYield_SpAttack:2; - /* 0x0B */ u16 evYield_SpDefense:2; - /* 0x0C */ u16 itemCommon; - /* 0x0E */ u16 itemRare; - /* 0x10 */ u8 genderRatio; - /* 0x11 */ u8 eggCycles; - /* 0x12 */ u8 friendship; - /* 0x13 */ u8 growthRate; - /* 0x14 */ u8 eggGroups[2]; - /* 0x16 */ u16 abilities[NUM_ABILITY_SLOTS]; - /* 0x19 */ u8 safariZoneFleeRate; - /* 0x1A */ u8 bodyColor : 7; + /* 0x09 padding */ + /* 0x0A */ u16 expYield; // expYield was changed from u8 to u16 for the new Exp System. + /* 0x0C */ u16 evYield_HP:2; + u16 evYield_Attack:2; + u16 evYield_Defense:2; + u16 evYield_Speed:2; + /* 0x0D */ u16 evYield_SpAttack:2; + u16 evYield_SpDefense:2; + /* 0x0E */ u16 itemCommon; + /* 0x10 */ u16 itemRare; + /* 0x12 */ u8 genderRatio; + /* 0x13 */ u8 eggCycles; + /* 0x14 */ u8 friendship; + /* 0x15 */ u8 growthRate; + /* 0x16 */ u8 eggGroups[2]; + /* 0x18 */ u16 abilities[NUM_ABILITY_SLOTS]; // 3 abilities, no longer u8 because we have over 255 abilities now. + /* 0x1E */ u8 safariZoneFleeRate; + /* 0x1F */ u8 bodyColor : 7; u8 noFlip : 1; - /* 0x1B */ u16 flags; + /* 0x20 */ u16 flags; }; struct BattleMove diff --git a/include/region_map.h b/include/region_map.h index 85793badc..9f0b110a6 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -21,7 +21,8 @@ enum { MAPSECTYPE_ROUTE, MAPSECTYPE_CITY_CANFLY, MAPSECTYPE_CITY_CANTFLY, - MAPSECTYPE_BATTLE_FRONTIER + MAPSECTYPE_BATTLE_FRONTIER, + NUM_MAPSEC_TYPES }; struct RegionMap { diff --git a/ld_script.txt b/ld_script.txt index 4c3085f59..dcce51a0f 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -343,6 +343,7 @@ SECTIONS { src/battle_transition_frontier.o(.text); src/international_string_util.o(.text); src/pokemon_debug.o(.text); + src/expansion_intro.o(.text); } =0 script_data : @@ -709,6 +710,7 @@ SECTIONS { src/m4a_tables.o(.rodata); data/sound_data.o(.rodata); src/pokemon_debug.o(.rodata); + src/expansion_intro.o(.rodata); } =0 song_data : diff --git a/make_tools.mk b/make_tools.mk index 36dbe8c90..5a5291b77 100644 --- a/make_tools.mk +++ b/make_tools.mk @@ -1,7 +1,6 @@ - MAKEFLAGS += --no-print-directory -TOOLDIRS := $(filter-out tools/mgba tools/agbcc tools/binutils,$(wildcard tools/*)) +TOOLDIRS := tools/aif2pcm tools/bin2c tools/gbafix tools/gbagfx tools/jsonproc tools/mapjson tools/mid2agb tools/preproc tools/ramscrgen tools/rsfont tools/scaninc .PHONY: all $(TOOLDIRS) diff --git a/sound/cry_tables.inc b/sound/cry_tables.inc index 7714cd00e..c9da7e679 100644 --- a/sound/cry_tables.inc +++ b/sound/cry_tables.inc @@ -1126,9 +1126,9 @@ gCryTable:: cry Cry_Bruxish cry Cry_Drampa cry Cry_Dhelmise - cry Cry_Jangmoo - cry Cry_Hakamoo - cry Cry_Kommoo + cry Cry_JangmoO + cry Cry_HakamoO + cry Cry_KommoO cry Cry_TapuKoko cry Cry_TapuLele cry Cry_TapuBulu @@ -3248,9 +3248,9 @@ gCryTable_Reverse:: cry_reverse Cry_Bruxish cry_reverse Cry_Drampa cry_reverse Cry_Dhelmise - cry_reverse Cry_Jangmoo - cry_reverse Cry_Hakamoo - cry_reverse Cry_Kommoo + cry_reverse Cry_JangmoO + cry_reverse Cry_HakamoO + cry_reverse Cry_KommoO cry_reverse Cry_TapuKoko cry_reverse Cry_TapuLele cry_reverse Cry_TapuBulu diff --git a/sound/direct_sound_data.inc b/sound/direct_sound_data.inc index fb4c6b44f..611808d23 100644 --- a/sound/direct_sound_data.inc +++ b/sound/direct_sound_data.inc @@ -3518,15 +3518,15 @@ Cry_Dhelmise:: .incbin "sound/direct_sound_samples/cries/dhelmise.bin" .align 2 -Cry_Jangmoo:: +Cry_JangmoO:: .incbin "sound/direct_sound_samples/cries/jangmo_o.bin" .align 2 -Cry_Hakamoo:: +Cry_HakamoO:: .incbin "sound/direct_sound_samples/cries/hakamo_o.bin" .align 2 -Cry_Kommoo:: +Cry_KommoO:: .incbin "sound/direct_sound_samples/cries/kommo_o.bin" .align 2 diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index a59f57d37..bbc1660fa 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -982,6 +982,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // stat raising effects case EFFECT_ATTACK_UP: case EFFECT_ATTACK_UP_2: + case EFFECT_ATTACK_UP_USER_ALLY: if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; break; @@ -2427,6 +2428,13 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; } break; + case EFFECT_HEAL_PULSE: // and floral healing + if (!IsTargetingPartner(battlerAtk, battlerDef)) // Don't heal enemies + { + score -= 10; + break; + } + // fallthrough case EFFECT_HIT_ENEMY_HEAL_ALLY: // pollen puff if (IsTargetingPartner(battlerAtk, battlerDef)) { @@ -2436,20 +2444,6 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; else if (gBattleMons[battlerDef].hp > gBattleMons[battlerDef].maxHP / 2) score -= 5; - break; - } - // fallthrough - case EFFECT_HEAL_PULSE: // and floral healing - if (!IsTargetingPartner(battlerAtk, battlerDef)) // Don't heal enemies - { - score -= 10; - } - else - { - if (AtMaxHp(battlerDef)) - score -= 10; - else if (gBattleMons[battlerDef].hp > gBattleMons[battlerDef].maxHP / 2) - score -= 5; } break; case EFFECT_ELECTRIFY: @@ -2638,7 +2632,7 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0) && gBattleMoves[move].effect != EFFECT_EXPLOSION) { // this move can faint the target - if (!WillAIStrikeFirst() || GetMovePriority(battlerAtk, move) > 0) + if (WillAIStrikeFirst() || GetMovePriority(battlerAtk, move) > 0) score += 4; // we go first or we're using priority move else score += 2; @@ -3009,6 +3003,13 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) RETURN_SCORE_PLUS(1); } break; + case EFFECT_HEAL_PULSE: + case EFFECT_HIT_ENEMY_HEAL_ALLY: + if (AI_WhoStrikesFirst(battlerAtk, FOE(battlerAtk), move) == AI_IS_FASTER + && AI_WhoStrikesFirst(battlerAtk, BATTLE_PARTNER(FOE(battlerAtk)), move) == AI_IS_FASTER + && gBattleMons[battlerAtkPartner].hp < gBattleMons[battlerAtkPartner].maxHP / 2) + RETURN_SCORE_PLUS(1); + break; } // attacker move effects } // check partner protecting @@ -3191,6 +3192,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // stat raising effects case EFFECT_ATTACK_UP: case EFFECT_ATTACK_UP_2: + case EFFECT_ATTACK_UP_USER_ALLY: if (MovesWithSplitUnusable(battlerAtk, battlerDef, SPLIT_PHYSICAL)) { score -= 8; @@ -4827,6 +4829,7 @@ static s16 AI_SetupFirstTurn(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (gBattleMoves[move].effect) { case EFFECT_ATTACK_UP: + case EFFECT_ATTACK_UP_USER_ALLY: case EFFECT_DEFENSE_UP: case EFFECT_SPEED_UP: case EFFECT_SPECIAL_ATTACK_UP: @@ -5158,6 +5161,7 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (effect) { case EFFECT_ATTACK_UP: + case EFFECT_ATTACK_UP_USER_ALLY: case EFFECT_DEFENSE_UP: case EFFECT_SPEED_UP: case EFFECT_SPECIAL_ATTACK_UP: diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 5bcd17716..b43927819 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -27,6 +27,15 @@ static bool32 AiExpectsToFaintPlayer(void); static bool32 AI_ShouldHeal(u32 healAmount); static bool32 AI_OpponentCanFaintAiWithMod(u32 healAmount); +static bool32 IsAceMon(u32 battlerId, u32 monPartyId) +{ + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && !(gBattleStruct->forcedSwitch & gBitTable[battlerId]) + && monPartyId == CalculateEnemyPartyCount()-1) + return TRUE; + return FALSE; +} + void GetAIPartyIndexes(u32 battlerId, s32 *firstId, s32 *lastId) { if (BATTLE_TWO_VS_ONE_OPPONENT && (battlerId & BIT_SIDE) == B_SIDE_OPPONENT) @@ -109,8 +118,7 @@ static bool8 ShouldSwitchIfWonderGuard(void) continue; if (i == gBattlerPartyIndexes[gActiveBattler]) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON - && i == (CalculateEnemyPartyCount()-1)) + if (IsAceMon(gActiveBattler, i)) continue; for (opposingBattler = GetBattlerAtPosition(opposingPosition), j = 0; j < MAX_MON_MOVES; j++) @@ -202,10 +210,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON - && i == (CalculateEnemyPartyCount()-1)) + if (IsAceMon(gActiveBattler, i)) continue; - + species = GetMonData(&party[i], MON_DATA_SPECIES); if (GetMonData(&party[i], MON_DATA_ABILITY_NUM) != 0) @@ -267,7 +274,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) ) switchMon = FALSE; - if (IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)) + if (IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)) && (gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_MISTY_TERRAIN || gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_ELECTRIC_TERRAIN) && IsBattlerGrounded(gActiveBattler) @@ -277,15 +284,14 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) if (*(gBattleStruct->AI_monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)) != PARTY_SIZE) //Partner is switching { GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); - + if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) party = gPlayerParty; - + for (i = firstId; i < lastId; i++) { - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON - && i == (CalculateEnemyPartyCount()-1)) - break; + if (IsAceMon(gActiveBattler, i)) + continue; //Look for mon in party that is able to be switched into and has ability that sets terrain if (GetMonData(&party[i], MON_DATA_HP) != 0 @@ -305,7 +311,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) } } } - + //Check if Active Pokemon can KO opponent instead of switching //Will still fall asleep, but take out opposing Pokemon first if (AiExpectsToFaintPlayer()) @@ -328,7 +334,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) && AI_DATA->abilities[opposingBattler] != ABILITY_UNAWARE && AI_DATA->abilities[opposingBattler] != ABILITY_KEEN_EYE && !(gBattleMons[gActiveBattler].status2 & STATUS2_FORESIGHT) - && !(gStatuses3[gActiveBattler] & STATUS3_MIRACLE_EYED)) + && !(gStatuses3[gActiveBattler] & STATUS3_MIRACLE_EYED)) switchMon = FALSE; } @@ -343,7 +349,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) && gBattleMons[gActiveBattler].hp >= (gBattleMons[gActiveBattler].maxHP / 3) && (Random() % (moduloChance*chanceReducer)) == 0) switchMon = TRUE; - + //Cursed moduloChance = 2; //50% if (gBattleMons[gActiveBattler].status2 & STATUS2_CURSED @@ -370,7 +376,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) //Todo //Pass Wish Heal - + //Semi-Invulnerable if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) { @@ -416,7 +422,7 @@ static bool8 ShouldSwitchIfAbilityBenefit(void) switch(AI_DATA->abilities[gActiveBattler]) { case ABILITY_NATURAL_CURE: moduloChance = 4; //25% - //Attempt to cure bad ailment + //Attempt to cure bad ailment if (gBattleMons[gActiveBattler].status1 & (STATUS1_SLEEP | STATUS1_FREEZE | STATUS1_TOXIC_POISON) && GetMostSuitableMonToSwitchInto() != PARTY_SIZE) break; @@ -432,17 +438,17 @@ static bool8 ShouldSwitchIfAbilityBenefit(void) case ABILITY_REGENERATOR: moduloChance = 2; //50% //Don't switch if ailment - if (gBattleMons[gActiveBattler].status1 & STATUS1_ANY) - return FALSE; + if (gBattleMons[gActiveBattler].status1 & STATUS1_ANY) + return FALSE; if ((gBattleMons[gActiveBattler].hp <= ((gBattleMons[gActiveBattler].maxHP * 2) / 3)) && GetMostSuitableMonToSwitchInto() != PARTY_SIZE && Random() % (moduloChance*chanceReducer) == 0) break; - + return FALSE; default: - return FALSE; + return FALSE; } *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; @@ -576,8 +582,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON - && i == (CalculateEnemyPartyCount()-1)) + if (IsAceMon(gActiveBattler, i)) continue; @@ -619,6 +624,7 @@ bool32 ShouldSwitch(void) struct Pokemon *party; s32 i; s32 availableToSwitch; + bool32 hasAceMon = FALSE; if (gBattleMons[gActiveBattler].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)) return FALSE; @@ -668,15 +674,22 @@ bool32 ShouldSwitch(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON - && i == (CalculateEnemyPartyCount()-1)) + if (IsAceMon(gActiveBattler, i)) + { + hasAceMon = TRUE; continue; + } availableToSwitch++; } if (availableToSwitch == 0) - return FALSE; + { + if (hasAceMon) // If the ace mon is the only available mon, use it + availableToSwitch++; + else + return FALSE; + } //NOTE: The sequence of the below functions matter! Do not change unless you have carefully considered the outcome. //Since the order is sequencial, and some of these functions prompt switch to specific party members. @@ -694,14 +707,14 @@ bool32 ShouldSwitch(void) return TRUE; if (ShouldSwitchIfAbilityBenefit()) return TRUE; - + //Removing switch capabilites under specific conditions //These Functions prevent the "FindMonWithFlagsAndSuperEffective" from getting out of hand. if (HasSuperEffectiveMoveAgainstOpponents(FALSE)) return FALSE; if (AreStatsRaised()) return FALSE; - + //Default Function //Can prompt switch if AI has a pokemon in party that resists current opponent & has super effective move if (FindMonWithFlagsAndSuperEffective(MOVE_RESULT_DOESNT_AFFECT_FOE, 2) @@ -758,8 +771,7 @@ void AI_TrySwitchOrUseItem(void) continue; if (monToSwitchId == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON - && monToSwitchId == (CalculateEnemyPartyCount()-1)) + if (IsAceMon(gActiveBattler, monToSwitchId)) continue; break; @@ -916,7 +928,7 @@ u8 GetMostSuitableMonToSwitchInto(void) s32 lastId = 0; // + 1 struct Pokemon *party; s32 i, j, aliveCount = 0; - u8 invalidMons = 0; + u32 invalidMons = 0, aceMonId = PARTY_SIZE; if (*(gBattleStruct->monToSwitchIntoId + gActiveBattler) != PARTY_SIZE) return *(gBattleStruct->monToSwitchIntoId + gActiveBattler); @@ -958,12 +970,19 @@ u8 GetMostSuitableMonToSwitchInto(void) || gBattlerPartyIndexes[battlerIn2] == i || i == *(gBattleStruct->monToSwitchIntoId + battlerIn1) || i == *(gBattleStruct->monToSwitchIntoId + battlerIn2) - || (GetMonAbility(&party[i]) == ABILITY_TRUANT && IsTruantMonVulnerable(gActiveBattler, opposingBattler)) // While not really invalid per say, not really wise to switch into this mon. - || ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON) - && i == (CalculateEnemyPartyCount() - 1))) //Save Ace Pokemon for last + || (GetMonAbility(&party[i]) == ABILITY_TRUANT && IsTruantMonVulnerable(gActiveBattler, opposingBattler))) // While not really invalid per say, not really wise to switch into this mon.) + { invalidMons |= gBitTable[i]; + } + else if (IsAceMon(gActiveBattler, i))// Save Ace Pokemon for last. + { + aceMonId = i; + invalidMons |= gBitTable[i]; + } else + { aliveCount++; + } } bestMonId = GetBestMonBatonPass(party, firstId, lastId, invalidMons, aliveCount); @@ -978,6 +997,11 @@ u8 GetMostSuitableMonToSwitchInto(void) if (bestMonId != PARTY_SIZE) return bestMonId; + // If ace mon is the last available Pokemon and U-Turn/Volt Switch was used - switch to the mon. + if (aceMonId != PARTY_SIZE + && (gBattleMoves[gLastUsedMove].effect == EFFECT_HIT_ESCAPE || gBattleMoves[gLastUsedMove].effect == EFFECT_PARTING_SHOT)) + return aceMonId; + return PARTY_SIZE; } diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 531a4aa6b..495e2ea1d 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -538,23 +538,73 @@ void SaveBattlerData(u8 battlerId) AI_THINKING_STRUCT->saved[battlerId].species = gBattleMons[battlerId].species; for (i = 0; i < 4; i++) AI_THINKING_STRUCT->saved[battlerId].moves[i] = gBattleMons[battlerId].moves[i]; + AI_THINKING_STRUCT->saved[battlerId].types[0] = gBattleMons[battlerId].type1; + AI_THINKING_STRUCT->saved[battlerId].types[1] = gBattleMons[battlerId].type2; } } +static bool32 ShouldFailForIllusion(u16 illusionSpecies, u32 battlerId) +{ + u32 i, j; + + if (BATTLE_HISTORY->abilities[battlerId] == ABILITY_ILLUSION) + return FALSE; + + // Don't fall for Illusion if the mon used a move it cannot know. + for (i = 0; i < MAX_MON_MOVES; i++) + { + u16 move = BATTLE_HISTORY->usedMoves[battlerId][i]; + if (move == MOVE_NONE) + continue; + + for (j = 0; gLevelUpLearnsets[illusionSpecies][j].move != MOVE_UNAVAILABLE; j++) + { + if (gLevelUpLearnsets[illusionSpecies][j].move == move) + break; + } + // The used move is in the learnsets of the fake species. + if (gLevelUpLearnsets[illusionSpecies][j].move != MOVE_UNAVAILABLE) + continue; + + // The used move can be learned from Tm/Hm or Move Tutors. + if (CanLearnTeachableMove(illusionSpecies, move)) + continue; + + // 'Illegal move', AI won't fail for the illusion. + return FALSE; + } + + return TRUE; +} + void SetBattlerData(u8 battlerId) { if (!IsBattlerAIControlled(battlerId)) { - struct Pokemon *illusionMon; - u32 i; + u32 i, species, illusionSpecies; + + // Simulate Illusion + species = gBattleMons[battlerId].species; + illusionSpecies = GetIllusionMonSpecies(battlerId); + if (illusionSpecies != SPECIES_NONE && ShouldFailForIllusion(illusionSpecies, battlerId)) + { + // If the battler's type has not been changed, AI assumes the types of the illusion mon. + if (gBattleMons[battlerId].type1 == gSpeciesInfo[species].types[0] + && gBattleMons[battlerId].type2 == gSpeciesInfo[species].types[1]) + { + gBattleMons[battlerId].type1 = gSpeciesInfo[illusionSpecies].types[0]; + gBattleMons[battlerId].type2 = gSpeciesInfo[illusionSpecies].types[1]; + } + species = illusionSpecies; + } // Use the known battler's ability. if (BATTLE_HISTORY->abilities[battlerId] != ABILITY_NONE) gBattleMons[battlerId].ability = BATTLE_HISTORY->abilities[battlerId]; // Check if mon can only have one ability. - else if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[1] == ABILITY_NONE - || gSpeciesInfo[gBattleMons[battlerId].species].abilities[1] == gSpeciesInfo[gBattleMons[battlerId].species].abilities[0]) - gBattleMons[battlerId].ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[0]; + else if (gSpeciesInfo[species].abilities[1] == ABILITY_NONE + || gSpeciesInfo[species].abilities[1] == gSpeciesInfo[species].abilities[0]) + gBattleMons[battlerId].ability = gSpeciesInfo[species].abilities[0]; // The ability is unknown. else gBattleMons[battlerId].ability = ABILITY_NONE; @@ -567,10 +617,6 @@ void SetBattlerData(u8 battlerId) if (BATTLE_HISTORY->usedMoves[battlerId][i] == 0) gBattleMons[battlerId].moves[i] = 0; } - - // Simulate Illusion - if ((illusionMon = GetIllusionMonPtr(battlerId)) != NULL) - gBattleMons[battlerId].species = GetMonData(illusionMon, MON_DATA_SPECIES2); } } @@ -585,6 +631,8 @@ void RestoreBattlerData(u8 battlerId) gBattleMons[battlerId].species = AI_THINKING_STRUCT->saved[battlerId].species; for (i = 0; i < 4; i++) gBattleMons[battlerId].moves[i] = AI_THINKING_STRUCT->saved[battlerId].moves[i]; + gBattleMons[battlerId].type1 = AI_THINKING_STRUCT->saved[battlerId].types[0]; + gBattleMons[battlerId].type2 = AI_THINKING_STRUCT->saved[battlerId].types[1]; } } @@ -744,6 +792,10 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, SetBattlerData(battlerDef); gBattleStruct->dynamicMoveType = 0; + + if (move == MOVE_NATURE_POWER) + move = GetNaturePowerMove(); + SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); @@ -802,6 +854,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, } else { + effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, FALSE); dmg = 0; } @@ -1166,7 +1219,7 @@ s32 AI_GetAbility(u32 battlerId) // We've had ability overwritten by e.g. Worry Seed. It is not part of AI_PARTY in case of switching if (gBattleStruct->overwrittenAbilities[battlerId]) return gBattleStruct->overwrittenAbilities[battlerId]; - + // The AI knows its own ability. if (IsBattlerAIControlled(battlerId)) return knownAbility; diff --git a/src/battle_anim.c b/src/battle_anim.c index 610c24321..724587588 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -3,6 +3,7 @@ #include "battle_anim.h" #include "battle_controllers.h" #include "battle_interface.h" +#include "battle_util.h" #include "bg.h" #include "contest.h" #include "decompress.h" @@ -81,7 +82,9 @@ static void Cmd_visible(void); static void Cmd_teamattack_moveback(void); static void Cmd_teamattack_movefwd(void); static void Cmd_stopsound(void); - +static void Cmd_createvisualtaskontargets(void); +static void Cmd_createspriteontargets(void); +static void Cmd_createspriteontargets_onpos(void); static void RunAnimScriptCommand(void); static void Task_UpdateMonBg(u8 taskId); static void FlipBattlerBgTiles(void); @@ -169,6 +172,9 @@ static void (* const sScriptCmdTable[])(void) = Cmd_teamattack_moveback, // 0x2D Cmd_teamattack_movefwd, // 0x2E Cmd_stopsound, // 0x2F + Cmd_createvisualtaskontargets, // 0x30 + Cmd_createspriteontargets, // 0x31 + Cmd_createspriteontargets_onpos, // 0x32 }; void ClearBattleAnimationVars(void) @@ -425,29 +431,46 @@ static void Cmd_unloadspritegfx(void) ClearSpriteIndex(GET_TRUE_SPRITE_INDEX(index)); } -static void Cmd_createsprite(void) +static u8 GetBattleAnimMoveTargets(u8 battlerArgIndex, u8 *targets) { - s32 i; - const struct SpriteTemplate *template; - u8 argVar; - u8 argsCount; - s16 subpriority; - - sBattleAnimScriptPtr++; - template = (const struct SpriteTemplate *)(T2_READ_32(sBattleAnimScriptPtr)); - sBattleAnimScriptPtr += 4; - - argVar = sBattleAnimScriptPtr[0]; - sBattleAnimScriptPtr++; - - argsCount = sBattleAnimScriptPtr[0]; - sBattleAnimScriptPtr++; - for (i = 0; i < argsCount; i++) + u8 numTargets = 1; + switch (GetBattlerMoveTargetType(gBattleAnimAttacker, gAnimMoveIndex)) { - gBattleAnimArgs[i] = T1_READ_16(sBattleAnimScriptPtr); - sBattleAnimScriptPtr += 2; + case MOVE_TARGET_BOTH: + targets[0] = gBattleAnimArgs[battlerArgIndex]; + numTargets = 1; + if (IsBattlerAlive(targets[0] ^ BIT_FLANK)) { + targets[1] = targets[0] ^ BIT_FLANK; + numTargets++; + } + break; + case MOVE_TARGET_FOES_AND_ALLY: + targets[0] = gBattleAnimArgs[battlerArgIndex]; + numTargets = 1; + + if (IsBattlerAlive(targets[0] ^ BIT_FLANK)) { + targets[1] = targets[0] ^ BIT_FLANK; + numTargets++; + } + + if (IsBattlerAlive(gBattleAnimAttacker ^ BIT_FLANK)) { + targets[2] = gBattleAnimAttacker ^ BIT_FLANK; + numTargets++; + } + break; + default: + targets[0] = gBattleAnimArgs[battlerArgIndex]; // original + numTargets = 1; + break; } + return numTargets; +} + +static s16 GetSubpriorityForMoveAnim(u8 argVar) +{ + s16 subpriority; + if (argVar & ANIMSPRITE_IS_TARGET) { argVar ^= ANIMSPRITE_IS_TARGET; @@ -471,6 +494,34 @@ static void Cmd_createsprite(void) if (subpriority < 3) subpriority = 3; + return subpriority; +} + +static void Cmd_createsprite(void) +{ + s32 i; + const struct SpriteTemplate *template; + u8 argVar; + u8 argsCount; + s16 subpriority; + + sBattleAnimScriptPtr++; + template = (const struct SpriteTemplate *)(T2_READ_32(sBattleAnimScriptPtr)); + sBattleAnimScriptPtr += 4; + + argVar = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + argsCount = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + for (i = 0; i < argsCount; i++) + { + gBattleAnimArgs[i] = T1_READ_16(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 2; + } + + subpriority = GetSubpriorityForMoveAnim(argVar); + CreateSpriteAndAnimate( template, GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2), @@ -479,6 +530,85 @@ static void Cmd_createsprite(void) gAnimVisualTaskCount++; } +static void CreateSpriteOnTargets(const struct SpriteTemplate *template, u8 argVar, u8 battlerArgIndex, u8 argsCount, bool32 overwriteAnimTgt) +{ + u32 i; + u8 targets[MAX_BATTLERS_COUNT]; + int ntargets; + s16 subpriority; + + for (i = 0; i < argsCount; i++) + { + gBattleAnimArgs[i] = T1_READ_16(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 2; + } + + subpriority = GetSubpriorityForMoveAnim(argVar); + + ntargets = GetBattleAnimMoveTargets(battlerArgIndex, targets); + + for (i = 0; i < ntargets; i++) { + + if (overwriteAnimTgt) + gBattleAnimArgs[battlerArgIndex] = targets[i]; + + CreateSpriteAndAnimate( + template, + GetBattlerSpriteCoord(targets[i], BATTLER_COORD_X_2), + GetBattlerSpriteCoord(targets[i], BATTLER_COORD_Y_PIC_OFFSET), + subpriority); + gAnimVisualTaskCount++; + } +} + +// will NOT overwrite gBattleAnimArgs +static void Cmd_createspriteontargets_onpos(void) +{ + const struct SpriteTemplate *template; + u8 argVar; + u8 argsCount; + u8 battlerArgIndex; + + sBattleAnimScriptPtr++; + template = (const struct SpriteTemplate *)(T2_READ_32(sBattleAnimScriptPtr)); + sBattleAnimScriptPtr += 4; + + argVar = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + battlerArgIndex = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + argsCount = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + CreateSpriteOnTargets(template, argVar, battlerArgIndex, argsCount, FALSE); +} + +// DOES overwrite gBattleAnimArgs +static void Cmd_createspriteontargets(void) +{ + const struct SpriteTemplate *template; + u8 argVar; + u8 argsCount; + u8 battlerArgIndex; + + sBattleAnimScriptPtr++; + template = (const struct SpriteTemplate *)(T2_READ_32(sBattleAnimScriptPtr)); + sBattleAnimScriptPtr += 4; + + argVar = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + battlerArgIndex = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + argsCount = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + CreateSpriteOnTargets(template, argVar, battlerArgIndex, argsCount, TRUE); +} + static void Cmd_createvisualtask(void) { TaskFunc taskFunc; @@ -509,6 +639,48 @@ static void Cmd_createvisualtask(void) gAnimVisualTaskCount++; } +static void Cmd_createvisualtaskontargets(void) +{ + TaskFunc taskFunc; + u8 taskPriority; + u8 taskId; + u8 numArgs; + u8 battlerArgIndex; // index in gBattleAnimArgs that has the battlerId + s32 i; + u8 targets[MAX_BATTLERS_COUNT] = {0}; + + sBattleAnimScriptPtr++; + + taskFunc = (TaskFunc)T2_READ_32(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 4; + + taskPriority = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + battlerArgIndex = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + numArgs = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + // copy task arguments + for (i = 0; i < numArgs; i++) { + gBattleAnimArgs[i] = T1_READ_16(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 2; + } + + numArgs = GetBattleAnimMoveTargets(battlerArgIndex, targets); + + for (i = 0; i < numArgs; i++) + { + gBattleAnimArgs[battlerArgIndex] = targets[i]; + taskId = CreateTask(taskFunc, taskPriority); + taskFunc(taskId); + gAnimVisualTaskCount++; + } +} + + static void Cmd_delay(void) { sBattleAnimScriptPtr++; diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 761a1886c..8dae62029 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -4806,8 +4806,8 @@ void AnimTask_CycleMagicalLeafPal(u8 taskId) void AnimNeedleArmSpike(struct Sprite *sprite) { - u8 a; - u8 b; + s16 a; + s16 b; u16 c; u16 x; u16 y; @@ -4820,13 +4820,27 @@ void AnimNeedleArmSpike(struct Sprite *sprite) { if (gBattleAnimArgs[0] == 0) { - a = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); - b = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + if (IsDoubleBattle()) + { + SetAverageBattlerPositions(gBattleAnimAttacker, TRUE, &a, &b); + } + else + { + a = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + b = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + } } else { - a = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); - b = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + if (IsDoubleBattle()) + { + SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &a, &b); + } + else + { + a = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + b = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + } } sprite->data[0] = gBattleAnimArgs[4]; diff --git a/src/battle_anim_ice.c b/src/battle_anim_ice.c index 3712fb727..e6a5607b5 100644 --- a/src/battle_anim_ice.c +++ b/src/battle_anim_ice.c @@ -1289,6 +1289,18 @@ static void InitPoisonGasCloudAnim(struct Sprite *sprite) sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + +#if B_UPDATED_MOVE_DATA >= GEN_5 + { + s16 x, y; + SetAverageBattlerPositions(gBattleAnimTarget, gBattleAnimArgs[7], &x, &y); + sprite->data[1] = sprite->x + gBattleAnimArgs[1]; + sprite->data[2] = x + gBattleAnimArgs[3]; + sprite->data[3] = sprite->y + gBattleAnimArgs[2]; + sprite->data[4] = y + gBattleAnimArgs[4]; + sprite->data[7] |= GetBattlerSpriteBGPriority(gBattleAnimTarget) << 8; + } +#else if (gBattleAnimArgs[7]) { sprite->data[1] = sprite->x + gBattleAnimArgs[1]; @@ -1305,6 +1317,7 @@ static void InitPoisonGasCloudAnim(struct Sprite *sprite) sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + gBattleAnimArgs[4]; sprite->data[7] |= GetBattlerSpriteBGPriority(gBattleAnimTarget) << 8; } +#endif if (IsContest()) { @@ -1333,8 +1346,14 @@ static void MovePoisonGasCloud(struct Sprite *sprite) if (sprite->data[0] <= 0) { + #if B_UPDATED_MOVE_DATA >= GEN_5 + s16 x, y; + SetAverageBattlerPositions(gBattleAnimTarget, 0, &x, &y); + sprite->x = x; + #else + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + #endif sprite->data[0] = 80; - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); sprite->data[1] = sprite->x; sprite->data[2] = sprite->x; sprite->y += sprite->y2; diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index c512b67df..17b04cc2b 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -1080,7 +1080,7 @@ void UpdateAnimBg3ScreenSize(bool8 largeScreenSize) } } -void TradeMenuBouncePartySprites(struct Sprite *sprite) +void Trade_MoveSelectedMonToTarget(struct Sprite *sprite) { sprite->data[1] = sprite->x; sprite->data[3] = sprite->y; diff --git a/src/battle_bg.c b/src/battle_bg.c index e56884b55..0ed1eec2e 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -185,7 +185,7 @@ static const struct WindowTemplate sStandardBattleWindowTemplates[] = .bg = 0, .tilemapLeft = 2, .tilemapTop = 55, - .width = 12, //for z move names + .width = 16, //for z move names .height = 2, .paletteNum = 5, .baseBlock = 0x0300, diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 97fc21df9..908363907 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1149,7 +1149,9 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) ClearTemporarySpeciesSpriteData(battlerId, dontClearSubstituteBit); gBattlerPartyIndexes[battlerId] = gBattleResources->bufferA[battlerId][1]; - species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); + species = GetIllusionMonSpecies(battlerId); + if (species == SPECIES_NONE) + species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[battlerId]], battlerId); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 0a9626a13..79283b067 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1177,7 +1177,9 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) ClearTemporarySpeciesSpriteData(battlerId, dontClearSubstituteBit); gBattlerPartyIndexes[battlerId] = gBattleResources->bufferA[battlerId][1]; - species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); + species = GetIllusionMonSpecies(battlerId); + if (species == SPECIES_NONE) + species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[battlerId]], battlerId); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index a57bd2995..82a9d7b7a 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -882,6 +882,7 @@ static void HandleMoveSwitching(void) if (JOY_NEW(A_BUTTON | SELECT_BUTTON)) { + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[gActiveBattler][4]); PlaySE(SE_SELECT); if (gMoveSelectionCursor[gActiveBattler] != gMultiUsePlayerCursor) @@ -973,6 +974,7 @@ static void HandleMoveSwitching(void) MoveSelectionDisplayPpString(); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); + GetUsableZMoves(gActiveBattler, moveInfo->moves); } else if (JOY_NEW(B_BUTTON | SELECT_BUTTON)) { @@ -2917,7 +2919,7 @@ static void PlayerHandleChoosePokemon(void) *(&gBattleStruct->battlerPreventingSwitchout) = gBattleResources->bufferA[gActiveBattler][1] >> 4; *(&gBattleStruct->prevSelectedPartySlot) = gBattleResources->bufferA[gActiveBattler][2]; *(&gBattleStruct->abilityPreventingSwitchout) = (gBattleResources->bufferA[gActiveBattler][3] & 0xFF) | (gBattleResources->bufferA[gActiveBattler][7] << 8); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattlerControllerFuncs[gActiveBattler] = OpenPartyMenuToChooseMon; gBattlerInMenuId = gActiveBattler; } diff --git a/src/battle_dome.c b/src/battle_dome.c index a5f73316e..deae7e64f 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -73,9 +73,33 @@ struct TourneyTreeLineSection #define tMode data[2] #define tPrevTaskId data[3] -#define EFFECTIVENESS_MODE_GOOD 0 -#define EFFECTIVENESS_MODE_BAD 1 -#define EFFECTIVENESS_MODE_AI_VS_AI 2 +enum { + EFFECTIVENESS_MODE_GOOD, + EFFECTIVENESS_MODE_BAD, + EFFECTIVENESS_MODE_AI_VS_AI, +}; + +// Window IDs for the tourney tree +enum { + TOURNEYWIN_NAMES_LEFT, + TOURNEYWIN_NAMES_RIGHT, + TOURNEYWIN_TITLE, +}; + +// Window IDs for the trainer (WIN_TRAINER_*) and match (WIN_MATCH_*) info cards. +// All 9 have a duplicate window at WIN + NUM_INFO_CARD_WINDOWS used by the alternate info card +enum { + WIN_TRAINER_NAME, + WIN_TRAINER_MON1_NAME, + WIN_TRAINER_MON2_NAME, // Used implicitly + WIN_TRAINER_MON3_NAME, // Used implicitly + WIN_TRAINER_FLAVOR_TEXT = WIN_TRAINER_MON1_NAME + FRONTIER_PARTY_SIZE, // Trainer's potential, battle style, and stat texts + WIN_MATCH_NUMBER, + WIN_MATCH_TRAINER_NAME_LEFT, + WIN_MATCH_TRAINER_NAME_RIGHT, + WIN_MATCH_WIN_TEXT, + NUM_INFO_CARD_WINDOWS +}; static u8 GetDomeTrainerMonIvs(u16); static void SwapDomeTrainers(int, int, u16 *); @@ -670,7 +694,7 @@ static const struct BgTemplate sInfoCardBgTemplates[4] = static const struct WindowTemplate sTourneyTreeWindowTemplates[] = { - { + [TOURNEYWIN_NAMES_LEFT] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 3, @@ -679,7 +703,7 @@ static const struct WindowTemplate sTourneyTreeWindowTemplates[] = .paletteNum = 15, .baseBlock = 16, }, - { + [TOURNEYWIN_NAMES_RIGHT] = { .bg = 0, .tilemapLeft = 22, .tilemapTop = 3, @@ -688,7 +712,7 @@ static const struct WindowTemplate sTourneyTreeWindowTemplates[] = .paletteNum = 15, .baseBlock = 144, }, - { + [TOURNEYWIN_TITLE] = { .bg = 0, .tilemapLeft = 8, .tilemapTop = 1, @@ -702,7 +726,7 @@ static const struct WindowTemplate sTourneyTreeWindowTemplates[] = static const struct WindowTemplate sInfoCardWindowTemplates[] = { - { + [WIN_TRAINER_NAME] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 2, @@ -711,7 +735,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 1, }, - { + [WIN_TRAINER_MON1_NAME] = { .bg = 0, .tilemapLeft = 16, .tilemapTop = 5, @@ -720,7 +744,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 53, }, - { + [WIN_TRAINER_MON2_NAME] = { .bg = 0, .tilemapLeft = 19, .tilemapTop = 7, @@ -729,7 +753,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 69, }, - { + [WIN_TRAINER_MON3_NAME] = { .bg = 0, .tilemapLeft = 16, .tilemapTop = 10, @@ -738,7 +762,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 96, }, - { + [WIN_TRAINER_FLAVOR_TEXT] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 12, @@ -747,7 +771,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 112, }, - { + [WIN_MATCH_NUMBER] = { .bg = 0, .tilemapLeft = 5, .tilemapTop = 2, @@ -756,7 +780,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 294, }, - { + [WIN_MATCH_TRAINER_NAME_LEFT] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 5, @@ -765,7 +789,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 340, }, - { + [WIN_MATCH_TRAINER_NAME_RIGHT] = { .bg = 0, .tilemapLeft = 20, .tilemapTop = 5, @@ -774,7 +798,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 356, }, - { + [WIN_MATCH_WIN_TEXT] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 16, @@ -783,7 +807,9 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 372, }, - { + // Duplicate windows used by the alternate info card + // Same as above but on bg 1 instead of bg 0 + [WIN_TRAINER_NAME + NUM_INFO_CARD_WINDOWS] = { .bg = 1, .tilemapLeft = 2, .tilemapTop = 2, @@ -792,7 +818,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 1, }, - { + [WIN_TRAINER_MON1_NAME + NUM_INFO_CARD_WINDOWS] = { .bg = 1, .tilemapLeft = 16, .tilemapTop = 5, @@ -801,7 +827,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 53, }, - { + [WIN_TRAINER_MON2_NAME + NUM_INFO_CARD_WINDOWS] = { .bg = 1, .tilemapLeft = 19, .tilemapTop = 7, @@ -810,7 +836,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 69, }, - { + [WIN_TRAINER_MON3_NAME + NUM_INFO_CARD_WINDOWS] = { .bg = 1, .tilemapLeft = 16, .tilemapTop = 10, @@ -819,7 +845,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 96, }, - { + [WIN_TRAINER_FLAVOR_TEXT + NUM_INFO_CARD_WINDOWS] = { .bg = 1, .tilemapLeft = 2, .tilemapTop = 12, @@ -828,7 +854,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 112, }, - { + [WIN_MATCH_NUMBER + NUM_INFO_CARD_WINDOWS] = { .bg = 1, .tilemapLeft = 5, .tilemapTop = 2, @@ -837,7 +863,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 294, }, - { + [WIN_MATCH_TRAINER_NAME_LEFT + NUM_INFO_CARD_WINDOWS] = { .bg = 1, .tilemapLeft = 2, .tilemapTop = 5, @@ -846,7 +872,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 340, }, - { + [WIN_MATCH_TRAINER_NAME_RIGHT + NUM_INFO_CARD_WINDOWS] = { .bg = 1, .tilemapLeft = 20, .tilemapTop = 5, @@ -855,7 +881,7 @@ static const struct WindowTemplate sInfoCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 356, }, - { + [WIN_MATCH_WIN_TEXT + NUM_INFO_CARD_WINDOWS] = { .bg = 1, .tilemapLeft = 2, .tilemapTop = 16, @@ -1397,26 +1423,27 @@ static const u8 sCompetitorRangeByMatch[DOME_TOURNAMENT_MATCHES_COUNT][3] = { NUM_POSSIBLE_MATCH_TRAINERS(DOME_FINAL) * 0, NUM_POSSIBLE_MATCH_TRAINERS(DOME_FINAL), DOME_FINAL}, }; -// 1st value is the windowId (0 for left column, 1 for right column) -// 2nd value is the y coord +#define NAME_ROW_HEIGHT 16 + +// 1st value is the windowId, 2nd value is the y coord static const u8 sTrainerNamePositions[DOME_TOURNAMENT_TRAINERS_COUNT][2] = { - { 0, 0}, - { 1, 112}, - { 1, 0}, - { 0, 112}, - { 0, 48}, - { 1, 64}, - { 1, 48}, - { 0, 64}, - { 0, 16}, - { 1, 96}, - { 1, 16}, - { 0, 96}, - { 0, 32}, - { 1, 80}, - { 1, 32}, - { 0, 80}, + { TOURNEYWIN_NAMES_LEFT, 0 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_RIGHT, 7 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_RIGHT, 0 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_LEFT, 7 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_LEFT, 3 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_RIGHT, 4 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_RIGHT, 3 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_LEFT, 4 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_LEFT, 1 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_RIGHT, 6 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_RIGHT, 1 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_LEFT, 6 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_LEFT, 2 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_RIGHT, 5 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_RIGHT, 2 * NAME_ROW_HEIGHT}, + { TOURNEYWIN_NAMES_LEFT, 5 * NAME_ROW_HEIGHT}, }; // Coords for the pokeballs on the tourney tree that act as buttons to view trainer/match info @@ -2427,7 +2454,7 @@ static void InitDomeTrainers(void) break; } - if (sTrainerNamePositions[i][0] != 0) + if (sTrainerNamePositions[i][0] != TOURNEYWIN_NAMES_LEFT) { j = 0; DOME_TRAINERS[j].trainerId = TRAINER_FRONTIER_BRAIN; @@ -3420,11 +3447,11 @@ static void Task_HandleInfoCardInput(u8 taskId) case MATCHCARD_INPUT_UP ... MATCHCARD_INPUT_RIGHT: gTasks[taskId].data[5] = i; if (gTasks[taskId].tUsingAlternateSlot) - windowId = 9; + windowId = NUM_INFO_CARD_WINDOWS; else windowId = 0; - for (i = windowId; i < windowId + 9; i++) + for (i = windowId; i < windowId + NUM_INFO_CARD_WINDOWS; i++) { CopyWindowToVram(i, COPYWIN_GFX); FillWindowPixelBuffer(i, PIXEL_FILL(0)); @@ -4246,14 +4273,14 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) int trainerId = 0; u8 nature = 0; int arrId = 0; - int windowId = 0; + int windowId = WIN_TRAINER_NAME; int x = 0, y = 0; u8 palSlot = 0; s16 *allocatedArray = AllocZeroed(sizeof(s16) * ALLOC_ARRAY_SIZE); trainerId = DOME_TRAINERS[trainerTourneyId].trainerId; if (flags & CARD_ALTERNATE_SLOT) - arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = 9, palSlot = 2; + arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = WIN_TRAINER_NAME + NUM_INFO_CARD_WINDOWS, palSlot = 2; if (flags & MOVE_CARD_RIGHT) x = DISPLAY_WIDTH + 16; if (flags & MOVE_CARD_DOWN) @@ -4371,19 +4398,19 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) else textPrinter.currentChar = gSpeciesNames[gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].species]; - textPrinter.windowId = 1 + i + windowId; + textPrinter.windowId = WIN_TRAINER_MON1_NAME + i + windowId; if (i == 1) textPrinter.currentX = 7; else textPrinter.currentX = 0; - PutWindowTilemap(1 + i + windowId); - CopyWindowToVram(1 + i + windowId, COPYWIN_FULL); + PutWindowTilemap(WIN_TRAINER_MON1_NAME + i + windowId); + CopyWindowToVram(WIN_TRAINER_MON1_NAME + i + windowId, COPYWIN_FULL); AddTextPrinter(&textPrinter, 0, NULL); } - PutWindowTilemap(windowId + 4); - CopyWindowToVram(windowId + 4, COPYWIN_FULL); + PutWindowTilemap(windowId + WIN_TRAINER_FLAVOR_TEXT); + CopyWindowToVram(windowId + WIN_TRAINER_FLAVOR_TEXT, COPYWIN_FULL); // Print text about trainers potential in the tourney if (trainerId == TRAINER_FRONTIER_BRAIN) @@ -4392,7 +4419,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) textPrinter.currentChar = sBattleDomePotentialTexts[trainerTourneyId]; textPrinter.fontId = FONT_NORMAL; - textPrinter.windowId = windowId + 4; + textPrinter.windowId = windowId + WIN_TRAINER_FLAVOR_TEXT; textPrinter.currentX = 0; textPrinter.y = 4; textPrinter.currentY = 4; @@ -4713,7 +4740,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) u8 palSlot = 0; if (flags & CARD_ALTERNATE_SLOT) - arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = 9, palSlot = 2; + arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = NUM_INFO_CARD_WINDOWS, palSlot = 2; if (flags & MOVE_CARD_RIGHT) x = DISPLAY_WIDTH + 16; if (flags & MOVE_CARD_DOWN) @@ -4855,10 +4882,10 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) textPrinter.shadowColor = TEXT_DYNAMIC_COLOR_4; StringExpandPlaceholders(gStringVar4, sBattleDomeWinTexts[winStringId]); textPrinter.currentChar = gStringVar4; - textPrinter.windowId = windowId + 8; + textPrinter.windowId = windowId + WIN_MATCH_WIN_TEXT; textPrinter.fontId = FONT_NORMAL; - PutWindowTilemap(windowId + 8); - CopyWindowToVram(windowId + 8, COPYWIN_FULL); + PutWindowTilemap(windowId + WIN_MATCH_WIN_TEXT); + CopyWindowToVram(windowId + WIN_MATCH_WIN_TEXT, COPYWIN_FULL); textPrinter.currentX = 0; textPrinter.currentY = textPrinter.y = 0; AddTextPrinter(&textPrinter, 0, NULL); @@ -4874,11 +4901,11 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) textPrinter.fontId = FONT_SHORT; textPrinter.letterSpacing = 2; textPrinter.currentChar = gStringVar1; - textPrinter.windowId = windowId + 6; + textPrinter.windowId = windowId + WIN_MATCH_TRAINER_NAME_LEFT; textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing); textPrinter.currentY = textPrinter.y = 2; - PutWindowTilemap(windowId + 6); - CopyWindowToVram(windowId + 6, COPYWIN_FULL); + PutWindowTilemap(windowId + WIN_MATCH_TRAINER_NAME_LEFT); + CopyWindowToVram(windowId + WIN_MATCH_TRAINER_NAME_LEFT, COPYWIN_FULL); AddTextPrinter(&textPrinter, 0, NULL); // Print right trainer's name. @@ -4890,21 +4917,21 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) CopyDomeTrainerName(gStringVar1, trainerIds[1]); textPrinter.currentChar = gStringVar1; - textPrinter.windowId = windowId + 7; + textPrinter.windowId = windowId + WIN_MATCH_TRAINER_NAME_RIGHT; textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing); textPrinter.currentY = textPrinter.y = 2; - PutWindowTilemap(windowId + 7); - CopyWindowToVram(windowId + 7, COPYWIN_FULL); + PutWindowTilemap(windowId + WIN_MATCH_TRAINER_NAME_RIGHT); + CopyWindowToVram(windowId + WIN_MATCH_TRAINER_NAME_RIGHT, COPYWIN_FULL); AddTextPrinter(&textPrinter, 0, NULL); // Print match number. textPrinter.letterSpacing = 0; textPrinter.currentChar = sBattleDomeMatchNumberTexts[matchNo]; - textPrinter.windowId = windowId + 5; + textPrinter.windowId = windowId + WIN_MATCH_NUMBER; textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0xA0, textPrinter.letterSpacing); textPrinter.currentY = textPrinter.y = 2; - PutWindowTilemap(windowId + 5); - CopyWindowToVram(windowId + 5, COPYWIN_FULL); + PutWindowTilemap(windowId + WIN_MATCH_NUMBER); + CopyWindowToVram(windowId + WIN_MATCH_NUMBER, COPYWIN_FULL); AddTextPrinter(&textPrinter, 0, NULL); } @@ -5338,7 +5365,7 @@ static void Task_ShowTourneyTree(u8 taskId) case 4: textPrinter.fontId = FONT_SHORT; textPrinter.currentChar = gText_BattleTourney; - textPrinter.windowId = 2; + textPrinter.windowId = TOURNEYWIN_TITLE; textPrinter.x = 0; textPrinter.y = 0; textPrinter.letterSpacing = 2; @@ -5424,7 +5451,7 @@ static void Task_ShowTourneyTree(u8 taskId) } } - if (sTrainerNamePositions[i][0] == 0) + if (sTrainerNamePositions[i][0] == TOURNEYWIN_NAMES_LEFT) textPrinter.currentX = GetStringWidthDifference(textPrinter.fontId, gDisplayedStringBattle, 0x3D, textPrinter.letterSpacing); else textPrinter.currentX = 3; @@ -5436,12 +5463,12 @@ static void Task_ShowTourneyTree(u8 taskId) gTasks[taskId].tState++; break; case 5: - PutWindowTilemap(0); - PutWindowTilemap(1); - PutWindowTilemap(2); - CopyWindowToVram(0, COPYWIN_FULL); - CopyWindowToVram(1, COPYWIN_FULL); - CopyWindowToVram(2, COPYWIN_FULL); + PutWindowTilemap(TOURNEYWIN_NAMES_LEFT); + PutWindowTilemap(TOURNEYWIN_NAMES_RIGHT); + PutWindowTilemap(TOURNEYWIN_TITLE); + CopyWindowToVram(TOURNEYWIN_NAMES_LEFT, COPYWIN_FULL); + CopyWindowToVram(TOURNEYWIN_NAMES_RIGHT, COPYWIN_FULL); + CopyWindowToVram(TOURNEYWIN_TITLE, COPYWIN_FULL); SetHBlankCallback(HblankCb_TourneyTree); SetVBlankCallback(VblankCb_TourneyTree); if (r4 == 2) @@ -5538,7 +5565,7 @@ static void Task_HandleStaticTourneyTreeInput(u8 taskId) if (DOME_TRAINERS[i].eliminatedAt == gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1 && DOME_TRAINERS[i].isEliminated) { - if (sTrainerNamePositions[i][0] == 0) + if (sTrainerNamePositions[i][0] == TOURNEYWIN_NAMES_LEFT) textPrinter.currentX = GetStringWidthDifference(textPrinter.fontId, gDisplayedStringBattle, 0x3D, textPrinter.letterSpacing); else textPrinter.currentX = 3; diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 193452613..389832fb2 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -557,6 +557,9 @@ static void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battlerId, bool32 op if (illusionMon != NULL) mon = illusionMon; + if (GetMonData(mon, MON_DATA_IS_EGG)) // Don't load GFX of egg pokemon. + return; + monsPersonality = GetMonData(mon, MON_DATA_PERSONALITY); if (gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies == SPECIES_NONE) { diff --git a/src/battle_main.c b/src/battle_main.c index f316846c6..96b2e90a5 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3124,7 +3124,6 @@ void SwitchInClearSetData(void) gDisableStructs[gActiveBattler].substituteHP = disableStructCopy.substituteHP; gDisableStructs[gActiveBattler].battlerWithSureHit = disableStructCopy.battlerWithSureHit; gDisableStructs[gActiveBattler].perishSongTimer = disableStructCopy.perishSongTimer; - gDisableStructs[gActiveBattler].perishSongTimerStartValue = disableStructCopy.perishSongTimerStartValue; gDisableStructs[gActiveBattler].battlerPreventingEscape = disableStructCopy.battlerPreventingEscape; } @@ -3656,7 +3655,7 @@ static void TryDoEventsBeforeFirstTurn(void) { for (i = 0; i < gBattlersCount; i++) { - if (gBattleMons[i].hp == 0 || gBattleMons[i].species == SPECIES_NONE) + if (gBattleMons[i].hp == 0 || gBattleMons[i].species == SPECIES_NONE || GetMonData(GetBattlerPartyData(i), MON_DATA_IS_EGG)) gAbsentBattlerFlags |= gBitTable[i]; } } @@ -3867,8 +3866,8 @@ void BattleTurnPassed(void) BattleScriptExecute(BattleScript_PalacePrintFlavorText); else if (gBattleTypeFlags & BATTLE_TYPE_ARENA && gBattleStruct->arenaTurnCounter == 0) BattleScriptExecute(BattleScript_ArenaTurnBeginning); - else if (ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), gTrainerBattleOpponent_A, TRAINER_SLIDE_LAST_LOW_HP)) - BattleScriptExecute(BattleScript_TrainerSlideMsgEnd2); + else if ((i = ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), TRAINER_SLIDE_LAST_LOW_HP))) + BattleScriptExecute(i == 1 ? BattleScript_TrainerASlideMsgEnd2 : BattleScript_TrainerBSlideMsgEnd2); } u8 IsRunningFromBattleImpossible(void) @@ -4955,6 +4954,9 @@ static void CheckChosenMoveForEffectsBeforeTurnStarts(void) case MOVE_BEAK_BLAST: BattleScriptExecute(BattleScript_BeakBlastSetUp); return; + case MOVE_SHELL_TRAP: + BattleScriptExecute(BattleScript_ShellTrapSetUp); + return; } } } diff --git a/src/battle_message.c b/src/battle_message.c index 34542e58d..29580ded0 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -306,6 +306,7 @@ static const u8 sText_PreventedFromWorking[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_ static const u8 sText_PkmnsXMadeItIneffective[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nmade it ineffective!"); static const u8 sText_PkmnsXPreventsFlinching[] = _("{B_EFF_NAME_WITH_PREFIX}'s {B_EFF_ABILITY}\nprevents flinching!"); static const u8 sText_PkmnsXPreventsYsZ[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\nprevents {B_DEF_NAME_WITH_PREFIX}'s\l{B_DEF_ABILITY} from working!"); +static const u8 sText_PkmnsAbilityPreventsAbility[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nprevents {B_DEF_NAME_WITH_PREFIX}'s\l{B_DEF_ABILITY} from working!"); static const u8 sText_PkmnsXCuredItsYProblem[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\ncured its {B_BUFF1} problem!"); static const u8 sText_PkmnsXHadNoEffectOnY[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nhad no effect on {B_EFF_NAME_WITH_PREFIX}!"); const u8 gText_StatSharply[] = _("sharply "); @@ -773,9 +774,13 @@ static const u8 sText_StatWasHeightened[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s static const u8 sText_ElectricTerrainActivatedAbility[] = _("The Electric Terrain activated\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}!"); static const u8 sText_AbilityWeakenedSurroundingMonsStat[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\nweakened the {B_BUFF1} of\lall surrounding Pokémon!\p"); static const u8 sText_AttackerGainedStrengthFromTheFallen[] = _("{B_ATK_NAME_WITH_PREFIX} gained strength\nfrom the fallen!"); +static const u8 sText_PrepareShellTrap[] = _("{B_ATK_NAME_WITH_PREFIX} set a shell trap!"); +static const u8 sText_ShellTrapDidntWork[] = _("{B_ATK_NAME_WITH_PREFIX}'s shell trap didn't work!"); +static const u8 sText_CouldntFullyProtect[] = _("{B_DEF_NAME_WITH_PREFIX} couldn't fully protect\nitself and got hurt!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_COULDNTFULLYPROTECT - BATTLESTRINGS_TABLE_START] = sText_CouldntFullyProtect, [STRINGID_ATTACKERGAINEDSTRENGTHFROMTHEFALLEN - BATTLESTRINGS_TABLE_START] = sText_AttackerGainedStrengthFromTheFallen, [STRINGID_ABILITYWEAKENEDFSURROUNDINGMONSSTAT - BATTLESTRINGS_TABLE_START] = sText_AbilityWeakenedSurroundingMonsStat, [STRINGID_ELECTRICTERRAINACTIVATEDABILITY - BATTLESTRINGS_TABLE_START] = sText_ElectricTerrainActivatedAbility, @@ -799,6 +804,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ZMOVEHPTRAP - BATTLESTRINGS_TABLE_START] = sText_ZMoveHpSwitchInTrap, [STRINGID_PLAYERLOSTTOENEMYTRAINER - BATTLESTRINGS_TABLE_START] = sText_PlayerLostToEnemyTrainer, [STRINGID_PLAYERPAIDPRIZEMONEY - BATTLESTRINGS_TABLE_START] = sText_PlayerPaidPrizeMoney, + [STRINGID_SHELLTRAPDIDNTWORK - BATTLESTRINGS_TABLE_START] = sText_ShellTrapDidntWork, + [STRINGID_PREPARESHELLTRAP - BATTLESTRINGS_TABLE_START] = sText_PrepareShellTrap, [STRINGID_COURTCHANGE - BATTLESTRINGS_TABLE_START] = sText_CourtChange, [STRINGID_HEATUPBEAK - BATTLESTRINGS_TABLE_START] = sText_HeatingUpBeak, [STRINGID_METEORBEAMCHARGING - BATTLESTRINGS_TABLE_START] = sText_MeteorBeamCharging, @@ -1402,6 +1409,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_PKMNTOOKTARGETHIGH - BATTLESTRINGS_TABLE_START] = sText_PkmnTookTargetHigh, [STRINGID_TARGETTOOHEAVY - BATTLESTRINGS_TABLE_START] = sText_TargetTooHeavy, [STRINGID_ATTACKERLOSTELECTRICTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostElectricType, + [STRINGID_PKMNSABILITYPREVENTSABILITY - BATTLESTRINGS_TABLE_START] = sText_PkmnsAbilityPreventsAbility, }; const u16 gZEffectStringIds[] = @@ -1592,7 +1600,6 @@ const u16 gUproarAwakeStringIds[] = { [B_MSG_CANT_SLEEP_UPROAR] = STRINGID_PKMNCANTSLEEPINUPROAR2, [B_MSG_UPROAR_KEPT_AWAKE] = STRINGID_UPROARKEPTPKMNAWAKE, - [B_MSG_STAYED_AWAKE_USING] = STRINGID_PKMNSTAYEDAWAKEUSING, }; const u16 gStatUpStringIds[] = @@ -2082,288 +2089,236 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 1, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_DYNAMIC_COLOR_6, - .shadowColor = TEXT_COLOR_GREEN, + .fgColor = 1, + .bgColor = 15, + .shadowColor = 6, }, [B_WIN_ACTION_PROMPT] = { .fillValue = PIXEL_FILL(0xF), .fontId = FONT_NORMAL, .x = 1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_DYNAMIC_COLOR_6, - .shadowColor = TEXT_COLOR_GREEN, + .fgColor = 1, + .bgColor = 15, + .shadowColor = 6, }, [B_WIN_ACTION_MENU] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_MOVE_NAME_1] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_MOVE_NAME_2] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_MOVE_NAME_3] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_MOVE_NAME_4] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_PP] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_3, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_2, + .fgColor = 12, + .bgColor = 14, + .shadowColor = 11, }, [B_WIN_DUMMY] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_PP_REMAINING] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 2, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_3, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_2, + .fgColor = 12, + .bgColor = 14, + .shadowColor = 11, }, [B_WIN_MOVE_TYPE] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_SWITCH_PROMPT] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_YESNO] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_LEVEL_UP_BOX] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_LEVEL_UP_BANNER] = { .fillValue = PIXEL_FILL(0), .fontId = FONT_NORMAL, .x = 32, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_COLOR_TRANSPARENT, - .shadowColor = TEXT_COLOR_DARK_GRAY, + .fgColor = 1, + .shadowColor = 2, }, [B_WIN_VS_PLAYER] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_VS_OPPONENT] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_VS_MULTI_PLAYER_1] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_VS_MULTI_PLAYER_2] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_VS_MULTI_PLAYER_3] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_VS_MULTI_PLAYER_4] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_VS_OUTCOME_DRAW] = { .fillValue = PIXEL_FILL(0), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_COLOR_TRANSPARENT, - .shadowColor = TEXT_COLOR_GREEN, + .fgColor = 1, + .shadowColor = 6, }, [B_WIN_VS_OUTCOME_LEFT] = { .fillValue = PIXEL_FILL(0), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_COLOR_TRANSPARENT, - .shadowColor = TEXT_COLOR_GREEN, + .fgColor = 1, + .shadowColor = 6, }, [B_WIN_VS_OUTCOME_RIGHT] = { .fillValue = PIXEL_FILL(0x0), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_COLOR_TRANSPARENT, - .shadowColor = TEXT_COLOR_GREEN, + .fgColor = 1, + .shadowColor = 6, }, }; @@ -2374,276 +2329,229 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 1, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_DYNAMIC_COLOR_6, - .shadowColor = TEXT_COLOR_GREEN, + .fgColor = 1, + .bgColor = 15, + .shadowColor = 6, }, [B_WIN_ACTION_PROMPT] = { .fillValue = PIXEL_FILL(0xF), .fontId = FONT_NORMAL, .x = 1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_DYNAMIC_COLOR_6, - .shadowColor = TEXT_COLOR_GREEN, + .fgColor = 1, + .bgColor = 15, + .shadowColor = 6, }, [B_WIN_ACTION_MENU] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_MOVE_NAME_1] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_MOVE_NAME_2] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_MOVE_NAME_3] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_MOVE_NAME_4] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_PP] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_3, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_2, + .fgColor = 12, + .bgColor = 14, + .shadowColor = 11, }, [B_WIN_DUMMY] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_PP_REMAINING] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 2, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_3, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_2, + .fgColor = 12, + .bgColor = 14, + .shadowColor = 11, }, [B_WIN_MOVE_TYPE] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_SWITCH_PROMPT] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NARROW, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_YESNO] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_LEVEL_UP_BOX] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [B_WIN_LEVEL_UP_BANNER] = { .fillValue = PIXEL_FILL(0), .fontId = FONT_NORMAL, .x = 32, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_COLOR_TRANSPARENT, - .shadowColor = TEXT_COLOR_DARK_GRAY, + .fgColor = 1, + .shadowColor = 2, }, [ARENA_WIN_PLAYER_NAME] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_COLOR_WHITE, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 1, + .bgColor = 14, + .shadowColor = 15, }, [ARENA_WIN_VS] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [ARENA_WIN_OPPONENT_NAME] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [ARENA_WIN_MIND] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [ARENA_WIN_SKILL] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [ARENA_WIN_BODY] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [ARENA_WIN_JUDGMENT_TITLE] = { .fillValue = PIXEL_FILL(0xE), .fontId = FONT_NORMAL, .x = -1, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 0, - .fgColor = TEXT_DYNAMIC_COLOR_4, - .bgColor = TEXT_DYNAMIC_COLOR_5, - .shadowColor = TEXT_DYNAMIC_COLOR_6, + .fgColor = 13, + .bgColor = 14, + .shadowColor = 15, }, [ARENA_WIN_JUDGMENT_TEXT] = { .fillValue = PIXEL_FILL(0x1), .fontId = FONT_NORMAL, .x = 0, .y = 1, - .letterSpacing = 0, - .lineSpacing = 0, .speed = 1, - .fgColor = TEXT_COLOR_DARK_GRAY, - .bgColor = TEXT_COLOR_WHITE, - .shadowColor = TEXT_COLOR_LIGHT_GRAY, + .fgColor = 2, + .bgColor = 1, + .shadowColor = 3, }, }; @@ -3912,8 +3820,13 @@ void SetPpNumbersPaletteInMoveSelection(void) { struct ChooseMoveStruct *chooseMoveStruct = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[gActiveBattler][4]); const u16 *palPtr = gPPTextPalette; - u8 var = GetCurrentPpToMaxPpState(chooseMoveStruct->currentPp[gMoveSelectionCursor[gActiveBattler]], + u8 var; + + if (!gBattleStruct->zmove.viewing) + var = GetCurrentPpToMaxPpState(chooseMoveStruct->currentPp[gMoveSelectionCursor[gActiveBattler]], chooseMoveStruct->maxPp[gMoveSelectionCursor[gActiveBattler]]); + else + var = GetCurrentPpToMaxPpState(chooseMoveStruct->currentPp[gMoveSelectionCursor[gActiveBattler]], gBattleMoves[gMoveSelectionCursor[gActiveBattler]].pp); gPlttBufferUnfaded[92] = palPtr[(var * 2) + 0]; gPlttBufferUnfaded[91] = palPtr[(var * 2) + 1]; @@ -3976,11 +3889,11 @@ static const struct TrainerSlide sTrainerSlides[] = */ }; -static u32 GetEnemyMonCount(bool32 onlyAlive) +static u32 GetEnemyMonCount(u32 firstId, u32 lastId, bool32 onlyAlive) { u32 i, count = 0; - for (i = 0; i < PARTY_SIZE; i++) + for (i = firstId; i < lastId; i++) { u32 species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2, NULL); if (species != SPECIES_NONE @@ -4000,12 +3913,33 @@ static bool32 IsBattlerHpLow(u32 battler) return FALSE; } -bool32 ShouldDoTrainerSlide(u32 battlerId, u32 trainerId, u32 which) +u32 ShouldDoTrainerSlide(u32 battlerId, u32 which) { - s32 i; + u32 i, firstId, lastId, trainerId, retValue = 1; if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) || GetBattlerSide(battlerId) != B_SIDE_OPPONENT) - return FALSE; + return 0; + + // Two opponents support. + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + { + if (gBattlerPartyIndexes[battlerId] >= 3) + { + firstId = 3, lastId = PARTY_SIZE; + trainerId = gTrainerBattleOpponent_B; + retValue = 2; + } + else + { + firstId = 0, lastId = 3; + trainerId = gTrainerBattleOpponent_A; + } + } + else + { + firstId = 0, lastId = PARTY_SIZE; + trainerId = gTrainerBattleOpponent_A; + } for (i = 0; i < ARRAY_COUNT(sTrainerSlides); i++) { @@ -4015,28 +3949,28 @@ bool32 ShouldDoTrainerSlide(u32 battlerId, u32 trainerId, u32 which) switch (which) { case TRAINER_SLIDE_LAST_SWITCHIN: - if (sTrainerSlides[i].msgLastSwitchIn != NULL && GetEnemyMonCount(TRUE) == 1) + if (sTrainerSlides[i].msgLastSwitchIn != NULL && !CanBattlerSwitch(battlerId)) { gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgLastSwitchIn; - return TRUE; + return retValue; } break; case TRAINER_SLIDE_LAST_LOW_HP: if (sTrainerSlides[i].msgLastLowHp != NULL - && GetEnemyMonCount(TRUE) == 1 + && GetEnemyMonCount(firstId, lastId, TRUE) == 1 && IsBattlerHpLow(battlerId) && !gBattleStruct->trainerSlideLowHpMsgDone) { gBattleStruct->trainerSlideLowHpMsgDone = TRUE; gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgLastLowHp; - return TRUE; + return retValue; } break; case TRAINER_SLIDE_FIRST_DOWN: - if (sTrainerSlides[i].msgFirstDown != NULL && GetEnemyMonCount(TRUE) == GetEnemyMonCount(FALSE) - 1) + if (sTrainerSlides[i].msgFirstDown != NULL && GetEnemyMonCount(firstId, lastId, TRUE) == GetEnemyMonCount(firstId, lastId, FALSE) - 1) { gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgFirstDown; - return TRUE; + return retValue; } break; } @@ -4044,5 +3978,5 @@ bool32 ShouldDoTrainerSlide(u32 battlerId, u32 trainerId, u32 which) } } - return FALSE; + return 0; } diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index 336582ba5..ffed24980 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -284,7 +284,7 @@ static const u8 sFloorTemplateOffsets[FRONTIER_STAGES_PER_CHALLENGE] = 0, 4, 9, 14, 19, 24, 29 }; -static const u16 sPickupItemsLvl50[TOTAL_ROUNDS][PICKUP_ITEMS_PER_ROUND] = +static const u16 sPickupItemsLvl50[TOTAL_PYRAMID_ROUNDS][PICKUP_ITEMS_PER_ROUND] = { {ITEM_HYPER_POTION, ITEM_FLUFFY_TAIL, ITEM_CHERI_BERRY, ITEM_ETHER, ITEM_LUM_BERRY, ITEM_REVIVE, ITEM_BRIGHT_POWDER, ITEM_SHELL_BELL, ITEM_MAX_REVIVE, ITEM_SACRED_ASH}, {ITEM_HYPER_POTION, ITEM_DIRE_HIT, ITEM_PECHA_BERRY, ITEM_ETHER, ITEM_LEPPA_BERRY, ITEM_REVIVE, ITEM_LEFTOVERS, ITEM_CHOICE_BAND, ITEM_FULL_RESTORE, ITEM_MAX_ELIXIR}, @@ -308,7 +308,7 @@ static const u16 sPickupItemsLvl50[TOTAL_ROUNDS][PICKUP_ITEMS_PER_ROUND] = {ITEM_HYPER_POTION, ITEM_X_DEFENSE, ITEM_LUM_BERRY, ITEM_ETHER, ITEM_LEPPA_BERRY, ITEM_REVIVE, ITEM_QUICK_CLAW, ITEM_KINGS_ROCK, ITEM_FULL_RESTORE, ITEM_MAX_ELIXIR}, }; -static const u16 sPickupItemsLvlOpen[TOTAL_ROUNDS][PICKUP_ITEMS_PER_ROUND] = +static const u16 sPickupItemsLvlOpen[TOTAL_PYRAMID_ROUNDS][PICKUP_ITEMS_PER_ROUND] = { {ITEM_HYPER_POTION, ITEM_FLUFFY_TAIL, ITEM_CHERI_BERRY, ITEM_ETHER, ITEM_LUM_BERRY, ITEM_REVIVE, ITEM_BRIGHT_POWDER, ITEM_SHELL_BELL, ITEM_MAX_REVIVE, ITEM_SACRED_ASH}, {ITEM_HYPER_POTION, ITEM_DIRE_HIT, ITEM_PECHA_BERRY, ITEM_ETHER, ITEM_LEPPA_BERRY, ITEM_REVIVE, ITEM_LEFTOVERS, ITEM_CHOICE_BAND, ITEM_FULL_RESTORE, ITEM_MAX_ELIXIR}, @@ -977,10 +977,10 @@ static void SetPickupItem(void) u8 id; u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u32 floor = gSaveBlock2Ptr->frontier.curChallengeBattleNum; - u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS; + u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_PYRAMID_ROUNDS; - if (round >= TOTAL_ROUNDS) - round = TOTAL_ROUNDS - 1; + if (round >= TOTAL_PYRAMID_ROUNDS) + round = TOTAL_PYRAMID_ROUNDS - 1; id = GetPyramidFloorTemplateId(); itemIndex = (gSpecialVar_LastTalked - sPyramidFloorTemplates[id].numTrainers) - 1; @@ -1345,10 +1345,10 @@ void GenerateBattlePyramidWildMon(void) const struct PyramidWildMon *wildMons; u32 id; u32 lvl = gSaveBlock2Ptr->frontier.lvlMode; - u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS; + u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_PYRAMID_ROUNDS; - if (round >= TOTAL_ROUNDS) - round = TOTAL_ROUNDS - 1; + if (round >= TOTAL_PYRAMID_ROUNDS) + round = TOTAL_PYRAMID_ROUNDS - 1; if (lvl != FRONTIER_LVL_50) wildMons = sOpenLevelWildMonPointers[round]; @@ -1961,8 +1961,8 @@ u16 GetBattlePyramidPickupItemId(void) u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; int round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE); - if (round >= TOTAL_ROUNDS) - round = TOTAL_ROUNDS - 1; + if (round >= TOTAL_PYRAMID_ROUNDS) + round = TOTAL_PYRAMID_ROUNDS - 1; rand = Random() % 100; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a534fd274..a445786ce 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -60,6 +60,37 @@ #include "battle_util.h" #include "constants/pokemon.h" +// Helper for accessing command arguments and advancing gBattlescriptCurrInstr. +// +// For example accuracycheck is defined as: +// +// .macro accuracycheck failInstr:req, move:req +// .byte 0x1 +// .4byte \failInstr +// .2byte \move +// .endm +// +// Which corresponds to: +// +// CMD_ARGS(const u8 *failInstr, u16 move); +// +// The arguments can be accessed as cmd->failInstr and cmd->move. +// gBattlescriptCurrInstr = cmd->nextInstr; advances to the next instruction. +#define CMD_ARGS(...) const struct __attribute__((packed)) { u8 opcode; MEMBERS(__VA_ARGS__) const u8 nextInstr[0]; } *const cmd = (const void *)gBattlescriptCurrInstr +#define VARIOUS_ARGS(...) CMD_ARGS(u8 battler, u8 id, ##__VA_ARGS__) +#define NATIVE_ARGS(...) CMD_ARGS(void (*func)(void), ##__VA_ARGS__) + +#define MEMBERS(...) VARARG_8(MEMBERS_, __VA_ARGS__) +#define MEMBERS_0() +#define MEMBERS_1(a) a; +#define MEMBERS_2(a, b) a; b; +#define MEMBERS_3(a, b, c) a; b; c; +#define MEMBERS_4(a, b, c, d) a; b; c; d; +#define MEMBERS_5(a, b, c, d, e) a; b; c; d; e; +#define MEMBERS_6(a, b, c, d, e, f) a; b; c; d; e; f; +#define MEMBERS_7(a, b, c, d, e, f, g) a; b; c; d; e; f; g; +#define MEMBERS_8(a, b, c, d, e, f, g, h) a; b; c; d; e; f; g; h; + extern struct Evolution gEvolutionTable[][EVOS_PER_MON]; extern const u8 *const gBattleScriptsForMoveEffects[]; @@ -318,6 +349,8 @@ static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite *sprite); static bool32 CriticalCapture(u32 odds); static void BestowItem(u32 battlerAtk, u32 battlerDef); static bool8 IsFinalStrikeEffect(u16 move); +static void TryUpdateRoundTurnOrder(void); +static bool32 ChangeOrderTargetAfterAttacker(void); static void Cmd_attackcanceler(void); static void Cmd_accuracycheck(void); @@ -451,7 +484,7 @@ static void Cmd_manipulatedamage(void); static void Cmd_trysetrest(void); static void Cmd_jumpifnotfirstturn(void); static void Cmd_setmiracleeye(void); -static void Cmd_jumpifcantmakeasleep(void); +static void Cmd_jumpifuproarwakes(void); static void Cmd_stockpile(void); static void Cmd_stockpiletobasedamage(void); static void Cmd_stockpiletohpheal(void); @@ -710,7 +743,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_trysetrest, //0x81 Cmd_jumpifnotfirstturn, //0x82 Cmd_setmiracleeye, //0x83 - Cmd_jumpifcantmakeasleep, //0x84 + Cmd_jumpifuproarwakes, //0x84 Cmd_stockpile, //0x85 Cmd_stockpiletobasedamage, //0x86 Cmd_stockpiletohpheal, //0x87 @@ -1412,6 +1445,8 @@ static bool32 TryAegiFormChange(void) static void Cmd_attackcanceler(void) { + CMD_ARGS(); + s32 i, moveType; u16 attackerAbility = GetBattlerAbility(gBattlerAttacker); @@ -1529,6 +1564,7 @@ static void Cmd_attackcanceler(void) PressurePPLose(gBattlerAttacker, gBattlerTarget, MOVE_MAGIC_COAT); gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleStruct->atkCancellerTracker = CANCELLER_POWDER_MOVE; // Edge case for bouncing a powder move against a grass type pokemon. if (BlocksPrankster(gCurrentMove, gBattlerTarget, gBattlerAttacker, TRUE)) { // Opponent used a prankster'd magic coat -> reflected status move should fail against a dark-type attacker @@ -1546,11 +1582,20 @@ static void Cmd_attackcanceler(void) && gBattleMoves[gCurrentMove].flags & FLAG_MAGIC_COAT_AFFECTED && !gProtectStructs[gBattlerAttacker].usesBouncedMove) { - RecordAbilityBattle(gBattlerTarget, ABILITY_MAGIC_BOUNCE); gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleStruct->atkCancellerTracker = CANCELLER_POWDER_MOVE; // Edge case for bouncing a powder move against a grass type pokemon. BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; + gBattlerAbility = gBattlerTarget; + return; + } + + // Z-moves and Max Moves bypass protection, but deal reduced damage (factored in CalcFinalDmg) + if (gBattleStruct->zmove.active && IS_BATTLER_PROTECTED(gBattlerTarget)) + { + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = BattleScript_CouldntFullyProtect; return; } @@ -1602,16 +1647,16 @@ static void Cmd_attackcanceler(void) gMultiHitCounter = 0; } gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (gProtectStructs[gBattlerTarget].beakBlastCharge && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) { gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -1636,15 +1681,17 @@ static bool32 JumpIfMoveFailed(u8 adder, u16 move) static void Cmd_jumpifaffectedbyprotect(void) { + CMD_ARGS(const u8 *failInstr); + if (IsBattlerProtected(gBattlerTarget, gCurrentMove)) { gMoveResultFlags |= MOVE_RESULT_MISSED; - JumpIfMoveFailed(5, 0); + JumpIfMoveFailed(sizeof(*cmd), MOVE_NONE); gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; } else { - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -1835,7 +1882,9 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u static void Cmd_accuracycheck(void) { - u16 type, move = T2_READ_16(gBattlescriptCurrInstr + 5); + CMD_ARGS(const u8 *failInstr, u16 move); + + u16 type, move = cmd->move; u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, move); if (move == ACC_CURR_MOVE) @@ -1844,18 +1893,18 @@ static void Cmd_accuracycheck(void) if (move == NO_ACC_CALC_CHECK_LOCK_ON) { if (gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; else if (gStatuses3[gBattlerTarget] & (STATUS3_SEMI_INVULNERABLE)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; else if (!JumpIfMoveAffectedByProtect(0)) - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT || (gSpecialStatuses[gBattlerAttacker].multiHitOn && (gBattleMoves[move].effect != EFFECT_TRIPLE_KICK || GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK))) { // No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else { @@ -1888,6 +1937,8 @@ static void Cmd_accuracycheck(void) static void Cmd_attackstring(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags) return; @@ -1896,12 +1947,14 @@ static void Cmd_attackstring(void) PrepareStringBattle(STRINGID_USEDMOVE, gBattlerAttacker); gHitMarker |= HITMARKER_ATTACKSTRING_PRINTED; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleCommunication[MSG_DISPLAY] = 0; } static void Cmd_ppreduce(void) { + CMD_ARGS(); + s32 i, ppToDeduct = 1; if (gBattleControllerExecFlags) @@ -1961,7 +2014,7 @@ static void Cmd_ppreduce(void) } gHitMarker &= ~HITMARKER_NO_PPDEDUCT; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // The chance is 1/N for each stage. @@ -2030,6 +2083,8 @@ s8 GetInverseCritChance(u8 battlerAtk, u8 battlerDef, u32 move) static void Cmd_critcalc(void) { + CMD_ARGS(); + u16 partySlot; s32 critChance = CalcCritChanceStage(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); gPotentialItemEffectBattler = gBattlerAttacker; @@ -2051,30 +2106,36 @@ static void Cmd_critcalc(void) && !(gBattleTypeFlags & BATTLE_TYPE_MULTI && GetBattlerPosition(gBattlerAttacker) == B_POSITION_PLAYER_LEFT)) gPartyCriticalHits[partySlot]++; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_damagecalc(void) { + CMD_ARGS(); + u8 moveType; GET_MOVE_TYPE(gCurrentMove, moveType); gBattleMoveDamage = CalculateMoveDamage(gCurrentMove, gBattlerAttacker, gBattlerTarget, moveType, 0, gIsCriticalHit, TRUE, TRUE); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_typecalc(void) { + CMD_ARGS(); + u8 moveType; GET_MOVE_TYPE(gCurrentMove, moveType); CalcTypeEffectivenessMultiplier(gCurrentMove, moveType, gBattlerAttacker, gBattlerTarget, TRUE); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_adjustdamage(void) { + CMD_ARGS(); + u8 holdEffect, param; u32 moveType; u32 friendshipScore = GetBattlerFriendshipScore(gBattlerTarget); @@ -2157,7 +2218,7 @@ static void Cmd_adjustdamage(void) #endif END: - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMoveDamage >= 1) gSpecialStatuses[gBattlerAttacker].damagedMons |= gBitTable[gBattlerTarget]; @@ -2200,6 +2261,8 @@ END: static void Cmd_multihitresultmessage(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags) return; @@ -2225,7 +2288,7 @@ static void Cmd_multihitresultmessage(void) return; } } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; // Print berry reducing message after result message. if (gSpecialStatuses[gBattlerTarget].berryReduced @@ -2239,6 +2302,8 @@ static void Cmd_multihitresultmessage(void) static void Cmd_attackanimation(void) { + CMD_ARGS(); + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); if (gBattleControllerExecFlags) @@ -2250,7 +2315,7 @@ static void Cmd_attackanimation(void) // In a wild double battle gotta use the teleport animation if two wild pokemon are alive. && !(gCurrentMove == MOVE_TELEPORT && WILD_DOUBLE_BATTLE && GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT && IsBattlerAlive(BATTLE_PARTNER(gBattlerAttacker)))) { - BattleScriptPush(gBattlescriptCurrInstr + 1); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_Pausex20; gBattleScripting.animTurn++; gBattleScripting.animTargetsHit++; @@ -2259,7 +2324,7 @@ static void Cmd_attackanimation(void) { if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT) // No animation on second hit { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; return; } @@ -2268,7 +2333,7 @@ static void Cmd_attackanimation(void) || moveTarget & MOVE_TARGET_DEPENDS) && gBattleScripting.animTargetsHit) { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; return; } if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) @@ -2293,11 +2358,11 @@ static void Cmd_attackanimation(void) gBattleScripting.animTurn++; gBattleScripting.animTargetsHit++; MarkBattlerForControllerExec(gBattlerAttacker); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - BattleScriptPush(gBattlescriptCurrInstr + 1); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_Pausex20; } } @@ -2305,18 +2370,22 @@ static void Cmd_attackanimation(void) static void Cmd_waitanimation(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags == 0) - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_healthbarupdate(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags) return; if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) || (gHitMarker & HITMARKER_PASSIVE_DAMAGE)) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (DoesSubstituteBlockMove(gBattlerAttacker, gActiveBattler, gCurrentMove) && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE)) { @@ -2334,11 +2403,13 @@ static void Cmd_healthbarupdate(void) } } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_datahpupdate(void) { + CMD_ARGS(u8 battler); + u32 moveType; if (gBattleControllerExecFlags) @@ -2353,7 +2424,7 @@ static void Cmd_datahpupdate(void) if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) || (gHitMarker & HITMARKER_PASSIVE_DAMAGE)) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (DoesSubstituteBlockMove(gBattlerAttacker, gActiveBattler, gCurrentMove) && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE)) { if (gDisableStructs[gActiveBattler].substituteHP >= gBattleMoveDamage) @@ -2373,7 +2444,7 @@ static void Cmd_datahpupdate(void) // check substitute fading if (gDisableStructs[gActiveBattler].substituteHP == 0) { - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SubstituteFade; return; @@ -2382,7 +2453,7 @@ static void Cmd_datahpupdate(void) else if (DoesDisguiseBlockMove(gBattlerAttacker, gActiveBattler, gCurrentMove)) { gBattleMons[gActiveBattler].species = SPECIES_MIMIKYU_BUSTED; - BattleScriptPush(gBattlescriptCurrInstr + 2); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_TargetFormChange; } else @@ -2404,7 +2475,7 @@ static void Cmd_datahpupdate(void) else { gTakenDmg[gActiveBattler] += gBattleMoveDamage; - if (gBattlescriptCurrInstr[1] == BS_TARGET) + if (cmd->battler == BS_TARGET) gTakenDmgByBattler[gActiveBattler] = gBattlerAttacker; else gTakenDmgByBattler[gActiveBattler] = gBattlerTarget; @@ -2428,7 +2499,7 @@ static void Cmd_datahpupdate(void) { gProtectStructs[gActiveBattler].physicalDmg = gHpDealt; gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt; - if (gBattlescriptCurrInstr[1] == BS_TARGET) + if (cmd->battler == BS_TARGET) { gProtectStructs[gActiveBattler].physicalBattlerId = gBattlerAttacker; gSpecialStatuses[gActiveBattler].physicalBattlerId = gBattlerAttacker; @@ -2443,7 +2514,7 @@ static void Cmd_datahpupdate(void) { gProtectStructs[gActiveBattler].specialDmg = gHpDealt; gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt; - if (gBattlescriptCurrInstr[1] == BS_TARGET) + if (cmd->battler == BS_TARGET) { gProtectStructs[gActiveBattler].specialBattlerId = gBattlerAttacker; gSpecialStatuses[gActiveBattler].specialBattlerId = gBattlerAttacker; @@ -2462,15 +2533,17 @@ static void Cmd_datahpupdate(void) } else { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (gSpecialStatuses[gActiveBattler].dmg == 0) gSpecialStatuses[gActiveBattler].dmg = 0xFFFF; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_critmessage(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags == 0) { if (gIsCriticalHit == TRUE && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) @@ -2478,12 +2551,14 @@ static void Cmd_critmessage(void) PrepareStringBattle(STRINGID_CRITICALHIT, gBattlerAttacker); gBattleCommunication[MSG_DISPLAY] = 1; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_effectivenesssound(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags) return; @@ -2527,11 +2602,13 @@ static void Cmd_effectivenesssound(void) break; } } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_resultmessage(void) { + CMD_ARGS(); + u32 stringId = 0; if (gBattleControllerExecFlags) @@ -2638,7 +2715,7 @@ static void Cmd_resultmessage(void) if (stringId) PrepareStringBattle(stringId, gBattlerAttacker); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; // Print berry reducing message after result message. if (gSpecialStatuses[gBattlerTarget].berryReduced @@ -2652,42 +2729,48 @@ static void Cmd_resultmessage(void) static void Cmd_printstring(void) { + CMD_ARGS(u16 id); + if (gBattleControllerExecFlags == 0) { - u16 var = T2_READ_16(gBattlescriptCurrInstr + 1); + u16 id = cmd->id; - gBattlescriptCurrInstr += 3; - PrepareStringBattle(var, gBattlerAttacker); + gBattlescriptCurrInstr = cmd->nextInstr; + PrepareStringBattle(id, gBattlerAttacker); gBattleCommunication[MSG_DISPLAY] = 1; } } static void Cmd_printselectionstring(void) { + CMD_ARGS(u16 id); + gActiveBattler = gBattlerAttacker; - BtlController_EmitPrintSelectionString(BUFFER_A, T2_READ_16(gBattlescriptCurrInstr + 1)); + BtlController_EmitPrintSelectionString(BUFFER_A, cmd->id); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleCommunication[MSG_DISPLAY] = 1; } static void Cmd_waitmessage(void) { + CMD_ARGS(u16 time); + if (gBattleControllerExecFlags == 0) { if (!gBattleCommunication[MSG_DISPLAY]) { - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - u16 toWait = T2_READ_16(gBattlescriptCurrInstr + 1); + u16 toWait = cmd->time; if (++gPauseCounterBattle >= toWait) { gPauseCounterBattle = 0; - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleCommunication[MSG_DISPLAY] = 0; } } @@ -2696,12 +2779,14 @@ static void Cmd_waitmessage(void) static void Cmd_printfromtable(void) { + CMD_ARGS(const u16 *ptr); + if (gBattleControllerExecFlags == 0) { - const u16 *ptr = (const u16 *) T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u16 *ptr = cmd->ptr; ptr += gBattleCommunication[MULTISTRING_CHOOSER]; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; PrepareStringBattle(*ptr, gBattlerAttacker); gBattleCommunication[MSG_DISPLAY] = 1; } @@ -2709,16 +2794,18 @@ static void Cmd_printfromtable(void) static void Cmd_printselectionstringfromtable(void) { + CMD_ARGS(const u16 *ptr); + if (gBattleControllerExecFlags == 0) { - const u16 *ptr = (const u16 *) T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u16 *ptr = cmd->ptr; ptr += gBattleCommunication[MULTISTRING_CHOOSER]; gActiveBattler = gBattlerAttacker; BtlController_EmitPrintSelectionString(BUFFER_A, *ptr); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleCommunication[MSG_DISPLAY] = 1; } } @@ -2791,7 +2878,7 @@ void SetMoveEffect(bool32 primary, u32 certain) u16 battlerAbility; bool8 activateAfterFaint = FALSE; - if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT && gBattleMons[gBattlerTarget].hp != 0 && IsFinalStrikeEffect(gCurrentMove)) { @@ -2830,7 +2917,7 @@ void SetMoveEffect(bool32 primary, u32 certain) // Just in case this flag is still set gBattleScripting.moveEffect &= ~MOVE_EFFECT_CERTAIN; - + if ((battlerAbility == ABILITY_SHIELD_DUST || GetBattlerHoldEffect(gEffectBattler, TRUE) == HOLD_EFFECT_COVERT_CLOAK) && !(gHitMarker & HITMARKER_IGNORE_SAFEGUARD) @@ -3640,7 +3727,7 @@ void SetMoveEffect(bool32 primary, u32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_BothCanNoLongerEscape; } - if (!gBattleMons[gBattlerTarget].status2 & STATUS2_ESCAPE_PREVENTION) + if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_ESCAPE_PREVENTION)) gDisableStructs[gBattlerTarget].battlerPreventingEscape = gBattlerAttacker; if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_ESCAPE_PREVENTION)) @@ -3666,6 +3753,10 @@ void SetMoveEffect(bool32 primary, u32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_DoubleShockRemoveType; break; + case MOVE_EFFECT_ROUND: + TryUpdateRoundTurnOrder(); // If another Pokémon uses Round before the user this turn, the user will use Round directly after it + gBattlescriptCurrInstr++; + break; case MOVE_EFFECT_DIRE_CLAW: if (!gBattleMons[gEffectBattler].status1) { @@ -3697,6 +3788,8 @@ void SetMoveEffect(bool32 primary, u32 certain) static void Cmd_seteffectwithchance(void) { + CMD_ARGS(); + u32 percentChance; if (GetBattlerAbility(gBattlerAttacker) == ABILITY_SERENE_GRACE) @@ -3721,7 +3814,7 @@ static void Cmd_seteffectwithchance(void) } else { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } gBattleScripting.moveEffect = 0; @@ -3730,17 +3823,23 @@ static void Cmd_seteffectwithchance(void) static void Cmd_seteffectprimary(void) { + CMD_ARGS(); + SetMoveEffect(TRUE, 0); } static void Cmd_seteffectsecondary(void) { + CMD_ARGS(); + SetMoveEffect(FALSE, 0); } static void Cmd_clearstatusfromeffect(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (gBattleScripting.moveEffect <= PRIMARY_STATUS_MOVE_EFFECT) gBattleMons[gActiveBattler].status1 &= (~sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]); @@ -3748,52 +3847,53 @@ static void Cmd_clearstatusfromeffect(void) gBattleMons[gActiveBattler].status2 &= (~sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]); gBattleScripting.moveEffect = 0; - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleScripting.multihitMoveEffect = 0; } static void Cmd_tryfaintmon(void) { - const u8 *BS_ptr; + CMD_ARGS(u8 battler, bool8 isSpikes, const u8 *instr); + const u8 *instr; - if (gBattlescriptCurrInstr[2] != 0) + if (cmd->isSpikes != 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (gHitMarker & HITMARKER_FAINTED(gActiveBattler)) { - BS_ptr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + instr = cmd->instr; BattleScriptPop(); - gBattlescriptCurrInstr = BS_ptr; + gBattlescriptCurrInstr = instr; gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED | SIDE_STATUS_TOXIC_SPIKES_DAMAGED | SIDE_STATUS_STEALTH_ROCK_DAMAGED | SIDE_STATUS_STICKY_WEB_DAMAGED); } else { - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } } else { u8 battlerId; - if (gBattlescriptCurrInstr[1] == BS_ATTACKER) + if (cmd->battler == BS_ATTACKER) { gActiveBattler = gBattlerAttacker; battlerId = gBattlerTarget; - BS_ptr = BattleScript_FaintAttacker; + instr = BattleScript_FaintAttacker; } else { gActiveBattler = gBattlerTarget; battlerId = gBattlerAttacker; - BS_ptr = BattleScript_FaintTarget; + instr = BattleScript_FaintTarget; } if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler]) && gBattleMons[gActiveBattler].hp == 0) { gHitMarker |= HITMARKER_FAINTED(gActiveBattler); - BattleScriptPush(gBattlescriptCurrInstr + 7); - gBattlescriptCurrInstr = BS_ptr; + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = instr; if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) { gHitMarker |= HITMARKER_PLAYER_FAINTED; @@ -3836,27 +3936,31 @@ static void Cmd_tryfaintmon(void) } else { - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } } } static void Cmd_dofaintanimation(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); BtlController_EmitFaintAnimation(BUFFER_A); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_cleareffectsonfaint(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (!(gBattleTypeFlags & BATTLE_TYPE_ARENA) || gBattleMons[gActiveBattler].hp == 0) { @@ -3866,44 +3970,50 @@ static void Cmd_cleareffectsonfaint(void) } FaintClearSetData(); // Effects like attractions, trapping, etc. - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifstatus(void) { - u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2); - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); + CMD_ARGS(u8 battler, u32 flags, const u8 *jumpInstr); + + u8 battlerId = GetBattlerForBattleScript(cmd->battler); + u32 flags = cmd->flags; + const u8 *jumpInstr = cmd->jumpInstr; if (gBattleMons[battlerId].status1 & flags && gBattleMons[battlerId].hp != 0) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; else - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifstatus2(void) { - u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2); - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); + CMD_ARGS(u8 battler, u32 flags, const u8 *jumpInstr); + + u8 battlerId = GetBattlerForBattleScript(cmd->battler); + u32 flags = cmd->flags; + const u8 *jumpInstr = cmd->jumpInstr; if (gBattleMons[battlerId].status2 & flags && gBattleMons[battlerId].hp != 0) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; else - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifability(void) { + CMD_ARGS(u8 battler, u16 ability, const u8 *jumpInstr); + u32 battlerId; bool32 hasAbility = FALSE; - u32 ability = T2_READ_16(gBattlescriptCurrInstr + 2); + u32 ability = cmd->ability; - switch (gBattlescriptCurrInstr[1]) + switch (cmd->battler) { default: - battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + battlerId = GetBattlerForBattleScript(cmd->battler); if (GetBattlerAbility(battlerId) == ability) hasAbility = TRUE; break; @@ -3928,103 +4038,113 @@ static void Cmd_jumpifability(void) if (hasAbility) { gLastUsedAbility = ability; - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 4); + gBattlescriptCurrInstr = cmd->jumpInstr; RecordAbilityBattle(battlerId, gLastUsedAbility); gBattlerAbility = battlerId; } else { - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifsideaffecting(void) { + CMD_ARGS(u8 battler, u32 flags, const u8 *jumpInstr); + u8 side; u32 flags; - const u8 *jumpPtr; + const u8 *jumpInstr; - if (gBattlescriptCurrInstr[1] == BS_ATTACKER) + if (cmd->battler == BS_ATTACKER) side = GET_BATTLER_SIDE(gBattlerAttacker); else side = GET_BATTLER_SIDE(gBattlerTarget); - flags = T2_READ_32(gBattlescriptCurrInstr + 2); - jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); + flags = cmd->flags; + jumpInstr = cmd->jumpInstr; if (gSideStatuses[side] & flags) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; else - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifstat(void) { - bool32 ret = 0; - u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - u8 statId = gBattlescriptCurrInstr[3]; - u8 cmpTo = gBattlescriptCurrInstr[4]; - u8 cmpKind = gBattlescriptCurrInstr[2]; + CMD_ARGS(u8 battler, u8 comparison, u8 stat, u8 value, const u8 *jumpInstr); - ret = CompareStat(battlerId, statId, cmpTo, cmpKind); + bool32 ret = 0; + u8 battlerId = GetBattlerForBattleScript(cmd->battler); + u8 stat = cmd->stat; + u8 value = cmd->value; + u8 comparison = cmd->comparison; + + ret = CompareStat(battlerId, stat, value, comparison); if (ret) - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 5); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 9; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifstatus3condition(void) { - u32 status; - const u8 *jumpPtr; + CMD_ARGS(u8 battler, u32 flags, bool8 jumpIfTrue, const u8 *jumpInstr); - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - status = T2_READ_32(gBattlescriptCurrInstr + 2); - jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7); + u32 flags; + const u8 *jumpInstr; - if (gBattlescriptCurrInstr[6]) + gActiveBattler = GetBattlerForBattleScript(cmd->battler); + flags = cmd->flags; + jumpInstr = cmd->jumpInstr; + + if (cmd->jumpIfTrue) { - if ((gStatuses3[gActiveBattler] & status) != 0) - gBattlescriptCurrInstr += 11; + if ((gStatuses3[gActiveBattler] & flags) != 0) + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; } else { - if ((gStatuses3[gActiveBattler] & status) != 0) - gBattlescriptCurrInstr = jumpPtr; + if ((gStatuses3[gActiveBattler] & flags) != 0) + gBattlescriptCurrInstr = jumpInstr; else - gBattlescriptCurrInstr += 11; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpbasedontype(void) { - u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - u8 type = gBattlescriptCurrInstr[2]; - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 4); + CMD_ARGS(u8 battler, u8 type, u8 jumpIfType, const u8 *jumpInstr); + + u8 battlerId = GetBattlerForBattleScript(cmd->battler); + u8 type = cmd->type; + const u8 *jumpInstr = cmd->jumpInstr; // jumpiftype - if (gBattlescriptCurrInstr[3]) + if (cmd->jumpIfType) { if (IS_BATTLER_OF_TYPE(battlerId, type)) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; else - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; } // jumpifnottype else { if (!IS_BATTLER_OF_TYPE(battlerId, type)) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; else - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_getexp(void) { + CMD_ARGS(u8 battler); + u16 item; s32 i; // also used as stringId u8 holdEffect; @@ -4032,7 +4152,7 @@ static void Cmd_getexp(void) s32 viaExpShare = 0; u32 *exp = &gBattleStruct->expValue; - gBattlerFainted = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gBattlerFainted = GetBattlerForBattleScript(cmd->battler); sentIn = gSentPokesToOpponent[(gBattlerFainted & 2) >> 1]; switch (gBattleScripting.getexpState) @@ -4064,6 +4184,8 @@ static void Cmd_getexp(void) { if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) == SPECIES_NONE || GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0) continue; + if (GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) + continue; if (gBitTable[i] & sentIn) viaSentIn++; @@ -4153,7 +4275,8 @@ static void Cmd_getexp(void) gBattleStruct->wildVictorySong++; } - if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP)) + if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP) + && !GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_IS_EGG)) { if (gBattleStruct->sentInPokes & 1) gBattleMoveDamage = *exp; @@ -4327,7 +4450,7 @@ static void Cmd_getexp(void) // not sure why gf clears the item and ability here gBattleMons[gBattlerFainted].item = ITEM_NONE; gBattleMons[gBattlerFainted].ability = ABILITY_NONE; - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } break; } @@ -4413,6 +4536,8 @@ bool32 NoAliveMonsForEitherParty(void) // sets gBattleOutcome accordingly, if necessary. static void Cmd_checkteamslost(void) { + CMD_ARGS(const u8 *jumpInstr); + if (gBattleControllerExecFlags) return; @@ -4457,21 +4582,21 @@ static void Cmd_checkteamslost(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { if (emptyOpponentSpots + emptyPlayerSpots > 1) - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { if (emptyOpponentSpots != 0 && emptyPlayerSpots != 0) - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } else { - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -4487,315 +4612,361 @@ static void MoveValuesCleanUp(void) static void Cmd_movevaluescleanup(void) { + CMD_ARGS(); + MoveValuesCleanUp(); - gBattlescriptCurrInstr += 1; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setmultihit(void) { - gMultiHitCounter = gBattlescriptCurrInstr[1]; - gBattlescriptCurrInstr += 2; + CMD_ARGS(u8 value); + + gMultiHitCounter = cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_decrementmultihit(void) { + CMD_ARGS(const u8 *loopInstr); + if (--gMultiHitCounter == 0) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->loopInstr; } static void Cmd_goto(void) { - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *instr); + + gBattlescriptCurrInstr = cmd->instr; } static void Cmd_jumpifbyte(void) { - u8 caseID = gBattlescriptCurrInstr[1]; - const u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 2); - u8 value = gBattlescriptCurrInstr[6]; - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7); + CMD_ARGS(u8 comparison, const u8 *bytePtr, u8 value, const u8 *jumpInstr); - gBattlescriptCurrInstr += 11; + u8 comparison = cmd->comparison; + const u8 *bytePtr = cmd->bytePtr; + u8 value = cmd->value; + const u8 *jumpInstr = cmd->jumpInstr; - switch (caseID) + gBattlescriptCurrInstr = cmd->nextInstr; + + switch (comparison) { case CMP_EQUAL: - if (*memByte == value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr == value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NOT_EQUAL: - if (*memByte != value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr != value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_GREATER_THAN: - if (*memByte > value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr > value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_LESS_THAN: - if (*memByte < value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr < value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_COMMON_BITS: - if (*memByte & value) - gBattlescriptCurrInstr = jumpPtr; + if (*bytePtr & value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NO_COMMON_BITS: - if (!(*memByte & value)) - gBattlescriptCurrInstr = jumpPtr; + if (!(*bytePtr & value)) + gBattlescriptCurrInstr = jumpInstr; break; } } static void Cmd_jumpifhalfword(void) { - u8 caseID = gBattlescriptCurrInstr[1]; - const u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 2); - u16 value = T2_READ_16(gBattlescriptCurrInstr + 6); - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 8); + CMD_ARGS(u8 comparison, const u16 *halfwordPtr, u16 value, const u8 *jumpInstr); - gBattlescriptCurrInstr += 12; + u8 comparison = cmd->comparison; + const u16 *halfwordPtr = cmd->halfwordPtr; + u16 value = cmd->value; + const u8 *jumpInstr = cmd->jumpInstr; - switch (caseID) + gBattlescriptCurrInstr = cmd->nextInstr; + + switch (comparison) { case CMP_EQUAL: - if (*memHword == value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr == value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NOT_EQUAL: - if (*memHword != value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr != value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_GREATER_THAN: - if (*memHword > value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr > value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_LESS_THAN: - if (*memHword < value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr < value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_COMMON_BITS: - if (*memHword & value) - gBattlescriptCurrInstr = jumpPtr; + if (*halfwordPtr & value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NO_COMMON_BITS: - if (!(*memHword & value)) - gBattlescriptCurrInstr = jumpPtr; + if (!(*halfwordPtr & value)) + gBattlescriptCurrInstr = jumpInstr; break; } } static void Cmd_jumpifword(void) { - u8 caseID = gBattlescriptCurrInstr[1]; - const u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 2); - u32 value = T1_READ_32(gBattlescriptCurrInstr + 6); - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); + CMD_ARGS(u8 comparison, const u32 *wordPtr, u32 value, const u8 *jumpInstr); - gBattlescriptCurrInstr += 14; + u8 comparison = cmd->comparison; + const u32 *wordPtr = cmd->wordPtr; + u32 value = cmd->value; + const u8 *jumpInstr = cmd->jumpInstr; - switch (caseID) + gBattlescriptCurrInstr = cmd->nextInstr; + + switch (comparison) { case CMP_EQUAL: - if (*memWord == value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr == value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NOT_EQUAL: - if (*memWord != value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr != value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_GREATER_THAN: - if (*memWord > value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr > value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_LESS_THAN: - if (*memWord < value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr < value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_COMMON_BITS: - if (*memWord & value) - gBattlescriptCurrInstr = jumpPtr; + if (*wordPtr & value) + gBattlescriptCurrInstr = jumpInstr; break; case CMP_NO_COMMON_BITS: - if (!(*memWord & value)) - gBattlescriptCurrInstr = jumpPtr; + if (!(*wordPtr & value)) + gBattlescriptCurrInstr = jumpInstr; break; } } static void Cmd_jumpifarrayequal(void) { - const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); - u32 size = gBattlescriptCurrInstr[9]; - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); + CMD_ARGS(const u8 *array1, const u8 *array2, u8 size, const u8 *jumpInstr); + + const u8 *array1 = cmd->array1; + const u8 *array2 = cmd->array2; + u32 size = cmd->size; + const u8 *jumpInstr = cmd->jumpInstr; u8 i; for (i = 0; i < size; i++) { - if (*mem1 != *mem2) + if (*array1 != *array2) { - gBattlescriptCurrInstr += 14; + gBattlescriptCurrInstr = cmd->nextInstr; break; } - mem1++, mem2++; + array1++, array2++; } if (i == size) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; } static void Cmd_jumpifarraynotequal(void) { + CMD_ARGS(const u8 *array1, const u8 *array2, u8 size, const u8 *jumpInstr); + u8 equalBytes = 0; - const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); - u32 size = gBattlescriptCurrInstr[9]; - const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); + const u8 *array1 = cmd->array1; + const u8 *array2 = cmd->array2; + u32 size = cmd->size; + const u8 *jumpInstr = cmd->jumpInstr; u8 i; for (i = 0; i < size; i++) { - if (*mem1 == *mem2) + if (*array1 == *array2) equalBytes++; - mem1++, mem2++; + array1++, array2++; } if (equalBytes != size) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; else - gBattlescriptCurrInstr += 14; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte = gBattlescriptCurrInstr[5]; + CMD_ARGS(u8 *bytePtr, u8 value); - gBattlescriptCurrInstr += 6; + u8 *bytePtr = cmd->bytePtr; + *bytePtr = cmd->value; + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_addbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte += gBattlescriptCurrInstr[5]; - gBattlescriptCurrInstr += 6; + CMD_ARGS(u8 *bytePtr, u8 value); + + u8 *bytePtr = cmd->bytePtr; + *bytePtr += cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_subbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte -= gBattlescriptCurrInstr[5]; - gBattlescriptCurrInstr += 6; + CMD_ARGS(u8 *bytePtr, u8 value); + + u8 *bytePtr = cmd->bytePtr; + *bytePtr -= cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_copyarray(void) { - u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5); - s32 size = gBattlescriptCurrInstr[9]; + CMD_ARGS(u8 *dest, const u8 *src, u8 size); + + u8 *dest = cmd->dest; + const u8 *src = cmd->src; + s32 size = cmd->size; s32 i; for (i = 0; i < size; i++) dest[i] = src[i]; - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_copyarraywithindex(void) { - u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5); - const u8 *index = T2_READ_PTR(gBattlescriptCurrInstr + 9); - s32 size = gBattlescriptCurrInstr[13]; + CMD_ARGS(u8 *dest, const u8 *src, const u8 *indexPtr, u8 size); + + u8 *dest = cmd->dest; + const u8 *src = cmd->src; + const u8 *indexPtr = cmd->indexPtr; + s32 size = cmd->size; s32 i; for (i = 0; i < size; i++) - dest[i] = src[i + *index]; + dest[i] = src[i + *indexPtr]; - gBattlescriptCurrInstr += 14; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_orbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte |= gBattlescriptCurrInstr[5]; - gBattlescriptCurrInstr += 6; + CMD_ARGS(u8 *bytePtr, u8 value); + + u8 *bytePtr = cmd->bytePtr; + *bytePtr |= cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_orhalfword(void) { - u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); - u16 val = T2_READ_16(gBattlescriptCurrInstr + 5); + CMD_ARGS(u16 *halfwordPtr, u16 value); - *memHword |= val; - gBattlescriptCurrInstr += 7; + u16 *halfwordPtr = cmd->halfwordPtr; + u16 value = cmd->value; + + *halfwordPtr |= value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_orword(void) { - u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); - u32 val = T2_READ_32(gBattlescriptCurrInstr + 5); + CMD_ARGS(u32 *wordPtr, u32 value); - *memWord |= val; - gBattlescriptCurrInstr += 9; + u32 *wordPtr = cmd->wordPtr; + u32 value = cmd->value; + + *wordPtr |= value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_bicbyte(void) { - u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); - *memByte &= ~(gBattlescriptCurrInstr[5]); - gBattlescriptCurrInstr += 6; + CMD_ARGS(u8 *bytePtr, u8 value); + + u8 *bytePtr = cmd->bytePtr; + *bytePtr &= ~cmd->value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_bichalfword(void) { - u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); - u16 val = T2_READ_16(gBattlescriptCurrInstr + 5); + CMD_ARGS(u16 *halfwordPtr, u16 value); - *memHword &= ~val; - gBattlescriptCurrInstr += 7; + u16 *halfwordPtr = cmd->halfwordPtr; + u16 value = cmd->value; + + *halfwordPtr &= ~value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_bicword(void) { - u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); - u32 val = T2_READ_32(gBattlescriptCurrInstr + 5); + CMD_ARGS(u32 *wordPtr, u32 value); - *memWord &= ~val; - gBattlescriptCurrInstr += 9; + u32 *wordPtr = cmd->wordPtr; + u32 value = cmd->value; + + *wordPtr &= ~value; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_pause(void) { + CMD_ARGS(u16 frames); + if (gBattleControllerExecFlags == 0) { - u16 value = T2_READ_16(gBattlescriptCurrInstr + 1); + u16 value = cmd->frames; if (++gPauseCounterBattle >= value) { gPauseCounterBattle = 0; - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } } } static void Cmd_waitstate(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags == 0) - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_healthbar_update(void) { - if (gBattlescriptCurrInstr[1] == BS_TARGET) + CMD_ARGS(u8 battler); + + if (cmd->battler == BS_TARGET) gActiveBattler = gBattlerTarget; else gActiveBattler = gBattlerAttacker; BtlController_EmitHealthBarUpdate(BUFFER_A, gBattleMoveDamage); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_return(void) @@ -4805,6 +4976,8 @@ static void Cmd_return(void) static void Cmd_end(void) { + CMD_ARGS(); + if (gBattleTypeFlags & BATTLE_TYPE_ARENA) BattleArena_AddSkillPoints(gBattlerAttacker); @@ -4815,6 +4988,8 @@ static void Cmd_end(void) static void Cmd_end2(void) { + CMD_ARGS(); + gActiveBattler = 0; gCurrentActionFuncId = B_ACTION_TRY_FINISH; } @@ -4822,6 +4997,8 @@ static void Cmd_end2(void) // Pops the main function stack static void Cmd_end3(void) { + CMD_ARGS(); + BattleScriptPop(); if (gBattleResources->battleCallbackStack->size != 0) gBattleResources->battleCallbackStack->size--; @@ -4830,12 +5007,16 @@ static void Cmd_end3(void) static void Cmd_call(void) { - BattleScriptPush(gBattlescriptCurrInstr + 5); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *instr); + + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = cmd->instr; } static void Cmd_setroost(void) { + CMD_ARGS(); + gBattleResources->flags->flags[gBattlerAttacker] |= RESOURCE_FLAG_ROOST; // Pure flying type. @@ -4866,35 +5047,48 @@ static void Cmd_setroost(void) gBattleStruct->roostTypes[gBattlerAttacker][1] = gBattleMons[gBattlerAttacker].type2; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifabilitypresent(void) { - if (IsAbilityOnField(T1_READ_16(gBattlescriptCurrInstr + 1))) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + CMD_ARGS(u16 ability, const u8 *jumpInstr); + + u16 ability = cmd->ability; + u32 abilityBattler = IsAbilityOnField(ability); + if (abilityBattler) + { + gBattlerAbility = abilityBattler - 1; + gBattlescriptCurrInstr = cmd->jumpInstr; + } else - gBattlescriptCurrInstr += 7; + { + gBattlescriptCurrInstr = cmd->nextInstr; + } } static void Cmd_endselectionscript(void) { + CMD_ARGS(); + *(gBattlerAttacker + gBattleStruct->selectionScriptFinished) = TRUE; } static void Cmd_playanimation(void) { - const u16 *argumentPtr; - u8 animId = gBattlescriptCurrInstr[2]; + CMD_ARGS(u8 battler, u8 animId, const u16 *argPtr); - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); + const u16 *argPtr; + u8 animId = cmd->animId; + + gActiveBattler = GetBattlerForBattleScript(cmd->battler); + argPtr = cmd->argPtr; #if B_TERRAIN_BG_CHANGE == FALSE if (animId == B_ANIM_RESTORE_BG) { // workaround for .if not working - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; } #endif @@ -4907,13 +5101,13 @@ static void Cmd_playanimation(void) || animId == B_ANIM_SUBSTITUTE_FADE || animId == B_ANIM_PRIMAL_REVERSION) { - BtlController_EmitBattleAnimation(BUFFER_A, animId, *argumentPtr); + BtlController_EmitBattleAnimation(BUFFER_A, animId, *argPtr); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (gHitMarker & HITMARKER_NO_ANIMATIONS && animId != B_ANIM_RESTORE_BG) { - BattleScriptPush(gBattlescriptCurrInstr + 7); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_Pausex20; } else if (animId == B_ANIM_RAIN_CONTINUES @@ -4921,71 +5115,75 @@ static void Cmd_playanimation(void) || animId == B_ANIM_SANDSTORM_CONTINUES || animId == B_ANIM_HAIL_CONTINUES) { - BtlController_EmitBattleAnimation(BUFFER_A, animId, *argumentPtr); + BtlController_EmitBattleAnimation(BUFFER_A, animId, *argPtr); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) { - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - BtlController_EmitBattleAnimation(BUFFER_A, animId, *argumentPtr); + BtlController_EmitBattleAnimation(BUFFER_A, animId, *argPtr); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } } // Same as playanimation, except it takes a pointer to some animation id, instead of taking the value directly static void Cmd_playanimation_var(void) { - const u16 *argumentPtr; - const u8 *animationIdPtr; + CMD_ARGS(u8 battler, const u8 *animIdPtr, const u16 *argPtr); - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - animationIdPtr = T2_READ_PTR(gBattlescriptCurrInstr + 2); - argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); + const u16 *argPtr; + const u8 *animIdPtr; - if (*animationIdPtr == B_ANIM_STATS_CHANGE - || *animationIdPtr == B_ANIM_SNATCH_MOVE - || *animationIdPtr == B_ANIM_MEGA_EVOLUTION - || *animationIdPtr == B_ANIM_ILLUSION_OFF - || *animationIdPtr == B_ANIM_FORM_CHANGE - || *animationIdPtr == B_ANIM_SUBSTITUTE_FADE - || *animationIdPtr == B_ANIM_PRIMAL_REVERSION) + gActiveBattler = GetBattlerForBattleScript(cmd->battler); + animIdPtr = cmd->animIdPtr; + argPtr = cmd->argPtr; + + if (*animIdPtr == B_ANIM_STATS_CHANGE + || *animIdPtr == B_ANIM_SNATCH_MOVE + || *animIdPtr == B_ANIM_MEGA_EVOLUTION + || *animIdPtr == B_ANIM_ILLUSION_OFF + || *animIdPtr == B_ANIM_FORM_CHANGE + || *animIdPtr == B_ANIM_SUBSTITUTE_FADE + || *animIdPtr == B_ANIM_PRIMAL_REVERSION) { - BtlController_EmitBattleAnimation(BUFFER_A, *animationIdPtr, *argumentPtr); + BtlController_EmitBattleAnimation(BUFFER_A, *animIdPtr, *argPtr); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (gHitMarker & HITMARKER_NO_ANIMATIONS) { - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } - else if (*animationIdPtr == B_ANIM_RAIN_CONTINUES - || *animationIdPtr == B_ANIM_SUN_CONTINUES - || *animationIdPtr == B_ANIM_SANDSTORM_CONTINUES - || *animationIdPtr == B_ANIM_HAIL_CONTINUES) + else if (*animIdPtr == B_ANIM_RAIN_CONTINUES + || *animIdPtr == B_ANIM_SUN_CONTINUES + || *animIdPtr == B_ANIM_SANDSTORM_CONTINUES + || *animIdPtr == B_ANIM_HAIL_CONTINUES) { - BtlController_EmitBattleAnimation(BUFFER_A, *animationIdPtr, *argumentPtr); + BtlController_EmitBattleAnimation(BUFFER_A, *animIdPtr, *argPtr); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) { - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - BtlController_EmitBattleAnimation(BUFFER_A, *animationIdPtr, *argumentPtr); + BtlController_EmitBattleAnimation(BUFFER_A, *animIdPtr, *argPtr); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setgraphicalstatchangevalues(void) { + CMD_ARGS(); + u8 value = GET_STAT_BUFF_VALUE_WITH_SIGN(gBattleScripting.statChanger); switch (value) @@ -5017,22 +5215,24 @@ static void Cmd_setgraphicalstatchangevalues(void) } gBattleScripting.animArg1 = GET_STAT_BUFF_ID(gBattleScripting.statChanger) + value - 1; gBattleScripting.animArg2 = 0; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_playstatchangeanimation(void) { + CMD_ARGS(u8 battler, u8 stats, u8 flags); + u32 ability; u32 currStat = 0; u32 statAnimId = 0; u32 changeableStatsCount = 0; - u32 statsToCheck = 0; + u32 stats = 0; u32 startingStatAnimId = 0; - u32 flags = gBattlescriptCurrInstr[3]; + u32 flags = cmd->flags; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); ability = GetBattlerAbility(gActiveBattler); - statsToCheck = gBattlescriptCurrInstr[2]; + stats = cmd->stats; // Handle Contrary and Simple if (ability == ABILITY_CONTRARY) @@ -5047,9 +5247,9 @@ static void Cmd_playstatchangeanimation(void) else startingStatAnimId = STAT_ANIM_MINUS1 - 1; - while (statsToCheck != 0) + while (stats != 0) { - if (statsToCheck & 1) + if (stats & 1) { if (flags & STAT_CHANGE_CANT_PREVENT) { @@ -5075,7 +5275,7 @@ static void Cmd_playstatchangeanimation(void) } } } - statsToCheck >>= 1, currStat++; + stats >>= 1, currStat++; } if (changeableStatsCount > 1) // more than one stat, so the color is gray @@ -5093,14 +5293,14 @@ static void Cmd_playstatchangeanimation(void) else startingStatAnimId = STAT_ANIM_PLUS1 - 1; - while (statsToCheck != 0) + while (stats != 0) { - if (statsToCheck & 1 && gBattleMons[gActiveBattler].statStages[currStat] < MAX_STAT_STAGE) + if (stats & 1 && gBattleMons[gActiveBattler].statStages[currStat] < MAX_STAT_STAGE) { statAnimId = startingStatAnimId + currStat; changeableStatsCount++; } - statsToCheck >>= 1, currStat++; + stats >>= 1, currStat++; } if (changeableStatsCount > 1) // more than one stat, so the color is gray @@ -5114,7 +5314,7 @@ static void Cmd_playstatchangeanimation(void) if (flags & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount < 2) { - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (changeableStatsCount != 0 && !gBattleScripting.statAnimPlayed) { @@ -5122,11 +5322,11 @@ static void Cmd_playstatchangeanimation(void) MarkBattlerForControllerExec(gActiveBattler); if (flags & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount > 1) gBattleScripting.statAnimPlayed = TRUE; - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -5185,6 +5385,8 @@ static u32 GetNextTarget(u32 moveTarget) static void Cmd_moveend(void) { + CMD_ARGS(u8 endMode, u8 endState); + s32 i; bool32 effect = FALSE; u32 moveType = 0; @@ -5198,8 +5400,8 @@ static void Cmd_moveend(void) else originallyUsedMove = gChosenMove; - endMode = gBattlescriptCurrInstr[1]; - endState = gBattlescriptCurrInstr[2]; + endMode = cmd->endMode; + endState = cmd->endState; holdEffectAtk = GetBattlerHoldEffect(gBattlerAttacker, TRUE); choicedMoveAtk = &gBattleStruct->choicedMove[gBattlerAttacker]; @@ -5567,6 +5769,22 @@ static void Cmd_moveend(void) else gBattleStruct->lastMoveFailed &= ~(gBitTable[gBattlerAttacker]); + // Set ShellTrap to activate after the attacker's turn if target was hit by a physical move. + if (gBattleMoves[gChosenMoveByBattler[gBattlerTarget]].effect == EFFECT_SHELL_TRAP + && gBattlerTarget != gBattlerAttacker + && GetBattlerSide(gBattlerTarget) != GetBattlerSide(gBattlerAttacker) + && gProtectStructs[gBattlerTarget].physicalDmg + && gProtectStructs[gBattlerTarget].physicalBattlerId == gBattlerAttacker + && !TestSheerForceFlag(gBattlerAttacker, gCurrentMove)) + { + gProtectStructs[gBattlerTarget].shellTrap = TRUE; + // Change move order in double battles, so the hit mon with shell trap moves immediately after being hit. + if (IsDoubleBattle()) + { + ChangeOrderTargetAfterAttacker(); + } + } + if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET) { gActiveBattler = gBattlerAttacker; @@ -5777,8 +5995,7 @@ static void Cmd_moveend(void) break; } case MOVEEND_EJECT_BUTTON: - if (gCurrentMove != MOVE_DRAGON_TAIL - && gCurrentMove != MOVE_CIRCLE_THROW + if (gBattleMoves[gCurrentMove].effect != EFFECT_HIT_SWITCH_TARGET && IsBattlerAlive(gBattlerAttacker) && !TestSheerForceFlag(gBattlerAttacker, gCurrentMove) && (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER || (gBattleTypeFlags & BATTLE_TYPE_TRAINER))) @@ -5811,8 +6028,7 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_RED_CARD: - if (gCurrentMove != MOVE_DRAGON_TAIL - && gCurrentMove != MOVE_CIRCLE_THROW + if ((gBattleMoves[gCurrentMove].effect != EFFECT_HIT_SWITCH_TARGET || gBattleStruct->hitSwitchTargetFailed) && IsBattlerAlive(gBattlerAttacker) && !TestSheerForceFlag(gBattlerAttacker, gCurrentMove) && GetBattlerAbility(gBattlerAttacker) != ABILITY_GUARD_DOG) @@ -6033,6 +6249,7 @@ static void Cmd_moveend(void) gBattleStruct->targetsDone[gBattlerAttacker] = 0; gProtectStructs[gBattlerAttacker].usesBouncedMove = FALSE; gProtectStructs[gBattlerAttacker].targetAffected = FALSE; + gProtectStructs[gBattlerAttacker].shellTrap = FALSE; gBattleStruct->ateBoost[gBattlerAttacker] = 0; gStatuses3[gBattlerAttacker] &= ~STATUS3_ME_FIRST; gSpecialStatuses[gBattlerAttacker].gemBoost = FALSE; @@ -6043,6 +6260,7 @@ static void Cmd_moveend(void) gBattleStruct->zmove.active = FALSE; gBattleStruct->zmove.toBeUsed[gBattlerAttacker] = MOVE_NONE; gBattleStruct->zmove.effect = EFFECT_HIT; + gBattleStruct->hitSwitchTargetFailed = FALSE; gBattleScripting.moveendState++; break; case MOVEEND_COUNT: @@ -6057,51 +6275,59 @@ static void Cmd_moveend(void) } while (gBattleScripting.moveendState != MOVEEND_COUNT && effect == FALSE); if (gBattleScripting.moveendState == MOVEEND_COUNT && effect == FALSE) - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_sethealblock(void) { + CMD_ARGS(const u8 *failInstr); + if (gStatuses3[gBattlerTarget] & STATUS3_HEAL_BLOCK) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gStatuses3[gBattlerTarget] |= STATUS3_HEAL_BLOCK; gDisableStructs[gBattlerTarget].healBlockTimer = 5; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_returnatktoball(void) { + CMD_ARGS(); + gActiveBattler = gBattlerAttacker; if (!(gHitMarker & HITMARKER_FAINTED(gActiveBattler))) { BtlController_EmitReturnMonToBall(BUFFER_A, FALSE); MarkBattlerForControllerExec(gActiveBattler); } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_getswitchedmondata(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); gBattlerPartyIndexes[gActiveBattler] = *(gBattleStruct->monToSwitchIntoId + gActiveBattler); BtlController_EmitGetMonData(BUFFER_A, REQUEST_ALL_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]]); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_switchindataupdate(void) { + CMD_ARGS(u8 battler); + struct BattlePokemon oldData; s32 i; u8 *monData; @@ -6109,7 +6335,7 @@ static void Cmd_switchindataupdate(void) if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); oldData = gBattleMons[gActiveBattler]; monData = (u8 *)(&gBattleMons[gActiveBattler]); @@ -6151,15 +6377,17 @@ static void Cmd_switchindataupdate(void) PREPARE_MON_NICK_BUFFER(gBattleTextBuff1, gActiveBattler, gBattlerPartyIndexes[gActiveBattler]); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_switchinanim(void) { + CMD_ARGS(u8 battler, bool8 dontClearSubstitute); + if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT && !(gBattleTypeFlags & (BATTLE_TYPE_LINK @@ -6171,10 +6399,10 @@ static void Cmd_switchinanim(void) gAbsentBattlerFlags &= ~(gBitTable[gActiveBattler]); - BtlController_EmitSwitchInAnim(BUFFER_A, gBattlerPartyIndexes[gActiveBattler], gBattlescriptCurrInstr[2]); + BtlController_EmitSwitchInAnim(BUFFER_A, gBattlerPartyIndexes[gActiveBattler], cmd->dontClearSubstitute); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; if (gBattleTypeFlags & BATTLE_TYPE_ARENA) BattleArena_InitPoints(); @@ -6331,19 +6559,20 @@ bool32 CanBattlerSwitch(u32 battlerId) static void Cmd_jumpifcantswitch(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~SWITCH_IGNORE_ESCAPE_PREVENTION); + CMD_ARGS(u8 battler:7, u8 ignoreEscapePrevention:1, const u8 *jumpInstr); - if (!(gBattlescriptCurrInstr[1] & SWITCH_IGNORE_ESCAPE_PREVENTION) - && !CanBattlerEscape(gActiveBattler)) + gActiveBattler = GetBattlerForBattleScript(cmd->battler); + + if (!cmd->ignoreEscapePrevention && !CanBattlerEscape(gActiveBattler)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + gBattlescriptCurrInstr = cmd->jumpInstr; } else { if (CanBattlerSwitch(gActiveBattler)) - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + gBattlescriptCurrInstr = cmd->jumpInstr; } } @@ -6362,16 +6591,18 @@ static void ChooseMonToSendOut(u8 slotId) static void Cmd_openpartyscreen(void) { + CMD_ARGS(u8 battler:7, u8 partyScreenOptional:1, const u8 *failInstr); + u32 flags; u8 hitmarkerFaintBits; u8 battlerId; - const u8 *jumpPtr; + const u8 *failInstr; battlerId = 0; flags = 0; - jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + failInstr = cmd->failInstr; - if (gBattlescriptCurrInstr[1] == BS_FAINTED_LINK_MULTIPLE_1) + if (cmd->battler == BS_FAINTED_LINK_MULTIPLE_1) { if ((gBattleTypeFlags & BATTLE_TYPE_MULTI) || !(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { @@ -6524,9 +6755,9 @@ static void Cmd_openpartyscreen(void) } } } - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } - else if (gBattlescriptCurrInstr[1] == BS_FAINTED_LINK_MULTIPLE_2) + else if (cmd->battler == BS_FAINTED_LINK_MULTIPLE_2) { if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { @@ -6565,18 +6796,18 @@ static void Cmd_openpartyscreen(void) gSpecialStatuses[gActiveBattler].faintedHasReplacement = TRUE; } } - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } else { // Not multi or double battle - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } } else { // Multi battle - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } hitmarkerFaintBits = gHitMarker >> 28; @@ -6587,26 +6818,26 @@ static void Cmd_openpartyscreen(void) gBattlerFainted++; if (gBattlerFainted == gBattlersCount) - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = failInstr; } else { - if (gBattlescriptCurrInstr[1] & PARTY_SCREEN_OPTIONAL) + if (cmd->partyScreenOptional) hitmarkerFaintBits = PARTY_ACTION_CHOOSE_MON; // Used here as the caseId for the EmitChoose function. else hitmarkerFaintBits = PARTY_ACTION_SEND_OUT; - battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~PARTY_SCREEN_OPTIONAL); + battlerId = GetBattlerForBattleScript(cmd->battler); if (gSpecialStatuses[battlerId].faintedHasReplacement) { - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (HasNoMonsToSwitch(battlerId, PARTY_SIZE, PARTY_SIZE)) { gActiveBattler = battlerId; gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = failInstr; } else { @@ -6618,7 +6849,7 @@ static void Cmd_openpartyscreen(void) BtlController_EmitChoosePokemon(BUFFER_A, hitmarkerFaintBits, *(gBattleStruct->monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)), ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT && gBattleResults.playerSwitchesCounter < 255) gBattleResults.playerSwitchesCounter++; @@ -6649,13 +6880,15 @@ static void Cmd_openpartyscreen(void) static void Cmd_switchhandleorder(void) { + CMD_ARGS(u8 battler, u8 state); + s32 i; if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); - switch (gBattlescriptCurrInstr[2]) + switch (cmd->state) { case 0: for (i = 0; i < gBattlersCount; i++) @@ -6710,7 +6943,7 @@ static void Cmd_switchhandleorder(void) break; } - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } static void SetDmgHazardsBattlescript(u8 battlerId, u8 multistringId) @@ -6729,11 +6962,42 @@ static void SetDmgHazardsBattlescript(u8 battlerId, u8 multistringId) gBattlescriptCurrInstr = BattleScript_DmgHazardsOnFaintedBattler; } +bool32 DoSwitchInAbilitiesItems(u32 battlerId) +{ + return (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, battlerId, 0, 0, 0) + || (gBattleWeather & B_WEATHER_ANY && WEATHER_HAS_EFFECT && AbilityBattleEffects(ABILITYEFFECT_ON_WEATHER, battlerId, 0, 0, 0)) + || (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY && AbilityBattleEffects(ABILITYEFFECT_ON_TERRAIN, battlerId, 0, 0, 0)) + || ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, battlerId, FALSE) + || AbilityBattleEffects(ABILITYEFFECT_TRACE2, 0, 0, 0, 0)); +} + +bool32 ShouldPostponeSwitchInAbilities(u32 battlerId) +{ + bool32 aliveOpposing1 = IsBattlerAlive(BATTLE_OPPOSITE(battlerId)); + bool32 aliveOpposing2 = IsBattlerAlive(BATTLE_PARTNER(BATTLE_OPPOSITE(battlerId))); + // No pokemon on opposing side - postpone. + if (!aliveOpposing1 && !aliveOpposing2) + return TRUE; + + // Checks for double battle, so abilities like Intimidate wait until all battlers are switched-in before activating. + if (IsDoubleBattle()) + { + if (aliveOpposing1 && !aliveOpposing2 && !HasNoMonsToSwitch(BATTLE_OPPOSITE(battlerId), PARTY_SIZE, PARTY_SIZE)) + return TRUE; + if (!aliveOpposing1 && aliveOpposing2 && !HasNoMonsToSwitch(BATTLE_PARTNER(BATTLE_OPPOSITE(battlerId)), PARTY_SIZE, PARTY_SIZE)) + return TRUE; + } + + return FALSE; +} + static void Cmd_switchineffects(void) { + CMD_ARGS(u8 battler); + s32 i; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); UpdateSentPokesToOpponentValue(gActiveBattler); gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); @@ -6751,6 +7015,24 @@ static void Cmd_switchineffects(void) BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SwitchInAbilityMsgRet; } + // Healing Wish activates before hazards. + // Starting from Gen8 - it heals only pokemon which can be healed. In gens 5,6,7 the effect activates anyways. + else if (((gBattleStruct->storedHealingWish & gBitTable[gActiveBattler]) || (gBattleStruct->storedLunarDance & gBitTable[gActiveBattler])) + && (gBattleMons[gActiveBattler].hp != gBattleMons[gActiveBattler].maxHP || gBattleMons[gActiveBattler].status1 != 0 || B_HEALING_WISH_SWITCH < GEN_8)) + { + if (gBattleStruct->storedHealingWish & gBitTable[gActiveBattler]) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_HealingWishActivates; + gBattleStruct->storedHealingWish &= ~(gBitTable[gActiveBattler]); + } + else // Lunar Dance + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_LunarDanceActivates; + gBattleStruct->storedLunarDance &= ~(gBitTable[gActiveBattler]); + } + } else if (!(gSideStatuses[GetBattlerSide(gActiveBattler)] & SIDE_STATUS_SPIKES_DAMAGED) && (gSideStatuses[GetBattlerSide(gActiveBattler)] & SIDE_STATUS_SPIKES) && GetBattlerAbility(gActiveBattler) != ABILITY_MAGIC_GUARD @@ -6843,12 +7125,17 @@ static void Cmd_switchineffects(void) gDisableStructs[gActiveBattler].truantSwitchInHack = 0; - if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0) - || (gBattleWeather & B_WEATHER_ANY && WEATHER_HAS_EFFECT && AbilityBattleEffects(ABILITYEFFECT_ON_WEATHER, gActiveBattler, 0, 0, 0)) - || (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY && AbilityBattleEffects(ABILITYEFFECT_ON_TERRAIN, gActiveBattler, 0, 0, 0)) - || ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE) - || AbilityBattleEffects(ABILITYEFFECT_TRACE2, 0, 0, 0, 0)) - return; + // Don't activate switch-in abilities if the opposing field is empty. + // This could happen when a mon uses explosion and causes everyone to faint. + if (ShouldPostponeSwitchInAbilities(gActiveBattler) || gBattleStruct->switchInAbilityPostponed) + { + gBattleStruct->switchInAbilityPostponed |= gBitTable[gActiveBattler]; + } + else + { + if (DoSwitchInAbilitiesItems(gActiveBattler)) + return; + } gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED | SIDE_STATUS_TOXIC_SPIKES_DAMAGED | SIDE_STATUS_STEALTH_ROCK_DAMAGED | SIDE_STATUS_STICKY_WEB_DAMAGED); @@ -6860,7 +7147,7 @@ static void Cmd_switchineffects(void) gBattleStruct->hpOnSwitchout[GetBattlerSide(i)] = gBattleMons[i].hp; } - if (gBattlescriptCurrInstr[1] == BS_FAINTED_LINK_MULTIPLE_1) + if (cmd->battler == BS_FAINTED_LINK_MULTIPLE_1) { u32 hitmarkerFaintBits = gHitMarker >> 28; @@ -6874,70 +7161,85 @@ static void Cmd_switchineffects(void) gBattlerFainted++; } } - gBattlescriptCurrInstr += 2; + gBattleStruct->forcedSwitch &= ~(gBitTable[gActiveBattler]); + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_trainerslidein(void) { - gActiveBattler = GetBattlerAtPosition(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + gActiveBattler = GetBattlerAtPosition(cmd->battler); BtlController_EmitTrainerSlide(BUFFER_A); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_playse(void) { + CMD_ARGS(u16 song); + gActiveBattler = gBattlerAttacker; - BtlController_EmitPlaySE(BUFFER_A, T2_READ_16(gBattlescriptCurrInstr + 1)); + BtlController_EmitPlaySE(BUFFER_A, cmd->song); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_fanfare(void) { + CMD_ARGS(u16 song); + gActiveBattler = gBattlerAttacker; - BtlController_EmitPlayFanfareOrBGM(BUFFER_A, T2_READ_16(gBattlescriptCurrInstr + 1), FALSE); + BtlController_EmitPlayFanfareOrBGM(BUFFER_A, cmd->song, FALSE); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_playfaintcry(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + gActiveBattler = GetBattlerForBattleScript(cmd->battler); BtlController_EmitFaintingCry(BUFFER_A); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_endlinkbattle(void) { + CMD_ARGS(); + gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); BtlController_EmitEndLinkBattle(BUFFER_A, gBattleOutcome); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 1; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_returntoball(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + gActiveBattler = GetBattlerForBattleScript(cmd->battler); BtlController_EmitReturnMonToBall(BUFFER_A, TRUE); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_handlelearnnewmove(void) { - const u8 *learnedMovePtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - const u8 *nothingToLearnPtr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + CMD_ARGS(const u8 *learnedMovePtr, const u8 *nothingToLearnPtr, bool8 isFirstMove); - u16 learnMove = MonTryLearningNewMove(&gPlayerParty[gBattleStruct->expGetterMonId], gBattlescriptCurrInstr[9]); + const u8 *learnedMovePtr = cmd->learnedMovePtr; + const u8 *nothingToLearnPtr = cmd->nothingToLearnPtr; + + u16 learnMove = MonTryLearningNewMove(&gPlayerParty[gBattleStruct->expGetterMonId], cmd->isFirstMove); while (learnMove == MON_ALREADY_KNOWS_MOVE) learnMove = MonTryLearningNewMove(&gPlayerParty[gBattleStruct->expGetterMonId], FALSE); @@ -6947,7 +7249,7 @@ static void Cmd_handlelearnnewmove(void) } else if (learnMove == MON_HAS_MAX_MOVES) { - gBattlescriptCurrInstr += 10; + gBattlescriptCurrInstr = cmd->nextInstr; } else { @@ -6974,6 +7276,8 @@ static void Cmd_handlelearnnewmove(void) static void Cmd_yesnoboxlearnmove(void) { + CMD_ARGS(const u8 *forgotMovePtr); + gActiveBattler = 0; switch (gBattleScripting.learnMoveState) @@ -7052,7 +7356,7 @@ static void Cmd_yesnoboxlearnmove(void) } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->forgotMovePtr; PREPARE_MOVE_BUFFER(gBattleTextBuff2, moveId) @@ -7077,7 +7381,7 @@ static void Cmd_yesnoboxlearnmove(void) break; case 5: HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; break; case 6: if (gBattleControllerExecFlags == 0) @@ -7090,6 +7394,8 @@ static void Cmd_yesnoboxlearnmove(void) static void Cmd_yesnoboxstoplearningmove(void) { + CMD_ARGS(const u8 *noInstr); + switch (gBattleScripting.learnMoveState) { case 0: @@ -7119,16 +7425,16 @@ static void Cmd_yesnoboxstoplearningmove(void) PlaySE(SE_SELECT); if (gBattleCommunication[1] != 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->noInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->noInstr; HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); } break; @@ -7137,21 +7443,23 @@ static void Cmd_yesnoboxstoplearningmove(void) static void Cmd_hitanimation(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (!(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE) || !(DoesSubstituteBlockMove(gBattlerAttacker, gActiveBattler, gCurrentMove)) || gDisableStructs[gActiveBattler].substituteHP == 0) { BtlController_EmitHitAnimation(BUFFER_A); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -7214,6 +7522,8 @@ static u32 GetTrainerMoneyToGive(u16 trainerId) static void Cmd_getmoneyreward(void) { + CMD_ARGS(); + u32 money; u8 sPartyLevel = 1; @@ -7246,13 +7556,15 @@ static void Cmd_getmoneyreward(void) } PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, money); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Command is never used static void Cmd_updatebattlermoves(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + gActiveBattler = GetBattlerForBattleScript(cmd->battler); switch (gBattleCommunication[0]) { @@ -7271,7 +7583,7 @@ static void Cmd_updatebattlermoves(void) gBattleMons[gActiveBattler].moves[i] = bufferPoke->moves[i]; gBattleMons[gActiveBattler].pp[i] = bufferPoke->pp[i]; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } break; } @@ -7279,6 +7591,8 @@ static void Cmd_updatebattlermoves(void) static void Cmd_swapattackerwithtarget(void) { + CMD_ARGS(); + gActiveBattler = gBattlerAttacker; gBattlerAttacker = gBattlerTarget; gBattlerTarget = gActiveBattler; @@ -7288,19 +7602,23 @@ static void Cmd_swapattackerwithtarget(void) else gHitMarker |= HITMARKER_SWAP_ATTACKER_TARGET; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_incrementgamestat(void) { - if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) - IncrementGameStat(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 stat); - gBattlescriptCurrInstr += 2; + if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) + IncrementGameStat(cmd->stat); + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_drawpartystatussummary(void) { + CMD_ARGS(u8 battler); + s32 i; struct Pokemon *party; struct HpAndStatus hpStatuses[PARTY_SIZE]; @@ -7308,7 +7626,7 @@ static void Cmd_drawpartystatussummary(void) if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) party = gPlayerParty; @@ -7333,21 +7651,25 @@ static void Cmd_drawpartystatussummary(void) BtlController_EmitDrawPartyStatusSummary(BUFFER_A, hpStatuses, 1); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_hidepartystatussummary(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + gActiveBattler = GetBattlerForBattleScript(cmd->battler); BtlController_EmitHidePartyStatusSummary(BUFFER_A); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumptocalledmove(void) { - if (gBattlescriptCurrInstr[1]) + CMD_ARGS(bool8 notChosenMove); + + if (cmd->notChosenMove) gCurrentMove = gCalledMove; else gChosenMove = gCurrentMove = gCalledMove; @@ -7357,9 +7679,11 @@ static void Cmd_jumptocalledmove(void) static void Cmd_statusanimation(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (!(gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) && gDisableStructs[gActiveBattler].substituteHP == 0 && !(gHitMarker & HITMARKER_NO_ANIMATIONS)) @@ -7367,18 +7691,20 @@ static void Cmd_statusanimation(void) BtlController_EmitStatusAnimation(BUFFER_A, FALSE, gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_status2animation(void) { + CMD_ARGS(u8 battler, u32 status2); + u32 wantedToAnimate; if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - wantedToAnimate = T1_READ_32(gBattlescriptCurrInstr + 2); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); + wantedToAnimate = cmd->status2; if (!(gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) && gDisableStructs[gActiveBattler].substituteHP == 0 && !(gHitMarker & HITMARKER_NO_ANIMATIONS)) @@ -7386,31 +7712,35 @@ static void Cmd_status2animation(void) BtlController_EmitStatusAnimation(BUFFER_A, TRUE, gBattleMons[gActiveBattler].status2 & wantedToAnimate); MarkBattlerForControllerExec(gActiveBattler); } - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_chosenstatusanimation(void) { + CMD_ARGS(u8 battler, bool8 isStatus2, u32 status); + u32 wantedStatus; if (gBattleControllerExecFlags == 0) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - wantedStatus = T1_READ_32(gBattlescriptCurrInstr + 3); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); + wantedStatus = cmd->status; if (!(gStatuses3[gActiveBattler] & STATUS3_SEMI_INVULNERABLE) && gDisableStructs[gActiveBattler].substituteHP == 0 && !(gHitMarker & HITMARKER_NO_ANIMATIONS)) { - BtlController_EmitStatusAnimation(BUFFER_A, gBattlescriptCurrInstr[2], wantedStatus); + BtlController_EmitStatusAnimation(BUFFER_A, cmd->isStatus2, wantedStatus); MarkBattlerForControllerExec(gActiveBattler); } - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_yesnobox(void) { + CMD_ARGS(); + switch (gBattleCommunication[0]) { case 0: @@ -7440,13 +7770,13 @@ static void Cmd_yesnobox(void) gBattleCommunication[CURSOR_POSITION] = 1; PlaySE(SE_SELECT); HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } break; } @@ -7454,25 +7784,29 @@ static void Cmd_yesnobox(void) static void Cmd_cancelallactions(void) { + CMD_ARGS(); + s32 i; for (i = 0; i < gBattlersCount; i++) gActionsByTurnOrder[i] = B_ACTION_CANCEL_PARTNER; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setgravity(void) { + CMD_ARGS(const u8 *failInstr); + if (gFieldStatuses & STATUS_FIELD_GRAVITY) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gFieldStatuses |= STATUS_FIELD_GRAVITY; gFieldTimers.gravityTimer = 5; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -7541,16 +7875,18 @@ static bool32 TrySymbiosis(u32 battler, u32 itemId) static void Cmd_removeitem(void) { + CMD_ARGS(u8 battler); + u16 itemId = 0; if (gBattleScripting.overrideBerryRequirements) { // bug bite / pluck - don't remove current item - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; return; } - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); itemId = gBattleMons[gActiveBattler].item; // Popped Air Balloon cannot be restored by any means. @@ -7565,18 +7901,22 @@ static void Cmd_removeitem(void) ClearBattlerItemEffectHistory(gActiveBattler); if (!TryCheekPouch(gActiveBattler, itemId) && !TrySymbiosis(gActiveBattler, itemId)) - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_atknameinbuff1(void) { + CMD_ARGS(); + PREPARE_MON_NICK_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattlerPartyIndexes[gBattlerAttacker]); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_drawlvlupbox(void) { + CMD_ARGS(); + if (gBattleScripting.drawlvlupboxState == 0) { // If the Pokémon getting exp is not in-battle then @@ -7670,7 +8010,7 @@ static void Cmd_drawlvlupbox(void) SetBgAttribute(1, BG_ATTR_PRIORITY, 1); ShowBg(0); ShowBg(1); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } break; } @@ -7858,33 +8198,41 @@ static bool32 IsMonGettingExpSentOut(void) static void Cmd_resetsentmonsvalue(void) { + CMD_ARGS(); + ResetSentPokesToOpponentValue(); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setatktoplayer0(void) { + CMD_ARGS(); + gBattlerAttacker = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_makevisible(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); BtlController_EmitSpriteInvisibility(BUFFER_A, FALSE); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_recordability(void) { - u8 battler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + u8 battler = GetBattlerForBattleScript(cmd->battler); RecordAbilityBattle(battler, gBattleMons[battler].ability); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } void BufferMoveToLearnIntoBattleTextBuff2(void) @@ -7894,26 +8242,32 @@ void BufferMoveToLearnIntoBattleTextBuff2(void) static void Cmd_buffermovetolearn(void) { + CMD_ARGS(); + BufferMoveToLearnIntoBattleTextBuff2(); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifplayerran(void) { + CMD_ARGS(const u8 *jumpInstr); + if (TryRunFromBattle(gBattlerFainted)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_hpthresholds(void) { + CMD_ARGS(u8 battler); + u8 opposingBattler; s32 result; if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); opposingBattler = BATTLE_OPPOSITE(gActiveBattler); result = gBattleMons[opposingBattler].hp * 100 / gBattleMons[opposingBattler].maxHP; @@ -7930,18 +8284,20 @@ static void Cmd_hpthresholds(void) gBattleStruct->hpScale = 3; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_hpthresholds2(void) { + CMD_ARGS(u8 battler); + u8 opposingBattler; s32 result; u8 hpSwitchout; if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); opposingBattler = BATTLE_OPPOSITE(gActiveBattler); hpSwitchout = *(gBattleStruct->hpOnSwitchout + GetBattlerSide(opposingBattler)); result = (hpSwitchout - gBattleMons[opposingBattler].hp) * 100 / hpSwitchout; @@ -7956,14 +8312,16 @@ static void Cmd_hpthresholds2(void) gBattleStruct->hpScale = 3; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_useitemonopponent(void) { + CMD_ARGS(); + gBattlerInMenuId = gBattlerAttacker; PokemonUseItemEffects(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker]], gLastUsedItem, gBattlerPartyIndexes[gBattlerAttacker], 0, TRUE); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static bool32 HasAttackerFaintedTarget(void) @@ -8340,8 +8698,42 @@ static bool32 CanTeleport(u8 battlerId) return TRUE; } +// Return True if the order was changed, and false if the order was not changed(for example because the target would move after the attacker anyway). +static bool32 ChangeOrderTargetAfterAttacker(void) +{ + u32 i; + u8 data[MAX_BATTLERS_COUNT]; + + if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget) + || GetBattlerTurnOrderNum(gBattlerAttacker) + 1 == GetBattlerTurnOrderNum(gBattlerTarget)) + return FALSE; + + for (i = 0; i < gBattlersCount; i++) + data[i] = gBattlerByTurnOrder[i]; + if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 2) + { + gBattlerByTurnOrder[1] = gBattlerTarget; + gBattlerByTurnOrder[2] = data[1]; + gBattlerByTurnOrder[3] = data[3]; + } + else if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 3) + { + gBattlerByTurnOrder[1] = gBattlerTarget; + gBattlerByTurnOrder[2] = data[1]; + gBattlerByTurnOrder[3] = data[2]; + } + else // Attacker == 1, Target == 3 + { + gBattlerByTurnOrder[2] = gBattlerTarget; + gBattlerByTurnOrder[3] = data[2]; + } + return TRUE; +} + static void Cmd_various(void) { + CMD_ARGS(u8 battler, u8 id); + struct Pokemon *mon; s32 i, j; u8 data[10]; @@ -8350,88 +8742,125 @@ static void Cmd_various(void) if (gBattleControllerExecFlags) return; - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); - switch (gBattlescriptCurrInstr[2]) + switch (cmd->id) { // Roar will fail in a double wild battle when used by the player against one of the two alive wild mons. // Also when an opposing wild mon uses it againt its partner. case VARIOUS_JUMP_IF_ROAR_FAILS: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (WILD_DOUBLE_BATTLE && GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER && GetBattlerSide(gBattlerTarget) == B_SIDE_OPPONENT && IS_WHOLE_SIDE_ALIVE(gBattlerTarget)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else if (WILD_DOUBLE_BATTLE && GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT && GetBattlerSide(gBattlerTarget) == B_SIDE_OPPONENT) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_JUMP_IF_ABSENT: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (!IsBattlerAlive(gActiveBattler)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_JUMP_IF_SHIELDS_DOWN_PROTECTED: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (IsShieldsDownProtected(gActiveBattler)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - else - gBattlescriptCurrInstr += 7; - return; - case VARIOUS_JUMP_IF_NO_HOLD_EFFECT: - if (GetBattlerHoldEffect(gActiveBattler, TRUE) != gBattlescriptCurrInstr[3]) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4); + gBattlerAbility = gActiveBattler; + gBattlescriptCurrInstr = cmd->jumpInstr; + } + else + { + gBattlescriptCurrInstr = cmd->nextInstr; + } + return; + } + case VARIOUS_JUMP_IF_NO_HOLD_EFFECT: + { + VARIOUS_ARGS(u8 holdEffect, const u8 *jumpInstr); + if (GetBattlerHoldEffect(gActiveBattler, TRUE) != cmd->holdEffect) + { + gBattlescriptCurrInstr = cmd->jumpInstr; } else { gLastUsedItem = gBattleMons[gActiveBattler].item; // For B_LAST_USED_ITEM - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_JUMP_IF_NO_ALLY: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (!IsBattlerAlive(BATTLE_PARTNER(gActiveBattler))) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_INFATUATE_WITH_BATTLER: + { + VARIOUS_ARGS(u8 infatuateWith); gBattleScripting.battler = gActiveBattler; - gBattleMons[gActiveBattler].status2 |= STATUS2_INFATUATED_WITH(GetBattlerForBattleScript(gBattlescriptCurrInstr[3])); - gBattlescriptCurrInstr += 4; + gBattleMons[gActiveBattler].status2 |= STATUS2_INFATUATED_WITH(GetBattlerForBattleScript(cmd->infatuateWith)); + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_SET_LAST_USED_ITEM: + { + VARIOUS_ARGS(); gLastUsedItem = gBattleMons[gActiveBattler].item; break; + } case VARIOUS_TRY_FAIRY_LOCK: + { + VARIOUS_ARGS(const u8 *failInstr); if (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { gFieldStatuses |= STATUS_FIELD_FAIRY_LOCK; gFieldTimers.fairyLockTimer = 2; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_GET_STAT_VALUE: - i = gBattlescriptCurrInstr[3]; + { + VARIOUS_ARGS(u8 stat); + i = cmd->stat; gBattleMoveDamage = *(u16 *)(&gBattleMons[gActiveBattler].attack) + (i - 1); gBattleMoveDamage *= gStatStageRatios[gBattleMons[gActiveBattler].statStages[i]][0]; gBattleMoveDamage /= gStatStageRatios[gBattleMons[gActiveBattler].statStages[i]][1]; - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_JUMP_IF_FULL_HP: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (BATTLER_MAX_HP(gActiveBattler)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_TRY_FRISK: + { + VARIOUS_ARGS(); while (gBattleStruct->friskedBattler < gBattlersCount) { gBattlerTarget = gBattleStruct->friskedBattler++; @@ -8458,54 +8887,78 @@ static void Cmd_various(void) gBattleStruct->friskedBattler = 0; gBattleStruct->friskedAbility = FALSE; break; + } case VARIOUS_POISON_TYPE_IMMUNITY: - if (!CanPoisonType(gActiveBattler, GetBattlerForBattleScript(gBattlescriptCurrInstr[3]))) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4); + { + VARIOUS_ARGS(u8 target, const u8 *failInstr); + if (!CanPoisonType(gActiveBattler, GetBattlerForBattleScript(cmd->target))) + gBattlescriptCurrInstr = cmd->failInstr; else - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_PARALYZE_TYPE_IMMUNITY: - if (!CanParalyzeType(gActiveBattler, GetBattlerForBattleScript(gBattlescriptCurrInstr[3]))) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4); + { + VARIOUS_ARGS(u8 target, const u8 *failInstr); + if (!CanParalyzeType(gActiveBattler, GetBattlerForBattleScript(cmd->target))) + gBattlescriptCurrInstr = cmd->failInstr; else - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_TRACE_ABILITY: + { + VARIOUS_ARGS(); gBattleMons[gActiveBattler].ability = gBattleStruct->overwrittenAbilities[gActiveBattler] = gBattleStruct->tracedAbility[gActiveBattler]; break; + } case VARIOUS_TRY_ILLUSION_OFF: + { + VARIOUS_ARGS(); if (GetIllusionMonPtr(gActiveBattler) != NULL) { - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_IllusionOff; return; } break; + } case VARIOUS_SET_SPRITEIGNORE0HP: - gBattleStruct->spriteIgnore0Hp = gBattlescriptCurrInstr[3]; - gBattlescriptCurrInstr += 4; + { + VARIOUS_ARGS(bool8 ignore0HP); + gBattleStruct->spriteIgnore0Hp = cmd->ignore0HP; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_UPDATE_NICK: + { + VARIOUS_ARGS(); if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) mon = &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]; else mon = &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]; UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], mon, HEALTHBOX_NICK); break; + } case VARIOUS_JUMP_IF_NOT_BERRY: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (ItemId_GetPocket(gBattleMons[gActiveBattler].item) == POCKET_BERRIES) - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; return; + } case VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS: + { + VARIOUS_ARGS(const u8 *failInstr); if ((gStatuses3[gActiveBattler] & (STATUS3_SEMI_INVULNERABLE | STATUS3_HEAL_BLOCK)) || BATTLER_MAX_HP(gActiveBattler) || !gBattleMons[gActiveBattler].hp || !(IsBattlerGrounded(gActiveBattler))) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -8514,17 +8967,23 @@ static void Cmd_various(void) gBattleMoveDamage = 1; gBattleMoveDamage *= -1; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_GRAVITY_ON_AIRBORNE_MONS: + { + VARIOUS_ARGS(); // Cancel all multiturn moves of IN_AIR Pokemon except those being targeted by Sky Drop. if (gStatuses3[gActiveBattler] & STATUS3_ON_AIR && !(gStatuses3[gActiveBattler] & STATUS3_SKY_DROPPED)) CancelMultiTurnMoves(gActiveBattler); gStatuses3[gActiveBattler] &= ~(STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS | STATUS3_ON_AIR | STATUS3_SKY_DROPPED); break; + } case VARIOUS_SPECTRAL_THIEF: + { + VARIOUS_ARGS(); // Raise stats for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { @@ -8541,10 +9000,16 @@ static void Cmd_various(void) } } break; + } case VARIOUS_SET_POWDER: + { + VARIOUS_ARGS(); gBattleMons[gActiveBattler].status2 |= STATUS2_POWDER; break; + } case VARIOUS_ACUPRESSURE: + { + VARIOUS_ARGS(const u8 *failInstr); bits = 0; for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { @@ -8560,17 +9025,23 @@ static void Cmd_various(void) } while (!(bits & gBitTable[statId])); SET_STATCHANGER(statId, 2, FALSE); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } return; + } case VARIOUS_CANCEL_MULTI_TURN_MOVES: + { + VARIOUS_ARGS(); CancelMultiTurnMoves(gActiveBattler); break; + } case VARIOUS_SET_MAGIC_COAT_TARGET: + { + VARIOUS_ARGS(); gBattleStruct->attackerBeforeBounce = gActiveBattler; gBattlerAttacker = gBattlerTarget; side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker)); @@ -8579,23 +9050,38 @@ static void Cmd_various(void) else gBattlerTarget = gActiveBattler; break; + } case VARIOUS_IS_RUNNING_IMPOSSIBLE: + { + VARIOUS_ARGS(); gBattleCommunication[0] = IsRunningFromBattleImpossible(); break; + } case VARIOUS_GET_MOVE_TARGET: + { + VARIOUS_ARGS(); gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); break; + } case VARIOUS_GET_BATTLER_FAINTED: + { + VARIOUS_ARGS(); if (gHitMarker & HITMARKER_FAINTED(gActiveBattler)) gBattleCommunication[0] = TRUE; else gBattleCommunication[0] = FALSE; break; + } case VARIOUS_RESET_SWITCH_IN_ABILITY_BITS: + { + VARIOUS_ARGS(); gSpecialStatuses[gActiveBattler].traced = FALSE; gSpecialStatuses[gActiveBattler].switchInAbilityDone = FALSE; break; + } case VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP: + { + VARIOUS_ARGS(); if (gBattlerPartyIndexes[0] == gBattleStruct->expGetterMonId || gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId) { if (gBattlerPartyIndexes[0] == gBattleStruct->expGetterMonId) @@ -8612,7 +9098,10 @@ static void Cmd_various(void) gBattleStruct->choicedMove[gActiveBattler] = MOVE_NONE; } break; + } case VARIOUS_RESET_PLAYER_FAINTED: + { + VARIOUS_ARGS(); if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLE)) && gBattleTypeFlags & BATTLE_TYPE_TRAINER && gBattleMons[0].hp != 0 @@ -8621,7 +9110,10 @@ static void Cmd_various(void) gHitMarker &= ~HITMARKER_PLAYER_FAINTED; } break; + } case VARIOUS_PALACE_FLAVOR_TEXT: + { + VARIOUS_ARGS(); // Try and print end-of-turn Battle Palace flavor text (e.g. "A glint appears in mon's eyes") gBattleCommunication[0] = FALSE; // whether or not msg should be printed gBattleScripting.battler = gActiveBattler = gBattleCommunication[1]; @@ -8635,7 +9127,11 @@ static void Cmd_various(void) gBattleCommunication[MULTISTRING_CHOOSER] = sBattlePalaceNatureToFlavorTextId[GetNatureFromPersonality(gBattleMons[gActiveBattler].personality)]; } break; + } case VARIOUS_ARENA_JUDGMENT_WINDOW: + { + VARIOUS_ARGS(); + i = BattleArena_ShowJudgmentWindow(&gBattleCommunication[0]); // BattleArena_ShowJudgmentWindow's last state was an intermediate step. @@ -8645,20 +9141,29 @@ static void Cmd_various(void) gBattleCommunication[1] = i; break; + } case VARIOUS_ARENA_OPPONENT_MON_LOST: + { + VARIOUS_ARGS(); gBattleMons[1].hp = 0; gHitMarker |= HITMARKER_FAINTED(1); gBattleStruct->arenaLostOpponentMons |= gBitTable[gBattlerPartyIndexes[1]]; gDisableStructs[1].truantSwitchInHack = 1; break; + } case VARIOUS_ARENA_PLAYER_MON_LOST: + { + VARIOUS_ARGS(); gBattleMons[0].hp = 0; gHitMarker |= HITMARKER_FAINTED(0); gHitMarker |= HITMARKER_PLAYER_FAINTED; gBattleStruct->arenaLostPlayerMons |= gBitTable[gBattlerPartyIndexes[0]]; gDisableStructs[0].truantSwitchInHack = 1; break; + } case VARIOUS_ARENA_BOTH_MONS_LOST: + { + VARIOUS_ARGS(); gBattleMons[0].hp = 0; gBattleMons[1].hp = 0; gHitMarker |= HITMARKER_FAINTED(0); @@ -8669,29 +9174,50 @@ static void Cmd_various(void) gDisableStructs[0].truantSwitchInHack = 1; gDisableStructs[1].truantSwitchInHack = 1; break; + } case VARIOUS_EMIT_YESNOBOX: + { + VARIOUS_ARGS(); BtlController_EmitYesNoBox(BUFFER_A); MarkBattlerForControllerExec(gActiveBattler); break; + } case VARIOUS_DRAW_ARENA_REF_TEXT_BOX: + { + VARIOUS_ARGS(); DrawArenaRefereeTextBox(); break; + } case VARIOUS_ERASE_ARENA_REF_TEXT_BOX: + { + VARIOUS_ARGS(); EraseArenaRefereeTextBox(); break; + } case VARIOUS_ARENA_JUDGMENT_STRING: - BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]); + { + CMD_ARGS(u8 id, u8 _); + BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[cmd->id]); BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGMENT_TEXT); break; + } case VARIOUS_ARENA_WAIT_STRING: + { + VARIOUS_ARGS(); if (IsTextPrinterActive(ARENA_WIN_JUDGMENT_TEXT)) return; break; + } case VARIOUS_WAIT_CRY: + { + VARIOUS_ARGS(); if (!IsCryFinished()) return; break; + } case VARIOUS_RETURN_OPPONENT_MON1: + { + VARIOUS_ARGS(); gActiveBattler = 1; if (gBattleMons[gActiveBattler].hp != 0) { @@ -8699,7 +9225,10 @@ static void Cmd_various(void) MarkBattlerForControllerExec(gActiveBattler); } break; + } case VARIOUS_RETURN_OPPONENT_MON2: + { + VARIOUS_ARGS(); if (gBattlersCount > 3) { gActiveBattler = 3; @@ -8710,20 +9239,35 @@ static void Cmd_various(void) } } break; + } case VARIOUS_VOLUME_DOWN: + { + VARIOUS_ARGS(); m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x55); break; + } case VARIOUS_VOLUME_UP: + { + VARIOUS_ARGS(); m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100); break; + } case VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT: + { + VARIOUS_ARGS(); gBattleStruct->alreadyStatusedMoveAttempt |= gBitTable[gActiveBattler]; break; + } case VARIOUS_PALACE_TRY_ESCAPE_STATUS: + { + VARIOUS_ARGS(); if (BattlePalace_TryEscapeStatus(gActiveBattler)) return; break; + } case VARIOUS_SET_TELEPORT_OUTCOME: + { + VARIOUS_ARGS(); // Don't end the battle if one of the wild mons teleported from the wild double battle // and its partner is still alive. if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT && IsBattlerAlive(BATTLE_PARTNER(gActiveBattler))) @@ -8744,35 +9288,59 @@ static void Cmd_various(void) gBattleOutcome = B_OUTCOME_MON_TELEPORTED; } break; + } case VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC: + { + VARIOUS_ARGS(); BtlController_EmitPlayFanfareOrBGM(BUFFER_A, MUS_VICTORY_TRAINER, TRUE); MarkBattlerForControllerExec(gActiveBattler); break; + } case VARIOUS_STAT_TEXT_BUFFER: + { + VARIOUS_ARGS(); PREPARE_STAT_BUFFER(gBattleTextBuff1, gBattleCommunication[0]); break; + } case VARIOUS_SWITCHIN_ABILITIES: - gBattlescriptCurrInstr += 3; + { + VARIOUS_ARGS(); + gBattlescriptCurrInstr = cmd->nextInstr; AbilityBattleEffects(ABILITYEFFECT_NEUTRALIZINGGAS, gActiveBattler, 0, 0, 0); AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0); AbilityBattleEffects(ABILITYEFFECT_TRACE2, gActiveBattler, 0, 0, 0); return; + } case VARIOUS_SAVE_TARGET: + { + VARIOUS_ARGS(); gBattleStruct->savedBattlerTarget = gBattlerTarget; break; + } case VARIOUS_RESTORE_TARGET: + { + VARIOUS_ARGS(); gBattlerTarget = gBattleStruct->savedBattlerTarget; break; + } case VARIOUS_INSTANT_HP_DROP: + { + VARIOUS_ARGS(); BtlController_EmitHealthBarUpdate(BUFFER_A, INSTANT_HP_BAR_DROP); MarkBattlerForControllerExec(gActiveBattler); break; + } case VARIOUS_CLEAR_STATUS: + { + VARIOUS_ARGS(); gBattleMons[gActiveBattler].status1 = 0; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); break; + } case VARIOUS_RESTORE_PP: + { + VARIOUS_ARGS(); for (i = 0; i < 4; i++) { gBattleMons[gActiveBattler].pp[i] = CalculatePPWithBonus(gBattleMons[gActiveBattler].moves[i], gBattleMons[gActiveBattler].ppBonuses, i); @@ -8782,8 +9350,11 @@ static void Cmd_various(void) BtlController_EmitSetMonData(BUFFER_A, REQUEST_PP_DATA_BATTLE, 0, 5, data); MarkBattlerForControllerExec(gActiveBattler); break; + } case VARIOUS_TRY_ACTIVATE_MOXIE: // and chilling neigh + as one ice rider { + VARIOUS_ARGS(); + u16 battlerAbility = GetBattlerAbility(gActiveBattler); if ((battlerAbility == ABILITY_MOXIE @@ -8796,17 +9367,19 @@ static void Cmd_various(void) gBattleMons[gBattlerAttacker].statStages[STAT_ATK]++; SET_STATCHANGER(STAT_ATK, 1, FALSE); PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK); - BattleScriptPush(gBattlescriptCurrInstr + 3); + BattleScriptPush(cmd->nextInstr); gLastUsedAbility = battlerAbility; if (battlerAbility == ABILITY_AS_ONE_ICE_RIDER) gBattleScripting.abilityPopupOverwrite = gLastUsedAbility = ABILITY_CHILLING_NEIGH; gBattlescriptCurrInstr = BattleScript_RaiseStatOnFaintingTarget; return; } - } break; + } case VARIOUS_TRY_ACTIVATE_GRIM_NEIGH: // and as one shadow rider { + VARIOUS_ARGS(); + u16 battlerAbility = GetBattlerAbility(gActiveBattler); if ((battlerAbility == ABILITY_GRIM_NEIGH @@ -8818,16 +9391,18 @@ static void Cmd_various(void) gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]++; SET_STATCHANGER(STAT_SPATK, 1, FALSE); PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPATK); - BattleScriptPush(gBattlescriptCurrInstr + 3); + BattleScriptPush(cmd->nextInstr); gLastUsedAbility = battlerAbility; if (battlerAbility == ABILITY_AS_ONE_SHADOW_RIDER) gBattleScripting.abilityPopupOverwrite = gLastUsedAbility = ABILITY_GRIM_NEIGH; gBattlescriptCurrInstr = BattleScript_RaiseStatOnFaintingTarget; return; } - } break; + } case VARIOUS_TRY_ACTIVATE_RECEIVER: // Partner gets fainted's ally ability + { + VARIOUS_ARGS(); gBattlerAbility = BATTLE_PARTNER(gActiveBattler); i = GetBattlerAbility(gBattlerAbility); if (IsBattlerAlive(gBattlerAbility) @@ -8849,13 +9424,16 @@ static void Cmd_various(void) default: gBattleStruct->tracedAbility[gBattlerAbility] = gBattleMons[gActiveBattler].ability; // re-using the variable for trace gBattleScripting.battler = gActiveBattler; - BattleScriptPush(gBattlescriptCurrInstr + 3); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_ReceiverActivates; return; } } break; + } case VARIOUS_TRY_ACTIVATE_BEAST_BOOST: + { + VARIOUS_ARGS(); i = GetHighestStatId(gActiveBattler); if (GetBattlerAbility(gActiveBattler) == ABILITY_BEAST_BOOST && HasAttackerFaintedTarget() @@ -8865,12 +9443,15 @@ static void Cmd_various(void) gBattleMons[gBattlerAttacker].statStages[i]++; SET_STATCHANGER(i, 1, FALSE); PREPARE_STAT_BUFFER(gBattleTextBuff1, i); - BattleScriptPush(gBattlescriptCurrInstr + 3); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_AttackerAbilityStatRaise; return; } break; + } case VARIOUS_TRY_ACTIVATE_SOULHEART: + { + VARIOUS_ARGS(); while (gBattleStruct->soulheartBattlerId < gBattlersCount) { gBattleScripting.battler = gBattleStruct->soulheartBattlerId++; @@ -8889,7 +9470,10 @@ static void Cmd_various(void) } gBattleStruct->soulheartBattlerId = 0; break; + } case VARIOUS_TRY_ACTIVATE_FELL_STINGER: + { + VARIOUS_ARGS(); if (gBattleMoves[gCurrentMove].effect == EFFECT_FELL_STINGER && HasAttackerFaintedTarget() && !NoAliveMonsForEitherParty() @@ -8901,50 +9485,62 @@ static void Cmd_various(void) SET_STATCHANGER(STAT_ATK, 2, FALSE); #endif PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK); - BattleScriptPush(gBattlescriptCurrInstr + 3); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_FellStingerRaisesStat; return; } break; + } case VARIOUS_PLAY_MOVE_ANIMATION: - BtlController_EmitMoveAnimation(BUFFER_A, T1_READ_16(gBattlescriptCurrInstr + 3), gBattleScripting.animTurn, 0, 0, gBattleMons[gActiveBattler].friendship, &gDisableStructs[gActiveBattler], gMultiHitCounter); + { + VARIOUS_ARGS(u16 move); + BtlController_EmitMoveAnimation(BUFFER_A, cmd->move, gBattleScripting.animTurn, 0, 0, gBattleMons[gActiveBattler].friendship, &gDisableStructs[gActiveBattler], gMultiHitCounter); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_SET_LUCKY_CHANT: + { + VARIOUS_ARGS(const u8 *failInstr); if (!(gSideStatuses[GET_BATTLER_SIDE(gActiveBattler)] & SIDE_STATUS_LUCKY_CHANT)) { gSideStatuses[GET_BATTLER_SIDE(gActiveBattler)] |= SIDE_STATUS_LUCKY_CHANT; gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].luckyChantBattlerId = gActiveBattler; gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].luckyChantTimer = 5; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } return; + } case VARIOUS_SUCKER_PUNCH_CHECK: + { + VARIOUS_ARGS(const u8 *failInstr); if (gProtectStructs[gBattlerTarget].obstructed) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; else if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; else if (IS_MOVE_STATUS(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]])) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_SET_SIMPLE_BEAM: + { + VARIOUS_ARGS(const u8 *failInstr); if (IsEntrainmentTargetOrSimpleBeamBannedAbility(gBattleMons[gBattlerTarget].ability) || gBattleMons[gBattlerTarget].ability == ABILITY_SIMPLE) { RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) { RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_ABILITY_SHIELD); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -8952,41 +9548,50 @@ static void Cmd_various(void) gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE; gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = ABILITY_SIMPLE; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_TRY_ENTRAINMENT: + { + VARIOUS_ARGS(const u8 *failInstr); if (IsEntrainmentBannedAbilityAttacker(gBattleMons[gBattlerAttacker].ability) || IsEntrainmentTargetOrSimpleBeamBannedAbility(gBattleMons[gBattlerTarget].ability)) { RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) { RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_ABILITY_SHIELD); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { if (gBattleMons[gBattlerTarget].ability == gBattleMons[gBattlerAttacker].ability) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = gBattleMons[gBattlerAttacker].ability; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } } return; + } case VARIOUS_SET_LAST_USED_ABILITY: + { + VARIOUS_ARGS(); gLastUsedAbility = gBattleMons[gActiveBattler].ability; break; + } case VARIOUS_TRY_HEAL_PULSE: + { + VARIOUS_ARGS(const u8 *failInstr); if (BATTLER_MAX_HP(gActiveBattler)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -8997,21 +9602,27 @@ static void Cmd_various(void) if (gBattleMoveDamage == 0) gBattleMoveDamage = -1; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_TRY_QUASH: + { + VARIOUS_ARGS(const u8 *failInstr); if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) // It's true if foe is faster, has a bigger priority, or switches { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // This replaces the current battlescript with the "fail" script. + gBattlescriptCurrInstr = cmd->failInstr; // This replaces the current battlescript with the "fail" script. } else // If the condition is not true, it means we are faster than the foe, so we can set the quash bit { gProtectStructs[gBattlerTarget].quash = TRUE; - gBattlescriptCurrInstr += 7; // and then we proceed with the rest of our battlescript + gBattlescriptCurrInstr = cmd->nextInstr; // and then we proceed with the rest of our battlescript } return; + } case VARIOUS_INVERT_STAT_STAGES: + { + VARIOUS_ARGS(); for (i = 0; i < NUM_BATTLE_STATS; i++) { if (gBattleMons[gActiveBattler].statStages[i] < DEFAULT_STAT_STAGE) // Negative becomes positive. @@ -9020,14 +9631,20 @@ static void Cmd_various(void) gBattleMons[gActiveBattler].statStages[i] = DEFAULT_STAT_STAGE - (gBattleMons[gActiveBattler].statStages[i] - DEFAULT_STAT_STAGE); } break; + } case VARIOUS_SET_TERRAIN: + { + VARIOUS_ARGS(const u8 *failInstr); HandleTerrainMove(gCurrentMove); return; + } case VARIOUS_TRY_ME_FIRST: + { + VARIOUS_ARGS(const u8 *failInstr); if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; else if (IS_MOVE_STATUS(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]])) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; else { u16 move = gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]; @@ -9043,84 +9660,100 @@ static void Cmd_various(void) case MOVE_METAL_BURST: case MOVE_ME_FIRST: case MOVE_BEAK_BLAST: - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; break; default: gCalledMove = move; gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); gStatuses3[gBattlerAttacker] |= STATUS3_ME_FIRST; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; break; } } return; + } case VARIOUS_JUMP_IF_BATTLE_END: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (NoAliveMonsForEitherParty()) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_TRY_ELECTRIFY: + { + VARIOUS_ARGS(const u8 *failInstr); if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { gStatuses4[gBattlerTarget] |= STATUS4_ELECTRIFIED; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_TRY_REFLECT_TYPE: + { + VARIOUS_ARGS(const u8 *failInstr); if (gBattleMons[gBattlerTarget].species == SPECIES_ARCEUS || gBattleMons[gBattlerTarget].species == SPECIES_SILVALLY) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else if (gBattleMons[gBattlerTarget].type1 == TYPE_MYSTERY && gBattleMons[gBattlerTarget].type2 != TYPE_MYSTERY) { gBattleMons[gBattlerAttacker].type1 = gBattleMons[gBattlerTarget].type2; gBattleMons[gBattlerAttacker].type2 = gBattleMons[gBattlerTarget].type2; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (gBattleMons[gBattlerTarget].type1 != TYPE_MYSTERY && gBattleMons[gBattlerTarget].type2 == TYPE_MYSTERY) { gBattleMons[gBattlerAttacker].type1 = gBattleMons[gBattlerTarget].type1; gBattleMons[gBattlerAttacker].type2 = gBattleMons[gBattlerTarget].type1; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (gBattleMons[gBattlerTarget].type1 == TYPE_MYSTERY && gBattleMons[gBattlerTarget].type2 == TYPE_MYSTERY) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMons[gBattlerAttacker].type1 = gBattleMons[gBattlerTarget].type1; gBattleMons[gBattlerAttacker].type2 = gBattleMons[gBattlerTarget].type2; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_TRY_SOAK: + { + VARIOUS_ARGS(const u8 *failInstr); if (gBattleMons[gBattlerTarget].type1 == gBattleMoves[gCurrentMove].type && gBattleMons[gBattlerTarget].type2 == gBattleMoves[gCurrentMove].type) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { SET_BATTLER_TYPE(gBattlerTarget, gBattleMoves[gCurrentMove].type); PREPARE_TYPE_BUFFER(gBattleTextBuff1, gBattleMoves[gCurrentMove].type); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_HANDLE_MEGA_EVO: + { + VARIOUS_ARGS(u8 case_); + if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) mon = &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]; else mon = &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]; // Change species. - if (gBattlescriptCurrInstr[3] == 0) + if (cmd->case_ == 0) { u16 megaSpecies; gBattleStruct->mega.evolvedSpecies[gActiveBattler] = gBattleMons[gActiveBattler].species; @@ -9144,7 +9777,7 @@ static void Cmd_various(void) MarkBattlerForControllerExec(gActiveBattler); } // Change stats. - else if (gBattlescriptCurrInstr[3] == 1) + else if (cmd->case_ == 1) { RecalcBattlerStats(gActiveBattler, mon); gBattleStruct->mega.alreadyEvolved[GetBattlerPosition(gActiveBattler)] = TRUE; @@ -9158,16 +9791,19 @@ static void Cmd_various(void) if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) SetBattlerShadowSpriteCallback(gActiveBattler, gBattleMons[gActiveBattler].species); } - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_HANDLE_PRIMAL_REVERSION: + { + VARIOUS_ARGS(u8 case_); if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) mon = &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]; else mon = &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]; // Change species. - if (gBattlescriptCurrInstr[3] == 0) + if (cmd->case_ == 0) { u16 primalSpecies; gBattleStruct->mega.primalRevertedSpecies[gActiveBattler] = gBattleMons[gActiveBattler].species; @@ -9186,7 +9822,7 @@ static void Cmd_various(void) MarkBattlerForControllerExec(gActiveBattler); } // Change stats. - else if (gBattlescriptCurrInstr[3] == 1) + else if (cmd->case_ == 1) { RecalcBattlerStats(gActiveBattler, mon); gBattleStruct->mega.primalRevertedPartyIds[GetBattlerSide(gActiveBattler)] |= gBitTable[gBattlerPartyIndexes[gActiveBattler]]; @@ -9199,16 +9835,19 @@ static void Cmd_various(void) if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) SetBattlerShadowSpriteCallback(gActiveBattler, gBattleMons[gActiveBattler].species); } - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_HANDLE_FORM_CHANGE: + { + VARIOUS_ARGS(u8 case_); if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) mon = &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]; else mon = &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]; // Change species. - if (gBattlescriptCurrInstr[3] == 0) + if (cmd->case_ == 0) { if (!gBattleTextBuff1) PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species); @@ -9216,7 +9855,7 @@ static void Cmd_various(void) MarkBattlerForControllerExec(gActiveBattler); } // Change stats. - else if (gBattlescriptCurrInstr[3] == 1) + else if (cmd->case_ == 1) { RecalcBattlerStats(gActiveBattler, mon); } @@ -9225,15 +9864,21 @@ static void Cmd_various(void) { UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], mon, HEALTHBOX_ALL); } - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_TRY_LAST_RESORT: + { + VARIOUS_ARGS(const u8 *failInstr); if (CanUseLastResort(gActiveBattler)) - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; return; + } case VARIOUS_ARGUMENT_STATUS_EFFECT: + { + VARIOUS_ARGS(); switch (gBattleMoves[gCurrentMove].argument) { case STATUS1_SLEEP: @@ -9260,12 +9905,15 @@ static void Cmd_various(void) } if (gBattleScripting.moveEffect != 0) { - BattleScriptPush(gBattlescriptCurrInstr + 3); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_EffectWithChance; return; } break; + } case VARIOUS_TRY_HIT_SWITCH_TARGET: + { + VARIOUS_ARGS(const u8 *failInstr); if (IsBattlerAlive(gBattlerAttacker) && IsBattlerAlive(gBattlerTarget) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) @@ -9273,42 +9921,51 @@ static void Cmd_various(void) && GetBattlerAbility(gBattlerTarget) != ABILITY_GUARD_DOG) { gBattleScripting.switchCase = B_SWITCH_HIT; - gBattlescriptCurrInstr = BattleScript_ForceRandomSwitch; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } return; + } case VARIOUS_TRY_AUTOTOMIZE: + { + VARIOUS_ARGS(const u8 *failInstr); if (GetBattlerWeight(gActiveBattler) > 1) { gDisableStructs[gActiveBattler].autotomizeCount++; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } return; + } case VARIOUS_TRY_COPYCAT: + { + VARIOUS_ARGS(const u8 *failInstr); if (gLastUsedMove == 0xFFFF || (sForbiddenMoves[gLastUsedMove] & FORBIDDEN_COPYCAT)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { gCalledMove = gLastUsedMove; gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_TRY_INSTRUCT: + { + VARIOUS_ARGS(const u8 *failInstr); if ((sForbiddenMoves[gLastMoves[gBattlerTarget]] & FORBIDDEN_INSTRUCT) || gLastMoves[gBattlerTarget] == 0xFFFF) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -9325,59 +9982,80 @@ static void Cmd_various(void) } } if (i != 4 || gBattleMons[gBattlerAttacker].pp[gCurrMovePos] == 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; else { gBattlerTarget = gBattleStruct->lastMoveTarget[gBattlerAttacker]; gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gActiveBattler, gBattlerPartyIndexes[gActiveBattler]); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } } return; + } case VARIOUS_ABILITY_POPUP: + { + VARIOUS_ARGS(); CreateAbilityPopUp(gActiveBattler, gBattleMons[gActiveBattler].ability, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0); break; + } case VARIOUS_UPDATE_ABILITY_POPUP: + { + VARIOUS_ARGS(); UpdateAbilityPopup(gActiveBattler); break; + } case VARIOUS_DEFOG: - if (T1_READ_8(gBattlescriptCurrInstr + 3)) // Clear + { + VARIOUS_ARGS(bool8 clear, const u8 *failInstr); + if (cmd->clear) // Clear { if (ClearDefogHazards(gEffectBattler, TRUE)) return; else - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; } else { if (ClearDefogHazards(gActiveBattler, FALSE)) - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4); + gBattlescriptCurrInstr = cmd->failInstr; } return; + } case VARIOUS_JUMP_IF_TARGET_ALLY: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget)) - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; return; + } case VARIOUS_TRY_SYNCHRONOISE: + { + VARIOUS_ARGS(const u8 *failInstr); if (!DoBattlersShareType(gBattlerAttacker, gBattlerTarget)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_LOSE_TYPE: + { + VARIOUS_ARGS(u8 type); for (i = 0; i < 3; i++) { - if (*(u8 *)(&gBattleMons[gActiveBattler].type1 + i) == gBattlescriptCurrInstr[3]) + if (*(u8 *)(&gBattleMons[gActiveBattler].type1 + i) == cmd->type) *(u8 *)(&gBattleMons[gActiveBattler].type1 + i) = TYPE_MYSTERY; } - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_PSYCHO_SHIFT: + { + VARIOUS_ARGS(const u8 *failInstr); // Psycho shift works if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_POISON) && CanBePoisoned(gBattlerAttacker, gBattlerTarget)) gBattleCommunication[MULTISTRING_CHOOSER] = 0; @@ -9389,120 +10067,139 @@ static void Cmd_various(void) gBattleCommunication[MULTISTRING_CHOOSER] = 3; else if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP) && CanSleep(gBattlerTarget)) gBattleCommunication[MULTISTRING_CHOOSER] = 4; - else + else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; return; } gBattleMons[gBattlerTarget].status1 = gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY; gActiveBattler = gBattlerTarget; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 7; - return; + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } case VARIOUS_CURE_STATUS: + { + VARIOUS_ARGS(); gBattleMons[gActiveBattler].status1 = 0; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); break; + } case VARIOUS_POWER_TRICK: + { + VARIOUS_ARGS(); gStatuses3[gActiveBattler] ^= STATUS3_POWER_TRICK; SWAP(gBattleMons[gActiveBattler].attack, gBattleMons[gActiveBattler].defense, i); break; + } case VARIOUS_AFTER_YOU: - if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget) - || GetBattlerTurnOrderNum(gBattlerAttacker) == GetBattlerTurnOrderNum(gBattlerTarget) + 1) + { + VARIOUS_ARGS(const u8 *failInstr); + if (ChangeOrderTargetAfterAttacker()) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gSpecialStatuses[gBattlerTarget].afterYou = 1; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - for (i = 0; i < gBattlersCount; i++) - data[i] = gBattlerByTurnOrder[i]; - if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 2) - { - gBattlerByTurnOrder[1] = gBattlerTarget; - gBattlerByTurnOrder[2] = data[1]; - gBattlerByTurnOrder[3] = data[3]; - } - else if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 3) - { - gBattlerByTurnOrder[1] = gBattlerTarget; - gBattlerByTurnOrder[2] = data[1]; - gBattlerByTurnOrder[3] = data[2]; - } - else - { - gBattlerByTurnOrder[2] = gBattlerTarget; - gBattlerByTurnOrder[3] = data[2]; - } - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->failInstr; } return; + } case VARIOUS_BESTOW: + { + VARIOUS_ARGS(const u8 *failInstr); if (gBattleMons[gBattlerAttacker].item == ITEM_NONE || gBattleMons[gBattlerTarget].item != ITEM_NONE || !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerAttacker].item) || !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerAttacker].item)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { BestowItem(gBattlerAttacker, gBattlerTarget); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_ARGUMENT_TO_MOVE_EFFECT: + { + VARIOUS_ARGS(); gBattleScripting.moveEffect = gBattleMoves[gCurrentMove].argument; break; + } case VARIOUS_JUMP_IF_NOT_GROUNDED: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (!IsBattlerGrounded(gActiveBattler)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_HANDLE_TRAINER_SLIDE_MSG: - if (gBattlescriptCurrInstr[3] == 0) + { + VARIOUS_ARGS(u8 case_); + if (cmd->case_ == 0) { - gBattleScripting.savedDmg = gBattlerSpriteIds[gActiveBattler]; + // Save sprite IDs, because trainer slide in will overwrite gBattlerSpriteIds variable. + gBattleScripting.savedDmg = (gBattlerSpriteIds[gActiveBattler] & 0xFF) | (gBattlerSpriteIds[BATTLE_PARTNER(gActiveBattler)] << 8); HideBattlerShadowSprite(gActiveBattler); } - else if (gBattlescriptCurrInstr[3] == 1) + else if (cmd->case_ == 1) { BtlController_EmitPrintString(BUFFER_A, STRINGID_TRAINERSLIDE); MarkBattlerForControllerExec(gActiveBattler); } else { - gBattlerSpriteIds[gActiveBattler] = gBattleScripting.savedDmg; - if (gBattleMons[gActiveBattler].hp != 0) + gBattlerSpriteIds[BATTLE_PARTNER(gActiveBattler)] = gBattleScripting.savedDmg >> 8; + gBattlerSpriteIds[gActiveBattler] = gBattleScripting.savedDmg & 0xFF; + if (IsBattlerAlive(gActiveBattler)) { SetBattlerShadowSpriteCallback(gActiveBattler, gBattleMons[gActiveBattler].species); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); } + i = BATTLE_PARTNER(gActiveBattler); + if (IsBattlerAlive(i)) + { + SetBattlerShadowSpriteCallback(i, gBattleMons[i].species); + BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[i]], i); + } } - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF: - if (ShouldDoTrainerSlide(gActiveBattler, gTrainerBattleOpponent_A, TRAINER_SLIDE_FIRST_DOWN)) + { + VARIOUS_ARGS(); + if ((i = ShouldDoTrainerSlide(gActiveBattler, TRAINER_SLIDE_FIRST_DOWN))) { gBattleScripting.battler = gActiveBattler; - BattleScriptPush(gBattlescriptCurrInstr + 3); - gBattlescriptCurrInstr = BattleScript_TrainerSlideMsgRet; + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = (i == 1 ? BattleScript_TrainerASlideMsgRet : BattleScript_TrainerBSlideMsgRet); return; } break; + } case VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON: - if (ShouldDoTrainerSlide(gActiveBattler, gTrainerBattleOpponent_A, TRAINER_SLIDE_LAST_SWITCHIN)) + { + VARIOUS_ARGS(); + if ((i = ShouldDoTrainerSlide(gActiveBattler, TRAINER_SLIDE_LAST_SWITCHIN))) { gBattleScripting.battler = gActiveBattler; - BattleScriptPush(gBattlescriptCurrInstr + 3); - gBattlescriptCurrInstr = BattleScript_TrainerSlideMsgRet; + BattleScriptPush(cmd->nextInstr); + gBattlescriptCurrInstr = (i == 1 ? BattleScript_TrainerASlideMsgRet : BattleScript_TrainerBSlideMsgRet); return; } break; + } case VARIOUS_SET_AURORA_VEIL: + { + VARIOUS_ARGS(); if (gSideStatuses[GET_BATTLER_SIDE(gActiveBattler)] & SIDE_STATUS_AURORA_VEIL || !(WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_HAIL)) { @@ -9524,26 +10221,35 @@ static void Cmd_various(void) gBattleCommunication[MULTISTRING_CHOOSER] = 5; } break; + } case VARIOUS_TRY_THIRD_TYPE: + { + VARIOUS_ARGS(const u8 *failInstr); if (IS_BATTLER_OF_TYPE(gActiveBattler, gBattleMoves[gCurrentMove].argument)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMons[gActiveBattler].type3 = gBattleMoves[gCurrentMove].argument; PREPARE_TYPE_BUFFER(gBattleTextBuff1, gBattleMoves[gCurrentMove].argument); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_DESTROY_ABILITY_POPUP: + { + VARIOUS_ARGS(); DestroyAbilityPopUp(gActiveBattler); break; + } case VARIOUS_TOTEM_BOOST: + { + VARIOUS_ARGS(const u8 *jumpInstr); gActiveBattler = gBattlerAttacker; if (gTotemBoosts[gActiveBattler].stats == 0) { - gBattlescriptCurrInstr += 7; // stats done, exit + gBattlescriptCurrInstr = cmd->nextInstr; // stats done, exit } else { @@ -9566,22 +10272,31 @@ static void Cmd_various(void) } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // do boost + gBattlescriptCurrInstr = cmd->jumpInstr; // do boost } return; } } - gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe) + gBattlescriptCurrInstr = cmd->nextInstr; // exit if loop failed (failsafe) } return; + } case VARIOUS_SET_Z_EFFECT: + { + VARIOUS_ARGS(); SetZEffect(); //handles battle script jumping internally return; + } case VARIOUS_MOVEEND_ITEM_EFFECTS: + { + VARIOUS_ARGS(); if (ItemBattleEffects(ITEMEFFECT_NORMAL, gActiveBattler, FALSE)) return; break; + } case VARIOUS_ROOM_SERVICE: + { + VARIOUS_ARGS(const u8 *failInstr); if (GetBattlerHoldEffect(gActiveBattler, TRUE) == HOLD_EFFECT_ROOM_SERVICE && TryRoomService(gActiveBattler)) { BattleScriptPushCursor(); @@ -9589,10 +10304,13 @@ static void Cmd_various(void) } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } return; + } case VARIOUS_TERRAIN_SEED: + { + VARIOUS_ARGS(const u8 *failInstr); if (GetBattlerHoldEffect(gActiveBattler, TRUE) == HOLD_EFFECT_SEEDS) { u8 effect = 0; @@ -9616,25 +10334,32 @@ static void Cmd_various(void) if (effect) return; } - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; return; + } case VARIOUS_MAKE_INVISIBLE: + { + VARIOUS_ARGS(); if (gBattleControllerExecFlags) break; BtlController_EmitSpriteInvisibility(BUFFER_A, TRUE); MarkBattlerForControllerExec(gActiveBattler); break; + } case VARIOUS_JUMP_IF_TERRAIN_AFFECTED: { - u32 flags = T1_READ_32(gBattlescriptCurrInstr + 3); + VARIOUS_ARGS(u32 flags, const u8 *jumpInstr); + u32 flags = cmd->flags; if (IsBattlerTerrainAffected(gActiveBattler, flags)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 7); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 11; + gBattlescriptCurrInstr = cmd->nextInstr; + return; } - return; case VARIOUS_EERIE_SPELL_PP_REDUCE: + { + VARIOUS_ARGS(const u8 *failInstr); if (gLastMoves[gActiveBattler] != 0 && gLastMoves[gActiveBattler] != 0xFFFF) { s32 i; @@ -9666,48 +10391,57 @@ static void Cmd_various(void) if (gBattleMons[gActiveBattler].pp[i] == 0 && gBattleStruct->skyDropTargets[gActiveBattler] == 0xFF) CancelMultiTurnMoves(gActiveBattler); - gBattlescriptCurrInstr += 7; // continue + gBattlescriptCurrInstr = cmd->nextInstr; // continue } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // cant reduce pp + gBattlescriptCurrInstr = cmd->failInstr; // cant reduce pp } } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // cant reduce pp + gBattlescriptCurrInstr = cmd->failInstr; // cant reduce pp } return; + } case VARIOUS_JUMP_IF_TEAM_HEALTHY: + { + VARIOUS_ARGS(const u8 *jumpInstr); if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerAlive(BATTLE_PARTNER(gActiveBattler))) { u8 partner = BATTLE_PARTNER(gActiveBattler); if ((gBattleMons[gActiveBattler].hp == gBattleMons[gActiveBattler].maxHP && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY)) && (gBattleMons[partner].hp == gBattleMons[partner].maxHP && !(gBattleMons[partner].status1 & STATUS1_ANY))) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // fail + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else // single battle { if (gBattleMons[gActiveBattler].hp == gBattleMons[gActiveBattler].maxHP && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // fail + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_TRY_HEAL_QUARTER_HP: + { + VARIOUS_ARGS(const u8 *failInstr); gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; gBattleMoveDamage *= -1; if (gBattleMons[gActiveBattler].hp == gBattleMons[gActiveBattler].maxHP) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // fail + gBattlescriptCurrInstr = cmd->failInstr; // fail else - gBattlescriptCurrInstr += 7; // can heal + gBattlescriptCurrInstr = cmd->nextInstr; // can heal return; + } case VARIOUS_REMOVE_TERRAIN: + { + VARIOUS_ARGS(); gFieldTimers.terrainTimer = 0; switch (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) { @@ -9729,14 +10463,20 @@ static void Cmd_various(void) } gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain break; + } case VARIOUS_JUMP_IF_UNDER_200: + { + VARIOUS_ARGS(const u8 *jumpInstr); // If the Pokemon is less than 200 kg, or weighing less than 441 lbs, then Sky Drop will work. Otherwise, it will fail. if (GetBattlerWeight(gBattlerTarget) < 2000) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_SET_SKY_DROP: + { + VARIOUS_ARGS(); gStatuses3[gBattlerTarget] |= (STATUS3_SKY_DROPPED | STATUS3_ON_AIR); /* skyDropTargets holds the information of who is in a particular instance of Sky Drop. This is needed in the case that multiple Pokemon use Sky Drop in the same turn or if @@ -9756,24 +10496,30 @@ static void Cmd_various(void) gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTimer = 0; break; + } case VARIOUS_CLEAR_SKY_DROP: + { + VARIOUS_ARGS(const u8 *failInstr); // Check to see if the initial target of this Sky Drop fainted before the 2nd turn of Sky Drop. // If so, make the move fail. If not, clear all of the statuses and continue the move. if (gBattleStruct->skyDropTargets[gBattlerAttacker] == 0xFF) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; else { gBattleStruct->skyDropTargets[gBattlerAttacker] = 0xFF; gBattleStruct->skyDropTargets[gBattlerTarget] = 0xFF; gStatuses3[gBattlerTarget] &= ~(STATUS3_SKY_DROPPED | STATUS3_ON_AIR); - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } // Confuse target if they were in the middle of Petal Dance/Outrage/Thrash when targeted. if (gBattleMons[gBattlerTarget].status2 & STATUS2_LOCK_CONFUSE) gBattleScripting.moveEffect = (MOVE_EFFECT_CONFUSION | MOVE_EFFECT_CERTAIN); return; + } case VARIOUS_SKY_DROP_YAWN: // If the mon that's sleeping due to Yawn was holding a Pokemon in Sky Drop, release the target and clear Sky Drop data. + { + VARIOUS_ARGS(); if (gBattleStruct->skyDropTargets[gEffectBattler] != 0xFF && !(gStatuses3[gEffectBattler] & STATUS3_SKY_DROPPED)) { // Set the target of Sky Drop as gEffectBattler @@ -9794,12 +10540,16 @@ static void Cmd_various(void) } } break; + } case VARIOUS_JUMP_IF_PRANKSTER_BLOCKED: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (BlocksPrankster(gCurrentMove, gBattlerAttacker, gActiveBattler, TRUE)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER: { bool8 shouldNotClear = FALSE; @@ -9834,15 +10584,20 @@ static void Cmd_various(void) break; } case VARIOUS_TRY_END_NEUTRALIZING_GAS: + { + VARIOUS_ARGS(); if (gSpecialStatuses[gActiveBattler].neutralizingGasRemoved) { gSpecialStatuses[gActiveBattler].neutralizingGasRemoved = FALSE; - BattleScriptPush(gBattlescriptCurrInstr + 3); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_NeutralizingGasExits; return; } break; + } case VARIOUS_GET_ROTOTILLER_TARGETS: + { + VARIOUS_ARGS(const u8 *failInstr); // Gets the battlers to be affected by rototiller. If there are none, print 'But it failed!' { u32 count = 0; @@ -9857,27 +10612,35 @@ static void Cmd_various(void) } if (count == 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // Rototiller fails + gBattlescriptCurrInstr = cmd->failInstr; // Rototiller fails else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (gSpecialStatuses[gActiveBattler].rototillerAffected) { gSpecialStatuses[gActiveBattler].rototillerAffected = FALSE; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // Unaffected by rototiller - print STRINGID_NOEFFECTONTARGET + gBattlescriptCurrInstr = cmd->jumpInstr; // Unaffected by rototiller - print STRINGID_NOEFFECTONTARGET } return; + } case VARIOUS_TRY_ACTIVATE_BATTLE_BOND: + { + VARIOUS_ARGS(); if (gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_BATTLE_BOND && HasAttackerFaintedTarget() - && CalculateEnemyPartyCount() > 1) + && CalculateEnemyPartyCount() > 1 + && !(gBattleStruct->battleBondTransformed[GET_BATTLER_SIDE2(gBattlerAttacker)] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) { + gBattleStruct->battleBondTransformed[GET_BATTLER_SIDE2(gBattlerAttacker)] |= gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]; PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species); gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species; gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH; @@ -9886,23 +10649,28 @@ static void Cmd_various(void) return; } break; + } case VARIOUS_CONSUME_BERRY: + { + VARIOUS_ARGS(bool8 fromBattler); if (gBattleScripting.overrideBerryRequirements == 2) { - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; return; } - - if (gBattlescriptCurrInstr[3]) + + if (cmd->fromBattler) gLastUsedItem = gBattleMons[gActiveBattler].item; - + gBattleScripting.battler = gEffectBattler = gBattlerTarget = gActiveBattler; // Cover all berry effect battlerId cases. e.g. ChangeStatBuffs uses target ID if (ItemBattleEffects(ITEMEFFECT_USE_LAST_ITEM, gActiveBattler, FALSE)) return; - gBattlescriptCurrInstr += 4; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL: { + VARIOUS_ARGS(const u8 *jumpInstr); bool8 canDoPrimalReversion = FALSE; for (i = 0; i < EVOS_PER_MON; i++) @@ -9912,35 +10680,47 @@ static void Cmd_various(void) canDoPrimalReversion = TRUE; } if (!canDoPrimalReversion) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; } case VARIOUS_JUMP_IF_WEATHER_AFFECTED: { - u32 weatherFlags = T1_READ_32(gBattlescriptCurrInstr + 3); - if (IsBattlerWeatherAffected(gActiveBattler, weatherFlags)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 7); + VARIOUS_ARGS(u32 flags, const u8 *jumpInstr); + u32 flags = cmd->flags; + if (IsBattlerWeatherAffected(gActiveBattler, flags)) + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 11; + gBattlescriptCurrInstr = cmd->nextInstr; + return; } - return; case VARIOUS_APPLY_PLASMA_FISTS: + { + VARIOUS_ARGS(); for (i = 0; i < gBattlersCount; i++) gStatuses4[i] |= STATUS4_PLASMA_FISTS; break; + } case VARIOUS_JUMP_IF_SPECIES: - if (gBattleMons[gActiveBattler].species == T1_READ_16(gBattlescriptCurrInstr + 3)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + { + VARIOUS_ARGS(u16 species, const u8 *jumpInstr); + if (gBattleMons[gActiveBattler].species == cmd->species) + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 9; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_PHOTON_GEYSER_CHECK: + { + VARIOUS_ARGS(); gBattleStruct->swapDamageCategory = (GetSplitBasedOnStats(gActiveBattler) == SPLIT_SPECIAL); break; + } case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment { + VARIOUS_ARGS(); + u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack; u32 targetDefStat = gBattleMons[gBattlerTarget].defense; u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack; @@ -9976,17 +10756,22 @@ static void Cmd_various(void) break; } case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (IsLeafGuardProtected(gActiveBattler)) { gBattlerAbility = gActiveBattler; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; } else { - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_SET_ATTACKER_STICKY_WEB_USER: + { + VARIOUS_ARGS(); // For Mirror Armor: "If the Pokémon with this Ability is affected by Sticky Web, the effect is reflected back to the Pokémon which set it up. // If Pokémon which set up Sticky Web is not on the field, no Pokémon have their Speed lowered." gBattlerAttacker = gBattlerTarget; // Initialize 'fail' condition @@ -9994,8 +10779,11 @@ static void Cmd_various(void) if (gBattleStruct->stickyWebUser != 0xFF) gBattlerAttacker = gBattleStruct->stickyWebUser; break; + } case VARIOUS_CUT_1_3_HP_RAISE_STATS: { + VARIOUS_ARGS(const u8 *failInstr); + bool8 atLeastOneStatBoosted = FALSE; u16 hpFraction = max(1, gBattleMons[gBattlerAttacker].maxHP / 3); @@ -10010,79 +10798,99 @@ static void Cmd_various(void) if (atLeastOneStatBoosted && gBattleMons[gBattlerAttacker].hp > hpFraction) { gBattleMoveDamage = hpFraction; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } + return; } - return; case VARIOUS_SET_OCTOLOCK: + { + VARIOUS_ARGS(const u8 *failInstr); if (gDisableStructs[gActiveBattler].octolock) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { gDisableStructs[gActiveBattler].octolock = TRUE; gBattleMons[gActiveBattler].status2 |= STATUS2_ESCAPE_PREVENTION; gDisableStructs[gActiveBattler].battlerPreventingEscape = gBattlerAttacker; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_CHECK_POLTERGEIST: + { + VARIOUS_ARGS(const u8 *failInstr); if (gBattleMons[gActiveBattler].item == ITEM_NONE || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || GetBattlerAbility(gActiveBattler) == ABILITY_KLUTZ) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { PREPARE_ITEM_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].item); gLastUsedItem = gBattleMons[gActiveBattler].item; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_TRY_NO_RETREAT: + { + VARIOUS_ARGS(const u8 *failInstr); if (gDisableStructs[gActiveBattler].noRetreat) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { if (!(gBattleMons[gActiveBattler].status2 & STATUS2_ESCAPE_PREVENTION)) gDisableStructs[gActiveBattler].noRetreat = TRUE; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_TRY_TAR_SHOT: + { + VARIOUS_ARGS(const u8 *failInstr); if (gDisableStructs[gActiveBattler].tarShot) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } else { gDisableStructs[gActiveBattler].tarShot = TRUE; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } return; + } case VARIOUS_CAN_TAR_SHOT_WORK: + { + VARIOUS_ARGS(const u8 *failInstr); // Tar Shot will fail if it's already been used on the target and its speed can't be lowered further if (!gDisableStructs[gActiveBattler].tarShot && CompareStat(gActiveBattler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; return; + } case VARIOUS_JUMP_IF_CANT_FLING: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (!CanFling(gActiveBattler)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_CURE_CERTAIN_STATUSES: + { + VARIOUS_ARGS(); // Check infatuation if (gBattleMons[gActiveBattler].status2 & STATUS2_INFATUATION) { @@ -10093,7 +10901,7 @@ static void Cmd_various(void) // Check taunt if (gDisableStructs[gActiveBattler].tauntTimer != 0) { - gDisableStructs[gActiveBattler].tauntTimer = gDisableStructs[gActiveBattler].tauntTimer2 = 0; + gDisableStructs[gActiveBattler].tauntTimer = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_TAUNT; PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_TAUNT); } @@ -10101,7 +10909,7 @@ static void Cmd_various(void) if (gDisableStructs[gActiveBattler].encoreTimer != 0) { gDisableStructs[gActiveBattler].encoredMove = 0; - gDisableStructs[gActiveBattler].encoreTimerStartValue = gDisableStructs[gActiveBattler].encoreTimer = 0; + gDisableStructs[gActiveBattler].encoreTimer = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_ENCORE; // STRINGID_PKMNENCOREENDED } // Check torment @@ -10119,47 +10927,74 @@ static void Cmd_various(void) // Check disable if (gDisableStructs[gActiveBattler].disableTimer != 0) { - gDisableStructs[gActiveBattler].disableTimer = gDisableStructs[gActiveBattler].disableTimerStartValue = 0; + gDisableStructs[gActiveBattler].disableTimer = 0; gDisableStructs[gActiveBattler].disabledMove = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_DISABLE; } - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES: + { + VARIOUS_ARGS(); gActiveBattler = gBattlerTarget; for (i = 0; i < NUM_BATTLE_STATS; i++) if (gBattleMons[gActiveBattler].statStages[i] < DEFAULT_STAT_STAGE) gBattleMons[gActiveBattler].statStages[i] = DEFAULT_STAT_STAGE; - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (ItemId_GetPocket(gLastUsedItem) == POCKET_BERRIES) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT: - if (ItemId_GetHoldEffect(gLastUsedItem) == gBattlescriptCurrInstr[3]) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4); + { + VARIOUS_ARGS(u8 holdEffect, const u8 *jumpInstr); + if (ItemId_GetHoldEffect(gLastUsedItem) == cmd->holdEffect) + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_SAVE_BATTLER_ITEM: + { + VARIOUS_ARGS(); gBattleResources->battleHistory->heldItems[gActiveBattler] = gBattleMons[gActiveBattler].item; break; + } case VARIOUS_RESTORE_BATTLER_ITEM: + { + VARIOUS_ARGS(); gBattleMons[gActiveBattler].item = gBattleResources->battleHistory->heldItems[gActiveBattler]; break; + } case VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM: + { + VARIOUS_ARGS(); gBattleMons[gActiveBattler].item = gLastUsedItem; break; + } case VARIOUS_SET_BEAK_BLAST: + { + VARIOUS_ARGS(); gProtectStructs[gActiveBattler].beakBlastCharge = TRUE; break; + } case VARIOUS_SWAP_SIDE_STATUSES: + { + VARIOUS_ARGS(); CourtChangeSwapSideStatuses(); break; + } case VARIOUS_TRY_SYMBIOSIS: //called by Bestow, Fling, and Bug Bite, which don't work with Cmd_removeitem. + { + VARIOUS_ARGS(); if (SYMBIOSIS_CHECK(gActiveBattler, BATTLE_PARTNER(gActiveBattler))) { BestowItem(BATTLE_PARTNER(gActiveBattler), gActiveBattler); @@ -10171,33 +11006,42 @@ static void Cmd_various(void) return; } break; + } case VARIOUS_CAN_TELEPORT: + { + VARIOUS_ARGS(); gBattleCommunication[0] = CanTeleport(gActiveBattler); break; + } case VARIOUS_GET_BATTLER_SIDE: + { + VARIOUS_ARGS(); if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) gBattleCommunication[0] = B_SIDE_PLAYER; else gBattleCommunication[0] = B_SIDE_OPPONENT; break; + } case VARIOUS_CHECK_PARENTAL_BOND_COUNTER: { + VARIOUS_ARGS(u8 counter, const u8 *jumpInstr); // Some effects should only happen on the first or second strike of Parental Bond, // so a way to check this in battle scripts is useful - u8 counter = T1_READ_8(gBattlescriptCurrInstr + 3); + u8 counter = cmd->counter; if (gSpecialStatuses[gBattlerAttacker].parentalBondState == counter && gBattleMons[gBattlerTarget].hp != 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 8; + gBattlescriptCurrInstr = cmd->nextInstr; return; } - break; case VARIOUS_SWAP_STATS: { - u8 statId = T1_READ_8(gBattlescriptCurrInstr + 3); + VARIOUS_ARGS(u8 stat); + + u8 stat = cmd->stat; u16 temp; - switch (statId) + switch (stat) { case STAT_HP: SWAP(gBattleMons[gBattlerAttacker].hp, gBattleMons[gBattlerTarget].hp, temp); @@ -10218,13 +11062,13 @@ static void Cmd_various(void) SWAP(gBattleMons[gBattlerAttacker].spDefense, gBattleMons[gBattlerTarget].spDefense, temp); break; } - PREPARE_STAT_BUFFER(gBattleTextBuff1, statId); - gBattlescriptCurrInstr += 4; + PREPARE_STAT_BUFFER(gBattleTextBuff1, stat); + gBattlescriptCurrInstr = cmd->nextInstr; return; } - break; case VARIOUS_TEATIME_TARGETS: { + VARIOUS_ARGS(const u8 *jumpInstr); u32 count = 0; for (i = 0; i < gBattlersCount; i++) @@ -10233,37 +11077,50 @@ static void Cmd_various(void) count++; } if (count == 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // Teatime fails + gBattlescriptCurrInstr = cmd->jumpInstr; // Teatime fails else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; + return; } - return; - case VARIOUS_TEATIME_INVUL: + case VARIOUS_TEATIME_INVUL: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (ItemId_GetPocket(gBattleMons[gActiveBattler].item) == POCKET_BERRIES && !(gStatuses3[gBattlerTarget] & (STATUS3_SEMI_INVULNERABLE))) - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; return; - case VARIOUS_JUMP_IF_ROD: + } + case VARIOUS_JUMP_IF_ROD: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (IsAbilityRodAffected()) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; - case VARIOUS_JUMP_IF_MOTOR: + } + case VARIOUS_JUMP_IF_MOTOR: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (IsAbilityMotorAffected()) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; - case VARIOUS_JUMP_IF_ABSORB: + } + case VARIOUS_JUMP_IF_ABSORB: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (IsAbilityAbsorbAffected()) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; + } case VARIOUS_TRY_WIND_RIDER_POWER: { + VARIOUS_ARGS(const u8 *failInstr); u16 ability = GetBattlerAbility(gActiveBattler); if (GetBattlerSide(gActiveBattler) == GetBattlerSide(gBattlerAttacker) && (ability == ABILITY_WIND_RIDER || ability == ABILITY_WIND_POWER)) @@ -10271,50 +11128,71 @@ static void Cmd_various(void) gLastUsedAbility = ability; RecordAbilityBattle(gActiveBattler, gLastUsedAbility); gBattlerAbility = gBattleScripting.battler = gActiveBattler; - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->failInstr; } + return; } - return; case VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES: - gBattlescriptCurrInstr += 3; + { + VARIOUS_ARGS(); + gBattlescriptCurrInstr = cmd->nextInstr; AbilityBattleEffects(ABILITYEFFECT_ON_WEATHER, gActiveBattler, 0, 0, 0); return; + } + case VARIOUS_JUMP_IF_SHELL_TRAP: + { + VARIOUS_ARGS(const u8 *jumpInstr); + if (gProtectStructs[gActiveBattler].shellTrap) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } case VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES: - gBattlescriptCurrInstr += 3; + { + VARIOUS_ARGS(); + gBattlescriptCurrInstr = cmd->nextInstr; AbilityBattleEffects(ABILITYEFFECT_ON_TERRAIN, gActiveBattler, 0, 0, 0); return; - case VARIOUS_JUMP_IF_NO_VALID_TARGETS: - { - u32 count = 0; - - for (i = 0; i < gBattlersCount; i++) - { - if (GetBattlerSide(i) != GetBattlerSide(gBattlerAttacker) && IsBattlerAlive(i)) - count++; - } - if (count == 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - else - gBattlescriptCurrInstr += 7; - } - return; + } case VARIOUS_JUMP_IF_EMERGENCY_EXITED: + { + VARIOUS_ARGS(const u8 *jumpInstr); if (gSpecialStatuses[gActiveBattler].emergencyExited) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr = cmd->nextInstr; return; - } // End of switch (gBattlescriptCurrInstr[2]) + } + case VARIOUS_STORE_HEALING_WISH: + { + VARIOUS_ARGS(); + if (gCurrentMove == MOVE_LUNAR_DANCE) + gBattleStruct->storedLunarDance |= gBitTable[gActiveBattler]; + else + gBattleStruct->storedHealingWish |= gBitTable[gActiveBattler]; + break; + } + case VARIOUS_HIT_SWITCH_TARGET_FAILED: + { + VARIOUS_ARGS(); + gBattleStruct->hitSwitchTargetFailed = TRUE; + gBattlescriptCurrInstr = cmd->nextInstr; + return; + } + } // End of switch (cmd->id) - gBattlescriptCurrInstr += 3; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setprotectlike(void) { + CMD_ARGS(); + bool32 fail = TRUE; bool32 notLastTurn = TRUE; @@ -10407,19 +11285,22 @@ static void Cmd_setprotectlike(void) gMoveResultFlags |= MOVE_RESULT_MISSED; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryexplosion(void) { + CMD_ARGS(); + + u32 dampBattler; if (gBattleControllerExecFlags) return; - if ((gBattlerTarget = IsAbilityOnField(ABILITY_DAMP))) + if ((dampBattler = IsAbilityOnField(ABILITY_DAMP))) { // Failed, a battler has Damp gLastUsedAbility = ABILITY_DAMP; - RecordAbilityBattle(--gBattlerTarget, ABILITY_DAMP); + gBattlerTarget = --dampBattler; gBattlescriptCurrInstr = BattleScript_DampStopsExplosion; return; } @@ -10428,19 +11309,13 @@ static void Cmd_tryexplosion(void) gBattleMoveDamage = gBattleMons[gActiveBattler].hp; BtlController_EmitHealthBarUpdate(BUFFER_A, INSTANT_HP_BAR_DROP); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr++; - - for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) - { - if (gBattlerTarget == gBattlerAttacker) - continue; - if (IsBattlerAlive(gBattlerTarget)) - break; - } + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setatkhptozero(void) { + CMD_ARGS(); + if (gBattleControllerExecFlags) return; @@ -10449,12 +11324,14 @@ static void Cmd_setatkhptozero(void) BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifnexttargetvalid(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *jumpInstr); + + const u8 *jumpInstr = cmd->jumpInstr; for (gBattlerTarget++; gBattlerTarget < gBattlersCount; gBattlerTarget++) { @@ -10465,16 +11342,18 @@ static void Cmd_jumpifnexttargetvalid(void) } if (gBattlerTarget >= gBattlersCount) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = jumpInstr; } static void Cmd_tryhealhalfhealth(void) { - const u8 *failPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *failInstr, u8 battler); - if (gBattlescriptCurrInstr[5] == BS_ATTACKER) + const u8 *failInstr = cmd->failInstr; + + if (cmd->battler == BS_ATTACKER) gBattlerTarget = gBattlerAttacker; gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; @@ -10483,13 +11362,15 @@ static void Cmd_tryhealhalfhealth(void) gBattleMoveDamage *= -1; if (gBattleMons[gBattlerTarget].hp == gBattleMons[gBattlerTarget].maxHP) - gBattlescriptCurrInstr = failPtr; + gBattlescriptCurrInstr = failInstr; else - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trymirrormove(void) { + CMD_ARGS(); + s32 validMovesCount; s32 i; u16 move; @@ -10529,12 +11410,14 @@ static void Cmd_trymirrormove(void) else // no valid moves found { gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setrain(void) { + CMD_ARGS(); + if (!TryChangeBattleWeather(gBattlerAttacker, ENUM_WEATHER_RAIN, FALSE)) { gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -10544,11 +11427,13 @@ static void Cmd_setrain(void) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_RAIN; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setreflect(void) { + CMD_ARGS(); + if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_REFLECT) { gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -10568,11 +11453,13 @@ static void Cmd_setreflect(void) else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_SINGLE; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setseeded(void) { + CMD_ARGS(); + if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT || gStatuses3[gBattlerTarget] & STATUS3_LEECHSEED) { gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -10590,12 +11477,14 @@ static void Cmd_setseeded(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_SET; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_manipulatedamage(void) { - switch (gBattlescriptCurrInstr[1]) + CMD_ARGS(u8 mode); + + switch (cmd->mode) { case DMG_CHANGE_SIGN: gBattleMoveDamage *= -1; @@ -10637,18 +11526,20 @@ static void Cmd_manipulatedamage(void) break; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trysetrest(void) { - const u8 *failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *failInstr); + + const u8 *failInstr = cmd->failInstr; gActiveBattler = gBattlerTarget = gBattlerAttacker; gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP * (-1); if (gBattleMons[gBattlerTarget].hp == gBattleMons[gBattlerTarget].maxHP) { - gBattlescriptCurrInstr = failJump; + gBattlescriptCurrInstr = failInstr; } else if (IsBattlerTerrainAffected(gBattlerTarget, STATUS_FIELD_ELECTRIC_TERRAIN)) { @@ -10668,30 +11559,34 @@ static void Cmd_trysetrest(void) gBattleMons[gBattlerTarget].status1 = STATUS1_SLEEP_TURN(3); BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifnotfirstturn(void) { - const u8 *failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *jumpInstr); + + const u8 *jumpInstr = cmd->jumpInstr; if (gDisableStructs[gBattlerAttacker].isFirstTurn) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = failJump; + gBattlescriptCurrInstr = jumpInstr; } static void Cmd_setmiracleeye(void) { + CMD_ARGS(const u8 *failInstr); + if (!(gStatuses3[gBattlerTarget] & STATUS3_MIRACLE_EYED)) { gStatuses3[gBattlerTarget] |= STATUS3_MIRACLE_EYED; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } @@ -10722,31 +11617,24 @@ bool8 UproarWakeUpCheck(u8 battlerId) return TRUE; } -static void Cmd_jumpifcantmakeasleep(void) +static void Cmd_jumpifuproarwakes(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *jumpInstr); + + const u8 *jumpInstr = cmd->jumpInstr; u32 ability = GetBattlerAbility(gBattlerTarget); if (UproarWakeUpCheck(gBattlerTarget)) - { - gBattlescriptCurrInstr = jumpPtr; - } - else if (ability == ABILITY_INSOMNIA || ability == ABILITY_VITAL_SPIRIT) - { - gLastUsedAbility = ability; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAYED_AWAKE_USING; - gBattlescriptCurrInstr = jumpPtr; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); - } + gBattlescriptCurrInstr = jumpInstr; else - { - gBattlescriptCurrInstr += 5; - } + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_stockpile(void) { - switch (gBattlescriptCurrInstr[1]) + CMD_ARGS(u8 id); + + switch (cmd->id) { case 0: if (gDisableStructs[gBattlerAttacker].stockpileCounter >= 3) @@ -10772,15 +11660,17 @@ static void Cmd_stockpile(void) break; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_stockpiletobasedamage(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *failInstr); + + const u8 *failInstr = cmd->failInstr; if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) { - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = failInstr; } else { @@ -10794,17 +11684,19 @@ static void Cmd_stockpiletobasedamage(void) gBattleMons[gBattlerAttacker].statStages[STAT_DEF] -= gDisableStructs[gBattlerAttacker].stockpileDef; gBattleMons[gBattlerAttacker].statStages[STAT_SPDEF] -= gDisableStructs[gBattlerAttacker].stockpileSpDef; } - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_stockpiletohpheal(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(const u8 *failInstr); + + const u8 *failInstr = cmd->failInstr; if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) { - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = failInstr; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FAILED; } else @@ -10812,7 +11704,7 @@ static void Cmd_stockpiletohpheal(void) if (gBattleMons[gBattlerAttacker].maxHP == gBattleMons[gBattlerAttacker].hp) { gDisableStructs[gBattlerAttacker].stockpileCounter = 0; - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = failInstr; gBattlerTarget = gBattlerAttacker; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FULL_HP; } @@ -10826,7 +11718,7 @@ static void Cmd_stockpiletohpheal(void) gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; gDisableStructs[gBattlerAttacker].stockpileCounter = 0; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; gBattlerTarget = gBattlerAttacker; } @@ -10839,6 +11731,8 @@ static void Cmd_stockpiletohpheal(void) // Sign change for drained HP handled in GetDrainedBigRootHp static void Cmd_setdrainedhp(void) { + CMD_ARGS(); + if (gBattleMoves[gCurrentMove].argument != 0) gBattleMoveDamage = (gHpDealt * gBattleMoves[gCurrentMove].argument / 100); else @@ -10847,7 +11741,7 @@ static void Cmd_setdrainedhp(void) if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static u16 ReverseStatChangeMoveEffect(u16 moveEffect) @@ -10921,8 +11815,9 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr bool32 certain = FALSE; bool32 notProtectAffected = FALSE; u32 index; - bool32 affectsUser = (flags & MOVE_EFFECT_AFFECTS_USER); u16 activeBattlerAbility; + bool32 affectsUser = (flags & MOVE_EFFECT_AFFECTS_USER); + bool32 mirrorArmored = (flags & STAT_CHANGE_MIRROR_ARMOR); if (affectsUser) gActiveBattler = gBattlerAttacker; @@ -10933,10 +11828,10 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr gSpecialStatuses[gActiveBattler].changedStatsBattlerId = gBattlerAttacker; - flags &= ~MOVE_EFFECT_AFFECTS_USER; + flags &= ~(MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_MIRROR_ARMOR); if (flags & MOVE_EFFECT_CERTAIN) - certain++; + certain = TRUE; flags &= ~MOVE_EFFECT_CERTAIN; if (flags & STAT_CHANGE_NOT_PROTECT_AFFECTED) @@ -10992,13 +11887,13 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr || activeBattlerAbility == ABILITY_CLEAR_BODY || activeBattlerAbility == ABILITY_FULL_METAL_BODY || activeBattlerAbility == ABILITY_WHITE_SMOKE) - && !affectsUser && !certain && gCurrentMove != MOVE_CURSE) + && (!affectsUser || mirrorArmored) && !certain && gCurrentMove != MOVE_CURSE) { if (GetBattlerHoldEffect(gActiveBattler, TRUE) == HOLD_EFFECT_CLEAR_AMULET) { RecordItemEffectBattle(gActiveBattler, HOLD_EFFECT_CLEAR_AMULET); } - + if (flags == STAT_CHANGE_ALLOW_PTR) { if (gSpecialStatuses[gActiveBattler].statLowered) @@ -11054,7 +11949,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr } return STAT_CHANGE_DIDNT_WORK; } - else if (activeBattlerAbility == ABILITY_MIRROR_ARMOR && !affectsUser && gBattlerAttacker != gBattlerTarget && gActiveBattler == gBattlerTarget) + else if (activeBattlerAbility == ABILITY_MIRROR_ARMOR && !affectsUser && !mirrorArmored && gBattlerAttacker != gBattlerTarget && gActiveBattler == gBattlerTarget) { if (flags == STAT_CHANGE_ALLOW_PTR) { @@ -11172,14 +12067,16 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr static void Cmd_statbuffchange(void) { - u16 flags = T1_READ_16(gBattlescriptCurrInstr + 1); - const u8 *ptrBefore = gBattlescriptCurrInstr; - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + CMD_ARGS(u16 flags, const u8 *failInstr); - if (ChangeStatBuffs(GET_STAT_BUFF_VALUE_WITH_SIGN(gBattleScripting.statChanger), GET_STAT_BUFF_ID(gBattleScripting.statChanger), flags, jumpPtr) == STAT_CHANGE_WORKED) - gBattlescriptCurrInstr += 7; + u16 flags = cmd->flags; + const u8 *ptrBefore = gBattlescriptCurrInstr; + const u8 *failInstr = cmd->failInstr; + + if (ChangeStatBuffs(GET_STAT_BUFF_VALUE_WITH_SIGN(gBattleScripting.statChanger), GET_STAT_BUFF_ID(gBattleScripting.statChanger), flags, failInstr) == STAT_CHANGE_WORKED) + gBattlescriptCurrInstr = cmd->nextInstr; else if (gBattlescriptCurrInstr == ptrBefore) // Prevent infinite looping. - gBattlescriptCurrInstr = jumpPtr; + gBattlescriptCurrInstr = failInstr; } bool32 TryResetBattlerStatChanges(u8 battler) @@ -11203,37 +12100,45 @@ bool32 TryResetBattlerStatChanges(u8 battler) // Haze static void Cmd_normalisebuffs(void) { + CMD_ARGS(); + s32 i, j; for (i = 0; i < gBattlersCount; i++) TryResetBattlerStatChanges(i); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setbide(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gBattlerAttacker] = gCurrentMove; gTakenDmg[gBattlerAttacker] = 0; gBattleMons[gBattlerAttacker].status2 |= STATUS2_BIDE_TURN(2); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_confuseifrepeatingattackends(void) { + CMD_ARGS(); + if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_LOCK_CONFUSE) && !gSpecialStatuses[gBattlerAttacker].dancerUsedMove) gBattleScripting.moveEffect = (MOVE_EFFECT_THRASH | MOVE_EFFECT_AFFECTS_USER); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setmultihitcounter(void) { - if (gBattlescriptCurrInstr[1]) + CMD_ARGS(u8 value); + + if (cmd->value) { - gMultiHitCounter = gBattlescriptCurrInstr[1]; + gMultiHitCounter = cmd->value; } else { @@ -11270,18 +12175,22 @@ static void Cmd_setmultihitcounter(void) } } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_initmultihitstring(void) { + CMD_ARGS(); + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_forcerandomswitch(void) { + CMD_ARGS(const u8 *failInstr); + s32 i; s32 battler1PartyId = 0; s32 battler2PartyId = 0; @@ -11290,8 +12199,8 @@ static void Cmd_forcerandomswitch(void) s32 lastMonId = 0; // + 1 s32 monsCount; struct Pokemon *party = NULL; - s32 validMons = 0; - s32 minNeeded; + u8 validMons[PARTY_SIZE]; + s32 validMonsCount = 0; bool32 redCardForcedSwitch = FALSE; @@ -11348,7 +12257,6 @@ static void Cmd_forcerandomswitch(void) firstMonId = 0; lastMonId = 6; monsCount = 6; - minNeeded = 2; battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; } @@ -11367,7 +12275,6 @@ static void Cmd_forcerandomswitch(void) lastMonId = PARTY_SIZE / 2; } monsCount = PARTY_SIZE / 2; - minNeeded = 1; battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; } @@ -11385,7 +12292,6 @@ static void Cmd_forcerandomswitch(void) lastMonId = PARTY_SIZE / 2; } monsCount = PARTY_SIZE / 2; - minNeeded = 1; battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; } @@ -11396,7 +12302,6 @@ static void Cmd_forcerandomswitch(void) firstMonId = 0; lastMonId = PARTY_SIZE; monsCount = PARTY_SIZE; - minNeeded = 2; // since there are two opponents, it has to be a double battle } else { @@ -11411,7 +12316,6 @@ static void Cmd_forcerandomswitch(void) lastMonId = PARTY_SIZE / 2; } monsCount = PARTY_SIZE / 2; - minNeeded = 1; } battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; @@ -11421,7 +12325,6 @@ static void Cmd_forcerandomswitch(void) firstMonId = 0; lastMonId = PARTY_SIZE; monsCount = PARTY_SIZE; - minNeeded = 2; battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)]; } @@ -11430,7 +12333,6 @@ static void Cmd_forcerandomswitch(void) firstMonId = 0; lastMonId = PARTY_SIZE; monsCount = PARTY_SIZE; - minNeeded = 1; battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one pokemon out in single battles battler1PartyId = gBattlerPartyIndexes[gBattlerTarget]; } @@ -11439,33 +12341,24 @@ static void Cmd_forcerandomswitch(void) { if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE && !GetMonData(&party[i], MON_DATA_IS_EGG) - && GetMonData(&party[i], MON_DATA_HP) != 0) + && GetMonData(&party[i], MON_DATA_HP) != 0 + && i != battler1PartyId + && i != battler2PartyId) { - validMons++; + validMons[validMonsCount++] = i; } } - if (!redCardForcedSwitch && validMons <= minNeeded) + if (validMonsCount == 0) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { *(gBattleStruct->battlerPartyIndexes + gBattlerTarget) = gBattlerPartyIndexes[gBattlerTarget]; gBattlescriptCurrInstr = BattleScript_RoarSuccessSwitch; - - do - { - i = Random() % monsCount; - i += firstMonId; - } - while (i == battler2PartyId - || i == battler1PartyId - || GetMonData(&party[i], MON_DATA_SPECIES) == SPECIES_NONE - || GetMonData(&party[i], MON_DATA_IS_EGG) == TRUE - || GetMonData(&party[i], MON_DATA_HP) == 0); - - *(gBattleStruct->monToSwitchIntoId + gBattlerTarget) = i; + gBattleStruct->forcedSwitch |= gBitTable[gBattlerTarget]; + *(gBattleStruct->monToSwitchIntoId + gBattlerTarget) = validMons[Random() % validMonsCount]; if (!IsMultiBattle()) SwitchPartyOrder(gBattlerTarget); @@ -11489,12 +12382,14 @@ static void Cmd_forcerandomswitch(void) if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) gBattlescriptCurrInstr = BattleScript_RoarSuccessEndBattle; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_tryconversiontypechange(void) { + CMD_ARGS(const u8 *failInstr); + u8 validMoves = 0; u8 moveChecked; u8 moveType; @@ -11511,13 +12406,13 @@ static void Cmd_tryconversiontypechange(void) } if (IS_BATTLER_OF_TYPE(gBattlerAttacker, moveType)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { SET_BATTLER_TYPE(gBattlerAttacker, moveType); PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } #else // Randomly changes user's type to one of its moves' type @@ -11550,7 +12445,7 @@ static void Cmd_tryconversiontypechange(void) if (moveChecked == validMoves) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -11573,13 +12468,15 @@ static void Cmd_tryconversiontypechange(void) SET_BATTLER_TYPE(gBattlerAttacker, moveType); PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } #endif } static void Cmd_givepaydaymoney(void) { + CMD_ARGS(); + if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) && gPaydayMoney != 0) { u32 bonusMoney = gPaydayMoney * gBattleStruct->moneyMultiplier; @@ -11587,17 +12484,19 @@ static void Cmd_givepaydaymoney(void) PREPARE_HWORD_NUMBER_BUFFER(gBattleTextBuff1, 5, bonusMoney) - BattleScriptPush(gBattlescriptCurrInstr + 1); + BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_PrintPayDayMoneyString; } else { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setlightscreen(void) { + CMD_ARGS(); + if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_LIGHTSCREEN) { gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -11618,11 +12517,13 @@ static void Cmd_setlightscreen(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_SINGLE; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryKO(void) { + CMD_ARGS(const u8 *failInstr); + bool32 lands = FALSE; u32 holdEffect = GetBattlerHoldEffect(gBattlerTarget, TRUE); u16 targetAbility = GetBattlerAbility(gBattlerTarget); @@ -11693,7 +12594,7 @@ static void Cmd_tryKO(void) gBattleMoveDamage = gBattleMons[gBattlerTarget].hp; gMoveResultFlags |= MOVE_RESULT_ONE_HIT_KO; } - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { @@ -11702,7 +12603,7 @@ static void Cmd_tryKO(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_MISS; else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_UNAFFECTED; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } } @@ -11710,15 +12611,19 @@ static void Cmd_tryKO(void) // Super Fang static void Cmd_damagetohalftargethp(void) { + CMD_ARGS(); + gBattleMoveDamage = gBattleMons[gBattlerTarget].hp / 2; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setsandstorm(void) { + CMD_ARGS(); + if (!TryChangeBattleWeather(gBattlerAttacker, ENUM_WEATHER_SANDSTORM, FALSE)) { gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -11728,11 +12633,13 @@ static void Cmd_setsandstorm(void) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SANDSTORM; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_weatherdamage(void) { + CMD_ARGS(); + u32 ability = GetBattlerAbility(gBattlerAttacker); gBattleMoveDamage = 0; @@ -11782,11 +12689,13 @@ static void Cmd_weatherdamage(void) } } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryinfatuating(void) { + CMD_ARGS(const u8 *failInstr); + struct Pokemon *monAttacker, *monTarget; u16 speciesAttacker, speciesTarget; u32 personalityAttacker, personalityTarget; @@ -11820,27 +12729,29 @@ static void Cmd_tryinfatuating(void) || GetGenderFromSpeciesAndPersonality(speciesAttacker, personalityAttacker) == MON_GENDERLESS || GetGenderFromSpeciesAndPersonality(speciesTarget, personalityTarget) == MON_GENDERLESS) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMons[gBattlerTarget].status2 |= STATUS2_INFATUATED_WITH(gBattlerAttacker); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } } static void Cmd_updatestatusicon(void) { + CMD_ARGS(u8 battler); + if (gBattleControllerExecFlags) return; - if (gBattlescriptCurrInstr[1] != BS_ATTACKER_WITH_PARTNER) + if (cmd->battler != BS_ATTACKER_WITH_PARTNER) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + gActiveBattler = GetBattlerForBattleScript(cmd->battler); BtlController_EmitStatusIconUpdate(BUFFER_A, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } else { @@ -11859,12 +12770,14 @@ static void Cmd_updatestatusicon(void) MarkBattlerForControllerExec(gActiveBattler); } } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setmist(void) { + CMD_ARGS(); + if (gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer) { gMoveResultFlags |= MOVE_RESULT_FAILED; @@ -11877,11 +12790,13 @@ static void Cmd_setmist(void) gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_MIST; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setfocusenergy(void) { + CMD_ARGS(); + if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY) { gMoveResultFlags |= MOVE_RESULT_FAILED; @@ -11892,13 +12807,15 @@ static void Cmd_setfocusenergy(void) gBattleMons[gBattlerAttacker].status2 |= STATUS2_FOCUS_ENERGY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_GETTING_PUMPED; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_transformdataexecution(void) { + CMD_ARGS(); + gChosenMove = MOVE_UNAVAILABLE; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; if (gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED || gBattleStruct->illusion[gBattlerTarget].on || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) @@ -11925,7 +12842,7 @@ static void Cmd_transformdataexecution(void) for (i = 0; i < offsetof(struct BattlePokemon, pp); i++) battleMonAttacker[i] = battleMonTarget[i]; - + gBattleStruct->overwrittenAbilities[gBattlerAttacker] = GetBattlerAbility(gBattlerTarget); for (i = 0; i < MAX_MON_MOVES; i++) { @@ -11944,6 +12861,8 @@ static void Cmd_transformdataexecution(void) static void Cmd_setsubstitute(void) { + CMD_ARGS(); + u32 hp = gBattleMons[gBattlerAttacker].maxHP / 4; if (gBattleMons[gBattlerAttacker].maxHP / 4 == 0) hp = 1; @@ -11966,16 +12885,18 @@ static void Cmd_setsubstitute(void) gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_mimicattackcopy(void) { + CMD_ARGS(const u8 *failInstr); + if ((sForbiddenMoves[gLastMoves[gBattlerTarget]] & FORBIDDEN_MIMIC) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) || gLastMoves[gBattlerTarget] == MOVE_UNAVAILABLE) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -11999,17 +12920,19 @@ static void Cmd_mimicattackcopy(void) PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastMoves[gBattlerTarget]) gDisableStructs[gBattlerAttacker].mimickedMoves |= gBitTable[gCurrMovePos]; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } } static void Cmd_metronome(void) { + CMD_ARGS(); + #if B_METRONOME_MOVES >= GEN_9 u16 moveCount = MOVES_COUNT_GEN9; #elif B_METRONOME_MOVES >= GEN_8 @@ -12044,12 +12967,16 @@ static void Cmd_metronome(void) static void Cmd_dmgtolevel(void) { + CMD_ARGS(); + gBattleMoveDamage = gBattleMons[gBattlerAttacker].level; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_psywavedamageeffect(void) { + CMD_ARGS(); + s32 randDamage; #if B_PSYWAVE_DMG >= GEN_6 randDamage = (Random() % 101); @@ -12057,11 +12984,13 @@ static void Cmd_psywavedamageeffect(void) randDamage = (Random() % 11) * 10; #endif gBattleMoveDamage = gBattleMons[gBattlerAttacker].level * (randDamage + 50) / 100; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_counterdamagecalculator(void) { + CMD_ARGS(const u8 *failInstr); + u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gProtectStructs[gBattlerAttacker].physicalBattlerId); @@ -12076,18 +13005,20 @@ static void Cmd_counterdamagecalculator(void) else gBattlerTarget = gProtectStructs[gBattlerAttacker].physicalBattlerId; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // A copy of Cmd with the physical -> special field changes static void Cmd_mirrorcoatdamagecalculator(void) { + CMD_ARGS(const u8 *failInstr); + u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gProtectStructs[gBattlerAttacker].specialBattlerId); @@ -12102,17 +13033,19 @@ static void Cmd_mirrorcoatdamagecalculator(void) else gBattlerTarget = gProtectStructs[gBattlerAttacker].specialBattlerId; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_disablelastusedattack(void) { + CMD_ARGS(const u8 *failInstr); + s32 i; for (i = 0; i < MAX_MON_MOVES; i++) @@ -12133,17 +13066,18 @@ static void Cmd_disablelastusedattack(void) #else gDisableStructs[gBattlerTarget].disableTimer = 4; #endif - gDisableStructs[gBattlerTarget].disableTimerStartValue = gDisableStructs[gBattlerTarget].disableTimer; // used to save the random amount of turns? - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_trysetencore(void) { + CMD_ARGS(const u8 *failInstr); + s32 i; for (i = 0; i < MAX_MON_MOVES; i++) @@ -12168,17 +13102,19 @@ static void Cmd_trysetencore(void) gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i]; gDisableStructs[gBattlerTarget].encoredMovePos = i; gDisableStructs[gBattlerTarget].encoreTimer = 3; - gDisableStructs[gBattlerTarget].encoreTimerStartValue = gDisableStructs[gBattlerTarget].encoreTimer; - gBattlescriptCurrInstr += 5; + gDisableStructs[gBattlerTarget].encoreTimer; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_painsplitdmgcalc(void) { + CMD_ARGS(const u8 *failInstr); + if (!(DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove))) { s32 hpDiff = (gBattleMons[gBattlerAttacker].hp + gBattleMons[gBattlerTarget].hp) / 2; @@ -12193,26 +13129,28 @@ static void Cmd_painsplitdmgcalc(void) gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp - hpDiff; gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // Conversion 2 static void Cmd_settypetorandomresistance(void) { + CMD_ARGS(const u8 *failInstr); + if (gLastLandedMoves[gBattlerAttacker] == MOVE_NONE || gLastLandedMoves[gBattlerAttacker] == MOVE_UNAVAILABLE) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else if (IsTwoTurnsMove(gLastLandedMoves[gBattlerAttacker]) && gBattleMons[gLastHitBy[gBattlerAttacker]].status2 & STATUS2_MULTIPLETURNS) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -12243,27 +13181,31 @@ static void Cmd_settypetorandomresistance(void) { SET_BATTLER_TYPE(gBattlerAttacker, i); PREPARE_TYPE_BUFFER(gBattleTextBuff1, i); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; return; } } } - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_setalwayshitflag(void) { + CMD_ARGS(); + gStatuses3[gBattlerTarget] &= ~STATUS3_ALWAYS_HITS; gStatuses3[gBattlerTarget] |= STATUS3_ALWAYS_HITS_TURN(2); gDisableStructs[gBattlerTarget].battlerWithSureHit = gBattlerAttacker; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Sketch static void Cmd_copymovepermanently(void) { + CMD_ARGS(const u8 *failInstr); + gChosenMove = MOVE_UNAVAILABLE; if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) @@ -12284,7 +13226,7 @@ static void Cmd_copymovepermanently(void) if (i != MAX_MON_MOVES) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else // sketch worked { @@ -12306,12 +13248,12 @@ static void Cmd_copymovepermanently(void) PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastPrintedMoves[gBattlerTarget]) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } @@ -12350,6 +13292,8 @@ static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a c static void Cmd_trychoosesleeptalkmove(void) { + CMD_ARGS(const u8 *failInstr); + u32 i, unusableMovesBits = 0, movePosition; for (i = 0; i < MAX_MON_MOVES; i++) @@ -12364,7 +13308,7 @@ static void Cmd_trychoosesleeptalkmove(void) unusableMovesBits = CheckMoveLimitations(gBattlerAttacker, unusableMovesBits, ~MOVE_LIMITATION_PP); if (unusableMovesBits == (1 << MAX_MON_MOVES) - 1) // all 4 moves cannot be chosen { - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else // at least one move can be chosen { @@ -12377,14 +13321,16 @@ static void Cmd_trychoosesleeptalkmove(void) gCurrMovePos = movePosition; gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_setdestinybond(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].status2 |= STATUS2_DESTINY_BOND; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void TrySetDestinyBondToHappen(void) @@ -12401,12 +13347,16 @@ static void TrySetDestinyBondToHappen(void) static void Cmd_trysetdestinybondtohappen(void) { + CMD_ARGS(); + TrySetDestinyBondToHappen(); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_settailwind(void) { + CMD_ARGS(const u8 *failInstr); + u8 side = GetBattlerSide(gBattlerAttacker); if (!(gSideStatuses[side] & SIDE_STATUS_TAILWIND)) @@ -12418,16 +13368,18 @@ static void Cmd_settailwind(void) #else gSideTimers[side].tailwindTimer = 3; #endif - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_tryspiteppreduce(void) { + CMD_ARGS(const u8 *failInstr); + if (gLastMoves[gBattlerTarget] != MOVE_NONE && gLastMoves[gBattlerTarget] != MOVE_UNAVAILABLE) { @@ -12471,7 +13423,7 @@ static void Cmd_tryspiteppreduce(void) MarkBattlerForControllerExec(gActiveBattler); } - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; // Don't cut off Sky Drop if pp is brought to zero. if (gBattleMons[gBattlerTarget].pp[i] == 0 && gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF) @@ -12479,17 +13431,19 @@ static void Cmd_tryspiteppreduce(void) } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_healpartystatus(void) { + CMD_ARGS(); + u32 zero = 0; u8 toHeal = 0; @@ -12583,14 +13537,16 @@ static void Cmd_healpartystatus(void) MarkBattlerForControllerExec(gActiveBattler); } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_cursetarget(void) { + CMD_ARGS(const u8 *failInstr); + if (gBattleMons[gBattlerTarget].status2 & STATUS2_CURSED) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -12599,35 +13555,41 @@ static void Cmd_cursetarget(void) if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_trysetspikes(void) { + CMD_ARGS(const u8 *failInstr); + u8 targetSide = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker)); if (gSideTimers[targetSide].spikesAmount == 3) { gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gSideStatuses[targetSide] |= SIDE_STATUS_SPIKES; gSideTimers[targetSide].spikesAmount++; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setforesight(void) { + CMD_ARGS(); + gBattleMons[gBattlerTarget].status2 |= STATUS2_FORESIGHT; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trysetperishsong(void) { + CMD_ARGS(const u8 *failInstr); + s32 i; s32 notAffectedCount = 0; @@ -12643,20 +13605,21 @@ static void Cmd_trysetperishsong(void) { gStatuses3[i] |= STATUS3_PERISH_SONG; gDisableStructs[i].perishSongTimer = 3; - gDisableStructs[i].perishSongTimerStartValue = 3; } } PressurePPLoseOnUsingPerishSong(gBattlerAttacker); if (notAffectedCount == gBattlersCount) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_handlerollout(void) { + CMD_ARGS(); + if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { CancelMultiTurnMoves(gBattlerAttacker); @@ -12676,21 +13639,25 @@ static void Cmd_handlerollout(void) gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifconfusedandstatmaxed(void) { + CMD_ARGS(u8 stat, const u8 *jumpInstr); + if (gBattleMons[gBattlerTarget].status2 & STATUS2_CONFUSION - && !CompareStat(gBattlerTarget, gBattlescriptCurrInstr[1], MAX_STAT_STAGE, CMP_LESS_THAN)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); // Fails if we're confused AND stat cannot be raised + && !CompareStat(gBattlerTarget, cmd->stat, MAX_STAT_STAGE, CMP_LESS_THAN)) + gBattlescriptCurrInstr = cmd->jumpInstr; // Fails if we're confused AND stat cannot be raised else - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_handlefurycutter(void) { + CMD_ARGS(); + if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { gDisableStructs[gBattlerAttacker].furyCutterCounter = 0; @@ -12702,26 +13669,30 @@ static void Cmd_handlefurycutter(void) && gSpecialStatuses[gBattlerAttacker].parentalBondState != PARENTAL_BOND_1ST_HIT) // Don't increment counter on first hit gDisableStructs[gBattlerAttacker].furyCutterCounter++; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setembargo(void) { + CMD_ARGS(const u8 *failInstr); + if (gStatuses3[gBattlerTarget] & STATUS3_EMBARGO) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gStatuses3[gBattlerTarget] |= STATUS3_EMBARGO; gDisableStructs[gBattlerTarget].embargoTimer = 5; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_presentdamagecalculation(void) { + CMD_ARGS(); + u32 rand = Random() & 0xFF; /* Don't reroll present effect/power for the second hit of Parental Bond. @@ -12771,6 +13742,8 @@ static void Cmd_presentdamagecalculation(void) static void Cmd_setsafeguard(void) { + CMD_ARGS(); + if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_SAFEGUARD) { gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -12784,11 +13757,13 @@ static void Cmd_setsafeguard(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SAFEGUARD; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_magnitudedamagecalculation(void) { + CMD_ARGS(); + u32 magnitude = Random() % 100; if (magnitude < 5) @@ -12837,11 +13812,13 @@ static void Cmd_magnitudedamagecalculation(void) break; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifnopursuitswitchdmg(void) { + CMD_ARGS(const u8 *jumpInstr); + if (gMultiHitCounter == 1) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) @@ -12874,18 +13851,20 @@ static void Cmd_jumpifnopursuitswitchdmg(void) gCurrentMove = MOVE_PURSUIT; gCurrMovePos = gChosenMovePos = *(gBattleStruct->chosenMovePositions + gBattlerTarget); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleScripting.animTurn = 1; gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; } } static void Cmd_setsunny(void) { + CMD_ARGS(); + if (!TryChangeBattleWeather(gBattlerAttacker, ENUM_WEATHER_SUN, FALSE)) { gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -12896,12 +13875,14 @@ static void Cmd_setsunny(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SUNLIGHT; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Belly Drum static void Cmd_maxattackhalvehp(void) { + CMD_ARGS(const u8 *failInstr); + u32 halfHp = gBattleMons[gBattlerAttacker].maxHP / 2; if (!(gBattleMons[gBattlerAttacker].maxHP / 2)) @@ -12916,17 +13897,19 @@ static void Cmd_maxattackhalvehp(void) if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // Psych Up static void Cmd_copyfoestats(void) { + CMD_ARGS(const u8 *unused); + s32 i; for (i = 0; i < NUM_BATTLE_STATS; i++) @@ -12934,11 +13917,13 @@ static void Cmd_copyfoestats(void) gBattleMons[gBattlerAttacker].statStages[i] = gBattleMons[gBattlerTarget].statStages[i]; } - gBattlescriptCurrInstr += 5; // Has an unused jump ptr(possibly for a failed attempt) parameter. + gBattlescriptCurrInstr = cmd->nextInstr; // Has an unused jump ptr(possibly for a failed attempt) parameter. } static void Cmd_rapidspinfree(void) { + CMD_ARGS(); + u8 atkSide = GetBattlerSide(gBattlerAttacker); if (gBattleMons[gBattlerAttacker].status2 & STATUS2_WRAPPED) @@ -12987,18 +13972,22 @@ static void Cmd_rapidspinfree(void) } else { - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setdefensecurlbit(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].status2 |= STATUS2_DEFENSE_CURL; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_recoverbasedonsunlight(void) { + CMD_ARGS(const u8 *failInstr); + gBattlerTarget = gBattlerAttacker; if (gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP) { @@ -13023,21 +14012,23 @@ static void Cmd_recoverbasedonsunlight(void) gBattleMoveDamage = 1; gBattleMoveDamage *= -1; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_setstickyweb(void) { + CMD_ARGS(const u8 *failInstr); + u8 targetSide = GetBattlerSide(gBattlerTarget); if (gSideStatuses[targetSide] & SIDE_STATUS_STICKY_WEB) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -13045,12 +14036,14 @@ static void Cmd_setstickyweb(void) gSideTimers[targetSide].stickyWebBattlerSide = GetBattlerSide(gBattlerAttacker); // For Court Change/Defiant - set this to the user's side gSideTimers[targetSide].stickyWebAmount = 1; gBattleStruct->stickyWebUser = gBattlerAttacker; // For Mirror Armor - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_selectfirstvalidtarget(void) { + CMD_ARGS(); + for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { if (gBattlerTarget == gBattlerAttacker && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) @@ -13058,14 +14051,16 @@ static void Cmd_selectfirstvalidtarget(void) if (IsBattlerAlive(gBattlerTarget)) break; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trysetfutureattack(void) { + CMD_ARGS(const u8 *failInstr); + if (gWishFutureKnock.futureSightCounter[gBattlerTarget] != 0) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -13079,15 +14074,17 @@ static void Cmd_trysetfutureattack(void) else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FUTURE_SIGHT; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_trydobeatup(void) { + CMD_ARGS(const u8 *endInstr, const u8 *failInstr); + #if B_BEAT_UP >= GEN_5 gBattleStruct->beatUpSlot++; - gBattlescriptCurrInstr += 9; + gBattlescriptCurrInstr = cmd->nextInstr; #else struct Pokemon *party; @@ -13098,7 +14095,7 @@ static void Cmd_trydobeatup(void) if (gBattleMons[gBattlerTarget].hp == 0) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->endInstr; } else { @@ -13115,7 +14112,7 @@ static void Cmd_trydobeatup(void) { PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattleCommunication[0]) - gBattlescriptCurrInstr += 9; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleMoveDamage = gSpeciesInfo[GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES)].baseAttack; gBattleMoveDamage *= gBattleMoves[gCurrentMove].power; @@ -13128,15 +14125,17 @@ static void Cmd_trydobeatup(void) gBattleCommunication[0]++; } else if (beforeLoop != 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->endInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + gBattlescriptCurrInstr = cmd->failInstr; } #endif } static void Cmd_setsemiinvulnerablebit(void) { + CMD_ARGS(); + switch (gCurrentMove) { case MOVE_FLY: @@ -13156,25 +14155,31 @@ static void Cmd_setsemiinvulnerablebit(void) break; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_clearsemiinvulnerablebit(void) { + CMD_ARGS(); + gStatuses3[gBattlerAttacker] &= ~STATUS3_SEMI_INVULNERABLE; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setminimize(void) { + CMD_ARGS(); + if (gHitMarker & HITMARKER_OBEYS) gStatuses3[gBattlerAttacker] |= STATUS3_MINIMIZED; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_sethail(void) { + CMD_ARGS(); + if (!TryChangeBattleWeather(gBattlerAttacker, ENUM_WEATHER_HAIL, FALSE)) { gMoveResultFlags |= MOVE_RESULT_MISSED; @@ -13185,11 +14190,13 @@ static void Cmd_sethail(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_HAIL; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trymemento(void) { + CMD_ARGS(const u8 *failInstr); + #if B_MEMENTO_FAIL == GEN_3 if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE @@ -13202,7 +14209,7 @@ static void Cmd_trymemento(void) #endif { // Failed, unprotected target already has minimum Attack and Special Attack. - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -13211,35 +14218,41 @@ static void Cmd_trymemento(void) gBattleMoveDamage = gBattleMons[gActiveBattler].hp; BtlController_EmitHealthBarUpdate(BUFFER_A, INSTANT_HP_BAR_DROP); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } // Follow Me static void Cmd_setforcedtarget(void) { + CMD_ARGS(); + gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTimer = 1; gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTarget = gBattlerTarget; gSideTimers[GetBattlerSide(gBattlerTarget)].followmePowder = TestMoveFlags(gCurrentMove, FLAG_POWDER); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_setcharge(void) { + CMD_ARGS(); + gStatuses3[gBattlerAttacker] |= STATUS3_CHARGED_UP; gDisableStructs[gBattlerAttacker].chargeTimer = 2; - gDisableStructs[gBattlerAttacker].chargeTimerStartValue = 2; gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Nature Power static void Cmd_callterrainattack(void) { + CMD_ARGS(); + gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gCurrentMove = GetNaturePowerMove(); gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } u16 GetNaturePowerMove(void) @@ -13260,43 +14273,51 @@ u16 GetNaturePowerMove(void) // Refresh static void Cmd_cureifburnedparalysedorpoisoned(void) { + CMD_ARGS(const u8 *failInstr); + if (gBattleMons[gBattlerAttacker].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)) { gBattleMons[gBattlerAttacker].status1 = 0; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; gActiveBattler = gBattlerAttacker; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_settorment(void) { + CMD_ARGS(const u8 *failInstr); + if (gBattleMons[gBattlerTarget].status2 & STATUS2_TORMENT) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMons[gBattlerTarget].status2 |= STATUS2_TORMENT; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifnodamage(void) { + CMD_ARGS(const u8 *jumpInstr); + if (gProtectStructs[gBattlerAttacker].physicalDmg || gProtectStructs[gBattlerAttacker].specialDmg) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; } static void Cmd_settaunt(void) { + CMD_ARGS(const u8 *failInstr); + #if B_OBLIVIOUS_TAUNT >= GEN_6 if (GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS) { @@ -13318,17 +14339,19 @@ static void Cmd_settaunt(void) u8 turns = 2; #endif - gDisableStructs[gBattlerTarget].tauntTimer = gDisableStructs[gBattlerTarget].tauntTimer2 = turns; - gBattlescriptCurrInstr += 5; + gDisableStructs[gBattlerTarget].tauntTimer = turns; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_trysethelpinghand(void) { + CMD_ARGS(const u8 *failInstr); + gBattlerTarget = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker))); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE @@ -13337,17 +14360,19 @@ static void Cmd_trysethelpinghand(void) && !gProtectStructs[gBattlerTarget].helpingHand) { gProtectStructs[gBattlerTarget].helpingHand = TRUE; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // Trick static void Cmd_tryswapitems(void) { + CMD_ARGS(const u8 *failInstr); + // opponent can't swap items with player in regular battles if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL || (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT @@ -13361,7 +14386,7 @@ static void Cmd_tryswapitems(void) #endif )))) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -13377,7 +14402,7 @@ static void Cmd_tryswapitems(void) && (gWishFutureKnock.knockedOffMons[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] || gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]])) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } // can't swap if two pokemon don't have an item // or if either of them is an enigma berry or a mail @@ -13387,7 +14412,7 @@ static void Cmd_tryswapitems(void) || !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerTarget].item) || !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerAttacker].item)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } // check if ability prevents swapping else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD) @@ -13422,7 +14447,7 @@ static void Cmd_tryswapitems(void) gBattleStruct->choicedMove[gBattlerTarget] = MOVE_NONE; gBattleStruct->choicedMove[gBattlerAttacker] = MOVE_NONE; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; PREPARE_ITEM_BUFFER(gBattleTextBuff1, *newItemAtk) PREPARE_ITEM_BUFFER(gBattleTextBuff2, oldItemAtk) @@ -13459,6 +14484,8 @@ static void Cmd_tryswapitems(void) // Role Play static void Cmd_trycopyability(void) { + CMD_ARGS(const u8 *failInstr); + u16 defAbility = gBattleMons[gBattlerTarget].ability; if (gBattleMons[gBattlerAttacker].ability == defAbility @@ -13466,31 +14493,33 @@ static void Cmd_trycopyability(void) || IsRolePlayBannedAbilityAtk(gBattleMons[gBattlerAttacker].ability) || IsRolePlayBannedAbility(defAbility)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleScripting.abilityPopupOverwrite = gBattleMons[gBattlerAttacker].ability; gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = defAbility; gLastUsedAbility = defAbility; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_trywish(void) { - switch (gBattlescriptCurrInstr[1]) + CMD_ARGS(u8 turnNumber, const u8 *failInstr); + + switch (cmd->turnNumber) { case 0: // use wish if (gWishFutureKnock.wishCounter[gBattlerAttacker] == 0) { gWishFutureKnock.wishCounter[gBattlerAttacker] = 2; gWishFutureKnock.wishPartyId[gBattlerAttacker] = gBattlerPartyIndexes[gBattlerAttacker]; - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + gBattlescriptCurrInstr = cmd->failInstr; } break; case 1: // heal effect @@ -13506,9 +14535,9 @@ static void Cmd_trywish(void) gBattleMoveDamage *= -1; if (gBattleMons[gBattlerTarget].hp == gBattleMons[gBattlerTarget].maxHP) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + gBattlescriptCurrInstr = cmd->failInstr; else - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; break; } @@ -13516,24 +14545,28 @@ static void Cmd_trywish(void) static void Cmd_settoxicspikes(void) { + CMD_ARGS(const u8 *failInstr); + u8 targetSide = GetBattlerSide(gBattlerTarget); if (gSideTimers[targetSide].toxicSpikesAmount >= 2) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gSideTimers[targetSide].toxicSpikesAmount++; gSideStatuses[targetSide] |= SIDE_STATUS_TOXIC_SPIKES; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setgastroacid(void) { + CMD_ARGS(const u8 *failInstr); + if (IsGastroAcidBannedAbility(gBattleMons[gBattlerTarget].ability)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -13541,16 +14574,18 @@ static void Cmd_setgastroacid(void) gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE; gStatuses3[gBattlerTarget] |= STATUS3_GASTRO_ACID; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setyawn(void) { + CMD_ARGS(const u8 *failInstr); + if (gStatuses3[gBattlerTarget] & STATUS3_YAWN || gBattleMons[gBattlerTarget].status1 & STATUS1_ANY) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else if (IsBattlerTerrainAffected(gBattlerTarget, STATUS_FIELD_ELECTRIC_TERRAIN)) { @@ -13567,20 +14602,22 @@ static void Cmd_setyawn(void) else { gStatuses3[gBattlerTarget] |= STATUS3_YAWN_TURN(2); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setdamagetohealthdifference(void) { + CMD_ARGS(const u8 *failInstr); + if (gBattleMons[gBattlerTarget].hp <= gBattleMons[gBattlerAttacker].hp) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - gBattleMons[gBattlerAttacker].hp; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -13602,6 +14639,8 @@ static void HandleRoomMove(u32 statusFlag, u8 *timer, u8 stringId) static void Cmd_setroom(void) { + CMD_ARGS(); + switch (gBattleMoves[gCurrentMove].effect) { case EFFECT_TRICK_ROOM: @@ -13617,28 +14656,30 @@ static void Cmd_setroom(void) gBattleCommunication[MULTISTRING_CHOOSER] = 6; break; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Skill Swap static void Cmd_tryswapabilities(void) { + CMD_ARGS(const u8 *failInstr); + if (IsSkillSwapBannedAbility(gBattleMons[gBattlerAttacker].ability) || IsSkillSwapBannedAbility(gBattleMons[gBattlerTarget].ability)) { RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) { RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_ABILITY_SHIELD); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -13646,16 +14687,18 @@ static void Cmd_tryswapabilities(void) gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = abilityAtk; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } } static void Cmd_tryimprison(void) { + CMD_ARGS(const u8 *failInstr); + if ((gStatuses3[gBattlerAttacker] & STATUS3_IMPRISONED_OTHERS)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -13683,38 +14726,42 @@ static void Cmd_tryimprison(void) if (attackerMoveId != MAX_MON_MOVES) { gStatuses3[gBattlerAttacker] |= STATUS3_IMPRISONED_OTHERS; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; break; } } } if (battlerId == gBattlersCount) // In Generation 3 games, Imprison fails if the user doesn't share any moves with any of the foes. - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_setstealthrock(void) { + CMD_ARGS(const u8 *failInstr); + u8 targetSide = GetBattlerSide(gBattlerTarget); if (gSideStatuses[targetSide] & SIDE_STATUS_STEALTH_ROCK) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gSideStatuses[targetSide] |= SIDE_STATUS_STEALTH_ROCK; gSideTimers[targetSide].stealthRockAmount = 1; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_setuserstatus3(void) { - u32 flags = T1_READ_32(gBattlescriptCurrInstr + 1); + CMD_ARGS(u32 flags, const u8 *failInstr); + + u32 flags = cmd->flags; if (gStatuses3[gBattlerAttacker] & flags) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + gBattlescriptCurrInstr = cmd->failInstr; } else { @@ -13723,12 +14770,14 @@ static void Cmd_setuserstatus3(void) gDisableStructs[gBattlerAttacker].magnetRiseTimer = 5; if (flags & STATUS3_LASER_FOCUS) gDisableStructs[gBattlerAttacker].laserFocusTimer = 2; - gBattlescriptCurrInstr += 9; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_assistattackselect(void) { + CMD_ARGS(const u8 *failInstr); + s32 chooseableMovesNo = 0; struct Pokemon *party; s32 monId, moveId; @@ -13765,41 +14814,45 @@ static void Cmd_assistattackselect(void) gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gCalledMove = validMoves[((Random() & 0xFF) * chooseableMovesNo) >> 8]; gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_trysetmagiccoat(void) { + CMD_ARGS(const u8 *failInstr); + gBattlerTarget = gBattlerAttacker; gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gProtectStructs[gBattlerAttacker].bounceMove = TRUE; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } // Snatch static void Cmd_trysetsnatch(void) { + CMD_ARGS(const u8 *failInstr); + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gProtectStructs[gBattlerAttacker].stealMove = TRUE; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -13809,7 +14862,9 @@ static void Cmd_unused2(void) static void Cmd_switchoutabilities(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler); + + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (gBattleMons[gActiveBattler].ability == ABILITY_NEUTRALIZING_GAS) { gBattleMons[gActiveBattler].ability = ABILITY_NONE; @@ -13841,24 +14896,28 @@ static void Cmd_switchoutabilities(void) break; } - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_jumpifhasnohp(void) { - gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 battler, const u8 *jumpInstr); + + gActiveBattler = GetBattlerForBattleScript(cmd->battler); if (gBattleMons[gActiveBattler].hp == 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_getsecretpowereffect(void) { + CMD_ARGS(); + gBattleScripting.moveEffect = GetSecretPowerMoveEffect(); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } u16 GetSecretPowerMoveEffect(void) @@ -13955,55 +15014,20 @@ u16 GetSecretPowerMoveEffect(void) static void Cmd_pickup(void) { - s32 i; - u16 species, heldItem; - u16 ability; + CMD_ARGS(); + + u32 i, j; + u16 species, heldItem, ability; u8 lvlDivBy10; - if (InBattlePike()) - { - - } - else if (InBattlePyramid()) + if (!InBattlePike()) // No items in Battle Pike. { + bool32 isInPyramid = InBattlePyramid_(); for (i = 0; i < PARTY_SIZE; i++) { species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); - - ability = gSpeciesInfo[species].abilities[GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM)]; - - if (ability == ABILITY_PICKUP - && species != SPECIES_NONE - && species != SPECIES_EGG - && heldItem == ITEM_NONE - && (Random() % 10) == 0) - { - heldItem = GetBattlePyramidPickupItemId(); - SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem); - } - #if (defined ITEM_HONEY) - else if (ability == ABILITY_HONEY_GATHER - && species != 0 - && species != SPECIES_EGG - && heldItem == ITEM_NONE) - { - if ((lvlDivBy10 + 1 ) * 5 > Random() % 100) - { - heldItem = ITEM_HONEY; - SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem); - } - } - #endif - } - } - else - { - for (i = 0; i < PARTY_SIZE; i++) - { - species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); - heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); - lvlDivBy10 = (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL)-1) / 10; //Moving this here makes it easier to add in abilities like Honey Gather + lvlDivBy10 = (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL)-1) / 10; //Moving this here makes it easier to add in abilities like Honey Gather. if (lvlDivBy10 > 9) lvlDivBy10 = 9; @@ -14015,24 +15039,30 @@ static void Cmd_pickup(void) && heldItem == ITEM_NONE && (Random() % 10) == 0) { - s32 j; - s32 rand = Random() % 100; - - for (j = 0; j < (int)ARRAY_COUNT(sPickupProbabilities); j++) + if (isInPyramid) { - if (sPickupProbabilities[j] > rand) + heldItem = GetBattlePyramidPickupItemId(); + SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem); + } + else + { + u32 rand = Random() % 100; + + for (j = 0; j < ARRAY_COUNT(sPickupProbabilities); j++) { - SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &sPickupItems[lvlDivBy10 + j]); - break; - } - else if (rand == 99 || rand == 98) - { - SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &sRarePickupItems[lvlDivBy10 + (99 - rand)]); - break; + if (sPickupProbabilities[j] > rand) + { + SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &sPickupItems[lvlDivBy10 + j]); + break; + } + else if (rand == 99 || rand == 98) + { + SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &sRarePickupItems[lvlDivBy10 + (99 - rand)]); + break; + } } } } - #if (defined ITEM_HONEY) else if (ability == ABILITY_HONEY_GATHER && species != 0 && species != SPECIES_EGG @@ -14044,15 +15074,25 @@ static void Cmd_pickup(void) SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem); } } + #if P_SHUCKLE_BERRY_JUICE == TRUE + else if (species == SPECIES_SHUCKLE + && heldItem == ITEM_ORAN_BERRY + && (Random() % 16) == 0) + { + heldItem = ITEM_BERRY_JUICE; + SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &heldItem); + } #endif } } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_doweatherformchangeanimation(void) { + CMD_ARGS(); + gActiveBattler = gBattleScripting.battler; if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE) @@ -14061,14 +15101,16 @@ static void Cmd_doweatherformchangeanimation(void) BtlController_EmitBattleAnimation(BUFFER_A, B_ANIM_CASTFORM_CHANGE, gBattleStruct->formToChangeInto); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryweatherformdatachange(void) { + CMD_ARGS(); + u8 form; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; form = TryWeatherFormChange(gBattleScripting.battler); if (form) { @@ -14080,6 +15122,8 @@ static void Cmd_tryweatherformdatachange(void) // Water and Mud Sport static void Cmd_settypebasedhalvers(void) { + CMD_ARGS(const u8 *failInstr); + bool8 worked = FALSE; if (gBattleMoves[gCurrentMove].effect == EFFECT_MUD_SPORT) @@ -14122,9 +15166,9 @@ static void Cmd_settypebasedhalvers(void) } if (worked) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } bool32 DoesSubstituteBlockMove(u8 battlerAtk, u8 battlerDef, u32 move) @@ -14157,14 +15201,18 @@ bool32 DoesDisguiseBlockMove(u8 battlerAtk, u8 battlerDef, u32 move) static void Cmd_jumpifsubstituteblocks(void) { + CMD_ARGS(const u8 *jumpInstr); + if (DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryrecycleitem(void) { + CMD_ARGS(const u8 *failInstr); + u16 *usedHeldItem; gActiveBattler = gBattlerAttacker; @@ -14178,11 +15226,11 @@ static void Cmd_tryrecycleitem(void) BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } @@ -14195,6 +15243,8 @@ bool32 CanCamouflage(u8 battlerId) static void Cmd_settypetoterrain(void) { + CMD_ARGS(const u8 *failInstr); + u8 terrainType; switch(gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) { @@ -14220,17 +15270,19 @@ static void Cmd_settypetoterrain(void) SET_BATTLER_TYPE(gBattlerAttacker, terrainType); PREPARE_TYPE_BUFFER(gBattleTextBuff1, terrainType); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } // Unused static void Cmd_pursuitdoubles(void) { + CMD_ARGS(const u8 *failInstr); + gActiveBattler = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker))); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE @@ -14240,19 +15292,21 @@ static void Cmd_pursuitdoubles(void) { gActionsByTurnOrder[gActiveBattler] = B_ACTION_TRY_FINISH; gCurrentMove = MOVE_PURSUIT; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; gBattleScripting.animTurn = 1; gBattleScripting.savedBattler = gBattlerAttacker; gBattlerAttacker = gActiveBattler; } else { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } } static void Cmd_snatchsetbattlers(void) { + CMD_ARGS(); + gEffectBattler = gBattlerAttacker; if (gBattlerAttacker == gBattlerTarget) @@ -14261,12 +15315,14 @@ static void Cmd_snatchsetbattlers(void) gBattlerTarget = gBattleScripting.battler; gBattleScripting.battler = gEffectBattler; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } // Brick Break static void Cmd_removelightscreenreflect(void) { + CMD_ARGS(); + u8 side; bool32 failed; @@ -14303,7 +15359,7 @@ static void Cmd_removelightscreenreflect(void) gBattleScripting.animTargetsHit = 0; } - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } u8 GetCatchingBattler(void) @@ -14316,6 +15372,8 @@ u8 GetCatchingBattler(void) static void Cmd_handleballthrow(void) { + CMD_ARGS(); + u16 ballMultiplier = 100; s8 ballAddition = 0; @@ -14634,6 +15692,8 @@ static void Cmd_handleballthrow(void) static void Cmd_givecaughtmon(void) { + CMD_ARGS(); + if (GiveMonToPlayer(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]]) != MON_GIVEN_TO_PARTY) { if (!ShouldShowBoxWasFullMessage()) @@ -14659,27 +15719,31 @@ static void Cmd_givecaughtmon(void) GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gBattleResults.caughtMonNick); gBattleResults.caughtMonBall = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_POKEBALL, NULL); - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_trysetcaughtmondexflags(void) { + CMD_ARGS(const u8 *failInstr); + u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_SPECIES, NULL); u32 personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_PERSONALITY, NULL); if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { HandleSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_CAUGHT, personality); - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_displaydexinfo(void) { + CMD_ARGS(); + u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_SPECIES, NULL); switch (gBattleCommunication[0]) @@ -14724,7 +15788,7 @@ static void Cmd_displaydexinfo(void) break; case 5: if (!gPaletteFade.active) - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; break; } } @@ -14797,6 +15861,8 @@ void BattleDestroyYesNoCursorAt(u8 cursorPosition) static void Cmd_trygivecaughtmonnick(void) { + CMD_ARGS(const u8 *successInstr); + switch (gBattleCommunication[MULTIUSE_STATE]) { case 0: @@ -14859,48 +15925,58 @@ static void Cmd_trygivecaughtmonnick(void) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) { SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_NICKNAME, gBattleStruct->caughtMonNick); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->successInstr; } break; case 4: if (CalculatePlayerPartyCount() == PARTY_SIZE) - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; else - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->successInstr; break; } } static void Cmd_subattackerhpbydmg(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].hp -= gBattleMoveDamage; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_removeattackerstatus1(void) { + CMD_ARGS(); + gBattleMons[gBattlerAttacker].status1 = 0; - gBattlescriptCurrInstr++; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_finishaction(void) { + CMD_ARGS(); + gCurrentActionFuncId = B_ACTION_FINISHED; } static void Cmd_finishturn(void) { + CMD_ARGS(); + gCurrentActionFuncId = B_ACTION_FINISHED; gCurrentTurnActionNumber = gBattlersCount; } static void Cmd_trainerslideout(void) { - gActiveBattler = GetBattlerAtPosition(gBattlescriptCurrInstr[1]); + CMD_ARGS(u8 position); + + gActiveBattler = GetBattlerAtPosition(cmd->position); BtlController_EmitTrainerSlideBack(BUFFER_A); MarkBattlerForControllerExec(gActiveBattler); - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static const u16 sTelekinesisBanList[] = @@ -14928,54 +16004,62 @@ bool32 IsTelekinesisBannedSpecies(u16 species) static void Cmd_settelekinesis(void) { + CMD_ARGS(const u8 *failInstr); + if (gStatuses3[gBattlerTarget] & (STATUS3_TELEKINESIS | STATUS3_ROOTED | STATUS3_SMACKED_DOWN) || gFieldStatuses & STATUS_FIELD_GRAVITY || IsTelekinesisBannedSpecies(gBattleMons[gBattlerTarget].species)) { - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gStatuses3[gBattlerTarget] |= STATUS3_TELEKINESIS; gDisableStructs[gBattlerTarget].telekinesisTimer = 3; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_swapstatstages(void) { - u8 statId = T1_READ_8(gBattlescriptCurrInstr + 1); - s8 atkStatStage = gBattleMons[gBattlerAttacker].statStages[statId]; - s8 defStatStage = gBattleMons[gBattlerTarget].statStages[statId]; + CMD_ARGS(u8 stat); - gBattleMons[gBattlerAttacker].statStages[statId] = defStatStage; - gBattleMons[gBattlerTarget].statStages[statId] = atkStatStage; + u8 stat = cmd->stat; + s8 atkStatStage = gBattleMons[gBattlerAttacker].statStages[stat]; + s8 defStatStage = gBattleMons[gBattlerTarget].statStages[stat]; - gBattlescriptCurrInstr += 2; + gBattleMons[gBattlerAttacker].statStages[stat] = defStatStage; + gBattleMons[gBattlerTarget].statStages[stat] = atkStatStage; + + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_averagestats(void) { - u8 statId = T1_READ_8(gBattlescriptCurrInstr + 1); - u16 atkStat = *(u16 *)((&gBattleMons[gBattlerAttacker].attack) + (statId - 1)); - u16 defStat = *(u16 *)((&gBattleMons[gBattlerTarget].attack) + (statId - 1)); + CMD_ARGS(u8 stat); + + u8 stat = cmd->stat; + u16 atkStat = *(u16 *)((&gBattleMons[gBattlerAttacker].attack) + (stat - 1)); + u16 defStat = *(u16 *)((&gBattleMons[gBattlerTarget].attack) + (stat - 1)); u16 average = (atkStat + defStat) / 2; - *(u16 *)((&gBattleMons[gBattlerAttacker].attack) + (statId - 1)) = average; - *(u16 *)((&gBattleMons[gBattlerTarget].attack) + (statId - 1)) = average; + *(u16 *)((&gBattleMons[gBattlerAttacker].attack) + (stat - 1)) = average; + *(u16 *)((&gBattleMons[gBattlerTarget].attack) + (stat - 1)) = average; - gBattlescriptCurrInstr += 2; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_jumpifoppositegenders(void) { + CMD_ARGS(const u8 *jumpInstr); + u32 atkGender = GetGenderFromSpeciesAndPersonality(gBattleMons[gBattlerAttacker].species, gBattleMons[gBattlerAttacker].personality); u32 defGender = GetGenderFromSpeciesAndPersonality(gBattleMons[gBattlerTarget].species, gBattleMons[gBattlerTarget].personality); if ((atkGender == MON_MALE && defGender == MON_FEMALE) || (atkGender == MON_FEMALE && defGender == MON_MALE)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->jumpInstr; else - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_unused(void) @@ -14984,32 +16068,38 @@ static void Cmd_unused(void) static void Cmd_tryworryseed(void) { + CMD_ARGS(const u8 *failInstr); + if (IsWorrySeedBannedAbility(gBattleMons[gBattlerTarget].ability)) { RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_ABILITY_SHIELD) { RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_ABILITY_SHIELD); - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = cmd->failInstr; } else { gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = ABILITY_INSOMNIA; - gBattlescriptCurrInstr += 5; + gBattlescriptCurrInstr = cmd->nextInstr; } } static void Cmd_callnative(void) { - void (*func)() = (void *)T1_READ_PTR(gBattlescriptCurrInstr + 1); + CMD_ARGS(void (*func)(void)); + void (*func)(void) = cmd->func; func(); } // Callnative Funcs void BS_CalcMetalBurstDmg(void) { + NATIVE_ARGS(const u8 *failInstr); + u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = 0; @@ -15024,7 +16114,7 @@ void BS_CalcMetalBurstDmg(void) else gBattlerTarget = gProtectStructs[gBattlerAttacker].physicalBattlerId; - gBattlescriptCurrInstr += 9; + gBattlescriptCurrInstr = cmd->nextInstr; } else if (gProtectStructs[gBattlerAttacker].specialDmg && sideAttacker != (sideTarget = GetBattlerSide(gProtectStructs[gBattlerAttacker].specialBattlerId)) @@ -15037,20 +16127,31 @@ void BS_CalcMetalBurstDmg(void) else gBattlerTarget = gProtectStructs[gBattlerAttacker].specialBattlerId; - gBattlescriptCurrInstr += 9; + gBattlescriptCurrInstr = cmd->nextInstr; } else { gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + gBattlescriptCurrInstr = cmd->failInstr; } } +void BS_JumpIfMoreThanHalfHP(void) +{ + NATIVE_ARGS(u8 battler, const u8 *jumpInstr); + + u8 battler = GetBattlerForBattleScript(cmd->battler); + if (gBattleMons[battler].hp > (gBattleMons[battler].maxHP + 1) / 2) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; +} + void BS_JumpIfHoldEffect(void) { u8 battler = gBattlescriptCurrInstr[5]; u16 holdEffect = T1_READ_16(gBattlescriptCurrInstr + 6); - + if (GetBattlerHoldEffect(battler, TRUE) == holdEffect) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 8); @@ -15081,10 +16182,8 @@ static bool32 CriticalCapture(u32 odds) else odds = (odds * 250) / 100; - #ifdef ITEM_CATCHING_CHARM if (CheckBagHasItem(ITEM_CATCHING_CHARM, 1)) odds = (odds * (100 + B_CATCHING_CHARM_BOOST)) / 100; - #endif odds /= 6; if ((Random() % 255) < odds) @@ -15098,7 +16197,7 @@ static bool32 CriticalCapture(u32 odds) bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) { - if (gBattleMoves[move].split != SPLIT_STATUS + if (gBattleMoves[move].split != SPLIT_STATUS && !(sForbiddenMoves[move] & FORBIDDEN_PARENTAL_BOND)) { if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) @@ -15136,3 +16235,51 @@ static bool8 IsFinalStrikeEffect(u16 move) } return FALSE; } + +static void TryUpdateRoundTurnOrder(void) +{ + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + u32 i; + u32 j = 0; + u32 k = 0; + u32 currRounder; + u8 roundUsers[3] = {0xFF, 0xFF, 0xFF}; + u8 nonRoundUsers[3] = {0xFF, 0xFF, 0xFF}; + for (i = 0; i < gBattlersCount; i++) + { + if (gBattlerByTurnOrder[i] == gBattlerAttacker) + { + currRounder = i + 1; // Current battler going after attacker + break; + } + } + + // Get battlers after us using round + for (i = currRounder; i < gBattlersCount; i++) + { + if (gChosenMoveByBattler[gBattlerByTurnOrder[i]] == MOVE_ROUND) + roundUsers[j++] = gBattlerByTurnOrder[i]; + else + nonRoundUsers[k++] = gBattlerByTurnOrder[i]; + } + + // update turn order for round users + for (i = 0; roundUsers[i] != 0xFF && i < 3; i++) + { + gBattlerByTurnOrder[currRounder] = roundUsers[i]; + gActionsByTurnOrder[currRounder] = gActionsByTurnOrder[roundUsers[i]]; + gProtectStructs[roundUsers[i]].quash = TRUE; // Make it so their turn order can't be changed again + currRounder++; + } + + // Update turn order for non-round users + for (i = 0; nonRoundUsers[i] != 0xFF && i < 3; i++) + { + gBattlerByTurnOrder[currRounder] = nonRoundUsers[i]; + gActionsByTurnOrder[currRounder] = gActionsByTurnOrder[nonRoundUsers[i]]; + currRounder++; + } + } +} + diff --git a/src/battle_util.c b/src/battle_util.c index 03a642625..a94467085 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -259,7 +259,7 @@ bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move) void HandleAction_UseMove(void) { u32 i, side, moveType, var = 4; - u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); + u16 moveTarget; gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber]; if (gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker] || !IsBattlerAlive(gBattlerAttacker)) @@ -324,6 +324,8 @@ void HandleAction_UseMove(void) gCurrentMove = gBattleStruct->zmove.toBeUsed[gBattlerAttacker]; } + moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); + if (gBattleMons[gBattlerAttacker].hp != 0) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) @@ -346,7 +348,7 @@ void HandleAction_UseMove(void) } else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gSideTimers[side].followmeTimer == 0 - && (gBattleMoves[gCurrentMove].power != 0 || moveTarget != MOVE_TARGET_USER) + && (gBattleMoves[gCurrentMove].power != 0 || (moveTarget != MOVE_TARGET_USER && moveTarget != MOVE_TARGET_ALL_BATTLERS)) && ((GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) || (GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_STORM_DRAIN && moveType == TYPE_WATER))) { @@ -907,9 +909,8 @@ void HandleAction_NothingIsFainted(void) void HandleAction_ActionFinished(void) { #if B_RECALC_TURN_AFTER_ACTIONS >= GEN_8 - u8 i, j; - u8 battler1 = 0; - u8 battler2 = 0; + u32 i, j; + bool32 afterYouActive = gSpecialStatuses[gBattlerByTurnOrder[gCurrentTurnActionNumber + 1]].afterYou; #endif *(gBattleStruct->monToSwitchIntoId + gBattlerByTurnOrder[gCurrentTurnActionNumber]) = PARTY_SIZE; gCurrentTurnActionNumber++; @@ -936,25 +937,33 @@ void HandleAction_ActionFinished(void) gBattleResources->battleScriptsStack->size = 0; #if B_RECALC_TURN_AFTER_ACTIONS >= GEN_8 - // i starts at `gCurrentTurnActionNumber` because we don't want to recalculate turn order for mon that have already - // taken action. It's been previously increased, which we want in order to not recalculate the turn of the mon that just finished its action - for (i = gCurrentTurnActionNumber; i < gBattlersCount - 1; i++) + if (!afterYouActive) { - for (j = i + 1; j < gBattlersCount; j++) + // i starts at `gCurrentTurnActionNumber` because we don't want to recalculate turn order for mon that have already + // taken action. It's been previously increased, which we want in order to not recalculate the turn of the mon that just finished its action + for (i = gCurrentTurnActionNumber; i < gBattlersCount - 1; i++) { - u8 battler1 = gBattlerByTurnOrder[i]; - u8 battler2 = gBattlerByTurnOrder[j]; - // We recalculate order only for action of the same priority. If any action other than switch/move has been taken, they should - // have been executed before. The only recalculation needed is for moves/switch. Mega evolution is handled in src/battle_main.c/TryChangeOrder - if((gActionsByTurnOrder[i] == B_ACTION_USE_MOVE && gActionsByTurnOrder[j] == B_ACTION_USE_MOVE)) + for (j = i + 1; j < gBattlersCount; j++) { - if (GetWhoStrikesFirst(battler1, battler2, FALSE)) - SwapTurnOrder(i, j); - } - else if ((gActionsByTurnOrder[i] == B_ACTION_SWITCH && gActionsByTurnOrder[j] == B_ACTION_SWITCH)) - { - if (GetWhoStrikesFirst(battler1, battler2, TRUE)) // If the actions chosen are switching, we recalc order but ignoring the moves - SwapTurnOrder(i, j); + u8 battler1 = gBattlerByTurnOrder[i]; + u8 battler2 = gBattlerByTurnOrder[j]; + + if (gProtectStructs[battler1].quash || gProtectStructs[battler2].quash + || gProtectStructs[battler1].shellTrap || gProtectStructs[battler2].shellTrap) + continue; + + // We recalculate order only for action of the same priority. If any action other than switch/move has been taken, they should + // have been executed before. The only recalculation needed is for moves/switch. Mega evolution is handled in src/battle_main.c/TryChangeOrder + if((gActionsByTurnOrder[i] == B_ACTION_USE_MOVE && gActionsByTurnOrder[j] == B_ACTION_USE_MOVE)) + { + if (GetWhoStrikesFirst(battler1, battler2, FALSE)) + SwapTurnOrder(i, j); + } + else if ((gActionsByTurnOrder[i] == B_ACTION_SWITCH && gActionsByTurnOrder[j] == B_ACTION_SWITCH)) + { + if (GetWhoStrikesFirst(battler1, battler2, TRUE)) // If the actions chosen are switching, we recalc order but ignoring the moves + SwapTurnOrder(i, j); + } } } } @@ -1279,6 +1288,9 @@ u8 GetBattlerForBattleScript(u8 caseId) case BS_ATTACKER: ret = gBattlerAttacker; break; + case BS_ATTACKER_PARTNER: + ret = BATTLE_PARTNER(gBattlerAttacker); + break; case BS_EFFECT_BATTLER: ret = gEffectBattler; break; @@ -2141,7 +2153,9 @@ u8 DoFieldEndTurnEffects(void) s32 j; for (j = i + 1; j < gBattlersCount; j++) { - if (GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE)) + if (!gProtectStructs[i].quash + && !gProtectStructs[j].quash + && GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE)) SwapTurnOrder(i, j); } } @@ -3288,7 +3302,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void) return FALSE; } -#define FAINTED_ACTIONS_MAX_CASE 7 +#define FAINTED_ACTIONS_MAX_CASE 8 bool8 HandleFaintedMonActions(void) { @@ -3373,7 +3387,19 @@ bool8 HandleFaintedMonActions(void) else gBattleStruct->faintedActionsState = 4; break; - case 6: + case 6: // All battlers switch-in abilities happen here to prevent them happening against an empty field. + for (i = 0; i < gBattlersCount; i++) + { + if (gBattleStruct->switchInAbilityPostponed & gBitTable[i]) + { + if (DoSwitchInAbilitiesItems(i)) + return TRUE; + gBattleStruct->switchInAbilityPostponed &= ~(gBitTable[i]); + } + } + gBattleStruct->faintedActionsState++; + break; + case 7: if (ItemBattleEffects(ITEMEFFECT_NORMAL, 0, TRUE)) return TRUE; gBattleStruct->faintedActionsState++; @@ -3397,35 +3423,6 @@ void TryClearRageAndFuryCutter(void) } } -enum -{ - CANCELLER_FLAGS, - CANCELLER_SKY_DROP, - CANCELLER_ASLEEP, - CANCELLER_FROZEN, - CANCELLER_TRUANT, - CANCELLER_RECHARGE, - CANCELLER_FLINCH, - CANCELLER_DISABLED, - CANCELLER_GRAVITY, - CANCELLER_HEAL_BLOCKED, - CANCELLER_TAUNTED, - CANCELLER_IMPRISONED, - CANCELLER_CONFUSED, - CANCELLER_PARALYSED, - CANCELLER_IN_LOVE, - CANCELLER_BIDE, - CANCELLER_THAW, - CANCELLER_POWDER_MOVE, - CANCELLER_POWDER_STATUS, - CANCELLER_THROAT_CHOP, - CANCELLER_MULTIHIT_MOVES, - CANCELLER_Z_MOVES, - CANCELLER_END, - CANCELLER_PSYCHIC_TERRAIN, - CANCELLER_END2, -}; - u8 AtkCanceller_UnableToUseMove(void) { u8 effect = 0; @@ -3740,7 +3737,10 @@ u8 AtkCanceller_UnableToUseMove(void) if (effect != 0) gBattlescriptCurrInstr = BattleScript_PowderMoveNoEffect; } - gBattleStruct->atkCancellerTracker++; + if (gProtectStructs[gBattlerAttacker].usesBouncedMove) // Edge case for bouncing a powder move against a grass type pokemon. + gBattleStruct->atkCancellerTracker = CANCELLER_END; + else + gBattleStruct->atkCancellerTracker++; break; case CANCELLER_POWDER_STATUS: if (gBattleMons[gBattlerAttacker].status2 & STATUS2_POWDER) @@ -3814,7 +3814,7 @@ u8 AtkCanceller_UnableToUseMove(void) { SetRandomMultiHitCounter(); } - + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } else if (gBattleMoves[gCurrentMove].flags & FLAG_TWO_STRIKES) @@ -3841,7 +3841,7 @@ u8 AtkCanceller_UnableToUseMove(void) party = gPlayerParty; else party = gEnemyParty; - + for (i = 0; i < PARTY_SIZE; i++) { if (GetMonData(&party[i], MON_DATA_HP) @@ -4762,6 +4762,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_INTIMIDATE: if (!gSpecialStatuses[battler].switchInAbilityDone) { + gBattlerAttacker = battler; gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_ATK, 1, TRUE); BattleScriptPushCursorAndCallback(BattleScript_IntimidateActivates); @@ -5487,7 +5488,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_ABILITY_SHIELD); break; } - + gLastUsedAbility = gBattleMons[gBattlerAttacker].ability; gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = gLastUsedAbility; @@ -5566,17 +5567,26 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_AFTERMATH: - if (!IsAbilityOnField(ABILITY_DAMP) - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMons[gBattlerTarget].hp == 0 && IsBattlerAlive(gBattlerAttacker) && IsMoveMakingContact(move, gBattlerAttacker)) { - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_AftermathDmg; + u8 battler; + if ((battler = IsAbilityOnField(ABILITY_DAMP))) + { + gBattleScripting.battler = battler - 1; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_DampPreventsAftermath; + } + else + { + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AftermathDmg; + } effect++; } break; @@ -5758,11 +5768,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move { gStatuses3[battler] |= STATUS3_PERISH_SONG; gDisableStructs[battler].perishSongTimer = 3; - gDisableStructs[battler].perishSongTimerStartValue = 3; } gStatuses3[gBattlerAttacker] |= STATUS3_PERISH_SONG; gDisableStructs[gBattlerAttacker].perishSongTimer = 3; - gDisableStructs[gBattlerAttacker].perishSongTimerStartValue = 3; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_PerishBodyActivates; effect++; @@ -6815,7 +6823,7 @@ static bool32 GetMentalHerbEffect(u8 battlerId) // Check taunt if (gDisableStructs[battlerId].tauntTimer != 0) { - gDisableStructs[battlerId].tauntTimer = gDisableStructs[battlerId].tauntTimer2 = 0; + gDisableStructs[battlerId].tauntTimer = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_TAUNT; PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_TAUNT); ret = TRUE; @@ -6824,7 +6832,7 @@ static bool32 GetMentalHerbEffect(u8 battlerId) if (gDisableStructs[battlerId].encoreTimer != 0) { gDisableStructs[battlerId].encoredMove = 0; - gDisableStructs[battlerId].encoreTimerStartValue = gDisableStructs[battlerId].encoreTimer = 0; + gDisableStructs[battlerId].encoreTimer = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_ENCORE; // STRINGID_PKMNENCOREENDED ret = TRUE; } @@ -6845,7 +6853,7 @@ static bool32 GetMentalHerbEffect(u8 battlerId) // Check disable if (gDisableStructs[battlerId].disableTimer != 0) { - gDisableStructs[battlerId].disableTimer = gDisableStructs[battlerId].disableTimerStartValue = 0; + gDisableStructs[battlerId].disableTimer = 0; gDisableStructs[battlerId].disabledMove = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MENTALHERBCURE_DISABLE; ret = TRUE; @@ -6858,7 +6866,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect) { u8 effect = 0; u32 i; - + switch (holdEffect) { #if B_HP_BERRIES >= GEN_4 @@ -7027,7 +7035,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect) && !(gBattleMons[battlerId].status2 & STATUS2_FOCUS_ENERGY) && HasEnoughHpToEatBerry(battlerId, GetBattlerItemHoldEffectParam(battlerId, gLastUsedItem), gLastUsedItem)) { - gBattleMons[battlerId].status2 |= STATUS2_FOCUS_ENERGY; + gBattleMons[battlerId].status2 |= STATUS2_FOCUS_ENERGY; gBattleScripting.battler = battlerId; gPotentialItemEffectBattler = battlerId; BattleScriptPushCursor(); @@ -7036,7 +7044,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect) } break; } - + return effect; } @@ -7053,7 +7061,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gLastUsedItem = gBattleMons[battlerId].item; battlerHoldEffect = GetBattlerHoldEffect(battlerId, TRUE); } - + atkItem = gBattleMons[gBattlerAttacker].item; atkHoldEffect = GetBattlerHoldEffect(gBattlerAttacker, TRUE); atkHoldEffectParam = GetBattlerHoldEffectParam(gBattlerAttacker); @@ -8184,7 +8192,7 @@ u32 GetBattlerHoldEffect(u8 battlerId, bool32 checkNegating) return ItemId_GetHoldEffect(gBattleMons[battlerId].item); } -// +// static u32 GetBattlerItemHoldEffectParam(u8 battlerId, u16 item) { if (item == ITEM_ENIGMA_BERRY) @@ -8234,10 +8242,16 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) else if (gProtectStructs[battlerId].protected) return FALSE; } - - if (move == MOVE_TEATIME) + + if (move == MOVE_TEATIME) { - return FALSE; + return FALSE; + } + + // Z-Moves and Max Moves bypass protection + if (gBattleStruct->zmove.active) + { + return FALSE; } // Protective Pads doesn't stop Unseen Fist from bypassing Protect effects, so IsMoveMakingContact() isn't used here. @@ -8682,8 +8696,14 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_ROUND: - if (gChosenMoveByBattler[BATTLE_PARTNER(battlerAtk)] == MOVE_ROUND && !(gAbsentBattlerFlags & gBitTable[BATTLE_PARTNER(battlerAtk)])) - basePower *= 2; + for (i = 0; i < gBattlersCount; i++) + { + if (i != battlerAtk && IsBattlerAlive(i) && gLastMoves[i] == MOVE_ROUND) + { + basePower *= 2; + break; + } + } break; case EFFECT_FUSION_COMBO: if (gBattleMoves[gLastUsedMove].effect == EFFECT_FUSION_COMBO && move != gLastUsedMove) @@ -9622,6 +9642,12 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move MulModifier(&finalModifier, UQ_4_12(0.25)); } + // Z-Moves and Max Moves bypass Protect and do 25% of their original damage + if (gBattleStruct->zmove.active && IS_BATTLER_PROTECTED(battlerDef)) + { + MulModifier(&finalModifier, UQ_4_12(0.25)); + } + // attacker's abilities switch (abilityAtk) { @@ -9807,6 +9833,18 @@ static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 batt MulModifier(modifier, mod); } +static void TryNoticeIllusionInTypeEffectiveness(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, u16 resultingModifier, u32 illusionSpecies) +{ + // Check if the type effectiveness would've been different if the pokemon really had the types as the disguise. + u16 presumedModifier = UQ_4_12(1.0); + MulByTypeEffectiveness(&presumedModifier, move, moveType, battlerDef, gSpeciesInfo[illusionSpecies].types[0], battlerAtk, FALSE); + if (gSpeciesInfo[illusionSpecies].types[1] != gSpeciesInfo[illusionSpecies].types[0]) + MulByTypeEffectiveness(&presumedModifier, move, moveType, battlerDef, gSpeciesInfo[illusionSpecies].types[1], battlerAtk, FALSE); + + if (presumedModifier != resultingModifier) + RecordAbilityBattle(battlerDef, ABILITY_ILLUSION); +} + static void UpdateMoveResultFlags(u16 modifier) { if (modifier == UQ_4_12(0.0)) @@ -9832,6 +9870,7 @@ static void UpdateMoveResultFlags(u16 modifier) static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities, u16 modifier) { + u32 illusionSpecies; u16 defAbility = GetBattlerAbility(battlerDef); MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, gBattleMons[battlerDef].type1, battlerAtk, recordAbilities); @@ -9841,7 +9880,20 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat && gBattleMons[battlerDef].type3 != gBattleMons[battlerDef].type1) MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, gBattleMons[battlerDef].type3, battlerAtk, recordAbilities); - if (moveType == TYPE_GROUND && !IsBattlerGrounded2(battlerDef, TRUE) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)) + if (recordAbilities && (illusionSpecies = GetIllusionMonSpecies(battlerDef))) + TryNoticeIllusionInTypeEffectiveness(move, moveType, battlerAtk, battlerDef, modifier, illusionSpecies); + + if (gBattleMoves[move].split == SPLIT_STATUS && move != MOVE_THUNDER_WAVE) + { + modifier = UQ_4_12(1.0); + #if B_GLARE_GHOST <= GEN_3 + if (move == MOVE_GLARE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) + { + modifier = UQ_4_12(0.0); + } + #endif + } + else if (moveType == TYPE_GROUND && !IsBattlerGrounded2(battlerDef, TRUE) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)) { modifier = UQ_4_12(0.0); if (recordAbilities && defAbility == ABILITY_LEVITATE) @@ -9859,12 +9911,6 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat modifier = UQ_4_12(0.0); } #endif -#if B_GLARE_GHOST >= GEN_4 - else if (move == MOVE_GLARE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) - { - modifier = UQ_4_12(1.0); - } -#endif // Thousand Arrows ignores type modifiers for flying mons if (!IsBattlerGrounded(battlerDef) && (gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING) @@ -10270,6 +10316,14 @@ void ClearIllusionMon(u32 battlerId) memset(&gBattleStruct->illusion[battlerId], 0, sizeof(gBattleStruct->illusion[battlerId])); } +u32 GetIllusionMonSpecies(u32 battlerId) +{ + struct Pokemon *illusionMon = GetIllusionMonPtr(battlerId); + if (illusionMon != NULL) + return GetMonData(illusionMon, MON_DATA_SPECIES); + return SPECIES_NONE; +} + bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId) { struct Pokemon *party, *partnerMon; diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 2eccd82f5..536080aa9 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -50,7 +50,7 @@ static u16 GetSignatureZMove(u16 move, u16 species, u16 item); static u16 GetTypeBasedZMove(u16 move, u8 battler); static void ZMoveSelectionDisplayPpNumber(void); static void ZMoveSelectionDisplayPower(u16 move, u16 zMove); -static void ShowZMoveTriggerSprite(void); +static void ShowZMoveTriggerSprite(u8 battleId); static bool32 AreStatsMaxed(u8 battlerId, u8 n); static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove); static void ZMoveSelectionDisplayMoveType(u16 zMove); @@ -204,11 +204,7 @@ bool32 IsViableZMove(u8 battlerId, u16 move) else holdEffect = ItemId_GetHoldEffect(item); - #ifdef ITEM_ULTRANECROZIUM_Z - if (holdEffect == HOLD_EFFECT_Z_CRYSTAL || item == ITEM_ULTRANECROZIUM_Z) - #else if (holdEffect == HOLD_EFFECT_Z_CRYSTAL) - #endif { u16 zMove = GetSignatureZMove(move, gBattleMons[battlerId].species, item); if (zMove != MOVE_NONE) @@ -258,7 +254,7 @@ bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex) if (gBattleStruct->zmove.viable && !viableZMove) HideZMoveTriggerSprite(); // Was a viable z move, now is not -> slide out else if (!gBattleStruct->zmove.viable && viableZMove) - ShowZMoveTriggerSprite(); // Was not a viable z move, now is -> slide back in + ShowZMoveTriggerSprite(battlerId); // Was not a viable z move, now is -> slide back in } #define SINGLES_Z_TRIGGER_POS_X_OPTIMAL (29) @@ -368,11 +364,11 @@ void HideZMoveTriggerSprite(void) gBattleStruct->zmove.viable = FALSE; } -static void ShowZMoveTriggerSprite(void) +static void ShowZMoveTriggerSprite(u8 battlerId) { struct Sprite *sprite = &gSprites[gBattleStruct->zmove.triggerSpriteId]; gBattleStruct->zmove.viable = TRUE; - CreateZMoveTriggerSprite(sprite->tBattler, TRUE); + CreateZMoveTriggerSprite(battlerId, TRUE); } void DestroyZMoveTriggerSprite(void) diff --git a/src/berry_blender.c b/src/berry_blender.c index f4c3c1677..e4ed5d0bf 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -106,6 +106,13 @@ enum { // Last berry that an NPC can put in #define NUM_NPC_BERRIES ITEM_TO_BERRY(ITEM_ASPEAR_BERRY) +enum { + // Windows 0-3 are used implicitly in several loops over BLENDER_MAX_PLAYERS + // i.e. window 0 is for player 1, window 1 for player 2, etc. + WIN_MSG = BLENDER_MAX_PLAYERS, + WIN_RESULTS, +}; + struct BlenderBerry { u16 itemId; @@ -200,7 +207,7 @@ static void SpriteCB_ScoreSymbolBest(struct Sprite *); static void InitLocalPlayers(u8); static void CB2_LoadBerryBlender(void); static void UpdateBlenderCenter(void); -static bool32 Blender_PrintText(s16 *, const u8 *, s32 ); +static bool32 PrintMessage(s16 *, const u8 *, s32 ); static void StartBlender(void); static void CB2_StartBlenderLink(void); static void CB2_StartBlenderLocal(void); @@ -332,7 +339,7 @@ static const struct BgTemplate sBgTemplates[3] = static const struct WindowTemplate sWindowTemplates[] = { - { + { // Player 1 .bg = 0, .tilemapLeft = 1, .tilemapTop = 6, @@ -341,7 +348,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 14, .baseBlock = 0x28, }, - { + { // Player 2 .bg = 0, .tilemapLeft = 22, .tilemapTop = 6, @@ -350,7 +357,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 14, .baseBlock = 0x36, }, - { + { // Player 3 .bg = 0, .tilemapLeft = 1, .tilemapTop = 12, @@ -359,7 +366,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 14, .baseBlock = 0x44, }, - { + { // Player 4 .bg = 0, .tilemapLeft = 22, .tilemapTop = 12, @@ -368,7 +375,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 14, .baseBlock = 0x52, }, - { + [WIN_MSG] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, @@ -377,7 +384,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 14, .baseBlock = 0x60, }, - { + [WIN_RESULTS] = { .bg = 0, .tilemapLeft = 5, .tilemapTop = 3, @@ -1107,7 +1114,7 @@ static void CB2_LoadBerryBlender(void) sBerryBlender->mainState++; break; case 4: - if (Blender_PrintText(&sBerryBlender->textState, sText_BerryBlenderStart, GetPlayerTextSpeedDelay())) + if (PrintMessage(&sBerryBlender->textState, sText_BerryBlenderStart, GetPlayerTextSpeedDelay())) sBerryBlender->mainState++; break; case 5: @@ -1337,7 +1344,7 @@ static void CB2_StartBlenderLink(void) } break; case 5: - Blender_PrintText(&sBerryBlender->textState, sText_CommunicationStandby, 0); + PrintMessage(&sBerryBlender->textState, sText_CommunicationStandby, 0); sBerryBlender->mainState = 8; sBerryBlender->framesToWait = 0; break; @@ -1363,7 +1370,7 @@ static void CB2_StartBlenderLink(void) if (++sBerryBlender->framesToWait > 20) { // Wait for partners' berries - ClearDialogWindowAndFrameToTransparent(4, TRUE); + ClearDialogWindowAndFrameToTransparent(WIN_MSG, TRUE); if (GetBlockReceivedStatus() == GetLinkPlayerCountAsBitFlags()) { for (i = 0; i < GetLinkPlayerCount(); i++) @@ -2276,9 +2283,9 @@ static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16 *_flavors, j++; } - // If all flavors are 0, or at least 3 were negative/0 + // If all 5 flavors are 0, or if 4-5 flavors were negative, // or if players used the same berry, color is black - if (j == 5 || negativeFlavors > 3) + if (j == FLAVOR_COUNT || negativeFlavors > 3) return PBLOCK_CLR_BLACK; for (i = 0; i < numPlayers; i++) @@ -2664,7 +2671,7 @@ static void CB2_EndBlenderGame(void) } break; case 7: - if (Blender_PrintText(&sBerryBlender->textState, sText_WouldLikeToBlendAnotherBerry, GetPlayerTextSpeedDelay())) + if (PrintMessage(&sBerryBlender->textState, sText_WouldLikeToBlendAnotherBerry, GetPlayerTextSpeedDelay())) sBerryBlender->gameEndState++; break; case 9: @@ -2748,7 +2755,7 @@ static void CB2_EndBlenderGame(void) sBerryBlender->gameEndState++; break; case 13: - if (Blender_PrintText(&sBerryBlender->textState, sText_CommunicationStandby, GetPlayerTextSpeedDelay())) + if (PrintMessage(&sBerryBlender->textState, sText_CommunicationStandby, GetPlayerTextSpeedDelay())) { SetMainCallback2(CB2_CheckPlayAgainLink); sBerryBlender->gameEndState = 0; @@ -2858,7 +2865,7 @@ static void CB2_CheckPlayAgainLink(void) StringAppend(gStringVar4, sText_HasNoBerriesToPut); break; case 3: - if (Blender_PrintText(&sBerryBlender->textState, gStringVar4, GetPlayerTextSpeedDelay())) + if (PrintMessage(&sBerryBlender->textState, gStringVar4, GetPlayerTextSpeedDelay())) { sBerryBlender->framesToWait = 0; sBerryBlender->gameEndState++; @@ -2869,7 +2876,7 @@ static void CB2_CheckPlayAgainLink(void) sBerryBlender->gameEndState = 5; break; case 5: - Blender_PrintText(&sBerryBlender->textState, gText_SavingDontTurnOff2, 0); + PrintMessage(&sBerryBlender->textState, gText_SavingDontTurnOff2, 0); SetLinkStandbyCallback(); sBerryBlender->gameEndState++; break; @@ -2965,7 +2972,7 @@ static void CB2_CheckPlayAgainLocal(void) StringCopy(gStringVar4, sText_RunOutOfBerriesForBlending); break; case 3: - if (Blender_PrintText(&sBerryBlender->textState, gStringVar4, GetPlayerTextSpeedDelay())) + if (PrintMessage(&sBerryBlender->textState, gStringVar4, GetPlayerTextSpeedDelay())) sBerryBlender->gameEndState = 9; break; case 9: @@ -3495,7 +3502,7 @@ static bool8 PrintBlendingResults(void) u8 *txtPtr; xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sText_BlendingResults, 0xA8); - Blender_AddTextPrinter(5, sText_BlendingResults, xPos, 1, TEXT_SKIP_DRAW, 0); + Blender_AddTextPrinter(WIN_RESULTS, sText_BlendingResults, xPos, 1, TEXT_SKIP_DRAW, 0); if (sBerryBlender->numPlayers == BLENDER_MAX_PLAYERS) yPos = 17; @@ -3510,15 +3517,15 @@ static bool8 PrintBlendingResults(void) StringAppend(sBerryBlender->stringVar, sText_Dot); StringAppend(sBerryBlender->stringVar, gText_Space); StringAppend(sBerryBlender->stringVar, gLinkPlayers[place].name); - Blender_AddTextPrinter(5, sBerryBlender->stringVar, 8, yPos, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 8, yPos, TEXT_SKIP_DRAW, 3); StringCopy(sBerryBlender->stringVar, sBerryBlender->blendedBerries[place].name); ConvertInternationalString(sBerryBlender->stringVar, gLinkPlayers[place].language); StringAppend(sBerryBlender->stringVar, sText_SpaceBerry); - Blender_AddTextPrinter(5, sBerryBlender->stringVar, 0x54, yPos, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 0x54, yPos, TEXT_SKIP_DRAW, 3); } - Blender_AddTextPrinter(5, sText_MaximumSpeed, 0, 0x51, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sText_MaximumSpeed, 0, 0x51, TEXT_SKIP_DRAW, 3); ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->maxRPM / 100, STR_CONV_MODE_RIGHT_ALIGN, 3); StringAppend(sBerryBlender->stringVar, sText_Dot); @@ -3527,8 +3534,8 @@ static bool8 PrintBlendingResults(void) StringAppend(sBerryBlender->stringVar, sText_RPM); xPos = GetStringRightAlignXOffset(FONT_NORMAL, sBerryBlender->stringVar, 0xA8); - Blender_AddTextPrinter(5, sBerryBlender->stringVar, xPos, 0x51, TEXT_SKIP_DRAW, 3); - Blender_AddTextPrinter(5, sText_Time, 0, 0x61, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, xPos, 0x51, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sText_Time, 0, 0x61, TEXT_SKIP_DRAW, 3); seconds = (sBerryBlender->gameFrameTime / 60) % 60; minutes = (sBerryBlender->gameFrameTime / (60 * 60)); @@ -3540,12 +3547,12 @@ static bool8 PrintBlendingResults(void) StringAppend(sBerryBlender->stringVar, sText_Sec); xPos = GetStringRightAlignXOffset(FONT_NORMAL, sBerryBlender->stringVar, 0xA8); - Blender_AddTextPrinter(5, sBerryBlender->stringVar, xPos, 0x61, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, xPos, 0x61, TEXT_SKIP_DRAW, 3); sBerryBlender->framesToWait = 0; sBerryBlender->mainState++; - CopyWindowToVram(5, COPYWIN_GFX); + CopyWindowToVram(WIN_RESULTS, COPYWIN_GFX); } break; case 4: @@ -3553,7 +3560,7 @@ static bool8 PrintBlendingResults(void) sBerryBlender->mainState++; break; case 5: - ClearStdWindowAndFrameToTransparent(5, TRUE); + ClearStdWindowAndFrameToTransparent(WIN_RESULTS, TRUE); for (i = 0; i < BLENDER_MAX_PLAYERS; i++) { @@ -3581,7 +3588,7 @@ static bool8 PrintBlendingResults(void) sBerryBlender->mainState++; break; case 6: - if (Blender_PrintText(&sBerryBlender->textState, sBerryBlender->stringVar, GetPlayerTextSpeedDelay())) + if (PrintMessage(&sBerryBlender->textState, sBerryBlender->stringVar, GetPlayerTextSpeedDelay())) { TryUpdateBerryBlenderRecord(); return TRUE; @@ -3692,9 +3699,9 @@ static bool8 PrintBlendingRanking(void) } break; case 3: - DrawStdFrameWithCustomTileAndPalette(5, FALSE, 1, 0xD); + DrawStdFrameWithCustomTileAndPalette(WIN_RESULTS, FALSE, 1, 0xD); xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sText_Ranking, 168); - Blender_AddTextPrinter(5, sText_Ranking, xPos, 1, TEXT_SKIP_DRAW, 0); + Blender_AddTextPrinter(WIN_RESULTS, sText_Ranking, xPos, 1, TEXT_SKIP_DRAW, 0); sBerryBlender->scoreIconIds[SCORE_BEST] = CreateSprite(&sSpriteTemplate_ScoreSymbols, 128, 52, 0); StartSpriteAnim(&gSprites[sBerryBlender->scoreIconIds[SCORE_BEST]], SCOREANIM_BEST_STATIC); @@ -3718,20 +3725,20 @@ static bool8 PrintBlendingRanking(void) StringAppend(sBerryBlender->stringVar, sText_Dot); StringAppend(sBerryBlender->stringVar, gText_Space); StringAppend(sBerryBlender->stringVar, gLinkPlayers[place].name); - Blender_AddTextPrinter(5, sBerryBlender->stringVar, 0, yPos, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 0, yPos, TEXT_SKIP_DRAW, 3); ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_BEST], STR_CONV_MODE_RIGHT_ALIGN, 3); - Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78, yPos, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 78, yPos, TEXT_SKIP_DRAW, 3); ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_GOOD], STR_CONV_MODE_RIGHT_ALIGN, 3); - Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78 + 32, yPos, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 78 + 32, yPos, TEXT_SKIP_DRAW, 3); ConvertIntToDecimalStringN(sBerryBlender->stringVar, sBerryBlender->scores[place][SCORE_MISS], STR_CONV_MODE_RIGHT_ALIGN, 3); - Blender_AddTextPrinter(5, sBerryBlender->stringVar, 78 + 64, yPos, TEXT_SKIP_DRAW, 3); + Blender_AddTextPrinter(WIN_RESULTS, sBerryBlender->stringVar, 78 + 64, yPos, TEXT_SKIP_DRAW, 3); } - PutWindowTilemap(5); - CopyWindowToVram(5, COPYWIN_FULL); + PutWindowTilemap(WIN_RESULTS); + CopyWindowToVram(WIN_RESULTS, COPYWIN_FULL); sBerryBlender->framesToWait = 0; sBerryBlender->mainState++; @@ -3875,26 +3882,24 @@ static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s3 } if (caseId != 3) - { FillWindowPixelBuffer(windowId, PIXEL_FILL(txtColor[0])); - } AddTextPrinterParameterized4(windowId, FONT_NORMAL, x, y, letterSpacing, 1, txtColor, speed, string); } -static bool32 Blender_PrintText(s16 *textState, const u8 *string, s32 textSpeed) +static bool32 PrintMessage(s16 *textState, const u8 *string, s32 textSpeed) { switch (*textState) { case 0: - DrawDialogFrameWithCustomTileAndPalette(4, FALSE, 0x14, 0xF); - Blender_AddTextPrinter(4, string, 0, 1, textSpeed, 0); - PutWindowTilemap(4); - CopyWindowToVram(4, COPYWIN_FULL); + DrawDialogFrameWithCustomTileAndPalette(WIN_MSG, FALSE, 0x14, 0xF); + Blender_AddTextPrinter(WIN_MSG, string, 0, 1, textSpeed, 0); + PutWindowTilemap(WIN_MSG); + CopyWindowToVram(WIN_MSG, COPYWIN_FULL); (*textState)++; break; case 1: - if (!IsTextPrinterActive(4)) + if (!IsTextPrinterActive(WIN_MSG)) { *textState = 0; return TRUE; diff --git a/src/berry_fix_program.c b/src/berry_fix_program.c index e8c4bc7e6..af21bb929 100644 --- a/src/berry_fix_program.c +++ b/src/berry_fix_program.c @@ -14,6 +14,13 @@ #include "m4a.h" #include "constants/rgb.h" +enum { + WIN_TITLE, // "Berry Program Update" header on the first screen + WIN_MSG_BODY, + WIN_GAME_NAMES, // The labels under the GBA graphics on the link screen + WIN_TURN_OFF_TITLE, // "Ruby/Sapphire" at the top of the "turn off the power" screen +}; + struct { u8 state; u8 curScene; @@ -71,7 +78,7 @@ static const struct BgTemplate sBerryFixBgTemplates[] = { }; static const struct WindowTemplate sBerryFixWindowTemplates[] = { - { + [WIN_TITLE] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 4, @@ -80,7 +87,7 @@ static const struct WindowTemplate sBerryFixWindowTemplates[] = { .paletteNum = 15, .baseBlock = 1 }, - { + [WIN_MSG_BODY] = { .bg = 0, .tilemapLeft = 1, .tilemapTop = 11, @@ -89,7 +96,7 @@ static const struct WindowTemplate sBerryFixWindowTemplates[] = { .paletteNum = 15, .baseBlock = 53 }, - { + [WIN_GAME_NAMES] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 8, @@ -98,7 +105,7 @@ static const struct WindowTemplate sBerryFixWindowTemplates[] = { .paletteNum = 15, .baseBlock = 277 }, - { + [WIN_TURN_OFF_TITLE] = { .bg = 0, .tilemapLeft = 8, .tilemapTop = 0, @@ -217,11 +224,11 @@ static void BerryFix_Main(void) sBerryFix->state = MAINSTATE_BEGIN; break; case MAINSTATE_BEGIN: - if (TryScene(SCENE_BEGIN) && (JOY_NEW(A_BUTTON))) + if (TryScene(SCENE_BEGIN) && JOY_NEW(A_BUTTON)) sBerryFix->state = MAINSTATE_CONNECT; break; case MAINSTATE_CONNECT: - if (TryScene(SCENE_ENSURE_CONNECT) && (JOY_NEW(A_BUTTON))) + if (TryScene(SCENE_ENSURE_CONNECT) && JOY_NEW(A_BUTTON)) sBerryFix->state = MAINSTATE_INIT_MULTIBOOT; break; case MAINSTATE_INIT_MULTIBOOT: @@ -299,29 +306,29 @@ static void BerryFix_GpuSet(void) DmaCopy32(3, sBerryFixPalColors, BG_PLTT + 0x1E0, sizeof(sBerryFixPalColors)); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP); - FillWindowPixelBuffer(2, PIXEL_FILL(0)); - FillWindowPixelBuffer(3, PIXEL_FILL(0)); - FillWindowPixelBuffer(0, PIXEL_FILL(10)); + FillWindowPixelBuffer(WIN_GAME_NAMES, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_TURN_OFF_TITLE, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_TITLE, PIXEL_FILL(10)); width = GetStringWidth(FONT_SMALL, sText_Emerald, 0); left = (120 - width) / 2; - AddTextPrinterParameterized3(2, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_Emerald); + AddTextPrinterParameterized3(WIN_GAME_NAMES, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_Emerald); width = GetStringWidth(FONT_SMALL, sText_RubySapphire, 0); left = (120 - width) / 2 + 120; - AddTextPrinterParameterized3(2, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire); + AddTextPrinterParameterized3(WIN_GAME_NAMES, FONT_SMALL, left, 3, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire); width = GetStringWidth(FONT_SMALL, sText_RubySapphire, 0); left = (112 - width) / 2; - AddTextPrinterParameterized3(3, FONT_SMALL, left, 0, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire); + AddTextPrinterParameterized3(WIN_TURN_OFF_TITLE, FONT_SMALL, left, 0, sGameTitleTextColors, TEXT_SKIP_DRAW, sText_RubySapphire); width = GetStringWidth(FONT_NORMAL, sText_BerryProgramUpdate, 0); left = (208 - width) / 2; - AddTextPrinterParameterized3(0, FONT_NORMAL, left, 2, sBerryProgramTextColors, TEXT_SKIP_DRAW, sText_BerryProgramUpdate); + AddTextPrinterParameterized3(WIN_TITLE, FONT_NORMAL, left, 2, sBerryProgramTextColors, TEXT_SKIP_DRAW, sText_BerryProgramUpdate); - CopyWindowToVram(2, COPYWIN_GFX); - CopyWindowToVram(3, COPYWIN_GFX); - CopyWindowToVram(0, COPYWIN_GFX); + CopyWindowToVram(WIN_GAME_NAMES, COPYWIN_GFX); + CopyWindowToVram(WIN_TURN_OFF_TITLE, COPYWIN_GFX); + CopyWindowToVram(WIN_TITLE, COPYWIN_GFX); } static int BerryFix_TrySetScene(int scene) @@ -345,23 +352,23 @@ static int BerryFix_TrySetScene(int scene) static void BerryFix_SetScene(int scene) { FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); - FillWindowPixelBuffer(1, PIXEL_FILL(10)); - AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 0, sBerryProgramTextColors, TEXT_SKIP_DRAW, sBerryProgramTexts[scene]); - PutWindowTilemap(1); - CopyWindowToVram(1, COPYWIN_GFX); + FillWindowPixelBuffer(WIN_MSG_BODY, PIXEL_FILL(10)); + AddTextPrinterParameterized3(WIN_MSG_BODY, FONT_NORMAL, 0, 0, sBerryProgramTextColors, TEXT_SKIP_DRAW, sBerryProgramTexts[scene]); + PutWindowTilemap(WIN_MSG_BODY); + CopyWindowToVram(WIN_MSG_BODY, COPYWIN_GFX); switch (scene) { case SCENE_ENSURE_CONNECT: case SCENE_TRANSMITTING: case SCENE_FOLLOW_INSTRUCT: case SCENE_TRANSMIT_FAILED: - PutWindowTilemap(2); + PutWindowTilemap(WIN_GAME_NAMES); break; case SCENE_TURN_OFF_POWER: - PutWindowTilemap(3); + PutWindowTilemap(WIN_TURN_OFF_TITLE); break; case SCENE_BEGIN: - PutWindowTilemap(0); + PutWindowTilemap(WIN_TITLE); break; } CopyBgTilemapBufferToVram(0); diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 862a466e0..5c8af3378 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -102,7 +102,7 @@ static const u8 sTextColors[2][3] = static const struct WindowTemplate sWindowTemplates[] = { - { // WIN_BERRY_NAME + [WIN_BERRY_NAME] = { .bg = 1, .tilemapLeft = 11, .tilemapTop = 4, @@ -111,7 +111,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 15, .baseBlock = 69, }, - { // WIN_SIZE_FIRM + [WIN_SIZE_FIRM] = { .bg = 1, .tilemapLeft = 11, .tilemapTop = 7, @@ -120,7 +120,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 15, .baseBlock = 85, }, - { // WIN_DESC + [WIN_DESC] = { .bg = 1, .tilemapLeft = 4, .tilemapTop = 14, @@ -129,7 +129,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 15, .baseBlock = 157, }, - { // WIN_BERRY_TAG + [WIN_BERRY_TAG] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 0, @@ -599,7 +599,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) switch (data[0]) { case 0x30: - FillWindowPixelBuffer(0, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_BERRY_NAME, PIXEL_FILL(0)); break; case 0x40: PrintBerryNumberAndName(); @@ -609,7 +609,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) CreateBerrySprite(); break; case 0x60: - FillWindowPixelBuffer(1, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_SIZE_FIRM, PIXEL_FILL(0)); break; case 0x70: PrintBerrySize(); @@ -621,7 +621,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) SetFlavorCirclesVisiblity(); break; case 0xA0: - FillWindowPixelBuffer(2, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_DESC, PIXEL_FILL(0)); break; case 0xB0: PrintBerryDescription1(); @@ -636,7 +636,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) switch (data[0]) { case 0x30: - FillWindowPixelBuffer(2, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_DESC, PIXEL_FILL(0)); break; case 0x40: PrintBerryDescription2(); @@ -648,7 +648,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) SetFlavorCirclesVisiblity(); break; case 0x70: - FillWindowPixelBuffer(1, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_SIZE_FIRM, PIXEL_FILL(0)); break; case 0x80: PrintBerryFirmness(); @@ -661,7 +661,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) CreateBerrySprite(); break; case 0xB0: - FillWindowPixelBuffer(0, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_BERRY_NAME, PIXEL_FILL(0)); break; case 0xC0: PrintBerryNumberAndName(); diff --git a/src/contest.c b/src/contest.c index 6771f47d6..047f13526 100644 --- a/src/contest.c +++ b/src/contest.c @@ -5456,7 +5456,7 @@ static void Contest_StartTextPrinter(const u8 *currChar, bool32 b) u8 speed; printerTemplate.currentChar = currChar; - printerTemplate.windowId = 4; + printerTemplate.windowId = WIN_GENERAL_TEXT; printerTemplate.fontId = FONT_NORMAL; printerTemplate.x = 0; printerTemplate.y = 1; @@ -5482,7 +5482,7 @@ static void Contest_StartTextPrinter(const u8 *currChar, bool32 b) AddTextPrinter(&printerTemplate, speed, 0); } - PutWindowTilemap(4); + PutWindowTilemap(WIN_GENERAL_TEXT); Contest_SetBgCopyFlags(0); } diff --git a/src/contest_util.c b/src/contest_util.c index 07bced414..53a81dea0 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -319,9 +319,10 @@ static const struct BgTemplate sBgTemplates[] = } }; -static const struct WindowTemplate sWindowTemplates[] = +// Window IDs are implicitly shared with contestant IDs in LoadContestMonName +static const struct WindowTemplate sWindowTemplates[CONTESTANT_COUNT + 1] = { - { + { // Contestant 1 .bg = 1, .tilemapLeft = 7, .tilemapTop = 4, @@ -330,7 +331,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 15, .baseBlock = 770 }, - { + { // Contestant 2 .bg = 1, .tilemapLeft = 7, .tilemapTop = 7, @@ -339,7 +340,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 15, .baseBlock = 794 }, - { + { // Contestant 3 .bg = 1, .tilemapLeft = 7, .tilemapTop = 10, @@ -348,7 +349,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 15, .baseBlock = 818 }, - { + { // Contestant 4 .bg = 1, .tilemapLeft = 7, .tilemapTop = 13, @@ -357,7 +358,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 15, .baseBlock = 842 }, - DUMMY_WIN_TEMPLATE, + DUMMY_WIN_TEMPLATE }; static const struct OamData sOamData_WirelessIndicatorWindow = diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index 5be53fe66..b1f158310 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1937,7 +1937,7 @@ const struct BattleAnimBackground gBattleAnimBackgroundTable[] = [BG_MAGMA_STORM] = {gBattleAnimBgImage_InAir, gBattleAnimBgPalette_MagmaStorm, gBattleAnimBgTilemap_InAir}, [BG_GIGA_IMPACT_OPPONENT] = {gBattleAnimBgImage_GigaImpact, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_GigaImpactOpponent}, [BG_GIGA_IMPACT_PLAYER] = {gBattleAnimBgImage_GigaImpact, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_GigaImpactPlayer}, - [BG_GIGA_IMPACT_CONTEST] = {gBattleAnimBgImage_GigaImpact, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_GigaImpactContest}, + [BG_GIGA_IMPACT_CONTEST] = {gBattleAnimBgImage_GigaImpactContest, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_GigaImpactContest}, [BG_TRICK_ROOM] = {gBattleAnimBgImage_TrickRoom, gBattleAnimBgPalette_TrickRoom, gBattleAnimBgTilemap_TrickRoom}, [BG_ROCK_WRECKER] = {gBattleAnimBgImage_Hurricane, gBattleAnimBgPalette_RockWrecker, gBattleAnimBgTilemap_Hurricane}, [BG_SPACIAL_REND_ON_OPPONENT] = {gBattleAnimBgImage_SpacialRend, gBattleAnimBgPalette_SpacialRend, gBattleAnimBgTilemap_GigaImpactOpponent}, diff --git a/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h b/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h index f87c1bfc4..c82b777c6 100644 --- a/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h +++ b/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h @@ -1038,7 +1038,7 @@ static const struct PyramidWildMon sOpenLevelWildMons_Round20[] = } }; -static const struct PyramidWildMon *const sOpenLevelWildMonPointers[TOTAL_ROUNDS] = +static const struct PyramidWildMon *const sOpenLevelWildMonPointers[TOTAL_PYRAMID_ROUNDS] = { sOpenLevelWildMons_Round1, sOpenLevelWildMons_Round2, diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 552b0a28d..cc4e322f2 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -4847,7 +4847,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_NATURE_POWER] = { .effect = EFFECT_NATURE_POWER, - .power = 0, + .power = 1, .type = TYPE_NORMAL, .accuracy = 0, .pp = 20, @@ -6073,10 +6073,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_8 .flags = FLAG_SNATCH_AFFECTED | FLAG_SOUND, + .effect = EFFECT_ATTACK_UP_USER_ALLY, #else .flags = FLAG_SNATCH_AFFECTED, + .effect = EFFECT_ATTACK_UP, #endif - .effect = EFFECT_ATTACK_UP, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, @@ -6832,7 +6833,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, + .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_STATUS, .zMovePower = 0, @@ -8914,7 +8915,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .type = TYPE_NORMAL, .accuracy = 100, .pp = 15, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, @@ -11554,7 +11555,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, + .target = MOVE_TARGET_BOTH, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, @@ -11612,7 +11613,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SHELL_TRAP] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_SHELL_TRAP, + .effect = EFFECT_SHELL_TRAP, .power = 150, .type = TYPE_FIRE, .accuracy = 100, @@ -13293,7 +13294,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .effect = EFFECT_DEFENSE_UP_HIT, .power = 70, .type = TYPE_PSYCHIC, - .accuracy = 100, + .accuracy = 90, .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, diff --git a/src/data/contest_opponents.h b/src/data/contest_opponents.h index fb2ff5986..10fff6134 100644 --- a/src/data/contest_opponents.h +++ b/src/data/contest_opponents.h @@ -2,102 +2,104 @@ #include "global.h" #include "contest.h" -#define CONTEST_OPPONENT_JIMMY 0 -#define CONTEST_OPPONENT_EDITH 1 -#define CONTEST_OPPONENT_EVAN 2 -#define CONTEST_OPPONENT_KELSEY 3 -#define CONTEST_OPPONENT_MADISON 4 -#define CONTEST_OPPONENT_RAYMOND 5 -#define CONTEST_OPPONENT_GRANT 6 -#define CONTEST_OPPONENT_PAIGE 7 -#define CONTEST_OPPONENT_ALEC 8 -#define CONTEST_OPPONENT_SYDNEY 9 -#define CONTEST_OPPONENT_MORRIS 10 -#define CONTEST_OPPONENT_MARIAH 11 -#define CONTEST_OPPONENT_RUSSELL 12 -#define CONTEST_OPPONENT_MELANIE 13 -#define CONTEST_OPPONENT_CHANCE 14 -#define CONTEST_OPPONENT_AGATHA 15 -#define CONTEST_OPPONENT_BEAU 16 -#define CONTEST_OPPONENT_KAY 17 -#define CONTEST_OPPONENT_CALE 18 -#define CONTEST_OPPONENT_CAITLIN 19 -#define CONTEST_OPPONENT_COLBY 20 -#define CONTEST_OPPONENT_KYLIE 21 -#define CONTEST_OPPONENT_LIAM 22 -#define CONTEST_OPPONENT_MILO 23 -#define CONTEST_OPPONENT_KARINA 24 -#define CONTEST_OPPONENT_BOBBY 25 -#define CONTEST_OPPONENT_CLAIRE 26 -#define CONTEST_OPPONENT_WILLIE 27 -#define CONTEST_OPPONENT_CASSIDY 28 -#define CONTEST_OPPONENT_MORGAN 29 -#define CONTEST_OPPONENT_SUMMER 30 -#define CONTEST_OPPONENT_MILES 31 -#define CONTEST_OPPONENT_AUDREY 32 -#define CONTEST_OPPONENT_AVERY 33 -#define CONTEST_OPPONENT_ARIANA 34 -#define CONTEST_OPPONENT_ASHTON 35 -#define CONTEST_OPPONENT_SANDRA 36 -#define CONTEST_OPPONENT_CARSON 37 -#define CONTEST_OPPONENT_KATRINA 38 -#define CONTEST_OPPONENT_LUKE 39 -#define CONTEST_OPPONENT_RAUL 40 -#define CONTEST_OPPONENT_JADA 41 -#define CONTEST_OPPONENT_ZEEK 42 -#define CONTEST_OPPONENT_DIEGO 43 -#define CONTEST_OPPONENT_ALIYAH 44 -#define CONTEST_OPPONENT_NATALIA 45 -#define CONTEST_OPPONENT_DEVIN 46 -#define CONTEST_OPPONENT_TYLOR 47 -#define CONTEST_OPPONENT_RONNIE 48 -#define CONTEST_OPPONENT_CLAUDIA 49 -#define CONTEST_OPPONENT_ELIAS 50 -#define CONTEST_OPPONENT_JADE 51 -#define CONTEST_OPPONENT_FRANCIS 52 -#define CONTEST_OPPONENT_ALISHA 53 -#define CONTEST_OPPONENT_SAUL 54 -#define CONTEST_OPPONENT_FELICIA 55 -#define CONTEST_OPPONENT_EMILIO 56 -#define CONTEST_OPPONENT_KARLA 57 -#define CONTEST_OPPONENT_DARRYL 58 -#define CONTEST_OPPONENT_SELENA 59 -#define CONTEST_OPPONENT_NOEL 60 -#define CONTEST_OPPONENT_LACEY 61 -#define CONTEST_OPPONENT_CORBIN 62 -#define CONTEST_OPPONENT_GRACIE 63 -#define CONTEST_OPPONENT_COLTIN 64 -#define CONTEST_OPPONENT_ELLIE 65 -#define CONTEST_OPPONENT_MARCUS 66 -#define CONTEST_OPPONENT_KIARA 67 -#define CONTEST_OPPONENT_BRYCE 68 -#define CONTEST_OPPONENT_JAMIE 69 -#define CONTEST_OPPONENT_JORGE 70 -#define CONTEST_OPPONENT_DEVON 71 -#define CONTEST_OPPONENT_JUSTINA 72 -#define CONTEST_OPPONENT_RALPH 73 -#define CONTEST_OPPONENT_ROSA 74 -#define CONTEST_OPPONENT_KEATON 75 -#define CONTEST_OPPONENT_MAYRA 76 -#define CONTEST_OPPONENT_LAMAR 77 -#define CONTEST_OPPONENT_AUBREY 78 -#define CONTEST_OPPONENT_NIGEL 79 -#define CONTEST_OPPONENT_CAMILLE 80 -#define CONTEST_OPPONENT_DEON 81 -#define CONTEST_OPPONENT_JANELLE 82 -#define CONTEST_OPPONENT_HEATH 83 -#define CONTEST_OPPONENT_SASHA 84 -#define CONTEST_OPPONENT_FRANKIE 85 -#define CONTEST_OPPONENT_HELEN 86 -#define CONTEST_OPPONENT_CAMILE 87 -#define CONTEST_OPPONENT_MARTIN 88 -#define CONTEST_OPPONENT_SERGIO 89 -#define CONTEST_OPPONENT_KAILEY 90 -#define CONTEST_OPPONENT_PERLA 91 -#define CONTEST_OPPONENT_CLARA 92 -#define CONTEST_OPPONENT_JAKOB 93 -#define CONTEST_OPPONENT_TREY 94 -#define CONTEST_OPPONENT_LANE 95 +enum { + CONTEST_OPPONENT_JIMMY, + CONTEST_OPPONENT_EDITH, + CONTEST_OPPONENT_EVAN, + CONTEST_OPPONENT_KELSEY, + CONTEST_OPPONENT_MADISON, + CONTEST_OPPONENT_RAYMOND, + CONTEST_OPPONENT_GRANT, + CONTEST_OPPONENT_PAIGE, + CONTEST_OPPONENT_ALEC, + CONTEST_OPPONENT_SYDNEY, + CONTEST_OPPONENT_MORRIS, + CONTEST_OPPONENT_MARIAH, + CONTEST_OPPONENT_RUSSELL, + CONTEST_OPPONENT_MELANIE, + CONTEST_OPPONENT_CHANCE, + CONTEST_OPPONENT_AGATHA, + CONTEST_OPPONENT_BEAU, + CONTEST_OPPONENT_KAY, + CONTEST_OPPONENT_CALE, + CONTEST_OPPONENT_CAITLIN, + CONTEST_OPPONENT_COLBY, + CONTEST_OPPONENT_KYLIE, + CONTEST_OPPONENT_LIAM, + CONTEST_OPPONENT_MILO, + CONTEST_OPPONENT_KARINA, + CONTEST_OPPONENT_BOBBY, + CONTEST_OPPONENT_CLAIRE, + CONTEST_OPPONENT_WILLIE, + CONTEST_OPPONENT_CASSIDY, + CONTEST_OPPONENT_MORGAN, + CONTEST_OPPONENT_SUMMER, + CONTEST_OPPONENT_MILES, + CONTEST_OPPONENT_AUDREY, + CONTEST_OPPONENT_AVERY, + CONTEST_OPPONENT_ARIANA, + CONTEST_OPPONENT_ASHTON, + CONTEST_OPPONENT_SANDRA, + CONTEST_OPPONENT_CARSON, + CONTEST_OPPONENT_KATRINA, + CONTEST_OPPONENT_LUKE, + CONTEST_OPPONENT_RAUL, + CONTEST_OPPONENT_JADA, + CONTEST_OPPONENT_ZEEK, + CONTEST_OPPONENT_DIEGO, + CONTEST_OPPONENT_ALIYAH, + CONTEST_OPPONENT_NATALIA, + CONTEST_OPPONENT_DEVIN, + CONTEST_OPPONENT_TYLOR, + CONTEST_OPPONENT_RONNIE, + CONTEST_OPPONENT_CLAUDIA, + CONTEST_OPPONENT_ELIAS, + CONTEST_OPPONENT_JADE, + CONTEST_OPPONENT_FRANCIS, + CONTEST_OPPONENT_ALISHA, + CONTEST_OPPONENT_SAUL, + CONTEST_OPPONENT_FELICIA, + CONTEST_OPPONENT_EMILIO, + CONTEST_OPPONENT_KARLA, + CONTEST_OPPONENT_DARRYL, + CONTEST_OPPONENT_SELENA, + CONTEST_OPPONENT_NOEL, + CONTEST_OPPONENT_LACEY, + CONTEST_OPPONENT_CORBIN, + CONTEST_OPPONENT_GRACIE, + CONTEST_OPPONENT_COLTIN, + CONTEST_OPPONENT_ELLIE, + CONTEST_OPPONENT_MARCUS, + CONTEST_OPPONENT_KIARA, + CONTEST_OPPONENT_BRYCE, + CONTEST_OPPONENT_JAMIE, + CONTEST_OPPONENT_JORGE, + CONTEST_OPPONENT_DEVON, + CONTEST_OPPONENT_JUSTINA, + CONTEST_OPPONENT_RALPH, + CONTEST_OPPONENT_ROSA, + CONTEST_OPPONENT_KEATON, + CONTEST_OPPONENT_MAYRA, + CONTEST_OPPONENT_LAMAR, + CONTEST_OPPONENT_AUBREY, + CONTEST_OPPONENT_NIGEL, + CONTEST_OPPONENT_CAMILLE, + CONTEST_OPPONENT_DEON, + CONTEST_OPPONENT_JANELLE, + CONTEST_OPPONENT_HEATH, + CONTEST_OPPONENT_SASHA, + CONTEST_OPPONENT_FRANKIE, + CONTEST_OPPONENT_HELEN, + CONTEST_OPPONENT_CAMILE, + CONTEST_OPPONENT_MARTIN, + CONTEST_OPPONENT_SERGIO, + CONTEST_OPPONENT_KAILEY, + CONTEST_OPPONENT_PERLA, + CONTEST_OPPONENT_CLARA, + CONTEST_OPPONENT_JAKOB, + CONTEST_OPPONENT_TREY, + CONTEST_OPPONENT_LANE +}; // All contest opponents have a common set of AI flags (which contains all of the actually // useful AI scripts, as well as some dummys) and a random combination of 2-3 dummy flags. diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h index 385460228..1d6704416 100644 --- a/src/data/graphics/pokemon.h +++ b/src/data/graphics/pokemon.h @@ -800,9 +800,9 @@ const u32 gMonFrontPic_Mimikyu[] = INCBIN_U32("graphics/pokemon/mimikyu/front.4b const u32 gMonFrontPic_Bruxish[] = INCBIN_U32("graphics/pokemon/bruxish/front.4bpp.lz"); const u32 gMonFrontPic_Drampa[] = INCBIN_U32("graphics/pokemon/drampa/front.4bpp.lz"); const u32 gMonFrontPic_Dhelmise[] = INCBIN_U32("graphics/pokemon/dhelmise/front.4bpp.lz"); -const u32 gMonFrontPic_Jangmoo[] = INCBIN_U32("graphics/pokemon/jangmo_o/front.4bpp.lz"); -const u32 gMonFrontPic_Hakamoo[] = INCBIN_U32("graphics/pokemon/hakamo_o/front.4bpp.lz"); -const u32 gMonFrontPic_Kommoo[] = INCBIN_U32("graphics/pokemon/kommo_o/front.4bpp.lz"); +const u32 gMonFrontPic_JangmoO[] = INCBIN_U32("graphics/pokemon/jangmo_o/front.4bpp.lz"); +const u32 gMonFrontPic_HakamoO[] = INCBIN_U32("graphics/pokemon/hakamo_o/front.4bpp.lz"); +const u32 gMonFrontPic_KommoO[] = INCBIN_U32("graphics/pokemon/kommo_o/front.4bpp.lz"); const u32 gMonFrontPic_TapuKoko[] = INCBIN_U32("graphics/pokemon/tapu_koko/anim_front.4bpp.lz"); const u32 gMonFrontPic_TapuLele[] = INCBIN_U32("graphics/pokemon/tapu_lele/anim_front.4bpp.lz"); const u32 gMonFrontPic_TapuBulu[] = INCBIN_U32("graphics/pokemon/tapu_bulu/anim_front.4bpp.lz"); @@ -2012,9 +2012,9 @@ const u32 gMonBackPic_Mimikyu[] = INCBIN_U32("graphics/pokemon/mimikyu/back.4bpp const u32 gMonBackPic_Bruxish[] = INCBIN_U32("graphics/pokemon/bruxish/back.4bpp.lz"); const u32 gMonBackPic_Drampa[] = INCBIN_U32("graphics/pokemon/drampa/back.4bpp.lz"); const u32 gMonBackPic_Dhelmise[] = INCBIN_U32("graphics/pokemon/dhelmise/back.4bpp.lz"); -const u32 gMonBackPic_Jangmoo[] = INCBIN_U32("graphics/pokemon/jangmo_o/back.4bpp.lz"); -const u32 gMonBackPic_Hakamoo[] = INCBIN_U32("graphics/pokemon/hakamo_o/back.4bpp.lz"); -const u32 gMonBackPic_Kommoo[] = INCBIN_U32("graphics/pokemon/kommo_o/back.4bpp.lz"); +const u32 gMonBackPic_JangmoO[] = INCBIN_U32("graphics/pokemon/jangmo_o/back.4bpp.lz"); +const u32 gMonBackPic_HakamoO[] = INCBIN_U32("graphics/pokemon/hakamo_o/back.4bpp.lz"); +const u32 gMonBackPic_KommoO[] = INCBIN_U32("graphics/pokemon/kommo_o/back.4bpp.lz"); const u32 gMonBackPic_TapuKoko[] = INCBIN_U32("graphics/pokemon/tapu_koko/back.4bpp.lz"); const u32 gMonBackPic_TapuLele[] = INCBIN_U32("graphics/pokemon/tapu_lele/back.4bpp.lz"); const u32 gMonBackPic_TapuBulu[] = INCBIN_U32("graphics/pokemon/tapu_bulu/back.4bpp.lz"); @@ -3218,9 +3218,9 @@ const u32 gMonPalette_Mimikyu[] = INCBIN_U32("graphics/pokemon/mimikyu/normal.gb const u32 gMonPalette_Bruxish[] = INCBIN_U32("graphics/pokemon/bruxish/normal.gbapal.lz"); const u32 gMonPalette_Drampa[] = INCBIN_U32("graphics/pokemon/drampa/normal.gbapal.lz"); const u32 gMonPalette_Dhelmise[] = INCBIN_U32("graphics/pokemon/dhelmise/normal.gbapal.lz"); -const u32 gMonPalette_Jangmoo[] = INCBIN_U32("graphics/pokemon/jangmo_o/normal.gbapal.lz"); -const u32 gMonPalette_Hakamoo[] = INCBIN_U32("graphics/pokemon/hakamo_o/normal.gbapal.lz"); -const u32 gMonPalette_Kommoo[] = INCBIN_U32("graphics/pokemon/kommo_o/normal.gbapal.lz"); +const u32 gMonPalette_JangmoO[] = INCBIN_U32("graphics/pokemon/jangmo_o/normal.gbapal.lz"); +const u32 gMonPalette_HakamoO[] = INCBIN_U32("graphics/pokemon/hakamo_o/normal.gbapal.lz"); +const u32 gMonPalette_KommoO[] = INCBIN_U32("graphics/pokemon/kommo_o/normal.gbapal.lz"); const u32 gMonPalette_TapuKoko[] = INCBIN_U32("graphics/pokemon/tapu_koko/normal.gbapal.lz"); const u32 gMonPalette_TapuLele[] = INCBIN_U32("graphics/pokemon/tapu_lele/normal.gbapal.lz"); const u32 gMonPalette_TapuBulu[] = INCBIN_U32("graphics/pokemon/tapu_bulu/normal.gbapal.lz"); @@ -4451,9 +4451,9 @@ const u32 gMonShinyPalette_Mimikyu[] = INCBIN_U32("graphics/pokemon/mimikyu/shin const u32 gMonShinyPalette_Bruxish[] = INCBIN_U32("graphics/pokemon/bruxish/shiny.gbapal.lz"); const u32 gMonShinyPalette_Drampa[] = INCBIN_U32("graphics/pokemon/drampa/shiny.gbapal.lz"); const u32 gMonShinyPalette_Dhelmise[] = INCBIN_U32("graphics/pokemon/dhelmise/shiny.gbapal.lz"); -const u32 gMonShinyPalette_Jangmoo[] = INCBIN_U32("graphics/pokemon/jangmo_o/shiny.gbapal.lz"); -const u32 gMonShinyPalette_Hakamoo[] = INCBIN_U32("graphics/pokemon/hakamo_o/shiny.gbapal.lz"); -const u32 gMonShinyPalette_Kommoo[] = INCBIN_U32("graphics/pokemon/kommo_o/shiny.gbapal.lz"); +const u32 gMonShinyPalette_JangmoO[] = INCBIN_U32("graphics/pokemon/jangmo_o/shiny.gbapal.lz"); +const u32 gMonShinyPalette_HakamoO[] = INCBIN_U32("graphics/pokemon/hakamo_o/shiny.gbapal.lz"); +const u32 gMonShinyPalette_KommoO[] = INCBIN_U32("graphics/pokemon/kommo_o/shiny.gbapal.lz"); const u32 gMonShinyPalette_TapuKoko[] = INCBIN_U32("graphics/pokemon/tapu_koko/shiny.gbapal.lz"); const u32 gMonShinyPalette_TapuLele[] = INCBIN_U32("graphics/pokemon/tapu_lele/shiny.gbapal.lz"); const u32 gMonShinyPalette_TapuBulu[] = INCBIN_U32("graphics/pokemon/tapu_bulu/shiny.gbapal.lz"); @@ -5678,9 +5678,9 @@ const u8 gMonIcon_Mimikyu[] = INCBIN_U8("graphics/pokemon/mimikyu/icon.4bpp"); const u8 gMonIcon_Bruxish[] = INCBIN_U8("graphics/pokemon/bruxish/icon.4bpp"); const u8 gMonIcon_Drampa[] = INCBIN_U8("graphics/pokemon/drampa/icon.4bpp"); const u8 gMonIcon_Dhelmise[] = INCBIN_U8("graphics/pokemon/dhelmise/icon.4bpp"); -const u8 gMonIcon_Jangmoo[] = INCBIN_U8("graphics/pokemon/jangmo_o/icon.4bpp"); -const u8 gMonIcon_Hakamoo[] = INCBIN_U8("graphics/pokemon/hakamo_o/icon.4bpp"); -const u8 gMonIcon_Kommoo[] = INCBIN_U8("graphics/pokemon/kommo_o/icon.4bpp"); +const u8 gMonIcon_JangmoO[] = INCBIN_U8("graphics/pokemon/jangmo_o/icon.4bpp"); +const u8 gMonIcon_HakamoO[] = INCBIN_U8("graphics/pokemon/hakamo_o/icon.4bpp"); +const u8 gMonIcon_KommoO[] = INCBIN_U8("graphics/pokemon/kommo_o/icon.4bpp"); const u8 gMonIcon_TapuKoko[] = INCBIN_U8("graphics/pokemon/tapu_koko/icon.4bpp"); const u8 gMonIcon_TapuLele[] = INCBIN_U8("graphics/pokemon/tapu_lele/icon.4bpp"); const u8 gMonIcon_TapuBulu[] = INCBIN_U8("graphics/pokemon/tapu_bulu/icon.4bpp"); @@ -6891,9 +6891,9 @@ const u8 gMonFootprint_Mimikyu[] = INCBIN_U8("graphics/pokemon/mimikyu/footprint const u8 gMonFootprint_Bruxish[] = INCBIN_U8("graphics/pokemon/bruxish/footprint.1bpp"); const u8 gMonFootprint_Drampa[] = INCBIN_U8("graphics/pokemon/drampa/footprint.1bpp"); const u8 gMonFootprint_Dhelmise[] = INCBIN_U8("graphics/pokemon/dhelmise/footprint.1bpp"); -const u8 gMonFootprint_Jangmo_o[] = INCBIN_U8("graphics/pokemon/jangmo_o/footprint.1bpp"); -const u8 gMonFootprint_Hakamo_o[] = INCBIN_U8("graphics/pokemon/hakamo_o/footprint.1bpp"); -const u8 gMonFootprint_Kommo_o[] = INCBIN_U8("graphics/pokemon/kommo_o/footprint.1bpp"); +const u8 gMonFootprint_JangmoO[] = INCBIN_U8("graphics/pokemon/jangmo_o/footprint.1bpp"); +const u8 gMonFootprint_HakamoO[] = INCBIN_U8("graphics/pokemon/hakamo_o/footprint.1bpp"); +const u8 gMonFootprint_KommoO[] = INCBIN_U8("graphics/pokemon/kommo_o/footprint.1bpp"); const u8 gMonFootprint_Tapu_Koko[] = INCBIN_U8("graphics/pokemon/tapu_koko/footprint.1bpp"); const u8 gMonFootprint_Tapu_Lele[] = INCBIN_U8("graphics/pokemon/tapu_lele/footprint.1bpp"); const u8 gMonFootprint_Tapu_Bulu[] = INCBIN_U8("graphics/pokemon/tapu_bulu/footprint.1bpp"); diff --git a/src/data/party_menu.h b/src/data/party_menu.h index 663e6f2c0..4a06fa135 100644 --- a/src/data/party_menu.h +++ b/src/data/party_menu.h @@ -122,7 +122,7 @@ static const u8 sFontColorTable[][3] = static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] = { - { + { // Party mon 1 .bg = 0, .tilemapLeft = 1, .tilemapTop = 3, @@ -131,7 +131,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] = .paletteNum = 3, .baseBlock = 0x63, }, - { + { // Party mon 2 .bg = 0, .tilemapLeft = 12, .tilemapTop = 1, @@ -140,7 +140,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] = .paletteNum = 4, .baseBlock = 0xA9, }, - { + { // Party mon 3 .bg = 0, .tilemapLeft = 12, .tilemapTop = 4, @@ -149,7 +149,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] = .paletteNum = 5, .baseBlock = 0xDF, }, - { + { // Party mon 4 .bg = 0, .tilemapLeft = 12, .tilemapTop = 7, @@ -158,7 +158,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] = .paletteNum = 6, .baseBlock = 0x115, }, - { + { // Party mon 5 .bg = 0, .tilemapLeft = 12, .tilemapTop = 10, @@ -167,7 +167,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] = .paletteNum = 7, .baseBlock = 0x14B, }, - { + { // Party mon 6 .bg = 0, .tilemapLeft = 12, .tilemapTop = 13, @@ -176,7 +176,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] = .paletteNum = 8, .baseBlock = 0x181, }, - { + [WIN_MSG] = { .bg = 2, .tilemapLeft = 1, .tilemapTop = 15, @@ -190,7 +190,7 @@ static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] = static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] = { - { + { // Party mon 1 .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, @@ -199,7 +199,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] = .paletteNum = 3, .baseBlock = 0x63, }, - { + { // Party mon 2 .bg = 0, .tilemapLeft = 1, .tilemapTop = 8, @@ -208,7 +208,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] = .paletteNum = 4, .baseBlock = 0xA9, }, - { + { // Party mon 3 .bg = 0, .tilemapLeft = 12, .tilemapTop = 1, @@ -217,7 +217,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] = .paletteNum = 5, .baseBlock = 0xEF, }, - { + { // Party mon 4 .bg = 0, .tilemapLeft = 12, .tilemapTop = 5, @@ -226,7 +226,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] = .paletteNum = 6, .baseBlock = 0x125, }, - { + { // Party mon 5 .bg = 0, .tilemapLeft = 12, .tilemapTop = 9, @@ -235,7 +235,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] = .paletteNum = 7, .baseBlock = 0x15B, }, - { + { // Party mon 6 .bg = 0, .tilemapLeft = 12, .tilemapTop = 13, @@ -244,7 +244,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] = .paletteNum = 8, .baseBlock = 0x191, }, - { + [WIN_MSG] = { .bg = 2, .tilemapLeft = 1, .tilemapTop = 15, @@ -258,7 +258,7 @@ static const struct WindowTemplate sDoublePartyMenuWindowTemplate[] = static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] = { - { + { // Party mon 1 .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, @@ -267,7 +267,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] = .paletteNum = 3, .baseBlock = 0x63, }, - { + { // Party mon 2 .bg = 0, .tilemapLeft = 1, .tilemapTop = 8, @@ -276,7 +276,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] = .paletteNum = 4, .baseBlock = 0xA9, }, - { + { // Party mon 3 .bg = 0, .tilemapLeft = 12, .tilemapTop = 2, @@ -285,7 +285,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] = .paletteNum = 5, .baseBlock = 0xEF, }, - { + { // Party mon 4 .bg = 0, .tilemapLeft = 12, .tilemapTop = 5, @@ -294,7 +294,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] = .paletteNum = 6, .baseBlock = 0x125, }, - { + { // Party mon 5 .bg = 0, .tilemapLeft = 12, .tilemapTop = 9, @@ -303,7 +303,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] = .paletteNum = 7, .baseBlock = 0x15B, }, - { + { // Party mon 6 .bg = 0, .tilemapLeft = 12, .tilemapTop = 12, @@ -312,7 +312,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] = .paletteNum = 8, .baseBlock = 0x191, }, - { + [WIN_MSG] = { .bg = 2, .tilemapLeft = 1, .tilemapTop = 15, @@ -326,7 +326,7 @@ static const struct WindowTemplate sMultiPartyMenuWindowTemplate[] = static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] = { - { + { // Party mon 1 .bg = 0, .tilemapLeft = 1, .tilemapTop = 2, @@ -335,7 +335,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] = .paletteNum = 3, .baseBlock = 0x63, }, - { + { // Party mon 2 .bg = 0, .tilemapLeft = 12, .tilemapTop = 3, @@ -344,7 +344,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] = .paletteNum = 5, .baseBlock = 0xA9, }, - { + { // Party mon 3 .bg = 0, .tilemapLeft = 12, .tilemapTop = 6, @@ -353,7 +353,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] = .paletteNum = 6, .baseBlock = 0xDF, }, - { + { // Party mon 4 .bg = 2, .tilemapLeft = 1, .tilemapTop = 11, @@ -362,7 +362,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] = .paletteNum = 4, .baseBlock = 0x115, }, - { + { // Party mon 5 .bg = 2, .tilemapLeft = 12, .tilemapTop = 12, @@ -371,7 +371,7 @@ static const struct WindowTemplate sShowcaseMultiPartyMenuWindowTemplate[] = .paletteNum = 7, .baseBlock = 0x16B, }, - { + { // Party mon 6 .bg = 2, .tilemapLeft = 12, .tilemapTop = 15, diff --git a/src/data/pokemon/level_up_learnset_pointers.h b/src/data/pokemon/level_up_learnset_pointers.h index 0ecfa59cc..9fa91ee23 100644 --- a/src/data/pokemon/level_up_learnset_pointers.h +++ b/src/data/pokemon/level_up_learnset_pointers.h @@ -789,9 +789,9 @@ const struct LevelUpMove *const gLevelUpLearnsets[NUM_SPECIES] = [SPECIES_BRUXISH] = sBruxishLevelUpLearnset, [SPECIES_DRAMPA] = sDrampaLevelUpLearnset, [SPECIES_DHELMISE] = sDhelmiseLevelUpLearnset, - [SPECIES_JANGMO_O] = sJangmooLevelUpLearnset, - [SPECIES_HAKAMO_O] = sHakamooLevelUpLearnset, - [SPECIES_KOMMO_O] = sKommooLevelUpLearnset, + [SPECIES_JANGMO_O] = sJangmoOLevelUpLearnset, + [SPECIES_HAKAMO_O] = sHakamoOLevelUpLearnset, + [SPECIES_KOMMO_O] = sKommoOLevelUpLearnset, [SPECIES_TAPU_KOKO] = sTapuKokoLevelUpLearnset, [SPECIES_TAPU_LELE] = sTapuLeleLevelUpLearnset, [SPECIES_TAPU_BULU] = sTapuBuluLevelUpLearnset, diff --git a/src/data/pokemon/level_up_learnsets.h b/src/data/pokemon/level_up_learnsets.h index f4ad3b566..17af6b888 100644 --- a/src/data/pokemon/level_up_learnsets.h +++ b/src/data/pokemon/level_up_learnsets.h @@ -15960,7 +15960,7 @@ static const struct LevelUpMove sDhelmiseLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sJangmooLevelUpLearnset[] = { +static const struct LevelUpMove sJangmoOLevelUpLearnset[] = { LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 5, MOVE_LEER), LEVEL_UP_MOVE( 9, MOVE_BIDE), @@ -15978,7 +15978,7 @@ static const struct LevelUpMove sJangmooLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sHakamooLevelUpLearnset[] = { +static const struct LevelUpMove sHakamoOLevelUpLearnset[] = { LEVEL_UP_MOVE( 0, MOVE_SKY_UPPERCUT), LEVEL_UP_MOVE( 1, MOVE_SKY_UPPERCUT), LEVEL_UP_MOVE( 1, MOVE_AUTOTOMIZE), @@ -16003,7 +16003,7 @@ static const struct LevelUpMove sHakamooLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sKommooLevelUpLearnset[] = { +static const struct LevelUpMove sKommoOLevelUpLearnset[] = { LEVEL_UP_MOVE( 0, MOVE_CLANGING_SCALES), LEVEL_UP_MOVE( 1, MOVE_CLANGING_SCALES), LEVEL_UP_MOVE( 1, MOVE_SKY_UPPERCUT), diff --git a/src/data/pokemon/pokedex_entries.h b/src/data/pokemon/pokedex_entries.h index 492538260..83b58c1d1 100644 --- a/src/data/pokemon/pokedex_entries.h +++ b/src/data/pokemon/pokedex_entries.h @@ -9396,7 +9396,7 @@ const struct PokedexEntry gPokedexEntries[] = .categoryName = _("Scaly"), .height = 6, .weight = 297, - .description = gJangmooPokedexText, + .description = gJangmoOPokedexText, .pokemonScale = 356, .pokemonOffset = 17, .trainerScale = 256, @@ -9408,7 +9408,7 @@ const struct PokedexEntry gPokedexEntries[] = .categoryName = _("Scaly"), .height = 12, .weight = 470, - .description = gHakamooPokedexText, + .description = gHakamoOPokedexText, .pokemonScale = 356, .pokemonOffset = 17, .trainerScale = 256, @@ -9420,7 +9420,7 @@ const struct PokedexEntry gPokedexEntries[] = .categoryName = _("Scaly"), .height = 16, .weight = 782, - .description = gKommooPokedexText, + .description = gKommoOPokedexText, .pokemonScale = 356, .pokemonOffset = 17, .trainerScale = 256, diff --git a/src/data/pokemon/pokedex_text.h b/src/data/pokemon/pokedex_text.h index 6048d2121..5e28a204b 100644 --- a/src/data/pokemon/pokedex_text.h +++ b/src/data/pokemon/pokedex_text.h @@ -4697,19 +4697,19 @@ const u8 gDhelmisePokedexText[] = _( "It maintains itself with new infusions of\n" "seabed detritus and seaweed."); -const u8 gJangmooPokedexText[] = _( +const u8 gJangmoOPokedexText[] = _( "It expresses its feelings by smacking its\n" "scales. Metallic sounds echo through the\n" "tall mountains where Jangmo-o live. They\n" "grow little by little battling one another."); -const u8 gHakamooPokedexText[] = _( +const u8 gHakamoOPokedexText[] = _( "It sheds and regrows its scales on a\n" "continuous basis. The scales become\n" "harder each time they're regrown. Its\n" "scaly punches tear its foes to shreds."); -const u8 gKommooPokedexText[] = _( +const u8 gKommoOPokedexText[] = _( "Its rigid scales function as offense and\n" "defense. In the past, its scales were\n" "processed and used to make weapons\n" diff --git a/src/data/pokemon/teachable_learnset_pointers.h b/src/data/pokemon/teachable_learnset_pointers.h index 28998aae1..31a39d516 100644 --- a/src/data/pokemon/teachable_learnset_pointers.h +++ b/src/data/pokemon/teachable_learnset_pointers.h @@ -789,9 +789,9 @@ const u16 *const gTeachableLearnsets[NUM_SPECIES] = [SPECIES_BRUXISH] = sBruxishTeachableLearnset, [SPECIES_DRAMPA] = sDrampaTeachableLearnset, [SPECIES_DHELMISE] = sDhelmiseTeachableLearnset, - [SPECIES_JANGMO_O] = sJangmooTeachableLearnset, - [SPECIES_HAKAMO_O] = sHakamooTeachableLearnset, - [SPECIES_KOMMO_O] = sKommooTeachableLearnset, + [SPECIES_JANGMO_O] = sJangmoOTeachableLearnset, + [SPECIES_HAKAMO_O] = sHakamoOTeachableLearnset, + [SPECIES_KOMMO_O] = sKommoOTeachableLearnset, [SPECIES_TAPU_KOKO] = sTapuKokoTeachableLearnset, [SPECIES_TAPU_LELE] = sTapuLeleTeachableLearnset, [SPECIES_TAPU_BULU] = sTapuBuluTeachableLearnset, diff --git a/src/data/pokemon/teachable_learnsets.h b/src/data/pokemon/teachable_learnsets.h index 19b22d9b3..6365af3b9 100644 --- a/src/data/pokemon/teachable_learnsets.h +++ b/src/data/pokemon/teachable_learnsets.h @@ -29414,7 +29414,7 @@ static const u16 sDhelmiseTeachableLearnset[] = { MOVE_UNAVAILABLE, }; -static const u16 sJangmooTeachableLearnset[] = { +static const u16 sJangmoOTeachableLearnset[] = { MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_BRICK_BREAK, @@ -29445,7 +29445,7 @@ static const u16 sJangmooTeachableLearnset[] = { MOVE_UNAVAILABLE, }; -static const u16 sHakamooTeachableLearnset[] = { +static const u16 sHakamoOTeachableLearnset[] = { MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_BRICK_BREAK, @@ -29475,7 +29475,7 @@ static const u16 sHakamooTeachableLearnset[] = { MOVE_UNAVAILABLE, }; -static const u16 sKommooTeachableLearnset[] = { +static const u16 sKommoOTeachableLearnset[] = { MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_BRICK_BREAK, diff --git a/src/data/pokemon_graphics/back_pic_coordinates.h b/src/data/pokemon_graphics/back_pic_coordinates.h index 8dbc2d2a9..5593e10a7 100644 --- a/src/data/pokemon_graphics/back_pic_coordinates.h +++ b/src/data/pokemon_graphics/back_pic_coordinates.h @@ -518,7 +518,7 @@ const struct MonCoords gMonBackPicCoords[] = [SPECIES_DARKRAI] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_SHAYMIN] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 15 }, [SPECIES_ARCEUS] = ARCEUS_BACK_PIC_COORDS, -#endif +#endif #if P_GEN_5_POKEMON == TRUE [SPECIES_VICTINI] = { .size = MON_COORDS_SIZE(40, 64), .y_offset = 7 }, [SPECIES_SNIVY] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, diff --git a/src/data/pokemon_graphics/back_pic_table.h b/src/data/pokemon_graphics/back_pic_table.h index ebe0c316f..29eaeceed 100644 --- a/src/data/pokemon_graphics/back_pic_table.h +++ b/src/data/pokemon_graphics/back_pic_table.h @@ -789,9 +789,9 @@ const struct CompressedSpriteSheet gMonBackPicTable[] = SPECIES_SPRITE(BRUXISH, gMonBackPic_Bruxish), SPECIES_SPRITE(DRAMPA, gMonBackPic_Drampa), SPECIES_SPRITE(DHELMISE, gMonBackPic_Dhelmise), - SPECIES_SPRITE(JANGMO_O, gMonBackPic_Jangmoo), - SPECIES_SPRITE(HAKAMO_O, gMonBackPic_Hakamoo), - SPECIES_SPRITE(KOMMO_O, gMonBackPic_Kommoo), + SPECIES_SPRITE(JANGMO_O, gMonBackPic_JangmoO), + SPECIES_SPRITE(HAKAMO_O, gMonBackPic_HakamoO), + SPECIES_SPRITE(KOMMO_O, gMonBackPic_KommoO), SPECIES_SPRITE(TAPU_KOKO, gMonBackPic_TapuKoko), SPECIES_SPRITE(TAPU_LELE, gMonBackPic_TapuLele), SPECIES_SPRITE(TAPU_BULU, gMonBackPic_TapuBulu), diff --git a/src/data/pokemon_graphics/footprint_table.h b/src/data/pokemon_graphics/footprint_table.h index 2b0dd0a4f..8e21b0604 100644 --- a/src/data/pokemon_graphics/footprint_table.h +++ b/src/data/pokemon_graphics/footprint_table.h @@ -789,9 +789,9 @@ const u8 *const gMonFootprintTable[] = [SPECIES_BRUXISH] = gMonFootprint_Bruxish, [SPECIES_DRAMPA] = gMonFootprint_Drampa, [SPECIES_DHELMISE] = gMonFootprint_Dhelmise, - [SPECIES_JANGMO_O] = gMonFootprint_Jangmo_o, - [SPECIES_HAKAMO_O] = gMonFootprint_Hakamo_o, - [SPECIES_KOMMO_O] = gMonFootprint_Kommo_o, + [SPECIES_JANGMO_O] = gMonFootprint_JangmoO, + [SPECIES_HAKAMO_O] = gMonFootprint_HakamoO, + [SPECIES_KOMMO_O] = gMonFootprint_KommoO, [SPECIES_TAPU_KOKO] = gMonFootprint_Tapu_Koko, [SPECIES_TAPU_LELE] = gMonFootprint_Tapu_Lele, [SPECIES_TAPU_BULU] = gMonFootprint_Tapu_Bulu, diff --git a/src/data/pokemon_graphics/front_pic_coordinates.h b/src/data/pokemon_graphics/front_pic_coordinates.h index a484b8596..ca880e7ef 100644 --- a/src/data/pokemon_graphics/front_pic_coordinates.h +++ b/src/data/pokemon_graphics/front_pic_coordinates.h @@ -920,7 +920,7 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_OVERQWIL] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_ENAMORUS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, #endif - // Megas + // Megas [SPECIES_VENUSAUR_MEGA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, [SPECIES_CHARIZARD_MEGA_X] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_CHARIZARD_MEGA_Y] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, @@ -974,11 +974,11 @@ const struct MonCoords gMonFrontPicCoords[] = #if P_GEN_6_POKEMON == TRUE [SPECIES_DIANCIE_MEGA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, #endif - // Special Mega + Primals + // Special Mega + Primals [SPECIES_RAYQUAZA_MEGA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_KYOGRE_PRIMAL] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_GROUDON_PRIMAL] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Alolan Forms + // Alolan Forms [SPECIES_RATTATA_ALOLAN] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, [SPECIES_RATICATE_ALOLAN] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, [SPECIES_RAICHU_ALOLAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, @@ -997,7 +997,7 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_MUK_ALOLAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, [SPECIES_EXEGGUTOR_ALOLAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_MAROWAK_ALOLAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, - // Galarian Forms + // Galarian Forms [SPECIES_MEOWTH_GALARIAN] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PONYTA_GALARIAN] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 8 }, [SPECIES_RAPIDASH_GALARIAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, @@ -1042,15 +1042,15 @@ const struct MonCoords gMonFrontPicCoords[] = #if P_GEN_7_POKEMON == TRUE [SPECIES_DECIDUEYE_HISUIAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, #endif - // Misc Forms - // Cosplay Pikachu + // Misc Forms + // Cosplay Pikachu [SPECIES_PIKACHU_COSPLAY] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PIKACHU_ROCK_STAR] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PIKACHU_BELLE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PIKACHU_POP_STAR] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PIKACHU_PH_D] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PIKACHU_LIBRE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, - // Cap Pikachu + // Cap Pikachu [SPECIES_PIKACHU_ORIGINAL_CAP] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PIKACHU_HOENN_CAP] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PIKACHU_SINNOH_CAP] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, @@ -1059,9 +1059,9 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_PIKACHU_ALOLA_CAP] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PIKACHU_PARTNER_CAP] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, [SPECIES_PIKACHU_WORLD_CAP] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, - // Pichu + // Pichu [SPECIES_PICHU_SPIKY_EARED] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 14 }, - // Unown + // Unown [SPECIES_UNOWN_B] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 16 }, [SPECIES_UNOWN_C] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 16 }, [SPECIES_UNOWN_D] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 16 }, @@ -1089,40 +1089,40 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_UNOWN_Z] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 16 }, [SPECIES_UNOWN_EMARK] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 15 }, [SPECIES_UNOWN_QMARK] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 13 }, - // Castform + // Castform [SPECIES_CASTFORM_SUNNY] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 9 }, [SPECIES_CASTFORM_RAINY] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 9 }, [SPECIES_CASTFORM_SNOWY] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 8 }, - // Deoxys + // Deoxys [SPECIES_DEOXYS_ATTACK] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_DEOXYS_DEFENSE] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, [SPECIES_DEOXYS_SPEED] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, #if P_GEN_4_POKEMON == TRUE - // Burmy + // Burmy [SPECIES_BURMY_SANDY_CLOAK] = { .size = MON_COORDS_SIZE(32, 56), .y_offset = 12 }, [SPECIES_BURMY_TRASH_CLOAK] = { .size = MON_COORDS_SIZE(32, 56), .y_offset = 8 }, - // Wormadam + // Wormadam [SPECIES_WORMADAM_SANDY_CLOAK] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 10 }, [SPECIES_WORMADAM_TRASH_CLOAK] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 10 }, - // Cherrim + // Cherrim [SPECIES_CHERRIM_SUNSHINE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, - // Shellos + // Shellos [SPECIES_SHELLOS_EAST_SEA] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, - // Gastrodon + // Gastrodon [SPECIES_GASTRODON_EAST_SEA] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, - // Rotom + // Rotom [SPECIES_ROTOM_HEAT] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, [SPECIES_ROTOM_WASH] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, [SPECIES_ROTOM_FROST] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 4 }, [SPECIES_ROTOM_FAN] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 8 }, [SPECIES_ROTOM_MOW] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 12 }, - // Origin Forme + // Origin Forme [SPECIES_DIALGA_ORIGIN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_PALKIA_ORIGIN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_GIRATINA_ORIGIN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Shaymin + // Shaymin [SPECIES_SHAYMIN_SKY] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, - // Arceus + // Arceus [SPECIES_ARCEUS_FIGHTING] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_ARCEUS_FLYING] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_ARCEUS_POISON] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, @@ -1142,42 +1142,42 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_ARCEUS_FAIRY] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, #endif #if P_GEN_5_POKEMON == TRUE - // Basculin + // Basculin [SPECIES_BASCULIN_BLUE_STRIPED] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 16 }, [SPECIES_BASCULIN_WHITE_STRIPED] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 10 }, - // Darmanitan + // Darmanitan [SPECIES_DARMANITAN_ZEN_MODE] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, [SPECIES_DARMANITAN_ZEN_MODE_GALARIAN] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 2 }, - // Deerling + // Deerling [SPECIES_DEERLING_SUMMER] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 11 }, [SPECIES_DEERLING_AUTUMN] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 11 }, [SPECIES_DEERLING_WINTER] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 11 }, - // Sawsbuck + // Sawsbuck [SPECIES_SAWSBUCK_SUMMER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_SAWSBUCK_AUTUMN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_SAWSBUCK_WINTER] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, - // Therian Forms + // Therian Forms [SPECIES_TORNADUS_THERIAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_THUNDURUS_THERIAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, [SPECIES_LANDORUS_THERIAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Kyurem + // Kyurem [SPECIES_KYUREM_WHITE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_KYUREM_BLACK] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Keldeo + // Keldeo [SPECIES_KELDEO_RESOLUTE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, - // Meloetta + // Meloetta [SPECIES_MELOETTA_PIROUETTE] = { .size = MON_COORDS_SIZE(40, 64), .y_offset = 2 }, - // Genesect + // Genesect [SPECIES_GENESECT_DOUSE_DRIVE] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, [SPECIES_GENESECT_SHOCK_DRIVE] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, [SPECIES_GENESECT_BURN_DRIVE] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, [SPECIES_GENESECT_CHILL_DRIVE] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, #endif #if P_GEN_6_POKEMON == TRUE - // Greninja + // Greninja [SPECIES_GRENINJA_BATTLE_BOND] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, [SPECIES_GRENINJA_ASH] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Vivillon + // Vivillon [SPECIES_VIVILLON_POLAR] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_VIVILLON_TUNDRA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_VIVILLON_CONTINENTAL] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, @@ -1197,23 +1197,23 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_VIVILLON_JUNGLE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_VIVILLON_FANCY] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_VIVILLON_POKE_BALL] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Flabébé + // Flabébé [SPECIES_FLABEBE_YELLOW_FLOWER] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, [SPECIES_FLABEBE_ORANGE_FLOWER] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, [SPECIES_FLABEBE_BLUE_FLOWER] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, [SPECIES_FLABEBE_WHITE_FLOWER] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, - // Floette + // Floette [SPECIES_FLOETTE_YELLOW_FLOWER] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 3 }, [SPECIES_FLOETTE_ORANGE_FLOWER] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 3 }, [SPECIES_FLOETTE_BLUE_FLOWER] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 3 }, [SPECIES_FLOETTE_WHITE_FLOWER] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 3 }, [SPECIES_FLOETTE_ETERNAL_FLOWER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, - // Florges + // Florges [SPECIES_FLORGES_YELLOW_FLOWER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_FLORGES_ORANGE_FLOWER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_FLORGES_BLUE_FLOWER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_FLORGES_WHITE_FLOWER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Furfrou + // Furfrou [SPECIES_FURFROU_HEART_TRIM] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, [SPECIES_FURFROU_STAR_TRIM] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, [SPECIES_FURFROU_DIAMOND_TRIM] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 2 }, @@ -1223,41 +1223,41 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_FURFROU_LA_REINE_TRIM] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 2 }, [SPECIES_FURFROU_KABUKI_TRIM] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, [SPECIES_FURFROU_PHARAOH_TRIM] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 2 }, - // Meowstic + // Meowstic [SPECIES_MEOWSTIC_FEMALE] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, - // Aegislash + // Aegislash [SPECIES_AEGISLASH_BLADE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Pumpkaboo + // Pumpkaboo [SPECIES_PUMPKABOO_SMALL] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, [SPECIES_PUMPKABOO_LARGE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 12 }, [SPECIES_PUMPKABOO_SUPER] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, - // Gourgeist + // Gourgeist [SPECIES_GOURGEIST_SMALL] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 5 }, [SPECIES_GOURGEIST_LARGE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, [SPECIES_GOURGEIST_SUPER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Xerneas + // Xerneas [SPECIES_XERNEAS_ACTIVE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Zygarde + // Zygarde [SPECIES_ZYGARDE_10] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, [SPECIES_ZYGARDE_10_POWER_CONSTRUCT] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, [SPECIES_ZYGARDE_50_POWER_CONSTRUCT] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_ZYGARDE_COMPLETE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Hoopa + // Hoopa [SPECIES_HOOPA_UNBOUND] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, #endif #if P_GEN_7_POKEMON == TRUE - // Oricorio + // Oricorio [SPECIES_ORICORIO_POM_POM] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, [SPECIES_ORICORIO_PAU] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 }, [SPECIES_ORICORIO_SENSU] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, - // Rockruff + // Rockruff [SPECIES_ROCKRUFF_OWN_TEMPO] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, - // Lycanroc + // Lycanroc [SPECIES_LYCANROC_MIDNIGHT] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 1 }, [SPECIES_LYCANROC_DUSK] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, - // Wishiwashi + // Wishiwashi [SPECIES_WISHIWASHI_SCHOOL] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 4 }, - // Silvally + // Silvally [SPECIES_SILVALLY_FIGHTING] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_SILVALLY_FLYING] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_SILVALLY_POISON] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, @@ -1275,7 +1275,7 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_SILVALLY_DRAGON] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_SILVALLY_DARK] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_SILVALLY_FAIRY] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Minior + // Minior [SPECIES_MINIOR_METEOR_ORANGE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, [SPECIES_MINIOR_METEOR_YELLOW] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, [SPECIES_MINIOR_METEOR_GREEN] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, @@ -1289,26 +1289,26 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_MINIOR_CORE_BLUE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, [SPECIES_MINIOR_CORE_INDIGO] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, [SPECIES_MINIOR_CORE_VIOLET] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, - // Mimikyu + // Mimikyu [SPECIES_MIMIKYU_BUSTED] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, - // Necrozma + // Necrozma [SPECIES_NECROZMA_DUSK_MANE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_NECROZMA_DAWN_WINGS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_NECROZMA_ULTRA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Magearna + // Magearna [SPECIES_MAGEARNA_ORIGINAL_COLOR] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, #endif #if P_GEN_8_POKEMON == TRUE - // Cramorant + // Cramorant [SPECIES_CRAMORANT_GULPING] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_CRAMORANT_GORGING] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Toxtricity + // Toxtricity [SPECIES_TOXTRICITY_LOW_KEY] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 2 }, - // Sinistea + // Sinistea [SPECIES_SINISTEA_ANTIQUE] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 17 }, - // Polteageist + // Polteageist [SPECIES_POLTEAGEIST_ANTIQUE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, - // Alcremie + // Alcremie [SPECIES_ALCREMIE_RUBY_CREAM] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 7 }, [SPECIES_ALCREMIE_MATCHA_CREAM] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 7 }, [SPECIES_ALCREMIE_MINT_CREAM] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 7 }, @@ -1317,28 +1317,28 @@ const struct MonCoords gMonFrontPicCoords[] = [SPECIES_ALCREMIE_RUBY_SWIRL] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 7 }, [SPECIES_ALCREMIE_CARAMEL_SWIRL] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 7 }, [SPECIES_ALCREMIE_RAINBOW_SWIRL] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 7 }, - // Eiscue + // Eiscue [SPECIES_EISCUE_NOICE_FACE] = { .size = MON_COORDS_SIZE(40, 64), .y_offset = 0 }, - // Indeedee + // Indeedee [SPECIES_INDEEDEE_FEMALE] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 9 }, - // Morpeko + // Morpeko [SPECIES_MORPEKO_HANGRY] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 14 }, - // Zacian + // Zacian [SPECIES_ZACIAN_CROWNED_SWORD] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, - // Zamazenta + // Zamazenta [SPECIES_ZAMAZENTA_CROWNED_SHIELD] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, - // Eternatus + // Eternatus [SPECIES_ETERNATUS_ETERNAMAX] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, - // Urshifu + // Urshifu [SPECIES_URSHIFU_RAPID_STRIKE_STYLE] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, - // Zarude + // Zarude [SPECIES_ZARUDE_DADA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, - // Calyrex + // Calyrex [SPECIES_CALYREX_ICE_RIDER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_CALYREX_SHADOW_RIDER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, [SPECIES_ENAMORUS_THERIAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, #endif - // Egg + // Egg [SPECIES_EGG] = { .size = MON_COORDS_SIZE(24, 24), .y_offset = 20 }, }; diff --git a/src/data/pokemon_graphics/front_pic_table.h b/src/data/pokemon_graphics/front_pic_table.h index 24ebc78f3..4530963af 100644 --- a/src/data/pokemon_graphics/front_pic_table.h +++ b/src/data/pokemon_graphics/front_pic_table.h @@ -789,9 +789,9 @@ const struct CompressedSpriteSheet gMonFrontPicTable[] = SPECIES_SPRITE(BRUXISH, gMonFrontPic_Bruxish), SPECIES_SPRITE(DRAMPA, gMonFrontPic_Drampa), SPECIES_SPRITE(DHELMISE, gMonFrontPic_Dhelmise), - SPECIES_SPRITE(JANGMO_O, gMonFrontPic_Jangmoo), - SPECIES_SPRITE(HAKAMO_O, gMonFrontPic_Hakamoo), - SPECIES_SPRITE(KOMMO_O, gMonFrontPic_Kommoo), + SPECIES_SPRITE(JANGMO_O, gMonFrontPic_JangmoO), + SPECIES_SPRITE(HAKAMO_O, gMonFrontPic_HakamoO), + SPECIES_SPRITE(KOMMO_O, gMonFrontPic_KommoO), SPECIES_SPRITE(TAPU_KOKO, gMonFrontPic_TapuKoko), SPECIES_SPRITE(TAPU_LELE, gMonFrontPic_TapuLele), SPECIES_SPRITE(TAPU_BULU, gMonFrontPic_TapuBulu), diff --git a/src/data/pokemon_graphics/palette_table.h b/src/data/pokemon_graphics/palette_table.h index a8c986d79..7311dfd0b 100644 --- a/src/data/pokemon_graphics/palette_table.h +++ b/src/data/pokemon_graphics/palette_table.h @@ -789,9 +789,9 @@ const struct CompressedSpritePalette gMonPaletteTable[] = SPECIES_PAL(BRUXISH, gMonPalette_Bruxish), SPECIES_PAL(DRAMPA, gMonPalette_Drampa), SPECIES_PAL(DHELMISE, gMonPalette_Dhelmise), - SPECIES_PAL(JANGMO_O, gMonPalette_Jangmoo), - SPECIES_PAL(HAKAMO_O, gMonPalette_Hakamoo), - SPECIES_PAL(KOMMO_O, gMonPalette_Kommoo), + SPECIES_PAL(JANGMO_O, gMonPalette_JangmoO), + SPECIES_PAL(HAKAMO_O, gMonPalette_HakamoO), + SPECIES_PAL(KOMMO_O, gMonPalette_KommoO), SPECIES_PAL(TAPU_KOKO, gMonPalette_TapuKoko), SPECIES_PAL(TAPU_LELE, gMonPalette_TapuLele), SPECIES_PAL(TAPU_BULU, gMonPalette_TapuBulu), diff --git a/src/data/pokemon_graphics/shiny_palette_table.h b/src/data/pokemon_graphics/shiny_palette_table.h index 012a95cf1..5ad52f6dc 100644 --- a/src/data/pokemon_graphics/shiny_palette_table.h +++ b/src/data/pokemon_graphics/shiny_palette_table.h @@ -789,9 +789,9 @@ const struct CompressedSpritePalette gMonShinyPaletteTable[] = SPECIES_SHINY_PAL(BRUXISH, gMonShinyPalette_Bruxish), SPECIES_SHINY_PAL(DRAMPA, gMonShinyPalette_Drampa), SPECIES_SHINY_PAL(DHELMISE, gMonShinyPalette_Dhelmise), - SPECIES_SHINY_PAL(JANGMO_O, gMonShinyPalette_Jangmoo), - SPECIES_SHINY_PAL(HAKAMO_O, gMonShinyPalette_Hakamoo), - SPECIES_SHINY_PAL(KOMMO_O, gMonShinyPalette_Kommoo), + SPECIES_SHINY_PAL(JANGMO_O, gMonShinyPalette_JangmoO), + SPECIES_SHINY_PAL(HAKAMO_O, gMonShinyPalette_HakamoO), + SPECIES_SHINY_PAL(KOMMO_O, gMonShinyPalette_KommoO), SPECIES_SHINY_PAL(TAPU_KOKO, gMonShinyPalette_TapuKoko), SPECIES_SHINY_PAL(TAPU_LELE, gMonShinyPalette_TapuLele), SPECIES_SHINY_PAL(TAPU_BULU, gMonShinyPalette_TapuBulu), @@ -1328,7 +1328,7 @@ const struct CompressedSpritePalette gMonShinyPaletteTable[] = SPECIES_SHINY_PAL(CALYREX_ICE_RIDER, gMonShinyPalette_CalyrexIceRider), SPECIES_SHINY_PAL(CALYREX_SHADOW_RIDER, gMonShinyPalette_CalyrexShadowRider), - + SPECIES_SHINY_PAL(ENAMORUS_THERIAN, gMonShinyPalette_CircledQuestionMark), //gMonShinyPalette_EnamorusTherian), #endif SPECIES_SHINY_PAL(EGG, gMonPalette_Egg), diff --git a/src/data/trade.h b/src/data/trade.h index 80d17a49b..ef7e9231d 100644 --- a/src/data/trade.h +++ b/src/data/trade.h @@ -55,7 +55,7 @@ static const u8 sText_OnlyPkmnForBattle[] = _("That's your only\nPOKéMON for ba static const u8 sText_WaitingForYourFriend[] = _("{COLOR DARK_GRAY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GRAY}Waiting for your friend\nto finish…"); static const u8 sText_YourFriendWantsToTrade[] = _("Your friend wants\nto trade POKéMON."); -static const struct OamData sTradeOamData_32x16 = +static const struct OamData sOamData_MenuText = { .shape = SPRITE_SHAPE(32x16), .size = SPRITE_SIZE(32x16), @@ -167,17 +167,17 @@ static const struct SpriteTemplate sSpriteTemplate_MenuText = { .tileTag = GFXTAG_MENU_TEXT, .paletteTag = PALTAG_MENU_TEXT, - .oam = &sTradeOamData_32x16, + .oam = &sOamData_MenuText, .anims = sAnims_MenuText, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }; -static const u16 sTradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal"); -static const struct SpritePalette sSpritePalette_TradeScreenText = +static const u16 sMenuText_Pal[] = INCBIN_U16("graphics/trade/text.gbapal"); +static const struct SpritePalette sSpritePalette_MenuText = { - .data = sTradeScreenTextPalette, + .data = sMenuText_Pal, .tag = PALTAG_MENU_TEXT }; @@ -193,7 +193,7 @@ static const struct SpritePalette sSpritePalette_TradeScreenText = // 1st array is the current positions // 2nd array is directions of input // 3rd array is the next positions to go to (unoccupied spaces are skipped over) -static const u8 sTradeNextSelectedMonTable[(PARTY_SIZE * 2) + 1][4][PARTY_SIZE] = +static const u8 sCursorMoveDestinations[(PARTY_SIZE * 2) + 1][4][PARTY_SIZE] = { { {4, 2, 12, 12, 0, 0}, // UP @@ -275,86 +275,67 @@ static const u8 sTradeNextSelectedMonTable[(PARTY_SIZE * 2) + 1][4][PARTY_SIZE] } }; +#define COL0_X 1 +#define COL1_X 8 +#define COL2_X 16 +#define COL3_X 23 +#define ROW0_Y 5 +#define ROW1_Y 10 +#define ROW2_Y 15 +#define ROW3_Y 18 + static const u8 sTradeMonSpriteCoords[(PARTY_SIZE * 2) + 1][2] = { - // Your party - {1, 5 }, - {8, 5 }, - {1, 10}, - {8, 10}, - {1, 15}, - {8, 15}, - - // Friend's party - {16, 5 }, - {23, 5 }, - {16, 10}, - {23, 10}, - {16, 15}, - {23, 15}, - - {23, 18} // CANCEL + // Player's party + {COL0_X, ROW0_Y}, + {COL1_X, ROW0_Y}, + {COL0_X, ROW1_Y}, + {COL1_X, ROW1_Y}, + {COL0_X, ROW2_Y}, + {COL1_X, ROW2_Y}, + // Partners's party + {COL2_X, ROW0_Y}, + {COL3_X, ROW0_Y}, + {COL2_X, ROW1_Y}, + {COL3_X, ROW1_Y}, + {COL2_X, ROW2_Y}, + {COL3_X, ROW2_Y}, + // Cancel + {COL3_X, ROW3_Y} }; -static const u8 sTradeMonLevelCoords[][2][2] = -{ - // Your party - { - {5, 4}, - {12, 4}, - }, - { - {5, 9}, - {12, 9}, - }, - { - {5, 14}, +static const u8 sTradeMonLevelCoords[PARTY_SIZE * 2][2] = { + [TRADE_PLAYER] = + { 5, 4}, + {12, 4}, + { 5, 9}, + {12, 9}, + { 5, 14}, {12, 14}, - }, - // Friend's party - { - - {20, 4}, - {27, 4}, - }, - { - {20, 9}, - {27, 9}, - }, - { + [TRADE_PARTNER * PARTY_SIZE] = + {20, 4}, + {27, 4}, + {20, 9}, + {27, 9}, {20, 14}, {27, 14}, - }, }; -static const u8 sTradeMonBoxCoords[][2][2] = -{ - // Your party - { - {1, 3}, - {8, 3}, - }, - { - {1, 8}, - {8, 8}, - }, - { - {1, 13}, - {8, 13}, - }, - // Friend's party - { - {16, 3}, - {23, 3}, - }, - { - {16, 8}, - {23, 8}, - }, - { +static const u8 sTradeMonBoxCoords[PARTY_SIZE * 2][2] = { + [TRADE_PLAYER] = + { 1, 3}, + { 8, 3}, + { 1, 8}, + { 8, 8}, + { 1, 13}, + { 8, 13}, + [TRADE_PARTNER * PARTY_SIZE] = + {16, 3}, + {23, 3}, + {16, 8}, + {23, 8}, {16, 13}, {23, 13}, - }, }; static const u8 sUnusedCoords[][2] = @@ -379,14 +360,14 @@ static const u8 sUnusedCoords[][2] = {23, 12} }; -static const u8 *const sTradeActionTexts[] = +static const u8 *const sActionTexts[] = { - [TRADE_TEXT_CANCEL] = sText_Cancel, - [TRADE_TEXT_CHOOSE_MON] = sText_ChooseAPkmn, - [TRADE_TEXT_SUMMARY] = sText_Summary, - [TRADE_TEXT_TRADE] = sText_Trade, - [TRADE_TEXT_CANCEL_TRADE] = sText_CancelTrade, - [TRADE_TEXT_JP_QUIT] = sJPText_PressBButtonToQuit + [TEXT_CANCEL] = sText_Cancel, + [TEXT_CHOOSE_MON] = sText_ChooseAPkmn, + [TEXT_SUMMARY] = sText_Summary, + [TEXT_TRADE] = sText_Trade, + [TEXT_CANCEL_TRADE] = sText_CancelTrade, + [TEXT_JP_QUIT] = sJPText_PressBButtonToQuit }; static const struct MenuAction sSelectTradeMonActions[] = @@ -395,17 +376,17 @@ static const struct MenuAction sSelectTradeMonActions[] = {sText_Trade2, Task_DrawSelectionTrade} }; -static const u8 *const sTradeMessages[] = +static const u8 *const sMessages[] = { - [TRADE_MSG_STANDBY] = sText_CommunicationStandby, - [TRADE_MSG_CANCELED] = sText_TheTradeHasBeenCanceled, - [TRADE_MSG_ONLY_MON1] = sText_OnlyPkmnForBattle, - [TRADE_MSG_ONLY_MON2] = gText_OnlyPkmnForBattle, //identical text to above - [TRADE_MSG_WAITING_FOR_FRIEND] = sText_WaitingForYourFriend, - [TRADE_MSG_FRIEND_WANTS_TO_TRADE] = sText_YourFriendWantsToTrade, - [TRADE_MSG_MON_CANT_BE_TRADED] = gText_PkmnCantBeTradedNow, - [TRADE_MSG_EGG_CANT_BE_TRADED] = gText_EggCantBeTradedNow, - [TRADE_MSG_FRIENDS_MON_CANT_BE_TRADED] = gText_OtherTrainersPkmnCantBeTraded + [MSG_STANDBY] = sText_CommunicationStandby, + [MSG_CANCELED] = sText_TheTradeHasBeenCanceled, + [MSG_ONLY_MON1] = sText_OnlyPkmnForBattle, + [MSG_ONLY_MON2] = gText_OnlyPkmnForBattle, //identical text to above + [MSG_WAITING_FOR_FRIEND] = sText_WaitingForYourFriend, + [MSG_FRIEND_WANTS_TO_TRADE] = sText_YourFriendWantsToTrade, + [MSG_MON_CANT_BE_TRADED] = gText_PkmnCantBeTradedNow, + [MSG_EGG_CANT_BE_TRADED] = gText_EggCantBeTradedNow, + [MSG_FRIENDS_MON_CANT_BE_TRADED] = gText_OtherTrainersPkmnCantBeTraded }; static const u8 sTradeTextColors[] = @@ -415,7 +396,7 @@ static const u8 sTradeTextColors[] = TEXT_COLOR_DARK_GRAY //shadow color }; -static const struct BgTemplate sTradeMenuBgTemplates[] = +static const struct BgTemplate sBgTemplates[] = { { .bg = 0, @@ -455,7 +436,7 @@ static const struct BgTemplate sTradeMenuBgTemplates[] = }, }; -static const struct WindowTemplate sTradeMenuWindowTemplates[] = +static const struct WindowTemplate sWindowTemplates[] = { { .bg = 0, @@ -633,8 +614,8 @@ static const struct WindowTemplate sTradeYesNoWindowTemplate = .baseBlock = 582 }; -static const u8 sJPText_Shedinja[] = _("ヌケニン"); -static const u8 sTradeMenuPartyMonBoxDimensions[3][2] = +static const u8 sText_ShedinjaJP[] = _("ヌケニン"); +static const u8 sSelectedMonLevelGenderCoords[3][2] = { [TRADE_PLAYER] = {4, 3}, [TRADE_PARTNER] = {19, 3} @@ -643,8 +624,8 @@ static const u8 sTradeMenuPartyMonBoxDimensions[3][2] = static const u16 sPokeball_Pal[] = INCBIN_U16("graphics/trade/pokeball.gbapal"); static const u8 sPokeball_Gfx[] = INCBIN_U8("graphics/trade/pokeball.4bpp"); static const u8 sPokeballSymbol_Gfx[] = INCBIN_U8("graphics/trade/pokeball_symbol.8bpp"); // unused -static const u16 sCrossingHighlightCable_Tilemap[] = INCBIN_U16("graphics/trade/crossing_highlight_cable.bin"); -static const u16 sTradeTilemap_PokeBallSymbol[] = INCBIN_U16("graphics/trade/pokeball_symbol_map.bin"); // unused? +static const u16 sCableCloseup_Map[] = INCBIN_U16("graphics/trade/crossing_highlight_cable.bin"); +static const u16 sPokeballSymbol_Map[] = INCBIN_U16("graphics/trade/pokeball_symbol_map.bin"); // unused? static const u16 sUnusedPal1[] = INCBIN_U16("graphics/trade/unused1.gbapal"); static const u16 sGba_Pal[] = INCBIN_U16("graphics/trade/gba.gbapal"); static const u16 sUnusedPal2[] = INCBIN_U16("graphics/trade/unused2.gbapal"); @@ -657,11 +638,11 @@ static const u8 sGbaScreen_Gfx[] = INCBIN_U8("graphics/trade/gba_screen.4bpp"); const u16 gTradePlatform_Tilemap[] = INCBIN_U16("graphics/trade/platform.bin"); static const u8 sGbaAffine_Gfx[] = INCBIN_U8("graphics/trade/gba_affine.8bpp"); // Only the gfx for when the GBA is zooming in/out static const u8 sEmptyGfx[64] = {}; -static const u8 sGbaCable_AffineTilemap[] = INCBIN_U8("graphics/trade/gba_affine_map_cable.bin"); -static const u8 sGbaWireless_AffineTilemap[] = INCBIN_U8("graphics/trade/gba_affine_map_wireless.bin"); -static const u16 sGbaWireless_Tilemap[] = INCBIN_U16("graphics/trade/gba_map_wireless.bin"); -static const u16 sGbaCable_Tilemap[] = INCBIN_U16("graphics/trade/gba_map_cable.bin"); -static const u32 sCrossingHighlightWireless_Tilemap[] = INCBIN_U32("graphics/trade/crossing_highlight_wireless.bin.lz"); +static const u8 sGbaAffineMapCable[] = INCBIN_U8("graphics/trade/gba_affine_map_cable.bin"); +static const u8 sGbaAffineMapWireless[] = INCBIN_U8("graphics/trade/gba_affine_map_wireless.bin"); +static const u16 sGbaMapWireless[] = INCBIN_U16("graphics/trade/gba_map_wireless.bin"); +static const u16 sGbaMapCable[] = INCBIN_U16("graphics/trade/gba_map_cable.bin"); +static const u32 sWirelessCloseup_Map[] = INCBIN_U32("graphics/trade/crossing_highlight_wireless.bin.lz"); static const u16 sWirelessSignalSend_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_send.gbapal"); static const u16 sWirelessSignalRecv_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_receive.gbapal"); static const u16 sWirelessSignalNone_Pal[] = INCBIN_U16("graphics/trade/wireless_signal_none.gbapal"); @@ -749,7 +730,7 @@ static const union AffineAnimCmd *const sAffineAnims_Pokeball[] = static const struct SpriteSheet sPokeBallSpriteSheet = { .data = sPokeball_Gfx, - .size = 0x600, + .size = sizeof(sPokeball_Gfx), .tag = GFXTAG_POKEBALL }; @@ -805,7 +786,7 @@ static const union AffineAnimCmd *const sAffineAnims_LinkMonGlow[] = static const struct SpriteSheet sSpriteSheet_LinkMonGlow = { .data = sLinkMonGlow_Gfx, - .size = 0x200, + .size = sizeof(sLinkMonGlow_Gfx), .tag = GFXTAG_LINK_MON_GLOW }; @@ -962,7 +943,7 @@ static const union AnimCmd *const sAnims_GbaScreen_Short[] = static const struct SpriteSheet sSpriteSheet_GbaScreen = { .data = sGbaScreen_Gfx, - .size = 0x1000, + .size = sizeof(sGbaScreen_Gfx), .tag = GFXTAG_GBA_SCREEN }; @@ -1185,7 +1166,7 @@ static const s8 sTradeBallVerticalVelocityTable[] = 0, 0, 0, 1, 0, 1, 1, 2, 3 }; -static const u8 sWirelessSignalTiming[][2] = +static const u8 sWirelessSignalAnimParams[][2] = { { 0, 1}, { 1, 1}, diff --git a/src/debug.c b/src/debug.c index 90081eb61..301bae51d 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1255,7 +1255,7 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId) if (gTasks[taskId].data[3] <= 15 || gTasks[taskId].data[3] >= 20) StringCopyPadded(gStringVar1, sWeatherNames[gTasks[taskId].data[3]], CHAR_SPACE, 30); else - StringCopyPadded(gStringVar1, sText_WeatherNotDefined, CHAR_SPACE, 30); + StringCopyPadded(gStringVar1, sText_WeatherNotDefined, CHAR_SPACE, 30); StringExpandPlaceholders(gStringVar4, sDebugText_Util_Weather_ID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); diff --git a/src/easy_chat.c b/src/easy_chat.c index 723800828..6595e0a10 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -226,18 +226,23 @@ static void DoQuizQuestionEasyChatScreen(void); static void DoQuizSetAnswerEasyChatScreen(void); static void DoQuizSetQuestionEasyChatScreen(void); -#define PALTAG_TRIANGLE_CURSOR 0 -#define PALTAG_RECTANGLE_CURSOR 1 -#define PALTAG_MISC_UI 2 -#define PALTAG_RS_INTERVIEW_FRAME 3 +enum { + PALTAG_TRIANGLE_CURSOR, + PALTAG_RECTANGLE_CURSOR, + PALTAG_MISC_UI, + PALTAG_RS_INTERVIEW_FRAME, +}; + +enum { + GFXTAG_TRIANGLE_CURSOR, + GFXTAG_RECTANGLE_CURSOR, + GFXTAG_SCROLL_INDICATOR, + GFXTAG_START_SELECT_BUTTONS, + GFXTAG_MODE_WINDOW, + GFXTAG_RS_INTERVIEW_FRAME, + GFXTAG_BUTTON_WINDOW, +}; -#define GFXTAG_TRIANGLE_CURSOR 0 -#define GFXTAG_RECTANGLE_CURSOR 1 -#define GFXTAG_SCROLL_INDICATOR 2 -#define GFXTAG_START_SELECT_BUTTONS 3 -#define GFXTAG_MODE_WINDOW 4 -#define GFXTAG_RS_INTERVIEW_FRAME 5 -#define GFXTAG_BUTTON_WINDOW 6 // State values for sEasyChatScreen->inputState // Control which input handler to use in HandleEasyChatInput @@ -376,6 +381,13 @@ enum { WINANIM_KEYBOARD_SWITCH_IN, }; +// Window IDs +enum { + WIN_TITLE, + WIN_MSG, + WIN_INPUT_SELECT, // Word groups, word list, and keyboard +}; + // Values for text frame tilemap #define FRAME_OFFSET_ORANGE 0x1000 // Orange frame, for phrase text #define FRAME_OFFSET_GREEN 0x4000 // Green frame, for keyboard/word select @@ -814,7 +826,7 @@ static const struct BgTemplate sEasyChatBgTemplates[] = { }; static const struct WindowTemplate sEasyChatWindowTemplates[] = { - { + [WIN_TITLE] = { .bg = 1, .tilemapLeft = 6, .tilemapTop = 0, @@ -823,7 +835,7 @@ static const struct WindowTemplate sEasyChatWindowTemplates[] = { .paletteNum = 10, .baseBlock = 0x10, }, - { + [WIN_MSG] = { .bg = 0, .tilemapLeft = 3, .tilemapTop = 15, @@ -832,7 +844,7 @@ static const struct WindowTemplate sEasyChatWindowTemplates[] = { .paletteNum = 15, .baseBlock = 0xA, }, - { + [WIN_INPUT_SELECT] = { .bg = 2, .tilemapLeft = 1, .tilemapTop = 0, @@ -3934,10 +3946,10 @@ static void PrintTitle(void) return; xOffset = GetStringCenterAlignXOffset(FONT_NORMAL, titleText, 144); - FillWindowPixelBuffer(0, PIXEL_FILL(0)); - PrintEasyChatTextWithColors(0, FONT_NORMAL, titleText, xOffset, 1, TEXT_SKIP_DRAW, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); - PutWindowTilemap(0); - CopyWindowToVram(0, COPYWIN_FULL); + FillWindowPixelBuffer(WIN_TITLE, PIXEL_FILL(0)); + PrintEasyChatTextWithColors(WIN_TITLE, FONT_NORMAL, titleText, xOffset, 1, TEXT_SKIP_DRAW, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); + PutWindowTilemap(WIN_TITLE); + CopyWindowToVram(WIN_TITLE, COPYWIN_FULL); } static void PrintEasyChatText(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)) @@ -3957,10 +3969,10 @@ static void PrintEasyChatTextWithColors(u8 windowId, u8 fontId, const u8 *str, u static void PrintInitialInstructions(void) { FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17); - LoadUserWindowBorderGfx(1, 1, BG_PLTT_ID(14)); - DrawTextBorderOuter(1, 1, 14); + LoadUserWindowBorderGfx(WIN_MSG, 1, BG_PLTT_ID(14)); + DrawTextBorderOuter(WIN_MSG, 1, 14); PrintEasyChatStdMessage(MSG_INSTRUCTIONS); - PutWindowTilemap(1); + PutWindowTilemap(WIN_MSG); CopyBgTilemapBufferToVram(0); } @@ -4004,14 +4016,14 @@ static void PrintEasyChatStdMessage(u8 msgId) break; } - FillWindowPixelBuffer(1, PIXEL_FILL(1)); + FillWindowPixelBuffer(WIN_MSG, PIXEL_FILL(1)); if (text1) - PrintEasyChatText(1, FONT_NORMAL, text1, 0, 1, TEXT_SKIP_DRAW, 0); + PrintEasyChatText(WIN_MSG, FONT_NORMAL, text1, 0, 1, TEXT_SKIP_DRAW, 0); if (text2) - PrintEasyChatText(1, FONT_NORMAL, text2, 0, 17, TEXT_SKIP_DRAW, 0); + PrintEasyChatText(WIN_MSG, FONT_NORMAL, text2, 0, 17, TEXT_SKIP_DRAW, 0); - CopyWindowToVram(1, COPYWIN_FULL); + CopyWindowToVram(WIN_MSG, COPYWIN_FULL); } static void CreateEasyChatYesNoMenu(u8 initialCursorPos) @@ -4198,14 +4210,14 @@ static void AdjustBgTilemapForFooter(void) static void DrawLowerWindow(void) { - PutWindowTilemap(2); - CopyBgTilemapBufferToVram(2); + PutWindowTilemap(WIN_INPUT_SELECT); + CopyBgTilemapBufferToVram(WIN_INPUT_SELECT); } static void InitLowerWindowText(u32 whichText) { ResetLowerWindowScroll(); - FillWindowPixelBuffer(2, PIXEL_FILL(1)); + FillWindowPixelBuffer(WIN_INPUT_SELECT, PIXEL_FILL(1)); switch (whichText) { case TEXT_GROUPS: @@ -4219,7 +4231,7 @@ static void InitLowerWindowText(u32 whichText) break; } - CopyWindowToVram(2, COPYWIN_GFX); + CopyWindowToVram(WIN_INPUT_SELECT, COPYWIN_GFX); } static void PrintKeyboardText(void) @@ -4248,7 +4260,7 @@ static void PrintKeyboardGroupNames(void) return; } - PrintEasyChatText(2, FONT_NORMAL, GetEasyChatWordGroupName(groupId), x * 84 + 10, y, TEXT_SKIP_DRAW, NULL); + PrintEasyChatText(WIN_INPUT_SELECT, FONT_NORMAL, GetEasyChatWordGroupName(groupId), x * 84 + 10, y, TEXT_SKIP_DRAW, NULL); } y += 16; @@ -4260,7 +4272,7 @@ static void PrintKeyboardAlphabet(void) u32 i; for (i = 0; i < ARRAY_COUNT(sEasyChatKeyboardAlphabet); i++) - PrintEasyChatText(2, FONT_NORMAL, sEasyChatKeyboardAlphabet[i], 10, 97 + i * 16, TEXT_SKIP_DRAW, NULL); + PrintEasyChatText(WIN_INPUT_SELECT, FONT_NORMAL, sEasyChatKeyboardAlphabet[i], 10, 97 + i * 16, TEXT_SKIP_DRAW, NULL); } static void PrintInitialWordSelectText(void) @@ -4331,16 +4343,16 @@ static void PrintWordSelectText(u8 scrollOffset, u8 numRows) { CopyEasyChatWordPadded(sScreenControl->wordSelectPrintBuffer, easyChatWord, 0); if (!DummyWordCheck(easyChatWord)) - PrintEasyChatText(2, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, NULL); + PrintEasyChatText(WIN_INPUT_SELECT, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, NULL); else // Never reached - PrintEasyChatTextWithColors(2, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GRAY); + PrintEasyChatTextWithColors(WIN_INPUT_SELECT, FONT_NORMAL, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SKIP_DRAW, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GRAY); } } y += 16; } - CopyWindowToVram(2, COPYWIN_GFX); + CopyWindowToVram(WIN_INPUT_SELECT, COPYWIN_GFX); } static void EraseWordSelectRows(u8 scrollOffset, u8 numRows) @@ -4364,15 +4376,15 @@ static void EraseWordSelectRows(u8 scrollOffset, u8 numRows) var1 = 0; } - FillWindowPixelRect(2, PIXEL_FILL(1), 0, y, 224, var2); + FillWindowPixelRect(WIN_INPUT_SELECT, PIXEL_FILL(1), 0, y, 224, var2); if (var1) - FillWindowPixelRect(2, PIXEL_FILL(1), 0, 0, 224, var1); + FillWindowPixelRect(WIN_INPUT_SELECT, PIXEL_FILL(1), 0, 0, 224, var1); } static void ClearWordSelectWindow(void) { - FillWindowPixelBuffer(2, PIXEL_FILL(1)); - CopyWindowToVram(2, COPYWIN_GFX); + FillWindowPixelBuffer(WIN_INPUT_SELECT, PIXEL_FILL(1)); + CopyWindowToVram(WIN_INPUT_SELECT, COPYWIN_GFX); } static void InitLowerWindowAnim(int winAnimType) diff --git a/src/ereader_screen.c b/src/ereader_screen.c index ea5cface4..c625c78a9 100755 --- a/src/ereader_screen.c +++ b/src/ereader_screen.c @@ -343,7 +343,7 @@ static void Task_EReader(u8 taskId) case ER_STATE_MSG_SELECT_CONNECT: if (PrintMysteryGiftMenuMessage(&data->textState, gJPText_SelectConnectFromEReaderMenu)) { - AddTextPrinterToWindow1(gJPText_SelectConnectWithGBA); + MG_AddMessageTextPrinter(gJPText_SelectConnectWithGBA); ResetTimer(&data->timer); data->state = ER_STATE_MSG_SELECT_CONNECT_WAIT; } @@ -397,7 +397,7 @@ static void Task_EReader(u8 taskId) data->state = ER_STATE_MSG_SELECT_CONNECT; break; case ER_STATE_CONNECTING: - AddTextPrinterToWindow1(gJPText_Connecting); + MG_AddMessageTextPrinter(gJPText_Connecting); // XXX: This (u32 *) cast is discarding the const qualifier from gMultiBootProgram_EReader_Start EReader_Load(&gEReaderData, gMultiBootProgram_EReader_End - gMultiBootProgram_EReader_Start, (u32 *)gMultiBootProgram_EReader_Start); data->state = ER_STATE_TRANSFER; @@ -416,7 +416,7 @@ static void Task_EReader(u8 taskId) else if (data->status == TRANSFER_SUCCESS) { ResetTimer(&data->timer); - AddTextPrinterToWindow1(gJPText_PleaseWaitAMoment); + MG_AddMessageTextPrinter(gJPText_PleaseWaitAMoment); data->state = ER_STATE_TRANSFER_SUCCESS; } else // TRANSFER_CANCELED @@ -430,7 +430,7 @@ static void Task_EReader(u8 taskId) break; case ER_STATE_LOAD_CARD_START: OpenEReaderLink(); - AddTextPrinterToWindow1(gJPText_AllowEReaderToLoadCard); + MG_AddMessageTextPrinter(gJPText_AllowEReaderToLoadCard); data->state = ER_STATE_LOAD_CARD; break; case ER_STATE_LOAD_CARD: @@ -439,7 +439,7 @@ static void Task_EReader(u8 taskId) case RECV_ACTIVE: break; case RECV_SUCCESS: - AddTextPrinterToWindow1(gJPText_Connecting); + MG_AddMessageTextPrinter(gJPText_Connecting); data->state = ER_STATE_WAIT_RECV_CARD; break; case RECV_CANCELED: @@ -487,7 +487,7 @@ static void Task_EReader(u8 taskId) case ER_STATE_SAVE: if (TryWriteTrainerHill((struct EReaderTrainerHillSet *)&gDecompressionBuffer)) { - AddTextPrinterToWindow1(gJPText_ConnectionComplete); + MG_AddMessageTextPrinter(gJPText_ConnectionComplete); ResetTimer(&data->timer); data->state = ER_STATE_SUCCESS_MSG; } @@ -499,7 +499,7 @@ static void Task_EReader(u8 taskId) case ER_STATE_SUCCESS_MSG: if (UpdateTimer(&data->timer, 120)) { - AddTextPrinterToWindow1(gJPText_NewTrainerHasComeToHoenn); + MG_AddMessageTextPrinter(gJPText_NewTrainerHasComeToHoenn); PlayFanfare(MUS_OBTAIN_ITEM); data->state = ER_STATE_SUCCESS_END; } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index ae48223c3..e1a02e3ee 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -499,7 +499,7 @@ static const struct SpritePalette sObjectEventSpritePalettes[] = { {gObjectEventPal_RubySapphireBrendan, OBJ_EVENT_PAL_TAG_RS_BRENDAN}, {gObjectEventPal_RubySapphireMay, OBJ_EVENT_PAL_TAG_RS_MAY}, #ifdef BUGFIX - {NULL, OBJ_EVENT_PAL_TAG_NONE}, + {NULL, OBJ_EVENT_PAL_TAG_NONE}, #else {}, // BUG: FindObjectEventPaletteIndexByTag looks for OBJ_EVENT_PAL_TAG_NONE and not 0x0. // If it's looking for a tag that isn't in this table, the game locks in an infinite loop. diff --git a/src/expansion_intro.c b/src/expansion_intro.c new file mode 100644 index 000000000..e37ea4b2e --- /dev/null +++ b/src/expansion_intro.c @@ -0,0 +1,417 @@ +#include "global.h" +#include "bg.h" +#include "decompress.h" +#include "palette.h" +#include "sound.h" +#include "sprite.h" +#include "task.h" +#include "gpu_regs.h" +#include "trig.h" +#include "main.h" +#include "intro.h" +#include "m4a.h" +#include "expansion_intro.h" +#include "constants/rgb.h" +#include "constants/songs.h" + +#if EXPANSION_INTRO == TRUE + +#define TAG_DIZZY 20000 +#define TAG_PORYGON 20001 + +#define PAL_TAG_DIZZY 20000 +#define PAL_TAG_PORYGON 20001 + +#define DIZZY_POS_X 300 +#define DIZZY_POS_Y 138 +#define DIZZY_COLLISION_POS_X 172 +#define PORY_POS_X -32 +#define PORY_POS_Y 115 +#define PORYGON_COLLISION_POS_X 140 +#define PORYGON_WAIT_TIME 99 + +#define DIZZY_ANIM_SPEED 4 +#define DIZZY_STARS_SPEED 12 + +enum +{ + EXPANSION_INTRO_BG2, + EXPANSION_INTRO_BG3 +}; + +enum +{ + ANIM_PORY_IDLE, + ANIM_PORY_HIT, + ANIM_PORY_GO_UP +}; + +enum +{ + ANIM_DIZZY_WALKING, + ANIM_DIZZY_DIZZY +}; + +static const u32 sBgTiles_PoweredBy[] = INCBIN_U32("graphics/expansion_intro/powered_by.4bpp.lz"); +static const u32 sBgTiles_RhhCredits[] = INCBIN_U32("graphics/expansion_intro/rhh_credits.8bpp.lz"); +static const u32 sBgMap_PoweredBy[] = INCBIN_U32("graphics/expansion_intro/powered_by.bin.lz"); +static const u32 sBgMap_RhhCredits[] = INCBIN_U32("graphics/expansion_intro/rhh_credits.bin.lz"); +static const u32 sBgPal_Credits[] = INCBIN_U32("graphics/expansion_intro/credits.gbapal.lz"); +static const u32 sSpriteTiles_DizzyEgg[] = INCBIN_U32("graphics/expansion_intro/sprites/dizzy_egg.4bpp.lz"); +static const u32 sSpriteTiles_Porygon[] = INCBIN_U32("graphics/expansion_intro/sprites/porygon.4bpp.lz"); +static const u16 sSpritePal_DizzyEgg[] = INCBIN_U16("graphics/expansion_intro/sprites/dizzy_egg.gbapal"); +static const u16 sSpritePal_Porygon[] = INCBIN_U16("graphics/expansion_intro/sprites/porygon.gbapal"); +static const u16 sSpritePal_PorygonShiny[] = INCBIN_U16("graphics/expansion_intro/sprites/shiny.gbapal"); + +static void SpriteCallback_DizzyWalking(struct Sprite* sprite); +static void SpriteCallback_PorygonFlying(struct Sprite* sprite); +static void Task_ExpansionIntro_HandleBlend(u8 taskId); +static void VBlankCB_ExpansionIntro(void); +static void ExpansionIntro_InitBgs(); +static void ExpansionIntro_StartBlend(); +static void ExpansionIntro_LoadGraphics(); +static void ExpansionIntro_CreateSprites(); + +static const union AnimCmd sAnimCmd_DizzyWalking[] = +{ + ANIMCMD_FRAME(32, DIZZY_ANIM_SPEED), + ANIMCMD_FRAME(16, DIZZY_ANIM_SPEED), + ANIMCMD_FRAME(0, DIZZY_ANIM_SPEED), + ANIMCMD_FRAME(16, DIZZY_ANIM_SPEED), + ANIMCMD_FRAME(32, DIZZY_ANIM_SPEED), + ANIMCMD_FRAME(48, DIZZY_ANIM_SPEED), + ANIMCMD_FRAME(64, DIZZY_ANIM_SPEED), + ANIMCMD_FRAME(48, DIZZY_ANIM_SPEED), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd sAnimCmd_DizzyisDizzy[] = +{ + ANIMCMD_FRAME(80, DIZZY_STARS_SPEED), + ANIMCMD_FRAME(96, DIZZY_STARS_SPEED), + ANIMCMD_FRAME(112, DIZZY_STARS_SPEED), + ANIMCMD_FRAME(96, DIZZY_STARS_SPEED), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd *const sAnimCmdTable_DizzyEgg[] = +{ + [ANIM_DIZZY_WALKING] = sAnimCmd_DizzyWalking, + [ANIM_DIZZY_DIZZY] = sAnimCmd_DizzyisDizzy, +}; + +static const union AnimCmd sAnimCmd_PorygonIdle[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END, +}; + +static const union AnimCmd sAnimCmd_PorygonHitted[] = +{ + ANIMCMD_FRAME(64, 0), + ANIMCMD_END, +}; + +static const union AnimCmd sAnimCmd_PorygonGoUp[] = +{ + ANIMCMD_FRAME(64, 20), + ANIMCMD_FRAME(128, 10), + ANIMCMD_END, +}; + +static const union AnimCmd *const sAnimCmdTable_Porygon[] = +{ + [ANIM_PORY_IDLE] = sAnimCmd_PorygonIdle, + [ANIM_PORY_HIT] = sAnimCmd_PorygonHitted, + [ANIM_PORY_GO_UP] = sAnimCmd_PorygonGoUp, +}; + +static const union AffineAnimCmd sAffineAnimCmd_PorygonScale[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_END, +}; + +static const union AffineAnimCmd *const sAffineAnimCmdTable_Porygon[] = +{ + sAffineAnimCmd_PorygonScale, +}; + +static const struct CompressedSpriteSheet sSpriteSheet_DizzyEgg = +{ + .data = sSpriteTiles_DizzyEgg, + .size = 0x1000, + .tag = TAG_DIZZY, +}; + +static const struct CompressedSpriteSheet sSpriteSheet_Porygon = +{ + .data = sSpriteTiles_Porygon, + .size = 0x2800, + .tag = PAL_TAG_PORYGON, +}; + +static const struct SpritePalette sSpritePalette_DizzyEgg = +{ + .data = sSpritePal_DizzyEgg, + .tag = PAL_TAG_DIZZY, +}; + +static const struct SpritePalette sSpritePalette_Porygon = +{ + .data = sSpritePal_Porygon, + .tag = PAL_TAG_PORYGON, +}; + +static const struct OamData sOamData_DizzyEgg = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .mosaic = 0, + .bpp = ST_OAM_4BPP, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .priority = 0, +}; + +static const struct OamData sOamData_Porygon = +{ + .affineMode = ST_OAM_AFFINE_NORMAL, + .objMode = ST_OAM_OBJ_NORMAL, + .mosaic = 0, + .bpp = ST_OAM_4BPP, + .shape = SPRITE_SHAPE(64x64), + .size = SPRITE_SIZE(64x64), + .priority = 0, +}; + +static const struct SpriteTemplate sSpriteTemplate_DizzyEgg = +{ + .tileTag = TAG_DIZZY, + .paletteTag = PAL_TAG_DIZZY, + .oam = &sOamData_DizzyEgg, + .anims = sAnimCmdTable_DizzyEgg, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallback_DizzyWalking, +}; + +static const struct SpriteTemplate sSpriteTemplate_Porygon = +{ + .tileTag = TAG_PORYGON, + .paletteTag = PAL_TAG_PORYGON, + .oam = &sOamData_Porygon, + .anims = sAnimCmdTable_Porygon, + .images = NULL, + .affineAnims = sAffineAnimCmdTable_Porygon, + .callback = SpriteCallback_PorygonFlying, +}; + +static const struct BgTemplate sBgTemplates_RhhCopyrightScreen[] = +{ + [EXPANSION_INTRO_BG2] = { + .bg = 2, + .charBaseIndex = 1, + .mapBaseIndex = 20, + .screenSize = 2, + .paletteMode = 1 + }, + [EXPANSION_INTRO_BG3] = { + .bg = 3, + .mapBaseIndex = 22, + .screenSize = 2 + }, +}; + +void CB2_ExpansionIntro(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); +} + +#define tState gTasks[taskId].data[0] +#define tFrameCounter gTasks[taskId].data[1] +void Task_HandleExpansionIntro(u8 taskId) +{ + switch (tState) + { + case 0: + SetVBlankCallback(VBlankCB_ExpansionIntro); + ExpansionIntro_InitBgs(); + ExpansionIntro_LoadGraphics(); + CpuFastFill16(RGB_BLACK, gPlttBufferFaded, 32); + ShowBg(3); + BeginNormalPaletteFade(1, 0, 16, 0, RGB_BLACK); + ExpansionIntro_StartBlend(); + ExpansionIntro_CreateSprites(); + tState++; + break; + case 1: + if (!gPaletteFade.active) + tState++; + break; + case 2: + if (tFrameCounter == 208) + { + tState++; + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); + } + else if (gMain.newKeys != 0) + { + CpuFill16(0, gPlttBufferFaded, sizeof(gPlttBufferFaded)); + if (IsCryPlaying()) + StopCry(); + m4aSongNumStop(SE_BIKE_HOP); + m4aSongNumStop(SE_M_DOUBLE_SLAP); + tState++; + } + else + { + tFrameCounter++; + } + break; + case 3: + if (!gPaletteFade.active) + { + ResetSpriteData(); + FreeAllSpritePalettes(); + DestroyTask(taskId); + CreateTask(Task_Scene1_Load, 0); + SetMainCallback2(MainCB2_Intro); + } + break; + } +} +#undef tState + +static void VBlankCB_ExpansionIntro(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +static void ExpansionIntro_InitBgs(void) +{ + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, sBgTemplates_RhhCopyrightScreen, ARRAY_COUNT(sBgTemplates_RhhCopyrightScreen)); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_EFFECT_DARKEN); + SetGpuReg(REG_OFFSET_BLDY, 0x1F); + HideBg(0); + HideBg(1); + HideBg(2); + HideBg(3); +} + +static void ExpansionIntro_LoadGraphics(void) +{ + LZ77UnCompVram(sBgTiles_PoweredBy, (void*) BG_CHAR_ADDR(sBgTemplates_RhhCopyrightScreen[EXPANSION_INTRO_BG3].charBaseIndex)); + LZ77UnCompVram(sBgMap_PoweredBy, (u16*) BG_SCREEN_ADDR(sBgTemplates_RhhCopyrightScreen[EXPANSION_INTRO_BG3].mapBaseIndex)); + LZ77UnCompVram(sBgTiles_RhhCredits, (void*) BG_CHAR_ADDR(sBgTemplates_RhhCopyrightScreen[EXPANSION_INTRO_BG2].charBaseIndex)); + LZ77UnCompVram(sBgMap_RhhCredits, (u16*) BG_SCREEN_ADDR(sBgTemplates_RhhCopyrightScreen[EXPANSION_INTRO_BG2].mapBaseIndex)); + LoadCompressedPalette(sBgPal_Credits, 0x00, 0x60); + + LoadCompressedSpriteSheet(&sSpriteSheet_DizzyEgg); + LoadCompressedSpriteSheet(&sSpriteSheet_Porygon); + LoadSpritePalette(&sSpritePalette_DizzyEgg); + LoadSpritePalette(&sSpritePalette_Porygon); +} + +static void ExpansionIntro_CreateSprites(void) +{ + u32 dizzyId, poryId; + + dizzyId = CreateSprite(&sSpriteTemplate_DizzyEgg, 0, DIZZY_POS_Y, 0); + gSprites[dizzyId].x2 = DIZZY_POS_X; + + poryId = CreateSprite(&sSpriteTemplate_Porygon, 0, PORY_POS_Y, 0); + gSprites[poryId].x2 = PORY_POS_X; +} + +static void ExpansionIntro_StartBlend(void) +{ + ShowBg(2); + CreateTask(Task_ExpansionIntro_HandleBlend, 0); +} + +static void Task_ExpansionIntro_HandleBlend(u8 taskId) +{ + if (GetGpuReg(REG_OFFSET_BLDY) != 0) + { + SetGpuReg(REG_OFFSET_BLDY, GetGpuReg(REG_OFFSET_BLDY) - 1); + } + else + { + SetGpuReg(REG_OFFSET_BLDCNT, 0); + DestroyTask(taskId); + } +} + +#define sTimer data[0] +static void SpriteCallback_DizzyWalking(struct Sprite* sprite) +{ + sprite->x2--; + + if (sprite->x2 <= DIZZY_COLLISION_POS_X) + { + StartSpriteAnim(sprite, ANIM_DIZZY_DIZZY); + sprite->callback = SpriteCallbackDummy; + } + + if (sprite->sTimer % 16 == 0 && sprite->sTimer / 16 > 2) + PlaySE(SE_BIKE_HOP); + + sprite->sTimer++; +} + + +static void SpriteCallback_PorygonHit(struct Sprite* sprite) +{ + sprite->x2-=2; + sprite ->y2 = Sin2(180 + sprite->sTimer * 4) / 128; + + if (sprite->sTimer >= 48) + { + StartSpriteAnim(sprite, ANIM_PORY_GO_UP); + sprite->callback = SpriteCallbackDummy; + } + + if (sprite->sTimer % 8 == 0) + { + if (sprite->sTimer % 16 == 0) + LoadPalette(sSpritePal_PorygonShiny, 0x10 * (16 + sprite->oam.paletteNum), 0x20); + else + LoadPalette(sSpritePal_Porygon, 0x10 * (16 + sprite->oam.paletteNum), 0x20); + } + + sprite->sTimer++; +} + +static void SpriteCallback_PorygonFlying(struct Sprite* sprite) +{ + if (sprite->sTimer >= PORYGON_WAIT_TIME) + { + sprite->x2 += 6; + + if (sprite->sTimer % 32 >= 16) + sprite->y2--; + else + sprite->y2++; + + if (sprite->x2 >= PORYGON_COLLISION_POS_X) + { + StartSpriteAnim(sprite, ANIM_PORY_HIT); + sprite->callback = SpriteCallback_PorygonHit; + sprite->sTimer = 0; + PlaySE(SE_M_DOUBLE_SLAP); + PlayCryInternal(SPECIES_PORYGON, 0, 120, 10, 0); + } + } + sprite->sTimer++; +} +#undef sTimer + +#endif //EXPANSION_INTRO diff --git a/src/field_effect.c b/src/field_effect.c index d62b2f595..b5880b3fc 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -3831,26 +3831,38 @@ static void SpriteCB_DeoxysRockFragment(struct Sprite *sprite) DestroySprite(sprite); } +// Task data for Task_MoveDeoxysRock +#define tState data[0] +#define tSpriteId data[1] +#define tTargetX data[2] +#define tTargetY data[3] +#define tCurX data[4] +#define tCurY data[5] +#define tVelocityX data[6] +#define tVelocityY data[7] +#define tMoveSteps data[8] +#define tObjEventId data[9] + bool8 FldEff_MoveDeoxysRock(struct Sprite *sprite) { - u8 objectEventIdBuffer; - if (!TryGetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2], &objectEventIdBuffer)) + u8 objectEventId; + if (!TryGetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2], &objectEventId)) { struct ObjectEvent *object; int xPos, yPos; u8 taskId; - object = &gObjectEvents[objectEventIdBuffer]; + object = &gObjectEvents[objectEventId]; xPos = object->currentCoords.x - MAP_OFFSET; yPos = object->currentCoords.y - MAP_OFFSET; xPos = (gFieldEffectArguments[3] - xPos) * 16; yPos = (gFieldEffectArguments[4] - yPos) * 16; ShiftObjectEventCoords(object, gFieldEffectArguments[3] + MAP_OFFSET, gFieldEffectArguments[4] + MAP_OFFSET); taskId = CreateTask(Task_MoveDeoxysRock, 80); - gTasks[taskId].data[1] = object->spriteId; - gTasks[taskId].data[2] = gSprites[object->spriteId].x + xPos; - gTasks[taskId].data[3] = gSprites[object->spriteId].y + yPos; - gTasks[taskId].data[8] = gFieldEffectArguments[5]; - gTasks[taskId].data[9] = objectEventIdBuffer; + gTasks[taskId].tSpriteId = object->spriteId; + gTasks[taskId].tTargetX = gSprites[object->spriteId].x + xPos; + gTasks[taskId].tTargetY = gSprites[object->spriteId].y + yPos; + gTasks[taskId].tMoveSteps = gFieldEffectArguments[5]; + gTasks[taskId].tObjEventId = objectEventId; } return FALSE; } @@ -3858,29 +3870,30 @@ bool8 FldEff_MoveDeoxysRock(struct Sprite *sprite) static void Task_MoveDeoxysRock(u8 taskId) { s16 *data = gTasks[taskId].data; - struct Sprite *sprite = &gSprites[data[1]]; - switch (data[0]) + struct Sprite *sprite = &gSprites[tSpriteId]; + switch (tState) { case 0: - data[4] = sprite->x << 4; - data[5] = sprite->y << 4; - data[6] = SAFE_DIV(data[2] * 16 - data[4], data[8]); - data[7] = SAFE_DIV(data[3] * 16 - data[5], data[8]); - data[0]++; + tCurX = sprite->x << 4; + tCurY = sprite->y << 4; + tVelocityX = SAFE_DIV(tTargetX * 16 - tCurX, tMoveSteps); + tVelocityY = SAFE_DIV(tTargetY * 16 - tCurY, tMoveSteps); + tState++; + // fallthrough case 1: - if (data[8] != 0) + if (tMoveSteps != 0) { - data[8]--; - data[4] += data[6]; - data[5] += data[7]; - sprite->x = data[4] >> 4; - sprite->y = data[5] >> 4; + tMoveSteps--; + tCurX += tVelocityX; + tCurY += tVelocityY; + sprite->x = tCurX >> 4; + sprite->y = tCurY >> 4; } else { - struct ObjectEvent *object = &gObjectEvents[data[9]]; - sprite->x = data[2]; - sprite->y = data[3]; + struct ObjectEvent *object = &gObjectEvents[tObjEventId]; + sprite->x = tTargetX; + sprite->y = tTargetY; ShiftStillObjectEventCoords(object); object->triggerGroundEffectsOnStop = TRUE; FieldEffectActiveListRemove(FLDEFF_MOVE_DEOXYS_ROCK); @@ -3890,3 +3903,13 @@ static void Task_MoveDeoxysRock(u8 taskId) } } +#undef tState +#undef tSpriteId +#undef tTargetX +#undef tTargetY +#undef tCurX +#undef tCurY +#undef tVelocityX +#undef tVelocityY +#undef tMoveSteps +#undef tObjEventId diff --git a/src/field_region_map.c b/src/field_region_map.c index 4c94172d5..73fc14582 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -23,9 +23,15 @@ * For the fly map, and utility functions all of the maps use, see region_map.c */ -// Static type declarations +enum { + WIN_MAPSEC_NAME, + WIN_TITLE, +}; -// Static RAM declarations +enum { + TAG_PLAYER_ICON, + TAG_CURSOR, +}; static EWRAM_DATA struct { MainCallback callback; @@ -34,16 +40,12 @@ static EWRAM_DATA struct { u16 state; } *sFieldRegionMapHandler = NULL; -// Static ROM declarations - static void MCB2_InitRegionMapRegisters(void); static void VBCB_FieldUpdateRegionMap(void); static void MCB2_FieldUpdateRegionMap(void); static void FieldUpdateRegionMap(void); static void PrintRegionMapSecName(void); -// .rodata - static const struct BgTemplate sFieldRegionMapBgTemplates[] = { { .bg = 0, @@ -66,7 +68,7 @@ static const struct BgTemplate sFieldRegionMapBgTemplates[] = { static const struct WindowTemplate sFieldRegionMapWindowTemplates[] = { - { + [WIN_MAPSEC_NAME] = { .bg = 0, .tilemapLeft = 17, .tilemapTop = 17, @@ -75,7 +77,7 @@ static const struct WindowTemplate sFieldRegionMapWindowTemplates[] = .paletteNum = 15, .baseBlock = 1 }, - { + [WIN_TITLE] = { .bg = 0, .tilemapLeft = 22, .tilemapTop = 1, @@ -87,8 +89,6 @@ static const struct WindowTemplate sFieldRegionMapWindowTemplates[] = DUMMY_WIN_TEMPLATE }; -// .text - void FieldInitRegionMap(MainCallback callback) { SetVBlankCallback(NULL); @@ -145,16 +145,16 @@ static void FieldUpdateRegionMap(void) { case 0: InitRegionMap(&sFieldRegionMapHandler->regionMap, FALSE); - CreateRegionMapPlayerIcon(0, 0); - CreateRegionMapCursor(1, 1); + CreateRegionMapPlayerIcon(TAG_PLAYER_ICON, TAG_PLAYER_ICON); + CreateRegionMapCursor(TAG_CURSOR, TAG_CURSOR); sFieldRegionMapHandler->state++; break; case 1: - DrawStdFrameWithCustomTileAndPalette(1, FALSE, 0x27, 0xd); + DrawStdFrameWithCustomTileAndPalette(WIN_TITLE, FALSE, 0x27, 0xd); offset = GetStringCenterAlignXOffset(FONT_NORMAL, gText_Hoenn, 0x38); - AddTextPrinterParameterized(1, FONT_NORMAL, gText_Hoenn, offset, 1, 0, NULL); + AddTextPrinterParameterized(WIN_TITLE, FONT_NORMAL, gText_Hoenn, offset, 1, 0, NULL); ScheduleBgCopyTilemapToVram(0); - DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x27, 0xd); + DrawStdFrameWithCustomTileAndPalette(WIN_MAPSEC_NAME, FALSE, 0x27, 0xd); PrintRegionMapSecName(); BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); sFieldRegionMapHandler->state++; @@ -203,13 +203,13 @@ static void PrintRegionMapSecName(void) { if (sFieldRegionMapHandler->regionMap.mapSecType != MAPSECTYPE_NONE) { - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized(0, FONT_NORMAL, sFieldRegionMapHandler->regionMap.mapSecName, 0, 1, 0, NULL); - ScheduleBgCopyTilemapToVram(0); + FillWindowPixelBuffer(WIN_MAPSEC_NAME, PIXEL_FILL(1)); + AddTextPrinterParameterized(WIN_MAPSEC_NAME, FONT_NORMAL, sFieldRegionMapHandler->regionMap.mapSecName, 0, 1, 0, NULL); + ScheduleBgCopyTilemapToVram(WIN_MAPSEC_NAME); } else { - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - CopyWindowToVram(0, COPYWIN_FULL); + FillWindowPixelBuffer(WIN_MAPSEC_NAME, PIXEL_FILL(1)); + CopyWindowToVram(WIN_MAPSEC_NAME, COPYWIN_FULL); } } diff --git a/src/field_specials.c b/src/field_specials.c index eb622f1f6..3996b739a 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -46,6 +46,7 @@ #include "wallclock.h" #include "window.h" #include "constants/battle_frontier.h" +#include "constants/battle_pyramid.h" #include "constants/battle_tower.h" #include "constants/decorations.h" #include "constants/event_objects.h" @@ -67,6 +68,15 @@ #include "palette.h" #include "battle_util.h" +#define TAG_ITEM_ICON 5500 + +#define GFXTAG_MULTICHOICE_SCROLL_ARROWS 2000 +#define PALTAG_MULTICHOICE_SCROLL_ARROWS 100 + +#define ELEVATOR_WINDOW_WIDTH 3 +#define ELEVATOR_WINDOW_HEIGHT 3 +#define ELEVATOR_LIGHT_STAGES 3 + EWRAM_DATA bool8 gBikeCyclingChallenge = FALSE; EWRAM_DATA u8 gBikeCollisions = 0; static EWRAM_DATA u32 sBikeCyclingTimer = 0; @@ -95,8 +105,8 @@ static void LoadLinkPartnerObjectEventSpritePalette(u8, u8, u8); static void Task_PetalburgGymSlideOpenRoomDoors(u8); static void PetalburgGymSetDoorMetatiles(u8, u16); static void Task_PCTurnOnEffect(u8); -static void PCTurnOnEffect_0(struct Task *); -static void PCTurnOnEffect_1(s16, s8, s8); +static void PCTurnOnEffect(struct Task *); +static void PCTurnOnEffect_SetMetatile(s16, s8, s8); static void PCTurnOffEffect(void); static void Task_LotteryCornerComputerEffect(u8); static void LotteryCornerComputerEffect(struct Task *); @@ -969,34 +979,44 @@ static bool8 IsPlayerInFrontOfPC(void) || tileInFront == METATILE_Building_PC_Off); } +// Task data for Task_PCTurnOnEffect and Task_LotteryCornerComputerEffect +#define tPaused data[0] // Never set +#define tTaskId data[1] +#define tFlickerCount data[2] +#define tTimer data[3] +#define tIsScreenOn data[4] + +// For this special, gSpecialVar_0x8004 is expected to be some PC_LOCATION_* value. void DoPCTurnOnEffect(void) { if (FuncIsActiveTask(Task_PCTurnOnEffect) != TRUE && IsPlayerInFrontOfPC() == TRUE) { u8 taskId = CreateTask(Task_PCTurnOnEffect, 8); - gTasks[taskId].data[0] = 0; - gTasks[taskId].data[1] = taskId; - gTasks[taskId].data[2] = 0; - gTasks[taskId].data[3] = 0; - gTasks[taskId].data[4] = 0; + gTasks[taskId].tPaused = FALSE; + gTasks[taskId].tTaskId = taskId; + gTasks[taskId].tFlickerCount = 0; + gTasks[taskId].tTimer = 0; + gTasks[taskId].tIsScreenOn = FALSE; } } static void Task_PCTurnOnEffect(u8 taskId) { struct Task *task = &gTasks[taskId]; - if (task->data[0] == 0) - PCTurnOnEffect_0(task); + if (!task->tPaused) + PCTurnOnEffect(task); } -static void PCTurnOnEffect_0(struct Task *task) +static void PCTurnOnEffect(struct Task *task) { u8 playerDirection; s8 dx = 0; s8 dy = 0; - if (task->data[3] == 6) + if (task->tTimer == 6) { - task->data[3] = 0; + task->tTimer = 0; + + // Get where the PC should be, depending on where the player is looking. playerDirection = GetPlayerFacingDirection(); switch (playerDirection) { @@ -1013,39 +1033,47 @@ static void PCTurnOnEffect_0(struct Task *task) dy = -1; break; } - PCTurnOnEffect_1(task->data[4], dx, dy); + + // Update map + PCTurnOnEffect_SetMetatile(task->tIsScreenOn, dx, dy); DrawWholeMapView(); - task->data[4] ^= 1; - if ((++task->data[2]) == 5) - DestroyTask(task->data[1]); + + // Screen flickers 5 times. Odd number and starting with the + // screen off means the animation ends with the screen on. + task->tIsScreenOn ^= 1; + if (++task->tFlickerCount == 5) + DestroyTask(task->tTaskId); } - task->data[3]++; + task->tTimer++; } -static void PCTurnOnEffect_1(s16 isPcTurnedOn, s8 dx, s8 dy) +static void PCTurnOnEffect_SetMetatile(s16 isScreenOn, s8 dx, s8 dy) { - u16 tileId = 0; - if (isPcTurnedOn) + u16 metatileId = 0; + if (isScreenOn) { + // Screen is on, set it off if (gSpecialVar_0x8004 == PC_LOCATION_OTHER) - tileId = METATILE_Building_PC_Off; + metatileId = METATILE_Building_PC_Off; else if (gSpecialVar_0x8004 == PC_LOCATION_BRENDANS_HOUSE) - tileId = METATILE_BrendansMaysHouse_BrendanPC_Off; + metatileId = METATILE_BrendansMaysHouse_BrendanPC_Off; else if (gSpecialVar_0x8004 == PC_LOCATION_MAYS_HOUSE) - tileId = METATILE_BrendansMaysHouse_MayPC_Off; + metatileId = METATILE_BrendansMaysHouse_MayPC_Off; } else { + // Screen is off, set it on if (gSpecialVar_0x8004 == PC_LOCATION_OTHER) - tileId = METATILE_Building_PC_On; + metatileId = METATILE_Building_PC_On; else if (gSpecialVar_0x8004 == PC_LOCATION_BRENDANS_HOUSE) - tileId = METATILE_BrendansMaysHouse_BrendanPC_On; + metatileId = METATILE_BrendansMaysHouse_BrendanPC_On; else if (gSpecialVar_0x8004 == PC_LOCATION_MAYS_HOUSE) - tileId = METATILE_BrendansMaysHouse_MayPC_On; + metatileId = METATILE_BrendansMaysHouse_MayPC_On; } - MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + MAP_OFFSET, gSaveBlock1Ptr->pos.y + dy + MAP_OFFSET, tileId | MAPGRID_COLLISION_MASK); + MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + MAP_OFFSET, gSaveBlock1Ptr->pos.y + dy + MAP_OFFSET, metatileId | MAPGRID_COLLISION_MASK); } +// For this special, gSpecialVar_0x8004 is expected to be some PC_LOCATION_* value. void DoPCTurnOffEffect(void) { PCTurnOffEffect(); @@ -1055,7 +1083,9 @@ static void PCTurnOffEffect(void) { s8 dx = 0; s8 dy = 0; - u16 tileId = 0; + u16 metatileId = 0; + + // Get where the PC should be, depending on where the player is looking. u8 playerDirection = GetPlayerFacingDirection(); if (IsPlayerInFrontOfPC() == FALSE) @@ -1075,13 +1105,15 @@ static void PCTurnOffEffect(void) dy = -1; break; } + if (gSpecialVar_0x8004 == PC_LOCATION_OTHER) - tileId = METATILE_Building_PC_Off; + metatileId = METATILE_Building_PC_Off; else if (gSpecialVar_0x8004 == PC_LOCATION_BRENDANS_HOUSE) - tileId = METATILE_BrendansMaysHouse_BrendanPC_Off; + metatileId = METATILE_BrendansMaysHouse_BrendanPC_Off; else if (gSpecialVar_0x8004 == PC_LOCATION_MAYS_HOUSE) - tileId = METATILE_BrendansMaysHouse_MayPC_Off; - MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + MAP_OFFSET, gSaveBlock1Ptr->pos.y + dy + MAP_OFFSET, tileId | MAPGRID_COLLISION_MASK); + metatileId = METATILE_BrendansMaysHouse_MayPC_Off; + + MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + MAP_OFFSET, gSaveBlock1Ptr->pos.y + dy + MAP_OFFSET, metatileId | MAPGRID_COLLISION_MASK); DrawWholeMapView(); } @@ -1090,42 +1122,47 @@ void DoLotteryCornerComputerEffect(void) if (FuncIsActiveTask(Task_LotteryCornerComputerEffect) != TRUE) { u8 taskId = CreateTask(Task_LotteryCornerComputerEffect, 8); - gTasks[taskId].data[0] = 0; - gTasks[taskId].data[1] = taskId; - gTasks[taskId].data[2] = 0; - gTasks[taskId].data[3] = 0; - gTasks[taskId].data[4] = 0; + gTasks[taskId].tPaused = FALSE; + gTasks[taskId].tTaskId = taskId; + gTasks[taskId].tFlickerCount = 0; + gTasks[taskId].tTimer = 0; + gTasks[taskId].tIsScreenOn = FALSE; } } static void Task_LotteryCornerComputerEffect(u8 taskId) { struct Task *task = &gTasks[taskId]; - if (task->data[0] == 0) + if (!task->tPaused) LotteryCornerComputerEffect(task); } static void LotteryCornerComputerEffect(struct Task *task) { - if (task->data[3] == 6) + if (task->tTimer == 6) { - task->data[3] = 0; - if (task->data[4] != 0) + task->tTimer = 0; + if (task->tIsScreenOn) { + // Screen is on, set it off MapGridSetMetatileIdAt(11 + MAP_OFFSET, 1 + MAP_OFFSET, METATILE_Shop_Laptop1_Normal | MAPGRID_COLLISION_MASK); MapGridSetMetatileIdAt(11 + MAP_OFFSET, 2 + MAP_OFFSET, METATILE_Shop_Laptop2_Normal | MAPGRID_COLLISION_MASK); } else { + // Screen is off, set it on MapGridSetMetatileIdAt(11 + MAP_OFFSET, 1 + MAP_OFFSET, METATILE_Shop_Laptop1_Flash | MAPGRID_COLLISION_MASK); MapGridSetMetatileIdAt(11 + MAP_OFFSET, 2 + MAP_OFFSET, METATILE_Shop_Laptop2_Flash | MAPGRID_COLLISION_MASK); } DrawWholeMapView(); - task->data[4] ^= 1; - if ((++task->data[2]) == 5) - DestroyTask(task->data[1]); + + // Screen flickers 5 times. Odd number and starting with the + // screen off means the animation ends with the screen on. + task->tIsScreenOn ^= 1; + if (++task->tFlickerCount == 5) + DestroyTask(task->tTaskId); } - task->data[3]++; + task->tTimer++; } void EndLotteryCornerComputerEffect(void) @@ -1135,6 +1172,12 @@ void EndLotteryCornerComputerEffect(void) DrawWholeMapView(); } +#undef tPaused +#undef tTaskId +#undef tFlickerCount +#undef tTimer +#undef tIsScreenOn + void SetTrickHouseNuggetFlag(void) { u16 *specVar = &gSpecialVar_0x8004; @@ -1219,7 +1262,7 @@ void SpawnCameraObject(void) OBJ_EVENT_ID_CAMERA, gSaveBlock1Ptr->pos.x + MAP_OFFSET, gSaveBlock1Ptr->pos.y + MAP_OFFSET, - 3); + 3); // elevation gObjectEvents[obj].invisible = TRUE; CameraObjectSetFollowedSpriteId(gObjectEvents[obj].spriteId); } @@ -1384,7 +1427,7 @@ void SetShoalItemFlag(u16 unused) FlagSet(FLAG_SYS_SHOAL_ITEM); } -void PutZigzagoonInPlayerParty(void) +void LoadWallyZigzagoon(void) { u16 monData; CreateMon(&gPlayerParty[0], SPECIES_ZIGZAGOON, 7, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0); @@ -1424,20 +1467,21 @@ bool8 IsPokerusInParty(void) return TRUE; } -#define horizontalPan data[0] -#define delayCounter data[1] -#define numShakes data[2] -#define delay data[3] -#define verticalPan data[4] +// Task data for Task_ShakeCamera +#define tHorizontalPan data[0] +#define tDelayCounter data[1] +#define tNumShakes data[2] +#define tDelay data[3] +#define tVerticalPan data[4] void ShakeCamera(void) { u8 taskId = CreateTask(Task_ShakeCamera, 9); - gTasks[taskId].horizontalPan = gSpecialVar_0x8005; - gTasks[taskId].delayCounter = 0; - gTasks[taskId].numShakes = gSpecialVar_0x8006; - gTasks[taskId].delay = gSpecialVar_0x8007; - gTasks[taskId].verticalPan = gSpecialVar_0x8004; + gTasks[taskId].tHorizontalPan = gSpecialVar_0x8005; + gTasks[taskId].tDelayCounter = 0; + gTasks[taskId].tNumShakes = gSpecialVar_0x8006; + gTasks[taskId].tDelay = gSpecialVar_0x8007; + gTasks[taskId].tVerticalPan = gSpecialVar_0x8004; SetCameraPanningCallback(NULL); PlaySE(SE_M_STRENGTH); } @@ -1446,15 +1490,15 @@ static void Task_ShakeCamera(u8 taskId) { s16 *data = gTasks[taskId].data; - delayCounter++; - if (delayCounter % delay == 0) + tDelayCounter++; + if (tDelayCounter % tDelay == 0) { - delayCounter = 0; - numShakes--; - horizontalPan = -horizontalPan; - verticalPan = -verticalPan; - SetCameraPanning(horizontalPan, verticalPan); - if (numShakes == 0) + tDelayCounter = 0; + tNumShakes--; + tHorizontalPan = -tHorizontalPan; + tVerticalPan = -tVerticalPan; + SetCameraPanning(tHorizontalPan, tVerticalPan); + if (tNumShakes == 0) { StopCameraShake(taskId); InstallCameraPanAheadCallback(); @@ -1468,11 +1512,11 @@ static void StopCameraShake(u8 taskId) ScriptContext_Enable(); } -#undef horizontalPan -#undef delayCounter -#undef numShakes -#undef delay -#undef verticalPan +#undef tHorizontalPan +#undef tDelayCounter +#undef tNumShakes +#undef tDelay +#undef tVerticalPan bool8 FoundBlackGlasses(void) { @@ -1497,7 +1541,8 @@ u8 GetLeadMonIndex(void) u8 partyCount = CalculatePlayerPartyCount(); for (i = 0; i < partyCount; i++) { - if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_EGG && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != 0) + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_EGG + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_NONE) return i; } return 0; @@ -1637,7 +1682,7 @@ void OffsetCameraForBattle(void) SetCameraPanning(8, 0); } -const struct WindowTemplate gElevatorFloor_WindowTemplate = +static const struct WindowTemplate sWindowTemplate_ElevatorFloor = { .bg = 0, .tilemapLeft = 21, @@ -1648,7 +1693,7 @@ const struct WindowTemplate gElevatorFloor_WindowTemplate = .baseBlock = 8, }; -const u8 *const gDeptStoreFloorNames[] = +static const u8 *const sDeptStoreFloorNames[] = { [DEPT_STORE_FLOORNUM_B4F] = gText_B4F, [DEPT_STORE_FLOORNUM_B3F] = gText_B3F, @@ -1668,7 +1713,7 @@ const u8 *const gDeptStoreFloorNames[] = [DEPT_STORE_FLOORNUM_ROOFTOP] = gText_Rooftop }; -static const u16 sElevatorWindowTiles_Ascending[][3] = +static const u16 sElevatorWindowTiles_Ascending[ELEVATOR_WINDOW_HEIGHT][ELEVATOR_LIGHT_STAGES] = { { METATILE_BattleFrontier_Elevator_Top0, @@ -1687,7 +1732,7 @@ static const u16 sElevatorWindowTiles_Ascending[][3] = }, }; -static const u16 sElevatorWindowTiles_Descending[][3] = +static const u16 sElevatorWindowTiles_Descending[ELEVATOR_WINDOW_HEIGHT][ELEVATOR_LIGHT_STAGES] = { { METATILE_BattleFrontier_Elevator_Top0, @@ -1771,53 +1816,66 @@ u16 GetDeptStoreDefaultFloorChoice(void) return sLilycoveDeptStore_DefaultFloorChoice; } +// Task data for Task_MoveElevator +#define tTimer data[1] +#define tMoveCounter data[2] +#define tVerticalPan data[4] +#define tTotalMoves data[5] +#define tDescending data[6] + +// The maximum considered difference between floors. +// Elevator trips with a larger difference are treated the same +// (i.e. traveling 9 floors and 200 floors would take the same amount of time). +#define MAX_ELEVATOR_TRIP 9 + +// gSpecialVar_0x8005 here is expected to be the current floor number, and +// gSpecialVar_0x8006 is expected to be the destination floor number. void MoveElevator(void) { - static const u8 sElevatorTripLength[] = { 8, 16, 24, 32, 38, 46, 52, 56, 57 }; + static const u8 sElevatorTripLength[MAX_ELEVATOR_TRIP] = { 8, 16, 24, 32, 38, 46, 52, 56, 57 }; s16 *data = gTasks[CreateTask(Task_MoveElevator, 9)].data; u16 floorDelta; - data[1] = 0; - data[2] = 0; - data[4] = 1; + tTimer = 0; + tMoveCounter = 0; + tVerticalPan = 1; - // descending if (gSpecialVar_0x8005 > gSpecialVar_0x8006) { floorDelta = gSpecialVar_0x8005 - gSpecialVar_0x8006; - data[6] = TRUE; + tDescending = TRUE; } else { floorDelta = gSpecialVar_0x8006 - gSpecialVar_0x8005; - data[6] = FALSE; + tDescending = FALSE; } - if (floorDelta > 8) - floorDelta = 8; + if (floorDelta > MAX_ELEVATOR_TRIP - 1) + floorDelta = MAX_ELEVATOR_TRIP - 1; - data[5] = sElevatorTripLength[floorDelta]; + tTotalMoves = sElevatorTripLength[floorDelta]; SetCameraPanningCallback(NULL); - MoveElevatorWindowLights(floorDelta, data[6]); + MoveElevatorWindowLights(floorDelta, tDescending); PlaySE(SE_ELEVATOR); } static void Task_MoveElevator(u8 taskId) { s16 *data = gTasks[taskId].data; - data[1]++; - if (data[1] % 3 == 0) + tTimer++; + if (tTimer % 3 == 0) { - data[1] = 0; - data[2]++; - data[4] = -data[4]; - SetCameraPanning(0, data[4]); + tTimer = 0; + tMoveCounter++; + tVerticalPan = -tVerticalPan; + SetCameraPanning(0, tVerticalPan); - // arrived at floor - if (data[2] == data[5]) + if (tMoveCounter == tTotalMoves) { + // Arrived at floor PlaySE(SE_DING_DONG); DestroyTask(taskId); ScriptContext_Enable(); @@ -1826,18 +1884,24 @@ static void Task_MoveElevator(u8 taskId) } } +#undef tTimer +#undef tMoveCounter +#undef tVerticalPan +#undef tTotalMoves +#undef tDescending + void ShowDeptStoreElevatorFloorSelect(void) { int xPos; - sTutorMoveAndElevatorWindowId = AddWindow(&gElevatorFloor_WindowTemplate); + sTutorMoveAndElevatorWindowId = AddWindow(&sWindowTemplate_ElevatorFloor); SetStandardWindowBorderStyle(sTutorMoveAndElevatorWindowId, FALSE); xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gText_ElevatorNowOn, 64); AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, gText_ElevatorNowOn, xPos, 1, TEXT_SKIP_DRAW, NULL); - xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gDeptStoreFloorNames[gSpecialVar_0x8005], 64); - AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, gDeptStoreFloorNames[gSpecialVar_0x8005], xPos, 17, TEXT_SKIP_DRAW, NULL); + xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sDeptStoreFloorNames[gSpecialVar_0x8005], 64); + AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, sDeptStoreFloorNames[gSpecialVar_0x8005], xPos, 17, TEXT_SKIP_DRAW, NULL); PutWindowTilemap(sTutorMoveAndElevatorWindowId); CopyWindowToVram(sTutorMoveAndElevatorWindowId, COPYWIN_FULL); @@ -1849,17 +1913,23 @@ void CloseDeptStoreElevatorWindow(void) RemoveWindow(sTutorMoveAndElevatorWindowId); } +// Task data for Task_MoveElevatorWindowLights +#define tMoveCounter data[0] +#define tTimer data[1] +#define tDescending data[2] +#define tTotalMoves data[3] + static void MoveElevatorWindowLights(u16 floorDelta, bool8 descending) { - static const u8 sElevatorLightCycles[] = { 3, 6, 9, 12, 15, 18, 21, 24, 27 }; + static const u8 sElevatorLightCycles[MAX_ELEVATOR_TRIP] = { 3, 6, 9, 12, 15, 18, 21, 24, 27 }; if (FuncIsActiveTask(Task_MoveElevatorWindowLights) != TRUE) { u8 taskId = CreateTask(Task_MoveElevatorWindowLights, 8); - gTasks[taskId].data[0] = 0; - gTasks[taskId].data[1] = 0; - gTasks[taskId].data[2] = descending; - gTasks[taskId].data[3] = sElevatorLightCycles[floorDelta]; + gTasks[taskId].tMoveCounter = 0; + gTasks[taskId].tTimer = 0; + gTasks[taskId].tDescending = descending; + gTasks[taskId].tTotalMoves = sElevatorLightCycles[floorDelta]; } } @@ -1868,36 +1938,41 @@ static void Task_MoveElevatorWindowLights(u8 taskId) u8 x, y; s16 *data = gTasks[taskId].data; - if (data[1] == 6) + if (tTimer == 6) { - data[0]++; + tMoveCounter++; - // ascending - if (data[2] == FALSE) + if (!tDescending) { - for (y = 0; y < 3; y++) + // Ascending + for (y = 0; y < ELEVATOR_WINDOW_HEIGHT; y++) { - for (x = 0; x < 3; x++) - MapGridSetMetatileIdAt(x + MAP_OFFSET + 1, y + MAP_OFFSET, sElevatorWindowTiles_Ascending[y][data[0] % 3] | MAPGRID_COLLISION_MASK); + for (x = 0; x < ELEVATOR_WINDOW_WIDTH; x++) + MapGridSetMetatileIdAt(x + MAP_OFFSET + 1, y + MAP_OFFSET, sElevatorWindowTiles_Ascending[y][tMoveCounter % ELEVATOR_LIGHT_STAGES] | MAPGRID_COLLISION_MASK); } } - // descending else { - for (y = 0; y < 3; y++) + // Descending + for (y = 0; y < ELEVATOR_WINDOW_HEIGHT; y++) { - for (x = 0; x < 3; x++) - MapGridSetMetatileIdAt(x + MAP_OFFSET + 1, y + MAP_OFFSET, sElevatorWindowTiles_Descending[y][data[0] % 3] | MAPGRID_COLLISION_MASK); + for (x = 0; x < ELEVATOR_WINDOW_WIDTH; x++) + MapGridSetMetatileIdAt(x + MAP_OFFSET + 1, y + MAP_OFFSET, sElevatorWindowTiles_Descending[y][tMoveCounter % ELEVATOR_LIGHT_STAGES] | MAPGRID_COLLISION_MASK); } } DrawWholeMapView(); - data[1] = 0; - if (data[0] == data[3]) + tTimer = 0; + if (tMoveCounter == tTotalMoves) DestroyTask(taskId); } - data[1]++; + tTimer++; } +#undef tMoveCounter +#undef tTimer +#undef tDescending +#undef tTotalMoves + void BufferVarsForIVRater(void) { u8 i; @@ -1959,13 +2034,13 @@ bool8 UsedPokemonCenterWarp(void) MAP_EVER_GRANDE_CITY_POKEMON_LEAGUE_1F, MAP_BATTLE_FRONTIER_POKEMON_CENTER_1F, MAP_UNION_ROOM, - 0xFFFF + MAP_UNDEFINED }; int i; u16 map = (gLastUsedWarp.mapGroup << 8) + gLastUsedWarp.mapNum; - for (i = 0; sPokemonCenters[i] != 0xFFFF; i++) + for (i = 0; sPokemonCenters[i] != MAP_UNDEFINED; i++) { if (sPokemonCenters[i] == map) return TRUE; @@ -2663,21 +2738,21 @@ static void ScrollableMultichoice_UpdateScrollArrows(u8 taskId) .secondY = 0, .fullyUpThreshold = 0, .fullyDownThreshold = 0, - .tileTag = 2000, - .palTag = 100, + .tileTag = GFXTAG_MULTICHOICE_SCROLL_ARROWS, + .palTag = PALTAG_MULTICHOICE_SCROLL_ARROWS, .palNum = 0 }; struct Task *task = &gTasks[taskId]; struct ScrollArrowsTemplate template = sScrollableMultichoice_ScrollArrowsTemplate; - if (task->tMaxItemsOnScreen != task->data[1]) + if (task->tMaxItemsOnScreen != task->tNumItems) { template.firstX = (task->tWidth / 2) * 8 + 12 + (task->tLeft - 1) * 8; template.firstY = 8; template.secondX = (task->tWidth / 2) * 8 + 12 + (task->tLeft - 1) * 8; template.secondY = task->tHeight * 8 + 10; template.fullyUpThreshold = 0; - template.fullyDownThreshold = task->data[1] - task->tMaxItemsOnScreen; + template.fullyDownThreshold = task->tNumItems - task->tMaxItemsOnScreen; task->tScrollArrowId = AddScrollIndicatorArrowPair(&template, &sScrollableMultichoice_ScrollOffset); } } @@ -2685,10 +2760,8 @@ static void ScrollableMultichoice_UpdateScrollArrows(u8 taskId) static void ScrollableMultichoice_RemoveScrollArrows(u8 taskId) { struct Task *task = &gTasks[taskId]; - if (task->tMaxItemsOnScreen != task->data[1]) - { + if (task->tMaxItemsOnScreen != task->tNumItems) RemoveScrollIndicatorArrowPair(task->tScrollArrowId); - } } // Removed for Emerald (replaced by ShowScrollableMultichoice) @@ -2912,8 +2985,6 @@ void CloseFrontierExchangeCornerItemIconWindow(void) RemoveWindow(sFrontierExchangeCorner_ItemIconWindowId); } -#define TAG_ITEM_ICON 5500 - static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection) { #include "data/battle_frontier/battle_frontier_exchange_corner.h" @@ -3125,12 +3196,14 @@ void ScrollableMultichoice_ClosePersistentMenu(void) #undef tListTaskId #undef tTaskId +#define DEOXYS_ROCK_LEVELS 11 + void DoDeoxysRockInteraction(void) { CreateTask(Task_DeoxysRockInteraction, 8); } -static const u16 sDeoxysRockPalettes[][16] = { +static const u16 sDeoxysRockPalettes[DEOXYS_ROCK_LEVELS][16] = { INCBIN_U16("graphics/field_effects/palettes/deoxys_rock_1.gbapal"), INCBIN_U16("graphics/field_effects/palettes/deoxys_rock_2.gbapal"), INCBIN_U16("graphics/field_effects/palettes/deoxys_rock_3.gbapal"), @@ -3144,7 +3217,7 @@ static const u16 sDeoxysRockPalettes[][16] = { INCBIN_U16("graphics/field_effects/palettes/deoxys_rock_11.gbapal"), }; -static const u8 sDeoxysRockCoords[][2] = { +static const u8 sDeoxysRockCoords[DEOXYS_ROCK_LEVELS][2] = { { 15, 12 }, { 11, 14 }, { 15, 8 }, @@ -3160,11 +3233,11 @@ static const u8 sDeoxysRockCoords[][2] = { static void Task_DeoxysRockInteraction(u8 taskId) { - static const u8 sStoneMaxStepCounts[] = { 4, 8, 8, 8, 4, 4, 4, 6, 3, 3 }; + static const u8 sStoneMaxStepCounts[DEOXYS_ROCK_LEVELS - 1] = { 4, 8, 8, 8, 4, 4, 4, 6, 3, 3 }; if (FlagGet(FLAG_DEOXYS_ROCK_COMPLETE) == TRUE) { - gSpecialVar_Result = 3; + gSpecialVar_Result = DEOXYS_ROCK_COMPLETE; ScriptContext_Enable(); DestroyTask(taskId); } @@ -3179,13 +3252,13 @@ static void Task_DeoxysRockInteraction(u8 taskId) // Player failed to take the shortest path to the stone, so it resets. ChangeDeoxysRockLevel(0); VarSet(VAR_DEOXYS_ROCK_LEVEL, 0); - gSpecialVar_Result = 0; + gSpecialVar_Result = DEOXYS_ROCK_FAILED; DestroyTask(taskId); } - else if (rockLevel == 10) + else if (rockLevel == DEOXYS_ROCK_LEVELS - 1) { FlagSet(FLAG_DEOXYS_ROCK_COMPLETE); - gSpecialVar_Result = 2; + gSpecialVar_Result = DEOXYS_ROCK_SOLVED; ScriptContext_Enable(); DestroyTask(taskId); } @@ -3194,7 +3267,7 @@ static void Task_DeoxysRockInteraction(u8 taskId) rockLevel++; ChangeDeoxysRockLevel(rockLevel); VarSet(VAR_DEOXYS_ROCK_LEVEL, rockLevel); - gSpecialVar_Result = 1; + gSpecialVar_Result = DEOXYS_ROCK_PROGRESSED; DestroyTask(taskId); } } @@ -3207,9 +3280,9 @@ static void ChangeDeoxysRockLevel(u8 rockLevel) TryGetObjectEventIdByLocalIdAndMap(LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId); if (rockLevel == 0) - PlaySE(SE_M_CONFUSE_RAY); + PlaySE(SE_M_CONFUSE_RAY); // Failure sound else - PlaySE(SE_RG_DEOXYS_MOVE); + PlaySE(SE_RG_DEOXYS_MOVE); // Success sound CreateTask(WaitForDeoxysRockMovement, 8); gFieldEffectArguments[0] = LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK; @@ -3218,6 +3291,8 @@ static void ChangeDeoxysRockLevel(u8 rockLevel) gFieldEffectArguments[3] = sDeoxysRockCoords[rockLevel][0]; gFieldEffectArguments[4] = sDeoxysRockCoords[rockLevel][1]; + // Set number of movement steps. + // Resetting for failure is slow, successful movement is fast. if (rockLevel == 0) gFieldEffectArguments[5] = 60; else @@ -3735,8 +3810,9 @@ static void Task_CloseBattlePikeCurtain(u8 taskId) void GetBattlePyramidHint(void) { - gSpecialVar_Result = gSpecialVar_0x8004 / 7; - gSpecialVar_Result -= (gSpecialVar_Result / 20) * 20; + // gSpecialVar_0x8004 here is expected to be the current Battle Pyramid win streak. + gSpecialVar_Result = gSpecialVar_0x8004 / FRONTIER_STAGES_PER_CHALLENGE; + gSpecialVar_Result -= (gSpecialVar_Result / TOTAL_PYRAMID_ROUNDS) * TOTAL_PYRAMID_ROUNDS; } // Used to avoid a potential softlock if the player respawns on Dewford with no way off @@ -3771,13 +3847,13 @@ bool8 InPokemonCenter(void) MAP_TRADE_CENTER, MAP_RECORD_CORNER, MAP_BATTLE_COLOSSEUM_4P, - 0xFFFF + MAP_UNDEFINED }; int i; u16 map = (gSaveBlock1Ptr->location.mapGroup << 8) + gSaveBlock1Ptr->location.mapNum; - for (i = 0; sPokemonCenters[i] != 0xFFFF; i++) + for (i = 0; sPokemonCenters[i] != MAP_UNDEFINED; i++) { if (sPokemonCenters[i] == map) return TRUE; diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 61bd1d409..07e06ad3b 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -30,6 +30,17 @@ #include "constants/region_map_sections.h" #include "constants/songs.h" +// gFrontierPassBg_Pal has 8*16 colors, but they attempt to load 13*16 colors. +// As a result it goes out of bounds and interprets 160 bytes of whatever comes +// after gFrontierPassBg_Pal (by default, gFrontierPassBg_Gfx) as a palette. +// Nothing uses these colors (except the Trainer Card, which correctly writes them) +// so in practice this bug has no effect on the game. +#ifdef BUGFIX +#define NUM_BG_PAL_SLOTS 8 +#else +#define NUM_BG_PAL_SLOTS 13 +#endif + // All windows displayed in the frontier pass. enum { @@ -768,7 +779,7 @@ static bool32 InitFrontierPass(void) CopyBgTilemapBufferToVram(2); break; case 8: - LoadPalette(gFrontierPassBg_Pal[0], 0, 13 * PLTT_SIZE_4BPP); + LoadPalette(gFrontierPassBg_Pal, 0, NUM_BG_PAL_SLOTS * PLTT_SIZE_4BPP); LoadPalette(gFrontierPassBg_Pal[1 + sPassData->trainerStars], BG_PLTT_ID(1), PLTT_SIZE_4BPP); LoadPalette(GetTextWindowPalette(0), BG_PLTT_ID(15), PLTT_SIZE_4BPP); DrawFrontierPassBg(); @@ -1412,7 +1423,7 @@ static bool32 InitFrontierMap(void) case 5: if (FreeTempTileDataBuffersIfPossible()) return FALSE; - LoadPalette(gFrontierPassBg_Pal[0], BG_PLTT_ID(0), 13 * PLTT_SIZE_4BPP); + LoadPalette(gFrontierPassBg_Pal, BG_PLTT_ID(0), NUM_BG_PAL_SLOTS * PLTT_SIZE_4BPP); LoadPalette(GetTextWindowPalette(0), BG_PLTT_ID(15), PLTT_SIZE_4BPP); CopyToBgTilemapBuffer(2, sMapScreen_Tilemap, 0, 0); CopyBgTilemapBufferToVram(2); diff --git a/src/frontier_util.c b/src/frontier_util.c index 1863aa622..0fe2c94ea 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -497,7 +497,7 @@ static const struct FrontierBrainMon sFrontierBrainsMons[][2][FRONTIER_PARTY_SIZ }, }; -static const u8 sBattlePointAwards[NUM_FRONTIER_FACILITIES][FRONTIER_MODE_COUNT][30] = +static const u8 sBattlePointAwards[NUM_FRONTIER_FACILITIES][FRONTIER_MODE_COUNT][30] = { /* facility, mode, tier */ [FRONTIER_FACILITY_TOWER] = /* Tier: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 */ diff --git a/src/graphics.c b/src/graphics.c index c8040a827..61d0fdf75 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1381,6 +1381,7 @@ const u32 gBattleAnimBgTilemap_GigaImpactPlayer[] = INCBIN_U32("graphics/battle_ const u32 gBattleAnimBgTilemap_GigaImpactOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/giga_impact_opponent.bin.lz"); const u32 gBattleAnimBgTilemap_GigaImpactContest[] = INCBIN_U32("graphics/battle_anims/backgrounds/giga_impact_contest.bin.lz"); const u32 gBattleAnimBgImage_GigaImpact[] = INCBIN_U32("graphics/battle_anims/backgrounds/giga_impact.4bpp.lz"); +const u32 gBattleAnimBgImage_GigaImpactContest[] = INCBIN_U32("graphics/battle_anims/backgrounds/giga_impact_contest.4bpp.lz"); const u32 gBattleAnimBgPalette_GigaImpact[] = INCBIN_U32("graphics/battle_anims/backgrounds/giga_impact.gbapal.lz"); const u32 gBattleAnimBgImage_SpacialRend[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend.4bpp.lz"); @@ -2012,7 +2013,6 @@ const u16 gTitleScreenPressStartPal[] = INCBIN_U16("graphics/title_screen/p const u32 gTitleScreenPressStartGfx[] = INCBIN_U32("graphics/title_screen/press_start.4bpp.lz"); const u32 gTitleScreenPokemonLogoTilemap[] = INCBIN_U32("graphics/title_screen/pokemon_logo.bin.lz"); -// size in LoadPalette calls is reported as 0xD0 << 1, which is 0x1A0, but palette is only 0x100 bytes long so it loads garbage as well const u16 gFrontierPassBg_Pal[][16] = INCBIN_U16("graphics/frontier_pass/bg.gbapal"); const u32 gFrontierPassBg_Gfx[] = INCBIN_U32("graphics/frontier_pass/bg.4bpp.lz"); const u32 gFrontierPassMapAndCard_Gfx[] = INCBIN_U32("graphics/frontier_pass/map_and_card.8bpp.lz"); diff --git a/src/intro.c b/src/intro.c index fd9c12467..38b2f0027 100644 --- a/src/intro.c +++ b/src/intro.c @@ -23,6 +23,7 @@ #include "sound.h" #include "util.h" #include "title_screen.h" +#include "expansion_intro.h" #include "constants/rgb.h" #include "constants/battle_anim.h" @@ -37,7 +38,6 @@ */ // Scene 1 main tasks -static void Task_Scene1_Load(u8); static void Task_Scene1_FadeIn(u8); static void Task_Scene1_WaterDrops(u8); static void Task_Scene1_PanUp(u8); @@ -1033,7 +1033,7 @@ static void VBlankCB_Intro(void) ScanlineEffect_InitHBlankDmaTransfer(); } -static void MainCB2_Intro(void) +void MainCB2_Intro(void) { RunTasks(); AnimateSprites(); @@ -1112,8 +1112,13 @@ static u8 SetUpCopyrightScreen(void) case 141: if (UpdatePaletteFade()) break; +#if EXPANSION_INTRO == TRUE + SetMainCallback2(CB2_ExpansionIntro); + CreateTask(Task_HandleExpansionIntro, 0); +#else CreateTask(Task_Scene1_Load, 0); SetMainCallback2(MainCB2_Intro); +#endif if (gMultibootProgramStruct.gcmb_field_2 != 0) { if (gMultibootProgramStruct.gcmb_field_2 == 2) @@ -1160,7 +1165,7 @@ void CB2_InitCopyrightScreenAfterTitleScreen(void) #define sBigDropSpriteId data[0] -static void Task_Scene1_Load(u8 taskId) +void Task_Scene1_Load(u8 taskId) { SetVBlankCallback(NULL); sIntroCharacterGender = Random() & 1; diff --git a/src/item.c b/src/item.c index 18b6242c4..db24cb82e 100644 --- a/src/item.c +++ b/src/item.c @@ -15,18 +15,14 @@ #include "constants/items.h" #include "constants/hold_effects.h" -// this file's functions static bool8 CheckPyramidBagHasItem(u16 itemId, u16 count); static bool8 CheckPyramidBagHasSpace(u16 itemId, u16 count); -// EWRAM variables EWRAM_DATA struct BagPocket gBagPockets[POCKETS_COUNT] = {0}; -// rodata #include "data/text/item_descriptions.h" #include "data/items.h" -// code static u16 GetBagItemQuantity(u16 *quantity) { return gSaveBlock2Ptr->encryptionKey ^ *quantity; diff --git a/src/link.c b/src/link.c index de857af33..06bde1e38 100644 --- a/src/link.c +++ b/src/link.c @@ -28,6 +28,13 @@ #include "constants/rgb.h" #include "constants/trade.h" +// Window IDs for the link error screens +enum { + WIN_LINK_ERROR_TOP, + WIN_LINK_ERROR_MID, + WIN_LINK_ERROR_BOTTOM, +}; + struct BlockTransfer { u16 pos; @@ -193,8 +200,9 @@ static const struct BgTemplate sLinkErrorBgTemplates[] = { .priority = 1 } }; + static const struct WindowTemplate sLinkErrorWindowTemplates[] = { - { + [WIN_LINK_ERROR_TOP] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, @@ -202,7 +210,8 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = { .height = 5, .paletteNum = 15, .baseBlock = 0x002 - }, { + }, + [WIN_LINK_ERROR_MID] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 6, @@ -210,7 +219,8 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = { .height = 7, .paletteNum = 15, .baseBlock = 0x098 - }, { + }, + [WIN_LINK_ERROR_BOTTOM] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 13, @@ -1641,26 +1651,26 @@ static void ErrorMsg_MoveCloserToPartner(void) CopyToBgTilemapBuffer(1, sWirelessLinkDisplayTilemap, 0, 0); CopyBgTilemapBufferToVram(1); LoadPalette(sWirelessLinkDisplayPal, 0, 0x20); - FillWindowPixelBuffer(0, PIXEL_FILL(0)); - FillWindowPixelBuffer(2, PIXEL_FILL(0)); - AddTextPrinterParameterized3(0, FONT_SHORT_COPY_1, 2, 6, sTextColors, 0, gText_CommErrorEllipsis); - AddTextPrinterParameterized3(2, FONT_SHORT_COPY_1, 2, 1, sTextColors, 0, gText_MoveCloserToLinkPartner); - PutWindowTilemap(0); - PutWindowTilemap(2); - CopyWindowToVram(0, COPYWIN_NONE); // Does nothing - CopyWindowToVram(2, COPYWIN_FULL); + FillWindowPixelBuffer(WIN_LINK_ERROR_TOP, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_LINK_ERROR_BOTTOM, PIXEL_FILL(0)); + AddTextPrinterParameterized3(WIN_LINK_ERROR_TOP, FONT_SHORT_COPY_1, 2, 6, sTextColors, 0, gText_CommErrorEllipsis); + AddTextPrinterParameterized3(WIN_LINK_ERROR_BOTTOM, FONT_SHORT_COPY_1, 2, 1, sTextColors, 0, gText_MoveCloserToLinkPartner); + PutWindowTilemap(WIN_LINK_ERROR_TOP); + PutWindowTilemap(WIN_LINK_ERROR_BOTTOM); + CopyWindowToVram(WIN_LINK_ERROR_TOP, COPYWIN_NONE); // Does nothing + CopyWindowToVram(WIN_LINK_ERROR_BOTTOM, COPYWIN_FULL); } static void ErrorMsg_CheckConnections(void) { LoadBgTiles(0, sCommErrorBg_Gfx, 0x20, 0); - FillWindowPixelBuffer(1, PIXEL_FILL(0)); - FillWindowPixelBuffer(2, PIXEL_FILL(0)); - AddTextPrinterParameterized3(1, FONT_SHORT_COPY_1, 2, 0, sTextColors, 0, gText_CommErrorCheckConnections); - PutWindowTilemap(1); - PutWindowTilemap(2); - CopyWindowToVram(1, COPYWIN_NONE); // Does nothing - CopyWindowToVram(2, COPYWIN_FULL); + FillWindowPixelBuffer(WIN_LINK_ERROR_MID, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_LINK_ERROR_BOTTOM, PIXEL_FILL(0)); + AddTextPrinterParameterized3(WIN_LINK_ERROR_MID, FONT_SHORT_COPY_1, 2, 0, sTextColors, 0, gText_CommErrorCheckConnections); + PutWindowTilemap(WIN_LINK_ERROR_MID); + PutWindowTilemap(WIN_LINK_ERROR_BOTTOM); + CopyWindowToVram(WIN_LINK_ERROR_MID, COPYWIN_NONE); // Does nothing + CopyWindowToVram(WIN_LINK_ERROR_BOTTOM, COPYWIN_FULL); } static void CB2_PrintErrorMessage(void) @@ -1691,9 +1701,9 @@ static void CB2_PrintErrorMessage(void) break; case 130: if (gWirelessCommType == 2) - AddTextPrinterParameterized3(0, FONT_SHORT_COPY_1, 2, 20, sTextColors, 0, gText_ABtnTitleScreen); + AddTextPrinterParameterized3(WIN_LINK_ERROR_TOP, FONT_SHORT_COPY_1, 2, 20, sTextColors, 0, gText_ABtnTitleScreen); else if (gWirelessCommType == 1) - AddTextPrinterParameterized3(0, FONT_SHORT_COPY_1, 2, 20, sTextColors, 0, gText_ABtnRegistrationCounter); + AddTextPrinterParameterized3(WIN_LINK_ERROR_TOP, FONT_SHORT_COPY_1, 2, 20, sTextColors, 0, gText_ABtnRegistrationCounter); break; } if (gMain.state == 160) diff --git a/src/link_rfu_3.c b/src/link_rfu_3.c index 2ad7a738e..1936d3741 100644 --- a/src/link_rfu_3.c +++ b/src/link_rfu_3.c @@ -677,7 +677,7 @@ void InitHostRfuGameData(struct RfuGameData *data, u8 activity, bool32 startedAc data->compatibility.hasNews = FALSE; data->compatibility.hasCard = FALSE; data->compatibility.unknown = FALSE; - data->compatibility.isChampion = FlagGet(FLAG_IS_CHAMPION); + data->compatibility.canLinkNationally = FlagGet(FLAG_IS_CHAMPION); data->compatibility.hasNationalDex = IsNationalPokedexEnabled(); data->compatibility.gameClear = FlagGet(FLAG_SYS_GAME_CLEAR); } diff --git a/src/main_menu.c b/src/main_menu.c index 9d510c027..377cd635c 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -503,7 +503,9 @@ static const u8 *const sFemalePresetNames[] = { gText_DefaultNameHalie }; -// .text +// The number of male vs. female names is assumed to be the same. +// If they aren't, the smaller of the two sizes will be used and any extra names will be ignored. +#define NUM_PRESET_NAMES min(ARRAY_COUNT(sMalePresetNames), ARRAY_COUNT(sFemalePresetNames)) enum { @@ -1597,7 +1599,7 @@ static void Task_NewGameBirchSpeech_StartNamingScreen(u8 taskId) { FreeAllWindowBuffers(); FreeAndDestroyMonPicSprite(gTasks[taskId].tLotadSpriteId); - NewGameBirchSpeech_SetDefaultPlayerName(Random() % 20); + NewGameBirchSpeech_SetDefaultPlayerName(Random() % NUM_PRESET_NAMES); DestroyTask(taskId); DoNamingScreen(NAMING_SCREEN_PLAYER, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_NewGameBirchSpeech_ReturnFromNamingScreen); } diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 6c153772f..5422087bf 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -106,10 +106,9 @@ static const u8 sConditionToLineLength[MAX_CONDITION + 1] = 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35 }; - static const struct WindowTemplate sMoveRelearnerWindowTemplates[] = { - { + [RELEARNERWIN_DESC_BATTLE] = { .bg = 1, .tilemapLeft = 1, .tilemapTop = 1, @@ -118,7 +117,7 @@ static const struct WindowTemplate sMoveRelearnerWindowTemplates[] = .paletteNum = 15, .baseBlock = 0xA }, - { + [RELEARNERWIN_DESC_CONTEST] = { .bg = 1, .tilemapLeft = 1, .tilemapTop = 1, @@ -127,7 +126,7 @@ static const struct WindowTemplate sMoveRelearnerWindowTemplates[] = .paletteNum = 15, .baseBlock = 0xCA }, - { + [RELEARNERWIN_MOVE_LIST] = { .bg = 1, .tilemapLeft = 19, .tilemapTop = 1, @@ -136,7 +135,7 @@ static const struct WindowTemplate sMoveRelearnerWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x18A }, - { + [RELEARNERWIN_MSG] = { .bg = 1, .tilemapLeft = 4, .tilemapTop = 15, @@ -145,7 +144,8 @@ static const struct WindowTemplate sMoveRelearnerWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x202 }, - { + // Unused. Identical to sMoveRelearnerYesNoMenuTemplate + [RELEARNERWIN_YESNO] = { .bg = 0, .tilemapLeft = 22, .tilemapTop = 8, @@ -176,7 +176,7 @@ static const struct ListMenuTemplate sMoveRelearnerMovesListTemplate = .itemPrintFunc = NULL, .totalItems = 0, .maxShowed = 0, - .windowId = 2, + .windowId = RELEARNERWIN_MOVE_LIST, .header_X = 0, .item_X = 8, .cursor_X = 0, @@ -702,7 +702,7 @@ void ConditionGraph_CalcPositions(u8 *conditions, struct UCoords16 *positions) // Move relearner //---------------- -void InitMoveRelearnerWindows(bool8 useContextWindow) +void InitMoveRelearnerWindows(bool8 useContestWindow) { u8 i; @@ -714,20 +714,20 @@ void InitMoveRelearnerWindows(bool8 useContextWindow) for (i = 0; i < ARRAY_COUNT(sMoveRelearnerWindowTemplates) - 1; i++) FillWindowPixelBuffer(i, PIXEL_FILL(1)); - if (!useContextWindow) + if (!useContestWindow) { - PutWindowTilemap(0); - DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x1, 0xE); + PutWindowTilemap(RELEARNERWIN_DESC_BATTLE); + DrawStdFrameWithCustomTileAndPalette(RELEARNERWIN_DESC_BATTLE, FALSE, 0x1, 0xE); } else { - PutWindowTilemap(1); - DrawStdFrameWithCustomTileAndPalette(1, FALSE, 1, 0xE); + PutWindowTilemap(RELEARNERWIN_DESC_CONTEST); + DrawStdFrameWithCustomTileAndPalette(RELEARNERWIN_DESC_CONTEST, FALSE, 1, 0xE); } - PutWindowTilemap(2); - PutWindowTilemap(3); - DrawStdFrameWithCustomTileAndPalette(2, FALSE, 1, 0xE); - DrawStdFrameWithCustomTileAndPalette(3, FALSE, 1, 0xE); + PutWindowTilemap(RELEARNERWIN_MOVE_LIST); + PutWindowTilemap(RELEARNERWIN_MSG); + DrawStdFrameWithCustomTileAndPalette(RELEARNERWIN_MOVE_LIST, FALSE, 1, 0xE); + DrawStdFrameWithCustomTileAndPalette(RELEARNERWIN_MSG, FALSE, 1, 0xE); MoveRelearnerDummy(); ScheduleBgCopyTilemapToVram(1); } @@ -758,33 +758,34 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove) u8 buffer[32]; const u8 *str; - FillWindowPixelBuffer(0, PIXEL_FILL(1)); + FillWindowPixelBuffer(RELEARNERWIN_DESC_BATTLE, PIXEL_FILL(1)); str = gText_MoveRelearnerBattleMoves; - x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 0x80); - AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL); + x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 128); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL); str = gText_MoveRelearnerPP; - AddTextPrinterParameterized(0, FONT_NORMAL, str, 4, 0x29, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 4, 41, TEXT_SKIP_DRAW, NULL); str = gText_MoveRelearnerPower; - x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x6A); - AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 0x19, TEXT_SKIP_DRAW, NULL); + x = GetStringRightAlignXOffset(FONT_NORMAL, str, 106); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, x, 25, TEXT_SKIP_DRAW, NULL); str = gText_MoveRelearnerAccuracy; - x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x6A); - AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 0x29, TEXT_SKIP_DRAW, NULL); + x = GetStringRightAlignXOffset(FONT_NORMAL, str, 106); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, x, 41, TEXT_SKIP_DRAW, NULL); if (chosenMove == LIST_CANCEL) { - CopyWindowToVram(0, COPYWIN_GFX); + // On "Cancel", skip printing move data + CopyWindowToVram(RELEARNERWIN_DESC_BATTLE, COPYWIN_GFX); return; } move = &gBattleMoves[chosenMove]; str = gTypeNames[move->type]; - AddTextPrinterParameterized(0, FONT_NORMAL, str, 4, 0x19, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 4, 25, TEXT_SKIP_DRAW, NULL); x = 4 + GetStringWidth(FONT_NORMAL, gText_MoveRelearnerPP, 0); ConvertIntToDecimalStringN(buffer, move->pp, STR_CONV_MODE_LEFT_ALIGN, 2); - AddTextPrinterParameterized(0, FONT_NORMAL, buffer, x, 0x29, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, buffer, x, 41, TEXT_SKIP_DRAW, NULL); if (move->power < 2) { @@ -795,7 +796,7 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove) ConvertIntToDecimalStringN(buffer, move->power, STR_CONV_MODE_LEFT_ALIGN, 3); str = buffer; } - AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x19, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 106, 25, TEXT_SKIP_DRAW, NULL); if (move->accuracy == 0) { @@ -806,14 +807,14 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove) ConvertIntToDecimalStringN(buffer, move->accuracy, STR_CONV_MODE_LEFT_ALIGN, 3); str = buffer; } - AddTextPrinterParameterized(0, FONT_NORMAL, str, 0x6A, 0x29, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 106, 41, TEXT_SKIP_DRAW, NULL); if (move->effect != EFFECT_PLACEHOLDER) str = gMoveDescriptionPointers[chosenMove - 1]; else str = gNotDoneYetDescription; - AddTextPrinterParameterized(0, FONT_NARROW, str, 0, 0x41, 0, NULL); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NARROW, str, 0, 65, 0, NULL); } static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove) @@ -823,33 +824,33 @@ static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove) const struct ContestMove *move; MoveRelearnerShowHideHearts(chosenMove); - FillWindowPixelBuffer(1, PIXEL_FILL(1)); + FillWindowPixelBuffer(RELEARNERWIN_DESC_CONTEST, PIXEL_FILL(1)); str = gText_MoveRelearnerContestMovesTitle; - x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 0x80); - AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL); + x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 128); + AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NORMAL, str, x, 1, TEXT_SKIP_DRAW, NULL); str = gText_MoveRelearnerAppeal; - x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x5C); - AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 0x19, TEXT_SKIP_DRAW, NULL); + x = GetStringRightAlignXOffset(FONT_NORMAL, str, 92); + AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NORMAL, str, x, 25, TEXT_SKIP_DRAW, NULL); str = gText_MoveRelearnerJam; - x = GetStringRightAlignXOffset(FONT_NORMAL, str, 0x5C); - AddTextPrinterParameterized(1, FONT_NORMAL, str, x, 0x29, TEXT_SKIP_DRAW, NULL); + x = GetStringRightAlignXOffset(FONT_NORMAL, str, 92); + AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NORMAL, str, x, 41, TEXT_SKIP_DRAW, NULL); if (chosenMove == MENU_NOTHING_CHOSEN) { - CopyWindowToVram(1, COPYWIN_GFX); + CopyWindowToVram(RELEARNERWIN_DESC_CONTEST, COPYWIN_GFX); return; } move = &gContestMoves[chosenMove]; str = gContestMoveTypeTextPointers[move->contestCategory]; - AddTextPrinterParameterized(1, FONT_NORMAL, str, 4, 0x19, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NORMAL, str, 4, 25, TEXT_SKIP_DRAW, NULL); str = gContestEffectDescriptionPointers[move->effect]; - AddTextPrinterParameterized(1, FONT_NARROW, str, 0, 0x41, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NARROW, str, 0, 65, TEXT_SKIP_DRAW, NULL); - CopyWindowToVram(1, COPYWIN_GFX); + CopyWindowToVram(RELEARNERWIN_DESC_CONTEST, COPYWIN_GFX); } static void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *list) @@ -860,20 +861,20 @@ static void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct List MoveRelearnerMenuLoadContestMoveDescription(itemIndex); } -void MoveRelearnerPrintText(u8 *str) +void MoveRelearnerPrintMessage(u8 *str) { u8 speed; - FillWindowPixelBuffer(3, PIXEL_FILL(1)); + FillWindowPixelBuffer(RELEARNERWIN_MSG, PIXEL_FILL(1)); gTextFlags.canABSpeedUpPrint = TRUE; speed = GetPlayerTextSpeedDelay(); - AddTextPrinterParameterized2(3, FONT_NORMAL, str, speed, NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, 3); + AddTextPrinterParameterized2(RELEARNERWIN_MSG, FONT_NORMAL, str, speed, NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, 3); } bool16 MoveRelearnerRunTextPrinters(void) { RunTextPrinters(); - return IsTextPrinterActive(3); + return IsTextPrinterActive(RELEARNERWIN_MSG); } void MoveRelearnerCreateYesNoMenu(void) diff --git a/src/mini_printf.c b/src/mini_printf.c index 8345a3935..9fb4ecfac 100644 --- a/src/mini_printf.c +++ b/src/mini_printf.c @@ -41,7 +41,7 @@ #ifndef NDEBUG -struct mini_buff +struct mini_buff { char *buffer, *pbuffer; u32 buffer_len; @@ -95,9 +95,9 @@ static s32 _putsAscii(char *s, s32 len, void *buf) s32 i; struct mini_buff *b; - if (!buf) + if (!buf) return len; - + b = buf; p0 = b->buffer; @@ -118,9 +118,9 @@ static s32 _putsEncoded(char *s, s32 len, void *buf) s32 i; struct mini_buff *b; - if (!buf) + if (!buf) return len; - + b = buf; p0 = b->buffer; @@ -142,7 +142,7 @@ static s32 mini_strlen(const char *s) return len; } -static s32 mini_itoa(u32 value, u32 radix, s32 uppercase, bool32 unsig, char *buffer) +static s32 mini_itoa(s32 value, u32 radix, s32 uppercase, bool32 unsig, char *buffer) { char *pbuffer = buffer; s32 negative = 0; @@ -159,7 +159,7 @@ static s32 mini_itoa(u32 value, u32 radix, s32 uppercase, bool32 unsig, char *bu } /* This builds the string back to front ... */ - do + do { s32 digit = value % radix; *(pbuffer++) = (digit < 10 ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10); @@ -243,7 +243,7 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va) { len = 1; len = _putsAscii(&ch, len, buf); - } else + } else { char pad_char = ' '; s32 pad_to = 0; @@ -270,7 +270,7 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va) ch=*(fmt++); } - switch (ch) + switch (ch) { case 0: goto end; diff --git a/src/move_relearner.c b/src/move_relearner.c index 05ec549e1..af4593e53 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -465,10 +465,10 @@ static void CB2_MoveRelearnerMain(void) UpdatePaletteFade(); } -static void FormatAndPrintText(const u8 *src) +static void PrintMessageWithPlaceholders(const u8 *src) { StringExpandPlaceholders(gStringVar4, src); - MoveRelearnerPrintText(gStringVar4); + MoveRelearnerPrintMessage(gStringVar4); } // See the state machine doc at the top of the file. @@ -522,7 +522,7 @@ static void DoMoveRelearnerMain(void) { if (GiveMoveToMon(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove()) != MON_HAS_MAX_MOVES) { - FormatAndPrintText(gText_MoveRelearnerPkmnLearnedMove); + PrintMessageWithPlaceholders(gText_MoveRelearnerPkmnLearnedMove); gSpecialVar_0x8004 = TRUE; sMoveRelearnerStruct->state = MENU_STATE_PRINT_TEXT_THEN_FANFARE; } @@ -574,7 +574,7 @@ static void DoMoveRelearnerMain(void) } break; case MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT: - FormatAndPrintText(gText_MoveRelearnerPkmnTryingToLearnMove); + PrintMessageWithPlaceholders(gText_MoveRelearnerPkmnTryingToLearnMove); sMoveRelearnerStruct->state++; break; case MENU_STATE_WAIT_FOR_TRYING_TO_LEARN: @@ -590,7 +590,7 @@ static void DoMoveRelearnerMain(void) if (selection == 0) { - FormatAndPrintText(gText_MoveRelearnerWhichMoveToForget); + PrintMessageWithPlaceholders(gText_MoveRelearnerWhichMoveToForget); sMoveRelearnerStruct->state = MENU_STATE_PRINT_WHICH_MOVE_PROMPT; } else if (selection == MENU_B_PRESSED || selection == 1) @@ -601,7 +601,7 @@ static void DoMoveRelearnerMain(void) break; case MENU_STATE_PRINT_STOP_TEACHING: StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]); - FormatAndPrintText(gText_MoveRelearnerStopTryingToTeachMove); + PrintMessageWithPlaceholders(gText_MoveRelearnerStopTryingToTeachMove); sMoveRelearnerStruct->state++; break; case MENU_STATE_WAIT_FOR_STOP_TEACHING: @@ -637,7 +637,7 @@ static void DoMoveRelearnerMain(void) case MENU_STATE_CHOOSE_SETUP_STATE: if (!MoveRelearnerRunTextPrinters()) { - FillWindowPixelBuffer(3, 0x11); + FillWindowPixelBuffer(RELEARNERWIN_MSG, 0x11); if (sMoveRelearnerMenuSate.showContestInfo == FALSE) { sMoveRelearnerStruct->state = MENU_STATE_SETUP_BATTLE_MODE; @@ -694,7 +694,7 @@ static void DoMoveRelearnerMain(void) ShowTeachMoveText(TRUE); } RemoveScrollArrows(); - CopyWindowToVram(3, COPYWIN_GFX); + CopyWindowToVram(RELEARNERWIN_MSG, COPYWIN_GFX); break; case MENU_STATE_TRY_OVERWRITE_MOVE: if (!gPaletteFade.active) @@ -711,7 +711,7 @@ static void DoMoveRelearnerMain(void) RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot); SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot); StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]); - FormatAndPrintText(gText_MoveRelearnerAndPoof); + PrintMessageWithPlaceholders(gText_MoveRelearnerAndPoof); sMoveRelearnerStruct->state = MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE; gSpecialVar_0x8004 = TRUE; } @@ -720,7 +720,7 @@ static void DoMoveRelearnerMain(void) case MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE: if (!MoveRelearnerRunTextPrinters()) { - FormatAndPrintText(gText_MoveRelearnerPkmnForgotMoveAndLearnedNew); + PrintMessageWithPlaceholders(gText_MoveRelearnerPkmnForgotMoveAndLearnedNew); sMoveRelearnerStruct->state = MENU_STATE_PRINT_TEXT_THEN_FANFARE; PlayFanfare(MUS_LEVEL_UP); } @@ -765,15 +765,13 @@ static void HideHeartSpritesAndShowTeachMoveText(bool8 onlyHideSprites) s32 i; for (i = 0; i < 16; i++) - { gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE; - } if (!onlyHideSprites) { StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn); - FillWindowPixelBuffer(3, 0x11); - AddTextPrinterParameterized(3, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL); + FillWindowPixelBuffer(RELEARNERWIN_MSG, 0x11); + AddTextPrinterParameterized(RELEARNERWIN_MSG, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL); } } @@ -786,21 +784,19 @@ static void HandleInput(bool8 showContest) { case LIST_NOTHING_CHOSEN: if (!(JOY_NEW(DPAD_LEFT | DPAD_RIGHT)) && !GetLRKeysPressed()) - { break; - } PlaySE(SE_SELECT); if (showContest == FALSE) { - PutWindowTilemap(1); + PutWindowTilemap(RELEARNERWIN_DESC_CONTEST); sMoveRelearnerStruct->state = MENU_STATE_SETUP_CONTEST_MODE; sMoveRelearnerMenuSate.showContestInfo = TRUE; } else { - PutWindowTilemap(0); + PutWindowTilemap(RELEARNERWIN_DESC_BATTLE); sMoveRelearnerStruct->state = MENU_STATE_SETUP_BATTLE_MODE; sMoveRelearnerMenuSate.showContestInfo = FALSE; } @@ -813,7 +809,7 @@ static void HandleInput(bool8 showContest) RemoveScrollArrows(); sMoveRelearnerStruct->state = MENU_STATE_PRINT_GIVE_UP_PROMPT; StringExpandPlaceholders(gStringVar4, gText_MoveRelearnerGiveUp); - MoveRelearnerPrintText(gStringVar4); + MoveRelearnerPrintMessage(gStringVar4); break; default: PlaySE(SE_SELECT); @@ -821,7 +817,7 @@ static void HandleInput(bool8 showContest) sMoveRelearnerStruct->state = MENU_STATE_PRINT_TEACH_MOVE_PROMPT; StringCopy(gStringVar2, gMoveNames[itemId]); StringExpandPlaceholders(gStringVar4, gText_MoveRelearnerTeachMoveConfirm); - MoveRelearnerPrintText(gStringVar4); + MoveRelearnerPrintMessage(gStringVar4); break; } } @@ -842,8 +838,8 @@ static void ShowTeachMoveText(bool8 shouldDoNothingInstead) if (shouldDoNothingInstead == FALSE) { StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn); - FillWindowPixelBuffer(3, 0x11); - AddTextPrinterParameterized(3, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL); + FillWindowPixelBuffer(RELEARNERWIN_MSG, 0x11); + AddTextPrinterParameterized(RELEARNERWIN_MSG, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL); } } @@ -857,9 +853,7 @@ static void CreateUISprites(void) // These are the appeal hearts. for (i = 0; i < 8; i++) - { sMoveRelearnerStruct->heartSpriteIds[i] = CreateSprite(&sConstestMoveHeartSprite, (i - (i / 4) * 4) * 8 + 104, (i / 4) * 8 + 36, 0); - } // These are the jam harts. // The animation is used to toggle between full/empty heart sprites. @@ -870,17 +864,13 @@ static void CreateUISprites(void) } for (i = 0; i < 16; i++) - { gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE; - } } static void AddScrollArrows(void) { if (sMoveRelearnerStruct->moveDisplayArrowTask == TASK_NONE) - { sMoveRelearnerStruct->moveDisplayArrowTask = AddScrollIndicatorArrowPair(&sDisplayModeArrowsTemplate, &sMoveRelearnerStruct->scrollOffset); - } if (sMoveRelearnerStruct->moveListScrollArrowTask == TASK_NONE) { @@ -934,49 +924,35 @@ void MoveRelearnerShowHideHearts(s32 moveId) if (!sMoveRelearnerMenuSate.showContestInfo || moveId == LIST_CANCEL) { for (i = 0; i < 16; i++) - { gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE; - } } else { numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].appeal / 10); if (numHearts == 0xFF) - { numHearts = 0; - } for (i = 0; i < 8; i++) { if (i < numHearts) - { StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i]], 1); - } else - { StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i]], 0); - } gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = FALSE; } numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].jam / 10); if (numHearts == 0xFF) - { numHearts = 0; - } for (i = 0; i < 8; i++) { if (i < numHearts) - { StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]], 3); - } else - { StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]], 2); - } gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]].invisible = FALSE; } } diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 92b07d45b..79cab2b05 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -20,6 +20,11 @@ #include "decompress.h" #include "constants/rgb.h" +enum { + WIN_MSG, + WIN_LOADING, +}; + static void CB2_MysteryEventMenu(void); static void PrintMysteryMenuText(u8 windowId, const u8 *text, u8 x, u8 y, s32 speed); @@ -40,7 +45,7 @@ static const struct BgTemplate sBgTemplates[] = static const struct WindowTemplate sWindowTemplates[] = { - { + [WIN_MSG] = { .bg = 0, .tilemapLeft = 4, .tilemapTop = 15, @@ -49,7 +54,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 14, .baseBlock = 20 }, - { + [WIN_LOADING] = { .bg = 0, .tilemapLeft = 7, .tilemapTop = 6, @@ -87,7 +92,7 @@ void CB2_InitMysteryEventMenu(void) s32 i; DeactivateAllTextPrinters(); - for (i = 0; i < 2; i++) + for (i = 0; i < (int)ARRAY_COUNT(sWindowTemplates) - 1; i++) FillWindowPixelBuffer(i, PIXEL_FILL(0)); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); @@ -131,9 +136,9 @@ static void CB2_MysteryEventMenu(void) switch (gMain.state) { case 0: - DrawStdFrameWithCustomTileAndPalette(0, TRUE, 1, 0xD); - PutWindowTilemap(0); - CopyWindowToVram(0, COPYWIN_FULL); + DrawStdFrameWithCustomTileAndPalette(WIN_MSG, TRUE, 1, 0xD); + PutWindowTilemap(WIN_MSG); + CopyWindowToVram(WIN_MSG, COPYWIN_FULL); ShowBg(0); BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gMain.state++; @@ -141,12 +146,12 @@ static void CB2_MysteryEventMenu(void) case 1: if (!gPaletteFade.active) { - PrintMysteryMenuText(0, gText_LinkStandby2, 1, 2, 1); + PrintMysteryMenuText(WIN_MSG, gText_LinkStandby2, 1, 2, 1); gMain.state++; } break; case 2: - if (!IsTextPrinterActive(0)) + if (!IsTextPrinterActive(WIN_MSG)) { gMain.state++; gLinkType = LINKTYPE_MYSTERY_EVENT; @@ -154,10 +159,10 @@ static void CB2_MysteryEventMenu(void) } break; case 3: - if ((gLinkStatus & 0x20) && (gLinkStatus & 0x1C) > 4) + if ((gLinkStatus & LINK_STAT_MASTER) && (gLinkStatus & LINK_STAT_PLAYER_COUNT) > 4) { PlaySE(SE_PIN); - PrintMysteryMenuText(0, gText_PressAToLoadEvent, 1, 2, 1); + PrintMysteryMenuText(WIN_MSG, gText_PressAToLoadEvent, 1, 2, 1); gMain.state++; } if (JOY_NEW(B_BUTTON)) @@ -168,7 +173,7 @@ static void CB2_MysteryEventMenu(void) } break; case 4: - if (!IsTextPrinterActive(0)) + if (!IsTextPrinterActive(WIN_MSG)) gMain.state++; break; case 5: @@ -178,10 +183,10 @@ static void CB2_MysteryEventMenu(void) { PlaySE(SE_SELECT); CheckShouldAdvanceLinkState(); - DrawStdFrameWithCustomTileAndPalette(1, TRUE, 1, 0xD); - PrintMysteryMenuText(1, gText_LoadingEvent, 1, 2, 0); - PutWindowTilemap(1); - CopyWindowToVram(1, COPYWIN_FULL); + DrawStdFrameWithCustomTileAndPalette(WIN_LOADING, TRUE, 1, 0xD); + PrintMysteryMenuText(WIN_LOADING, gText_LoadingEvent, 1, 2, 0); + PutWindowTilemap(WIN_LOADING); + CopyWindowToVram(WIN_LOADING, COPYWIN_FULL); gMain.state++; } else if (JOY_NEW(B_BUTTON)) @@ -194,7 +199,7 @@ static void CB2_MysteryEventMenu(void) else { GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR); - PrintMysteryMenuText(0, gStringVar4, 1, 2, 1); + PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1); gMain.state = 13; } break; @@ -207,19 +212,19 @@ static void CB2_MysteryEventMenu(void) { SetCloseLinkCallback(); GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR); - PrintMysteryMenuText(0, gStringVar4, 1, 2, 1); + PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1); gMain.state = 13; } else if (CheckLanguageMatch()) { - PrintMysteryMenuText(0, gText_DontRemoveCableTurnOff, 1, 2, 1); + PrintMysteryMenuText(WIN_MSG, gText_DontRemoveCableTurnOff, 1, 2, 1); gMain.state++; } else { CloseLink(); GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR); - PrintMysteryMenuText(0, gStringVar4, 1, 2, 1); + PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1); gMain.state = 13; } } @@ -232,7 +237,7 @@ static void CB2_MysteryEventMenu(void) } break; case 7: - if (!IsTextPrinterActive(0)) + if (!IsTextPrinterActive(WIN_MSG)) gMain.state++; break; case 8: @@ -260,11 +265,11 @@ static void CB2_MysteryEventMenu(void) } break; case 12: - PrintMysteryMenuText(0, gStringVar4, 1, 2, 1); + PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1); gMain.state++; break; case 13: - if (!IsTextPrinterActive(0)) + if (!IsTextPrinterActive(WIN_MSG)) { gMain.state++; sUnused = 0; @@ -287,11 +292,11 @@ static void CB2_MysteryEventMenu(void) break; } - if (gLinkStatus & 0x40 && !IsLinkMaster()) + if (gLinkStatus & LINK_STAT_CONN_ESTABLISHED && !IsLinkMaster()) { CloseLink(); GetEventLoadMessage(gStringVar4, MEVENT_STATUS_LOAD_ERROR); - PrintMysteryMenuText(0, gStringVar4, 1, 2, 1); + PrintMysteryMenuText(WIN_MSG, gStringVar4, 1, 2, 1); gMain.state = 13; } diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c index 3ac48822c..c73f43a56 100644 --- a/src/mystery_gift_menu.c +++ b/src/mystery_gift_menu.c @@ -32,6 +32,12 @@ #include "wonder_news.h" #include "constants/cable_club.h" +enum { + WIN_HEADER, + WIN_MSG, + WIN_UNK, // Cleared, but nothing is ever apparently rendered on it +}; + #define LIST_MENU_TILE_NUM 10 #define LIST_MENU_PAL_NUM BG_PLTT_ID(14) @@ -98,7 +104,7 @@ static const struct BgTemplate sBGTemplates[] = { }; static const struct WindowTemplate sMainWindows[] = { - { + [WIN_HEADER] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, @@ -106,7 +112,8 @@ static const struct WindowTemplate sMainWindows[] = { .height = 2, .paletteNum = 12, .baseBlock = 0x0013 - }, { + }, + [WIN_MSG] = { .bg = 0, .tilemapLeft = 1, .tilemapTop = 15, @@ -114,7 +121,8 @@ static const struct WindowTemplate sMainWindows[] = { .height = 4, .paletteNum = 12, .baseBlock = 0x004f - }, { + }, + [WIN_UNK] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 15, @@ -224,7 +232,7 @@ static const struct ListMenuTemplate sListMenuTemplate_ThreeOptions = { .itemPrintFunc = NULL, .totalItems = 3, .maxShowed = 3, - .windowId = 0, + .windowId = 0, // Overwritten by DoMysteryGiftListMenu .header_X = 0, .item_X = 8, .cursor_X = 0, @@ -269,7 +277,7 @@ static const struct ListMenuTemplate sListMenu_ReceiveSendToss = { .itemPrintFunc = NULL, .totalItems = 4, .maxShowed = 4, - .windowId = 0, + .windowId = 0, // Overwritten by DoMysteryGiftListMenu .header_X = 0, .item_X = 8, .cursor_X = 0, @@ -290,7 +298,7 @@ static const struct ListMenuTemplate sListMenu_ReceiveToss = { .itemPrintFunc = NULL, .totalItems = 3, .maxShowed = 3, - .windowId = 0, + .windowId = 0, // Overwritten by DoMysteryGiftListMenu .header_X = 0, .item_X = 8, .cursor_X = 0, @@ -311,7 +319,7 @@ static const struct ListMenuTemplate sListMenu_ReceiveSend = { .itemPrintFunc = NULL, .totalItems = 3, .maxShowed = 3, - .windowId = 0, + .windowId = 0, // Overwritten by DoMysteryGiftListMenu .header_X = 0, .item_X = 8, .cursor_X = 0, @@ -332,7 +340,7 @@ static const struct ListMenuTemplate sListMenu_Receive = { .itemPrintFunc = NULL, .totalItems = 2, .maxShowed = 2, - .windowId = 0, + .windowId = 0, // Overwritten by DoMysteryGiftListMenu .header_X = 0, .item_X = 8, .cursor_X = 0, @@ -354,9 +362,9 @@ static const u8 *const sUnusedMenuTexts[] = { gText_ReturnToTitle }; -ALIGNED(2) static const u8 sTextColors_TopMenu[] = { TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; -ALIGNED(2) static const u8 sTextColors_TopMenu_Copy[] = { TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; -ALIGNED(2) static const u8 sMG_Ereader_TextColor_2[] = { TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY }; +ALIGNED(2) static const u8 sTextColors_Header[] = { TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; +ALIGNED(2) static const u8 sTextColors_Header_Copy[] = { TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; +ALIGNED(2) static const u8 sMG_Ereader_TextColor_2[] = { TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY }; static void VBlankCB_MysteryGiftEReader(void) { @@ -420,7 +428,7 @@ static bool32 HandleMysteryGiftOrEReaderSetup(s32 isEReader) FillBgTilemapBufferRect(1, 0x000, 0, 0, 32, 32, 17); FillBgTilemapBufferRect(2, 0x000, 0, 0, 32, 32, 17); MG_DrawCheckerboardPattern(3); - PrintMysteryGiftOrEReaderTopMenu(isEReader, FALSE); + PrintMysteryGiftOrEReaderHeader(isEReader, FALSE); gMain.state++; break; case 2: @@ -474,26 +482,27 @@ void MainCB_FreeAllBuffersAndReturnToInitTitleScreen(void) SetMainCallback2(CB2_InitTitleScreen); } -void PrintMysteryGiftOrEReaderTopMenu(bool8 isEReader, bool32 useCancel) +// Print the text window at the top of the screen with the title and control instructions +void PrintMysteryGiftOrEReaderHeader(bool8 isEReader, bool32 useCancel) { - const u8 *header; + const u8 *title; const u8 *options; - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(WIN_HEADER, 0); if (!isEReader) { - header = gText_MysteryGift; + title = gText_MysteryGift; options = !useCancel ? gText_PickOKExit : gText_PickOKCancel; } else { - header = gJPText_MysteryGift; + title = gJPText_MysteryGift; options = gJPText_DecideStop; } - AddTextPrinterParameterized4(0, FONT_NORMAL, 4, 1, 0, 0, sTextColors_TopMenu, TEXT_SKIP_DRAW, header); - AddTextPrinterParameterized4(0, FONT_SMALL, GetStringRightAlignXOffset(FONT_SMALL, options, 0xDE), 1, 0, 0, sTextColors_TopMenu, TEXT_SKIP_DRAW, options); - CopyWindowToVram(0, COPYWIN_GFX); - PutWindowTilemap(0); + AddTextPrinterParameterized4(WIN_HEADER, FONT_NORMAL, 4, 1, 0, 0, sTextColors_Header, TEXT_SKIP_DRAW, title); + AddTextPrinterParameterized4(WIN_HEADER, FONT_SMALL, GetStringRightAlignXOffset(FONT_SMALL, options, 0xDE), 1, 0, 0, sTextColors_Header, TEXT_SKIP_DRAW, options); + CopyWindowToVram(WIN_HEADER, COPYWIN_GFX); + PutWindowTilemap(WIN_HEADER); } void MG_DrawTextBorder(u8 windowId) @@ -533,21 +542,21 @@ static void ClearScreenInBg0(bool32 ignoreTopTwoRows) CopyBgTilemapBufferToVram(0); } -void AddTextPrinterToWindow1(const u8 *str) +void MG_AddMessageTextPrinter(const u8 *str) { StringExpandPlaceholders(gStringVar4, str); - FillWindowPixelBuffer(1, 0x11); - AddTextPrinterParameterized4(1, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); - DrawTextBorderOuter(1, 0x001, 0xF); - PutWindowTilemap(1); - CopyWindowToVram(1, COPYWIN_FULL); + FillWindowPixelBuffer(WIN_MSG, 0x11); + AddTextPrinterParameterized4(WIN_MSG, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); + DrawTextBorderOuter(WIN_MSG, 0x001, 0xF); + PutWindowTilemap(WIN_MSG); + CopyWindowToVram(WIN_MSG, COPYWIN_FULL); } -static void ClearTextWindow(void) +static void ClearMessage(void) { - rbox_fill_rectangle(1); - ClearWindowTilemap(1); - CopyWindowToVram(1, COPYWIN_MAP); + rbox_fill_rectangle(WIN_MSG); + ClearWindowTilemap(WIN_MSG); + CopyWindowToVram(WIN_MSG, COPYWIN_MAP); } #define DOWN_ARROW_X 208 @@ -558,18 +567,18 @@ bool32 PrintMysteryGiftMenuMessage(u8 *textState, const u8 *str) switch (*textState) { case 0: - AddTextPrinterToWindow1(str); + MG_AddMessageTextPrinter(str); (*textState)++; break; case 1: - DrawDownArrow(1, DOWN_ARROW_X, DOWN_ARROW_Y, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); - if (({JOY_NEW(A_BUTTON | B_BUTTON);})) + DrawDownArrow(WIN_MSG, DOWN_ARROW_X, DOWN_ARROW_Y, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); + if (JOY_NEW(A_BUTTON | B_BUTTON)) (*textState)++; break; case 2: - DrawDownArrow(1, DOWN_ARROW_X, DOWN_ARROW_Y, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); + DrawDownArrow(WIN_MSG, DOWN_ARROW_X, DOWN_ARROW_Y, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); *textState = 0; - ClearTextWindow(); + ClearMessage(); return TRUE; case 0xFF: *textState = 2; @@ -580,12 +589,12 @@ bool32 PrintMysteryGiftMenuMessage(u8 *textState, const u8 *str) static void HideDownArrow(void) { - DrawDownArrow(1, DOWN_ARROW_X, DOWN_ARROW_Y, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); + DrawDownArrow(WIN_MSG, DOWN_ARROW_X, DOWN_ARROW_Y, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); } static void ShowDownArrow(void) { - DrawDownArrow(1, DOWN_ARROW_X, DOWN_ARROW_Y, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); + DrawDownArrow(WIN_MSG, DOWN_ARROW_X, DOWN_ARROW_Y, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); } // Unused @@ -609,12 +618,12 @@ static bool32 HideDownArrowAndWaitButton(u8 *textState) static bool32 PrintStringAndWait2Seconds(u8 *counter, const u8 *str) { if (*counter == 0) - AddTextPrinterToWindow1(str); + MG_AddMessageTextPrinter(str); if (++(*counter) > 120) { *counter = 0; - ClearTextWindow(); + ClearMessage(); return TRUE; } else @@ -648,8 +657,8 @@ static u32 MysteryGift_HandleThreeOptionMenu(u8 *unused0, u16 * unused1, u8 whic response = DoMysteryGiftListMenu(&windowTemplate, &listMenuTemplate, 1, LIST_MENU_TILE_NUM, LIST_MENU_PAL_NUM); if (response != LIST_NOTHING_CHOSEN) { - ClearWindowTilemap(2); - CopyWindowToVram(2, COPYWIN_MAP); + ClearWindowTilemap(WIN_UNK); + CopyWindowToVram(WIN_UNK, COPYWIN_MAP); } return response; } @@ -865,7 +874,7 @@ static bool32 SaveOnMysteryGiftMenu(u8 *state) switch (*state) { case 0: - AddTextPrinterToWindow1(gText_DataWillBeSaved); + MG_AddMessageTextPrinter(gText_DataWillBeSaved); (*state)++; break; case 1: @@ -873,7 +882,7 @@ static bool32 SaveOnMysteryGiftMenu(u8 *state) (*state)++; break; case 2: - AddTextPrinterToWindow1(gText_SaveCompletedPressA); + MG_AddMessageTextPrinter(gText_SaveCompletedPressA); (*state)++; break; case 3: @@ -882,7 +891,7 @@ static bool32 SaveOnMysteryGiftMenu(u8 *state) break; case 4: *state = 0; - ClearTextWindow(); + ClearMessage(); return TRUE; } @@ -967,7 +976,7 @@ static bool32 PrintSuccessMessage(u8 *state, const u8 *msg, u16 * timer) { case 0: if (msg != NULL) - AddTextPrinterToWindow1(msg); + MG_AddMessageTextPrinter(msg); PlayFanfare(MUS_OBTAIN_ITEM); *timer = 0; (*state)++; @@ -980,7 +989,7 @@ static bool32 PrintSuccessMessage(u8 *state, const u8 *msg, u16 * timer) if (IsFanfareTaskInactive()) { *state = 0; - ClearTextWindow(); + ClearMessage(); return TRUE; } break; @@ -1161,7 +1170,7 @@ static void Task_MysteryGift(u8 taskId) if (PrintMysteryGiftMenuMessage(&data->textState, gText_DontHaveCardNewOneInput)) { data->state = MG_STATE_SOURCE_PROMPT; - PrintMysteryGiftOrEReaderTopMenu(FALSE, TRUE); + PrintMysteryGiftOrEReaderHeader(FALSE, TRUE); } } else @@ -1169,16 +1178,16 @@ static void Task_MysteryGift(u8 taskId) if (PrintMysteryGiftMenuMessage(&data->textState, gText_DontHaveNewsNewOneInput)) { data->state = MG_STATE_SOURCE_PROMPT; - PrintMysteryGiftOrEReaderTopMenu(FALSE, TRUE); + PrintMysteryGiftOrEReaderHeader(FALSE, TRUE); } } break; } case MG_STATE_SOURCE_PROMPT: if (!data->isWonderNews) - AddTextPrinterToWindow1(gText_WhereShouldCardBeAccessed); + MG_AddMessageTextPrinter(gText_WhereShouldCardBeAccessed); else - AddTextPrinterToWindow1(gText_WhereShouldNewsBeAccessed); + MG_AddMessageTextPrinter(gText_WhereShouldNewsBeAccessed); data->state = MG_STATE_SOURCE_PROMPT_INPUT; break; case MG_STATE_SOURCE_PROMPT_INPUT: @@ -1186,17 +1195,17 @@ static void Task_MysteryGift(u8 taskId) switch (MysteryGift_HandleThreeOptionMenu(&data->textState, &data->var, TRUE)) { case 0: // "Wireless Communication" - ClearTextWindow(); + ClearMessage(); data->state = MG_STATE_CLIENT_LINK_START; data->sourceIsFriend = FALSE; break; case 1: // "Friend" - ClearTextWindow(); + ClearMessage(); data->state = MG_STATE_CLIENT_LINK_START; data->sourceIsFriend = TRUE; break; case LIST_CANCEL: - ClearTextWindow(); + ClearMessage(); if (ValidateCardOrNews(data->isWonderNews)) { data->state = MG_STATE_LOAD_GIFT; @@ -1204,7 +1213,7 @@ static void Task_MysteryGift(u8 taskId) else { data->state = MG_STATE_TO_MAIN_MENU; - PrintMysteryGiftOrEReaderTopMenu(FALSE, FALSE); + PrintMysteryGiftOrEReaderHeader(FALSE, FALSE); } break; } @@ -1246,7 +1255,7 @@ static void Task_MysteryGift(u8 taskId) } break; case MG_STATE_CLIENT_COMMUNICATING: - AddTextPrinterToWindow1(gText_Communicating); + MG_AddMessageTextPrinter(gText_Communicating); data->state = MG_STATE_CLIENT_LINK; break; case MG_STATE_CLIENT_LINK: @@ -1379,7 +1388,7 @@ static void Task_MysteryGift(u8 taskId) { // Did not receive card/news, return to main menu data->state = MG_STATE_TO_MAIN_MENU; - PrintMysteryGiftOrEReaderTopMenu(FALSE, FALSE); + PrintMysteryGiftOrEReaderHeader(FALSE, FALSE); } else { @@ -1500,7 +1509,7 @@ static void Task_MysteryGift(u8 taskId) if (PrintThrownAway(&data->textState, data->isWonderNews)) { data->state = MG_STATE_TO_MAIN_MENU; - PrintMysteryGiftOrEReaderTopMenu(FALSE, FALSE); + PrintMysteryGiftOrEReaderHeader(FALSE, FALSE); } break; case MG_STATE_GIFT_INPUT_EXIT: @@ -1546,12 +1555,12 @@ static void Task_MysteryGift(u8 taskId) if (!data->isWonderNews) { - AddTextPrinterToWindow1(gText_SendingWonderCard); + MG_AddMessageTextPrinter(gText_SendingWonderCard); MysterGiftServer_CreateForCard(); } else { - AddTextPrinterToWindow1(gText_SendingWonderNews); + MG_AddMessageTextPrinter(gText_SendingWonderNews); MysterGiftServer_CreateForNews(); } data->state = MG_STATE_SERVER_LINK; @@ -1586,7 +1595,7 @@ static void Task_MysteryGift(u8 taskId) else { data->state = MG_STATE_TO_MAIN_MENU; - PrintMysteryGiftOrEReaderTopMenu(FALSE, FALSE); + PrintMysteryGiftOrEReaderHeader(FALSE, FALSE); } } break; @@ -1595,7 +1604,7 @@ static void Task_MysteryGift(u8 taskId) if (PrintMysteryGiftMenuMessage(&data->textState, gText_CommunicationError)) { data->state = MG_STATE_TO_MAIN_MENU; - PrintMysteryGiftOrEReaderTopMenu(FALSE, FALSE); + PrintMysteryGiftOrEReaderHeader(FALSE, FALSE); } break; case MG_STATE_EXIT: diff --git a/src/mystery_gift_view.c b/src/mystery_gift_view.c index 4ac0489bb..bc1939adf 100644 --- a/src/mystery_gift_view.c +++ b/src/mystery_gift_view.c @@ -310,7 +310,7 @@ s32 WonderCard_Exit(bool32 useCancel) FreeMonIconPalettes(); break; case 5: - PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, useCancel); + PrintMysteryGiftOrEReaderHeader(gGiftIsFromEReader, useCancel); CopyBgTilemapBufferToVram(0); BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); break; @@ -785,7 +785,7 @@ s32 WonderNews_Exit(bool32 useCancel) } break; case 5: - PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, useCancel); + PrintMysteryGiftOrEReaderHeader(gGiftIsFromEReader, useCancel); MG_DrawCheckerboardPattern(3); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(3); diff --git a/src/party_menu.c b/src/party_menu.c index 7be838d62..8debf9f3c 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -161,14 +161,18 @@ enum { #define MENU_DIR_RIGHT 2 #define MENU_DIR_LEFT -2 -enum -{ +enum { CAN_LEARN_MOVE, CANNOT_LEARN_MOVE, ALREADY_KNOWS_MOVE, CANNOT_LEARN_MOVE_IS_EGG }; +enum { + // Window ids 0-5 are implicitly assigned to each party pokemon in InitPartyMenuBoxes + WIN_MSG = PARTY_SIZE, +}; + struct PartyMenuBoxInfoRects { void (*blitFunc)(u8, u8, u8, u8, u8, bool8); @@ -321,7 +325,7 @@ static void UpdateCurrentPartySelection(s8 *, s8); static void UpdatePartySelectionSingleLayout(s8 *, s8); static void UpdatePartySelectionDoubleLayout(s8 *, s8); static s8 GetNewSlotDoubleLayout(s8, s8); -static void PartyMenuPrintText(const u8 *); +static void PrintMessage(const u8 *); static void Task_PrintAndWaitForText(u8); static bool16 IsMonAllowedInPokemonJump(struct Pokemon *); static bool16 IsMonAllowedInDodrioBerryPicking(struct Pokemon *); @@ -1702,7 +1706,7 @@ u8 DisplayPartyMenuMessage(const u8 *str, bool8 keepOpen) { u8 taskId; - PartyMenuPrintText(str); + PrintMessage(str); taskId = CreateTask(Task_PrintAndWaitForText, 1); gTasks[taskId].tKeepOpen = keepOpen; return taskId; @@ -1710,12 +1714,12 @@ u8 DisplayPartyMenuMessage(const u8 *str, bool8 keepOpen) static void Task_PrintAndWaitForText(u8 taskId) { - if (RunTextPrintersRetIsActive(6) != TRUE) + if (RunTextPrintersRetIsActive(WIN_MSG) != TRUE) { if (gTasks[taskId].tKeepOpen == FALSE) { - ClearStdWindowAndFrameToTransparent(6, FALSE); - ClearWindowTilemap(6); + ClearStdWindowAndFrameToTransparent(WIN_MSG, FALSE); + ClearWindowTilemap(WIN_MSG); } DestroyTask(taskId); } @@ -1741,8 +1745,8 @@ static void Task_ReturnToChooseMonAfterText(u8 taskId) { if (IsPartyMenuTextPrinterActive() != TRUE) { - ClearStdWindowAndFrameToTransparent(6, FALSE); - ClearWindowTilemap(6); + ClearStdWindowAndFrameToTransparent(WIN_MSG, FALSE); + ClearWindowTilemap(WIN_MSG); if (MenuHelpers_IsLinkActive() == TRUE) { gTasks[taskId].func = Task_WaitForLinkAndReturnToChooseMon; @@ -2550,11 +2554,11 @@ static u8 DisplaySelectionWindow(u8 windowType) return sPartyMenuInternal->windowId[0]; } -static void PartyMenuPrintText(const u8 *text) +static void PrintMessage(const u8 *text) { - DrawStdFrameWithCustomTileAndPalette(6, FALSE, 0x4F, 13); + DrawStdFrameWithCustomTileAndPalette(WIN_MSG, FALSE, 0x4F, 13); gTextFlags.canABSpeedUpPrint = TRUE; - AddTextPrinterParameterized2(6, FONT_NORMAL, text, GetPlayerTextSpeedDelay(), 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY); + AddTextPrinterParameterized2(WIN_MSG, FONT_NORMAL, text, GetPlayerTextSpeedDelay(), 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY); } static void PartyMenuDisplayYesNoMenu(void) @@ -5161,7 +5165,6 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) u16 *itemPtr = &gSpecialVar_ItemId; bool8 cannotUseEffect; u8 holdEffectParam = ItemId_GetHoldEffectParam(*itemPtr); - u16 targetSpecies = GetEvolutionTargetSpecies(mon, EVO_MODE_NORMAL, ITEM_NONE, NULL); sInitialLevel = GetMonData(mon, MON_DATA_LEVEL); if (sInitialLevel != MAX_LEVEL) @@ -5177,10 +5180,22 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) PlaySE(SE_SELECT); if (cannotUseEffect) { - if (targetSpecies != SPECIES_NONE && holdEffectParam == 0) + u16 targetSpecies = SPECIES_NONE; + + // Resets values to 0 so other means of teaching moves doesn't overwrite levels + sInitialLevel = 0; + sFinalLevel = 0; + + if (holdEffectParam == 0) + targetSpecies = GetEvolutionTargetSpecies(mon, EVO_MODE_NORMAL, ITEM_NONE, NULL); + + if (targetSpecies != SPECIES_NONE) { - PartyMenuTryEvolution(taskId); RemoveBagItem(gSpecialVar_ItemId, 1); + FreePartyPointers(); + gCB2_AfterEvolution = gPartyMenu.exitCallback; + BeginEvolutionScene(mon, targetSpecies, TRUE, gPartyMenu.slotId); + DestroyTask(taskId); } else { diff --git a/src/pokeblock.c b/src/pokeblock.c index 3f0b3b5c5..e490f372c 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -765,7 +765,7 @@ static void DrawPokeblockInfo(s32 pkblId) struct Pokeblock *pokeblock; u16 rectTilemapSrc[2]; - FillWindowPixelBuffer(7, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_FEEL, PIXEL_FILL(0)); if (pkblId != LIST_CANCEL) { @@ -802,7 +802,7 @@ static void DrawPokeblockInfo(s32 pkblId) for (i = 0; i < FLAVOR_COUNT; i++) CopyToBgTilemapBufferRect(2, rectTilemapSrc, (i / 3 * 6) + 1, (i % 3 * 2) + 13, 1, 2); - CopyWindowToVram(7, COPYWIN_GFX); + CopyWindowToVram(WIN_FEEL, COPYWIN_GFX); } ScheduleBgCopyTilemapToVram(0); diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c index 0758ea37d..5e2e8a656 100644 --- a/src/pokemon_icon.c +++ b/src/pokemon_icon.c @@ -815,9 +815,9 @@ const u8 *const gMonIconTable[] = [SPECIES_BRUXISH] = gMonIcon_Bruxish, [SPECIES_DRAMPA] = gMonIcon_Drampa, [SPECIES_DHELMISE] = gMonIcon_Dhelmise, - [SPECIES_JANGMO_O] = gMonIcon_Jangmoo, - [SPECIES_HAKAMO_O] = gMonIcon_Hakamoo, - [SPECIES_KOMMO_O] = gMonIcon_Kommoo, + [SPECIES_JANGMO_O] = gMonIcon_JangmoO, + [SPECIES_HAKAMO_O] = gMonIcon_HakamoO, + [SPECIES_KOMMO_O] = gMonIcon_KommoO, [SPECIES_TAPU_KOKO] = gMonIcon_TapuKoko, [SPECIES_TAPU_LELE] = gMonIcon_TapuLele, [SPECIES_TAPU_BULU] = gMonIcon_TapuBulu, diff --git a/src/region_map.c b/src/region_map.c index d55afb961..ebe3afb8e 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -53,6 +53,13 @@ enum { TAG_FLY_ICON, }; +// Window IDs for the fly map +enum { + WIN_MAPSEC_NAME, + WIN_MAPSEC_NAME_TALL, // For fly destinations with subtitles (just Ever Grande) + WIN_FLY_TO_WHERE, +}; + struct MultiNameFlyDest { const u8 *const *name; @@ -378,7 +385,7 @@ static const struct BgTemplate sFlyMapBgTemplates[] = static const struct WindowTemplate sFlyMapWindowTemplates[] = { - { + [WIN_MAPSEC_NAME] = { .bg = 0, .tilemapLeft = 17, .tilemapTop = 17, @@ -387,7 +394,7 @@ static const struct WindowTemplate sFlyMapWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x01 }, - { + [WIN_MAPSEC_NAME_TALL] = { .bg = 0, .tilemapLeft = 17, .tilemapTop = 15, @@ -396,7 +403,7 @@ static const struct WindowTemplate sFlyMapWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x19 }, - { + [WIN_FLY_TO_WHERE] = { .bg = 0, .tilemapLeft = 1, .tilemapTop = 18, @@ -1394,7 +1401,7 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag) } LoadSpriteSheet(&sheet); LoadSpritePalette(&palette); - spriteId = CreateSprite(&template, 0x38, 0x48, 0); + spriteId = CreateSprite(&template, 56, 72, 0); if (spriteId != MAX_SPRITES) { sRegionMap->cursorSprite = &gSprites[spriteId]; @@ -1703,9 +1710,9 @@ void CB2_OpenFlyMap(void) break; case 7: LoadPalette(sRegionMapFramePal, BG_PLTT_ID(1), sizeof(sRegionMapFramePal)); - PutWindowTilemap(2); - FillWindowPixelBuffer(2, PIXEL_FILL(0)); - AddTextPrinterParameterized(2, FONT_NORMAL, gText_FlyToWhere, 0, 1, 0, NULL); + PutWindowTilemap(WIN_FLY_TO_WHERE); + FillWindowPixelBuffer(WIN_FLY_TO_WHERE, PIXEL_FILL(0)); + AddTextPrinterParameterized(WIN_FLY_TO_WHERE, FONT_NORMAL, gText_FlyToWhere, 0, 1, 0, NULL); ScheduleBgCopyTilemapToVram(0); gMain.state++; break; @@ -1758,7 +1765,7 @@ static void DrawFlyDestTextWindow(void) bool32 namePrinted; const u8 *name; - if (sFlyMap->regionMap.mapSecType > MAPSECTYPE_NONE && sFlyMap->regionMap.mapSecType <= MAPSECTYPE_BATTLE_FRONTIER) + if (sFlyMap->regionMap.mapSecType > MAPSECTYPE_NONE && sFlyMap->regionMap.mapSecType < NUM_MAPSEC_TYPES) { namePrinted = FALSE; for (i = 0; i < ARRAY_COUNT(sMultiNameFlyDestinations); i++) @@ -1769,11 +1776,11 @@ static void DrawFlyDestTextWindow(void) { StringLength(sMultiNameFlyDestinations[i].name[sFlyMap->regionMap.posWithinMapSec]); namePrinted = TRUE; - ClearStdWindowAndFrameToTransparent(0, FALSE); - DrawStdFrameWithCustomTileAndPalette(1, FALSE, 101, 13); - AddTextPrinterParameterized(1, FONT_NORMAL, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL); + ClearStdWindowAndFrameToTransparent(WIN_MAPSEC_NAME, FALSE); + DrawStdFrameWithCustomTileAndPalette(WIN_MAPSEC_NAME_TALL, FALSE, 101, 13); + AddTextPrinterParameterized(WIN_MAPSEC_NAME_TALL, FONT_NORMAL, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL); name = sMultiNameFlyDestinations[i].name[sFlyMap->regionMap.posWithinMapSec]; - AddTextPrinterParameterized(1, FONT_NORMAL, name, GetStringRightAlignXOffset(FONT_NORMAL, name, 96), 17, 0, NULL); + AddTextPrinterParameterized(WIN_MAPSEC_NAME_TALL, FONT_NORMAL, name, GetStringRightAlignXOffset(FONT_NORMAL, name, 96), 17, 0, NULL); ScheduleBgCopyTilemapToVram(0); sDrawFlyDestTextWindow = TRUE; } @@ -1784,15 +1791,15 @@ static void DrawFlyDestTextWindow(void) { if (sDrawFlyDestTextWindow == TRUE) { - ClearStdWindowAndFrameToTransparent(1, FALSE); - DrawStdFrameWithCustomTileAndPalette(0, FALSE, 101, 13); + ClearStdWindowAndFrameToTransparent(WIN_MAPSEC_NAME_TALL, FALSE); + DrawStdFrameWithCustomTileAndPalette(WIN_MAPSEC_NAME, FALSE, 101, 13); } else { // Window is already drawn, just empty it - FillWindowPixelBuffer(0, PIXEL_FILL(1)); + FillWindowPixelBuffer(WIN_MAPSEC_NAME, PIXEL_FILL(1)); } - AddTextPrinterParameterized(0, FONT_NORMAL, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL); + AddTextPrinterParameterized(WIN_MAPSEC_NAME, FONT_NORMAL, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL); ScheduleBgCopyTilemapToVram(0); sDrawFlyDestTextWindow = FALSE; } @@ -1802,11 +1809,11 @@ static void DrawFlyDestTextWindow(void) // Selection is on MAPSECTYPE_NONE, draw empty fly destination text window if (sDrawFlyDestTextWindow == TRUE) { - ClearStdWindowAndFrameToTransparent(1, FALSE); - DrawStdFrameWithCustomTileAndPalette(0, FALSE, 101, 13); + ClearStdWindowAndFrameToTransparent(WIN_MAPSEC_NAME_TALL, FALSE); + DrawStdFrameWithCustomTileAndPalette(WIN_MAPSEC_NAME, FALSE, 101, 13); } - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - CopyWindowToVram(0, COPYWIN_GFX); + FillWindowPixelBuffer(WIN_MAPSEC_NAME, PIXEL_FILL(1)); + CopyWindowToVram(WIN_MAPSEC_NAME, COPYWIN_GFX); ScheduleBgCopyTilemapToVram(0); sDrawFlyDestTextWindow = FALSE; } diff --git a/src/reset_rtc_screen.c b/src/reset_rtc_screen.c index 5c9314867..98ccb71b6 100644 --- a/src/reset_rtc_screen.c +++ b/src/reset_rtc_screen.c @@ -49,6 +49,11 @@ enum { SELECTION_NONE }; +enum { + WIN_TIME, + WIN_MSG, +}; + struct ResetRtcInputMap { /*0x0*/ u8 dataIndex; @@ -79,7 +84,7 @@ static const struct BgTemplate sBgTemplates[] = static const struct WindowTemplate sWindowTemplates[] = { - { + [WIN_TIME] = { .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, @@ -88,7 +93,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x155 }, - { + [WIN_MSG] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, @@ -562,8 +567,8 @@ static void VBlankCB(void) static void ShowMessage(const u8 *str) { - DrawDialogFrameWithCustomTileAndPalette(1, FALSE, 0x200, 0xF); - AddTextPrinterParameterized(1, FONT_NORMAL, str, 0, 1, 0, NULL); + DrawDialogFrameWithCustomTileAndPalette(WIN_MSG, FALSE, 0x200, 0xF); + AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, str, 0, 1, 0, NULL); ScheduleBgCopyTilemapToVram(0); } @@ -576,11 +581,11 @@ static void Task_ShowResetRtcPrompt(u8 taskId) switch (tState) { case 0: - DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(WIN_TIME, FALSE, 0x214, 0xE); - AddTextPrinterParameterized(0, FONT_NORMAL, gText_PresentTime, 0, 1, TEXT_SKIP_DRAW, 0); + AddTextPrinterParameterized(WIN_TIME, FONT_NORMAL, gText_PresentTime, 0, 1, TEXT_SKIP_DRAW, 0); PrintTime( - 0, + WIN_TIME, 0, 17, gLocalTime.days, @@ -588,9 +593,9 @@ static void Task_ShowResetRtcPrompt(u8 taskId) gLocalTime.minutes, gLocalTime.seconds); - AddTextPrinterParameterized(0, FONT_NORMAL, gText_PreviousTime, 0, 33, TEXT_SKIP_DRAW, 0); + AddTextPrinterParameterized(WIN_TIME, FONT_NORMAL, gText_PreviousTime, 0, 33, TEXT_SKIP_DRAW, 0); PrintTime( - 0, + WIN_TIME, 0, 49, gSaveBlock2Ptr->lastBerryTreeUpdate.days, @@ -599,7 +604,7 @@ static void Task_ShowResetRtcPrompt(u8 taskId) gSaveBlock2Ptr->lastBerryTreeUpdate.seconds); ShowMessage(gText_ResetRTCConfirmCancel); - CopyWindowToVram(0, COPYWIN_GFX); + CopyWindowToVram(WIN_TIME, COPYWIN_GFX); ScheduleBgCopyTilemapToVram(0); tState++; case 1: @@ -666,7 +671,7 @@ static void Task_ResetRtcScreen(u8 taskId) // Wait for A or B press on prompt first if (gTasks[tSubTaskId].isActive != TRUE) { - ClearStdWindowAndFrameToTransparent(0, FALSE); + ClearStdWindowAndFrameToTransparent(WIN_TIME, FALSE); ShowMessage(gText_PleaseResetTime); gLocalTime = gSaveBlock2Ptr->lastBerryTreeUpdate; tSubTaskId = CreateTask(Task_ResetRtc_Init, 80); diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index 16310a7c3..b24db3f87 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -258,6 +258,8 @@ static void CreateBattlerSprite(u8 battler) { if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_HP) == 0) return; + if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_IS_EGG)) + return; SetMultiuseSpriteTemplateToPokemon(GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES), GetBattlerPosition(battler)); gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2), posY, GetBattlerSpriteSubpriority(battler)); @@ -311,7 +313,7 @@ static void CreateHealthboxSprite(u8 battler) } else if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI)) { - if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_HP) == 0) + if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_HP) == 0 || GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_IS_EGG)) SetHealthboxSpriteInvisible(healthboxSpriteId); } } diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c index 118cc5e27..7b8822acc 100644 --- a/src/rom_header_gf.c +++ b/src/rom_header_gf.c @@ -9,8 +9,8 @@ // The purpose of this struct is for outside applications to be // able to access parts of the ROM or its save file, like a public API. // In vanilla, it was used by Colosseum and XD to access pokemon graphics. -// -// If this struct is rearranged in any way, it defeats the purpose of +// +// If this struct is rearranged in any way, it defeats the purpose of // having it at all. Applications like PKHex or streaming HUDs may find // these values useful, so there's some potential benefit to keeping it. // If there's a compilation problem below, just comment out the assignment diff --git a/src/trade.c b/src/trade.c index b1aa60e10..1f9e68886 100644 --- a/src/trade.c +++ b/src/trade.c @@ -51,6 +51,68 @@ #include "constants/songs.h" #include "constants/union_room.h" +// IDs for RunTradeMenuCallback +enum { + CB_MAIN_MENU, + CB_SELECTED_MON, + CB_SHOW_MON_SUMMARY, + CB_CONFIRM_TRADE_PROMPT, + CB_CANCEL_TRADE_PROMPT, + CB_READY_WAIT, // Unused in Emerald, equivalent to CB_IDLE + CB_SET_SELECTED_MONS, + CB_PRINT_IS_THIS_OKAY, + CB_HANDLE_TRADE_CANCELED, + CB_FADE_TO_START_TRADE, + CB_WAIT_TO_START_TRADE, + CB_INIT_EXIT_CANCELED_TRADE, + CB_EXIT_CANCELED_TRADE, + CB_START_LINK_TRADE, + CB_INIT_CONFIRM_TRADE_PROMPT, + CB_UNUSED_CLOSE_MSG, + CB_WAIT_TO_START_RFU_TRADE, + CB_PARTNER_MON_INVALID, + CB_IDLE = 100, +}; + +// Indexes for sActionTexts +enum { + TEXT_CANCEL, + TEXT_CHOOSE_MON, + TEXT_SUMMARY, + TEXT_TRADE, + TEXT_CANCEL_TRADE, + TEXT_JP_QUIT, +}; + +// Indexes for sMessages +enum { + MSG_STANDBY, + MSG_CANCELED, + MSG_ONLY_MON1, + MSG_ONLY_MON2, + MSG_WAITING_FOR_FRIEND, + MSG_FRIEND_WANTS_TO_TRADE, + MSG_MON_CANT_BE_TRADED, + MSG_EGG_CANT_BE_TRADED, + MSG_FRIENDS_MON_CANT_BE_TRADED, +}; + +// IDs for QueueAction +enum { + QUEUE_SEND_DATA, + QUEUE_STANDBY, + QUEUE_ONLY_MON1, + QUEUE_ONLY_MON2, + QUEUE_UNUSED1, // Presumably intended for MSG_WAITING_FOR_FRIEND + QUEUE_UNUSED2, // Presumably intended for MSG_FRIEND_WANTS_TO_TRADE + QUEUE_MON_CANT_BE_TRADED, + QUEUE_EGG_CANT_BE_TRADED, + QUEUE_FRIENDS_MON_CANT_BE_TRADED, +}; + +#define QUEUE_DELAY_MSG 3 +#define QUEUE_DELAY_DATA 5 + // The following tags are offsets from GFXTAG_MENU_TEXT // They're looped over in CB2_CreateTradeMenu and CB2_ReturnToTradeMenu // and used as indexes into sMenuTextTileBuffers @@ -69,153 +131,160 @@ enum { GFXTAG_CHOOSE_PKMN_EMPTY_1, // 6 sprites to cover the full bottom bar, but only first 3 are needed GFXTAG_CHOOSE_PKMN_EMPTY_2, GFXTAG_CHOOSE_PKMN_EMPTY_3, - GFXTAG_MENU_TEXT_COUNT + NUM_MENU_TEXT_SPRITES }; -#define GFXTAG_PLAYER_NAME (1 + GFXTAG_PLAYER_NAME_R - GFXTAG_PLAYER_NAME_L) -#define GFXTAG_PARTNER_NAME (1 + GFXTAG_PARTNER_NAME_R - GFXTAG_PARTNER_NAME_L) -#define GFXTAG_CHOOSE_PKMN (1 + GFXTAG_CHOOSE_PKMN_EMPTY_3 - GFXTAG_CHOOSE_PKMN_L) +#define NUM_PLAYER_NAME_SPRITES (1 + GFXTAG_PLAYER_NAME_R - GFXTAG_PLAYER_NAME_L) +#define NUM_PARTNER_NAME_SPRITES (1 + GFXTAG_PARTNER_NAME_R - GFXTAG_PARTNER_NAME_L) +#define NUM_CHOOSE_PKMN_SPRITES (1 + GFXTAG_CHOOSE_PKMN_EMPTY_3 - GFXTAG_CHOOSE_PKMN_L) + +// Values for signaling to/from the link partner +enum { + STATUS_NONE, + STATUS_READY, + STATUS_CANCEL, +}; + +// Checked to confirm DrawSelectedMonScreen has reached final state +#define DRAW_SELECTED_FINISH 5 struct InGameTrade { - /*0x00*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; - /*0x0C*/ u16 species; - /*0x0E*/ u8 ivs[NUM_STATS]; - /*0x14*/ u8 abilityNum; - /*0x18*/ u32 otId; - /*0x1C*/ u8 conditions[CONTEST_CATEGORIES_COUNT]; - /*0x24*/ u32 personality; - /*0x28*/ u16 heldItem; - /*0x2A*/ u8 mailNum; - /*0x2B*/ u8 otName[11]; - /*0x36*/ u8 otGender; - /*0x37*/ u8 sheen; - /*0x38*/ u16 requestedSpecies; + u8 nickname[POKEMON_NAME_LENGTH + 1]; + u16 species; + u8 ivs[NUM_STATS]; + u8 abilityNum; + u32 otId; + u8 conditions[CONTEST_CATEGORIES_COUNT]; + u32 personality; + u16 heldItem; + u8 mailNum; + u8 otName[11]; + u8 otGender; + u8 sheen; + u16 requestedSpecies; }; -static EWRAM_DATA u8 *sMenuTextAllocBuffer = NULL; +static EWRAM_DATA u8 *sMenuTextTileBuffer = NULL; // Bytes 0-2 are used for the player's name text // Bytes 3-5 are used for the partner's name text // Bytes 6-7 are used for the Cancel text // Bytes 8-13 are used for the Choose a Pokemon text // See the corresponding GFXTAGs in src/data/trade.h -static EWRAM_DATA u8 *sMenuTextTileBuffers[GFXTAG_MENU_TEXT_COUNT] = {NULL}; +static EWRAM_DATA u8 *sMenuTextTileBuffers[NUM_MENU_TEXT_SPRITES] = {NULL}; EWRAM_DATA struct Mail gTradeMail[PARTY_SIZE] = {0}; EWRAM_DATA u8 gSelectedTradeMonPositions[2] = {0}; static EWRAM_DATA struct { - /*0x0000*/ u8 bg2hofs; - /*0x0001*/ u8 bg3hofs; - /*0x0002*/ u8 filler_2[38]; - /*0x0028*/ u8 partySpriteIds[2][PARTY_SIZE]; - /*0x0034*/ u8 cursorSpriteId; - /*0x0035*/ u8 cursorPosition; - /*0x0036*/ u8 partyCounts[2]; - /*0x0038*/ bool8 monPresent[PARTY_SIZE * 2]; - /*0x0044*/ bool8 neverRead_44; - /*0x0045*/ bool8 isLiveMon[2][PARTY_SIZE]; - /*0x0051*/ bool8 isEgg[2][PARTY_SIZE]; - /*0x005D*/ u8 hpBarLevels[2][PARTY_SIZE]; - /*0x0069*/ u8 bufferPartyState; - /*0x006A*/ u8 filler_6A[5]; - /*0x006F*/ u8 tradeMenuFunc; - /*0x0070*/ u8 neverRead_70; - /*0x0071*/ u8 filler_71; - /*0x0072*/ u16 bottomTextTileStart; - /*0x0074*/ u8 drawPartyState[2]; - /*0x0076*/ u8 selectedMonIdx[2]; - /*0x0078*/ u8 playerLinkFlagChoseAction; - /*0x0079*/ u8 partnerLinkFlagChoseAction; - /*0x007A*/ u8 playerLinkFlagStatus; - /*0x007B*/ u8 partnerLinkFlagStatus; - /*0x007C*/ u8 filler_7C[2]; - /*0x007E*/ u8 partnerCursorPosition; - /*0x007F*/ u8 unused_7F; - /*0x0080*/ u16 linkData[20]; - /*0x00A8*/ u8 timer; - /*0x00A9*/ u8 giftRibbons[GIFT_RIBBONS_COUNT]; - /*0x00B4*/ u8 filler_B4[0x81C]; - /*0x08D0*/ struct { - bool8 queued; - u16 queueDelay; + u8 bg2hofs; + u8 bg3hofs; + u8 filler_2[38]; + u8 partySpriteIds[2][PARTY_SIZE]; + u8 cursorSpriteId; + u8 cursorPosition; + u8 partyCounts[2]; + bool8 optionsActive[PARTY_SIZE * 2 + 1]; + bool8 isLiveMon[2][PARTY_SIZE]; + bool8 isEgg[2][PARTY_SIZE]; + u8 hpBarLevels[2][PARTY_SIZE]; + u8 bufferPartyState; + u8 filler_6A[5]; + u8 callbackId; + u8 neverRead_70; + u16 bottomTextTileStart; + u8 drawSelectedMonState[2]; + u8 selectedMonIdx[2]; + u8 playerSelectStatus; + u8 partnerSelectStatus; + u8 playerConfirmStatus; + u8 partnerConfirmStatus; + u8 filler_7C[2]; + u8 partnerCursorPosition; + u16 linkData[20]; + u8 timer; + u8 giftRibbons[GIFT_RIBBONS_COUNT]; + u8 filler_B4[0x81C]; + struct { + bool8 active; + u16 delay; u8 actionId; } queuedActions[4]; - /*0x08F0*/ u16 tilemapBuffer[0x400]; -} *sTradeMenuData = {NULL}; + u16 tilemapBuffer[BG_SCREEN_SIZE / 2]; +} *sTradeMenu = NULL; static EWRAM_DATA struct { - /*0x00*/ struct Pokemon tempMon; // Used as a temp variable when swapping Pokémon - /*0x64*/ u32 timer; - /*0x68*/ u32 monPersonalities[2]; - /*0x70*/ u8 filler_70[2]; - /*0x72*/ u8 playerLinkFlagFinishTrade; - /*0x73*/ u8 partnerLinkFlagFinishTrade; - /*0x74*/ u16 linkData[10]; - /*0x88*/ u8 linkTimeoutZero1; - /*0x89*/ u8 linkTimeoutZero2; - /*0x8A*/ u16 linkTimeoutCounter; - /*0x8C*/ u16 neverRead_8C; - /*0x8E*/ u8 monSpriteIds[2]; - /*0x90*/ u8 connectionSpriteId1; // Multi-purpose sprite ids used during the transfer sequence - /*0x91*/ u8 connectionSpriteId2; - /*0x92*/ u8 cableEndSpriteId; - /*0x93*/ u8 sendTradeFinishState; - /*0x94*/ u16 state; - /*0x96*/ u8 filler_96[0xD2 - 0x96]; - /*0xD2*/ u8 releasePokeballSpriteId; - /*0xD3*/ u8 bouncingPokeballSpriteId; - /*0xD4*/ u16 texX; - /*0xD6*/ u16 texY; - /*0xD8*/ u16 neverRead_D8; - /*0xDA*/ u16 neverRead_DA; - /*0xDC*/ u16 scrX; - /*0xDE*/ u16 scrY; - /*0xE0*/ s16 bg1vofs; - /*0xE2*/ s16 bg1hofs; - /*0xE4*/ s16 bg2vofs; - /*0xE6*/ s16 bg2hofs; - /*0xE8*/ u16 sXY; - /*0xEA*/ u16 gbaScale; - /*0xEC*/ u16 alpha; - /*0xEE*/ bool8 isLinkTrade; - /*0xF0*/ u16 monSpecies[2]; - /*0xF4*/ u16 cachedMapMusic; - /*0xF6*/ u8 textColors[3]; - /*0xF9*/ u8 filler_F9; - /*0xFA*/ bool8 isCableTrade; - /*0xFB*/ u8 wirelessWinLeft; - /*0xFC*/ u8 wirelessWinTop; - /*0xFD*/ u8 wirelessWinRight; - /*0xFE*/ u8 wirelessWinBottom; -} *sTradeData = {NULL}; + struct Pokemon tempMon; // Used as a temp variable when swapping Pokémon + u32 timer; + u32 monPersonalities[2]; + u8 filler_70[2]; + u8 playerFinishStatus; + u8 partnerFinishStatus; + u16 linkData[10]; + u8 linkTimeoutZero1; + u8 linkTimeoutZero2; + u16 linkTimeoutTimer; + u16 neverRead_8C; + u8 monSpriteIds[2]; + u8 connectionSpriteId1; // Multi-purpose sprite ids used during the transfer sequence + u8 connectionSpriteId2; + u8 cableEndSpriteId; + u8 scheduleLinkTransfer; + u16 state; + u8 filler_96[0x3C]; + u8 releasePokeballSpriteId; + u8 bouncingPokeballSpriteId; + u16 texX; + u16 texY; + u16 neverRead_D8; + u16 neverRead_DA; + u16 scrX; + u16 scrY; + s16 bg1vofs; + s16 bg1hofs; + s16 bg2vofs; + s16 bg2hofs; + u16 sXY; + u16 gbaScale; + u16 alpha; + bool8 isLinkTrade; + u16 monSpecies[2]; + u16 cachedMapMusic; + u8 textColors[3]; + u8 filler_F9; + bool8 isCableTrade; + u8 wirelessWinLeft; + u8 wirelessWinTop; + u8 wirelessWinRight; + u8 wirelessWinBottom; +} *sTradeAnim = NULL; static bool32 IsWirelessTrade(void); static void CB2_CreateTradeMenu(void); static void VBlankCB_TradeMenu(void); static void CB2_TradeMenu(void); static void LoadTradeBgGfx(u8); -static void SetTradePartyMonsVisible(void); +static void SetActiveMenuOptions(void); static bool8 BufferTradeParties(void); -static void CB1_SendOrReactToLinkTradeData(void); -static void CallTradeMenuFunc(void); +static void CB1_UpdateLink(void); +static void RunTradeMenuCallback(void); static void SetSelectedMon(u8); -static void DrawTradeMenuParty(u8); +static void DrawSelectedMonScreen(u8); static u8 GetMonNicknameWidth(u8 *, u8, u8); -static void BufferTradeMonMoves(u8 *, u8, u8); -static void PrintPartyNicknamesForTradeMenu(u8); -static void DrawTradeMenuPartyMonInfo(u8, u8, u8, u8, u8, u8); -static void DrawTradeMenuPartyInfo(u8); -static void PrintNicknamesForTradeMenu(void); -static void RedrawTradeMenuParty(u8); +static void BufferMovesString(u8 *, u8, u8); +static void PrintPartyNicknames(u8); +static void PrintLevelAndGender(u8, u8, u8, u8, u8, u8); +static void PrintPartyLevelsAndGenders(u8); +static void PrintTradePartnerPartyNicknames(void); +static void RedrawPartyWindow(u8); static void Task_DrawSelectionSummary(u8); static void Task_DrawSelectionTrade(u8); static void QueueAction(u16, u8); static u32 GetNumQueuedActions(void); static void DoQueuedActions(void); static void PrintTradeMessage(u8); -static bool8 LoadTradeMenuSpriteSheetsAndPalettes(void); +static bool8 LoadUISpriteGfx(void); static void DrawBottomRowText(const u8 *, u8 *, u8); -static void SetTradePartyLiveStatuses(u8); -static void GetTradePartyHPBarLevels(u8); +static void ComputePartyTradeableFlags(u8); +static void ComputePartyHPBarLevels(u8); static void SetTradePartyHPBarSprites(void); static void SaveTradeGiftRibbons(void); static u32 CanTradeSelectedMon(struct Pokemon *, int, int); @@ -224,29 +293,29 @@ static void SpriteCB_LinkMonShadow(struct Sprite *); static void SpriteCB_CableEndSending(struct Sprite *); static void SpriteCB_CableEndReceiving(struct Sprite *); static void SpriteCB_GbaScreen(struct Sprite *); -static void InitTradeBgInternal(void); -static void CB2_UpdateInGameTrade(void); +static void TradeAnimInit_LoadGfx(void); +static void CB2_InGameTrade(void); static void SetTradeSequenceBgGpuRegs(u8); static void LoadTradeSequenceSpriteSheetsAndPalettes(void); static void BufferTradeSceneStrings(void); -static bool8 AnimateTradeSequence(void); -static bool8 AnimateTradeSequenceCable(void); -static bool8 AnimateTradeSequenceWireless(void); +static bool8 DoTradeAnim(void); +static bool8 DoTradeAnim_Cable(void); +static bool8 DoTradeAnim_Wireless(void); static void SpriteCB_BouncingPokeball(struct Sprite *); static void SpriteCB_BouncingPokeballDepart(struct Sprite *); static void SpriteCB_BouncingPokeballDepartEnd(struct Sprite *); static void SpriteCB_BouncingPokeballArrive(struct Sprite *); static void BufferInGameTradeMonName(void); -static void SetInGameTradeMail(struct Mail *, const struct InGameTrade *); +static void GetInGameTradeMail(struct Mail *, const struct InGameTrade *); static void CB2_UpdateLinkTrade(void); -static void CB2_TryFinishTrade(void); +static void CB2_WaitTradeComplete(void); static void CB2_SaveAndEndTrade(void); -static void CB2_FreeTradeData(void); +static void CB2_FreeTradeAnim(void); static void Task_InGameTrade(u8); static void CheckPartnersMonForRibbons(void); static void Task_AnimateWirelessSignal(u8); -static void Task_NarrowWindowForCrossing_Wireless(u8); -static void Task_NarrowWindowForCrossing_Cable(u8); +static void Task_OpenCenterWhiteColumn(u8); +static void Task_CloseCenterWhiteColumn(u8); static void CB2_SaveAndEndWirelessTrade(void); #include "data/trade.h" @@ -336,16 +405,16 @@ static void InitTradeMenu(void) LoadPalette(gStandardMenuPalette, BG_PLTT_ID(15), PLTT_SIZEOF(10)); LoadPalette(gStandardMenuPalette, BG_PLTT_ID(13), PLTT_SIZEOF(10)); ResetBgsAndClearDma3BusyFlags(0); - InitBgsFromTemplates(0, sTradeMenuBgTemplates, ARRAY_COUNT(sTradeMenuBgTemplates)); - SetBgTilemapBuffer(1, sTradeMenuData->tilemapBuffer); + InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); + SetBgTilemapBuffer(1, sTradeMenu->tilemapBuffer); - if (InitWindows(sTradeMenuWindowTemplates)) + if (InitWindows(sWindowTemplates)) { u32 i; DeactivateAllTextPrinters(); - for (i = 0; i < 18; i++) + for (i = 0; i < ARRAY_COUNT(sWindowTemplates) - 1; i++) { ClearWindowTilemap(i); FillWindowPixelBuffer(i, PIXEL_FILL(0)); @@ -355,14 +424,14 @@ static void InitTradeMenu(void) LoadUserWindowBorderGfx_(0, 20, BG_PLTT_ID(12)); LoadUserWindowBorderGfx(2, 1, BG_PLTT_ID(14)); LoadMonIconPalettes(); - sTradeMenuData->bufferPartyState = 0; - sTradeMenuData->tradeMenuFunc = 0; - sTradeMenuData->neverRead_70 = 0; - sTradeMenuData->drawPartyState[TRADE_PLAYER] = 0; - sTradeMenuData->drawPartyState[TRADE_PARTNER] = 0; - sTradeMenuData->playerLinkFlagStatus = 0; - sTradeMenuData->partnerLinkFlagStatus = 0; - sTradeMenuData->timer = 0; + sTradeMenu->bufferPartyState = 0; + sTradeMenu->callbackId = CB_MAIN_MENU; + sTradeMenu->neverRead_70 = 0; + sTradeMenu->drawSelectedMonState[TRADE_PLAYER] = 0; + sTradeMenu->drawSelectedMonState[TRADE_PARTNER] = 0; + sTradeMenu->playerConfirmStatus = STATUS_NONE; + sTradeMenu->partnerConfirmStatus = STATUS_NONE; + sTradeMenu->timer = 0; } } @@ -383,12 +452,12 @@ static void CB2_CreateTradeMenu(void) switch (gMain.state) { case 0: - sTradeMenuData = AllocZeroed(sizeof(*sTradeMenuData)); + sTradeMenu = AllocZeroed(sizeof(*sTradeMenu)); InitTradeMenu(); - sMenuTextAllocBuffer = AllocZeroed(GFXTAG_MENU_TEXT_COUNT * 256); + sMenuTextTileBuffer = AllocZeroed(NUM_MENU_TEXT_SPRITES * 256); - for (i = 0; i < GFXTAG_MENU_TEXT_COUNT; i++) - sMenuTextTileBuffers[i] = &sMenuTextAllocBuffer[i * 256]; + for (i = 0; i < NUM_MENU_TEXT_SPRITES; i++) + sMenuTextTileBuffers[i] = &sMenuTextTileBuffer[i * 256]; gMain.state++; break; @@ -398,13 +467,13 @@ static void CB2_CreateTradeMenu(void) for (i = 0; i < PARTY_SIZE; i++) CreateMon(&gEnemyParty[i], SPECIES_NONE, 0, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0); - PrintTradeMessage(TRADE_MSG_STANDBY); + PrintTradeMessage(MSG_STANDBY); ShowBg(0); if (!gReceivedRemoteLinkPlayers) { gLinkType = LINKTYPE_TRADE_CONNECTING; - sTradeMenuData->timer = 0; + sTradeMenu->timer = 0; if (gWirelessCommType) { @@ -425,10 +494,10 @@ static void CB2_CreateTradeMenu(void) } break; case 2: - sTradeMenuData->timer++; - if (sTradeMenuData->timer > 11) + sTradeMenu->timer++; + if (sTradeMenu->timer > 11) { - sTradeMenuData->timer = 0; + sTradeMenu->timer = 0; gMain.state++; } break; @@ -437,7 +506,7 @@ static void CB2_CreateTradeMenu(void) { if (IsLinkMaster()) { - if (++sTradeMenuData->timer > 30) + if (++sTradeMenu->timer > 30) { CheckShouldAdvanceLinkState(); gMain.state++; @@ -455,7 +524,7 @@ static void CB2_CreateTradeMenu(void) DestroyTask_RfuIdle(); CalculatePlayerPartyCount(); gMain.state++; - sTradeMenuData->timer = 0; + sTradeMenu->timer = 0; if (gWirelessCommType) { Rfu_SetLinkRecovery(TRUE); @@ -489,13 +558,13 @@ static void CB2_CreateTradeMenu(void) CalculateEnemyPartyCount(); SetGpuReg(REG_OFFSET_DISPCNT, 0); SetGpuReg(REG_OFFSET_BLDCNT, 0); - sTradeMenuData->partyCounts[TRADE_PLAYER] = gPlayerPartyCount; - sTradeMenuData->partyCounts[TRADE_PARTNER] = gEnemyPartyCount; + sTradeMenu->partyCounts[TRADE_PLAYER] = gPlayerPartyCount; + sTradeMenu->partyCounts[TRADE_PARTNER] = gEnemyPartyCount; - for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PLAYER]; i++) + for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++) { struct Pokemon *mon = &gPlayerParty[i]; - sTradeMenuData->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2), + sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2), SpriteCB_MonIcon, (sTradeMonSpriteCoords[i][0] * 8) + 14, (sTradeMonSpriteCoords[i][1] * 8) - 12, @@ -503,10 +572,10 @@ static void CB2_CreateTradeMenu(void) GetMonData(mon, MON_DATA_PERSONALITY)); } - for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PARTNER]; i++) + for (i = 0; i < sTradeMenu->partyCounts[TRADE_PARTNER]; i++) { struct Pokemon *mon = &gEnemyParty[i]; - sTradeMenuData->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL), + sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL), SpriteCB_MonIcon, (sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14, (sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12, @@ -517,30 +586,30 @@ static void CB2_CreateTradeMenu(void) break; case 8: LoadHeldItemIcons(); - DrawHeldItemIconsForTrade(&sTradeMenuData->partyCounts[0], sTradeMenuData->partySpriteIds[0], TRADE_PLAYER); + DrawHeldItemIconsForTrade(&sTradeMenu->partyCounts[0], sTradeMenu->partySpriteIds[0], TRADE_PLAYER); gMain.state++; break; case 9: - DrawHeldItemIconsForTrade(&sTradeMenuData->partyCounts[0], sTradeMenuData->partySpriteIds[0], TRADE_PARTNER); + DrawHeldItemIconsForTrade(&sTradeMenu->partyCounts[0], sTradeMenu->partySpriteIds[0], TRADE_PARTNER); gMain.state++; break; case 10: DrawTextWindowAndBufferTiles(gSaveBlock2Ptr->playerName, sMenuTextTileBuffers[GFXTAG_PLAYER_NAME_L], 0, 0, 3); id = GetMultiplayerId(); DrawTextWindowAndBufferTiles(gLinkPlayers[id ^ 1].name, sMenuTextTileBuffers[GFXTAG_PARTNER_NAME_L], 0, 0, 3); - DrawTextWindowAndBufferTiles(sTradeActionTexts[TRADE_TEXT_CANCEL], sMenuTextTileBuffers[GFXTAG_CANCEL_L], 0, 0, 2); - DrawBottomRowText(sTradeActionTexts[TRADE_TEXT_CHOOSE_MON], sMenuTextTileBuffers[GFXTAG_CHOOSE_PKMN_L], 24); + DrawTextWindowAndBufferTiles(sActionTexts[TEXT_CANCEL], sMenuTextTileBuffers[GFXTAG_CANCEL_L], 0, 0, 2); + DrawBottomRowText(sActionTexts[TEXT_CHOOSE_MON], sMenuTextTileBuffers[GFXTAG_CHOOSE_PKMN_L], 24); gMain.state++; - sTradeMenuData->timer = 0; + sTradeMenu->timer = 0; break; case 11: - if (LoadTradeMenuSpriteSheetsAndPalettes()) + if (LoadUISpriteGfx()) gMain.state++; break; case 12: // Create player's name text sprites xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gSaveBlock2Ptr->playerName, 120); - for (i = 0; i < GFXTAG_PLAYER_NAME; i++) + for (i = 0; i < NUM_PLAYER_NAME_SPRITES; i++) { temp = sSpriteTemplate_MenuText; temp.tileTag += i + GFXTAG_PLAYER_NAME_L; @@ -549,7 +618,7 @@ static void CB2_CreateTradeMenu(void) // Create partner's name text sprites xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gLinkPlayers[GetMultiplayerId() ^ 1].name, 120); - for (i = 0; i < GFXTAG_PARTNER_NAME; i++) + for (i = 0; i < NUM_PARTNER_NAME_SPRITES; i++) { temp = sSpriteTemplate_MenuText; temp.tileTag += i + GFXTAG_PARTNER_NAME_L; @@ -564,33 +633,33 @@ static void CB2_CreateTradeMenu(void) CreateSprite(&temp, 215, 152, 1); temp = sSpriteTemplate_MenuText; temp.tileTag += GFXTAG_CANCEL_R; - CreateSprite(&temp, 247, 152, 1); + CreateSprite(&temp, 215 + 32, 152, 1); // Create Choose a Pokémon text sprites (only 3 are needed, other 3 are empty) - for (i = 0; i < GFXTAG_CHOOSE_PKMN; i++) + for (i = 0; i < NUM_CHOOSE_PKMN_SPRITES; i++) { temp = sSpriteTemplate_MenuText; temp.tileTag += i + GFXTAG_CHOOSE_PKMN_L; CreateSprite(&temp, (i * 32) + 24, 150, 1); } - sTradeMenuData->cursorSpriteId = CreateSprite(&sSpriteTemplate_Cursor, sTradeMonSpriteCoords[0][0] * 8 + 32, sTradeMonSpriteCoords[0][1] * 8, 2); - sTradeMenuData->cursorPosition = 0; + sTradeMenu->cursorSpriteId = CreateSprite(&sSpriteTemplate_Cursor, sTradeMonSpriteCoords[0][0] * 8 + 32, sTradeMonSpriteCoords[0][1] * 8, 2); + sTradeMenu->cursorPosition = 0; gMain.state++; rbox_fill_rectangle(0); break; case 14: - SetTradePartyLiveStatuses(TRADE_PLAYER); - PrintPartyNicknamesForTradeMenu(TRADE_PLAYER); - sTradeMenuData->bg2hofs = 0; - sTradeMenuData->bg3hofs = 0; - SetTradePartyMonsVisible(); + ComputePartyTradeableFlags(TRADE_PLAYER); + PrintPartyNicknames(TRADE_PLAYER); + sTradeMenu->bg2hofs = 0; + sTradeMenu->bg3hofs = 0; + SetActiveMenuOptions(); gMain.state++; PlayBGM(MUS_SCHOOL); break; case 15: - SetTradePartyLiveStatuses(TRADE_PARTNER); - PrintPartyNicknamesForTradeMenu(TRADE_PARTNER); + ComputePartyTradeableFlags(TRADE_PARTNER); + PrintPartyNicknames(TRADE_PARTNER); gMain.state++; // fallthrough case 16: @@ -611,18 +680,18 @@ static void CB2_CreateTradeMenu(void) gMain.state++; break; case 20: - GetTradePartyHPBarLevels(TRADE_PLAYER); + ComputePartyHPBarLevels(TRADE_PLAYER); gMain.state++; break; case 21: - GetTradePartyHPBarLevels(TRADE_PARTNER); + ComputePartyHPBarLevels(TRADE_PARTNER); SetTradePartyHPBarSprites(); gMain.state++; break; case 22: if (!gPaletteFade.active) { - gMain.callback1 = CB1_SendOrReactToLinkTradeData; + gMain.callback1 = CB1_UpdateLink; SetMainCallback2(CB2_TradeMenu); } break; @@ -650,7 +719,7 @@ static void CB2_ReturnToTradeMenu(void) break; case 1: gMain.state++; - sTradeMenuData->timer = 0; + sTradeMenu->timer = 0; break; case 2: gMain.state++; @@ -675,16 +744,16 @@ static void CB2_ReturnToTradeMenu(void) break; case 7: CalculateEnemyPartyCount(); - sTradeMenuData->partyCounts[TRADE_PLAYER] = gPlayerPartyCount; - sTradeMenuData->partyCounts[TRADE_PARTNER] = gEnemyPartyCount; + sTradeMenu->partyCounts[TRADE_PLAYER] = gPlayerPartyCount; + sTradeMenu->partyCounts[TRADE_PARTNER] = gEnemyPartyCount; ClearWindowTilemap(0); - PrintPartyNicknamesForTradeMenu(TRADE_PLAYER); - PrintPartyNicknamesForTradeMenu(TRADE_PARTNER); + PrintPartyNicknames(TRADE_PLAYER); + PrintPartyNicknames(TRADE_PARTNER); - for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PLAYER]; i++) + for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++) { struct Pokemon *mon = &gPlayerParty[i]; - sTradeMenuData->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL), + sTradeMenu->partySpriteIds[TRADE_PLAYER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL), SpriteCB_MonIcon, (sTradeMonSpriteCoords[i][0] * 8) + 14, (sTradeMonSpriteCoords[i][1] * 8) - 12, @@ -692,10 +761,10 @@ static void CB2_ReturnToTradeMenu(void) GetMonData(mon, MON_DATA_PERSONALITY)); } - for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PARTNER]; i++) + for (i = 0; i < sTradeMenu->partyCounts[TRADE_PARTNER]; i++) { struct Pokemon *mon = &gEnemyParty[i]; - sTradeMenuData->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL), + sTradeMenu->partySpriteIds[TRADE_PARTNER][i] = CreateMonIcon(GetMonData(mon, MON_DATA_SPECIES2, NULL), SpriteCB_MonIcon, (sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14, (sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12, @@ -706,30 +775,30 @@ static void CB2_ReturnToTradeMenu(void) break; case 8: LoadHeldItemIcons(); - DrawHeldItemIconsForTrade(&sTradeMenuData->partyCounts[0], sTradeMenuData->partySpriteIds[0], TRADE_PLAYER); + DrawHeldItemIconsForTrade(&sTradeMenu->partyCounts[0], sTradeMenu->partySpriteIds[0], TRADE_PLAYER); gMain.state++; break; case 9: - DrawHeldItemIconsForTrade(&sTradeMenuData->partyCounts[0], sTradeMenuData->partySpriteIds[0], TRADE_PARTNER); + DrawHeldItemIconsForTrade(&sTradeMenu->partyCounts[0], sTradeMenu->partySpriteIds[0], TRADE_PARTNER); gMain.state++; break; case 10: DrawTextWindowAndBufferTiles(gSaveBlock2Ptr->playerName, sMenuTextTileBuffers[GFXTAG_PLAYER_NAME_L], 0, 0, 3); id = GetMultiplayerId(); DrawTextWindowAndBufferTiles(gLinkPlayers[id ^ 1].name, sMenuTextTileBuffers[GFXTAG_PARTNER_NAME_L], 0, 0, 3); - DrawTextWindowAndBufferTiles(sTradeActionTexts[TRADE_TEXT_CANCEL], sMenuTextTileBuffers[GFXTAG_CANCEL_L], 0, 0, 2); - DrawBottomRowText(sTradeActionTexts[TRADE_TEXT_CHOOSE_MON], sMenuTextTileBuffers[GFXTAG_CHOOSE_PKMN_L], 24); + DrawTextWindowAndBufferTiles(sActionTexts[TEXT_CANCEL], sMenuTextTileBuffers[GFXTAG_CANCEL_L], 0, 0, 2); + DrawBottomRowText(sActionTexts[TEXT_CHOOSE_MON], sMenuTextTileBuffers[GFXTAG_CHOOSE_PKMN_L], 24); gMain.state++; - sTradeMenuData->timer = 0; + sTradeMenu->timer = 0; break; case 11: - if (LoadTradeMenuSpriteSheetsAndPalettes()) + if (LoadUISpriteGfx()) gMain.state++; break; case 12: // Create player's name text sprites xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gSaveBlock2Ptr->playerName, 120); - for (i = 0; i < GFXTAG_PLAYER_NAME; i++) + for (i = 0; i < NUM_PLAYER_NAME_SPRITES; i++) { temp = sSpriteTemplate_MenuText; temp.tileTag += i + GFXTAG_PLAYER_NAME_L; @@ -738,7 +807,7 @@ static void CB2_ReturnToTradeMenu(void) // Create partner's name text sprites xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gLinkPlayers[GetMultiplayerId() ^ 1].name, 120); - for (i = 0; i < GFXTAG_PARTNER_NAME; i++) + for (i = 0; i < NUM_PARTNER_NAME_SPRITES; i++) { temp = sSpriteTemplate_MenuText; temp.tileTag += i + GFXTAG_PARTNER_NAME_L; @@ -753,24 +822,24 @@ static void CB2_ReturnToTradeMenu(void) CreateSprite(&temp, 215, 152, 1); temp = sSpriteTemplate_MenuText; temp.tileTag += GFXTAG_CANCEL_R; - CreateSprite(&temp, 247, 152, 1); + CreateSprite(&temp, 215 + 32, 152, 1); // Create Choose a Pokémon text sprites - for (i = 0; i < GFXTAG_CHOOSE_PKMN; i++) + for (i = 0; i < NUM_CHOOSE_PKMN_SPRITES; i++) { temp = sSpriteTemplate_MenuText; temp.tileTag += i + GFXTAG_CHOOSE_PKMN_L; CreateSprite(&temp, (i * 32) + 24, 150, 1); } - if (sTradeMenuData->cursorPosition < PARTY_SIZE) - sTradeMenuData->cursorPosition = gLastViewedMonIndex; + if (sTradeMenu->cursorPosition < PARTY_SIZE) + sTradeMenu->cursorPosition = gLastViewedMonIndex; else - sTradeMenuData->cursorPosition = gLastViewedMonIndex + PARTY_SIZE; + sTradeMenu->cursorPosition = gLastViewedMonIndex + PARTY_SIZE; - sTradeMenuData->cursorSpriteId = CreateSprite(&sSpriteTemplate_Cursor, - sTradeMonSpriteCoords[sTradeMenuData->cursorPosition][0] * 8 + 32, - sTradeMonSpriteCoords[sTradeMenuData->cursorPosition][1] * 8, 2); + sTradeMenu->cursorSpriteId = CreateSprite(&sSpriteTemplate_Cursor, + sTradeMonSpriteCoords[sTradeMenu->cursorPosition][0] * 8 + 32, + sTradeMonSpriteCoords[sTradeMenu->cursorPosition][1] * 8, 2); gMain.state = 16; break; case 16: @@ -779,9 +848,9 @@ static void CB2_ReturnToTradeMenu(void) break; case 17: LoadTradeBgGfx(1); - sTradeMenuData->bg2hofs = 0; - sTradeMenuData->bg3hofs = 0; - SetTradePartyMonsVisible(); + sTradeMenu->bg2hofs = 0; + sTradeMenu->bg3hofs = 0; + SetActiveMenuOptions(); gMain.state++; break; case 18: @@ -804,9 +873,7 @@ static void CB2_ReturnToTradeMenu(void) break; case 22: if (!gPaletteFade.active) - { SetMainCallback2(CB2_TradeMenu); - } break; } @@ -823,59 +890,59 @@ static void VBlankCB_TradeMenu(void) TransferPlttBuffer(); } -static void LinkTradeFadeOut(void) +static void CB_FadeToStartTrade(void) { - if (++sTradeMenuData->timer > 15) + if (++sTradeMenu->timer > 15) { BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_LINK_TRADE_WAIT_FADE; + sTradeMenu->callbackId = CB_WAIT_TO_START_TRADE; } } -static void LinkTradeWaitForFade(void) +static void CB_WaitToStartTrade(void) { if (!gPaletteFade.active) { - gSelectedTradeMonPositions[TRADE_PLAYER] = sTradeMenuData->cursorPosition; - gSelectedTradeMonPositions[TRADE_PARTNER] = sTradeMenuData->partnerCursorPosition; + gSelectedTradeMonPositions[TRADE_PLAYER] = sTradeMenu->cursorPosition; + gSelectedTradeMonPositions[TRADE_PARTNER] = sTradeMenu->partnerCursorPosition; if (gWirelessCommType) { - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_LINK_TRADE_WAIT_QUEUE; + sTradeMenu->callbackId = CB_WAIT_TO_START_RFU_TRADE; } else { SetCloseLinkCallbackAndType(32); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_START_LINK_TRADE; + sTradeMenu->callbackId = CB_START_LINK_TRADE; } } } -static void SetLinkTradeCallbacks(void) +static void CB_StartLinkTrade(void) { gMain.savedCallback = CB2_StartCreateTradeMenu; - // Wireless Link Trade if (gWirelessCommType) { + // Wireless Link Trade if (IsLinkRfuTaskFinished()) { - Free(sMenuTextAllocBuffer); + Free(sMenuTextTileBuffer); FreeAllWindowBuffers(); - Free(sTradeMenuData); + Free(sTradeMenu); gMain.callback1 = NULL; DestroyWirelessStatusIndicatorSprite(); SetMainCallback2(CB2_LinkTrade); } } - // Cable Link Trade else { + // Cable Link Trade if (!gReceivedRemoteLinkPlayers) { - Free(sMenuTextAllocBuffer); + Free(sMenuTextTileBuffer); FreeAllWindowBuffers(); - Free(sTradeMenuData); + Free(sTradeMenu); gMain.callback1 = NULL; SetMainCallback2(CB2_LinkTrade); } @@ -884,13 +951,15 @@ static void SetLinkTradeCallbacks(void) static void CB2_TradeMenu(void) { - CallTradeMenuFunc(); + RunTradeMenuCallback(); DoQueuedActions(); - DrawTradeMenuParty(TRADE_PLAYER); - DrawTradeMenuParty(TRADE_PARTNER); - SetGpuReg(REG_OFFSET_BG2HOFS, sTradeMenuData->bg2hofs++); - SetGpuReg(REG_OFFSET_BG3HOFS, sTradeMenuData->bg3hofs--); + // As long as drawSelectedMonState is 0, these do nothing + DrawSelectedMonScreen(TRADE_PLAYER); + DrawSelectedMonScreen(TRADE_PARTNER); + + SetGpuReg(REG_OFFSET_BG2HOFS, sTradeMenu->bg2hofs++); + SetGpuReg(REG_OFFSET_BG3HOFS, sTradeMenu->bg3hofs--); RunTextPrintersAndIsPrinter0Active(); RunTasks(); @@ -913,8 +982,8 @@ static void LoadTradeBgGfx(u8 state) break; case 1: LoadBgTilemap(3, sTradeStripesBG3Tilemap, 0x800, 0); - DrawTradeMenuPartyInfo(TRADE_PLAYER); - DrawTradeMenuPartyInfo(TRADE_PARTNER); + PrintPartyLevelsAndGenders(TRADE_PLAYER); + PrintPartyLevelsAndGenders(TRADE_PARTNER); CopyBgTilemapBufferToVram(1); break; case 2: @@ -928,47 +997,50 @@ static void LoadTradeBgGfx(u8 state) } } -static void SetTradePartyMonsVisible(void) +// Determine (based on party counts) where the main menu cursor can go +static void SetActiveMenuOptions(void) { int i; for (i = 0; i < PARTY_SIZE; i++) { - if (i < sTradeMenuData->partyCounts[TRADE_PLAYER]) + if (i < sTradeMenu->partyCounts[TRADE_PLAYER]) { - gSprites[sTradeMenuData->partySpriteIds[TRADE_PLAYER][i]].invisible = FALSE; - sTradeMenuData->monPresent[i] = TRUE; + // Present player pokemon + gSprites[sTradeMenu->partySpriteIds[TRADE_PLAYER][i]].invisible = FALSE; + sTradeMenu->optionsActive[i] = TRUE; } else { - sTradeMenuData->monPresent[i] = FALSE; + // Absent player pokemon + sTradeMenu->optionsActive[i] = FALSE; } - if (i < sTradeMenuData->partyCounts[TRADE_PARTNER]) + if (i < sTradeMenu->partyCounts[TRADE_PARTNER]) { - gSprites[sTradeMenuData->partySpriteIds[TRADE_PARTNER][i]].invisible = FALSE; - sTradeMenuData->monPresent[i + PARTY_SIZE] = TRUE; + // Present partner pokemon + gSprites[sTradeMenu->partySpriteIds[TRADE_PARTNER][i]].invisible = FALSE; + sTradeMenu->optionsActive[i + PARTY_SIZE] = TRUE; } else { - sTradeMenuData->monPresent[i + PARTY_SIZE] = FALSE; + // Absent partner pokemon + sTradeMenu->optionsActive[i + PARTY_SIZE] = FALSE; } } - sTradeMenuData->neverRead_44 = TRUE; + // Cancel is always active + sTradeMenu->optionsActive[PARTY_SIZE * 2] = TRUE; } // why not just use memcpy? -static void Trade_Memcpy(void *dataDest, const void *dataSrc, u32 count) +static void Trade_Memcpy(void *dest, const void *src, u32 size) { - u8 *dest = dataDest; - const u8 *src = dataSrc; + u8 *_dest = dest; + const u8 *_src = src; u32 i; - - for (i = 0; i < count; i++) - { - dest[i] = src[i]; - } + for (i = 0; i < size; i++) + _dest[i] = _src[i]; } static bool8 BufferTradeParties(void) @@ -977,107 +1049,107 @@ static bool8 BufferTradeParties(void) int i; struct Pokemon *mon; - switch (sTradeMenuData->bufferPartyState) + switch (sTradeMenu->bufferPartyState) { case 0: // The parties are sent in pairs rather than all at once Trade_Memcpy(gBlockSendBuffer, &gPlayerParty[0], 2 * sizeof(struct Pokemon)); - sTradeMenuData->bufferPartyState++; - sTradeMenuData->timer = 0; + sTradeMenu->bufferPartyState++; + sTradeMenu->timer = 0; break; case 1: if (IsLinkTradeTaskFinished()) { if (_GetBlockReceivedStatus() == 0) { - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; } else { TradeResetReceivedFlags(); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; } } break; case 3: if (id == 0) RequestLinkData(BLOCK_REQ_SIZE_200); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; break; case 4: if (_GetBlockReceivedStatus() == 3) { Trade_Memcpy(&gEnemyParty[0], gBlockRecvBuffer[id ^ 1], 2 * sizeof(struct Pokemon)); TradeResetReceivedFlags(); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; } break; case 5: Trade_Memcpy(gBlockSendBuffer, &gPlayerParty[2], 2 * sizeof(struct Pokemon)); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; break; case 7: if (id == 0) RequestLinkData(BLOCK_REQ_SIZE_200); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; break; case 8: if (_GetBlockReceivedStatus() == 3) { Trade_Memcpy(&gEnemyParty[2], gBlockRecvBuffer[id ^ 1], 2 * sizeof(struct Pokemon)); TradeResetReceivedFlags(); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; } break; case 9: Trade_Memcpy(gBlockSendBuffer, &gPlayerParty[4], 2 * sizeof(struct Pokemon)); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; break; case 11: if (id == 0) RequestLinkData(BLOCK_REQ_SIZE_200); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; break; case 12: if (_GetBlockReceivedStatus() == 3) { Trade_Memcpy(&gEnemyParty[4], gBlockRecvBuffer[id ^ 1], 2 * sizeof(struct Pokemon)); TradeResetReceivedFlags(); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; } break; case 13: Trade_Memcpy(gBlockSendBuffer, gSaveBlock1Ptr->mail, PARTY_SIZE * sizeof(struct Mail) + 4); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; break; case 15: if (id == 0) RequestLinkData(BLOCK_REQ_SIZE_220); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; break; case 16: if (_GetBlockReceivedStatus() == 3) { Trade_Memcpy(gTradeMail, gBlockRecvBuffer[id ^ 1], PARTY_SIZE * sizeof(struct Mail)); TradeResetReceivedFlags(); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; } break; case 17: - Trade_Memcpy(gBlockSendBuffer, gSaveBlock1Ptr->giftRibbons, sizeof(sTradeMenuData->giftRibbons)); - sTradeMenuData->bufferPartyState++; + Trade_Memcpy(gBlockSendBuffer, gSaveBlock1Ptr->giftRibbons, sizeof(sTradeMenu->giftRibbons)); + sTradeMenu->bufferPartyState++; break; case 19: if (id == 0) RequestLinkData(BLOCK_REQ_SIZE_40); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; break; case 20: if (_GetBlockReceivedStatus() == 3) { - Trade_Memcpy(sTradeMenuData->giftRibbons, gBlockRecvBuffer[id ^ 1], sizeof(sTradeMenuData->giftRibbons)); + Trade_Memcpy(sTradeMenu->giftRibbons, gBlockRecvBuffer[id ^ 1], sizeof(sTradeMenu->giftRibbons)); TradeResetReceivedFlags(); - sTradeMenuData->bufferPartyState++; + sTradeMenu->bufferPartyState++; } break; case 21: @@ -1092,10 +1164,8 @@ static bool8 BufferTradeParties(void) { GetMonData(mon, MON_DATA_NICKNAME, name); - if (!StringCompareWithoutExtCtrlCodes(name, sJPText_Shedinja)) - { + if (!StringCompareWithoutExtCtrlCodes(name, sText_ShedinjaJP)) SetMonData(mon, MON_DATA_NICKNAME, gSpeciesNames[SPECIES_SHEDINJA]); - } } } } @@ -1106,40 +1176,39 @@ static bool8 BufferTradeParties(void) case 10: case 14: case 18: - sTradeMenuData->timer++; - if (sTradeMenuData->timer > 10) + sTradeMenu->timer++; + if (sTradeMenu->timer > 10) { - sTradeMenuData->timer = 0; - sTradeMenuData->bufferPartyState++; + sTradeMenu->timer = 0; + sTradeMenu->bufferPartyState++; } break; } return FALSE; } -static void DrawIsThisTradeOkay(void) +static void PrintIsThisTradeOkay(void) { - DrawBottomRowText(sText_IsThisTradeOkay, (void *)(OBJ_VRAM0 + (sTradeMenuData->bottomTextTileStart * 32)), 24); + DrawBottomRowText(sText_IsThisTradeOkay, (void *)(OBJ_VRAM0 + (sTradeMenu->bottomTextTileStart * 32)), 24); } -// mpId is unused -static void UpdateLinkTradeFlags(u8 mpId, u8 status) +static void Leader_ReadLinkBuffer(u8 mpId, u8 status) { if (status & 1) { switch (gBlockRecvBuffer[0][0]) { case LINKCMD_REQUEST_CANCEL: - sTradeMenuData->playerLinkFlagChoseAction = WANTS_TO_CANCEL; + sTradeMenu->playerSelectStatus = STATUS_CANCEL; break; case LINKCMD_READY_TO_TRADE: - sTradeMenuData->playerLinkFlagChoseAction = WANTS_TO_TRADE; + sTradeMenu->playerSelectStatus = STATUS_READY; break; case LINKCMD_INIT_BLOCK: - sTradeMenuData->playerLinkFlagStatus = INITIATE_TRADE; + sTradeMenu->playerConfirmStatus = STATUS_READY; break; case LINKCMD_READY_CANCEL_TRADE: - sTradeMenuData->playerLinkFlagStatus = CANCEL_TRADE; + sTradeMenu->playerConfirmStatus = STATUS_CANCEL; break; } TradeResetReceivedFlag(0); @@ -1150,25 +1219,24 @@ static void UpdateLinkTradeFlags(u8 mpId, u8 status) switch (gBlockRecvBuffer[1][0]) { case LINKCMD_REQUEST_CANCEL: - sTradeMenuData->partnerLinkFlagChoseAction = WANTS_TO_CANCEL; + sTradeMenu->partnerSelectStatus = STATUS_CANCEL; break; case LINKCMD_READY_TO_TRADE: - sTradeMenuData->partnerCursorPosition = gBlockRecvBuffer[1][1] + 6; - sTradeMenuData->partnerLinkFlagChoseAction = WANTS_TO_TRADE; + sTradeMenu->partnerCursorPosition = gBlockRecvBuffer[1][1] + PARTY_SIZE; + sTradeMenu->partnerSelectStatus = STATUS_READY; break; case LINKCMD_INIT_BLOCK: - sTradeMenuData->partnerLinkFlagStatus = INITIATE_TRADE; + sTradeMenu->partnerConfirmStatus = STATUS_READY; break; case LINKCMD_READY_CANCEL_TRADE: - sTradeMenuData->partnerLinkFlagStatus = CANCEL_TRADE; + sTradeMenu->partnerConfirmStatus = STATUS_CANCEL; break; } TradeResetReceivedFlag(1); } } -// mpId is unused -static void ReactToLinkTradeData(u8 mpId, u8 status) +static void Follower_ReadLinkBuffer(u8 mpId, u8 status) { if (status & 1) { @@ -1176,27 +1244,27 @@ static void ReactToLinkTradeData(u8 mpId, u8 status) { case LINKCMD_BOTH_CANCEL_TRADE: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - PrintTradeMessage(TRADE_MSG_WAITING_FOR_FRIEND); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CANCEL_TRADE_1; + PrintTradeMessage(MSG_WAITING_FOR_FRIEND); + sTradeMenu->callbackId = CB_INIT_EXIT_CANCELED_TRADE; break; case LINKCMD_PARTNER_CANCEL_TRADE: - PrintTradeMessage(TRADE_MSG_FRIEND_WANTS_TO_TRADE); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; + PrintTradeMessage(MSG_FRIEND_WANTS_TO_TRADE); + sTradeMenu->callbackId = CB_HANDLE_TRADE_CANCELED; break; case LINKCMD_SET_MONS_TO_TRADE: - sTradeMenuData->partnerCursorPosition = gBlockRecvBuffer[0][1] + 6; + sTradeMenu->partnerCursorPosition = gBlockRecvBuffer[0][1] + PARTY_SIZE; rbox_fill_rectangle(0); - SetSelectedMon(sTradeMenuData->cursorPosition); - SetSelectedMon(sTradeMenuData->partnerCursorPosition); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CONFIRM_TRADE_PROMPT; + SetSelectedMon(sTradeMenu->cursorPosition); + SetSelectedMon(sTradeMenu->partnerCursorPosition); + sTradeMenu->callbackId = CB_PRINT_IS_THIS_OKAY; break; case LINKCMD_START_TRADE: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_LINK_TRADE_WAIT_FADE; + sTradeMenu->callbackId = CB_WAIT_TO_START_TRADE; break; case LINKCMD_PLAYER_CANCEL_TRADE: - PrintTradeMessage(TRADE_MSG_CANCELED); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; + PrintTradeMessage(MSG_CANCELED); + sTradeMenu->callbackId = CB_HANDLE_TRADE_CANCELED; } TradeResetReceivedFlag(0); } @@ -1205,76 +1273,87 @@ static void ReactToLinkTradeData(u8 mpId, u8 status) TradeResetReceivedFlag(1); } -static void QueueLinkTradeData(void) +static void Leader_HandleCommunication(void) { - if (sTradeMenuData->playerLinkFlagChoseAction && sTradeMenuData->partnerLinkFlagChoseAction) + if (sTradeMenu->playerSelectStatus != STATUS_NONE + && sTradeMenu->partnerSelectStatus != STATUS_NONE) { - if (sTradeMenuData->playerLinkFlagChoseAction == WANTS_TO_TRADE - && sTradeMenuData->partnerLinkFlagChoseAction == WANTS_TO_TRADE) + if (sTradeMenu->playerSelectStatus == STATUS_READY + && sTradeMenu->partnerSelectStatus == STATUS_READY) { - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_BOTH_MONS_SELECTED; - sTradeMenuData->linkData[0] = LINKCMD_SET_MONS_TO_TRADE; - sTradeMenuData->linkData[1] = sTradeMenuData->cursorPosition; + // Both players have selected a pokemon to trade + sTradeMenu->callbackId = CB_SET_SELECTED_MONS; + sTradeMenu->linkData[0] = LINKCMD_SET_MONS_TO_TRADE; + sTradeMenu->linkData[1] = sTradeMenu->cursorPosition; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); - sTradeMenuData->playerLinkFlagChoseAction = sTradeMenuData->partnerLinkFlagChoseAction = 0; + sTradeMenu->playerSelectStatus = sTradeMenu->partnerSelectStatus = STATUS_NONE; } - else if (sTradeMenuData->playerLinkFlagChoseAction == WANTS_TO_TRADE - && sTradeMenuData->partnerLinkFlagChoseAction == WANTS_TO_CANCEL) + else if (sTradeMenu->playerSelectStatus == STATUS_READY + && sTradeMenu->partnerSelectStatus == STATUS_CANCEL) { - PrintTradeMessage(TRADE_MSG_CANCELED); - sTradeMenuData->linkData[0] = LINKCMD_PARTNER_CANCEL_TRADE; - sTradeMenuData->linkData[1] = 0; + // The player has selected a pokemon to trade, + // but the partner has selected Cancel + PrintTradeMessage(MSG_CANCELED); + sTradeMenu->linkData[0] = LINKCMD_PARTNER_CANCEL_TRADE; + sTradeMenu->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); - sTradeMenuData->playerLinkFlagStatus = sTradeMenuData->partnerLinkFlagStatus = 0; - sTradeMenuData->playerLinkFlagChoseAction = sTradeMenuData->partnerLinkFlagChoseAction = 0; - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; + sTradeMenu->playerConfirmStatus = sTradeMenu->partnerConfirmStatus = STATUS_NONE; + sTradeMenu->playerSelectStatus = sTradeMenu->partnerSelectStatus = STATUS_NONE; + sTradeMenu->callbackId = CB_HANDLE_TRADE_CANCELED; } - else if (sTradeMenuData->playerLinkFlagChoseAction == WANTS_TO_CANCEL - && sTradeMenuData->partnerLinkFlagChoseAction == WANTS_TO_TRADE) + else if (sTradeMenu->playerSelectStatus == STATUS_CANCEL + && sTradeMenu->partnerSelectStatus == STATUS_READY) { - PrintTradeMessage(TRADE_MSG_FRIEND_WANTS_TO_TRADE); - sTradeMenuData->linkData[0] = LINKCMD_PLAYER_CANCEL_TRADE; - sTradeMenuData->linkData[1] = 0; + // The partner has selected a pokemon to trade, + // but the player has selected cancel + PrintTradeMessage(MSG_FRIEND_WANTS_TO_TRADE); + sTradeMenu->linkData[0] = LINKCMD_PLAYER_CANCEL_TRADE; + sTradeMenu->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); - sTradeMenuData->playerLinkFlagStatus = sTradeMenuData->partnerLinkFlagStatus = 0; - sTradeMenuData->playerLinkFlagChoseAction = sTradeMenuData->partnerLinkFlagChoseAction = 0; - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; + sTradeMenu->playerConfirmStatus = sTradeMenu->partnerConfirmStatus = STATUS_NONE; + sTradeMenu->playerSelectStatus = sTradeMenu->partnerSelectStatus = STATUS_NONE; + sTradeMenu->callbackId = CB_HANDLE_TRADE_CANCELED; } - else if (sTradeMenuData->playerLinkFlagChoseAction == WANTS_TO_CANCEL - && sTradeMenuData->partnerLinkFlagChoseAction == WANTS_TO_CANCEL) + else if (sTradeMenu->playerSelectStatus == STATUS_CANCEL + && sTradeMenu->partnerSelectStatus == STATUS_CANCEL) { - sTradeMenuData->linkData[0] = LINKCMD_BOTH_CANCEL_TRADE; - sTradeMenuData->linkData[1] = 0; + // Both players have selected Cancel + sTradeMenu->linkData[0] = LINKCMD_BOTH_CANCEL_TRADE; + sTradeMenu->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeMenuData->playerLinkFlagChoseAction = sTradeMenuData->partnerLinkFlagChoseAction = 0; - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CANCEL_TRADE_1; + sTradeMenu->playerSelectStatus = sTradeMenu->partnerSelectStatus = STATUS_NONE; + sTradeMenu->callbackId = CB_INIT_EXIT_CANCELED_TRADE; } } - if (sTradeMenuData->playerLinkFlagStatus && sTradeMenuData->partnerLinkFlagStatus) + if (sTradeMenu->playerConfirmStatus != STATUS_NONE + && sTradeMenu->partnerConfirmStatus != STATUS_NONE) { - if (sTradeMenuData->playerLinkFlagStatus == INITIATE_TRADE - && sTradeMenuData->partnerLinkFlagStatus == INITIATE_TRADE) + if (sTradeMenu->playerConfirmStatus == STATUS_READY + && sTradeMenu->partnerConfirmStatus == STATUS_READY) { - sTradeMenuData->linkData[0] = LINKCMD_START_TRADE; - sTradeMenuData->linkData[1] = 0; + // Both players have confirmed trade + sTradeMenu->linkData[0] = LINKCMD_START_TRADE; + sTradeMenu->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); - sTradeMenuData->playerLinkFlagStatus = 0; - sTradeMenuData->partnerLinkFlagStatus = 0; - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_LINK_TRADE_FADE_OUT; + sTradeMenu->playerConfirmStatus = STATUS_NONE; + sTradeMenu->partnerConfirmStatus = STATUS_NONE; + sTradeMenu->callbackId = CB_FADE_TO_START_TRADE; } - if (sTradeMenuData->playerLinkFlagStatus == CANCEL_TRADE - || sTradeMenuData->partnerLinkFlagStatus == CANCEL_TRADE) + if (sTradeMenu->playerConfirmStatus == STATUS_CANCEL + || sTradeMenu->partnerConfirmStatus == STATUS_CANCEL) { - PrintTradeMessage(TRADE_MSG_CANCELED); - sTradeMenuData->linkData[0] = LINKCMD_PLAYER_CANCEL_TRADE; - sTradeMenuData->linkData[1] = 0; + // One of the players has decided not to confirm the trade, + // or the trade was not allowed. + PrintTradeMessage(MSG_CANCELED); + sTradeMenu->linkData[0] = LINKCMD_PLAYER_CANCEL_TRADE; + sTradeMenu->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); - sTradeMenuData->playerLinkFlagStatus = 0; - sTradeMenuData->partnerLinkFlagStatus = 0; - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; + sTradeMenu->playerConfirmStatus = STATUS_NONE; + sTradeMenu->partnerConfirmStatus = STATUS_NONE; + sTradeMenu->callbackId = CB_HANDLE_TRADE_CANCELED; } } } @@ -1288,10 +1367,10 @@ static void _SetLinkData(u16 *linkData, u16 linkCmd, u16 cursorPosition) static void SetLinkData(u16 linkCmd, u16 cursorPosition) { - _SetLinkData(sTradeMenuData->linkData, linkCmd, cursorPosition); + _SetLinkData(sTradeMenu->linkData, linkCmd, cursorPosition); } -static void CB1_SendOrReactToLinkTradeData(void) +static void CB1_UpdateLink(void) { u8 mpId = GetMultiplayerId(); u8 status; @@ -1299,25 +1378,25 @@ static void CB1_SendOrReactToLinkTradeData(void) if ((status = _GetBlockReceivedStatus())) { if (mpId == 0) - UpdateLinkTradeFlags(mpId, status); + Leader_ReadLinkBuffer(mpId, status); else - ReactToLinkTradeData(mpId, status); + Follower_ReadLinkBuffer(mpId, status); } if (mpId == 0) - QueueLinkTradeData(); + Leader_HandleCommunication(); } -static u8 GetNewTradeMenuPosition(u8 oldPosition, u8 direction) +static u8 GetNewCursorPosition(u8 oldPosition, u8 direction) { int i; u8 newPosition = 0; for (i = 0; i < PARTY_SIZE; i++) { - if (sTradeMenuData->monPresent[sTradeNextSelectedMonTable[oldPosition][direction][i]] == TRUE) + if (sTradeMenu->optionsActive[sCursorMoveDestinations[oldPosition][direction][i]] == TRUE) { - newPosition = sTradeNextSelectedMonTable[oldPosition][direction][i]; + newPosition = sCursorMoveDestinations[oldPosition][direction][i]; break; } } @@ -1327,157 +1406,151 @@ static u8 GetNewTradeMenuPosition(u8 oldPosition, u8 direction) static void TradeMenuMoveCursor(u8 *cursorPosition, u8 direction) { - u8 newPosition = GetNewTradeMenuPosition(*cursorPosition, direction); + u8 newPosition = GetNewCursorPosition(*cursorPosition, direction); if (newPosition == (PARTY_SIZE * 2)) // CANCEL { - StartSpriteAnim(&gSprites[sTradeMenuData->cursorSpriteId], CURSOR_ANIM_ON_CANCEL); - gSprites[sTradeMenuData->cursorSpriteId].x = DISPLAY_WIDTH - 16; - gSprites[sTradeMenuData->cursorSpriteId].y = DISPLAY_HEIGHT; + StartSpriteAnim(&gSprites[sTradeMenu->cursorSpriteId], CURSOR_ANIM_ON_CANCEL); + gSprites[sTradeMenu->cursorSpriteId].x = DISPLAY_WIDTH - 16; + gSprites[sTradeMenu->cursorSpriteId].y = DISPLAY_HEIGHT; } else { - StartSpriteAnim(&gSprites[sTradeMenuData->cursorSpriteId], CURSOR_ANIM_NORMAL); - gSprites[sTradeMenuData->cursorSpriteId].x = sTradeMonSpriteCoords[newPosition][0] * 8 + 32; - gSprites[sTradeMenuData->cursorSpriteId].y = sTradeMonSpriteCoords[newPosition][1] * 8; + StartSpriteAnim(&gSprites[sTradeMenu->cursorSpriteId], CURSOR_ANIM_NORMAL); + gSprites[sTradeMenu->cursorSpriteId].x = sTradeMonSpriteCoords[newPosition][0] * 8 + 32; + gSprites[sTradeMenu->cursorSpriteId].y = sTradeMonSpriteCoords[newPosition][1] * 8; } if (*cursorPosition != newPosition) - { PlaySE(SE_SELECT); - } *cursorPosition = newPosition; } static void SetReadyToTrade(void) { - PrintTradeMessage(TRADE_MSG_STANDBY); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_STANDBY; + PrintTradeMessage(MSG_STANDBY); + sTradeMenu->callbackId = CB_IDLE; if (GetMultiplayerId() == 1) - SetLinkData(LINKCMD_READY_TO_TRADE, sTradeMenuData->cursorPosition); + { + // Communicate to the link leader that we're ready to trade + SetLinkData(LINKCMD_READY_TO_TRADE, sTradeMenu->cursorPosition); + } else - sTradeMenuData->playerLinkFlagChoseAction = WANTS_TO_TRADE; + { + // We are the link leader, no communication necessary + sTradeMenu->playerSelectStatus = STATUS_READY; + } } -static void TradeMenuProcessInput(void) +static void CB_ProcessMenuInput(void) { if (JOY_REPEAT(DPAD_UP)) - { - TradeMenuMoveCursor(&sTradeMenuData->cursorPosition, 0); - } + TradeMenuMoveCursor(&sTradeMenu->cursorPosition, 0); else if (JOY_REPEAT(DPAD_DOWN)) - { - TradeMenuMoveCursor(&sTradeMenuData->cursorPosition, 1); - } + TradeMenuMoveCursor(&sTradeMenu->cursorPosition, 1); else if (JOY_REPEAT(DPAD_LEFT)) - { - TradeMenuMoveCursor(&sTradeMenuData->cursorPosition, 2); - } + TradeMenuMoveCursor(&sTradeMenu->cursorPosition, 2); else if (JOY_REPEAT(DPAD_RIGHT)) - { - TradeMenuMoveCursor(&sTradeMenuData->cursorPosition, 3); - } + TradeMenuMoveCursor(&sTradeMenu->cursorPosition, 3); if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); - // Cursor is in player's party - if (sTradeMenuData->cursorPosition < PARTY_SIZE) + if (sTradeMenu->cursorPosition < PARTY_SIZE) { + // Selected pokemon in player's party DrawTextBorderOuter(1, 1, 14); FillWindowPixelBuffer(1, PIXEL_FILL(1)); PrintMenuTable(1, ARRAY_COUNT(sSelectTradeMonActions), sSelectTradeMonActions); InitMenuInUpperLeftCornerNormal(1, ARRAY_COUNT(sSelectTradeMonActions), 0); PutWindowTilemap(1); CopyWindowToVram(1, COPYWIN_FULL); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_SELECTED_MON; + sTradeMenu->callbackId = CB_SELECTED_MON; } - // Cursor is in partner's party - else if (sTradeMenuData->cursorPosition < PARTY_SIZE * 2) + else if (sTradeMenu->cursorPosition < PARTY_SIZE * 2) { + // Selected pokemon in partner's party BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_SHOW_MON_SUMMARY; + sTradeMenu->callbackId = CB_SHOW_MON_SUMMARY; } - // Cursor is on Cancel - else if (sTradeMenuData->cursorPosition == PARTY_SIZE * 2) + else if (sTradeMenu->cursorPosition == PARTY_SIZE * 2) { + // Selected Cancel CreateYesNoMenu(&sTradeYesNoWindowTemplate, 1, 14, 0); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CANCEL_TRADE_PROMPT; - DrawBottomRowText(sTradeActionTexts[TRADE_TEXT_CANCEL_TRADE], (void *)(OBJ_VRAM0 + sTradeMenuData->bottomTextTileStart * 32), 24); + sTradeMenu->callbackId = CB_CANCEL_TRADE_PROMPT; + DrawBottomRowText(sActionTexts[TEXT_CANCEL_TRADE], (void *)(OBJ_VRAM0 + sTradeMenu->bottomTextTileStart * 32), 24); } } } -static void TradeMenuChooseMon(void) +static void RedrawChooseAPokemonWindow(void) { - PrintNicknamesForTradeMenu(); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_MAIN_MENU; - gSprites[sTradeMenuData->cursorSpriteId].invisible = FALSE; - DrawBottomRowText(sTradeActionTexts[TRADE_TEXT_CHOOSE_MON], (void *)(OBJ_VRAM0 + sTradeMenuData->bottomTextTileStart * 32), 24); + PrintTradePartnerPartyNicknames(); + sTradeMenu->callbackId = CB_MAIN_MENU; + gSprites[sTradeMenu->cursorSpriteId].invisible = FALSE; + DrawBottomRowText(sActionTexts[TEXT_CHOOSE_MON], (void *)(OBJ_VRAM0 + sTradeMenu->bottomTextTileStart * 32), 24); } -static void TradeMenuProcessInput_SelectedMon(void) +static void CB_ProcessSelectedMonInput(void) { switch (Menu_ProcessInputNoWrap()) { case MENU_B_PRESSED: PlaySE(SE_SELECT); - TradeMenuChooseMon(); + RedrawChooseAPokemonWindow(); break; case MENU_NOTHING_CHOSEN: break; case 0: // Summary BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_SHOW_MON_SUMMARY; + sTradeMenu->callbackId = CB_SHOW_MON_SUMMARY; break; case 1: // Trade - switch (CanTradeSelectedMon(gPlayerParty, gPlayerPartyCount, sTradeMenuData->cursorPosition)) + switch (CanTradeSelectedMon(gPlayerParty, gPlayerPartyCount, sTradeMenu->cursorPosition)) { case CAN_TRADE_MON: SetReadyToTrade(); - gSprites[sTradeMenuData->cursorSpriteId].invisible = TRUE; + gSprites[sTradeMenu->cursorSpriteId].invisible = TRUE; break; case CANT_TRADE_LAST_MON: QueueAction(QUEUE_DELAY_MSG, QUEUE_ONLY_MON2); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; + sTradeMenu->callbackId = CB_HANDLE_TRADE_CANCELED; break; case CANT_TRADE_NATIONAL: case CANT_TRADE_INVALID_MON: QueueAction(QUEUE_DELAY_MSG, QUEUE_MON_CANT_BE_TRADED); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; + sTradeMenu->callbackId = CB_HANDLE_TRADE_CANCELED; break; case CANT_TRADE_EGG_YET: - case CANT_TRADE_EGG_YET2: + case CANT_TRADE_PARTNER_EGG_YET: QueueAction(QUEUE_DELAY_MSG, QUEUE_EGG_CANT_BE_TRADED); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; + sTradeMenu->callbackId = CB_HANDLE_TRADE_CANCELED; break; } break; } } -static void ChooseMonAfterButtonPress(void) +static void CB_ChooseMonAfterButtonPress(void) { - if ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON))) + if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - TradeMenuChooseMon(); + RedrawChooseAPokemonWindow(); } } -static void TradeMenuShowMonSummaryScreen(void) +static void CB_ShowTradeMonSummaryScreen(void) { if (!gPaletteFade.active) { - // Player's party - if (sTradeMenuData->cursorPosition < PARTY_SIZE) - ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, gPlayerParty, sTradeMenuData->cursorPosition, sTradeMenuData->partyCounts[TRADE_PLAYER] - 1, CB2_ReturnToTradeMenu); - // Partner's party + if (sTradeMenu->cursorPosition < PARTY_SIZE) + ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, gPlayerParty, sTradeMenu->cursorPosition, sTradeMenu->partyCounts[TRADE_PLAYER] - 1, CB2_ReturnToTradeMenu); else - ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, gEnemyParty, sTradeMenuData->cursorPosition - PARTY_SIZE, sTradeMenuData->partyCounts[TRADE_PARTNER] - 1, CB2_ReturnToTradeMenu); + ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, gEnemyParty, sTradeMenu->cursorPosition - PARTY_SIZE, sTradeMenu->partyCounts[TRADE_PARTNER] - 1, CB2_ReturnToTradeMenu); FreeAllWindowBuffers(); } } @@ -1511,7 +1584,7 @@ static u8 CheckValidityOfTradeMons(u8 *aliveMons, u8 playerPartyCount, u8 player // Partner cant trade Egg or non-Hoenn mon if player doesn't have National Dex if (!IsNationalPokedexEnabled()) { - if (sTradeMenuData->isEgg[TRADE_PARTNER][partnerMonIdx] || !IsSpeciesInHoennDex(partnerSpecies)) + if (sTradeMenu->isEgg[TRADE_PARTNER][partnerMonIdx] || !IsSpeciesInHoennDex(partnerSpecies)) return PARTNER_MON_INVALID; } @@ -1527,14 +1600,12 @@ static bool32 CheckMonsBeforeTrade(void) int i; u8 aliveMons[PARTY_SIZE * 2]; - for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PLAYER]; i++) - { - aliveMons[i] = sTradeMenuData->isLiveMon[TRADE_PLAYER][i]; - } + for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++) + aliveMons[i] = sTradeMenu->isLiveMon[TRADE_PLAYER][i]; - switch (CheckValidityOfTradeMons(aliveMons, sTradeMenuData->partyCounts[TRADE_PLAYER], - sTradeMenuData->cursorPosition, - sTradeMenuData->partnerCursorPosition)) + switch (CheckValidityOfTradeMons(aliveMons, sTradeMenu->partyCounts[TRADE_PLAYER], + sTradeMenu->cursorPosition, + sTradeMenu->partnerCursorPosition)) { case PLAYER_MON_INVALID: QueueAction(QUEUE_DELAY_MSG, QUEUE_ONLY_MON2); @@ -1552,24 +1623,24 @@ static bool32 CheckMonsBeforeTrade(void) return FALSE; } -static void ConfirmOrCancelTrade(void) +static void CB_ProcessConfirmTradeInput(void) { switch (Menu_ProcessInputNoWrapClearOnChoose()) { - case 0: // Confirm Trade + case 0: // YES, Confirm selection if (!CheckMonsBeforeTrade()) - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_STANDBY; + sTradeMenu->callbackId = CB_IDLE; else - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_PARTNER_MON_INVALID; + sTradeMenu->callbackId = CB_PARTNER_MON_INVALID; PutWindowTilemap(17); break; - case 1: // Cancel Trade + case 1: // NO, Cancel Trade case MENU_B_PRESSED: QueueAction(QUEUE_DELAY_MSG, QUEUE_STANDBY); if (IsLinkTradeTaskFinished()) SetLinkData(LINKCMD_READY_CANCEL_TRADE, 0); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_STANDBY; + sTradeMenu->callbackId = CB_IDLE; PutWindowTilemap(17); break; } @@ -1580,66 +1651,65 @@ static void RestoreNicknamesCoveredByYesNo(void) { int i; - for (i = 0; i < sTradeMenuData->partyCounts[1] - 4; i++) + for (i = 0; i < sTradeMenu->partyCounts[1] - 4; i++) { - PutWindowTilemap(i + 12); - CopyWindowToVram(i + 12, COPYWIN_MAP); + PutWindowTilemap(i + PARTY_SIZE * 2); + CopyWindowToVram(i + PARTY_SIZE * 2, COPYWIN_MAP); } } -static void CancelTradeYesNo(void) +static void CB_ProcessCancelTradeInput(void) { switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: // YES, Cancel - PrintTradeMessage(TRADE_MSG_WAITING_FOR_FRIEND); + PrintTradeMessage(MSG_WAITING_FOR_FRIEND); SetLinkData(LINKCMD_REQUEST_CANCEL, 0); - gSprites[sTradeMenuData->cursorSpriteId].invisible = TRUE; - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_STANDBY; + gSprites[sTradeMenu->cursorSpriteId].invisible = TRUE; + sTradeMenu->callbackId = CB_IDLE; RestoreNicknamesCoveredByYesNo(); break; case 1: // NO, Continue case MENU_B_PRESSED: PlaySE(SE_SELECT); - TradeMenuChooseMon(); + RedrawChooseAPokemonWindow(); break; } } -static void SetBothSelectedMons(void) +static void CB_SetSelectedMons(void) { if (GetMultiplayerId() == 0) { rbox_fill_rectangle(0); - SetSelectedMon(sTradeMenuData->cursorPosition); - SetSelectedMon(sTradeMenuData->partnerCursorPosition); + SetSelectedMon(sTradeMenu->cursorPosition); + SetSelectedMon(sTradeMenu->partnerCursorPosition); } - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CONFIRM_TRADE_PROMPT; + sTradeMenu->callbackId = CB_PRINT_IS_THIS_OKAY; } -static void ConfirmTradePrompt(void) +static void CB_PrintIsThisTradeOkay(void) { - if (sTradeMenuData->drawPartyState[TRADE_PLAYER] == DRAW_PARTY_FINISH - && sTradeMenuData->drawPartyState[TRADE_PARTNER] == DRAW_PARTY_FINISH) + if (sTradeMenu->drawSelectedMonState[TRADE_PLAYER] == DRAW_SELECTED_FINISH + && sTradeMenu->drawSelectedMonState[TRADE_PARTNER] == DRAW_SELECTED_FINISH) { - DrawIsThisTradeOkay(); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_DELAY_TRADE_CONFIRM; + PrintIsThisTradeOkay(); + sTradeMenu->callbackId = CB_INIT_CONFIRM_TRADE_PROMPT; } } -static void DelayTradeConfirmation(void) +static void CB_InitConfirmTradePrompt(void) { - sTradeMenuData->timer++; - - if (sTradeMenuData->timer > 120) + sTradeMenu->timer++; + if (sTradeMenu->timer > 120) { CreateYesNoMenu(&sTradeYesNoWindowTemplate, 1, 14, 0); - sTradeMenuData->timer = 0; - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CONFIRM_OR_CANCEL_TRADE; + sTradeMenu->timer = 0; + sTradeMenu->callbackId = CB_CONFIRM_TRADE_PROMPT; } } -static void RedrawTradeMenuAfterPressA(void) +static void CB_HandleTradeCanceled(void) { int i; @@ -1655,38 +1725,34 @@ static void RedrawTradeMenuAfterPressA(void) rbox_fill_rectangle(i + 14); } - RedrawTradeMenuParty(TRADE_PLAYER); - RedrawTradeMenuParty(TRADE_PARTNER); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_MAIN_MENU; - gSprites[sTradeMenuData->cursorSpriteId].invisible = FALSE; + RedrawPartyWindow(TRADE_PLAYER); + RedrawPartyWindow(TRADE_PARTNER); + sTradeMenu->callbackId = CB_MAIN_MENU; + gSprites[sTradeMenu->cursorSpriteId].invisible = FALSE; } } -static void CancelTrade_1(void) +static void CB_InitExitCanceledTrade(void) { if (!gPaletteFade.active) { if (gWirelessCommType) - { SetLinkStandbyCallback(); - } else - { SetCloseLinkCallbackAndType(12); - } - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CANCEL_TRADE_2; + sTradeMenu->callbackId = CB_EXIT_CANCELED_TRADE; } } -static void CancelTrade_2(void) +static void CB_ExitCanceledTrade(void) { if (gWirelessCommType) { if (IsLinkTradeTaskFinished() && GetNumQueuedActions() == 0) { - Free(sMenuTextAllocBuffer); - Free(sTradeMenuData); + Free(sMenuTextTileBuffer); + Free(sTradeMenu); FreeAllWindowBuffers(); DestroyWirelessStatusIndicatorSprite(); SetMainCallback2(CB2_ReturnToFieldFromMultiplayer); @@ -1696,88 +1762,88 @@ static void CancelTrade_2(void) { if (!gReceivedRemoteLinkPlayers) { - Free(sMenuTextAllocBuffer); - Free(sTradeMenuData); + Free(sMenuTextTileBuffer); + Free(sTradeMenu); FreeAllWindowBuffers(); SetMainCallback2(CB2_ReturnToFieldFromMultiplayer); } } } -static void LinkTradeWaitForQueue(void) +static void CB_WaitToStartRfuTrade(void) { if (!Rfu_SetLinkRecovery(FALSE) && GetNumQueuedActions() == 0) { SetLinkStandbyCallback(); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_START_LINK_TRADE; + sTradeMenu->callbackId = CB_START_LINK_TRADE; } } -static void PartnersMonWasInvalid(void) +static void CB_PartnersMonWasInvalid(void) { if (JOY_NEW(A_BUTTON)) { SetLinkData(LINKCMD_READY_CANCEL_TRADE, 0); - sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_STANDBY; + sTradeMenu->callbackId = CB_IDLE; } } -static void CallTradeMenuFunc(void) +static void RunTradeMenuCallback(void) { - switch (sTradeMenuData->tradeMenuFunc) + switch (sTradeMenu->callbackId) { - case TRADEMENUFUNC_MAIN_MENU: - TradeMenuProcessInput(); + case CB_MAIN_MENU: + CB_ProcessMenuInput(); break; - case TRADEMENUFUNC_SELECTED_MON: - TradeMenuProcessInput_SelectedMon(); + case CB_SELECTED_MON: + CB_ProcessSelectedMonInput(); break; - case TRADEMENUFUNC_SHOW_MON_SUMMARY: - TradeMenuShowMonSummaryScreen(); + case CB_SHOW_MON_SUMMARY: + CB_ShowTradeMonSummaryScreen(); break; - case TRADEMENUFUNC_CONFIRM_OR_CANCEL_TRADE: - ConfirmOrCancelTrade(); + case CB_CONFIRM_TRADE_PROMPT: + CB_ProcessConfirmTradeInput(); break; - case TRADEMENUFUNC_CANCEL_TRADE_PROMPT: - CancelTradeYesNo(); + case CB_CANCEL_TRADE_PROMPT: + CB_ProcessCancelTradeInput(); break; - case TRADEMENUFUNC_BOTH_MONS_SELECTED: - SetBothSelectedMons(); + case CB_SET_SELECTED_MONS: + CB_SetSelectedMons(); break; - case TRADEMENUFUNC_CONFIRM_TRADE_PROMPT: - ConfirmTradePrompt(); + case CB_PRINT_IS_THIS_OKAY: + CB_PrintIsThisTradeOkay(); break; - case TRADEMENUFUNC_REDRAW_MAIN_MENU: - RedrawTradeMenuAfterPressA(); + case CB_HANDLE_TRADE_CANCELED: + CB_HandleTradeCanceled(); break; - case TRADEMENUFUNC_LINK_TRADE_FADE_OUT: - LinkTradeFadeOut(); + case CB_FADE_TO_START_TRADE: + CB_FadeToStartTrade(); break; - case TRADEMENUFUNC_LINK_TRADE_WAIT_FADE: - LinkTradeWaitForFade(); + case CB_WAIT_TO_START_TRADE: + CB_WaitToStartTrade(); break; - case TRADEMENUFUNC_CANCEL_TRADE_1: - CancelTrade_1(); + case CB_INIT_EXIT_CANCELED_TRADE: + CB_InitExitCanceledTrade(); break; - case TRADEMENUFUNC_CANCEL_TRADE_2: - CancelTrade_2(); + case CB_EXIT_CANCELED_TRADE: + CB_ExitCanceledTrade(); break; - case TRADEMENUFUNC_START_LINK_TRADE: - SetLinkTradeCallbacks(); + case CB_START_LINK_TRADE: + CB_StartLinkTrade(); break; - case TRADEMENUFUNC_DELAY_TRADE_CONFIRM: - DelayTradeConfirmation(); + case CB_INIT_CONFIRM_TRADE_PROMPT: + CB_InitConfirmTradePrompt(); break; - case TRADEMENUFUNC_UNUSED_15: - ChooseMonAfterButtonPress(); + case CB_UNUSED_CLOSE_MSG: + CB_ChooseMonAfterButtonPress(); break; - case TRADEMENUFUNC_LINK_TRADE_WAIT_QUEUE: - LinkTradeWaitForQueue(); + case CB_WAIT_TO_START_RFU_TRADE: + CB_WaitToStartRfuTrade(); break; - case TRADEMENUFUNC_PARTNER_MON_INVALID: - PartnersMonWasInvalid(); + case CB_PARTNER_MON_INVALID: + CB_PartnersMonWasInvalid(); break; - //case TRADEMENUFUNC_STANDBY: is nop + //case CB_IDLE: is nop } } @@ -1786,14 +1852,16 @@ static void SetSelectedMon(u8 cursorPosition) //cursorPosition 0-5 are the player's mons, 6-11 are the partner's u8 whichParty = cursorPosition / PARTY_SIZE; - if (sTradeMenuData->drawPartyState[whichParty] == 0) + if (sTradeMenu->drawSelectedMonState[whichParty] == 0) { - sTradeMenuData->drawPartyState[whichParty] = 1; - sTradeMenuData->selectedMonIdx[whichParty] = cursorPosition; + // Start the animation to display just the selected + // pokemon in the middle of the screen + sTradeMenu->drawSelectedMonState[whichParty] = 1; + sTradeMenu->selectedMonIdx[whichParty] = cursorPosition; } } -static void DrawTradeMenuParty(u8 whichParty) +static void DrawSelectedMonScreen(u8 whichParty) { s8 nameStringWidth; u8 nickname[20]; @@ -1801,105 +1869,111 @@ static void DrawTradeMenuParty(u8 whichParty) u8 i; u8 partyIdx; u8 selectedMonParty; - u8 selectedMonIdx = sTradeMenuData->selectedMonIdx[whichParty]; + u8 selectedMonIdx = sTradeMenu->selectedMonIdx[whichParty]; selectedMonParty = TRADE_PARTNER; - if (sTradeMenuData->selectedMonIdx[whichParty] < PARTY_SIZE) + if (sTradeMenu->selectedMonIdx[whichParty] < PARTY_SIZE) selectedMonParty = TRADE_PLAYER; partyIdx = selectedMonIdx % PARTY_SIZE; nameStringWidth = 0; - switch (sTradeMenuData->drawPartyState[whichParty]) + switch (sTradeMenu->drawSelectedMonState[whichParty]) { + default: + // Idle while state is 0, and once it reaches the final state (DRAW_SELECTED_FINISH) + break; case 1: - for (i = 0; i < sTradeMenuData->partyCounts[whichParty]; i++) - { - gSprites[sTradeMenuData->partySpriteIds[0][i + (selectedMonParty * PARTY_SIZE)]].invisible = TRUE; - } - - for (i = 0; i < 6; i++) - { + // Erase the rest of the party + for (i = 0; i < sTradeMenu->partyCounts[whichParty]; i++) + gSprites[sTradeMenu->partySpriteIds[selectedMonParty][i]].invisible = TRUE; + for (i = 0; i < PARTY_SIZE; i++) ClearWindowTilemap(i + (whichParty * PARTY_SIZE + 2)); - } - gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]].invisible = FALSE; - gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]].data[0] = 20; - gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]].data[2] = (sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE][0] - + sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE + 1][0]) / 2 * 8 + 14; - gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]].data[4] = (sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE][1] * 8) - 12; - StoreSpriteCallbackInData6(&gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]], SpriteCB_MonIcon); - sTradeMenuData->drawPartyState[whichParty]++; - TradeMenuBouncePartySprites(&gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]]); + // Re-display the selected pokemon + gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].invisible = FALSE; + + // Move the selected pokemon to the center + gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].data[0] = 20; + gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].data[2] = (sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE][0] + + sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE + 1][0]) / 2 * 8 + 14; + gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].data[4] = (sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE][1] * 8) - 12; + StoreSpriteCallbackInData6(&gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]], SpriteCB_MonIcon); + sTradeMenu->drawSelectedMonState[whichParty]++; + Trade_MoveSelectedMonToTarget(&gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]]); + CopyToBgTilemapBufferRect_ChangePalette(1, sTradePartyBoxTilemap, whichParty * 15, 0, 15, 17, 0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(0); if (selectedMonParty == TRADE_PLAYER) - PrintNicknamesForTradeMenu(); + PrintTradePartnerPartyNicknames(); break; case 2: - if (gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]].callback == SpriteCB_MonIcon) - sTradeMenuData->drawPartyState[whichParty] = 3; + // Wait for the selected pokemon's sprite to move to the correct position + if (gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].callback == SpriteCB_MonIcon) + sTradeMenu->drawSelectedMonState[whichParty] = 3; break; case 3: + // Redisplay the bg box CopyToBgTilemapBufferRect_ChangePalette(1, sTradeMovesBoxTilemap, selectedMonParty * 15, 0, 15, 17, 0); CopyBgTilemapBufferToVram(1); - gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]].x = (sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE][0] - + sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE + 1][0]) / 2 * 8 + 14; - gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]].y = (sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE][1] * 8) - 12; - gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]].x2 = 0; - gSprites[sTradeMenuData->partySpriteIds[0][partyIdx + (selectedMonParty * PARTY_SIZE)]].y2 = 0; + + // Finalize the selected pokemon's position + gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].x = (sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE][0] + + sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE + 1][0]) / 2 * 8 + 14; + gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].y = (sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE][1] * 8) - 12; + gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].x2 = 0; + gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].y2 = 0; + + // Print selected pokemon's name and moves nameStringWidth = GetMonNicknameWidth(nickname, selectedMonParty, partyIdx); AddTextPrinterParameterized3((whichParty * 2) + 14, FONT_SMALL, (80 - nameStringWidth) / 2, 4, sTradeTextColors, 0, nickname); - BufferTradeMonMoves(movesString, selectedMonParty, partyIdx); + BufferMovesString(movesString, selectedMonParty, partyIdx); AddTextPrinterParameterized4((whichParty * 2) + 15, FONT_NORMAL, 0, 0, 0, 0, sTradeTextColors, 0, movesString); PutWindowTilemap((whichParty * 2) + 14); CopyWindowToVram((whichParty * 2) + 14, COPYWIN_FULL); PutWindowTilemap((whichParty * 2) + 15); CopyWindowToVram((whichParty * 2) + 15, COPYWIN_FULL); - sTradeMenuData->drawPartyState[whichParty]++; + + sTradeMenu->drawSelectedMonState[whichParty]++; break; case 4: - DrawTradeMenuPartyMonInfo(whichParty, partyIdx, - sTradeMenuPartyMonBoxDimensions[whichParty][0] + 4, - sTradeMenuPartyMonBoxDimensions[whichParty][1] + 1, - sTradeMenuPartyMonBoxDimensions[whichParty][0], - sTradeMenuPartyMonBoxDimensions[whichParty][1]); - sTradeMenuData->drawPartyState[whichParty]++; + PrintLevelAndGender(whichParty, partyIdx, + sSelectedMonLevelGenderCoords[whichParty][0] + 4, + sSelectedMonLevelGenderCoords[whichParty][1] + 1, + sSelectedMonLevelGenderCoords[whichParty][0], + sSelectedMonLevelGenderCoords[whichParty][1]); + sTradeMenu->drawSelectedMonState[whichParty]++; break; } } -static u8 GetMonNicknameWidth(u8 *str, u8 whichParty, u8 monIdx) +static u8 GetMonNicknameWidth(u8 *str, u8 whichParty, u8 partyIdx) { - u8 nickname[12]; + u8 nickname[POKEMON_NAME_LENGTH]; if (whichParty == TRADE_PLAYER) - GetMonData(&gPlayerParty[monIdx], MON_DATA_NICKNAME, nickname); + GetMonData(&gPlayerParty[partyIdx], MON_DATA_NICKNAME, nickname); else - GetMonData(&gEnemyParty[monIdx], MON_DATA_NICKNAME, nickname); + GetMonData(&gEnemyParty[partyIdx], MON_DATA_NICKNAME, nickname); StringCopy_Nickname(str, nickname); return GetStringWidth(FONT_SMALL, str, GetFontAttribute(FONT_SMALL, FONTATTR_LETTER_SPACING)); } -static void BufferTradeMonMoves(u8 *str, u8 whichParty, u8 partyIdx) +static void BufferMovesString(u8 *str, u8 whichParty, u8 partyIdx) { u16 moves[MAX_MON_MOVES]; u16 i; - if (!sTradeMenuData->isEgg[whichParty][partyIdx]) + if (!sTradeMenu->isEgg[whichParty][partyIdx]) { for (i = 0; i < MAX_MON_MOVES; i++) { if (whichParty == TRADE_PLAYER) - { moves[i] = GetMonData(&gPlayerParty[partyIdx], i + MON_DATA_MOVE1, NULL); - } else - { moves[i] = GetMonData(&gEnemyParty[partyIdx], i + MON_DATA_MOVE1, NULL); - } } StringCopy(str, sText_EmptyString); @@ -1907,9 +1981,7 @@ static void BufferTradeMonMoves(u8 *str, u8 whichParty, u8 partyIdx) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE) - { StringAppend(str, gMoveNames[moves[i]]); - } StringAppend(str, sText_NewLine); } @@ -1921,7 +1993,7 @@ static void BufferTradeMonMoves(u8 *str, u8 whichParty, u8 partyIdx) } } -static void PrintMonNicknameForTradeMenu(u8 whichParty, u8 windowId, u8 *nickname) +static void PrintPartyMonNickname(u8 whichParty, u8 windowId, u8 *nickname) { u8 xPos; windowId += (whichParty * PARTY_SIZE) + 2; @@ -1931,27 +2003,27 @@ static void PrintMonNicknameForTradeMenu(u8 whichParty, u8 windowId, u8 *nicknam CopyWindowToVram(windowId, COPYWIN_FULL); } -static void PrintPartyNicknamesForTradeMenu(u8 whichParty) +static void PrintPartyNicknames(u8 whichParty) { u8 i; u8 nickname[20]; u8 str[32]; struct Pokemon *party = (whichParty == TRADE_PLAYER) ? gPlayerParty : gEnemyParty; - for (i = 0; i < sTradeMenuData->partyCounts[whichParty]; i++) + for (i = 0; i < sTradeMenu->partyCounts[whichParty]; i++) { GetMonData(&party[i], MON_DATA_NICKNAME, nickname); StringCopy_Nickname(str, nickname); - PrintMonNicknameForTradeMenu(whichParty, i, str); + PrintPartyMonNickname(whichParty, i, str); } } -static void DrawTradeMenuPartyMonInfo(u8 whichParty, u8 monIdx, u8 x, u8 y, u8 width, u8 height) +static void PrintLevelAndGender(u8 whichParty, u8 monIdx, u8 x, u8 y, u8 width, u8 height) { u8 level; u32 symbolTile; u8 gender; - u8 nickname[12]; + u8 nickname[POKEMON_NAME_LENGTH]; CopyToBgTilemapBufferRect_ChangePalette(1, gTradeMenuMonBox_Tilemap, width, height, 6, 3, 0); CopyBgTilemapBufferToVram(1); @@ -1961,20 +2033,20 @@ static void DrawTradeMenuPartyMonInfo(u8 whichParty, u8 monIdx, u8 x, u8 y, u8 w else level = GetMonData(&gEnemyParty[monIdx], MON_DATA_LEVEL, NULL); - if (!sTradeMenuData->isEgg[whichParty][monIdx]) + if (!sTradeMenu->isEgg[whichParty][monIdx]) { if (level / 10 != 0) - sTradeMenuData->tilemapBuffer[x + (y * 32)] = (level / 10) + 0x60; + sTradeMenu->tilemapBuffer[x + (y * 32)] = (level / 10) + 0x60; - sTradeMenuData->tilemapBuffer[x + (y * 32) + 1] = (level % 10) + 0x70; + sTradeMenu->tilemapBuffer[x + (y * 32) + 1] = (level % 10) + 0x70; } else { - sTradeMenuData->tilemapBuffer[x + (y * 32) - 32] = sTradeMenuData->tilemapBuffer[x + (y * 32) - 33]; - sTradeMenuData->tilemapBuffer[x + (y * 32) - 31] = sTradeMenuData->tilemapBuffer[x + (y * 32) - 36] | 0x400; + sTradeMenu->tilemapBuffer[x + (y * 32) - 32] = sTradeMenu->tilemapBuffer[x + (y * 32) - 33]; + sTradeMenu->tilemapBuffer[x + (y * 32) - 31] = sTradeMenu->tilemapBuffer[x + (y * 32) - 36] | 0x400; } - if (sTradeMenuData->isEgg[whichParty][monIdx]) + if (sTradeMenu->isEgg[whichParty][monIdx]) { symbolTile = 0x480; } @@ -2004,62 +2076,57 @@ static void DrawTradeMenuPartyMonInfo(u8 whichParty, u8 monIdx, u8 x, u8 y, u8 w break; } } - sTradeMenuData->tilemapBuffer[(y - 1) * 32 + x + 1] = symbolTile; + sTradeMenu->tilemapBuffer[(y - 1) * 32 + x + 1] = symbolTile; } -static void DrawTradeMenuPartyInfo(u8 whichParty) +static void PrintPartyLevelsAndGenders(u8 whichParty) { s32 i; - for (i = 0; i < sTradeMenuData->partyCounts[whichParty]; i++) + for (i = 0; i < sTradeMenu->partyCounts[whichParty]; i++) { - const u8 (*r5)[2]; - const u8 (*r4)[2]; - u32 r0 = 3 * whichParty; - const u8 (*r1)[2][2] = sTradeMonLevelCoords; - - r5 = r1[r0]; - r4 = sTradeMonBoxCoords[r0]; - DrawTradeMenuPartyMonInfo( + s32 j = i + PARTY_SIZE * whichParty; + PrintLevelAndGender( whichParty, i, - r5[i][0], - r5[i][1], - r4[i][0], - r4[i][1] + sTradeMonLevelCoords[j][0], + sTradeMonLevelCoords[j][1], + sTradeMonBoxCoords[j][0], + sTradeMonBoxCoords[j][1] ); } } -static void ResetTradeMenuPartyPositions(u8 whichParty) +static void ShowTradePartyMonIcons(u8 whichParty) { int i; - for (i = 0; i < sTradeMenuData->partyCounts[whichParty]; i++) + for (i = 0; i < sTradeMenu->partyCounts[whichParty]; i++) { - gSprites[sTradeMenuData->partySpriteIds[whichParty][i]].invisible = FALSE; - gSprites[sTradeMenuData->partySpriteIds[whichParty][i]].x = sTradeMonSpriteCoords[(whichParty * PARTY_SIZE) + i][0] * 8 + 14; - gSprites[sTradeMenuData->partySpriteIds[whichParty][i]].y = sTradeMonSpriteCoords[(whichParty * PARTY_SIZE) + i][1] * 8 - 12; - gSprites[sTradeMenuData->partySpriteIds[whichParty][i]].x2 = 0; - gSprites[sTradeMenuData->partySpriteIds[whichParty][i]].y2 = 0; + gSprites[sTradeMenu->partySpriteIds[whichParty][i]].invisible = FALSE; + gSprites[sTradeMenu->partySpriteIds[whichParty][i]].x = sTradeMonSpriteCoords[(whichParty * PARTY_SIZE) + i][0] * 8 + 14; + gSprites[sTradeMenu->partySpriteIds[whichParty][i]].y = sTradeMonSpriteCoords[(whichParty * PARTY_SIZE) + i][1] * 8 - 12; + gSprites[sTradeMenu->partySpriteIds[whichParty][i]].x2 = 0; + gSprites[sTradeMenu->partySpriteIds[whichParty][i]].y2 = 0; } } -static void PrintNicknamesForTradeMenu(void) +static void PrintTradePartnerPartyNicknames(void) { rbox_fill_rectangle(1); - //PrintPartyNicknamesForTradeMenu(TRADE_PLAYER); ? - PrintPartyNicknamesForTradeMenu(TRADE_PARTNER); + //PrintPartyNicknames(TRADE_PLAYER); ? + PrintPartyNicknames(TRADE_PARTNER); } -static void RedrawTradeMenuParty(u8 whichParty) +// Returning to the party selection screen from the "is this trade ok?" screen +static void RedrawPartyWindow(u8 whichParty) { CopyToBgTilemapBufferRect_ChangePalette(1, sTradePartyBoxTilemap, whichParty * 15, 0, 15, 17, 0); CopyBgTilemapBufferToVram(1); - DrawTradeMenuPartyInfo(whichParty); - PrintPartyNicknamesForTradeMenu(whichParty); - ResetTradeMenuPartyPositions(whichParty); - DrawBottomRowText(sTradeActionTexts[TRADE_TEXT_CHOOSE_MON], (void *)(OBJ_VRAM0 + (sTradeMenuData->bottomTextTileStart * 32)), 24); - sTradeMenuData->drawPartyState[whichParty] = 0; + PrintPartyLevelsAndGenders(whichParty); + PrintPartyNicknames(whichParty); + ShowTradePartyMonIcons(whichParty); + DrawBottomRowText(sActionTexts[TEXT_CHOOSE_MON], (void *)(OBJ_VRAM0 + (sTradeMenu->bottomTextTileStart * 32)), 24); + sTradeMenu->drawSelectedMonState[whichParty] = 0; } static void Task_DrawSelectionSummary(u8 taskId) @@ -2078,13 +2145,14 @@ static void QueueAction(u16 delay, u8 actionId) { int i; - for (i = 0; i < (int)ARRAY_COUNT(sTradeMenuData->queuedActions); i++) + for (i = 0; i < (int)ARRAY_COUNT(sTradeMenu->queuedActions); i++) { - if (!sTradeMenuData->queuedActions[i].queued) + // Find first available spot + if (!sTradeMenu->queuedActions[i].active) { - sTradeMenuData->queuedActions[i].queueDelay = delay; - sTradeMenuData->queuedActions[i].actionId = actionId; - sTradeMenuData->queuedActions[i].queued = TRUE; + sTradeMenu->queuedActions[i].delay = delay; + sTradeMenu->queuedActions[i].actionId = actionId; + sTradeMenu->queuedActions[i].active = TRUE; break; } } @@ -2095,9 +2163,9 @@ static u32 GetNumQueuedActions(void) u32 numActions = 0; int i; - for (i = 0; i < (int)ARRAY_COUNT(sTradeMenuData->queuedActions); i++) + for (i = 0; i < (int)ARRAY_COUNT(sTradeMenu->queuedActions); i++) { - numActions += sTradeMenuData->queuedActions[i].queued; + numActions += sTradeMenu->queuedActions[i].active; } return numActions; @@ -2107,43 +2175,43 @@ static void DoQueuedActions(void) { int i; - for (i = 0; i < (int)ARRAY_COUNT(sTradeMenuData->queuedActions); i++) + for (i = 0; i < (int)ARRAY_COUNT(sTradeMenu->queuedActions); i++) { - if (sTradeMenuData->queuedActions[i].queued) + if (sTradeMenu->queuedActions[i].active) { - if (sTradeMenuData->queuedActions[i].queueDelay) + if (sTradeMenu->queuedActions[i].delay != 0) { - sTradeMenuData->queuedActions[i].queueDelay--; + sTradeMenu->queuedActions[i].delay--; } else { - switch (sTradeMenuData->queuedActions[i].actionId) + switch (sTradeMenu->queuedActions[i].actionId) { case QUEUE_SEND_DATA: - SendLinkData(sTradeMenuData->linkData, 20); + SendLinkData(sTradeMenu->linkData, 20); break; case QUEUE_STANDBY: - PrintTradeMessage(TRADE_MSG_STANDBY); + PrintTradeMessage(MSG_STANDBY); break; case QUEUE_ONLY_MON1: - PrintTradeMessage(TRADE_MSG_ONLY_MON1); + PrintTradeMessage(MSG_ONLY_MON1); break; case QUEUE_ONLY_MON2: case QUEUE_UNUSED1: case QUEUE_UNUSED2: - PrintTradeMessage(TRADE_MSG_ONLY_MON2); + PrintTradeMessage(MSG_ONLY_MON2); break; case QUEUE_MON_CANT_BE_TRADED: - PrintTradeMessage(TRADE_MSG_MON_CANT_BE_TRADED); + PrintTradeMessage(MSG_MON_CANT_BE_TRADED); break; case QUEUE_EGG_CANT_BE_TRADED: - PrintTradeMessage(TRADE_MSG_EGG_CANT_BE_TRADED); + PrintTradeMessage(MSG_EGG_CANT_BE_TRADED); break; case QUEUE_FRIENDS_MON_CANT_BE_TRADED: - PrintTradeMessage(TRADE_MSG_FRIENDS_MON_CANT_BE_TRADED); + PrintTradeMessage(MSG_FRIENDS_MON_CANT_BE_TRADED); break; } - sTradeMenuData->queuedActions[i].queued = FALSE; + sTradeMenu->queuedActions[i].active = FALSE; } } } @@ -2152,24 +2220,24 @@ static void DoQueuedActions(void) static void PrintTradeMessage(u8 messageId) { FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized(0, FONT_NORMAL, sTradeMessages[messageId], 0, 1, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(0, FONT_NORMAL, sMessages[messageId], 0, 1, TEXT_SKIP_DRAW, NULL); DrawTextBorderOuter(0, 20, 12); PutWindowTilemap(0); CopyWindowToVram(0, COPYWIN_FULL); } -static bool8 LoadTradeMenuSpriteSheetsAndPalettes(void) +static bool8 LoadUISpriteGfx(void) { struct SpriteSheet sheet; - if (sTradeMenuData->timer < GFXTAG_MENU_TEXT_COUNT) + if (sTradeMenu->timer < NUM_MENU_TEXT_SPRITES) { - sheet.data = sMenuTextTileBuffers[sTradeMenuData->timer]; + sheet.data = sMenuTextTileBuffers[sTradeMenu->timer]; sheet.size = 0x100; - sheet.tag = GFXTAG_MENU_TEXT + sTradeMenuData->timer; + sheet.tag = GFXTAG_MENU_TEXT + sTradeMenu->timer; } - switch (sTradeMenuData->timer) + switch (sTradeMenu->timer) { case GFXTAG_PLAYER_NAME_L: case GFXTAG_PLAYER_NAME_M: @@ -2180,11 +2248,11 @@ static bool8 LoadTradeMenuSpriteSheetsAndPalettes(void) case GFXTAG_CANCEL_L: case GFXTAG_CANCEL_R: LoadSpriteSheet(&sheet); - sTradeMenuData->timer++; + sTradeMenu->timer++; break; case GFXTAG_CHOOSE_PKMN_L: - sTradeMenuData->bottomTextTileStart = LoadSpriteSheet(&sheet); - sTradeMenuData->timer++; + sTradeMenu->bottomTextTileStart = LoadSpriteSheet(&sheet); + sTradeMenu->timer++; break; case GFXTAG_CHOOSE_PKMN_M: case GFXTAG_CHOOSE_PKMN_R: @@ -2192,22 +2260,22 @@ static bool8 LoadTradeMenuSpriteSheetsAndPalettes(void) case GFXTAG_CHOOSE_PKMN_EMPTY_2: case GFXTAG_CHOOSE_PKMN_EMPTY_3: LoadSpriteSheet(&sheet); - sTradeMenuData->timer++; + sTradeMenu->timer++; break; - case GFXTAG_MENU_TEXT_COUNT: - LoadSpritePalette(&sSpritePalette_TradeScreenText); - sTradeMenuData->timer++; + case NUM_MENU_TEXT_SPRITES: + LoadSpritePalette(&sSpritePalette_MenuText); + sTradeMenu->timer++; break; - case GFXTAG_MENU_TEXT_COUNT + 1: + case NUM_MENU_TEXT_SPRITES + 1: LoadSpritePalette(&sCursor_SpritePalette); - sTradeMenuData->timer++; + sTradeMenu->timer++; break; - case GFXTAG_MENU_TEXT_COUNT + 2: + case NUM_MENU_TEXT_SPRITES + 2: LoadSpriteSheet(&sCursor_SpriteSheet); - sTradeMenuData->timer++; + sTradeMenu->timer++; break; - case GFXTAG_MENU_TEXT_COUNT + 3: - sTradeMenuData->timer = 0; + case NUM_MENU_TEXT_SPRITES + 3: + sTradeMenu->timer = 0; return TRUE; } @@ -2219,75 +2287,75 @@ static void DrawBottomRowText(const u8 *str, u8 *dest, u8 unused) DrawTextWindowAndBufferTiles(str, dest, 0, 0, 6); } -static void SetTradePartyLiveStatuses(u8 whichParty) +static void ComputePartyTradeableFlags(u8 whichParty) { int i; switch (whichParty) { case TRADE_PLAYER: - for (i = 0; i < sTradeMenuData->partyCounts[whichParty]; i++) + for (i = 0; i < sTradeMenu->partyCounts[whichParty]; i++) { if (GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG) == TRUE) { - sTradeMenuData->isLiveMon[whichParty][i] = FALSE; - sTradeMenuData->isEgg[whichParty][i] = TRUE; + sTradeMenu->isLiveMon[whichParty][i] = FALSE; + sTradeMenu->isEgg[whichParty][i] = TRUE; } else if (GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0) { - sTradeMenuData->isLiveMon[whichParty][i] = FALSE; - sTradeMenuData->isEgg[whichParty][i] = FALSE; + sTradeMenu->isLiveMon[whichParty][i] = FALSE; + sTradeMenu->isEgg[whichParty][i] = FALSE; } else { - sTradeMenuData->isLiveMon[whichParty][i] = TRUE; - sTradeMenuData->isEgg[whichParty][i] = FALSE; + sTradeMenu->isLiveMon[whichParty][i] = TRUE; + sTradeMenu->isEgg[whichParty][i] = FALSE; } } break; case TRADE_PARTNER: - for (i = 0; i < sTradeMenuData->partyCounts[whichParty]; i++) + for (i = 0; i < sTradeMenu->partyCounts[whichParty]; i++) { if (GetMonData(&gEnemyParty[i], MON_DATA_IS_EGG) == TRUE) { - sTradeMenuData->isLiveMon[whichParty][i] = FALSE; - sTradeMenuData->isEgg[whichParty][i] = TRUE; + sTradeMenu->isLiveMon[whichParty][i] = FALSE; + sTradeMenu->isEgg[whichParty][i] = TRUE; } else if (GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0) { - sTradeMenuData->isLiveMon[whichParty][i] = FALSE; - sTradeMenuData->isEgg[whichParty][i] = FALSE; + sTradeMenu->isLiveMon[whichParty][i] = FALSE; + sTradeMenu->isEgg[whichParty][i] = FALSE; } else { - sTradeMenuData->isLiveMon[whichParty][i] = TRUE; - sTradeMenuData->isEgg[whichParty][i] = FALSE; + sTradeMenu->isLiveMon[whichParty][i] = TRUE; + sTradeMenu->isEgg[whichParty][i] = FALSE; } } break; } } -static void GetTradePartyHPBarLevels(u8 who) +static void ComputePartyHPBarLevels(u8 whichParty) { u16 i, curHp, maxHp; - switch (who) + switch (whichParty) { case TRADE_PLAYER: - for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PLAYER]; i++) + for (i = 0; i < sTradeMenu->partyCounts[TRADE_PLAYER]; i++) { curHp = GetMonData(&gPlayerParty[i], MON_DATA_HP); maxHp = GetMonData(&gPlayerParty[i], MON_DATA_MAX_HP); - sTradeMenuData->hpBarLevels[TRADE_PLAYER][i] = GetHPBarLevel(curHp, maxHp); + sTradeMenu->hpBarLevels[TRADE_PLAYER][i] = GetHPBarLevel(curHp, maxHp); } break; case TRADE_PARTNER: - for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PARTNER]; i++) + for (i = 0; i < sTradeMenu->partyCounts[TRADE_PARTNER]; i++) { curHp = GetMonData(&gEnemyParty[i], MON_DATA_HP); maxHp = GetMonData(&gEnemyParty[i], MON_DATA_MAX_HP); - sTradeMenuData->hpBarLevels[TRADE_PARTNER][i] = GetHPBarLevel(curHp, maxHp); + sTradeMenu->hpBarLevels[TRADE_PARTNER][i] = GetHPBarLevel(curHp, maxHp); } break; } @@ -2299,10 +2367,8 @@ static void SetTradePartyHPBarSprites(void) for (i = 0; i < 2; i++) { - for (j = 0; j < sTradeMenuData->partyCounts[i]; j++) - { - SetPartyHPBarSprite(&gSprites[sTradeMenuData->partySpriteIds[i][j]], 4 - sTradeMenuData->hpBarLevels[i][j]); - } + for (j = 0; j < sTradeMenu->partyCounts[i]; j++) + SetPartyHPBarSprite(&gSprites[sTradeMenu->partySpriteIds[i][j]], 4 - sTradeMenu->hpBarLevels[i][j]); } } @@ -2310,12 +2376,12 @@ static void SaveTradeGiftRibbons(void) { int i; - for (i = 0; i < (int)ARRAY_COUNT(sTradeMenuData->giftRibbons); i++) + for (i = 0; i < (int)ARRAY_COUNT(sTradeMenu->giftRibbons); i++) { - if (gSaveBlock1Ptr->giftRibbons[i] == 0 && sTradeMenuData->giftRibbons[i] != 0) + if (gSaveBlock1Ptr->giftRibbons[i] == 0 && sTradeMenu->giftRibbons[i] != 0) { - if (sTradeMenuData->giftRibbons[i] < 64) - gSaveBlock1Ptr->giftRibbons[i] = sTradeMenuData->giftRibbons[i]; + if (sTradeMenu->giftRibbons[i] < 64) + gSaveBlock1Ptr->giftRibbons[i] = sTradeMenu->giftRibbons[i]; } } } @@ -2323,7 +2389,7 @@ static void SaveTradeGiftRibbons(void) static u32 CanTradeSelectedMon(struct Pokemon *playerParty, int partyCount, int monIdx) { int i, numMonsLeft; - struct LinkPlayer *player; + struct LinkPlayer *partner; u32 species[PARTY_SIZE]; u32 species2[PARTY_SIZE]; @@ -2343,15 +2409,15 @@ static u32 CanTradeSelectedMon(struct Pokemon *playerParty, int partyCount, int return CANT_TRADE_NATIONAL; } - player = &gLinkPlayers[GetMultiplayerId() ^ 1]; - if ((player->version & 0xFF) != VERSION_RUBY && - (player->version & 0xFF) != VERSION_SAPPHIRE) + partner = &gLinkPlayers[GetMultiplayerId() ^ 1]; + if ((partner->version & 0xFF) != VERSION_RUBY && + (partner->version & 0xFF) != VERSION_SAPPHIRE) { // Does partner not have National Dex - if (!(player->progressFlagsCopy & 0xF)) + if (!(partner->progressFlagsCopy & 0xF)) { if (species2[monIdx] == SPECIES_EGG) - return CANT_TRADE_EGG_YET2; + return CANT_TRADE_PARTNER_EGG_YET; if (!IsSpeciesInHoennDex(species2[monIdx])) return CANT_TRADE_INVALID_MON; @@ -2390,30 +2456,30 @@ static u32 CanTradeSelectedMon(struct Pokemon *playerParty, int partyCount, int s32 GetGameProgressForLinkTrade(void) { - // isGameFrLg could have been a bool but they use 2 and > 0 instead - // possible other checks (for other game versions?) were planned/removed - s32 isGameFrLg; + // The usage of this value is a little unusual given it's treated as a bool, + // but it's the result of its usage in FRLG, where 0 is FRLG, 1 is RS, and 2 is Emerald. + s32 versionId; // 0: RSE, 2: FRLG u16 version; if (gReceivedRemoteLinkPlayers) { - isGameFrLg = 0; + versionId = 0; version = (gLinkPlayers[GetMultiplayerId() ^ 1].version & 0xFF); if (version == VERSION_RUBY || version == VERSION_SAPPHIRE || version == VERSION_EMERALD) - isGameFrLg = 0; + versionId = 0; else if (version == VERSION_FIRE_RED || version == VERSION_LEAF_GREEN) - isGameFrLg = 2; + versionId = 2; - // If trading with FRLG, both players must be champion - if (isGameFrLg > 0) + // If trading with FRLG, both players must have progessed the story enough + if (versionId > 0) { // Is player champion if (gLinkPlayers[GetMultiplayerId()].progressFlagsCopy & 0xF0) { - if (isGameFrLg == 2) //unnecessary check, isGameFrLg always 2 here + if (versionId == 2) // Check is only relevant in FRLG, this will always be true { - // Is partner champion + // Has FRLG partner finished the Sevii Islands if (gLinkPlayers[GetMultiplayerId() ^ 1].progressFlagsCopy & 0xF0) return TRADE_BOTH_PLAYERS_READY; else @@ -2442,17 +2508,18 @@ static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal) int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal) { bool8 playerHasNationalDex = player.hasNationalDex; - bool8 playerIsChampion = player.isChampion; + bool8 playerCanLinkNationally = player.canLinkNationally; bool8 partnerHasNationalDex = partner.hasNationalDex; - bool8 partnerIsChampion = partner.isChampion; + bool8 partnerCanLinkNationally = partner.canLinkNationally; u8 partnerVersion = partner.version; - // If partner is not using Emerald, both players must be champion + // If partner is not using Emerald, both players must have progressed the story + // to a certain point (becoming champion in RSE, finishing the Sevii islands in FRLG) if (partnerVersion != VERSION_EMERALD) { - if (!playerIsChampion) + if (!playerCanLinkNationally) return UR_TRADE_MSG_CANT_TRADE_WITH_PARTNER_1; - else if (!partnerIsChampion) + else if (!partnerCanLinkNationally) return UR_TRADE_MSG_CANT_TRADE_WITH_PARTNER_2; } @@ -2610,6 +2677,7 @@ static void SpriteCB_LinkMonGlowWireless(struct Sprite *sprite) } } +// Palette flash for trade glow core static void SpriteCB_LinkMonShadow(struct Sprite *sprite) { if (!sprite->data[1]) @@ -2654,7 +2722,7 @@ static void SetTradeBGAffine(void) { struct BgAffineDstData affine; - DoBgAffineSet(&affine, sTradeData->texX * 0x100, sTradeData->texY * 0x100, sTradeData->scrX, sTradeData->scrY, sTradeData->sXY, sTradeData->sXY, sTradeData->alpha); + DoBgAffineSet(&affine, sTradeAnim->texX * 0x100, sTradeAnim->texY * 0x100, sTradeAnim->scrX, sTradeAnim->scrY, sTradeAnim->sXY, sTradeAnim->sXY, sTradeAnim->alpha); SetGpuReg(REG_OFFSET_BG2PA, affine.pa); SetGpuReg(REG_OFFSET_BG2PB, affine.pb); SetGpuReg(REG_OFFSET_BG2PC, affine.pc); @@ -2669,14 +2737,14 @@ static void SetTradeGpuRegs(void) { u16 dispcnt; - SetGpuReg(REG_OFFSET_BG1VOFS, sTradeData->bg1vofs); - SetGpuReg(REG_OFFSET_BG1HOFS, sTradeData->bg1hofs); + SetGpuReg(REG_OFFSET_BG1VOFS, sTradeAnim->bg1vofs); + SetGpuReg(REG_OFFSET_BG1HOFS, sTradeAnim->bg1hofs); dispcnt = GetGpuReg(REG_OFFSET_DISPCNT); if ((dispcnt & 7) == DISPCNT_MODE_0) { - SetGpuReg(REG_OFFSET_BG2VOFS, sTradeData->bg2vofs); - SetGpuReg(REG_OFFSET_BG2HOFS, sTradeData->bg2hofs); + SetGpuReg(REG_OFFSET_BG2VOFS, sTradeAnim->bg2vofs); + SetGpuReg(REG_OFFSET_BG2HOFS, sTradeAnim->bg2hofs); } else { @@ -2684,7 +2752,7 @@ static void SetTradeGpuRegs(void) } } -static void VBlankCB_Trade(void) +static void VBlankCB_TradeAnim(void) { SetTradeGpuRegs(); LoadOam(); @@ -2692,30 +2760,30 @@ static void VBlankCB_Trade(void) TransferPlttBuffer(); } -static void ClearLinkTimeoutCounter(void) +static void ClearLinkTimeoutTimer(void) { - sTradeData->linkTimeoutCounter = 0; - sTradeData->linkTimeoutZero1 = 0; - sTradeData->linkTimeoutZero2 = 0; + sTradeAnim->linkTimeoutTimer = 0; + sTradeAnim->linkTimeoutZero1 = 0; + sTradeAnim->linkTimeoutZero2 = 0; } static void CheckForLinkTimeout(void) { - if (sTradeData->linkTimeoutZero1 == sTradeData->linkTimeoutZero2) - sTradeData->linkTimeoutCounter++; + if (sTradeAnim->linkTimeoutZero1 == sTradeAnim->linkTimeoutZero2) + sTradeAnim->linkTimeoutTimer++; else - sTradeData->linkTimeoutCounter = 0; + sTradeAnim->linkTimeoutTimer = 0; - if (sTradeData->linkTimeoutCounter > LINK_TRADE_TIMEOUT) + if (sTradeAnim->linkTimeoutTimer > 300) { CloseLink(); SetMainCallback2(CB2_LinkError); - sTradeData->linkTimeoutCounter = 0; - sTradeData->linkTimeoutZero2 = 0; - sTradeData->linkTimeoutZero1 = 0; + sTradeAnim->linkTimeoutTimer = 0; + sTradeAnim->linkTimeoutZero2 = 0; + sTradeAnim->linkTimeoutZero1 = 0; } - sTradeData->linkTimeoutZero2 = sTradeData->linkTimeoutZero1; + sTradeAnim->linkTimeoutZero2 = sTradeAnim->linkTimeoutZero1; } static u32 TradeGetMultiplayerId(void) @@ -2753,14 +2821,14 @@ static void LoadTradeMonPic(u8 whichParty, u8 state) HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[whichParty * 2 + B_POSITION_OPPONENT_LEFT], species, personality); LoadCompressedSpritePalette(GetMonSpritePalStruct(mon)); - sTradeData->monSpecies[whichParty] = species; - sTradeData->monPersonalities[whichParty] = personality; + sTradeAnim->monSpecies[whichParty] = species; + sTradeAnim->monPersonalities[whichParty] = personality; break; case 1: SetMultiuseSpriteTemplateToPokemon(GetMonSpritePalStruct(mon)->tag, pos); - sTradeData->monSpriteIds[whichParty] = CreateSprite(&gMultiuseSpriteTemplate, 120, 60, 6); - gSprites[sTradeData->monSpriteIds[whichParty]].invisible = TRUE; - gSprites[sTradeData->monSpriteIds[whichParty]].callback = SpriteCallbackDummy; + sTradeAnim->monSpriteIds[whichParty] = CreateSprite(&gMultiuseSpriteTemplate, 120, 60, 6); + gSprites[sTradeAnim->monSpriteIds[whichParty]].invisible = TRUE; + gSprites[sTradeAnim->monSpriteIds[whichParty]].callback = SpriteCallbackDummy; break; } } @@ -2775,34 +2843,34 @@ void CB2_LinkTrade(void) gLinkType = LINKTYPE_TRADE_DISCONNECTED; CloseLink(); } - sTradeData = AllocZeroed(sizeof(*sTradeData)); + sTradeAnim = AllocZeroed(sizeof(*sTradeAnim)); AllocateMonSpritesGfx(); ResetTasks(); ResetSpriteData(); FreeAllSpritePalettes(); - SetVBlankCallback(VBlankCB_Trade); - InitTradeBgInternal(); - ClearLinkTimeoutCounter(); + SetVBlankCallback(VBlankCB_TradeAnim); + TradeAnimInit_LoadGfx(); + ClearLinkTimeoutTimer(); gMain.state++; - sTradeData->neverRead_8C = 0; - sTradeData->state = 0; - sTradeData->isLinkTrade = TRUE; - sTradeData->texX = 64; - sTradeData->texY = 64; - sTradeData->neverRead_D8 = 0; - sTradeData->neverRead_DA = 0; - sTradeData->scrX = 120; - sTradeData->scrY = 80; - sTradeData->sXY = 256; - sTradeData->alpha = 0; + sTradeAnim->neverRead_8C = 0; + sTradeAnim->state = 0; + sTradeAnim->isLinkTrade = TRUE; + sTradeAnim->texX = 64; + sTradeAnim->texY = 64; + sTradeAnim->neverRead_D8 = 0; + sTradeAnim->neverRead_DA = 0; + sTradeAnim->scrX = DISPLAY_WIDTH / 2; + sTradeAnim->scrY = DISPLAY_HEIGHT / 2; + sTradeAnim->sXY = 256; + sTradeAnim->alpha = 0; break; case 1: if (!gReceivedRemoteLinkPlayers) { - sTradeData->isCableTrade = TRUE; + sTradeAnim->isCableTrade = TRUE; OpenLink(); gMain.state++; - sTradeData->timer = 0; + sTradeAnim->timer = 0; } else { @@ -2810,9 +2878,9 @@ void CB2_LinkTrade(void) } break; case 2: - if (++sTradeData->timer > 60) + if (++sTradeAnim->timer > 60) { - sTradeData->timer = 0; + sTradeAnim->timer = 0; gMain.state++; } break; @@ -2821,7 +2889,7 @@ void CB2_LinkTrade(void) { if (GetLinkPlayerCount_2() >= GetSavedPlayerCount()) { - if (++sTradeData->timer > 30) + if (++sTradeAnim->timer > 30) { CheckShouldAdvanceLinkState(); gMain.state++; @@ -2843,9 +2911,9 @@ void CB2_LinkTrade(void) gMain.state++; break; case 5: - sTradeData->playerLinkFlagFinishTrade = 0; - sTradeData->partnerLinkFlagFinishTrade = 0; - sTradeData->sendTradeFinishState = 0; + sTradeAnim->playerFinishStatus = 0; + sTradeAnim->partnerFinishStatus = 0; + sTradeAnim->scheduleLinkTransfer = 0; LoadTradeMonPic(TRADE_PLAYER, 0); gMain.state++; break; @@ -2910,7 +2978,7 @@ void LinkTradeDrawWindow(void) CopyWindowToVram(0, COPYWIN_FULL); } -static void InitTradeBgInternal(void) +static void TradeAnimInit_LoadGfx(void) { SetGpuReg(REG_OFFSET_DISPCNT, 0); ResetBgsAndClearDma3BusyFlags(0); @@ -2921,18 +2989,20 @@ static void InitTradeBgInternal(void) SetBgTilemapBuffer(1, Alloc(BG_SCREEN_SIZE)); SetBgTilemapBuffer(3, Alloc(BG_SCREEN_SIZE)); DeactivateAllTextPrinters(); + // Doing the graphics load... DecompressAndLoadBgGfxUsingHeap(0, gBattleTextboxTiles, 0, 0, 0); LZDecompressWram(gBattleTextboxTilemap, gDecompressionBuffer); - CopyToBgTilemapBuffer(0, gDecompressionBuffer, 0x800, 0); + CopyToBgTilemapBuffer(0, gDecompressionBuffer, BG_SCREEN_SIZE, 0); LoadCompressedPalette(gBattleTextboxPalette, BG_PLTT_ID(0), PLTT_SIZE_4BPP); InitWindows(sTradeSequenceWindowTemplates); + // ... and doing the same load again DecompressAndLoadBgGfxUsingHeap(0, gBattleTextboxTiles, 0, 0, 0); LZDecompressWram(gBattleTextboxTilemap, gDecompressionBuffer); - CopyToBgTilemapBuffer(0, gDecompressionBuffer, 0x800, 0); + CopyToBgTilemapBuffer(0, gDecompressionBuffer, BG_SCREEN_SIZE, 0); LoadCompressedPalette(gBattleTextboxPalette, BG_PLTT_ID(0), PLTT_SIZE_4BPP); } -static void CB2_InGameTrade(void) +static void CB2_InitInGameTrade(void) { u8 otName[11]; @@ -2946,25 +3016,25 @@ static void CB2_InGameTrade(void) StringCopy(gLinkPlayers[1].name, otName); gLinkPlayers[0].language = GAME_LANGUAGE; gLinkPlayers[1].language = GetMonData(&gEnemyParty[0], MON_DATA_LANGUAGE); - sTradeData = AllocZeroed(sizeof(*sTradeData)); + sTradeAnim = AllocZeroed(sizeof(*sTradeAnim)); AllocateMonSpritesGfx(); ResetTasks(); ResetSpriteData(); FreeAllSpritePalettes(); - SetVBlankCallback(VBlankCB_Trade); - InitTradeBgInternal(); - sTradeData->isLinkTrade = FALSE; - sTradeData->neverRead_8C = 0; - sTradeData->state = 0; - sTradeData->texX = 64; - sTradeData->texY = 64; - sTradeData->neverRead_D8 = 0; - sTradeData->neverRead_DA = 0; - sTradeData->scrX = 120; - sTradeData->scrY = 80; - sTradeData->sXY = 256; - sTradeData->alpha = 0; - sTradeData->timer = 0; + SetVBlankCallback(VBlankCB_TradeAnim); + TradeAnimInit_LoadGfx(); + sTradeAnim->isLinkTrade = FALSE; + sTradeAnim->neverRead_8C = 0; + sTradeAnim->state = 0; + sTradeAnim->texX = 64; + sTradeAnim->texY = 64; + sTradeAnim->neverRead_D8 = 0; + sTradeAnim->neverRead_DA = 0; + sTradeAnim->scrX = DISPLAY_WIDTH / 2; + sTradeAnim->scrY = DISPLAY_HEIGHT / 2; + sTradeAnim->sXY = 256; + sTradeAnim->alpha = 0; + sTradeAnim->timer = 0; gMain.state = 5; break; case 5: @@ -3004,7 +3074,7 @@ static void CB2_InGameTrade(void) gMain.state++; break; case 12: - SetMainCallback2(CB2_UpdateInGameTrade); + SetMainCallback2(CB2_InGameTrade); break; } @@ -3048,11 +3118,14 @@ static void TradeMons(u8 playerPartyIdx, u8 partnerPartyIdx) struct Pokemon *partnerMon = &gEnemyParty[partnerPartyIdx]; u16 partnerMail = GetMonData(partnerMon, MON_DATA_MAIL); + // The mail attached to the sent Pokemon no longer exists in your file. if (playerMail != MAIL_NONE) ClearMail(&gSaveBlock1Ptr->mail[playerMail]); - SWAP(*playerMon, *partnerMon, sTradeData->tempMon); + SWAP(*playerMon, *partnerMon, sTradeAnim->tempMon); + // By default, a Pokemon received from a trade will have 70 Friendship. + // Eggs use Friendship to track egg cycles, so don't set this on Eggs. friendship = 70; if (!GetMonData(playerMon, MON_DATA_IS_EGG)) SetMonData(playerMon, MON_DATA_FRIENDSHIP, &friendship); @@ -3065,26 +3138,26 @@ static void TradeMons(u8 playerPartyIdx, u8 partnerPartyIdx) TryEnableNationalDexFromLinkPartner(); } -static void TrySendTradeFinishData(void) +static void HandleLinkDataSend(void) { - switch (sTradeData->sendTradeFinishState) + switch (sTradeAnim->scheduleLinkTransfer) { case 1: if (IsLinkTaskFinished()) { - SendBlock(BitmaskAllOtherLinkPlayers(), sTradeData->linkData, sizeof(sTradeData->linkData)); - sTradeData->sendTradeFinishState++; + SendBlock(BitmaskAllOtherLinkPlayers(), sTradeAnim->linkData, sizeof(sTradeAnim->linkData)); + sTradeAnim->scheduleLinkTransfer++; } // fallthrough case 2: - sTradeData->sendTradeFinishState = 0; + sTradeAnim->scheduleLinkTransfer = 0; break; } } -static void CB2_UpdateInGameTrade(void) +static void CB2_InGameTrade(void) { - AnimateTradeSequence(); + DoTradeAnim(); RunTasks(); RunTextPrinters(); AnimateSprites(); @@ -3097,8 +3170,8 @@ static void SetTradeSequenceBgGpuRegs(u8 state) switch (state) { case 0: - sTradeData->bg2vofs = 0; - sTradeData->bg2hofs = 180; + sTradeAnim->bg2vofs = 0; + sTradeAnim->bg2hofs = 180; SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | @@ -3114,8 +3187,8 @@ static void SetTradeSequenceBgGpuRegs(u8 state) DmaCopy16Defvars(3, gTradePlatform_Tilemap, (void *) BG_SCREEN_ADDR(18), 0x1000); break; case 1: - sTradeData->bg1hofs = 0; - sTradeData->bg1vofs = 348; + sTradeAnim->bg1hofs = 0; + sTradeAnim->bg1vofs = 348; SetGpuReg(REG_OFFSET_BG1VOFS, 348); SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | @@ -3128,13 +3201,13 @@ static void SetTradeSequenceBgGpuRegs(u8 state) BGCNT_SCREENBASE(18) | BGCNT_TXT256x512); - if (sTradeData->isCableTrade) + if (sTradeAnim->isCableTrade) { - DmaCopy16Defvars(3, sGbaCable_Tilemap, (void *) BG_SCREEN_ADDR(5), 0x1000); + DmaCopy16Defvars(3, sGbaMapCable, (void *) BG_SCREEN_ADDR(5), 0x1000); } else { - DmaCopy16Defvars(3, sGbaWireless_Tilemap, (void *) BG_SCREEN_ADDR(5), 0x1000); + DmaCopy16Defvars(3, sGbaMapWireless, (void *) BG_SCREEN_ADDR(5), 0x1000); } DmaCopyLarge16(3, gTradeGba_Gfx, (void *) BG_CHAR_ADDR(0), 0x1420, 0x1000); @@ -3144,15 +3217,15 @@ static void SetTradeSequenceBgGpuRegs(u8 state) DISPCNT_OBJ_ON); break; case 2: - sTradeData->bg1vofs = 0; - sTradeData->bg1hofs = 0; - if (!sTradeData->isCableTrade) + sTradeAnim->bg1vofs = 0; + sTradeAnim->bg1hofs = 0; + if (!sTradeAnim->isCableTrade) { SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_OBJ_ON); - LZ77UnCompVram(sCrossingHighlightWireless_Tilemap, (void *) BG_SCREEN_ADDR(5)); + LZ77UnCompVram(sWirelessCloseup_Map, (void *) BG_SCREEN_ADDR(5)); BlendPalettes(0x8, 16, RGB_BLACK); } else @@ -3161,7 +3234,7 @@ static void SetTradeSequenceBgGpuRegs(u8 state) DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_OBJ_ON); - DmaCopy16Defvars(3, sCrossingHighlightCable_Tilemap, (void *) BG_SCREEN_ADDR(5), 0x800); + DmaCopy16Defvars(3, sCableCloseup_Map, (void *) BG_SCREEN_ADDR(5), 0x800); BlendPalettes(0x1, 16, RGB_BLACK); } break; @@ -3169,7 +3242,7 @@ static void SetTradeSequenceBgGpuRegs(u8 state) LoadPalette(sWirelessSignalNone_Pal, BG_PLTT_ID(3), PLTT_SIZE_4BPP); LZ77UnCompVram(sWirelessSignal_Gfx, (void *) BG_CHAR_ADDR(1)); LZ77UnCompVram(sWirelessSignal_Tilemap, (void *) BG_SCREEN_ADDR(18)); - sTradeData->bg2vofs = 80; + sTradeAnim->bg2vofs = 80; SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | @@ -3186,26 +3259,26 @@ static void SetTradeSequenceBgGpuRegs(u8 state) BGCNT_256COLOR | BGCNT_SCREENBASE(18) | BGCNT_AFF128x128); - sTradeData->texX = 64; - sTradeData->texY = 92; - sTradeData->sXY = 32; - sTradeData->gbaScale = 1024; - sTradeData->alpha = 0; + sTradeAnim->texX = 64; + sTradeAnim->texY = 92; + sTradeAnim->sXY = 32; + sTradeAnim->gbaScale = 1024; + sTradeAnim->alpha = 0; DmaCopyLarge16(3, sGbaAffine_Gfx, (void *) BG_CHAR_ADDR(1), 0x2840, 0x1000); - if (sTradeData->isCableTrade) + if (sTradeAnim->isCableTrade) { - DmaCopy16Defvars(3, sGbaCable_AffineTilemap, (void *) BG_SCREEN_ADDR(18), 0x100); + DmaCopy16Defvars(3, sGbaAffineMapCable, (void *) BG_SCREEN_ADDR(18), 0x100); } else { - DmaCopy16Defvars(3, sGbaWireless_AffineTilemap, (void *) BG_SCREEN_ADDR(18), 0x100); + DmaCopy16Defvars(3, sGbaAffineMapWireless, (void *) BG_SCREEN_ADDR(18), 0x100); } break; case 5: - sTradeData->bg1vofs = 0; - sTradeData->bg1hofs = 0; + sTradeAnim->bg1vofs = 0; + sTradeAnim->bg1hofs = 0; break; case 6: SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 | @@ -3217,28 +3290,28 @@ static void SetTradeSequenceBgGpuRegs(u8 state) BGCNT_256COLOR | BGCNT_SCREENBASE(18) | BGCNT_AFF128x128); - sTradeData->texX = 64; - sTradeData->texY = 92; - sTradeData->sXY = 256; - sTradeData->gbaScale = 128; - sTradeData->scrX = 120; - sTradeData->scrY = 80; - sTradeData->alpha = 0; + sTradeAnim->texX = 64; + sTradeAnim->texY = 92; + sTradeAnim->sXY = 256; + sTradeAnim->gbaScale = 128; + sTradeAnim->scrX = 120; + sTradeAnim->scrY = 80; + sTradeAnim->alpha = 0; DmaCopyLarge16(3, sGbaAffine_Gfx, (void *) BG_CHAR_ADDR(1), 0x2840, 0x1000); - if (sTradeData->isCableTrade) + if (sTradeAnim->isCableTrade) { - DmaCopy16Defvars(3, sGbaCable_AffineTilemap, (void *) BG_SCREEN_ADDR(18), 0x100); + DmaCopy16Defvars(3, sGbaAffineMapCable, (void *) BG_SCREEN_ADDR(18), 0x100); } else { - DmaCopy16Defvars(3, sGbaWireless_AffineTilemap, (void *) BG_SCREEN_ADDR(18), 0x100); + DmaCopy16Defvars(3, sGbaAffineMapWireless, (void *) BG_SCREEN_ADDR(18), 0x100); } break; case 7: - sTradeData->bg2vofs = 0; - sTradeData->bg2hofs = 0; + sTradeAnim->bg2vofs = 0; + sTradeAnim->bg2hofs = 0; SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(1) | @@ -3269,7 +3342,7 @@ static void BufferTradeSceneStrings(void) u8 name[20]; const struct InGameTrade *ingameTrade; - if (sTradeData->isLinkTrade) + if (sTradeAnim->isLinkTrade) { mpId = GetMultiplayerId(); StringCopy(gStringVar1, gLinkPlayers[mpId ^ 1].name); @@ -3289,476 +3362,476 @@ static void BufferTradeSceneStrings(void) } // returns TRUE if it finished a link trade, FALSE if it finished an in-game trade or if sequence is still going -static bool8 AnimateTradeSequence(void) +static bool8 DoTradeAnim(void) { - if (sTradeData->isCableTrade) - return AnimateTradeSequenceCable(); + if (sTradeAnim->isCableTrade) + return DoTradeAnim_Cable(); else - return AnimateTradeSequenceWireless(); + return DoTradeAnim_Wireless(); } -// Below are the states for the main switch in AnimateTradeSequenceCable and AnimateTradeSequenceWireless -// When AnimateTradeSequenceWireless has a unique version of a -// state used by AnimateTradeSequenceCable, it adds the below modifier -#define TS_WIRELESS_STATE 100 +// Below are the states for the main switch in DoTradeAnim_Cable and DoTradeAnim_Wireless +// When DoTradeAnim_Wireless has a unique version of a state used by DoTradeAnim_Cable, it adds the below modifier +#define STATE_WIRELESS 100 enum { - TS_STATE_START, - TS_STATE_MON_SLIDE_IN, + STATE_START, + STATE_MON_SLIDE_IN, // 2-9 unused - TS_STATE_SEND_MSG = 10, - TS_STATE_BYE_BYE, - TS_STATE_POKEBALL_DEPART, - TS_STATE_POKEBALL_DEPART_WAIT, - TS_STATE_FADE_OUT_TO_GBA_SEND, + STATE_SEND_MSG = 10, + STATE_BYE_BYE, + STATE_POKEBALL_DEPART, + STATE_POKEBALL_DEPART_WAIT, + STATE_FADE_OUT_TO_GBA_SEND, // 15-19 unused - TS_STATE_WAIT_FADE_OUT_TO_GBA_SEND = 20, - TS_STATE_FADE_IN_TO_GBA_SEND, - TS_STATE_WAIT_FADE_IN_TO_GBA_SEND, - TS_STATE_GBA_ZOOM_OUT, - TS_STATE_GBA_FLASH_SEND, - TS_STATE_GBA_STOP_FLASH_SEND, - TS_STATE_PAN_AWAY_GBA, - TS_STATE_CREATE_LINK_MON_LEAVING, - TS_STATE_LINK_MON_TRAVEL_OUT, - TS_STATE_FADE_OUT_TO_CROSSING, - TS_STATE_WAIT_FADE_OUT_TO_CROSSING, - TS_STATE_FADE_IN_TO_CROSSING, - TS_STATE_WAIT_FADE_IN_TO_CROSSING, - TS_STATE_CROSSING_LINK_MONS_ENTER, - TS_STATE_CROSSING_BLEND_WHITE_1, - TS_STATE_CROSSING_BLEND_WHITE_2, - TS_STATE_CROSSING_BLEND_WHITE_3, - TS_STATE_CROSSING_CREATE_MON_PICS, - TS_STATE_CROSSING_MON_PICS_MOVE, - TS_STATE_CROSSING_LINK_MONS_EXIT, - TS_STATE_CREATE_LINK_MON_ARRIVING, - TS_STATE_FADE_OUT_TO_GBA_RECV, - TS_STATE_WAIT_FADE_OUT_TO_GBA_RECV, - TS_STATE_LINK_MON_TRAVEL_IN, - TS_STATE_PAN_TO_GBA, - TS_STATE_DESTROY_LINK_MON, - TS_STATE_LINK_MON_ARRIVED_DELAY, - TS_STATE_MOVE_GBA_TO_CENTER, - TS_STATE_GBA_FLASH_RECV, - TS_STATE_UNUSED, - TS_STATE_GBA_STOP_FLASH_RECV, - TS_STATE_GBA_ZOOM_IN, - TS_STATE_FADE_OUT_TO_NEW_MON, + STATE_WAIT_FADE_OUT_TO_GBA_SEND = 20, + STATE_FADE_IN_TO_GBA_SEND, + STATE_WAIT_FADE_IN_TO_GBA_SEND, + STATE_GBA_ZOOM_OUT, + STATE_GBA_FLASH_SEND, + STATE_GBA_STOP_FLASH_SEND, + STATE_PAN_AWAY_GBA, + STATE_CREATE_LINK_MON_LEAVING, + STATE_LINK_MON_TRAVEL_OUT, + STATE_FADE_OUT_TO_CROSSING, + STATE_WAIT_FADE_OUT_TO_CROSSING, + STATE_FADE_IN_TO_CROSSING, + STATE_WAIT_FADE_IN_TO_CROSSING, + STATE_CROSSING_LINK_MONS_ENTER, + STATE_CROSSING_BLEND_WHITE_1, + STATE_CROSSING_BLEND_WHITE_2, + STATE_CROSSING_BLEND_WHITE_3, + STATE_CROSSING_CREATE_MON_PICS, + STATE_CROSSING_MON_PICS_MOVE, + STATE_CROSSING_LINK_MONS_EXIT, + STATE_CREATE_LINK_MON_ARRIVING, + STATE_FADE_OUT_TO_GBA_RECV, + STATE_WAIT_FADE_OUT_TO_GBA_RECV, + STATE_LINK_MON_TRAVEL_IN, + STATE_PAN_TO_GBA, + STATE_DESTROY_LINK_MON, + STATE_LINK_MON_ARRIVED_DELAY, + STATE_MOVE_GBA_TO_CENTER, + STATE_GBA_FLASH_RECV, + STATE_UNUSED, + STATE_GBA_STOP_FLASH_RECV, + STATE_GBA_ZOOM_IN, + STATE_FADE_OUT_TO_NEW_MON, // 53-59 unused - TS_STATE_WAIT_FADE_OUT_TO_NEW_MON = 60, - TS_STATE_FADE_IN_TO_NEW_MON, - TS_STATE_WAIT_FADE_IN_TO_NEW_MON, - TS_STATE_POKEBALL_ARRIVE, - TS_STATE_FADE_POKEBALL_TO_NORMAL, - TS_STATE_POKEBALL_ARRIVE_WAIT, - TS_STATE_SHOW_NEW_MON, - TS_STATE_NEW_MON_MSG, - TS_STATE_TAKE_CARE_OF_MON, - TS_STATE_AFTER_NEW_MON_DELAY, - TS_STATE_CHECK_RIBBONS, - TS_STATE_END_LINK_TRADE, - TS_STATE_TRY_EVOLUTION, - TS_STATE_FADE_OUT_END, - TS_STATE_WAIT_FADE_OUT_END, + STATE_WAIT_FADE_OUT_TO_NEW_MON = 60, + STATE_FADE_IN_TO_NEW_MON, + STATE_WAIT_FADE_IN_TO_NEW_MON, + STATE_POKEBALL_ARRIVE, + STATE_FADE_POKEBALL_TO_NORMAL, + STATE_POKEBALL_ARRIVE_WAIT, + STATE_SHOW_NEW_MON, + STATE_NEW_MON_MSG, + STATE_TAKE_CARE_OF_MON, + STATE_AFTER_NEW_MON_DELAY, + STATE_CHECK_RIBBONS, + STATE_END_LINK_TRADE, + STATE_TRY_EVOLUTION, + STATE_FADE_OUT_END, + STATE_WAIT_FADE_OUT_END, // Special states - TS_STATE_GBA_FLASH_SEND_WIRELESS = TS_STATE_GBA_FLASH_SEND + TS_WIRELESS_STATE, - TS_STATE_GBA_STOP_FLASH_SEND_WIRELESS, - TS_STATE_WAIT_WIRELESS_SIGNAL_SEND, - TS_STATE_PAN_TO_GBA_WIRELESS = TS_STATE_PAN_TO_GBA + TS_WIRELESS_STATE, - TS_STATE_DESTROY_LINK_MON_WIRELESS, - TS_STATE_WAIT_WIRELESS_SIGNAL_RECV, - TS_STATE_DELAY_FOR_MON_ANIM = 167, - TS_STATE_LINK_MON_TRAVEL_OFFSCREEN = 200, - TS_STATE_WAIT_FOR_MON_CRY = 267, + STATE_GBA_FLASH_SEND_WIRELESS = STATE_GBA_FLASH_SEND + STATE_WIRELESS, + STATE_GBA_STOP_FLASH_SEND_WIRELESS, + STATE_WAIT_WIRELESS_SIGNAL_SEND, + STATE_PAN_TO_GBA_WIRELESS = STATE_PAN_TO_GBA + STATE_WIRELESS, + STATE_DESTROY_LINK_MON_WIRELESS, + STATE_WAIT_WIRELESS_SIGNAL_RECV, + STATE_DELAY_FOR_MON_ANIM = 167, + STATE_LINK_MON_TRAVEL_OFFSCREEN = 200, + STATE_WAIT_FOR_MON_CRY = 267, }; -static bool8 AnimateTradeSequenceCable(void) +static bool8 DoTradeAnim_Cable(void) { u16 evoTarget; - switch (sTradeData->state) + switch (sTradeAnim->state) { - case TS_STATE_START: - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].invisible = FALSE; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].x2 = -180; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 = gMonFrontPicCoords[sTradeData->monSpecies[TRADE_PLAYER]].y_offset; - sTradeData->state++; - sTradeData->cachedMapMusic = GetCurrentMapMusic(); + case STATE_START: + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].invisible = FALSE; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].x2 = -180; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 = gMonFrontPicCoords[sTradeAnim->monSpecies[TRADE_PLAYER]].y_offset; + sTradeAnim->state++; + sTradeAnim->cachedMapMusic = GetCurrentMapMusic(); PlayNewMapMusic(MUS_EVOLUTION); break; - case TS_STATE_MON_SLIDE_IN: - if (sTradeData->bg2hofs > 0) + case STATE_MON_SLIDE_IN: + if (sTradeAnim->bg2hofs > 0) { // Sliding - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].x2 += 3; - sTradeData->bg2hofs -= 3; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].x2 += 3; + sTradeAnim->bg2hofs -= 3; } else { // Pokémon has arrived onscreen - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].x2 = 0; - sTradeData->bg2hofs = 0; - sTradeData->state = TS_STATE_SEND_MSG; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].x2 = 0; + sTradeAnim->bg2hofs = 0; + sTradeAnim->state = STATE_SEND_MSG; } break; - case TS_STATE_SEND_MSG: + case STATE_SEND_MSG: StringExpandPlaceholders(gStringVar4, gText_XWillBeSentToY); DrawTextOnTradeWindow(0, gStringVar4, 0); - if (sTradeData->monSpecies[TRADE_PLAYER] != SPECIES_EGG) - PlayCry_Normal(sTradeData->monSpecies[TRADE_PLAYER], 0); + if (sTradeAnim->monSpecies[TRADE_PLAYER] != SPECIES_EGG) + PlayCry_Normal(sTradeAnim->monSpecies[TRADE_PLAYER], 0); - sTradeData->state = TS_STATE_BYE_BYE; - sTradeData->timer = 0; + sTradeAnim->state = STATE_BYE_BYE; + sTradeAnim->timer = 0; break; - case TS_STATE_BYE_BYE: - if (++sTradeData->timer == 80) + case STATE_BYE_BYE: + if (++sTradeAnim->timer == 80) { - sTradeData->releasePokeballSpriteId = CreateTradePokeballSprite(sTradeData->monSpriteIds[0], gSprites[sTradeData->monSpriteIds[0]].oam.paletteNum, 120, 32, 2, 1, 0x14, 0xfffff); - sTradeData->state++; + sTradeAnim->releasePokeballSpriteId = CreateTradePokeballSprite(sTradeAnim->monSpriteIds[TRADE_PLAYER], gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].oam.paletteNum, 120, 32, 2, 1, 0x14, 0xfffff); + sTradeAnim->state++; StringExpandPlaceholders(gStringVar4, gText_ByeByeVar1); DrawTextOnTradeWindow(0, gStringVar4, 0); } break; - case TS_STATE_POKEBALL_DEPART: - if (gSprites[sTradeData->releasePokeballSpriteId].callback == SpriteCallbackDummy) + case STATE_POKEBALL_DEPART: + if (gSprites[sTradeAnim->releasePokeballSpriteId].callback == SpriteCallbackDummy) { - sTradeData->bouncingPokeballSpriteId = CreateSprite(&sSpriteTemplate_Pokeball, 120, 32, 0); - gSprites[sTradeData->bouncingPokeballSpriteId].callback = SpriteCB_BouncingPokeballDepart; - DestroySprite(&gSprites[sTradeData->releasePokeballSpriteId]); - sTradeData->state++; + sTradeAnim->bouncingPokeballSpriteId = CreateSprite(&sSpriteTemplate_Pokeball, 120, 32, 0); + gSprites[sTradeAnim->bouncingPokeballSpriteId].callback = SpriteCB_BouncingPokeballDepart; + DestroySprite(&gSprites[sTradeAnim->releasePokeballSpriteId]); + sTradeAnim->state++; } break; - case TS_STATE_POKEBALL_DEPART_WAIT: + case STATE_POKEBALL_DEPART_WAIT: // The game waits here for the sprite to finish its animation sequence. break; - case TS_STATE_FADE_OUT_TO_GBA_SEND: + case STATE_FADE_OUT_TO_GBA_SEND: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeData->state = TS_STATE_WAIT_FADE_OUT_TO_GBA_SEND; + sTradeAnim->state = STATE_WAIT_FADE_OUT_TO_GBA_SEND; break; - case TS_STATE_WAIT_FADE_OUT_TO_GBA_SEND: + case STATE_WAIT_FADE_OUT_TO_GBA_SEND: if (!gPaletteFade.active) { SetTradeSequenceBgGpuRegs(4); FillWindowPixelBuffer(0, PIXEL_FILL(15)); CopyWindowToVram(0, COPYWIN_FULL); - sTradeData->state++; + sTradeAnim->state++; } break; - case TS_STATE_FADE_IN_TO_GBA_SEND: + case STATE_FADE_IN_TO_GBA_SEND: BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_IN_TO_GBA_SEND: + case STATE_WAIT_FADE_IN_TO_GBA_SEND: if (!gPaletteFade.active) - sTradeData->state = TS_STATE_GBA_ZOOM_OUT; + sTradeAnim->state = STATE_GBA_ZOOM_OUT; break; - case TS_STATE_GBA_ZOOM_OUT: - if (sTradeData->gbaScale > 0x100) + case STATE_GBA_ZOOM_OUT: + if (sTradeAnim->gbaScale > 0x100) { - sTradeData->gbaScale -= 0x34; + sTradeAnim->gbaScale -= 0x34; } else { SetTradeSequenceBgGpuRegs(1); - sTradeData->gbaScale = 0x80; - sTradeData->state++; - sTradeData->timer = 0; + sTradeAnim->gbaScale = 0x80; + sTradeAnim->state++; + sTradeAnim->timer = 0; } - sTradeData->sXY = 0x8000 / sTradeData->gbaScale; + sTradeAnim->sXY = 0x8000 / sTradeAnim->gbaScale; break; - case TS_STATE_GBA_FLASH_SEND: - if (++sTradeData->timer > 20) + case STATE_GBA_FLASH_SEND: + if (++sTradeAnim->timer > 20) { SetTradeBGAffine(); - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_GbaScreenFlash_Long, 120, 80, 0); - sTradeData->state++; + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_GbaScreenFlash_Long, 120, 80, 0); + sTradeAnim->state++; } break; - case TS_STATE_GBA_STOP_FLASH_SEND: - if (gSprites[sTradeData->connectionSpriteId2].animEnded) + case STATE_GBA_STOP_FLASH_SEND: + if (gSprites[sTradeAnim->connectionSpriteId2].animEnded) { - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(12, 4)); - sTradeData->state++; + sTradeAnim->state++; } break; - case TS_STATE_PAN_AWAY_GBA: - if (--sTradeData->bg1vofs == 316) - sTradeData->state++; + case STATE_PAN_AWAY_GBA: + if (--sTradeAnim->bg1vofs == 316) + sTradeAnim->state++; - if (sTradeData->bg1vofs == 328) - sTradeData->cableEndSpriteId = CreateSprite(&sSpriteTemplate_CableEnd, 128, 65, 0); + if (sTradeAnim->bg1vofs == 328) + sTradeAnim->cableEndSpriteId = CreateSprite(&sSpriteTemplate_CableEnd, 128, 65, 0); break; - case TS_STATE_CREATE_LINK_MON_LEAVING: - sTradeData->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonGlow, 128, 80, 3); - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 128, 80, 0); - StartSpriteAnim(&gSprites[sTradeData->connectionSpriteId2], ANIM_LINKMON_SMALL); - sTradeData->state++; + case STATE_CREATE_LINK_MON_LEAVING: + sTradeAnim->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonGlow, 128, 80, 3); + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 128, 80, 0); + StartSpriteAnim(&gSprites[sTradeAnim->connectionSpriteId2], ANIM_LINKMON_SMALL); + sTradeAnim->state++; break; - case TS_STATE_LINK_MON_TRAVEL_OUT: - if ((sTradeData->bg1vofs -= 2) == 166) - sTradeData->state = TS_STATE_LINK_MON_TRAVEL_OFFSCREEN; + case STATE_LINK_MON_TRAVEL_OUT: + if ((sTradeAnim->bg1vofs -= 2) == 166) + sTradeAnim->state = STATE_LINK_MON_TRAVEL_OFFSCREEN; SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_OBJ_ON); break; - case TS_STATE_LINK_MON_TRAVEL_OFFSCREEN: - gSprites[sTradeData->connectionSpriteId1].y -= 2; - gSprites[sTradeData->connectionSpriteId2].y -= 2; - if (gSprites[sTradeData->connectionSpriteId1].y < -8) - sTradeData->state = TS_STATE_FADE_OUT_TO_CROSSING; + case STATE_LINK_MON_TRAVEL_OFFSCREEN: + gSprites[sTradeAnim->connectionSpriteId1].y -= 2; + gSprites[sTradeAnim->connectionSpriteId2].y -= 2; + if (gSprites[sTradeAnim->connectionSpriteId1].y < -8) + sTradeAnim->state = STATE_FADE_OUT_TO_CROSSING; break; - case TS_STATE_FADE_OUT_TO_CROSSING: + case STATE_FADE_OUT_TO_CROSSING: BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); - sTradeData->state = TS_STATE_WAIT_FADE_OUT_TO_CROSSING; + sTradeAnim->state = STATE_WAIT_FADE_OUT_TO_CROSSING; break; - case TS_STATE_WAIT_FADE_OUT_TO_CROSSING: + case STATE_WAIT_FADE_OUT_TO_CROSSING: if (!gPaletteFade.active) { - DestroySprite(&gSprites[sTradeData->connectionSpriteId1]); - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId1]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); SetTradeSequenceBgGpuRegs(2); - sTradeData->state++; + sTradeAnim->state++; } break; - case TS_STATE_FADE_IN_TO_CROSSING: + case STATE_FADE_IN_TO_CROSSING: BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); - sTradeData->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 111, 170, 0); - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 129, -10, 0); - sTradeData->state++; + sTradeAnim->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 111, 170, 0); + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 129, -10, 0); + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_IN_TO_CROSSING: + case STATE_WAIT_FADE_IN_TO_CROSSING: if (!gPaletteFade.active) { PlaySE(SE_WARP_OUT); - sTradeData->state++; + sTradeAnim->state++; } - gSprites[sTradeData->connectionSpriteId1].y2 -= 3; - gSprites[sTradeData->connectionSpriteId2].y2 += 3; + gSprites[sTradeAnim->connectionSpriteId1].y2 -= 3; + gSprites[sTradeAnim->connectionSpriteId2].y2 += 3; break; - case TS_STATE_CROSSING_LINK_MONS_ENTER: - gSprites[sTradeData->connectionSpriteId1].y2 -= 3; - gSprites[sTradeData->connectionSpriteId2].y2 += 3; - if (gSprites[sTradeData->connectionSpriteId1].y2 <= -90) + case STATE_CROSSING_LINK_MONS_ENTER: + gSprites[sTradeAnim->connectionSpriteId1].y2 -= 3; + gSprites[sTradeAnim->connectionSpriteId2].y2 += 3; + if (gSprites[sTradeAnim->connectionSpriteId1].y2 <= -90) { - gSprites[sTradeData->connectionSpriteId1].data[1] = 1; - gSprites[sTradeData->connectionSpriteId2].data[1] = 1; - sTradeData->state++; + gSprites[sTradeAnim->connectionSpriteId1].data[1] = 1; + gSprites[sTradeAnim->connectionSpriteId2].data[1] = 1; + sTradeAnim->state++; } break; - case TS_STATE_CROSSING_BLEND_WHITE_1: + case STATE_CROSSING_BLEND_WHITE_1: BlendPalettes(0x1, 16, RGB_WHITEALPHA); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_CROSSING_BLEND_WHITE_2: + case STATE_CROSSING_BLEND_WHITE_2: BlendPalettes(0x1, 0, RGB_WHITEALPHA); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_CROSSING_BLEND_WHITE_3: + case STATE_CROSSING_BLEND_WHITE_3: BlendPalettes(0x1, 16, RGB_WHITEALPHA); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_CROSSING_CREATE_MON_PICS: - if (!IsMonSpriteNotFlipped(sTradeData->monSpecies[TRADE_PLAYER])) + case STATE_CROSSING_CREATE_MON_PICS: + if (!IsMonSpriteNotFlipped(sTradeAnim->monSpecies[TRADE_PLAYER])) { - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].affineAnims = sAffineAnims_CrossingMonPics; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].oam.affineMode = ST_OAM_AFFINE_DOUBLE; - CalcCenterToCornerVec(&gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]], SPRITE_SHAPE(64x64), SPRITE_SIZE(64x64), ST_OAM_AFFINE_DOUBLE); - StartSpriteAffineAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]], 0); + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].affineAnims = sAffineAnims_CrossingMonPics; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].oam.affineMode = ST_OAM_AFFINE_DOUBLE; + CalcCenterToCornerVec(&gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]], SPRITE_SHAPE(64x64), SPRITE_SIZE(64x64), ST_OAM_AFFINE_DOUBLE); + StartSpriteAffineAnim(&gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]], 0); } else { - StartSpriteAffineAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]], 0); + StartSpriteAffineAnim(&gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]], 0); } - StartSpriteAffineAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]], 0); - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].x = 60; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x = 180; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y = 192; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y = -32; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].invisible = FALSE; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].invisible = FALSE; - sTradeData->state++; + StartSpriteAffineAnim(&gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]], 0); + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].x = 60; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].x = 180; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y = 192; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].y = -32; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].invisible = FALSE; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].invisible = FALSE; + sTradeAnim->state++; break; - case TS_STATE_CROSSING_MON_PICS_MOVE: - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 -= 3; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y2 += 3; - if (gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 < -DISPLAY_HEIGHT - && gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 >= -DISPLAY_HEIGHT - 3) + case STATE_CROSSING_MON_PICS_MOVE: + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 -= 3; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].y2 += 3; + if (gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 < -DISPLAY_HEIGHT + && gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 >= -DISPLAY_HEIGHT - 3) { PlaySE(SE_WARP_IN); } - if (gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 < -222) + if (gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 < -222) { - gSprites[sTradeData->connectionSpriteId1].data[1] = 0; - gSprites[sTradeData->connectionSpriteId2].data[1] = 0; - sTradeData->state++; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].invisible = TRUE; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].invisible = TRUE; + gSprites[sTradeAnim->connectionSpriteId1].data[1] = 0; + gSprites[sTradeAnim->connectionSpriteId2].data[1] = 0; + sTradeAnim->state++; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].invisible = TRUE; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].invisible = TRUE; BlendPalettes(0x1, 0, RGB_WHITEALPHA); } break; - case TS_STATE_CROSSING_LINK_MONS_EXIT: - gSprites[sTradeData->connectionSpriteId1].y2 -= 3; - gSprites[sTradeData->connectionSpriteId2].y2 += 3; - if (gSprites[sTradeData->connectionSpriteId1].y2 <= -222) + case STATE_CROSSING_LINK_MONS_EXIT: + gSprites[sTradeAnim->connectionSpriteId1].y2 -= 3; + gSprites[sTradeAnim->connectionSpriteId2].y2 += 3; + if (gSprites[sTradeAnim->connectionSpriteId1].y2 <= -222) { BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); - sTradeData->state++; - DestroySprite(&gSprites[sTradeData->connectionSpriteId1]); - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); + sTradeAnim->state++; + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId1]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); } break; - case TS_STATE_CREATE_LINK_MON_ARRIVING: + case STATE_CREATE_LINK_MON_ARRIVING: if (!gPaletteFade.active) { - sTradeData->state++; + sTradeAnim->state++; SetTradeSequenceBgGpuRegs(1); - sTradeData->bg1vofs = 166; - sTradeData->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonGlow, 128, -20, 3); - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 128, -20, 0); - StartSpriteAnim(&gSprites[sTradeData->connectionSpriteId2], ANIM_LINKMON_SMALL); + sTradeAnim->bg1vofs = 166; + sTradeAnim->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonGlow, 128, -20, 3); + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 128, -20, 0); + StartSpriteAnim(&gSprites[sTradeAnim->connectionSpriteId2], ANIM_LINKMON_SMALL); } break; - case TS_STATE_FADE_OUT_TO_GBA_RECV: + case STATE_FADE_OUT_TO_GBA_RECV: BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_OUT_TO_GBA_RECV: + case STATE_WAIT_FADE_OUT_TO_GBA_RECV: SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_OBJ_ON); if (!gPaletteFade.active) - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_LINK_MON_TRAVEL_IN: - gSprites[sTradeData->connectionSpriteId1].y2 += 3; - gSprites[sTradeData->connectionSpriteId2].y2 += 3; - if (gSprites[sTradeData->connectionSpriteId1].y2 + gSprites[sTradeData->connectionSpriteId1].y == 64) + case STATE_LINK_MON_TRAVEL_IN: + gSprites[sTradeAnim->connectionSpriteId1].y2 += 3; + gSprites[sTradeAnim->connectionSpriteId2].y2 += 3; + if (gSprites[sTradeAnim->connectionSpriteId1].y2 + gSprites[sTradeAnim->connectionSpriteId1].y == 64) + sTradeAnim->state++; + break; + case STATE_PAN_TO_GBA: + if ((sTradeAnim->bg1vofs += 2) > 316) { - sTradeData->state++; + sTradeAnim->bg1vofs = 316; + sTradeAnim->state++; } break; - case TS_STATE_PAN_TO_GBA: - if ((sTradeData->bg1vofs += 2) > 316) + case STATE_DESTROY_LINK_MON: + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId1]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); + sTradeAnim->state++; + sTradeAnim->timer = 0; + break; + case STATE_LINK_MON_ARRIVED_DELAY: + if (++sTradeAnim->timer == 10) + sTradeAnim->state++; + break; + case STATE_MOVE_GBA_TO_CENTER: + if (++sTradeAnim->bg1vofs > 348) { - sTradeData->bg1vofs = 316; - sTradeData->state++; + sTradeAnim->bg1vofs = 348; + sTradeAnim->state++; + } + if (sTradeAnim->bg1vofs == 328 && sTradeAnim->isCableTrade) + { + sTradeAnim->cableEndSpriteId = CreateSprite(&sSpriteTemplate_CableEnd, 128, 65, 0); + gSprites[sTradeAnim->cableEndSpriteId].callback = SpriteCB_CableEndReceiving; } break; - case TS_STATE_DESTROY_LINK_MON: - DestroySprite(&gSprites[sTradeData->connectionSpriteId1]); - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); - sTradeData->state++; - sTradeData->timer = 0; + case STATE_GBA_FLASH_RECV: + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_GbaScreenFlash_Long, 120, 80, 0); + sTradeAnim->state = STATE_GBA_STOP_FLASH_RECV; break; - case TS_STATE_LINK_MON_ARRIVED_DELAY: - if (++sTradeData->timer == 10) - sTradeData->state++; - break; - case TS_STATE_MOVE_GBA_TO_CENTER: - if (++sTradeData->bg1vofs > 348) + case STATE_GBA_STOP_FLASH_RECV: + if (gSprites[sTradeAnim->connectionSpriteId2].animEnded) { - sTradeData->bg1vofs = 348; - sTradeData->state++; - } - if (sTradeData->bg1vofs == 328 && sTradeData->isCableTrade) - { - sTradeData->cableEndSpriteId = CreateSprite(&sSpriteTemplate_CableEnd, 128, 65, 0); - gSprites[sTradeData->cableEndSpriteId].callback = SpriteCB_CableEndReceiving; - } - break; - case TS_STATE_GBA_FLASH_RECV: - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_GbaScreenFlash_Long, 120, 80, 0); - sTradeData->state = TS_STATE_GBA_STOP_FLASH_RECV; - break; - case TS_STATE_GBA_STOP_FLASH_RECV: - if (gSprites[sTradeData->connectionSpriteId2].animEnded) - { - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); SetTradeSequenceBgGpuRegs(6); - sTradeData->state++; + sTradeAnim->state++; PlaySE(SE_M_SAND_ATTACK); } break; - case TS_STATE_GBA_ZOOM_IN: - if (sTradeData->gbaScale < 0x400) + case STATE_GBA_ZOOM_IN: + if (sTradeAnim->gbaScale < 0x400) { - sTradeData->gbaScale += 0x34; + sTradeAnim->gbaScale += 0x34; } else { - sTradeData->gbaScale = 0x400; - sTradeData->state++; + sTradeAnim->gbaScale = 0x400; + sTradeAnim->state++; } - sTradeData->sXY = 0x8000 / sTradeData->gbaScale; + sTradeAnim->sXY = 0x8000 / sTradeAnim->gbaScale; break; - case TS_STATE_FADE_OUT_TO_NEW_MON: + case STATE_FADE_OUT_TO_NEW_MON: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeData->state = TS_STATE_WAIT_FADE_OUT_TO_NEW_MON; + sTradeAnim->state = STATE_WAIT_FADE_OUT_TO_NEW_MON; break; - case TS_STATE_WAIT_FADE_OUT_TO_NEW_MON: + case STATE_WAIT_FADE_OUT_TO_NEW_MON: if (!gPaletteFade.active) { SetTradeSequenceBgGpuRegs(5); SetTradeSequenceBgGpuRegs(7); gPaletteFade.bufferTransferDisabled = TRUE; - sTradeData->state++; + sTradeAnim->state++; } break; - case TS_STATE_FADE_IN_TO_NEW_MON: + case STATE_FADE_IN_TO_NEW_MON: gPaletteFade.bufferTransferDisabled = FALSE; BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_IN_TO_NEW_MON: + case STATE_WAIT_FADE_IN_TO_NEW_MON: SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON); if (!gPaletteFade.active) - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_POKEBALL_ARRIVE: - sTradeData->bouncingPokeballSpriteId = CreateSprite(&sSpriteTemplate_Pokeball, 120, -8, 0); - gSprites[sTradeData->bouncingPokeballSpriteId].data[3] = 74; - gSprites[sTradeData->bouncingPokeballSpriteId].callback = SpriteCB_BouncingPokeballArrive; - StartSpriteAnim(&gSprites[sTradeData->bouncingPokeballSpriteId], 1); - StartSpriteAffineAnim(&gSprites[sTradeData->bouncingPokeballSpriteId], 2); - BlendPalettes(1 << (16 + gSprites[sTradeData->bouncingPokeballSpriteId].oam.paletteNum), 16, RGB_WHITEALPHA); - sTradeData->state++; - sTradeData->timer = 0; + case STATE_POKEBALL_ARRIVE: + sTradeAnim->bouncingPokeballSpriteId = CreateSprite(&sSpriteTemplate_Pokeball, 120, -8, 0); + gSprites[sTradeAnim->bouncingPokeballSpriteId].data[3] = 74; + gSprites[sTradeAnim->bouncingPokeballSpriteId].callback = SpriteCB_BouncingPokeballArrive; + StartSpriteAnim(&gSprites[sTradeAnim->bouncingPokeballSpriteId], 1); + StartSpriteAffineAnim(&gSprites[sTradeAnim->bouncingPokeballSpriteId], 2); + BlendPalettes(1 << (16 + gSprites[sTradeAnim->bouncingPokeballSpriteId].oam.paletteNum), 16, RGB_WHITEALPHA); + sTradeAnim->state++; + sTradeAnim->timer = 0; break; - case TS_STATE_FADE_POKEBALL_TO_NORMAL: - BeginNormalPaletteFade(1 << (16 + gSprites[sTradeData->bouncingPokeballSpriteId].oam.paletteNum), 1, 16, 0, RGB_WHITEALPHA); - sTradeData->state++; + case STATE_FADE_POKEBALL_TO_NORMAL: + BeginNormalPaletteFade(1 << (16 + gSprites[sTradeAnim->bouncingPokeballSpriteId].oam.paletteNum), 1, 16, 0, RGB_WHITEALPHA); + sTradeAnim->state++; break; - case TS_STATE_POKEBALL_ARRIVE_WAIT: - if (gSprites[sTradeData->bouncingPokeballSpriteId].callback == SpriteCallbackDummy) + case STATE_POKEBALL_ARRIVE_WAIT: + if (gSprites[sTradeAnim->bouncingPokeballSpriteId].callback == SpriteCallbackDummy) { - HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]); - sTradeData->state++; + HandleLoadSpecialPokePic(TRUE, + gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT], + sTradeAnim->monSpecies[TRADE_PARTNER], + sTradeAnim->monPersonalities[TRADE_PARTNER]); + sTradeAnim->state++; } break; - case TS_STATE_SHOW_NEW_MON: - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x = 120; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y = gMonFrontPicCoords[sTradeData->monSpecies[TRADE_PARTNER]].y_offset + 60; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x2 = 0; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y2 = 0; - StartSpriteAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]], 0); - CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, PALETTES_BG | (0xF << 16), sTradeData->monSpecies[TRADE_PARTNER]); - FreeSpriteOamMatrix(&gSprites[sTradeData->bouncingPokeballSpriteId]); - DestroySprite(&gSprites[sTradeData->bouncingPokeballSpriteId]); - sTradeData->state++; + case STATE_SHOW_NEW_MON: + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].x = 120; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].y = gMonFrontPicCoords[sTradeAnim->monSpecies[TRADE_PARTNER]].y_offset + 60; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].x2 = 0; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].y2 = 0; + StartSpriteAnim(&gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]], 0); + CreatePokeballSpriteToReleaseMon(sTradeAnim->monSpriteIds[TRADE_PARTNER], gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, PALETTES_BG | (0xF << 16), sTradeAnim->monSpecies[TRADE_PARTNER]); + FreeSpriteOamMatrix(&gSprites[sTradeAnim->bouncingPokeballSpriteId]); + DestroySprite(&gSprites[sTradeAnim->bouncingPokeballSpriteId]); + sTradeAnim->state++; break; - case TS_STATE_NEW_MON_MSG: + case STATE_NEW_MON_MSG: SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | @@ -3766,76 +3839,70 @@ static bool8 AnimateTradeSequenceCable(void) DISPCNT_OBJ_ON); StringExpandPlaceholders(gStringVar4, gText_XSentOverY); DrawTextOnTradeWindow(0, gStringVar4, 0); - sTradeData->state = TS_STATE_DELAY_FOR_MON_ANIM; - sTradeData->timer = 0; + sTradeAnim->state = STATE_DELAY_FOR_MON_ANIM; + sTradeAnim->timer = 0; break; - case TS_STATE_DELAY_FOR_MON_ANIM: - if (++sTradeData->timer > 60) + case STATE_DELAY_FOR_MON_ANIM: + if (++sTradeAnim->timer > 60) { - sTradeData->state = TS_STATE_WAIT_FOR_MON_CRY; - sTradeData->timer = 0; + sTradeAnim->state = STATE_WAIT_FOR_MON_CRY; + sTradeAnim->timer = 0; } break; - case TS_STATE_WAIT_FOR_MON_CRY: + case STATE_WAIT_FOR_MON_CRY: if (IsCryFinished()) - sTradeData->state = TS_STATE_TAKE_CARE_OF_MON; + sTradeAnim->state = STATE_TAKE_CARE_OF_MON; break; - case TS_STATE_TAKE_CARE_OF_MON: - if (++sTradeData->timer == 10) + case STATE_TAKE_CARE_OF_MON: + if (++sTradeAnim->timer == 10) PlayFanfare(MUS_EVOLVED); - if (sTradeData->timer == 250) + if (sTradeAnim->timer == 250) { - sTradeData->state++; + sTradeAnim->state++; StringExpandPlaceholders(gStringVar4, gText_TakeGoodCareOfX); DrawTextOnTradeWindow(0, gStringVar4, 0); - sTradeData->timer = 0; + sTradeAnim->timer = 0; } break; - case TS_STATE_AFTER_NEW_MON_DELAY: - if (++sTradeData->timer == 60) - sTradeData->state++; + case STATE_AFTER_NEW_MON_DELAY: + if (++sTradeAnim->timer == 60) + sTradeAnim->state++; break; - case TS_STATE_CHECK_RIBBONS: + case STATE_CHECK_RIBBONS: CheckPartnersMonForRibbons(); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_END_LINK_TRADE: - if (sTradeData->isLinkTrade) - { + case STATE_END_LINK_TRADE: + if (sTradeAnim->isLinkTrade) return TRUE; - } else if (JOY_NEW(A_BUTTON)) - { - sTradeData->state++; - } + sTradeAnim->state++; break; - case TS_STATE_TRY_EVOLUTION: // Only if in-game trade, link trades use CB2_TryLinkTradeEvolution + case STATE_TRY_EVOLUTION: // Only if in-game trade, link trades use CB2_TryLinkTradeEvolution TradeMons(gSpecialVar_0x8005, 0); - gCB2_AfterEvolution = CB2_UpdateInGameTrade; + gCB2_AfterEvolution = CB2_InGameTrade; evoTarget = GetEvolutionTargetSpecies(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], EVO_MODE_TRADE, ITEM_NONE, &gPlayerParty[gSelectedTradeMonPositions[TRADE_PARTNER]]); if (evoTarget != SPECIES_NONE) - { - TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], evoTarget, sTradeData->monSpriteIds[TRADE_PARTNER], gSelectedTradeMonPositions[TRADE_PLAYER]); - } - sTradeData->state++; + TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], evoTarget, sTradeAnim->monSpriteIds[TRADE_PARTNER], gSelectedTradeMonPositions[TRADE_PLAYER]); + sTradeAnim->state++; break; - case TS_STATE_FADE_OUT_END: + case STATE_FADE_OUT_END: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_OUT_END: + case STATE_WAIT_FADE_OUT_END: if (!gPaletteFade.active) { - PlayNewMapMusic(sTradeData->cachedMapMusic); - if (sTradeData) + PlayNewMapMusic(sTradeAnim->cachedMapMusic); + if (sTradeAnim) { FreeAllWindowBuffers(); Free(GetBgTilemapBuffer(3)); Free(GetBgTilemapBuffer(1)); Free(GetBgTilemapBuffer(0)); FreeMonSpritesGfx(); - FREE_AND_SET_NULL(sTradeData); + FREE_AND_SET_NULL(sTradeAnim); } SetMainCallback2(CB2_ReturnToField); BufferInGameTradeMonName(); @@ -3845,111 +3912,116 @@ static bool8 AnimateTradeSequenceCable(void) return FALSE; } -static bool8 AnimateTradeSequenceWireless(void) +// Task data for Task_AnimateWirelessSignal +#define tIdx data[0] +#define tCounter data[1] +#define tSignalComingBack data[2] + +static bool8 DoTradeAnim_Wireless(void) { u16 evoTarget; - switch (sTradeData->state) + switch (sTradeAnim->state) { - case TS_STATE_START: - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].invisible = FALSE; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].x2 = -180; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 = gMonFrontPicCoords[sTradeData->monSpecies[TRADE_PLAYER]].y_offset; - sTradeData->state++; - sTradeData->cachedMapMusic = GetCurrentMapMusic(); + case STATE_START: + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].invisible = FALSE; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].x2 = -180; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 = gMonFrontPicCoords[sTradeAnim->monSpecies[TRADE_PLAYER]].y_offset; + sTradeAnim->state++; + sTradeAnim->cachedMapMusic = GetCurrentMapMusic(); PlayNewMapMusic(MUS_EVOLUTION); break; - case TS_STATE_MON_SLIDE_IN: - if (sTradeData->bg2hofs > 0) + case STATE_MON_SLIDE_IN: + if (sTradeAnim->bg2hofs > 0) { - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].x2 += 3; - sTradeData->bg2hofs -= 3; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].x2 += 3; + sTradeAnim->bg2hofs -= 3; } else { - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].x2 = 0; - sTradeData->bg2hofs = 0; - sTradeData->state = TS_STATE_SEND_MSG; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].x2 = 0; + sTradeAnim->bg2hofs = 0; + sTradeAnim->state = STATE_SEND_MSG; } break; - case TS_STATE_SEND_MSG: + case STATE_SEND_MSG: StringExpandPlaceholders(gStringVar4, gText_XWillBeSentToY); DrawTextOnTradeWindow(0, gStringVar4, 0); - if (sTradeData->monSpecies[TRADE_PLAYER] != SPECIES_EGG) - PlayCry_Normal(sTradeData->monSpecies[TRADE_PLAYER], 0); + if (sTradeAnim->monSpecies[TRADE_PLAYER] != SPECIES_EGG) + PlayCry_Normal(sTradeAnim->monSpecies[TRADE_PLAYER], 0); - sTradeData->state = TS_STATE_BYE_BYE; - sTradeData->timer = 0; + sTradeAnim->state = STATE_BYE_BYE; + sTradeAnim->timer = 0; break; - case TS_STATE_BYE_BYE: - if (++sTradeData->timer == 80) + case STATE_BYE_BYE: + if (++sTradeAnim->timer == 80) { - sTradeData->releasePokeballSpriteId = CreateTradePokeballSprite(sTradeData->monSpriteIds[0], gSprites[sTradeData->monSpriteIds[0]].oam.paletteNum, 120, 32, 2, 1, 0x14, 0xfffff); - sTradeData->state++; + sTradeAnim->releasePokeballSpriteId = CreateTradePokeballSprite(sTradeAnim->monSpriteIds[TRADE_PLAYER], gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].oam.paletteNum, 120, 32, 2, 1, 0x14, 0xfffff); + sTradeAnim->state++; StringExpandPlaceholders(gStringVar4, gText_ByeByeVar1); DrawTextOnTradeWindow(0, gStringVar4, 0); } break; - case TS_STATE_POKEBALL_DEPART: - if (gSprites[sTradeData->releasePokeballSpriteId].callback == SpriteCallbackDummy) + case STATE_POKEBALL_DEPART: + if (gSprites[sTradeAnim->releasePokeballSpriteId].callback == SpriteCallbackDummy) { - sTradeData->bouncingPokeballSpriteId = CreateSprite(&sSpriteTemplate_Pokeball, 120, 32, 0); - gSprites[sTradeData->bouncingPokeballSpriteId].callback = SpriteCB_BouncingPokeballDepart; - DestroySprite(&gSprites[sTradeData->releasePokeballSpriteId]); - sTradeData->state++; + sTradeAnim->bouncingPokeballSpriteId = CreateSprite(&sSpriteTemplate_Pokeball, 120, 32, 0); + gSprites[sTradeAnim->bouncingPokeballSpriteId].callback = SpriteCB_BouncingPokeballDepart; + DestroySprite(&gSprites[sTradeAnim->releasePokeballSpriteId]); + sTradeAnim->state++; } break; - case TS_STATE_POKEBALL_DEPART_WAIT: + case STATE_POKEBALL_DEPART_WAIT: // The game waits here for the sprite to finish its animation sequence. break; - case TS_STATE_FADE_OUT_TO_GBA_SEND: + case STATE_FADE_OUT_TO_GBA_SEND: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeData->state = TS_STATE_WAIT_FADE_OUT_TO_GBA_SEND; + sTradeAnim->state = STATE_WAIT_FADE_OUT_TO_GBA_SEND; break; - case TS_STATE_WAIT_FADE_OUT_TO_GBA_SEND: + case STATE_WAIT_FADE_OUT_TO_GBA_SEND: if (!gPaletteFade.active) { SetTradeSequenceBgGpuRegs(4); FillWindowPixelBuffer(0, PIXEL_FILL(15)); CopyWindowToVram(0, COPYWIN_FULL); - sTradeData->state++; + sTradeAnim->state++; } break; - case TS_STATE_FADE_IN_TO_GBA_SEND: + case STATE_FADE_IN_TO_GBA_SEND: BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_IN_TO_GBA_SEND: + case STATE_WAIT_FADE_IN_TO_GBA_SEND: if (!gPaletteFade.active) - sTradeData->state = TS_STATE_GBA_ZOOM_OUT; + sTradeAnim->state = STATE_GBA_ZOOM_OUT; break; - case TS_STATE_GBA_ZOOM_OUT: - if (sTradeData->gbaScale > 0x100) + case STATE_GBA_ZOOM_OUT: + if (sTradeAnim->gbaScale > 0x100) { - sTradeData->gbaScale -= 0x34; + sTradeAnim->gbaScale -= 0x34; } else { SetTradeSequenceBgGpuRegs(1); - sTradeData->gbaScale = 0x80; - sTradeData->state = TS_STATE_GBA_FLASH_SEND_WIRELESS; - sTradeData->timer = 0; + sTradeAnim->gbaScale = 0x80; + sTradeAnim->state = STATE_GBA_FLASH_SEND_WIRELESS; + sTradeAnim->timer = 0; } - sTradeData->sXY = 0x8000 / sTradeData->gbaScale; + sTradeAnim->sXY = 0x8000 / sTradeAnim->gbaScale; break; - case TS_STATE_GBA_FLASH_SEND_WIRELESS: - if (++sTradeData->timer > 20) + case STATE_GBA_FLASH_SEND_WIRELESS: + if (++sTradeAnim->timer > 20) { SetTradeSequenceBgGpuRegs(3); - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_GbaScreenFlash_Short, 120, 80, 0); - sTradeData->state++; + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_GbaScreenFlash_Short, 120, 80, 0); + sTradeAnim->state++; } break; - case TS_STATE_GBA_STOP_FLASH_SEND_WIRELESS: - if (gSprites[sTradeData->connectionSpriteId2].animEnded) + case STATE_GBA_STOP_FLASH_SEND_WIRELESS: + if (gSprites[sTradeAnim->connectionSpriteId2].animEnded) { - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_TGT1_OBJ | BLDCNT_EFFECT_BLEND | @@ -3958,307 +4030,305 @@ static bool8 AnimateTradeSequenceWireless(void) // Start wireless signal effect CreateTask(Task_AnimateWirelessSignal, 5); - sTradeData->state++; + sTradeAnim->state++; } break; - case TS_STATE_WAIT_WIRELESS_SIGNAL_SEND: + case STATE_WAIT_WIRELESS_SIGNAL_SEND: if (!FuncIsActiveTask(Task_AnimateWirelessSignal)) - sTradeData->state = TS_STATE_PAN_AWAY_GBA; + sTradeAnim->state = STATE_PAN_AWAY_GBA; break; - case TS_STATE_PAN_AWAY_GBA: - if (--sTradeData->bg1vofs == 316) - sTradeData->state++; + case STATE_PAN_AWAY_GBA: + if (--sTradeAnim->bg1vofs == 316) + sTradeAnim->state++; break; - case TS_STATE_CREATE_LINK_MON_LEAVING: - sTradeData->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonGlow, 120, 80, 3); - gSprites[sTradeData->connectionSpriteId1].callback = SpriteCB_LinkMonGlowWireless; - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 120, 80, 0); - StartSpriteAnim(&gSprites[sTradeData->connectionSpriteId2], ANIM_LINKMON_SMALL); - sTradeData->state++; + case STATE_CREATE_LINK_MON_LEAVING: + sTradeAnim->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonGlow, 120, 80, 3); + gSprites[sTradeAnim->connectionSpriteId1].callback = SpriteCB_LinkMonGlowWireless; + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 120, 80, 0); + StartSpriteAnim(&gSprites[sTradeAnim->connectionSpriteId2], ANIM_LINKMON_SMALL); + sTradeAnim->state++; break; - case TS_STATE_LINK_MON_TRAVEL_OUT: - if ((sTradeData->bg1vofs -= 3) == 166) - sTradeData->state = TS_STATE_LINK_MON_TRAVEL_OFFSCREEN; + case STATE_LINK_MON_TRAVEL_OUT: + if ((sTradeAnim->bg1vofs -= 3) == 166) + sTradeAnim->state = STATE_LINK_MON_TRAVEL_OFFSCREEN; SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_OBJ_ON); break; - case TS_STATE_LINK_MON_TRAVEL_OFFSCREEN: - gSprites[sTradeData->connectionSpriteId1].y -= 2; - gSprites[sTradeData->connectionSpriteId2].y -= 2; - if (gSprites[sTradeData->connectionSpriteId1].y < -8) - { - sTradeData->state = TS_STATE_FADE_OUT_TO_CROSSING; - } + case STATE_LINK_MON_TRAVEL_OFFSCREEN: + gSprites[sTradeAnim->connectionSpriteId1].y -= 2; + gSprites[sTradeAnim->connectionSpriteId2].y -= 2; + if (gSprites[sTradeAnim->connectionSpriteId1].y < -8) + sTradeAnim->state = STATE_FADE_OUT_TO_CROSSING; break; - case TS_STATE_FADE_OUT_TO_CROSSING: + case STATE_FADE_OUT_TO_CROSSING: BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); - sTradeData->state = TS_STATE_WAIT_FADE_OUT_TO_CROSSING; + sTradeAnim->state = STATE_WAIT_FADE_OUT_TO_CROSSING; break; - case TS_STATE_WAIT_FADE_OUT_TO_CROSSING: + case STATE_WAIT_FADE_OUT_TO_CROSSING: if (!gPaletteFade.active) { - DestroySprite(&gSprites[sTradeData->connectionSpriteId1]); - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId1]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); SetTradeSequenceBgGpuRegs(2); - sTradeData->state++; + sTradeAnim->state++; } break; - case TS_STATE_FADE_IN_TO_CROSSING: + case STATE_FADE_IN_TO_CROSSING: BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); - sTradeData->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 111, 170, 0); - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 129, -10, 0); - sTradeData->state++; + sTradeAnim->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 111, 170, 0); + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 129, -10, 0); + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_IN_TO_CROSSING: + case STATE_WAIT_FADE_IN_TO_CROSSING: if (!gPaletteFade.active) { PlaySE(SE_WARP_OUT); - sTradeData->state++; + sTradeAnim->state++; } - gSprites[sTradeData->connectionSpriteId1].y2 -= 3; - gSprites[sTradeData->connectionSpriteId2].y2 += 3; + gSprites[sTradeAnim->connectionSpriteId1].y2 -= 3; + gSprites[sTradeAnim->connectionSpriteId2].y2 += 3; break; - case TS_STATE_CROSSING_LINK_MONS_ENTER: - gSprites[sTradeData->connectionSpriteId1].y2 -= 3; - gSprites[sTradeData->connectionSpriteId2].y2 += 3; - if (gSprites[sTradeData->connectionSpriteId1].y2 <= -90) + case STATE_CROSSING_LINK_MONS_ENTER: + gSprites[sTradeAnim->connectionSpriteId1].y2 -= 3; + gSprites[sTradeAnim->connectionSpriteId2].y2 += 3; + if (gSprites[sTradeAnim->connectionSpriteId1].y2 <= -90) { - gSprites[sTradeData->connectionSpriteId1].data[1] = 1; - gSprites[sTradeData->connectionSpriteId2].data[1] = 1; - sTradeData->state++; - CreateTask(Task_NarrowWindowForCrossing_Wireless, 5); + gSprites[sTradeAnim->connectionSpriteId1].data[1] = 1; + gSprites[sTradeAnim->connectionSpriteId2].data[1] = 1; + sTradeAnim->state++; + CreateTask(Task_OpenCenterWhiteColumn, 5); } break; - case TS_STATE_CROSSING_BLEND_WHITE_1: + case STATE_CROSSING_BLEND_WHITE_1: BlendPalettes(0x8, 16, RGB_WHITEALPHA); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_CROSSING_BLEND_WHITE_2: + case STATE_CROSSING_BLEND_WHITE_2: BlendPalettes(0x8, 16, RGB_WHITEALPHA); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_CROSSING_BLEND_WHITE_3: + case STATE_CROSSING_BLEND_WHITE_3: BlendPalettes(0x8, 16, RGB_WHITEALPHA); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_CROSSING_CREATE_MON_PICS: - if (!IsMonSpriteNotFlipped(sTradeData->monSpecies[TRADE_PLAYER])) + case STATE_CROSSING_CREATE_MON_PICS: + if (!IsMonSpriteNotFlipped(sTradeAnim->monSpecies[TRADE_PLAYER])) { - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].affineAnims = sAffineAnims_CrossingMonPics; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].oam.affineMode = ST_OAM_AFFINE_DOUBLE; - CalcCenterToCornerVec(&gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]], SPRITE_SHAPE(64x64), SPRITE_SIZE(64x64), ST_OAM_AFFINE_DOUBLE); - StartSpriteAffineAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]], 0); + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].affineAnims = sAffineAnims_CrossingMonPics; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].oam.affineMode = ST_OAM_AFFINE_DOUBLE; + CalcCenterToCornerVec(&gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]], SPRITE_SHAPE(64x64), SPRITE_SIZE(64x64), ST_OAM_AFFINE_DOUBLE); + StartSpriteAffineAnim(&gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]], 0); } else { - StartSpriteAffineAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]], 0); + StartSpriteAffineAnim(&gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]], 0); } - StartSpriteAffineAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]], 0); - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].x = 40; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x = 200; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y = 192; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y = -32; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].invisible = FALSE; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].invisible = FALSE; - sTradeData->state++; + StartSpriteAffineAnim(&gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]], 0); + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].x = 40; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].x = 200; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y = 192; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].y = -32; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].invisible = FALSE; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].invisible = FALSE; + sTradeAnim->state++; break; - case TS_STATE_CROSSING_MON_PICS_MOVE: - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 -= 3; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y2 += 3; - if (gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 < -DISPLAY_HEIGHT - && gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 >= -DISPLAY_HEIGHT - 3) + case STATE_CROSSING_MON_PICS_MOVE: + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 -= 3; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].y2 += 3; + if (gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 < -DISPLAY_HEIGHT + && gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 >= -DISPLAY_HEIGHT - 3) { PlaySE(SE_WARP_IN); } - if (gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].y2 < -222) + if (gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].y2 < -222) { - gSprites[sTradeData->connectionSpriteId1].data[1] = 0; - gSprites[sTradeData->connectionSpriteId2].data[1] = 0; - sTradeData->state++; - gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]].invisible = TRUE; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].invisible = TRUE; - CreateTask(Task_NarrowWindowForCrossing_Cable, 5); + gSprites[sTradeAnim->connectionSpriteId1].data[1] = 0; + gSprites[sTradeAnim->connectionSpriteId2].data[1] = 0; + sTradeAnim->state++; + gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]].invisible = TRUE; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].invisible = TRUE; + CreateTask(Task_CloseCenterWhiteColumn, 5); } break; - case TS_STATE_CROSSING_LINK_MONS_EXIT: - gSprites[sTradeData->connectionSpriteId1].y2 -= 3; - gSprites[sTradeData->connectionSpriteId2].y2 += 3; - if (gSprites[sTradeData->connectionSpriteId1].y2 <= -222) + case STATE_CROSSING_LINK_MONS_EXIT: + gSprites[sTradeAnim->connectionSpriteId1].y2 -= 3; + gSprites[sTradeAnim->connectionSpriteId2].y2 += 3; + if (gSprites[sTradeAnim->connectionSpriteId1].y2 <= -222) { BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); - sTradeData->state++; - DestroySprite(&gSprites[sTradeData->connectionSpriteId1]); - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); + sTradeAnim->state++; + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId1]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); } break; - case TS_STATE_CREATE_LINK_MON_ARRIVING: + case STATE_CREATE_LINK_MON_ARRIVING: if (!gPaletteFade.active) { - sTradeData->state++; + sTradeAnim->state++; SetTradeSequenceBgGpuRegs(1); - sTradeData->bg1vofs = 166; + sTradeAnim->bg1vofs = 166; SetTradeSequenceBgGpuRegs(3); - sTradeData->bg2vofs = 412; - sTradeData->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonGlow, 120, -20, 3); - gSprites[sTradeData->connectionSpriteId1].callback = SpriteCB_LinkMonGlowWireless; - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 120, -20, 0); - StartSpriteAnim(&gSprites[sTradeData->connectionSpriteId2], ANIM_LINKMON_SMALL); + sTradeAnim->bg2vofs = 412; + sTradeAnim->connectionSpriteId1 = CreateSprite(&sSpriteTemplate_LinkMonGlow, 120, -20, 3); + gSprites[sTradeAnim->connectionSpriteId1].callback = SpriteCB_LinkMonGlowWireless; + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_LinkMonShadow, 120, -20, 0); + StartSpriteAnim(&gSprites[sTradeAnim->connectionSpriteId2], ANIM_LINKMON_SMALL); } break; - case TS_STATE_FADE_OUT_TO_GBA_RECV: + case STATE_FADE_OUT_TO_GBA_RECV: BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_OUT_TO_GBA_RECV: + case STATE_WAIT_FADE_OUT_TO_GBA_RECV: SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_OBJ_ON); if (!gPaletteFade.active) - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_LINK_MON_TRAVEL_IN: - gSprites[sTradeData->connectionSpriteId1].y2 += 4; - gSprites[sTradeData->connectionSpriteId2].y2 += 4; - if (gSprites[sTradeData->connectionSpriteId1].y2 + gSprites[sTradeData->connectionSpriteId1].y == 64) + case STATE_LINK_MON_TRAVEL_IN: + gSprites[sTradeAnim->connectionSpriteId1].y2 += 4; + gSprites[sTradeAnim->connectionSpriteId2].y2 += 4; + if (gSprites[sTradeAnim->connectionSpriteId1].y2 + gSprites[sTradeAnim->connectionSpriteId1].y == 64) { - sTradeData->state = TS_STATE_PAN_TO_GBA_WIRELESS; - sTradeData->timer = 0; + sTradeAnim->state = STATE_PAN_TO_GBA_WIRELESS; + sTradeAnim->timer = 0; } break; - case TS_STATE_PAN_TO_GBA_WIRELESS: + case STATE_PAN_TO_GBA_WIRELESS: SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_BG2_ON | DISPCNT_OBJ_ON); - sTradeData->bg1vofs += 3; - sTradeData->bg2vofs += 3; - if (++sTradeData->timer == 10) + sTradeAnim->bg1vofs += 3; + sTradeAnim->bg2vofs += 3; + if (++sTradeAnim->timer == 10) { u8 taskId = CreateTask(Task_AnimateWirelessSignal, 5); - gTasks[taskId].data[2] = TRUE; + gTasks[taskId].tSignalComingBack = TRUE; } - if (sTradeData->bg1vofs > 316) + if (sTradeAnim->bg1vofs > 316) { - sTradeData->bg1vofs = 316; - sTradeData->state++; + sTradeAnim->bg1vofs = 316; + sTradeAnim->state++; } break; - case TS_STATE_DESTROY_LINK_MON_WIRELESS: - DestroySprite(&gSprites[sTradeData->connectionSpriteId1]); - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); - sTradeData->state++; - sTradeData->timer = 0; + case STATE_DESTROY_LINK_MON_WIRELESS: + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId1]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); + sTradeAnim->state++; + sTradeAnim->timer = 0; break; - case TS_STATE_WAIT_WIRELESS_SIGNAL_RECV: + case STATE_WAIT_WIRELESS_SIGNAL_RECV: if (!FuncIsActiveTask(Task_AnimateWirelessSignal)) { - sTradeData->state = TS_STATE_LINK_MON_ARRIVED_DELAY; - sTradeData->timer = 0; + sTradeAnim->state = STATE_LINK_MON_ARRIVED_DELAY; + sTradeAnim->timer = 0; } break; - case TS_STATE_LINK_MON_ARRIVED_DELAY: - if (++sTradeData->timer == 10) - sTradeData->state++; + case STATE_LINK_MON_ARRIVED_DELAY: + if (++sTradeAnim->timer == 10) + sTradeAnim->state++; break; - case TS_STATE_MOVE_GBA_TO_CENTER: - if (++sTradeData->bg1vofs > 348) + case STATE_MOVE_GBA_TO_CENTER: + if (++sTradeAnim->bg1vofs > 348) { - sTradeData->bg1vofs = 348; - sTradeData->state++; + sTradeAnim->bg1vofs = 348; + sTradeAnim->state++; } break; - case TS_STATE_GBA_FLASH_RECV: - sTradeData->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_GbaScreenFlash_Long, 120, 80, 0); - sTradeData->state = TS_STATE_GBA_STOP_FLASH_RECV; + case STATE_GBA_FLASH_RECV: + sTradeAnim->connectionSpriteId2 = CreateSprite(&sSpriteTemplate_GbaScreenFlash_Long, 120, 80, 0); + sTradeAnim->state = STATE_GBA_STOP_FLASH_RECV; break; - case TS_STATE_GBA_STOP_FLASH_RECV: - if (gSprites[sTradeData->connectionSpriteId2].animEnded) + case STATE_GBA_STOP_FLASH_RECV: + if (gSprites[sTradeAnim->connectionSpriteId2].animEnded) { - DestroySprite(&gSprites[sTradeData->connectionSpriteId2]); + DestroySprite(&gSprites[sTradeAnim->connectionSpriteId2]); SetTradeSequenceBgGpuRegs(6); - sTradeData->state++; + sTradeAnim->state++; PlaySE(SE_M_SAND_ATTACK); } break; - case TS_STATE_GBA_ZOOM_IN: - if (sTradeData->gbaScale < 0x400) + case STATE_GBA_ZOOM_IN: + if (sTradeAnim->gbaScale < 0x400) { - sTradeData->gbaScale += 0x34; + sTradeAnim->gbaScale += 0x34; } else { - sTradeData->gbaScale = 0x400; - sTradeData->state++; + sTradeAnim->gbaScale = 0x400; + sTradeAnim->state++; } - sTradeData->sXY = 0x8000 / sTradeData->gbaScale; + sTradeAnim->sXY = 0x8000 / sTradeAnim->gbaScale; break; - case TS_STATE_FADE_OUT_TO_NEW_MON: + case STATE_FADE_OUT_TO_NEW_MON: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeData->state = TS_STATE_WAIT_FADE_OUT_TO_NEW_MON; + sTradeAnim->state = STATE_WAIT_FADE_OUT_TO_NEW_MON; break; - case TS_STATE_WAIT_FADE_OUT_TO_NEW_MON: + case STATE_WAIT_FADE_OUT_TO_NEW_MON: if (!gPaletteFade.active) { SetTradeSequenceBgGpuRegs(5); SetTradeSequenceBgGpuRegs(7); gPaletteFade.bufferTransferDisabled = TRUE; - sTradeData->state++; + sTradeAnim->state++; } break; - case TS_STATE_FADE_IN_TO_NEW_MON: + case STATE_FADE_IN_TO_NEW_MON: gPaletteFade.bufferTransferDisabled = FALSE; BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_IN_TO_NEW_MON: + case STATE_WAIT_FADE_IN_TO_NEW_MON: SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON); if (!gPaletteFade.active) - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_POKEBALL_ARRIVE: - sTradeData->bouncingPokeballSpriteId = CreateSprite(&sSpriteTemplate_Pokeball, 120, -8, 0); - gSprites[sTradeData->bouncingPokeballSpriteId].data[3] = 74; - gSprites[sTradeData->bouncingPokeballSpriteId].callback = SpriteCB_BouncingPokeballArrive; - StartSpriteAnim(&gSprites[sTradeData->bouncingPokeballSpriteId], 1); - StartSpriteAffineAnim(&gSprites[sTradeData->bouncingPokeballSpriteId], 2); - BlendPalettes(1 << (16 + gSprites[sTradeData->bouncingPokeballSpriteId].oam.paletteNum), 16, RGB_WHITEALPHA); - sTradeData->state++; - sTradeData->timer = 0; + case STATE_POKEBALL_ARRIVE: + sTradeAnim->bouncingPokeballSpriteId = CreateSprite(&sSpriteTemplate_Pokeball, 120, -8, 0); + gSprites[sTradeAnim->bouncingPokeballSpriteId].data[3] = 74; + gSprites[sTradeAnim->bouncingPokeballSpriteId].callback = SpriteCB_BouncingPokeballArrive; + StartSpriteAnim(&gSprites[sTradeAnim->bouncingPokeballSpriteId], 1); + StartSpriteAffineAnim(&gSprites[sTradeAnim->bouncingPokeballSpriteId], 2); + BlendPalettes(1 << (16 + gSprites[sTradeAnim->bouncingPokeballSpriteId].oam.paletteNum), 16, RGB_WHITEALPHA); + sTradeAnim->state++; + sTradeAnim->timer = 0; break; - case TS_STATE_FADE_POKEBALL_TO_NORMAL: - BeginNormalPaletteFade(1 << (16 + gSprites[sTradeData->bouncingPokeballSpriteId].oam.paletteNum), 1, 16, 0, RGB_WHITEALPHA); - sTradeData->state++; + case STATE_FADE_POKEBALL_TO_NORMAL: + BeginNormalPaletteFade(1 << (16 + gSprites[sTradeAnim->bouncingPokeballSpriteId].oam.paletteNum), 1, 16, 0, RGB_WHITEALPHA); + sTradeAnim->state++; break; - case TS_STATE_POKEBALL_ARRIVE_WAIT: - if (gSprites[sTradeData->bouncingPokeballSpriteId].callback == SpriteCallbackDummy) + case STATE_POKEBALL_ARRIVE_WAIT: + if (gSprites[sTradeAnim->bouncingPokeballSpriteId].callback == SpriteCallbackDummy) { HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT], - sTradeData->monSpecies[TRADE_PARTNER], - sTradeData->monPersonalities[TRADE_PARTNER]); - sTradeData->state++; + sTradeAnim->monSpecies[TRADE_PARTNER], + sTradeAnim->monPersonalities[TRADE_PARTNER]); + sTradeAnim->state++; } break; - case TS_STATE_SHOW_NEW_MON: - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x = 120; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y = gMonFrontPicCoords[sTradeData->monSpecies[TRADE_PARTNER]].y_offset + 60; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x2 = 0; - gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y2 = 0; - StartSpriteAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]], 0); - CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, PALETTES_BG | (0xF << 16), sTradeData->monSpecies[TRADE_PARTNER]); - FreeSpriteOamMatrix(&gSprites[sTradeData->bouncingPokeballSpriteId]); - DestroySprite(&gSprites[sTradeData->bouncingPokeballSpriteId]); - sTradeData->state++; + case STATE_SHOW_NEW_MON: + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].x = 120; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].y = gMonFrontPicCoords[sTradeAnim->monSpecies[TRADE_PARTNER]].y_offset + 60; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].x2 = 0; + gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].y2 = 0; + StartSpriteAnim(&gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]], 0); + CreatePokeballSpriteToReleaseMon(sTradeAnim->monSpriteIds[TRADE_PARTNER], gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, PALETTES_BG | (0xF << 16), sTradeAnim->monSpecies[TRADE_PARTNER]); + FreeSpriteOamMatrix(&gSprites[sTradeAnim->bouncingPokeballSpriteId]); + DestroySprite(&gSprites[sTradeAnim->bouncingPokeballSpriteId]); + sTradeAnim->state++; break; - case TS_STATE_NEW_MON_MSG: + case STATE_NEW_MON_MSG: SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | @@ -4266,76 +4336,70 @@ static bool8 AnimateTradeSequenceWireless(void) DISPCNT_OBJ_ON); StringExpandPlaceholders(gStringVar4, gText_XSentOverY); DrawTextOnTradeWindow(0, gStringVar4, 0); - sTradeData->state = TS_STATE_DELAY_FOR_MON_ANIM; - sTradeData->timer = 0; + sTradeAnim->state = STATE_DELAY_FOR_MON_ANIM; + sTradeAnim->timer = 0; break; - case TS_STATE_DELAY_FOR_MON_ANIM: - if (++sTradeData->timer > 60) + case STATE_DELAY_FOR_MON_ANIM: + if (++sTradeAnim->timer > 60) { - sTradeData->state = TS_STATE_WAIT_FOR_MON_CRY; - sTradeData->timer = 0; + sTradeAnim->state = STATE_WAIT_FOR_MON_CRY; + sTradeAnim->timer = 0; } break; - case TS_STATE_WAIT_FOR_MON_CRY: + case STATE_WAIT_FOR_MON_CRY: if (IsCryFinished()) - sTradeData->state = TS_STATE_TAKE_CARE_OF_MON; + sTradeAnim->state = STATE_TAKE_CARE_OF_MON; break; - case TS_STATE_TAKE_CARE_OF_MON: - if (++sTradeData->timer == 10) + case STATE_TAKE_CARE_OF_MON: + if (++sTradeAnim->timer == 10) PlayFanfare(MUS_EVOLVED); - if (sTradeData->timer == 250) + if (sTradeAnim->timer == 250) { - sTradeData->state++; + sTradeAnim->state++; StringExpandPlaceholders(gStringVar4, gText_TakeGoodCareOfX); DrawTextOnTradeWindow(0, gStringVar4, 0); - sTradeData->timer = 0; + sTradeAnim->timer = 0; } break; - case TS_STATE_AFTER_NEW_MON_DELAY: - if (++sTradeData->timer == 60) - sTradeData->state++; + case STATE_AFTER_NEW_MON_DELAY: + if (++sTradeAnim->timer == 60) + sTradeAnim->state++; break; - case TS_STATE_CHECK_RIBBONS: + case STATE_CHECK_RIBBONS: CheckPartnersMonForRibbons(); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_END_LINK_TRADE: - if (sTradeData->isLinkTrade) - { + case STATE_END_LINK_TRADE: + if (sTradeAnim->isLinkTrade) return TRUE; - } else if (JOY_NEW(A_BUTTON)) - { - sTradeData->state++; - } + sTradeAnim->state++; break; - case TS_STATE_TRY_EVOLUTION: // Only if in-game trade, link trades use CB2_TryLinkTradeEvolution + case STATE_TRY_EVOLUTION: // Only if in-game trade, link trades use CB2_TryLinkTradeEvolution TradeMons(gSpecialVar_0x8005, 0); - gCB2_AfterEvolution = CB2_UpdateInGameTrade; + gCB2_AfterEvolution = CB2_InGameTrade; evoTarget = GetEvolutionTargetSpecies(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], EVO_MODE_TRADE, ITEM_NONE, &gPlayerParty[gSelectedTradeMonPositions[TRADE_PARTNER]]); if (evoTarget != SPECIES_NONE) - { - TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], evoTarget, sTradeData->monSpriteIds[TRADE_PARTNER], gSelectedTradeMonPositions[TRADE_PLAYER]); - } - sTradeData->state++; + TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], evoTarget, sTradeAnim->monSpriteIds[TRADE_PARTNER], gSelectedTradeMonPositions[TRADE_PLAYER]); + sTradeAnim->state++; break; - case TS_STATE_FADE_OUT_END: + case STATE_FADE_OUT_END: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sTradeData->state++; + sTradeAnim->state++; break; - case TS_STATE_WAIT_FADE_OUT_END: + case STATE_WAIT_FADE_OUT_END: if (!gPaletteFade.active) { - PlayNewMapMusic(sTradeData->cachedMapMusic); - if (sTradeData) + PlayNewMapMusic(sTradeAnim->cachedMapMusic); + if (sTradeAnim) { FreeAllWindowBuffers(); Free(GetBgTilemapBuffer(3)); Free(GetBgTilemapBuffer(1)); Free(GetBgTilemapBuffer(0)); FreeMonSpritesGfx(); - FREE_AND_SET_NULL(sTradeData); + FREE_AND_SET_NULL(sTradeAnim); } SetMainCallback2(CB2_ReturnToField); BufferInGameTradeMonName(); @@ -4346,7 +4410,7 @@ static bool8 AnimateTradeSequenceWireless(void) } // Try to evolve a Pokémon received in a link trade -// In-game trades resolve evolution during the trade sequence, in TS_STATE_TRY_EVOLUTION +// In-game trades resolve evolution during the trade sequence, in STATE_TRY_EVOLUTION static void CB2_TryLinkTradeEvolution(void) { u16 evoTarget; @@ -4360,7 +4424,7 @@ static void CB2_TryLinkTradeEvolution(void) gCB2_AfterEvolution = CB2_SaveAndEndTrade; evoTarget = GetEvolutionTargetSpecies(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], EVO_MODE_TRADE, ITEM_NONE, &gPlayerParty[gSelectedTradeMonPositions[TRADE_PARTNER]]); if (evoTarget != SPECIES_NONE) - TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], evoTarget, sTradeData->monSpriteIds[TRADE_PARTNER], gSelectedTradeMonPositions[TRADE_PLAYER]); + TradeEvolutionScene(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], evoTarget, sTradeAnim->monSpriteIds[TRADE_PARTNER], gSelectedTradeMonPositions[TRADE_PLAYER]); else if (IsWirelessTrade()) SetMainCallback2(CB2_SaveAndEndWirelessTrade); else @@ -4375,25 +4439,25 @@ static void CB2_TryLinkTradeEvolution(void) UpdatePaletteFade(); } -static void UpdateTradeFinishFlags(void) +static void HandleLinkDataReceive(void) { - u8 blockReceivedStatus; + u8 recvStatus; TradeGetMultiplayerId(); // no effect call, ret val ignored - blockReceivedStatus = GetBlockReceivedStatus(); - if (blockReceivedStatus & 0x01) + recvStatus = GetBlockReceivedStatus(); + if (recvStatus & (1 << 0)) { if (gBlockRecvBuffer[0][0] == LINKCMD_CONFIRM_FINISH_TRADE) SetMainCallback2(CB2_TryLinkTradeEvolution); if (gBlockRecvBuffer[0][0] == LINKCMD_READY_FINISH_TRADE) - sTradeData->playerLinkFlagFinishTrade = READY_FINISH_TRADE; + sTradeAnim->playerFinishStatus = STATUS_READY; ResetBlockReceivedFlag(0); } - if (blockReceivedStatus & 0x02) + if (recvStatus & (1 << 1)) { if (gBlockRecvBuffer[1][0] == LINKCMD_READY_FINISH_TRADE) - sTradeData->partnerLinkFlagFinishTrade = READY_FINISH_TRADE; + sTradeAnim->partnerFinishStatus = STATUS_READY; ResetBlockReceivedFlag(1); } @@ -4444,7 +4508,7 @@ static void SpriteCB_BouncingPokeballDepartEnd(struct Sprite *sprite) if (++ sprite->data[0] == 23) { DestroySprite(sprite); - sTradeData->state = TS_STATE_FADE_OUT_TO_GBA_SEND; // Resume the master trade animation + sTradeAnim->state = STATE_FADE_OUT_TO_GBA_SEND; // Resume the master trade animation } } } @@ -4491,14 +4555,14 @@ static void BufferInGameTradeMonName(void) StringCopy(gStringVar2, gSpeciesNames[inGameTrade->species]); } -static void _CreateInGameTradePokemon(u8 whichPlayerMon, u8 whichInGameTrade) +static void CreateInGameTradePokemonInternal(u8 whichPlayerMon, u8 whichInGameTrade) { const struct InGameTrade *inGameTrade = &sIngameTrades[whichInGameTrade]; u8 level = GetMonData(&gPlayerParty[whichPlayerMon], MON_DATA_LEVEL); struct Mail mail; u8 metLocation = METLOC_IN_GAME_TRADE; - u8 isMail; + u8 mailNum; struct Pokemon *pokemon = &gEnemyParty[0]; CreateMon(pokemon, inGameTrade->species, level, USE_RANDOM_IVS, TRUE, inGameTrade->personality, OT_ID_PRESET, inGameTrade->otId); @@ -4521,14 +4585,14 @@ static void _CreateInGameTradePokemon(u8 whichPlayerMon, u8 whichInGameTrade) SetMonData(pokemon, MON_DATA_SHEEN, &inGameTrade->sheen); SetMonData(pokemon, MON_DATA_MET_LOCATION, &metLocation); - isMail = FALSE; + mailNum = 0; if (inGameTrade->heldItem != ITEM_NONE) { if (ItemIsMail(inGameTrade->heldItem)) { - SetInGameTradeMail(&mail, inGameTrade); + GetInGameTradeMail(&mail, inGameTrade); gTradeMail[0] = mail; - SetMonData(pokemon, MON_DATA_MAIL, &isMail); + SetMonData(pokemon, MON_DATA_MAIL, &mailNum); SetMonData(pokemon, MON_DATA_HELD_ITEM, &inGameTrade->heldItem); } else @@ -4539,14 +4603,12 @@ static void _CreateInGameTradePokemon(u8 whichPlayerMon, u8 whichInGameTrade) CalculateMonStats(&gEnemyParty[0]); } -static void SetInGameTradeMail(struct Mail *mail, const struct InGameTrade *trade) +static void GetInGameTradeMail(struct Mail *mail, const struct InGameTrade *trade) { s32 i; for (i = 0; i < MAIL_WORDS_COUNT; i++) - { mail->words[i] = sIngameTradeMail[trade->mailNum][i]; - } StringCopy(mail->playerName, trade->otName); PadNameString(mail->playerName, CHAR_SPACE); @@ -4568,25 +4630,25 @@ u16 GetTradeSpecies(void) void CreateInGameTradePokemon(void) { - _CreateInGameTradePokemon(gSpecialVar_0x8005, gSpecialVar_0x8004); + CreateInGameTradePokemonInternal(gSpecialVar_0x8005, gSpecialVar_0x8004); } static void CB2_UpdateLinkTrade(void) { - if (AnimateTradeSequence() == TRUE) + if (DoTradeAnim() == TRUE) { - DestroySprite(&gSprites[sTradeData->monSpriteIds[TRADE_PLAYER]]); - FreeSpriteOamMatrix(&gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]]); + DestroySprite(&gSprites[sTradeAnim->monSpriteIds[TRADE_PLAYER]]); + FreeSpriteOamMatrix(&gSprites[sTradeAnim->monSpriteIds[TRADE_PARTNER]]); TradeMons(gSelectedTradeMonPositions[TRADE_PLAYER], gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE); if (!IsWirelessTrade()) { - sTradeData->linkData[0] = LINKCMD_READY_FINISH_TRADE; - sTradeData->sendTradeFinishState = 1; + sTradeAnim->linkData[0] = LINKCMD_READY_FINISH_TRADE; + sTradeAnim->scheduleLinkTransfer = 1; } - SetMainCallback2(CB2_TryFinishTrade); + SetMainCallback2(CB2_WaitTradeComplete); } - TrySendTradeFinishData(); - UpdateTradeFinishFlags(); + HandleLinkDataSend(); + HandleLinkDataReceive(); RunTasks(); RunTextPrinters(); AnimateSprites(); @@ -4594,7 +4656,7 @@ static void CB2_UpdateLinkTrade(void) UpdatePaletteFade(); } -static void CB2_TryFinishTrade(void) +static void CB2_WaitTradeComplete(void) { u8 mpId = TradeGetMultiplayerId(); if (IsWirelessTrade()) @@ -4603,15 +4665,15 @@ static void CB2_TryFinishTrade(void) } else { - UpdateTradeFinishFlags(); + HandleLinkDataReceive(); if (mpId == 0 - && sTradeData->playerLinkFlagFinishTrade == READY_FINISH_TRADE - && sTradeData->partnerLinkFlagFinishTrade == READY_FINISH_TRADE) + && sTradeAnim->playerFinishStatus == STATUS_READY + && sTradeAnim->partnerFinishStatus == STATUS_READY) { - sTradeData->linkData[0] = LINKCMD_CONFIRM_FINISH_TRADE; - SendBlock(BitmaskAllOtherLinkPlayers(), sTradeData->linkData, sizeof(sTradeData->linkData)); - sTradeData->playerLinkFlagFinishTrade = FINISH_TRADE; - sTradeData->partnerLinkFlagFinishTrade = FINISH_TRADE; + sTradeAnim->linkData[0] = LINKCMD_CONFIRM_FINISH_TRADE; + SendBlock(BitmaskAllOtherLinkPlayers(), sTradeAnim->linkData, sizeof(sTradeAnim->linkData)); + sTradeAnim->playerFinishStatus = STATUS_CANCEL; + sTradeAnim->partnerFinishStatus = STATUS_CANCEL; } } RunTasks(); @@ -4632,24 +4694,20 @@ static void CB2_SaveAndEndTrade(void) case 1: SetTradeLinkStandbyCallback(0); gMain.state = 100; - sTradeData->timer = 0; + sTradeAnim->timer = 0; break; case 100: - if (++sTradeData->timer > 180) + if (++sTradeAnim->timer > 180) { gMain.state = 101; - sTradeData->timer = 0; + sTradeAnim->timer = 0; } if (_IsLinkTaskFinished()) - { gMain.state = 2; - } break; case 101: if (_IsLinkTaskFinished()) - { gMain.state = 2; - } break; case 2: gMain.state = 50; @@ -4665,10 +4723,10 @@ static void CB2_SaveAndEndTrade(void) SetContinueGameWarpStatusToDynamicWarp(); LinkFullSave_Init(); gMain.state++; - sTradeData->timer = 0; + sTradeAnim->timer = 0; break; case 51: - if (++sTradeData->timer == 5) + if (++sTradeAnim->timer == 5) gMain.state++; break; case 52: @@ -4680,38 +4738,34 @@ static void CB2_SaveAndEndTrade(void) else { // Save isn't finished, delay again - sTradeData->timer = 0; + sTradeAnim->timer = 0; gMain.state = 51; } break; case 4: LinkFullSave_ReplaceLastSector(); gMain.state = 40; - sTradeData->timer = 0; + sTradeAnim->timer = 0; break; case 40: - if (++sTradeData->timer > 50) + if (++sTradeAnim->timer > 50) { if (GetMultiplayerId() == 0) - { - sTradeData->timer = Random() % 30; - } + sTradeAnim->timer = Random() % 30; else - { - sTradeData->timer = 0; - } + sTradeAnim->timer = 0; gMain.state = 41; } break; case 41: - if (sTradeData->timer == 0) + if (sTradeAnim->timer == 0) { SetTradeLinkStandbyCallback(1); gMain.state = 42; } else { - sTradeData->timer--; + sTradeAnim->timer--; } break; case 42: @@ -4722,7 +4776,7 @@ static void CB2_SaveAndEndTrade(void) } break; case 5: - if (++sTradeData->timer > 60) + if (++sTradeAnim->timer > 60) { gMain.state++; SetTradeLinkStandbyCallback(2); @@ -4746,13 +4800,9 @@ static void CB2_SaveAndEndTrade(void) if (IsBGMStopped() == TRUE) { if (gWirelessCommType && gMain.savedCallback == CB2_StartCreateTradeMenu) - { SetTradeLinkStandbyCallback(3); - } else - { SetCloseLinkCallback(); - } gMain.state++; } break; @@ -4762,13 +4812,13 @@ static void CB2_SaveAndEndTrade(void) if (_IsLinkTaskFinished()) { gSoftResetDisabled = FALSE; - SetMainCallback2(CB2_FreeTradeData); + SetMainCallback2(CB2_FreeTradeAnim); } } else if (!gReceivedRemoteLinkPlayers) { gSoftResetDisabled = FALSE; - SetMainCallback2(CB2_FreeTradeData); + SetMainCallback2(CB2_FreeTradeAnim); } break; } @@ -4781,7 +4831,7 @@ static void CB2_SaveAndEndTrade(void) UpdatePaletteFade(); } -static void CB2_FreeTradeData(void) +static void CB2_FreeTradeAnim(void) { if (!gPaletteFade.active) { @@ -4790,7 +4840,7 @@ static void CB2_FreeTradeData(void) Free(GetBgTilemapBuffer(1)); Free(GetBgTilemapBuffer(0)); FreeMonSpritesGfx(); - FREE_AND_SET_NULL(sTradeData); + FREE_AND_SET_NULL(sTradeAnim); if (gWirelessCommType) DestroyWirelessStatusIndicatorSprite(); SetMainCallback2(gMain.savedCallback); @@ -4812,7 +4862,7 @@ static void Task_InGameTrade(u8 taskId) { if (!gPaletteFade.active) { - SetMainCallback2(CB2_InGameTrade); + SetMainCallback2(CB2_InitInGameTrade); gFieldCallback = FieldCB_ContinueScriptHandleMusic; DestroyTask(taskId); } @@ -4822,40 +4872,35 @@ static void CheckPartnersMonForRibbons(void) { u8 i; u8 numRibbons = 0; - for (i = 0; i < (MON_DATA_UNUSED_RIBBONS - MON_DATA_CHAMPION_RIBBON); i ++) - { + for (i = 0; i < (MON_DATA_UNUSED_RIBBONS - MON_DATA_CHAMPION_RIBBON); i++) numRibbons += GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_CHAMPION_RIBBON + i); - } + if (numRibbons != 0) FlagSet(FLAG_SYS_RIBBON_GET); } void LoadTradeAnimGfx(void) { - InitTradeBgInternal(); + TradeAnimInit_LoadGfx(); } void DrawTextOnTradeWindow(u8 windowId, const u8 *str, u8 speed) { FillWindowPixelBuffer(windowId, PIXEL_FILL(15)); - sTradeData->textColors[0] = TEXT_DYNAMIC_COLOR_6; - sTradeData->textColors[1] = TEXT_COLOR_WHITE; - sTradeData->textColors[2] = TEXT_COLOR_GREEN; - AddTextPrinterParameterized4(windowId, FONT_NORMAL, 0, 2, 0, 0, sTradeData->textColors, speed, str); + sTradeAnim->textColors[0] = TEXT_DYNAMIC_COLOR_6; + sTradeAnim->textColors[1] = TEXT_COLOR_WHITE; + sTradeAnim->textColors[2] = TEXT_COLOR_GREEN; + AddTextPrinterParameterized4(windowId, FONT_NORMAL, 0, 2, 0, 0, sTradeAnim->textColors, speed, str); CopyWindowToVram(windowId, COPYWIN_FULL); } -#define idx data[0] -#define counter data[1] -#define signalComingBack data[2] - static void Task_AnimateWirelessSignal(u8 taskId) { s16 *data = gTasks[taskId].data; - u16 paletteIdx = sWirelessSignalTiming[idx][0] * 16; + u16 paletteIdx = sWirelessSignalAnimParams[tIdx][0] * 16; - if (!signalComingBack) + if (!tSignalComingBack) { if (paletteIdx == 256) LoadPalette(sWirelessSignalNone_Pal, BG_PLTT_ID(3), PLTT_SIZE_4BPP); @@ -4870,37 +4915,37 @@ static void Task_AnimateWirelessSignal(u8 taskId) LoadPalette(&sWirelessSignalRecv_Pal[paletteIdx], BG_PLTT_ID(3), PLTT_SIZE_4BPP); } - if (sWirelessSignalTiming[idx][0] == 0 && counter == 0) + if (sWirelessSignalAnimParams[tIdx][0] == 0 && tCounter == 0) PlaySE(SE_M_HEAL_BELL); - if (counter == sWirelessSignalTiming[idx][1]) + if (tCounter == sWirelessSignalAnimParams[tIdx][1]) { - idx++; - counter = 0; - if (sWirelessSignalTiming[idx][1] == 0xFF) + tIdx++; + tCounter = 0; + if (sWirelessSignalAnimParams[tIdx][1] == 0xFF) { DestroyTask(taskId); } } else { - counter++; + tCounter++; } } -#undef idx -#undef counter -#undef signalComingBack +#undef tIdx +#undef tCounter +#undef tSignalComingBack -static void Task_NarrowWindowForCrossing_Wireless(u8 taskId) +static void Task_OpenCenterWhiteColumn(u8 taskId) { s16 *data = gTasks[taskId].data; if (data[0] == 0) { - sTradeData->wirelessWinLeft = sTradeData->wirelessWinRight = DISPLAY_WIDTH / 2; - sTradeData->wirelessWinTop = 0; - sTradeData->wirelessWinBottom = DISPLAY_HEIGHT; + sTradeAnim->wirelessWinLeft = sTradeAnim->wirelessWinRight = DISPLAY_WIDTH / 2; + sTradeAnim->wirelessWinTop = 0; + sTradeAnim->wirelessWinBottom = DISPLAY_HEIGHT; SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_OBJ); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG0 | @@ -4908,41 +4953,41 @@ static void Task_NarrowWindowForCrossing_Wireless(u8 taskId) WININ_WIN0_OBJ); } - SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE2(sTradeData->wirelessWinLeft, sTradeData->wirelessWinRight)); - SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE2(sTradeData->wirelessWinTop, sTradeData->wirelessWinBottom)); + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE2(sTradeAnim->wirelessWinLeft, sTradeAnim->wirelessWinRight)); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE2(sTradeAnim->wirelessWinTop, sTradeAnim->wirelessWinBottom)); data[0]++; - sTradeData->wirelessWinLeft -= 5; - sTradeData->wirelessWinRight += 5; + sTradeAnim->wirelessWinLeft -= 5; + sTradeAnim->wirelessWinRight += 5; - if (sTradeData->wirelessWinLeft < 80) + if (sTradeAnim->wirelessWinLeft < 80) DestroyTask(taskId); } -static void Task_NarrowWindowForCrossing_Cable(u8 taskId) +static void Task_CloseCenterWhiteColumn(u8 taskId) { s16 *data = gTasks[taskId].data; if (data[0] == 0) { - sTradeData->wirelessWinLeft = 80; - sTradeData->wirelessWinRight = DISPLAY_WIDTH - 80; + sTradeAnim->wirelessWinLeft = 80; + sTradeAnim->wirelessWinRight = DISPLAY_WIDTH - 80; SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_OBJ); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_OBJ); } - SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE2(sTradeData->wirelessWinLeft, sTradeData->wirelessWinRight)); - SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE2(sTradeData->wirelessWinTop, sTradeData->wirelessWinBottom)); + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE2(sTradeAnim->wirelessWinLeft, sTradeAnim->wirelessWinRight)); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE2(sTradeAnim->wirelessWinTop, sTradeAnim->wirelessWinBottom)); - if (sTradeData->wirelessWinLeft != DISPLAY_WIDTH / 2) + if (sTradeAnim->wirelessWinLeft != DISPLAY_WIDTH / 2) { data[0]++; - sTradeData->wirelessWinLeft += 5; - sTradeData->wirelessWinRight -= 5; + sTradeAnim->wirelessWinLeft += 5; + sTradeAnim->wirelessWinRight -= 5; - if (sTradeData->wirelessWinLeft > DISPLAY_WIDTH / 2 - 5) + if (sTradeAnim->wirelessWinLeft > DISPLAY_WIDTH / 2 - 5) BlendPalettes(0x8, 0, RGB_WHITEALPHA); } else @@ -4964,7 +5009,7 @@ static void CB2_SaveAndEndWirelessTrade(void) case 1: SetTradeLinkStandbyCallback(0); gMain.state = 2; - sTradeData->timer = 0; + sTradeAnim->timer = 0; break; case 2: if (_IsLinkTaskFinished()) @@ -4974,11 +5019,11 @@ static void CB2_SaveAndEndWirelessTrade(void) DrawTextOnTradeWindow(0, gStringVar4, 0); IncrementGameStat(GAME_STAT_POKEMON_TRADES); LinkFullSave_Init(); - sTradeData->timer = 0; + sTradeAnim->timer = 0; } break; case 3: - if (++sTradeData->timer == 5) + if (++sTradeAnim->timer == 5) gMain.state = 4; break; case 4: @@ -4988,34 +5033,34 @@ static void CB2_SaveAndEndWirelessTrade(void) } else { - sTradeData->timer = 0; + sTradeAnim->timer = 0; gMain.state = 3; } break; case 5: LinkFullSave_ReplaceLastSector(); gMain.state = 6; - sTradeData->timer = 0; + sTradeAnim->timer = 0; break; case 6: - if (++sTradeData->timer > 10) + if (++sTradeAnim->timer > 10) { if (GetMultiplayerId() == 0) - sTradeData->timer = Random() % 30; + sTradeAnim->timer = Random() % 30; else - sTradeData->timer = 0; + sTradeAnim->timer = 0; gMain.state = 7; } break; case 7: - if (sTradeData->timer == 0) + if (sTradeAnim->timer == 0) { SetTradeLinkStandbyCallback(1); gMain.state = 8; } else { - sTradeData->timer--; + sTradeAnim->timer--; } break; case 8: @@ -5026,7 +5071,7 @@ static void CB2_SaveAndEndWirelessTrade(void) } break; case 9: - if (++sTradeData->timer > 60) + if (++sTradeAnim->timer > 60) { gMain.state++; SetTradeLinkStandbyCallback(2); @@ -5051,7 +5096,7 @@ static void CB2_SaveAndEndWirelessTrade(void) if (_IsLinkTaskFinished()) { gSoftResetDisabled = FALSE; - SetMainCallback2(CB2_FreeTradeData); + SetMainCallback2(CB2_FreeTradeAnim); } break; } diff --git a/src/trainer_card.c b/src/trainer_card.c index 4da1d938a..1535c3d99 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -33,6 +33,12 @@ #include "constants/trainers.h" #include "constants/union_room.h" +enum { + WIN_MSG, + WIN_CARD_TEXT, + WIN_TRAINER_PIC, +}; + struct TrainerCardData { u8 mainState; @@ -226,7 +232,7 @@ static const struct BgTemplate sTrainerCardBgTemplates[4] = static const struct WindowTemplate sTrainerCardWindowTemplates[] = { - { + [WIN_MSG] = { .bg = 1, .tilemapLeft = 2, .tilemapTop = 15, @@ -235,7 +241,7 @@ static const struct WindowTemplate sTrainerCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x253, }, - { + [WIN_CARD_TEXT] = { .bg = 1, .tilemapLeft = 1, .tilemapTop = 1, @@ -244,7 +250,7 @@ static const struct WindowTemplate sTrainerCardWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x1, }, - { + [WIN_TRAINER_PIC] = { .bg = 3, .tilemapLeft = 19, .tilemapTop = 5, @@ -376,7 +382,7 @@ static void Task_TrainerCard(u8 taskId) case 0: if (!IsDma3ManagerBusyWithBgCopy()) { - FillWindowPixelBuffer(1, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_CARD_TEXT, PIXEL_FILL(0)); sData->mainState++; } break; @@ -385,13 +391,13 @@ static void Task_TrainerCard(u8 taskId) sData->mainState++; break; case 2: - DrawTrainerCardWindow(1); + DrawTrainerCardWindow(WIN_CARD_TEXT); sData->mainState++; break; case 3: - FillWindowPixelBuffer(2, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_TRAINER_PIC, PIXEL_FILL(0)); CreateTrainerCardTrainerPic(); - DrawTrainerCardWindow(2); + DrawTrainerCardWindow(WIN_TRAINER_PIC); sData->mainState++; break; case 4: @@ -411,7 +417,7 @@ static void Task_TrainerCard(u8 taskId) if (gWirelessCommType == 1 && gReceivedRemoteLinkPlayers == TRUE) { LoadWirelessStatusIndicatorSpriteGfx(); - CreateWirelessStatusIndicatorSprite(230, 150); + CreateWirelessStatusIndicatorSprite(DISPLAY_WIDTH - 10, DISPLAY_HEIGHT - 10); } BlendPalettes(PALETTES_ALL, 16, sData->blendColor); BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, sData->blendColor); @@ -434,7 +440,7 @@ static void Task_TrainerCard(u8 taskId) if (!gReceivedRemoteLinkPlayers && sData->timeColonNeedDraw) { PrintTimeOnCard(); - DrawTrainerCardWindow(1); + DrawTrainerCardWindow(WIN_CARD_TEXT); sData->timeColonNeedDraw = FALSE; } if (JOY_NEW(A_BUTTON)) @@ -497,9 +503,9 @@ static void Task_TrainerCard(u8 taskId) break; case STATE_WAIT_LINK_PARTNER: SetCloseLinkCallback(); - DrawDialogueFrame(0, TRUE); - AddTextPrinterParameterized(0, FONT_NORMAL, gText_WaitingTrainerFinishReading, 0, 1, 255, 0); - CopyWindowToVram(0, COPYWIN_FULL); + DrawDialogueFrame(WIN_MSG, TRUE); + AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_WaitingTrainerFinishReading, 0, 1, 255, 0); + CopyWindowToVram(WIN_MSG, COPYWIN_FULL); sData->mainState = STATE_CLOSE_CARD_LINK; break; case STATE_CLOSE_CARD_LINK: @@ -1002,9 +1008,9 @@ static void PrintNameOnCardFront(void) StringCopy(txtPtr, sData->trainerCard.playerName); ConvertInternationalString(txtPtr, sData->language); if (sData->cardType == CARD_TYPE_FRLG) - AddTextPrinterParameterized3(1, FONT_NORMAL, 20, 28, sTrainerCardTextColors, TEXT_SKIP_DRAW, buffer); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 20, 28, sTrainerCardTextColors, TEXT_SKIP_DRAW, buffer); else - AddTextPrinterParameterized3(1, FONT_NORMAL, 16, 33, sTrainerCardTextColors, TEXT_SKIP_DRAW, buffer); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 16, 33, sTrainerCardTextColors, TEXT_SKIP_DRAW, buffer); } static void PrintIdOnCard(void) @@ -1026,7 +1032,7 @@ static void PrintIdOnCard(void) top = 9; } - AddTextPrinterParameterized3(1, FONT_NORMAL, xPos, top, sTrainerCardTextColors, TEXT_SKIP_DRAW, buffer); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, xPos, top, sTrainerCardTextColors, TEXT_SKIP_DRAW, buffer); } static void PrintMoneyOnCard(void) @@ -1035,9 +1041,9 @@ static void PrintMoneyOnCard(void) u8 top; if (!sData->isHoenn) - AddTextPrinterParameterized3(1, FONT_NORMAL, 20, 56, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardMoney); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 20, 56, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardMoney); else - AddTextPrinterParameterized3(1, FONT_NORMAL, 16, 57, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardMoney); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 16, 57, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardMoney); ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.money, STR_CONV_MODE_LEFT_ALIGN, 6); StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1); @@ -1051,7 +1057,7 @@ static void PrintMoneyOnCard(void) xOffset = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 128); top = 57; } - AddTextPrinterParameterized3(1, FONT_NORMAL, xOffset, top, sTrainerCardTextColors, TEXT_SKIP_DRAW, gStringVar4); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, xOffset, top, sTrainerCardTextColors, TEXT_SKIP_DRAW, gStringVar4); } static u16 GetCaughtMonsCount(void) @@ -1069,9 +1075,9 @@ static void PrintPokedexOnCard(void) if (FlagGet(FLAG_SYS_POKEDEX_GET)) { if (!sData->isHoenn) - AddTextPrinterParameterized3(1, FONT_NORMAL, 20, 72, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardPokedex); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 20, 72, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardPokedex); else - AddTextPrinterParameterized3(1, FONT_NORMAL, 16, 73, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardPokedex); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 16, 73, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardPokedex); StringCopy(ConvertIntToDecimalStringN(gStringVar4, sData->trainerCard.caughtMonsCount, STR_CONV_MODE_LEFT_ALIGN, 3), gText_EmptyString6); if (!sData->isHoenn) { @@ -1083,7 +1089,7 @@ static void PrintPokedexOnCard(void) xOffset = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 128); top = 73; } - AddTextPrinterParameterized3(1, FONT_NORMAL, xOffset, top, sTrainerCardTextColors, TEXT_SKIP_DRAW, gStringVar4); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, xOffset, top, sTrainerCardTextColors, TEXT_SKIP_DRAW, gStringVar4); } } @@ -1097,9 +1103,9 @@ static void PrintTimeOnCard(void) u32 x, y, totalWidth; if (!sData->isHoenn) - AddTextPrinterParameterized3(1, FONT_NORMAL, 20, 88, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardTime); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 20, 88, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardTime); else - AddTextPrinterParameterized3(1, FONT_NORMAL, 16, 89, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardTime); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 16, 89, sTrainerCardTextColors, TEXT_SKIP_DRAW, gText_TrainerCardTime); if (sData->isLink) { @@ -1131,14 +1137,14 @@ static void PrintTimeOnCard(void) totalWidth = width + 30; x -= totalWidth; - FillWindowPixelRect(1, PIXEL_FILL(0), x, y, totalWidth, 15); + FillWindowPixelRect(WIN_CARD_TEXT, PIXEL_FILL(0), x, y, totalWidth, 15); ConvertIntToDecimalStringN(gStringVar4, hours, STR_CONV_MODE_RIGHT_ALIGN, 3); - AddTextPrinterParameterized3(1, FONT_NORMAL, x, y, sTrainerCardTextColors, TEXT_SKIP_DRAW, gStringVar4); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, x, y, sTrainerCardTextColors, TEXT_SKIP_DRAW, gStringVar4); x += 18; - AddTextPrinterParameterized3(1, FONT_NORMAL, x, y, sTimeColonTextColors[sData->timeColonInvisible], TEXT_SKIP_DRAW, gText_Colon2); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, x, y, sTimeColonTextColors[sData->timeColonInvisible], TEXT_SKIP_DRAW, gText_Colon2); x += width; ConvertIntToDecimalStringN(gStringVar4, minutes, STR_CONV_MODE_LEADING_ZEROS, 2); - AddTextPrinterParameterized3(1, FONT_NORMAL, x, y, sTrainerCardTextColors, TEXT_SKIP_DRAW, gStringVar4); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, x, y, sTrainerCardTextColors, TEXT_SKIP_DRAW, gStringVar4); } static void PrintProfilePhraseOnCard(void) @@ -1148,10 +1154,10 @@ static void PrintProfilePhraseOnCard(void) if (sData->isLink) { - AddTextPrinterParameterized3(1, FONT_NORMAL, 8, yOffsetsLine1[sData->isHoenn], sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->easyChatProfile[0]); - AddTextPrinterParameterized3(1, FONT_NORMAL, GetStringWidth(FONT_NORMAL, sData->easyChatProfile[0], 0) + 14, yOffsetsLine1[sData->isHoenn], sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->easyChatProfile[1]); - AddTextPrinterParameterized3(1, FONT_NORMAL, 8, yOffsetsLine2[sData->isHoenn], sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->easyChatProfile[2]); - AddTextPrinterParameterized3(1, FONT_NORMAL, GetStringWidth(FONT_NORMAL, sData->easyChatProfile[2], 0) + 14, yOffsetsLine2[sData->isHoenn], sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->easyChatProfile[3]); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 8, yOffsetsLine1[sData->isHoenn], sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->easyChatProfile[0]); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, GetStringWidth(FONT_NORMAL, sData->easyChatProfile[0], 0) + 14, yOffsetsLine1[sData->isHoenn], sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->easyChatProfile[1]); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 8, yOffsetsLine2[sData->isHoenn], sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->easyChatProfile[2]); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, GetStringWidth(FONT_NORMAL, sData->easyChatProfile[2], 0) + 14, yOffsetsLine2[sData->isHoenn], sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->easyChatProfile[3]); } } @@ -1169,9 +1175,9 @@ static void BufferNameForCardBack(void) static void PrintNameOnCardBack(void) { if (!sData->isHoenn) - AddTextPrinterParameterized3(1, FONT_NORMAL, 136, 9, sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->textPlayersCard); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, 136, 9, sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->textPlayersCard); else - AddTextPrinterParameterized3(1, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, sData->textPlayersCard, 216), 9, sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->textPlayersCard); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, sData->textPlayersCard, 216), 9, sTrainerCardTextColors, TEXT_SKIP_DRAW, sData->textPlayersCard); } static const u8 sText_HofTime[] = _("{STR_VAR_1}:{STR_VAR_2}:{STR_VAR_3}"); @@ -1192,8 +1198,8 @@ static void PrintStatOnBackOfCard(u8 top, const u8 *statName, u8 *stat, const u8 static const u8 xOffsets[] = {8, 16}; static const u8 widths[] = {216, 216}; - AddTextPrinterParameterized3(1, FONT_NORMAL, xOffsets[sData->isHoenn], top * 16 + 33, sTrainerCardTextColors, TEXT_SKIP_DRAW, statName); - AddTextPrinterParameterized3(1, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, stat, widths[sData->isHoenn]), top * 16 + 33, color, TEXT_SKIP_DRAW, stat); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, xOffsets[sData->isHoenn], top * 16 + 33, sTrainerCardTextColors, TEXT_SKIP_DRAW, statName); + AddTextPrinterParameterized3(WIN_CARD_TEXT, FONT_NORMAL, GetStringRightAlignXOffset(FONT_NORMAL, stat, widths[sData->isHoenn]), top * 16 + 33, color, TEXT_SKIP_DRAW, stat); } static void PrintHofDebutTimeOnCard(void) @@ -1672,7 +1678,7 @@ static bool8 Task_DrawFlippedCardSide(struct Task *task) switch (sData->flipDrawState) { case 0: - FillWindowPixelBuffer(1, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_CARD_TEXT, PIXEL_FILL(0)); FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 0x20, 0x20); break; case 1: @@ -1691,13 +1697,13 @@ static bool8 Task_DrawFlippedCardSide(struct Task *task) if (!sData->onBack) DrawCardFrontOrBack(sData->backTilemap); else - DrawTrainerCardWindow(1); + DrawTrainerCardWindow(WIN_CARD_TEXT); break; case 3: if (!sData->onBack) DrawCardBackStats(); else - FillWindowPixelBuffer(2, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_TRAINER_PIC, PIXEL_FILL(0)); break; case 4: if (sData->onBack) @@ -1722,12 +1728,12 @@ static bool8 Task_SetCardFlipped(struct Task *task) // If on back of card, draw front of card because its being flipped if (sData->onBack) { - DrawTrainerCardWindow(2); + DrawTrainerCardWindow(WIN_TRAINER_PIC); DrawCardScreenBackground(sData->bgTilemap); DrawCardFrontOrBack(sData->frontTilemap); DrawStarsAndBadgesOnCard(); } - DrawTrainerCardWindow(1); + DrawTrainerCardWindow(WIN_CARD_TEXT); sData->onBack ^= 1; task->tFlipState++; sData->allowDMACopy = TRUE; @@ -1882,7 +1888,7 @@ static void CreateTrainerCardTrainerPic(void) sTrainerPicOffset[sData->isHoenn][sData->trainerCard.gender][0], sTrainerPicOffset[sData->isHoenn][sData->trainerCard.gender][1], 8, - 2); + WIN_TRAINER_PIC); } else { @@ -1891,6 +1897,6 @@ static void CreateTrainerCardTrainerPic(void) sTrainerPicOffset[sData->isHoenn][sData->trainerCard.gender][0], sTrainerPicOffset[sData->isHoenn][sData->trainerCard.gender][1], 8, - 2); + WIN_TRAINER_PIC); } } diff --git a/src/trainer_see.c b/src/trainer_see.c index 9496e119b..8d3450628 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -692,8 +692,8 @@ void TryPrepareSecondApproachingTrainer(void) #define sLocalId data[0] #define sMapNum data[1] #define sMapGroup data[2] -#define sData3 data[3] -#define sData4 data[4] +#define sYVelocity data[3] +#define sYOffset data[4] #define sFldEffId data[7] u8 FldEff_ExclamationMarkIcon(void) @@ -739,7 +739,7 @@ static void SetIconSpriteData(struct Sprite *sprite, u16 fldEffId, u8 spriteAnim sprite->sLocalId = gFieldEffectArguments[0]; sprite->sMapNum = gFieldEffectArguments[1]; sprite->sMapGroup = gFieldEffectArguments[2]; - sprite->sData3 = -5; + sprite->sYVelocity = -5; sprite->sFldEffId = fldEffId; StartSpriteAnim(sprite, spriteAnimNum); @@ -757,23 +757,23 @@ static void SpriteCB_TrainerIcons(struct Sprite *sprite) else { struct Sprite *objEventSprite = &gSprites[gObjectEvents[objEventId].spriteId]; - sprite->sData4 += sprite->sData3; + sprite->sYOffset += sprite->sYVelocity; sprite->x = objEventSprite->x; sprite->y = objEventSprite->y - 16; sprite->x2 = objEventSprite->x2; - sprite->y2 = objEventSprite->y2 + sprite->sData4; - if (sprite->sData4) - sprite->sData3++; + sprite->y2 = objEventSprite->y2 + sprite->sYOffset; + if (sprite->sYOffset) + sprite->sYVelocity++; else - sprite->sData3 = 0; + sprite->sYVelocity = 0; } } #undef sLocalId #undef sMapNum #undef sMapGroup -#undef sData3 -#undef sData4 +#undef sYVelocity +#undef sYOffset #undef sFldEffId u8 GetCurrentApproachingTrainerObjectEventId(void) diff --git a/src/union_room.c b/src/union_room.c index c622ee04a..3739c5952 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -1271,7 +1271,7 @@ static u32 IsTryingToTradeAcrossVersionTooSoon(struct WirelessLink_Group *data, { if (!(gSaveBlock2Ptr->specialSaveWarpFlags & CHAMPION_SAVEWARP)) return UR_TRADE_PLAYER_NOT_READY; - else if (partner->rfu.data.compatibility.isChampion) + else if (partner->rfu.data.compatibility.canLinkNationally) return UR_TRADE_READY; } else @@ -1927,7 +1927,7 @@ static void Task_SendMysteryGift(u8 taskId) data->state = 3; break; case 3: - AddTextPrinterToWindow1(gStringVar4); + MG_AddMessageTextPrinter(gStringVar4); data->state = 4; break; case 4: @@ -2001,7 +2001,7 @@ static void Task_SendMysteryGift(u8 taskId) } break; case 9: - AddTextPrinterToWindow1(gStringVar4); + MG_AddMessageTextPrinter(gStringVar4); data->state = 10; break; case 10: @@ -2104,7 +2104,7 @@ static void Task_CardOrNewsWithFriend(u8 taskId) data->state = 1; break; case 1: - AddTextPrinterToWindow1(sText_ChooseTrainer); + MG_AddMessageTextPrinter(sText_ChooseTrainer); data->state = 2; break; case 2: @@ -2176,7 +2176,7 @@ static void Task_CardOrNewsWithFriend(u8 taskId) } break; case 4: - AddTextPrinterToWindow1(sText_AwaitingPlayersResponse); + MG_AddMessageTextPrinter(sText_AwaitingPlayersResponse); CopyAndTranslatePlayerName(gStringVar1, &data->playerList->players[data->leaderId]); data->state = 5; break; @@ -2195,7 +2195,7 @@ static void Task_CardOrNewsWithFriend(u8 taskId) data->state = 8; break; case RFU_STATUS_JOIN_GROUP_OK: - AddTextPrinterToWindow1(sText_PlayerSentBackOK); + MG_AddMessageTextPrinter(sText_PlayerSentBackOK); RfuSetStatus(RFU_STATUS_OK, 0); break; } @@ -2223,7 +2223,7 @@ static void Task_CardOrNewsWithFriend(u8 taskId) break; case 7: DestroyWirelessStatusIndicatorSprite(); - AddTextPrinterToWindow1(sText_PleaseStartOver); + MG_AddMessageTextPrinter(sText_PleaseStartOver); DestroyTask(taskId); LinkRfu_Shutdown(); gSpecialVar_Result = LINKUP_FAILED; @@ -2272,7 +2272,7 @@ static void Task_CardOrNewsOverWireless(u8 taskId) data->state = 1; break; case 1: - AddTextPrinterToWindow1(sText_SearchingForWirelessSystemWait); + MG_AddMessageTextPrinter(sText_SearchingForWirelessSystemWait); data->state = 2; break; case 2: @@ -2341,7 +2341,7 @@ static void Task_CardOrNewsOverWireless(u8 taskId) } break; case 4: - AddTextPrinterToWindow1(sText_AwaitingResponseFromWirelessSystem); + MG_AddMessageTextPrinter(sText_AwaitingResponseFromWirelessSystem); CopyAndTranslatePlayerName(gStringVar1, &data->playerList->players[data->leaderId]); data->state = 5; break; @@ -2360,7 +2360,7 @@ static void Task_CardOrNewsOverWireless(u8 taskId) data->state = 8; break; case RFU_STATUS_JOIN_GROUP_OK: - AddTextPrinterToWindow1(sText_WirelessLinkEstablished); + MG_AddMessageTextPrinter(sText_WirelessLinkEstablished); RfuSetStatus(RFU_STATUS_OK, 0); break; } diff --git a/src/union_room_chat.c b/src/union_room_chat.c index af4ec2721..5d91e264a 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -116,6 +116,13 @@ enum { // Shared by all above #define PALTAG_INTERFACE 0 +enum { + WIN_CHAT_HISTORY, + WIN_TEXT_ENTRY, + WIN_KEYBOARD, + WIN_SWAP_MENU, +}; + struct UnionRoomChat { u32 filler1; @@ -560,7 +567,7 @@ static const struct BgTemplate sBgTemplates[] = { }; static const struct WindowTemplate sWinTemplates[] = { - { + [WIN_CHAT_HISTORY] = { .bg = 3, .tilemapLeft = 8, .tilemapTop = 1, @@ -568,7 +575,8 @@ static const struct WindowTemplate sWinTemplates[] = { .height = 19, .paletteNum = 15, .baseBlock = 0x0001, - }, { + }, + [WIN_TEXT_ENTRY] = { .bg = 1, .tilemapLeft = 9, .tilemapTop = 18, @@ -576,7 +584,8 @@ static const struct WindowTemplate sWinTemplates[] = { .height = 2, .paletteNum = 12, .baseBlock = 0x007a, - }, { + }, + [WIN_KEYBOARD] = { .bg = 1, .tilemapLeft = 0, .tilemapTop = 2, @@ -584,7 +593,8 @@ static const struct WindowTemplate sWinTemplates[] = { .height = 15, .paletteNum = 7, .baseBlock = 0x0020, - }, { + }, + [WIN_SWAP_MENU] = { .bg = 0, .tilemapLeft = 1, .tilemapTop = 2, @@ -2280,7 +2290,7 @@ static bool32 Display_ShowKeyboardSwapMenu(u8 *state) { case 0: ShowKeyboardSwapMenu(); - CopyWindowToVram(3, COPYWIN_FULL); + CopyWindowToVram(WIN_SWAP_MENU, COPYWIN_FULL); break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2296,7 +2306,7 @@ static bool32 Display_HideKeyboardSwapMenu(u8 *state) { case 0: HideKeyboardSwapMenu(); - CopyWindowToVram(3, COPYWIN_FULL); + CopyWindowToVram(WIN_SWAP_MENU, COPYWIN_FULL); break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2316,7 +2326,7 @@ static bool32 Display_SwitchPages(u8 *state) return TRUE; PrintCurrentKeyboardPage(); - CopyWindowToVram(2, COPYWIN_GFX); + CopyWindowToVram(WIN_KEYBOARD, COPYWIN_GFX); break; case 1: if (IsDma3ManagerBusyWithBgCopy()) @@ -2393,7 +2403,7 @@ static bool32 Display_UpdateMessageBuffer(u8 *state) FillTextEntryWindow(x, width, 0); str = GetMessageEntryBuffer(); DrawTextEntryMessage(0, str, 3, 1, 2); - CopyWindowToVram(1, COPYWIN_GFX); + CopyWindowToVram(WIN_TEXT_ENTRY, COPYWIN_GFX); break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) @@ -2422,7 +2432,7 @@ static bool32 Display_AskRegisterText(u8 *state) length = StringLength_Multibyte(str); FillTextEntryWindow(x, length, PIXEL_FILL(6)); DrawTextEntryMessage(x, str, 0, 4, 5); - CopyWindowToVram(1, COPYWIN_GFX); + CopyWindowToVram(WIN_TEXT_ENTRY, COPYWIN_GFX); break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) @@ -2463,7 +2473,7 @@ static bool32 Display_CancelRegister(u8 *state) length = StringLength_Multibyte(str); FillTextEntryWindow(x, length, PIXEL_FILL(0)); DrawTextEntryMessage(x, str, 3, 1, 2); - CopyWindowToVram(1, COPYWIN_GFX); + CopyWindowToVram(WIN_TEXT_ENTRY, COPYWIN_GFX); break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) @@ -2501,7 +2511,7 @@ static bool32 Display_ReturnToKeyboard(u8 *state) { case 0: PrintCurrentKeyboardPage(); - CopyWindowToVram(2, COPYWIN_GFX); + CopyWindowToVram(WIN_KEYBOARD, COPYWIN_GFX); (*state)++; break; case 1: @@ -2527,7 +2537,7 @@ static bool32 Display_ScrollChat(u8 *state) str = GetLastReceivedMessage(); colorIdx = GetReceivedPlayerIndex(); PrintChatMessage(row, str, colorIdx); - CopyWindowToVram(0, COPYWIN_GFX); + CopyWindowToVram(WIN_CHAT_HISTORY, COPYWIN_GFX); break; case 1: if (IsDma3ManagerBusyWithBgCopy()) @@ -2546,8 +2556,8 @@ static bool32 Display_ScrollChat(u8 *state) } // fall through case 2: - ScrollWindow(0, 0, 5, PIXEL_FILL(1)); - CopyWindowToVram(0, COPYWIN_GFX); + ScrollWindow(WIN_CHAT_HISTORY, 0, 5, PIXEL_FILL(1)); + CopyWindowToVram(WIN_CHAT_HISTORY, COPYWIN_GFX); sDisplay->scrollCount++; (*state)++; // fall through @@ -2864,7 +2874,7 @@ static void DestroyStdMessageWindow(void) static void FillTextEntryWindow(u16 x, u16 width, u8 fillValue) { - FillWindowPixelRect(1, fillValue, x * 8, 1, width * 8, 14); + FillWindowPixelRect(WIN_TEXT_ENTRY, fillValue, x * 8, 1, width * 8, 14); } static void DrawTextEntryMessage(u16 x, u8 *str, u8 bgColor, u8 fgColor, u8 shadowColor) @@ -2881,7 +2891,7 @@ static void DrawTextEntryMessage(u16 x, u8 *str, u8 bgColor, u8 fgColor, u8 shad strBuffer[1] = EXT_CTRL_CODE_MIN_LETTER_SPACING; strBuffer[2] = 8; StringCopy(&strBuffer[3], str); - AddTextPrinterParameterized3(1, FONT_SHORT, x * 8, 1, color, TEXT_SKIP_DRAW, strBuffer); + AddTextPrinterParameterized3(WIN_TEXT_ENTRY, FONT_SHORT, x * 8, 1, color, TEXT_SKIP_DRAW, strBuffer); } static void PrintCurrentKeyboardPage(void) @@ -2894,7 +2904,7 @@ static void PrintCurrentKeyboardPage(void) u8 str[45]; u8 *str2; - FillWindowPixelBuffer(2, PIXEL_FILL(15)); + FillWindowPixelBuffer(WIN_KEYBOARD, PIXEL_FILL(15)); page = GetCurrentKeyboardPage(); color[0] = TEXT_COLOR_TRANSPARENT; color[1] = TEXT_DYNAMIC_COLOR_5; @@ -2916,7 +2926,7 @@ static void PrintCurrentKeyboardPage(void) return; StringCopy(&str[3], sUnionRoomKeyboardText[page][i]); - AddTextPrinterParameterized3(2, FONT_SMALL, left, top, color, TEXT_SKIP_DRAW, str); + AddTextPrinterParameterized3(WIN_KEYBOARD, FONT_SMALL, left, top, color, TEXT_SKIP_DRAW, str); } } else @@ -2927,7 +2937,7 @@ static void PrintCurrentKeyboardPage(void) str2 = GetRegisteredTextByRow(i); if (GetStringWidth(FONT_SMALL, str2, 0) <= 40) { - AddTextPrinterParameterized3(2, FONT_SMALL, left, top, color, TEXT_SKIP_DRAW, str2); + AddTextPrinterParameterized3(WIN_KEYBOARD, FONT_SMALL, left, top, color, TEXT_SKIP_DRAW, str2); } else { @@ -2938,8 +2948,8 @@ static void PrintCurrentKeyboardPage(void) StringCopyN_Multibyte(str, str2, length); } while (GetStringWidth(FONT_SMALL, str, 0) > 35); - AddTextPrinterParameterized3(2, FONT_SMALL, left, top, color, TEXT_SKIP_DRAW, str); - AddTextPrinterParameterized3(2, FONT_SMALL, left + 35, top, color, TEXT_SKIP_DRAW, sText_Ellipsis); + AddTextPrinterParameterized3(WIN_KEYBOARD, FONT_SMALL, left, top, color, TEXT_SKIP_DRAW, str); + AddTextPrinterParameterized3(WIN_KEYBOARD, FONT_SMALL, left + 35, top, color, TEXT_SKIP_DRAW, sText_Ellipsis); } } } @@ -2989,17 +2999,17 @@ static bool32 SlideKeyboardPageIn(void) static void ShowKeyboardSwapMenu(void) { - FillWindowPixelBuffer(3, PIXEL_FILL(1)); - DrawTextBorderOuter(3, 1, 13); - PrintMenuActionTextsAtPos(3, FONT_SHORT, 8, 1, 14, ARRAY_COUNT(sKeyboardPageTitleTexts), sKeyboardPageTitleTexts); - InitMenuNormal(3, FONT_SHORT, 0, 1, 14, 5, GetCurrentKeyboardPage()); - PutWindowTilemap(3); + FillWindowPixelBuffer(WIN_SWAP_MENU, PIXEL_FILL(1)); + DrawTextBorderOuter(WIN_SWAP_MENU, 1, 13); + PrintMenuActionTextsAtPos(WIN_SWAP_MENU, FONT_SHORT, 8, 1, 14, ARRAY_COUNT(sKeyboardPageTitleTexts), sKeyboardPageTitleTexts); + InitMenuNormal(WIN_SWAP_MENU, FONT_SHORT, 0, 1, 14, 5, GetCurrentKeyboardPage()); + PutWindowTilemap(WIN_SWAP_MENU); } static void HideKeyboardSwapMenu(void) { - ClearStdWindowAndFrameToTransparent(3, FALSE); - ClearWindowTilemap(3); + ClearStdWindowAndFrameToTransparent(WIN_SWAP_MENU, FALSE); + ClearWindowTilemap(WIN_SWAP_MENU); } static void PrintChatMessage(u16 row, u8 *str, u8 colorIdx) @@ -3009,8 +3019,8 @@ static void PrintChatMessage(u16 row, u8 *str, u8 colorIdx) color[0] = TEXT_COLOR_WHITE; color[1] = colorIdx * 2 + 2; color[2] = colorIdx * 2 + 3; - FillWindowPixelRect(0, PIXEL_FILL(1), 0, row * 15, 168, 15); - AddTextPrinterParameterized3(0, FONT_SHORT, 0, row * 15 + 1, color, TEXT_SKIP_DRAW, str); + FillWindowPixelRect(WIN_CHAT_HISTORY, PIXEL_FILL(1), 0, row * 15, 168, 15); + AddTextPrinterParameterized3(WIN_CHAT_HISTORY, FONT_SHORT, 0, row * 15 + 1, color, TEXT_SKIP_DRAW, str); } static void ResetGpuBgState(void) @@ -3087,16 +3097,16 @@ static void LoadChatUnkPalette(void) static void LoadChatMessagesWindow(void) { LoadPalette(sUnk_Palette2, BG_PLTT_ID(15), sizeof(sUnk_Palette2)); - PutWindowTilemap(0); - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - CopyWindowToVram(0, COPYWIN_FULL); + PutWindowTilemap(WIN_CHAT_HISTORY); + FillWindowPixelBuffer(WIN_CHAT_HISTORY, PIXEL_FILL(1)); + CopyWindowToVram(WIN_CHAT_HISTORY, COPYWIN_FULL); } static void LoadKeyboardWindow(void) { - PutWindowTilemap(2); + PutWindowTilemap(WIN_KEYBOARD); PrintCurrentKeyboardPage(); - CopyWindowToVram(2, COPYWIN_FULL); + CopyWindowToVram(WIN_KEYBOARD, COPYWIN_FULL); } static void LoadTextEntryWindow(void) @@ -3107,18 +3117,18 @@ static void LoadTextEntryWindow(void) unused[1] = 0xFF; for (i = 0; i < MAX_MESSAGE_LENGTH; i++) - BlitBitmapToWindow(1, sDisplay->unk2128, i * 8, 0, 8, 16); + BlitBitmapToWindow(WIN_TEXT_ENTRY, sDisplay->unk2128, i * 8, 0, 8, 16); - FillWindowPixelBuffer(1, PIXEL_FILL(0)); - PutWindowTilemap(1); - CopyWindowToVram(1, COPYWIN_FULL); + FillWindowPixelBuffer(WIN_TEXT_ENTRY, PIXEL_FILL(0)); + PutWindowTilemap(WIN_TEXT_ENTRY); + CopyWindowToVram(WIN_TEXT_ENTRY, COPYWIN_FULL); } static void LoadKeyboardSwapWindow(void) { - FillWindowPixelBuffer(3, PIXEL_FILL(1)); - LoadUserWindowBorderGfx(3, 1, BG_PLTT_ID(13)); - LoadUserWindowBorderGfx_(3, 0xA, BG_PLTT_ID(2)); + FillWindowPixelBuffer(WIN_SWAP_MENU, PIXEL_FILL(1)); + LoadUserWindowBorderGfx(WIN_SWAP_MENU, 1, BG_PLTT_ID(13)); + LoadUserWindowBorderGfx_(WIN_SWAP_MENU, 0xA, BG_PLTT_ID(2)); LoadPalette(gStandardMenuPalette, BG_PLTT_ID(14), PLTT_SIZE_4BPP); } diff --git a/src/wallclock.c b/src/wallclock.c index 571748d11..ab1add25a 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -55,25 +55,28 @@ static void SpriteCB_AMIndicator(struct Sprite *sprite); #define PALTAG_WALL_CLOCK_MALE 0x1000 #define PALTAG_WALL_CLOCK_FEMALE 0x1001 -enum -{ +enum { PERIOD_AM, PERIOD_PM, }; -enum -{ +enum { MOVE_NONE, MOVE_BACKWARD, MOVE_FORWARD, }; +enum { + WIN_MSG, + WIN_BUTTON_LABEL, +}; + static const u32 sHand_Gfx[] = INCBIN_U32("graphics/wallclock/hand.4bpp.lz"); static const u16 sTextPrompt_Pal[] = INCBIN_U16("graphics/wallclock/text_prompt.gbapal"); // for "Cancel" or "Confirm" static const struct WindowTemplate sWindowTemplates[] = { - { + [WIN_MSG] = { .bg = 0, .tilemapLeft = 3, .tilemapTop = 17, @@ -82,7 +85,7 @@ static const struct WindowTemplate sWindowTemplates[] = .paletteNum = 14, .baseBlock = 512 }, - { + [WIN_BUTTON_LABEL] = { .bg = 2, .tilemapLeft = 24, .tilemapTop = 16, @@ -717,8 +720,8 @@ void CB2_StartWallClock(void) WallClockInit(); - AddTextPrinterParameterized(1, FONT_NORMAL, gText_Confirm3, 0, 1, 0, NULL); - PutWindowTilemap(1); + AddTextPrinterParameterized(WIN_BUTTON_LABEL, FONT_NORMAL, gText_Confirm3, 0, 1, 0, NULL); + PutWindowTilemap(WIN_BUTTON_LABEL); ScheduleBgCopyTilemapToVram(2); } @@ -765,8 +768,8 @@ void CB2_ViewWallClock(void) WallClockInit(); - AddTextPrinterParameterized(1, FONT_NORMAL, gText_Cancel4, 0, 1, 0, NULL); - PutWindowTilemap(1); + AddTextPrinterParameterized(WIN_BUTTON_LABEL, FONT_NORMAL, gText_Cancel4, 0, 1, 0, NULL); + PutWindowTilemap(WIN_BUTTON_LABEL); ScheduleBgCopyTilemapToVram(2); } @@ -829,9 +832,9 @@ static void Task_SetClock_HandleInput(u8 taskId) static void Task_SetClock_AskConfirm(u8 taskId) { - DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x250, 0x0d); - AddTextPrinterParameterized(0, FONT_NORMAL, gText_IsThisTheCorrectTime, 0, 1, 0, NULL); - PutWindowTilemap(0); + DrawStdFrameWithCustomTileAndPalette(WIN_MSG, FALSE, 0x250, 0x0d); + AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_IsThisTheCorrectTime, 0, 1, 0, NULL); + PutWindowTilemap(WIN_MSG); ScheduleBgCopyTilemapToVram(0); CreateYesNoMenu(&sWindowTemplate_ConfirmYesNo, 0x250, 0x0d, 1); gTasks[taskId].func = Task_SetClock_HandleConfirmInput; @@ -848,8 +851,8 @@ static void Task_SetClock_HandleConfirmInput(u8 taskId) case 1: // NO case MENU_B_PRESSED: PlaySE(SE_SELECT); - ClearStdWindowAndFrameToTransparent(0, FALSE); - ClearWindowTilemap(0); + ClearStdWindowAndFrameToTransparent(WIN_MSG, FALSE); + ClearWindowTilemap(WIN_MSG); gTasks[taskId].func = Task_SetClock_HandleInput; break; } diff --git a/src/wireless_communication_status_screen.c b/src/wireless_communication_status_screen.c index 14ee1cf99..f80e2356e 100644 --- a/src/wireless_communication_status_screen.c +++ b/src/wireless_communication_status_screen.c @@ -28,12 +28,21 @@ enum { COLORMODE_WHITE_DGRAY, }; -#define GROUPTYPE_TRADE 0 -#define GROUPTYPE_BATTLE 1 -#define GROUPTYPE_UNION 2 -#define GROUPTYPE_TOTAL 3 -#define GROUPTYPE_NONE -1 -#define NUM_GROUPTYPES 4 +enum { + WIN_TITLE, + WIN_GROUP_NAMES, + WIN_GROUP_COUNTS, +}; + +enum { + GROUPTYPE_TRADE, + GROUPTYPE_BATTLE, + GROUPTYPE_UNION, + GROUPTYPE_TOTAL, + NUM_GROUPTYPES +}; + +#define GROUPTYPE_NONE 0xFF struct WirelessCommunicationStatusScreen { @@ -88,7 +97,7 @@ static const struct BgTemplate sBgTemplates[] = { }; static const struct WindowTemplate sWindowTemplates[] = { - { + [WIN_TITLE] = { .bg = 0, .tilemapLeft = 3, .tilemapTop = 0, @@ -96,7 +105,8 @@ static const struct WindowTemplate sWindowTemplates[] = { .height = 3, .paletteNum = 15, .baseBlock = 0x0001 - }, { + }, + [WIN_GROUP_NAMES] = { .bg = 0, .tilemapLeft = 3, .tilemapTop = 4, @@ -104,7 +114,8 @@ static const struct WindowTemplate sWindowTemplates[] = { .height = 15, .paletteNum = 15, .baseBlock = 0x0049 - }, { + }, + [WIN_GROUP_COUNTS] = { .bg = 0, .tilemapLeft = 24, .tilemapTop = 4, @@ -126,7 +137,6 @@ static const u8 *const sHeaderTexts[NUM_GROUPTYPES + 1] = { // Activity, group type, number of players // 0 players means the number of players can change and should be counted dynamically // GROUPTYPE_TOTAL have no unique group and are simply counted in the total of "people communicating" -// UB: GROUPTYPE_NONE (-1) can potentially be used as an index into a u8[4] in CountPlayersInGroupAndGetActivity static const u8 sActivityGroupInfo[][3] = { {ACTIVITY_BATTLE_SINGLE, GROUPTYPE_BATTLE, 2}, {ACTIVITY_BATTLE_DOUBLE, GROUPTYPE_BATTLE, 2}, @@ -254,24 +264,24 @@ static void CyclePalette(s16 * counter, s16 * palIdx) static void PrintHeaderTexts(void) { s32 i; - FillWindowPixelBuffer(0, PIXEL_FILL(0)); - FillWindowPixelBuffer(1, PIXEL_FILL(0)); - FillWindowPixelBuffer(2, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_TITLE, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_GROUP_NAMES, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_GROUP_COUNTS, PIXEL_FILL(0)); // Print title - WCSS_AddTextPrinterParameterized(0, FONT_NORMAL, sHeaderTexts[0], GetStringCenterAlignXOffset(FONT_NORMAL, sHeaderTexts[0], 0xC0), 6, COLORMODE_GREEN); + WCSS_AddTextPrinterParameterized(WIN_TITLE, FONT_NORMAL, sHeaderTexts[0], GetStringCenterAlignXOffset(FONT_NORMAL, sHeaderTexts[0], 0xC0), 6, COLORMODE_GREEN); // Print label for each group (excluding total) for (i = 0; i < NUM_GROUPTYPES - 1; i++) - WCSS_AddTextPrinterParameterized(1, FONT_NORMAL, sHeaderTexts[i + 1], 0, 30 * i + 8, COLORMODE_WHITE_LGRAY); + WCSS_AddTextPrinterParameterized(WIN_GROUP_NAMES, FONT_NORMAL, sHeaderTexts[i + 1], 0, 30 * i + 8, COLORMODE_WHITE_LGRAY); // Print label for total - WCSS_AddTextPrinterParameterized(1, FONT_NORMAL, sHeaderTexts[i + 1], 0, 30 * i + 8, COLORMODE_RED); + WCSS_AddTextPrinterParameterized(WIN_GROUP_NAMES, FONT_NORMAL, sHeaderTexts[i + 1], 0, 30 * i + 8, COLORMODE_RED); - PutWindowTilemap(0); - CopyWindowToVram(0, COPYWIN_GFX); - PutWindowTilemap(1); - CopyWindowToVram(1, COPYWIN_GFX); + PutWindowTilemap(WIN_TITLE); + CopyWindowToVram(WIN_TITLE, COPYWIN_GFX); + PutWindowTilemap(WIN_GROUP_NAMES); + CopyWindowToVram(WIN_GROUP_NAMES, COPYWIN_GFX); } #define tState data[0] @@ -299,17 +309,17 @@ static void Task_WirelessCommunicationScreen(u8 taskId) case 3: if (UpdateCommunicationCounts(sStatusScreen->groupCounts, sStatusScreen->prevGroupCounts, sStatusScreen->activities, sStatusScreen->rfuTaskId)) { - FillWindowPixelBuffer(2, PIXEL_FILL(0)); + FillWindowPixelBuffer(WIN_GROUP_COUNTS, PIXEL_FILL(0)); for (i = 0; i < NUM_GROUPTYPES; i++) { ConvertIntToDecimalStringN(gStringVar4, sStatusScreen->groupCounts[i], STR_CONV_MODE_RIGHT_ALIGN, 2); if (i != GROUPTYPE_TOTAL) - WCSS_AddTextPrinterParameterized(2, FONT_NORMAL, gStringVar4, 12, 30 * i + 8, COLORMODE_WHITE_LGRAY); + WCSS_AddTextPrinterParameterized(WIN_GROUP_COUNTS, FONT_NORMAL, gStringVar4, 12, 30 * i + 8, COLORMODE_WHITE_LGRAY); else - WCSS_AddTextPrinterParameterized(2, FONT_NORMAL, gStringVar4, 12, 98, COLORMODE_RED); + WCSS_AddTextPrinterParameterized(WIN_GROUP_COUNTS, FONT_NORMAL, gStringVar4, 12, 98, COLORMODE_RED); } - PutWindowTilemap(2); - CopyWindowToVram(2, COPYWIN_FULL); + PutWindowTilemap(WIN_GROUP_COUNTS); + CopyWindowToVram(WIN_GROUP_COUNTS, COPYWIN_FULL); } if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON)) { @@ -382,6 +392,13 @@ static u32 CountPlayersInGroupAndGetActivity(struct RfuPlayer * player, u32 * gr for (i = 0; i < ARRAY_COUNT(sActivityGroupInfo); i++) { +#ifdef UBFIX + // GROUPTYPE_NONE is 0xFF, and shouldn't be used as an index into groupCounts. + // In theory the only activity with this group type (ACTIVITY_SEARCH) wouldn't + // satisfy the condition below, but not necessarily. + if (group_type(i) == GROUPTYPE_NONE) + continue; +#endif if (activity == group_activity(i) && player->groupScheduledAnim == UNION_ROOM_SPAWN_IN) { if (group_players(i) == 0) diff --git a/test/ability_blaze.c b/test/ability_blaze.c index 259b863ec..1e12c6b29 100644 --- a/test/ability_blaze.c +++ b/test/ability_blaze.c @@ -15,6 +15,6 @@ SINGLE_BATTLE_TEST("Blaze boosts Fire-type moves in a pinch", s16 damage) } SCENE { HP_BAR(opponent, captureDamage: &results[i].damage); } FINALLY { - EXPECT_GT(results[1].damage, results[0].damage); + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); } } diff --git a/test/ability_cloud_nine.c b/test/ability_cloud_nine.c new file mode 100644 index 000000000..02da15ee1 --- /dev/null +++ b/test/ability_cloud_nine.c @@ -0,0 +1,16 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Cloud Nine prevents weather effects") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_SANDSTORM].effect == EFFECT_SANDSTORM); + PLAYER(SPECIES_PSYDUCK) { Ability(ABILITY_CLOUD_NINE); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_SANDSTORM); } + TURN {} + } SCENE { + NONE_OF { HP_BAR(player); } + } +} diff --git a/test/ability_compound_eyes.c b/test/ability_compound_eyes.c new file mode 100644 index 000000000..97ab84dd2 --- /dev/null +++ b/test/ability_compound_eyes.c @@ -0,0 +1,37 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Compound Eyes raises accuracy") +{ + PASSES_RANDOMLY(91, 100); + GIVEN { + ASSUME(gBattleMoves[MOVE_THUNDER].accuracy == 70); + PLAYER(SPECIES_BUTTERFREE) { Ability(ABILITY_COMPOUND_EYES); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_THUNDER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDER, player); + HP_BAR(opponent); + } +} + +// This fails even though the ability works correctly. The failure is due to +// a statistical anomaly in the test system where FISSURE hits 3 times more often +// than we expect. +SINGLE_BATTLE_TEST("Compound Eyes does not affect OHKO moves") +{ + KNOWN_FAILING; + PASSES_RANDOMLY(30, 100); + GIVEN { + ASSUME(gBattleMoves[MOVE_FISSURE].accuracy == 30); + ASSUME(gBattleMoves[MOVE_FISSURE].effect == EFFECT_OHKO); + PLAYER(SPECIES_BUTTERFREE) { Ability(ABILITY_TINTED_LENS); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_FISSURE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FISSURE, player); + HP_BAR(opponent, hp: 0); + } +} diff --git a/test/ability_damp.c b/test/ability_damp.c new file mode 100644 index 000000000..c473660f5 --- /dev/null +++ b/test/ability_damp.c @@ -0,0 +1,74 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Damp prevents explosion-like moves from enemies") +{ + u32 move; + PARAMETRIZE { move = MOVE_EXPLOSION; } + PARAMETRIZE { move = MOVE_SELF_DESTRUCT; } + PARAMETRIZE { move = MOVE_MIND_BLOWN; } + PARAMETRIZE { move = MOVE_MISTY_EXPLOSION; } + GIVEN { + PLAYER(SPECIES_PARAS) { Ability(ABILITY_DAMP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, move); } + } SCENE { + ABILITY_POPUP(player, ABILITY_DAMP); + NONE_OF { HP_BAR(player); HP_BAR(opponent); } + } +} + +DOUBLE_BATTLE_TEST("Damp prevents explosion-like moves from enemies in a double battle") +{ + u32 move; + PARAMETRIZE { move = MOVE_EXPLOSION; } + PARAMETRIZE { move = MOVE_SELF_DESTRUCT; } + PARAMETRIZE { move = MOVE_MIND_BLOWN; } + PARAMETRIZE { move = MOVE_MISTY_EXPLOSION; } + GIVEN { + PLAYER(SPECIES_PARAS) { Ability(ABILITY_DAMP); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentLeft, move); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_DAMP); + NONE_OF { HP_BAR(playerLeft); HP_BAR(opponentLeft); HP_BAR(playerRight); HP_BAR(opponentRight); } + } +} + +SINGLE_BATTLE_TEST("Damp prevents explosion-like moves from self") +{ + u32 move; + PARAMETRIZE { move = MOVE_EXPLOSION; } + PARAMETRIZE { move = MOVE_SELF_DESTRUCT; } + PARAMETRIZE { move = MOVE_MIND_BLOWN; } + PARAMETRIZE { move = MOVE_MISTY_EXPLOSION; } + GIVEN { + PLAYER(SPECIES_PARAS) { Ability(ABILITY_DAMP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, move); } + } SCENE { + ABILITY_POPUP(player, ABILITY_DAMP); + NONE_OF { HP_BAR(player); HP_BAR(opponent); } + } +} + +SINGLE_BATTLE_TEST("Damp prevents damage from aftermath") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].flags & FLAG_MAKES_CONTACT); + PLAYER(SPECIES_PARAS) { Ability(ABILITY_DAMP); }; + OPPONENT(SPECIES_VOLTORB) { Ability(ABILITY_AFTERMATH); HP(1); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); SEND_OUT(opponent, 1); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_AFTERMATH); + ABILITY_POPUP(player, ABILITY_DAMP); + NONE_OF { HP_BAR(player); } + } +} diff --git a/test/ability_download.c b/test/ability_download.c new file mode 100644 index 000000000..132c0eb5b --- /dev/null +++ b/test/ability_download.c @@ -0,0 +1,95 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); + ASSUME(gBattleMoves[MOVE_TRI_ATTACK].split == SPLIT_SPECIAL); +} + +SINGLE_BATTLE_TEST("Download raises Attack if player has lower Def than Sp.Def", s16 damage) +{ + u32 ability; + PARAMETRIZE { ability = ABILITY_TRACE; } + PARAMETRIZE { ability = ABILITY_DOWNLOAD; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) {Defense(100); SpDefense(200); }; + OPPONENT(SPECIES_PORYGON) { Ability(ability); Attack(100); }; + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + if (ability == ABILITY_DOWNLOAD) + { + ABILITY_POPUP(opponent, ABILITY_DOWNLOAD); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Porygon's Download raised its attack!"); + } + HP_BAR(player, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Download raises Sp.Attack if enemy has lower Sp.Def than Def", s16 damage) +{ + u32 ability; + PARAMETRIZE { ability = ABILITY_TRACE; } + PARAMETRIZE { ability = ABILITY_DOWNLOAD; } + GIVEN { + PLAYER(SPECIES_PORYGON) { Ability(ability); SpAttack(100); }; + OPPONENT(SPECIES_WOBBUFFET) {Defense(200); SpDefense(100); }; + } WHEN { + TURN { MOVE(player, MOVE_TRI_ATTACK); } + } SCENE { + if (ability == ABILITY_DOWNLOAD) + { + ABILITY_POPUP(player, ABILITY_DOWNLOAD); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Porygon's Download raised its sp. attack!"); + } + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Download doesn't activate if target hasn't been sent out yet", s16 damagePhysical, s16 damageSpecial) +{ + u32 ability; + PARAMETRIZE { ability = ABILITY_TRACE; } + PARAMETRIZE { ability = ABILITY_DOWNLOAD; } + GIVEN { + ASSUME(gBattleMoves[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + PLAYER(SPECIES_WOBBUFFET) { Speed(100); }; + PLAYER(SPECIES_PORYGON) { Ability(ability); Defense(400); SpDefense(300); Speed(300); Attack(100); }; + OPPONENT(SPECIES_WOBBUFFET) { HP(1); Speed(100); }; + OPPONENT(SPECIES_PORYGON2) { Ability(ability); Defense(100); SpDefense(200); Speed(200); }; + } WHEN { + TURN { MOVE(player, MOVE_EXPLOSION); SEND_OUT(player, 1); SEND_OUT(opponent, 1); } + TURN { MOVE(player, MOVE_TACKLE); MOVE(opponent, MOVE_TRI_ATTACK);} + } SCENE { + HP_BAR(player, hp: 0); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player); + // Everyone faints. + + MESSAGE("Go! Porygon!"); + MESSAGE("2 sent out Porygon2!"); + + if (ability == ABILITY_DOWNLOAD) + { + ABILITY_POPUP(player, ABILITY_DOWNLOAD); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Porygon's Download raised its attack!"); + ABILITY_POPUP(opponent, ABILITY_DOWNLOAD); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Porygon2's Download raised its sp. attack!"); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); + HP_BAR(opponent, captureDamage: &results[i].damagePhysical); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TRI_ATTACK, opponent); + HP_BAR(player, captureDamage: &results[i].damageSpecial); + } FINALLY { + EXPECT_MUL_EQ(results[0].damagePhysical, Q_4_12(1.5), results[1].damagePhysical); + EXPECT_MUL_EQ(results[0].damageSpecial, Q_4_12(1.5), results[1].damageSpecial); + } +} diff --git a/test/ability_drizzle.c b/test/ability_drizzle.c new file mode 100644 index 000000000..1b9932476 --- /dev/null +++ b/test/ability_drizzle.c @@ -0,0 +1,24 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Drizzle summons rain", s16 damage) +{ + u32 ability; + PARAMETRIZE { ability = ABILITY_DRIZZLE; } + PARAMETRIZE { ability = ABILITY_DAMP; } + + GIVEN { + PLAYER(SPECIES_POLITOED) { Ability(ability); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BUBBLE); } + } SCENE { + if (ability == ABILITY_DRIZZLE) { + ABILITY_POPUP(player, ABILITY_DRIZZLE); + MESSAGE("Politoed's Drizzle made it rain!"); + } + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[1].damage, Q_4_12(1.5), results[0].damage); + } +} diff --git a/test/ability_insomnia.c b/test/ability_insomnia.c new file mode 100644 index 000000000..9398bd30a --- /dev/null +++ b/test/ability_insomnia.c @@ -0,0 +1,59 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Insomnia prevents sleep") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_SPORE].effect == EFFECT_SLEEP); + PLAYER(SPECIES_DROWZEE) { Ability(ABILITY_INSOMNIA); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_SPORE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_INSOMNIA); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPORE, opponent); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, player); + STATUS_ICON(player, sleep: TRUE); + } + } +} + +SINGLE_BATTLE_TEST("Insomnia prevents yawn") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_YAWN].effect == EFFECT_YAWN); + PLAYER(SPECIES_DROWZEE) { Ability(ABILITY_INSOMNIA); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_SPORE); } + TURN { } + TURN { } + } SCENE { + ABILITY_POPUP(player, ABILITY_INSOMNIA); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_YAWN, opponent); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, player); + STATUS_ICON(player, sleep: TRUE); + } + } +} + +SINGLE_BATTLE_TEST("Insomnia prevents rest") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_REST].effect == EFFECT_REST); + PLAYER(SPECIES_DROWZEE) { Ability(ABILITY_INSOMNIA); HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_REST); } + } SCENE { + ABILITY_POPUP(player, ABILITY_INSOMNIA); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_REST, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, player); + STATUS_ICON(player, sleep: TRUE); + HP_BAR(player); + } + } +} diff --git a/test/ability_intimidate.c b/test/ability_intimidate.c new file mode 100644 index 000000000..f978b80ab --- /dev/null +++ b/test/ability_intimidate.c @@ -0,0 +1,97 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); +} + +SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after switch out", s16 damage) +{ + u32 ability; + PARAMETRIZE { ability = ABILITY_INTIMIDATE; } + PARAMETRIZE { ability = ABILITY_RECKLESS; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_STARAPTOR) { Ability(ability); }; + } WHEN { + TURN { SWITCH(opponent, 1); } + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + if (ability == ABILITY_INTIMIDATE) + { + ABILITY_POPUP(opponent, ABILITY_INTIMIDATE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Foe Staraptor's Intimidate cuts Wobbuffet's ATTACK!"); + } + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after KO", s16 damage) +{ + u32 ability; + PARAMETRIZE { ability = ABILITY_INTIMIDATE; } + PARAMETRIZE { ability = ABILITY_RECKLESS; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Speed(2); }; + OPPONENT(SPECIES_WOBBUFFET) { HP(1); Speed(1); }; + OPPONENT(SPECIES_STARAPTOR) { Ability(ability); Speed(1); }; + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); SEND_OUT(opponent, 1); } + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + HP_BAR(opponent); + if (ability == ABILITY_INTIMIDATE) + { + ABILITY_POPUP(opponent, ABILITY_INTIMIDATE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Foe Staraptor's Intimidate cuts Wobbuffet's ATTACK!"); + } + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} + +DOUBLE_BATTLE_TEST("Intimidate doesn't activate on an empty field in a double battle") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + PLAYER(SPECIES_WOBBUFFET) { }; + PLAYER(SPECIES_WOBBUFFET) { HP(1); }; + PLAYER(SPECIES_STARAVIA) { Ability(ABILITY_INTIMIDATE); }; + PLAYER(SPECIES_ABRA); + OPPONENT(SPECIES_WOBBUFFET) { HP(1); }; + OPPONENT(SPECIES_WOBBUFFET) { HP(1); }; + OPPONENT(SPECIES_STARAPTOR) { Ability(ABILITY_INTIMIDATE); }; + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(playerLeft, MOVE_EXPLOSION); SEND_OUT(playerLeft, 2); SEND_OUT(opponentLeft, 2); SEND_OUT(playerRight, 3); SEND_OUT(opponentRight, 3); } + TURN { MOVE(playerLeft, MOVE_CELEBRATE);} + } SCENE { + HP_BAR(playerLeft, hp: 0); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft); + // Everyone faints. + + MESSAGE("Go! Staravia!"); + MESSAGE("2 sent out Staraptor!"); + MESSAGE("Go! Abra!"); + MESSAGE("2 sent out Wynaut!"); + + ABILITY_POPUP(playerLeft, ABILITY_INTIMIDATE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + MESSAGE("Staravia's Intimidate cuts Foe Staraptor's ATTACK!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight); + MESSAGE("Staravia's Intimidate cuts Foe Wynaut's ATTACK!"); + + ABILITY_POPUP(opponentLeft, ABILITY_INTIMIDATE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft); + MESSAGE("Foe Staraptor's Intimidate cuts Staravia's ATTACK!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Foe Staraptor's Intimidate cuts Abra's ATTACK!"); + } +} diff --git a/test/ability_limber.c b/test/ability_limber.c new file mode 100644 index 000000000..4b428d0c1 --- /dev/null +++ b/test/ability_limber.c @@ -0,0 +1,16 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Limber prevents paralysis") +{ + GIVEN { + PLAYER(SPECIES_PERSIAN) { Ability(ABILITY_LIMBER); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_THUNDER_SHOCK); } + } SCENE { + HP_BAR(player); + NONE_OF { ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PRZ, player); } + NONE_OF { STATUS_ICON(player, paralysis: TRUE); } + } +} diff --git a/test/ability_magic_bounce.c b/test/ability_magic_bounce.c new file mode 100644 index 000000000..d52b93c4a --- /dev/null +++ b/test/ability_magic_bounce.c @@ -0,0 +1,84 @@ +#include "global.h" +#include "test_battle.h" + + +SINGLE_BATTLE_TEST("Magic Bounce bounces back status moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_TOXIC].effect == EFFECT_TOXIC); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE);}; + } WHEN { + TURN { MOVE(player, MOVE_TOXIC); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_MAGIC_BOUNCE); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, player); + MESSAGE("Wynaut's Toxic was bounced back by Foe Espeon's Magic Bounce!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, opponent); + STATUS_ICON(player, badPoison: TRUE); + } +} + +SINGLE_BATTLE_TEST("Magic Bounce bounces back powder moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER); + ASSUME(gBattleMoves[MOVE_STUN_SPORE].effect == EFFECT_PARALYZE); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE);}; + } WHEN { + TURN { MOVE(player, MOVE_STUN_SPORE); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_MAGIC_BOUNCE); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, player); + MESSAGE("Wynaut's Stun Spore was bounced back by Foe Espeon's Magic Bounce!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, opponent); + STATUS_ICON(player, paralysis: TRUE); + } +} + +SINGLE_BATTLE_TEST("Magic Bounce cannot bounce back powder moves against Grass Types") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER); + ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); + PLAYER(SPECIES_ODDISH); + OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE);}; + } WHEN { + TURN { MOVE(player, MOVE_STUN_SPORE); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_MAGIC_BOUNCE); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); + MESSAGE("Oddish's Stun Spore was bounced back by Foe Espeon's Magic Bounce!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, opponent); + MESSAGE("It doesn't affect Oddish…"); + NOT STATUS_ICON(player, paralysis: TRUE); + } +} + + +DOUBLE_BATTLE_TEST("Magic Bounce bounces back moves hitting both foes at two foes") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_LEER].effect == EFFECT_DEFENSE_DOWN); + ASSUME(gBattleMoves[MOVE_LEER].target == MOVE_TARGET_BOTH); + PLAYER(SPECIES_ABRA); + PLAYER(SPECIES_KADABRA); + OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE);}; + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(playerLeft, MOVE_LEER); } + } SCENE { + ABILITY_POPUP(opponentLeft, ABILITY_MAGIC_BOUNCE); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_LEER, playerLeft); + MESSAGE("Abra's Leer was bounced back by Foe Espeon's Magic Bounce!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_LEER, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft); + MESSAGE("Abra's defense fell!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Kadabra's defense fell!"); + // Also check if second original target gets hit by Leer as this was once bugged + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight); + MESSAGE("Foe Wynaut's defense fell!"); + } +} diff --git a/test/ability_oblivious.c b/test/ability_oblivious.c new file mode 100644 index 000000000..0708845ed --- /dev/null +++ b/test/ability_oblivious.c @@ -0,0 +1,68 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Oblivious prevents Infatuation") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_ATTRACT].effect == EFFECT_ATTRACT); + PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OBLIVIOUS); Gender(MON_MALE); }; + OPPONENT(SPECIES_WOBBUFFET) { Gender(MON_FEMALE); }; + } WHEN { + TURN { MOVE(opponent, MOVE_ATTRACT); } + } SCENE { + ABILITY_POPUP(player, ABILITY_OBLIVIOUS); + NONE_OF { ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_INFATUATION, player); } + MESSAGE("It doesn't affect Slowpoke…"); + } +} + +SINGLE_BATTLE_TEST("Oblivious prevents Captivate") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_CAPTIVATE].effect == EFFECT_CAPTIVATE); + PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OBLIVIOUS); Gender(MON_MALE); }; + OPPONENT(SPECIES_WOBBUFFET) { Gender(MON_FEMALE); }; + } WHEN { + TURN { MOVE(opponent, MOVE_ATTRACT); } + } SCENE { + ABILITY_POPUP(player, ABILITY_OBLIVIOUS); + NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } + MESSAGE("It doesn't affect Slowpoke…"); + } +} + +SINGLE_BATTLE_TEST("Oblivious prevents Taunt") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_TAUNT].effect == EFFECT_TAUNT); + ASSUME(B_OBLIVIOUS_TAUNT >= GEN_6); + PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OBLIVIOUS); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TAUNT); } + TURN { MOVE(player, MOVE_SPORE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_OBLIVIOUS); + NONE_OF { ANIMATION(ANIM_TYPE_MOVE, MOVE_TAUNT, opponent); } + MESSAGE("It doesn't affect Slowpoke…"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPORE, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, opponent); + } +} + +SINGLE_BATTLE_TEST("Oblivious prevents Intimidate") +{ + GIVEN { + ASSUME(B_UPDATED_INTIMIDATE >= GEN_8); + PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OBLIVIOUS); }; + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }; + } WHEN { + TURN { SWITCH(opponent, 1); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_INTIMIDATE); + ABILITY_POPUP(player, ABILITY_OBLIVIOUS); + NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } + MESSAGE("Slowpoke's attack was not lowered!"); + } +} diff --git a/test/ability_overgrow.c b/test/ability_overgrow.c new file mode 100644 index 000000000..82d8dd467 --- /dev/null +++ b/test/ability_overgrow.c @@ -0,0 +1,20 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Overgrow boosts Grass-type moves in a pinch", s16 damage) +{ + u16 hp; + PARAMETRIZE { hp = 99; } + PARAMETRIZE { hp = 33; } + GIVEN { + ASSUME(gBattleMoves[MOVE_VINE_WHIP].type == TYPE_GRASS); + PLAYER(SPECIES_BULBASAUR) { Ability(ABILITY_OVERGROW); MaxHP(99); HP(hp); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_VINE_WHIP); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} diff --git a/test/ability_sand_veil.c b/test/ability_sand_veil.c new file mode 100644 index 000000000..5d2325140 --- /dev/null +++ b/test/ability_sand_veil.c @@ -0,0 +1,30 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Sand Veil prevents damage from sandstorm") +{ + GIVEN { + PLAYER(SPECIES_SANDSHREW) { Ability(ABILITY_SAND_VEIL); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_SANDSTORM); } + TURN {} + } SCENE { + NONE_OF { HP_BAR(player); } + } +} + +SINGLE_BATTLE_TEST("Sand Veil reduces accuracy during sandstorm") +{ + PASSES_RANDOMLY(4,5); + GIVEN { + ASSUME(gBattleMoves[MOVE_POUND].accuracy == 100); + PLAYER(SPECIES_SANDSHREW) { Ability(ABILITY_SAND_VEIL); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_SANDSTORM); } + TURN { MOVE(opponent, MOVE_POUND); } + } SCENE { + HP_BAR(player); + } +} diff --git a/test/ability_speed_boost.c b/test/ability_speed_boost.c new file mode 100644 index 000000000..b3e128931 --- /dev/null +++ b/test/ability_speed_boost.c @@ -0,0 +1,20 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Speed Boost gradually boosts speed") +{ + GIVEN { + PLAYER(SPECIES_TORCHIC) { Ability(ABILITY_SPEED_BOOST); Speed(99); }; + OPPONENT(SPECIES_WOBBUFFET) { Speed(100); }; + } WHEN { + TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_CELEBRATE); } + TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_CELEBRATE); } + } SCENE { + MESSAGE("Foe Wobbuffet used Celebrate!"); + MESSAGE("Torchic used Celebrate!"); + ABILITY_POPUP(player, ABILITY_SPEED_BOOST); + MESSAGE("Torchic's Speed Boost raised its SPEED!"); + MESSAGE("Torchic used Celebrate!"); + MESSAGE("Foe Wobbuffet used Celebrate!"); + } +} diff --git a/test/ability_stench.c b/test/ability_stench.c new file mode 100644 index 000000000..7285ee768 --- /dev/null +++ b/test/ability_stench.c @@ -0,0 +1,34 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Stench has a 10% chance to flinch") +{ + PASSES_RANDOMLY(1,10); + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].power > 0); + PLAYER(SPECIES_STUNKY) { Ability(ABILITY_STENCH); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); MOVE(opponent, MOVE_CELEBRATE); } + } SCENE { + MESSAGE("Foe Wobbuffet flinched!"); + } +} + +SINGLE_BATTLE_TEST("Stench does not stack with King's Rock") +{ + PASSES_RANDOMLY(1,10); + GIVEN { + ASSUME(gItems[ITEM_KINGS_ROCK].holdEffect == HOLD_EFFECT_FLINCH); + ASSUME(gBattleMoves[MOVE_TACKLE].power > 0); + + PLAYER(SPECIES_STUNKY) { Ability(ABILITY_STENCH); Item(ITEM_KINGS_ROCK); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); MOVE(opponent, MOVE_CELEBRATE); } + } SCENE { + MESSAGE("Foe Wobbuffet flinched!"); + } +} + +// TODO: Test against interaction with multi hits diff --git a/test/ability_swarm.c b/test/ability_swarm.c new file mode 100644 index 000000000..7709e976e --- /dev/null +++ b/test/ability_swarm.c @@ -0,0 +1,20 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Swarm boosts Bug-type moves in a pinch", s16 damage) +{ + u16 hp; + PARAMETRIZE { hp = 99; } + PARAMETRIZE { hp = 33; } + GIVEN { + ASSUME(gBattleMoves[MOVE_BUG_BITE].type == TYPE_BUG); + PLAYER(SPECIES_LEDYBA) { Ability(ABILITY_SWARM); MaxHP(99); HP(hp); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BUG_BITE); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} diff --git a/test/ability_torrent.c b/test/ability_torrent.c new file mode 100644 index 000000000..e5c701775 --- /dev/null +++ b/test/ability_torrent.c @@ -0,0 +1,20 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Torrent boosts Water-type moves in a pinch", s16 damage) +{ + u16 hp; + PARAMETRIZE { hp = 99; } + PARAMETRIZE { hp = 33; } + GIVEN { + ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); + PLAYER(SPECIES_SQUIRTLE) { Ability(ABILITY_TORRENT); MaxHP(99); HP(hp); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BUBBLE); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} diff --git a/test/ability_volt_absorb.c b/test/ability_volt_absorb.c new file mode 100644 index 000000000..bef35e2b4 --- /dev/null +++ b/test/ability_volt_absorb.c @@ -0,0 +1,109 @@ +#include "global.h" +#include "test_battle.h" + +#define TEST_MAX_HP (100) + +SINGLE_BATTLE_TEST("Volt Absorb heals 25% when hit by electric type moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); + PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_THUNDER_SHOCK); } + } SCENE { + ABILITY_POPUP(player, ABILITY_VOLT_ABSORB); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 1); + MESSAGE("Jolteon restored HP using its Volt Absorb!"); + } +} + +SINGLE_BATTLE_TEST("Volt Absorb does not activate if protected") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); + PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PROTECT); MOVE(opponent, MOVE_THUNDER_SHOCK); } + } SCENE { + NONE_OF { ABILITY_POPUP(player, ABILITY_VOLT_ABSORB); HP_BAR(player); MESSAGE("Jolteon restored HP using its Volt Absorb!"); } + } +} + +SINGLE_BATTLE_TEST("Volt Absorb activates on status moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_THUNDER_WAVE].type == TYPE_ELECTRIC); + ASSUME(gBattleMoves[MOVE_THUNDER_WAVE].split == SPLIT_STATUS); + PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_THUNDER_WAVE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_VOLT_ABSORB); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 1); + MESSAGE("Jolteon restored HP using its Volt Absorb!"); + } +} + +SINGLE_BATTLE_TEST("Volt Absorb is only triggered once on multi strike moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_FURY_SWIPES].type == TYPE_NORMAL); + ASSUME(gBattleMoves[MOVE_FURY_SWIPES].effect == EFFECT_MULTI_HIT); + PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_GRAVELER_ALOLAN) { Ability(ABILITY_GALVANIZE); }; + } WHEN { + TURN { MOVE(opponent, MOVE_FURY_SWIPES); } + } SCENE { + ABILITY_POPUP(player, ABILITY_VOLT_ABSORB); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 1); + MESSAGE("Jolteon restored HP using its Volt Absorb!"); + } +} + +DOUBLE_BATTLE_TEST("Volt Absorb does not stop Electric Typed Explosion from damaging other pokemon", s16 damage1, s16 damage2) // Fixed issue #1961 +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(gBattleMoves[MOVE_EXPLOSION].type == TYPE_NORMAL); + PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); } + PLAYER(SPECIES_ABRA); + OPPONENT(SPECIES_GRAVELER_ALOLAN) { Ability(ABILITY_GALVANIZE); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_EXPLOSION); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_VOLT_ABSORB); + HP_BAR(playerLeft, hp: TEST_MAX_HP / 4 + 1); + MESSAGE("Jolteon restored HP using its Volt Absorb!"); + HP_BAR(playerRight, captureDamage: &results->damage1); + HP_BAR(opponentRight, captureDamage: &results->damage2); + } + FINALLY { + EXPECT_NE(results[0].damage1, 0); + EXPECT_NE(results[0].damage2, 0); + } +} + +SINGLE_BATTLE_TEST("Volt Absorb prevents Cell Battery from activating") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); + PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); Item(ITEM_CELL_BATTERY); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_THUNDER_SHOCK); } + } SCENE { + ABILITY_POPUP(player, ABILITY_VOLT_ABSORB); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 1); + MESSAGE("Jolteon restored HP using its Volt Absorb!"); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Using Cell Battery, the attack of Jolteon rose!"); + } + + } +} diff --git a/test/ability_water_absorb.c b/test/ability_water_absorb.c new file mode 100644 index 000000000..aaaa149ac --- /dev/null +++ b/test/ability_water_absorb.c @@ -0,0 +1,87 @@ +#include "global.h" +#include "test_battle.h" + +#define TEST_MAX_HP (100) + +SINGLE_BATTLE_TEST("Water Absorb heals 25% when hit by water type moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); + PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_BUBBLE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_WATER_ABSORB); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 1); + MESSAGE("Poliwag restored HP using its Water Absorb!"); + } +} + +SINGLE_BATTLE_TEST("Water Absorb does not activate if protected") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); + PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PROTECT); MOVE(opponent, MOVE_BUBBLE); } + } SCENE { + NONE_OF { ABILITY_POPUP(player, ABILITY_WATER_ABSORB); HP_BAR(player); MESSAGE("Poliwag restored HP using its Water Absorb!"); } + } +} + +SINGLE_BATTLE_TEST("Water Absorb activates on status moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_SOAK].type == TYPE_WATER); + ASSUME(gBattleMoves[MOVE_SOAK].split == SPLIT_STATUS); + PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_SOAK); } + } SCENE { + ABILITY_POPUP(player, ABILITY_WATER_ABSORB); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 1); + MESSAGE("Poliwag restored HP using its Water Absorb!"); + } +} + +SINGLE_BATTLE_TEST("Water Absorb is only triggered once on multi strike moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_WATER_SHURIKEN].type == TYPE_WATER); + ASSUME(gBattleMoves[MOVE_WATER_SHURIKEN].effect == EFFECT_MULTI_HIT); + PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_WATER_SHURIKEN); } + } SCENE { + ABILITY_POPUP(player, ABILITY_WATER_ABSORB); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 1); + MESSAGE("Poliwag restored HP using its Water Absorb!"); + } +} + +SINGLE_BATTLE_TEST("Water Absorb prevents Items from activating") +{ + u32 item; + PARAMETRIZE { item = ITEM_ABSORB_BULB; } + PARAMETRIZE { item = ITEM_LUMINOUS_MOSS; } + GIVEN { + ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); + PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); Item(item); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_BUBBLE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_WATER_ABSORB); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 1); + MESSAGE("Poliwag restored HP using its Water Absorb!"); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + } + + } +} diff --git a/test/hold_effect_red_card.c b/test/hold_effect_red_card.c new file mode 100644 index 000000000..c32c489d5 --- /dev/null +++ b/test/hold_effect_red_card.c @@ -0,0 +1,378 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gItems[ITEM_RED_CARD].holdEffect == HOLD_EFFECT_RED_CARD); +} + +SINGLE_BATTLE_TEST("Red Card switches the attacker with a random non-fainted replacement") +{ + PASSES_RANDOMLY(1, 2); + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_BULBASAUR); + OPPONENT(SPECIES_CHARMANDER); + OPPONENT(SPECIES_SQUIRTLE) { HP(0); } + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + MESSAGE("Foe Bulbasaur was dragged out!"); + } +} + +DOUBLE_BATTLE_TEST("Red Card switches the target with a random non-battler, non-fainted replacement") +{ + PASSES_RANDOMLY(1, 2); + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_BULBASAUR); + OPPONENT(SPECIES_CHARMANDER); + OPPONENT(SPECIES_SQUIRTLE) { HP(0); } + } WHEN { + TURN { MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + MESSAGE("Foe Bulbasaur was dragged out!"); + } +} + +SINGLE_BATTLE_TEST("Red Card does not activate if holder faints") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(1); Item(ITEM_RED_CARD); } + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } + } +} + +SINGLE_BATTLE_TEST("Red Card does not activate if target is behind a Substitute") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(player, MOVE_SUBSTITUTE); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } + } +} + +SINGLE_BATTLE_TEST("Red Card activates after the last hit of a multi-hit move") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, MOVE_DOUBLE_KICK); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_KICK, opponent); + HP_BAR(player); + HP_BAR(player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } +} + +SINGLE_BATTLE_TEST("Red Card does not activate if no replacements") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } + } +} + +SINGLE_BATTLE_TEST("Red Card does not activate if replacements fainted") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT) { HP(0); } + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } + } +} + +SINGLE_BATTLE_TEST("Red Card does not activate if knocked off") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, MOVE_KNOCK_OFF); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } + } +} + +SINGLE_BATTLE_TEST("Red Card does not activate if stolen by a move") +{ + u32 item; + bool32 activate; + PARAMETRIZE { item = ITEM_NONE; activate = FALSE; } + PARAMETRIZE { item = ITEM_POTION; activate = TRUE; } + ASSUME(gBattleMoves[MOVE_THIEF].effect == EFFECT_THIEF); + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET) { Item(item); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, MOVE_THIEF); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_THIEF, opponent); + if (activate) { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } else { + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } + } + } +} + +SINGLE_BATTLE_TEST("Red Card does not activate if stolen by Magician") +{ + u32 item; + bool32 activate; + PARAMETRIZE { item = ITEM_NONE; activate = FALSE; } + PARAMETRIZE { item = ITEM_POTION; activate = TRUE; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_FENNEKIN) { Ability(ABILITY_MAGICIAN); Item(item); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + if (activate) { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Fennekin!"); + } else { + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Fennekin!"); + } + } + } +} + +DOUBLE_BATTLE_TEST("Red Card activates for only the fastest target") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Speed(3); Item(ITEM_RED_CARD); } + PLAYER(SPECIES_WYNAUT) { Speed(2); Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(5); } + OPPONENT(SPECIES_WYNAUT) { Speed(4); } + OPPONENT(SPECIES_UNOWN) { Speed(1); } + } WHEN { + TURN { + MOVE(opponentLeft, MOVE_ROCK_SLIDE); + MOVE(opponentRight, MOVE_TACKLE, target: playerRight); + } + } SCENE { + // Fastest target's Red Card activates. + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + MESSAGE("Foe Unown was dragged out!"); + + // Slower target's Red Card still able to activate on other battler. + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight); + MESSAGE("Wynaut held up its Red Card against Foe Wynaut!"); + MESSAGE("Foe Wobbuffet was dragged out!"); + } +} + +DOUBLE_BATTLE_TEST("Red Card activates but fails if the attacker is rooted") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_UNOWN); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_INGRAIN); } + TURN { + MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); + MOVE(opponentRight, MOVE_TACKLE, target: playerLeft); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + MESSAGE("Foe Wobbuffet anchored itself with its roots!"); + + // Red Card already consumed so cannot activate. + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight); + MESSAGE("Wynaut held up its Red Card against Foe Wynaut!"); + } + } +} + +DOUBLE_BATTLE_TEST("Red Card activates but fails if the attacker has Suction Cups") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_OCTILLERY) { Ability(ABILITY_SUCTION_CUPS); } + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_UNOWN); + } WHEN { + TURN { + MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); + MOVE(opponentRight, MOVE_TACKLE, target: playerLeft); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft); + MESSAGE("Wobbuffet held up its Red Card against Foe Octillery!"); + MESSAGE("Foe Octillery anchors itself with Suction Cups!"); + + // Red Card already consumed so cannot activate. + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight); + MESSAGE("Wynaut held up its Red Card against Foe Wynaut!"); + } + } +} + +SINGLE_BATTLE_TEST("Red Card does not activate if switched by Dragon Tail") +{ + bool32 hasWynaut, activate; + PARAMETRIZE { hasWynaut = TRUE; activate = FALSE; } + PARAMETRIZE { hasWynaut = FALSE; activate = TRUE; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + if (hasWynaut) PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, MOVE_DRAGON_TAIL); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_TAIL, opponent); + if (activate) { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } else { + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } + } + } +} + +SINGLE_BATTLE_TEST("Red Card activates and overrides U-turn") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, MOVE_U_TURN); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_U_TURN, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!"); + } +} + +SINGLE_BATTLE_TEST("Red Card does not activate if attacker's Sheer Force applied") +{ + u32 move; + bool32 activate; + PARAMETRIZE { move = MOVE_TACKLE; activate = TRUE; } + PARAMETRIZE { move = MOVE_STOMP; activate = FALSE; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_TAUROS) { Ability(ABILITY_SHEER_FORCE); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + if (activate) { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Tauros!"); + } else { + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet held up its Red Card against Foe Tauros!"); + } + } + } +} + +SINGLE_BATTLE_TEST("Red Card activates before Emergency Exit") +{ + GIVEN { + PLAYER(SPECIES_GOLISOPOD) { MaxHP(100); HP(51); Item(ITEM_RED_CARD); } + PLAYER(SPECIES_WIMPOD); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Golisopod held up its Red Card against Foe Wobbuffet!"); + ABILITY_POPUP(player, ABILITY_EMERGENCY_EXIT); + MESSAGE("Go! Wimpod!"); + } +} + +// SINGLE_BATTLE_TEST("Red Card activates but fails if the attacker has Dynamaxed") diff --git a/test/move_effect_after_you.c b/test/move_effect_after_you.c index 400fc053f..a488d7a8c 100644 --- a/test/move_effect_after_you.c +++ b/test/move_effect_after_you.c @@ -8,7 +8,6 @@ ASSUMPTIONS DOUBLE_BATTLE_TEST("After You makes the target move after user") { - if (B_RECALC_TURN_AFTER_ACTIONS >= GEN_8) KNOWN_FAILING; // #2615. GIVEN { PLAYER(SPECIES_WOBBUFFET) { Speed(4); } PLAYER(SPECIES_WYNAUT) { Speed(1); } diff --git a/test/move_effect_attack_up_user_ally.c b/test/move_effect_attack_up_user_ally.c new file mode 100644 index 000000000..e98df30d8 --- /dev/null +++ b/test/move_effect_attack_up_user_ally.c @@ -0,0 +1,65 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_HOWL].effect == EFFECT_ATTACK_UP_USER_ALLY); +} + +SINGLE_BATTLE_TEST("Howl raises user's Attack", s16 damage) +{ + bool32 raiseAttack; + PARAMETRIZE { raiseAttack = FALSE; } + PARAMETRIZE { raiseAttack = TRUE; } + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + if (raiseAttack) TURN { MOVE(player, MOVE_HOWL); } + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + if (raiseAttack) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HOWL, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Wobbuffet's attack rose!"); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} + +DOUBLE_BATTLE_TEST("Howl raises user's and partner's Attack", s16 damageLeft, s16 damageRight) +{ + bool32 raiseAttack; + PARAMETRIZE { raiseAttack = FALSE; } + PARAMETRIZE { raiseAttack = TRUE; } + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); + PLAYER(SPECIES_WOBBUFFET) { Speed(15); }; + PLAYER(SPECIES_WYNAUT) { Speed(10); }; + OPPONENT(SPECIES_WOBBUFFET) { Speed(13); }; + OPPONENT(SPECIES_WYNAUT) { Speed(12); }; + } WHEN { + if (raiseAttack) TURN { MOVE(playerLeft, MOVE_HOWL); } + TURN { MOVE(playerLeft, MOVE_TACKLE, target: opponentLeft); } + TURN { MOVE(playerRight, MOVE_TACKLE, target: opponentRight); } + } SCENE { + if (raiseAttack) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HOWL, playerLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft); + MESSAGE("Wobbuffet's attack rose!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Wynaut's attack rose!"); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerLeft); + HP_BAR(opponentLeft, captureDamage: &results[i].damageLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerRight); + HP_BAR(opponentRight, captureDamage: &results[i].damageRight); + } FINALLY { + EXPECT_MUL_EQ(results[0].damageLeft, Q_4_12(1.5), results[1].damageLeft); + EXPECT_MUL_EQ(results[0].damageRight, Q_4_12(1.5), results[1].damageRight); + } +} diff --git a/test/move_effect_explosion.c b/test/move_effect_explosion.c index 872f3f709..41e74044b 100644 --- a/test/move_effect_explosion.c +++ b/test/move_effect_explosion.c @@ -8,7 +8,6 @@ ASSUMPTIONS SINGLE_BATTLE_TEST("Explosion causes the user to faint") { - u16 remainingHP; GIVEN { PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -17,12 +16,29 @@ SINGLE_BATTLE_TEST("Explosion causes the user to faint") } SCENE { HP_BAR(player, hp: 0); ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player); + MESSAGE("Wobbuffet fainted!"); + } +} + +SINGLE_BATTLE_TEST("Explosion causes the user & the target to faint") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_EXPLOSION); } + } SCENE { + HP_BAR(player, hp: 0); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player); + HP_BAR(opponent, hp: 0); + MESSAGE("Foe Wobbuffet fainted!"); + MESSAGE("Wobbuffet fainted!"); } } SINGLE_BATTLE_TEST("Explosion causes the user to faint even if it misses") { - u16 remainingHP; GIVEN { PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -31,12 +47,12 @@ SINGLE_BATTLE_TEST("Explosion causes the user to faint even if it misses") } SCENE { HP_BAR(player, hp: 0); ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player); + MESSAGE("Wobbuffet fainted!"); } } SINGLE_BATTLE_TEST("Explosion causes the user to faint even if it has no effect") { - u16 remainingHP; GIVEN { ASSUME(gBattleMoves[MOVE_EXPLOSION].type == TYPE_NORMAL); ASSUME(gSpeciesInfo[SPECIES_GASTLY].types[0] == TYPE_GHOST); @@ -49,5 +65,29 @@ SINGLE_BATTLE_TEST("Explosion causes the user to faint even if it has no effect" ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player); MESSAGE("It doesn't affect Foe Gastly…"); NOT HP_BAR(opponent); + MESSAGE("Wobbuffet fainted!"); + } +} + +DOUBLE_BATTLE_TEST("Explosion causes everyone to faint in a double battle") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT) { HP(1); } + OPPONENT(SPECIES_ABRA) { HP(1); } + OPPONENT(SPECIES_KADABRA) { HP(1); } + OPPONENT(SPECIES_KADABRA); + } WHEN { + TURN { MOVE(playerLeft, MOVE_EXPLOSION); } + } SCENE { + HP_BAR(playerLeft, hp: 0); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft); + HP_BAR(opponentLeft, hp: 0); + MESSAGE("Foe Abra fainted!"); + HP_BAR(playerRight, hp: 0); + MESSAGE("Wynaut fainted!"); + HP_BAR(opponentRight, hp: 0); + MESSAGE("Foe Kadabra fainted!"); + MESSAGE("Wobbuffet fainted!"); } } diff --git a/test/move_effect_healing_wish.c b/test/move_effect_healing_wish.c new file mode 100644 index 000000000..98e8730b3 --- /dev/null +++ b/test/move_effect_healing_wish.c @@ -0,0 +1,80 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_HEALING_WISH].effect == EFFECT_HEALING_WISH); + ASSUME(gBattleMoves[MOVE_LUNAR_DANCE].effect == EFFECT_HEALING_WISH); +} + +#define TEST_MAX_HP (100) + +SINGLE_BATTLE_TEST("Healing Wish causes the user to faint and fully heals the replacement") +{ + GIVEN { + ASSUME(B_HEALING_WISH_SWITCH >= GEN_5); + PLAYER(SPECIES_GARDEVOIR); + PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(TEST_MAX_HP); Status1(STATUS1_POISON); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_HEALING_WISH); SEND_OUT(player, 1); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HEALING_WISH, player); + HP_BAR(player, hp: 0); + MESSAGE("Gardevoir fainted!"); + MESSAGE("The healing wish came true for Wynaut!"); + HP_BAR(player, hp: TEST_MAX_HP); + STATUS_ICON(player, none: TRUE); + MESSAGE("Wynaut regained health!"); + } +} + +DOUBLE_BATTLE_TEST("Lunar Dance causes the user to faint and fully heals the replacement in a double battle") +{ + GIVEN { + ASSUME(B_HEALING_WISH_SWITCH >= GEN_5); + PLAYER(SPECIES_GARDEVOIR) { Speed(300); } + PLAYER(SPECIES_WOBBUFFET) { Speed(50); } + PLAYER(SPECIES_WYNAUT) { HP(TEST_MAX_HP - 1); MaxHP(TEST_MAX_HP); Status1(STATUS1_BURN); Speed(50); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(50); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(50); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_LUNAR_DANCE); SEND_OUT(playerLeft, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_LUNAR_DANCE, playerLeft); + HP_BAR(playerLeft, hp: 0); + MESSAGE("Gardevoir fainted!"); + MESSAGE("Wynaut became cloaked in mystical moonlight!"); + HP_BAR(playerLeft, hp: TEST_MAX_HP); + STATUS_ICON(playerLeft, none: TRUE); + MESSAGE("Wynaut regained health!"); + } +} + +SINGLE_BATTLE_TEST("Healing Wish effect activates only if the switched pokemon can be healed") +{ + GIVEN { + ASSUME(B_HEALING_WISH_SWITCH >= GEN_8); + PLAYER(SPECIES_GARDEVOIR) { Speed(300); } + PLAYER(SPECIES_NINJASK) { Speed(400); } + PLAYER(SPECIES_WYNAUT) { HP(TEST_MAX_HP / 2); MaxHP(TEST_MAX_HP); Status1(STATUS1_PARALYSIS); Speed(50); } + OPPONENT(SPECIES_WOBBUFFET) {Speed(50); } + } WHEN { + TURN { MOVE(player, MOVE_HEALING_WISH); SEND_OUT(player, 1); } + TURN { MOVE(player, MOVE_U_TURN); SEND_OUT(player, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HEALING_WISH, player); + HP_BAR(player, hp: 0); + MESSAGE("Gardevoir fainted!"); + NONE_OF { + MESSAGE("The healing wish came true for Wynaut!"); + MESSAGE("Wynaut regained health!"); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_U_TURN, player); + MESSAGE("Do it! Wynaut!"); + MESSAGE("The healing wish came true for Wynaut!"); + HP_BAR(player, hp: TEST_MAX_HP); + STATUS_ICON(player, none: TRUE); + MESSAGE("Wynaut regained health!"); + } +} diff --git a/test/move_effect_hit_switch_target.c b/test/move_effect_hit_switch_target.c new file mode 100644 index 000000000..9c50a4e4c --- /dev/null +++ b/test/move_effect_hit_switch_target.c @@ -0,0 +1,72 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_DRAGON_TAIL].effect == EFFECT_HIT_SWITCH_TARGET); + ASSUME(gBattleMoves[MOVE_LOCK_ON].effect == EFFECT_LOCK_ON); +} + +SINGLE_BATTLE_TEST("Dragon Tail switches the target with a random non-fainted replacement") +{ + KNOWN_FAILING; // Only 18/50. Waiting for an improved PASSES_RANDOMLY. + PASSES_RANDOMLY(90 * 1, 100 * 2); + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_BULBASAUR); + OPPONENT(SPECIES_CHARMANDER); + OPPONENT(SPECIES_SQUIRTLE) { HP(0); } + } WHEN { + TURN { MOVE(player, MOVE_DRAGON_TAIL); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_TAIL, player); + MESSAGE("Foe Bulbasaur was dragged out!"); + } +} + +DOUBLE_BATTLE_TEST("Dragon Tail switches the target with a random non-battler, non-fainted replacement") +{ + PASSES_RANDOMLY(90 * 1, 100 * 2); + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_BULBASAUR); + OPPONENT(SPECIES_CHARMANDER); + OPPONENT(SPECIES_SQUIRTLE) { HP(0); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_DRAGON_TAIL, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_TAIL, playerLeft); + MESSAGE("Foe Bulbasaur was dragged out!"); + } +} + +SINGLE_BATTLE_TEST("Dragon Tail does not fail if no replacements") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DRAGON_TAIL); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_TAIL, player); + NOT MESSAGE("But it failed!"); + } +} + +SINGLE_BATTLE_TEST("Dragon Tail does not fail if replacements fainted") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT) { HP(0); } + } WHEN { + TURN { MOVE(player, MOVE_DRAGON_TAIL); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_TAIL, player); + NOT MESSAGE("But it failed!"); + } +} diff --git a/test/move_effect_mind_blown.c b/test/move_effect_mind_blown.c new file mode 100644 index 000000000..6b053cfb5 --- /dev/null +++ b/test/move_effect_mind_blown.c @@ -0,0 +1,109 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_MIND_BLOWN].effect == EFFECT_MIND_BLOWN); +} + +#define HP_TEST (400) + +SINGLE_BATTLE_TEST("Mind Blown makes the user lose 1/2 of its HP") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST); MaxHP(HP_TEST); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_MIND_BLOWN); } + } SCENE { + HP_BAR(player, hp: HP_TEST / 2); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, player); + NOT MESSAGE("Wobbuffet fainted!"); // Wobb had more than 1/2 of its HP, so it can't faint. + } +} + +DOUBLE_BATTLE_TEST("Mind Blown makes the user lose 1/2 of its HP in a double battle") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST); MaxHP(HP_TEST); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerLeft, MOVE_MIND_BLOWN); } + } SCENE { + HP_BAR(playerLeft, hp: HP_TEST / 2); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, playerLeft); + NOT MESSAGE("Wobbuffet fainted!"); // Wobb had more than 1/2 of its HP, so it can't faint. + } +} + +SINGLE_BATTLE_TEST("Mind Blown causes the user to faint when below 1/2 of its HP") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST / 2); MaxHP(HP_TEST); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_MIND_BLOWN); } + } SCENE { + HP_BAR(player, hp: 0); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, player); + MESSAGE("Wobbuffet fainted!"); + } +} + +DOUBLE_BATTLE_TEST("Mind Blown causes the user to faint when below 1/2 of its HP in a double battle") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST / 2); MaxHP(HP_TEST); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerLeft, MOVE_MIND_BLOWN);} + } SCENE { + HP_BAR(playerLeft, hp: 0); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, playerLeft); + MESSAGE("Wobbuffet fainted!"); + } +} + +SINGLE_BATTLE_TEST("Mind Blown causes the user & the target to faint when below 1/2 of its HP") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST / 2) ; MaxHP(HP_TEST); } + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_MIND_BLOWN);} + } SCENE { + HP_BAR(player, hp: 0); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, player); + HP_BAR(opponent, hp: 0); + MESSAGE("Foe Wobbuffet fainted!"); + MESSAGE("Wobbuffet fainted!"); + } +} + +DOUBLE_BATTLE_TEST("Mind Blown causes everyone to faint in a double battle") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST / 2); MaxHP(HP_TEST); } + PLAYER(SPECIES_WYNAUT) { HP(1); } + OPPONENT(SPECIES_ABRA) { HP(1); } + OPPONENT(SPECIES_KADABRA) { HP(1); } + OPPONENT(SPECIES_KADABRA); + } WHEN { + TURN { MOVE(playerLeft, MOVE_MIND_BLOWN, criticalHit: FALSE); } + } SCENE { + HP_BAR(playerLeft, hp: 0); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, playerLeft); + HP_BAR(opponentLeft, hp: 0); + MESSAGE("Foe Abra fainted!"); + HP_BAR(playerRight, hp: 0); + MESSAGE("Wynaut fainted!"); + HP_BAR(opponentRight, hp: 0); + MESSAGE("Foe Kadabra fainted!"); + MESSAGE("Wobbuffet fainted!"); + } +} diff --git a/test/move_effect_recoil_if_miss.c b/test/move_effect_recoil_if_miss.c index 5c1f1a61a..8a80309d7 100644 --- a/test/move_effect_recoil_if_miss.c +++ b/test/move_effect_recoil_if_miss.c @@ -42,8 +42,8 @@ SINGLE_BATTLE_TEST("Jump Kick has 50% recoil on protect") SINGLE_BATTLE_TEST("Jump Kick has no recoil if no target") { - KNOWN_FAILING; // #2596. GIVEN { + ASSUME(B_HEALING_WISH_SWITCH >= GEN_5); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WYNAUT); diff --git a/test/move_effect_roar.c b/test/move_effect_roar.c new file mode 100644 index 000000000..2d4eadda8 --- /dev/null +++ b/test/move_effect_roar.c @@ -0,0 +1,70 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_ROAR].effect == EFFECT_ROAR); +} + +SINGLE_BATTLE_TEST("Roar switches the target with a random non-fainted replacement") +{ + PASSES_RANDOMLY(1, 2); + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_BULBASAUR); + OPPONENT(SPECIES_CHARMANDER); + OPPONENT(SPECIES_SQUIRTLE) { HP(0); } + } WHEN { + TURN { MOVE(player, MOVE_ROAR); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROAR, player); + MESSAGE("Foe Bulbasaur was dragged out!"); + } +} + +DOUBLE_BATTLE_TEST("Roar switches the target with a random non-battler, non-fainted replacement") +{ + PASSES_RANDOMLY(1, 2); + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_BULBASAUR); + OPPONENT(SPECIES_CHARMANDER); + OPPONENT(SPECIES_SQUIRTLE) { HP(0); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_ROAR, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROAR, playerLeft); + MESSAGE("Foe Bulbasaur was dragged out!"); + } +} + +SINGLE_BATTLE_TEST("Roar fails if no replacements") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_ROAR); } + } SCENE { + MESSAGE("Wobbuffet used Roar!"); + MESSAGE("But it failed!"); + } +} + +SINGLE_BATTLE_TEST("Roar fails if replacements fainted") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT) { HP(0); } + } WHEN { + TURN { MOVE(player, MOVE_ROAR); } + } SCENE { + MESSAGE("Wobbuffet used Roar!"); + MESSAGE("But it failed!"); + } +} diff --git a/test/move_effect_shell_trap.c b/test/move_effect_shell_trap.c new file mode 100644 index 000000000..27dc4b7f6 --- /dev/null +++ b/test/move_effect_shell_trap.c @@ -0,0 +1,168 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_SHELL_TRAP].effect == EFFECT_SHELL_TRAP); + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); + ASSUME(gBattleMoves[MOVE_WATER_GUN].split == SPLIT_SPECIAL); + ASSUME(gBattleMoves[MOVE_LEER].split == SPLIT_STATUS); +} + +SINGLE_BATTLE_TEST("Shell Trap activates only if hit by a physical move") +{ + u32 move; + bool32 activate; + PARAMETRIZE { move = MOVE_TACKLE; activate = TRUE; } + PARAMETRIZE { move = MOVE_WATER_GUN; activate = FALSE; } + PARAMETRIZE { move = MOVE_LEER; activate = FALSE; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SHELL_TRAP); MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, player); + MESSAGE("Wobbuffet set a shell trap!"); + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + + if (activate) { + MESSAGE("Wobbuffet used Shell Trap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, player); + HP_BAR(opponent); + } else { + MESSAGE("Wobbuffet's shell trap didn't work!"); + NONE_OF { + MESSAGE("Wobbuffet used Shell Trap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, player); + HP_BAR(opponent); + } + } + } +} + +SINGLE_BATTLE_TEST("Shell Trap does not activate if attacker's Sheer Force applied") +{ + u32 move; + bool32 activate; + PARAMETRIZE { move = MOVE_TACKLE; activate = TRUE; } + PARAMETRIZE { move = MOVE_STOMP; activate = FALSE; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_TAUROS) { Ability(ABILITY_SHEER_FORCE); } + } WHEN { + TURN { MOVE(player, MOVE_SHELL_TRAP); MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, player); + MESSAGE("Wobbuffet set a shell trap!"); + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + if (activate) { + MESSAGE("Wobbuffet used Shell Trap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, player); + HP_BAR(opponent); + } else { + MESSAGE("Wobbuffet's shell trap didn't work!"); + NONE_OF { + MESSAGE("Wobbuffet used Shell Trap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, player); + HP_BAR(opponent); + } + } + } +} + +SINGLE_BATTLE_TEST("Shell Trap does not activate if battler faints before being able to activate it") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(1); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SHELL_TRAP); MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, player); + MESSAGE("Wobbuffet set a shell trap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + MESSAGE("Wobbuffet fainted!"); + MESSAGE("Go! Wobbuffet!"); + NONE_OF { + MESSAGE("Wobbuffet used Shell Trap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, player); + HP_BAR(opponent); + } + } +} + +DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 1 and attacks both opponents") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_SHELL_TRAP].target == MOVE_TARGET_BOTH); + PLAYER(SPECIES_WOBBUFFET) { Speed(1); } + PLAYER(SPECIES_WOBBUFFET) { Speed(2); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(5); } + OPPONENT(SPECIES_WYNAUT) { Speed(1); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_SHELL_TRAP); MOVE(opponentLeft, MOVE_TACKLE, target:playerLeft); MOVE(playerRight, MOVE_CELEBRATE); MOVE(opponentRight, MOVE_CELEBRATE); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, playerLeft); + MESSAGE("Wobbuffet set a shell trap!"); + MESSAGE("Foe Wobbuffet used Tackle!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + MESSAGE("Wobbuffet used Shell Trap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, playerLeft); + HP_BAR(opponentLeft); + HP_BAR(opponentRight); + MESSAGE("Wobbuffet used Celebrate!"); + MESSAGE("Foe Wynaut used Celebrate!"); + } +} + +DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 2 and attacks both opponents") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_SHELL_TRAP].target == MOVE_TARGET_BOTH); + PLAYER(SPECIES_WOBBUFFET) { Speed(1); } + PLAYER(SPECIES_WOBBUFFET) { Speed(2); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(5); } + OPPONENT(SPECIES_WYNAUT) { Speed(6); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_SHELL_TRAP); MOVE(opponentLeft, MOVE_TACKLE, target:playerLeft); MOVE(playerRight, MOVE_CELEBRATE); MOVE(opponentRight, MOVE_CELEBRATE); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, playerLeft); + MESSAGE("Wobbuffet set a shell trap!"); + MESSAGE("Foe Wynaut used Celebrate!"); + MESSAGE("Foe Wobbuffet used Tackle!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + MESSAGE("Wobbuffet used Shell Trap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, playerLeft); + HP_BAR(opponentLeft); + HP_BAR(opponentRight); + MESSAGE("Wobbuffet used Celebrate!"); + } +} + +DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 3 and attacks both opponents") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_SHELL_TRAP].target == MOVE_TARGET_BOTH); + PLAYER(SPECIES_WOBBUFFET) { Speed(1); } + PLAYER(SPECIES_WOBBUFFET) { Speed(7); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(5); } + OPPONENT(SPECIES_WYNAUT) { Speed(6); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_SHELL_TRAP); MOVE(opponentLeft, MOVE_TACKLE, target:playerLeft); MOVE(playerRight, MOVE_CELEBRATE); MOVE(opponentRight, MOVE_CELEBRATE); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, playerLeft); + MESSAGE("Wobbuffet set a shell trap!"); + MESSAGE("Wobbuffet used Celebrate!"); + MESSAGE("Foe Wynaut used Celebrate!"); + MESSAGE("Foe Wobbuffet used Tackle!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + MESSAGE("Wobbuffet used Shell Trap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, playerLeft); + HP_BAR(opponentLeft); + HP_BAR(opponentRight); + } +} diff --git a/test/powder_moves.c b/test/powder_moves.c new file mode 100644 index 000000000..cb0aee528 --- /dev/null +++ b/test/powder_moves.c @@ -0,0 +1,47 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Powder Moves are blocked by Grass Types") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER); + ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ODDISH); + } WHEN { + TURN { MOVE(player, MOVE_STUN_SPORE); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); + MESSAGE("It doesn't affect Foe Oddish…"); + } +} + +SINGLE_BATTLE_TEST("Powder Moves are blocked by Ability Overcoat") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_PINECO) { Ability(ABILITY_OVERCOAT);}; + } WHEN { + TURN { MOVE(player, MOVE_STUN_SPORE); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_OVERCOAT); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); + MESSAGE("It doesn't affect Foe Pineco…"); + } +} + +SINGLE_BATTLE_TEST("Powder Moves are blocked by Item Safety Goggles") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER); + ASSUME(gItems[ITEM_SAFETY_GOGGLES].holdEffect == HOLD_EFFECT_SAFETY_GOGGLES); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ABRA) { Item(ITEM_SAFETY_GOGGLES);}; + } WHEN { + TURN { MOVE(player, MOVE_STUN_SPORE); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); + MESSAGE("Foe Abra is not affected thanks to its SafetyGoggles!"); + } +} diff --git a/test/test.h b/test/test.h index cbcf11717..c69a4fa92 100644 --- a/test/test.h +++ b/test/test.h @@ -39,7 +39,6 @@ struct TestRunnerState u8 exitCode; s32 tests; s32 passes; - s32 skips; const char *skipFilename; const struct Test *test; u32 processCosts[MAX_PROCESSES]; diff --git a/test/test_battle.h b/test/test_battle.h index 8fb1ce6d3..806e7947e 100644 --- a/test/test_battle.h +++ b/test/test_battle.h @@ -112,17 +112,17 @@ * NOT STATUS_ICON(opponent, paralysis: TRUE); to say that Oddish was * not paralyzed without specifying the exact outputs which led to that. * - * As a final example, to test that Howl works you might: - * 1. Put a Wobbuffet that knows Howl and Tackle in your party. + * As a final example, to test that Meditate works you might: + * 1. Put a Wobbuffet that knows Meditate and Tackle in your party. * 2. Battle a wild Wobbuffet. * 3. Use Tackle and note the amount the HP bar reduced. * 4. Battle a wild Wobbuffet. - * 5. Use Howl and that that the stat change animation and message play. + * 5. Use Meditate and that the stat change animation and message play. * 6. Use Tackle and check that the HP bar reduced by more than in 3. * * This can be translated to an automated test as follows: * - * SINGLE_BATTLE_TEST("Howl raises Attack", s16 damage) + * SINGLE_BATTLE_TEST("Meditate raises Attack", s16 damage) * { * bool32 raiseAttack; * PARAMETRIZE { raiseAttack = FALSE; } @@ -132,11 +132,11 @@ * PLAYER(SPECIES_WOBBUFFET); * OPPONENT(SPECIES_WOBBUFFET); * } WHEN { - * if (raiseAttack) TURN { MOVE(player, MOVE_HOWL); } // 5. + * if (raiseAttack) TURN { MOVE(player, MOVE_MEDITATE); } // 5. * TURN { MOVE(player, MOVE_TACKLE); } // 3 & 6. * } SCENE { * if (raiseAttack) { - * ANIMATION(ANIM_TYPE_MOVE, MOVE_HOWL, player); + * ANIMATION(ANIM_TYPE_MOVE, MOVE_MEDITATE, player); * ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); // 5. * MESSAGE("Wobbuffet's attack rose!"); // 5. * } @@ -159,7 +159,7 @@ * of the first battle (with a small tolerance to account for rounding). * * You might notice that all the tests check the outputs the player - * could see rather than the internal battle state. e.g. the Howl test + * could see rather than the internal battle state. e.g. the Meditate test * could have used gBattleMons[B_POSITION_OPPONENT_LEFT].hp instead of * using HP_BAR to capture the damage. This is a deliberate choice, by * checking what the player can observe the tests are more robust to diff --git a/test/test_runner.c b/test/test_runner.c index a10a3a89d..6620548dc 100644 --- a/test/test_runner.c +++ b/test/test_runner.c @@ -7,7 +7,7 @@ #include "test.h" #include "test_runner.h" -#define TIMEOUT_SECONDS 30 +#define TIMEOUT_SECONDS 55 void CB2_TestRunner(void); @@ -60,7 +60,6 @@ void CB2_TestRunner(void) gTestRunnerState.exitCode = 0; gTestRunnerState.tests = 0; gTestRunnerState.passes = 0; - gTestRunnerState.skips = 0; gTestRunnerState.skipFilename = NULL; gTestRunnerState.test = __start_tests - 1; break; @@ -70,20 +69,15 @@ void CB2_TestRunner(void) if (gTestRunnerState.test == __stop_tests) { - MgbaPrintf_("%s%d/%d PASSED\e[0m", gTestRunnerState.exitCode == 0 ? "\e[32m" : "\e[31m", gTestRunnerState.passes, gTestRunnerState.tests); - if (gTestRunnerState.skips) - { - if (gTestRunnerSkipIsFail) - MgbaPrintf_("\e[31m%d SKIPPED\e[0m", gTestRunnerState.skips); - else - MgbaPrintf_("%d SKIPPED", gTestRunnerState.skips); - } gTestRunnerState.state = STATE_EXIT; return; } - if (!PrefixMatch(gTestRunnerArgv, gTestRunnerState.test->name)) + if (gTestRunnerState.test->runner != &gAssumptionsRunner + && !PrefixMatch(gTestRunnerArgv, gTestRunnerState.test->name)) + { return; + } // Greedily assign tests to processes based on estimated cost. // TODO: Make processCosts a min heap. @@ -111,6 +105,7 @@ void CB2_TestRunner(void) return; } + MgbaPrintf_(":N%s", gTestRunnerState.test->name); gTestRunnerState.state = STATE_REPORT_RESULT; gTestRunnerState.result = TEST_RESULT_PASS; gTestRunnerState.expectedResult = TEST_RESULT_PASS; @@ -130,7 +125,6 @@ void CB2_TestRunner(void) } else { - MgbaPrintf_(":N%s", gTestRunnerState.test->name); if (gTestRunnerState.test->runner->setUp) gTestRunnerState.test->runner->setUp(gTestRunnerState.test->data); gTestRunnerState.test->runner->run(gTestRunnerState.test->data); @@ -150,12 +144,6 @@ void CB2_TestRunner(void) if (gTestRunnerState.result != TEST_RESULT_PASS) gTestRunnerState.skipFilename = gTestRunnerState.test->filename; } - else if (gTestRunnerState.result == TEST_RESULT_SKIP) - { - gTestRunnerState.skips++; - if (gTestRunnerSkipIsFail) - gTestRunnerState.exitCode = 1; - } else { const char *color; @@ -187,7 +175,17 @@ void CB2_TestRunner(void) switch (gTestRunnerState.result) { - case TEST_RESULT_FAIL: result = "FAIL"; break; + case TEST_RESULT_FAIL: + if (gTestRunnerState.expectedResult == TEST_RESULT_FAIL) + { + result = "KNOWN_FAILING"; + color = "\e[33m"; + } + else + { + result = "FAIL"; + } + break; case TEST_RESULT_PASS: result = "PASS"; break; case TEST_RESULT_SKIP: result = "SKIP"; break; case TEST_RESULT_INVALID: result = "INVALID"; break; @@ -196,7 +194,10 @@ void CB2_TestRunner(void) default: result = "UNKNOWN"; break; } - MgbaPrintf_(":R%s%s\e[0m", color, result); + if (gTestRunnerState.expectedResult == gTestRunnerState.result) + MgbaPrintf_(":P%s%s\e[0m", color, result); + else + MgbaPrintf_(":F%s%s\e[0m", color, result); } break; diff --git a/tools/mgba-rom-test-hydra/main.c b/tools/mgba-rom-test-hydra/main.c index f9c51d505..4ce9b09bd 100644 --- a/tools/mgba-rom-test-hydra/main.c +++ b/tools/mgba-rom-test-hydra/main.c @@ -30,7 +30,7 @@ struct Runner { pid_t pid; int outfd; - char rom_path[L_tmpnam]; + char rom_path[FILENAME_MAX]; char test_name[256]; size_t input_buffer_size; size_t input_buffer_capacity; @@ -38,6 +38,8 @@ struct Runner size_t output_buffer_size; size_t output_buffer_capacity; char *output_buffer; + int passes; + int results; }; static unsigned nrunners = 0; @@ -72,7 +74,11 @@ static void handle_read(struct Runner *runner) runner->test_name[eol - soc - 1] = '\0'; break; - case 'R': + case 'P': + case 'F': + if (soc[1] == 'P') + runner->passes++; + runner->results++; soc += 2; fprintf(stdout, "%s: ", runner->test_name); fwrite(soc, 1, eol - soc, stdout); @@ -234,53 +240,6 @@ int main(int argc, char *argv[]) perror("pipe failed"); exit(2); } - if (!tmpnam(runners[i].rom_path)) - { - perror("tmpnam rom_path failed"); - exit(2); - } - int tmpfd; - if ((tmpfd = open(runners[i].rom_path, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) == -1) - { - perror("open tmpfd failed"); - _exit(2); - } - if ((write(tmpfd, elf, elfst.st_size)) == -1) - { - perror("write tmpfd failed"); - _exit(2); - } - pid_t patchelfpid = fork(); - if (patchelfpid == -1) - { - perror("fork patchelf failed"); - _exit(2); - } - else if (patchelfpid == 0) - { - char n_arg[5], i_arg[5]; - snprintf(n_arg, sizeof(n_arg), "\\x%02x", nrunners); - snprintf(i_arg, sizeof(i_arg), "\\x%02x", i); - if (execlp("tools/patchelf/patchelf", "tools/patchelf/patchelf", runners[i].rom_path, "gTestRunnerN", n_arg, "gTestRunnerI", i_arg, NULL) == -1) - { - perror("execlp patchelf failed"); - _exit(2); - } - } - else - { - int wstatus; - if (waitpid(patchelfpid, &wstatus, 0) == -1) - { - perror("waitpid patchelfpid failed"); - _exit(2); - } - if (!WIFEXITED(wstatus) || WEXITSTATUS(wstatus) != 0) - { - fprintf(stderr, "patchelf exited with an error\n"); - _exit(2); - } - } pid_t pid = fork(); if (pid == -1) { perror("fork mgba-rom-test failed"); @@ -310,15 +269,60 @@ int main(int argc, char *argv[]) perror("close pipefds[1] failed"); _exit(2); } + char rom_path[FILENAME_MAX]; + sprintf(rom_path, "/tmp/file%05d", getpid()); + int tmpfd; + if ((tmpfd = open(rom_path, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) == -1) + { + perror("open tmpfd failed"); + _exit(2); + } + if ((write(tmpfd, elf, elfst.st_size)) == -1) + { + perror("write tmpfd failed"); + _exit(2); + } + pid_t patchelfpid = fork(); + if (patchelfpid == -1) + { + perror("fork patchelf failed"); + _exit(2); + } + else if (patchelfpid == 0) + { + char n_arg[5], i_arg[5]; + snprintf(n_arg, sizeof(n_arg), "\\x%02x", nrunners); + snprintf(i_arg, sizeof(i_arg), "\\x%02x", i); + if (execlp("tools/patchelf/patchelf", "tools/patchelf/patchelf", rom_path, "gTestRunnerN", n_arg, "gTestRunnerI", i_arg, NULL) == -1) + { + perror("execlp patchelf failed"); + _exit(2); + } + } + else + { + int wstatus; + if (waitpid(patchelfpid, &wstatus, 0) == -1) + { + perror("waitpid patchelfpid failed"); + _exit(2); + } + if (!WIFEXITED(wstatus) || WEXITSTATUS(wstatus) != 0) + { + fprintf(stderr, "patchelf exited with an error\n"); + _exit(2); + } + } // stdbuf is required because otherwise mgba never flushes // stdout. - if (execlp("stdbuf", "stdbuf", "-oL", argv[1], "-l15", "-ClogLevel.gba.dma=16", "-Rr0", runners[i].rom_path, NULL) == -1) + if (execlp("stdbuf", "stdbuf", "-oL", argv[1], "-l15", "-ClogLevel.gba.dma=16", "-Rr0", rom_path, NULL) == -1) { perror("execl stdbuf mgba-rom-test failed"); _exit(2); } } else { runners[i].pid = pid; + sprintf(runners[i].rom_path, "/tmp/file%05d", runners[i].pid); runners[i].outfd = pipefds[0]; if (close(pipefds[1]) == -1) { @@ -406,6 +410,8 @@ int main(int argc, char *argv[]) // Reap test runners and collate exit codes. int exit_code = 0; + int passes = 0; + int results = 0; for (int i = 0; i < nrunners; i++) { int wstatus; @@ -414,8 +420,14 @@ int main(int argc, char *argv[]) perror("waitpid runners[i] failed"); exit(2); } + if (runners[i].output_buffer_size > 0) + fwrite(runners[i].output_buffer, 1, runners[i].output_buffer_size, stdout); if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) > exit_code) exit_code = WEXITSTATUS(wstatus); + passes += runners[i].passes; + results += runners[i].results; } + fprintf(stdout, "%d/%d \e[32mPASS\e[0med\n", passes, results); + fflush(stdout); return exit_code; }