Ancient Shrine: Code the rest of the owl

- If a follower with the specific Mystic Melody sound effect (DSMELODY) is used on the Shrine by a local player...
- Activates the shrine after two seconds!
    - This is clientside only.
- Stores on the mapheaderinfo's mapvisited record
This commit is contained in:
toaster 2023-10-06 22:24:40 +01:00
parent fe62e76a39
commit d386800c1e
7 changed files with 68 additions and 9 deletions

View file

@ -142,7 +142,8 @@ struct skinreference_t
#define MV_BEATEN (1<<1)
#define MV_ENCORE (1<<2)
#define MV_SPBATTACK (1<<3)
#define MV_MAX (MV_VISITED|MV_BEATEN|MV_ENCORE|MV_SPBATTACK)
#define MV_MYSTICMELODY (1<<4)
#define MV_MAX (MV_VISITED|MV_BEATEN|MV_ENCORE|MV_SPBATTACK|MV_MYSTICMELODY)
#define MV_FINISHNEEDED (1<<7)
#define MV_PERSISTUNLOADED (MV_SPBATTACK|MV_FINISHNEEDED)

View file

@ -8336,7 +8336,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass
0, // damage
sfx_None, // activesound
MF_SCENERY|MF_NOGRAVITY|MF_SOLID|MF_DONTENCOREMAP, // flags
MF_NOGRAVITY|MF_SOLID|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},

View file

@ -729,15 +729,16 @@ void K_FollowerHornTaunt(player_t *taunter, player_t *victim, boolean mysticmelo
const follower_t *fl = &followers[taunter->followerskin];
// Check mystic melody special status
// Restrict mystic melody special status
if (mysticmelodyspecial == true)
{
/*mysticmelodyspecial = (fl->hornsound == sfx_melody)
if (mysticmelodyspecial == true)
{
// Todo: The rest of the owl
}*/
mysticmelodyspecial = (
(demo.playback == false) // No downloading somebody else's replay
&& (fl->hornsound == sfx_melody) // Must be the Mystic Melody
&& (taunter->bot == false) // No getting your puppies to do it for you
&& P_IsLocalPlayer(taunter) // Must be in your party
&& !(mapheaderinfo[gamemap-1]->records.mapvisited & MV_MYSTICMELODY) // Not already done
);
}
// More expensive checks
@ -758,6 +759,40 @@ void K_FollowerHornTaunt(player_t *taunter, player_t *victim, boolean mysticmelo
mobj_t *honk = taunter->follower->hprev;
const fixed_t desiredscale = (2*taunter->mo->scale)/3;
if (mysticmelodyspecial == true)
{
mobj_t *mobj = NULL, *next = NULL;
for (mobj = trackercap; mobj; mobj = next)
{
next = mobj->itnext;
if (mobj->type != MT_ANCIENTSHRINE)
{
// Not relevant
continue;
}
if (P_MobjWasRemoved(mobj->tracer) == false)
{
// Already initiated
continue;
}
// Cleverly a mobj type where TypeIsNetSynced is false
P_SetTarget(&mobj->tracer, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_HORNCODE));
if (P_MobjWasRemoved(mobj->tracer) == true)
{
// Unrecoverable?!
continue;
}
// This is a helper non-netsynced countdown
mobj->tracer->renderflags |= RF_DONTDRAW;
mobj->tracer->fuse = 2*TICRATE;
}
}
if (P_MobjWasRemoved(honk) == true)
{
honk = P_SpawnMobj(

View file

@ -6392,6 +6392,12 @@ static void M_DrawMapMedals(INT32 mapnum, INT32 x, INT32 y)
}
x -= 8;
}
if (mapheaderinfo[mapnum]->records.mapvisited & MV_MYSTICMELODY)
{
V_DrawScaledPatch(x, y, 0, W_CachePatchName("GOTMEL", PU_CACHE));
x -= 8;
}
}
static void M_DrawStatsMaps(void)

View file

@ -7255,6 +7255,21 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
break;
}
case MT_ANCIENTSHRINE:
{
if (P_MobjWasRemoved(mobj->tracer) == false
&& mobj->tracer->fuse == 1)
{
if (!(mapheaderinfo[gamemap-1]->records.mapvisited & MV_MYSTICMELODY))
{
mapheaderinfo[gamemap-1]->records.mapvisited |= MV_MYSTICMELODY;
}
}
mobj->frame = (mapheaderinfo[gamemap-1]->records.mapvisited & MV_MYSTICMELODY) ? 1 : 0;
break;
}
case MT_FLOATINGITEM:
{
P_ResetPitchRoll(mobj);

View file

@ -1192,6 +1192,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"clawk2", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SF_X8AWAYSOUND
{"horn00", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "/"}, // HORNCODE
{"melody", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "/"}, // Mystic Melody
{"monch", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"etexpl", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Game crash"},

View file

@ -1262,6 +1262,7 @@ typedef enum
sfx_clawk2,
sfx_horn00,
sfx_melody,
sfx_monch,
sfx_etexpl,