Merge branch 'hazard-punting' into 'master'

Hazard punting; fixes to flame jets and item clash VFX

Closes #755 and #732

See merge request KartKrew/Kart!1620
This commit is contained in:
Oni 2023-11-14 07:13:01 +00:00
commit 469c85377d
20 changed files with 387 additions and 194 deletions

View file

@ -5618,7 +5618,7 @@ static INT16 Consistancy(void)
if (TypeIsNetSynced(mo->type) == false)
continue;
if (mo->flags & (MF_SPECIAL | MF_SOLID | MF_PUSHABLE | MF_BOSS | MF_MISSILE | MF_SPRING | MF_MONITOR | MF_FIRE | MF_ENEMY | MF_PAIN | MF_STICKY))
if (mo->flags & (MF_SPECIAL | MF_SOLID | MF_PUSHABLE | MF_BOSS | MF_MISSILE | MF_SPRING | MF_ELEMENTAL | MF_FIRE | MF_ENEMY | MF_PAIN | MF_DONTPUNT))
{
ret -= mo->type;
ret += mo->x;

View file

@ -5987,13 +5987,13 @@ const char *const MOBJFLAG_LIST[] = {
"SLOPE",
"MISSILE",
"SPRING",
"MONITOR",
"ELEMENTAL",
"NOTHINK",
"NOCLIPHEIGHT",
"ENEMY",
"SCENERY",
"PAIN",
"STICKY",
"DONTPUNT",
"APPLYTERRAIN",
"NOCLIPTHING",
"GRENADEBOUNCE",

View file

@ -1330,7 +1330,7 @@ readghosttic:
z = READFIXED(g->p);
angle = READANGLE(g->p);
if (!(mobjinfo[type].flags & MF_SHOOTABLE)
|| !(mobjinfo[type].flags & (MF_ENEMY|MF_MONITOR))
|| !(mobjinfo[type].flags & MF_ENEMY)
|| health != 0 || i >= 4) // only spawn for the first 4 hits per frame, to prevent ghosts from splode-spamming too bad.
continue;
poof = P_SpawnMobj(x, y, z, MT_GHOST);

View file

@ -4815,12 +4815,12 @@ state_t states[NUMSTATES] =
{SPR_FLEN, FF_FULLBRIGHT|1, 3, {NULL}, 0, 0, S_FLINGENERGY3}, // S_FLINGENERGY2,
{SPR_FLEN, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_NULL}, // S_FLINGENERGY3,
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30, 2, {A_PlayActiveSound}, 0, 0, S_CLASH2}, // S_CLASH1
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30|1, 2, {NULL}, 0, 0, S_CLASH3}, // S_CLASH2
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30|2, 2, {NULL}, 0, 0, S_CLASH4}, // S_CLASH3
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30|3, 2, {NULL}, 0, 0, S_CLASH5}, // S_CLASH4
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30|4, 2, {NULL}, 0, 0, S_CLASH6}, // S_CLASH5
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30|5, 2, {NULL}, 0, 0, S_NULL}, // S_CLASH6
{SPR_CLAS, FF_FULLBRIGHT|FF_ADD, 2, {A_PlayActiveSound}, 0, 0, S_CLASH2}, // S_CLASH1
{SPR_CLAS, FF_FULLBRIGHT|FF_ADD|1, 2, {NULL}, 0, 0, S_CLASH3}, // S_CLASH2
{SPR_CLAS, FF_FULLBRIGHT|FF_ADD|2, 2, {NULL}, 0, 0, S_CLASH4}, // S_CLASH3
{SPR_CLAS, FF_FULLBRIGHT|FF_ADD|3, 2, {NULL}, 0, 0, S_CLASH5}, // S_CLASH4
{SPR_CLAS, FF_FULLBRIGHT|FF_ADD|4, 2, {NULL}, 0, 0, S_CLASH6}, // S_CLASH5
{SPR_CLAS, FF_FULLBRIGHT|FF_ADD|5, 2, {NULL}, 0, 0, S_NULL}, // S_CLASH6
{SPR_PSHW, FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FIREDITEM2}, // S_FIREDITEM1
{SPR_PSHW, FF_FULLBRIGHT|1, 3, {NULL}, 0, 0, S_FIREDITEM3}, // S_FIREDITEM2
@ -5742,7 +5742,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
1000, // mass
MT_THOK, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SOLID|MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
(statenum_t)MT_THOK // raisestate
},
@ -9548,7 +9548,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_RING_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9575,7 +9575,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_PITY_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9602,7 +9602,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_ATTRACT_ICON,// damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9629,7 +9629,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_FORCE_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9656,7 +9656,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_ARMAGEDDON_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9683,7 +9683,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_WHIRLWIND_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9710,7 +9710,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_ELEMENTAL_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9737,7 +9737,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_SNEAKERS_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9764,7 +9764,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_INVULN_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9791,7 +9791,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_1UP_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9818,7 +9818,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_EGGMAN_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9845,7 +9845,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_MIXUP_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9872,7 +9872,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_UNKNOWN, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9899,7 +9899,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_GRAVITY_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9926,7 +9926,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_RECYCLER_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9953,7 +9953,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_SCORE1K_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -9980,7 +9980,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_SCORE10K_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -10007,7 +10007,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_FLAMEAURA_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -10034,7 +10034,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_BUBBLEWRAP_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -10061,7 +10061,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_THUNDERCOIN_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -10088,7 +10088,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_PITY_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10115,7 +10115,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_ATTRACT_ICON,// damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10142,7 +10142,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_FORCE_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10169,7 +10169,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_ARMAGEDDON_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10196,7 +10196,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_WHIRLWIND_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10223,7 +10223,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_ELEMENTAL_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10250,7 +10250,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_SNEAKERS_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10277,7 +10277,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_INVULN_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10304,7 +10304,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_EGGMAN_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10331,7 +10331,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_GRAVITY_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10358,7 +10358,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_FLAMEAURA_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10385,7 +10385,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_BUBBLEWRAP_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10412,7 +10412,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_THUNDERCOIN_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
MF_SOLID|MF_SHOOTABLE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
@ -10439,7 +10439,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_RING_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -10466,7 +10466,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
MT_RING_ICON, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
MF_SOLID|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -14618,13 +14618,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_None, // deathsound
5*FRACUNIT, // speed
8*FRACUNIT, // radius
8*FRACUNIT, // height
16*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
DMG_NORMAL, // mass
0, // damage
sfx_None, // activesound
MF_NOGRAVITY|MF_MISSILE|MF_PAIN, // flags
MF_NOGRAVITY|MF_MISSILE|MF_PAIN|MF_NOSQUISH|MF_NOHITLAGFORME|MF_ELEMENTAL, // flags
S_NULL // raisestate
},
@ -23111,7 +23111,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
0, // damage
sfx_None, // activesound
MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags
MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24002,7 +24002,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_peel, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24029,7 +24029,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24083,7 +24083,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3k96, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24110,7 +24110,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24137,7 +24137,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3kc0s, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24164,7 +24164,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24218,7 +24218,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3k5c, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24245,7 +24245,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24353,7 +24353,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass
0, // damage
sfx_s3k5c, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24380,7 +24380,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3k96, // activesound
MF_SPECIAL|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SPECIAL|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24407,7 +24407,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SPECIAL|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SPECIAL|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24461,7 +24461,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24515,7 +24515,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_kc64, // activesound
MF_SOLID|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags
MF_SOLID|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -24758,7 +24758,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
0, // damage
sfx_None, // activesound
MF_NOCLIPTHING|MF_DONTENCOREMAP, // flags
MF_NOCLIPTHING|MF_DONTENCOREMAP|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -25055,7 +25055,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3k5c, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -25082,7 +25082,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -25136,7 +25136,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3k96, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_SLOPE|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -25190,7 +25190,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass
0, // damage
sfx_None, // activesound
MF_SPECIAL|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
MF_SPECIAL|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_DONTPUNT, // flags
S_NULL // raisestate
},
@ -30433,7 +30433,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass
0, // damage
sfx_None, // activesound
MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags
MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTPUNT, // flags
S_NULL // raisestate
},

View file

@ -18,6 +18,7 @@
#include "k_podium.h"
#include "k_powerup.h"
#include "k_hitlag.h"
#include "m_random.h"
angle_t K_GetCollideAngle(mobj_t *t1, mobj_t *t2)
{
@ -1170,3 +1171,114 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
return false;
}
void K_PuntHazard(mobj_t *t1, mobj_t *t2)
{
// TODO: spawn a unique mobjtype other than MT_GHOST
mobj_t *img = P_SpawnGhostMobj(t1);
K_MakeObjectReappear(t1);
img->flags &= ~MF_NOGRAVITY;
img->renderflags = t1->renderflags & ~RF_DONTDRAW;
img->extravalue1 = 1;
img->extravalue2 = 2;
img->fuse = 2*TICRATE;
struct Vector
{
fixed_t x_, y_, z_;
fixed_t h_ = FixedHypot(x_, y_);
fixed_t speed_ = std::max(60 * mapobjectscale, FixedHypot(h_, z_) * 2);
explicit Vector(fixed_t x, fixed_t y, fixed_t z) : x_(x), y_(y), z_(z) {}
explicit Vector(const mobj_t* mo) :
Vector(std::max(
Vector(mo->x - mo->old_x, mo->y - mo->old_y, mo->z - mo->old_z),
Vector(mo->momx, mo->momy, mo->momz)
))
{
}
explicit Vector(const Vector&) = default;
bool operator<(const Vector& b) const { return speed_ < b.speed_; }
void invert()
{
x_ = -x_;
y_ = -y_;
z_ = -z_;
}
void thrust(mobj_t* mo) const
{
angle_t yaw = R_PointToAngle2(0, 0, h_, z_);
yaw = std::max(AbsAngle(yaw), static_cast<angle_t>(ANGLE_11hh)) + (yaw & ANGLE_180);
P_InstaThrust(mo, R_PointToAngle2(0, 0, x_, y_), FixedMul(speed_, FCOS(yaw)));
mo->momz = FixedMul(speed_, FSIN(yaw));
}
};
Vector h_vector(t1);
Vector p_vector(t2);
h_vector.invert();
std::max(h_vector, p_vector).thrust(img);
K_DoPowerClash(img, t2); // applies hitlag
P_SpawnMobj(t2->x/2 + t1->x/2, t2->y/2 + t1->y/2, t2->z/2 + t1->z/2, MT_ITEMCLASH);
}
boolean K_PuntCollide(mobj_t *t1, mobj_t *t2)
{
if (t1->flags & MF_DONTPUNT)
{
return false;
}
if (!t2->player)
{
return false;
}
if (!K_PlayerCanPunt(t2->player))
{
return false;
}
if (t1->flags & MF_ELEMENTAL)
{
K_MakeObjectReappear(t1);
// copied from MT_ITEMCAPSULE
UINT8 i;
INT16 spacing = (t1->radius >> 1) / t1->scale;
// dust effects
for (i = 0; i < 10; i++)
{
mobj_t *puff = P_SpawnMobjFromMobj(
t1,
P_RandomRange(PR_ITEM_DEBRIS, -spacing, spacing) * FRACUNIT,
P_RandomRange(PR_ITEM_DEBRIS, -spacing, spacing) * FRACUNIT,
P_RandomRange(PR_ITEM_DEBRIS, 0, 4*spacing) * FRACUNIT,
MT_SPINDASHDUST
);
puff->momz = puff->scale * P_MobjFlip(puff);
P_Thrust(puff, R_PointToAngle2(t2->x, t2->y, puff->x, puff->y), 3*puff->scale);
puff->momx += t2->momx / 2;
puff->momy += t2->momy / 2;
puff->momz += t2->momz / 2;
}
}
else
{
K_PuntHazard(t1, t2);
}
return true;
}

View file

@ -33,6 +33,9 @@ boolean K_SMKIceBlockCollide(mobj_t *t1, mobj_t *t2);
boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2);
void K_PuntHazard(mobj_t *t1, mobj_t *t2);
boolean K_PuntCollide(mobj_t *t1, mobj_t *t2);
#ifdef __cplusplus
} // extern "C"
#endif

View file

@ -12636,4 +12636,34 @@ boolean K_IsPlayingDisplayPlayer(player_t *player)
return P_IsDisplayPlayer(player) && (!player->exiting);
}
boolean K_PlayerCanPunt(player_t *player)
{
if (player->invincibilitytimer > 0)
{
return true;
}
if (player->flamedash > 0 && player->itemtype == KITEM_FLAMESHIELD)
{
return true;
}
if (player->growshrinktimer > 0)
{
return true;
}
if (player->tripwirePass >= TRIPWIRE_BLASTER && player->speed >= 2 * K_GetKartSpeed(player, false, false))
{
return true;
}
return false;
}
void K_MakeObjectReappear(mobj_t *mo)
{
(!P_MobjWasRemoved(mo->punt_ref) ? mo->punt_ref : mo)->reappear = leveltime + (30*TICRATE);
}
//}

View file

@ -245,6 +245,9 @@ void K_SetTireGrease(player_t *player, tic_t tics);
boolean K_IsPlayingDisplayPlayer(player_t *player);
boolean K_PlayerCanPunt(player_t *player);
void K_MakeObjectReappear(mobj_t *mo);
#ifdef __cplusplus
} // extern "C"
#endif

View file

@ -106,7 +106,9 @@ enum mobj_e {
mobj_tid,
mobj_special,
mobj_args,
mobj_stringargs
mobj_stringargs,
mobj_reappear,
mobj_punt_ref,
};
static const char *const mobj_opt[] = {
@ -194,6 +196,8 @@ static const char *const mobj_opt[] = {
"special",
"args",
"stringargs",
"reappear",
"punt_ref",
NULL};
#define UNIMPLEMENTED luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " is not implemented for Lua and cannot be accessed.", mobj_opt[field])
@ -493,6 +497,17 @@ static int mobj_get(lua_State *L)
case mobj_stringargs:
LUA_PushUserdata(L, mo->thing_stringargs, META_THINGSTRINGARGS);
break;
case mobj_reappear:
lua_pushinteger(L, mo->reappear);
break;
case mobj_punt_ref:
if (mo->punt_ref && P_MobjWasRemoved(mo->punt_ref))
{ // don't put invalid mobj back into Lua.
P_SetTarget(&mo->punt_ref, NULL);
return 0;
}
LUA_PushUserdata(L, mo->punt_ref, META_MOBJ);
break;
default: // extra custom variables in Lua memory
lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS);
I_Assert(lua_istable(L, -1));
@ -883,6 +898,18 @@ static int mobj_set(lua_State *L)
return NOSET;
case mobj_stringargs:
return NOSET;
case mobj_reappear:
mo->reappear = luaL_checkinteger(L, 3);
break;
case mobj_punt_ref:
if (lua_isnil(L, 3))
P_SetTarget(&mo->punt_ref, NULL);
else
{
mobj_t *punt_ref = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
P_SetTarget(&mo->punt_ref, punt_ref);
}
break;
default:
lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS);
I_Assert(lua_istable(L, -1));

View file

@ -1017,7 +1017,6 @@ static mobj_t *SearchMarioNode(msecnode_t *node)
}
// Ignore popped monitors, too.
if (node->m_thing->health == 0 // this only really applies for monitors
|| (!(node->m_thing->flags & MF_MONITOR) && (mobjinfo[node->m_thing->type].flags & MF_MONITOR)) // gold monitor support
|| (node->m_thing->type == MT_RANDOMITEM))
continue;
// Okay, we found something valid.
@ -2344,7 +2343,6 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
fixed_t topheight = *rover->topheight;
mariothink_t *block;
mobj_t *thing;
fixed_t oldx = 0, oldy = 0, oldz = 0;
I_Assert(puncher != NULL);
I_Assert(puncher->player != NULL);
@ -2362,7 +2360,6 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
S_StartSound(puncher, sfx_mario1); // "Thunk!" sound - puncher is "close enough".
else // Found something!
{
const boolean itsamonitor = (thing->flags & MF_MONITOR) == MF_MONITOR;
// create and initialize new elevator thinker
block = Z_Calloc(sizeof (*block), PU_LEVSPEC, NULL);
@ -2383,13 +2380,6 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
R_CreateInterpolator_SectorPlane(&block->thinker, roversec, false);
R_CreateInterpolator_SectorPlane(&block->thinker, roversec, true);
if (itsamonitor)
{
oldx = thing->x;
oldy = thing->y;
oldz = thing->z;
}
P_UnsetThingPosition(thing);
thing->x = thing->old_x = sector->soundorg.x;
thing->y = thing->old_y = sector->soundorg.y;
@ -2410,16 +2400,5 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
// "Powerup rise" sound
S_StartSound(puncher, sfx_mario9); // Puncher is "close enough"
}
if (itsamonitor && thing)
{
P_UnsetThingPosition(thing);
thing->x = thing->old_x = oldx;
thing->y = thing->old_y = oldy;
thing->z = thing->old_z = oldz;
thing->momx = 1;
thing->momy = 1;
P_SetThingPosition(thing);
}
}
}

View file

@ -43,6 +43,7 @@
#include "k_hitlag.h"
#include "acs/interface.h"
#include "k_powerup.h"
#include "k_collide.h"
// CTF player names
#define CTFTEAMCODE(pl) pl->ctfteam ? (pl->ctfteam == 1 ? "\x85" : "\x84") : ""
@ -1537,7 +1538,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
target->momx = target->momy = target->momz = 0;
// SRB2kart
if (target->type != MT_PLAYER && !(target->flags & MF_MONITOR)
if (target->type != MT_PLAYER
&& !(target->type == MT_ORBINAUT || target->type == MT_ORBINAUT_SHIELD
|| target->type == MT_JAWZ || target->type == MT_JAWZ_SHIELD
|| target->type == MT_BANANA || target->type == MT_BANANA_SHIELD
@ -1630,7 +1631,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
// if killed by a player
if (source && source->player)
{
if (target->flags & MF_MONITOR || target->type == MT_RANDOMITEM)
if (target->type == MT_RANDOMITEM)
{
P_SetTarget(&target->target, source);
@ -2929,6 +2930,14 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
invincible = false;
}
// TODO: doing this from P_DamageMobj limits punting to objects that damage the player.
// And it may be kind of yucky.
// But this is easier than accounting for every condition in PIT_CheckThing!
if (inflictor && K_PuntCollide(inflictor, target))
{
return false;
}
if (invincible && type != DMG_STUMBLE && type != DMG_WHUMBLE)
{
const INT32 oldHitlag = target->hitlag;

View file

@ -595,6 +595,8 @@ mobj_t *P_FindMobjFromTID(mtag_t tid, mobj_t *i, mobj_t *activator);
void P_DeleteMobjStringArgs(mobj_t *mobj);
tic_t P_MobjIsReappearing(const mobj_t *mobj);
#ifdef __cplusplus
} // extern "C"
#endif

View file

@ -538,6 +538,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
{
fixed_t blockdist;
boolean damage = false;
if (tm.thing == NULL || P_MobjWasRemoved(tm.thing) == true)
return BMIT_STOP; // func just popped our tm.thing, cannot continue.
@ -562,6 +563,10 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
if ((thing->flags & MF_NOCLIPTHING) || !(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE|MF_SPRING)))
return BMIT_CONTINUE;
// Thing is respawning
if (P_MobjIsReappearing(thing))
return BMIT_CONTINUE;
blockdist = thing->radius + tm.thing->radius;
if (abs(thing->x - tm.x) >= blockdist || abs(thing->y - tm.y) >= blockdist)
@ -694,10 +699,12 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
if (P_DamageMobj(tm.thing, thing, thing, 1, damagetype) && (damagetype = (thing->info->mass>>8)))
S_StartSound(thing, damagetype);
}
if (P_MobjWasRemoved(tm.thing) || P_MobjWasRemoved(thing))
return BMIT_CONTINUE;
if (P_MobjWasRemoved(tm.thing) || P_MobjWasRemoved(thing))
return BMIT_CONTINUE;
damage = true;
}
}
else if (tm.thing->flags & MF_PAIN && thing->player)
{ // Painful thing splats player in the face
@ -712,10 +719,12 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
if (P_DamageMobj(thing, tm.thing, tm.thing, 1, damagetype) && (damagetype = (tm.thing->info->mass>>8)))
S_StartSound(tm.thing, damagetype);
}
if (P_MobjWasRemoved(tm.thing) || P_MobjWasRemoved(thing))
return BMIT_CONTINUE;
if (P_MobjWasRemoved(tm.thing) || P_MobjWasRemoved(thing))
return BMIT_CONTINUE;
damage = true;
}
}
// check for skulls slamming into things
@ -1216,7 +1225,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
}
// missiles can hit other things
if (tm.thing->flags & MF_MISSILE)
if ((tm.thing->flags & MF_MISSILE) && !damage) // if something was already damaged, don't run this
{
UINT8 damagetype = (tm.thing->info->mass ^ DMG_WOMBO);
@ -1626,7 +1635,10 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
if (tm.thing->z + tm.thing->height < thing->z)
return BMIT_CONTINUE; // underneath
K_KartSolidBounce(tm.thing, thing);
if (!K_PuntCollide(thing, tm.thing))
{
K_KartSolidBounce(tm.thing, thing);
}
return BMIT_CONTINUE;
}
}
@ -2341,7 +2353,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y, TryMoveResult_t *re
// Check things first, possibly picking things up.
// MF_NOCLIPTHING: used by camera to not be blocked by things
if (!(thing->flags & MF_NOCLIPTHING))
// Respawning things should also be intangible to other things
if (!(thing->flags & MF_NOCLIPTHING) && !P_MobjIsReappearing(thing))
{
for (bx = xl; bx <= xh; bx++)
{
@ -4220,7 +4233,7 @@ static BlockItReturn_t PIT_RadiusAttack(mobj_t *thing)
if ((bombdamagetype & DMG_CANTHURTSELF) && bombsource && thing->type == bombsource->type) // ignore the type of guys who dropped the bomb (Jetty-Syn Bomber or Skim can bomb eachother, but not themselves.)
return BMIT_CONTINUE;
if ((thing->flags & (MF_MONITOR|MF_SHOOTABLE)) != MF_SHOOTABLE)
if ((thing->flags & MF_SHOOTABLE) != MF_SHOOTABLE)
return BMIT_CONTINUE;
dx = abs(thing->x - bombspot->x);

View file

@ -1725,25 +1725,6 @@ void P_XYMovement(mobj_t *mo)
P_ExplodeMissile(mo);
return;
}
else if (mo->flags & MF_STICKY)
{
S_StartSound(mo, mo->info->activesound);
mo->momx = mo->momy = mo->momz = 0; //Full stop!
mo->flags |= MF_NOGRAVITY; //Stay there!
mo->flags &= ~MF_STICKY; //Don't check again!
// Check for hit against sky here
if (P_CheckSkyHit(mo))
{
// Hack to prevent missiles exploding
// against the sky.
// Does not handle sky floors.
// Check frontsector as well.
P_RemoveMobj(mo);
return;
}
}
else
{
boolean walltransferred = false;
@ -5698,12 +5679,12 @@ static void P_FlameJetSceneryThink(mobj_t *mobj)
flame->angle = mobj->angle;
if (mobj->flags2 & MF2_AMBUSH) // Wave up and down instead of side-to-side
flame->momz = mobj->fuse << (FRACBITS - 2);
flame->momz = (mobj->fuse * mapobjectscale) / 4;
else
flame->angle += FixedAngle(mobj->fuse<<FRACBITS);
strength = 20*FRACUNIT;
strength -= ((20*FRACUNIT)/16)*mobj->movedir;
strength = 20*mapobjectscale;
strength -= ((20*mapobjectscale)/16)*mobj->movedir;
P_InstaThrust(flame, flame->angle, strength);
S_StartSound(flame, sfx_fire);
@ -5733,8 +5714,8 @@ static void P_VerticalFlameJetSceneryThink(mobj_t *mobj)
flame = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_FLAMEJETFLAME);
strength = 20*FRACUNIT;
strength -= ((20*FRACUNIT)/16)*mobj->movedir;
strength = 20*mapobjectscale;
strength -= ((20*mapobjectscale)/16)*mobj->movedir;
// If deaf'd, the object spawns on the ceiling.
if (mobj->flags2 & MF2_AMBUSH)
@ -5748,7 +5729,7 @@ static void P_VerticalFlameJetSceneryThink(mobj_t *mobj)
P_SetMobjState(flame, S_FLAMEJETFLAME7);
}
P_InstaThrust(flame, mobj->angle, FixedDiv(mobj->fuse*FRACUNIT, 3*FRACUNIT));
P_InstaThrust(flame, mobj->angle, (mobj->fuse * mapobjectscale) / 3);
S_StartSound(flame, sfx_fire);
}
@ -10077,48 +10058,6 @@ static void K_MineExplodeThink(mobj_t *mobj)
}
}
static void P_MonitorFuseThink(mobj_t *mobj)
{
mobj_t *newmobj;
// Special case for ALL monitors.
// If a box's speed is nonzero, it's allowed to respawn as a WRM/SRM.
if (mobj->info->speed != 0 && (mobj->flags2 & (MF2_AMBUSH|MF2_STRONGBOX)))
{
mobjtype_t spawnchance[64];
INT32 numchoices = 0, i = 0;
// This define should make it a lot easier to organize and change monitor weights
#define SETMONITORCHANCES(type, strongboxamt, weakboxamt) \
for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) spawnchance[numchoices++] = type
// Type SRM WRM
SETMONITORCHANCES(MT_SNEAKERS_BOX, 0, 10); // Super Sneakers
SETMONITORCHANCES(MT_INVULN_BOX, 2, 0); // Invincibility
SETMONITORCHANCES(MT_WHIRLWIND_BOX, 3, 8); // Whirlwind Shield
SETMONITORCHANCES(MT_ELEMENTAL_BOX, 3, 8); // Elemental Shield
SETMONITORCHANCES(MT_ATTRACT_BOX, 2, 0); // Attraction Shield
SETMONITORCHANCES(MT_FORCE_BOX, 3, 3); // Force Shield
SETMONITORCHANCES(MT_ARMAGEDDON_BOX, 2, 0); // Armageddon Shield
SETMONITORCHANCES(MT_MIXUP_BOX, 0, 1); // Teleporters
SETMONITORCHANCES(MT_RECYCLER_BOX, 0, 1); // Recycler
SETMONITORCHANCES(MT_1UP_BOX, 1, 1); // 1-Up
// =======================================
// Total 16 32
#undef SETMONITORCHANCES
i = P_RandomKey(PR_UNDEFINED, numchoices); // Gotta love those random numbers!
newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, spawnchance[i]);
}
else
newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type);
// Transfer flags2 (ambush, strongbox, objectflip)
newmobj->flags2 = mobj->flags2;
P_RemoveMobj(mobj); // make sure they disappear
}
static boolean P_CanFlickerFuse(mobj_t *mobj)
{
switch (mobj->type)
@ -10167,11 +10106,6 @@ static boolean P_FuseThink(mobj_t *mobj)
if (LUA_HookMobj(mobj, MOBJ_HOOK(MobjFuse)) || P_MobjWasRemoved(mobj))
;
else if (mobj->info->flags & MF_MONITOR)
{
P_MonitorFuseThink(mobj);
return false;
}
else switch (mobj->type)
{
// gargoyle and snowman handled in P_PushableThinker, not here
@ -10316,6 +10250,8 @@ void P_MobjThinker(mobj_t *mobj)
P_SetTarget(&mobj->hprev, NULL);
if (mobj->itnext && P_MobjWasRemoved(mobj->itnext))
P_SetTarget(&mobj->itnext, NULL);
if (mobj->punt_ref && P_MobjWasRemoved(mobj->punt_ref))
P_SetTarget(&mobj->punt_ref, NULL);
if (mobj->flags & MF_NOTHINK)
return;
@ -10826,6 +10762,10 @@ fixed_t P_GetMobjDefaultScale(mobj_t *mobj)
{
switch(mobj->type)
{
case MT_FLAMEJETFLAME:
return 3*FRACUNIT;
case MT_ITEMCLASH:
return 2*FRACUNIT;
case MT_SPECIALSTAGEARCH:
return 5*FRACUNIT;
case MT_SPECIALSTAGEBOMB:
@ -11381,6 +11321,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
mobj->y + FINESINE((ang>>ANGLETOFINESHIFT) & FINEMASK), mobj->z, MT_DAYTONAPINETREE_SIDE);
side->angle = ang;
P_SetTarget(&side->target, mobj);
P_SetTarget(&side->punt_ref, mobj);
side->threshold = i;
}
break;
@ -11865,6 +11806,7 @@ void P_RemoveMobj(mobj_t *mobj)
}
P_SetTarget(&mobj->itnext, NULL);
P_SetTarget(&mobj->punt_ref, NULL);
P_RemoveThingTID(mobj);
P_DeleteMobjStringArgs(mobj);
@ -15440,3 +15382,9 @@ void P_DeleteMobjStringArgs(mobj_t *mobj)
mobj->script_stringargs[i] = NULL;
}
}
tic_t P_MobjIsReappearing(const mobj_t *mobj)
{
tic_t t = (!P_MobjWasRemoved(mobj->punt_ref) ? mobj->punt_ref : mobj)->reappear;
return t - min(leveltime, t);
}

View file

@ -137,8 +137,8 @@ typedef enum
MF_MISSILE = 1<<15,
// Item is a spring.
MF_SPRING = 1<<16,
// Item box
MF_MONITOR = 1<<17,
// Object is elemental. If it is punted, it will evaporate.
MF_ELEMENTAL = 1<<17,
// Don't run the thinker for this object.
MF_NOTHINK = 1<<18,
// Don't adjust z if below or above floorz/ceilingz
@ -149,8 +149,8 @@ typedef enum
MF_SCENERY = 1<<21,
// Painful (shit hurts).
MF_PAIN = 1<<22,
// This mobj will stick to any surface or solid object it touches.
MF_STICKY = 1<<23,
// Object cannot be punted by invincible players. (Default CAN be punted, if it deals damage or is solid.)
MF_DONTPUNT = 1<<23,
// Object uses terrain effects. (Overlays, footsteps, etc)
MF_APPLYTERRAIN = 1<<24,
// for chase camera, don't be blocked by things (partial clipping)
@ -437,6 +437,14 @@ struct mobj_t
boolean frozen;
// Object was punted and is temporarily invisible and
// intangible. This is the leveltime that it will
// reappear.
tic_t reappear;
// If punt_ref, set punt_ref->reappear, treat as if this->reappear
mobj_t *punt_ref;
// WARNING: New fields must be added separately to savegame and Lua.
};

View file

@ -2668,9 +2668,16 @@ typedef enum
MD2_FROZEN = 1<<28,
MD2_TERRAIN = 1<<29,
MD2_WATERSKIP = 1<<30,
MD2_LIGHTLEVEL = (INT32)(1U<<31),
MD2_MORE = (INT32)(1U<<31),
} mobj_diff2_t;
typedef enum
{
MD3_LIGHTLEVEL = 1,
MD3_REAPPEAR = 1<<1,
MD3_PUNT_REF = 1<<2,
} mobj_diff3_t;
typedef enum
{
tc_mobj,
@ -2781,12 +2788,14 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
const mobj_t *mobj = (const mobj_t *)th;
UINT32 diff;
UINT32 diff2;
UINT32 diff3;
size_t j;
if (TypeIsNetSynced(mobj->type) == false)
return;
diff2 = 0;
diff3 = 0;
if (mobj->spawnpoint)
{
@ -2968,8 +2977,6 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
|| (slope->normal.z != FRACUNIT))
diff2 |= MD2_FLOORSPRITESLOPE;
}
if (mobj->lightlevel)
diff2 |= MD2_LIGHTLEVEL;
if (mobj->hitlag)
diff2 |= MD2_HITLAG;
if (mobj->waterskip)
@ -2987,6 +2994,16 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
if (mobj->terrain != NULL || mobj->terrainOverlay != NULL)
diff2 |= MD2_TERRAIN;
if (mobj->lightlevel)
diff3 |= MD3_LIGHTLEVEL;
if (mobj->reappear)
diff3 |= MD3_REAPPEAR;
if (mobj->punt_ref)
diff3 |= MD3_PUNT_REF;
if (diff3 != 0)
diff2 |= MD2_MORE;
if (diff2 != 0)
diff |= MD_MORE;
@ -2998,6 +3015,8 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
WRITEUINT32(save->p, diff);
if (diff & MD_MORE)
WRITEUINT32(save->p, diff2);
if (diff2 & MD2_MORE)
WRITEUINT32(save->p, diff3);
WRITEFIXED(save->p, mobj->z); // Force this so 3dfloor problems don't arise.
WRITEFIXED(save->p, mobj->floorz);
@ -3235,10 +3254,6 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
WRITEFIXED(save->p, slope->normal.y);
WRITEFIXED(save->p, slope->normal.z);
}
if (diff2 & MD2_LIGHTLEVEL)
{
WRITEINT16(save->p, mobj->lightlevel);
}
if (diff2 & MD2_HITLAG)
{
WRITEINT32(save->p, mobj->hitlag);
@ -3261,6 +3276,19 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
WRITEUINT32(save->p, SaveMobjnum(mobj->terrainOverlay));
}
if (diff3 & MD3_LIGHTLEVEL)
{
WRITEINT16(save->p, mobj->lightlevel);
}
if (diff3 & MD3_REAPPEAR)
{
WRITEUINT32(save->p, mobj->reappear);
}
if (diff3 & MD3_PUNT_REF)
{
WRITEUINT32(save->p, mobj->punt_ref->mobjnum);
}
WRITEUINT32(save->p, mobj->mobjnum);
}
@ -4134,6 +4162,7 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
mobj_t *mobj;
UINT32 diff;
UINT32 diff2;
UINT32 diff3;
INT32 i;
fixed_t z, floorz, ceilingz;
ffloor_t *floorrover = NULL, *ceilingrover = NULL;
@ -4145,6 +4174,11 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
else
diff2 = 0;
if (diff2 & MD2_MORE)
diff3 = READUINT32(save->p);
else
diff3 = 0;
z = READFIXED(save->p); // Force this so 3dfloor problems don't arise.
floorz = READFIXED(save->p);
ceilingz = READFIXED(save->p);
@ -4470,10 +4504,6 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
P_UpdateSlopeLightOffset(slope);
}
if (diff2 & MD2_LIGHTLEVEL)
{
mobj->lightlevel = READINT16(save->p);
}
if (diff2 & MD2_HITLAG)
{
mobj->hitlag = READINT32(save->p);
@ -4500,6 +4530,19 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
mobj->terrain = NULL;
}
if (diff3 & MD3_LIGHTLEVEL)
{
mobj->lightlevel = READINT16(save->p);
}
if (diff3 & MD3_REAPPEAR)
{
mobj->reappear = READUINT32(save->p);
}
if (diff3 & MD3_PUNT_REF)
{
mobj->punt_ref = (mobj_t *)(size_t)READUINT32(save->p);
}
// set sprev, snext, bprev, bnext, subsector
P_SetThingPosition(mobj);
@ -5539,6 +5582,13 @@ static void P_RelinkPointers(void)
if (!P_SetTarget(&mobj->terrainOverlay, P_FindNewPosition(temp)))
CONS_Debug(DBG_GAMELOGIC, "terrainOverlay not found on %d\n", mobj->type);
}
if (mobj->punt_ref)
{
temp = (UINT32)(size_t)mobj->punt_ref;
mobj->punt_ref = NULL;
if (!P_SetTarget(&mobj->punt_ref, P_FindNewPosition(temp)))
CONS_Debug(DBG_GAMELOGIC, "punt_ref not found on %d\n", mobj->type);
}
}
for (i = 0; i < MAXPLAYERS; i++)

View file

@ -1166,6 +1166,9 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
K_ReduceVFX(ghost, mobj->player);
ghost->reappear = mobj->reappear;
P_SetTarget(&ghost->punt_ref, mobj->punt_ref);
return ghost;
}
@ -2709,9 +2712,6 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius)
if (!(mo->flags & MF_SHOOTABLE) && (mo->type != MT_SPB)) // Don't want to give SPB MF_SHOOTABLE, to ensure it's undamagable through other means
continue;
if (mo->flags & MF_MONITOR)
continue; // Monitors cannot be 'nuked'.
if (abs(inflictor->x - mo->x) > radius || abs(inflictor->y - mo->y) > radius || abs(inflictor->z - mo->z) > radius)
continue; // Workaround for possible integer overflow in the below -Red

View file

@ -240,7 +240,7 @@ static boolean is_tangible (mobj_t *thing)
// These objects probably do nothing! :D
if ((thing->flags & (MF_SPECIAL|MF_SOLID|MF_SHOOTABLE
|MF_PUSHABLE|MF_BOSS|MF_MISSILE|MF_SPRING
|MF_MONITOR|MF_ENEMY|MF_PAIN|MF_STICKY
|MF_ELEMENTAL|MF_ENEMY|MF_PAIN|MF_DONTPUNT
|MF_PICKUPFROMBELOW)) == 0U)
{
return false;

View file

@ -3746,6 +3746,12 @@ boolean R_ThingVisible (mobj_t *thing)
if (r_viewmobj && (thing == r_viewmobj || (r_viewmobj->player && r_viewmobj->player->followmobj == thing)))
return false;
if (tic_t t = P_MobjIsReappearing(thing))
{
// Flicker back in
return t <= 2*TICRATE && (leveltime & 1);
}
if ((viewssnum == 0 && (thing->renderflags & RF_DONTDRAWP1))
|| (viewssnum == 1 && (thing->renderflags & RF_DONTDRAWP2))
|| (viewssnum == 2 && (thing->renderflags & RF_DONTDRAWP3))

View file

@ -948,6 +948,9 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
if (!listener)
return false;
if (source->thinker.function.acp1 == (actionf_p1)P_MobjThinker && P_MobjIsReappearing(source))
return false;
// Init listensource with default listener
listensource.x = listener->x;
listensource.y = listener->y;