From 2d0094a8b84c577171d7b223bd92b042ed56d69c Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 4 Nov 2022 20:39:39 +1000 Subject: [PATCH] Remove eyespy --- ld/gamefiles.ntsc-final.inc | 1 - src/game/body.c | 96 --- src/game/bondeyespy.c | 1179 ---------------------------- src/game/bondgun.c | 20 - src/game/bondgunreset.c | 19 - src/game/bondview.c | 1455 ----------------------------------- src/game/chr.c | 104 +-- src/game/chraction.c | 258 +------ src/game/game_0b0fd0.c | 4 +- src/game/hudmsg.c | 2 - src/game/lv.c | 41 - src/game/mainmenu.c | 10 - src/game/menu.c | 9 +- src/game/menutick.c | 1 - src/game/mplayer/ingame.c | 12 - src/game/player.c | 142 +--- src/game/playermgr.c | 3 - src/game/playerreset.c | 85 -- src/game/prop.c | 21 +- src/game/propobj.c | 66 +- src/game/sight.c | 10 - src/game/sky.c | 2 +- src/game/training.c | 13 - src/include/constants.h | 4 - src/include/types.h | 36 +- 25 files changed, 45 insertions(+), 3548 deletions(-) delete mode 100644 src/game/bondeyespy.c diff --git a/ld/gamefiles.ntsc-final.inc b/ld/gamefiles.ntsc-final.inc index fd361af4d..41222e133 100644 --- a/ld/gamefiles.ntsc-final.inc +++ b/ld/gamefiles.ntsc-final.inc @@ -120,7 +120,6 @@ build/ROMID/game/bondwalk.o (section); \ build/ROMID/game/bondmove.o (section); \ build/ROMID/game/bondgrab.o (section); \ - build/ROMID/game/bondeyespy.o (section); \ build/ROMID/game/bondbike.o (section); \ build/ROMID/game/savebuffer.o (section); \ build/ROMID/game/healthbar.o (section); \ diff --git a/src/game/body.c b/src/game/body.c index 78a8e0a5e..5cf2556ec 100644 --- a/src/game/body.c +++ b/src/game/body.c @@ -143,12 +143,6 @@ u32 bodyGetRace(s32 bodynum) case BODY_MINISKEDAR: case BODY_SKEDARKING: return RACE_SKEDAR; - case BODY_DRCAROLL: - return RACE_DRCAROLL; - case BODY_EYESPY: - return RACE_EYESPY; - case BODY_CHICROB: - return RACE_ROBOT; } return RACE_HUMAN; @@ -530,96 +524,6 @@ void bodyAllocateChr(s32 stagenum, struct packedchr *packed, s32 cmdindex) } } -struct prop *bodyAllocateEyespy(struct pad *pad, s16 room) -{ - s16 rooms[2]; - struct prop *prop; - struct chrdata *chr; - struct model *model; - s32 inlift; - struct prop *lift; - f32 ground; - - rooms[0] = room; - rooms[1] = -1; - -#if PIRACYCHECKS - { - u32 stack[2]; - u32 checksum = 0; - s32 *ptr = (s32 *)&lvReset; - s32 *end = (s32 *)&lvConfigureFade; - - while (ptr < end) { - checksum <<= 1; - checksum ^= *ptr; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - s32 *ptr2 = (s32 *)_memaFree; - s32 *end2 = (s32 *)memaInit; - - while (ptr2 < end2) { - ptr2[0] = 0; - ptr2++; - } - } - } -#endif - - model = bodyAllocateModel(BODY_EYESPY, 0, 0); - - if (model) { - prop = chrAllocate(model, &pad->pos, rooms, 0); - - if (prop) { - propActivate(prop); - propEnable(prop); - chr = prop->chr; - chrSetChrnum(chr, chrsGetNextUnusedChrnum()); - chr->bodynum = BODY_EYESPY; - chr->padpreset1 = 0; - chr->chrpreset1 = 0; - chr->headnum = 0; - chr->hearingscale = 0; - chr->visionrange = 0; - chr->race = bodyGetRace(chr->bodynum); - - ground = cdFindGroundInfoAtCyl(&pad->pos, 30, rooms, NULL, NULL, NULL, NULL, &inlift, &lift); - chr->ground = ground; - chr->manground = ground; - - chr->flags = 0; - chr->flags2 = 0; - chr->team = 0; - chr->squadron = 0; - chr->maxdamage = 2; - chr->tude = random() & 3; - chr->voicebox = random() % 3; - chr->naturalanim = 0; - chr->myspecial = 0; - chr->yvisang = 0; - chr->teamscandist = 0; - chr->convtalk = 0; - chr->radius = 26; - chr->height = 200; - func0f02e9a0(chr, 0); - chr->chrflags |= CHRCFLAG_HIDDEN; - -#if VERSION >= VERSION_NTSC_1_0 - chr->hidden2 |= CHRH2FLAG_0040; -#else - chr->hidden |= CHRHFLAG_00000200; -#endif - - return prop; - } - } - - return NULL; -} - void body0f02ddbf(void) { // empty diff --git a/src/game/bondeyespy.c b/src/game/bondeyespy.c deleted file mode 100644 index 0a129a4a7..000000000 --- a/src/game/bondeyespy.c +++ /dev/null @@ -1,1179 +0,0 @@ -#include -#include "constants.h" -#include "game/bondeyespy.h" -#include "game/chraction.h" -#include "game/chr.h" -#include "game/prop.h" -#include "game/propsnd.h" -#include "game/bondgun.h" -#include "game/player.h" -#include "game/hudmsg.h" -#include "game/inv.h" -#include "game/mplayer/ingame.h" -#include "game/playermgr.h" -#include "game/stagetable.h" -#include "game/lang.h" -#include "game/options.h" -#include "game/propobj.h" -#include "bss.h" -#include "lib/joy.h" -#include "lib/main.h" -#include "lib/snd.h" -#include "lib/mtx.h" -#include "lib/anim.h" -#include "lib/collision.h" -#include "data.h" -#include "types.h" - -u8 g_EyespyPickup = false; -u8 g_EyespyHit = EYESPYHIT_NONE; -u8 g_EyespyPrevHit = EYESPYHIT_NONE; -u8 var80070ecc = 0; -f32 g_EyespyMaxHeight = 160; -f32 g_EyespyMinHeight = 80; -u32 g_EyespyFallAccel = 100; -u32 g_EyespyMaxFallSpeed = 3000; - -/** - * Determines the eyespy's ground Y value by doing a collision check for a - * position 50 units above the current position, or less if the eyespy is near - * the top of its height range. - */ -f32 eyespyFindGround(s16 *floorroom) -{ - struct prop *prop = g_Vars.currentplayer->eyespy->prop; - s32 inlift; - struct prop *lift; - struct coord pos; - f32 yoffset = 50; - f32 ground; - - if (g_EyespyMaxHeight - g_Vars.currentplayer->eyespy->height < 50) { - yoffset = g_EyespyMaxHeight - g_Vars.currentplayer->eyespy->height; - } - - if (yoffset < 0) { - yoffset = 0; - } - - pos.x = prop->pos.x; - pos.y = prop->pos.y + yoffset; - pos.z = prop->pos.z; - - ground = cdFindGroundInfoAtCyl(&pos, 26, prop->rooms, NULL, NULL, NULL, floorroom, &inlift, &lift); - - if (ground < -30000) { - ground = -30000; - } - - return ground; -} - -s32 eyespyTryMoveUpwards(f32 yvel) -{ - s32 result; - struct prop *prop = g_Vars.currentplayer->eyespy->prop; - struct chrdata *chr = prop->chr; - struct coord dstpos; - s16 dstrooms[8]; - s32 types; - u32 stack; - f32 f0; - u32 stack2; - - dstpos.x = prop->pos.x; - dstpos.y = prop->pos.y + yvel; - dstpos.z = prop->pos.z; - - types = g_Vars.bondcollisions ? CDTYPE_ALL : CDTYPE_BG; - - // Allow eyespy to go up steps 30cm or less - if (chr->manground + 30 >= g_Vars.currentplayer->eyespy->oldground) { - f0 = chr->manground - prop->pos.y + 30; - } else { - f0 = g_Vars.currentplayer->eyespy->oldground - prop->pos.y; - } - - func0f065e74(&prop->pos, prop->rooms, &dstpos, dstrooms); - chr0f021fa8(prop->chr, &dstpos, dstrooms); - propSetPerimEnabled(prop, false); - - f0 -= 0.1f; - - result = cdTestVolume(&dstpos, 26, dstrooms, types, CHECKVERTICAL_YES, 15, f0); - propSetPerimEnabled(prop, true); - - if (result == CDRESULT_NOCOLLISION) { - prop->pos.y = dstpos.y; - propDeregisterRooms(prop); - roomsCopy(dstrooms, prop->rooms); - } - - return result; -} - -s32 eyespyCalculateNewPosition(struct coord *vel) -{ - bool result = true; - struct prop *eyespyprop = g_Vars.currentplayer->eyespy->prop; - struct chrdata *chr = eyespyprop->chr; - struct coord dstpos; - s16 dstrooms[8]; - s16 floorroom; - s16 sp74[24]; - s32 types; - s32 i; - f32 ymin; - f32 xdiff; - f32 zdiff; - u32 stack; - f32 radius; - f32 halfradius; - struct prop *prop; - s32 playernum; - u32 stack2; - - eyespyFindGround(&floorroom); - - if (vel->x || vel->y || vel->z) { - propSetPerimEnabled(eyespyprop, false); - - dstpos.x = vel->x + eyespyprop->pos.x; - dstpos.y = vel->y + eyespyprop->pos.y; - dstpos.z = vel->z + eyespyprop->pos.z; - - types = g_Vars.bondcollisions ? CDTYPE_ALL : CDTYPE_BG; - - // Allow eyespy to go up steps 30cm or less - if (g_Vars.currentplayer->eyespy->oldground <= chr->manground + 30) { - ymin = chr->manground - eyespyprop->pos.y + 30; - } else { - ymin = g_Vars.currentplayer->eyespy->oldground - eyespyprop->pos.y; - } - - // This must be populating dstrooms at least - func0f065dfc(&eyespyprop->pos, eyespyprop->rooms, &dstpos, dstrooms, sp74, 20); - - // Check if dstrooms contains the eyespy's old room. - // If so, simplify dstrooms so it only contains that room. - for (i = 0; dstrooms[i] != -1; i++) { - if (dstrooms[i] == floorroom) { - dstrooms[0] = floorroom; - dstrooms[1] = -1; - break; - } - } - - chr0f021fa8(eyespyprop->chr, &dstpos, dstrooms); - - // Check if the eyespy is moving 13cm or more along either the X or Z - // axis in a single frame. If less, only do a collision check for the - // dst position. If more, do a halfway check too? - xdiff = dstpos.x - eyespyprop->pos.x; - zdiff = dstpos.z - eyespyprop->pos.z; - - radius = 26; - halfradius = radius * 0.5f; - - if (xdiff > halfradius || zdiff > halfradius || xdiff < -halfradius || zdiff < -halfradius) { - result = cdExamCylMove06(&eyespyprop->pos, eyespyprop->rooms, &dstpos, dstrooms, radius, types, 1, 15, ymin); - - if (result == CDRESULT_NOCOLLISION) { - result = cdExamCylMove02(&eyespyprop->pos, &dstpos, radius, dstrooms, types, true, 15, ymin); - } - } else { - result = cdExamCylMove02(&eyespyprop->pos, &dstpos, radius, sp74, types, true, 15, ymin); - } - - if (result == CDRESULT_COLLISION) { - prop = cdGetObstacleProp(); - - if (prop && prop->type == PROPTYPE_PLAYER) { - playernum = g_Vars.currentplayernum; - - if (playernum == playermgrGetPlayerNumByProp(prop)) { - g_EyespyPickup = true; - } - } - } - - propSetPerimEnabled(eyespyprop, true); - - if (result == CDRESULT_NOCOLLISION) { - // Apply the destination - eyespyprop->pos.x = dstpos.x; - eyespyprop->pos.y = dstpos.y; - eyespyprop->pos.z = dstpos.z; - - propDeregisterRooms(eyespyprop); - - roomsCopy(dstrooms, eyespyprop->rooms); - } - } - - return result; -} - -bool eyespyCalculateNewPositionWithPush(struct coord *vel) -{ - s32 result = eyespyCalculateNewPosition(vel); - struct prop *prop; - - if (result != CDRESULT_NOCOLLISION) { - g_EyespyHit = EYESPYHIT_BG; - - prop = cdGetObstacleProp(); - - if (prop && g_Vars.lvupdate240 > 0) { - if (prop->type == PROPTYPE_DOOR) { - struct doorobj *door = prop->door; - - g_EyespyHit = EYESPYHIT_DOOR; - - if (door->doorflags & DOORFLAG_DAMAGEONCONTACT) { - f32 sp38[3]; - struct coord sp2c; - struct coord sp20; - - cdGetEdge(&sp2c, &sp20, 286, "bondeyespy.c"); - - // Nothing is actually done with these coordinates... - // This code was likely copied from bondwalk then the bounce - // feature removed - sp38[0] = sp20.z - sp2c.z; - sp38[1] = 0; - sp38[2] = sp2c.x - sp20.x; - - if (sp38[0] || sp38[2]) { - guNormalize(&sp38[0], &sp38[1], &sp38[2]); - } else { - sp38[2] = 1; - } - - if (prop); - - g_EyespyHit = EYESPYHIT_DAMAGE; - } - } - - if (prop->type == PROPTYPE_CHR) { - g_EyespyHit = EYESPYHIT_CHR; - } else if (prop->type == PROPTYPE_PLAYER) { - g_EyespyHit = EYESPYHIT_CHR; - } else if (prop->type == PROPTYPE_OBJ) { - g_EyespyHit = EYESPYHIT_OBJ; - } - } - } - - return result; -} - -s32 eyespy0f0cf890(struct coord *arg0, struct coord *arg1, struct coord *arg2, struct coord *arg3, struct coord *arg4) -{ - if (cd00024ea4()) { - struct coord sp24; - s32 someint; - f32 somefloat = cd00024e98(); - sp24.x = arg0->x * somefloat * 0.25f; - sp24.y = arg0->y * somefloat * 0.25f; - sp24.z = arg0->z * somefloat * 0.25f; - - someint = eyespyCalculateNewPositionWithPush(&sp24); - - if (someint == 1) { - return 1; - } - - if (someint == 0) { - cdGetEdge(arg3, arg4, 350, "bondeyespy.c"); - - if (arg3->f[0] != arg1->f[0] - || arg3->f[1] != arg1->f[1] - || arg3->f[2] != arg1->f[2] - || arg4->f[0] != arg2->f[0] - || arg4->f[1] != arg2->f[1] - || arg4->f[2] != arg2->f[2]) { - return 0; - } - } - } - - return -1; -} - -s32 eyespy0f0cf9f8(struct coord *arg0, struct coord *arg1, struct coord *arg2) -{ - f32 tmp; - struct coord sp30; - struct coord sp24; - f32 dist; - - if (arg1->f[0] != arg2->f[0] || arg1->f[2] != arg2->f[2]) { - sp30.x = arg2->x - arg1->x; - sp30.y = 0; - sp30.z = arg2->z - arg1->z; - - dist = sqrtf(sp30.f[0] * sp30.f[0] + sp30.f[2] * sp30.f[2]); - - sp30.x *= 1.0f / dist; - sp30.z *= 1.0f / dist; - - tmp = arg0->f[0] * sp30.f[0] + arg0->f[2] * sp30.f[2]; - - sp24.x = sp30.x * tmp; - sp24.y = 0; - sp24.z = sp30.z * tmp; - - return eyespyCalculateNewPositionWithPush(&sp24); - } - - return -1; -} - -s32 eyespy0f0cfafc(struct coord *arg0, struct coord *arg1, struct coord *arg2) -{ - struct coord sp34; - struct coord sp28; - f32 width = 26; - struct prop *prop = g_Vars.currentplayer->eyespy->prop; - f32 tmp; - - sp34.x = arg1->x - (prop->pos.x + arg0->f[0]); - sp34.z = arg1->z - (prop->pos.z + arg0->f[2]); - - if (sp34.f[0] * sp34.f[0] + sp34.f[2] * sp34.f[2] <= width * width) { - if (arg1->f[0] != prop->pos.f[0] || arg1->f[2] != prop->pos.f[2]) { - sp34.x = -(arg1->z - prop->pos.z); - sp34.y = 0; - sp34.z = arg1->x - prop->pos.x; - - tmp = sqrtf(sp34.f[0] * sp34.f[0] + sp34.f[2] * sp34.f[2]); - - sp34.x = sp34.f[0] * (1.0f / tmp); - sp34.z = sp34.f[2] * (1.0f / tmp); - - tmp = arg0->f[0] * sp34.f[0] + arg0->f[2] * sp34.f[2]; - - sp34.x = sp34.x * tmp; - sp34.z = sp34.z * tmp; - - sp28.x = sp34.x; - sp28.y = 0; - sp28.z = sp34.z; - - if (eyespyCalculateNewPositionWithPush(&sp28) == 1) { - return true; - } - } - } else { - sp34.x = arg2->x - (prop->pos.x + arg0->f[0]); - sp34.z = arg2->z - (prop->pos.z + arg0->f[2]); - - if (sp34.f[0] * sp34.f[0] + sp34.f[2] * sp34.f[2] <= width * width) { - if (arg2->f[0] != prop->pos.f[0] || arg2->f[2] != prop->pos.f[2]) { - sp34.x = -(arg2->z - prop->pos.z); - sp34.y = 0; - sp34.z = arg2->x - prop->pos.x; - - tmp = sqrtf(sp34.f[0] * sp34.f[0] + sp34.f[2] * sp34.f[2]); - - sp34.x = sp34.f[0] * (1.0f / tmp); - sp34.z = sp34.f[2] * (1.0f / tmp); - - tmp = arg0->f[0] * sp34.f[0] + arg0->f[2] * sp34.f[2]; - - sp34.x = sp34.x * tmp; - sp34.z = sp34.z * tmp; - - sp28.x = sp34.x; - sp28.y = 0; - sp28.z = sp34.z; - - if (eyespyCalculateNewPositionWithPush(&sp28) == 1) { - return true; - } - } - } - } - - return false; -} - -s32 eyespy0f0cfdd0(struct coord *vel, struct coord *arg1, struct coord *arg2) -{ - bool result = eyespyCalculateNewPositionWithPush(vel); - - if (result != CDRESULT_NOCOLLISION) { - cdGetEdge(arg1, arg2, 473, "bondeyespy.c"); - } - - return result; -} - -void eyespyUpdateVertical(void) -{ - struct coord spac; - struct coord spa0; - struct prop *prop = g_Vars.currentplayer->eyespy->prop; - struct coord dist; - f32 newground; - struct chrdata *chr = prop->chr; - struct coord origpos; - f32 accel; - f32 maxfallspeed; - u8 hit = EYESPYHIT_NONE; - f32 newy; - struct coord sp60; - struct coord sp54; - u32 stack; - struct coord sp44; - struct coord sp38; - - origpos.f[0] = prop->pos.x; - origpos.f[1] = prop->pos.y; - origpos.f[2] = prop->pos.z; - - dist.x = g_Vars.currentplayer->eyespy->vel.x; - dist.y = 0; - dist.z = g_Vars.currentplayer->eyespy->vel.z; - - if (eyespy0f0cfdd0(&dist, &spac, &spa0) == CDRESULT_COLLISION) { - if (eyespy0f0cf890(&dist, &spac, &spa0, &sp60, &sp54)) { - if (eyespy0f0cf9f8(&dist, &spac, &spa0) <= 0) { - eyespy0f0cfafc(&dist, &spac, &spa0); - } - } else { - eyespy0f0cf890(&dist, &sp60, &sp54, &sp44, &sp38); - - if (eyespy0f0cf9f8(&dist, &sp60, &sp54) <= 0 - && eyespy0f0cf9f8(&dist, &spac, &spa0) <= 0 - && eyespy0f0cfafc(&dist, &sp60, &sp54) <= 0) { - eyespy0f0cfafc(&dist, &spac, &spa0); - } - } - } - - // Handle gravity - mainOverrideVariable("g", &g_EyespyFallAccel); - mainOverrideVariable("l", &g_EyespyMaxFallSpeed); - - accel = g_EyespyFallAccel * 0.01; // always 1 - maxfallspeed = g_EyespyMaxFallSpeed * 0.01f; // always 30 - - newy = chr->manground; - newground = eyespyFindGround(NULL); - - if (newground != chr->manground) { - if (newground < chr->manground) { - // Descending a slope or ledge - if (g_Vars.currentplayer->eyespy->gravity >= maxfallspeed) { - g_Vars.currentplayer->eyespy->gravity = maxfallspeed; - } else { - g_Vars.currentplayer->eyespy->gravity += accel; - } - - newy -= g_Vars.currentplayer->eyespy->gravity; - - if (newy < newground) { - g_Vars.currentplayer->eyespy->gravity = 0; - newy = newground; - } - } else if (newground > chr->manground) { - // Ascending a slope or steps - if (g_Vars.currentplayer->eyespy->gravity >= maxfallspeed) { - g_Vars.currentplayer->eyespy->gravity = maxfallspeed; - } else { - g_Vars.currentplayer->eyespy->gravity += accel; - } - - newy += g_Vars.currentplayer->eyespy->gravity; - - if (newy > newground) { - g_Vars.currentplayer->eyespy->gravity = 0; - newy = newground; - } - } - - if (chr->manground + g_Vars.currentplayer->eyespy->height < newground + g_EyespyMinHeight) { - newy = (newground + g_EyespyMinHeight) - g_Vars.currentplayer->eyespy->height; - } - } - - if (eyespyTryMoveUpwards(newy - chr->manground)) { - chr->manground = newy; - } else { - g_Vars.currentplayer->eyespy->gravity = 0; - } - - g_Vars.currentplayer->eyespy->oldground = newground; - chr->ground = chr->manground; - chr->sumground = chr->manground * (PAL ? 8.4175090789795f : 9.999998f); - - // Handle rebound if hitting the min or max height - if (g_Vars.currentplayer->eyespy->vel.y != 0) { - f32 newheight = g_Vars.currentplayer->eyespy->vel.y + g_Vars.currentplayer->eyespy->height; - bool rebound = false; - - if (newheight < g_EyespyMinHeight) { - newheight = g_EyespyMinHeight; - rebound = true; - } else if (newheight > g_EyespyMaxHeight) { - newheight = g_EyespyMaxHeight; - rebound = true; - } - - if (eyespyTryMoveUpwards(newheight - g_Vars.currentplayer->eyespy->height)) { - g_Vars.currentplayer->eyespy->height = newheight; - } else { - rebound = true; - hit = EYESPYHIT_BG; - } - - if (rebound) { - g_Vars.currentplayer->eyespy->vel.y = -g_Vars.currentplayer->eyespy->vel.y * 0.25f; - } - } - - if (g_EyespyHit == EYESPYHIT_NONE) { - g_EyespyHit = hit; - } - - chr0f0220ac(chr); - - dist.x = prop->pos.x - origpos.x; - dist.y = prop->pos.y - origpos.y; - dist.z = prop->pos.z - origpos.z; - - g_Vars.currentplayer->eyespy->speed = - dist.f[0] * dist.f[0] + - dist.f[1] * dist.f[1] + - dist.f[2] * dist.f[2]; -} - -bool eyespyTryLaunch(void) -{ - struct coord playerpos; - struct coord testfrompos; - struct chrdata *chr = g_Vars.currentplayer->eyespy->prop->chr; - bool launched; - bool insafe; - char text[48]; - - insafe = stageGetIndex(g_Vars.stagenum) == STAGEINDEX_G5BUILDING - && g_Vars.currentplayer->prop->rooms[0] == 0x53; - - playerpos.x = g_Vars.currentplayer->prop->pos.x; - playerpos.y = g_Vars.currentplayer->prop->pos.y; - playerpos.z = g_Vars.currentplayer->prop->pos.z; - - chr->soundtimer = TICKS(10); - - g_Vars.currentplayer->eyespy->held = false; - g_Vars.currentplayer->eyespy->up.x = 0; - g_Vars.currentplayer->eyespy->up.y = 1; - g_Vars.currentplayer->eyespy->up.z = 0; - g_Vars.currentplayer->eyespy->startuptimer60 = 0; - - if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_G5BUILDING - || stageGetIndex(g_Vars.stagenum) == STAGEINDEX_CITRAINING) { - g_EyespyMinHeight = 30; - } else { - g_EyespyMinHeight = 80; - } - - g_Vars.currentplayer->eyespy->oldground = g_Vars.currentplayer->vv_ground; - chr->ground = g_Vars.currentplayer->eyespy->oldground; - chr->manground = g_Vars.currentplayer->eyespy->oldground; - - g_Vars.currentplayer->eyespy->height = g_EyespyMinHeight; - g_Vars.currentplayer->eyespy->theta = g_Vars.currentplayer->vv_theta + 180; - - if (g_Vars.currentplayer->eyespy->theta >= 360) { - g_Vars.currentplayer->eyespy->theta -= 360; - } - - g_Vars.currentplayer->eyespy->costheta = cosf(g_Vars.currentplayer->eyespy->theta * 0.017453292384744f); - g_Vars.currentplayer->eyespy->sintheta = sinf(g_Vars.currentplayer->eyespy->theta * 0.017453292384744f); - - chr->prevpos.x = g_Vars.currentplayer->eyespy->prop->pos.x = playerpos.f[0] + g_Vars.currentplayer->eyespy->sintheta * 100; - chr->prevpos.y = g_Vars.currentplayer->eyespy->prop->pos.y = g_Vars.currentplayer->eyespy->oldground + g_Vars.currentplayer->eyespy->height; - chr->prevpos.z = g_Vars.currentplayer->eyespy->prop->pos.z = playerpos.f[2] + g_Vars.currentplayer->eyespy->costheta * -100; - - chr->fallspeed.x = 0; - chr->fallspeed.y = 0; - chr->fallspeed.z = 0; - - testfrompos.x = playerpos.x; - testfrompos.y = g_Vars.currentplayer->eyespy->oldground + g_Vars.currentplayer->eyespy->height; - testfrompos.z = playerpos.z; - - g_Vars.currentplayer->eyespy->look.x = g_Vars.currentplayer->eyespy->sintheta; - g_Vars.currentplayer->eyespy->look.y = 0; - g_Vars.currentplayer->eyespy->look.z = -g_Vars.currentplayer->eyespy->costheta; - g_Vars.currentplayer->eyespy->verta = 0; - g_Vars.currentplayer->eyespy->cosverta = 1; - g_Vars.currentplayer->eyespy->sinverta = 0; - g_Vars.currentplayer->eyespy->vel.x = 0; - g_Vars.currentplayer->eyespy->vel.y = 0; - g_Vars.currentplayer->eyespy->vel.z = 0; - g_Vars.currentplayer->eyespy->bobdir = 1; - g_Vars.currentplayer->eyespy->bobtimer = 0; - g_Vars.currentplayer->eyespy->bobactive = true; - g_Vars.currentplayer->eyespy->speed = 0; - g_Vars.currentplayer->eyespy->gravity = 0; - g_Vars.currentplayer->eyespy->active = true; - g_Vars.currentplayer->eyespy->camerabuttonheld = false; - g_Vars.currentplayer->eyespy->buttonheld = g_Vars.currentplayer->eyespy->camerabuttonheld; - g_Vars.currentplayer->eyespy->camerashuttertime = 0; - g_Vars.currentplayer->eyespy->opendoor = false; - g_Vars.currentplayer->eyespy->velf[0] = 0; - g_Vars.currentplayer->eyespy->velf[1] = 0; - g_Vars.currentplayer->eyespy->vels[0] = 0; - g_Vars.currentplayer->eyespy->vels[1] = 0; - g_Vars.currentplayer->eyespy->pitch = 0; - - playerSetPerimEnabled(g_Vars.currentplayer->prop, false); - - if (insafe || !cdExamLos08(&testfrompos, g_Vars.currentplayer->prop->rooms, - &g_Vars.currentplayer->eyespy->prop->pos, - CDTYPE_ALL, - GEOFLAG_FLOOR1 | GEOFLAG_FLOOR2 | GEOFLAG_WALL | GEOFLAG_BLOCK_SIGHT)) { - // Launch failed due to not enough physical space, or we're in the G5 safe - g_Vars.currentplayer->eyespy->deployed = false; - - chr->prevpos.x = g_Vars.currentplayer->eyespy->prop->pos.x = playerpos.f[0]; - chr->prevpos.y = g_Vars.currentplayer->eyespy->prop->pos.y = g_Vars.currentplayer->eyespy->oldground + g_Vars.currentplayer->eyespy->height; - chr->prevpos.z = g_Vars.currentplayer->eyespy->prop->pos.z = playerpos.f[2]; - - propSetPerimEnabled(g_Vars.currentplayer->eyespy->prop, false); - - // "Not enough room to launch " - sprintf(text, "%s%s", langGet(L_MISC_218), bgunGetName(WEAPON_EYESPY)); - hudmsgCreate(text, HUDMSGTYPE_DEFAULT); - launched = false; - } else { - // Launch successful - g_Vars.currentplayer->eyespy->deployed = true; - - sndStart(var80095200, SFX_DETONATE, 0, -1, -1, -1, -1, -1); - - launched = true; - - chr->chrflags &= ~CHRCFLAG_HIDDEN; - chr->chrflags &= ~CHRCFLAG_INVINCIBLE; - -#if VERSION >= VERSION_NTSC_1_0 - propsnd0f0939f8(NULL, g_Vars.currentplayer->eyespy->prop, SFX_EYESPY_RUNNING, -1, - -1, 2, 0, 0, 0, -1, 0, -1, -1, -1, -1); -#else - propsnd0f0939f8(NULL, g_Vars.currentplayer->eyespy->prop, SFX_EYESPY_RUNNING, -1, - -1, 0, 0, 0, 0, -1, 0, -1, -1, -1, -1); -#endif - } - - playerSetPerimEnabled(g_Vars.currentplayer->prop, true); - propDeregisterRooms(g_Vars.currentplayer->eyespy->prop); - func0f065e74(&g_Vars.currentplayer->prop->pos, g_Vars.currentplayer->prop->rooms, - &g_Vars.currentplayer->eyespy->prop->pos, g_Vars.currentplayer->eyespy->prop->rooms); - - chr0f0220ac(chr); - - return launched; -} - -void eyespyProcessInput(bool allowbuttons) -{ - struct chrdata *chr = g_Vars.currentplayer->eyespy->prop->chr; - f32 spe0 = PAL ? 0.952f : 0.96f; - f32 f; - s32 i; - f32 spd4; - f32 spd0; - f32 spcc; - f32 spc8; - f32 spc4; - s8 contpad1 = optionsGetContpadNum1(g_Vars.currentplayerstats->mpindex); - s8 c1stickx = joyGetStickX(contpad1); - s8 c2stickx; - s8 c1sticky = joyGetStickY(contpad1); - s8 c2sticky; - u16 c1buttons = allowbuttons ? joyGetButtons(contpad1, 0xffff) : 0; - u16 c2buttons; - bool domovecentre = true; - s32 controlmode = optionsGetControlMode(g_Vars.currentplayerstats->mpindex); - - bool aimpressed; - bool shootpressed; - bool exitpressed; - bool activatepressed; - f32 forwardspeed = 0.0f; - f32 pitchspeed = 0.0f; - f32 sidespeed = 0.0f; - f32 angle; - f32 ascendspeed = 0.0f; - f32 prevverta = g_Vars.currentplayer->eyespy->verta; - s16 prevrooms[8]; - s32 contpad2; - u32 stack[5]; - f32 tmp; - - if (controlmode >= CONTROLMODE_21) { - contpad2 = (s8) optionsGetContpadNum2(g_Vars.currentplayerstats->mpindex); - c2stickx = joyGetStickX(contpad2); - c2sticky = joyGetStickY(contpad2); - - c2buttons = allowbuttons ? joyGetButtons(contpad2, 0xffff) : 0; - } else { - c2stickx = c1stickx; - c2sticky = c1sticky; - c2buttons = c1buttons; - } - - if (controlmode == CONTROLMODE_13 || controlmode == CONTROLMODE_14) { - aimpressed = c1buttons & Z_TRIG; - shootpressed = c1buttons & A_BUTTON; - exitpressed = c1buttons & R_TRIG; - activatepressed = c1buttons & B_BUTTON; - } else if (controlmode <= CONTROLMODE_14) { - aimpressed = c1buttons & (0 | R_TRIG); - shootpressed = c1buttons & Z_TRIG; - exitpressed = c1buttons & A_BUTTON; - activatepressed = c1buttons & B_BUTTON; - } else { - if (controlmode >= CONTROLMODE_23) { - aimpressed = c1buttons & Z_TRIG; - shootpressed = c2buttons & Z_TRIG; - } else { - aimpressed = c2buttons & Z_TRIG; - shootpressed = c1buttons & Z_TRIG; - } - - exitpressed = (c1buttons | c2buttons) & A_BUTTON; - activatepressed = (c1buttons | c2buttons) & B_BUTTON; - } - - // Apply safe zone for c1stickx - if (c1stickx > -10 && c1stickx < 10) { - c1stickx = 0; - } - - if (c1stickx <= -10) { - c1stickx += 10; - } - - if (c1stickx >= 10) { - c1stickx -= 10; - } - - // Apply safe zone for c2stickx - if (c2stickx > -10 && c2stickx < 10) { - c2stickx = 0; - } - - if (c2stickx <= -10) { - c2stickx += 10; - } - - if (c2stickx >= 10) { - c2stickx -= 10; - } - - // Apply safe zone for c1sticky - if (c1sticky > -20 && c1sticky < 20) { - c1sticky = 0; - } - - if (c1sticky <= -20) { - c1sticky += 20; - } - - if (c1sticky >= 20) { - c1sticky -= 20; - } - - // Apply safe zone for c2sticky - if (c2sticky > -20 && c2sticky < 20) { - c2sticky = 0; - } - - if (c2sticky <= -20) { - c2sticky += 20; - } - - if (c2sticky >= 20) { - c2sticky -= 20; - } - - c1sticky *= 0.3f; - c2sticky *= 0.3f; - - if (controlmode == CONTROLMODE_11 || controlmode == CONTROLMODE_13) { - if (aimpressed) { - domovecentre = false; - pitchspeed = c1sticky; - } else { - forwardspeed = c1sticky; - } - - ascendspeed = (c1buttons & (U_CBUTTONS | 0) ? 1 : 0) - (c1buttons & (D_CBUTTONS | 0) ? 1 : 0); - sidespeed = (c1buttons & (R_CBUTTONS | 0) ? 1 : 0) - (c1buttons & (L_CBUTTONS | 0) ? 1 : 0); - } else if (controlmode <= CONTROLMODE_14) { - if (aimpressed) { - domovecentre = false; - pitchspeed = c1sticky; - } else { - ascendspeed = c1sticky * 0.25f; - forwardspeed = (c1buttons & (U_CBUTTONS | 0) ? 24.0f : 0) - (c1buttons & (D_CBUTTONS | 0) ? 24.0f : 0); - } - - sidespeed = (c1buttons & (R_CBUTTONS | 0) ? 1 : 0) - (c1buttons & (L_CBUTTONS | 0) ? 1 : 0); - } else if (controlmode == CONTROLMODE_21 || controlmode == CONTROLMODE_23) { - forwardspeed = c1sticky; - - if (aimpressed) { - pitchspeed = c2sticky; - } else { - ascendspeed = c2sticky * 0.25f; - } - - sidespeed = c2stickx * 0.0125f; - } else { - if (aimpressed) { - pitchspeed = c1sticky; - } else { - ascendspeed = c1sticky * 0.25f; - } - - forwardspeed = c2sticky; - sidespeed = c2stickx * 0.0125f; - } - - g_EyespyPickup = false; - -#if VERSION >= VERSION_PAL_BETA - for (f = 1; f < g_Vars.lvupdate60; f++) { - spe0 *= PAL ? 0.952f : 0.96f; - } -#else - for (f = 1; f < g_Vars.lvupdate60freal; f++) { - spe0 *= 0.96f; - } -#endif - - if (g_Vars.currentplayer->eyespy->startuptimer60 < TICKS(50)) { - g_Vars.currentplayer->eyespy->startuptimer60 += g_Vars.lvupdate60; - } else { - g_Vars.currentplayer->eyespy->startuptimer60 = TICKS(50); - } - - chr->prevpos.x = g_Vars.currentplayer->eyespy->prop->pos.x; - chr->prevpos.y = g_Vars.currentplayer->eyespy->prop->pos.y; - chr->prevpos.z = g_Vars.currentplayer->eyespy->prop->pos.z; - - roomsCopy(g_Vars.currentplayer->eyespy->prop->rooms, prevrooms); - - if (!invHasSingleWeaponIncAllGuns(WEAPON_EYESPY)) { - g_Vars.currentplayer->eyespy->deployed = false; - g_Vars.currentplayer->eyespy->held = true; - g_Vars.currentplayer->eyespy->active = false; - - chr->chrflags |= CHRCFLAG_HIDDEN; - - chrClearReferences(g_Vars.currentplayer->eyespy->prop - g_Vars.props); - } - - if (g_Vars.currentplayer->eyespy->active && g_PlayersWithControl[g_Vars.currentplayernum]) { - g_Vars.currentplayer->joybutinhibit = 0xffffffff; - -#if VERSION < VERSION_NTSC_1_0 - if (g_Vars.currentplayer->isdead == false - && g_Vars.currentplayer->pausemode == PAUSEMODE_UNPAUSED - && (c1buttons & START_BUTTON)) { - if (!g_Vars.mplayerisrunning) { - playerPause(MENUROOT_MAINMENU); - } else { - mpPushPauseDialog(); - } - } -#endif - - // Update theta - g_Vars.currentplayer->eyespy->theta += c1stickx * 0.0625f * g_Vars.lvupdate60freal; - - while (g_Vars.currentplayer->eyespy->theta < 0.0f) { - g_Vars.currentplayer->eyespy->theta += 360.0f; - } - - while (g_Vars.currentplayer->eyespy->theta >= 360.0f) { - g_Vars.currentplayer->eyespy->theta -= 360.0f; - } - - g_Vars.currentplayer->eyespy->costheta = cosf(g_Vars.currentplayer->eyespy->theta * 0.017453292384744f); - g_Vars.currentplayer->eyespy->sintheta = sinf(g_Vars.currentplayer->eyespy->theta * 0.017453292384744f); - - // Update verta - g_Vars.currentplayer->eyespy->verta -= pitchspeed * 0.0625f * g_Vars.lvupdate60freal; - - if (prevverta != g_Vars.currentplayer->eyespy->verta) { - while (g_Vars.currentplayer->eyespy->verta < 0.0f) { - g_Vars.currentplayer->eyespy->verta += 360.0f; - } - - while (g_Vars.currentplayer->eyespy->verta >= 360.0f) { - g_Vars.currentplayer->eyespy->verta -= 360.0f; - } - - g_Vars.currentplayer->eyespy->cosverta = cosf(g_Vars.currentplayer->eyespy->verta * 0.017453292384744f); - g_Vars.currentplayer->eyespy->sinverta = sinf(g_Vars.currentplayer->eyespy->verta * 0.017453292384744f); - } - - spc4 = 0.0f; - spc8 = 0.0f; - spcc = 0.0f; - spd0 = 0.0f; - spd4 = 0.0f; - - // Make eyespy look horizontally - if (domovecentre) { - if (g_Vars.currentplayer->eyespy->verta > 0.0f && forwardspeed != 0) { - if (g_Vars.currentplayer->eyespy->verta < 180.0f) { - tmp = g_Vars.currentplayer->eyespy->verta; - - for (i = 0; i < g_Vars.lvupdate60; i++) { - tmp *= 0.04f; - g_Vars.currentplayer->eyespy->verta -= tmp; - } - } else { - tmp = 360.0f - g_Vars.currentplayer->eyespy->verta; - - for (i = 0; i < g_Vars.lvupdate60; i++) { - tmp *= 0.04f; - g_Vars.currentplayer->eyespy->verta += tmp; - } - } - - g_Vars.currentplayer->eyespy->cosverta = cosf(g_Vars.currentplayer->eyespy->verta * 0.017453292384744f); - g_Vars.currentplayer->eyespy->sinverta = sinf(g_Vars.currentplayer->eyespy->verta * 0.017453292384744f); - } - - spcc += forwardspeed * g_Vars.currentplayer->eyespy->sintheta * 0.15f * g_Vars.lvupdate60freal; - spc8 += -forwardspeed * g_Vars.currentplayer->eyespy->costheta * 0.15f * g_Vars.lvupdate60freal; - } - - if (sidespeed != 0) { - spd4 += sidespeed * 5 * g_Vars.currentplayer->eyespy->costheta * 0.15f * g_Vars.lvupdate60freal; - spd0 += sidespeed * 5 * g_Vars.currentplayer->eyespy->sintheta * 0.15f * g_Vars.lvupdate60freal; - } - - if (ascendspeed != 0) { - spc4 += ascendspeed * 3 * 0.15f * g_Vars.lvupdate60freal; - - g_Vars.currentplayer->eyespy->bobdir = (ascendspeed < 0.0f) ? -1 : 1; - g_Vars.currentplayer->eyespy->bobtimer = 0; - g_Vars.currentplayer->eyespy->bobactive = false; - } - - g_Vars.currentplayer->eyespy->velf[0] += spcc; - g_Vars.currentplayer->eyespy->velf[1] += spc8; - g_Vars.currentplayer->eyespy->vels[0] += spd4; - g_Vars.currentplayer->eyespy->vels[1] += spd0; - - spcc = g_Vars.currentplayer->eyespy->velf[0] * g_Vars.currentplayer->eyespy->velf[0] - + g_Vars.currentplayer->eyespy->velf[1] * g_Vars.currentplayer->eyespy->velf[1]; - - if (spcc > 90.25f * g_Vars.lvupdate60freal * g_Vars.lvupdate60freal) { - spcc = 9.5f * g_Vars.lvupdate60freal / sqrtf(spcc); - - g_Vars.currentplayer->eyespy->velf[0] *= spcc; - g_Vars.currentplayer->eyespy->velf[1] *= spcc; - } - - spd4 = g_Vars.currentplayer->eyespy->vels[0] * g_Vars.currentplayer->eyespy->vels[0] - + g_Vars.currentplayer->eyespy->vels[1] * g_Vars.currentplayer->eyespy->vels[1]; - - if (spd4 > 225.0f * g_Vars.lvupdate60freal * g_Vars.lvupdate60freal) { - spd4 = 15.0f * g_Vars.lvupdate60freal / sqrtf(spd4); - - g_Vars.currentplayer->eyespy->vels[0] *= spd4; - g_Vars.currentplayer->eyespy->vels[1] *= spd4; - } - - g_Vars.currentplayer->eyespy->vel.y += spc4; - - if (g_Vars.currentplayer->eyespy->vel.y < -(5 * g_Vars.lvupdate60freal)) { - g_Vars.currentplayer->eyespy->vel.y = -(5 * g_Vars.lvupdate60freal); - } - - if (g_Vars.currentplayer->eyespy->vel.y > 5 * g_Vars.lvupdate60freal) { - g_Vars.currentplayer->eyespy->vel.y = 5 * g_Vars.lvupdate60freal; - } - } else { - g_Vars.currentplayer->eyespy->bobactive = true; - } - - // Update bob - if (spc4 == 0.0f) { - if (g_Vars.currentplayer->eyespy->bobactive || ABS(g_Vars.currentplayer->eyespy->vel.y) < 0.1f) { - g_Vars.currentplayer->eyespy->bobactive = true; - g_Vars.currentplayer->eyespy->bobtimer += g_Vars.lvupdate60; - g_Vars.currentplayer->eyespy->vel.y += 0.025f * g_Vars.currentplayer->eyespy->bobdir; - - if (g_Vars.currentplayer->eyespy->bobtimer > TICKS(120)) { - g_Vars.currentplayer->eyespy->bobtimer = 0; - g_Vars.currentplayer->eyespy->bobdir = -g_Vars.currentplayer->eyespy->bobdir; - } - } - } - - g_Vars.currentplayer->eyespy->vel.y *= spe0; - - g_Vars.currentplayer->eyespy->vels[0] *= spe0; - g_Vars.currentplayer->eyespy->vels[1] *= spe0; - g_Vars.currentplayer->eyespy->velf[0] *= spe0; - g_Vars.currentplayer->eyespy->velf[1] *= spe0; - - g_Vars.currentplayer->eyespy->vel.x = g_Vars.currentplayer->eyespy->vels[0] + g_Vars.currentplayer->eyespy->velf[0]; - g_Vars.currentplayer->eyespy->vel.z = g_Vars.currentplayer->eyespy->vels[1] + g_Vars.currentplayer->eyespy->velf[1]; - - g_Vars.currentplayer->eyespy->look.y = g_Vars.currentplayer->eyespy->sinverta; - g_Vars.currentplayer->eyespy->look.x = g_Vars.currentplayer->eyespy->cosverta * g_Vars.currentplayer->eyespy->sintheta; - g_Vars.currentplayer->eyespy->look.z = -g_Vars.currentplayer->eyespy->cosverta * g_Vars.currentplayer->eyespy->costheta; - - g_Vars.currentplayer->eyespy->up.y = g_Vars.currentplayer->eyespy->cosverta; - g_Vars.currentplayer->eyespy->up.x = -g_Vars.currentplayer->eyespy->sinverta * g_Vars.currentplayer->eyespy->sintheta; - g_Vars.currentplayer->eyespy->up.z = g_Vars.currentplayer->eyespy->sinverta * g_Vars.currentplayer->eyespy->costheta; - - g_EyespyPrevHit = g_EyespyHit; - g_EyespyHit = EYESPYHIT_NONE; - var80070ecc = 0; - - eyespyUpdateVertical(); - - // Consider playing the tap sound when the eyespy is driven into a wall or object - if (g_Vars.currentplayer->eyespy->active - && g_EyespyHit != g_EyespyPrevHit - && g_EyespyHit > 0 - && chr->soundtimer > TICKS(10)) { - chr->soundtimer = 0; - - switch (g_EyespyHit) { - case EYESPYHIT_BG: - snd00010718(NULL, 0, 16000, 0x40, SFX_EYESPYHIT, 1, 1, -1, 1); - break; - case EYESPYHIT_OBJ: - snd00010718(NULL, 0, 16000, 0x40, SFX_EYESPYHIT, 1, 1, -1, 1); - break; - case EYESPYHIT_DOOR: - snd00010718(NULL, 0, 16000, 0x40, SFX_EYESPYHIT, 1, 1, -1, 1); - break; - case EYESPYHIT_CHR: - snd00010718(NULL, 0, 16000, 0x40, SFX_EYESPYHIT, 1, 1, -1, 1); - break; - case EYESPYHIT_DAMAGE: - sndStart(var80095200, SFX_PICKUP_LASER, NULL, -1, -1, -1, -1, -1); - break; - default: - break; - } - } - - // Apply speed and angle - if (g_Vars.currentplayer->eyespy->speed > 1600.0f) { - g_Vars.currentplayer->eyespy->speed = 1600.0f; - } - - tmp = g_Vars.currentplayer->eyespy->speed / 1600.0f; - func0f093790(g_Vars.currentplayer->eyespy->prop, tmp * 400.0f); - - angle = 180 - g_Vars.currentplayer->eyespy->theta; - - if (angle < 0) { - angle += 360.0f; - } - - angle = angle / 360.0f * M_BADTAU; - - chrSetLookAngle(chr, angle); - - if (g_Vars.currentplayer->eyespy->startuptimer60 < TICKS(50)) { - return; - } - - // Handle trigger - if (g_Vars.currentplayer->eyespy->camerashuttertime <= 0 && shootpressed && g_Vars.currentplayer->eyespy->active) { - if (g_Vars.currentplayer->eyespy->camerabuttonheld == false) { - g_Vars.currentplayer->eyespy->camerabuttonheld = true; - g_Vars.currentplayer->eyespy->camerashuttertime = TICKS(24); - } - } else { - g_Vars.currentplayer->eyespy->camerabuttonheld = false; - } - - // Handle exit - if (exitpressed && g_Vars.currentplayer->eyespy->active) { - g_Vars.currentplayer->eyespy->active = false; - g_Vars.currentplayer->devicesactive &= ~DEVICE_EYESPY; - } - - // Handle B button activation - if (activatepressed && g_Vars.currentplayer->eyespy->active) { - if (g_Vars.currentplayer->eyespy->buttonheld == false) { - g_Vars.currentplayer->eyespy->buttonheld = true; - g_Vars.currentplayer->eyespy->opendoor = true; - } else { - g_Vars.currentplayer->eyespy->opendoor = false; - } - } else { - g_Vars.currentplayer->eyespy->opendoor = false; - g_Vars.currentplayer->eyespy->buttonheld = false; - } - - g_Vars.currentplayer->eyespy->hit = g_EyespyHit; - - // Check if the eyespy is inactive and coasting into the player's pickup range - if (g_Vars.currentplayer->eyespy->active == false && !g_EyespyPickup) { - s32 cdresult; - - f32 xdiff = g_Vars.currentplayer->eyespy->prop->pos.x - g_Vars.currentplayer->prop->pos.x; - f32 zdiff = g_Vars.currentplayer->eyespy->prop->pos.z - g_Vars.currentplayer->prop->pos.z; - - g_EyespyPickup = true; - - if (xdiff * xdiff + zdiff * zdiff > 100 * 100) { - g_EyespyPickup = false; - } - - cdresult = cdTestLos05(&g_Vars.currentplayer->prop->pos, g_Vars.currentplayer->prop->rooms, - &g_Vars.currentplayer->eyespy->prop->pos, g_Vars.currentplayer->eyespy->prop->rooms, - CDTYPE_DOORS | CDTYPE_BG, - GEOFLAG_WALL | GEOFLAG_BLOCK_SIGHT | GEOFLAG_BLOCK_SHOOT); - - if (cdresult == CDRESULT_COLLISION) { - // Something's in the way - g_EyespyPickup = false; - } - } - - // Sanity check - can't pick up the eyespy while it's active - if (g_Vars.currentplayer->eyespy->active) { - g_EyespyPickup = false; - } - - // Handle pickup - if (g_EyespyPickup) { - g_Vars.currentplayer->eyespy->deployed = false; - g_Vars.currentplayer->eyespy->held = true; - g_Vars.currentplayer->eyespy->active = false; - - chr->chrflags |= CHRCFLAG_HIDDEN; - chr->chrflags |= CHRCFLAG_INVINCIBLE; - - weaponPlayPickupSound(WEAPON_EYESPY); - currentPlayerQueuePickupWeaponHudmsg(WEAPON_EYESPY, false); - func0f0926bc(g_Vars.currentplayer->eyespy->prop, 1, 0xffff); - chrClearReferences(g_Vars.currentplayer->eyespy->prop - g_Vars.props); - } - - coordTriggerProxies(&chr->prop->pos, true); -} diff --git a/src/game/bondgun.c b/src/game/bondgun.c index afbbdb155..ddfa473fb 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -1554,12 +1554,6 @@ s32 bgunTickIncReload(struct handweaponinfo *info, s32 handnum, struct hand *han if (hand->triggeron) { hand->unk0cc8_03 = false; } - -#if VERSION >= VERSION_JPN_FINAL - if (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_EYESPY) { - hand->unk0cc8_03 = false; - } -#endif } else { if ((hand->stateflags & HANDSTATEFLAG_00000010) == 0) { if (bgun0f098a44(hand, 1)) { @@ -4178,14 +4172,6 @@ void bgunTickLoad(void) bool bgun0f09eae4(void) { - // PAL adds a check for the eyespy being used -#if VERSION >= VERSION_PAL_BETA - if ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_EYESPY)) { - g_Vars.currentplayer->gunctrl.unk1583_06 = false; - return false; - } -#endif - bgun0f09df9c(); if (g_Vars.currentplayer->gunctrl.weaponnum != WEAPON_NONE) { @@ -8073,12 +8059,6 @@ void bgunTickGameplay2(void) bgunTickLoad(); } - // Return control to Jo if eyespy has been deselected - if ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_EYESPY) == 0 - && player->eyespy) { - player->eyespy->active = false; - } - 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) diff --git a/src/game/bondgunreset.c b/src/game/bondgunreset.c index 5e03d0a37..d29e3e4d4 100644 --- a/src/game/bondgunreset.c +++ b/src/game/bondgunreset.c @@ -243,24 +243,5 @@ void bgunReset(void) g_Vars.currentplayer->gunzoomfovs[1] = 60; g_Vars.currentplayer->gunzoomfovs[2] = 30; - if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_AIRBASE) { - g_Weapons[WEAPON_EYESPY]->name = L_GUN_061; // "DrugSpy" - g_Weapons[WEAPON_EYESPY]->shortname = L_GUN_061; // "DrugSpy" - g_Weapons[WEAPON_EYESPY]->flags &= ~(WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN); - } else if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_CHICAGO - || (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_MBR)) { - g_Weapons[WEAPON_EYESPY]->name = L_GUN_062; // "BombSpy" - g_Weapons[WEAPON_EYESPY]->shortname = L_GUN_062; // "BombSpy" - g_Weapons[WEAPON_EYESPY]->flags &= ~(WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN); - } else { - // This is setting the "an" determiner for the camspy which seems - // unusual at first. The theory is that during development it was called - // the eyespy, then the pickup message was changed to "your camspy" - // which made the determiner unused, hence no need to update it. - g_Weapons[WEAPON_EYESPY]->name = L_GUN_060; // "CamSpy" - g_Weapons[WEAPON_EYESPY]->shortname = L_GUN_060; // "CamSpy" - g_Weapons[WEAPON_EYESPY]->flags |= (WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN); - } - bgunInitHandAnims(); } diff --git a/src/game/bondview.c b/src/game/bondview.c index 974cffcba..c372a6095 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -475,1461 +475,6 @@ f32 bview0f142d74(s32 arg0, f32 arg1, f32 arg2, f32 arg3) return result; } -/** - * Draw the fisheye curved effect when using an eyespy. - * - * PAL Beta adds padding above and below to compensate for the higher vertical - * screen resolution, by adjusting the viewtop and viewheight variables and - * drawing black filler at the end of the function. However the size of these - * bars is static regardless of the screen layout and size being used. - * - * PAL Final improves on beta's mistake by checking the screen size, but there's - * no check for a vertical split being used, and as a result the fisheye radius - * is smaller than it should be when using a horizontal split. @bug - */ -Gfx *bviewDrawFisheye(Gfx *gdl, u32 colour, u32 alpha, s32 shuttertime60, s8 startuptimer60, u8 hit) -{ - u16 *fb = viGetBackBuffer(); - s32 viewtop; - s32 viewheight; - f32 f26; - f32 halfheight; - f32 sqhalfheight; - s32 viewwidth; - s32 viewleft; - s32 s2; - s32 i; - s32 s3; - u8 starting; - s32 curradius; - f32 startupfrac; - f32 fullradius; - s32 one = 1; - s32 spec; - u8 alpha2; - -#if VERSION >= VERSION_PAL_FINAL && PAL - s32 vpadding; -#endif - - f32 tmp; - -#if VERSION >= VERSION_PAL_FINAL - viewtop = viGetViewTop(); - viewheight = viGetViewHeight(); - viewwidth = viGetViewWidth(); - viewleft = viGetViewLeft(); - - startupfrac = 1.0f; - s2 = 0; - -#if PAL - if (PLAYERCOUNT() >= 2 - || optionsGetEffectiveScreenSize() == SCREENSIZE_WIDE - || optionsGetEffectiveScreenSize() == SCREENSIZE_CINEMA) { - vpadding = 16; - viewtop += vpadding; - viewheight -= vpadding * 2; - } else { - vpadding = 23; - viewtop += vpadding; - viewheight -= vpadding * 2; - } -#endif - - halfheight = viewheight * 0.5f; - sqhalfheight = halfheight * halfheight; - f26 = -(halfheight + halfheight) / viewheight; -#elif VERSION >= VERSION_PAL_BETA - viewtop = viGetViewTop() + 16; - viewheight = viGetViewHeight() - 32; - halfheight = viewheight * 0.5f; - sqhalfheight = halfheight * halfheight; - f26 = -(halfheight + halfheight) / viewheight; - viewwidth = viGetViewWidth(); - viewleft = viGetViewLeft(); - startupfrac = 1.0f; - s2 = 0; -#else - viewtop = viGetViewTop(); - viewheight = viGetViewHeight(); - halfheight = viewheight * 0.5f; - sqhalfheight = halfheight * halfheight; - f26 = -(halfheight + halfheight) / viewheight; - viewwidth = viGetViewWidth(); - viewleft = viGetViewLeft(); - startupfrac = 1.0f; - s2 = 0; -#endif - - starting = (startuptimer60 < TICKS(50)); - - var8007f840++; - - if (var8007f840 >= 2) { - return gdl; - } - - strcpy(var800a41c0, "blurGfxFisheye"); - - s3 = 1; - - if (starting) { - fullradius = viewheight * 0.5f; - startupfrac = startuptimer60 / (PAL ? 41.0f : 50.0f); - curradius = fullradius * startupfrac; - spec = startupfrac * 255.0f; - - if (spec > 255) { - spec = 255; - } - } - - gDPPipeSync(gdl++); - - gdl = bviewPrepareStaticRgba16(gdl, colour, alpha); - - if (starting) { - for (i = viewtop; i < viewtop + viewheight; i++) { - if (i % 2) { - if (i > viewtop + fullradius - curradius && i < viewtop + fullradius + curradius) { - gDPSetEnvColorViaWord(gdl++, (colour & 0xffffff00) | (spec & 0xff)); - - tmp = bview0f142d74(s2, f26, halfheight, sqhalfheight) * startupfrac; - gdl = bviewCopyPixels(gdl, fb, i, 5, i, tmp, viewleft, viewwidth); - } - } - - s2 += s3; - - if (s2 >= viewheight * 0.5f) { - s2 = viewheight * 0.5f; - s3 = -s3; - } - } - } else { - f32 f22 = 1.0f; - - for (i = viewtop; i < viewtop + viewheight; i++) { - if (hit == EYESPYHIT_DAMAGE) { - alpha2 = (random() % 120) + 120; - colour = 0xff333300 | (alpha2 & 0xff); - f22 = ((random() % 32) + 220.0f) * (1.0f / 256.0f); - - gDPSetEnvColorViaWord(gdl++, colour); - } else { - gDPSetEnvColorViaWord(gdl++, 0xffffffff); - } - - tmp = bview0f142d74(s2, f26, halfheight, sqhalfheight) * f22; - gdl = bviewCopyPixels(gdl, fb, i, 5, i, tmp, viewleft, viewwidth); - - if (hit == EYESPYHIT_DAMAGE) { - gDPSetEnvColorViaWord(gdl++, 0xddaaaa99); - - tmp = bview0f142d74(s2, f26, halfheight, sqhalfheight) * 1.03f; - gdl = bviewCopyPixels(gdl, fb, i, 5, i, tmp, viewleft, viewwidth); - } - - s2 += s3; - - if ((i % 2) == 0) { - gDPSetEnvColorViaWord(gdl++, 0x00000055); - gDPFillRectangle(gdl++, viewleft, i, viewleft + viewwidth, i + 1); - } - - if (s2 >= viewheight * 0.5f) { - s2 = viewheight * 0.5f; - s3 = -s3; - } - } - } - - gDPPipeSync(gdl++); - gDPSetCycleType(gdl++, G_CYC_1CYCLE); - gDPSetRenderMode(gdl++, G_RM_XLU_SURF, G_RM_XLU_SURF2); - gDPSetCombineMode(gdl++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); - gDPSetPrimColor(gdl++, 0, 0, 0x00, 0x00, 0x00, 0xff); - - s3 = 1; - - if (shuttertime60 != 0 || starting) { - s32 s7; - s32 spa8 = viewheight * 0.5f; - f32 f20; - - if (!starting) { - shuttertime60 -= TICKS(12); - - if (shuttertime60 < 0) { - shuttertime60 = -shuttertime60; - } - - s7 = spa8 * (shuttertime60 / TICKS(12.0f)); - } else { - s7 = curradius; - } - - for (i = viewtop; i < viewtop + spa8 - s7; i++) { - gdl = bviewDrawFisheyeRect(gdl, i, 0.0f, viewleft, viewwidth); - gdl = bviewDrawFisheyeRect(gdl, viewtop + viewtop + viewheight - i, 0.0f, viewleft, viewwidth); - } - - gDPSetPrimColorViaWord(gdl++, 0, 0, 0x000000ff); - - tmp = (f32) one * halfheight; - f20 = halfheight; - - for (i = viewtop + spa8 - s7; i <= viewtop + spa8; i++) { - f32 f2; - - if (sqhalfheight > f20 * f20) { - f2 = sqrtf(sqhalfheight - f20 * f20) * (1.0f / 160.0f); - } else { - f2 = 0.01f; - } - - f20 += -tmp / s7; - - gdl = bviewDrawFisheyeRect(gdl, i, f2 * startupfrac, viewleft, viewwidth); - - if (i != viewtop + viewtop + viewheight - i) { - gdl = bviewDrawFisheyeRect(gdl, viewtop + viewtop + viewheight - i, f2 * startupfrac, viewleft, viewwidth); - } - } - } else { - s2 = 0; - - for (i = viewtop; i < viewtop + viewheight; i++) { - tmp = bview0f142d74(s2, f26, halfheight, sqhalfheight); - gdl = bviewDrawFisheyeRect(gdl, i, tmp, viewleft, viewwidth); - - s2 += s3; - - if (s2 >= viewheight * 0.5f) { - s2 = viewheight * 0.5f; - s3 = -s3; - } - } - } - -#if PAL - s3 = viGetViewTop(); -#if VERSION >= VERSION_PAL_FINAL - s2 = s3 + viGetViewHeight() - vpadding; -#else - s2 = s3 + viGetViewHeight() - 16; -#endif - -#if VERSION >= VERSION_PAL_FINAL - for (i = 0; i < vpadding; i++) -#else - for (i = 0; i < 16; i++) -#endif - { - gDPFillRectangle(gdl++, viewleft, s3 , viewleft + viewwidth, s3 + 1); - gDPFillRectangle(gdl++, viewleft, s2, viewleft + viewwidth, s2 + 1); - - s3++; - s2++; - } -#endif - - return gdl; -} - -/** - * Draw a black rectangle to the side of the circular fisheye lens. - * - * These are each 1px high, and go from the edge of the circle to the edge of - * the screen. There is one drawn on every row on both sides. - */ -Gfx *bviewDrawEyespySideRect(Gfx *gdl, s32 *points, u8 r, u8 g, u8 b, u8 alpha) -{ - struct gfxvtx *vertices = gfxAllocateVertices(4); - u32 *colours = gfxAllocateColours(2); - - vertices[0].x = points[0] * 10.0f; - vertices[0].y = points[1] * 10.0f; - vertices[0].z = -10; - - vertices[1].x = points[2] * 10.0f; - vertices[1].y = points[3] * 10.0f; - vertices[1].z = -10; - - vertices[2].x = points[4] * 10.0f; - vertices[2].y = points[5] * 10.0f; - vertices[2].z = -10; - - vertices[3].x = points[6] * 10.0f; - vertices[3].y = points[7] * 10.0f; - vertices[3].z = -10; - - colours[0] = r << 0x18 | g << 0x10 | b << 8 | 0xff; - colours[1] = r << 0x18 | g << 0x10 | b << 8 | alpha; - - vertices[0].colour = 0; - vertices[1].colour = 0; - vertices[2].colour = 4; - vertices[3].colour = 4; - - gDPSetColorArray(gdl++, colours, 2); - gDPSetVerticeArray(gdl++, vertices, 4); - - if (colours); - - gDPTri2(gdl++, 0, 1, 2, 0, 2, 3); - - return gdl; -} - -/** - * Renders the eyespy user interface, excluding the fisheye lens. The lens is - * drawn first by another function, then this one is called to draw the outer - * information. Care must be taken not to draw over the top of the fisheye lens. - * - * Note that the dimensions of the view can differ based on hi-res on/off, as - * well as using coop mode in both the vertical and horizontal screen splits. - * Some elements are omitted if a vertical split is being used, and to handle - * hi-res a scale variable is used to multiply X values and widths where needed. - * - * @bug: Many of the X values and widths are not multiplied by the scale which - * causes them to display incorrectly when using hi-res: - * - Some of the horizontal lines don't touch the lens circle. - * - The vertical lines are thinner and closer to the screen edges than intended. - * - The speed and height bars are stretched. - * - The device name and model are closer to the screen edge than intended. - */ -Gfx *bviewDrawEyespyMetrics(Gfx *gdl) -{ - char text[256]; - s32 viewleft = viGetViewLeft(); -#if VERSION >= VERSION_PAL_FINAL - s32 viewwidth = viGetViewWidth(); - s32 viewtop = viGetViewTop(); - s32 viewheight = viGetViewHeight(); -#elif VERSION >= VERSION_PAL_BETA - s32 viewwidth = viGetViewWidth(); - s32 viewtop = viGetViewTop() + 16; - s32 viewheight = viGetViewHeight() - 32; -#else - s32 viewtop = viGetViewTop(); - s32 viewwidth = viGetViewWidth(); - s32 viewheight = viGetViewHeight(); -#endif - s32 viewright = viewleft + viewwidth - 1; - s32 viewbottom = viewtop + viewheight - 1; - s32 x; - s32 y; - s32 textwidth; - s32 textheight; - s32 x2; - s32 y2; - struct chrdata *chr; - s32 savedy; - s32 movex; - s32 movey; - s32 movez; - f32 movedist; - f32 sqmovedist = 0.0f; - u32 colourtextbright; - u32 colourtextdull; - u32 colourglow; -#if PAL - s32 scale = 1; - f32 palscale = viewwidth > 320 ? 1.4f : 1.0f; -#else - s32 scale = viewwidth > 320 ? 2 : 1; -#endif -#if VERSION >= VERSION_NTSC_1_0 - bool vsplit = false; -#endif - -#if VERSION >= VERSION_PAL_FINAL -#if PAL - if (PLAYERCOUNT() >= 2 - || optionsGetEffectiveScreenSize() == SCREENSIZE_WIDE - || optionsGetEffectiveScreenSize() == SCREENSIZE_CINEMA) { - viewtop += 16; - viewheight -= 32; - } else { - viewtop += 23; - viewheight -= 46; - } -#endif - viewbottom = viewtop + viewheight - 1; -#endif - - if (g_Vars.currentplayer->eyespy == NULL - || g_Vars.currentplayer->eyespy->prop == NULL - || g_Vars.currentplayer->eyespy->prop->chr == NULL) { - return gdl; - } - - chr = g_Vars.currentplayer->eyespy->prop->chr; - -#if VERSION >= VERSION_NTSC_1_0 - if (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL && PLAYERCOUNT() >= 2) { - vsplit = true; - } -#endif - -#if VERSION >= VERSION_NTSC_1_0 - movex = chr->prop->pos.x - chr->prevpos.x; - movey = chr->prop->pos.y - chr->prevpos.y; - movez = chr->prop->pos.z - chr->prevpos.z; - - if (movex != 0.0f || movey != 0.0f || movez != 0.0f) { - sqmovedist = movex * movex + movey * movey + movez * movez; - } - - if (sqmovedist > 0.001f) { - movedist = sqrtf(sqmovedist); - } else { - movedist = 0.0f; - } -#else - if (g_Vars.coopplayernum < 0 && g_Vars.antiplayernum < 0) { - movex = chr->prop->pos.x - chr->prevpos.x; - movey = chr->prop->pos.y - chr->prevpos.y; - movez = chr->prop->pos.z - chr->prevpos.z; - - if (movex != 0.0f || movey != 0.0f || movez != 0.0f) { - sqmovedist = movex * movex + movey * movey + movez * movez; - } - - if (sqmovedist > 0.001f) { - movedist = sqrtf(sqmovedist); - } else { - movedist = 0.0f; - } - } else { - movedist = 0.0f; - } -#endif - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - gdl = textSetPrimColour(gdl, 0x00ff0028); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - gdl = textSetPrimColour(gdl, 0x2244ffa0); - } else { - gdl = textSetPrimColour(gdl, 0xff3300a0); - } - -#if VERSION >= VERSION_NTSC_1_0 - if (!vsplit) -#endif - { - // Render borders/lines in background - gDPFillRectangle(gdl++, viewleft + 25, viewtop + 55, viewleft + 26, viewbottom - 24); - gDPFillRectangle(gdl++, viewleft + 31, viewtop + 55, viewleft + 32, viewbottom - 42); - gDPFillRectangle(gdl++, viewleft + 25, viewbottom - 25, viewleft + 25 + viewwidth / 5.0f + 1, viewbottom - 24); - gDPFillRectangle(gdl++, viewleft + 31, viewbottom - 43, viewleft + 25 + viewwidth / 7.0f + 1, viewbottom - 42); - gDPFillRectangle(gdl++, viewright - 25, viewtop + 25, viewright - 24, viewbottom - 54); - gDPFillRectangle(gdl++, viewright - 31, viewtop + 43, viewright - 30, viewbottom - 54); - gDPFillRectangle(gdl++, viewright - 25 - viewwidth / 5.0f, viewtop + 25, viewright - 24, viewtop + 26); - gDPFillRectangle(gdl++, viewright - 25 - viewwidth / 7.0f, viewtop + 43, viewright - 30, viewtop + 44); - gDPFillRectangle(gdl++, viewleft, viewtop + 55, viewleft + viewwidth / 5.0f + 1, viewtop + 56); - gDPFillRectangle(gdl++, viewright - viewwidth / 5.0f, viewbottom - 55, viewright + 1, viewbottom - 54); - } - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - // Render crosshair - s32 x = viewleft + (viewwidth >> 1); - s32 y = viewtop + (viewheight >> 1); - - gDPFillRectangle(gdl++, x + 2, y + 0, x + 7, y + 1); - gDPFillRectangle(gdl++, x + 2, y + 0, x + 5, y + 1); - gDPFillRectangle(gdl++, x - 6, y + 0, x - 1, y + 1); - gDPFillRectangle(gdl++, x - 4, y + 0, x - 1, y + 1); - gDPFillRectangle(gdl++, x + 0, y + 2, x + 1, y + 7); - gDPFillRectangle(gdl++, x + 0, y + 2, x + 1, y + 5); - gDPFillRectangle(gdl++, x + 0, y - 6, x + 1, y - 1); - gDPFillRectangle(gdl++, x + 0, y - 4, x + 1, y - 1); - } - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - colourtextbright = 0x00ff00a0; - colourtextdull = 0x005000ff; - colourglow = 0x000f00ff; - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - colourtextbright = 0x2244ffff; - colourtextdull = 0x2244ffff; - colourglow = 0x00000fff; - } else { - colourtextbright = 0xff3300ff; - colourtextdull = 0xff3300ff; - colourglow = 0x0f0000ff; - } - - // "S/MPS" - sprintf(text, "%s %s%5.2f", langGet(L_MISC_073), "", movedist * 0.6f); - savedy = viewtop + 14; - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); - x = viewleft + 25 * scale; - y = savedy; - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); - -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextbright, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextbright, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - - // "H/M" - sprintf(text, "%s %s%4.2f", langGet(L_MISC_074), "", g_Vars.currentplayer->eyespy->height * 0.01f); - savedy += 9; - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); - x = viewleft + 25 * scale; - y = savedy; - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextbright, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextbright, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - - // "Y/D" - sprintf(text, "%s %d", langGet(L_MISC_075), (s32)g_Vars.currentplayer->eyespy->theta); - savedy += 9; - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); - x = viewleft + 25 * scale; - y = savedy; - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextbright, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextbright, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - - // "P/D" - sprintf(text, "%s %d", langGet(L_MISC_076), (s32)g_Vars.currentplayer->eyespy->verta); - savedy += 9; - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); - x = viewleft + 25 * scale; - y = savedy; - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextbright, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextbright, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - - // "CI 2023" - sprintf(text, "%s", langGet(L_MISC_077)); - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); - -#if VERSION >= VERSION_NTSC_1_0 - x = (vsplit ? -3 : 0) + viewleft + 25 * scale + 5; - y = (vsplit ? 18 : 0) + viewbottom - 41; -#else - x = viewleft + 25 * scale + 5; - y = viewbottom - 41; -#endif - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - sprintf(text, "%s", langGet(L_MISC_078)); // "YKK: 95935" - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - sprintf(text, "%s", langGet(L_MISC_208)); // "JM: 201172" - } else { - sprintf(text, "%s", langGet(L_MISC_217)); // "BNC: 15877" - } - - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); - -#if VERSION >= VERSION_NTSC_1_0 - x = viewleft + 25 * scale + (vsplit ? -3 : 0) + 5; - y = viewbottom + (vsplit ? 20 : 0) - 34; -#else - x = viewleft + 25 * scale + 5; - y = viewbottom - 34; -#endif - - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - // "CAMSPY" - sprintf(text, " %s", langGet(L_MISC_079)); - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); - -#if VERSION >= VERSION_PAL_FINAL - x = viewright - textwidth - 27; -#else - x = viewright - scale * 53 - 25; -#endif -#if VERSION >= VERSION_NTSC_1_0 - y = (vsplit ? -13 : 0) + viewtop + 27; -#else - y = viewtop + 27; -#endif - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - // "DRUGSPY" - sprintf(text, " %s", langGet(L_MISC_468)); - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); - -#if VERSION >= VERSION_PAL_FINAL - x = viewright - textwidth - 27; -#else - x = viewright - scale * 53 - 25; -#endif -#if VERSION >= VERSION_NTSC_1_0 - y = (vsplit ? -13 : 0) + viewtop + 27; -#else - y = viewtop + 27; -#endif - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - } else { - // "BOMBSPY" - sprintf(text, " %s", langGet(L_MISC_469)); - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); - -#if VERSION >= VERSION_PAL_FINAL - x = viewright - textwidth - 27; -#else - x = viewright - scale * 59 - 25; -#endif -#if VERSION >= VERSION_NTSC_1_0 - y = (vsplit ? -13 : 0) + viewtop + 27; -#else - y = viewtop + 27; -#endif - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - } - - // Model number - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - sprintf(text, "%s", langGet(L_MISC_080)); // "MODEL 1.2" - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - sprintf(text, "%s", langGet(L_MISC_207)); // "MODEL 1.4" - } else { - sprintf(text, "%s", langGet(L_MISC_216)); // "MODEL 1.3" - } - - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); -#if VERSION >= VERSION_PAL_FINAL - x = (vsplit ? 3 : 0) + viewright - textwidth - 27; - y = (vsplit ? -11 : 0) + viewtop + 34; -#elif VERSION >= VERSION_NTSC_1_0 - x = (vsplit ? 3 : 0) + viewright - scale * 46 - 25; - y = (vsplit ? -11 : 0) + viewtop + 34; -#else - x = viewright - scale * 46 - 25; - y = viewtop + 34; -#endif - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - - // Gyrostat/dartammo text - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY - || g_Vars.currentplayer->eyespy->mode == EYESPYMODE_BOMBSPY) { - sprintf(text, "%s", langGet(L_MISC_081)); // "GYROSTAT" - } else { - sprintf(text, "%s", langGet(L_MISC_206)); // "DARTAMMO" - } - - textMeasure(&textheight, &textwidth, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); -#if VERSION >= VERSION_PAL_FINAL - x = viewright - textwidth - 27; - y = (vsplit ? -2 : 0) + viewbottom - 12; -#elif VERSION >= VERSION_NTSC_1_0 - x = (vsplit ? -35 : 0) + (viewright - viewwidth / 5.0f - 3 - (scale * 5 - 5)); - y = (vsplit ? -2 : 0) + viewbottom - 12; -#else - x = viewright - viewwidth / 5.0f - 3 - (scale * 5 - 5); - y = viewbottom - 12; -#endif - if (1); - x2 = x + textwidth; \ - y2 = y + textheight; \ - gdl = text0f153858(gdl, &x, &y, &x2, &y2); -#if VERSION >= VERSION_JPN_FINAL - gdl = func0f1574d0jf(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#else - gdl = textRender(gdl, &x, &y, text, g_CharsHandelGothicXs, g_FontHandelGothicXs, - colourtextdull, colourglow, viGetWidth(), viGetHeight(), 0, 0); -#endif - - gdl = text0f153838(gdl); - - { - s8 contpadnum = optionsGetContpadNum1(g_Vars.currentplayerstats->mpindex); - u16 buttonsdown = joyGetButtons(contpadnum, 0xffff); \ - u16 buttonsthisframe = joyGetButtonsPressedThisFrame(contpadnum, 0xffff); - s8 cstickx = joyGetStickX(contpadnum); \ - s8 csticky = joyGetStickY(contpadnum); - s32 xpos; - s32 tmpval; - u8 brightness; - u8 brightness2; - s32 points[8]; - s32 r; - s32 g; - s32 b; - - gDPPipeSync(gdl++); \ - gDPSetCycleType(gdl++, G_CYC_1CYCLE); \ - gDPSetColorDither(gdl++, G_CD_DISABLE); \ - gDPSetTexturePersp(gdl++, G_TP_NONE); \ - gDPSetAlphaCompare(gdl++, G_AC_NONE); \ - gDPSetTextureLOD(gdl++, G_TL_TILE); \ - gDPSetTextureFilter(gdl++, G_TF_BILERP); \ - gDPSetTextureConvert(gdl++, G_TC_FILT); \ - gDPSetTextureLUT(gdl++, G_TT_NONE); \ - gDPSetRenderMode(gdl++, G_RM_CLD_SURF, G_RM_CLD_SURF2); \ - gDPSetCombineMode(gdl++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); - -#if VERSION >= VERSION_NTSC_1_0 - if (!vsplit) -#endif - { - xpos = (scale == 2) ? -76 : -85; - - // Up - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - brightness = 20; \ - if (buttonsdown & (0 | U_CBUTTONS)) { \ - brightness += 20; \ - } \ - if (buttonsthisframe & (0 | U_CBUTTONS)) { \ - brightness += 20; \ - } \ - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); \ - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - brightness = 127; - - if (buttonsdown & (0 | U_CBUTTONS)) { - brightness += 63; - } - - if (buttonsthisframe & (0 | U_CBUTTONS)) { - brightness += 63; \ - } \ - gDPSetPrimColor(gdl++, 0, 0, 0x10, 0x20, brightness, 0xff); - } else { - brightness = 20; - - if (buttonsdown & (0 | U_CBUTTONS)) { - brightness += 20; - } - - if (buttonsthisframe & (0 | U_CBUTTONS)) { - brightness += 20; \ - } \ - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - } - - gDPFillRectangle(gdl++, xpos * scale + viewright, viewtop + 10, (xpos + 8) * scale + viewright, viewtop + 18); - xpos += 10; - - // Down - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - brightness = 20; - - if (buttonsdown & (0 | D_CBUTTONS)) { \ - brightness += 20; \ - } \ - if (buttonsthisframe & (0 | D_CBUTTONS)) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - brightness = 127; - - if (buttonsdown & (0 | D_CBUTTONS)) { - brightness += 63; - } - - if (buttonsthisframe & (0 | D_CBUTTONS)) { - brightness += 63; - } - - gDPSetPrimColor(gdl++, 0, 0, 0x10, 0x20, brightness, 0xff); - } else { - brightness = 20; - - if (buttonsdown & (0 | D_CBUTTONS)) { - brightness += 20; - } - - if (buttonsthisframe & (0 | D_CBUTTONS)) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - } - - gDPFillRectangle(gdl++, xpos * scale + viewright, viewtop + 10, (xpos + 8) * scale + viewright, viewtop + 18); - xpos += 10; - - // Left - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - brightness = 20; - - if (buttonsdown & (0 | L_CBUTTONS)) { \ - brightness += 20; \ - } \ - if (buttonsthisframe & (0 | L_CBUTTONS)) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - brightness = 127; - - if (buttonsdown & (0 | L_CBUTTONS)) { - brightness += 63; - } - - if (buttonsthisframe & (0 | L_CBUTTONS)) { - brightness += 63; - } - - gDPSetPrimColor(gdl++, 0, 0, 0x10, 0x20, brightness, 0xff); - } else { - brightness = 20; - - if (buttonsdown & (0 | L_CBUTTONS)) { - brightness += 20; - } - - if (buttonsthisframe & (0 | L_CBUTTONS)) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - } - - gDPFillRectangle(gdl++, xpos * scale + viewright, viewtop + 10, (xpos + 8) * scale + viewright, viewtop + 18); - xpos += 10; - - // Right - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - brightness = 20; - - if (buttonsdown & (0 | R_CBUTTONS)) { \ - brightness += 20; \ - } \ - if (buttonsthisframe & (0 | R_CBUTTONS)) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - brightness = 127; - - if (buttonsdown & (0 | R_CBUTTONS)) { - brightness += 63; - } - - if (buttonsthisframe & (0 | R_CBUTTONS)) { - brightness += 63; - } - - gDPSetPrimColor(gdl++, 0, 0, 0x10, 0x20, brightness, 0xff); - } else { - brightness = 20; - - if (buttonsdown & (0 | R_CBUTTONS)) { - brightness += 20; - } - - if (buttonsthisframe & (0 | R_CBUTTONS)) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - } - - gDPFillRectangle(gdl++, xpos * scale + viewright, viewtop + 10, (xpos + 8) * scale + viewright, viewtop + 18); - xpos += 10; - - // Shoulder buttons - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - brightness = 20; - - if (buttonsdown & (0 | R_TRIG)) { \ - brightness += 20; \ - } \ - if (buttonsthisframe & (0 | R_TRIG)) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - brightness = 127; - - if (buttonsdown & (0 | R_TRIG)) { - brightness += 63; - } - - if (buttonsthisframe & (0 | R_TRIG)) { - brightness += 63; - } - - gDPSetPrimColor(gdl++, 0, 0, 0x10, 0x20, brightness, 0xff); - } else { - brightness = 20; - - if (buttonsdown & (0 | R_TRIG)) { - brightness += 20; - } - - if (buttonsthisframe & (0 | R_TRIG)) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - } - - gDPFillRectangle(gdl++, xpos * scale + viewright, viewtop + 10, (xpos + 8) * scale + viewright, viewtop + 18); - xpos += 10; - - // Z button - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - brightness = 20; - - if (buttonsdown & Z_TRIG) { \ - brightness += 20; \ - } \ - if (buttonsthisframe & Z_TRIG) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - brightness = 127; - - if (buttonsdown & Z_TRIG) { - brightness += 63; - } - - if (buttonsthisframe & Z_TRIG) { - brightness += 63; - } - - gDPSetPrimColor(gdl++, 0, 0, 0x10, 0x20, brightness, 0xff); - } else { - brightness = 20; - - if (buttonsdown & Z_TRIG) { - brightness += 20; - } - - if (buttonsthisframe & Z_TRIG) { - brightness += 20; - } - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - } - - gDPFillRectangle(gdl++, xpos * scale + viewright, viewtop + 10, (xpos + 8) * scale + viewright, viewtop + 18); - } - - xpos = (scale == 2) ? -48 : -55; - - // Stick X - tmpval = cstickx * 96.0f / 80.0f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - r = brightness / 96.0f * 16.0f; - g = brightness / 96.0f * 32.0f; - b = brightness * 2.5f; - gDPSetPrimColor(gdl++, 0, 0, r, g, b, 0xff); - } else { - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - } - -#if VERSION >= VERSION_NTSC_1_0 - if (!vsplit) -#endif - { - tmpval = cstickx * 28.0f / 80.0f; - - if (cstickx > 0) { - gDPFillRectangle(gdl++, - xpos * scale + viewright, - viewtop + 19, - (tmpval + xpos) * scale + viewright, - viewtop + 21); - } else { - gDPFillRectangle(gdl++, - (tmpval + xpos) * scale + viewright, - viewtop + 19, - xpos * scale + viewright, - viewtop + 21); - } - } - - // Stick Y - tmpval = csticky * 96.0f / 80.0f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - r = brightness / 96.0f * 16.0f; - g = brightness / 96.0f * 32.0f; - b = brightness * 2.5f; - gDPSetPrimColor(gdl++, 0, 0, r, g, b, 0xff); - } else { - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - } - -#if VERSION >= VERSION_NTSC_1_0 - if (!vsplit) -#endif - { - tmpval = csticky * 28.0f / 80.0f; - - if (csticky > 0) { - gDPFillRectangle(gdl++, - xpos * scale + viewright, - viewtop + 22, - (tmpval + xpos) * scale + viewright, - viewtop + 24); - } else { - gDPFillRectangle(gdl++, - (tmpval + xpos) * scale + viewright, - viewtop + 22, - xpos * scale + viewright, - viewtop + 24); - } - } - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { -#if VERSION >= VERSION_NTSC_1_0 - if (!vsplit) -#endif - { - // Camspy gyrobar 1 - x = viewright - viewwidth / 5.0f; - y = viewbottom - 13; - - tmpval = g_Vars.currentplayer->eyespy->theta * 96.0f / 360.0f; - textheight = g_Vars.currentplayer->eyespy->theta * 35.0f / 360.0f; - brightness = tmpval < 0 ? -tmpval : tmpval; \ - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Camspy gyrobar 2 - x += scale * 2 + scale * 5; - - tmpval = (g_Vars.currentplayer->eyespy->costheta + 1.0f) * 96.0f * 0.5f; - textheight = (g_Vars.currentplayer->eyespy->costheta + 1.0f) * 35.0f * 0.5f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Camspy gyrobar 3 - x += scale * 2 + scale * 5; - - tmpval = (g_Vars.currentplayer->eyespy->sintheta + 1.0f) * 96.0f * 0.5f; - textheight = (g_Vars.currentplayer->eyespy->sintheta + 1.0f) * 35.0f * 0.5f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Camspy gyrobar 4 - x += scale * 2 + scale * 5; - - tmpval = g_Vars.currentplayer->eyespy->verta * 96.0f / 360.0f; - textheight = g_Vars.currentplayer->eyespy->verta * 35.0f / 360.0f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Camspy gyrobar 5 - x += scale * 2 + scale * 5; - - tmpval = (g_Vars.currentplayer->eyespy->cosverta + 1.0f) * 96.0f * 0.5f; - textheight = (g_Vars.currentplayer->eyespy->cosverta + 1.0f) * 35.0f * 0.5f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Camspy gyrobar 6 - x += scale * 2 + scale * 5; - - tmpval = (g_Vars.currentplayer->eyespy->sinverta + 1.0f) * 96.0f * 0.5f; - textheight = (g_Vars.currentplayer->eyespy->sinverta + 1.0f) * 35.0f * 0.5f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, 0, brightness, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - x += scale * 2 + scale * 5; - } - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_BOMBSPY) { -#if VERSION >= VERSION_NTSC_1_0 - if (!vsplit) -#endif - { - // Bombspy gyrobar 1 - x = viewright - viewwidth / 5.0f; - y = viewbottom - 13; - - tmpval = g_Vars.currentplayer->eyespy->theta * 96.0f / 360.0f; - textheight = g_Vars.currentplayer->eyespy->theta * 35.0f / 360.0f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Bombspy gyrobar 2 - x += scale * 2 + scale * 5; - - tmpval = (g_Vars.currentplayer->eyespy->costheta + 1.0f) * 96.0f * 0.5f; - textheight = (g_Vars.currentplayer->eyespy->costheta + 1.0f) * 35.0f * 0.5f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Bombspy gyrobar 3 - x += scale * 2 + scale * 5; - - tmpval = (g_Vars.currentplayer->eyespy->sintheta + 1.0f) * 96.0f * 0.5f; - textheight = (g_Vars.currentplayer->eyespy->sintheta + 1.0f) * 35.0f * 0.5f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Bombspy gyrobar 4 - x += scale * 2 + scale * 5; - - tmpval = g_Vars.currentplayer->eyespy->verta * 96.0f / 360.0f; - textheight = g_Vars.currentplayer->eyespy->verta * 35.0f / 360.0f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Bombspy gyrobar 5 - x += scale * 2 + scale * 5; - - tmpval = (g_Vars.currentplayer->eyespy->cosverta + 1.0f) * 96.0f * 0.5f; - textheight = (g_Vars.currentplayer->eyespy->cosverta + 1.0f) * 35.0f * 0.5f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - // Bombspy gyrobar 6 - x += scale * 2 + scale * 5; - - tmpval = (g_Vars.currentplayer->eyespy->sinverta + 1.0f) * 96.0f * 0.5f; - textheight = (g_Vars.currentplayer->eyespy->sinverta + 1.0f) * 35.0f * 0.5f; - brightness = tmpval < 0 ? -tmpval : tmpval; - - gDPSetPrimColor(gdl++, 0, 0, brightness, brightness >> 2, 0, 0xff); - gDPFillRectangle(gdl++, x, y - textheight, x + scale * 5, y); - - x += scale * 2 + scale * 5; - } - } else { - // Drugspy ammo - s32 i; -#if VERSION >= VERSION_NTSC_1_0 - s32 width; -#endif - - brightness2 = 255; -#if VERSION >= VERSION_NTSC_1_0 - width = scale * 30; -#endif - - y = viewbottom - 13; - x = viewright - viewwidth / 5.0f + 5; - -#if VERSION >= VERSION_NTSC_1_0 - if (vsplit) { - x -= 12; - y -= 3; - width = 15; - } -#endif - - for (i = 0; i < 8; i++) { - if (i >= g_Vars.currentplayer->eyespydarts) { - brightness2 = 0x88; - } - - gDPSetPrimColor(gdl++, 0, 0, 0x10, 0x20, brightness2, 0xff); -#if VERSION >= VERSION_NTSC_1_0 - gDPFillRectangle(gdl++, x, y - 4, x + width, y); -#else - gDPFillRectangle(gdl++, x, y - 4, x + 30 * scale, y); -#endif - - y -= 5; - } - } - - gDPPipeSync(gdl++); \ - gDPSetColorDither(gdl++, G_CD_BAYER); \ - gDPSetTexturePersp(gdl++, G_TP_PERSP); \ - gDPSetTextureLOD(gdl++, G_TL_LOD); - - if (g_Vars.coopplayernum < 0 && g_Vars.antiplayernum < 0) { - s32 barheight = (viewbottom - viewtop - 103) / 17.0f - 1; - s32 centrey = viewheight / 2.0f; - s32 sqcentrey = centrey * centrey; - s32 ypos; - u8 alpha; - u32 stack; - u32 stack2; - s8 yoffset; - s32 value; - s32 i; - -#if VERSION == VERSION_PAL_BETA - if (centrey); -#endif - - value = 17.0f * movedist / 25.0f; - - if (value > 17) { - value = 17; - } - - value = 17 - value; - - if (viewheight == 220) { - yoffset = 10; - } else if (viewheight == 180) { - barheight--; - yoffset = -8; - } else { - yoffset = 0; - } - - gdl = func0f0d479c(gdl); - - gSPClearGeometryMode(gdl++, G_CULL_BOTH); - gSPSetGeometryMode(gdl++, G_SHADE | G_SHADING_SMOOTH); - gDPSetCombineMode(gdl++, G_CC_SHADE, G_CC_SHADE); - gDPSetTextureFilter(gdl++, G_TF_BILERP); - gDPSetCycleType(gdl++, G_CYC_1CYCLE); - gDPSetRenderMode(gdl++, G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2); - - // Speed bars (left side) - y = viewtop + 58; - - if (viewheight == 180) { - y += 5; - } - - ypos = centrey - y + 10; - -#if VERSION == VERSION_PAL_BETA - ypos += 16; -#endif - -#if VERSION == VERSION_PAL_FINAL - if (PLAYERCOUNT() >= 2 - || optionsGetEffectiveScreenSize() == SCREENSIZE_WIDE - || optionsGetEffectiveScreenSize() == SCREENSIZE_CINEMA) { - ypos += 16; - } else { - ypos += 23; - } -#endif - - for (i = 0; i < 17; i++) { - brightness = i < value ? 40 : 80; - alpha = i < value ? 0x22 : 0x56; - - points[0] = x = viewleft + 34; - points[1] = y; - points[2] = x = viewleft + 34; - points[3] = y + barheight; -#if PAL - points[6] = x = viewwidth / 2.0f - sqrtf(sqcentrey - (ypos - yoffset) * (ypos - yoffset)) * palscale - 5.0f; -#else - points[6] = x = viewwidth / 2.0f - sqrtf(sqcentrey - (ypos - yoffset) * (ypos - yoffset)) * scale - 5.0f; -#endif - points[5] = y + barheight; - - ypos -= barheight; - -#if PAL - points[4] = x = viewwidth / 2.0f - sqrtf(sqcentrey - (ypos - yoffset) * (ypos - yoffset)) * palscale - 5.0f; -#else - points[4] = x = viewwidth / 2.0f - sqrtf(sqcentrey - (ypos - yoffset) * (ypos - yoffset)) * scale - 5.0f; -#endif - points[7] = y; - - ypos -= 2; - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - gdl = bviewDrawEyespySideRect(gdl, points, 0, brightness, 0, alpha); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - gdl = bviewDrawEyespySideRect(gdl, points, 0x10, brightness, brightness * 3, alpha); - } else { - gdl = bviewDrawEyespySideRect(gdl, points, brightness, brightness >> 2, 0, alpha); - } - - y += barheight; - y += 2; - } - - // Height bars (right side) - value = g_Vars.currentplayer->eyespy->height * 17.0f * (1.0f / 160.0f); - - if (value > 17) { - value = 17; - } - - value = 17 - value; - - y = viewtop + 46; - - if (viewheight == 180) { - y += 5; - } - - ypos = centrey - y + 10; - -#if VERSION == VERSION_PAL_BETA - ypos += 16; -#endif - -#if VERSION == VERSION_PAL_FINAL - if (PLAYERCOUNT() >= 2 - || optionsGetEffectiveScreenSize() == SCREENSIZE_WIDE - || optionsGetEffectiveScreenSize() == SCREENSIZE_CINEMA) { - ypos += 16; - } else { - ypos += 23; - } -#endif - - for (i = 0; i < 17; i++) { - brightness = i < value ? 40 : 80; - alpha = i < value ? 0x22 : 0x56; - - points[0] = x = viewright - 34; - points[1] = y; - points[3] = y + barheight; - points[2] = x = viewright - 34; -#if PAL - points[6] = x = viewwidth / 2.0f + sqrtf(sqcentrey - (ypos - yoffset) * (ypos - yoffset)) * palscale + 5.0f; -#else - points[6] = x = viewwidth / 2.0f + sqrtf(sqcentrey - (ypos - yoffset) * (ypos - yoffset)) * scale + 5.0f; -#endif - points[5] = y + barheight; - - ypos -= barheight; - -#if PAL - points[4] = x = viewwidth / 2.0f + sqrtf(sqcentrey - (ypos - yoffset) * (ypos - yoffset)) * palscale + 5.0f; -#else - points[4] = x = viewwidth / 2.0f + sqrtf(sqcentrey - (ypos - yoffset) * (ypos - yoffset)) * scale + 5.0f; -#endif - points[7] = y; - - ypos -= 2; - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - gdl = bviewDrawEyespySideRect(gdl, points, 0, brightness, 0, alpha); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - gdl = bviewDrawEyespySideRect(gdl, points, 0x10, brightness, brightness * 3U, alpha); - } else { - gdl = bviewDrawEyespySideRect(gdl, points, brightness, brightness >> 2, 0, alpha); - } - - y += barheight; - y += 2; - } - } - - gdl = func0f0d49c8(gdl); - } - - return gdl; -} - void bview0f1572f8(void) { // empty diff --git a/src/game/chr.c b/src/game/chr.c index 7bc0f79ad..ad7389f71 100644 --- a/src/game/chr.c +++ b/src/game/chr.c @@ -224,13 +224,6 @@ void chrCalculatePushPos(struct chrdata *chr, struct coord *dstpos, s16 *dstroom s32 l; #endif - // The eyespy can't be pushed - if (CHRRACE(chr) == RACE_EYESPY) { - roomsCopy(prop->rooms, dstrooms); - chrSetPerimEnabled(chr, true); - return; - } - chrGetBbox(prop, &radius, &ymax, &ymin); halfradius = radius * 0.5f; chrSetPerimEnabled(chr, false); @@ -696,15 +689,7 @@ bool chr0f01f378(struct model *model, struct coord *arg1, struct coord *arg2, f3 arg2->x += chr->fallspeed.x * VAR(lvupdate60freal); arg2->z += chr->fallspeed.z * VAR(lvupdate60freal); - if (race == RACE_EYESPY) { - struct eyespy *eyespy = chrToEyespy(chr); - - if (eyespy && eyespy->deployed) { - arg2->x = chr->prop->pos.x; - arg2->y = chr->prop->pos.y; - arg2->z = chr->prop->pos.z; - } - } else if (chr->actiontype == ACT_SKJUMP + if (chr->actiontype == ACT_SKJUMP && chr->act_skjump.state == SKJUMPSTATE_AIRBORNE && !chr->act_skjump.needsnewanim && g_Vars.lvupdate60 != 0) { @@ -794,9 +779,7 @@ bool chr0f01f378(struct model *model, struct coord *arg1, struct coord *arg2, f3 chr->ground = chr->manground; arg2->y -= chr->manground; } else { - if (race == RACE_EYESPY) { - ground = chr->manground; - } else if (prop->type == PROPTYPE_PLAYER) { + if (prop->type == PROPTYPE_PLAYER) { struct player *player = g_Vars.players[playermgrGetPlayerNumByProp(prop)]; ground = player->vv_manground; chr->floorcol = player->floorcol; @@ -1853,22 +1836,6 @@ void chr0f021fa8(struct chrdata *chr, struct coord *pos, s16 *rooms) struct coord upper; f32 height = 110; - if ( -#if VERSION >= VERSION_NTSC_1_0 - chr && chr->race == RACE_EYESPY -#else - chr->race == RACE_EYESPY -#endif - ) { - struct eyespy *eyespy = chrToEyespy(chr); - - if (eyespy) { - height = eyespy->height + 30.0f; - } else { - height = 230; - } - } - lower.x = pos->x - 50.0f; lower.y = pos->y - height; lower.z = pos->z - 50.0f; @@ -2432,23 +2399,7 @@ s32 chrTick(struct prop *prop) } } - if (race == RACE_EYESPY) { - struct eyespy *eyespy = chrToEyespy(chr); - - if (eyespy && eyespy->deployed) { - if (eyespy == g_Vars.currentplayer->eyespy && eyespy->active) { - onscreen = false; - } else { - onscreen = func0f08e8ac(prop, &prop->pos, model0001af80(model), true); - } - - if (fulltick) { - chr0f0220ec(chr, lvupdate240, 1); - } - } else { - onscreen = false; - } - } else if (chr->chrflags & CHRCFLAG_HIDDEN) { + if (chr->chrflags & CHRCFLAG_HIDDEN) { onscreen = false; } else if ((chr->chrflags & CHRCFLAG_UNPLAYABLE) || (prop->type == PROPTYPE_PLAYER @@ -2556,8 +2507,7 @@ s32 chrTick(struct prop *prop) onscreen = func0f08e8ac(prop, &prop->pos, model0001af80(model), true); } else if (prop->type == PROPTYPE_PLAYER && (g_Vars.mplayerisrunning - || (player = g_Vars.players[playermgrGetPlayerNumByProp(prop)], player->cameramode == CAMERAMODE_EYESPY) - || (player->cameramode == CAMERAMODE_THIRDPERSON && player->visionmode == VISIONMODE_SLAYERROCKET))) { + || (player = g_Vars.players[playermgrGetPlayerNumByProp(prop)], player->cameramode == CAMERAMODE_THIRDPERSON && player->visionmode == VISIONMODE_SLAYERROCKET))) { model->anim->average = false; chr0f0220ec(chr, lvupdate240, 1); onscreen = func0f08e8ac(prop, &prop->pos, model0001af80(model), true); @@ -3265,20 +3215,6 @@ void chrGetBloodColour(s16 bodynum, u8 *colour1, u32 *colour2) colour2[2] = 0x005611a0; } return; - case BODY_DRCAROLL: - case BODY_EYESPY: - case BODY_CHICROB: - if (colour1) { - colour1[0] = 10; - colour1[1] = 10; - colour1[2] = 10; - } - if (colour2) { - colour2[0] = 0xb0b030a0; - colour2[1] = 0xe0e030a0; - colour2[2] = 0xe0e050a0; - } - return; case BODY_MRBLONDE: case BODY_SKEDAR: case BODY_MINISKEDAR: @@ -3323,21 +3259,6 @@ Gfx *chrRender(struct prop *prop, Gfx *gdl, bool xlupass) u8 spec[4]; u8 speb = 0; - // Don't render the eyespy if we're the one controlling it - if (CHRRACE(chr) == RACE_EYESPY) { - eyespy = chrToEyespy(chr); - - if (eyespy) { - if (!eyespy->deployed) { - return gdl; - } - - if (eyespy == g_Vars.currentplayer->eyespy && eyespy->active) { - return gdl; - } - } - } - if (chr->chrflags & CHRCFLAG_UNPLAYABLE) { alpha = 0xff; } else { @@ -3567,8 +3488,6 @@ Gfx *chrRender(struct prop *prop, Gfx *gdl, bool xlupass) if (gaptoground <= 400 && g_Vars.currentplayer->visionmode != VISIONMODE_XRAY) { if (chr->bodynum == BODY_SKEDAR || chr->bodynum == BODY_SKEDARKING) { radius = 80; - } else if (chr->bodynum == BODY_EYESPY) { - radius = 12; } else { radius = 35; } @@ -3635,11 +3554,6 @@ void chrEmitSparks(struct chrdata *chr, struct prop *prop, s32 hitpart, struct c race = CHRRACE(chr); - if (race == RACE_DRCAROLL || race == RACE_ROBOT || race == RACE_EYESPY) { - sparksCreate(chrprop->rooms[0], chrprop, coord, coord2, 0, SPARKTYPE_ELECTRICAL); - return; - } - if (chr->noblood) { return; } @@ -5286,12 +5200,7 @@ void chrHit(struct shotdata *shotdata, struct hit *hit) mtx4TransformVec(&spb0, &sp98, &sp5c); #if VERSION >= VERSION_NTSC_1_0 - if (!chr->noblood - && race != RACE_DRCAROLL - && race != RACE_ROBOT - && race != RACE_EYESPY - && !isclose - && shotdata->gset.weaponnum != WEAPON_TRANQUILIZER) { + if (!chr->noblood && !isclose && shotdata->gset.weaponnum != WEAPON_TRANQUILIZER) { u8 darker; if (chr->bodynum == BODY_MRBLONDE || race == RACE_SKEDAR) { @@ -5311,9 +5220,6 @@ void chrHit(struct shotdata *shotdata, struct hit *hit) // If paintball is enabled, neither blood nor paint is created. if (!chrIsUsingPaintball(g_Vars.currentplayer->prop->chr) && !chr->noblood - && race != RACE_DRCAROLL - && race != RACE_ROBOT - && race != RACE_EYESPY && !isclose && shotdata->gset.weaponnum != WEAPON_TRANQUILIZER) { u8 darker; diff --git a/src/game/chraction.c b/src/game/chraction.c index 32c0e7d42..fa90587db 100644 --- a/src/game/chraction.c +++ b/src/game/chraction.c @@ -1660,9 +1660,7 @@ void chrChooseStandAnimation(struct chrdata *chr, f32 mergetime) return; } - if (race == RACE_EYESPY) { - modelSetAnimation(chr->model, ANIM_013E, 0, 0, 0, mergetime); - } else if (race == RACE_HUMAN) { + if (race == RACE_HUMAN) { if (prevanimnum == ANIM_SNIPING_GETDOWN || prevanimnum == ANIM_SNIPING_GETUP || prevanimnum == ANIM_SNIPING_ONGROUND) { @@ -1728,7 +1726,7 @@ void chrStand(struct chrdata *chr) s32 race = CHRRACE(chr); f32 result; - if (race != RACE_EYESPY) { + { chrStopFiring(chr); if (race == RACE_HUMAN && chr->actiontype == ACT_KNEEL) { @@ -2795,7 +2793,7 @@ void chrAttack(struct chrdata *chr, struct attackanimgroup **animgroups, bool fl s32 race = CHRRACE(chr); u8 sniping = false; - if (race != RACE_DRCAROLL && race != RACE_EYESPY && race != RACE_ROBOT) { + { chr->actiontype = ACT_ATTACK; if (&animgroups[0] == &g_LieAttackAnims) { @@ -2989,7 +2987,6 @@ void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hit s32 prevplayernum; s32 i; s32 buddyplayernum; - struct eyespy *eyespy; s32 objectivenum; f32 impactforce1; f32 impactforce2; @@ -3010,81 +3007,6 @@ void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hit mpstatsDecrementTotalKnockoutCount(); } - // Handle eyespy then return early - if (race == RACE_EYESPY) { - prevplayernum = g_Vars.currentplayernum; - buddyplayernum = -1; - eyespy = chrToEyespy(chr); - objectivenum = -1; - - // Figure out which playernum has the eyespy that's being destroyed, - // and the buddy's playernum if applicable. Note that the player count - // can only be 1 or 2 here. - for (i = 0; i < PLAYERCOUNT(); i++) { - if (eyespy == g_Vars.players[i]->eyespy) { - setCurrentPlayerNum(i); - } else { - buddyplayernum = i; - } - } - - if (g_Vars.currentplayer->eyespy) { - // Stop using eyespy if active - if (g_Vars.currentplayer->eyespy->active) { - g_Vars.currentplayer->eyespy->active = false; - g_Vars.currentplayer->devicesactive &= ~DEVICE_EYESPY; - } - - // Destroy the eyespy - chr->hidden |= CHRHFLAG_REAPED; - - explosionCreateSimple(g_Vars.currentplayer->eyespy->prop, - &g_Vars.currentplayer->eyespy->prop->pos, - g_Vars.currentplayer->eyespy->prop->rooms, EXPLOSIONTYPE_EYESPY, 0); - invRemoveItemByNum(WEAPON_EYESPY); - - func0f0926bc(g_Vars.currentplayer->eyespy->prop, 1, 0xffff); - g_Vars.currentplayer->eyespy = NULL; - setCurrentPlayerNum(prevplayernum); - - // For Investigation and G5 Building, set a stage flag to show that - // the eyespy is destroyed. The scripting in those stages checks for - // this flag and fails the objective if set. - switch (stageGetIndex(g_Vars.stagenum)) { - case STAGEINDEX_INVESTIGATION: - objectivenum = 0; - break; - case STAGEINDEX_G5BUILDING: - if (lvGetDifficulty() == DIFF_A) { - objectivenum = 2; - } else if (lvGetDifficulty() == DIFF_SA) { - objectivenum = 2; - } else { - objectivenum = 2; - } - break; - } - - // But don't set the flag if the coop buddy still has an eyespy - if (objectivenum >= 0 && buddyplayernum >= 0) { - setCurrentPlayerNum(buddyplayernum); - - if (g_Vars.currentplayer->eyespy) { - objectivenum = -1; - } - - setCurrentPlayerNum(prevplayernum); - } - - if (objectivenum >= 0 && objectiveCheck(objectivenum) != OBJECTIVE_COMPLETE) { - g_StageFlags |= STAGEFLAG_EYESPY_DESTROYED; - } - } - - setCurrentPlayerNum(prevplayernum); - return; - } - // instant = whether to merge into death animation or switch to it instantly instant = chr->actiontype == ACT_ARGH && chr->act_argh.lvframe60 == g_Vars.lvframe60; @@ -3412,7 +3334,7 @@ void chrBeginArgh(struct chrdata *chr, f32 angle, s32 hitpart) return; } - if (race == RACE_EYESPY || chr->aibot) { + if (chr->aibot) { return; } @@ -3540,53 +3462,12 @@ void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 knockedout = true; } - if (race == RACE_EYESPY) { - f32 strength = gsetGetImpactForce(gset); - struct eyespy *eyespy = chrToEyespy(chr); - - if (eyespy) { - if (strength <= 0) { - strength = 6; - } - - strength *= 4; - - eyespy->hit = EYESPYHIT_DAMAGE; - eyespy->vel.x += vector->x * strength; - eyespy->vel.z += vector->z * strength; - } - } - if (chr->damage >= chr->maxdamage) { chrBeginDeath(chr, vector, angle, hitpart, gset, false, aplayernum); } else if (animnum == ANIM_SNIPING_GETDOWN || animnum == ANIM_SNIPING_GETUP || animnum == ANIM_SNIPING_ONGROUND) { chrFlinchBody(chr); - } else if (race == RACE_EYESPY) { - // empty - } else if (race == RACE_DRCAROLL || race == RACE_ROBOT) { - f32 strength = gsetGetImpactForce(gset); - - if (race == RACE_DRCAROLL) { - strength *= 0.5f; - } - - if (strength <= 0) { - strength = 6; - } - - if (strength > 0) { - chr->elapseextra = 0; - chr->timeextra = strength * 15; - chr->extraspeed.x = vector->x * strength; - chr->extraspeed.y = vector->y * strength; - chr->extraspeed.z = vector->z * strength; - } - - if (race == RACE_DRCAROLL) { - chrBeginArgh(chr, 0, 0); - } } else if (!knockedout) { chrBeginArgh(chr, angle, hitpart); } @@ -3612,7 +3493,7 @@ void chrYeetFromPos(struct chrdata *chr, struct coord *exppos, f32 force) s32 subindex; f32 angletoexplosion; - if (race != RACE_DRCAROLL && race != RACE_EYESPY && race != RACE_ROBOT) { + { faceangle = chrGetInverseTheta(chr); latangle = atan2f(prop->pos.x - exppos->x, prop->pos.z - exppos->z); @@ -3744,7 +3625,7 @@ bool chrIsAnimPreventingArgh(struct chrdata *chr, f32 *dst) bool result = false; s32 race = CHRRACE(chr); - if (race == RACE_DRCAROLL || race == RACE_EYESPY || chr->aibot) { + if (chr->aibot) { return false; } @@ -3807,10 +3688,6 @@ void chrChoke(struct chrdata *chr, s32 choketype) static s32 nextindexmale = 0; static s32 nextindexfemale = 0; - if (race == RACE_EYESPY || race == RACE_ROBOT) { - return; - } - if (chr->prop->type == PROPTYPE_PLAYER) { playernum = playermgrGetPlayerNumByProp(chr->prop); @@ -4967,11 +4844,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse if (chr->damage > 0) { chr->damage = chr->maxdamage; - if (race == RACE_DRCAROLL || race == RACE_EYESPY || race == RACE_ROBOT) { - chrBeginDeath(chr, vector, angle, hitpart, gset, false, aplayernum); - } else { - chrYeetFromPos(chr, explosionpos, explosionforce); - } + chrYeetFromPos(chr, explosionpos, explosionforce); if (canchoke) { chrChoke(chr, choketype); @@ -5820,7 +5693,7 @@ void chrGoPosChooseAnimation(struct chrdata *chr) chr->act_gopos.flags &= ~GOPOSFLAG_WAITING; } - if (race == RACE_EYESPY || chr->aibot) { + if (chr->aibot) { return; } @@ -6200,9 +6073,7 @@ void chrPatrolChooseAnimation(struct chrdata *chr) s32 ismale = g_HeadsAndBodies[chr->bodynum].ismale; f32 speed; - if (race == RACE_EYESPY) { - // empty - } else if (race == RACE_HUMAN || race == RACE_SKEDAR) { + if (race == RACE_HUMAN || race == RACE_SKEDAR) { if ((leftprop && rightprop) || (!leftprop && !rightprop)) { // No weapon, or double weapons heavy = false; @@ -6258,7 +6129,7 @@ void chrStartPatrol(struct chrdata *chr, struct path *path) struct prop *prop = chr->prop; s16 sp60[2]; - if (CHRRACE(chr) != RACE_EYESPY) { + { // Do some kind of collision test with the pad to resume from... // maybe a line of sight check? if (chr->patrolnextstep >= 0 && chr->patrolnextstep < path->len) { @@ -6863,10 +6734,6 @@ bool chrTryAttackWalk(struct chrdata *chr) { u32 race = CHRRACE(chr); - if (race == RACE_DRCAROLL || race == RACE_EYESPY) { - return false; - } - if (chrIsReadyForOrders(chr)) { struct prop *prop = chr->prop; @@ -6892,10 +6759,6 @@ bool chrTryAttackRun(struct chrdata *chr) { u32 race = CHRRACE(chr); - if (race == RACE_DRCAROLL || race == RACE_EYESPY) { - return false; - } - if (chrIsReadyForOrders(chr)) { struct prop *prop = chr->prop; @@ -7001,10 +6864,6 @@ bool chrTryAttackStand(struct chrdata *chr, u32 attackflags, s32 entityid) { s32 race = CHRRACE(chr); - if (race == RACE_DRCAROLL || race == RACE_EYESPY) { - return false; - } - if (chrIsReadyForOrders(chr)) { if (race == RACE_ROBOT) { robotAttack(chr); @@ -7055,10 +6914,6 @@ bool chrTryModifyAttack(struct chrdata *chr, u32 attackflags, s32 entityid) { s32 race = CHRRACE(chr); - if (race == RACE_DRCAROLL || race == RACE_EYESPY) { - return false; - } - if (chr->actiontype == ACT_ATTACK && (chr->act_attack.flags & (ATTACKFLAG_AIMONLY | ATTACKFLAG_DONTTURN))) { chr->act_attack.flags = attackflags; @@ -7292,11 +7147,6 @@ s32 func0f03aca0(struct chrdata *chr, f32 arg1, u8 arg2) bool chrTryStop(struct chrdata *chr) { - if (CHRRACE(chr) == RACE_EYESPY) { - func0f02e9a0(chr, 0); - return true; - } - if (chrIsReadyForOrders(chr)) { chrStop(chr); return true; @@ -7816,7 +7666,7 @@ bool chrTryPunch(struct chrdata *chr, u8 reverse) if (ok) { struct prop *targetprop = chrGetTargetProp(chr); - if (targetprop->type == PROPTYPE_EYESPY || targetprop->type == PROPTYPE_PLAYER) { + if (targetprop->type == PROPTYPE_PLAYER) { chr->act_anim.hitradius = playerhitradius; } else { chr->act_anim.hitradius = chrhitradius; @@ -7849,34 +7699,6 @@ void func0f03c03c(void) // empty } -/** - * Verifies that the given chr struct is actually an eyespy and returns the - * eyespy struct. - * - * Eyespys have their own chr struct, even though they aren't a chr. Iterating - * the player list is required because the only pointer to an eyespy is via the - * player struct. - */ -struct eyespy *chrToEyespy(struct chrdata *chr) -{ - if (chr && chr->prop) { - if (CHRRACE(chr) == RACE_EYESPY) { - s32 playercount = PLAYERCOUNT(); - s32 i; - - for (i = 0; i < playercount; i++) { - if (g_Vars.players[i]->eyespy && chr->prop == g_Vars.players[i]->eyespy->prop) { - return g_Vars.players[i]->eyespy; - } - } - - return NULL; - } - } - - return NULL; -} - void chrTickStand(struct chrdata *chr) { s32 race; @@ -7918,10 +7740,6 @@ void chrTickStand(struct chrdata *chr) race = CHRRACE(chr); - if (race == RACE_EYESPY) { - return; - } - if (chr->act_stand.prestand) { if (modelGetCurAnimFrame(chr->model) >= modelGetAnimEndFrame(chr->model)) { chrChooseStandAnimation(chr, 8); @@ -8323,10 +8141,6 @@ void chrTickDie(struct chrdata *chr) static s32 thudindex = 0; - if (race == RACE_EYESPY) { - return; - } - if (race == RACE_ROBOT) { struct prop *prop = chr->prop; func0f0926bc(prop, 1, 0xffff); @@ -9332,7 +9146,7 @@ void chrStopFiring(struct chrdata *chr) { u8 race = CHRRACE(chr); - if (race != RACE_DRCAROLL && race != RACE_EYESPY && chr->aibot == NULL) { + if (race != RACE_DRCAROLL && chr->aibot == NULL) { chrSetFiring(chr, HAND_RIGHT, false); chrSetFiring(chr, HAND_LEFT, false); @@ -9962,27 +9776,16 @@ void chrTickShoot(struct chrdata *chr, s32 handnum) ? CDTYPE_OBJS | CDTYPE_DOORS | CDTYPE_CHRS | CDTYPE_PATHBLOCKER | CDTYPE_BG | CDTYPE_DOORSWITHOUTFLAG | CDTYPE_PLAYERS : CDTYPE_OBJS | CDTYPE_DOORS | CDTYPE_CHRS | CDTYPE_PATHBLOCKER | CDTYPE_BG | CDTYPE_DOORSWITHOUTFLAG; u32 stack; - bool isshootingeyespy = CHRRACE(targetprop->chr) == RACE_EYESPY && chrGetDistanceToTarget(chr) > 150; - bool fudgeforeyespy = false; - if (isshootingeyespy) { - vector.x = targetprop->pos.x - gunpos.x; - vector.y = targetprop->pos.y - gunpos.y; - vector.z = targetprop->pos.z - gunpos.z; + vector.x = cosf(rotx) * sinf(roty); + vector.y = sinf(rotx); + vector.z = cosf(rotx) * cosf(roty); - guNormalize(&vector.x, &vector.y, &vector.z); - propSetPerimEnabled(targetprop, true); - } else { - vector.x = cosf(rotx) * sinf(roty); - vector.y = sinf(rotx); - vector.z = cosf(rotx) * cosf(roty); - - if (isaibot) { - bgunCalculateBotShotSpread(&vector, - chr->aibot->weaponnum, chr->aibot->gunfunc, - chr->aibot->burstsdone[handnum], botGuessCrouchPos(chr), - chr->weapons_held[0] && chr->weapons_held[1]); - } + if (isaibot) { + bgunCalculateBotShotSpread(&vector, + chr->aibot->weaponnum, chr->aibot->gunfunc, + chr->aibot->burstsdone[handnum], botGuessCrouchPos(chr), + chr->weapons_held[0] && chr->weapons_held[1]); } // Handle Farsight shots by aibots specially @@ -10027,19 +9830,6 @@ void chrTickShoot(struct chrdata *chr, s32 handnum) g_Vars.useperimshoot = false; } - // Eyespy is small and hard to hit, so make it a 50/50 chance - if (hitprop == NULL && isshootingeyespy) { - fudgeforeyespy = random() % 100 > 50; - - if (fudgeforeyespy) { - hitprop = targetprop; - - hitpos.x = hitprop->pos.x; - hitpos.y = hitprop->pos.y; - hitpos.z = hitprop->pos.z; - } - } - xdiff = hitpos.x - gunpos.x; ydiff = hitpos.y - gunpos.y; zdiff = hitpos.z - gunpos.z; @@ -10315,7 +10105,6 @@ void chrTickShoot(struct chrdata *chr, s32 handnum) // Hit a player or chr other than the one they // were aiming for if (isaibot - || fudgeforeyespy || ((chr->chrflags & CHRCFLAG_00000040) && chrCompareTeams(hitprop->chr, chr, COMPARE_ENEMIES))) { struct modelnode *node = NULL; struct model *model = NULL; @@ -10389,10 +10178,6 @@ void chrTickShoot(struct chrdata *chr, s32 handnum) } } } - - if (isshootingeyespy) { - propSetPerimEnabled(targetprop, false); - } } } @@ -13388,8 +13173,7 @@ void chraTickBg(void) if (targetprop && (targetprop->type == PROPTYPE_CHR || targetprop->type == PROPTYPE_PLAYER)) { if ((targetprop->type == PROPTYPE_PLAYER && !(g_Vars.antiplayernum >= 0 && g_Vars.anti && g_Vars.anti->prop == targetprop) - && chrCompareTeams(chr, targetprop->chr, COMPARE_ENEMIES)) - || CHRRACE(targetprop->chr) == RACE_EYESPY) { + && chrCompareTeams(chr, targetprop->chr, COMPARE_ENEMIES))) { s32 time60; s32 lastsee; s32 lastvis; diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index 2856d0c8d..563c68c9f 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -356,8 +356,8 @@ void currentPlayerSetDeviceActive(s32 weaponnum, bool active) if ((devicefunc->base.type & 0xff) == INVENTORYFUNCTYPE_DEVICE) { if (active) { - if (devicefunc->device & (DEVICE_NIGHTVISION | DEVICE_XRAYSCANNER | DEVICE_EYESPY | DEVICE_IRSCANNER)) { - g_Vars.currentplayer->devicesactive &= ~(DEVICE_NIGHTVISION | DEVICE_XRAYSCANNER | DEVICE_EYESPY | DEVICE_IRSCANNER); + 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; diff --git a/src/game/hudmsg.c b/src/game/hudmsg.c index 111627f78..32daa64cc 100644 --- a/src/game/hudmsg.c +++ b/src/game/hudmsg.c @@ -91,7 +91,6 @@ s32 hudmsgIsZoomRangeVisible(void) || g_Vars.antiplayernum >= 0) && var80075d60 == 2 && currentPlayerGetSight() == SIGHT_ZOOM - && g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY && g_Vars.currentplayer->cameramode != CAMERAMODE_THIRDPERSON; } @@ -1718,7 +1717,6 @@ Gfx *hudmsgsRender(Gfx *gdl) && var80075d60 == 2 && g_Vars.normmplayerisrunning == false && g_Vars.stagenum != STAGE_CITRAINING - && g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY && g_Vars.currentplayer->cameramode != CAMERAMODE_THIRDPERSON) { gdl = hudmsgRenderMissionTimer(gdl, timerthing); } diff --git a/src/game/lv.c b/src/game/lv.c index b8e58a149..a75aa0532 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -643,7 +643,6 @@ bool lvUpdateTrackedProp(struct trackedprop *trackedprop, s32 index) } return false; case PROPTYPE_DOOR: - case PROPTYPE_EYESPY: case PROPTYPE_EXPLOSION: case PROPTYPE_SMOKE: default: @@ -1309,7 +1308,6 @@ Gfx *lvRender(Gfx *gdl) } else if (g_Vars.currentplayer->gunctrl.unk1583_06 && var80075d60 == 2 && g_Vars.currentplayer->cameramode != CAMERAMODE_THIRDPERSON - && g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY && var8009dfc0 == 0) { g_Vars.currentplayer->gunctrl.unk1583_06 = bgun0f09eae4(); } @@ -1397,51 +1395,12 @@ Gfx *lvRender(Gfx *gdl) } } - // Handle eyespy Z presses - if (g_Vars.currentplayer->eyespy - && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_EYESPY) - && g_Vars.currentplayer->eyespy->camerabuttonheld) { - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - objectiveCheckHolograph(400); - sndStart(var80095200, SFX_CAMSPY_SHUTTER, 0, -1, -1, -1, -1, -1); - } else if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - if (g_Vars.currentplayer->eyespydarts) { - // Fire dart - struct coord direction; - sndStart(var80095200, SFX_DRUGSPY_FIREDART, 0, -1, -1, -1, -1, -1); - g_Vars.currentplayer->eyespydarts--; - - direction.x = g_Vars.currentplayer->eyespy->look.x; - direction.y = g_Vars.currentplayer->eyespy->look.y; - direction.z = g_Vars.currentplayer->eyespy->look.z; - - projectileCreate(g_Vars.currentplayer->eyespy->prop, 0, - &g_Vars.currentplayer->eyespy->prop->pos, &direction, WEAPON_TRANQUILIZER, NULL); - } else { - // No dart ammo - sndStart(var80095200, SFX_FIREEMPTY, 0, -1, -1, -1, -1, -1); - } - } else { // EYESPYMODE_BOMBSPY - struct coord vel = {0, 0, 0}; - struct gset gset = {WEAPON_GRENADE, 0, 0, FUNC_PRIMARY}; - explosionCreateSimple(g_Vars.currentplayer->eyespy->prop, - &g_Vars.currentplayer->eyespy->prop->pos, - g_Vars.currentplayer->eyespy->prop->rooms, - EXPLOSIONTYPE_DRAGONBOMBSPY, 0); - chrBeginDeath(g_Vars.currentplayer->eyespy->prop->chr, &vel, 0, 0, &gset, false, 0); - } - } - // Handle opening doors and reloading if (g_Vars.currentplayer->bondactivateorreload) { if (currentPlayerInteract(false)) { bgunReloadIfPossible(HAND_RIGHT); bgunReloadIfPossible(HAND_LEFT); } - } else if (g_Vars.currentplayer->eyespy - && g_Vars.currentplayer->eyespy->active - && g_Vars.currentplayer->eyespy->opendoor) { - currentPlayerInteract(true); } propsTestForPickup(); diff --git a/src/game/mainmenu.c b/src/game/mainmenu.c index 01c1bd953..5a3cfad6a 100644 --- a/src/game/mainmenu.c +++ b/src/game/mainmenu.c @@ -3899,16 +3899,6 @@ char *invMenuTextWeaponDescription(struct menuitem *item) struct weapon *weapon = weaponFindById(g_InventoryWeapon); if (weapon) { - if (g_InventoryWeapon == WEAPON_EYESPY && g_Vars.currentplayer->eyespy) { - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - return langGet(L_GUN_237); // Drugspy description - } - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_BOMBSPY) { - return langGet(L_GUN_236); // Bombspy description - } - } - if (g_InventoryWeapon == WEAPON_NECKLACE && g_Vars.stagenum == (VERSION >= VERSION_NTSC_1_0 ? STAGE_ATTACKSHIP : STAGE_SKEDARRUINS) && lvGetDifficulty() >= DIFF_PA) { diff --git a/src/game/menu.c b/src/game/menu.c index ecf6c3fb1..7aa7a5dfc 100644 --- a/src/game/menu.c +++ b/src/game/menu.c @@ -8410,12 +8410,6 @@ Gfx *menuRender(Gfx *gdl) } } - if (g_Vars.currentplayer->eyespy - && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_EYESPY) - && g_Vars.currentplayer->eyespy->active) { - removepiece = true; - } - if (removepiece) { if (g_MenuData.unk01c.unk580 == 0) { g_MenuData.unk01c.unk5b1_04 = true; @@ -8461,8 +8455,7 @@ Gfx *menuRender(Gfx *gdl) } // Render the health bar (playerRenderHealthBar may choose not to render) - if ((g_MenuData.bg || g_MenuData.nextbg != 255) - && (!g_Vars.currentplayer->eyespy || !g_Vars.currentplayer->eyespy->active)) { + if (g_MenuData.bg || g_MenuData.nextbg != 255) { gdl = func0f0d49c8(gdl); gdl = playerRenderHealthBar(gdl); gdl = func0f0d479c(gdl); diff --git a/src/game/menutick.c b/src/game/menutick.c index f59bd327d..09233cebc 100644 --- a/src/game/menutick.c +++ b/src/game/menutick.c @@ -722,7 +722,6 @@ void menuTick(void) g_Vars.players[i]->devicesinhibit = 0 | DEVICE_NIGHTVISION | DEVICE_XRAYSCANNER - | DEVICE_EYESPY | DEVICE_IRSCANNER; } } diff --git a/src/game/mplayer/ingame.c b/src/game/mplayer/ingame.c index f89ea2d30..22e57dd1f 100644 --- a/src/game/mplayer/ingame.c +++ b/src/game/mplayer/ingame.c @@ -357,18 +357,6 @@ char *mpMenuTextWeaponDescription(struct menuitem *item) struct weapon *weapondef = weaponFindById(g_Menus[g_MpPlayerNum].training.weaponnum); if (weapondef != NULL) { - if (g_Menus[g_MpPlayerNum].training.weaponnum == WEAPON_EYESPY) { - if (g_Vars.currentplayer->eyespy != NULL) { - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_DRUGSPY) { - return langGet(L_GUN_237); - } - - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_BOMBSPY) { - return langGet(L_GUN_236); - } - } - } - if (g_Menus[g_MpPlayerNum].training.weaponnum == WEAPON_NECKLACE && g_Vars.stagenum == STAGE_ATTACKSHIP) { if (lvGetDifficulty() >= DIFF_PA) { u8 username[] = { diff --git a/src/game/player.c b/src/game/player.c index 251a5fa0c..6b3425c66 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -3363,7 +3363,6 @@ void playerLaunchSlayerRocket(struct weaponobj *rocket) g_Vars.currentplayer->devicesactive &= ~( DEVICE_NIGHTVISION | DEVICE_XRAYSCANNER | - DEVICE_EYESPY | DEVICE_IRSCANNER); g_Vars.currentplayer->badrockettime = 0; @@ -3543,77 +3542,6 @@ void playerTick(bool arg0) playerTickDamageAndHealth(); playerTickExplode(); - if (g_Vars.currentplayer->eyespy) { - // The stage uses an eyespy - struct eyespy *eyespy = g_Vars.currentplayer->eyespy; - u32 playernum = g_Vars.currentplayernum; - - if (g_Vars.tickmode == TICKMODE_CUTSCENE) { - // Turn off the eyespy if active - struct chrdata *chr = eyespy->prop->chr; - eyespy->deployed = false; - eyespy->held = true; - eyespy->active = false; - func0f0926bc(eyespy->prop, 1, 0xffff); - chr->chrflags |= CHRCFLAG_HIDDEN; - chr->chrflags |= CHRCFLAG_INVINCIBLE; - g_Vars.currentplayer->devicesactive &= ~DEVICE_EYESPY; - } else { - if (eyespy->held == false) { - // Eyespy is deployed -#if VERSION >= VERSION_NTSC_1_0 - if (g_Vars.currentplayer->eyespy->active) { - // And is being controlled - s8 contpad1 = optionsGetContpadNum1(g_Vars.currentplayerstats->mpindex); - u16 buttons = arg0 ? joyGetButtons(contpad1, 0xffff) : 0; - - if (g_Vars.currentplayer->isdead == false - && g_Vars.currentplayer->pausemode == PAUSEMODE_UNPAUSED - && (buttons & START_BUTTON)) { - if (g_Vars.mplayerisrunning == false) { - playerPause(MENUROOT_MAINMENU); - } else { - mpPushPauseDialog(); - } - } - } -#endif - - if (g_Vars.lvupdate240) { - eyespyProcessInput(arg0); - } - } else { - // Eyespy is held - // If eyespy is activated, launch it - if ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_EYESPY) - && g_PlayersWithControl[playernum] - && !eyespyTryLaunch()) { - // Launch failed - eyespy->held = true; - eyespy->active = false; - g_Vars.currentplayer->devicesactive &= ~DEVICE_EYESPY; - } - } - - if (eyespy->deployed - && g_PlayersWithControl[playernum] - && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_EYESPY)) { - // Eyespy is being controlled - if (eyespy->active == false) { - // Eyespy is being turned off - eyespy->active = true; - eyespy->buttonheld = eyespy->camerabuttonheld = false; - eyespy->camerashuttertime = 0; - eyespy->startuptimer60 = 0; - eyespy->prop->chr->soundtimer = TICKS(10); - sndStart(var80095200, SFX_DETONATE, NULL, -1, -1, -1, -1, -1); - } - - g_Vars.currentplayer->invdowntime = TICKS(-40); - } - } - } - if (lvIsPaused()) { playerStopAudioForPause(); } @@ -3653,25 +3581,6 @@ void playerTick(bool arg0) for (i = 0; i < PLAYERCOUNT(); i++) { g_Vars.players[i]->joybutinhibit = 0xffffffff; } - } else if (g_Vars.currentplayer->eyespy - && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_EYESPY) - && g_Vars.currentplayer->eyespy->active) { - // Controlling an eyespy - struct coord sp308; - playermgrSetFovY(120); - viSetFovY(120); - sp308.x = g_Vars.currentplayer->eyespy->prop->pos.x; - sp308.y = g_Vars.currentplayer->eyespy->prop->pos.y; - sp308.z = g_Vars.currentplayer->eyespy->prop->pos.z; - playerTickChrBody(); - bmoveTick(0, 0, 0, 1); - playerSetCameraMode(CAMERAMODE_EYESPY); -#if VERSION >= VERSION_JPN_FINAL - player0f0c1840(&sp308, &g_Vars.currentplayer->eyespy->up, &g_Vars.currentplayer->eyespy->look, - &g_Vars.currentplayer->eyespy->prop->pos, g_Vars.currentplayer->eyespy->prop->rooms); -#else - player0f0c1bd8(&sp308, &g_Vars.currentplayer->eyespy->up, &g_Vars.currentplayer->eyespy->look); -#endif } else if (g_Vars.currentplayer->teleportstate == TELEPORTSTATE_WHITE) { // Deep Sea teleport playerTickChrBody(); @@ -4525,7 +4434,7 @@ Gfx *playerRenderHud(Gfx *gdl) return gdl; } - if (g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY) { + { bgunTickGameplay2(); gdl = boltbeamsRender(gdl); bgunRender(&gdl); @@ -4566,13 +4475,11 @@ Gfx *playerRenderHud(Gfx *gdl) if (g_Vars.currentplayer->isdead == false && g_InCutscene == 0 - && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) && ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit) & DEVICE_NIGHTVISION)) { gdl = bviewDrawNvLens(gdl); gdl = bviewDrawNvBinoculars(gdl); } else if (g_Vars.currentplayer->isdead == false && g_InCutscene == 0 - && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) && ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit) & DEVICE_IRSCANNER)) { gdl = bviewDrawIrLens(gdl); gdl = bviewDrawIrBinoculars(gdl); @@ -4586,7 +4493,7 @@ Gfx *playerRenderHud(Gfx *gdl) gdl = player0f0baf84(gdl); // Draw menu - if (g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY && g_Vars.currentplayer->mpmenuon) { + if (g_Vars.currentplayer->mpmenuon) { s32 a = viGetViewLeft(); s32 b = viGetViewTop(); s32 c = viGetViewLeft() + viGetViewWidth(); @@ -4597,9 +4504,7 @@ Gfx *playerRenderHud(Gfx *gdl) gdl = text0f153780(gdl); } - if (g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY - && playerIsHealthVisible() - && func0f0f0c68()) { + if (playerIsHealthVisible() && func0f0f0c68()) { gdl = playerRenderHealthBar(gdl); } @@ -4791,7 +4696,7 @@ Gfx *playerRenderHud(Gfx *gdl) } } - if (g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY) { + { gdl = bgunDrawSight(gdl); if (bgunGetWeaponNum(HAND_RIGHT) == WEAPON_HORIZONSCANNER) { @@ -4810,44 +4715,6 @@ Gfx *playerRenderHud(Gfx *gdl) gdl = radarRender(gdl); #endif - gdl = playerDrawStoredFade(gdl); - } else { - gdl = bgRenderArtifacts(gdl); - - if (g_Vars.currentplayer->eyespy) { - if (g_Vars.currentplayer->eyespy->startuptimer60 < TICKS(50)) { - gdl = bviewDrawFisheye(gdl, 0xffffffff, 255, 0, g_Vars.currentplayer->eyespy->startuptimer60, g_Vars.currentplayer->eyespy->hit); - } else { - s32 time = g_Vars.currentplayer->eyespy->camerashuttertime; - - if (time > 0) { - if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { - gdl = bviewDrawFisheye(gdl, 0xffffffff, 255, time, TICKS(50), g_Vars.currentplayer->eyespy->hit); - } else { - gdl = bviewDrawFisheye(gdl, 0xffffffff, 255, 0, TICKS(50), g_Vars.currentplayer->eyespy->hit); - } - - g_Vars.currentplayer->eyespy->camerashuttertime -= g_Vars.lvupdate60; - } else { - gdl = bviewDrawFisheye(gdl, 0xffffffff, 255, 0, TICKS(50), g_Vars.currentplayer->eyespy->hit); - } - } - - gdl = bviewDrawEyespyMetrics(gdl); - } - - if (g_Vars.currentplayer->mpmenuon) { - s32 a = viGetViewLeft(); - s32 b = viGetViewTop(); - s32 c = viGetViewLeft() + viGetViewWidth(); - s32 d = viGetViewTop() + viGetViewHeight(); - - gdl = text0f153628(gdl); - gdl = text0f153a34(gdl, a, b, c, d, 0x000000a0); - gdl = text0f153780(gdl); - } - - gdl = hudmsgsRender(gdl); gdl = playerDrawStoredFade(gdl); } @@ -5398,7 +5265,6 @@ s32 playerTickThirdPerson(struct prop *prop) if (player->haschrbody && player->model00d4 && ((g_Vars.mplayerisrunning && g_Vars.currentplayernum != playernum) - || player->cameramode == CAMERAMODE_EYESPY || (player->cameramode == CAMERAMODE_THIRDPERSON && player->visionmode == VISIONMODE_SLAYERROCKET))) { chr->actiontype = ACT_BONDMULTI; diff --git a/src/game/playermgr.c b/src/game/playermgr.c index f3b782358..2d13671d1 100644 --- a/src/game/playermgr.c +++ b/src/game/playermgr.c @@ -598,9 +598,6 @@ void playermgrAllocatePlayer(s32 index) g_Vars.players[index]->model.anim = &g_Vars.players[index]->unk01c0; - g_Vars.players[index]->eyespy = NULL; - g_Vars.players[index]->eyespydarts = 8; - g_Vars.players[index]->autocontrol_aimpad = 0; g_Vars.players[index]->autocontrol_lookup = 0; g_Vars.players[index]->autocontrol_dist = 0; diff --git a/src/game/playerreset.c b/src/game/playerreset.c index 49ce3f2e9..6ee9b6719 100644 --- a/src/game/playerreset.c +++ b/src/game/playerreset.c @@ -24,82 +24,6 @@ #include "data.h" #include "types.h" -void playerInitEyespy(void) -{ - struct prop *prop; - struct pad pad; - struct chrdata *propchr; - struct chrdata *playerchr; - static u8 nextpad = 0; - - if (g_Vars.currentplayer->eyespy == NULL) { - /** - * To create the eyespy's prop, a pad must be passed to bodyAllocateEyespy. - * However the eyespy doesn't have a pad because it's held by the - * player, so it needs to choose one from the stage. The method used - * will increment the chosen pad number each time the stage is loaded - * and wrap at 256. - * - * @bug: This method means if you play G5 Building enough times then - * the camspy will start in a trigger point for the mid cutscene, - * causing the mid cutscene to play instead of the intro. - */ - padUnpack(nextpad++, PADFIELD_ROOM | PADFIELD_POS, &pad); - prop = bodyAllocateEyespy(&pad, pad.room); - - if (prop) { - g_Vars.currentplayer->eyespy = mempAlloc(sizeof(struct eyespy), MEMPOOL_STAGE); - - if (g_Vars.currentplayer->eyespy) { - g_Vars.currentplayer->eyespy->prop = prop; - g_Vars.currentplayer->eyespy->look.x = 0; - g_Vars.currentplayer->eyespy->look.y = 0; - g_Vars.currentplayer->eyespy->look.z = 1; - g_Vars.currentplayer->eyespy->up.x = 0; - g_Vars.currentplayer->eyespy->up.y = 1; - g_Vars.currentplayer->eyespy->up.z = 0; - g_Vars.currentplayer->eyespy->theta = 0; - g_Vars.currentplayer->eyespy->costheta = 1; - g_Vars.currentplayer->eyespy->sintheta = 0; - g_Vars.currentplayer->eyespy->verta = 0; - g_Vars.currentplayer->eyespy->cosverta = 1; - g_Vars.currentplayer->eyespy->sinverta = 0; - g_Vars.currentplayer->eyespy->held = true; - g_Vars.currentplayer->eyespy->deployed = false; - g_Vars.currentplayer->eyespy->active = false; - g_Vars.currentplayer->eyespy->buttonheld = false; - g_Vars.currentplayer->eyespy->camerabuttonheld = false; - g_Vars.currentplayer->eyespy->bobdir = 1; - g_Vars.currentplayer->eyespy->bobtimer = 0; - g_Vars.currentplayer->eyespy->bobactive = true; - g_Vars.currentplayer->eyespy->vel.x = 0; - g_Vars.currentplayer->eyespy->vel.y = 0; - g_Vars.currentplayer->eyespy->vel.z = 0; - g_Vars.currentplayer->eyespy->speed = 0; - g_Vars.currentplayer->eyespy->oldground = 0; - g_Vars.currentplayer->eyespy->height = 0; - g_Vars.currentplayer->eyespy->gravity = 0; - g_Vars.currentplayer->eyespy->hit = EYESPYHIT_NONE; - g_Vars.currentplayer->eyespy->opendoor = false; - g_Vars.currentplayer->eyespy->mode = EYESPYMODE_CAMSPY; - propchr = prop->chr; - playerchr = g_Vars.currentplayer->prop->chr; - propchr->team = playerchr->team; - - if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_AIRBASE) { - g_Vars.currentplayer->eyespy->mode = EYESPYMODE_DRUGSPY; - g_Weapons[WEAPON_EYESPY]->name = L_GUN_061; // "DrugSpy" - g_Weapons[WEAPON_EYESPY]->shortname = L_GUN_061; // "DrugSpy" - } else if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_MBR || stageGetIndex(g_Vars.stagenum) == STAGEINDEX_CHICAGO) { - g_Vars.currentplayer->eyespy->mode = EYESPYMODE_BOMBSPY; - } else { - g_Vars.currentplayer->eyespy->mode = EYESPYMODE_CAMSPY; - } - } - } - } -} - struct cmd32 { s32 type; s32 param1; @@ -115,7 +39,6 @@ void playerReset(void) f32 groundy; bool hasdefaultweapon = false; struct cmd32 *cmd = (struct cmd32 *)g_StageSetup.intro; - u8 haseyespy = false; s32 stack[7]; s32 i; s32 numchrs; @@ -199,10 +122,6 @@ void playerReset(void) hasdefaultweapon = true; } - - if (cmd->param1 == WEAPON_EYESPY) { - haseyespy = true; - } } cmd = (struct cmd32 *)((u32)cmd + 16); break; @@ -391,10 +310,6 @@ void playerReset(void) } } - if (haseyespy) { - playerInitEyespy(); - } - if (g_NumSpawnPoints > 0) { if (g_Vars.coopplayernum >= 0) { turnanglerad = M_BADTAU - scenarioChooseSpawnLocation(30, &pos, rooms, g_Vars.currentplayer->prop); diff --git a/src/game/prop.c b/src/game/prop.c index 746ec06d5..189978817 100644 --- a/src/game/prop.c +++ b/src/game/prop.c @@ -1482,7 +1482,6 @@ bool currentPlayerInteract(bool eyespy) op = propdoorInteract(prop); break; case PROPTYPE_CHR: - case PROPTYPE_EYESPY: case PROPTYPE_PLAYER: case PROPTYPE_EXPLOSION: case PROPTYPE_SMOKE: @@ -2337,7 +2336,6 @@ void propsTestForPickup(void) break; case PROPTYPE_DOOR: case PROPTYPE_CHR: - case PROPTYPE_EYESPY: case PROPTYPE_PLAYER: case PROPTYPE_EXPLOSION: case PROPTYPE_SMOKE: @@ -2612,12 +2610,8 @@ void autoaimTick(void) chr = bestprop->chr; aimpos[0] = (trackedprop->x2 + trackedprop->x1) / 2; - if (chr && chr->race == RACE_EYESPY) { - aimpos[1] = (trackedprop->y2 + trackedprop->y1) >> 1; - } else { - // Aim 2/3 up the chr, so about their chest - aimpos[1] = (trackedprop->y2 + trackedprop->y1 * 2) / 3; - } + // Aim 2/3 up the chr, so about their chest + aimpos[1] = (trackedprop->y2 + trackedprop->y1 * 2) / 3; } // Constrain aimpos to the aim limits @@ -2637,16 +2631,7 @@ void autoaimTick(void) aimpos[1] = top; } - // Don't use this prop if it's an undeployed eyespy, or if - // the trackedprop is outside of the aim limits - if (chr && chr->race == RACE_EYESPY) { - struct eyespy *eyespy = chrToEyespy(chr); - - if (eyespy == NULL || !eyespy->deployed) { - bestprop = NULL; - aimpos[0] = aimpos[1] = 0; - } - } else if (aimpos[0] > trackedprop->x2 + if (aimpos[0] > trackedprop->x2 || aimpos[0] < trackedprop->x1 || aimpos[1] > trackedprop->y2 || aimpos[1] < trackedprop->y1) { diff --git a/src/game/propobj.c b/src/game/propobj.c index c7bed1c58..4a7be4a55 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -928,12 +928,6 @@ void func0f06803c(struct coord *arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4 f32 aspect = viGetAspect(); f32 fovy = viGetFovY(); - if (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & DEVICE_EYESPY) { - if (g_Vars.currentplayer->eyespy && g_Vars.currentplayer->eyespy->active) { - fovy = 120.0f; - } - } - sp4c.x = arg1[0]; sp4c.y = arg0->y; sp4c.z = arg0->z; @@ -17645,8 +17639,6 @@ void weaponPlayPickupSound(s32 weaponnum) sound = SFX_PICKUP_LASER; } else if (weaponnum == WEAPON_BOLT) { sound = SFX_PICKUP_GUN; - } else if (weaponnum == WEAPON_EYESPY) { - sound = SFX_PICKUP_KEYCARD; } else if (weaponnum > WEAPON_PSYCHOSISGUN) { sound = SFX_PICKUP_KEYCARD; } else { @@ -17843,24 +17835,6 @@ s32 weaponGetPickupAmmoQty(struct weaponobj *weapon) void weaponGetPickupText(char *buffer, s32 weaponnum, bool dual) { -#if VERSION >= VERSION_PAL_BETA - // PAL changes the implementation of this function to use a lookup table, - // with some fake weaponnums for the different eyespy types. - s32 playercount = PLAYERCOUNT(); - s32 full = playercount <= 2 - && !(playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB())); - - if (weaponnum == WEAPON_EYESPY) { - if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_AIRBASE) { - weaponnum = 998; - } else if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_MBR - || stageGetIndex(g_Vars.stagenum) == STAGEINDEX_CHICAGO) { - weaponnum = 997; - } - } - - func0f0878c8pf(buffer, weaponnum, 0, !full, dual, var8006aa94pf); -#else s32 playercount = PLAYERCOUNT(); s32 full = playercount <= 2 && !(playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB())); @@ -17874,9 +17848,7 @@ void weaponGetPickupText(char *buffer, s32 weaponnum, bool dual) if (full) { strcat(buffer, langGet(L_PROPOBJ_000)); // "Picked up" - if (weaponnum == WEAPON_EYESPY && g_Vars.currentplayer->eyespy) { - textid = L_PROPOBJ_050; // "your" - } else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_F_SOME)) { + if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_F_SOME)) { textid = L_PROPOBJ_002; // "some" } else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_F_AN)) { textid = L_PROPOBJ_006; // "an" @@ -17888,9 +17860,7 @@ void weaponGetPickupText(char *buffer, s32 weaponnum, bool dual) strcat(buffer, langGet(textid)); } else { - if (weaponnum == WEAPON_EYESPY && g_Vars.currentplayer->eyespy) { - textid = L_PROPOBJ_051; // "Your" - } else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_S_SOME)) { + if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_S_SOME)) { textid = L_PROPOBJ_003; // "Some" } else if (weaponHasFlag(weaponnum, WEAPONFLAG_DETERMINER_S_AN)) { textid = L_PROPOBJ_007; // "An" @@ -17940,7 +17910,6 @@ void weaponGetPickupText(char *buffer, s32 weaponnum, bool dual) } strcat(buffer, ".\n"); -#endif } void currentPlayerQueuePickupWeaponHudmsg(u32 weaponnum, bool dual) @@ -18138,10 +18107,6 @@ s32 propPickupByPlayer(struct prop *prop, bool showhudmsg) } } } - - if (weapon->weaponnum == WEAPON_EYESPY && g_Vars.currentplayer->eyespy == NULL) { - playerInitEyespy(); - } } break; case OBJTYPE_SHIELD: @@ -21112,14 +21077,7 @@ f32 func0f08f538(f32 x, f32 y) { f32 angle = atan2f(x, y); - if (g_Vars.currentplayer->eyespy - && g_Vars.currentplayer->eyespy->active - && g_Vars.currentplayer->eyespy->prop - && g_Vars.currentplayer->eyespy->prop->chr) { - angle -= chrGetInverseTheta(g_Vars.currentplayer->eyespy->prop->chr); - } else { - angle -= (360.0f - g_Vars.currentplayer->vv_theta) * M_BADTAU / 360.0f; - } + angle -= (360.0f - g_Vars.currentplayer->vv_theta) * M_BADTAU / 360.0f; if (angle < 0) { angle += M_BADTAU; @@ -21159,11 +21117,7 @@ void door0f08f604(struct doorobj *door, f32 *arg1, f32 *arg2, f32 *arg3, f32 *ar f32 cosine; f32 sine; - if (g_Vars.currentplayer->eyespy && g_Vars.currentplayer->eyespy->active) { - playerprop = g_Vars.currentplayer->eyespy->prop; - } else { - playerprop = g_Vars.currentplayer->prop; - } + playerprop = g_Vars.currentplayer->prop; padUnpack(door->base.pad, PADFIELD_POS | PADFIELD_LOOK | PADFIELD_UP | PADFIELD_BBOX, &pad); @@ -21253,11 +21207,7 @@ bool func0f08f968(struct doorobj *door, bool arg1) if (g_InteractProp == NULL) { maybe = false; - if (g_Vars.currentplayer->eyespy && g_Vars.currentplayer->eyespy->active) { - playerprop = g_Vars.currentplayer->eyespy->prop; - } else { - playerprop = g_Vars.currentplayer->prop; - } + playerprop = g_Vars.currentplayer->prop; if ((door->doorflags & (DOORFLAG_0080 | DOORFLAG_0100)) != DOORFLAG_0080) { maybe = true; @@ -21327,8 +21277,7 @@ bool doorTestForInteract(struct prop *prop) && door->maxfrac > 0 && (prop->flags & PROPFLAG_ONTHISSCREENTHISTICK)) { bool maybe = false; - bool usingeyespy = g_Vars.currentplayer->eyespy && g_Vars.currentplayer->eyespy->active; - struct prop *playerprop = usingeyespy ? g_Vars.currentplayer->eyespy->prop : g_Vars.currentplayer->prop; + struct prop *playerprop = g_Vars.currentplayer->prop; f32 xdiff = door->startpos.x - playerprop->pos.x; f32 ydiff = door->startpos.y - playerprop->pos.y; @@ -21468,8 +21417,7 @@ void doorsChooseSwingDirection(struct prop *chrprop, struct doorobj *door) bool propdoorInteract(struct prop *doorprop) { struct doorobj *door = doorprop->door; - bool usingeyespy = g_Vars.currentplayer->eyespy && g_Vars.currentplayer->eyespy->active; - struct prop *playerprop = usingeyespy ? g_Vars.currentplayer->eyespy->prop : g_Vars.currentplayer->prop; + struct prop *playerprop = g_Vars.currentplayer->prop; if (doorIsUnlocked(playerprop, doorprop)) { doorsChooseSwingDirection(playerprop, door); diff --git a/src/game/sight.c b/src/game/sight.c index 876d1682f..228050a8b 100644 --- a/src/game/sight.c +++ b/src/game/sight.c @@ -117,16 +117,6 @@ bool sightIsReactiveToProp(struct prop *prop) if (objGetDestroyedLevel(obj) > 0) { return false; } - } else if (prop->type == PROPTYPE_CHR) { - struct chrdata *chr = prop->chr; - - if (chr && chr->race == RACE_EYESPY) { - struct eyespy *eyespy = chrToEyespy(chr); - - if (!eyespy || !eyespy->deployed) { - return false; - } - } } return true; diff --git a/src/game/sky.c b/src/game/sky.c index ade24528e..077e530de 100644 --- a/src/game/sky.c +++ b/src/game/sky.c @@ -2949,7 +2949,7 @@ Gfx *sky0f1274d8(Gfx *gdl) ? g_Vars.currentplayer->unk1c2c : g_Vars.currentplayer->unk1c30; - if (!g_InCutscene && EYESPYINACTIVE() && value > 0) { + if (!g_InCutscene && value > 0) { f32 r = g_Vars.currentplayer->unk1c28 * (255.0f / value); f32 g = g_Vars.currentplayer->unk1c2c * (255.0f / value); f32 b = g_Vars.currentplayer->unk1c30 * (255.0f / value); diff --git a/src/game/training.c b/src/game/training.c index 738eae510..acbdce651 100644 --- a/src/game/training.c +++ b/src/game/training.c @@ -2753,19 +2753,6 @@ void dtRestorePlayer(void) if (dtGetWeaponByDeviceIndex(dtGetIndexBySlot(g_DtSlot)) == WEAPON_ECMMINE) { bgunSetAmmoQuantity(AMMOTYPE_ECM_MINE, 0); } - - if (g_Vars.currentplayer->eyespy) { - struct chrdata *chr = g_Vars.currentplayer->eyespy->prop->chr; - g_Vars.currentplayer->eyespy->deployed = false; - g_Vars.currentplayer->eyespy->held = true; - g_Vars.currentplayer->eyespy->active = false; - - chr->chrflags |= CHRCFLAG_HIDDEN; - - func0f0926bc(g_Vars.currentplayer->eyespy->prop, 1, 0xffff); - - g_Vars.currentplayer->devicesactive &= ~DEVICE_EYESPY; - } } void dtPushEndscreen(void) diff --git a/src/include/constants.h b/src/include/constants.h index d5ae3deed..d378233bc 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -46,7 +46,6 @@ #define USINGDEVICE(device) (!g_Vars.currentplayer->isdead \ && !g_InCutscene \ - && EYESPYINACTIVE() \ && (g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit & (device))) #if VERSION >= VERSION_PAL_BETA @@ -61,8 +60,6 @@ #define VOLUME(volume) (volume) #endif -#define EYESPYINACTIVE() (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) - #define ERASERSQDIST(p) ( \ (p[0] - g_Vars.currentplayer->eraserpos.f[0]) * (p[0] - g_Vars.currentplayer->eraserpos.f[0]) + \ (p[1] - g_Vars.currentplayer->eraserpos.f[1]) * (p[1] - g_Vars.currentplayer->eraserpos.f[1]) + \ @@ -364,7 +361,6 @@ #define CAMERAMODE_DEFAULT 0 #define CAMERAMODE_THIRDPERSON 1 -#define CAMERAMODE_EYESPY 2 #define CASING_NONE -1 #define CASING_STANDARD 0 diff --git a/src/include/types.h b/src/include/types.h index 99b6b3b1d..49d7634db 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -1948,40 +1948,6 @@ struct escalatorobj { // objtype 0x3b /*0x60*/ struct coord prevpos; }; -struct eyespy { - /*0x00*/ struct prop *prop; - /*0x04*/ struct coord look; - /*0x10*/ struct coord up; - /*0x1c*/ f32 theta; // turn angle in degrees - /*0x20*/ f32 costheta; - /*0x24*/ f32 sintheta; - /*0x28*/ f32 verta; - /*0x2c*/ f32 cosverta; - /*0x30*/ f32 sinverta; - /*0x34*/ u8 held; // the eyespy is held by the player (opposite of deployed) - /*0x35*/ u8 deployed; // the eyespy is deployed in the stage somewhere - /*0x36*/ s8 startuptimer60; - /*0x37*/ s8 active; // player is currently controlling the eyespy - /*0x38*/ s8 buttonheld; - /*0x39*/ s8 camerabuttonheld; - /*0x3a*/ s16 bobdir; - /*0x3c*/ u8 bobtimer; - /*0x3d*/ u8 bobactive; - /*0x40*/ struct coord vel; - /*0x4c*/ struct coord unk4c; - /*0x58*/ f32 speed; - /*0x5c*/ f32 oldground; - /*0x60*/ f32 height; // height above ground - 30 to 160 on G5 and CI training, 80 to 160 elsewhere - /*0x64*/ f32 gravity; - /*0x68*/ s8 camerashuttertime; - /*0x69*/ u8 hit; - /*0x6a*/ u8 opendoor; - /*0x6b*/ u8 mode; - /*0x6c*/ f32 velf[2]; - /*0x74*/ f32 vels[2]; - /*0x7c*/ f32 pitch; -}; - struct sndstate { /*0x00*/ ALLink node; /*0x08*/ ALSound *sound; @@ -2533,7 +2499,7 @@ struct player { /*0x0440*/ struct coord standup[2]; /*0x0458*/ s32 standcnt; /*0x045c*/ struct model model; - /*0x0480*/ struct eyespy *eyespy; + /*0x0480*/ s32 eyespy; /*0x0484*/ u8 *unk0484; // pointer to vtx buffer? /*0x0488*/ u8 *unk0488; // pointer to vtx buffer? /*0x048c*/ bool aborted;