Reinstate xray scanner

This commit is contained in:
Ryan Dwyer
2022-11-06 10:16:37 +10:00
parent f0ef65ac42
commit 712d8a9fe5
3 changed files with 53 additions and 23 deletions
+42 -23
View File
@@ -6546,7 +6546,8 @@ void bgunUpdateLasersight(struct hand *hand, struct modelfiledata *modeldef, s32
mtx4TransformVecInPlace(camGetProjectionMtxF(), &beamnear);
if (hand->useposrot) {
if (hand->useposrot
|| (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_XRAYSCANNER)) {
beamfar.x = 0.0f;
beamfar.y = 0.0f;
beamfar.z = 1.0f;
@@ -7858,33 +7859,51 @@ void bgunTickGameplay2(void)
bgunTickLoad();
}
if (player->gunsightoff == 0) {
if (player->hands[HAND_RIGHT].gset.weaponnum == WEAPON_FARSIGHT) {
// Aiming with the Farsight
if (player->visionmode != VISIONMODE_XRAY) {
player->erasertime = 0;
} else {
player->erasertime += g_Vars.lvupdate240;
}
player->visionmode = VISIONMODE_XRAY;
player->ecol_1 = 16;
player->ecol_2 = 24;
player->ecol_3 = 8;
player->epcol_0 = 0;
player->epcol_1 = 1;
player->epcol_2 = 2;
if ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_XRAYSCANNER)
&& (bgunGetWeaponNum(HAND_RIGHT) != WEAPON_FARSIGHT || player->gunsightoff)) {
// Using normal xray scanner (not Farsight zoom)
if (player->visionmode != VISIONMODE_XRAY) {
player->erasertime = 0;
} else {
// Aiming with non-Farsight
player->erasertime += g_Vars.lvupdate240;
}
player->visionmode = VISIONMODE_XRAY;
player->ecol_1 = 24;
player->ecol_2 = 8;
player->ecol_3 = 24;
player->epcol_0 = 2;
player->epcol_1 = 0;
player->epcol_2 = 1;
} else {
if (player->gunsightoff == 0) {
if (player->hands[HAND_RIGHT].gset.weaponnum == WEAPON_FARSIGHT) {
// Aiming with the Farsight
if (player->visionmode != VISIONMODE_XRAY) {
player->erasertime = 0;
} else {
player->erasertime += g_Vars.lvupdate240;
}
player->visionmode = VISIONMODE_XRAY;
player->ecol_1 = 16;
player->ecol_2 = 24;
player->ecol_3 = 8;
player->epcol_0 = 0;
player->epcol_1 = 1;
player->epcol_2 = 2;
} else {
// Aiming with non-Farsight
if (player->visionmode != VISIONMODE_SLAYERROCKET) {
player->visionmode = VISIONMODE_NORMAL;
}
}
} else {
// Not aiming
if (player->visionmode != VISIONMODE_SLAYERROCKET) {
player->visionmode = VISIONMODE_NORMAL;
}
}
} else {
// Not aiming
if (player->visionmode != VISIONMODE_SLAYERROCKET) {
player->visionmode = VISIONMODE_NORMAL;
}
}
if (player->gunctrl.weaponnum == WEAPON_MAULER) {
+4
View File
@@ -300,6 +300,10 @@ void currentPlayerSetDeviceActive(s32 weaponnum, bool active)
if ((devicefunc->base.type & 0xff) == INVENTORYFUNCTYPE_DEVICE) {
if (active) {
if (devicefunc->device & (DEVICE_NIGHTVISION | DEVICE_XRAYSCANNER | DEVICE_IRSCANNER)) {
g_Vars.currentplayer->devicesactive &= ~(DEVICE_NIGHTVISION | DEVICE_XRAYSCANNER | DEVICE_IRSCANNER);
}
g_Vars.currentplayer->devicesactive |= devicefunc->device;
return;
}
+7
View File
@@ -2369,6 +2369,13 @@ void playerLaunchSlayerRocket(struct weaponobj *rocket)
{
g_Vars.currentplayer->slayerrocket = rocket;
g_Vars.currentplayer->visionmode = VISIONMODE_SLAYERROCKET;
// Turn off these devices
g_Vars.currentplayer->devicesactive &= ~(
DEVICE_NIGHTVISION |
DEVICE_XRAYSCANNER |
DEVICE_IRSCANNER);
g_Vars.currentplayer->badrockettime = 0;
}