EnInvadepoh (Aliens, UFO, Invasion Handler, etc.) OK and documented (#1614)

* deimplementation complete

* newlines

* match

* data import

* back port cleanup changes

* stuff

* naming and such

* all funcs provisionally named

* more stuff

* merge

* Fix merge issues

* begin cleanup

* Use constants for all face animation data

* Use THIS like almost every actor does

* Change "Light Ball" to "UFO"

* Rename the alien types

* EnInvadePoh -> EnInvadepoh

* Rename the types

* Rename some Twinmold stuff

* ConfusedRomani -> SilentRomani

* Fix stack size issues with EnInvadepoh_Cremia_Init

* Move a struct out of the header to where it belongs

* Some header cleanup and struct names

* Name remaining struct vars

* Some more struct var renames

* Finish reviewing the struct var names

* Rename most of the interactInfo stuff

* Consistency

* Remove unused union

* Define EN_INVADEPOH_LIMB_MAX like EndingHero6 does

* Fix header

* Update functions.txt and variables.txt

* Create macros for accessing spawn time and kill count

* Some defines

* Some minor comments and cleanup

* Rename some functions

* Comments for those three functions

* Draw function cleanups

* Some damaged and dead cleanup

* Death scale stuff

* Good chunk of alien functions

* Invasion state naming

* Weekeventreg naming

* Happy with >20% of functions now

* A couple more functions

* More consistent names for BSS variables

* Some Init cleanup

* Happy with 30% of the functions now

* Finish the abductors

* Some random functions to get the functions I'm happy with >1/3rd

* Use `InitPath` for everything

* UFO functions done, >40% functions I'm happy with

* Do a lot of work on InvasionHandler action funcs

* Finish invasion handler code

* InitVars

* Rename the "closest alien" stuff to "closest alien threat"

* Finish most of the dog functions

* Lots of small stuff here and there

* Finish documenting the dog bug

* Document `EnInvadepoh_Dog_IsCloseToPath`

* `EnInvadepoh_Dog_MoveAlongPath` and other fixes

* Simple comment for `EnInvadepoh_Dog_Move`

* Various path functions, finish dog

* Consistently use "SetMatrixTranslation"

* Change all the angleToPlayer stuff to pitch/yaw

* Some RewardRomani functions

* Finish RewardRomani

* Finish Night1Romani and BarnRomani, >75% of functions done

* Some minor stuff

* Document bug

* Finish all of SilentRomani minus the Idle functions

* Finish EnInvadepoh_SilentRomani_Idle

* Finish Night3Cremia

* Finish Night3Romani

* Finish `EnInvadepoh_Ufo_SpawnSparkles`

* Finish some library functions

* Finish the alien pathing stuff

* Finish Romani path stuff

* Finish all non-InteractInfo stuff

* InteractInfo -> ModelInfo

* Create a `EnInvadepohFaceAnimBase` struct

* Name some of the animation data

* Switch to `Chained`/`ChainedDelay` and do some other cleanup

* Name all of the animation data

* Finish documenting and cleaning up the face animation functions

* Some comments at the top of the file

* Clean up forward declarations

* Clean some stuff up to the ModelInfo functions

* Fix build

* Move the animation data around so all the ModelInfo functions are adjacent

* Review

* Use `CLOCK_TIME_MINUTE` in `EnInvadepoh_Alien_PathComputeProgress`

* Respond to some of Anghelo's review

* Update comment on spawn time macros explaining what indices are usable

* Create a `DEATH_SCALE` define

* `WEEKEVENTREG_RECEIVED_MILK_BOTTLE` -> `WEEKEVENTREG_RECEIVED_ALIENS_BOTTLE`

* Forgot to do the bomber's notebook stuff too

* parallelogram -> rectangle

* Respond to engineer's review

* Slight spacing fix

---------

Co-authored-by: petrie911 <petrie911@users.noreply.github.com>
Co-authored-by: petrie911 <pmontag@Monday.localdomain>
Co-authored-by: angie <angheloalf95@gmail.com>
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
Tom Overton
2024-04-29 08:19:55 -07:00
committed by GitHub
parent 6126e72df3
commit 7c93d5e125
32 changed files with 6115 additions and 1009 deletions
+1 -1
View File
@@ -3341,7 +3341,7 @@ u32 Environment_GetStormState(PlayState* play) {
u32 stormState = play->envCtx.stormState;
if ((play->sceneId == SCENE_OMOYA) && (play->roomCtx.curRoom.num == 0)) {
stormState = ((gSaveContext.save.day >= 2) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_THEM))
stormState = ((gSaveContext.save.day >= 2) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_DEFENDED_AGAINST_ALIENS))
? STORM_STATE_ON
: STORM_STATE_OFF;
}
+1 -1
View File
@@ -405,7 +405,7 @@ void Lights_GlowCheck(PlayState* play) {
if ((projectedPos.z > 1) && (fabsf(projectedPos.x * invW) < 1) && (fabsf(projectedPos.y * invW) < 1)) {
s32 screenPosX = PROJECTED_TO_SCREEN_X(projectedPos, invW);
s32 screenPosY = PROJECTED_TO_SCREEN_Y(projectedPos, invW);
s32 wZ = (s32)((projectedPos.z * invW) * 16352.0f) + 16352;
s32 wZ = (s32)(projectedPos.z * invW * ((G_MAXZ / 2) * 32)) + ((G_MAXZ / 2) * 32);
s32 zBuf = SysCfb_GetZBufferInt(screenPosX, screenPosY);
if (wZ < zBuf) {
+5 -4
View File
@@ -98,11 +98,12 @@ u16 sBombersNotebookEntries[BOMBERS_NOTEBOOK_PERSON_MAX][BOMBERS_NOTEBOOK_ENTRY_
},
{
/* Romani */
BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1, BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_THEM,
CLOCK_TIME(6, 0), CLOCK_TIME(18, 0)),
BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 1, BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_THEM,
BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_CENTER, 1,
BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_ALIENS, CLOCK_TIME(6, 0),
CLOCK_TIME(18, 0)),
BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_ABOVE, 1, BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_ALIENS,
CLOCK_TIME(2, 30), CLOCK_TIME(5, 15)),
BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_MILK_BOTTLE,
BOMBERS_NOTEBOOK_ENTRY(BOMBERS_NOTEBOOK_ENTRY_POS_BELOW, 1, BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALIENS_BOTTLE,
CLOCK_TIME(2, 30), CLOCK_TIME(5, 15)),
BOMBERS_NOTEBOOK_ENTRY_END,
},
+11 -11
View File
@@ -99,7 +99,7 @@ u16 sPersistentCycleWeekEventRegs[ARRAY_COUNT(gSaveContext.save.saveInfo.weekEve
/* 19 */ 0,
/* 20 */ 0,
/* 21 */ 0,
/* 22 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_22_02) |
/* 22 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_ALIENS_BOTTLE) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_HONEY_AND_DARLING_HEART_PIECE),
/* 23 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_GREAT_SPIN_ATTACK) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_BEAVER_RACE_BOTTLE),
@@ -195,9 +195,9 @@ u16 sPersistentCycleWeekEventRegs[ARRAY_COUNT(gSaveContext.save.saveInfo.weekEve
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_PENDANT_OF_MEMORIES) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DELIVERED_PENDANT_OF_MEMORIES) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCAPED_SAKONS_HIDEOUT) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_THEM) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_THEM) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_MILK_BOTTLE) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_PROMISED_TO_HELP_WITH_ALIENS) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_DEFENDED_AGAINST_ALIENS) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ALIENS_BOTTLE) |
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_ESCORTED_CREMIA),
/* 70 */
PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_BOMBERS_NOTEBOOK_EVENT_RECEIVED_ROMANIS_MASK) |
@@ -625,13 +625,13 @@ void Sram_SaveEndOfCycle(PlayState* play) {
gSaveContext.save.saveInfo.skullTokenCount &= ~0x0000FFFF;
gSaveContext.save.saveInfo.unk_EA0 = 0;
gSaveContext.save.saveInfo.unk_E64[0] = 0;
gSaveContext.save.saveInfo.unk_E64[1] = 0;
gSaveContext.save.saveInfo.unk_E64[2] = 0;
gSaveContext.save.saveInfo.unk_E64[3] = 0;
gSaveContext.save.saveInfo.unk_E64[4] = 0;
gSaveContext.save.saveInfo.unk_E64[5] = 0;
gSaveContext.save.saveInfo.unk_E64[6] = 0;
gSaveContext.save.saveInfo.alienInfo[0] = 0;
gSaveContext.save.saveInfo.alienInfo[1] = 0;
gSaveContext.save.saveInfo.alienInfo[2] = 0;
gSaveContext.save.saveInfo.alienInfo[3] = 0;
gSaveContext.save.saveInfo.alienInfo[4] = 0;
gSaveContext.save.saveInfo.alienInfo[5] = 0;
gSaveContext.save.saveInfo.alienInfo[6] = 0;
Sram_ClearHighscores();