4.10 support update (unfinished and untested).

This commit is contained in:
Mari the Deer 2022-12-05 02:10:56 +01:00
commit 8e952f412f
80 changed files with 2343 additions and 2356 deletions

View file

@ -296,8 +296,7 @@ Class SWWMGasCloudSpawner : SWWMNonInteractiveActor
if ( isFrozen() ) return;
if ( !(special1%5) )
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
let c = Spawn("SWWMGasCloud",level.Vec3Offset(pos,x*(20+special1*12)));
c.target = target;
c.specialf1 = 1+special1/10.;
@ -1004,17 +1003,15 @@ Class Chancebox : Actor
// find all secret sectors, find potential spawn spots within them
// after that, spawn up to 3 boxes total within them
int tboxes = 0;
for ( int i=0; i<level.Sectors.Size(); i++ )
foreach ( s:level.Sectors )
{
if ( !(level.Sectors[i].flags&Sector.SECF_SECRET) ) continue;
Sector s = level.Sectors[i];
if ( !(s.flags&Sector.SECF_SECRET) ) continue;
// find any spots in the sector that are within it and have no linedefs or blocking actors within a 32 unit box
// start from the center, expand in rings
Vector2 origin = s.centerspot;
double maxradius = 0;
for ( int j=0; j<s.lines.Size(); j++ )
foreach ( l:s.lines )
{
Line l = s.lines[j];
double v1len = (l.v1.p-origin).length(),
v2len = (l.v2.p-origin).length();
if ( v1len > maxradius ) maxradius = v1len;
@ -1122,9 +1119,9 @@ Class Chancebox : Actor
{
Array<Class <SWWMCollectible> > candidates;
candidates.Clear();
for ( int i=0; i<AllActorClasses.Size(); i++ )
foreach ( cls:AllActorClasses )
{
let c = (Class<SWWMCollectible>)(AllActorClasses[i]);
let c = (Class<SWWMCollectible>)(cls);
if ( !c || (c == 'SWWMCollectible') ) continue;
let def = GetDefaultByType(c);
// check that we can collect it in this IWAD
@ -1156,9 +1153,9 @@ Class Chancebox : Actor
{
// populate reward choices to randomize
Array<ChanceboxReward> rewards;
for ( int i=0; i<AllClasses.Size(); i++ )
foreach ( cls:AllClasses )
{
let cls = (Class<ChanceboxReward>)(AllClasses[i]);
let cls = (Class<ChanceboxReward>)(cls);
if ( !cls || cls.isAbstract() ) continue;
let cr = ChanceboxReward(new(cls));
rewards.Push(cr);
@ -1213,9 +1210,9 @@ Class Chancebox : Actor
SWWMCollectible c;
while ( c = SWWMCollectible(ti.Next()) ) col++;
int tcol = 0;
for ( int i=0; i<AllActorClasses.Size(); i++ )
foreach ( cls:AllActorClasses )
{
let c = (Class<SWWMCollectible>)(AllActorClasses[i]);
let c = (Class<SWWMCollectible>)(cls);
if ( !c || (c == 'SWWMCollectible') ) continue;
let def = GetDefaultByType(c);
// check that we can collect it in this IWAD