Merge branch 'jester-fireball' into 'master'

Mario fireball by Jester (resolves #296)

Closes #296

See merge request STJr/SRB2Internal!487
This commit is contained in:
MascaraSnake 2019-11-18 15:56:33 -05:00
commit 1365ef49b3
6 changed files with 61 additions and 31 deletions

View file

@ -7325,13 +7325,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_FIREFLOWER2",
"S_FIREFLOWER3",
"S_FIREFLOWER4",
"S_FIREBALL1",
"S_FIREBALL2",
"S_FIREBALL3",
"S_FIREBALL4",
"S_FIREBALLEXP1",
"S_FIREBALLEXP2",
"S_FIREBALLEXP3",
"S_FIREBALL",
"S_FIREBALLTRAIL1",
"S_FIREBALLTRAIL2",
"S_SHELL",
"S_PUMA_START1",
"S_PUMA_START2",
@ -8323,6 +8319,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_BLUEGOOMBA",
"MT_FIREFLOWER",
"MT_FIREBALL",
"MT_FIREBALLTRAIL",
"MT_SHELL",
"MT_PUMA",
"MT_PUMATRAIL",

View file

@ -3528,13 +3528,9 @@ state_t states[NUMSTATES] =
{SPR_FFWR, 3, 3, {NULL}, 0, 0, S_FIREFLOWER1}, // S_FIREFLOWER4
// Thrown Mario Fireball
{SPR_FBLL, FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FIREBALL2}, // S_FIREBALL1
{SPR_FBLL, FF_FULLBRIGHT|1, 3, {NULL}, 0, 0, S_FIREBALL3}, // S_FIREBALL2
{SPR_FBLL, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_FIREBALL4}, // S_FIREBALL3
{SPR_FBLL, FF_FULLBRIGHT|3, 3, {NULL}, 0, 0, S_FIREBALL1}, // S_FIREBALL4
{SPR_FBLL, FF_FULLBRIGHT|4, 3, {NULL}, 0, 0, S_FIREBALLEXP2}, // S_FIREBALLEXP1
{SPR_FBLL, FF_FULLBRIGHT|5, 3, {NULL}, 0, 0, S_FIREBALLEXP3}, // S_FIREBALLEXP2
{SPR_FBLL, FF_FULLBRIGHT|6, 3, {NULL}, 0, 0, S_NULL}, // S_FIREBALLEXP3
{SPR_FBLL, FF_FULLBRIGHT, 1, {A_SpawnObjectRelative}, 0, MT_FIREBALLTRAIL, S_FIREBALL}, // S_FIREBALL
{SPR_FBLL, 1|FF_FULLBRIGHT|FF_TRANS50, 1, {A_SetScale}, FRACUNIT*3/4, 0, S_FIREBALLTRAIL2}, // S_FIREBALLTRAIL1
{SPR_FBLL, 1|FF_FULLBRIGHT|FF_TRANS50, 8, {A_SetScale}, FRACUNIT/6, 1, S_NULL}, // S_FIREBALLTRAIL2
// Turtle Shell
{SPR_SHLL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SHELL
@ -18914,31 +18910,58 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
{ // MT_FIREBALL
-1, // doomednum
S_FIREBALL1, // spawnstate
S_FIREBALL, // spawnstate
1000, // spawnhealth
S_FIREBALLEXP1, // seestate
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_FIREBALLEXP1, // meleestate
S_FIREBALLEXP1, // missilestate
S_FIREBALLEXP1, // deathstate
S_FIREBALLEXP1, // xdeathstate
sfx_mario1, // deathsound
10*FRACUNIT, // speed
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
40*FRACUNIT, // speed
4*FRACUNIT, // radius
8*FRACUNIT, // height
0, // display offset
DMG_FIRE, // mass
1, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_FIRE|MF_MISSILE, // flags
MF_FIRE|MF_BOUNCE|MF_MISSILE, // flags
S_NULL // raisestate
},
{ // MT_FIREBALLTRAIL
-1, // doomednum
S_FIREBALLTRAIL1, // 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
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
0, // mass
1, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_RUNSPAWNFUNC, // flags
S_NULL // raisestate
},
{ // MT_SHELL
1804, // doomednum
S_SHELL, // spawnstate

View file

@ -3638,13 +3638,9 @@ typedef enum state
S_FIREFLOWER2,
S_FIREFLOWER3,
S_FIREFLOWER4,
S_FIREBALL1,
S_FIREBALL2,
S_FIREBALL3,
S_FIREBALL4,
S_FIREBALLEXP1,
S_FIREBALLEXP2,
S_FIREBALLEXP3,
S_FIREBALL,
S_FIREBALLTRAIL1,
S_FIREBALLTRAIL2,
S_SHELL,
S_PUMA_START1,
S_PUMA_START2,
@ -4658,6 +4654,7 @@ typedef enum mobj_type
MT_BLUEGOOMBA,
MT_FIREFLOWER,
MT_FIREBALL,
MT_FIREBALLTRAIL,
MT_SHELL,
MT_PUMA,
MT_PUMATRAIL,

View file

@ -1305,6 +1305,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
return false;
}
// Fireball touched an enemy
// Don't bounce though, just despawn right there
if ((tmthing->type == MT_FIREBALL) && (thing->flags & MF_ENEMY))
P_KillMobj(tmthing, NULL, NULL, 0);
// damage / explode
if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example)
P_DamageMobj(thing, tmthing, tmthing, 1, 0);

View file

@ -8693,6 +8693,13 @@ void P_MobjThinker(mobj_t *mobj)
case MT_KOOPA:
P_KoopaThinker(mobj);
break;
case MT_FIREBALL:
if (P_AproxDistance(mobj->momx, mobj->momy) <= 16*FRACUNIT) // Once fireballs lose enough speed, kill them
{
P_KillMobj(mobj, NULL, NULL, 0);
return;
}
break;
case MT_REDRING:
if (((mobj->z < mobj->floorz) || (mobj->z + mobj->height > mobj->ceilingz))
&& mobj->flags & MF_MISSILE)

View file

@ -4026,12 +4026,13 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd)
if (player->pflags & PF_ATTACKDOWN || player->climbing || (G_TagGametype() && !(player->pflags & PF_TAGIT)))
return;
if ((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER)
if (((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) && !(player->weapondelay))
{
player->pflags |= PF_ATTACKDOWN;
mo = P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0);
P_InstaThrust(mo, player->mo->angle, ((mo->info->speed>>FRACBITS)*player->mo->scale) + player->speed);
S_StartSound(player->mo, sfx_mario7);
P_SetWeaponDelay(player, TICRATE); // Short delay between fireballs so you can't spam them everywhere
return;
}