Hardcode Ice Cap Blocks

This commit is contained in:
James R 2023-11-27 05:00:14 -08:00
parent aec21cd114
commit c5968ad3ad
8 changed files with 69 additions and 1 deletions

View file

@ -4838,6 +4838,12 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_SA2_CRATE_DEBRIS_G",
"S_SA2_CRATE_DEBRIS_H",
"S_SA2_CRATE_DEBRIS_METAL",
"S_ICECAPBLOCK_DEBRIS",
"S_ICECAPBLOCK_DEBRIS_C",
"S_ICECAPBLOCK_DEBRIS_D",
"S_ICECAPBLOCK_DEBRIS_E",
"S_ICECAPBLOCK_DEBRIS_F",
};
// RegEx to generate this from info.h: ^\tMT_([^,]+), --> \t"MT_\1",
@ -6068,6 +6074,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_BOX_SIDE",
"MT_BOX_DEBRIS",
"MT_SA2_CRATE",
"MT_ICECAPBLOCK",
};
const char *const MOBJFLAG_LIST[] = {

View file

@ -987,6 +987,7 @@ char sprnames[NUMSPRITES + 1][5] =
"SFTR",
"SABX",
"ICBL",
// First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw later
"VIEW",
@ -5686,6 +5687,12 @@ state_t states[NUMSTATES] =
{SPR_SABX, 6, 70, {NULL}, 0, 0, S_NULL}, // S_SA2_CRATE_DEBRIS_G
{SPR_SABX, 7, 70, {NULL}, 0, 0, S_NULL}, // S_SA2_CRATE_DEBRIS_H
{SPR_SABX, 12, 70, {NULL}, 0, 0, S_NULL}, // S_SA2_CRATE_DEBRIS_METAL
{SPR_UNKN, FF_FULLBRIGHT, -1, {A_RandomStateRange}, S_ICECAPBLOCK_DEBRIS_C, S_ICECAPBLOCK_DEBRIS_F, S_NULL}, // S_ICECAPBLOCK_DEBRIS
{SPR_ICBL, 2, 70, {NULL}, 0, 0, S_NULL}, // S_ICECAPBLOCK_DEBRIS_C
{SPR_ICBL, 3, 70, {NULL}, 0, 0, S_NULL}, // S_ICECAPBLOCK_DEBRIS_D
{SPR_ICBL, 4, 70, {NULL}, 0, 0, S_NULL}, // S_ICECAPBLOCK_DEBRIS_E
{SPR_ICBL, 5, 70, {NULL}, 0, 0, S_NULL}, // S_ICECAPBLOCK_DEBRIS_F
};
mobjinfo_t mobjinfo[NUMMOBJTYPES] =
@ -32287,6 +32294,32 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
MF_SPECIAL|MF_SOLID|MF_SHOOTABLE|MF_SCENERY|MF_DONTPUNT, // flags
S_NULL // raisestate
},
{ // MT_ICECAPBLOCK
3750, // doomednum
S_INVISIBLE, // spawnstate
1, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
0, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
40*FRACUNIT, // radius
80*FRACUNIT, // height
0, // dispoffset
0, // mass
0, // damage
sfx_None, // activesound
MF_SPECIAL|MF_SOLID|MF_SHOOTABLE|MF_SCENERY|MF_DONTPUNT, // flags
S_NULL // raisestate
},
};

View file

@ -1541,6 +1541,7 @@ typedef enum sprite
SPR_SFTR,
SPR_SABX,
SPR_ICBL,
// First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw later
SPR_VIEW,
@ -6111,6 +6112,12 @@ typedef enum state
S_SA2_CRATE_DEBRIS_H,
S_SA2_CRATE_DEBRIS_METAL,
S_ICECAPBLOCK_DEBRIS,
S_ICECAPBLOCK_DEBRIS_C,
S_ICECAPBLOCK_DEBRIS_D,
S_ICECAPBLOCK_DEBRIS_E,
S_ICECAPBLOCK_DEBRIS_F,
S_FIRSTFREESLOT,
S_LASTFREESLOT = S_FIRSTFREESLOT + NUMSTATEFREESLOTS - 1,
NUMSTATES
@ -7360,6 +7367,7 @@ typedef enum mobj_type
MT_BOX_SIDE,
MT_BOX_DEBRIS,
MT_SA2_CRATE,
MT_ICECAPBLOCK,
MT_FIRSTFREESLOT,
MT_LASTFREESLOT = MT_FIRSTFREESLOT + NUMMOBJFREESLOTS - 1,

View file

@ -321,7 +321,7 @@ void Obj_PatrolIvoBallInit(mobj_t *mo);
void Obj_PatrolIvoBallThink(mobj_t *mo);
void Obj_PatrolIvoBallTouch(mobj_t *special, mobj_t *toucher);
/* SA2 Crates */
/* SA2 Crates / Ice Cap Blocks */
void Obj_BoxSideThink(mobj_t *mo);
void Obj_TryCrateInit(mobj_t *mo);
boolean Obj_TryCrateThink(mobj_t *mo);

View file

@ -49,6 +49,13 @@ struct SA2CrateConfig
static constexpr statenum_t kDefaultDebris = S_SA2_CRATE_DEBRIS;
};
struct IceCapBlockConfig
{
static constexpr spritenum_t kSprite = SPR_ICBL;
static constexpr frame_layout kFrames = {6, 6, 0, 0, 0, 0};
static constexpr statenum_t kDefaultDebris = S_ICECAPBLOCK_DEBRIS;
};
struct Graphic : Mobj
{
void hnext() = delete;
@ -330,6 +337,10 @@ struct Crate : Box<SA2CrateConfig>
}
};
struct Ice : Box<IceCapBlockConfig>
{
};
template <typename F>
bool AnyBox::visit(F&& visitor)
{
@ -339,6 +350,10 @@ bool AnyBox::visit(F&& visitor)
visitor(static_cast<Crate*>(this));
break;
case MT_ICECAPBLOCK:
visitor(static_cast<Ice*>(this));
break;
default:
return false;
}

View file

@ -989,6 +989,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
case MT_SA2_CRATE:
case MT_ICECAPBLOCK:
{
Obj_TryCrateTouch(special, toucher);
return;
@ -2855,6 +2856,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
return false;
case MT_SA2_CRATE:
case MT_ICECAPBLOCK:
Obj_TryCrateDamage(target, inflictor);
return true;

View file

@ -1635,6 +1635,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
switch (tm.thing->type)
{
case MT_SA2_CRATE:
case MT_ICECAPBLOCK:
// Let crates stack on top of solid objects (this
// includes other crates).
if (thing->flags & MF_SOLID)

View file

@ -6837,6 +6837,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
return;
}
case MT_SA2_CRATE:
case MT_ICECAPBLOCK:
{
if (!Obj_TryCrateThink(mobj))
{
@ -14490,6 +14491,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj)
break;
}
case MT_SA2_CRATE:
case MT_ICECAPBLOCK:
{
Obj_TryCrateInit(mobj);
break;