mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- added a new flag for non-teleporting items.
This commit is contained in:
parent
fc94fb9651
commit
2468debe34
5 changed files with 182 additions and 190 deletions
|
@ -1955,113 +1955,105 @@ void movetransports_d(void)
|
|||
warpspriteto = 1;
|
||||
}
|
||||
|
||||
if (warpspriteto) switch (act2->spr.picnum)
|
||||
if (warpspriteto)
|
||||
{
|
||||
case TRANSPORTERSTAR:
|
||||
case TRANSPORTERBEAM:
|
||||
case TRIPBOMB:
|
||||
case BULLETHOLE:
|
||||
case WATERSPLASH2:
|
||||
case BURNING:
|
||||
case BURNING2:
|
||||
case FIRE:
|
||||
case FIRE2:
|
||||
case TOILETWATER:
|
||||
case LASERLINE:
|
||||
continue;
|
||||
case PLAYERONWATER:
|
||||
if (sectlotag == 2)
|
||||
if (actorflag(act2, SFLAG_NOTELEPORT)) continue;
|
||||
switch (act2->spr.picnum)
|
||||
{
|
||||
act2->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
break;
|
||||
}
|
||||
[[fallthrough]];
|
||||
default:
|
||||
if (act2->spr.statnum == 5 && !(sectlotag == 1 || sectlotag == 2))
|
||||
break;
|
||||
[[fallthrough]];
|
||||
|
||||
case WATERBUBBLE:
|
||||
//if( rnd(192) && a2->s.picnum == WATERBUBBLE)
|
||||
// break;
|
||||
|
||||
if (sectlotag > 0)
|
||||
{
|
||||
auto k = spawn(act2, WATERSPLASH2);
|
||||
if (k && sectlotag == 1 && act2->spr.statnum == 4)
|
||||
case PLAYERONWATER:
|
||||
if (sectlotag == 2)
|
||||
{
|
||||
k->spr.xvel = act2->spr.xvel >> 1;
|
||||
k->spr.ang = act2->spr.ang;
|
||||
ssp(k, CLIPMASK0);
|
||||
act2->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
[[fallthrough]];
|
||||
default:
|
||||
if (act2->spr.statnum == 5 && !(sectlotag == 1 || sectlotag == 2))
|
||||
break;
|
||||
[[fallthrough]];
|
||||
|
||||
switch (sectlotag)
|
||||
{
|
||||
case 0:
|
||||
if (onfloorz)
|
||||
case WATERBUBBLE:
|
||||
//if( rnd(192) && a2->s.picnum == WATERBUBBLE)
|
||||
// break;
|
||||
|
||||
if (sectlotag > 0)
|
||||
{
|
||||
if (act2->spr.statnum == STAT_PROJECTILE || (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1))
|
||||
auto k = spawn(act2, WATERSPLASH2);
|
||||
if (k && sectlotag == 1 && act2->spr.statnum == 4)
|
||||
{
|
||||
k->spr.xvel = act2->spr.xvel >> 1;
|
||||
k->spr.ang = act2->spr.ang;
|
||||
ssp(k, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
||||
switch (sectlotag)
|
||||
{
|
||||
case 0:
|
||||
if (onfloorz)
|
||||
{
|
||||
if (act2->spr.statnum == STAT_PROJECTILE || (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1))
|
||||
{
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z -= act->spr.pos.Z - Owner->sector()->floorz;
|
||||
act2->spr.ang = Owner->spr.ang;
|
||||
|
||||
act2->backupang();
|
||||
|
||||
if (act->spr.pal == 0)
|
||||
{
|
||||
auto k = spawn(act, TRANSPORTERBEAM);
|
||||
if (k) S_PlayActorSound(TELEPORTER, k);
|
||||
|
||||
k = spawn(Owner, TRANSPORTERBEAM);
|
||||
if (k) S_PlayActorSound(TELEPORTER, k);
|
||||
}
|
||||
|
||||
if (Owner && Owner->GetOwner() == Owner)
|
||||
{
|
||||
act->temp_data[0] = 13;
|
||||
Owner->temp_data[0] = 13;
|
||||
}
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z -= act->spr.pos.Z - Owner->sector()->floorz;
|
||||
act2->spr.ang = Owner->spr.ang;
|
||||
act2->spr.pos.Z = Owner->spr.pos.Z + 4096;
|
||||
|
||||
act2->backupang();
|
||||
|
||||
if (act->spr.pal == 0)
|
||||
{
|
||||
auto k = spawn(act, TRANSPORTERBEAM);
|
||||
if (k) S_PlayActorSound(TELEPORTER, k);
|
||||
|
||||
k = spawn(Owner, TRANSPORTERBEAM);
|
||||
if (k) S_PlayActorSound(TELEPORTER, k);
|
||||
}
|
||||
|
||||
if (Owner && Owner->GetOwner() == Owner)
|
||||
{
|
||||
act->temp_data[0] = 13;
|
||||
Owner->temp_data[0] = 13;
|
||||
}
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
case 1:
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->spr.pos.Z + 4096;
|
||||
act2->spr.pos.Z = Owner->sector()->ceilingz + ll;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
break;
|
||||
case 2:
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->floorz - ll;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->ceilingz + ll;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
break;
|
||||
case 2:
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->floorz - ll;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1639,135 +1639,131 @@ void movetransports_r(void)
|
|||
warpspriteto = 1;
|
||||
}
|
||||
|
||||
if (warpspriteto) switch (act2->spr.picnum)
|
||||
if (warpspriteto)
|
||||
{
|
||||
case TRANSPORTERSTAR:
|
||||
case TRANSPORTERBEAM:
|
||||
case BULLETHOLE:
|
||||
case WATERSPLASH2:
|
||||
case BURNING:
|
||||
case FIRE:
|
||||
case MUD:
|
||||
continue;
|
||||
case PLAYERONWATER:
|
||||
if (sectlotag == ST_2_UNDERWATER)
|
||||
if (actorflag(act2, SFLAG_NOTELEPORT)) continue;
|
||||
switch (act2->spr.picnum)
|
||||
{
|
||||
act2->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
break;
|
||||
}
|
||||
[[fallthrough]];
|
||||
default:
|
||||
if (act2->spr.statnum == 5 && !(sectlotag == ST_1_ABOVE_WATER || sectlotag == ST_2_UNDERWATER || (isRRRA() && (sectlotag == 160 || sectlotag == 161))))
|
||||
break;
|
||||
[[fallthrough]];
|
||||
|
||||
case WATERBUBBLE:
|
||||
if (rnd(192) && act2->spr.picnum == WATERBUBBLE)
|
||||
break;
|
||||
|
||||
if (sectlotag > 0)
|
||||
{
|
||||
auto spawned = spawn(act2, WATERSPLASH2);
|
||||
if (spawned && sectlotag == 1 && act2->spr.statnum == 4)
|
||||
case PLAYERONWATER:
|
||||
if (sectlotag == ST_2_UNDERWATER)
|
||||
{
|
||||
spawned->spr.xvel = act2->spr.xvel >> 1;
|
||||
spawned->spr.ang = act2->spr.ang;
|
||||
ssp(spawned, CLIPMASK0);
|
||||
act2->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
[[fallthrough]];
|
||||
default:
|
||||
if (act2->spr.statnum == 5 && !(sectlotag == ST_1_ABOVE_WATER || sectlotag == ST_2_UNDERWATER || (isRRRA() && (sectlotag == 160 || sectlotag == 161))))
|
||||
break;
|
||||
[[fallthrough]];
|
||||
|
||||
switch (sectlotag)
|
||||
{
|
||||
case ST_0_NO_EFFECT:
|
||||
if (onfloorz)
|
||||
case WATERBUBBLE:
|
||||
if (rnd(192) && act2->spr.picnum == WATERBUBBLE)
|
||||
break;
|
||||
|
||||
if (sectlotag > 0)
|
||||
{
|
||||
if (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1)
|
||||
auto spawned = spawn(act2, WATERSPLASH2);
|
||||
if (spawned && sectlotag == 1 && act2->spr.statnum == 4)
|
||||
{
|
||||
spawned->spr.xvel = act2->spr.xvel >> 1;
|
||||
spawned->spr.ang = act2->spr.ang;
|
||||
ssp(spawned, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
||||
switch (sectlotag)
|
||||
{
|
||||
case ST_0_NO_EFFECT:
|
||||
if (onfloorz)
|
||||
{
|
||||
if (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1)
|
||||
{
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z -= act->spr.pos.Z - Owner->sector()->floorz;
|
||||
act2->spr.ang = Owner->spr.ang;
|
||||
|
||||
act2->backupang();
|
||||
|
||||
auto beam = spawn(act, TRANSPORTERBEAM);
|
||||
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
||||
|
||||
beam = spawn(Owner, TRANSPORTERBEAM);
|
||||
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
{
|
||||
act->temp_data[0] = 13;
|
||||
Owner->temp_data[0] = 13;
|
||||
}
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z -= act->spr.pos.Z - Owner->sector()->floorz;
|
||||
act2->spr.ang = Owner->spr.ang;
|
||||
act2->spr.pos.Z = Owner->spr.pos.Z + 4096;
|
||||
|
||||
act2->backupang();
|
||||
|
||||
auto beam = spawn(act, TRANSPORTERBEAM);
|
||||
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
||||
|
||||
beam = spawn(Owner, TRANSPORTERBEAM);
|
||||
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
{
|
||||
act->temp_data[0] = 13;
|
||||
Owner->temp_data[0] = 13;
|
||||
}
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
case ST_1_ABOVE_WATER:
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->spr.pos.Z + 4096;
|
||||
act2->spr.pos.Z = Owner->sector()->ceilingz + ll;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
break;
|
||||
case ST_2_UNDERWATER:
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->floorz - ll;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
break;
|
||||
|
||||
case 160:
|
||||
if (!isRRRA()) break;
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->ceilingz + ll2;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
movesprite_ex(act2, MulScale(act2->spr.xvel, bcos(act2->spr.ang), 14),
|
||||
MulScale(act2->spr.xvel, bsin(act2->spr.ang), 14), 0, CLIPMASK1, coll);
|
||||
|
||||
break;
|
||||
case 161:
|
||||
if (!isRRRA()) break;
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->floorz - ll2;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
movesprite_ex(act2, MulScale(act2->spr.xvel, bcos(act2->spr.ang), 14),
|
||||
MulScale(act2->spr.xvel, bsin(act2->spr.ang), 14), 0, CLIPMASK1, coll);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ST_1_ABOVE_WATER:
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->ceilingz + ll;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
break;
|
||||
case ST_2_UNDERWATER:
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->floorz - ll;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
break;
|
||||
|
||||
case 160:
|
||||
if (!isRRRA()) break;
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->ceilingz + ll2;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
movesprite_ex(act2, MulScale(act2->spr.xvel, bcos(act2->spr.ang), 14),
|
||||
MulScale(act2->spr.xvel, bsin(act2->spr.ang), 14), 0, CLIPMASK1, coll);
|
||||
|
||||
break;
|
||||
case 161:
|
||||
if (!isRRRA()) break;
|
||||
act2->spr.pos.X += (Owner->spr.pos.X - act->spr.pos.X);
|
||||
act2->spr.pos.Y += (Owner->spr.pos.Y - act->spr.pos.Y);
|
||||
act2->spr.pos.Z = Owner->sector()->floorz - ll2;
|
||||
|
||||
act2->backupz();
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
movesprite_ex(act2, MulScale(act2->spr.xvel, bcos(act2->spr.ang), 14),
|
||||
MulScale(act2->spr.xvel, bsin(act2->spr.ang), 14), 0, CLIPMASK1, coll);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -322,6 +322,7 @@ enum sflags_t
|
|||
SFLAG_HITRADIUS_FLAG1 = 0x02000000,
|
||||
SFLAG_HITRADIUS_FLAG2 = 0x04000000,
|
||||
SFLAG_CHECKSLEEP = 0x08000000,
|
||||
SFLAG_NOTELEPORT = 0x10000000,
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -207,6 +207,8 @@ void initactorflags_d()
|
|||
setflag(SFLAG_HITRADIUS_FLAG1, { BOX, TREE1, TREE2, TIRE, CONE });
|
||||
setflag(SFLAG_HITRADIUS_FLAG2, { TRIPBOMB, QUEBALL, STRIPEBALL, DUKELYINGDEAD });
|
||||
setflag(SFLAG_CHECKSLEEP, { RUBBERCAN, EXPLODINGBARREL, WOODENHORSE, HORSEONSIDE, CANWITHSOMETHING, FIREBARREL, NUKEBARREL, NUKEBARRELDENTED, NUKEBARRELLEAKED, TRIPBOMB });
|
||||
setflag(SFLAG_NOTELEPORT, { TRANSPORTERSTAR, TRANSPORTERBEAM, TRIPBOMB, BULLETHOLE, WATERSPLASH2, BURNING, BURNING2, FIRE, FIRE2, TOILETWATER, LASERLINE });
|
||||
|
||||
|
||||
if (isWorldTour())
|
||||
{
|
||||
|
|
|
@ -237,6 +237,7 @@ void initactorflags_r()
|
|||
setflag(SFLAG_HITRADIUS_FLAG1, { BOX, TREE1, TREE2, TIRE });
|
||||
setflag(SFLAG_HITRADIUS_FLAG2, { QUEBALL, STRIPEBALL, BOWLINGPIN, DUKELYINGDEAD });
|
||||
setflag(SFLAG_CHECKSLEEP, { RUBBERCAN, EXPLODINGBARREL, WOODENHORSE, HORSEONSIDE, CANWITHSOMETHING, FIREBARREL, NUKEBARREL, NUKEBARRELDENTED, NUKEBARRELLEAKED, TRIPBOMB, EGG });
|
||||
setflag(SFLAG_NOTELEPORT, { TRANSPORTERSTAR, TRANSPORTERBEAM, BULLETHOLE, WATERSPLASH2, BURNING, FIRE, MUD });
|
||||
|
||||
// Animals were not supposed to have this, but due to a coding bug the logic was unconditional for everything in the game.
|
||||
for (auto& ainf : gs.actorinfo)
|
||||
|
|
Loading…
Reference in a new issue