mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- removed the disabled and mostly non-functional code for the EMP gun (secondary fire of railgun)
This commit is contained in:
parent
5900ac7db4
commit
c053b46a6d
2 changed files with 1 additions and 163 deletions
|
@ -51,7 +51,6 @@ PANEL_SPRITEp InitWeaponUziSecondaryReload(PANEL_SPRITEp);
|
|||
PANEL_SPRITEp InitWeaponUzi2(PANEL_SPRITEp);
|
||||
int InitShotgun(PLAYERp pp);
|
||||
int InitRail(PLAYERp pp);
|
||||
int InitEMP(PLAYERp pp);
|
||||
int InitMicro(PLAYERp pp);
|
||||
int InitRocket(PLAYERp pp);
|
||||
int InitNuke(PLAYERp pp);
|
||||
|
@ -3379,10 +3378,7 @@ void
|
|||
pRailFire(PANEL_SPRITEp psp)
|
||||
{
|
||||
SpawnVis(psp->PlayerP->Actor(), -1, -1, -1, -1, 16);
|
||||
if (psp->PlayerP->WpnRailType == 0)
|
||||
InitRail(psp->PlayerP);
|
||||
else
|
||||
InitEMP(psp->PlayerP);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -17501,164 +17501,6 @@ InitUzi(PLAYERp pp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Electro Magnetic Pulse gun
|
||||
int InitEMP(PLAYERp pp)
|
||||
{
|
||||
USERp u = pp->Actor()->u();
|
||||
SPRITEp wp, hsp=nullptr;
|
||||
USERp wu;
|
||||
short daang;
|
||||
HITINFO hitinfo;
|
||||
int daz, nz;
|
||||
short cstat = 0;
|
||||
|
||||
if (SW_SHAREWARE) return false; // JBF: verify
|
||||
|
||||
|
||||
PlayerUpdateAmmo(pp, u->WeaponNum, -1);
|
||||
|
||||
PlaySound(DIGI_RAILFIRE, pp, v3df_dontpan|v3df_doppler);
|
||||
|
||||
InitTracerUzi(pp);
|
||||
|
||||
//daz = nz = pp->posz + Z(8) + -MulScale(pp->horizon.horiz.asq16(), 72, 16);
|
||||
//daang = NORM_ANGLE(pp->angle.ang.asbuild() + (RandomRange(50) - 25));
|
||||
|
||||
daz = nz = pp->posz + pp->bob_z;
|
||||
daang = 64;
|
||||
if (WeaponAutoAimHitscan(pp->Actor(), &daz, &daang, false) != nullptr)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
daz = -MulScale(pp->horizon.horiz.asq16(), 2000, 16);
|
||||
daang = pp->angle.ang.asbuild();
|
||||
}
|
||||
|
||||
FAFhitscan(pp->posx, pp->posy, nz, pp->cursectnum, // Start position
|
||||
bcos(daang), // X vector of 3D ang
|
||||
bsin(daang), // Y vector of 3D ang
|
||||
daz, // Z vector of 3D ang
|
||||
&hitinfo, CLIPMASK_MISSILE);
|
||||
|
||||
auto missileActor = SpawnActor(STAT_MISSILE, EMP, s_EMPBurst, hitinfo.sect, hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang, 0);
|
||||
|
||||
wp = &missileActor->s();
|
||||
wu = missileActor->u();
|
||||
|
||||
wu->WaitTics = SEC(7);
|
||||
wp->shade = -127;
|
||||
SetOwner(pp->Actor(), missileActor);
|
||||
SET(wp->cstat, cstat | CSTAT_SPRITE_YCENTER);
|
||||
wp->clipdist = 8 >> 2;
|
||||
|
||||
if (hitinfo.sect < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SetVisHigh();
|
||||
|
||||
// check to see what you hit
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.wall < 0)
|
||||
{
|
||||
if (labs(hitinfo.pos.z - sector[hitinfo.sect].ceilingz) <= Z(1))
|
||||
{
|
||||
hitinfo.pos.z += Z(16);
|
||||
SET(cstat, CSTAT_SPRITE_YFLIP);
|
||||
|
||||
if (TEST(sector[hitinfo.sect].ceilingstat, CEILING_STAT_PLAX))
|
||||
return 0;
|
||||
}
|
||||
else if (labs(hitinfo.pos.z - sector[hitinfo.sect].floorz) <= Z(1))
|
||||
{
|
||||
if (TEST(sector[hitinfo.sect].extra, SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE)
|
||||
{
|
||||
SpawnSplashXY(hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,hitinfo.sect);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hitinfo.wall >= 0)
|
||||
{
|
||||
if (wall[hitinfo.wall].nextsector >= 0)
|
||||
{
|
||||
if (TEST(sector[wall[hitinfo.wall].nextsector].ceilingstat, CEILING_STAT_PLAX))
|
||||
{
|
||||
if (hitinfo.pos.z < sector[wall[hitinfo.wall].nextsector].ceilingz)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HitscanSpriteAdjust(missileActor->GetSpriteIndex(), hitinfo.wall);
|
||||
if (wall[hitinfo.wall].lotag == TAG_WALL_BREAK)
|
||||
{
|
||||
HitBreakWall(&wall[hitinfo.wall], hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z, daang, u->ID);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// hit a sprite?
|
||||
if (hitinfo.hitactor != nullptr)
|
||||
{
|
||||
hsp = &hitinfo.hitactor->s();
|
||||
|
||||
if (hsp->lotag == TAG_SPRITE_HIT_MATCH)
|
||||
{
|
||||
if (MissileHitMatch(-1, WPN_UZI, hitinfo.hitactor->GetSpriteIndex()))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (TEST(hsp->extra, SPRX_BREAKABLE))
|
||||
{
|
||||
HitBreakSprite(hitinfo.hitactor,0);
|
||||
//return(0);
|
||||
}
|
||||
|
||||
if (BulletHitSprite(pp->SpriteP, hitinfo.hitactor->GetSpriteIndex(), hitinfo.pos.x, hitinfo.pos.y, hitinfo.pos.z,0))
|
||||
//return(0);
|
||||
|
||||
// hit a switch?
|
||||
if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL) && (hsp->lotag || hsp->hitag))
|
||||
{
|
||||
ShootableSwitch(hitinfo.hitactor);
|
||||
}
|
||||
|
||||
if (TEST(hsp->extra, SPRX_PLAYER_OR_ENEMY))
|
||||
{
|
||||
// attach weapon to sprite
|
||||
SetAttach(hitinfo.hitactor, missileActor);
|
||||
wu->sz = hitinfo.hitactor->s().z - wp->z;
|
||||
if (RandomRange(1000) > 500)
|
||||
PlayerSound(DIGI_YOULOOKSTUPID, v3df_follow|v3df_dontpan,pp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
|
||||
{
|
||||
SET(wu->Flags2, SPR2_ATTACH_WALL);
|
||||
}
|
||||
else if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
|
||||
{
|
||||
// hit floor
|
||||
if (wp->z > DIV2(wu->hiz + wu->loz))
|
||||
SET(wu->Flags2, SPR2_ATTACH_FLOOR);
|
||||
else
|
||||
SET(wu->Flags2, SPR2_ATTACH_CEILING);
|
||||
}
|
||||
else
|
||||
{
|
||||
KillActor(missileActor);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int InitTankShell(DSWActor* actor, PLAYERp pp)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue