Revert all "global level removal" changes, as this concept is being discarded in GZDoom.

Keep a couple changes from that commit, though, such as the switch to legacy render style tags in Screen API calls.
This commit is contained in:
Marisa the Magician 2019-01-24 21:09:17 +01:00
commit ee0cf53e9b
16 changed files with 74 additions and 76 deletions

View file

@ -213,7 +213,7 @@ Class UTPlayer : DoomPlayer
}
if ( !footsteps ) footsteps = CVar.GetCVar('flak_footsteps',players[consoleplayer]);
if ( !footsteps.GetBool() ) return;
double ang = level.maptime/(20*TICRATE/35.)*360.;
double ang = level.time/(20*TICRATE/35.)*360.;
bool forcefootstep = false;
if ( player.onground && !bNoGravity && !lastground && (waterlevel < 2) )
{
@ -901,7 +901,7 @@ Class UTViewSpark : UTSpark
Vector3 origin = x*ofs.x+y*ofs.y+z*ofs.z+(0,0,target.player.viewz);
SetOrigin(target.Vec2OffsetZ(origin.x,origin.y,origin.z),true);
bInvisible = (players[consoleplayer].camera != target);
if ( isFrozen() ) return;
if ( level.frozen || globalfreeze ) return;
ofs += vvel;
vvel.z -= 0.1;
scale *= 0.8;
@ -943,7 +943,7 @@ Class UTChip : Actor
override void Tick()
{
Super.Tick();
if ( isFrozen() ) return;
if ( level.frozen || globalfreeze ) return;
if ( InStateSequence(CurState,ResolveState("Death")) )
{
deadtimer++;
@ -1006,7 +1006,7 @@ Class UTBubble : Actor
override void Tick()
{
Super.Tick();
if ( isFrozen() ) return;
if ( level.frozen || globalfreeze ) return;
vel *= 0.96;
vel.z += 0.05;
if ( (waterlevel <= 0) || !Random[Puff](0,100) ) Destroy();
@ -1054,7 +1054,7 @@ Class UTSmoke : Actor
override void Tick()
{
Super.Tick();
if ( isFrozen() ) return;
if ( level.frozen || globalfreeze ) return;
vel *= 0.96;
vel.z += 0.01;
A_FadeOut(1/32.);
@ -1146,7 +1146,7 @@ Class UTViewSmoke : UTSmoke
Vector3 origin = x*ofs.x+y*ofs.y+z*ofs.z+(0,0,target.player.viewz);
SetOrigin(target.Vec2OffsetZ(origin.x,origin.y,origin.z),true);
bInvisible = (players[consoleplayer].camera != target);
if ( isFrozen() ) return;
if ( level.frozen || globalfreeze ) return;
ofs += vvel;
vvel *= 0.96;
vvel.z += 0.01;
@ -1545,7 +1545,7 @@ Class UTMainHandler : StaticEventHandler
private Actor AddLight( Vector3 pos, Color col, int radius )
{
Actor l = currentSession.levelinfo[0].Spawn("PointLightAttenuated",pos);
Actor l = Actor.Spawn("PointLightAttenuated",pos);
if ( !l ) return null;
l.args[0] = col.r;
l.args[1] = col.g;
@ -1556,7 +1556,7 @@ Class UTMainHandler : StaticEventHandler
private Actor AddAmbient( Vector3 pos, String snd, double volume = 1., double attenuation = ATTN_NORM )
{
Actor a = currentSession.levelinfo[0].Spawn("MapSpot",pos);
Actor a = Actor.Spawn("MapSpot",pos);
if ( !a ) return null;
a.A_PlaySound(snd,CHAN_BODY,volume,true,attenuation);
return a;
@ -1565,12 +1565,15 @@ Class UTMainHandler : StaticEventHandler
override void WorldLoaded( WorldEvent e )
{
if ( gamestate != GS_LEVEL || e.IsSaveGame ) return;
let level = currentSession.levelinfo[0];
// just replace the -noflat- with a better scaled version
// just replace the -noflat- with a better scaled version and change the sky
if ( !flak_doomtest )
{
if ( (level.GetChecksum() ~== "FBC3B6622A8B74AE06DE01E70007AC33") || (level.GetChecksum() ~== "D8206A3414DA967F2159473B5791139E") )
{
level.ReplaceTextures("-noflat-","DefTex",0);
TextureID skytx = TexMan.CheckForTexture("BlueSky",TexMan.Type_Any);
level.ChangeSky(skytx,skytx);
}
return;
}
// prettify Kinsie's test map for a more Unreal feel
@ -1871,7 +1874,7 @@ Class UTMainHandler : StaticEventHandler
return;
}
// generic gibbing
let a = e.Thing.level.Spawn("UTGibber",e.Thing.pos);
let a = Actor.Spawn("UTGibber",e.Thing.pos);
a.vel = e.Thing.vel;
a.Scale = e.Thing.Scale;
a.Translation = e.Thing.BloodTranslation;
@ -1886,7 +1889,7 @@ Class UTMainHandler : StaticEventHandler
}
// attach damage accumulator for corpses
if ( !flak_corpsedamage ) return;
let a = e.Thing.level.Spawn("ShredCorpseHitbox",e.Thing.pos);
let a = Actor.Spawn("ShredCorpseHitbox",e.Thing.pos);
a.target = e.Thing;
}
@ -1911,7 +1914,7 @@ Class UTMainHandler : StaticEventHandler
if ( !a || !a.bSHOOTABLE || !Source.CheckSight(a,0xf) || (a == Source) || (Source.Distance3D(a) > ExplosionRadius) )
continue;
Vector3 midpoint = a.Vec3Offset(0,0,a.height*0.5);
a.vel += Source.level.Vec3Diff(Source.pos,midpoint).unit()*(MomentumTransfer/(Thinker.TICRATE*a.mass));
a.vel += Level.Vec3Diff(Source.pos,midpoint).unit()*(MomentumTransfer/(Thinker.TICRATE*a.mass));
}
}
@ -1925,7 +1928,7 @@ Class UTMainHandler : StaticEventHandler
static void DoSwing( Actor target, Vector2 dir, double initial, double inc, int steps, int mode = 0, int delay = 0, double rmul = 1.0 )
{
if ( !flak_swingers ) return;
let s = new("Swinger"); // this looks unsafe, shouldn't there be a way to create thinkers in specifc level?
let s = new("Swinger");
s.ChangeStatNum(Thinker.STAT_USER);
s.target = target;
s.dir = dir;