fix biggun rockets

This commit is contained in:
Woops 2020-09-11 12:54:30 -05:00
parent 8cc8c99ecd
commit eb9eef21e8

View file

@ -13,59 +13,49 @@
#include "tomb4fx.h" #include "tomb4fx.h"
#include "draw.h" #include "draw.h"
static long GunRotYAdd = 0;
int fireCount = 0; int fireCount = 0;
void FireBigGun(ITEM_INFO *obj) void FireBigGun(ITEM_INFO *obj)
{ {
Lara.hasFired = true;
short itemNumber = CreateItem(); short itemNumber = CreateItem();
if (itemNumber != NO_ITEM) if (itemNumber != NO_ITEM)
{ {
BIGGUNINFO *gun = (BIGGUNINFO*)obj->data;
ITEM_INFO* item = &g_Level.Items[itemNumber]; ITEM_INFO* item = &g_Level.Items[itemNumber];
item->objectNumber = ID_ROCKET; item->objectNumber = ID_ROCKET;
item->roomNumber = LaraItem->roomNumber; item->roomNumber = LaraItem->roomNumber;
PHD_VECTOR jointPos; PHD_VECTOR pos;
jointPos.x = Lara.torsoXrot; pos.x = 0;
jointPos.y = Lara.torsoYrot + 1300; pos.y = 0;
jointPos.z = Lara.torsoZrot; pos.z = 520;
GetLaraJointPosition(&jointPos, LM_RHAND); GetJointAbsPosition(obj, &pos, 2);
int x, y, z;
item->pos.xPos = x = jointPos.x; item->pos.xPos = pos.x;
item->pos.yPos = y = jointPos.y; item->pos.yPos = pos.y;
item->pos.zPos = z = jointPos.z; item->pos.zPos = pos.z;
jointPos.x = 0; InitialiseItem(itemNumber);
jointPos.y = 180 + 1024;
jointPos.z = 0;
item->pos.xRot = -((gun->xRot - 32) * (ANGLE(1)));
item->pos.yRot = obj->pos.yRot;
item->pos.zRot = 0;
item->speed = 512 >> 5;
item->itemFlags[0] = 1;
AddActiveItem(itemNumber);
SmokeCountL = 32; SmokeCountL = 32;
SmokeWeapon = WEAPON_ROCKET_LAUNCHER; SmokeWeapon = WEAPON_ROCKET_LAUNCHER;
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
TriggerGunSmoke(x, y, z, jointPos.x - x, jointPos.y - y, jointPos.z - z, 1, WEAPON_ROCKET_LAUNCHER, 32); TriggerGunSmoke(pos.x, pos.y, pos.z, 0, 0, 0, 1, WEAPON_ROCKET_LAUNCHER, 32);
InitialiseItem(itemNumber);
item->pos.xRot = LaraItem->pos.xRot + Lara.leftArm.xRot;
item->pos.yRot = LaraItem->pos.yRot + Lara.leftArm.yRot;
item->pos.zRot = 0;
if (!Lara.leftArm.lock)
{
item->pos.xRot += Lara.torsoXrot;
item->pos.yRot += Lara.torsoYrot;
}
item->speed = 512 >> 5;
item->itemFlags[0] = 0;
AddActiveItem(itemNumber);
SoundEffect(SFX_EXPLOSION1, 0, 0); SoundEffect(SFX_EXPLOSION1, 0, 0);
} }