mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-23 19:31:05 +00:00
Implemented the two NiGHTS Emblem types in the TUDD via var modifications to ET_GLOBAL!
* GE_NIGHTSPULL (for it to chase you once paralooped) - Sun emblem * GE_NIGHTSITEM (for hidden until paralooped) - Moon emblem Combined means that you essentially have to loop it twice. Also, revamped NIGHTSITEM to suck a little less (and have more compatibility with MT_EMBLEM).
This commit is contained in:
parent
5f8318642b
commit
61fcbe9b36
7 changed files with 68 additions and 54 deletions
|
@ -2293,12 +2293,12 @@ static void reademblemdata(MYFILE *f, INT32 num)
|
|||
emblemlocations[num-1].type = ET_TIME;
|
||||
else if (fastcmp(word2, "RINGS"))
|
||||
emblemlocations[num-1].type = ET_RINGS;
|
||||
else if (fastcmp(word2, "MAP"))
|
||||
emblemlocations[num-1].type = ET_MAP;
|
||||
else if (fastcmp(word2, "NGRADE"))
|
||||
emblemlocations[num-1].type = ET_NGRADE;
|
||||
else if (fastcmp(word2, "NTIME"))
|
||||
emblemlocations[num-1].type = ET_NTIME;
|
||||
else if (fastcmp(word2, "MAP"))
|
||||
emblemlocations[num-1].type = ET_MAP;
|
||||
else
|
||||
emblemlocations[num-1].type = (UINT8)value;
|
||||
}
|
||||
|
@ -6233,16 +6233,11 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_NIGHTSWING_XMAS",
|
||||
|
||||
// NiGHTS Paraloop Powerups
|
||||
"S_NIGHTSPOWERUP1",
|
||||
"S_NIGHTSPOWERUP2",
|
||||
"S_NIGHTSPOWERUP3",
|
||||
"S_NIGHTSPOWERUP4",
|
||||
"S_NIGHTSPOWERUP5",
|
||||
"S_NIGHTSPOWERUP6",
|
||||
"S_NIGHTSPOWERUP7",
|
||||
"S_NIGHTSPOWERUP8",
|
||||
"S_NIGHTSPOWERUP9",
|
||||
"S_NIGHTSPOWERUP10",
|
||||
"S_NIGHTSSUPERLOOP",
|
||||
"S_NIGHTSDRILLREFILL",
|
||||
"S_NIGHTSHELPER",
|
||||
"S_NIGHTSEXTRATIME",
|
||||
"S_NIGHTSLINKFREEZE",
|
||||
"S_EGGCAPSULE",
|
||||
|
||||
// Orbiting Chaos Emeralds
|
||||
|
@ -7465,7 +7460,11 @@ struct {
|
|||
{"SF_X8AWAYSOUND",SF_X8AWAYSOUND},
|
||||
{"SF_NOINTERRUPT",SF_NOINTERRUPT},
|
||||
{"SF_X2AWAYSOUND",SF_X2AWAYSOUND},
|
||||
|
||||
|
||||
// Global emblem var flags
|
||||
{"GE_NIGHTSPULL",GE_NIGHTSPULL},
|
||||
{"GE_NIGHTSITEM",GE_NIGHTSITEM},
|
||||
|
||||
// Map emblem var flags
|
||||
{"ME_ALLEMERALDS",ME_ALLEMERALDS},
|
||||
{"ME_ULTIMATE",ME_ULTIMATE},
|
||||
|
|
35
src/info.c
35
src/info.c
|
@ -2870,16 +2870,11 @@ state_t states[NUMSTATES] =
|
|||
{SPR_NWNG, 1, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSWING_XMAS
|
||||
|
||||
// NiGHTS Paraloop Powerups
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP1
|
||||
{SPR_NPRU, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP2
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP3
|
||||
{SPR_NPRU, 1, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP4
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP5
|
||||
{SPR_NPRU, 2, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP6
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP7
|
||||
{SPR_NPRU, 3, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP8
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP9
|
||||
{SPR_NPRU, 4, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP10
|
||||
{SPR_NPRU, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSSUPERLOOP
|
||||
{SPR_NPRU, 1, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSDRILLREFILL
|
||||
{SPR_NPRU, 2, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSHELPER
|
||||
{SPR_NPRU, 3, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSEXTRATIME
|
||||
{SPR_NPRU, 4, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSLINKFREEZE
|
||||
|
||||
{SPR_CAPS, 0, -1, {NULL}, 0, 0, S_NULL}, // S_EGGCAPSULE
|
||||
|
||||
|
@ -13973,9 +13968,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSSUPERLOOP
|
||||
1707, // doomednum
|
||||
S_NIGHTSPOWERUP1, // spawnstate
|
||||
S_NIGHTSSUPERLOOP, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP2, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
@ -14000,9 +13995,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSDRILLREFILL
|
||||
1708, // doomednum
|
||||
S_NIGHTSPOWERUP3, // spawnstate
|
||||
S_NIGHTSDRILLREFILL, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP4, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
@ -14027,9 +14022,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSHELPER
|
||||
1709, // doomednum
|
||||
S_NIGHTSPOWERUP5, // spawnstate
|
||||
S_NIGHTSHELPER, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP6, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
@ -14054,9 +14049,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSEXTRATIME
|
||||
1711, // doomednum
|
||||
S_NIGHTSPOWERUP7, // spawnstate
|
||||
S_NIGHTSEXTRATIME, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP8, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
@ -14081,9 +14076,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSLINKFREEZE
|
||||
1712, // doomednum
|
||||
S_NIGHTSPOWERUP9, // spawnstate
|
||||
S_NIGHTSLINKFREEZE, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP10, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
|
15
src/info.h
15
src/info.h
|
@ -3014,16 +3014,11 @@ typedef enum state
|
|||
S_NIGHTSWING_XMAS,
|
||||
|
||||
// NiGHTS Paraloop Powerups
|
||||
S_NIGHTSPOWERUP1,
|
||||
S_NIGHTSPOWERUP2,
|
||||
S_NIGHTSPOWERUP3,
|
||||
S_NIGHTSPOWERUP4,
|
||||
S_NIGHTSPOWERUP5,
|
||||
S_NIGHTSPOWERUP6,
|
||||
S_NIGHTSPOWERUP7,
|
||||
S_NIGHTSPOWERUP8,
|
||||
S_NIGHTSPOWERUP9,
|
||||
S_NIGHTSPOWERUP10,
|
||||
S_NIGHTSSUPERLOOP,
|
||||
S_NIGHTSDRILLREFILL,
|
||||
S_NIGHTSHELPER,
|
||||
S_NIGHTSEXTRATIME,
|
||||
S_NIGHTSLINKFREEZE,
|
||||
S_EGGCAPSULE,
|
||||
|
||||
// Orbiting Chaos Emeralds
|
||||
|
|
20
src/m_cond.h
20
src/m_cond.h
|
@ -66,14 +66,18 @@ typedef struct
|
|||
} conditionset_t;
|
||||
|
||||
// Emblem information
|
||||
#define ET_GLOBAL 0 // Global map emblem, var == color
|
||||
#define ET_SKIN 1 // Skin specific emblem, var == skin
|
||||
#define ET_SCORE 2
|
||||
#define ET_TIME 3
|
||||
#define ET_RINGS 4
|
||||
#define ET_NGRADE 5
|
||||
#define ET_NTIME 6
|
||||
#define ET_MAP 7
|
||||
#define ET_GLOBAL 0 // Emblem with a position in space
|
||||
#define ET_SKIN 1 // Skin specific emblem with a position in space, var == skin
|
||||
#define ET_MAP 2 // Beat the map
|
||||
#define ET_SCORE 3 // Get the score
|
||||
#define ET_TIME 4 // Get the time
|
||||
#define ET_RINGS 5 // Get the rings
|
||||
#define ET_NGRADE 6 // Get the grade
|
||||
#define ET_NTIME 7 // Get the time (NiGHTS mode)
|
||||
|
||||
// Global emblem flags
|
||||
#define GE_NIGHTSPULL 1 // sun off the nights track - loop it
|
||||
#define GE_NIGHTSITEM 2 // moon on the nights track - find it
|
||||
|
||||
// Map emblem flags
|
||||
#define ME_ALLEMERALDS 1
|
||||
|
|
|
@ -881,7 +881,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
|
||||
if (!(mo2->flags & MF_SPECIAL) && mo2->health)
|
||||
{
|
||||
P_SetMobjState(mo2, mo2->info->seestate);
|
||||
mo2->flags2 &= ~MF2_DONTDRAW;
|
||||
mo2->flags |= MF_SPECIAL;
|
||||
mo2->flags &= ~MF_NIGHTSITEM;
|
||||
S_StartSound(toucher, sfx_hidden);
|
||||
|
@ -890,7 +890,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
}
|
||||
|
||||
if (!(mo2->type == MT_NIGHTSWING || mo2->type == MT_RING || mo2->type == MT_COIN
|
||||
|| mo2->type == MT_BLUEBALL))
|
||||
|| mo2->type == MT_BLUEBALL
|
||||
|| ((mo2->type == MT_EMBLEM) && (mo2->reactiontime & GE_NIGHTSPULL))))
|
||||
continue;
|
||||
|
||||
// Yay! The thing's in reach! Pull it in!
|
||||
|
|
|
@ -7778,6 +7778,10 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
if (mobj->flags2 & MF2_NIGHTSPULL)
|
||||
P_NightsItemChase(mobj);
|
||||
break;
|
||||
case MT_EMBLEM:
|
||||
if (mobj->flags2 & MF2_NIGHTSPULL)
|
||||
P_NightsItemChase(mobj);
|
||||
break;
|
||||
case MT_SHELL:
|
||||
if (mobj->threshold && mobj->threshold != TICRATE)
|
||||
mobj->threshold--;
|
||||
|
@ -10166,7 +10170,6 @@ ML_NOCLIMB : Direction not controllable
|
|||
// Spawn already displayed
|
||||
mobj->flags |= MF_SPECIAL;
|
||||
mobj->flags &= ~MF_NIGHTSITEM;
|
||||
P_SetMobjState(mobj, mobj->info->seestate);
|
||||
}
|
||||
|
||||
if (mobj->flags & MF_PUSHABLE)
|
||||
|
@ -10219,6 +10222,10 @@ ML_NOCLIMB : Direction not controllable
|
|||
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||
}
|
||||
|
||||
// Final set of not being able to draw nightsitems.
|
||||
if (mobj->flags & MF_NIGHTSITEM)
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
|
||||
mthing->mobj = mobj;
|
||||
}
|
||||
|
||||
|
|
|
@ -1118,7 +1118,20 @@ static inline void P_SpawnEmblems(void)
|
|||
P_SetThingPosition(emblemmobj);
|
||||
}
|
||||
else
|
||||
{
|
||||
emblemmobj->frame &= ~FF_TRANSMASK;
|
||||
|
||||
if (emblemlocations[i].type == ET_GLOBAL)
|
||||
{
|
||||
emblemmobj->reactiontime = emblemlocations[i].var;
|
||||
if (emblemlocations[i].var & GE_NIGHTSITEM)
|
||||
{
|
||||
emblemmobj->flags |= MF_NIGHTSITEM;
|
||||
emblemmobj->flags &= ~MF_SPECIAL;
|
||||
emblemmobj->flags2 |= MF2_DONTDRAW;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue