mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-05-02 14:47:58 +03:00
port SwitchCollision2
This commit is contained in:
parent
f966020644
commit
dce2736a1a
4 changed files with 67 additions and 22 deletions
|
@ -558,7 +558,7 @@
|
|||
<rect width="12.00" height="12.00" x="70.00" y="171.00" class="decompiled"><title>PickUpScion4Collision</title></rect>
|
||||
<rect width="12.00" height="12.00" x="84.00" y="171.00" class="decompiled"><title>MidasCollision</title></rect>
|
||||
<rect width="12.00" height="12.00" x="98.00" y="171.00" class="decompiled"><title>SwitchCollision</title></rect>
|
||||
<rect width="12.00" height="12.00" x="112.00" y="171.00" class="named"><title>SwitchCollision2</title></rect>
|
||||
<rect width="12.00" height="12.00" x="112.00" y="171.00" class="decompiled"><title>SwitchCollision2</title></rect>
|
||||
<rect width="12.00" height="12.00" x="126.00" y="171.00" class="named"><title>KeyHoleCollision</title></rect>
|
||||
<rect width="12.00" height="12.00" x="140.00" y="171.00" class="named"><title>PuzzleHoleCollision</title></rect>
|
||||
<rect width="12.00" height="12.00" x="154.00" y="171.00" class="named"><title>SwitchControl</title></rect>
|
||||
|
@ -1029,7 +1029,7 @@
|
|||
<rect width="11.03" height="12.00" x="659.07" y="352.13" class="todo"><title>sub_40C25A</title></rect>
|
||||
<rect width="10.98" height="12.00" x="672.10" y="352.13" class="named"><title>phd_PutPolygons</title></rect>
|
||||
<rect width="10.92" height="12.00" x="685.08" y="352.13" class="decompiled"><title>phd_InitWindow</title></rect>
|
||||
<rect width="11.14" height="11.66" x="525.45" y="366.13" class="named"><title>SwitchCollision2</title></rect>
|
||||
<rect width="11.14" height="11.66" x="525.45" y="366.13" class="decompiled"><title>SwitchCollision2</title></rect>
|
||||
<rect width="11.14" height="11.49" x="525.45" y="379.79" class="decompiled"><title>LaraAsRun</title></rect>
|
||||
<rect width="11.14" height="11.49" x="525.45" y="393.28" class="named"><title>GunHit</title></rect>
|
||||
<rect width="11.14" height="11.43" x="525.45" y="406.77" class="named"><title>mn_reset_sound_effects</title></rect>
|
||||
|
@ -1463,10 +1463,10 @@
|
|||
<rect width="-0.06" height="-0.07" x="694.51" y="536.07" class="todo"><title>sub_440EF0</title></rect>
|
||||
<rect width="-0.45" height="-0.55" x="696.45" y="536.07" class="todo"><title>sub_437BC0</title></rect>
|
||||
<rect width="-0.45" height="-1.52" x="696.45" y="537.52" class="named"><title>S_CDVolume</title></rect>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="564.50" class="decompiled"/><text x="17.00" y="570.50">Functions decompiled (count): 56.77%</text>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="582.50" class="decompiled"/><text x="17.00" y="588.50">Functions decompiled (bytesize): 52.16%</text>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="600.50" class="named"/><text x="17.00" y="606.50">Functions not decompiled, but with known names (count): 29.14%</text>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="618.50" class="named"/><text x="17.00" y="624.50">Functions not decompiled, but with known names (bytesize): 32.02%</text>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="564.50" class="decompiled"/><text x="17.00" y="570.50">Functions decompiled (count): 56.91%</text>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="582.50" class="decompiled"/><text x="17.00" y="588.50">Functions decompiled (bytesize): 52.25%</text>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="600.50" class="named"/><text x="17.00" y="606.50">Functions not decompiled, but with known names (count): 29.00%</text>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="618.50" class="named"/><text x="17.00" y="624.50">Functions not decompiled, but with known names (bytesize): 31.92%</text>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="636.50" class="todo"/><text x="17.00" y="642.50">Functions not decompiled, with unknown names (count): 14.09%</text>
|
||||
<rect width="12.00" height="12.00" x="0.00" y="654.50" class="todo"/><text x="17.00" y="660.50">Functions not decompiled, with unknown names (bytesize): 15.83%</text>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 157 KiB |
|
@ -786,7 +786,7 @@ PickUpScion4Collision 0x004333B0 0x00000108 +
|
|||
MidasOnAfterInventory ---------- ---------- +
|
||||
MidasCollision 0x004334C0 0x00000217 +
|
||||
SwitchCollision 0x004336F0 0x0000011C +
|
||||
SwitchCollision2 0x00433810 0x000000F0 *
|
||||
SwitchCollision2 0x00433810 0x000000F0 +
|
||||
KeyHoleOnAfterInventory ---------- ---------- -
|
||||
KeyHoleCollision 0x00433900 0x00000227 *
|
||||
PuzzleOnAfterInventory ---------- ---------- -
|
||||
|
|
|
@ -34,9 +34,6 @@ static int16_t PickUpBoundsUW[12] = {
|
|||
+45 * PHD_DEGREE,
|
||||
};
|
||||
|
||||
static PHD_VECTOR PickUpPosition = { 0, 0, -100 };
|
||||
static PHD_VECTOR PickUpPositionUW = { 0, -200, -350 };
|
||||
|
||||
static int16_t PickUpScionBounds[12] = {
|
||||
-256,
|
||||
+256,
|
||||
|
@ -51,7 +48,6 @@ static int16_t PickUpScionBounds[12] = {
|
|||
0,
|
||||
0,
|
||||
};
|
||||
static PHD_VECTOR PickUpScionPosition = { 0, 640, -310 };
|
||||
|
||||
static int16_t PickUpScion4Bounds[12] = {
|
||||
-256,
|
||||
|
@ -67,17 +63,16 @@ static int16_t PickUpScion4Bounds[12] = {
|
|||
0,
|
||||
0,
|
||||
};
|
||||
static PHD_VECTOR PickUpScion4Position = { 0, 280, -512 + 105 };
|
||||
|
||||
static int16_t MidasBounds[12] = {
|
||||
-700,
|
||||
700,
|
||||
384 - 100,
|
||||
384 + 100 + 512,
|
||||
+700,
|
||||
+384 - 100,
|
||||
+384 + 100 + 512,
|
||||
-700,
|
||||
700,
|
||||
+700,
|
||||
-10 * PHD_DEGREE,
|
||||
10 * PHD_DEGREE,
|
||||
+10 * PHD_DEGREE,
|
||||
-30 * PHD_DEGREE,
|
||||
+30 * PHD_DEGREE,
|
||||
-10 * PHD_DEGREE,
|
||||
|
@ -87,10 +82,10 @@ static int16_t MidasBounds[12] = {
|
|||
static int16_t Switch1Bounds[12] = {
|
||||
-200,
|
||||
+200,
|
||||
0,
|
||||
0,
|
||||
WALL_L / 2 - 200,
|
||||
WALL_L / 2,
|
||||
+0,
|
||||
+0,
|
||||
+WALL_L / 2 - 200,
|
||||
+WALL_L / 2,
|
||||
-10 * PHD_DEGREE,
|
||||
+10 * PHD_DEGREE,
|
||||
-30 * PHD_DEGREE,
|
||||
|
@ -99,6 +94,18 @@ static int16_t Switch1Bounds[12] = {
|
|||
+10 * PHD_DEGREE,
|
||||
};
|
||||
|
||||
static int16_t Switch2Bounds[12] = {
|
||||
-WALL_L, +WALL_L, -WALL_L, +WALL_L,
|
||||
-WALL_L, +WALL_L / 2, -80 * PHD_DEGREE, +80 * PHD_DEGREE,
|
||||
-80 * PHD_DEGREE, +80 * PHD_DEGREE, -80 * PHD_DEGREE, +80 * PHD_DEGREE,
|
||||
};
|
||||
|
||||
static PHD_VECTOR PickUpPosition = { 0, 0, -100 };
|
||||
static PHD_VECTOR PickUpPositionUW = { 0, -200, -350 };
|
||||
static PHD_VECTOR PickUpScionPosition = { 0, 640, -310 };
|
||||
static PHD_VECTOR PickUpScion4Position = { 0, 280, -512 + 105 };
|
||||
static PHD_VECTOR Switch2Position = { 0, 0, 108 };
|
||||
|
||||
void AnimateLaraUntil(ITEM_INFO* lara_item, int32_t goal)
|
||||
{
|
||||
lara_item->goal_anim_state = goal;
|
||||
|
@ -340,6 +347,43 @@ void SwitchCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
|||
}
|
||||
}
|
||||
|
||||
void SwitchCollision2(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||
{
|
||||
ITEM_INFO* item = &Items[item_num];
|
||||
|
||||
if (!CHK_ANY(Input, IN_ACTION) || item->status != IS_NOT_ACTIVE
|
||||
|| Lara.water_status != LWS_UNDERWATER) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (lara_item->current_anim_state != AS_TREAD) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TestLaraPosition(Switch2Bounds, item, lara_item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->current_anim_state == SS_ON
|
||||
|| item->current_anim_state == SS_OFF) {
|
||||
if (!MoveLaraPosition(&Switch2Position, item, lara_item)) {
|
||||
return;
|
||||
}
|
||||
lara_item->fall_speed = 0;
|
||||
AnimateLaraUntil(lara_item, AS_SWITCHON);
|
||||
lara_item->goal_anim_state = AS_TREAD;
|
||||
Lara.gun_status = LGS_HANDSBUSY;
|
||||
item->status = IS_ACTIVE;
|
||||
if (item->current_anim_state == SS_ON) {
|
||||
item->goal_anim_state = SS_OFF;
|
||||
} else {
|
||||
item->goal_anim_state = SS_ON;
|
||||
}
|
||||
AddActiveItem(item_num);
|
||||
AnimateItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
int32_t KeyTrigger(int16_t item_num)
|
||||
{
|
||||
ITEM_INFO* item = &Items[item_num];
|
||||
|
@ -366,5 +410,6 @@ void T1MInjectGamePickup()
|
|||
INJECT(0x004333B0, PickUpScion4Collision);
|
||||
INJECT(0x004334C0, MidasCollision);
|
||||
INJECT(0x004336F0, SwitchCollision);
|
||||
INJECT(0x00433810, SwitchCollision2);
|
||||
INJECT(0x00433EA0, KeyTrigger);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <stdint.h>
|
||||
|
||||
// clang-format off
|
||||
#define SwitchCollision2 ((void (*)(int16_t item_num, ITEM_INFO* litem, COLL_INFO* coll))0x00433810)
|
||||
#define KeyHoleCollision ((void (*)(int16_t item_num, ITEM_INFO* litem, COLL_INFO* coll))0x00433900)
|
||||
#define PuzzleHoleCollision ((void (*)(int16_t item_num, ITEM_INFO* litem, COLL_INFO* coll))0x00433B40)
|
||||
#define SwitchControl ((void (*)(int16_t item_num))0x00433DE0)
|
||||
|
@ -21,6 +20,7 @@ void PickUpScion4Collision(
|
|||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
||||
void MidasCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
||||
void SwitchCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
||||
void SwitchCollision2(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
||||
int32_t KeyTrigger(int16_t item_num);
|
||||
|
||||
void T1MInjectGamePickup();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue