- exported several RR enemies/animals needed for the UFO spawner.

This commit is contained in:
Christoph Oelckers 2022-12-12 17:51:02 +01:00
parent 9b96f8312a
commit c9888ae6cb
20 changed files with 258 additions and 139 deletions

View file

@ -37,6 +37,7 @@ xx(RedneckKeyinfoSetter)
xx(DukeSectorEffector)
xx(RedneckGoogooCluster)
xx(DukeAtomicHealth)
xx(RedneckHen)
xx(spawnstate)
xx(brokenstate)

View file

@ -3318,10 +3318,9 @@ void movefta(void)
{
if (act->GetClass() == RUNTIME_CLASS(DDukeActor))
{
if (isRR()) check_fta_sounds_r(act);
else check_fta_sounds_d(act);
if (!isRR()) check_fta_sounds_d(act);
}
else
else if (act->spr.extra > 0)
CallPlayFTASound(act);
};

View file

@ -43,28 +43,6 @@ void moveminecart();
//
//---------------------------------------------------------------------------
void check_fta_sounds_r(DDukeActor* actor)
{
if (actor->spr.extra > 0) switch (actor->spr.picnum)
{
case RTILE_COOT: // LIZTROOP
if (!isRRRA() && (krand() & 3) == 2)
S_PlayActorSound(PRED_RECOG, actor);
break;
case RTILE_BILLYCOCK:
case RTILE_BILLYRAY:
case RTILE_BRAYSNIPER: // PIGCOP
S_PlayActorSound(PIG_RECOG, actor);
break;
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void addweapon_r(player_struct* p, int weapon, bool wswitch)
{
int cw = p->curr_weapon;
@ -949,46 +927,8 @@ static void rrra_specialstats()
DukeSpriteIterator itr;
while (auto act = itr.Next())
{
switch (act->spr.picnum)
if (badguy(act))
{
//case 4049:
//case 4050:
case RTILE_BILLYCOCK:
case RTILE_BILLYRAY:
case RTILE_BILLYRAYSTAYPUT:
case RTILE_BRAYSNIPER:
case RTILE_DOGRUN:
case RTILE_LTH:
case RTILE_HULKJUMP:
case RTILE_HULK:
case RTILE_HULKSTAYPUT:
case RTILE_HEN:
case RTILE_DRONE:
case RTILE_PIG:
case RTILE_MINION:
case RTILE_MINIONSTAYPUT:
case RTILE_UFO1_RRRA:
case RTILE_UFO2:
case RTILE_UFO3:
case RTILE_UFO4:
case RTILE_UFO5:
case RTILE_COOT:
case RTILE_COOTSTAYPUT:
case RTILE_VIXEN:
case RTILE_BIKERB:
case RTILE_BIKERBV2:
case RTILE_BIKER:
case RTILE_MAKEOUT:
case RTILE_CHEERB:
case RTILE_CHEER:
case RTILE_CHEERSTAYPUT:
case RTILE_COOTPLAY:
case RTILE_BILLYPLAY:
case RTILE_MINIONBOAT:
case RTILE_HULKBOAT:
case RTILE_CHEERBOAT:
case RTILE_RABBIT:
case RTILE_MAMA:
if (enemysizecheat == 3)
{
act->spr.scale *= 2;
@ -998,11 +938,10 @@ static void rrra_specialstats()
{
act->spr.scale *= 0.5;
auto tex = TexMan.GetGameTexture(act->spr.spritetexture());
act->clipdist = act->spr.scale.X, tex->GetDisplayHeight() * 0.125;
act->setClipDistFromTile();
}
break;
}
}
enemysizecheat = 0;
}

View file

@ -364,11 +364,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
if (t->picnum >= RTILE_CHEER + 102 && t->picnum <= RTILE_CHEER + 151)
t->shade = -127;
break;
case RTILE_MINION:
if (!isRRRA()) break;
if (t->pal == 19)
t->shade = -127;
break;
case RTILE_BIKER:
if (!isRRRA()) break;
if (t->picnum >= RTILE_BIKER + 54 && t->picnum <= RTILE_BIKER + 58)
@ -376,12 +371,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
else if (t->picnum >= RTILE_BIKER + 84 && t->picnum <= RTILE_BIKER + 88)
t->shade = -127;
break;
case RTILE_BILLYRAY:
case RTILE_BILLYRAYSTAYPUT:
if (!isRRRA()) break;
if (t->picnum >= RTILE_BILLYRAY + 5 && t->picnum <= RTILE_BILLYRAY + 9)
t->shade = -127;
break;
case RTILE_RRTILE2034:
t->picnum = RTILE_RRTILE2034 + ((PlayClock >> 2) & 1);
break;

View file

@ -119,7 +119,7 @@ static const char *cheatKfc(int player)
{
for (int i = 0; i < 7; i++)
{
auto spr = spawn(ps[player].GetActor(), TILE_HEN);
auto spr = spawn(ps[player].GetActor(), PClass::FindActor(NAME_RedneckHen));
if (spr)
{
spr->spr.pal = 1;

View file

@ -176,7 +176,6 @@ int TILE_WATERBUBBLE;
int TILE_SMALLSMOKE;
int TILE_BLOODPOOL;
int TILE_CLOUDYSKIES;
int TILE_HEN;
int TILE_MIRRORBROKE;
int TILE_LOADSCREEN;
int TILE_CROSSHAIR;

View file

@ -63,9 +63,7 @@ void initactorflags_r()
RTILE_BUBBASTAND,
RTILE_HULK,
RTILE_HULKSTAYPUT,
RTILE_HEN,
RTILE_DRONE,
RTILE_PIG,
RTILE_RECON,
RTILE_MINION,
RTILE_MINIONSTAYPUT,
@ -83,8 +81,6 @@ void initactorflags_r()
RTILE_CHEERB,
RTILE_CHEER,
RTILE_CHEERSTAYPUT,
RTILE_COOTPLAY,
RTILE_BILLYPLAY,
RTILE_MINIONBOAT,
RTILE_HULKBOAT,
RTILE_CHEERBOAT,
@ -99,9 +95,7 @@ void initactorflags_r()
RTILE_UFO4,
RTILE_UFO5 });
// Why does the pig count as kill? Let's undo that.
gs.actorinfo[RTILE_PIG].flags &= ~SFLAG_KILLCOUNT;
gs.actorinfo[RTILE_HEN].flags &= ~SFLAG_KILLCOUNT;
setflag(SFLAG_INTERNAL_BADGUY, { RTILE_PIG, RTILE_HEN });
gs.actorinfo[RTILE_DRONE].flags |= SFLAG_NOWATERDIP;
gs.actorinfo[RTILE_VIXEN].flags |= SFLAG_NOCANSEECHECK;
@ -111,6 +105,7 @@ void initactorflags_r()
setflag(SFLAG_NODAMAGEPUSH, { RTILE_HULK, RTILE_MAMA, RTILE_BILLYPLAY, RTILE_COOTPLAY, RTILE_MAMACLOUD });
setflag(SFLAG_NOCANSEECHECK, { RTILE_COOT, RTILE_COOTSTAYPUT, RTILE_BIKERB, RTILE_BIKERBV2, RTILE_CHEER, RTILE_CHEERB,
RTILE_CHEERSTAYPUT, RTILE_MINIONBOAT, RTILE_HULKBOAT, RTILE_CHEERBOAT, RTILE_RABBIT, RTILE_COOTPLAY, RTILE_BILLYPLAY, RTILE_MAKEOUT, RTILE_MAMA });
setflag(SFLAG_INTERNAL_BADGUY, { RTILE_COOTPLAY, RTILE_BILLYPLAY });
}
else
{
@ -293,7 +288,6 @@ void initactorflags_r()
TILE_BLOODPOOL = RTILE_BLOODPOOL;
TILE_CLOUDYSKIES = RTILE_CLOUDYSKIES;
TILE_MIRRORBROKE = RTILE_MIRRORBROKE;
TILE_HEN = RTILE_HEN;
TILE_LOADSCREEN = RTILE_LOADSCREEN;
TILE_CROSSHAIR = RTILE_CROSSHAIR;
TILE_EGG = RTILE_EGG;

View file

@ -80,7 +80,6 @@ void handle_se128(DDukeActor* i);
void handle_se130(DDukeActor* i, int countmax, int EXPLOSION2);
void check_fta_sounds_d(DDukeActor* i);
void check_fta_sounds_r(DDukeActor* i);
int dodge(DDukeActor*);
void alterang(int ang, DDukeActor* actor, int g_p);

View file

@ -17,7 +17,6 @@ extern int TILE_WATERBUBBLE;
extern int TILE_SMALLSMOKE;
extern int TILE_BLOODPOOL;
extern int TILE_CLOUDYSKIES;
extern int TILE_HEN;
extern int TILE_MIRRORBROKE;
extern int TILE_LOADSCREEN;
extern int TILE_CROSSHAIR;

View file

@ -560,7 +560,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw
{
if (isRRRA() && atwith == RTILE_RPG2)
{
if (aimed->spr.picnum == RTILE_HEN || aimed->spr.picnum == RTILE_HENSTAYPUT)
if (aimed->IsKindOf(NAME_RedneckHen))
act90 = ps[screenpeek].GetActor();
else
act90 = aimed;
@ -3605,13 +3605,13 @@ HORIZONLY:
}
else if (badguy(clip.actor()))
{
if (clip.actor()->spr.statnum != 1)
if (clip.actor()->spr.statnum != STAT_ACTOR)
{
clip.actor()->timetosleep = 0;
if (clip.actor()->spr.picnum == RTILE_BILLYRAY)
S_PlayActorSound(404, clip.actor());
else
check_fta_sounds_r(clip.actor());
CallPlayFTASound(clip.actor());
ChangeActorStat(clip.actor(), 1);
}
}

View file

@ -204,31 +204,18 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (isRRRA()) goto default_case;
[[fallthrough]];
case RTILE_BILLYRAYSTAYPUT:
case RTILE_BRAYSNIPER:
case RTILE_BUBBASTAND:
case RTILE_HULKSTAYPUT:
case RTILE_HENSTAYPUT:
case RTILE_PIGSTAYPUT:
case RTILE_MINIONSTAYPUT:
case RTILE_COOTSTAYPUT:
rrra_stayput:
act->actorstayput = act->sector();
[[fallthrough]];
case RTILE_BOULDER:
case RTILE_BOULDER1:
case RTILE_TORNADO:
case RTILE_BILLYCOCK:
case RTILE_BILLYRAY:
case RTILE_DOGRUN:
case RTILE_LTH:
case RTILE_HULK:
case RTILE_HEN:
case RTILE_DRONE:
case RTILE_PIG:
case RTILE_MINION:
case RTILE_COW:
case RTILE_COOT:
case RTILE_VIXEN:
rrra_badguy2:
act->spr.scale = DVector2(0.625, 0.625);
@ -255,8 +242,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->setClipDistFromTile();
break;
case RTILE_COOTPLAY:
case RTILE_COOT:
case RTILE_COOTSTAYPUT:
act->spr.scale = DVector2(0.375, 0.28125);
act->setClipDistFromTile();
act->clipdist *= 4;
@ -267,40 +252,11 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break;
case RTILE_SBSWIPE:
case RTILE_BILLYPLAY:
case RTILE_BILLYCOCK:
case RTILE_BILLYRAY:
case RTILE_BILLYRAYSTAYPUT:
case RTILE_BRAYSNIPER:
case RTILE_BUBBASTAND:
act->spr.scale = DVector2(0.390625, 0.328125);
act->setClipDistFromTile();
break;
case RTILE_COW:
act->spr.scale = DVector2(0.5, 0.5);
act->setClipDistFromTile();
break;
case RTILE_HEN:
case RTILE_HENSTAYPUT:
if (act->spr.pal == 35)
{
act->spr.scale = DVector2(0.65625, 0.46875);
act->setClipDistFromTile();
}
else
{
act->spr.scale = DVector2(0.328125, 0.234375);
act->clipdist = 16;
}
break;
case RTILE_MINION:
case RTILE_MINIONSTAYPUT:
act->spr.scale = DVector2(0.25, 0.25);
act->setClipDistFromTile();
if (isRRRA() && ud.ufospawnsminion)
act->spr.pal = 8;
break;
case RTILE_DOGRUN:
case RTILE_PIG:
act->spr.scale = DVector2(0.25, 0.25);
act->setClipDistFromTile();
break;
@ -420,7 +376,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (actj)
{
act->timetosleep = 0;
check_fta_sounds_r(act);
CallPlayFTASound(act);
ChangeActorStat(act, STAT_ACTOR);
act->spr.shade = actj->spr.shade;
}

View file

@ -284,5 +284,18 @@ spawnclasses
240 = DukeWaterBubble
3388 = RedneckCircleStuck
4861 = RedneckHen
4862 = RedneckHenStayput
5376 = RedneckCoot
5377 = RedneckCootStayput
5317 = RedneckCow
4945 = RedneckPig
4946 = RedneckPigStayput
4162 = RedneckBillyRay
4163 = RedneckBillyRayStayput
4147 = RedneckBillyRayCock
4249 = RedneckBillyRaySniper
5120 = RedneckMinion
5121 = RedneckMinionStayput
}

View file

@ -132,6 +132,12 @@ version "4.10"
#include "zscript/games/duke/actors/airplane.zs"
#include "zscript/games/duke/actors/piano.zs"
#include "zscript/games/duke/actors/coot.zs"
#include "zscript/games/duke/actors/billyray.zs"
#include "zscript/games/duke/actors/minion.zs"
#include "zscript/games/duke/actors/hen.zs"
#include "zscript/games/duke/actors/cow.zs"
#include "zscript/games/duke/actors/pig.zs"
#include "zscript/games/duke/actors/rabbit.zs"
#include "zscript/games/duke/world/dukebreak.zs"

View file

@ -0,0 +1,72 @@
class RedneckBillyRay : DukeActor
{
default
{
pic "BILLYRAY";
}
override void PlayFTASound()
{
self.PlayActorSound("BR_RECOG");
}
override void Initialize()
{
self.scale = (0.390625, 0.328125);
self.setClipDistFromTile();
}
override bool animate(tspritetype t)
{
if (Raze.isRRRA())
{
/* todo: define this in the animation.
if (t->picnum >= RTILE_BILLYRAY + 5 && t->picnum <= RTILE_BILLYRAY + 9)
t->shade = -127;
*/
}
return false;
}
}
class RedneckBillyRayStayput: RedneckBillyRay
{
default
{
pic "BILLYRAYSTAYPUT";
}
override void PlayFTASound()
{
}
override void initialize()
{
super.initialize();
self.actorstayput = self.sector; // make this a flag once everything has been exported.
}
}
class RedneckBillyRayCock: RedneckBillyRay
{
default
{
pic "BILLYCOCK";
}
}
class RedneckBillyRaySniper: RedneckBillyRay
{
default
{
pic "BRAYSNIPER";
}
override void initialize()
{
super.initialize();
self.actorstayput = self.sector; // make this a flag once everything has been exported.
}
}

View file

@ -39,8 +39,7 @@ class RedneckBowlingPin : DukeActor
let hitact = DukeActor(coll.hitActor());
// avoid checkhitsprite here. The way this was handled was just wrong on all accounts
self.collide(hitact);
//if (hitact is "RedneckHen") // does not work yet - Hen is not scriptified.
if (hitact.checkType("HEN")) // Temporary workaround
if (hitact is "RedneckHen")
{
let ns = hitact.spawn("RedneckHenstand");
hitact.scale = (0,0);

View file

@ -0,0 +1,38 @@
class RedneckCoot : DukeActor
{
default
{
pic "COOT";
}
override void PlayFTASound()
{
if (!Raze.isRRRA() && (random(0, 3)) == 2)
self.PlayActorSound("CT_GET");
}
override void Initialize()
{
self.scale = (0.375, 0.28125);
self.setClipDistFromTile();
self.clipdist *= 4;
}
}
class RedneckCootStayput: RedneckCoot
{
default
{
pic "COOTSTAYPUT";
}
override void PlayFTASound()
{
}
override void initialize()
{
super.initialize();
self.actorstayput = self.sector; // make this a flag once everything has been exported.
}
}

View file

@ -0,0 +1,14 @@
class RedneckCow : DukeActor
{
default
{
pic "COW";
}
override void Initialize()
{
self.scale = (0.5, 0.5);
self.setClipDistFromTile();
}
}

View file

@ -0,0 +1,35 @@
class RedneckHen : DukeActor
{
default
{
pic "HEN";
}
override void Initialize()
{
if (self.pal == 35)
{
self.scale = (0.65625, 0.46875);
self.setClipDistFromTile();
}
else
{
self.scale = (0.328125, 0.234375);
self.clipdist = 16;
}
}
}
class RedneckHenStayput: RedneckHen
{
default
{
pic "HENSTAYPUT";
}
override void initialize()
{
super.initialize();
self.actorstayput = self.sector; // make this a flag once everything has been exported.
}
}

View file

@ -0,0 +1,40 @@
class RedneckMinion : DukeActor
{
default
{
pic "MINION";
}
override void Initialize()
{
self.scale = (0.25, 0.25);
self.setClipDistFromTile();
if (Raze.isRRRA() && ud.ufospawnsminion)
self.pal = 8;
}
override bool animate(tspritetype t)
{
if (Raze.isRRRA() && t.pal == 19)
t.shade = -127;
return false;
}
}
class RedneckMinionStayput: RedneckMinion
{
default
{
pic "MINIONSTAYPUT";
}
override void PlayFTASound()
{
}
override void initialize()
{
super.initialize();
self.actorstayput = self.sector; // make this a flag once everything has been exported.
}
}

View file

@ -0,0 +1,27 @@
class RedneckPig : DukeActor
{
default
{
pic "PIG";
}
override void Initialize()
{
self.scale = (0.25, 0.25);;
self.setClipDistFromTile();
}
}
class RedneckPigStayput: RedneckPig
{
default
{
pic "PIGSTAYPUT";
}
override void initialize()
{
super.initialize();
self.actorstayput = self.sector; // make this a flag once everything has been exported.
}
}