mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-17 02:01:15 +00:00
Some explosion stuff
Sphere spawns at centre and quickly grows before stopping While sphere grows players get flung up Fix some issues with battle mode stuff stopping bobombs from working
This commit is contained in:
parent
68338f560b
commit
d41d5800eb
6 changed files with 27 additions and 17 deletions
|
@ -6360,6 +6360,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_BOMBITEM",
|
"S_BOMBITEM",
|
||||||
"S_BOMBAIR",
|
"S_BOMBAIR",
|
||||||
"S_BOMBEXPLODE",
|
"S_BOMBEXPLODE",
|
||||||
|
"S_BOMBEXPLOSION1",
|
||||||
|
"S_BOMBEXPLOSION2",
|
||||||
|
|
||||||
// Blue Shell - Blue Lightning for now...
|
// Blue Shell - Blue Lightning for now...
|
||||||
"S_BLUELIGHTNING1",
|
"S_BLUELIGHTNING1",
|
||||||
|
|
|
@ -2687,6 +2687,8 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_BOMB, 0, 1, {A_GrenadeRing}, 0, 0, S_BOMBITEM}, // S_BOMBITEM
|
{SPR_BOMB, 0, 1, {A_GrenadeRing}, 0, 0, S_BOMBITEM}, // S_BOMBITEM
|
||||||
{SPR_BOMB, 0, 1, {NULL}, 0, 0, S_BOMBAIR}, // S_BOMBAIR
|
{SPR_BOMB, 0, 1, {NULL}, 0, 0, S_BOMBAIR}, // S_BOMBAIR
|
||||||
{SPR_BOMB, 0, 1, {A_BobombExplode}, MT_BOMBEXPLOSION, 0, S_NULL}, // S_BOMBEXPLODE
|
{SPR_BOMB, 0, 1, {A_BobombExplode}, MT_BOMBEXPLOSION, 0, S_NULL}, // S_BOMBEXPLODE
|
||||||
|
{SPR_BOM2, FF_FULLBRIGHT, 6, {NULL}, 0, 0, S_BOMBEXPLOSION2}, // S_BOMBEXPLOSION1
|
||||||
|
{SPR_BOM2, FF_FULLBRIGHT|1, 22, {A_ForceStop}, 0, 0, S_NULL}, // S_BOMBEXPLOSION2
|
||||||
|
|
||||||
{SPR_BLIG, 0, 2, {NULL}, 0, 0, S_BLUELIGHTNING2}, // S_BLUELIGHTNING1
|
{SPR_BLIG, 0, 2, {NULL}, 0, 0, S_BLUELIGHTNING2}, // S_BLUELIGHTNING1
|
||||||
{SPR_BLIG, 1, 2, {NULL}, 0, 0, S_BLUELIGHTNING3}, // S_BLUELIGHTNING2
|
{SPR_BLIG, 1, 2, {NULL}, 0, 0, S_BLUELIGHTNING3}, // S_BLUELIGHTNING2
|
||||||
|
@ -14932,7 +14934,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
8, // reactiontime
|
8, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_NULL, // painstate
|
||||||
256*FRACUNIT, // painchance
|
288*FRACUNIT, // painchance
|
||||||
sfx_None, // painsound
|
sfx_None, // painsound
|
||||||
S_NULL, // meleestate
|
S_NULL, // meleestate
|
||||||
S_NULL, // missilestate
|
S_NULL, // missilestate
|
||||||
|
@ -14946,13 +14948,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
100, // mass
|
100, // mass
|
||||||
1, // damage
|
1, // damage
|
||||||
sfx_bomb, // activesound
|
sfx_bomb, // activesound
|
||||||
MF_BOUNCE|MF_FLOAT|MF_NOCLIPTHING|MF_MISSILE|MF_SHOOTABLE, // flags
|
MF_BOUNCE|MF_NOCLIPTHING|MF_MISSILE|MF_SHOOTABLE, // flags
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_BOMBEXPLOSION
|
{ // MT_BOMBEXPLOSION
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_BPLD1, // spawnstate
|
S_BOMBEXPLOSION1, // spawnstate
|
||||||
1000, // spawnhealth
|
1000, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_None, // seesound
|
sfx_None, // seesound
|
||||||
|
|
|
@ -3197,6 +3197,8 @@ typedef enum state
|
||||||
S_BOMBITEM,
|
S_BOMBITEM,
|
||||||
S_BOMBAIR,
|
S_BOMBAIR,
|
||||||
S_BOMBEXPLODE,
|
S_BOMBEXPLODE,
|
||||||
|
S_BOMBEXPLOSION1,
|
||||||
|
S_BOMBEXPLOSION2,
|
||||||
|
|
||||||
// Blue Shell - Blue Lightning for now...
|
// Blue Shell - Blue Lightning for now...
|
||||||
S_BLUELIGHTNING1,
|
S_BLUELIGHTNING1,
|
||||||
|
|
10
src/k_kart.c
10
src/k_kart.c
|
@ -2107,8 +2107,6 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
|
||||||
|
|
||||||
degrees = FINEANGLES/number;
|
degrees = FINEANGLES/number;
|
||||||
|
|
||||||
radius = FixedDiv(radius,5*(FRACUNIT/4));
|
|
||||||
|
|
||||||
closestangle = 0;
|
closestangle = 0;
|
||||||
|
|
||||||
// Create the hoop!
|
// Create the hoop!
|
||||||
|
@ -2153,10 +2151,6 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
|
||||||
mobj = ghost;
|
mobj = ghost;
|
||||||
}
|
}
|
||||||
|
|
||||||
mobj->momx = FixedMul(FixedDiv(mobjx - x, dist), 2*FRACUNIT);
|
|
||||||
mobj->momy = FixedMul(FixedDiv(mobjy - y, dist), 2*FRACUNIT);
|
|
||||||
mobj->momz = FixedMul(FixedDiv(mobjz - z, dist), 2*FRACUNIT);
|
|
||||||
|
|
||||||
if (spawncenter)
|
if (spawncenter)
|
||||||
{
|
{
|
||||||
mobj->x = x;
|
mobj->x = x;
|
||||||
|
@ -2164,6 +2158,10 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
|
||||||
mobj->z = z;
|
mobj->z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mobj->momx = FixedMul(FixedDiv(mobjx - x, dist), FixedDiv(dist, 6*FRACUNIT));
|
||||||
|
mobj->momy = FixedMul(FixedDiv(mobjy - y, dist), FixedDiv(dist, 6*FRACUNIT));
|
||||||
|
mobj->momz = FixedMul(FixedDiv(mobjz - z, dist), FixedDiv(dist, 6*FRACUNIT));
|
||||||
|
|
||||||
mobj->flags |= MF_NOCLIPTHING;
|
mobj->flags |= MF_NOCLIPTHING;
|
||||||
mobj->flags &= ~MF_SPECIAL;
|
mobj->flags &= ~MF_SPECIAL;
|
||||||
|
|
||||||
|
|
|
@ -3922,11 +3922,11 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing)
|
||||||
if (thing->type != MT_PLAYER) // Don't explode for anything but an actual player.
|
if (thing->type != MT_PLAYER) // Don't explode for anything but an actual player.
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (thing == grenade->target && !(grenade->threshold == 0)) // Don't blow up at your owner.
|
if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner.
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (thing->player && (thing->player->kartstuff[k_bootimer]
|
if (thing->player && (thing->player->kartstuff[k_bootimer]
|
||||||
|| (thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebacktimer])))
|
|| (gametype == GT_MATCH && thing->player && thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebacktimer])))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if ((gametype == GT_CTF || gametype == GT_TEAMMATCH)
|
if ((gametype == GT_CTF || gametype == GT_TEAMMATCH)
|
||||||
|
@ -8268,7 +8268,7 @@ void A_BobombExplode(mobj_t *actor)
|
||||||
type = (mobjtype_t)locvar1;
|
type = (mobjtype_t)locvar1;
|
||||||
|
|
||||||
for (d = 0; d < 16; d++)
|
for (d = 0; d < 16; d++)
|
||||||
K_SpawnKartExplosion(actor->x, actor->y, actor->z, actor->info->painchance + 32*FRACUNIT, 32, type, d*(ANGLE_45/4), false, false, actor->target); // 32 <-> 64
|
K_SpawnKartExplosion(actor->x, actor->y, actor->z, actor->info->painchance + 32*FRACUNIT, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64
|
||||||
|
|
||||||
P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOMBEXPLOSIONSOUND);
|
P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOMBEXPLOSIONSOUND);
|
||||||
|
|
||||||
|
@ -8284,7 +8284,7 @@ void A_BobombExplode(mobj_t *actor)
|
||||||
if (mo2 == actor || mo2->type == MT_BOMBEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
|
if (mo2 == actor || mo2->type == MT_BOMBEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (actor->target && actor->target->player && actor->target->player->kartstuff[k_balloon] <= 0 && mo2 == actor->target)
|
if (gametype == GT_MATCH && actor->target && actor->target->player && actor->target->player->kartstuff[k_balloon] <= 0 && mo2 == actor->target)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance)
|
if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance)
|
||||||
|
|
14
src/p_map.c
14
src/p_map.c
|
@ -848,9 +848,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
if (thing->player && thing->player->powers[pw_flashing])
|
if (thing->player && thing->player->powers[pw_flashing])
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (thing->type == MT_PLAYER)
|
if (thing->type == MT_PLAYER && thing->player)
|
||||||
{
|
{
|
||||||
K_SpinPlayer(thing->player, tmthing->target);
|
if (tmthing->state == &states[S_BOMBEXPLOSION1])
|
||||||
|
K_ExplodePlayer(thing->player, tmthing->target);
|
||||||
|
else
|
||||||
|
K_SpinPlayer(thing->player, tmthing->target);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true; // This doesn't collide with anything, but we want it to effect the player anyway.
|
return true; // This doesn't collide with anything, but we want it to effect the player anyway.
|
||||||
|
@ -1180,10 +1183,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
|
|
||||||
P_KillMobj(thing, tmthing, tmthing);
|
P_KillMobj(thing, tmthing, tmthing);
|
||||||
}
|
}
|
||||||
else if (thing->type == MT_BOMBEXPLOSION)
|
else if (thing->type == MT_BOMBEXPLOSION && tmthing->player)
|
||||||
{
|
{
|
||||||
// Player Damage
|
// Player Damage
|
||||||
K_SpinPlayer(tmthing->player, thing->target);
|
if (thing->state == &states[S_BOMBEXPLOSION1])
|
||||||
|
K_ExplodePlayer(tmthing->player, thing->target);
|
||||||
|
else
|
||||||
|
K_SpinPlayer(tmthing->player, thing->target);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue