diff --git a/src/deh_tables.c b/src/deh_tables.c index 5f026fe39..9abc8f3f2 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5627,6 +5627,8 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_PAPERITEMSPOT", "MT_BEAMPOINT", + + "MT_BROLY", }; const char *const MOBJFLAG_LIST[] = { diff --git a/src/info.c b/src/info.c index 5a1cefa1f..17d930a90 100644 --- a/src/info.c +++ b/src/info.c @@ -29030,6 +29030,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOCLIPTHING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, + + { // MT_BROLY + -1, // doomednum + S_BROLY1, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // 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 + 0, // radius + 0, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPTHING|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, }; skincolor_t skincolors[MAXSKINCOLORS] = { diff --git a/src/info.h b/src/info.h index e4c96915c..bc074a0b5 100644 --- a/src/info.h +++ b/src/info.h @@ -6682,6 +6682,8 @@ typedef enum mobj_type MT_BEAMPOINT, + MT_BROLY, + MT_FIRSTFREESLOT, MT_LASTFREESLOT = MT_FIRSTFREESLOT + NUMMOBJFREESLOTS - 1, NUMMOBJTYPES diff --git a/src/k_collide.c b/src/k_collide.c index 64f460a61..11ac0b745 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -319,7 +319,7 @@ tic_t K_MineExplodeAttack(mobj_t *actor, fixed_t size, boolean spin) if (!spin) { - K_SpawnBrolyKi(actor, minehitlag); + Obj_SpawnBrolyKi(actor, minehitlag); return minehitlag; } diff --git a/src/k_kart.c b/src/k_kart.c index 1c8213998..12598f831 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5210,39 +5210,6 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color, tic_t delay) } } -void K_SpawnBrolyKi(mobj_t *source, tic_t duration) -{ - mobj_t *x; - - if (duration == 0) - { - return; - } - - x = P_SpawnMobjFromMobj(source, 0, 0, 0, MT_THOK); - - // Shrink into center of source object. - x->z = (source->z + source->height / 2); - x->height = 0; - - P_SetMobjState(x, S_BROLY1); - x->colorized = true; - x->color = source->color; - x->hitlag = 0; // do not copy source hitlag - - P_SetScale(x, 64 * mapobjectscale); - x->scalespeed = x->scale / duration; - - // The last tic doesn't actually get rendered so in order - // to show scale = destscale, add one buffer tic. - x->tics = (duration + 1); - x->destscale = 1; // 0 also doesn't work - - K_ReduceVFX(x, NULL); - - S_StartSound(x, sfx_cdfm74); -} - #undef MINEQUAKEDIST fixed_t K_ItemScaleForPlayer(player_t *player) diff --git a/src/k_kart.h b/src/k_kart.h index 87f3e1998..6827c77bc 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -107,7 +107,6 @@ void K_DestroyBumpers(player_t *player, UINT8 amount); void K_TakeBumpersFromPlayer(player_t *player, player_t *victim, UINT8 amount); void K_MineFlashScreen(mobj_t *source); void K_SpawnMineExplosion(mobj_t *source, UINT8 color, tic_t delay); -void K_SpawnBrolyKi(mobj_t *source, tic_t duration); void K_RunFinishLineBeam(void); UINT16 K_DriftSparkColor(player_t *player, INT32 charge); void K_SpawnBoostTrail(player_t *player); diff --git a/src/k_objects.h b/src/k_objects.h index 96e0fa2b5..fc15a2153 100644 --- a/src/k_objects.h +++ b/src/k_objects.h @@ -54,4 +54,7 @@ void Obj_DuelBombReverse(mobj_t *bomb); void Obj_DuelBombTouch(mobj_t *bomb, mobj_t *toucher); void Obj_DuelBombInit(mobj_t *bomb); +/* Broly Ki */ +mobj_t *Obj_SpawnBrolyKi(mobj_t *source, tic_t duration); + #endif/*k_objects_H*/ diff --git a/src/objects/Sourcefile b/src/objects/Sourcefile index b8cb63b1f..099f0d203 100644 --- a/src/objects/Sourcefile +++ b/src/objects/Sourcefile @@ -7,3 +7,4 @@ manta-ring.c orbinaut.c jawz.c duel-bomb.c +broly.c diff --git a/src/objects/broly.c b/src/objects/broly.c new file mode 100644 index 000000000..8c743a64a --- /dev/null +++ b/src/objects/broly.c @@ -0,0 +1,41 @@ +#include "../doomdef.h" +#include "../info.h" +#include "../k_kart.h" +#include "../k_objects.h" +#include "../p_local.h" +#include "../s_sound.h" + +mobj_t * +Obj_SpawnBrolyKi +( mobj_t * source, + tic_t duration) +{ + mobj_t *x = P_SpawnMobjFromMobj( + source, 0, 0, 0, MT_BROLY); + + if (duration == 0) + { + return x; + } + + // Shrink into center of source object. + x->z = (source->z + source->height / 2); + + x->colorized = true; + x->color = source->color; + x->hitlag = 0; // do not copy source hitlag + + P_SetScale(x, 64 * mapobjectscale); + x->scalespeed = x->scale / duration; + + // The last tic doesn't actually get rendered so in order + // to show scale = destscale, add one buffer tic. + x->tics = (duration + 1); + x->destscale = 1; // 0 also doesn't work + + K_ReduceVFX(x, NULL); + + S_StartSound(x, sfx_cdfm74); + + return x; +} diff --git a/src/p_enemy.c b/src/p_enemy.c index afe17b5bc..61762cce8 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -13186,7 +13186,7 @@ void A_LandMineExplode(mobj_t *actor) expl->momz = ((i+1)*actor->scale*5/2)*P_MobjFlip(expl); } - K_SpawnBrolyKi(actor, delay); + Obj_SpawnBrolyKi(actor, delay); } void A_BallhogExplode(mobj_t *actor)