diff --git a/source/core/maptypes.h b/source/core/maptypes.h index b6ce28f45..19f564a5a 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -193,6 +193,8 @@ enum ETSprFlags TSPR_FLAGS_DRAW_LAST = 2, // Currently unused: checked by Polymost but never set. TSPR_MDLROTATE = 4, // rotate if this is a model or voxel. TSPR_SLOPESPRITE = 8, // render as sloped sprite + TSPR_ROTATE8FRAMES = 16, // do an 8 frame rotation + TSPR_ROTATE12FRAMES = 32, // do an 12 frame rotation }; diff --git a/source/games/duke/src/constants.h b/source/games/duke/src/constants.h index f9e0b6301..ce340301e 100644 --- a/source/games/duke/src/constants.h +++ b/source/games/duke/src/constants.h @@ -369,6 +369,12 @@ enum sflags2_t SFLAG2_NORADIUSPUSH = 0x00008000, SFLAG2_FREEZEDAMAGE = 0x00010000, SFLAG2_REFLECTIVE = 0x00020000, + SFLAG2_ALWAYSROTATE2 = 0x00040000, + SFLAG2_SPECIALAUTOAIM = 0x00080000, + SFLAG2_NODAMAGEPUSH = 0x00100000, + SFLAG2_IGNOREHITOWNER = 0x00200000, + SFLAG2_DONTDIVE = 0x00400000, + SFLAG2_FLOATING = 0x00800000, }; using EDukeFlags2 = TFlags; diff --git a/source/games/duke/src/flags_d.cpp b/source/games/duke/src/flags_d.cpp index 708e2d117..5f0cedc65 100644 --- a/source/games/duke/src/flags_d.cpp +++ b/source/games/duke/src/flags_d.cpp @@ -123,6 +123,11 @@ void initactorflags_d() setflag(SFLAG2_TRANFERPALTOJIBS, { LIZTROOP }); setflag(SFLAG2_NORADIUSPUSH, { TANK, ROTATEGUN, RECON }); setflag(SFLAG2_FREEZEDAMAGE | SFLAG2_REFLECTIVE, { FREEZEBLAST }); + setflag(SFLAG2_ALWAYSROTATE2, { RECON }); + setflag(SFLAG2_SPECIALAUTOAIM, { RECON }); + setflag(SFLAG2_IGNOREHITOWNER, { RECON }); + setflag(SFLAG2_NODAMAGEPUSH, { RECON, TANK, ROTATEGUN }); + setflag(SFLAG2_FLOATING, { DRONE, SHARK, COMMANDER }); if (isWorldTour()) { diff --git a/source/games/duke/src/flags_r.cpp b/source/games/duke/src/flags_r.cpp index d84f67ba4..6a9dea57f 100644 --- a/source/games/duke/src/flags_r.cpp +++ b/source/games/duke/src/flags_r.cpp @@ -180,6 +180,10 @@ void initactorflags_r() setflag(SFLAG2_DIENOW, { RADIUSEXPLOSION }); setflag(SFLAG2_NORADIUSPUSH, { HULK }); setflag(SFLAG2_FREEZEDAMAGE | SFLAG2_REFLECTIVE, { FREEZEBLAST }); + setflag(SFLAG2_ALWAYSROTATE2, { RECON }); + setflag(SFLAG2_SPECIALAUTOAIM, { RECON }); + setflag(SFLAG2_IGNOREHITOWNER, { RECON }); + setflag(SFLAG2_FLOATING, { DRONE }); // Animals were not supposed to have this, but due to a coding bug the logic was unconditional for everything in the game. @@ -188,15 +192,20 @@ void initactorflags_r() ainf.flags |= SFLAG_MOVEFTA_WAKEUPCHECK; } + if (isRRRA()) { setflag(SFLAG_MOVEFTA_CHECKSEEWITHPAL8, { MINION }); setflag(SFLAG2_TRANFERPALTOJIBS, { MINION }); setflag(SFLAG2_NORADIUSPUSH, { MAMA, BILLYPLAY, COOTPLAY, MAMACLOUD }); + setflag(SFLAG2_DONTDIVE, { CHEERBOAT, HULKBOAT, MINIONBOAT, UFO1_RRRA }); + setflag(SFLAG2_FLOATING, { UFO1_RRRA }); } else { setflag(SFLAG2_NORADIUSPUSH, { SBMOVE }); + setflag(SFLAG2_DONTDIVE, { UFO1_RR, UFO2, UFO3, UFO4, UFO5 }); + setflag(SFLAG2_FLOATING, { UFO1_RR, UFO2, UFO3, UFO4, UFO5 }); } gs.actorinfo[RPG2].flags |= SFLAG_FORCEAUTOAIM; diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index e76621fd4..d75d77bb1 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -681,7 +681,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw double dal = ((aimed->spr.scale.X * tileHeight(aimed->spr.picnum)) * 0.5) + 8; double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length(); zvel = ((aimed->spr.pos.Z - pos.Z - dal) * vel) / dist; - if (aimed->spr.picnum != RECON) + if (!actorflag(aimed, SFLAG2_SPECIALAUTOAIM)) ang = (aimed->spr.pos.XY() - pos.XY()).Angle(); } else diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 2134f0454..ba0385c67 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -592,7 +592,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw double dal = ((aimed->spr.scale.X * tileHeight(aimed->spr.picnum)) * 0.5) + 8; double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length(); zvel = ((aimed->spr.pos.Z - pos.Z - dal) * vel) / dist; - if (aimed->spr.picnum != RECON) + if (!actorflag(aimed, SFLAG2_SPECIALAUTOAIM)) ang = (aimed->spr.pos.XY() - pos.XY()).Angle(); } else diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 700eb2b1c..4fe24c0f5 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -975,7 +975,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj) fi.shoot(targ, BLOODSPLAT4); } - if (targ->spr.picnum != TANK && !bossguy(targ) && targ->spr.picnum != RECON && targ->spr.picnum != ROTATEGUN) + if (!actorflag(targ, SFLAG2_NODAMAGEPUSH) && !bossguy(targ)) // RR does not have this. { if ((targ->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0) targ->spr.Angles.Yaw = proj->spr.Angles.Yaw + DAngle180; @@ -987,9 +987,9 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj) ChangeActorSect(targ, sp); } - if (targ->spr.statnum == 2) + if (targ->spr.statnum == STAT_ZOMBIEACTOR) { - ChangeActorStat(targ, 1); + ChangeActorStat(targ, STAT_ACTOR); targ->timetosleep = SLEEPTIME; } if ((targ->spr.scale.X < 0.375 || targ->spr.picnum == SHARK) && proj->spr.picnum == SHRINKSPARK) return; diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index ffe478fc3..6b3b64170 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -1339,9 +1339,9 @@ void checkhitdefault_r(DDukeActor* targ, DDukeActor* proj) fi.shoot(targ, BLOODSPLAT4); } - if (targ->spr.statnum == 2) + if (targ->spr.statnum == STAT_ZOMBIEACTOR) { - ChangeActorStat(targ, 1); + ChangeActorStat(targ, STAT_ACTOR); targ->timetosleep = SLEEPTIME; } } diff --git a/wadsrc/static/zscript/games/duke/dukeactor.zs b/wadsrc/static/zscript/games/duke/dukeactor.zs index 74c090d6a..39e0ab077 100644 --- a/wadsrc/static/zscript/games/duke/dukeactor.zs +++ b/wadsrc/static/zscript/games/duke/dukeactor.zs @@ -318,9 +318,10 @@ enum sflags2_t 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, + SFLAG2_ALWAYSROTATE2 = 0x00040000, + SFLAG2_SPECIALAUTOAIM = 0x00080000, + SFLAG2_NODAMAGEPUSH = 0x00100000, + SFLAG2_IGNOREHITOWNER = 0x00200000, + SFLAG2_DONTDIVE = 0x00400000, + SFLAG2_FLOATING = 0x00800000, };