Merge branch 'master' into brake-drift

This commit is contained in:
TehRealSalt 2018-11-01 17:37:10 -04:00
commit 6a31959381
9 changed files with 226 additions and 8 deletions

View file

@ -346,6 +346,7 @@ typedef enum
k_comebackpoints, // Number of times you've bombed or gave an item to someone; once it's 3 it gets set back to 0 and you're given a bumper
k_comebackmode, // 0 = bomb, 1 = item
k_wanted, // Timer for determining WANTED status, lowers when hitting people, prevents the game turning into Camp Lazlo
k_yougotem, // "You Got Em" gfx when hitting someone as a karma player via a method that gets you back in the game instantly
NUMKARTSTUFF
} kartstufftype_t;

View file

@ -6761,6 +6761,36 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_KARMAWHEEL", // Karma player wheels
"S_BATTLEPOINT1A", // Battle point indicators
"S_BATTLEPOINT1B",
"S_BATTLEPOINT1C",
"S_BATTLEPOINT1D",
"S_BATTLEPOINT1E",
"S_BATTLEPOINT1F",
"S_BATTLEPOINT1G",
"S_BATTLEPOINT1H",
"S_BATTLEPOINT1I",
"S_BATTLEPOINT2A",
"S_BATTLEPOINT2B",
"S_BATTLEPOINT2C",
"S_BATTLEPOINT2D",
"S_BATTLEPOINT2E",
"S_BATTLEPOINT2F",
"S_BATTLEPOINT2G",
"S_BATTLEPOINT2H",
"S_BATTLEPOINT2I",
"S_BATTLEPOINT3A",
"S_BATTLEPOINT3B",
"S_BATTLEPOINT3C",
"S_BATTLEPOINT3D",
"S_BATTLEPOINT3E",
"S_BATTLEPOINT3F",
"S_BATTLEPOINT3G",
"S_BATTLEPOINT3H",
"S_BATTLEPOINT3I",
// Thunder shield use stuff;
"S_KSPARK1", // Sparkling Radius
"S_KSPARK2",
@ -7519,6 +7549,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_KARMAHITBOX",
"MT_KARMAWHEEL",
"MT_BATTLEPOINT",
"MT_FZEROBOOM",
// Midnight Channel stuff:
@ -7933,6 +7965,7 @@ static const char *const KARTSTUFF_LIST[] = {
"COMEBACKPOINTS",
"COMEBACKMODE",
"WANTED",
"YOUGOTEM",
};
static const char *const HUDITEMS_LIST[] = {

View file

@ -60,9 +60,9 @@ char sprnames[NUMSPRITES + 1][5] =
"JAWZ","SSMN","KRBM","BHOG","BHBM","SPBM","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","KSPK",
"LZI1","LZI2","KLIT","FZSM","FZBM","FPRT","SPTL","ENM1","GARU","MARR",
"REAP","JITB","CDMO","CDBU","VIEW"
"ARRO","ITEM","ITMO","ITMI","ITMN","WANT","PBOM","HIT1","HIT2","HIT3",
"RETI","AIDU","KSPK","LZI1","LZI2","KLIT","FZSM","FZBM","FPRT","SPTL",
"ENM1","GARU","MARR","REAP","JITB","CDMO","CDBU","VIEW"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -3048,6 +3048,36 @@ state_t states[NUMSTATES] =
{SPR_PBOM, 0, -1, {NULL}, 0, 0, S_NULL}, // S_KARMAWHEEL
{SPR_HIT1, 0, 7, {NULL}, 0, 0, S_BATTLEPOINT1B}, // S_BATTLEPOINT1A
{SPR_HIT1, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT1C}, // S_BATTLEPOINT1B
{SPR_HIT1, 4, 1, {NULL}, 0, 0, S_BATTLEPOINT1D}, // S_BATTLEPOINT1C
{SPR_HIT1, 3, 1, {NULL}, 0, 0, S_BATTLEPOINT1E}, // S_BATTLEPOINT1D
{SPR_HIT1, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT1F}, // S_BATTLEPOINT1E
{SPR_HIT1, 1, 1, {NULL}, 0, 0, S_BATTLEPOINT1G}, // S_BATTLEPOINT1F
{SPR_HIT1, 2, TICRATE, {NULL}, 0, 0, S_BATTLEPOINT1H}, // S_BATTLEPOINT1G
{SPR_HIT1, 5, 1, {NULL}, 0, 0, S_BATTLEPOINT1I}, // S_BATTLEPOINT1H
{SPR_HIT1, 6, 1, {NULL}, 0, 0, S_NULL}, // S_BATTLEPOINT1I
{SPR_HIT2, 0, 7, {NULL}, 0, 0, S_BATTLEPOINT2B}, // S_BATTLEPOINT2A
{SPR_HIT2, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT2C}, // S_BATTLEPOINT2B
{SPR_HIT2, 4, 1, {NULL}, 0, 0, S_BATTLEPOINT2D}, // S_BATTLEPOINT2C
{SPR_HIT2, 3, 1, {NULL}, 0, 0, S_BATTLEPOINT2E}, // S_BATTLEPOINT2D
{SPR_HIT2, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT2F}, // S_BATTLEPOINT2E
{SPR_HIT2, 1, 1, {NULL}, 0, 0, S_BATTLEPOINT2G}, // S_BATTLEPOINT2F
{SPR_HIT2, 2, TICRATE, {NULL}, 0, 0, S_BATTLEPOINT2H}, // S_BATTLEPOINT2G
{SPR_HIT2, 5, 1, {NULL}, 0, 0, S_BATTLEPOINT2I}, // S_BATTLEPOINT2H
{SPR_HIT2, 6, 1, {NULL}, 0, 0, S_NULL}, // S_BATTLEPOINT2I
{SPR_HIT3, 0, 7, {NULL}, 0, 0, S_BATTLEPOINT3B}, // S_BATTLEPOINT3A
{SPR_HIT3, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT3C}, // S_BATTLEPOINT3B
{SPR_HIT3, 4, 1, {NULL}, 0, 0, S_BATTLEPOINT3D}, // S_BATTLEPOINT3C
{SPR_HIT3, 3, 1, {NULL}, 0, 0, S_BATTLEPOINT3E}, // S_BATTLEPOINT3D
{SPR_HIT3, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT3F}, // S_BATTLEPOINT3E
{SPR_HIT3, 1, 1, {NULL}, 0, 0, S_BATTLEPOINT3G}, // S_BATTLEPOINT3F
{SPR_HIT3, 2, TICRATE, {NULL}, 0, 0, S_BATTLEPOINT3H}, // S_BATTLEPOINT3G
{SPR_HIT3, 5, 1, {NULL}, 0, 0, S_BATTLEPOINT3I}, // S_BATTLEPOINT3H
{SPR_HIT3, 6, 1, {NULL}, 0, 0, S_NULL}, // S_BATTLEPOINT3I
// 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
@ -17305,6 +17335,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_BATTLEPOINT
-1, // doomednum
S_INVISIBLE, // 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
8, // speed
8*FRACUNIT, // radius
8*FRACUNIT, // height
-1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_FZEROBOOM
-1, // doomednum
S_INVISIBLE, // spawnstate

View file

@ -652,6 +652,11 @@ typedef enum sprite
SPR_WANT,
SPR_PBOM, // player bomb
SPR_HIT1, // battle points
SPR_HIT2, // battle points
SPR_HIT3, // battle points
SPR_RETI, // player reticule
SPR_AIDU,
@ -3623,7 +3628,37 @@ typedef enum state
S_PLAYERFAKE,
S_KARMAWHEEL,
S_BATTLEPOINT1A, // Battle point indicators
S_BATTLEPOINT1B,
S_BATTLEPOINT1C,
S_BATTLEPOINT1D,
S_BATTLEPOINT1E,
S_BATTLEPOINT1F,
S_BATTLEPOINT1G,
S_BATTLEPOINT1H,
S_BATTLEPOINT1I,
S_BATTLEPOINT2A,
S_BATTLEPOINT2B,
S_BATTLEPOINT2C,
S_BATTLEPOINT2D,
S_BATTLEPOINT2E,
S_BATTLEPOINT2F,
S_BATTLEPOINT2G,
S_BATTLEPOINT2H,
S_BATTLEPOINT2I,
S_BATTLEPOINT3A,
S_BATTLEPOINT3B,
S_BATTLEPOINT3C,
S_BATTLEPOINT3D,
S_BATTLEPOINT3E,
S_BATTLEPOINT3F,
S_BATTLEPOINT3G,
S_BATTLEPOINT3H,
S_BATTLEPOINT3I,
// Thunder shield use stuff;
S_KSPARK1, // Sparkling Radius
S_KSPARK2,
@ -4399,6 +4434,8 @@ typedef enum mobj_type
MT_KARMAHITBOX,
MT_KARMAWHEEL,
MT_BATTLEPOINT,
MT_FZEROBOOM,
// Midnight Channel stuff:

View file

@ -1801,6 +1801,32 @@ void K_DoInstashield(player_t *player)
P_SetTarget(&layerb->target, player->mo);
}
void K_SpawnBattlePoints(player_t *source, player_t *victim, UINT8 amount)
{
statenum_t st;
mobj_t *pt;
if (!source || !source->mo)
return;
if (amount == 1)
st = S_BATTLEPOINT1A;
else if (amount == 2)
st = S_BATTLEPOINT2A;
else if (amount == 3)
st = S_BATTLEPOINT3A;
else
return; // NO STATE!
pt = P_SpawnMobj(source->mo->x, source->mo->y, source->mo->z, MT_BATTLEPOINT);
P_SetTarget(&pt->target, source->mo);
P_SetMobjState(pt, st);
if (victim && victim->skincolor)
pt->color = victim->skincolor;
else
pt->color = source->skincolor;
}
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem)
{
UINT8 scoremultiply = 1;
@ -1834,6 +1860,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
if (source && source->player && player != source->player)
{
P_AddPlayerScore(source->player, scoremultiply);
K_SpawnBattlePoints(source->player, player, scoremultiply);
if (!trapitem)
{
source->player->kartstuff[k_wanted] -= wantedreduce;
@ -1924,6 +1951,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
if (source && source->player && player != source->player)
{
P_AddPlayerScore(source->player, scoremultiply);
K_SpawnBattlePoints(source->player, player, scoremultiply);
source->player->kartstuff[k_wanted] -= wantedreduce;
player->kartstuff[k_wanted] -= (wantedreduce/2);
}
@ -2013,6 +2041,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
if (source && source->player && player != source->player)
{
P_AddPlayerScore(source->player, scoremultiply);
K_SpawnBattlePoints(source->player, player, scoremultiply);
source->player->kartstuff[k_wanted] -= wantedreduce;
player->kartstuff[k_wanted] -= (wantedreduce/2);
}
@ -4085,6 +4114,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->kartstuff[k_lapanimation])
player->kartstuff[k_lapanimation]--;
if (player->kartstuff[k_yougotem])
player->kartstuff[k_yougotem]--;
if (G_BattleGametype() && (player->exiting || player->kartstuff[k_comebacktimer]))
{
if (player->exiting)
@ -5610,6 +5642,8 @@ static patch_t *kp_lapanim_number[10][3];
static patch_t *kp_lapanim_emblem;
static patch_t *kp_lapanim_hand[3];
static patch_t *kp_yougotem;
void K_LoadKartHUDGraphics(void)
{
INT32 i, j;
@ -5835,6 +5869,8 @@ void K_LoadKartHUDGraphics(void)
buffer[7] = '0'+(i+1);
kp_lapanim_hand[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
}
kp_yougotem = (patch_t *) W_CachePatchName("YOUGOTEM", PU_HUDGFX);
}
// For the item toggle menu
@ -7707,6 +7743,9 @@ void K_drawKartHUD(void)
K_drawLapStartAnim();
}
if (G_BattleGametype() && !splitscreen && (stplyr->kartstuff[k_yougotem] % 2)) // * YOU GOT EM *
V_DrawScaledPatch(BASEVIDWIDTH/2 - (SHORT(kp_yougotem->width)/2), 32, V_HUDTRANS, kp_yougotem);
// Draw FREE PLAY.
if (isfreeplay && !stplyr->spectator && timeinmap > 113)
K_drawKartFreePlay(leveltime);

View file

@ -27,6 +27,7 @@ void K_KartMoveAnimation(player_t *player);
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
void K_KartPlayerAfterThink(player_t *player);
void K_DoInstashield(player_t *player);
void K_SpawnBattlePoints(player_t *source, player_t *victim, UINT8 amount);
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem);
void K_SquishPlayer(player_t *player, mobj_t *source);
void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor);

View file

@ -2109,6 +2109,20 @@ static int lib_kDoInstashield(lua_State *L)
return 0;
}
static int lib_kSpawnBattlePoints(lua_State *L)
{
player_t *source = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
player_t *victim = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
UINT8 amount = (UINT8)luaL_checkinteger(L, 3);
NOHUD
if (!source)
return LUA_ErrInvalid(L, "player_t");
if (!victim)
return LUA_ErrInvalid(L, "player_t");
K_SpawnBattlePoints(source, victim, amount);
return 0;
}
static int lib_kSpinPlayer(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -2500,6 +2514,7 @@ static luaL_Reg lib[] = {
{"K_KartBouncing",lib_kKartBouncing},
{"K_MatchGenericExtraFlags",lib_kMatchGenericExtraFlags},
{"K_DoInstashield",lib_kDoInstashield},
{"K_SpawnBattlePoints",lib_kSpawnBattlePoints},
{"K_SpinPlayer",lib_kSpinPlayer},
{"K_SquishPlayer",lib_kSquishPlayer},
{"K_ExplodePlayer",lib_kExplodePlayer},

View file

@ -494,6 +494,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
else
{
mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMEXPLODE);
UINT8 ptadd = (K_IsPlayerWanted(player) ? 2 : 1);
boom->scale = special->target->scale;
boom->destscale = special->target->scale;
boom->momz = 5*FRACUNIT;
@ -516,12 +518,17 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
if (numingame <= 2) // If so, then an extra karma point so they are 100% certain to switch places; it's annoying to end matches with a bomb kill
special->target->player->kartstuff[k_comebackpoints]++;
ptadd++;
}
special->target->player->kartstuff[k_comebackpoints] += (K_IsPlayerWanted(player) ? 2 : 1);
special->target->player->kartstuff[k_comebackpoints] += ptadd;
if (ptadd > 1)
special->target->player->kartstuff[k_yougotem] = 2*TICRATE;
if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
K_ExplodePlayer(player, special->target, special);
@ -545,6 +552,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
else if (special->target->player->kartstuff[k_comebackmode] == 2 && P_CanPickupItem(player, 2))
{
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
UINT8 ptadd = 1; // No WANTED bonus for tricking
S_StartSound(poof, special->info->seesound);
if (player->kartstuff[k_bumper] == 1) // If you have only one bumper left, and see if it's a 1v1
@ -560,14 +569,18 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
if (numingame <= 2) // If so, then an extra karma point so they are 100% certain to switch places; it's annoying to end matches with a fake kill
special->target->player->kartstuff[k_comebackpoints]++;
ptadd++;
}
special->target->player->kartstuff[k_comebackmode] = 0;
special->target->player->kartstuff[k_comebackpoints]++;
special->target->player->kartstuff[k_comebackpoints] += ptadd;
if (ptadd > 1)
special->target->player->kartstuff[k_yougotem] = 2*TICRATE;
if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
K_DropItems(player); //K_StripItems(player);

View file

@ -8357,6 +8357,28 @@ void P_MobjThinker(mobj_t *mobj)
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
break;
case MT_BATTLEPOINT:
if (!mobj->target || P_MobjWasRemoved(mobj->target))
{
P_RemoveMobj(mobj);
return;
}
if (mobj->movefactor < 48*mobj->target->scale)
{
mobj->movefactor += (48*mobj->target->scale)/6;
if (mobj->movefactor > mobj->target->height)
mobj->movefactor = mobj->target->height;
}
else if (mobj->movefactor > 48*mobj->target->scale)
{
mobj->movefactor -= (48*mobj->target->scale)/6;
if (mobj->movefactor < mobj->target->height)
mobj->movefactor = mobj->target->height;
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z + (mobj->target->height/2) + mobj->movefactor);
break;
case MT_THUNDERSHIELD:
{
fixed_t destx, desty;