- exported two more classes used by PicForName.

This commit is contained in:
Christoph Oelckers 2022-12-12 15:08:20 +01:00
parent 7b4d5eb26d
commit bc50f596e8
9 changed files with 69 additions and 47 deletions

View file

@ -176,7 +176,6 @@ void addspritetodelete(int spnum=0);
void checkavailinven(player_struct* p);
bool initspriteforspawn(DDukeActor* spn);
bool commonEnemySetup(DDukeActor* self, DDukeActor* owner);
int spawnbloodpoolpart1(DDukeActor* acti);
void initshell(DDukeActor* actj, DDukeActor* acti, bool isshell);
void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors);
int startrts(int lumpNum, int localPlayer);

View file

@ -340,31 +340,6 @@ bool commonEnemySetup(DDukeActor* self, DDukeActor* owner)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int spawnbloodpoolpart1(DDukeActor* act)
{
bool away = isAwayFromWall(act, 6.75);
if (!away)
{
act->spr.scale = DVector2(0, 0);
ChangeActorStat(act, STAT_MISC);
return true;
}
if (act->sector()->lotag == 1)
{
ChangeActorStat(act, STAT_MISC);
return true;
}
return false;
}
//---------------------------------------------------------------------------
//
//

View file

@ -123,15 +123,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
ChangeActorStat(act, STAT_ZOMBIEACTOR);
}
return act;
case DTILE_LAVAPOOLBUBBLE:
if (actj->spr.scale.X < 0.46875)
return act;
act->SetOwner(actj);
ChangeActorStat(act, STAT_MISC);
act->spr.pos.X += krandf(32) - 16;
act->spr.pos.Y += krandf(32) - 16;
act->spr.scale = DVector2(0.25, 0.25);
return act;
case DTILE_WHISPYSMOKE:
ChangeActorStat(act, STAT_MISC);
act->spr.pos.X += krandf(16) - 8;
@ -163,16 +154,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.pal = 6;
ChangeActorStat(act, STAT_MISC);
break;
case DTILE_LAVAPOOL:
if (!isWorldTour()) // Twentieth Anniversary World Tour
return act;
if (spawnbloodpoolpart1(act)) break;
act->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_FLOOR;
act->spr.pos.Z = getflorzofslopeptr(act->sector(), act->spr.pos) - 0.78125;
[[fallthrough]];
case DTILE_FECES:
if (actj)
act->spr.scale = DVector2(REPEAT_SCALE, REPEAT_SCALE);

View file

@ -14,8 +14,6 @@ int PicForName(int intname)
if (classnameToTile.CountUsed() == 0)
{
static std::pair<const char*, const char*> classes[] = {
{"DukeLavaPool", "LAVAPOOL"},
{"RedneckCircleStuck", "CIRCLESTUCK"},
{"DukePigCop", "PIGCOP"},
{"DukeSmallSmoke", "SMALLSMOKE"},
{"RedneckBowlingBallSprite", "BOWLINGBALLSPRITE"},

View file

@ -7,4 +7,6 @@ spawnclasses
5294 = DeveloperCommentary
1891 = DukeFlamethrowerFlame
5296 = DukeFireflyFlyingEffect
5304 = DukeLavaPool
5207 = DukeLavaPoolBubble
}

View file

@ -282,6 +282,7 @@ spawnclasses
52 = RedneckPorkRinds
5595 = RedneckGoogooCluster
240 = DukeWaterBubble
3388 = RedneckCircleStuck
}

View file

@ -114,6 +114,7 @@ version "4.10"
#include "zscript/games/duke/actors/flamethrowerflame.zs"
#include "zscript/games/duke/actors/firefly.zs"
#include "zscript/games/duke/actors/lavapool.zs"
#include "zscript/games/duke/actors/powderkeg.zs"
#include "zscript/games/duke/actors/redneckmisc.zs"

View file

@ -0,0 +1,56 @@
class DukeLavaPool : DukeActor
{
default
{
pic "LAVAPOOL";
}
override void Initialize()
{
bool away = self.isAwayFromWall(6.75);
if (!away)
{
self.ChangeStat(STAT_MISC);
self.scale = (0, 0);
return;
}
if (self.sector.lotag == 1)
{
return;
}
self.cstat |= CSTAT_SPRITE_ALIGNMENT_FLOOR;
double c, f;
[c, f] = self.sector.getslopes(self.pos.XY);
self.pos.Z = f - 0.78125;
if (self != self.ownerActor)
self.scale = (REPEAT_SCALE, REPEAT_SCALE);
self.ChangeStat(STAT_MISC);
}
}
class DukeLavaPoolBubble : DukeActor
{
default
{
pic "LAVAPOOLBUBBLE";
}
override void Initialize()
{
let owner = self.ownerActor;
self.ChangeStat(STAT_MISC);
if (owner.scale.X < 0.46875)
{
self.scale = (0, 0);
return;
}
self.pos.X += frandom(-16, 16);
self.pos.Y += frandom(-16, 16);
self.scale = (0.25, 0.25);
}
}

View file

@ -1048,3 +1048,12 @@ class RedneckSawBlade : DukeProjectile
return true;
}
}
class RedneckCircleStuck : DukeActor
{
default
{
pic "CIRCLESTUCK";
}
}