Merge branch '_RHH/upcoming' into _RHH/pr/master/1.9.0
18
Makefile
@ -169,11 +169,12 @@ JSONPROC := tools/jsonproc/jsonproc$(EXE)
|
||||
PATCHELF := tools/patchelf/patchelf$(EXE)
|
||||
ROMTEST ?= $(shell { command -v mgba-rom-test || command -v tools/mgba/mgba-rom-test$(EXE); } 2>/dev/null)
|
||||
ROMTESTHYDRA := tools/mgba-rom-test-hydra/mgba-rom-test-hydra$(EXE)
|
||||
TRAINERPROC := tools/trainerproc/trainerproc$(EXE)
|
||||
|
||||
PERL := perl
|
||||
|
||||
# Inclusive list. If you don't want a tool to be built, don't add it here.
|
||||
TOOLDIRS := tools/aif2pcm tools/bin2c tools/gbafix tools/gbagfx tools/jsonproc tools/mapjson tools/mid2agb tools/preproc tools/ramscrgen tools/rsfont tools/scaninc
|
||||
TOOLDIRS := tools/aif2pcm tools/bin2c tools/gbafix tools/gbagfx tools/jsonproc tools/mapjson tools/mid2agb tools/preproc tools/ramscrgen tools/rsfont tools/scaninc tools/trainerproc
|
||||
CHECKTOOLDIRS = tools/patchelf tools/mgba-rom-test-hydra
|
||||
TOOLBASE = $(TOOLDIRS:tools/%=%)
|
||||
TOOLS = $(foreach tool,$(TOOLBASE),tools/$(tool)/$(tool)$(EXE))
|
||||
@ -295,7 +296,7 @@ mostlyclean: tidynonmodern tidymodern tidycheck
|
||||
rm -f $(MID_SUBDIR)/*.s
|
||||
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} +
|
||||
rm -f $(DATA_ASM_SUBDIR)/layouts/layouts.inc $(DATA_ASM_SUBDIR)/layouts/layouts_table.inc
|
||||
rm -f $(DATA_ASM_SUBDIR)/maps/connections.inc $(DATA_ASM_SUBDIR)/maps/events.inc $(DATA_ASM_SUBDIR)/maps/groups.inc $(DATA_ASM_SUBDIR)/maps/headers.inc
|
||||
rm -f $(DATA_ASM_SUBDIR)/maps/connections.inc $(DATA_ASM_SUBDIR)/maps/events.inc $(DATA_ASM_SUBDIR)/maps/groups.inc $(DATA_ASM_SUBDIR)/maps/headers.inc $(DATA_SRC_SUBDIR)/map_group_count.h
|
||||
find $(DATA_ASM_SUBDIR)/maps \( -iname 'connections.inc' -o -iname 'events.inc' -o -iname 'header.inc' \) -exec rm {} +
|
||||
rm -f $(AUTO_GEN_TARGETS)
|
||||
@$(MAKE) clean -C libagbsyscall
|
||||
@ -343,6 +344,10 @@ $(CRY_SUBDIR)/uncomp_%.bin: $(CRY_SUBDIR)/uncomp_%.aif ; $(AIF) $< $@
|
||||
$(CRY_SUBDIR)/%.bin: $(CRY_SUBDIR)/%.aif ; $(AIF) $< $@ --compress
|
||||
sound/%.bin: sound/%.aif ; $(AIF) $< $@
|
||||
|
||||
COMPETITIVE_PARTY_SYNTAX := $(shell PATH="$(PATH)"; echo 'COMPETITIVE_PARTY_SYNTAX' | $(CPP) $(CPPFLAGS) -imacros include/global.h | tail -n1)
|
||||
ifeq ($(COMPETITIVE_PARTY_SYNTAX),1)
|
||||
%.h: %.party tools ; $(CPP) $(CPPFLAGS) -traditional-cpp - < $< | sed '/#[^p]/d' | $(TRAINERPROC) -o $@ -i $< -
|
||||
endif
|
||||
|
||||
ifeq ($(MODERN),0)
|
||||
$(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE)
|
||||
@ -362,6 +367,8 @@ $(C_BUILDDIR)/librfu_intr.o: CFLAGS := -O2 -mthumb-interwork -quiet
|
||||
else
|
||||
$(C_BUILDDIR)/librfu_intr.o: CFLAGS := -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast
|
||||
$(C_BUILDDIR)/pokedex_plus_hgss.o: CFLAGS := -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init
|
||||
# Annoyingly we can't turn this on just for src/data/trainers.h
|
||||
$(C_BUILDDIR)/data.o: CFLAGS += -fno-show-column -fno-diagnostics-show-caret
|
||||
endif
|
||||
|
||||
ifeq ($(DINFO),1)
|
||||
@ -502,7 +509,12 @@ $(ROM): $(ELF)
|
||||
$(OBJCOPY) -O binary $< $@
|
||||
$(FIX) $@ -p --silent
|
||||
|
||||
agbcc: all
|
||||
# Uncomment the next line, and then comment the 4 lines after it to reenable agbcc.
|
||||
#agbcc: all
|
||||
agbcc:
|
||||
@echo "'make agbcc' is deprecated as of pokeemerald-expansion 1.9 and will be removed in 1.10."
|
||||
@echo "Search for 'agbcc: all' in Makefile to reenable agbcc."
|
||||
@exit 1
|
||||
|
||||
modern: all
|
||||
|
||||
|
||||
@ -141,6 +141,14 @@ Based off RHH's pokeemerald-expansion 1.8.6 https://github.com/rh-hideout/pokeem
|
||||
- [Nature Colors](https://github.com/DizzyEggg/pokeemerald/tree/nature_color) in summary screen by @DizzyEggg
|
||||
- [Dynamic Multichoice](https://github.com/SBird1337/pokeemerald/tree/feature/dynmulti) by @SBird1337
|
||||
- [Saveblock Cleansing](https://github.com/ghoulslash/pokeemerald/tree/saveblock) by @ghoulslash
|
||||
- [Followers & Expanded IDs](https://github.com/aarant/pokeemerald/tree/followers-expanded-id) by @aarant
|
||||
- May be disabled.
|
||||
- Includes Pokémon followers like in HGSS, including interactions.
|
||||
- ***Expands the amount of possible object event IDs beyond 255.***
|
||||
- ***Includes an implementation of dynamic overworld palettes (DOWP).***
|
||||
- **Additional features**:
|
||||
- *Pokémon overworld sprites up to Generation 8.*
|
||||
- *Integration with our Pokémon Sprite Visualizer, allowing users to browse through the follower sprites alongside battle sprites.*
|
||||
- ***Other features***
|
||||
- Pressing B while holding a Pokémon drops them like in modern games (configurable).
|
||||
- Running indoors (configurable).
|
||||
|
||||
@ -321,6 +321,19 @@
|
||||
.4byte \jumpInstr
|
||||
.endm
|
||||
|
||||
.macro createdragondartsprite anim_battler:req, subpriority_offset:req, argv:vararg
|
||||
.byte 0x34
|
||||
.if \anim_battler == ANIM_TARGET
|
||||
.byte ANIMSPRITE_IS_TARGET | (\subpriority_offset & 0x7F)
|
||||
.else
|
||||
.byte (\subpriority_offset & 0x7F)
|
||||
.endif
|
||||
.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
|
||||
|
||||
@ -710,8 +710,9 @@
|
||||
.byte 0x7c
|
||||
.endm
|
||||
|
||||
.macro setrain
|
||||
.macro setfieldweather weather:req
|
||||
.byte 0x7d
|
||||
.byte \weather
|
||||
.endm
|
||||
|
||||
.macro setreflect
|
||||
@ -833,11 +834,11 @@
|
||||
.byte 0x94
|
||||
.endm
|
||||
|
||||
.macro setsandstorm
|
||||
.macro unused_95
|
||||
.byte 0x95
|
||||
.endm
|
||||
|
||||
.macro weatherdamage
|
||||
.macro unused_96
|
||||
.byte 0x96
|
||||
.endm
|
||||
|
||||
@ -1006,7 +1007,7 @@
|
||||
.4byte \jumpInstr
|
||||
.endm
|
||||
|
||||
.macro setsunny
|
||||
.macro unused_bb
|
||||
.byte 0xbb
|
||||
.endm
|
||||
|
||||
@ -1081,7 +1082,7 @@
|
||||
.byte 0xc7
|
||||
.endm
|
||||
|
||||
.macro sethail
|
||||
.macro unused_c8
|
||||
.byte 0xc8
|
||||
.endm
|
||||
|
||||
@ -1351,6 +1352,22 @@
|
||||
.endm
|
||||
|
||||
@ callnative macros
|
||||
.macro savetarget
|
||||
callnative BS_SaveTarget
|
||||
.endm
|
||||
|
||||
.macro restoretarget
|
||||
callnative BS_RestoreTarget
|
||||
.endm
|
||||
|
||||
.macro saveattacker
|
||||
callnative BS_SaveAttacker
|
||||
.endm
|
||||
|
||||
.macro restoreattacker
|
||||
callnative BS_RestoreAttacker
|
||||
.endm
|
||||
|
||||
.macro metalburstdamagecalculator failInstr:req
|
||||
callnative BS_CalcMetalBurstDmg
|
||||
.4byte \failInstr
|
||||
@ -1411,10 +1428,6 @@
|
||||
callnative BS_TryRevertWeatherForm
|
||||
.endm
|
||||
|
||||
.macro setsnow
|
||||
callnative BS_SetSnow
|
||||
.endm
|
||||
|
||||
.macro applysaltcure battler:req
|
||||
callnative BS_ApplySaltCure
|
||||
.byte \battler
|
||||
@ -1547,10 +1560,6 @@
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro damagenontypes
|
||||
callnative BS_DamageNonTypes
|
||||
.endm
|
||||
|
||||
.macro trysetstatus1, ptr:req
|
||||
callnative BS_TrySetStatus1
|
||||
.4byte \ptr
|
||||
@ -1620,6 +1629,10 @@
|
||||
callnative BS_TryUpdateRecoilTracker
|
||||
.endm
|
||||
|
||||
.macro tryupdateleaderscresttracker
|
||||
callnative BS_TryUpdateLeadersCrestTracker
|
||||
.endm
|
||||
|
||||
.macro trytidyup clear:req, jumpInstr:req
|
||||
callnative BS_TryTidyUp
|
||||
.byte \clear
|
||||
@ -1645,6 +1658,18 @@
|
||||
.4byte \failInstr
|
||||
.endm
|
||||
|
||||
.macro removeweather
|
||||
callnative BS_RemoveWeather
|
||||
.endm
|
||||
|
||||
.macro applyterastallization
|
||||
callnative BS_ApplyTerastallization
|
||||
.endm
|
||||
|
||||
.macro damagetoquartertargethp
|
||||
callnative BS_DamageToQuarterTargetHP
|
||||
.endm
|
||||
|
||||
@ various command changed to more readable macros
|
||||
.macro cancelmultiturnmoves battler:req
|
||||
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
|
||||
@ -1767,14 +1792,6 @@
|
||||
various \battler, VARIOUS_SWITCHIN_ABILITIES
|
||||
.endm
|
||||
|
||||
.macro savetarget
|
||||
various BS_TARGET, VARIOUS_SAVE_TARGET
|
||||
.endm
|
||||
|
||||
.macro restoretarget
|
||||
various BS_TARGET, VARIOUS_RESTORE_TARGET
|
||||
.endm
|
||||
|
||||
.macro instanthpdrop battler:req
|
||||
various \battler, VARIOUS_INSTANT_HP_DROP
|
||||
.endm
|
||||
|
||||
@ -776,6 +776,16 @@
|
||||
trainerbattle TRAINER_BATTLE_SINGLE_NO_INTRO_TEXT, \trainer, 0, \lose_text
|
||||
.endm
|
||||
|
||||
@ Starts a double battle with the player against two trainers
|
||||
@ Takes two trainers and defeat text for each
|
||||
.macro trainerbattle_two_trainers trainer_a:req, lose_text_a:req, trainer_b:req, lose_text_b:req
|
||||
.byte 0x5c
|
||||
.byte TRAINER_BATTLE_TWO_TRAINERS_NO_INTRO
|
||||
.2byte \trainer_a
|
||||
.4byte \lose_text_a
|
||||
.2byte \trainer_b
|
||||
.4byte \lose_text_b
|
||||
.endm
|
||||
|
||||
@ Starts a trainer battle using the battle information stored in RAM (usually by the scripts in trainer_battle.inc, which
|
||||
@ are run by trainerbattle), and blocks script execution until the battle finishes.
|
||||
@ -987,7 +997,69 @@
|
||||
@ Gives the player a Pokémon of the specified species and level, and allows to customize extra parameters.
|
||||
@ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome.
|
||||
.macro givemon species:req, level:req, item, ball, nature, abilityNum, gender, hpEv, atkEv, defEv, speedEv, spAtkEv, spDefEv, hpIv, atkIv, defIv, speedIv, spAtkIv, spDefIv, move1, move2, move3, move4, isShiny, ggMaxFactor, teraType
|
||||
callnative ScrCmd_givemon
|
||||
callnative ScrCmd_createmon
|
||||
.byte 0
|
||||
.byte 6 @ PARTY_SIZE - assign to first empty slot
|
||||
.set givemon_flags, 0
|
||||
.2byte \species
|
||||
.2byte \level
|
||||
.ifnb \item; .set givemon_flags, givemon_flags | (1 << 0); .endif
|
||||
.ifnb \ball; .set givemon_flags, givemon_flags | (1 << 1); .endif
|
||||
.ifnb \nature; .set givemon_flags, givemon_flags | (1 << 2); .endif
|
||||
.ifnb \abilityNum; .set givemon_flags, givemon_flags | (1 << 3); .endif
|
||||
.ifnb \gender; .set givemon_flags, givemon_flags | (1 << 4); .endif
|
||||
.ifnb \hpEv; .set givemon_flags, givemon_flags | (1 << 5); .endif
|
||||
.ifnb \atkEv; .set givemon_flags, givemon_flags | (1 << 6); .endif
|
||||
.ifnb \defEv; .set givemon_flags, givemon_flags | (1 << 7); .endif
|
||||
.ifnb \speedEv; .set givemon_flags, givemon_flags | (1 << 8); .endif
|
||||
.ifnb \spAtkEv; .set givemon_flags, givemon_flags | (1 << 9); .endif
|
||||
.ifnb \spDefEv; .set givemon_flags, givemon_flags | (1 << 10); .endif
|
||||
.ifnb \hpIv; .set givemon_flags, givemon_flags | (1 << 11); .endif
|
||||
.ifnb \atkIv; .set givemon_flags, givemon_flags | (1 << 12); .endif
|
||||
.ifnb \defIv; .set givemon_flags, givemon_flags | (1 << 13); .endif
|
||||
.ifnb \speedIv; .set givemon_flags, givemon_flags | (1 << 14); .endif
|
||||
.ifnb \spAtkIv; .set givemon_flags, givemon_flags | (1 << 15); .endif
|
||||
.ifnb \spDefIv; .set givemon_flags, givemon_flags | (1 << 16); .endif
|
||||
.ifnb \move1; .set givemon_flags, givemon_flags | (1 << 17); .endif
|
||||
.ifnb \move2; .set givemon_flags, givemon_flags | (1 << 18); .endif
|
||||
.ifnb \move3; .set givemon_flags, givemon_flags | (1 << 19); .endif
|
||||
.ifnb \move4; .set givemon_flags, givemon_flags | (1 << 20); .endif
|
||||
.ifnb \isShiny; .set givemon_flags, givemon_flags | (1 << 21); .endif
|
||||
.ifnb \ggMaxFactor; .set givemon_flags, givemon_flags | (1 << 22); .endif
|
||||
.ifnb \teraType; .set givemon_flags, givemon_flags | (1 << 23); .endif
|
||||
.4byte givemon_flags
|
||||
.ifnb \item; .2byte \item; .endif
|
||||
.ifnb \ball; .2byte \ball; .endif
|
||||
.ifnb \nature; .2byte \nature; .endif
|
||||
.ifnb \abilityNum; .2byte \abilityNum; .endif
|
||||
.ifnb \gender; .2byte \gender; .endif
|
||||
.ifnb \hpEv; .2byte \hpEv; .endif
|
||||
.ifnb \atkEv; .2byte \atkEv; .endif
|
||||
.ifnb \defEv; .2byte \defEv; .endif
|
||||
.ifnb \speedEv; .2byte \speedEv; .endif
|
||||
.ifnb \spAtkEv; .2byte \spAtkEv; .endif
|
||||
.ifnb \spDefEv; .2byte \spDefEv; .endif
|
||||
.ifnb \hpIv; .2byte \hpIv; .endif
|
||||
.ifnb \atkIv; .2byte \atkIv; .endif
|
||||
.ifnb \defIv; .2byte \defIv; .endif
|
||||
.ifnb \speedIv; .2byte \speedIv; .endif
|
||||
.ifnb \spAtkIv; .2byte \spAtkIv; .endif
|
||||
.ifnb \spDefIv; .2byte \spDefIv; .endif
|
||||
.ifnb \move1; .2byte \move1; .endif
|
||||
.ifnb \move2; .2byte \move2; .endif
|
||||
.ifnb \move3; .2byte \move3; .endif
|
||||
.ifnb \move4; .2byte \move4; .endif
|
||||
.ifnb \isShiny; .2byte \isShiny; .endif
|
||||
.ifnb \ggMaxFactor; .2byte \ggMaxFactor; .endif
|
||||
.ifnb \teraType; .2byte \teraType; .endif
|
||||
.endm
|
||||
|
||||
@ creates a mon for a given party and slot
|
||||
@ otherwise
|
||||
.macro createmon side:req, slot:req, species:req, level:req, item, ball, nature, abilityNum, gender, hpEv, atkEv, defEv, speedEv, spAtkEv, spDefEv, hpIv, atkIv, defIv, speedIv, spAtkIv, spDefIv, move1, move2, move3, move4, isShiny, ggMaxFactor, teraType
|
||||
callnative ScrCmd_createmon
|
||||
.byte \side @ 0 - player, 1 - opponent
|
||||
.byte \slot @ 0-5
|
||||
.set givemon_flags, 0
|
||||
.2byte \species
|
||||
.2byte \level
|
||||
@ -1393,7 +1465,7 @@
|
||||
@ The specified id can be used to refer to the sprite again later with turnvobject.
|
||||
.macro createvobject graphicsId:req, id:req, x:req, y:req, elevation=3, direction=DIR_SOUTH
|
||||
.byte 0xaa
|
||||
.byte \graphicsId
|
||||
.2byte \graphicsId
|
||||
.byte \id
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
@ -1813,7 +1885,6 @@
|
||||
_dynmultichoice \left, \top, \ignoreBPress, \maxBeforeScroll, \shouldSort, \initialSelected, \callbacks, NULL
|
||||
.endm
|
||||
|
||||
|
||||
@ Supplementary
|
||||
|
||||
.macro goto_if_unset flag:req, dest:req
|
||||
@ -2024,6 +2095,11 @@
|
||||
special CreateEnemyEventMon
|
||||
.endm
|
||||
|
||||
.macro setdynamicaifunc func:req
|
||||
callnative ScriptSetDynamicAiFunc
|
||||
.4byte \func
|
||||
.endm
|
||||
|
||||
@ Set up a totem boost for the next battle.
|
||||
@ 'battler' is the position of the mon you want to gain a boost. see B_POSITION_xx in include/constants/battle.h.
|
||||
@ The rest of the arguments are the stat change values to each stat.
|
||||
@ -2096,7 +2172,7 @@
|
||||
setvar VAR_0x8002, \tryMultiple
|
||||
special TrySpecialOverworldEvo
|
||||
.endm
|
||||
|
||||
|
||||
.macro ai_vs_ai_battle trainer1:req, trainer2:req
|
||||
setflag B_FLAG_AI_VS_AI_BATTLE
|
||||
setvar VAR_0x8004, \trainer1
|
||||
@ -2172,3 +2248,76 @@
|
||||
.2byte \status1
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ Sets VAR_RESULT to the Pokémon in \slot's Tera Type
|
||||
.macro checkteratype slot:req
|
||||
callnative CheckTeraType
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ Sets the Pokémon in \slot's Tera Type
|
||||
.macro setteratype type:req, slot:req
|
||||
callnative SetTeraType
|
||||
.byte \type
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ Saves species and forms of Daycare Pokémon to specific vars. Saves the amount of Daycare mon to VAR_RESULT.
|
||||
.macro getdaycaregfx varSpecies1:req varSpecies2:req varForm1:req varForm2:req
|
||||
callnative GetDaycareGraphics
|
||||
.2byte \varSpecies1
|
||||
.2byte \varSpecies2
|
||||
.2byte \varForm1
|
||||
.2byte \varForm2
|
||||
.endm
|
||||
|
||||
@ Plays the cry of the first alive party member.
|
||||
.macro playfirstmoncry
|
||||
callnative PlayFirstMonCry
|
||||
.endm
|
||||
|
||||
@ Buffers the nickname of the first alive party member.
|
||||
.macro bufferlivemonnickname out:req
|
||||
callnative BufferFirstLiveMonNickname
|
||||
.byte \out
|
||||
.endm
|
||||
|
||||
@ Executes Follower actions
|
||||
.macro getfolloweraction
|
||||
callnative GetFollowerAction
|
||||
.endm
|
||||
|
||||
@ Checks if Field move is being used by the current follower.
|
||||
.macro isfollowerfieldmoveuser var:req
|
||||
callnative IsFollowerFieldMoveUser
|
||||
.2byte \var
|
||||
.endm
|
||||
|
||||
@ Saves the direction from where source object event would need to turn to to face the target into the specified var.
|
||||
.macro getdirectiontoface var:req, sourceId:req, targetId:req
|
||||
callnative GetDirectionToFaceScript
|
||||
.2byte \var
|
||||
.byte \sourceId
|
||||
.byte \targetId
|
||||
.endm
|
||||
|
||||
@ set the wild double battle flag
|
||||
@ can be used in conjunection with createmon to set up a wild battle with 2 player mons vs. 1 enemy mon
|
||||
.macro setwilddoubleflag
|
||||
callnative ScriptSetDoubleBattleFlag
|
||||
.endm
|
||||
|
||||
@ When OW_USE_FAKE_RTC and OW_FLAG_PAUSE_TIME is assigned, this macro will stop the flow of time.
|
||||
.macro pausefakertc
|
||||
callnative Script_PauseFakeRtc
|
||||
.endm
|
||||
|
||||
@ When OW_USE_FAKE_RTC and OW_FLAG_PAUSE_TIME is assigned, this macro will resume the flow of time.
|
||||
.macro resumefakertc
|
||||
callnative Script_ResumeFakeRtc
|
||||
.endm
|
||||
|
||||
@ When OW_USE_FAKE_RTC and OW_FLAG_PAUSE_TIME is assigned, this macro will resume the flow of time if paused, and stop the flow of time otherwise.
|
||||
.macro togglefakertc
|
||||
callnative Script_ToggleFakeRtc
|
||||
.endm
|
||||
|
||||
@ -22,9 +22,8 @@
|
||||
@ Defines an object event template for map data, to be used by a normal object. Mirrors the struct layout of ObjectEventTemplate in include/global.fieldmap.h
|
||||
.macro object_event index:req, gfx:req, x:req, y:req, elevation:req, movement_type:req, x_radius:req, y_radius:req, trainer_type:req, sight_radius_tree_etc:req, script:req, event_flag:req
|
||||
.byte \index
|
||||
.byte \gfx
|
||||
.2byte \gfx
|
||||
.byte OBJ_KIND_NORMAL
|
||||
.space 1 @ Padding
|
||||
.2byte \x, \y
|
||||
.byte \elevation
|
||||
.byte \movement_type
|
||||
|
||||
@ -165,4 +165,6 @@
|
||||
create_movement_action emote_double_exclamation_mark, MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK
|
||||
create_movement_action emote_x, MOVEMENT_ACTION_EMOTE_X
|
||||
|
||||
create_movement_action exit_pokeball, MOVEMENT_ACTION_EXIT_POKEBALL
|
||||
create_movement_action enter_pokeball, MOVEMENT_ACTION_ENTER_POKEBALL
|
||||
create_movement_action step_end, MOVEMENT_ACTION_STEP_END
|
||||
|
||||
@ -453,6 +453,9 @@ FONT_NORMAL = FC 06 01
|
||||
FONT_SHORT = FC 06 02
|
||||
FONT_NARROW = FC 06 07
|
||||
FONT_SMALL_NARROW = FC 06 08
|
||||
FONT_NARROWER = FC 06 0A
|
||||
FONT_SMALL_NARROWER = FC 06 0B
|
||||
FONT_SHORT_NARROW = FC 06 0C
|
||||
|
||||
@ colors
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "config.h"
|
||||
#include "config/general.h"
|
||||
#include "config/battle.h"
|
||||
#include "constants/global.h"
|
||||
#include "constants/battle.h"
|
||||
@ -20,6 +20,101 @@
|
||||
|
||||
.section script_data, "aw", %progbits
|
||||
|
||||
BattleScript_DamageToQuarterTargetHP::
|
||||
attackcanceler
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
attackstring
|
||||
ppreduce
|
||||
typecalc
|
||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||
damagetoquartertargethp
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
|
||||
BattleScript_Terastallization::
|
||||
@ TODO: no string prints in S/V, but right now this helps with clarity
|
||||
printstring STRINGID_PKMNSTORINGENERGY
|
||||
playanimation BS_ATTACKER, B_ANIM_TERA_CHARGE
|
||||
waitanimation
|
||||
applyterastallization
|
||||
playanimation BS_ATTACKER, B_ANIM_TERA_ACTIVATE
|
||||
waitanimation
|
||||
printstring STRINGID_PKMNTERASTALLIZEDINTO
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
end3
|
||||
|
||||
BattleScript_TeraFormChange::
|
||||
@ TODO: no string prints in S/V, but right now this helps with clarity
|
||||
printstring STRINGID_PKMNSTORINGENERGY
|
||||
handleformchange BS_ATTACKER, 0
|
||||
handleformchange BS_ATTACKER, 1
|
||||
playanimation BS_ATTACKER, B_ANIM_TERA_CHARGE
|
||||
waitanimation
|
||||
applyterastallization
|
||||
playanimation BS_ATTACKER, B_ANIM_TERA_ACTIVATE
|
||||
waitanimation
|
||||
handleformchange BS_ATTACKER, 2
|
||||
printstring STRINGID_PKMNTERASTALLIZEDINTO
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
switchinabilities BS_ATTACKER
|
||||
end3
|
||||
|
||||
BattleScript_LowerAtkSpAtk::
|
||||
jumpifstat BS_EFFECT_BATTLER, CMP_GREATER_THAN, STAT_ATK, MIN_STAT_STAGE, BattleScript_LowerAtkSpAtkDoAnim
|
||||
jumpifstat BS_EFFECT_BATTLER, CMP_EQUAL, STAT_SPATK, MIN_STAT_STAGE, BattleScript_LowerAtkSpAtkEnd
|
||||
BattleScript_LowerAtkSpAtkDoAnim::
|
||||
setbyte sSTAT_ANIM_PLAYED, FALSE
|
||||
playstatchangeanimation BS_EFFECT_BATTLER, BIT_ATK | BIT_SPATK, STAT_CHANGE_NEGATIVE
|
||||
setstatchanger STAT_ATK, 1, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_LowerAtkSpAtkTrySpAtk
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_LowerAtkSpAtkTrySpAtk
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_LowerAtkSpAtkTrySpAtk::
|
||||
setstatchanger STAT_SPATK, 1, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_LowerAtkSpAtkEnd
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_LowerAtkSpAtkEnd
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_LowerAtkSpAtkEnd:
|
||||
return
|
||||
|
||||
BattleScript_EffectSpicyExtract::
|
||||
attackcanceler
|
||||
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE BattleScript_SpicyExtract_CheckShouldSkipAttackAnim
|
||||
jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_SpicyExtract_CheckShouldSkipAttackAnim
|
||||
goto BattleScript_ButItFailed
|
||||
BattleScript_SpicyExtract_CheckShouldSkipAttackAnim:
|
||||
jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0, BattleScript_SpicyExtract_RaiseAtk
|
||||
attackstring
|
||||
ppreduce
|
||||
bicword gHitMarker, HITMARKER_NO_ATTACKSTRING | HITMARKER_NO_PPDEDUCT
|
||||
goto BattleScript_SpicyExtract_SkipAttackAnim
|
||||
BattleScript_SpicyExtract_RaiseAtk:
|
||||
attackstring
|
||||
ppreduce
|
||||
attackanimation
|
||||
waitanimation
|
||||
BattleScript_SpicyExtract_SkipAttackAnim:
|
||||
setbyte sSTAT_ANIM_PLAYED, FALSE
|
||||
playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_BY_TWO
|
||||
setstatchanger STAT_ATK, 2, FALSE
|
||||
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_EffectSpicyExtractDefenseDown
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectSpicyExtractDefenseDown
|
||||
printfromtable gStatUpStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_EffectSpicyExtractDefenseDown:
|
||||
setbyte sSTAT_ANIM_PLAYED, FALSE
|
||||
playstatchangeanimation BS_TARGET, BIT_DEF, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO
|
||||
setstatchanger STAT_DEF, 2, TRUE
|
||||
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_EffectSpicyExtract_End
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_EffectSpicyExtract_End
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_EffectSpicyExtract_End:
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectTidyUp::
|
||||
attackcanceler
|
||||
attackstring
|
||||
@ -160,7 +255,7 @@ BattleScript_EffectChillyReception::
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_RAIN_PRIMAL, BattleScript_EffectChillyReceptionBlockedByPrimalRain
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_STRONG_WINDS, BattleScript_EffectChillyReceptionBlockedByStrongWinds
|
||||
call BattleScript_EffectChillyReceptionPlayAnimation
|
||||
setsnow
|
||||
setfieldweather ENUM_WEATHER_SNOW
|
||||
call BattleScript_MoveWeatherChangeRet
|
||||
goto BattleScript_MoveSwitch
|
||||
BattleScript_EffectChillyReceptionPlayAnimation:
|
||||
@ -3084,6 +3179,7 @@ BattleScript_EffectStatDown:
|
||||
BattleScript_StatDownFromAttackString:
|
||||
attackstring
|
||||
ppreduce
|
||||
BattleScript_EffectStatDownFromStatBuffChange:
|
||||
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_StatDownEnd
|
||||
jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_StatDownDoAnim
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_StatDownEnd
|
||||
@ -3094,6 +3190,7 @@ BattleScript_StatDownDoAnim::
|
||||
waitanimation
|
||||
setgraphicalstatchangevalues
|
||||
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
|
||||
bicword gHitMarker, HITMARKER_DISABLE_ANIMATION
|
||||
BattleScript_StatDownPrintString::
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
@ -3126,7 +3223,8 @@ BattleScript_MirrorArmorReflectStickyWeb:
|
||||
call BattleScript_AbilityPopUp
|
||||
setattackertostickywebuser
|
||||
jumpifbyteequal gBattlerAttacker, gBattlerTarget, BattleScript_StickyWebOnSwitchInEnd @ Sticky web user not on field -> no stat loss
|
||||
goto BattleScript_MirrorArmorReflectStatLoss
|
||||
call BattleScript_MirrorArmorReflectStatLoss
|
||||
goto BattleScript_StickyWebOnSwitchInEnd
|
||||
|
||||
BattleScript_StatDown::
|
||||
playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
|
||||
@ -4199,7 +4297,7 @@ BattleScript_EffectSandstorm::
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
setsandstorm
|
||||
setfieldweather ENUM_WEATHER_SANDSTORM
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
BattleScript_EffectRollout::
|
||||
@ -4365,7 +4463,7 @@ BattleScript_EffectRainDance::
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
setrain
|
||||
setfieldweather ENUM_WEATHER_RAIN
|
||||
BattleScript_MoveWeatherChange::
|
||||
attackanimation
|
||||
waitanimation
|
||||
@ -4383,7 +4481,7 @@ BattleScript_EffectSunnyDay::
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
setsunny
|
||||
setfieldweather ENUM_WEATHER_SUN
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
BattleScript_ExtremelyHarshSunlightWasNotLessened:
|
||||
@ -4740,7 +4838,7 @@ BattleScript_EffectHail::
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
sethail
|
||||
setfieldweather ENUM_WEATHER_HAIL
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
BattleScript_EffectTorment::
|
||||
@ -5363,6 +5461,7 @@ BattleScript_FaintAttacker::
|
||||
BattleScript_FaintTarget::
|
||||
tryillusionoff BS_TARGET
|
||||
tryactivategulpmissile
|
||||
tryupdateleaderscresttracker
|
||||
playfaintcry BS_TARGET
|
||||
pause B_WAIT_TIME_LONG
|
||||
dofaintanimation BS_TARGET
|
||||
@ -5679,7 +5778,7 @@ BattleScript_PrintFullBox::
|
||||
|
||||
BattleScript_ActionSwitch::
|
||||
hpthresholds2 BS_ATTACKER
|
||||
copybyte sSAVED_BATTLER, gBattlerAttacker
|
||||
saveattacker
|
||||
printstring STRINGID_RETURNMON
|
||||
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_PursuitSwitchDmgSetMultihit
|
||||
setmultihit 1
|
||||
@ -5697,7 +5796,7 @@ BattleScript_DoSwitchOut::
|
||||
switchoutabilities BS_ATTACKER
|
||||
updatedynamax
|
||||
waitstate
|
||||
copybyte gBattlerAttacker, sSAVED_BATTLER
|
||||
restoreattacker
|
||||
returnatktoball
|
||||
waitstate
|
||||
drawpartystatussummary BS_ATTACKER
|
||||
@ -5799,33 +5898,22 @@ BattleScript_DamagingWeatherContinues::
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
playanimation_var BS_ATTACKER, sB_ANIM_ARG1
|
||||
setbyte gBattleCommunication, 0
|
||||
BattleScript_DamagingWeatherLoop::
|
||||
copyarraywithindex gBattlerAttacker, gBattlerByTurnOrder, gBattleCommunication, 1
|
||||
weatherdamage
|
||||
jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement
|
||||
jumpifword CMP_COMMON_BITS gBattleMoveDamage, 1 << 31, BattleScript_DamagingWeatherHeal
|
||||
end2
|
||||
|
||||
BattleScript_DamagingWeather::
|
||||
printfromtable gSandStormHailDmgStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
effectivenesssound
|
||||
hitanimation BS_ATTACKER
|
||||
goto BattleScript_DamagingWeatherHpChange
|
||||
BattleScript_DamagingWeatherHeal:
|
||||
call BattleScript_AbilityPopUp
|
||||
hitanimation BS_SCRIPTING
|
||||
goto BattleScript_DoTurnDmg
|
||||
|
||||
BattleScript_IceBodyHeal::
|
||||
call BattleScript_AbilityPopUpScripting
|
||||
playanimation BS_SCRIPTING, B_ANIM_SIMPLE_HEAL
|
||||
healthbarupdate BS_SCRIPTING
|
||||
datahpupdate BS_SCRIPTING
|
||||
printstring STRINGID_ICEBODYHPGAIN
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_DamagingWeatherHpChange:
|
||||
orword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
tryfaintmon BS_ATTACKER
|
||||
checkteamslost BattleScript_DamagingWeatherLoopIncrement
|
||||
BattleScript_DamagingWeatherLoopIncrement::
|
||||
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_DamagingWeatherContinuesEnd
|
||||
addbyte gBattleCommunication, 1
|
||||
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
|
||||
BattleScript_DamagingWeatherContinuesEnd::
|
||||
bicword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||
call BattleScript_ActivateWeatherAbilities
|
||||
end2
|
||||
|
||||
BattleScript_SandStormHailSnowEnds::
|
||||
@ -5847,6 +5935,23 @@ BattleScript_SunlightFaded::
|
||||
call BattleScript_ActivateWeatherAbilities
|
||||
end2
|
||||
|
||||
BattleScript_FogContinues::
|
||||
printstring STRINGID_FOGISDEEP
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
playanimation BS_ATTACKER, B_ANIM_FOG_CONTINUES
|
||||
call BattleScript_ActivateWeatherAbilities
|
||||
end2
|
||||
|
||||
BattleScript_FogEnded_Ret::
|
||||
printstring STRINGID_FOGLIFTED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
call BattleScript_ActivateWeatherAbilities
|
||||
return
|
||||
|
||||
BattleScript_FogEnded::
|
||||
call BattleScript_FogEnded_Ret
|
||||
end2
|
||||
|
||||
BattleScript_OverworldStatusStarts::
|
||||
printfromtable gStartingStatusStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
@ -6231,6 +6336,7 @@ BattleScript_ToxicSpikesPoisoned::
|
||||
|
||||
BattleScript_StickyWebOnSwitchIn::
|
||||
savetarget
|
||||
saveattacker
|
||||
copybyte gBattlerTarget, sBATTLER
|
||||
setbyte sSTICKY_WEB_STAT_DROP, 1
|
||||
printstring STRINGID_STICKYWEBSWITCHIN
|
||||
@ -6249,6 +6355,7 @@ BattleScript_StickyWebOnSwitchInPrintStatMsg:
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_StickyWebOnSwitchInEnd:
|
||||
restoretarget
|
||||
restoreattacker
|
||||
return
|
||||
|
||||
BattleScript_PerishSongTakesLife::
|
||||
@ -6402,6 +6509,9 @@ BattleScript_PerishSongCountGoesDown::
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
end2
|
||||
|
||||
BattleScript_AllStatsUpZMove::
|
||||
printfromtable gZEffectStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_AllStatsUp::
|
||||
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_AllStatsUpAtk
|
||||
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_DEF, MAX_STAT_STAGE, BattleScript_AllStatsUpAtk
|
||||
@ -6841,17 +6951,6 @@ BattleScript_OneHitKOMsg::
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
BattleScript_SAtkDown2::
|
||||
setbyte sSTAT_ANIM_PLAYED, FALSE
|
||||
playstatchangeanimation BS_ATTACKER, BIT_SPATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO
|
||||
setstatchanger STAT_SPATK, 2, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_ALLOW_PTR, BattleScript_SAtkDown2End
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_SAtkDown2End
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_SAtkDown2End::
|
||||
return
|
||||
|
||||
BattleScript_MoveEffectClearSmog::
|
||||
printstring STRINGID_RESETSTARGETSSTATLEVELS
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
@ -6871,13 +6970,13 @@ BattleScript_MegaEvolution::
|
||||
BattleScript_MegaEvolutionAfterString:
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
setbyte gIsCriticalHit, 0
|
||||
handlemegaevo BS_ATTACKER, 0
|
||||
playanimation BS_ATTACKER, B_ANIM_MEGA_EVOLUTION
|
||||
handlemegaevo BS_SCRIPTING, 0
|
||||
playanimation BS_SCRIPTING, B_ANIM_MEGA_EVOLUTION
|
||||
waitanimation
|
||||
handlemegaevo BS_ATTACKER, 1
|
||||
handlemegaevo BS_SCRIPTING, 1
|
||||
printstring STRINGID_MEGAEVOEVOLVED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
switchinabilities BS_ATTACKER
|
||||
switchinabilities BS_SCRIPTING
|
||||
end3
|
||||
|
||||
BattleScript_WishMegaEvolution::
|
||||
@ -6914,13 +7013,13 @@ BattleScript_UltraBurst::
|
||||
printstring STRINGID_ULTRABURSTREACTING
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
setbyte gIsCriticalHit, 0
|
||||
handleultraburst BS_ATTACKER, 0
|
||||
playanimation BS_ATTACKER, B_ANIM_ULTRA_BURST
|
||||
handleultraburst BS_SCRIPTING, 0
|
||||
playanimation BS_SCRIPTING, B_ANIM_ULTRA_BURST
|
||||
waitanimation
|
||||
handleultraburst BS_ATTACKER, 1
|
||||
handleultraburst BS_SCRIPTING, 1
|
||||
printstring STRINGID_ULTRABURSTCOMPLETED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
switchinabilities BS_ATTACKER
|
||||
switchinabilities BS_SCRIPTING
|
||||
end3
|
||||
|
||||
BattleScript_GulpMissileFormChange::
|
||||
@ -6948,6 +7047,29 @@ BattleScript_AttackerFormChangeEnd3NoPopup::
|
||||
call BattleScript_AttackerFormChangeNoPopup
|
||||
end3
|
||||
|
||||
BattleScript_AttackerFormChangeWithString::
|
||||
pause 5
|
||||
copybyte gBattlerAbility, gBattlerAttacker
|
||||
call BattleScript_AbilityPopUp
|
||||
flushtextbox
|
||||
BattleScript_AttackerFormChangeWithStringNoPopup::
|
||||
handleformchange BS_ATTACKER, 0
|
||||
handleformchange BS_ATTACKER, 1
|
||||
playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE
|
||||
waitanimation
|
||||
handleformchange BS_ATTACKER, 2
|
||||
printstring STRINGID_PKMNTRANSFORMED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
BattleScript_AttackerFormChangeWithStringEnd3::
|
||||
call BattleScript_AttackerFormChangeWithString
|
||||
end3
|
||||
|
||||
BattleScript_AttackerFormChangeWithStringEnd3NoPopup::
|
||||
call BattleScript_AttackerFormChangeWithStringNoPopup
|
||||
end3
|
||||
|
||||
BattleScript_AttackerFormChangeMoveEffect::
|
||||
waitmessage 1
|
||||
handleformchange BS_ATTACKER, 0
|
||||
@ -7698,7 +7820,7 @@ BattleScript_TryIntimidateHoldEffectsRet:
|
||||
return
|
||||
|
||||
BattleScript_IntimidateActivates::
|
||||
copybyte sSAVED_BATTLER, gBattlerTarget
|
||||
savetarget
|
||||
.if B_ABILITY_POP_UP == TRUE
|
||||
showabilitypopup BS_ATTACKER
|
||||
pause B_WAIT_TIME_LONG
|
||||
@ -7735,7 +7857,7 @@ BattleScript_IntimidateLoopIncrement:
|
||||
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_IntimidateLoop
|
||||
copybyte sBATTLER, gBattlerAttacker
|
||||
destroyabilitypopup
|
||||
copybyte gBattlerTarget, sSAVED_BATTLER
|
||||
restoretarget
|
||||
pause B_WAIT_TIME_MED
|
||||
end3
|
||||
|
||||
@ -7768,7 +7890,7 @@ BattleScript_IntimidateInReverse:
|
||||
goto BattleScript_IntimidateLoopIncrement
|
||||
|
||||
BattleScript_SupersweetSyrupActivates::
|
||||
copybyte sSAVED_BATTLER, gBattlerTarget
|
||||
savetarget
|
||||
.if B_ABILITY_POP_UP == TRUE
|
||||
showabilitypopup BS_ATTACKER
|
||||
pause B_WAIT_TIME_LONG
|
||||
@ -7800,7 +7922,7 @@ BattleScript_SupersweetSyrupLoopIncrement:
|
||||
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_SupersweetSyrupLoop
|
||||
copybyte sBATTLER, gBattlerAttacker
|
||||
destroyabilitypopup
|
||||
copybyte gBattlerTarget, sSAVED_BATTLER
|
||||
restoretarget
|
||||
pause B_WAIT_TIME_MED
|
||||
end3
|
||||
|
||||
@ -8251,6 +8373,13 @@ BattleScript_ProteanActivates::
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
BattleScript_TeraShellDistortingTypeMatchups::
|
||||
pause B_WAIT_TIME_SHORTEST
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_PKMNMADESHELLGLEAM
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
BattleScript_CursedBodyActivates::
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_CUSEDBODYDISABLED
|
||||
@ -8435,7 +8564,10 @@ BattleScript_FriskMsg::
|
||||
return
|
||||
|
||||
BattleScript_FriskActivates::
|
||||
tryfriskmsg BS_ATTACKER
|
||||
saveattacker
|
||||
copybyte gBattlerAttacker, sBATTLER
|
||||
tryfriskmsg BS_SCRIPTING
|
||||
restoreattacker
|
||||
end3
|
||||
|
||||
BattleScript_ImposterActivates::
|
||||
@ -9153,6 +9285,25 @@ BattleScript_AnnounceAirLockCloudNine::
|
||||
call BattleScript_ActivateWeatherAbilities
|
||||
end3
|
||||
|
||||
BattleScript_ActivateTeraformZero::
|
||||
call BattleScript_AbilityPopUp
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_ANY, BattleScript_ActivateTeraformZero_RemoveWeather
|
||||
jumpifhalfword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_ANY, BattleScript_ActivateTeraformZero_RemoveTerrain
|
||||
goto BattleScript_ActivateTeraformZero_End
|
||||
BattleScript_ActivateTeraformZero_RemoveWeather:
|
||||
removeweather
|
||||
printfromtable gWeatherEndsStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
jumpifhalfword CMP_NO_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_ANY, BattleScript_ActivateTeraformZero_End
|
||||
BattleScript_ActivateTeraformZero_RemoveTerrain:
|
||||
removeterrain
|
||||
playanimation BS_ATTACKER, B_ANIM_RESTORE_BG
|
||||
printfromtable gTerrainStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_ActivateTeraformZero_End:
|
||||
end3
|
||||
|
||||
BattleScript_QuickClawActivation::
|
||||
flushtextbox
|
||||
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
|
||||
@ -9405,19 +9556,19 @@ BattleScript_RedCardIngrain:
|
||||
printstring STRINGID_PKMNANCHOREDITSELF
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
removeitem BS_SCRIPTING
|
||||
swapattackerwithtarget
|
||||
restoretarget
|
||||
return
|
||||
BattleScript_RedCardSuctionCups:
|
||||
printstring STRINGID_PKMNANCHORSITSELFWITH
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
removeitem BS_SCRIPTING
|
||||
swapattackerwithtarget
|
||||
restoretarget
|
||||
return
|
||||
BattleScript_RedCardDynamaxed:
|
||||
printstring STRINGID_MOVEBLOCKEDBYDYNAMAX
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
removeitem BS_SCRIPTING
|
||||
swapattackerwithtarget
|
||||
restoretarget
|
||||
return
|
||||
|
||||
BattleScript_EjectButtonActivates::
|
||||
@ -9636,27 +9787,11 @@ BattleScript_DamageNonTypesStarts::
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_DamageNonTypesContinues::
|
||||
setbyte gBattleCommunication, 0
|
||||
BattleScript_DamageNonTypesLoop::
|
||||
copyarraywithindex gBattlerAttacker, gBattlerByTurnOrder, gBattleCommunication, 1
|
||||
damagenontypes
|
||||
jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamageNonTypesLoopIncrement
|
||||
printfromtable gDamageNonTypesDmgStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
effectivenesssound
|
||||
hitanimation BS_ATTACKER
|
||||
orword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
tryfaintmon BS_ATTACKER
|
||||
checkteamslost BattleScript_DamageNonTypesLoopIncrement
|
||||
BattleScript_DamageNonTypesLoopIncrement::
|
||||
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_DamageNonTypesContinuesEnd
|
||||
addbyte gBattleCommunication, 1
|
||||
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamageNonTypesLoop
|
||||
BattleScript_DamageNonTypesContinuesEnd::
|
||||
bicword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||
end2
|
||||
hitanimation BS_SCRIPTING
|
||||
goto BattleScript_DoTurnDmg
|
||||
|
||||
BattleScript_EffectTryReducePP::
|
||||
tryspiteppreduce BattleScript_MoveEnd
|
||||
@ -9881,10 +10016,20 @@ BattleScript_BerserkGeneRet_End:
|
||||
removeitem BS_SCRIPTING
|
||||
end3
|
||||
|
||||
BattleScript_BoosterEnergyEnd2::
|
||||
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, sB_ANIM_ARG1
|
||||
call BattleScript_AbilityPopUpTarget
|
||||
printstring STRINGID_BOOSTERENERGYACTIVATES
|
||||
waitmessage B_WAIT_TIME_MED
|
||||
printstring STRINGID_STATWASHEIGHTENED
|
||||
waitmessage B_WAIT_TIME_MED
|
||||
removeitem BS_SCRIPTING
|
||||
end2
|
||||
|
||||
BattleScript_EffectSnow::
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
call BattleScript_CheckPrimalWeather
|
||||
setsnow
|
||||
setfieldweather ENUM_WEATHER_SNOW
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "config.h"
|
||||
#include "config/general.h"
|
||||
#include "constants/global.h"
|
||||
#include "constants/contest.h"
|
||||
.include "asm/macros.inc"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "config.h"
|
||||
#include "config/general.h"
|
||||
#include "config/battle.h"
|
||||
#include "config/item.h"
|
||||
#include "constants/global.h"
|
||||
@ -725,6 +725,7 @@ Common_EventScript_OutOfCenterPartyHeal::
|
||||
playfanfare MUS_HEAL
|
||||
waitfanfare
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
fadescreen FADE_FROM_BLACK
|
||||
return
|
||||
|
||||
@ -1069,6 +1070,7 @@ EventScript_VsSeekerChargingDone::
|
||||
.include "data/scripts/move_tutors.inc"
|
||||
.include "data/scripts/trainer_hill.inc"
|
||||
.include "data/scripts/test_signpost.inc"
|
||||
.include "data/scripts/follower.inc"
|
||||
.include "data/text/frontier_brain.inc"
|
||||
.include "data/text/save.inc"
|
||||
.include "data/text/birch_speech.inc"
|
||||
|
||||
@ -76,6 +76,9 @@ gFieldEffectScriptPointers::
|
||||
.4byte gFldEffScript_UseVsSeeker @ FLDEFF_USE_VS_SEEKER
|
||||
.4byte gFldEffScript_XIcon @ FLDEFF_X_ICON
|
||||
.4byte gFldEffScript_DoubleExclMarkIcon @ FLDEFF_DOUBLE_EXCL_MARK_ICON
|
||||
.4byte gFieldEffectScript_TracksSlither @ FLDEFF_TRACKS_SLITHER
|
||||
.4byte gFieldEffectScript_TracksBug @ FLDEFF_TRACKS_BUG
|
||||
.4byte gFieldEffectScript_TracksSpot @ FLDEFF_TRACKS_SPOT
|
||||
|
||||
gFieldEffectScript_ExclamationMarkIcon1::
|
||||
field_eff_callnative FldEff_ExclamationMarkIcon
|
||||
@ -359,3 +362,15 @@ gFldEffScript_XIcon::
|
||||
gFldEffScript_DoubleExclMarkIcon::
|
||||
field_eff_callnative FldEff_DoubleExclMarkIcon
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_TracksBug::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect0, FldEff_TracksBug
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_TracksSpot::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect0, FldEff_TracksSpot
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_TracksSlither::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect0, FldEff_TracksSlither
|
||||
field_eff_end
|
||||
|
||||
@ -12,10 +12,10 @@
|
||||
#include "constants/trainer_hill.h"
|
||||
#include "constants/trainer_types.h"
|
||||
#include "constants/berry.h"
|
||||
#include "constants/species.h"
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.section .rodata
|
||||
|
||||
.include "data/maps/events.inc"
|
||||
|
||||
|
||||
@ -75,6 +75,7 @@ BattleFrontier_BattleArenaLobby_EventScript_SaveAfterChallenge::
|
||||
frontier_checkairshow
|
||||
special LoadPlayerParty
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
arena_save 0
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
@ -133,6 +134,7 @@ BattleFrontier_BattleArenaLobby_EventScript_TryEnterChallenge::
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
|
||||
msgbox BattleFrontier_BattleArenaLobby_Text_SelectThreeMons, MSGBOX_DEFAULT
|
||||
fadescreen FADE_TO_BLACK
|
||||
callnative RemoveFollowingPokemon
|
||||
call BattleFrontier_EventScript_GetLvlMode
|
||||
copyvar VAR_0x8004, VAR_RESULT
|
||||
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
|
||||
@ -194,6 +196,7 @@ BattleFrontier_BattleArenaLobby_EventScript_CancelChallengeSaveFailed::
|
||||
|
||||
BattleFrontier_BattleArenaLobby_EventScript_LoadPartyAndCancelChallenge::
|
||||
special LoadPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
BattleFrontier_BattleArenaLobby_EventScript_CancelChallenge::
|
||||
msgbox BattleFrontier_BattleArenaLobby_Text_AwaitAnotherChallenge, MSGBOX_DEFAULT
|
||||
BattleFrontier_BattleArenaLobby_EventScript_EndCancelChallenge::
|
||||
|
||||
@ -17,6 +17,7 @@ BattleFrontier_BattleDomeBattleRoom_MapScripts::
|
||||
.byte 0
|
||||
|
||||
BattleFrontier_BattleDomeBattleRoom_OnTransition:
|
||||
setflag FLAG_TEMP_HIDE_FOLLOWER
|
||||
dome_setopponentgfx
|
||||
frontier_get FRONTIER_DATA_BATTLE_NUM
|
||||
copyvar VAR_TEMP_F, VAR_RESULT
|
||||
|
||||
@ -68,6 +68,7 @@ BattleFrontier_BattleDomeLobby_EventScript_GiveBattlePoints::
|
||||
dome_set DOME_DATA_WIN_STREAK_ACTIVE, TRUE
|
||||
special LoadPlayerParty
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
goto BattleFrontier_BattleDomeLobby_EventScript_AskRecordBattle
|
||||
|
||||
BattleFrontier_BattleDomeLobby_EventScript_LostChallenge::
|
||||
@ -82,6 +83,7 @@ BattleFrontier_BattleDomeLobby_EventScript_LostChallenge::
|
||||
dome_set DOME_DATA_ATTEMPTED_CHALLENGE, TRUE
|
||||
special LoadPlayerParty
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
BattleFrontier_BattleDomeLobby_EventScript_AskRecordBattle::
|
||||
dome_save 0
|
||||
playse SE_SAVE
|
||||
@ -160,6 +162,7 @@ BattleFrontier_BattleDomeLobby_EventScript_TryEnterChallenge::
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
|
||||
msgbox BattleFrontier_BattleDomeLobby_Text_SelectThreeMons, MSGBOX_DEFAULT
|
||||
fadescreen FADE_TO_BLACK
|
||||
callnative RemoveFollowingPokemon
|
||||
call BattleFrontier_EventScript_GetLvlMode
|
||||
copyvar VAR_0x8004, VAR_RESULT
|
||||
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
|
||||
@ -222,6 +225,7 @@ BattleFrontier_BattleDomeLobby_EventScript_CancelChallengeSaveFailed::
|
||||
|
||||
BattleFrontier_BattleDomeLobby_EventScript_LoadPartyCancelChallenge::
|
||||
special LoadPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
BattleFrontier_BattleDomeLobby_EventScript_CancelChallenge::
|
||||
msgbox BattleFrontier_BattleDomeLobby_Text_HopeToSeeYouAgain, MSGBOX_DEFAULT
|
||||
BattleFrontier_BattleDomeLobby_EventScript_EndCancelChallenge::
|
||||
|
||||
@ -59,6 +59,7 @@ BattleFrontier_BattleFactoryLobby_EventScript_GiveBattlePoints::
|
||||
waitmessage
|
||||
frontier_checkairshow
|
||||
special LoadPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
factory_save 0
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
@ -71,6 +72,7 @@ BattleFrontier_BattleFactoryLobby_EventScript_LostChallenge::
|
||||
waitmessage
|
||||
frontier_checkairshow
|
||||
special LoadPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
factory_set FACTORY_DATA_WIN_STREAK_ACTIVE, FALSE
|
||||
factory_save 0
|
||||
playse SE_SAVE
|
||||
@ -196,6 +198,7 @@ BattleFrontier_BattleFactoryLobby_EventScript_CancelChallengeSaveFailed::
|
||||
|
||||
BattleFrontier_BattleFactoryLobby_EventScript_LoadPartyAndCancelChallenge::
|
||||
special LoadPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
BattleFrontier_BattleFactoryLobby_EventScript_CancelChallenge::
|
||||
msgbox BattleFrontier_BattleFactoryLobby_Text_LookForwardToNextVisit, MSGBOX_DEFAULT
|
||||
release
|
||||
|
||||
@ -76,6 +76,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_SaveAfterChallenge::
|
||||
frontier_checkairshow
|
||||
special LoadPlayerParty
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
palace_save 0
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
@ -151,6 +152,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_TryEnterChallenge::
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
|
||||
msgbox BattleFrontier_BattlePalaceLobby_Text_NowSelectThreeMons, MSGBOX_DEFAULT
|
||||
fadescreen FADE_TO_BLACK
|
||||
callnative RemoveFollowingPokemon
|
||||
call BattleFrontier_EventScript_GetLvlMode
|
||||
copyvar VAR_0x8004, VAR_RESULT
|
||||
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
|
||||
@ -215,6 +217,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_CancelChallengeSaveFailed::
|
||||
|
||||
BattleFrontier_BattlePalaceLobby_EventScript_LoadPartyAndCancelChallenge::
|
||||
special LoadPlayerParty
|
||||
callnative LoadPlayerParty
|
||||
BattleFrontier_BattlePalaceLobby_EventScript_CancelChallenge::
|
||||
msgbox BattleFrontier_BattlePalaceLobby_Text_ReturnWhenFortified, MSGBOX_DEFAULT
|
||||
BattleFrontier_BattlePalaceLobby_EventScript_EndCancelChallenge::
|
||||
|
||||
@ -59,6 +59,7 @@ BattleFrontier_BattlePikeLobby_EventScript_GiveBattlePoints::
|
||||
pike_set PIKE_DATA_TOTAL_STREAKS, VAR_RESULT
|
||||
special LoadPlayerParty
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
pike_resethelditems
|
||||
message BattleFrontier_BattlePikeLobby_Text_ShallRecordResults
|
||||
waitmessage
|
||||
@ -80,6 +81,7 @@ BattleFrontier_BattlePikeLobby_EventScript_LostChallenge::
|
||||
pike_set PIKE_DATA_WIN_STREAK_ACTIVE, FALSE
|
||||
special LoadPlayerParty
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
pike_resethelditems
|
||||
pike_save 0
|
||||
playse SE_SAVE
|
||||
@ -119,6 +121,7 @@ BattleFrontier_BattlePikeLobby_EventScript_TryEnterChallenge::
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
|
||||
msgbox BattleFrontier_BattlePikeLobby_Text_PleaseChooseThreeMons, MSGBOX_DEFAULT
|
||||
fadescreen FADE_TO_BLACK
|
||||
callnative RemoveFollowingPokemon
|
||||
call BattleFrontier_EventScript_GetLvlMode
|
||||
copyvar VAR_0x8004, VAR_RESULT
|
||||
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
|
||||
@ -183,6 +186,7 @@ BattleFrontier_BattlePikeLobby_EventScript_CancelChallengeSaveFailed::
|
||||
|
||||
BattleFrontier_BattlePikeLobby_EventScript_LoadPartyAndCancelChallenge::
|
||||
special LoadPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
BattleFrontier_BattlePikeLobby_EventScript_CancelChallenge::
|
||||
msgbox BattleFrontier_BattlePikeLobby_Text_LookForwardToSeeingYou, MSGBOX_DEFAULT
|
||||
BattleFrontier_BattlePikeLobby_EventScript_EndCancelChallenge::
|
||||
|
||||
@ -59,6 +59,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_GiveBattlePoints::
|
||||
special LoadPlayerParty
|
||||
pyramid_clearhelditems
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
message BattleFrontier_BattlePyramidLobby_Text_UsedBattleBagWillBeKept
|
||||
waitmessage
|
||||
playse SE_EXP_MAX
|
||||
@ -83,6 +84,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_LostChallenge::
|
||||
special LoadPlayerParty
|
||||
pyramid_clearhelditems
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
lockall
|
||||
message BattleFrontier_BattlePyramidLobby_Text_DisappointingHereIsBag
|
||||
waitmessage
|
||||
@ -132,6 +134,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_TryEnterChallenge::
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
|
||||
msgbox BattleFrontier_BattlePyramidLobby_Text_SelectThreeMons, MSGBOX_DEFAULT
|
||||
fadescreen FADE_TO_BLACK
|
||||
callnative RemoveFollowingPokemon
|
||||
call BattleFrontier_EventScript_GetLvlMode
|
||||
copyvar VAR_0x8004, VAR_RESULT
|
||||
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
|
||||
@ -196,6 +199,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_CancelChallengeSaveFailed::
|
||||
|
||||
BattleFrontier_BattlePyramidLobby_EventScript_LoadPartyAndCancelChallenge::
|
||||
special LoadPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
BattleFrontier_BattlePyramidLobby_EventScript_CancelChallenge::
|
||||
msgbox BattleFrontier_BattlePyramidLobby_Text_AwaitFutureChallenge, MSGBOX_DEFAULT
|
||||
BattleFrontier_BattlePyramidLobby_EventScript_EndCancelChallenge::
|
||||
|
||||
@ -95,6 +95,7 @@ BattleFrontier_BattleTowerLobby_EventScript_LookForwardToChallenge::
|
||||
msgbox BattleFrontier_BattleTowerLobby_Text_LookForwardToAnotherChallenge, MSGBOX_DEFAULT
|
||||
closemessage
|
||||
setvar VAR_TEMP_CHALLENGE_STATUS, 255
|
||||
callnative UpdateFollowingPokemon
|
||||
release
|
||||
end
|
||||
|
||||
@ -114,6 +115,7 @@ BattleFrontier_BattleTowerLobby_EventScript_LostThanksForPlaying::
|
||||
msgbox BattleFrontier_BattleTowerLobby_Text_LookForwardToAnotherChallenge, MSGBOX_DEFAULT
|
||||
closemessage
|
||||
setvar VAR_TEMP_CHALLENGE_STATUS, 255
|
||||
callnative UpdateFollowingPokemon
|
||||
release
|
||||
end
|
||||
|
||||
@ -200,6 +202,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterSinglesChallenge::
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
|
||||
msgbox BattleFrontier_BattleTowerLobby_Text_SelectThreeMons, MSGBOX_DEFAULT
|
||||
fadescreen FADE_TO_BLACK
|
||||
callnative RemoveFollowingPokemon
|
||||
call BattleFrontier_EventScript_GetLvlMode
|
||||
copyvar VAR_0x8004, VAR_RESULT
|
||||
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
|
||||
@ -263,6 +266,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterDoublesChallenge::
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
|
||||
msgbox BattleFrontier_BattleTowerLobby_Text_PleaseSelectFourMons, MSGBOX_DEFAULT
|
||||
fadescreen FADE_TO_BLACK
|
||||
callnative RemoveFollowingPokemon
|
||||
call BattleFrontier_EventScript_GetLvlMode
|
||||
copyvar VAR_0x8004, VAR_RESULT
|
||||
setvar VAR_0x8005, FRONTIER_DOUBLES_PARTY_SIZE
|
||||
@ -327,6 +331,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterMultisChallenge::
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
|
||||
msgbox BattleFrontier_BattleTowerLobby_Text_PleaseSelectTwoMons, MSGBOX_DEFAULT
|
||||
fadescreen FADE_TO_BLACK
|
||||
callnative RemoveFollowingPokemon
|
||||
call BattleFrontier_EventScript_GetLvlMode
|
||||
copyvar VAR_0x8004, VAR_RESULT
|
||||
setvar VAR_0x8005, FRONTIER_MULTI_PARTY_SIZE
|
||||
@ -390,6 +395,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterLinkMultisChallenge::
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
|
||||
msgbox BattleFrontier_BattleTowerLobby_Text_PleaseSelectTwoMons2, MSGBOX_DEFAULT
|
||||
fadescreen FADE_TO_BLACK
|
||||
callnative RemoveFollowingPokemon
|
||||
call BattleFrontier_EventScript_GetLvlMode
|
||||
copyvar VAR_0x8004, VAR_RESULT
|
||||
setvar VAR_0x8005, FRONTIER_MULTI_PARTY_SIZE
|
||||
@ -582,6 +588,7 @@ BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed::
|
||||
|
||||
BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge::
|
||||
special LoadPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge::
|
||||
special CloseLink
|
||||
msgbox BattleFrontier_BattleTowerLobby_Text_LookForwardToAnotherChallenge, MSGBOX_DEFAULT
|
||||
|
||||
@ -5,6 +5,7 @@ FortreeCity_Gym_MapScripts::
|
||||
|
||||
FortreeCity_Gym_OnTransition:
|
||||
special RotatingGate_InitPuzzle
|
||||
setflag FLAG_TEMP_HIDE_FOLLOWER @ Hide follower bc of rotating gates
|
||||
end
|
||||
|
||||
FortreeCity_Gym_OnWarp:
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
MossdeepCity_Gym_MapScripts::
|
||||
map_script MAP_SCRIPT_ON_TRANSITION, MossdeepCity_Gym_OnTransition
|
||||
map_script MAP_SCRIPT_ON_LOAD, MossdeepCity_Gym_OnLoad
|
||||
.byte 0
|
||||
|
||||
@ NOTE: Mossdeep Gym was redesigned between R/S and E. Leftover (and now functionally unused) scripts are commented below
|
||||
|
||||
MossdeepCity_Gym_OnTransition:
|
||||
setflag FLAG_TEMP_HIDE_FOLLOWER @ Hide follower since it can collide with moving statues
|
||||
end
|
||||
|
||||
@ All the below checks are leftover from RS. FLAG_MOSSDEEP_GYM_SWITCH_X is never set
|
||||
MossdeepCity_Gym_OnLoad:
|
||||
goto_if_set FLAG_MOSSDEEP_GYM_SWITCH_1, MossdeepCity_Gym_EventScript_SetSwitch1Metatiles
|
||||
|
||||
@ -105,8 +105,8 @@
|
||||
},
|
||||
{
|
||||
"graphics_id": "OBJ_EVENT_GFX_PIKACHU",
|
||||
"x": 49,
|
||||
"y": 2,
|
||||
"x": 51,
|
||||
"y": 1,
|
||||
"elevation": 3,
|
||||
"movement_type": "MOVEMENT_TYPE_LOOK_AROUND",
|
||||
"movement_range_x": 0,
|
||||
@ -336,6 +336,32 @@
|
||||
"trainer_sight_or_berry_tree_id": "4",
|
||||
"script": "Route117_EventScript_Melina",
|
||||
"flag": "0"
|
||||
},
|
||||
{
|
||||
"graphics_id": "OBJ_EVENT_GFX_VAR_0",
|
||||
"x": 47,
|
||||
"y": 2,
|
||||
"elevation": 3,
|
||||
"movement_type": "MOVEMENT_TYPE_LOOK_AROUND",
|
||||
"movement_range_x": 0,
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "TRAINER_TYPE_NONE",
|
||||
"trainer_sight_or_berry_tree_id": "VAR_TEMP_0",
|
||||
"script": "NULL",
|
||||
"flag": "FLAG_TEMP_1"
|
||||
},
|
||||
{
|
||||
"graphics_id": "OBJ_EVENT_GFX_VAR_1",
|
||||
"x": 49,
|
||||
"y": 2,
|
||||
"elevation": 3,
|
||||
"movement_type": "MOVEMENT_TYPE_LOOK_AROUND",
|
||||
"movement_range_x": 0,
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "TRAINER_TYPE_NONE",
|
||||
"trainer_sight_or_berry_tree_id": "VAR_TEMP_1",
|
||||
"script": "NULL",
|
||||
"flag": "FLAG_TEMP_2"
|
||||
}
|
||||
],
|
||||
"warp_events": [
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
.set LOCALID_DAYCARE_MAN, 3
|
||||
.set LOCALID_DAYCARE_MON_0, 25
|
||||
.set LOCALID_DAYCARE_MON_1, 26
|
||||
|
||||
Route117_MapScripts::
|
||||
map_script MAP_SCRIPT_ON_TRANSITION, Route117_OnTransition
|
||||
@ -6,8 +8,42 @@ Route117_MapScripts::
|
||||
|
||||
Route117_OnTransition:
|
||||
call Route117_EventScript_TryMoveDayCareMan
|
||||
@ set flags for OW daycare mons
|
||||
setflag FLAG_TEMP_1
|
||||
setflag FLAG_TEMP_2
|
||||
getdaycaregfx VAR_OBJ_GFX_ID_0, VAR_OBJ_GFX_ID_1, VAR_TEMP_0, VAR_TEMP_1
|
||||
switch VAR_RESULT
|
||||
case 2, Route117_EventScript_ShowDaycareMon1
|
||||
case 1, Route117_EventScript_ShowDaycareMon0
|
||||
end
|
||||
|
||||
Route117_EventScript_ShowDaycareMon1:
|
||||
@ set pokemon movement type based on compatibility
|
||||
special SetDaycareCompatibilityString
|
||||
call_if_eq VAR_RESULT, PARENTS_INCOMPATIBLE, Route117_EventScript_DaycareMonIncompatible
|
||||
@ Don't do anything if PARENTS_LOW_COMPATIBILITY
|
||||
call_if_eq VAR_RESULT, PARENTS_MED_COMPATIBILITY, Route117_EventScript_DaycareMonMedCompatibility
|
||||
call_if_eq VAR_RESULT, PARENTS_MAX_COMPATIBILITY, Route117_EventScript_DaycareMonMaxCompatibility
|
||||
clearflag FLAG_TEMP_2
|
||||
Route117_EventScript_ShowDaycareMon0:
|
||||
clearflag FLAG_TEMP_1
|
||||
end
|
||||
|
||||
Route117_EventScript_DaycareMonIncompatible: @ mons never face each other
|
||||
setobjectmovementtype LOCALID_DAYCARE_MON_0, MOVEMENT_TYPE_FACE_DOWN_UP_AND_LEFT
|
||||
setobjectmovementtype LOCALID_DAYCARE_MON_1, MOVEMENT_TYPE_FACE_DOWN_UP_AND_RIGHT
|
||||
return
|
||||
|
||||
Route117_EventScript_DaycareMonMedCompatibility: @ down and towards each other
|
||||
setobjectmovementtype LOCALID_DAYCARE_MON_0, MOVEMENT_TYPE_FACE_DOWN_AND_RIGHT
|
||||
setobjectmovementtype LOCALID_DAYCARE_MON_1, MOVEMENT_TYPE_FACE_DOWN_AND_LEFT
|
||||
return
|
||||
|
||||
Route117_EventScript_DaycareMonMaxCompatibility: @ facing; walk in place
|
||||
setobjectmovementtype LOCALID_DAYCARE_MON_0, MOVEMENT_TYPE_WALK_IN_PLACE_RIGHT
|
||||
setobjectmovementtype LOCALID_DAYCARE_MON_1, MOVEMENT_TYPE_WALK_IN_PLACE_LEFT
|
||||
return
|
||||
|
||||
Route117_EventScript_TryMoveDayCareMan::
|
||||
goto_if_unset FLAG_PENDING_DAYCARE_EGG, Route117_EventScript_StopMoveDayCareMan
|
||||
setobjectxyperm LOCALID_DAYCARE_MAN, 47, 6
|
||||
@ -205,4 +241,3 @@ Route117_Text_RouteSignMauville:
|
||||
Route117_Text_DayCareSign:
|
||||
.string "POKéMON DAY CARE\n"
|
||||
.string "“Let us raise your POKéMON.”$"
|
||||
|
||||
|
||||
@ -274,6 +274,7 @@ RusturfTunnel_EventScript_TunnelBlockagePos3::
|
||||
|
||||
RusturfTunnel_EventScript_AquaGruntBackUp::
|
||||
lockall
|
||||
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
|
||||
msgbox RusturfTunnel_Text_ComeAndGetSome, MSGBOX_DEFAULT
|
||||
closemessage
|
||||
applymovement LOCALID_GRUNT, RusturfTunnel_Movement_GruntAndPeekoBackUp
|
||||
|
||||
@ -79,6 +79,7 @@ SlateportCity_OceanicMuseum_2F_EventScript_CaptStern::
|
||||
playfanfare MUS_HEAL
|
||||
waitfanfare
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
removeobject LOCALID_CAPT_STERN
|
||||
setflag FLAG_HIDE_ROUTE_110_TEAM_AQUA
|
||||
call_if_eq VAR_REGISTER_BIRCH_STATE, 0, SlateportCity_OceanicMuseum_2F_EventScript_ReadyRegisterBirch
|
||||
|
||||
@ -495,6 +495,7 @@ SootopolisCity_EventScript_RayquazaSceneFromPokeCenter::
|
||||
removeobject LOCALID_GROUDON
|
||||
removeobject LOCALID_KYOGRE
|
||||
addobject LOCALID_RAYQUAZA
|
||||
hideobjectat LOCALID_RAYQUAZA, MAP_SOOTOPOLIS_CITY
|
||||
setvar VAR_0x8004, TRUE
|
||||
special Script_DoRayquazaScene
|
||||
waitstate
|
||||
|
||||
@ -96,6 +96,7 @@ TrainerHill_Entrance_EventScript_PlayerExitChallenge::
|
||||
waitmovement 0
|
||||
setvar VAR_TRAINER_HILL_IS_ACTIVE, 0
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
releaseall
|
||||
TrainerHill_Entrance_EventScript_EndExitChallenge::
|
||||
end
|
||||
@ -161,6 +162,7 @@ TrainerHill_Entrance_EventScript_ChooseChallenge::
|
||||
setvar VAR_TRAINER_HILL_IS_ACTIVE, 1
|
||||
setvar VAR_TEMP_5, 0
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
msgbox TrainerHill_Entrance_Text_TimeProgessGetSetGo, MSGBOX_DEFAULT
|
||||
trainerhill_start
|
||||
releaseall
|
||||
|
||||
@ -26,6 +26,7 @@ UnionRoom_OnResume:
|
||||
end
|
||||
|
||||
UnionRoom_OnTransition:
|
||||
setflag FLAG_TEMP_HIDE_FOLLOWER
|
||||
end
|
||||
|
||||
UnionRoom_EventScript_Player1::
|
||||
@ -106,4 +107,3 @@ UnionRoom_EventScript_Unused::
|
||||
waitstate
|
||||
releaseall
|
||||
end
|
||||
|
||||
|
||||
@ -133,6 +133,7 @@ BattleFrontier_BattlePikeThreePathRoom_EventScript_NoTurningBack::
|
||||
lockall
|
||||
msgbox BattleFrontier_BattlePike_Text_PathBlockedNoTurningBack, MSGBOX_DEFAULT
|
||||
closemessage
|
||||
releaseall
|
||||
end
|
||||
|
||||
BattleFrontier_BattlePikeRoomNormal_EventScript_SetEnteredRoom::
|
||||
@ -146,6 +147,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_NoTurningBack::
|
||||
lockall
|
||||
msgbox BattleFrontier_BattlePike_Text_PathBlockedNoTurningBack, MSGBOX_DEFAULT
|
||||
closemessage
|
||||
releaseall
|
||||
end
|
||||
|
||||
BattleFrontier_BattlePikeRoomNormal_EventScript_Exit::
|
||||
@ -214,6 +216,7 @@ BattleFrontier_BattlePikeRoomWildMons_EventScript_NoTurningBack::
|
||||
lockall
|
||||
msgbox BattleFrontier_BattlePike_Text_PathBlockedNoTurningBack, MSGBOX_DEFAULT
|
||||
closemessage
|
||||
releaseall
|
||||
end
|
||||
|
||||
BattleFrontier_BattlePike_EventScript_Retire::
|
||||
|
||||
@ -103,6 +103,7 @@ Route117_PokemonDayCare_EventScript_GiveMonToRaise::
|
||||
msgbox Route117_PokemonDayCare_Text_WellRaiseYourMon, MSGBOX_DEFAULT
|
||||
waitmoncry
|
||||
special StoreSelectedPokemonInDaycare
|
||||
callnative UpdateFollowingPokemon
|
||||
incrementgamestat GAME_STAT_USED_DAYCARE
|
||||
specialvar VAR_RESULT, GetDaycareState
|
||||
goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route117_PokemonDayCare_EventScript_CanRaiseOneMore
|
||||
|
||||
@ -138,27 +138,35 @@ Debug_EventScript_Text_DefensiveIVs:
|
||||
.string "HP IVs: {STR_VAR_1}, DEF IVs: {STR_VAR_2}, SPDEF IVs: {STR_VAR_3}$"
|
||||
|
||||
Debug_EventScript_Script_1::
|
||||
release
|
||||
end
|
||||
|
||||
Debug_EventScript_Script_2::
|
||||
release
|
||||
end
|
||||
|
||||
Debug_EventScript_Script_3::
|
||||
release
|
||||
end
|
||||
|
||||
Debug_EventScript_Script_4::
|
||||
release
|
||||
end
|
||||
|
||||
Debug_EventScript_Script_5::
|
||||
release
|
||||
end
|
||||
|
||||
Debug_EventScript_Script_6::
|
||||
release
|
||||
end
|
||||
|
||||
Debug_EventScript_Script_7::
|
||||
release
|
||||
end
|
||||
|
||||
Debug_EventScript_Script_8::
|
||||
release
|
||||
end
|
||||
|
||||
Debug_CheckSaveBlock::
|
||||
@ -431,4 +439,14 @@ Debug_EventScript_InflictStatus1_Text_Freeze:
|
||||
Debug_EventScript_InflictStatus1_Text_Frostbite:
|
||||
.string "Frostbite$"
|
||||
|
||||
Debug_EventScript_EWRAMCounters::
|
||||
callnative CheckEWRAMCounters
|
||||
msgbox Debug_EventScript_EWRAMCounters_Text, MSGBOX_DEFAULT
|
||||
release
|
||||
end
|
||||
|
||||
Debug_EventScript_EWRAMCounters_Text::
|
||||
.string "Follower Steps: {STR_VAR_1}.\n"
|
||||
.string "Fishing Chain: {STR_VAR_2}.$"
|
||||
|
||||
.endif
|
||||
|
||||
@ -11,26 +11,25 @@ EventScript_CutTree::
|
||||
goto_if_eq VAR_RESULT, NO, EventScript_CancelCut
|
||||
msgbox Text_MonUsedFieldMove, MSGBOX_DEFAULT
|
||||
closemessage
|
||||
EventScript_CutTreeCommon:
|
||||
isfollowerfieldmoveuser VAR_0x8004
|
||||
setfieldeffectargument 3, VAR_0x8004 @ skip pose if so
|
||||
dofieldeffect FLDEFF_USE_CUT_ON_TREE
|
||||
waitstate
|
||||
goto EventScript_CutTreeDown
|
||||
end
|
||||
|
||||
@ Use cut from party menu
|
||||
EventScript_UseCut::
|
||||
lockall
|
||||
dofieldeffect FLDEFF_USE_CUT_ON_TREE
|
||||
waitstate
|
||||
goto EventScript_CutTreeDown
|
||||
end
|
||||
|
||||
EventScript_CutTreeDown::
|
||||
EventScript_CutTreeDown:: @ fallthrough
|
||||
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
|
||||
call_if_eq VAR_0x8004, TRUE, EventScript_FollowerFieldMove
|
||||
applymovement VAR_LAST_TALKED, Movement_CutTreeDown
|
||||
waitmovement 0
|
||||
removeobject VAR_LAST_TALKED
|
||||
releaseall
|
||||
end
|
||||
|
||||
@ Use cut from party menu
|
||||
EventScript_UseCut::
|
||||
lockall
|
||||
goto EventScript_CutTreeCommon
|
||||
|
||||
Movement_CutTreeDown:
|
||||
cut_tree
|
||||
step_end
|
||||
@ -57,6 +56,11 @@ Text_CantCut:
|
||||
.string "This tree looks like it can be\n"
|
||||
.string "CUT down!$"
|
||||
|
||||
@ Use rock smash from party menu
|
||||
EventScript_UseRockSmash::
|
||||
lockall
|
||||
goto EventScript_RockSmashCommon
|
||||
|
||||
@ Interact with smashable rock
|
||||
EventScript_RockSmash::
|
||||
lockall
|
||||
@ -70,20 +74,15 @@ EventScript_RockSmash::
|
||||
goto_if_eq VAR_RESULT, NO, EventScript_CancelSmash
|
||||
msgbox Text_MonUsedFieldMove, MSGBOX_DEFAULT
|
||||
closemessage
|
||||
EventScript_RockSmashCommon:
|
||||
@ check if follower should use the field move
|
||||
isfollowerfieldmoveuser VAR_0x8004
|
||||
setfieldeffectargument 3, VAR_0x8004 @ skip pose if so
|
||||
dofieldeffect FLDEFF_USE_ROCK_SMASH
|
||||
waitstate
|
||||
goto EventScript_SmashRock
|
||||
end
|
||||
|
||||
@ Use rock smash from party menu
|
||||
EventScript_UseRockSmash::
|
||||
lockall
|
||||
dofieldeffect FLDEFF_USE_ROCK_SMASH
|
||||
waitstate
|
||||
goto EventScript_SmashRock
|
||||
end
|
||||
|
||||
EventScript_SmashRock::
|
||||
EventScript_SmashRock:: @ fallthrough
|
||||
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
|
||||
call_if_eq VAR_0x8004, TRUE, EventScript_FollowerFieldMove
|
||||
applymovement VAR_LAST_TALKED, Movement_SmashRock
|
||||
waitmovement 0
|
||||
removeobject VAR_LAST_TALKED
|
||||
@ -95,10 +94,117 @@ EventScript_SmashRock::
|
||||
releaseall
|
||||
end
|
||||
|
||||
EventScript_FollowerFieldMove:
|
||||
getdirectiontoface VAR_0x8005, OBJ_EVENT_ID_FOLLOWER, OBJ_EVENT_ID_PLAYER
|
||||
specialvar VAR_0x8006, GetPlayerFacingDirection
|
||||
goto_if_eq VAR_0x8005, DIR_NONE, EventScript_FollowerFieldMoveEnd
|
||||
@ Swap follower and player
|
||||
call EventScript_FollowerSwap
|
||||
@ Face follower in direction and jump
|
||||
switch VAR_0x8006
|
||||
case DIR_NORTH, EventScript_FollowerJumpNorth
|
||||
case DIR_EAST, EventScript_FollowerJumpEast
|
||||
case DIR_SOUTH, EventScript_FollowerJumpSouth
|
||||
case DIR_WEST, EventScript_FollowerJumpWest
|
||||
EventScript_FollowerFieldMoveEnd:
|
||||
return
|
||||
|
||||
EventScript_FollowerSwap:
|
||||
switch VAR_0x8005
|
||||
case DIR_NORTH, EventScript_FollowerMoveNorth
|
||||
case DIR_EAST, EventScript_FollowerMoveEast
|
||||
case DIR_SOUTH, EventScript_FollowerMoveSouth
|
||||
case DIR_WEST, EventScript_FollowerMoveWest
|
||||
return
|
||||
|
||||
EventScript_FollowerMoveNorth:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_WalkUp
|
||||
applymovement OBJ_EVENT_ID_PLAYER, Movement_WalkDown
|
||||
waitmovement 0
|
||||
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceUp
|
||||
waitmovement 0
|
||||
return
|
||||
|
||||
EventScript_FollowerMoveEast:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_WalkRight
|
||||
applymovement OBJ_EVENT_ID_PLAYER, Movement_WalkLeft
|
||||
waitmovement 0
|
||||
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceRight
|
||||
waitmovement 0
|
||||
return
|
||||
|
||||
EventScript_FollowerMoveSouth:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_WalkDown
|
||||
applymovement OBJ_EVENT_ID_PLAYER, Movement_WalkUp
|
||||
waitmovement 0
|
||||
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceDown
|
||||
waitmovement 0
|
||||
return
|
||||
|
||||
EventScript_FollowerMoveWest:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_WalkLeft
|
||||
applymovement OBJ_EVENT_ID_PLAYER, Movement_WalkRight
|
||||
waitmovement 0
|
||||
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceLeft
|
||||
waitmovement 0
|
||||
return
|
||||
|
||||
EventScript_FollowerJumpNorth:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_JumpUp
|
||||
waitmovement 0
|
||||
return
|
||||
|
||||
EventScript_FollowerJumpEast:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_JumpRight
|
||||
waitmovement 0
|
||||
return
|
||||
|
||||
EventScript_FollowerJumpSouth:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_JumpDown
|
||||
waitmovement 0
|
||||
return
|
||||
|
||||
EventScript_FollowerJumpWest:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_JumpLeft
|
||||
waitmovement 0
|
||||
return
|
||||
|
||||
EventScript_EndSmash::
|
||||
releaseall
|
||||
end
|
||||
|
||||
Movement_WalkUp:
|
||||
walk_up
|
||||
step_end
|
||||
|
||||
Movement_JumpUp:
|
||||
jump_in_place_up
|
||||
step_end
|
||||
|
||||
Movement_WalkRight:
|
||||
walk_right
|
||||
step_end
|
||||
|
||||
Movement_JumpRight:
|
||||
jump_in_place_right
|
||||
step_end
|
||||
|
||||
Movement_WalkDown:
|
||||
walk_down
|
||||
step_end
|
||||
|
||||
Movement_JumpDown:
|
||||
jump_in_place_down
|
||||
step_end
|
||||
|
||||
Movement_WalkLeft:
|
||||
walk_left
|
||||
step_end
|
||||
|
||||
Movement_JumpLeft:
|
||||
jump_in_place_left
|
||||
step_end
|
||||
|
||||
Movement_SmashRock:
|
||||
rock_smash_break
|
||||
step_end
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
EventScript_UseFlash::
|
||||
animateflash 1
|
||||
setflashlevel 1
|
||||
releaseall
|
||||
end
|
||||
|
||||
648
data/scripts/follower.inc
Normal file
@ -0,0 +1,648 @@
|
||||
gText_FollowerLovesYou::
|
||||
.string "{STR_VAR_1} is regarding you with\nadoration!$"
|
||||
|
||||
gText_FollowerLostInThought::
|
||||
.string "{STR_VAR_1} seems lost in thought.$"
|
||||
|
||||
gText_FollowerDefault::
|
||||
.string "ERROR 404: Script not found.$"
|
||||
|
||||
gText_WantsToFly::
|
||||
.string "{STR_VAR_1} looks up at the\nsky restlessly.\pWould you like to use FLY?$"
|
||||
|
||||
EventScript_Follower::
|
||||
lock
|
||||
bufferlivemonnickname 0
|
||||
playfirstmoncry
|
||||
getfolloweraction
|
||||
EventScript_FollowerEnd::
|
||||
waitfieldeffect FLDEFF_EMOTE
|
||||
release
|
||||
end
|
||||
|
||||
EventScript_FollowerLovesYou::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, ContestHall_Movement_Heart
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
waitmoncry
|
||||
msgbox gText_FollowerLovesYou, MSGBOX_DEFAULT
|
||||
return
|
||||
|
||||
@ Message address must be loaded into bank 0
|
||||
EventScript_FollowerGeneric:: @ similar to Std_MsgboxDefault
|
||||
faceplayer
|
||||
EventScript_FollowerGenericSkipFace:
|
||||
waitfieldeffect FLDEFF_EMOTE
|
||||
message 0x0
|
||||
waitmessage
|
||||
waitbuttonpress
|
||||
return
|
||||
|
||||
EventScript_FollowerJump::
|
||||
faceplayer
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerSplashMovement
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
waitfieldeffect FLDEFF_EMOTE
|
||||
message 0x0
|
||||
waitmessage
|
||||
waitbuttonpress
|
||||
return
|
||||
|
||||
EnterPokeballMovement::
|
||||
enter_pokeball
|
||||
step_end
|
||||
|
||||
@ Movement scripts below, movements are defined in movement.inc
|
||||
|
||||
FollowerSplashMovement::
|
||||
jump_in_place_down
|
||||
delay_4
|
||||
jump_in_place_down
|
||||
face_player
|
||||
step_end
|
||||
|
||||
FollowerShiverVerticalMovement:
|
||||
lock_facing_direction
|
||||
slide_left
|
||||
slide_right
|
||||
slide_right
|
||||
slide_left
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerShiverHorizontalMovement:
|
||||
lock_facing_direction
|
||||
slide_up
|
||||
slide_down
|
||||
slide_down
|
||||
slide_up
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerNostalgiaMovement:
|
||||
face_away_player
|
||||
lock_facing_direction
|
||||
jump_in_place_down
|
||||
jump_in_place_down
|
||||
jump_in_place_down
|
||||
unlock_facing_direction
|
||||
face_player
|
||||
lock_facing_direction
|
||||
jump_in_place_down
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerSkippingMovement:
|
||||
lock_facing_direction
|
||||
jump_in_place_down
|
||||
delay_4
|
||||
jump_in_place_down
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerJumpOnPlayerNorth:
|
||||
jump_up
|
||||
delay_4
|
||||
lock_facing_direction
|
||||
walk_fast_down
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerJumpOnPlayerSouth:
|
||||
jump_down
|
||||
delay_4
|
||||
lock_facing_direction
|
||||
walk_fast_up
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerJumpOnPlayerEast:
|
||||
jump_right
|
||||
delay_4
|
||||
lock_facing_direction
|
||||
walk_fast_left
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerJumpOnPlayerWest:
|
||||
jump_left
|
||||
delay_4
|
||||
lock_facing_direction
|
||||
walk_fast_right
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerCuddlingNorth:
|
||||
face_left
|
||||
lock_facing_direction
|
||||
walk_up
|
||||
walk_in_place_left
|
||||
walk_in_place_left
|
||||
unlock_facing_direction
|
||||
walk_down
|
||||
face_player
|
||||
step_end
|
||||
|
||||
FollowerCuddlingSouth:
|
||||
face_right
|
||||
lock_facing_direction
|
||||
walk_down
|
||||
walk_in_place_right
|
||||
walk_in_place_right
|
||||
unlock_facing_direction
|
||||
walk_up
|
||||
face_player
|
||||
step_end
|
||||
|
||||
FollowerCuddlingEast:
|
||||
face_down
|
||||
lock_facing_direction
|
||||
walk_right
|
||||
walk_in_place_down
|
||||
walk_in_place_down
|
||||
unlock_facing_direction
|
||||
walk_left
|
||||
face_player
|
||||
step_end
|
||||
|
||||
FollowerCuddlingWest:
|
||||
face_down
|
||||
lock_facing_direction
|
||||
walk_left
|
||||
walk_in_place_down
|
||||
walk_in_place_down
|
||||
unlock_facing_direction
|
||||
walk_right
|
||||
face_player
|
||||
step_end
|
||||
|
||||
FollowerGetCloserNorth:
|
||||
walk_up
|
||||
delay_16
|
||||
lock_facing_direction
|
||||
walk_down
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerGetCloserSouth:
|
||||
walk_down
|
||||
delay_16
|
||||
lock_facing_direction
|
||||
walk_up
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerGetCloserEast:
|
||||
walk_right
|
||||
delay_16
|
||||
lock_facing_direction
|
||||
walk_left
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerGetCloserWest:
|
||||
walk_left
|
||||
delay_16
|
||||
lock_facing_direction
|
||||
walk_right
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerPokeNorth:
|
||||
walk_faster_up
|
||||
delay_8
|
||||
lock_facing_direction
|
||||
walk_faster_down
|
||||
delay_4
|
||||
walk_faster_up
|
||||
delay_4
|
||||
walk_faster_down
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerPokeSouth:
|
||||
walk_faster_down
|
||||
delay_8
|
||||
lock_facing_direction
|
||||
walk_faster_up
|
||||
delay_4
|
||||
walk_faster_down
|
||||
delay_4
|
||||
walk_faster_up
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerPokeEast:
|
||||
walk_faster_right
|
||||
delay_8
|
||||
lock_facing_direction
|
||||
walk_faster_left
|
||||
delay_4
|
||||
walk_faster_right
|
||||
delay_4
|
||||
walk_faster_left
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerPokeWest:
|
||||
walk_faster_left
|
||||
delay_8
|
||||
lock_facing_direction
|
||||
walk_faster_right
|
||||
delay_4
|
||||
walk_faster_left
|
||||
delay_4
|
||||
walk_faster_right
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerLookAround:
|
||||
face_away_player
|
||||
delay_16
|
||||
delay_16
|
||||
face_left
|
||||
delay_16
|
||||
delay_16
|
||||
face_up
|
||||
delay_16
|
||||
delay_16
|
||||
face_down
|
||||
delay_16
|
||||
delay_16
|
||||
step_end
|
||||
|
||||
FollowerLookAway:
|
||||
face_away_player
|
||||
delay_16
|
||||
delay_16
|
||||
step_end
|
||||
|
||||
FollowerLookAwayBark:
|
||||
face_away_player
|
||||
lock_facing_direction
|
||||
jump_in_place_down
|
||||
jump_in_place_down
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerLookAwayPokeG:
|
||||
face_away_player
|
||||
lock_facing_direction
|
||||
walk_in_place_down
|
||||
walk_in_place_down
|
||||
walk_in_place_down
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerPokeGround:
|
||||
lock_facing_direction
|
||||
walk_in_place_down
|
||||
walk_in_place_down
|
||||
walk_in_place_down
|
||||
unlock_facing_direction
|
||||
step_end
|
||||
|
||||
FollowerStartled:
|
||||
face_away_player
|
||||
lock_facing_direction
|
||||
jump_in_place_down
|
||||
unlock_facing_direction
|
||||
face_player
|
||||
step_end
|
||||
|
||||
FollowerHopFast:
|
||||
jump_in_place_up
|
||||
jump_in_place_down
|
||||
jump_in_place_left
|
||||
jump_in_place_right
|
||||
face_player
|
||||
step_end
|
||||
|
||||
FollowerDizzy:
|
||||
walk_in_place_left
|
||||
walk_in_place_fast_right
|
||||
walk_in_place_slow_up
|
||||
walk_in_place_fast_down
|
||||
delay_4
|
||||
face_away_player
|
||||
step_end
|
||||
|
||||
FollowerLookAroundScared:
|
||||
face_up
|
||||
delay_16
|
||||
face_down
|
||||
delay_16
|
||||
face_left
|
||||
delay_16
|
||||
face_right
|
||||
delay_16
|
||||
face_up
|
||||
delay_16
|
||||
face_down
|
||||
delay_16
|
||||
face_left
|
||||
delay_16
|
||||
face_right
|
||||
delay_16
|
||||
face_player
|
||||
step_end
|
||||
|
||||
FollowerDance:
|
||||
lock_facing_direction
|
||||
jump_in_place_up
|
||||
unlock_facing_direction
|
||||
walk_in_place_fast_up
|
||||
walk_in_place_fast_left
|
||||
walk_in_place_fast_down
|
||||
walk_in_place_fast_right
|
||||
walk_in_place_fast_up
|
||||
walk_in_place_fast_left
|
||||
walk_in_place_fast_down
|
||||
walk_in_place_fast_right
|
||||
jump_in_place_up
|
||||
jump_in_place_down
|
||||
jump_in_place_up
|
||||
face_player
|
||||
step_end
|
||||
|
||||
@ Movement scripts
|
||||
|
||||
EventScript_FollowerIsShivering::
|
||||
faceplayer
|
||||
compare VAR_FACING, DIR_NORTH
|
||||
call_if_eq ShiverVertical
|
||||
compare VAR_FACING, DIR_SOUTH
|
||||
call_if_eq ShiverVertical
|
||||
compare VAR_FACING, DIR_WEST
|
||||
call_if_eq ShiverHorizontal
|
||||
compare VAR_FACING, DIR_EAST
|
||||
call_if_eq ShiverHorizontal
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
ShiverVertical:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerShiverVerticalMovement
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
ShiverHorizontal:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerShiverHorizontalMovement
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
EventScript_FollowerNostalgia::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerNostalgiaMovement
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
EventScript_FollowerHopping::
|
||||
faceplayer
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerSkippingMovement
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
JumpOnN:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerJumpOnPlayerNorth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
JumpOnS:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerJumpOnPlayerSouth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
JumpOnE:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerJumpOnPlayerEast
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
JumpOnW:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerJumpOnPlayerWest
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
EventScript_FollowerJumpOnPlayer::
|
||||
faceplayer
|
||||
compare VAR_FACING, DIR_NORTH
|
||||
call_if_eq JumpOnS
|
||||
compare VAR_FACING, DIR_SOUTH
|
||||
call_if_eq JumpOnN
|
||||
compare VAR_FACING, DIR_WEST
|
||||
call_if_eq JumpOnE
|
||||
compare VAR_FACING, DIR_EAST
|
||||
call_if_eq JumpOnW
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
CuddleN:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerCuddlingNorth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
CuddleS:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerCuddlingSouth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
CuddleE:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerCuddlingEast
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
CuddleW:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER, FollowerCuddlingWest
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
EventScript_FollowerCuddling:: @ similar to Std_MsgboxDefault
|
||||
faceplayer
|
||||
compare VAR_FACING, DIR_NORTH
|
||||
call_if_eq CuddleS
|
||||
compare VAR_FACING, DIR_SOUTH
|
||||
call_if_eq CuddleN
|
||||
compare VAR_FACING, DIR_WEST
|
||||
call_if_eq CuddleE
|
||||
compare VAR_FACING, DIR_EAST
|
||||
call_if_eq CuddleW
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
ShCuddleN:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverVerticalMovement
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingNorth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
ShCuddleS:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverVerticalMovement
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingSouth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
ShCuddleE:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverHorizontalMovement
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingEast
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
ShCuddleW:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverHorizontalMovement
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingWest
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
EventScript_FollowerShiverCuddling::
|
||||
faceplayer
|
||||
compare VAR_FACING, DIR_NORTH
|
||||
call_if_eq ShCuddleS
|
||||
compare VAR_FACING, DIR_SOUTH
|
||||
call_if_eq ShCuddleN
|
||||
compare VAR_FACING, DIR_WEST
|
||||
call_if_eq ShCuddleE
|
||||
compare VAR_FACING, DIR_EAST
|
||||
call_if_eq ShCuddleW
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
CreepCloserN:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserNorth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
CreepCloserS:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserSouth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
CreepCloserE:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserEast
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
CreepCloserW:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserWest
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
EventScript_FollowerGetCloser::
|
||||
faceplayer
|
||||
compare VAR_FACING, DIR_NORTH
|
||||
call_if_eq CreepCloserS
|
||||
compare VAR_FACING, DIR_SOUTH
|
||||
call_if_eq CreepCloserN
|
||||
compare VAR_FACING, DIR_WEST
|
||||
call_if_eq CreepCloserE
|
||||
compare VAR_FACING, DIR_EAST
|
||||
call_if_eq CreepCloserW
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
PokePlayerN:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserNorth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
PokePlayerS:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserSouth
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
PokePlayerE:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserEast
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
PokePlayerW:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserWest
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
return
|
||||
|
||||
EventScript_FollowerPokingPlayer::
|
||||
faceplayer
|
||||
compare VAR_FACING, DIR_NORTH
|
||||
call_if_eq PokePlayerS
|
||||
compare VAR_FACING, DIR_SOUTH
|
||||
call_if_eq PokePlayerN
|
||||
compare VAR_FACING, DIR_WEST
|
||||
call_if_eq PokePlayerE
|
||||
compare VAR_FACING, DIR_EAST
|
||||
call_if_eq PokePlayerW
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
EventScript_FollowerLookAround::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAround
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
EventScript_FollowerLookAway::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAway
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerLookAwayBark::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAwayBark
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerLookAwayPoke::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAwayPokeG
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerPokeGround::
|
||||
faceplayer
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerPokeGround
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
EventScript_FollowerStartled::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerStartled
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerFastHopping::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerHopFast
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerDizzy::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerDizzy
|
||||
waitmovement 0
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerLookAroundScared::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAroundScared
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
EventScript_FollowerDance::
|
||||
faceplayer
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER FollowerDance
|
||||
waitmovement 0
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerFaceUp::
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER Common_Movement_FaceUp
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerFaceResult:: @ Face towards direction in VAR_RESULT
|
||||
switch VAR_RESULT
|
||||
case DIR_SOUTH, EventScript_FollowerFaceDown
|
||||
case DIR_NORTH, EventScript_FollowerFaceUp
|
||||
case DIR_WEST, EventScript_FollowerFaceLeft
|
||||
case DIR_EAST, EventScript_FollowerFaceRight
|
||||
goto EventScript_FollowerGeneric
|
||||
|
||||
EventScript_FollowerFaceDown:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER Common_Movement_FaceDown
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerFaceLeft:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER Common_Movement_FaceLeft
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
|
||||
EventScript_FollowerFaceRight:
|
||||
applymovement OBJ_EVENT_ID_FOLLOWER Common_Movement_FaceRight
|
||||
waitmovement OBJ_EVENT_ID_FOLLOWER
|
||||
goto EventScript_FollowerGenericSkipFace
|
||||
@ -1,3 +1,6 @@
|
||||
@ Starting from here, these movements are considered
|
||||
@ 'safe' (won't put follower into a Pokeball)
|
||||
Common_Movement_FollowerSafeStart::
|
||||
Common_Movement_QuestionMark:
|
||||
emote_question_mark
|
||||
step_end
|
||||
@ -68,6 +71,10 @@ Common_Movement_WalkInPlaceRight:
|
||||
walk_in_place_right
|
||||
step_end
|
||||
|
||||
@ End of follower-safe movements
|
||||
Common_Movement_FollowerSafeEnd::
|
||||
step_end
|
||||
|
||||
Common_Movement_WalkUp6:
|
||||
walk_up
|
||||
walk_up
|
||||
|
||||
@ -33,13 +33,14 @@ EventScript_PkmnCenterNurse_IllTakeYourPkmn2::
|
||||
return
|
||||
|
||||
EventScript_PkmnCenterNurse_TakeAndHealPkmn::
|
||||
applymovement VAR_0x800B, Common_Movement_WalkInPlaceFasterLeft
|
||||
applymovement VAR_0x800B, Movement_PkmnCenterNurse_Turn @ Changed from Common_Movement_WalkInPlaceFasterLeft to force the follower to enter their Poké Ball
|
||||
waitmovement 0
|
||||
dofieldeffect FLDEFF_POKECENTER_HEAL
|
||||
waitfieldeffect FLDEFF_POKECENTER_HEAL
|
||||
applymovement VAR_0x800B, Common_Movement_WalkInPlaceFasterDown
|
||||
waitmovement 0
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
return
|
||||
|
||||
EventScript_PkmnCenterNurse_CheckTrainerHillAndUnionRoom::
|
||||
@ -120,3 +121,7 @@ Movement_PkmnCenterNurse_Bow:
|
||||
nurse_joy_bow
|
||||
delay_4
|
||||
step_end
|
||||
|
||||
Movement_PkmnCenterNurse_Turn:
|
||||
walk_in_place_faster_left
|
||||
step_end
|
||||
|
||||
@ -646,6 +646,7 @@ SecretBase_EventScript_BattleTrainer::
|
||||
call_if_eq VAR_RESULT, B_OUTCOME_WON, SecretBase_EventScript_WonSecretBaseBattle
|
||||
call_if_eq VAR_RESULT, B_OUTCOME_LOST, SecretBase_EventScript_LostSecretBaseBattle
|
||||
special HealPlayerParty
|
||||
callnative UpdateFollowingPokemon
|
||||
release
|
||||
end
|
||||
|
||||
|
||||
@ -10,8 +10,10 @@ EventScript_TrainerApproach::
|
||||
EventScript_TryDoNormalTrainerBattle::
|
||||
lock
|
||||
faceplayer
|
||||
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
|
||||
applymovement VAR_LAST_TALKED, Movement_RevealTrainer
|
||||
waitmovement 0
|
||||
clearflag FLAG_SAFE_FOLLOWER_MOVEMENT
|
||||
specialvar VAR_RESULT, GetTrainerFlag
|
||||
goto_if_ne VAR_RESULT, FALSE, EventScript_NoNormalTrainerBattle
|
||||
special PlayTrainerEncounterMusic
|
||||
@ -44,8 +46,10 @@ EventScript_NoDoubleTrainerBattle::
|
||||
gotopostbattlescript
|
||||
|
||||
EventScript_DoNoIntroTrainerBattle::
|
||||
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
|
||||
applymovement VAR_LAST_TALKED, Movement_RevealTrainer
|
||||
waitmovement 0
|
||||
clearflag FLAG_SAFE_FOLLOWER_MOVEMENT
|
||||
special PlayTrainerEncounterMusic
|
||||
dotrainerbattle
|
||||
gotopostbattlescript
|
||||
@ -93,8 +97,10 @@ EventScript_NotEnoughMonsForDoubleRematchBattle::
|
||||
end
|
||||
|
||||
EventScript_RevealTrainer::
|
||||
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
|
||||
applymovement VAR_LAST_TALKED, Movement_RevealTrainer
|
||||
waitmovement 0
|
||||
clearflag FLAG_SAFE_FOLLOWER_MOVEMENT
|
||||
return
|
||||
|
||||
Movement_RevealTrainer:
|
||||
|
||||
110
dev_scripts/followers/extract_sprites.py
Normal file
@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env python3
|
||||
""" Extract sprites from HGSS follower spritesheets. """
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
from glob import glob
|
||||
|
||||
import png
|
||||
|
||||
|
||||
SPRITESHEETS = [('gen1.png', 15, 11, 1)]
|
||||
output_dir = 'sprites'
|
||||
index_to_name = {}
|
||||
with open('names.txt', 'r') as f:
|
||||
for line in f:
|
||||
index, name = line.split(' ')[:2]
|
||||
name = name.strip()
|
||||
index_to_name[int(index)] = name.lower()
|
||||
name_to_index = {v: k for k, v in index_to_name.items()}
|
||||
PKMN_GRAPHICS = os.path.join('graphics', 'pokemon')
|
||||
|
||||
|
||||
def extract_sprites(spritesheet):
|
||||
path, width, height, offset = spritesheet
|
||||
for y in range(height):
|
||||
for x in range(width):
|
||||
if x == 3 and y == 0 or x == 10 and y == 1:
|
||||
continue
|
||||
output_path = os.path.join(output_dir, f'{offset:03d}.png')
|
||||
subprocess.run(['convert', '-extract', f'64x128+{x*(64+1)}+{y*(128+1)}', path, output_path], check=True)
|
||||
offset += 1
|
||||
|
||||
|
||||
def stack_sprite(name, path):
|
||||
joinp = os.path.join
|
||||
frames = [joinp(path, 'down', name), joinp(path, 'down', 'frame2', name),
|
||||
joinp(path, 'up', name), joinp(path, 'up', 'frame2', name),
|
||||
joinp(path, 'left', name), joinp(path, 'left', 'frame2', name)]
|
||||
output = joinp(path, name)
|
||||
subprocess.run(['convert'] + frames + ['+append', output], check=True)
|
||||
print(f'Stacked {output}')
|
||||
|
||||
def canonicalize_names():
|
||||
for path in glob('overworld/**/*.png', recursive=True):
|
||||
head, tail = os.path.split(path)
|
||||
name, ext = os.path.splitext(tail)
|
||||
try:
|
||||
num = int(name)
|
||||
except ValueError:
|
||||
continue
|
||||
new_name = f'{num:03d}'
|
||||
new_path = os.path.join(head, new_name+ext)
|
||||
os.rename(path, new_path)
|
||||
print(path, '->', new_path)
|
||||
|
||||
def closest_color(c, palette):
|
||||
min_d = float('inf')
|
||||
best = 0
|
||||
r1, g1, b1 = c
|
||||
for i, (r2, g2, b2) in enumerate(palette[1:], 1):
|
||||
# Color diff from https://stackoverflow.com/questions/1847092/given-an-rgb-value-what-would-be-the-best-way-to-find-the-closest-match-in-the-d
|
||||
d = ((r2-r1)*0.30)**2 + ((g2-g1)*0.59)**2 + ((b2-b1)*0.11)**2
|
||||
if d < min_d:
|
||||
min_d = d
|
||||
best = i
|
||||
return best
|
||||
|
||||
def apply_palette(palette_file, input_file, output_file): # Apply one file's palette to another
|
||||
plt = png.Reader(palette_file)
|
||||
plt.read()
|
||||
target_palette = tuple(c[:3] for c in plt.palette())
|
||||
inp = png.Reader(input_file)
|
||||
w, h, rows, _ = inp.read()
|
||||
src_palette = tuple(c[:3] for c in inp.palette())
|
||||
with open(output_file, 'wb') as f:
|
||||
new_rows = []
|
||||
for row in rows:
|
||||
new_rows.append([closest_color(src_palette[c], target_palette) if c else 0 for c in row])
|
||||
w = png.Writer(width=w, height=h, bitdepth=4, palette=target_palette)
|
||||
w.write(f, new_rows)
|
||||
|
||||
def paletteify(path, output_path=None):
|
||||
output_path = output_path or path
|
||||
joinp = os.path.join
|
||||
_, tail = os.path.split(path)
|
||||
species, _ = os.path.splitext(tail)
|
||||
front = png.Reader(joinp(PKMN_GRAPHICS, species, 'anim_front.png'))
|
||||
front.read()
|
||||
target_palette = tuple(c[:3] for c in front.palette())
|
||||
r, g, b = target_palette[0]
|
||||
color = f'rgb({r},{g},{b})'
|
||||
# Strip alpha color
|
||||
subprocess.run(['convert', path, '-background', color, '-alpha', 'remove', output_path], check=True)
|
||||
apply_palette(joinp(PKMN_GRAPHICS, species, 'anim_front.png'), output_path, output_path)
|
||||
|
||||
# Sprites from https://veekun.com/dex/downloads
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = sys.argv[1:]
|
||||
if args:
|
||||
paletteify(args[0])
|
||||
else:
|
||||
for path in sorted(glob('overworld/*.png')):
|
||||
_, tail = os.path.split(path)
|
||||
name, _ = os.path.splitext(tail)
|
||||
output_path = os.path.join('graphics/object_events/pics/pokemon', f'{name}.png')
|
||||
try:
|
||||
paletteify(path, output_path)
|
||||
except Exception as e:
|
||||
print(name, e.__class__.__name__, e, file=sys.stderr)
|
||||
50
dev_scripts/followers/follower_emotions.py
Normal file
@ -0,0 +1,50 @@
|
||||
""" Processes & outputs follower emotion messages """
|
||||
import sys
|
||||
import re
|
||||
import textwrap
|
||||
|
||||
blank_regex = re.compile(r'\(?_+\)?')
|
||||
|
||||
|
||||
# Converts a series of message lines to a better format
|
||||
def convert_messages(infile, outfile='emotions.txt'):
|
||||
with open(infile, 'r') as f_in, open(outfile, 'w') as f_out:
|
||||
for line in f_in:
|
||||
line = line.rstrip('\n')
|
||||
if line and line[0] == '-':
|
||||
line = line[1:]
|
||||
line = line.lstrip()
|
||||
if not line:
|
||||
continue
|
||||
line = blank_regex.sub('{STR_VAR_1}', line)
|
||||
if line[-1] not in ('.', '?', '!', ':'):
|
||||
line += '.'
|
||||
print(line)
|
||||
f_out.write('\n' + line)
|
||||
|
||||
# Prepares a string for field-message display, performing line-wrapping, etc
|
||||
# Does not add a terminator, as this is done by _("")
|
||||
def prepare_string(s):
|
||||
lines = textwrap.wrap(s, width=36) # Width of message window
|
||||
s = lines[0]
|
||||
for i, line in enumerate(lines[1:]):
|
||||
ending = r'\p' if i % 2 else r'\n'
|
||||
s += ending + line
|
||||
return s
|
||||
|
||||
|
||||
# Exports up to n messages in C format to outfile
|
||||
def export_messages(infile, outfile, n=None, indent=0, start=0):
|
||||
with open(infile, 'r') as f_in:
|
||||
lines = f_in.readlines()
|
||||
if n is not None:
|
||||
lines = lines[:n]
|
||||
with open(outfile, 'w') as f_out:
|
||||
codelines = [' '*indent + f'static const u8 sCondMsg{start+i:02d}[] = _("{prepare_string(s)}");' for i, s in enumerate(lines)]
|
||||
f_out.write('\n'.join(codelines))
|
||||
print(f'{len(lines)} lines written')
|
||||
return len(lines)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
export_messages('emotions.txt', 'emotions.h', n=1, start=7)
|
||||
77
dev_scripts/followers/front_palette.py
Normal file
@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env python3
|
||||
""" Extract sprites from HGSS follower spritesheets. """
|
||||
import os.path
|
||||
from os.path import join as joinp
|
||||
import subprocess
|
||||
import sys
|
||||
from glob import glob
|
||||
|
||||
import png
|
||||
from tqdm import tqdm
|
||||
|
||||
import shutil
|
||||
|
||||
def stack_sprite(name, path):
|
||||
frames = [joinp(path, 'down', name), joinp(path, 'down', 'frame2', name),
|
||||
joinp(path, 'up', name), joinp(path, 'up', 'frame2', name),
|
||||
joinp(path, 'left', name), joinp(path, 'left', 'frame2', name)]
|
||||
output = joinp(path, name)
|
||||
subprocess.run(['convert'] + frames + ['+append', output], check=True)
|
||||
print(f'Stacked {output}')
|
||||
|
||||
def closest_color(c, palette):
|
||||
min_d = float('inf')
|
||||
best = 0
|
||||
r1, g1, b1 = c
|
||||
for i, (r2, g2, b2) in enumerate(palette[1:], 1):
|
||||
# Color diff from https://stackoverflow.com/questions/1847092/given-an-rgb-value-what-would-be-the-best-way-to-find-the-closest-match-in-the-d
|
||||
d = ((r2-r1)*0.30)**2 + ((g2-g1)*0.59)**2 + ((b2-b1)*0.11)**2
|
||||
if d < min_d:
|
||||
min_d = d
|
||||
best = i
|
||||
return best
|
||||
|
||||
def apply_palette(palette_file, input_file, output_file): # Apply one file's palette to another
|
||||
plt = png.Reader(palette_file)
|
||||
plt.read()
|
||||
target_palette = tuple(c[:3] for c in plt.palette())
|
||||
inp = png.Reader(input_file)
|
||||
w, h, rows, info = inp.read()
|
||||
src_palette = tuple(c[:3] for c in inp.palette())
|
||||
new_rows = [[closest_color(src_palette[c][:3], target_palette) if c else 0 for c in row] for row in rows]
|
||||
with open(output_file, 'wb') as f:
|
||||
w = png.Writer(width=w, height=h, bitdepth=4, palette=target_palette)
|
||||
w.write(f, new_rows)
|
||||
|
||||
# Sprites from https://veekun.com/dex/downloads
|
||||
|
||||
def apply_front_palettes(ow_dir, project_root=''):
|
||||
mon_graphics = joinp(project_root, 'graphics', 'pokemon')
|
||||
for x in os.walk(ow_dir):
|
||||
current_dir = x[0]
|
||||
sub_dir = current_dir[len(ow_dir) + 1:1000]
|
||||
t = tqdm(sorted(glob(joinp(current_dir, '*.png'))))
|
||||
spaces = 0
|
||||
for path in t:
|
||||
name, _ = os.path.splitext(os.path.basename(path))
|
||||
name = joinp(sub_dir, name)
|
||||
# old_path = joinp(project_root, 'graphics', 'object_events', 'pics', 'pokemon', f'{name}.png')
|
||||
# new_path = joinp(project_root, 'graphics', 'object_events', 'pics', 'pokemon', name, 'follower.png')
|
||||
# os.mkdir(joinp(project_root, 'graphics', 'object_events', 'pics', 'pokemon', name))
|
||||
# shutil.move(old_path, new_path)
|
||||
spaces = min(max(len(name), spaces), 10)
|
||||
t.set_description(name + ' '*(spaces-len(name)))
|
||||
output_path = joinp(project_root, 'graphics', 'object_events', 'pics', 'pokemon', f'{name}.png')
|
||||
palette_path = joinp(mon_graphics, name, 'anim_front.png')
|
||||
try:
|
||||
apply_palette(palette_path, path, output_path)
|
||||
except Exception as e:
|
||||
palette_path = joinp(mon_graphics, name, 'front.png')
|
||||
try:
|
||||
apply_palette(palette_path, path, output_path)
|
||||
except Exception as e2:
|
||||
t.write(f'{name}: {e2.__class__.__name__}: {e2}', file=sys.stderr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
apply_front_palettes('graphics/object_events/pics/pokemon')
|
||||
26
dev_scripts/followers/palette.py
Normal file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python3
|
||||
""" Extract a GBA-compatible palette from a PNG. """
|
||||
import sys
|
||||
import os.path
|
||||
import png
|
||||
|
||||
PAL_PRELUDE = 'JASC-PAL\n0100\n'
|
||||
|
||||
|
||||
def extract_palette(path):
|
||||
r = png.Reader(path)
|
||||
r.read()
|
||||
root, _ = os.path.splitext(path)
|
||||
out_path = root + '.pal'
|
||||
with open(out_path, 'w', newline='\r\n') as f:
|
||||
f.write(PAL_PRELUDE)
|
||||
colors = r.palette()
|
||||
if len(colors) < 16:
|
||||
colors += [(0, 0, 0) for _ in range(16-len(colors))]
|
||||
f.write(f'{len(colors)}\n')
|
||||
for r, g, b in colors:
|
||||
f.write(f'{r} {g} {b}\n')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
extract_palette(*sys.argv[1:])
|
||||
11
dev_scripts/followers/rename.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
lalala1="graphics/object_events/pics/pokemon/"
|
||||
lalala2="a2"
|
||||
for file in graphics/object_events/pics/pokemon/*.png; do
|
||||
name=${file##*/}
|
||||
base=${name%.png}
|
||||
#echo "${file}"
|
||||
#echo "${base}"
|
||||
echo "graphics/pokemon/${base}/follower.png"
|
||||
mv -- "$file" "graphics/pokemon/${base}/follower.png"
|
||||
done
|
||||
24
dev_scripts/followers/rename_files_of_same_name.py
Normal file
@ -0,0 +1,24 @@
|
||||
import glob
|
||||
import re
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
# THIS IS A TEMPORARY SCRIPT MADE TO RENAME FILES WITH THE "FOLLOWER" NAME TO "OVERWORLD",
|
||||
# AS THESE GRAPHICS CAN ALSO BE USED OUTSIDE THE FOLLOWER FEATURE.
|
||||
#
|
||||
# I'M SAVING IT HERE IN CASE IT'S NEEDED SOMEWHERE IN THE FUTURE, THOUGH TWEAKING MIGHT BE NEEDED.
|
||||
# - AsparagusEduardo
|
||||
|
||||
def rename_files(dir, old, new):
|
||||
for root, dirs, files in os.walk(dir):
|
||||
for name in files:
|
||||
if name.endswith(old):
|
||||
originalName = os.path.join(root, name)
|
||||
newName = originalName.replace(old, new)
|
||||
print(originalName + " -> " + newName)
|
||||
os.rename(originalName, newName)
|
||||
|
||||
rename_files("graphics/pokemon", 'follower.png', "overworld.png")
|
||||
rename_files("graphics/pokemon", 'follow_normal.pal', "overworld_normal.pal")
|
||||
rename_files("graphics/pokemon", 'follow_shiny.pal', "overworld_shiny.pal")
|
||||
64
dev_scripts/followers/rename_to_graphics_pokemon.py
Normal file
@ -0,0 +1,64 @@
|
||||
import glob
|
||||
import re
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
# THIS IS A TEMPORARY SCRIPT MADE TO MOVE EXISTING FOLLOWER GRAPHICS FROM A SINGLE DIRECTORY.
|
||||
# IT TAKES FOLLOWER GRAPHICS FROM a 'followers' FOLDER IN THE ROOT FOLDER AND MOVES THEM BASED ON THEIR NAME.
|
||||
# EG. 'followers/bulbasaur.png' WILL BE MOVED to 'graphics/pokemon/bulbasaur/follower.png'.
|
||||
#
|
||||
# I'M SAVING IT HERE IN CASE IT'S NEEDED SOMEWHERE IN THE FUTURE, THOUGH TWEAKING MIGHT BE NEEDED.
|
||||
# - AsparagusEduardo
|
||||
|
||||
def rellocate_follower_graphics():
|
||||
dict_out = {}
|
||||
count = 0
|
||||
for pth in sorted(glob.glob('followers/*.png')):
|
||||
name = pth.replace(".png", "").replace("followers/", "")
|
||||
count+=1
|
||||
#if (count == 2):
|
||||
# break
|
||||
print(name)
|
||||
newname = name
|
||||
newname = newname.replace("_female", "/female")
|
||||
newname = newname.replace("_hisuian", "/hisuian")
|
||||
newname = newname.replace("_galarian", "/galarian")
|
||||
newname = newname.replace("_origin", "/origin")
|
||||
newname = newname.replace("_therian", "/therian")
|
||||
newname = newname.replace("_east_sea", "/east_sea")
|
||||
newname = newname.replace("_crowned", "/crowned")
|
||||
|
||||
newname = newname.replace("arceus_", "arceus/")
|
||||
newname = newname.replace("burmy_", "burmy/")
|
||||
newname = newname.replace("basculin_", "basculin/")
|
||||
newname = newname.replace("castform_", "castform/")
|
||||
newname = newname.replace("calyrex_", "calyrex/")
|
||||
newname = newname.replace("deerling_", "deerling/")
|
||||
newname = newname.replace("deoxys_", "deoxys/")
|
||||
newname = newname.replace("flabebe_", "flabebe/")
|
||||
newname = newname.replace("floette_", "floette/")
|
||||
newname = newname.replace("florges_", "florges/")
|
||||
newname = newname.replace("furfrou_", "furfrou/")
|
||||
newname = newname.replace("hoopa_", "hoopa/")
|
||||
newname = newname.replace("lycanroc_", "lycanroc/")
|
||||
newname = newname.replace("meloetta_", "meloetta/")
|
||||
newname = newname.replace("necrozma_", "necrozma/")
|
||||
newname = newname.replace("pichu_", "pichu/")
|
||||
newname = newname.replace("rotom_", "rotom/")
|
||||
newname = newname.replace("sawsbuck_", "sawsbuck/")
|
||||
newname = newname.replace("toxtricity_", "toxtricity/")
|
||||
newname = newname.replace("unown_", "unown/")
|
||||
newname = newname.replace("ursaluna_", "ursaluna/")
|
||||
newname = newname.replace("vivillon_", "vivillon/")
|
||||
newname = newname.replace("wormadam_", "wormadam/")
|
||||
|
||||
if (os.path.exists('followers/' + newname) == False):
|
||||
os.mkdir('followers/' + newname)
|
||||
os.rename('followers/' + name + '.png', 'followers/' + newname + '/follower.png')
|
||||
#os.popen('cp followers/' + name + '.png followers/' + name + '/follower.png')
|
||||
#os.remove('followers/' + name + '.png')
|
||||
#print(pth)
|
||||
#subprocess.run(["tools/gbagfx/gbagfx " + name +".png " + name + "_normal.pal'" + str(count) + "'"])
|
||||
|
||||
rellocate_follower_graphics()
|
||||
@ -495,7 +495,7 @@
|
||||
* Aeroblast: Added Wind Move flag.
|
||||
* Ivy Cudgel's type now changes based on Ogerpon's form rather than held item by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3865
|
||||
* Renamed `healBlockBanned` flag to `healingMove` by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3981
|
||||
* Removed some hardcoded move IDs
|
||||
* Removed some hardcoded move IDs
|
||||
* By @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/3982
|
||||
* `MOVE_EXPLOSION`, `MOVE_SELF_DESTRUCT`, `MOVE_FRUSTRATION`, `MOVE_AURA_WHEEL`, `MOVE_PRESENT`, `MOVE_BLIZZARD`.
|
||||
* By @ZnogyroP in https://github.com/rh-hideout/pokeemerald-expansion/pull/4085
|
||||
|
||||
@ -92,9 +92,9 @@ void *AllocInternal(void *heapStart, u32 size, const char *location)
|
||||
{
|
||||
const char *location = MemBlockLocation(block);
|
||||
if (location)
|
||||
MgbaPrintf_("%s: %d bytes allocated", location, block->size);
|
||||
Test_MgbaPrintf("%s: %d bytes allocated", location, block->size);
|
||||
else
|
||||
MgbaPrintf_("<unknown>: %d bytes allocated", block->size);
|
||||
Test_MgbaPrintf("<unknown>: %d bytes allocated", block->size);
|
||||
}
|
||||
block = block->next;
|
||||
}
|
||||
|
||||
@ -52,7 +52,6 @@ static void SortSprites(u32 *spritePriorities, s32 n);
|
||||
static u32 CreateSpriteAt(u32 index, const struct SpriteTemplate *template, s16 x, s16 y, u32 subpriority);
|
||||
static void ResetOamMatrices(void);
|
||||
static void ResetSprite(struct Sprite *sprite);
|
||||
static s16 AllocSpriteTiles(u16 tileCount);
|
||||
static void RequestSpriteFrameImageCopy(u16 index, u16 tileNum, const struct SpriteFrameImage *images);
|
||||
static void ResetAllSprites(void);
|
||||
static void BeginAnim(struct Sprite *sprite);
|
||||
@ -879,9 +878,15 @@ void BeginAnim(struct Sprite *sprite)
|
||||
SetSpriteOamFlipBits(sprite, hFlip, vFlip);
|
||||
|
||||
if (sprite->usingSheet)
|
||||
{
|
||||
if (OW_GFX_COMPRESS && sprite->sheetSpan)
|
||||
imageValue = (imageValue + 1) << sprite->sheetSpan;
|
||||
sprite->oam.tileNum = sprite->sheetTileStart + imageValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
RequestSpriteFrameImageCopy(imageValue, sprite->oam.tileNum, sprite->images);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -931,9 +936,15 @@ void AnimCmd_frame(struct Sprite *sprite)
|
||||
SetSpriteOamFlipBits(sprite, hFlip, vFlip);
|
||||
|
||||
if (sprite->usingSheet)
|
||||
{
|
||||
if (OW_GFX_COMPRESS && sprite->sheetSpan)
|
||||
imageValue = (imageValue + 1) << sprite->sheetSpan;
|
||||
sprite->oam.tileNum = sprite->sheetTileStart + imageValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
RequestSpriteFrameImageCopy(imageValue, sprite->oam.tileNum, sprite->images);
|
||||
}
|
||||
}
|
||||
|
||||
void AnimCmd_end(struct Sprite *sprite)
|
||||
@ -965,9 +976,15 @@ void AnimCmd_jump(struct Sprite *sprite)
|
||||
SetSpriteOamFlipBits(sprite, hFlip, vFlip);
|
||||
|
||||
if (sprite->usingSheet)
|
||||
{
|
||||
if (OW_GFX_COMPRESS && sprite->sheetSpan)
|
||||
imageValue = (imageValue + 1) << sprite->sheetSpan;
|
||||
sprite->oam.tileNum = sprite->sheetTileStart + imageValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
RequestSpriteFrameImageCopy(imageValue, sprite->oam.tileNum, sprite->images);
|
||||
}
|
||||
}
|
||||
|
||||
void AnimCmd_loop(struct Sprite *sprite)
|
||||
@ -1346,6 +1363,8 @@ void SetSpriteSheetFrameTileNum(struct Sprite *sprite)
|
||||
if (sprite->usingSheet)
|
||||
{
|
||||
s16 tileOffset = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.imageValue;
|
||||
if (OW_GFX_COMPRESS && sprite->sheetSpan)
|
||||
tileOffset = (tileOffset + 1) << sprite->sheetSpan;
|
||||
if (tileOffset < 0)
|
||||
tileOffset = 0;
|
||||
sprite->oam.tileNum = sprite->sheetTileStart + tileOffset;
|
||||
@ -1424,7 +1443,7 @@ void SetOamMatrixRotationScaling(u8 matrixNum, s16 xScale, s16 yScale, u16 rotat
|
||||
CopyOamMatrix(matrixNum, &matrix);
|
||||
}
|
||||
|
||||
u16 LoadSpriteSheet(const struct SpriteSheet *sheet)
|
||||
static u16 LoadSpriteSheetWithOffset(const struct SpriteSheet *sheet, u32 offset)
|
||||
{
|
||||
s16 tileStart = AllocSpriteTiles(sheet->size / TILE_SIZE_4BPP);
|
||||
|
||||
@ -1435,11 +1454,32 @@ u16 LoadSpriteSheet(const struct SpriteSheet *sheet)
|
||||
else
|
||||
{
|
||||
AllocSpriteTileRange(sheet->tag, (u16)tileStart, sheet->size / TILE_SIZE_4BPP);
|
||||
CpuCopy16(sheet->data, (u8 *)OBJ_VRAM0 + TILE_SIZE_4BPP * tileStart, sheet->size);
|
||||
CpuSmartCopy16(sheet->data, (u8 *)OBJ_VRAM0 + TILE_SIZE_4BPP * tileStart + offset, sheet->size - offset);
|
||||
return (u16)tileStart;
|
||||
}
|
||||
}
|
||||
|
||||
u16 LoadSpriteSheet(const struct SpriteSheet *sheet)
|
||||
{
|
||||
return LoadSpriteSheetWithOffset(sheet, 0);
|
||||
}
|
||||
|
||||
// Like LoadSpriteSheet, but checks if already loaded, and uses template image frames
|
||||
u16 LoadSpriteSheetByTemplate(const struct SpriteTemplate *template, u32 frame, s32 offset)
|
||||
{
|
||||
u16 tileStart;
|
||||
struct SpriteSheet sheet;
|
||||
// error if template is null or tile tag or images not set
|
||||
if (!template || template->tileTag == TAG_NONE || !template->images)
|
||||
return TAG_NONE;
|
||||
if ((tileStart = GetSpriteTileStartByTag(template->tileTag)) != TAG_NONE) // return if already loaded
|
||||
return tileStart;
|
||||
sheet.data = template->images[frame].data;
|
||||
sheet.size = template->images[frame].size;
|
||||
sheet.tag = template->tileTag;
|
||||
return LoadSpriteSheetWithOffset(&sheet, offset);
|
||||
}
|
||||
|
||||
void LoadSpriteSheets(const struct SpriteSheet *sheets)
|
||||
{
|
||||
u32 i;
|
||||
@ -1691,10 +1731,36 @@ bool8 AddSubspritesToOamBuffer(struct Sprite *sprite, struct OamData *destOam, u
|
||||
destOam[i].y = baseY + y;
|
||||
destOam[i].tileNum = tileNum + subspriteTable->subsprites[i].tileOffset;
|
||||
|
||||
if (sprite->subspriteMode != SUBSPRITES_IGNORE_PRIORITY)
|
||||
if (sprite->subspriteMode < SUBSPRITES_IGNORE_PRIORITY)
|
||||
destOam[i].priority = subspriteTable->subsprites[i].priority;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const u8 sSpanPerImage[4][4] =
|
||||
{
|
||||
[ST_OAM_SQUARE] =
|
||||
{
|
||||
[ST_OAM_SIZE_0] = 0, // SPRITE_SIZE_8x8
|
||||
[ST_OAM_SIZE_1] = 2, // SPRITE_SIZE_16x16
|
||||
[ST_OAM_SIZE_2] = 4, // SPRITE_SIZE_32x32
|
||||
[ST_OAM_SIZE_3] = 6 // SPRITE_SIZE_64x64
|
||||
},
|
||||
[ST_OAM_H_RECTANGLE ... ST_OAM_V_RECTANGLE] =
|
||||
{
|
||||
[ST_OAM_SIZE_0] = 1, // SPRITE_SIZE_16x8
|
||||
[ST_OAM_SIZE_1] = 2, // SPRITE_SIZE_32x8
|
||||
[ST_OAM_SIZE_2] = 3, // SPRITE_SIZE_32x16
|
||||
[ST_OAM_SIZE_3] = 5 // SPRITE_SIZE_64x32
|
||||
},
|
||||
};
|
||||
|
||||
// For a given sprite shape & size, returns
|
||||
// the value for sheetSpan:
|
||||
// i.e, a 32x32 sprite has span 4, because 1 << 4 == 16 == 4x4 tiles
|
||||
u32 GetSpanPerImage(u32 shape, u32 size)
|
||||
{
|
||||
return sSpanPerImage[shape][size];
|
||||
}
|
||||
|
||||
@ -217,22 +217,26 @@ struct Sprite
|
||||
// general purpose data fields
|
||||
/*0x2E*/ s16 data[8];
|
||||
|
||||
/*0x3E*/ bool16 inUse:1; //1
|
||||
bool16 coordOffsetEnabled:1; //2
|
||||
bool16 invisible:1; //4
|
||||
bool16 flags_3:1; //8
|
||||
bool16 flags_4:1; //0x10
|
||||
bool16 flags_5:1; //0x20
|
||||
bool16 flags_6:1; //0x40
|
||||
bool16 flags_7:1; //0x80
|
||||
/*0x3F*/ bool16 hFlip:1; //1
|
||||
bool16 vFlip:1; //2
|
||||
bool16 animBeginning:1; //4
|
||||
bool16 affineAnimBeginning:1; //8
|
||||
bool16 animEnded:1; //0x10
|
||||
bool16 affineAnimEnded:1; //0x20
|
||||
bool16 usingSheet:1; //0x40
|
||||
bool16 anchored:1; //0x80
|
||||
/*0x3E*/ u16 inUse:1; //1
|
||||
u16 coordOffsetEnabled:1; //2
|
||||
u16 invisible:1; //4
|
||||
u16 flags_3:1; //8
|
||||
// if nonzero, tile offset for usingSheet sprites
|
||||
// is (offset + 1) << sheetSpan;
|
||||
// (This allows using frame-based anim tables for sheet sprites)
|
||||
u16 sheetSpan:3;
|
||||
// u16 flags_4:1; //0x10
|
||||
// u16 flags_5:1; //0x20
|
||||
// u16 flags_6:1; //0x40
|
||||
u16 flags_7:1; //0x80
|
||||
/*0x3F*/ u16 hFlip:1; //1
|
||||
u16 vFlip:1; //2
|
||||
u16 animBeginning:1; //4
|
||||
u16 affineAnimBeginning:1; //8
|
||||
u16 animEnded:1; //0x10
|
||||
u16 affineAnimEnded:1; //0x20
|
||||
u16 usingSheet:1; //0x40
|
||||
u16 anchored:1; //0x80
|
||||
|
||||
/*0x40*/ u16 sheetTileStart;
|
||||
|
||||
@ -298,7 +302,9 @@ void FreeOamMatrix(u8 matrixNum);
|
||||
void InitSpriteAffineAnim(struct Sprite *sprite);
|
||||
void SetOamMatrixRotationScaling(u8 matrixNum, s16 xScale, s16 yScale, u16 rotation);
|
||||
u16 LoadSpriteSheet(const struct SpriteSheet *sheet);
|
||||
u16 LoadSpriteSheetByTemplate(const struct SpriteTemplate *template, u32 frame, s32 offset);
|
||||
void LoadSpriteSheets(const struct SpriteSheet *sheets);
|
||||
s16 AllocSpriteTiles(u16 tileCount);
|
||||
u16 AllocTilesForSpriteSheet(struct SpriteSheet *sheet);
|
||||
void AllocTilesForSpriteSheets(struct SpriteSheet *sheets);
|
||||
void LoadTilesForSpriteSheet(const struct SpriteSheet *sheet);
|
||||
@ -324,5 +330,6 @@ void CopyFromSprites(u8 *dest);
|
||||
u8 SpriteTileAllocBitmapOp(u16 bit, u8 op);
|
||||
void ClearSpriteCopyRequests(void);
|
||||
void ResetAffineAnimData(void);
|
||||
u32 GetSpanPerImage(u32 shape, u32 size);
|
||||
|
||||
#endif //GUARD_SPRITE_H
|
||||
|
||||
327
gflib/text.c
@ -23,17 +23,26 @@ static u16 FontFunc_ShortCopy2(struct TextPrinter *);
|
||||
static u16 FontFunc_ShortCopy3(struct TextPrinter *);
|
||||
static u16 FontFunc_Narrow(struct TextPrinter *);
|
||||
static u16 FontFunc_SmallNarrow(struct TextPrinter *);
|
||||
static u16 FontFunc_Narrower(struct TextPrinter *);
|
||||
static u16 FontFunc_SmallNarrower(struct TextPrinter *);
|
||||
static u16 FontFunc_ShortNarrow(struct TextPrinter *);
|
||||
static void DecompressGlyph_Small(u16, bool32);
|
||||
static void DecompressGlyph_Normal(u16, bool32);
|
||||
static void DecompressGlyph_Short(u16, bool32);
|
||||
static void DecompressGlyph_Narrow(u16, bool32);
|
||||
static void DecompressGlyph_SmallNarrow(u16, bool32);
|
||||
static void DecompressGlyph_Bold(u16);
|
||||
static void DecompressGlyph_Narrower(u16, bool32);
|
||||
static void DecompressGlyph_SmallNarrower(u16, bool32);
|
||||
static void DecompressGlyph_ShortNarrow(u16, bool32);
|
||||
static u32 GetGlyphWidth_Small(u16, bool32);
|
||||
static u32 GetGlyphWidth_Normal(u16, bool32);
|
||||
static u32 GetGlyphWidth_Short(u16, bool32);
|
||||
static u32 GetGlyphWidth_Narrow(u16, bool32);
|
||||
static u32 GetGlyphWidth_SmallNarrow(u16, bool32);
|
||||
static u32 GetGlyphWidth_Narrower(u16, bool32);
|
||||
static u32 GetGlyphWidth_SmallNarrower(u16, bool32);
|
||||
static u32 GetGlyphWidth_ShortNarrow(u16, bool32);
|
||||
|
||||
static EWRAM_DATA struct TextPrinter sTempTextPrinter = {0};
|
||||
static EWRAM_DATA struct TextPrinter sTextPrinters[WINDOWS_MAX] = {0};
|
||||
@ -81,15 +90,18 @@ static const u8 sWindowVerticalScrollSpeeds[] = {
|
||||
|
||||
static const struct GlyphWidthFunc sGlyphWidthFuncs[] =
|
||||
{
|
||||
{ FONT_SMALL, GetGlyphWidth_Small },
|
||||
{ FONT_NORMAL, GetGlyphWidth_Normal },
|
||||
{ FONT_SHORT, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_1, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_2, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_3, GetGlyphWidth_Short },
|
||||
{ FONT_BRAILLE, GetGlyphWidth_Braille },
|
||||
{ FONT_NARROW, GetGlyphWidth_Narrow },
|
||||
{ FONT_SMALL_NARROW, GetGlyphWidth_SmallNarrow }
|
||||
{ FONT_SMALL, GetGlyphWidth_Small },
|
||||
{ FONT_NORMAL, GetGlyphWidth_Normal },
|
||||
{ FONT_SHORT, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_1, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_2, GetGlyphWidth_Short },
|
||||
{ FONT_SHORT_COPY_3, GetGlyphWidth_Short },
|
||||
{ FONT_BRAILLE, GetGlyphWidth_Braille },
|
||||
{ FONT_NARROW, GetGlyphWidth_Narrow },
|
||||
{ FONT_SMALL_NARROW, GetGlyphWidth_SmallNarrow },
|
||||
{ FONT_NARROWER, GetGlyphWidth_Narrower },
|
||||
{ FONT_SMALL_NARROWER, GetGlyphWidth_SmallNarrower },
|
||||
{ FONT_SHORT_NARROW, GetGlyphWidth_ShortNarrow },
|
||||
};
|
||||
|
||||
struct
|
||||
@ -217,21 +229,54 @@ static const struct FontInfo sFontInfos[] =
|
||||
.fgColor = 1,
|
||||
.bgColor = 2,
|
||||
.shadowColor = 15,
|
||||
}
|
||||
},
|
||||
[FONT_NARROWER] = {
|
||||
.fontFunction = FontFunc_Narrower,
|
||||
.maxLetterWidth = 5,
|
||||
.maxLetterHeight = 16,
|
||||
.letterSpacing = 0,
|
||||
.lineSpacing = 0,
|
||||
.fgColor = 2,
|
||||
.bgColor = 1,
|
||||
.shadowColor = 3,
|
||||
},
|
||||
[FONT_SMALL_NARROWER] = {
|
||||
.fontFunction = FontFunc_SmallNarrower,
|
||||
.maxLetterWidth = 5,
|
||||
.maxLetterHeight = 8,
|
||||
.letterSpacing = 0,
|
||||
.lineSpacing = 0,
|
||||
.fgColor = 2,
|
||||
.bgColor = 1,
|
||||
.shadowColor = 3,
|
||||
},
|
||||
[FONT_SHORT_NARROW] = {
|
||||
.fontFunction = FontFunc_ShortNarrow,
|
||||
.maxLetterWidth = 5,
|
||||
.maxLetterHeight = 14,
|
||||
.letterSpacing = 0,
|
||||
.lineSpacing = 0,
|
||||
.fgColor = 2,
|
||||
.bgColor = 1,
|
||||
.shadowColor = 3,
|
||||
},
|
||||
};
|
||||
|
||||
static const u8 sMenuCursorDimensions[][2] =
|
||||
{
|
||||
[FONT_SMALL] = { 8, 12 },
|
||||
[FONT_NORMAL] = { 8, 15 },
|
||||
[FONT_SHORT] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_1] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_2] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_3] = { 8, 14 },
|
||||
[FONT_BRAILLE] = { 8, 16 },
|
||||
[FONT_NARROW] = { 8, 15 },
|
||||
[FONT_SMALL_NARROW] = { 8, 8 },
|
||||
[FONT_BOLD] = {}
|
||||
[FONT_SMALL] = { 8, 12 },
|
||||
[FONT_NORMAL] = { 8, 15 },
|
||||
[FONT_SHORT] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_1] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_2] = { 8, 14 },
|
||||
[FONT_SHORT_COPY_3] = { 8, 14 },
|
||||
[FONT_BRAILLE] = { 8, 16 },
|
||||
[FONT_NARROW] = { 8, 15 },
|
||||
[FONT_SMALL_NARROW] = { 8, 8 },
|
||||
[FONT_BOLD] = {},
|
||||
[FONT_NARROWER] = { 8, 15 },
|
||||
[FONT_SMALL_NARROWER] = { 8, 8 },
|
||||
[FONT_SHORT_NARROW] = { 8, 14 },
|
||||
};
|
||||
|
||||
static const u16 sFontBoldJapaneseGlyphs[] = INCBIN_U16("graphics/fonts/bold.hwjpnfont");
|
||||
@ -769,6 +814,42 @@ static u16 FontFunc_SmallNarrow(struct TextPrinter *textPrinter)
|
||||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
static u16 FontFunc_Narrower(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
|
||||
if (subStruct->hasFontIdBeenSet == FALSE)
|
||||
{
|
||||
subStruct->fontId = FONT_NARROWER;
|
||||
subStruct->hasFontIdBeenSet = TRUE;
|
||||
}
|
||||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
static u16 FontFunc_SmallNarrower(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
|
||||
if (subStruct->hasFontIdBeenSet == FALSE)
|
||||
{
|
||||
subStruct->fontId = FONT_SMALL_NARROWER;
|
||||
subStruct->hasFontIdBeenSet = TRUE;
|
||||
}
|
||||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
static u16 FontFunc_ShortNarrow(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
|
||||
if (subStruct->hasFontIdBeenSet == FALSE)
|
||||
{
|
||||
subStruct->fontId = FONT_SHORT_NARROW;
|
||||
subStruct->hasFontIdBeenSet = TRUE;
|
||||
}
|
||||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
@ -1140,6 +1221,15 @@ static u16 RenderText(struct TextPrinter *textPrinter)
|
||||
case FONT_SMALL_NARROW:
|
||||
DecompressGlyph_SmallNarrow(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_NARROWER:
|
||||
DecompressGlyph_Narrower(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_SMALL_NARROWER:
|
||||
DecompressGlyph_SmallNarrower(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_SHORT_NARROW:
|
||||
DecompressGlyph_ShortNarrow(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_BRAILLE:
|
||||
break;
|
||||
}
|
||||
@ -1902,3 +1992,200 @@ static void DecompressGlyph_Bold(u16 glyphId)
|
||||
gCurGlyph.width = 8;
|
||||
gCurGlyph.height = 12;
|
||||
}
|
||||
|
||||
static void DecompressGlyph_Narrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
glyphs = gFontNormalJapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId % 0x10));
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom);
|
||||
gCurGlyph.width = 8;
|
||||
gCurGlyph.height = 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyphs = gFontNarrowerLatinGlyphs + (0x20 * glyphId);
|
||||
gCurGlyph.width = gFontNarrowerLatinGlyphWidths[glyphId];
|
||||
|
||||
if (gCurGlyph.width <= 8)
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8);
|
||||
}
|
||||
|
||||
gCurGlyph.height = 15;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 GetGlyphWidth_Narrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
if (isJapanese == TRUE)
|
||||
return 8;
|
||||
else
|
||||
return gFontNarrowerLatinGlyphWidths[glyphId];
|
||||
}
|
||||
|
||||
static void DecompressGlyph_SmallNarrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
glyphs = gFontSmallJapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId % 0x10));
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom);
|
||||
gCurGlyph.width = 8;
|
||||
gCurGlyph.height = 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyphs = gFontSmallNarrowerLatinGlyphs + (0x20 * glyphId);
|
||||
gCurGlyph.width = gFontSmallNarrowerLatinGlyphWidths[glyphId];
|
||||
|
||||
if (gCurGlyph.width <= 8)
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8);
|
||||
}
|
||||
|
||||
gCurGlyph.height = 15;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 GetGlyphWidth_SmallNarrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
if (isJapanese == TRUE)
|
||||
return 8;
|
||||
else
|
||||
return gFontSmallNarrowerLatinGlyphWidths[glyphId];
|
||||
}
|
||||
|
||||
static void DecompressGlyph_ShortNarrow(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
glyphs = gFontShortJapaneseGlyphs + (0x100 * (glyphId >> 0x3)) + (0x10 * (glyphId & 0x7));
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); // gCurGlyph + 0x20
|
||||
DecompressGlyphTile(glyphs + 0x88, gCurGlyph.gfxBufferBottom + 8); // gCurGlyph + 0x60
|
||||
gCurGlyph.width = gFontShortJapaneseGlyphWidths[glyphId];
|
||||
gCurGlyph.height = 14;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyphs = gFontShortNarrowLatinGlyphs + (0x20 * glyphId);
|
||||
gCurGlyph.width = gFontShortNarrowLatinGlyphWidths[glyphId];
|
||||
|
||||
if (gCurGlyph.width <= 8)
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8);
|
||||
}
|
||||
|
||||
gCurGlyph.height = 14;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 GetGlyphWidth_ShortNarrow(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
if (isJapanese == TRUE)
|
||||
return gFontShortJapaneseGlyphWidths[glyphId];
|
||||
else
|
||||
return gFontShortNarrowLatinGlyphWidths[glyphId];
|
||||
}
|
||||
|
||||
static const s8 sNarrowerFontIds[] =
|
||||
{
|
||||
[FONT_SMALL] = FONT_SMALL_NARROW,
|
||||
[FONT_NORMAL] = FONT_NARROW,
|
||||
[FONT_SHORT] = FONT_SHORT_NARROW,
|
||||
[FONT_SHORT_COPY_1] = FONT_SHORT_NARROW,
|
||||
[FONT_SHORT_COPY_2] = FONT_SHORT_NARROW,
|
||||
[FONT_SHORT_COPY_3] = FONT_SHORT_NARROW,
|
||||
[FONT_BRAILLE] = -1,
|
||||
[FONT_NARROW] = FONT_NARROWER,
|
||||
[FONT_SMALL_NARROW] = FONT_SMALL_NARROWER,
|
||||
[FONT_BOLD] = -1,
|
||||
[FONT_NARROWER] = -1,
|
||||
[FONT_SMALL_NARROWER] = -1,
|
||||
[FONT_SHORT_NARROW] = -1,
|
||||
};
|
||||
|
||||
// If the narrowest font ID doesn't fit the text, we still return that
|
||||
// ID because clipping is better than crashing.
|
||||
u32 GetFontIdToFit(const u8 *string, u32 fontId, u32 letterSpacing, u32 widthPx)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
s32 narrowerFontId = sNarrowerFontIds[fontId];
|
||||
if (narrowerFontId == -1)
|
||||
return fontId;
|
||||
if (GetStringWidth(fontId, string, letterSpacing) <= widthPx)
|
||||
return fontId;
|
||||
fontId = narrowerFontId;
|
||||
}
|
||||
}
|
||||
|
||||
u8 *PrependFontIdToFit(u8 *start, u8 *end, u32 fontId, u32 width)
|
||||
{
|
||||
u32 fitFontId = GetFontIdToFit(start, fontId, 0, width);
|
||||
|
||||
if (fitFontId == fontId)
|
||||
return end;
|
||||
|
||||
memmove(&start[3], &start[0], end - start);
|
||||
start[0] = EXT_CTRL_CODE_BEGIN;
|
||||
start[1] = EXT_CTRL_CODE_FONT;
|
||||
start[2] = fitFontId;
|
||||
end[3] = EOS;
|
||||
return end + 3;
|
||||
}
|
||||
|
||||
u8 *WrapFontIdToFit(u8 *start, u8 *end, u32 fontId, u32 width)
|
||||
{
|
||||
|
||||
u32 fitFontId = GetFontIdToFit(start, fontId, 0, width);
|
||||
if (fitFontId != fontId)
|
||||
{
|
||||
memmove(&start[3], &start[0], end - start);
|
||||
start[0] = EXT_CTRL_CODE_BEGIN;
|
||||
start[1] = EXT_CTRL_CODE_FONT;
|
||||
start[2] = fitFontId;
|
||||
end[3] = EXT_CTRL_CODE_BEGIN;
|
||||
end[4] = EXT_CTRL_CODE_FONT;
|
||||
end[5] = fontId;
|
||||
end[6] = EOS;
|
||||
return end + 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
return end;
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,6 +18,9 @@ enum {
|
||||
FONT_NARROW,
|
||||
FONT_SMALL_NARROW, // Very similar to FONT_SMALL, some glyphs are narrower
|
||||
FONT_BOLD, // JP glyph set only
|
||||
FONT_NARROWER,
|
||||
FONT_SMALL_NARROWER,
|
||||
FONT_SHORT_NARROW,
|
||||
};
|
||||
|
||||
// Return values for font functions
|
||||
@ -168,4 +171,8 @@ u8 GetMenuCursorDimensionByFont(u8 fontId, u8 whichDimension);
|
||||
u16 FontFunc_Braille(struct TextPrinter *textPrinter);
|
||||
u32 GetGlyphWidth_Braille(u16 glyphId, bool32 isJapanese);
|
||||
|
||||
u32 GetFontIdToFit(const u8 *string, u32 widestFontId, u32 letterSpacing, u32 widthPx);
|
||||
u8 *PrependFontIdToFit(u8 *start, u8 *end, u32 fontId, u32 width);
|
||||
u8 *WrapFontIdToFit(u8 *start, u8 *end, u32 fontId, u32 width);
|
||||
|
||||
#endif // GUARD_TEXT_H
|
||||
|
||||
@ -712,3 +712,13 @@ static u32 GetNumActiveWindowsOnBg8Bit(u32 bgId)
|
||||
}
|
||||
return windowsNum;
|
||||
}
|
||||
|
||||
u32 WindowWidthPx(u32 windowId)
|
||||
{
|
||||
return gWindows[windowId].window.width * TILE_WIDTH;
|
||||
}
|
||||
|
||||
u32 WindowTemplateWidthPx(const struct WindowTemplate *template)
|
||||
{
|
||||
return template->width * TILE_WIDTH;
|
||||
}
|
||||
|
||||
@ -73,6 +73,8 @@ void FillWindowPixelBuffer8Bit(u32 windowId, u8 fillValue);
|
||||
void FillWindowPixelRect8Bit(u32 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height);
|
||||
void BlitBitmapRectToWindow4BitTo8Bit(u32 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum);
|
||||
void CopyWindowToVram8Bit(u32 windowId, u8 mode);
|
||||
u32 WindowWidthPx(u32 windowId);
|
||||
u32 WindowTemplateWidthPx(const struct WindowTemplate *template);
|
||||
|
||||
extern struct Window gWindows[];
|
||||
extern void *gWindowBgTilemapBuffers[];
|
||||
|
||||
19
graphics/battle_anims/sprites/dreepy_missile.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
153 217 234
|
||||
254 87 103
|
||||
77 119 117
|
||||
62 67 67
|
||||
170 237 211
|
||||
138 189 179
|
||||
121 163 146
|
||||
77 119 117
|
||||
251 234 137
|
||||
195 97 109
|
||||
78 52 54
|
||||
222 214 198
|
||||
173 146 118
|
||||
151 135 135
|
||||
122 105 94
|
||||
0 4 1
|
||||
|
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 4.3 KiB |
19
graphics/battle_anims/sprites/dreepy_missile_shiny.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
153 217 234
|
||||
222 223 109
|
||||
77 119 117
|
||||
62 67 67
|
||||
170 237 211
|
||||
138 189 179
|
||||
77 171 225
|
||||
53 110 226
|
||||
251 234 137
|
||||
195 97 109
|
||||
78 52 54
|
||||
222 214 198
|
||||
173 146 118
|
||||
151 135 135
|
||||
122 105 94
|
||||
0 4 1
|
||||
BIN
graphics/battle_anims/sprites/tera_crystal.png
Normal file
|
After Width: | Height: | Size: 1011 B |
BIN
graphics/battle_anims/sprites/tera_shatter.png
Normal file
|
After Width: | Height: | Size: 439 B |
BIN
graphics/battle_interface/bug_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 6.8 KiB |
BIN
graphics/battle_interface/dark_indicator.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
graphics/battle_interface/dragon_indicator.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
graphics/battle_interface/electric_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/fairy_indicator.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
graphics/battle_interface/fighting_indicator.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
graphics/battle_interface/fire_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/flying_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/ghost_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/grass_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/ground_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/ice_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/normal_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/poison_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/psychic_indicator.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
graphics/battle_interface/rock_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/steel_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/battle_interface/stellar_indicator.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
19
graphics/battle_interface/tera_indicator.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
0 0 0
|
||||
98 83 124
|
||||
207 63 109
|
||||
83 105 175
|
||||
80 144 216
|
||||
216 208 179
|
||||
254 115 121
|
||||
148 155 163
|
||||
99 188 91
|
||||
147 192 47
|
||||
255 156 85
|
||||
199 182 140
|
||||
113 206 198
|
||||
117 206 192
|
||||
245 210 55
|
||||
255 255 255
|
||||
BIN
graphics/battle_interface/tera_trigger.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
graphics/battle_interface/water_indicator.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 275 B After Width: | Height: | Size: 7.3 KiB |
BIN
graphics/field_effects/pics/bug_tracks.png
Normal file
|
After Width: | Height: | Size: 275 B |
|
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 144 B After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 4.7 KiB |
BIN
graphics/field_effects/pics/slither_tracks.png
Normal file
|
After Width: | Height: | Size: 354 B |
BIN
graphics/field_effects/pics/spot_tracks.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
graphics/fonts/latin_narrower.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
graphics/fonts/latin_short_narrow.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
graphics/fonts/latin_small_narrower.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
19
graphics/map_popup/bw/black.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
0 0 0
|
||||
0 0 0
|
||||
255 255 255
|
||||
84 85 89
|
||||
0 0 0
|
||||
238 230 238
|
||||
189 180 197
|
||||
139 139 164
|
||||
90 90 123
|
||||
41 49 90
|
||||
27 27 27
|
||||
40 40 40
|
||||
51 51 51
|
||||
62 62 62
|
||||
0 0 0
|
||||
0 0 0
|
||||
BIN
graphics/map_popup/bw/bw_primary.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
graphics/map_popup/bw/bw_secondary.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
19
graphics/map_popup/bw/white.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
0 0 0
|
||||
255 255 255
|
||||
0 0 0
|
||||
158 158 158
|
||||
0 0 0
|
||||
238 230 238
|
||||
189 180 197
|
||||
139 139 164
|
||||
90 90 123
|
||||
41 49 90
|
||||
228 228 228
|
||||
215 215 215
|
||||
204 204 204
|
||||
193 193 193
|
||||
0 0 0
|
||||
0 0 0
|
||||
19
graphics/misc/emotes.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
255 255 0
|
||||
151 48 0
|
||||
74 75 87
|
||||
88 88 97
|
||||
164 72 167
|
||||
248 63 2
|
||||
78 128 207
|
||||
48 160 0
|
||||
237 131 0
|
||||
205 144 203
|
||||
168 168 178
|
||||
251 167 159
|
||||
240 176 183
|
||||
219 181 221
|
||||
165 225 69
|
||||
247 249 246
|
||||
BIN
graphics/misc/emotes.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |