mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- generic destructibles
This commit is contained in:
parent
2b7e094019
commit
9e29c3970d
21 changed files with 704 additions and 537 deletions
|
@ -2245,8 +2245,12 @@ static void parseSpawnClasses(FScanner& sc, FScriptPosition& pos)
|
|||
}
|
||||
while (!sc.CheckString("}"))
|
||||
{
|
||||
// This will need some reworking once we can use real textures.
|
||||
int num = -1;
|
||||
int base = -1;
|
||||
int basetex = -1;
|
||||
int brokentex = -1;
|
||||
FName sound = NAME_None;
|
||||
FName cname;
|
||||
sc.GetNumber(num, true);
|
||||
sc.MustGetStringName("=");
|
||||
|
@ -2254,11 +2258,34 @@ static void parseSpawnClasses(FScanner& sc, FScriptPosition& pos)
|
|||
cname = sc.String;
|
||||
if (sc.CheckString(","))
|
||||
{
|
||||
sc.GetNumber(base, true);
|
||||
if (sc.CheckNumber(true)) base = sc.Number;
|
||||
else
|
||||
{
|
||||
sc.MustGetString();
|
||||
basetex = TileFiles.tileForName(sc.String);
|
||||
if (basetex < 0) Printf(TEXTCOLOR_RED "Unknown texture %s in definition for spawn ID # %d\n", num);
|
||||
if (sc.CheckString(","))
|
||||
{
|
||||
sc.MustGetString();
|
||||
brokentex = TileFiles.tileForName(sc.String);
|
||||
if (brokentex < 0) Printf(TEXTCOLOR_RED "Unknown texture %s in definition for spawn ID # %d\n", num);
|
||||
if (sc.CheckString(","))
|
||||
{
|
||||
sc.MustGetString();
|
||||
sound = sc.String;
|
||||
#if 0
|
||||
// Sound engine is not initialized here.
|
||||
S_FindSound(sc.String).index();
|
||||
if (sound <= 0) Printf(TEXTCOLOR_RED "Unknown sound %s in definition for spawn ID # %d\n", num);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// todo: check for proper base class
|
||||
spawnMap.Insert(num, { cname, nullptr, base });
|
||||
spawnMap.Insert(num, { cname, nullptr, base, basetex, brokentex, sound });
|
||||
}
|
||||
sc.SetCMode(false);
|
||||
}
|
||||
|
|
|
@ -276,6 +276,8 @@ struct SpawnRec
|
|||
FName clsname;
|
||||
PClass* cls;
|
||||
int param;
|
||||
int basetex, brokentex;
|
||||
FName breaksound;
|
||||
|
||||
PClass* Class(int pn)
|
||||
{
|
||||
|
|
|
@ -19,3 +19,8 @@ xx(DukeRespawnController)
|
|||
xx(DukeActivator)
|
||||
xx(DukeActivatorLocked)
|
||||
xx(DukeLocator)
|
||||
xx(DukeGenericDestructible)
|
||||
|
||||
xx(spawnstate)
|
||||
xx(brokenstate)
|
||||
xx(breaksound)
|
|
@ -194,7 +194,6 @@ int TILE_BOTTOMSTATUSBAR;
|
|||
int TILE_THREEDEE;
|
||||
int TILE_INGAMEDUKETHREEDEE;
|
||||
int TILE_ATOMICHEALTH;
|
||||
int TILE_JIBS6;
|
||||
int TILE_FIRE;
|
||||
int TILE_WATERBUBBLE;
|
||||
int TILE_SMALLSMOKE;
|
||||
|
@ -204,12 +203,10 @@ int TILE_FOOTPRINTS2;
|
|||
int TILE_FOOTPRINTS3;
|
||||
int TILE_FOOTPRINTS4;
|
||||
int TILE_CLOUDYSKIES;
|
||||
int TILE_ARROW;
|
||||
int TILE_ACCESSSWITCH;
|
||||
int TILE_ACCESSSWITCH2;
|
||||
int TILE_GLASSPIECES;
|
||||
int TILE_HEN;
|
||||
int TILE_BETAVERSION;
|
||||
int TILE_MIRROR;
|
||||
int TILE_CLOUDYOCEAN;
|
||||
int TILE_MOONSKY1;
|
||||
|
|
|
@ -222,7 +222,6 @@ void initactorflags_d()
|
|||
TILE_STATIC = STATIC;
|
||||
TILE_BOTTOMSTATUSBAR = isWorldTour()? WIDESCREENSTATUSBAR : BOTTOMSTATUSBAR;
|
||||
TILE_ATOMICHEALTH = ATOMICHEALTH;
|
||||
TILE_JIBS6 = JIBS6;
|
||||
TILE_FIRE = FIRE;
|
||||
TILE_WATERBUBBLE = WATERBUBBLE;
|
||||
TILE_SMALLSMOKE = SMALLSMOKE;
|
||||
|
@ -232,11 +231,9 @@ void initactorflags_d()
|
|||
TILE_FOOTPRINTS3 = FOOTPRINTS3;
|
||||
TILE_FOOTPRINTS4 = FOOTPRINTS4;
|
||||
TILE_CLOUDYSKIES = CLOUDYSKIES;
|
||||
TILE_ARROW = ARROW;
|
||||
TILE_ACCESSSWITCH = ACCESSSWITCH;
|
||||
TILE_ACCESSSWITCH2 = ACCESSSWITCH2;
|
||||
TILE_GLASSPIECES = GLASSPIECES;
|
||||
TILE_BETAVERSION = BETAVERSION;
|
||||
TILE_MIRROR = MIRROR;
|
||||
TILE_CLOUDYOCEAN = CLOUDYOCEAN;
|
||||
TILE_MOONSKY1 = MOONSKY1;
|
||||
|
|
|
@ -228,7 +228,6 @@ void initactorflags_r()
|
|||
TILE_STATIC = STATIC;
|
||||
TILE_BOTTOMSTATUSBAR = BOTTOMSTATUSBAR;
|
||||
TILE_ATOMICHEALTH = ATOMICHEALTH;
|
||||
TILE_JIBS6 = JIBS6;
|
||||
TILE_FIRE = FIRE;
|
||||
TILE_WATERBUBBLE = WATERBUBBLE;
|
||||
TILE_SMALLSMOKE = SMALLSMOKE;
|
||||
|
@ -238,11 +237,9 @@ void initactorflags_r()
|
|||
TILE_FOOTPRINTS3 = FOOTPRINTS3;
|
||||
TILE_FOOTPRINTS4 = FOOTPRINTS4;
|
||||
TILE_CLOUDYSKIES = CLOUDYSKIES;
|
||||
TILE_ARROW = ARROW;
|
||||
TILE_ACCESSSWITCH = ACCESSSWITCH;
|
||||
TILE_ACCESSSWITCH2 = ACCESSSWITCH2;
|
||||
TILE_GLASSPIECES = GLASSPIECES;
|
||||
TILE_BETAVERSION = BETAVERSION;
|
||||
TILE_MIRROR = MIRROR;
|
||||
TILE_HEN = HEN;
|
||||
TILE_MOONSKY1 = MOONSKY1;
|
||||
|
|
|
@ -162,6 +162,7 @@ void makeitfall(DDukeActor* s);
|
|||
DAngle furthestangle(DDukeActor* snum, int angDiv);
|
||||
void getglobalz(DDukeActor* s);
|
||||
void OnEvent(int id, int pnum = -1, DDukeActor* snum = nullptr, int dist = -1);
|
||||
void setFromSpawnRec(DDukeActor* act, SpawnRec* info);
|
||||
|
||||
DDukeActor* CreateActor(sectortype* whatsectp, const DVector3& pos, int s_pn, int8_t s_shd, const DVector2& scale, DAngle s_ang, double s_vel, double s_zvel, DDukeActor* s_ow, int8_t s_stat);
|
||||
DDukeActor* CreateActor(sectortype* whatsectp, const DVector3& pos, PClassActor* cls, int8_t s_shd, const DVector2& scale, DAngle s_ang, double s_vel, double s_zvel, DDukeActor* s_ow, int8_t s_stat);
|
||||
|
|
|
@ -602,7 +602,7 @@ y(RRTILE1812, 1812)
|
|||
y(RRTILE1814, 1814)
|
||||
y(RRTILE1817, 1817)
|
||||
y(RRTILE1821, 1821)
|
||||
y(RRTILE1824, 1824)
|
||||
x(YELLOWBOTTLE, 1824)
|
||||
y(RRTILE1826, 1826)
|
||||
y(RRTILE1850, 1850)
|
||||
y(RRTILE1851, 1851)
|
||||
|
|
|
@ -15,7 +15,6 @@ extern int TILE_CAMLIGHT;
|
|||
extern int TILE_STATIC;
|
||||
extern int TILE_BOTTOMSTATUSBAR;
|
||||
extern int TILE_ATOMICHEALTH;
|
||||
extern int TILE_JIBS6;
|
||||
extern int TILE_FIRE;
|
||||
extern int TILE_WATERBUBBLE;
|
||||
extern int TILE_SMALLSMOKE;
|
||||
|
@ -25,12 +24,10 @@ extern int TILE_FOOTPRINTS2;
|
|||
extern int TILE_FOOTPRINTS3;
|
||||
extern int TILE_FOOTPRINTS4;
|
||||
extern int TILE_CLOUDYSKIES;
|
||||
extern int TILE_ARROW;
|
||||
extern int TILE_ACCESSSWITCH;
|
||||
extern int TILE_ACCESSSWITCH2;
|
||||
extern int TILE_GLASSPIECES;
|
||||
extern int TILE_HEN;
|
||||
extern int TILE_BETAVERSION;
|
||||
extern int TILE_MIRROR;
|
||||
extern int TILE_CLOUDYOCEAN;
|
||||
extern int TILE_MOONSKY1;
|
||||
|
|
|
@ -3181,3 +3181,4 @@ HORIZONLY:
|
|||
}
|
||||
|
||||
END_DUKE_NS
|
||||
|
||||
|
|
|
@ -940,6 +940,10 @@ static TArray<DDukeActor*> spawnactors(SpawnSpriteDef& sprites)
|
|||
}
|
||||
|
||||
auto sprt = &sprites.sprites[i];
|
||||
|
||||
if (sprt->picnum == 7220)
|
||||
sprt->picnum = 8490;
|
||||
|
||||
auto info = spawnMap.CheckKey(sprt->picnum);
|
||||
auto cls = info ? info->Class(sprt->picnum) : nullptr;;
|
||||
auto actor = static_cast<DDukeActor*>(InsertActor(cls? cls : RUNTIME_CLASS(DDukeActor), sprt->sectp, sprt->statnum));
|
||||
|
@ -947,6 +951,7 @@ static TArray<DDukeActor*> spawnactors(SpawnSpriteDef& sprites)
|
|||
{
|
||||
spawns[j++] = actor;
|
||||
actor->initFromSprite(&sprites.sprites[i]);
|
||||
setFromSpawnRec(actor, info);
|
||||
actor->time = i;
|
||||
if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i];
|
||||
else actor->sprext = {};
|
||||
|
|
|
@ -936,10 +936,10 @@ bool checkhitceiling_d(sectortype* sectp)
|
|||
|
||||
void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
|
||||
{
|
||||
if ((targ->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL) && targ->spr.hitag == 0 && targ->spr.lotag == 0 && targ->spr.statnum == 0)
|
||||
if ((targ->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL) && targ->spr.hitag == 0 && targ->spr.lotag == 0 && targ->spr.statnum == STAT_DEFAULT)
|
||||
return;
|
||||
|
||||
if ((proj->spr.picnum == FREEZEBLAST || proj->GetOwner() != targ) && targ->spr.statnum != 4)
|
||||
if ((proj->spr.picnum == FREEZEBLAST || proj->GetOwner() != targ) && targ->spr.statnum != STAT_PROJECTILE)
|
||||
{
|
||||
if (badguy(targ) == 1)
|
||||
{
|
||||
|
@ -995,7 +995,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
|
|||
if ((targ->spr.scale.X < 0.375 || targ->spr.picnum == SHARK) && proj->spr.picnum == SHRINKSPARK) return;
|
||||
}
|
||||
|
||||
if (targ->spr.statnum != 2)
|
||||
if (targ->spr.statnum != STAT_ZOMBIEACTOR)
|
||||
{
|
||||
if (proj->spr.picnum == FREEZEBLAST && ((targ->spr.picnum == APLAYER && targ->spr.pal == 1) || (gs.freezerhurtowner == 0 && proj->GetOwner() == targ)))
|
||||
return;
|
||||
|
@ -1018,7 +1018,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
|
|||
targ->SetHitOwner(Owner);
|
||||
}
|
||||
|
||||
if (targ->spr.statnum == 10)
|
||||
if (targ->spr.statnum == STAT_PLAYER)
|
||||
{
|
||||
auto p = targ->spr.yint;
|
||||
if (ps[p].newOwner != nullptr)
|
||||
|
|
|
@ -1397,373 +1397,6 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
{
|
||||
case IRONWHEELSWITCH:
|
||||
break;
|
||||
case RRTILE8487:
|
||||
case RRTILE8489:
|
||||
S_PlayActorSound(471, targ);
|
||||
targ->spr.picnum++;
|
||||
break;
|
||||
case RRTILE7638:
|
||||
case RRTILE7644:
|
||||
case RRTILE7646:
|
||||
case RRTILE7650:
|
||||
case RRTILE7653:
|
||||
case RRTILE7655:
|
||||
case RRTILE7691:
|
||||
case RRTILE7876:
|
||||
case RRTILE7881:
|
||||
case RRTILE7883:
|
||||
targ->spr.picnum++;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case RRTILE7879:
|
||||
targ->spr.picnum++;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE7648:
|
||||
case RRTILE7694:
|
||||
case RRTILE7700:
|
||||
case RRTILE7702:
|
||||
case RRTILE7711:
|
||||
targ->spr.picnum++;
|
||||
S_PlayActorSound(47, targ);
|
||||
break;
|
||||
case RRTILE7636:
|
||||
targ->spr.picnum += 3;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case RRTILE7875:
|
||||
targ->spr.picnum += 3;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case RRTILE7640:
|
||||
targ->spr.picnum += 2;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case RRTILE7595:
|
||||
case RRTILE7704:
|
||||
targ->spr.picnum = RRTILE7705;
|
||||
S_PlayActorSound(495, targ);
|
||||
break;
|
||||
case RRTILE8579:
|
||||
targ->spr.picnum = RRTILE5014;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7441:
|
||||
targ->spr.picnum = RRTILE5016;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7534:
|
||||
targ->spr.picnum = RRTILE5029;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7545:
|
||||
targ->spr.picnum = RRTILE5030;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7547:
|
||||
targ->spr.picnum = RRTILE5031;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7574:
|
||||
targ->spr.picnum = RRTILE5032;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7575:
|
||||
targ->spr.picnum = RRTILE5033;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7578:
|
||||
targ->spr.picnum = RRTILE5034;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7478:
|
||||
targ->spr.picnum = RRTILE5035;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8525:
|
||||
targ->spr.picnum = RRTILE5036;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8537:
|
||||
targ->spr.picnum = RRTILE5062;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8215:
|
||||
targ->spr.picnum = RRTILE5064;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8216:
|
||||
targ->spr.picnum = RRTILE5065;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8217:
|
||||
targ->spr.picnum = RRTILE5066;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8218:
|
||||
targ->spr.picnum = RRTILE5067;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8220:
|
||||
targ->spr.picnum = RRTILE5068;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8221:
|
||||
targ->spr.picnum = RRTILE5069;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8312:
|
||||
targ->spr.picnum = RRTILE5071;
|
||||
S_PlayActorSound(472, targ);
|
||||
break;
|
||||
case RRTILE8395:
|
||||
targ->spr.picnum = RRTILE5072;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8423:
|
||||
targ->spr.picnum = RRTILE5073;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE3462:
|
||||
targ->spr.picnum = RRTILE5074;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case UWHIP:
|
||||
targ->spr.picnum = RRTILE5075;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8608:
|
||||
targ->spr.picnum = RRTILE5083;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8609:
|
||||
targ->spr.picnum = RRTILE5084;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8567:
|
||||
case RRTILE8568:
|
||||
case RRTILE8569:
|
||||
case RRTILE8570:
|
||||
case RRTILE8571:
|
||||
targ->spr.picnum = RRTILE5082;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8640:
|
||||
targ->spr.picnum = RRTILE5085;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8611:
|
||||
targ->spr.picnum = RRTILE5086;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case TECHLIGHTBUST2:
|
||||
targ->spr.picnum = TECHLIGHTBUST4;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8497:
|
||||
targ->spr.picnum = RRTILE5076;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8162:
|
||||
case RRTILE8163:
|
||||
case RRTILE8164:
|
||||
case RRTILE8165:
|
||||
case RRTILE8166:
|
||||
case RRTILE8167:
|
||||
case RRTILE8168:
|
||||
ChangeActorStat(targ, STAT_MISC);
|
||||
targ->spr.picnum = RRTILE5063;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8589:
|
||||
case RRTILE8590:
|
||||
case RRTILE8591:
|
||||
case RRTILE8592:
|
||||
case RRTILE8593:
|
||||
case RRTILE8594:
|
||||
case RRTILE8595:
|
||||
ChangeActorStat(targ, STAT_MISC);
|
||||
targ->spr.picnum = RRTILE8588;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE3497:
|
||||
targ->spr.picnum = RRTILE5076;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE3498:
|
||||
targ->spr.picnum = RRTILE5077;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE3499:
|
||||
targ->spr.picnum = RRTILE5078;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8503:
|
||||
targ->spr.picnum = RRTILE5079;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7901:
|
||||
targ->spr.picnum = RRTILE5080;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7696:
|
||||
targ->spr.picnum = RRTILE7697;
|
||||
S_PlayActorSound(DUKE_SHUCKS, targ);
|
||||
break;
|
||||
case RRTILE7806:
|
||||
targ->spr.picnum = RRTILE5043;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7885:
|
||||
case RRTILE7890:
|
||||
targ->spr.picnum = RRTILE5045;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE7886:
|
||||
targ->spr.picnum = RRTILE5046;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE7887:
|
||||
targ->spr.picnum = RRTILE5044;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE7900:
|
||||
targ->spr.picnum = RRTILE5047;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7906:
|
||||
targ->spr.picnum = RRTILE5048;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7912:
|
||||
case RRTILE7913:
|
||||
targ->spr.picnum = RRTILE5049;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8047:
|
||||
targ->spr.picnum = RRTILE5050;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8596:
|
||||
targ->spr.picnum = RRTILE8598;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8059:
|
||||
targ->spr.picnum = RRTILE5051;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8060:
|
||||
targ->spr.picnum = RRTILE5052;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8222:
|
||||
targ->spr.picnum = RRTILE5053;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8223:
|
||||
targ->spr.picnum = RRTILE5054;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8224:
|
||||
targ->spr.picnum = RRTILE5055;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8370:
|
||||
targ->spr.picnum = RRTILE5056;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8371:
|
||||
targ->spr.picnum = RRTILE5057;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8372:
|
||||
targ->spr.picnum = RRTILE5058;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8373:
|
||||
targ->spr.picnum = RRTILE5059;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8396:
|
||||
targ->spr.picnum = RRTILE5038;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8397:
|
||||
targ->spr.picnum = RRTILE5039;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8398:
|
||||
targ->spr.picnum = RRTILE5040;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8399:
|
||||
targ->spr.picnum = RRTILE5041;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8385:
|
||||
targ->spr.picnum = RRTILE8386;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8387:
|
||||
targ->spr.picnum = RRTILE8388;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8389:
|
||||
targ->spr.picnum = RRTILE8390;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8391:
|
||||
targ->spr.picnum = RRTILE8392;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7553:
|
||||
targ->spr.picnum = RRTILE5035;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8475:
|
||||
targ->spr.picnum = RRTILE5075;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8498:
|
||||
targ->spr.picnum = RRTILE5077;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8499:
|
||||
targ->spr.picnum = RRTILE5078;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE2445:
|
||||
targ->spr.picnum = RRTILE2450;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE2123:
|
||||
targ->spr.picnum = RRTILE2124;
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
case RRTILE3773:
|
||||
targ->spr.picnum = RRTILE8651;
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
case RRTILE7533:
|
||||
targ->spr.picnum = RRTILE5035;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE8394:
|
||||
targ->spr.picnum = RRTILE5072;
|
||||
S_PlayActorSound(495, targ);
|
||||
break;
|
||||
case RRTILE8461:
|
||||
case RRTILE8462:
|
||||
targ->spr.picnum = RRTILE5074;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8679:
|
||||
targ->spr.picnum = RRTILE8680;
|
||||
S_PlayActorSound(DUKE_SHUCKS, targ);
|
||||
|
@ -1781,15 +1414,6 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
}
|
||||
}
|
||||
break;
|
||||
case RRTILE3584:
|
||||
targ->spr.picnum = RRTILE8681;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 250, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE8682:
|
||||
targ->spr.picnum = RRTILE8683;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8099:
|
||||
if (targ->spr.lotag == 5)
|
||||
{
|
||||
|
@ -1804,60 +1428,10 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
}
|
||||
}
|
||||
break;
|
||||
case RRTILE2437:
|
||||
S_PlayActorSound(439, targ);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (targ->spr.picnum)
|
||||
{
|
||||
case RRTILE3114:
|
||||
targ->spr.picnum = RRTILE3117;
|
||||
break;
|
||||
case RRTILE2876:
|
||||
targ->spr.picnum = RRTILE2990;
|
||||
break;
|
||||
case RRTILE3152:
|
||||
targ->spr.picnum = RRTILE3218;
|
||||
break;
|
||||
case RRTILE3153:
|
||||
targ->spr.picnum = RRTILE3219;
|
||||
break;
|
||||
case RRTILE2030:
|
||||
targ->spr.picnum = RRTILE2034;
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
case RRTILE2893:
|
||||
case RRTILE2915:
|
||||
case RRTILE3115:
|
||||
case RRTILE3171:
|
||||
switch (targ->spr.picnum)
|
||||
{
|
||||
case RRTILE2915:
|
||||
targ->spr.picnum = RRTILE2977;
|
||||
break;
|
||||
case RRTILE2893:
|
||||
targ->spr.picnum = RRTILE2978;
|
||||
break;
|
||||
case RRTILE3115:
|
||||
targ->spr.picnum = RRTILE3116;
|
||||
break;
|
||||
case RRTILE3171:
|
||||
targ->spr.picnum = RRTILE3216;
|
||||
break;
|
||||
}
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
case RRTILE2156:
|
||||
case RRTILE2158:
|
||||
case RRTILE2160:
|
||||
case RRTILE2175:
|
||||
targ->spr.picnum++;
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
case RRTILE2137:
|
||||
case RRTILE2151:
|
||||
case RRTILE2152:
|
||||
|
@ -1945,7 +1519,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
targ->Destroy();
|
||||
}
|
||||
break;
|
||||
case RRTILE1824:
|
||||
case YELLOWBOTTLE:
|
||||
if (!isRRRA()) break;
|
||||
[[fallthrough]];
|
||||
case BOTTLE1:
|
||||
|
@ -2036,18 +1610,6 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
|
||||
case GRATE1:
|
||||
targ->spr.picnum = BGRATE1;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
case CIRCLEPANNEL:
|
||||
targ->spr.picnum = CIRCLEPANNELBROKE;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
case PIPE1:
|
||||
case PIPE2:
|
||||
case PIPE3:
|
||||
|
|
|
@ -43,6 +43,22 @@ source as it is released.
|
|||
BEGIN_DUKE_NS
|
||||
|
||||
|
||||
void setFromSpawnRec(DDukeActor* act, SpawnRec* info)
|
||||
{
|
||||
if (info)
|
||||
{
|
||||
//int basepicnum = info->param;
|
||||
//act->basepicnum = basepicnum;
|
||||
if (info->basetex > 0 && act->IsKindOf(NAME_DukeGenericDestructible))
|
||||
{
|
||||
// allow defining simple destructibles without actual actor definitions.
|
||||
act->IntVar(NAME_spawnstate) = info->basetex;
|
||||
act->IntVar(NAME_brokenstate) = info->brokentex;
|
||||
act->IntVar(NAME_breaksound) = S_FindSound(info->breaksound.GetChars()).index();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// this creates a new actor but does not run any init code on it
|
||||
|
@ -56,26 +72,24 @@ DDukeActor* CreateActor(sectortype* whatsectp, const DVector3& pos, PClassActor*
|
|||
if (whatsectp == nullptr || !validSectorIndex(sectindex(whatsectp))) return nullptr;
|
||||
// spawning out of range sprites will also crash.
|
||||
if (clstype == nullptr && (s_pn < 0 || s_pn >= MAXTILES)) return nullptr;
|
||||
SpawnRec* info = nullptr;
|
||||
|
||||
int basepicnum = -1;
|
||||
if (!clstype)
|
||||
{
|
||||
auto info = spawnMap.CheckKey(s_pn);
|
||||
info = spawnMap.CheckKey(s_pn);
|
||||
if (info)
|
||||
{
|
||||
clstype = static_cast<PClassActor*>(info->Class(s_pn));
|
||||
basepicnum = info->param;
|
||||
}
|
||||
}
|
||||
|
||||
auto act = static_cast<DDukeActor*>(InsertActor(clstype? clstype : RUNTIME_CLASS(DDukeActor), whatsectp, s_stat));
|
||||
|
||||
if (act == nullptr) return nullptr;
|
||||
SetupGameVarsForActor(act);
|
||||
|
||||
act->basepicnum = basepicnum;
|
||||
act->spr.pos = pos;
|
||||
if (s_pn != -1) act->spr.picnum = s_pn; // if -1 use the class default.
|
||||
setFromSpawnRec(act, info);
|
||||
act->spr.pos = pos;
|
||||
act->spr.shade = s_shd;
|
||||
if (!scale.isZero()) act->spr.scale = DVector2(scale.X, scale.Y);
|
||||
|
||||
|
|
|
@ -142,28 +142,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
ChangeActorStat(act, 122);
|
||||
break;
|
||||
|
||||
case BIKEJIBA:
|
||||
case BIKEJIBB:
|
||||
case BIKEJIBC:
|
||||
case BIKERJIBA:
|
||||
case BIKERJIBB:
|
||||
case BIKERJIBC:
|
||||
case BIKERJIBD:
|
||||
case CHEERJIBA:
|
||||
case CHEERJIBB:
|
||||
case CHEERJIBC:
|
||||
case CHEERJIBD:
|
||||
case FBOATJIBA:
|
||||
case FBOATJIBB:
|
||||
case RABBITJIBA:
|
||||
case RABBITJIBB:
|
||||
case RABBITJIBC:
|
||||
case MAMAJIBA:
|
||||
case MAMAJIBB:
|
||||
// impossible to do with better methods outside of redoing the entire switch/case block
|
||||
if (isRRRA()) goto rrra_badguy;
|
||||
else goto default_case;
|
||||
|
||||
case WATERSPLASH2:
|
||||
case MUD:
|
||||
if (actj)
|
||||
|
@ -204,59 +182,8 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
case DOMELITE:
|
||||
if (act->spr.picnum != WATERSPLASH2)
|
||||
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
||||
if (act->spr.picnum == DOMELITE)
|
||||
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
||||
[[fallthrough]];
|
||||
case JIBS1:
|
||||
case JIBS2:
|
||||
case JIBS3:
|
||||
case JIBS4:
|
||||
case JIBS5:
|
||||
case JIBS6:
|
||||
case DUKETORSO:
|
||||
case DUKEGUN:
|
||||
case DUKELEG:
|
||||
case BILLYJIBA:
|
||||
case BILLYJIBB:
|
||||
case HULKJIBA:
|
||||
case HULKJIBB:
|
||||
case HULKJIBC:
|
||||
case MINJIBA:
|
||||
case MINJIBB:
|
||||
case MINJIBC:
|
||||
case COOTJIBA:
|
||||
case COOTJIBB:
|
||||
case COOTJIBC:
|
||||
rrra_badguy:
|
||||
if (act->spr.picnum == JIBS6)
|
||||
{
|
||||
act->spr.scale *= 0.5;
|
||||
}
|
||||
else if (isRRRA())
|
||||
{
|
||||
if (act->spr.picnum == RABBITJIBA)
|
||||
{
|
||||
act->spr.scale = DVector2(0.28125, 0.28125);
|
||||
}
|
||||
else if (act->spr.picnum == RABBITJIBB)
|
||||
{
|
||||
act->spr.scale = DVector2(0.5625, 0.5625);
|
||||
}
|
||||
else if (act->spr.picnum == RABBITJIBC)
|
||||
{
|
||||
act->spr.scale = DVector2(0.84375, 0.84375);
|
||||
}
|
||||
}
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
case TONGUE:
|
||||
if (actj)
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
act->spr.pos.Z -= gs.playerheight;
|
||||
act->vel.Z = 1 - krandf(2);
|
||||
act->vel.X = 4 - krandf(8);
|
||||
ChangeActorStat(act, STAT_PROJECTILE);
|
||||
break;
|
||||
case TRANSPORTERSTAR:
|
||||
case TRANSPORTERBEAM:
|
||||
spawntransporter(actj, act, act->spr.picnum == TRANSPORTERBEAM);
|
||||
|
|
|
@ -978,6 +978,30 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, floorflags, duke_floorflags)
|
|||
ACTION_RETURN_INT(duke_floorflags(sect));
|
||||
}
|
||||
|
||||
int duke_wallflags(walltype* wal)
|
||||
{
|
||||
return tileflags(wal->picnum);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, wallflags, duke_wallflags)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_POINTER(sect, walltype);
|
||||
ACTION_RETURN_INT(duke_wallflags(sect));
|
||||
}
|
||||
|
||||
int duke_ismirror(walltype* wal)
|
||||
{
|
||||
return wal->picnum == TILE_MIRROR || wal->overpicnum == TILE_MIRROR;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, ismirror, duke_ismirror)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_POINTER(wal, walltype);
|
||||
ACTION_RETURN_BOOL(duke_ismirror(wal));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, addcycler, addcycler)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
|
@ -1093,6 +1117,18 @@ DEFINE_ACTION_FUNCTION_NATIVE(_tspritetype, setWeaponOrAmmoSprite, tspritetype_s
|
|||
return 0;
|
||||
}
|
||||
|
||||
// this must still work around the lack of proper texture support on the script side.
|
||||
DEFINE_ACTION_FUNCTION(DDukeGenericDestructible, SetBroken)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(DDukeActor);
|
||||
PARAM_INT(bust);
|
||||
int tilenum = self->IntVar(bust ? NAME_brokenstate : NAME_spawnstate);
|
||||
if (tilenum > 0) self->spr.picnum = tilenum;
|
||||
ACTION_RETURN_BOOL(tilenum > 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void spawnguts(DDukeActor* origin, PClass* type, int count)
|
||||
{
|
||||
|
|
|
@ -30,6 +30,393 @@ spawnclasses
|
|||
7397 = RedneckRabbitJibC
|
||||
8890 = RedneckMamaJibA
|
||||
8895 = RedneckMamaJibB
|
||||
|
||||
8487 = DukeGenericDestructible, "RRTILE8487", "RRTILE8488", "BALLOON"
|
||||
8489 = DukeGenericDestructible, "RRTILE8489", "RRTILE8490", "BALLOON"
|
||||
|
||||
/*
|
||||
case RRTILE8487:
|
||||
case RRTILE8489:
|
||||
S_PlayActorSound(471, targ);
|
||||
targ->spr.picnum++;
|
||||
break;
|
||||
case RRTILE7638:
|
||||
case RRTILE7644:
|
||||
case RRTILE7646:
|
||||
case RRTILE7650:
|
||||
case RRTILE7653:
|
||||
case RRTILE7655:
|
||||
case RRTILE7691:
|
||||
case RRTILE7876:
|
||||
case RRTILE7881:
|
||||
case RRTILE7883:
|
||||
targ->spr.picnum++;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case RRTILE7879:
|
||||
targ->spr.picnum++;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE7648:
|
||||
case RRTILE7694:
|
||||
case RRTILE7700:
|
||||
case RRTILE7702:
|
||||
case RRTILE7711:
|
||||
targ->spr.picnum++;
|
||||
S_PlayActorSound(47, targ);
|
||||
break;
|
||||
case RRTILE7636:
|
||||
targ->spr.picnum += 3;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case RRTILE7875:
|
||||
targ->spr.picnum += 3;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case RRTILE7640:
|
||||
targ->spr.picnum += 2;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case RRTILE7595:
|
||||
case RRTILE7704:
|
||||
targ->spr.picnum = RRTILE7705;
|
||||
S_PlayActorSound(495, targ);
|
||||
break;
|
||||
case RRTILE8579:
|
||||
targ->spr.picnum = RRTILE5014;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7441:
|
||||
targ->spr.picnum = RRTILE5016;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7534:
|
||||
targ->spr.picnum = RRTILE5029;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7545:
|
||||
targ->spr.picnum = RRTILE5030;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7547:
|
||||
targ->spr.picnum = RRTILE5031;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7574:
|
||||
targ->spr.picnum = RRTILE5032;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7575:
|
||||
targ->spr.picnum = RRTILE5033;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7578:
|
||||
targ->spr.picnum = RRTILE5034;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7478:
|
||||
targ->spr.picnum = RRTILE5035;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8525:
|
||||
targ->spr.picnum = RRTILE5036;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8537:
|
||||
targ->spr.picnum = RRTILE5062;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8215:
|
||||
targ->spr.picnum = RRTILE5064;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8216:
|
||||
targ->spr.picnum = RRTILE5065;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8217:
|
||||
targ->spr.picnum = RRTILE5066;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8218:
|
||||
targ->spr.picnum = RRTILE5067;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8220:
|
||||
targ->spr.picnum = RRTILE5068;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8221:
|
||||
targ->spr.picnum = RRTILE5069;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8312:
|
||||
targ->spr.picnum = RRTILE5071;
|
||||
S_PlayActorSound(472, targ);
|
||||
break;
|
||||
case RRTILE8395:
|
||||
targ->spr.picnum = RRTILE5072;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8423:
|
||||
targ->spr.picnum = RRTILE5073;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE3462:
|
||||
targ->spr.picnum = RRTILE5074;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case UWHIP:
|
||||
targ->spr.picnum = RRTILE5075;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8608:
|
||||
targ->spr.picnum = RRTILE5083;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8609:
|
||||
targ->spr.picnum = RRTILE5084;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8567:
|
||||
case RRTILE8568:
|
||||
case RRTILE8569:
|
||||
case RRTILE8570:
|
||||
case RRTILE8571:
|
||||
targ->spr.picnum = RRTILE5082;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8640:
|
||||
targ->spr.picnum = RRTILE5085;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8611:
|
||||
targ->spr.picnum = RRTILE5086;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case TECHLIGHTBUST2:
|
||||
targ->spr.picnum = TECHLIGHTBUST4;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8497:
|
||||
targ->spr.picnum = RRTILE5076;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8162:
|
||||
case RRTILE8163:
|
||||
case RRTILE8164:
|
||||
case RRTILE8165:
|
||||
case RRTILE8166:
|
||||
case RRTILE8167:
|
||||
case RRTILE8168:
|
||||
ChangeActorStat(targ, STAT_MISC);
|
||||
targ->spr.picnum = RRTILE5063;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8589:
|
||||
case RRTILE8590:
|
||||
case RRTILE8591:
|
||||
case RRTILE8592:
|
||||
case RRTILE8593:
|
||||
case RRTILE8594:
|
||||
case RRTILE8595:
|
||||
ChangeActorStat(targ, STAT_MISC);
|
||||
targ->spr.picnum = RRTILE8588;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE3497:
|
||||
targ->spr.picnum = RRTILE5076;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE3498:
|
||||
targ->spr.picnum = RRTILE5077;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE3499:
|
||||
targ->spr.picnum = RRTILE5078;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8503:
|
||||
targ->spr.picnum = RRTILE5079;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7901:
|
||||
targ->spr.picnum = RRTILE5080;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7696:
|
||||
targ->spr.picnum = RRTILE7697;
|
||||
S_PlayActorSound(DUKE_SHUCKS, targ);
|
||||
break;
|
||||
case RRTILE7806:
|
||||
targ->spr.picnum = RRTILE5043;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7885:
|
||||
case RRTILE7890:
|
||||
targ->spr.picnum = RRTILE5045;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE7886:
|
||||
targ->spr.picnum = RRTILE5046;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE7887:
|
||||
targ->spr.picnum = RRTILE5044;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE7900:
|
||||
targ->spr.picnum = RRTILE5047;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7906:
|
||||
targ->spr.picnum = RRTILE5048;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7912:
|
||||
case RRTILE7913:
|
||||
targ->spr.picnum = RRTILE5049;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8047:
|
||||
targ->spr.picnum = RRTILE5050;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8596:
|
||||
targ->spr.picnum = RRTILE8598;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8059:
|
||||
targ->spr.picnum = RRTILE5051;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8060:
|
||||
targ->spr.picnum = RRTILE5052;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8222:
|
||||
targ->spr.picnum = RRTILE5053;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8223:
|
||||
targ->spr.picnum = RRTILE5054;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8224:
|
||||
targ->spr.picnum = RRTILE5055;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8370:
|
||||
targ->spr.picnum = RRTILE5056;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8371:
|
||||
targ->spr.picnum = RRTILE5057;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8372:
|
||||
targ->spr.picnum = RRTILE5058;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8373:
|
||||
targ->spr.picnum = RRTILE5059;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8396:
|
||||
targ->spr.picnum = RRTILE5038;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8397:
|
||||
targ->spr.picnum = RRTILE5039;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8398:
|
||||
targ->spr.picnum = RRTILE5040;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8399:
|
||||
targ->spr.picnum = RRTILE5041;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8385:
|
||||
targ->spr.picnum = RRTILE8386;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8387:
|
||||
targ->spr.picnum = RRTILE8388;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8389:
|
||||
targ->spr.picnum = RRTILE8390;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8391:
|
||||
targ->spr.picnum = RRTILE8392;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE7553:
|
||||
targ->spr.picnum = RRTILE5035;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8475:
|
||||
targ->spr.picnum = RRTILE5075;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8498:
|
||||
targ->spr.picnum = RRTILE5077;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE8499:
|
||||
targ->spr.picnum = RRTILE5078;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE2445:
|
||||
targ->spr.picnum = RRTILE2450;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE2123:
|
||||
targ->spr.picnum = RRTILE2124;
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
case RRTILE3773:
|
||||
targ->spr.picnum = RRTILE8651;
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
case RRTILE7533:
|
||||
targ->spr.picnum = RRTILE5035;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE8394:
|
||||
targ->spr.picnum = RRTILE5072;
|
||||
S_PlayActorSound(495, targ);
|
||||
break;
|
||||
case RRTILE8461:
|
||||
case RRTILE8462:
|
||||
targ->spr.picnum = RRTILE5074;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE3584:
|
||||
targ->spr.picnum = RRTILE8681;
|
||||
S_PlayActorSound(495, targ);
|
||||
fi.hitradius(targ, 250, 0, 0, 1, 1);
|
||||
break;
|
||||
case RRTILE8682:
|
||||
targ->spr.picnum = RRTILE8683;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
break;
|
||||
case RRTILE2437:
|
||||
S_PlayActorSound(439, targ);
|
||||
break;
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
tileflag TFLAG_WALLSWITCH {
|
||||
|
|
|
@ -75,6 +75,7 @@ version "4.10"
|
|||
#include "zscript/games/duke/actors/canwithsomething.zs"
|
||||
#include "zscript/games/duke/actors/tongue.zs"
|
||||
|
||||
#include "zscript/games/duke/actors/genericdestructible.zs"
|
||||
#include "zscript/games/duke/actors/rabbitspawner.zs"
|
||||
#include "zscript/games/duke/actors/chickenplant.zs"
|
||||
#include "zscript/games/duke/actors/lumberblade.zs"
|
||||
|
|
190
wadsrc/static/zscript/games/duke/actors/genericdestructible.zs
Normal file
190
wadsrc/static/zscript/games/duke/actors/genericdestructible.zs
Normal file
|
@ -0,0 +1,190 @@
|
|||
|
||||
|
||||
class DukeGenericDestructible : DukeActor
|
||||
{
|
||||
TextureID spawnstate, brokenstate;
|
||||
Sound breaksound;
|
||||
bool broken;
|
||||
|
||||
native bool SetBroken(bool bust); // sets broken texture. Must be done natively as long as we do not have proper texture support.
|
||||
|
||||
virtual bool DestroyAction() { return false; } // for customized subclasses
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.SetBroken(false);
|
||||
}
|
||||
|
||||
override void OnHit(DukeActor proj)
|
||||
{
|
||||
if (broken) return;
|
||||
|
||||
broken = true;
|
||||
bool res1 = self.SetBroken(true);
|
||||
bool res2 = DestroyAction();
|
||||
if (res1 || res2)
|
||||
self.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
class DukeGenericDamagingDestructible : DukeGenericDestructible
|
||||
{
|
||||
override bool DestroyAction()
|
||||
{
|
||||
self.hitradius(10, 0, 0, 1, 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeGenericGlassSpawningDestructible : DukeGenericDestructible
|
||||
{
|
||||
override bool DestroyAction()
|
||||
{
|
||||
self.lotsofglass(10);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeGenericUnblockingDestructible : DukeGenericDestructible
|
||||
{
|
||||
override bool DestroyAction()
|
||||
{
|
||||
self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// todo: RRRA
|
||||
|
||||
|
||||
// RR
|
||||
|
||||
case RRTILE3114:
|
||||
targ->spr.picnum = RRTILE3117;
|
||||
break;
|
||||
case RRTILE2876:
|
||||
targ->spr.picnum = RRTILE2990;
|
||||
break;
|
||||
case RRTILE3152:
|
||||
targ->spr.picnum = RRTILE3218;
|
||||
break;
|
||||
case RRTILE3153:
|
||||
targ->spr.picnum = RRTILE3219;
|
||||
break;
|
||||
case RRTILE2030:
|
||||
targ->spr.picnum = RRTILE2034;
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
case RRTILE2893:
|
||||
case RRTILE2915:
|
||||
case RRTILE3115:
|
||||
case RRTILE3171:
|
||||
switch (targ->spr.picnum)
|
||||
{
|
||||
case RRTILE2915:
|
||||
targ->spr.picnum = RRTILE2977;
|
||||
break;
|
||||
case RRTILE2893:
|
||||
targ->spr.picnum = RRTILE2978;
|
||||
break;
|
||||
case RRTILE3115:
|
||||
targ->spr.picnum = RRTILE3116;
|
||||
break;
|
||||
case RRTILE3171:
|
||||
targ->spr.picnum = RRTILE3216;
|
||||
break;
|
||||
}
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
case RRTILE2156:
|
||||
case RRTILE2158:
|
||||
case RRTILE2160:
|
||||
case RRTILE2175:
|
||||
targ->spr.picnum++;
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
break;
|
||||
|
||||
case RRTILE2654:
|
||||
case RRTILE2656:
|
||||
case RRTILE3172:
|
||||
if (!isRRRA()) break;
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
lotsofglass(targ, nullptr, 10);
|
||||
targ->Destroy();
|
||||
break;
|
||||
case GRATE1:
|
||||
targ->spr.picnum = BGRATE1;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
case CIRCLEPANNEL:
|
||||
targ->spr.picnum = CIRCLEPANNELBROKE;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
+
|
||||
case GRATE1:
|
||||
targ->spr.picnum = BGRATE1;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
case CIRCLEPANNEL:
|
||||
targ->spr.picnum = CIRCLEPANNELBROKE;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
|
||||
Duke
|
||||
|
||||
case GRATE1:
|
||||
targ->spr.picnum = BGRATE1;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
case CIRCLEPANNEL:
|
||||
targ->spr.picnum = CIRCLEPANNELBROKE;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case PANNEL1:
|
||||
case PANNEL2:
|
||||
targ->spr.picnum = BPANNEL1;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case PANNEL3:
|
||||
targ->spr.picnum = BPANNEL3;
|
||||
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
|
||||
case CHAIR1:
|
||||
case CHAIR2:
|
||||
targ->spr.picnum = BROKENCHAIR;
|
||||
targ->spr.cstat = 0;
|
||||
break;
|
||||
case CHAIR3:
|
||||
case MOVIECAMERA:
|
||||
case SCALE:
|
||||
case VACUUM:
|
||||
case CAMERALIGHT:
|
||||
case IVUNIT:
|
||||
case POT1:
|
||||
case POT2:
|
||||
case POT3:
|
||||
case TRIPODCAMERA:
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
for (j = 0; j < 16; j++) RANDOMSCRAP(targ);
|
||||
targ->Destroy();
|
||||
break;
|
||||
*/
|
|
@ -252,6 +252,11 @@ class DukeJibs6 : DukeJibs1
|
|||
{
|
||||
spritesetindex 1;
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
if (Raze.isRR()) self.scale *= 0.5; // only RR needs this.
|
||||
}
|
||||
}
|
||||
|
||||
class DukeHeadJib1 : DukeJibs1
|
||||
|
@ -544,6 +549,8 @@ class RedneckRabbitJibA : DukeJibs1
|
|||
default
|
||||
{
|
||||
pic "RABBITJIBA";
|
||||
ScaleX 0.28125;
|
||||
ScaleY 0.28125;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -552,6 +559,8 @@ class RedneckRabbitJibB : DukeJibs1
|
|||
default
|
||||
{
|
||||
pic "RABBITJIBB";
|
||||
ScaleX 0.5625;
|
||||
ScaleY 0.5625;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -560,6 +569,8 @@ class RedneckRabbitJibC : DukeJibs1
|
|||
default
|
||||
{
|
||||
pic "RABBITJIBC";
|
||||
ScaleX 0.84375;
|
||||
ScaleY 0.84375;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -221,11 +221,13 @@ struct DukeLevel
|
|||
native static void operatemasterswitches(int lotag);
|
||||
native static void operateactivators(int lotag, DukePlayer p);
|
||||
native static int floorflags(sectortype s);
|
||||
native static int wallflags(walltype s);
|
||||
native static void AddCycler(sectortype sector, int lotag, int shade, int shade2, int hitag, int state);
|
||||
native static void addtorch(sectortype sector, int shade, int lotag);
|
||||
native static void addlightning(sectortype sector, int shade);
|
||||
native static int addambient(int hitag, int lotag);
|
||||
native static void resetswitch(int tag); //
|
||||
native bool isMirror(walltype wal);
|
||||
}
|
||||
|
||||
struct DukeStatIterator
|
||||
|
@ -305,4 +307,12 @@ enum sflags2_t
|
|||
SFLAG2_ALWAYSROTATE1 = 0x00001000,
|
||||
SFLAG2_DIENOW = 0x00002000,
|
||||
SFLAG2_TRANFERPALTOJIBS = 0x00004000,
|
||||
SFLAG2_NORADIUSPUSH = 0x00008000,
|
||||
SFLAG2_FREEZEDAMAGE = 0x00010000,
|
||||
SFLAG2_REFLECTIVE = 0x00020000,
|
||||
SFLAG2_SPAWNRABBITGUTS = 0x00040000, // this depends on the shooter, not the projectile so it has to be done with a flag.
|
||||
SFLAG2_NONSMOKYROCKET = 0x00080000, // same with this one. Flags should later be copied to the projectile once posible.
|
||||
SFLAG2_MIRRORREFLECT = 0x00100000,
|
||||
SFLAG2_NOCIRCLEREFLECT = 0x00200000, // yet another shooter flag. :(
|
||||
SFLAG2_UNDERWATERSLOWDOWN = 0x00400000,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue