Merge branch 'thundershield-hell' into 'master'

Thundershield hell

See merge request KartKrew/Kart!14
This commit is contained in:
Sal 2018-09-23 18:08:59 -04:00
commit b964c1c49a
8 changed files with 208 additions and 24 deletions

View file

@ -1830,6 +1830,7 @@ static actionpointer_t actionpointers[] =
{{A_JawzExplode}, "A_JAWZEXPLODE"}, // SRB2kart
{{A_MineExplode}, "A_MINEEXPLODE"}, // SRB2kart
{{A_BallhogExplode}, "A_BALLHOGEXPLODE"}, // SRB2kart
{{A_LightningFollowPlayer}, "A_LIGHTNINGFOLLOWPLAYER"}, //SRB2kart
{{A_OrbitNights}, "A_ORBITNIGHTS"},
{{A_GhostMe}, "A_GHOSTME"},
{{A_SetObjectState}, "A_SETOBJECTSTATE"},

View file

@ -60,7 +60,8 @@ char sprnames[NUMSPRITES + 1][5] =
"KRBM","BHOG","BHBM","BLIG","LIGH","THNS","SINK","SITR","KBLN","DEZL",
"POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM","SACO",
"CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB","ARRO",
"ITEM","ITMO","ITMI","ITMN","WANT","PBOM","RETI","AIDU","VIEW"
"ITEM","ITMO","ITMI","ITMN","WANT","PBOM","RETI","AIDU","KSPK","LZI1",
"LZI2","KLIT","VIEW"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -3007,6 +3008,57 @@ state_t states[NUMSTATES] =
{SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM
{SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_KARMAWHEEL
// Oh no it's annoying lightning states.......
// Lightning Sparks (it's the ones we'll use for the radius)
{SPR_KSPK, FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_KSPARK2}, // S_KSPARK1
{SPR_NULL, FF_FULLBRIGHT, 1, {A_LightningFollowPlayer}, 0, 0, S_KSPARK3}, // S_KSPARK2
{SPR_KSPK, FF_FULLBRIGHT|1, 2, {A_LightningFollowPlayer}, 0, 0, S_KSPARK4}, // S_KSPARK3
{SPR_NULL, FF_FULLBRIGHT, 1, {A_LightningFollowPlayer}, 0, 0, S_KSPARK5}, // S_KSPARK4
{SPR_KSPK, FF_FULLBRIGHT|2, 2, {A_LightningFollowPlayer}, 0, 0, S_KSPARK6}, // S_KSPARK5
{SPR_NULL, FF_FULLBRIGHT, 1, {A_LightningFollowPlayer}, 0, 0, S_KSPARK7}, // S_KSPARK6
{SPR_KSPK, FF_FULLBRIGHT|3, 2, {A_LightningFollowPlayer}, 0, 0, S_KSPARK8}, // S_KSPARK7
{SPR_NULL, FF_FULLBRIGHT, 1, {A_LightningFollowPlayer}, 0, 0, S_KSPARK9}, // S_KSPARK8
{SPR_KSPK, FF_TRANS40|FF_FULLBRIGHT|4, 2, {A_LightningFollowPlayer}, 0, 0, S_KSPARK10}, // S_KSPARK9
{SPR_NULL, FF_FULLBRIGHT, 1, {A_LightningFollowPlayer}, 0, 0, S_KSPARK11}, // S_KSPARK10
{SPR_KSPK, FF_TRANS50|FF_FULLBRIGHT|5, 2, {A_LightningFollowPlayer}, 0, 0, S_KSPARK12}, // S_KSPARK11
{SPR_NULL, FF_FULLBRIGHT, 1, {A_LightningFollowPlayer}, 0, 0, S_KSPARK13}, // S_KSPARK12
{SPR_KSPK, FF_TRANS60|FF_FULLBRIGHT|6, 2, {A_LightningFollowPlayer}, 0, 0, S_NULL}, // S_KSPARK13
// The straight bolt...
{SPR_LZI1, FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO12}, // S_LZIO11
{SPR_NULL, FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO13}, // S_LZIO12
{SPR_LZI1, FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO14}, // S_LZIO13
{SPR_LZI1, FF_FULLBRIGHT|1, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO15}, // S_LZIO14
{SPR_NULL, FF_FULLBRIGHT, 4, {A_LightningFollowPlayer}, 0, 0, S_LZIO16}, // S_LZIO15
{SPR_LZI1, FF_FULLBRIGHT|1, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO17}, // S_LZIO16
{SPR_NULL, 0, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO18}, // S_LZIO17
{SPR_LZI1, FF_TRANS50|FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO19}, // S_LZIO18
{SPR_LZI1, FF_TRANS70|FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_NULL}, // S_LZIO19
{SPR_NULL, FF_FULLBRIGHT, 6, {A_LightningFollowPlayer}, 0, 0, S_LZIO22}, // S_LZIO21
{SPR_LZI2, FF_FULLBRIGHT|1, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO23}, // S_LZIO22
{SPR_LZI2, FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO24}, // S_LZIO23
{SPR_NULL, FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO25}, // S_LZIO24
{SPR_NULL, FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO26}, // S_LZIO25
{SPR_NULL, FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO27}, // S_LZIO26
{SPR_LZI2, FF_TRANS30|FF_FULLBRIGHT|2, 2, {A_LightningFollowPlayer}, 0, 0, S_LZIO28}, // S_LZIO27
{SPR_NULL, 0, 4, {A_LightningFollowPlayer}, 0, 0, S_LZIO29}, // S_LZIO28
{SPR_LZI2, FF_TRANS70|FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_NULL}, // S_LZIO29
// The slanted bolt. Man these states are boring as all heck to do.
{SPR_KLIT, FF_FULLBRIGHT|FF_PAPERSPRITE, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT2}, // S_KLIT1
{SPR_NULL, FF_FULLBRIGHT|FF_PAPERSPRITE, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT3}, // S_KLIT2
{SPR_KLIT, FF_FULLBRIGHT|FF_PAPERSPRITE|1, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT4}, // S_KLIT3
{SPR_NULL, FF_FULLBRIGHT|FF_PAPERSPRITE, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT5}, // S_KLIT4
{SPR_KLIT, FF_FULLBRIGHT|FF_PAPERSPRITE|2, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT6}, // S_KLIT5
{SPR_NULL, FF_FULLBRIGHT|FF_PAPERSPRITE, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT7}, // S_KLIT6
{SPR_KLIT, FF_FULLBRIGHT|FF_PAPERSPRITE|3, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT8}, // S_KLIT7
{SPR_NULL, FF_FULLBRIGHT|FF_PAPERSPRITE, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT9}, // S_KLIT8
{SPR_KLIT, FF_FULLBRIGHT|FF_PAPERSPRITE|4, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT10}, // S_KLIT9
{SPR_NULL, FF_FULLBRIGHT|FF_PAPERSPRITE, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT11}, // S_KLIT10
{SPR_KLIT, FF_FULLBRIGHT|FF_PAPERSPRITE|5, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT12}, // S_KLIT11
{SPR_NULL, FF_FULLBRIGHT|FF_PAPERSPRITE, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT1}, // S_KLIT12
#ifdef SEENAMES
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK

View file

@ -168,6 +168,7 @@ void A_JawzChase(); // SRB2kart
void A_JawzExplode(); // SRB2kart
void A_MineExplode(); // SRB2kart
void A_BallhogExplode(); // SRB2kart
void A_LightningFollowPlayer(); // SRB2kart: Lightning shield effect player chasing
void A_OrbitNights();
void A_GhostMe();
void A_SetObjectState();
@ -646,8 +647,13 @@ typedef enum sprite
SPR_AIDU,
SPR_VIEW, // First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw!
SPR_KSPK, // Spark radius for the lightning shield
SPR_LZI1, // Lightning that falls on the player for lightning shield
SPR_LZI2, // ditto
SPR_KLIT, // You have a twisted mind. But this actually is for the diagonal lightning.
SPR_VIEW, // First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw!
SPR_FIRSTFREESLOT,
SPR_LASTFREESLOT = SPR_FIRSTFREESLOT + NUMSPRITEFREESLOTS - 1,
NUMSPRITES
@ -3550,6 +3556,54 @@ typedef enum state
S_PLAYERITEM,
S_KARMAWHEEL,
// Lightning shield use stuff;
S_KSPARK1, // Sparkling Radius
S_KSPARK2,
S_KSPARK3,
S_KSPARK4,
S_KSPARK5,
S_KSPARK6,
S_KSPARK7,
S_KSPARK8,
S_KSPARK9,
S_KSPARK10,
S_KSPARK11,
S_KSPARK12,
S_KSPARK13, // ... that's an awful lot.
S_LZIO11, // Straight lightning bolt
S_LZIO12,
S_LZIO13,
S_LZIO14,
S_LZIO15,
S_LZIO16,
S_LZIO17,
S_LZIO18,
S_LZIO19,
S_LZIO21, // Straight lightning bolt (flipped)
S_LZIO22,
S_LZIO23,
S_LZIO24,
S_LZIO25,
S_LZIO26,
S_LZIO27,
S_LZIO28,
S_LZIO29,
S_KLIT1, // Diagonal lightning. No, it not being straight doesn't make it gay.
S_KLIT2,
S_KLIT3,
S_KLIT4,
S_KLIT5,
S_KLIT6,
S_KLIT7,
S_KLIT8,
S_KLIT9,
S_KLIT10,
S_KLIT11,
S_KLIT12,
#ifdef SEENAMES
S_NAMECHECK,

View file

@ -2842,13 +2842,59 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
return mo;
}
#define THUNDERRADIUS 320
static void K_DoThunderShield(player_t *player)
{
S_StartSound(player->mo, sfx_s3k45);
mobj_t *mo;
int i = 0;
fixed_t sx;
fixed_t sy;
S_StartSound(player->mo, sfx_zio3);
//player->kartstuff[k_thunderanim] = 35;
P_NukeEnemies(player->mo, player->mo, RING_DIST/4);
// spawn vertical bolt
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK);
P_SetTarget(&mo->target, player->mo);
P_SetMobjState(mo, S_LZIO11);
mo->color = SKINCOLOR_TEAL;
mo->scale = player->mo->scale*3 + (player->mo->scale/2);
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK);
P_SetTarget(&mo->target, player->mo);
P_SetMobjState(mo, S_LZIO21);
mo->color = SKINCOLOR_CYAN;
mo->scale = player->mo->scale*3 + (player->mo->scale/2);
// spawn horizontal bolts;
for (i=0; i<7; i++)
{
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK);
mo->angle = P_RandomRange(0, 359)*ANG1;
mo->fuse = P_RandomRange(20, 50);
P_SetTarget(&mo->target, player->mo);
P_SetMobjState(mo, S_KLIT1);
}
// spawn the radius thing:
angle_t an = ANGLE_22h;
for (i=0; i<15; i++)
{
sx = player->mo->x + FixedMul((player->mo->scale*THUNDERRADIUS), FINECOSINE((an*i)>>ANGLETOFINESHIFT));
sy = player->mo->y + FixedMul((player->mo->scale*THUNDERRADIUS), FINESINE((an*i)>>ANGLETOFINESHIFT));
mo = P_SpawnMobj(sx, sy, player->mo->z, MT_THOK);
mo-> angle = an*i;
mo->extravalue1 = THUNDERRADIUS; // Used to know whether we should teleport by radius or something.
mo->scale = player->mo->scale*3;
P_SetTarget(&mo->target, player->mo);
P_SetMobjState(mo, S_KSPARK1);
}
}
#undef THUNDERRADIUS
static void K_DoHyudoroSteal(player_t *player)
{
INT32 i, numplayers = 0;
@ -5494,52 +5540,52 @@ void K_LoadKartHUDGraphics(void)
}
// For the item toggle menu
const char *K_GetItemPatch(UINT8 item, boolean small)
const char *K_GetItemPatch(UINT8 item, boolean tiny)
{
switch (item)
{
case KITEM_SNEAKER:
case KRITEM_TRIPLESNEAKER:
return (small ? "K_ISSHOE" : "K_ITSHOE");
return (tiny ? "K_ISSHOE" : "K_ITSHOE");
case KITEM_ROCKETSNEAKER:
return (small ? "K_ISRSHE" : "K_ITRSHE");
return (tiny ? "K_ISRSHE" : "K_ITRSHE");
case KITEM_INVINCIBILITY:
return (small ? "K_ISINV1" : "K_ITINV1");
return (tiny ? "K_ISINV1" : "K_ITINV1");
case KITEM_BANANA:
case KRITEM_TRIPLEBANANA:
case KRITEM_TENFOLDBANANA:
return (small ? "K_ISBANA" : "K_ITBANA");
return (tiny ? "K_ISBANA" : "K_ITBANA");
case KITEM_EGGMAN:
return (small ? "K_ISEGGM" : "K_ITEGGM");
return (tiny ? "K_ISEGGM" : "K_ITEGGM");
case KITEM_ORBINAUT:
return (small ? "K_ISORBN" : "K_ITORB1");
return (tiny ? "K_ISORBN" : "K_ITORB1");
case KITEM_JAWZ:
case KRITEM_DUALJAWZ:
return (small ? "K_ISJAWZ" : "K_ITJAWZ");
return (tiny ? "K_ISJAWZ" : "K_ITJAWZ");
case KITEM_MINE:
return (small ? "K_ISMINE" : "K_ITMINE");
return (tiny ? "K_ISMINE" : "K_ITMINE");
case KITEM_BALLHOG:
return (small ? "K_ISBHOG" : "K_ITBHOG");
return (tiny ? "K_ISBHOG" : "K_ITBHOG");
case KITEM_SPB:
return (small ? "K_ISSPB" : "K_ITSPB");
return (tiny ? "K_ISSPB" : "K_ITSPB");
case KITEM_GROW:
return (small ? "K_ISGROW" : "K_ITGROW");
return (tiny ? "K_ISGROW" : "K_ITGROW");
case KITEM_SHRINK:
return (small ? "K_ISSHRK" : "K_ITSHRK");
return (tiny ? "K_ISSHRK" : "K_ITSHRK");
case KITEM_THUNDERSHIELD:
return (small ? "K_ISTHNS" : "K_ITTHNS");
return (tiny ? "K_ISTHNS" : "K_ITTHNS");
case KITEM_HYUDORO:
return (small ? "K_ISHYUD" : "K_ITHYUD");
return (tiny ? "K_ISHYUD" : "K_ITHYUD");
case KITEM_POGOSPRING:
return (small ? "K_ISPOGO" : "K_ITPOGO");
return (tiny ? "K_ISPOGO" : "K_ITPOGO");
case KITEM_KITCHENSINK:
return (small ? "K_ISSINK" : "K_ITSINK");
return (tiny ? "K_ISSINK" : "K_ITSINK");
case KRITEM_TRIPLEORBINAUT:
return (small ? "K_ISORBN" : "K_ITORB3");
return (tiny ? "K_ISORBN" : "K_ITORB3");
case KRITEM_QUADORBINAUT:
return (small ? "K_ISORBN" : "K_ITORB4");
return (tiny ? "K_ISORBN" : "K_ITORB4");
default:
return (small ? "K_ISSAD" : "K_ITSAD");
return (tiny ? "K_ISSAD" : "K_ITSAD");
}
}

View file

@ -59,7 +59,7 @@ void K_CalculateBattleWanted(void);
void K_CheckBumpers(void);
void K_CheckSpectateStatus(void);
const char *K_GetItemPatch(UINT8 item, boolean small);
const char *K_GetItemPatch(UINT8 item, boolean tiny);
INT32 K_calcSplitFlags(INT32 snapflags);
void K_LoadKartHUDGraphics(void);
fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my);

View file

@ -192,6 +192,7 @@ void A_JawzChase(mobj_t *actor); // SRB2kart
void A_JawzExplode(mobj_t *actor); // SRB2kart
void A_MineExplode(mobj_t *actor); // SRB2kart
void A_BallhogExplode(mobj_t *actor); // SRB2kart
void A_LightningFollowPlayer(mobj_t *actor); // SRB2kart
void A_OrbitNights(mobj_t *actor);
void A_GhostMe(mobj_t *actor);
void A_SetObjectState(mobj_t *actor);
@ -8312,6 +8313,34 @@ void A_BallhogExplode(mobj_t *actor)
S_StartSound(mo2, actor->info->deathsound);
return;
}
// A_LightningFollowPlayer:
// Dumb simple function that gives a mobj its target's momentums without updating its angle.
void A_LightningFollowPlayer(mobj_t *actor)
{
#ifdef HAVE_BLUA
if (LUA_CallAction("A_LightningFollowPlayer", actor))
return;
#endif
fixed_t sx, sy;
if (actor->target)
{
if (actor->extravalue1) // Make the radius also follow the player somewhat accuratly
{
sx = actor->target->x + FixedMul((actor->target->scale*actor->extravalue1), FINECOSINE((actor->angle)>>ANGLETOFINESHIFT));
sy = actor->target->y + FixedMul((actor->target->scale*actor->extravalue1), FINESINE((actor->angle)>>ANGLETOFINESHIFT));
P_TeleportMove(actor, sx, sy, actor->target->z);
}
else // else just teleport to player directly
P_TeleportMove(actor, actor->target->x, actor->target->y, actor->target->z);
actor->momx = actor->target->momx;
actor->momy = actor->target->momy;
actor->momz = actor->target->momz; // Give momentum since we don't teleport to our player literally every frame.
}
return;
}
//}
// Function: A_OrbitNights

View file

@ -815,6 +815,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"hogbom", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"kpogos", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"ddash", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"zio3", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"mcitm1", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"chaooo", false, 110, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"itfree", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},

View file

@ -890,6 +890,7 @@ typedef enum
sfx_hogbom,
sfx_kpogos,
sfx_ddash,
sfx_zio3,
sfx_mcitm1,
sfx_chaooo,
sfx_itfree,