Remove eyespy

This commit is contained in:
Ryan Dwyer
2022-11-04 20:39:39 +10:00
parent 6400af6d88
commit 2d0094a8b8
25 changed files with 45 additions and 3548 deletions
-1
View File
@@ -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); \
-96
View File
@@ -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
File diff suppressed because it is too large Load Diff
-20
View File
@@ -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)
-19
View File
@@ -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();
}
-1455
View File
File diff suppressed because it is too large Load Diff
+5 -99
View File
@@ -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;
+21 -237
View File
@@ -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;
+2 -2
View File
@@ -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;
-2
View File
@@ -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);
}
-41
View File
@@ -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();
-10
View File
@@ -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) {
+1 -8
View File
@@ -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);
-1
View File
@@ -722,7 +722,6 @@ void menuTick(void)
g_Vars.players[i]->devicesinhibit = 0
| DEVICE_NIGHTVISION
| DEVICE_XRAYSCANNER
| DEVICE_EYESPY
| DEVICE_IRSCANNER;
}
}
-12
View File
@@ -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[] = {
+4 -138
View File
@@ -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;
-3
View File
@@ -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;
-85
View File
@@ -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);
+3 -18
View File
@@ -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) {
+7 -59
View File
@@ -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);
-10
View File
@@ -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;
+1 -1
View File
@@ -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);
-13
View File
@@ -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)
-4
View File
@@ -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
+1 -35
View File
@@ -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;