From a9fd434d9970dd182be0abe62427cd56e2146fcb Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:56:19 +0100 Subject: [PATCH] tr1/lara: inject medium water exit animation This injects the TR2 exit water to "medium" height animation. Resolves #1538. --- .../ship/data/injections/lara_animations.bin | Bin 220046 -> 221366 bytes docs/tr1/CHANGELOG.md | 1 + docs/tr1/README.md | 1 + .../include/libtrx/game/lara/enum_tr1.h | 3 ++- src/tr1/game/lara/misc.c | 9 ++++++++- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/data/tr1/ship/data/injections/lara_animations.bin b/data/tr1/ship/data/injections/lara_animations.bin index ac69d7b19e1663ec85a0c44ac128892d6f19f348..c59a69837dc0eb00927d6391927173950371e0cb 100644 GIT binary patch delta 1012 zcmXYuZERCz6vxkVFSmE=3+*!NCK&|=zMu>1+*aDzm;1p1+2&S6K{C{$!D$v_BM?+f zS^|+R#?d;l12aeb;y|LEK|14*F`{F}ZN(2RMo7!VAhXMGgQRZVb3FIDC;8`|n{&?Z zf1c-bBuwWonIdJTMiI25)H68K=h|wOB?uRnf_S*ydbHij675#uP&Bk3_reLhE=2if z$Z;A9(M)ZA2HBJcAV~^V=T;@X0H-JpH~_-#kS&tcK{tRBB4FA*`-ft()od|LKi2L0#vRpf zSkY^E^xR86G80;@7-`fDTr^1T5-WO%OlH?nn(=s8%7Mg?NhR?%JzHv#meB zu&mp6;z%UFV!lYfX5eY62?(!Y7)J2{ag@JLywF3;s{sSd5>yDLP8O`b^@aLP5-?It zlX^yPrSrI{SN^y8f^Y9L<+_!V6Y{2Avs4pd2k~8qV@}BM4+*Ga4NC(qTNj{wm`wdu z_gV*49=+h5DuB4>yTU&4UVg7MTy}URwCw9(d6UD^+nEaW#?XO#;0Rt8beJOGDD2dL zcD4|kt7jWqg5>ur|C8D9NyyeGp>gzUI4G) z3=E+YKP4WD@z~X;m@A~d1YL>fLbD>~@%$$z-g*W8#UtTrf;sJ-0 zXOU5iRJWb#6c-R7GnZl8uf-*cGp#SZImBqy@)WOw72E>vVH(cjT|S`lvg1$GS|u~G zuF8Mrn&d&--^+m?s5F--vELfmnrFY~??CUO9zMZywAM>JsWqkCMq|>5?27&N%#3d0 z*fEOx?ZuB+c)>YxC03vK8(*LKm_~T*& Qe5?HkP?uOgAnfV+50CqT5dZ)H delta 51 zcmdmXkhgC;?*tuQFJ=ZXIN-s^uyUhiplI_X(e_EAjN2!PGBr%xF0_V8L3Df2L8g@X E0FJB>Gynhq diff --git a/docs/tr1/CHANGELOG.md b/docs/tr1/CHANGELOG.md index 6ceb0813e..bec21eb43 100644 --- a/docs/tr1/CHANGELOG.md +++ b/docs/tr1/CHANGELOG.md @@ -5,6 +5,7 @@ - added `/quit` alias to `/exit` console command - added an option to toggle the in-game UI, such as healthbars and ammo text (#1656) - added the ability to cycle through console prompt history (#1571) +- added Lara's exit-water-to-medium-height animation from TR2+ (#1538) - changed the easter egg console command to pack more punch - changed `/set` console command to do fuzzy matching (LostArtefacts/libtrx#38) - fixed console caret position off by a couple of pixels (regression from 3.0) diff --git a/docs/tr1/README.md b/docs/tr1/README.md index b709423d6..a36f90736 100644 --- a/docs/tr1/README.md +++ b/docs/tr1/README.md @@ -388,6 +388,7 @@ Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for det - added ability to automatically walk to items when nearby - added ability to roll while underwater like in TR2+ - added ability to use Lara's underwater swimming physics from TR2+ +- added Lara's exit-water-to-medium-height animation from TR2+ - added a pause screen - added a choice whether to play NG or NG+ without having to play the entire game - added Japanese mode (guns deal twice the damage, inspired by JP release of TR3); available for both NG and NG+ diff --git a/src/libtrx/include/libtrx/game/lara/enum_tr1.h b/src/libtrx/include/libtrx/game/lara/enum_tr1.h index b24f1b44a..4b19d2303 100644 --- a/src/libtrx/include/libtrx/game/lara/enum_tr1.h +++ b/src/libtrx/include/libtrx/game/lara/enum_tr1.h @@ -77,7 +77,7 @@ typedef enum { LA_TREAD = 108, LA_SURF_TREAD = 114, LA_SURF_DIVE = 119, - LA_SURF_CLIMB = 111, + LA_SURF_CLIMB_HIGH = 111, LA_JUMP_IN = 112, LA_PUSHABLE_GRAB = 120, LA_ROLL = 146, @@ -90,6 +90,7 @@ typedef enum { LA_SPAZ_BACK = 126, LA_SPAZ_RIGHT = 127, LA_SPAZ_LEFT = 128, + LA_SURF_CLIMB_MEDIUM = 169, } LARA_ANIMATION; // clang-format off diff --git a/src/tr1/game/lara/misc.c b/src/tr1/game/lara/misc.c index b8583369f..a9237c2ec 100644 --- a/src/tr1/game/lara/misc.c +++ b/src/tr1/game/lara/misc.c @@ -673,7 +673,14 @@ bool Lara_TestWaterClimbOut(ITEM *item, COLL_INFO *coll) break; } - Item_SwitchToAnim(item, LA_SURF_CLIMB, 0); + LARA_ANIMATION animation; + if (hdif < -STEP_L / 2) { + animation = LA_SURF_CLIMB_HIGH; + } else { + animation = LA_SURF_CLIMB_MEDIUM; + } + + Item_SwitchToAnim(item, animation, 0); item->current_anim_state = LS_WATER_OUT; item->goal_anim_state = LS_STOP; item->rot.x = 0;