- scriptified a few more skeleton items needed by PicforName.

This commit is contained in:
Christoph Oelckers 2022-12-12 12:48:41 +01:00
parent ccc048136f
commit 673ea69d35
21 changed files with 174 additions and 48 deletions

View file

@ -35,6 +35,8 @@ xx(RedneckJaildoorSound)
xx(RedneckGeometryEffect)
xx(RedneckKeyinfoSetter)
xx(DukeSectorEffector)
xx(RedneckGoogooCluster)
xx(DukeAtomicHealth)
xx(spawnstate)
xx(brokenstate)

View file

@ -140,9 +140,6 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
}
break;
case DTILE_ATOMICHEALTH:
t->pos.Z -= 4;
break;
case DTILE_CRYSTALAMMO:
t->shade = int(BobVal(PlayClock << 4) * 16);
continue;
@ -303,7 +300,6 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
switch (h->spr.picnum)
{
case DTILE_ATOMICHEALTH:
case DTILE_GROWSPARK:
case DTILE_CHAINGUN:
case DTILE_SHRINKEREXPLOSION:

View file

@ -139,9 +139,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
}
break;
case RTILE_ATOMICHEALTH:
t->pos.Z -= 4;
break;
case RTILE_CRYSTALAMMO:
t->shade = int(BobVal(PlayClock << 4) * 16);
break;
@ -350,7 +347,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
t->shade = -127;
break;
case RTILE_ATOMICHEALTH:
case RTILE_CHAINGUN:
case RTILE_EXPLOSION3:
t->shade = -127;

View file

@ -171,7 +171,6 @@ int TILE_STATIC;
int TILE_BOTTOMSTATUSBAR;
int TILE_THREEDEE;
int TILE_INGAMEDUKETHREEDEE;
int TILE_ATOMICHEALTH;
int TILE_FIRE;
int TILE_WATERBUBBLE;
int TILE_SMALLSMOKE;

View file

@ -286,7 +286,6 @@ void initactorflags_d()
TILE_CAMLIGHT = DTILE_CAMLIGHT;
TILE_STATIC = DTILE_STATIC;
TILE_BOTTOMSTATUSBAR = isWorldTour()? DTILE_WIDESCREENSTATUSBAR : DTILE_BOTTOMSTATUSBAR;
TILE_ATOMICHEALTH = DTILE_ATOMICHEALTH;
TILE_FIRE = DTILE_FIRE;
TILE_WATERBUBBLE = DTILE_WATERBUBBLE;
TILE_SMALLSMOKE = DTILE_SMALLSMOKE;

View file

@ -286,7 +286,6 @@ void initactorflags_r()
TILE_CAMLIGHT = RTILE_CAMLIGHT;
TILE_STATIC = RTILE_STATIC;
TILE_BOTTOMSTATUSBAR = RTILE_BOTTOMSTATUSBAR;
TILE_ATOMICHEALTH = RTILE_ATOMICHEALTH;
TILE_FIRE = RTILE_FIRE;
TILE_WATERBUBBLE = RTILE_WATERBUBBLE;
TILE_SMALLSMOKE = RTILE_SMALLSMOKE;

View file

@ -2011,7 +2011,7 @@ int ParseState::parse(void)
if (ps[g_p].drink_amt < 0)
ps[g_p].drink_amt = 0;
j = ps[g_p].GetActor()->spr.extra;
if (g_ac->spr.picnum != TILE_ATOMICHEALTH)
if (g_ac->GetClass()->TypeName != NAME_RedneckGoogooCluster)
{
if (j > gs.max_player_health && *insptr > 0)
{
@ -2072,7 +2072,7 @@ int ParseState::parse(void)
j = ps[g_p].GetActor()->spr.extra;
if(g_ac->spr.picnum != TILE_ATOMICHEALTH)
if(!g_ac->IsKindOf(NAME_DukeAtomicHealth) && g_ac->GetClass()->TypeName != NAME_RedneckGoogooCluster)
{
if( j > gs.max_player_health && *insptr > 0 )
{

View file

@ -12,7 +12,6 @@ extern int TILE_CAMCORNER;
extern int TILE_CAMLIGHT;
extern int TILE_STATIC;
extern int TILE_BOTTOMSTATUSBAR;
extern int TILE_ATOMICHEALTH;
extern int TILE_FIRE;
extern int TILE_WATERBUBBLE;
extern int TILE_SMALLSMOKE;

View file

@ -433,7 +433,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break;
[[fallthrough]];
case DTILE_ATOMICHEALTH:
case DTILE_STEROIDS:
case DTILE_HEATSENSOR:
case DTILE_SHIELD:
@ -455,7 +454,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case DTILE_HBOMBAMMO:
case DTILE_CRYSTALAMMO:
case DTILE_GROWAMMO:
case DTILE_BATTERYAMMO:
case DTILE_DEVISTATORAMMO:
case DTILE_RPGAMMO:
case DTILE_BOOTS:
@ -463,7 +461,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case DTILE_AMMOLOTS:
case DTILE_COLA:
case DTILE_FIRSTAID:
case DTILE_SIXPAK:
if (actj)
{
act->spr.lotag = 0;
@ -490,9 +487,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case DTILE_ACCESSCARD:
if (act->spr.picnum == DTILE_ATOMICHEALTH)
act->spr.cstat |= CSTAT_SPRITE_YCENTER;
if (ud.multimode > 1 && ud.coop != 1 && act->spr.picnum == DTILE_ACCESSCARD)
{
act->spr.scale = DVector2(0, 0);

View file

@ -204,7 +204,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case RTILE_MINIONBOAT:
case RTILE_HULKBOAT:
case RTILE_CHEERBOAT:
case RTILE_RABBIT:
case RTILE_ROCK:
case RTILE_ROCK2:
case RTILE_MAMACLOUD:
@ -320,10 +319,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.scale = DVector2(0.25, 0.25);
act->setClipDistFromTile();
break;
case RTILE_RABBIT:
act->spr.scale = DVector2(0.28125, 0.28125);
act->setClipDistFromTile();
break;
case RTILE_MAMACLOUD:
act->spr.scale = DVector2(1, 1);
act->spr.cstat = CSTAT_SPRITE_TRANSLUCENT;
@ -434,9 +429,8 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
if (act->spr.picnum != 5501)
if (actorfella(act))
ps[myconnectindex].max_actors_killed++;
if (actorfella(act))
ps[myconnectindex].max_actors_killed++;
if (actj)
{
@ -457,7 +451,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (!isRRRA()) goto default_case;
[[fallthrough]];
case RTILE_ATOMICHEALTH:
case RTILE_STEROIDS:
case RTILE_HEATSENSOR:
case RTILE_SHIELD:
@ -479,7 +472,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case RTILE_HBOMBAMMO:
case RTILE_CRYSTALAMMO:
case RTILE_GROWAMMO:
case RTILE_BATTERYAMMO:
case RTILE_DEVISTATORAMMO:
case RTILE_RPGAMMO:
case RTILE_BOOTS:
@ -487,7 +479,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case RTILE_AMMOLOTS:
case RTILE_BEER:
case RTILE_FIRSTAID:
case RTILE_SIXPAK:
case RTILE_SAWAMMO:
case RTILE_BOWLINGBALLSPRITE:
@ -524,9 +515,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case RTILE_ACCESSCARD:
if (act->spr.picnum == RTILE_ATOMICHEALTH)
act->spr.cstat |= CSTAT_SPRITE_YCENTER;
if (ud.multimode > 1 && ud.coop != 1 && act->spr.picnum == RTILE_ACCESSCARD)
{
act->spr.scale = DVector2(0, 0);
@ -557,10 +545,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.scale = DVector2(0.28125, 0.265625);
if (isRRRA()) act->spr.cstat = CSTAT_SPRITE_BLOCK_HITSCAN;
break;
case RTILE_SIXPAK:
act->spr.scale = DVector2(0.203125, 0.140625);
if (isRRRA()) act->spr.cstat = CSTAT_SPRITE_BLOCK_HITSCAN;
break;
case RTILE_FIRSTAID:
act->spr.scale = DVector2(0.125, 0.125);
break;
@ -593,9 +577,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case RTILE_AIRTANK:
act->spr.scale = DVector2(0.296875, 0.25);
break;
case RTILE_BATTERYAMMO:
act->spr.scale = DVector2(0.234375, 0.234375);
break;
case RTILE_BOWLINGBALLSPRITE:
act->spr.scale = DVector2(0.171875, 0.171875);
break;

View file

@ -14,9 +14,6 @@ int PicForName(int intname)
if (classnameToTile.CountUsed() == 0)
{
static std::pair<const char*, const char*> classes[] = {
{"RedneckRabbit","RABBIT"},
{"DukeBatteryAmmo", "BATTERYAMMO"},
{"DukeSixpak", "SIXPAK"},
{"DukeAtomicHealth", "ATOMICHEALTH"},
{"DukeShrinkerExplosion", "SHRINKEREXPLOSION" },
{"DukeWaterBubble", "WATERBUBBLE"},

View file

@ -244,5 +244,7 @@ spawnclasses
2310 = DukeBurning2
1890 = DukeExplosion2
2219 = DukeExplosion2Bot
41 = DukeBatteryAmmo
52 = DukeSixpak
100 = DukeAtomicHealth
}

View file

@ -160,4 +160,7 @@ spawnclasses
7506 = DukeActor, "*RRTILE7506"
8860 = RedneckBellSwitch
// stuff below uses CON
7280 = RedneckRabbit
}

View file

@ -278,6 +278,9 @@ spawnclasses
1196 = DukeToiletWater
1494 = DukeBurning
1441 = DukeExplosion2
41 = RedneckRifleAmmo
52 = RedneckPorkRinds
5595 = RedneckGoogooCluster
}

View file

@ -107,6 +107,10 @@ version "4.10"
#include "zscript/games/duke/actors/burning.zs"
#include "zscript/games/duke/actors/explosion2.zs"
#include "zscript/games/duke/actors/batteryammo.zs"
#include "zscript/games/duke/actors/sixpak.zs"
#include "zscript/games/duke/actors/atomichealth.zs"
#include "zscript/games/duke/actors/flamethrowerflame.zs"
#include "zscript/games/duke/actors/firefly.zs"
@ -125,6 +129,8 @@ version "4.10"
#include "zscript/games/duke/actors/airplane.zs"
#include "zscript/games/duke/actors/piano.zs"
#include "zscript/games/duke/actors/rabbit.zs"
#include "zscript/games/duke/world/dukebreak.zs"
#include "zscript/games/duke/world/redneckbreak.zs"

View file

@ -0,0 +1,43 @@
class DukeAtomicHealth : DukeActor
{
default
{
pic "ATOMICHEALTH";
}
override void Initialize()
{
commonItemSetup();
self.cstat |= CSTAT_SPRITE_YCENTER;
}
override bool animate(tspritetype t)
{
t.pos.Z -= 4;
t.shade = -127;
return false;
}
}
class RedneckGoogooCluster : DukeActor
{
default
{
pic "ATOMICHEALTH";
}
override void Initialize()
{
commonItemSetup((0.125, 0.125));
self.cstat |= CSTAT_SPRITE_YCENTER;
}
override bool animate(tspritetype t)
{
t.pos.Z -= 4;
t.shade = -127;
return false;
}
}

View file

@ -0,0 +1,25 @@
class DukeBatteryAmmo : DukeActor
{
default
{
pic "BATTERYAMMO";
}
override void Initialize()
{
commonItemSetup();
}
}
class RedneckRifleAmmo : DukeActor
{
default
{
pic "BATTERYAMMO";
}
override void Initialize()
{
commonItemSetup((0.234375, 0.234375));
}
}

View file

@ -46,7 +46,7 @@ class RedneckGamblingMachine : DukeActor
else
{
spriteindex = 2;
self.spawn("DukeBatteryAmmo");
self.spawn("RedneckRifleAmmo");
pl.SlotWin |= 1;
self.PlayActorSound(winsound);
}
@ -74,7 +74,7 @@ class RedneckGamblingMachine : DukeActor
else
{
spriteindex = 5;
self.spawn("DukeSixpak");
self.spawn("RedneckPorkRinds");
pl.SlotWin |= 4;
self.PlayActorSound(winsound);
}
@ -88,7 +88,7 @@ class RedneckGamblingMachine : DukeActor
else
{
spriteindex = 4;
spawn("DukeAtomicHealth");
spawn("RedneckGoogooCluster");
pl.SlotWin |= 8;
self.PlayActorSound(winsound);
}

View file

@ -0,0 +1,12 @@
class RedneckRabbit : DukeActor
{
default
{
pic "RABBIT";
}
override void Initialize()
{
self.scale = (0.28125, 0.28125);
}
}

View file

@ -0,0 +1,27 @@
class DukeSixpak : DukeActor
{
default
{
pic "SIXPAK";
}
override void Initialize()
{
commonItemSetup();
}
}
class RedneckPorkRinds : DukeActor
{
default
{
pic "SIXPAK";
}
override void Initialize()
{
commonItemSetup((0.203125, 0.140625));
if (Raze.isRRRA()) self.cstat = CSTAT_SPRITE_BLOCK_HITSCAN;
}
}

View file

@ -274,6 +274,49 @@ class DukeActor : CoreActor native
}
void commonItemSetup(Vector2 scale = (0.5, 0.5), int usefloorshade = -1)
{
let owner = self.ownerActor;
if (owner != self)
{
self.lotag = 0;
self.pos.Z -= 32;
self.vel.Z = -4;
self.DoMove(CLIPMASK0);
self.cstat |= randomxflip();
}
else
{
self.cstat = 0;
}
if ((ud.multimode < 2 && self.pal != 0) || (self.lotag > ud.player_skill))
{
self.scale = (0, 0);
self.ChangeStat(STAT_MISC);
return;
}
self.pal = 0;
self.shade = -17;
self.scale = scale;
if (owner != self) self.ChangeStat(STAT_ACTOR);
else
{
self.ChangeStat(STAT_ZOMBIEACTOR);
self.makeitfall();
}
// RR defaults to using the floor shade here, let's make this configurable.
if (usefloorshade == 1 || (usefloorshade == -1 && Raze.isRR()))
{
self.shade = self.sector.floorshade;
}
}
int checkLocationForFloorSprite(double radius)
{
bool away = self.isAwayFromWall(radius);