Add graphic for throwing items

Fix missing frame of clash
This commit is contained in:
Sryder13 2017-10-24 17:19:14 +01:00
parent c66b10dda3
commit 0422e40649
5 changed files with 87 additions and 6 deletions

View file

@ -6398,6 +6398,12 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_CLASH3",
"S_CLASH4",
"S_CLASH5",
"S_CLASH6",
"S_FIREDITEM1",
"S_FIREDITEM2",
"S_FIREDITEM3",
"S_FIREDITEM4",
#ifdef SEENAMES
"S_NAMECHECK",
@ -6963,6 +6969,10 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_BUMP",
"MT_ITEMCLASH",
"MT_FIREDITEM",
#ifdef SEENAMES
"MT_NAMECHECK",
#endif

View file

@ -58,7 +58,7 @@ char sprnames[NUMSPRITES + 1][5] =
"SPRG","BSPR","RNDM","RPOP","KFRE","DRIF","DSMO","FITM","DFAK","BANA",
"DBAN","GSHE","DGSH","RSHE","DRSH","BOMB","BLIG","LIGH","SINK","SITR",
"LAKI","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM",
"SACO","CRAB","SHAD","BUMP","FLEN","CLAS"
"SACO","CRAB","SHAD","BUMP","FLEN","CLAS","PSHW"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -2849,11 +2849,17 @@ 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|1, 2, {NULL}, 0, 0, S_CLASH2},
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30|2, 2, {NULL}, 0, 0, S_CLASH3},
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30|3, 2, {NULL}, 0, 0, S_CLASH4},
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30|4, 2, {NULL}, 0, 0, S_CLASH5},
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30|5, 2, {NULL}, 0, 0, S_NULL},
{SPR_CLAS, FF_FULLBRIGHT|FF_TRANS30, 2, {NULL}, 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_PSHW, 0, 3, {NULL}, 0, 0, S_FIREDITEM2}, // S_FIREDITEM1
{SPR_PSHW, 1, 3, {NULL}, 0, 0, S_FIREDITEM3}, // S_FIREDITEM2
{SPR_PSHW, 2, 3, {NULL}, 0, 0, S_FIREDITEM4}, // S_FIREDITEM3
{SPR_PSHW, 3, 3, {NULL}, 0, 0, S_NULL}, // S_FIREDITEM4
#ifdef SEENAMES
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK
@ -16567,6 +16573,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY, // flags
S_NULL // raisestate
},
{ // MT_FIREDITEM
-1, // doomednum
S_FIREDITEM1, // 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
60*FRACUNIT, // speed
32*FRACUNIT, // radius
64*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_SCENERY, // flags
S_NULL // raisestate
},
// ============================================================================================================================//
#ifdef SEENAMES

View file

@ -618,6 +618,7 @@ typedef enum sprite
SPR_BUMP, // Player/shell bump
SPR_FLEN, // Shell hit graphics stuff
SPR_CLAS, // items clash
SPR_PSHW, // thrown indicator
SPR_FIRSTFREESLOT,
SPR_LASTFREESLOT = SPR_FIRSTFREESLOT + NUMSPRITEFREESLOTS - 1,
@ -3369,6 +3370,12 @@ typedef enum state
S_CLASH3,
S_CLASH4,
S_CLASH5,
S_CLASH6,
S_FIREDITEM1,
S_FIREDITEM2,
S_FIREDITEM3,
S_FIREDITEM4,
#ifdef SEENAMES
S_NAMECHECK,
@ -4012,6 +4019,8 @@ typedef enum mobj_type
MT_ITEMCLASH,
MT_FIREDITEM,
#ifdef SEENAMES
MT_NAMECHECK,
#endif

View file

@ -1824,6 +1824,13 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
th->momx = FixedMul(speed, FINECOSINE(an>>ANGLETOFINESHIFT));
th->momy = FixedMul(speed, FINESINE(an>>ANGLETOFINESHIFT));
x = x + P_ReturnThrustX(source, an, source->radius + th->radius);
x = y + P_ReturnThrustY(source, an, source->radius + th->radius);
mobj_t *throwmo = P_SpawnMobj(x, y, z, MT_FIREDITEM);
throwmo->movecount = 1;
throwmo->movedir = source->angle - an;
P_SetTarget(&throwmo->target, source);
return NULL;
}
@ -2042,6 +2049,10 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
if (player->mo->eflags & MFE_VERTICALFLIP)
mo->eflags |= MFE_VERTICALFLIP;
}
mobj_t *throwmo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + 80*FRACUNIT, MT_FIREDITEM);
P_SetTarget(&throwmo->target, player->mo);
throwmo->movecount = 0; // above player
}
else
{

View file

@ -6819,6 +6819,24 @@ void P_MobjThinker(mobj_t *mobj)
return;
}
break;
case MT_FIREDITEM:
{
fixed_t x, y, z;
if (mobj->movecount)
{
x = mobj->target->x + P_ReturnThrustX(mobj->target, mobj->target->angle + mobj->movedir, mobj->target->radius + mobj->radius);
y = mobj->target->y + P_ReturnThrustY(mobj->target, mobj->target->angle + mobj->movedir, mobj->target->radius + mobj->radius);
z = mobj->target->z + mobj->target->height/3;
}
else
{
x = mobj->target->x;
y = mobj->target->y;
z = mobj->target->z + 80*FRACUNIT;
}
P_TeleportMove(mobj, x, y, z);
break;
}
default:
if (mobj->fuse)
{ // Scenery object fuse! Very basic!