mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- scriptified all remaining Duke actors with specific init code and no CON part.
This commit is contained in:
parent
c9628db264
commit
bdc474d04f
23 changed files with 348 additions and 276 deletions
|
@ -26,6 +26,7 @@ xx(DukeGlassPieces2)
|
|||
xx(DukeNaturalLightning)
|
||||
xx(RedneckBowlingPin)
|
||||
xx(DukeReactor)
|
||||
xx(DukeFootprints)
|
||||
|
||||
xx(spawnstate)
|
||||
xx(brokenstate)
|
||||
|
|
|
@ -58,26 +58,13 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t = tsprites.get(j);
|
||||
h = static_cast<DDukeActor*>(t->ownerActor);
|
||||
|
||||
if (!actorflag(h, SFLAG2_FORCESECTORSHADE))
|
||||
switch (t->picnum)
|
||||
if (!actorflag(h, SFLAG2_FORCESECTORSHADE) && ((t->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) || (badguypic(t->picnum) && t->extra > 0) || t->statnum == STAT_PLAYER)
|
||||
{
|
||||
case DEVELOPERCOMMENTARY:
|
||||
case DEVELOPERCOMMENTARYON:
|
||||
if (isWorldTour() && !wt_commentary)
|
||||
t->scale = DVector2(0, 0);
|
||||
break;
|
||||
case FOOTPRINTS:
|
||||
case FOOTPRINTS2:
|
||||
case FOOTPRINTS3:
|
||||
case FOOTPRINTS4:
|
||||
if (t->shade == 127) continue;
|
||||
break;
|
||||
case BULLETHOLE:
|
||||
t->shade = 16;
|
||||
if (h->sector()->shadedsector == 1 && h->spr.statnum != 1)
|
||||
{
|
||||
t->shade = 16;
|
||||
}
|
||||
continue;
|
||||
default:
|
||||
if (((t->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) || (badguypic(t->picnum) && t->extra > 0) || t->statnum == STAT_PLAYER)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (t->sectp != nullptr)
|
||||
|
@ -151,13 +138,6 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
case DUKELYINGDEAD:
|
||||
t->pos.Z += 24;
|
||||
break;
|
||||
case FOOTPRINTS:
|
||||
case FOOTPRINTS2:
|
||||
case FOOTPRINTS3:
|
||||
case FOOTPRINTS4:
|
||||
if (t->pal == 6)
|
||||
t->shade = -127;
|
||||
break;
|
||||
case BURNING:
|
||||
case BURNING2:
|
||||
if (OwnerAc && OwnerAc->spr.statnum == STAT_PLAYER)
|
||||
|
|
|
@ -53,34 +53,13 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t = tsprites.get(j);
|
||||
h = static_cast<DDukeActor*>(t->ownerActor);
|
||||
|
||||
switch (t->picnum)
|
||||
if (!actorflag(h, SFLAG2_FORCESECTORSHADE) && ((t->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) || (badguypic(t->picnum) && t->extra > 0) || t->statnum == STAT_PLAYER)
|
||||
{
|
||||
case FOOTPRINTS:
|
||||
case FOOTPRINTS2:
|
||||
case FOOTPRINTS3:
|
||||
case FOOTPRINTS4:
|
||||
if (t->shade == 127) continue;
|
||||
break;
|
||||
case BULLETHOLE:
|
||||
t->shade = 16;
|
||||
continue;
|
||||
|
||||
case RRTILE1947:
|
||||
case RRTILE2859:
|
||||
case RRTILE3774:
|
||||
case RRTILE8096:
|
||||
if (isRRRA()) continue;
|
||||
|
||||
default:
|
||||
if (((t->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) || (badguypic(t->picnum) && t->extra > 0) || t->statnum == STAT_PLAYER)
|
||||
if (h->sector()->shadedsector == 1 && h->spr.statnum != 1)
|
||||
{
|
||||
if (h->sector()->shadedsector == 1 && h->spr.statnum != 1)
|
||||
{
|
||||
h->spr.shade = 16;
|
||||
t->shade = 16;
|
||||
}
|
||||
continue;
|
||||
t->shade = 16;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (t->sectp != nullptr)
|
||||
|
@ -158,13 +137,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
if (h->spr.extra > 0)
|
||||
t->pos.Z += 6;
|
||||
break;
|
||||
case FOOTPRINTS:
|
||||
case FOOTPRINTS2:
|
||||
case FOOTPRINTS3:
|
||||
case FOOTPRINTS4:
|
||||
if (t->pal == 6)
|
||||
t->shade = -127;
|
||||
break;
|
||||
case POWDERKEG:
|
||||
continue;
|
||||
case BURNING:
|
||||
|
|
|
@ -193,10 +193,6 @@ int TILE_FIRE;
|
|||
int TILE_WATERBUBBLE;
|
||||
int TILE_SMALLSMOKE;
|
||||
int TILE_BLOODPOOL;
|
||||
int TILE_FOOTPRINTS;
|
||||
int TILE_FOOTPRINTS2;
|
||||
int TILE_FOOTPRINTS3;
|
||||
int TILE_FOOTPRINTS4;
|
||||
int TILE_CLOUDYSKIES;
|
||||
int TILE_ACCESSSWITCH;
|
||||
int TILE_ACCESSSWITCH2;
|
||||
|
|
|
@ -245,10 +245,6 @@ void initactorflags_d()
|
|||
TILE_WATERBUBBLE = WATERBUBBLE;
|
||||
TILE_SMALLSMOKE = SMALLSMOKE;
|
||||
TILE_BLOODPOOL = BLOODPOOL;
|
||||
TILE_FOOTPRINTS = FOOTPRINTS;
|
||||
TILE_FOOTPRINTS2 = FOOTPRINTS2;
|
||||
TILE_FOOTPRINTS3 = FOOTPRINTS3;
|
||||
TILE_FOOTPRINTS4 = FOOTPRINTS4;
|
||||
TILE_CLOUDYSKIES = CLOUDYSKIES;
|
||||
TILE_ACCESSSWITCH = ACCESSSWITCH;
|
||||
TILE_ACCESSSWITCH2 = ACCESSSWITCH2;
|
||||
|
|
|
@ -252,10 +252,6 @@ void initactorflags_r()
|
|||
TILE_WATERBUBBLE = WATERBUBBLE;
|
||||
TILE_SMALLSMOKE = SMALLSMOKE;
|
||||
TILE_BLOODPOOL = BLOODPOOL;
|
||||
TILE_FOOTPRINTS = FOOTPRINTS;
|
||||
TILE_FOOTPRINTS2 = FOOTPRINTS2;
|
||||
TILE_FOOTPRINTS3 = FOOTPRINTS3;
|
||||
TILE_FOOTPRINTS4 = FOOTPRINTS4;
|
||||
TILE_CLOUDYSKIES = CLOUDYSKIES;
|
||||
TILE_ACCESSSWITCH = ACCESSSWITCH;
|
||||
TILE_ACCESSSWITCH2 = ACCESSSWITCH2;
|
||||
|
|
|
@ -174,7 +174,6 @@ bool initspriteforspawn(DDukeActor* spn);
|
|||
void spawninitdefault(DDukeActor* actj, DDukeActor* act);
|
||||
void spawntransporter(DDukeActor* actj, DDukeActor* acti, bool beam);
|
||||
int spawnbloodpoolpart1(DDukeActor* acti);
|
||||
void initfootprint(DDukeActor* actj, DDukeActor* acti);
|
||||
void initshell(DDukeActor* actj, DDukeActor* acti, bool isshell);
|
||||
void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors);
|
||||
int startrts(int lumpNum, int localPlayer);
|
||||
|
|
|
@ -18,10 +18,6 @@ extern int TILE_FIRE;
|
|||
extern int TILE_WATERBUBBLE;
|
||||
extern int TILE_SMALLSMOKE;
|
||||
extern int TILE_BLOODPOOL;
|
||||
extern int TILE_FOOTPRINTS;
|
||||
extern int TILE_FOOTPRINTS2;
|
||||
extern int TILE_FOOTPRINTS3;
|
||||
extern int TILE_FOOTPRINTS4;
|
||||
extern int TILE_CLOUDYSKIES;
|
||||
extern int TILE_ACCESSSWITCH;
|
||||
extern int TILE_ACCESSSWITCH2;
|
||||
|
|
|
@ -508,7 +508,7 @@ void footprints(int snum)
|
|||
DukeSectIterator it(actor->sector());
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->spr.picnum == TILE_FOOTPRINTS || act->spr.picnum == TILE_FOOTPRINTS2 || act->spr.picnum == TILE_FOOTPRINTS3 || act->spr.picnum == TILE_FOOTPRINTS4)
|
||||
if (act->IsKindOf(NAME_DukeFootprints))
|
||||
if (abs(act->spr.pos.X - p->GetActor()->spr.pos.X) < 24)
|
||||
if (abs(act->spr.pos.Y - p->GetActor()->spr.pos.Y) < 24)
|
||||
{
|
||||
|
@ -521,16 +521,10 @@ void footprints(int snum)
|
|||
p->footprintcount--;
|
||||
if (p->cursector->lotag == 0 && p->cursector->hitag == 0)
|
||||
{
|
||||
DDukeActor* fprint;
|
||||
switch (krand() & 3)
|
||||
{
|
||||
case 0: fprint = spawn(actor, TILE_FOOTPRINTS); break;
|
||||
case 1: fprint = spawn(actor, TILE_FOOTPRINTS2); break;
|
||||
case 2: fprint = spawn(actor, TILE_FOOTPRINTS3); break;
|
||||
default: fprint = spawn(actor, TILE_FOOTPRINTS4); break;
|
||||
}
|
||||
DDukeActor* fprint = spawn(actor, PClass::FindActor(NAME_DukeFootprints));
|
||||
if (fprint)
|
||||
{
|
||||
fprint->spr.Angles.Yaw = p->actor->spr.Angles.Yaw;
|
||||
fprint->spr.pal = p->footprintpal;
|
||||
fprint->spr.shade = (int8_t)p->footprintshade;
|
||||
}
|
||||
|
|
|
@ -198,22 +198,6 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act)
|
|||
case ALIENSWITCH:
|
||||
case ALIENSWITCHON:
|
||||
break;
|
||||
case DEVELOPERCOMMENTARY + 1: //Twentieth Anniversary World Tour
|
||||
if (act)
|
||||
{
|
||||
StopCommentary();
|
||||
act->spr.picnum = DEVELOPERCOMMENTARY;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case DEVELOPERCOMMENTARY: //Twentieth Anniversary World Tour
|
||||
if (act)
|
||||
{
|
||||
if (StartCommentary(lotag, act))
|
||||
act->spr.picnum = DEVELOPERCOMMENTARY+1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case ACCESSSWITCH:
|
||||
case ACCESSSWITCH2:
|
||||
if (ps[snum].access_incs == 0)
|
||||
|
@ -1220,20 +1204,8 @@ void checksectors_d(int snum)
|
|||
{
|
||||
if (fi.checkhitswitch(snum, nullptr, neartagsprite)) return;
|
||||
|
||||
if (neartagsprite->GetClass() != RUNTIME_CLASS(DDukeActor))
|
||||
{
|
||||
if (CallOnUse(neartagsprite, p))
|
||||
return;
|
||||
}
|
||||
else
|
||||
switch (neartagsprite->spr.picnum)
|
||||
{
|
||||
case PLUG:
|
||||
S_PlayActorSound(SHORT_CIRCUIT, pact);
|
||||
p->GetActor()->spr.extra -= 2 + (krand() & 3);
|
||||
SetPlayerPal(p, PalEntry(32, 48, 48, 64));
|
||||
break;
|
||||
}
|
||||
if (CallOnUse(neartagsprite, p))
|
||||
return;
|
||||
}
|
||||
|
||||
if (!PlayerInput(snum, SB_OPEN)) return;
|
||||
|
|
|
@ -1631,11 +1631,6 @@ void checksectors_r(int snum)
|
|||
if (!isRRRA()) return;
|
||||
OnBoat(p, neartagsprite);
|
||||
return;
|
||||
|
||||
case PLUG:
|
||||
S_PlayActorSound(SHORT_CIRCUIT, pact);
|
||||
p->GetActor()->spr.extra -= 2 + (krand() & 3);
|
||||
SetPlayerPal(p, PalEntry(32, 48, 48, 64));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,6 +80,8 @@ void MuteSounds()
|
|||
});
|
||||
}
|
||||
|
||||
void setSpritesetImage(DDukeActor* self, unsigned int index);
|
||||
|
||||
class DukeSoundEngine : public RazeSoundEngine
|
||||
{
|
||||
// client specific parts of the sound engine go in this class.
|
||||
|
@ -113,7 +115,7 @@ public:
|
|||
{
|
||||
UnloadSound(schan->SoundID.index());
|
||||
currentCommentarySound = NO_SOUND;
|
||||
if (currentCommentarySprite) currentCommentarySprite->spr.picnum = DEVELOPERCOMMENTARY;
|
||||
if (currentCommentarySprite) setSpritesetImage(currentCommentarySprite, 0);
|
||||
I_SetRelativeVolume(1.0f);
|
||||
UnmuteSounds();
|
||||
}
|
||||
|
@ -851,7 +853,7 @@ void StopCommentary()
|
|||
}
|
||||
}
|
||||
|
||||
bool StartCommentary(int tag, DDukeActor* actor)
|
||||
int StartCommentary(int tag, DDukeActor* actor)
|
||||
{
|
||||
if (wt_commentary && Commentaries.Size() > (unsigned)tag && Commentaries[tag].IsNotEmpty())
|
||||
{
|
||||
|
|
|
@ -109,7 +109,7 @@ void S_ContinueLevelMusic(void);
|
|||
void S_ParseDeveloperCommentary();
|
||||
|
||||
void StopCommentary();
|
||||
bool StartCommentary(int tag, DDukeActor* sprnum);
|
||||
int StartCommentary(int tag, DDukeActor* sprnum);
|
||||
|
||||
|
||||
END_DUKE_NS
|
||||
|
|
|
@ -403,37 +403,6 @@ int spawnbloodpoolpart1(DDukeActor* act)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void initfootprint(DDukeActor* actj, DDukeActor* act)
|
||||
{
|
||||
auto sect = act->sector();
|
||||
if (actj)
|
||||
{
|
||||
bool away = isAwayFromWall(act, 5.25);
|
||||
if (!away)
|
||||
{
|
||||
act->spr.scale = DVector2(0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
|
||||
if ((ps[actj->PlayerIndex()].footprintcount & 1)) act->spr.cstat |= CSTAT_SPRITE_XFLIP;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
act->spr.pos.Z = sect->floorz;
|
||||
if (sect->lotag != 1 && sect->lotag != 2)
|
||||
act->spr.scale = DVector2(0.5, 0.5);
|
||||
|
||||
insertspriteq(act);
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
|
||||
{
|
||||
auto sectp = actor->sector();
|
||||
|
|
|
@ -179,49 +179,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
|
||||
case FEMMAG1: // ok
|
||||
case FEMMAG2: // ok
|
||||
act->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
ChangeActorStat(act, 0);
|
||||
break;
|
||||
case DUKETAG: // ok
|
||||
case SIGN1: // ok
|
||||
case SIGN2: // ok
|
||||
if (ud.multimode < 2 && act->spr.pal)
|
||||
{
|
||||
act->spr.scale = DVector2(0, 0);
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
}
|
||||
else act->spr.pal = 0;
|
||||
break;
|
||||
case MASKWALL1: // all ok
|
||||
case MASKWALL2:
|
||||
case MASKWALL3:
|
||||
case MASKWALL4:
|
||||
case MASKWALL5:
|
||||
case MASKWALL6:
|
||||
case MASKWALL7:
|
||||
case MASKWALL8:
|
||||
case MASKWALL9:
|
||||
case MASKWALL10:
|
||||
case MASKWALL11:
|
||||
case MASKWALL12:
|
||||
case MASKWALL13:
|
||||
case MASKWALL14:
|
||||
case MASKWALL15:
|
||||
{
|
||||
auto j = act->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_MASK | CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP);
|
||||
act->spr.cstat = j | CSTAT_SPRITE_BLOCK;
|
||||
ChangeActorStat(act, 0);
|
||||
break;
|
||||
}
|
||||
case FOOTPRINTS: // ok
|
||||
case FOOTPRINTS2:
|
||||
case FOOTPRINTS3:
|
||||
case FOOTPRINTS4:
|
||||
initfootprint(actj, act);
|
||||
break;
|
||||
|
||||
case FEM1:
|
||||
case FEM2:
|
||||
case FEM3:
|
||||
|
@ -263,20 +220,8 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
case MIKE:
|
||||
if (act->spr.picnum == MIKE)
|
||||
act->spr.yint = act->spr.hitag;
|
||||
[[fallthrough]];
|
||||
case WEATHERWARN: // ok
|
||||
ChangeActorStat(act, STAT_ACTOR);
|
||||
ChangeActorStat(act, 1);
|
||||
break;
|
||||
|
||||
case SPOTLITE: // ok
|
||||
break;
|
||||
case BULLETHOLE: // ok
|
||||
act->spr.scale = DVector2(0.046875, 0.046875);
|
||||
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | randomFlip();
|
||||
insertspriteq(act);
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
|
||||
case ONFIRE:
|
||||
// Twentieth Anniversary World Tour
|
||||
if (!isWorldTour())
|
||||
|
@ -376,10 +321,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
break;
|
||||
|
||||
case PLUG:
|
||||
act->spr.lotag = 9999;
|
||||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
break;
|
||||
case WATERBUBBLEMAKER:
|
||||
if (act->spr.hitag && act->spr.picnum == WATERBUBBLEMAKER)
|
||||
{ // JBF 20030913: Pisses off move(), eg. in bobsp2
|
||||
|
@ -594,23 +535,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
break;
|
||||
|
||||
case CAMERAPOLE: // ok
|
||||
act->spr.extra = 1;
|
||||
|
||||
if (gs.camerashitable) act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
else act->spr.cstat = 0;
|
||||
[[fallthrough]];
|
||||
|
||||
case GENERICPOLE: // ok
|
||||
|
||||
if (ud.multimode < 2 && act->spr.pal != 0)
|
||||
{
|
||||
act->spr.scale = DVector2(0, 0);
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
}
|
||||
else act->spr.pal = 0;
|
||||
break;
|
||||
case STEAM:
|
||||
if (actj)
|
||||
{
|
||||
|
|
|
@ -97,25 +97,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
||||
ChangeActorStat(act, 0);
|
||||
break;
|
||||
case FEMMAG1:
|
||||
case FEMMAG2:
|
||||
act->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
ChangeActorStat(act, 0);
|
||||
break;
|
||||
|
||||
case MASKWALL7:
|
||||
{
|
||||
auto j = act->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_MASK | CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP);
|
||||
act->spr.cstat = j | CSTAT_SPRITE_BLOCK;
|
||||
ChangeActorStat(act, 0);
|
||||
break;
|
||||
}
|
||||
case FOOTPRINTS:
|
||||
case FOOTPRINTS2:
|
||||
case FOOTPRINTS3:
|
||||
case FOOTPRINTS4:
|
||||
initfootprint(actj, act);
|
||||
break;
|
||||
case FEM10:
|
||||
case NAKED1:
|
||||
case STATUE:
|
||||
|
@ -144,15 +125,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
ChangeActorStat(act, STAT_ACTOR);
|
||||
break;
|
||||
|
||||
case SPOTLITE:
|
||||
break;
|
||||
case BULLETHOLE:
|
||||
act->spr.scale = DVector2(0.046875, 0.046875);
|
||||
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | randomFlip();
|
||||
insertspriteq(act);
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
|
||||
case EXPLOSION2:
|
||||
case EXPLOSION3:
|
||||
case BURNING:
|
||||
|
@ -234,10 +206,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
|
||||
case PLUG:
|
||||
act->spr.lotag = 9999;
|
||||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
break;
|
||||
case WATERBUBBLEMAKER:
|
||||
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
|
@ -686,20 +654,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
}
|
||||
act->spr.shade = act->sector()->floorshade;
|
||||
break;
|
||||
case CAMERAPOLE:
|
||||
act->spr.extra = 1;
|
||||
|
||||
if (gs.camerashitable) act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
else act->spr.cstat = 0;
|
||||
|
||||
if (ud.multimode < 2 && act->spr.pal != 0)
|
||||
{
|
||||
act->spr.scale = DVector2(0, 0);
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
}
|
||||
else act->spr.pal = 0;
|
||||
break;
|
||||
case STEAM:
|
||||
if (actj)
|
||||
{
|
||||
|
|
|
@ -190,6 +190,22 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Duke, updatepindisplay, updatepindisplay)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_Duke, StartCommentary, StartCommentary)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_INT(tag);
|
||||
PARAM_POINTER(act, DDukeActor);
|
||||
ACTION_RETURN_BOOL(StartCommentary(tag, act));
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_Duke, StopCommentary, StopCommentary)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
StopCommentary();
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_GLOBAL_UNSIZED(dlevel)
|
||||
DEFINE_GLOBAL(camsprite)
|
||||
|
||||
|
@ -226,7 +242,7 @@ DEFINE_FIELD(DDukeActor, temp_pos)
|
|||
DEFINE_FIELD(DDukeActor, temp_pos2)
|
||||
DEFINE_FIELD(DDukeActor, temp_angle)
|
||||
|
||||
static void setSpritesetImage(DDukeActor* self, unsigned int index)
|
||||
void setSpritesetImage(DDukeActor* self, unsigned int index)
|
||||
{
|
||||
auto& spriteset = static_cast<PClassActor*>(self->GetClass())->ActorInfo()->SpriteSet;
|
||||
|
||||
|
|
|
@ -4,4 +4,5 @@ spawnclasses
|
|||
5163 = DukeFireball
|
||||
5736 = DukeGenericDestructible, "WTGLASS1", "", "GLASS_BREAKING", spawnglass
|
||||
5737 = DukeGenericDestructible, "WTGLASS2", "", "GLASS_BREAKING", spawnglass
|
||||
5294 = DeveloperCommentary
|
||||
}
|
||||
|
|
|
@ -122,6 +122,34 @@ spawnclasses
|
|||
680 = DukeChair3
|
||||
569 = DukeToilet
|
||||
571 = DukeStall
|
||||
1069 = DukePlug
|
||||
568 = DukeFemMag1
|
||||
577 = DukeFemMag2
|
||||
4900 = DukeTag
|
||||
4909 = DukeSign1
|
||||
4912 = DukeSign2
|
||||
285 = DukeMaskWall1
|
||||
913 = DukeMaskWall2
|
||||
914 = DukeMaskWall3
|
||||
915 = DukeMaskWall4
|
||||
514 = DukeMaskWall5
|
||||
1059 = DukeMaskWall6
|
||||
1174 = DukeMaskWall7
|
||||
1124 = DukeMaskWall8
|
||||
255 = DukeMaskWall9
|
||||
387 = DukeMaskWall10
|
||||
391 = DukeMaskWall11
|
||||
609 = DukeMaskWall12
|
||||
830 = DukeMaskWall13
|
||||
988 = DukeMaskWall14
|
||||
1024 = DukeMaskWall15
|
||||
550 = DukeFootprints
|
||||
672 = DukeFootprints
|
||||
673 = DukeFootprints
|
||||
674 = DukeFootprints
|
||||
952 = DukeBulletHole
|
||||
554 = DukeCameraPole
|
||||
977 = DukeGenericPole
|
||||
|
||||
1272 = DukeTrash
|
||||
634 = DukeBolt1
|
||||
|
|
|
@ -106,6 +106,15 @@ spawnclasses
|
|||
1100 = DukeStall
|
||||
2121 = RedneckToiletSeat
|
||||
2122 = RedneckToilet2
|
||||
1097 = DukeFemMag1
|
||||
1106 = DukeFemMag2
|
||||
2264 = DukeMaskWall7
|
||||
1079 = DukeFootprints
|
||||
1144 = DukeFootprints
|
||||
1145 = DukeFootprints
|
||||
1146 = DukeFootprints
|
||||
1212 = DukeBulletHole
|
||||
1083 = DukeCameraPole
|
||||
|
||||
26 = RedneckDynamite
|
||||
1416 = RedneckMortar
|
||||
|
|
|
@ -61,6 +61,7 @@ version "4.10"
|
|||
#include "zscript/games/duke/actors/frameeffect.zs"
|
||||
#include "zscript/games/duke/actors/naturallightning.zs"
|
||||
|
||||
#include "zscript/games/duke/actors/dukemisc.zs"
|
||||
#include "zscript/games/duke/actors/projectiles.zs"
|
||||
#include "zscript/games/duke/actors/rat.zs"
|
||||
#include "zscript/games/duke/actors/jibs.zs"
|
||||
|
|
269
wadsrc/static/zscript/games/duke/actors/dukemisc.zs
Normal file
269
wadsrc/static/zscript/games/duke/actors/dukemisc.zs
Normal file
|
@ -0,0 +1,269 @@
|
|||
|
||||
class DukePlug : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "PLUG";
|
||||
statnum STAT_STANDABLE;
|
||||
lotag 9999;
|
||||
}
|
||||
|
||||
override bool OnUse(DukePlayer p)
|
||||
{
|
||||
p.actor.PlayActorSound("SHORT_CIRCUIT");
|
||||
p.actor.extra -= random(2, 5);
|
||||
p.pals = Color(32, 48, 48, 64);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeFemMag1 : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "FEMMAG1";
|
||||
statnum STAT_DEFAULT;
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeFemMag2 : DukeFemMag1
|
||||
{
|
||||
default { pic "FEMMAG1"; }
|
||||
}
|
||||
|
||||
class DukeTag : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "DUKETAG";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
if (ud.multimode < 2 && self.pal)
|
||||
{
|
||||
self.scale = (0, 0);
|
||||
self.ChangeStat(STAT_MISC);
|
||||
}
|
||||
else self.pal = 0;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeSign1 : DukeTag
|
||||
{
|
||||
default { pic "SIGN1"; }
|
||||
}
|
||||
|
||||
class DukeSign2 : DukeTag
|
||||
{
|
||||
default { pic "SIGN2"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall1 : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "MASKWALL1";
|
||||
statnum STAT_DEFAULT;
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
let j = self.cstat & (CSTAT_SPRITE_ALIGNMENT_MASK | CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP);
|
||||
self.cstat = j | CSTAT_SPRITE_BLOCK;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeMaskWall2 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL2"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall3 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL3"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall4 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL4"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall5 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL5"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall6 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL6"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall7 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL7"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall8 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL9"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall10 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL10"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall11 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL11"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall12 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL12"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall13 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL13"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall14 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL14"; }
|
||||
}
|
||||
|
||||
class DukeMaskWall15 : DukeMaskWall1
|
||||
{
|
||||
default { pic "MASKWALL15"; }
|
||||
}
|
||||
|
||||
class DukeFootprints : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
statnum STAT_MISC;
|
||||
spriteset "FOOTPRINTS", "FOOTPRINTS2", "FOOTPRINTS3", "FOOTPRINTS4";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
if (self != self.ownerActor)
|
||||
{
|
||||
bool away = self.isAwayFromWall(5.25);
|
||||
if (!away)
|
||||
{
|
||||
self.scale = (0, 0);
|
||||
return;
|
||||
}
|
||||
self.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
|
||||
self.insertspriteq();
|
||||
}
|
||||
let sect = self.sector;
|
||||
self.pos.Z = sect.floorz;
|
||||
if (sect.lotag != ST_1_ABOVE_WATER && sect.lotag != ST_2_UNDERWATER)
|
||||
self.scale = (0.5, 0.5);
|
||||
self.setSpriteSetImage(random(0, 3));
|
||||
}
|
||||
|
||||
override bool animate(tspritetype t)
|
||||
{
|
||||
if (self.shade == 127) t.shade = 127;
|
||||
if (t.pal == 6) t.shade = -127;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeBulletHole : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
statnum STAT_MISC;
|
||||
pic "BULLETHOLE";
|
||||
scaleX 0.046875;
|
||||
scaleY 0.046875;
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | randomFlip();
|
||||
self.insertspriteq();
|
||||
}
|
||||
|
||||
override bool animate(tspritetype t)
|
||||
{
|
||||
t.shade = 16;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeGenericPole : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "GENERICPOLE";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
if (ud.multimode < 2 && self.pal != 0)
|
||||
{
|
||||
self.scale = (0, 0);
|
||||
self.ChangeStat(STAT_MISC);
|
||||
}
|
||||
else self.pal = 0;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeCameraPole : DukeGenericPole
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "CAMERAPOLE";
|
||||
extra 1;
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
if (gs.camerashitable) self.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
else self.cstat = 0;
|
||||
super.Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
class DeveloperCommentary : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
spriteset "DEVELOPERCOMMENTARY", "DEVELOPERCOMMENTARYON";
|
||||
}
|
||||
|
||||
override bool OnUse(DukePlayer p)
|
||||
{
|
||||
if (!wt_commentary) return false;
|
||||
if (self.spriteSetIndex == 0)
|
||||
{
|
||||
if (Duke.StartCommentary(self.lotag, self))
|
||||
self.setSpriteSetImage(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
Duke.StopCommentary();
|
||||
self.setSpriteSetImage(0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
override bool animate(tspritetype t)
|
||||
{
|
||||
if (!wt_commentary) t.scale = (0, 0);
|
||||
else t.shade = self.shade;
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -154,6 +154,8 @@ struct Duke native
|
|||
native static int GetSoundFlags(Sound snd);
|
||||
native static int badguyID(int id);
|
||||
native static void updatepindisplay(int tag, int pinmask);
|
||||
native static bool StartCommentary(int tag, DukeActor act);
|
||||
native static void StopCommentary();
|
||||
static int rnd(int val)
|
||||
{
|
||||
return (random(0, 255) >= (255 - (val)));
|
||||
|
|
Loading…
Reference in a new issue