mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-05-01 14:17:58 +03:00
port LightningCollision
This commit is contained in:
parent
fe98b4c086
commit
778b768f74
4 changed files with 24 additions and 8 deletions
|
@ -455,7 +455,7 @@
|
||||||
<rect width="12.00" height="12.00" x="28.00" y="143.00" fill="forestgreen"><title>DrawLightning</title></rect>
|
<rect width="12.00" height="12.00" x="28.00" y="143.00" fill="forestgreen"><title>DrawLightning</title></rect>
|
||||||
<rect width="12.00" height="12.00" x="42.00" y="143.00" fill="forestgreen"><title>InitialiseLightning</title></rect>
|
<rect width="12.00" height="12.00" x="42.00" y="143.00" fill="forestgreen"><title>InitialiseLightning</title></rect>
|
||||||
<rect width="12.00" height="12.00" x="56.00" y="143.00" fill="forestgreen"><title>LightningControl</title></rect>
|
<rect width="12.00" height="12.00" x="56.00" y="143.00" fill="forestgreen"><title>LightningControl</title></rect>
|
||||||
<rect width="12.00" height="12.00" x="70.00" y="143.00" fill="lightpink"><title>LightningCollision</title></rect>
|
<rect width="12.00" height="12.00" x="70.00" y="143.00" fill="forestgreen"><title>LightningCollision</title></rect>
|
||||||
<rect width="12.00" height="12.00" x="84.00" y="143.00" fill="lightpink"><title>InitialiseThorsHandle</title></rect>
|
<rect width="12.00" height="12.00" x="84.00" y="143.00" fill="lightpink"><title>InitialiseThorsHandle</title></rect>
|
||||||
<rect width="12.00" height="12.00" x="98.00" y="143.00" fill="lightpink"><title>ThorsHandleControl</title></rect>
|
<rect width="12.00" height="12.00" x="98.00" y="143.00" fill="lightpink"><title>ThorsHandleControl</title></rect>
|
||||||
<rect width="12.00" height="12.00" x="112.00" y="143.00" fill="lightpink"><title>ThorsHandleCollision</title></rect>
|
<rect width="12.00" height="12.00" x="112.00" y="143.00" fill="lightpink"><title>ThorsHandleCollision</title></rect>
|
||||||
|
@ -1199,7 +1199,7 @@
|
||||||
<rect width="6.22" height="7.10" x="601.29" y="441.36" fill="lightpink"><title>flatA</title></rect>
|
<rect width="6.22" height="7.10" x="601.29" y="441.36" fill="lightpink"><title>flatA</title></rect>
|
||||||
<rect width="6.22" height="7.01" x="601.29" y="450.46" fill="forestgreen"><title>InitialiseObjects</title></rect>
|
<rect width="6.22" height="7.01" x="601.29" y="450.46" fill="forestgreen"><title>InitialiseObjects</title></rect>
|
||||||
<rect width="6.22" height="6.83" x="601.29" y="459.47" fill="forestgreen"><title>draw_pistol_meshes</title></rect>
|
<rect width="6.22" height="6.83" x="601.29" y="459.47" fill="forestgreen"><title>draw_pistol_meshes</title></rect>
|
||||||
<rect width="6.22" height="6.83" x="601.29" y="468.30" fill="lightpink"><title>LightningCollision</title></rect>
|
<rect width="6.22" height="6.83" x="601.29" y="468.30" fill="forestgreen"><title>LightningCollision</title></rect>
|
||||||
<rect width="6.22" height="6.74" x="601.29" y="477.13" fill="mistyrose"><title>sub_4079E9</title></rect>
|
<rect width="6.22" height="6.74" x="601.29" y="477.13" fill="mistyrose"><title>sub_4079E9</title></rect>
|
||||||
<rect width="6.22" height="6.74" x="601.29" y="485.86" fill="forestgreen"><title>GetSavedGamesList</title></rect>
|
<rect width="6.22" height="6.74" x="601.29" y="485.86" fill="forestgreen"><title>GetSavedGamesList</title></rect>
|
||||||
<rect width="6.22" height="6.74" x="601.29" y="494.60" fill="forestgreen"><title>Inv_RingGetView</title></rect>
|
<rect width="6.22" height="6.74" x="601.29" y="494.60" fill="forestgreen"><title>Inv_RingGetView</title></rect>
|
||||||
|
@ -1463,10 +1463,10 @@
|
||||||
<rect width="-0.06" height="-0.07" x="694.51" y="536.07" fill="mistyrose"><title>sub_440EF0</title></rect>
|
<rect width="-0.06" height="-0.07" x="694.51" y="536.07" fill="mistyrose"><title>sub_440EF0</title></rect>
|
||||||
<rect width="-0.45" height="-0.55" x="696.45" y="536.07" fill="mistyrose"><title>sub_437BC0</title></rect>
|
<rect width="-0.45" height="-0.55" x="696.45" y="536.07" fill="mistyrose"><title>sub_437BC0</title></rect>
|
||||||
<rect width="-0.45" height="-1.52" x="696.45" y="537.52" fill="lightpink"><title>S_CDVolume</title></rect>
|
<rect width="-0.45" height="-1.52" x="696.45" y="537.52" fill="lightpink"><title>S_CDVolume</title></rect>
|
||||||
<rect width="12.00" height="12.00" x="0.00" y="564.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="570.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (count): 48.02%</text>
|
<rect width="12.00" height="12.00" x="0.00" y="564.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="570.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (count): 48.15%</text>
|
||||||
<rect width="12.00" height="12.00" x="0.00" y="582.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="588.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (bytesize): 45.88%</text>
|
<rect width="12.00" height="12.00" x="0.00" y="582.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="588.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (bytesize): 45.92%</text>
|
||||||
<rect width="12.00" height="12.00" x="0.00" y="600.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="606.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (count): 37.89%</text>
|
<rect width="12.00" height="12.00" x="0.00" y="600.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="606.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (count): 37.76%</text>
|
||||||
<rect width="12.00" height="12.00" x="0.00" y="618.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="624.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (bytesize): 38.29%</text>
|
<rect width="12.00" height="12.00" x="0.00" y="618.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="624.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (bytesize): 38.25%</text>
|
||||||
<rect width="12.00" height="12.00" x="0.00" y="636.50" fill="mistyrose"/><text alignment-baseline="central" x="17.00" y="642.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, with unknown names (count): 14.09%</text>
|
<rect width="12.00" height="12.00" x="0.00" y="636.50" fill="mistyrose"/><text alignment-baseline="central" x="17.00" y="642.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, with unknown names (count): 14.09%</text>
|
||||||
<rect width="12.00" height="12.00" x="0.00" y="654.50" fill="mistyrose"/><text alignment-baseline="central" x="17.00" y="660.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, with unknown names (bytesize): 15.83%</text>
|
<rect width="12.00" height="12.00" x="0.00" y="654.50" fill="mistyrose"/><text alignment-baseline="central" x="17.00" y="660.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, with unknown names (bytesize): 15.83%</text>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
|
@ -636,7 +636,7 @@ LaraWaterCurrent 0x00429440 0x000001DB +
|
||||||
DrawLightning 0x00429620 0x000004D1 +
|
DrawLightning 0x00429620 0x000004D1 +
|
||||||
InitialiseLightning 0x00429B00 0x0000007E +
|
InitialiseLightning 0x00429B00 0x0000007E +
|
||||||
LightningControl 0x00429B80 0x000002AF +
|
LightningControl 0x00429B80 0x000002AF +
|
||||||
LightningCollision 0x00429E30 0x00000061 *
|
LightningCollision 0x00429E30 0x00000061 +
|
||||||
InitialiseThorsHandle 0x00429EA0 0x00000086 *
|
InitialiseThorsHandle 0x00429EA0 0x00000086 *
|
||||||
ThorsHandleControl 0x00429F30 0x000002B0 *
|
ThorsHandleControl 0x00429F30 0x000002B0 *
|
||||||
ThorsHandleCollision 0x0042A1F0 0x0000004B *
|
ThorsHandleCollision 0x0042A1F0 0x0000004B *
|
||||||
|
|
|
@ -263,9 +263,24 @@ void LightningControl(int16_t item_num)
|
||||||
SoundEffect(98, &item->pos, 0);
|
SoundEffect(98, &item->pos, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LightningCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
|
{
|
||||||
|
LIGHTNING* l = Items[item_num].data;
|
||||||
|
if (!l->zapped) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Lara.hit_direction = 1 + (GetRandomControl() * 4) / 0x7FFF;
|
||||||
|
Lara.hit_frame++;
|
||||||
|
if (Lara.hit_frame > 34) {
|
||||||
|
Lara.hit_frame = 34;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void T1MInjectGameLightning()
|
void T1MInjectGameLightning()
|
||||||
{
|
{
|
||||||
INJECT(0x00429620, DrawLightning);
|
INJECT(0x00429620, DrawLightning);
|
||||||
INJECT(0x00429B00, InitialiseLightning);
|
INJECT(0x00429B00, InitialiseLightning);
|
||||||
INJECT(0x00429B80, LightningControl);
|
INJECT(0x00429B80, LightningControl);
|
||||||
|
INJECT(0x00429E30, LightningCollision);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define LightningCollision ((void (*)(int16_t item_num, ITEM_INFO* litem, COLL_INFO* coll))0x00429E30)
|
|
||||||
#define InitialiseThorsHandle ((void (*)(int16_t item_num))0x00429EA0)
|
#define InitialiseThorsHandle ((void (*)(int16_t item_num))0x00429EA0)
|
||||||
#define ThorsHandleControl ((void (*)(int16_t item_num))0x00429F30)
|
#define ThorsHandleControl ((void (*)(int16_t item_num))0x00429F30)
|
||||||
#define ThorsHandleCollision ((void (*)(int16_t item_num, ITEM_INFO* litem, COLL_INFO* coll))0x0042A1F0)
|
#define ThorsHandleCollision ((void (*)(int16_t item_num, ITEM_INFO* litem, COLL_INFO* coll))0x0042A1F0)
|
||||||
|
@ -15,6 +14,8 @@
|
||||||
void DrawLightning(ITEM_INFO* item);
|
void DrawLightning(ITEM_INFO* item);
|
||||||
void InitialiseLightning(int16_t item_num);
|
void InitialiseLightning(int16_t item_num);
|
||||||
void LightningControl(int16_t item_num);
|
void LightningControl(int16_t item_num);
|
||||||
|
void LightningCollision(
|
||||||
|
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
||||||
|
|
||||||
void T1MInjectGameLightning();
|
void T1MInjectGameLightning();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue