Merge remote-tracking branch 'refs/remotes/origin/master' into sal-misc

This commit is contained in:
TehRealSalt 2018-02-27 19:13:32 -05:00
commit a9a74bc2c8
14 changed files with 90 additions and 41 deletions

View File

@ -1956,12 +1956,10 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese
void D_SetupVote(void) void D_SetupVote(void)
{ {
XBOXSTATIC char buf[8]; char buf[8];
char *p; char *p = buf;
INT32 i; INT32 i;
p = buf;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (i == 3) if (i == 3)
@ -1973,18 +1971,21 @@ void D_SetupVote(void)
SendNetXCmd(XD_SETUPVOTE, buf, p - buf); SendNetXCmd(XD_SETUPVOTE, buf, p - buf);
} }
void D_ModifyClientVote(INT8 voted) void D_ModifyClientVote(SINT8 voted)
{ {
XBOXSTATIC UINT8 buf[1]; char buf[1];
buf[0] = (UINT8)(voted+1); char *p = buf;
WRITESINT8(p, voted);
SendNetXCmd(XD_MODIFYVOTE, &buf, 1); SendNetXCmd(XD_MODIFYVOTE, &buf, 1);
} }
void D_PickVote(void) void D_PickVote(void)
{ {
XBOXSTATIC UINT8 buf[2]; char buf[2];
UINT8 temppicks[MAXPLAYERS]; char* p = buf;
UINT8 templevels[MAXPLAYERS]; SINT8 temppicks[MAXPLAYERS];
SINT8 templevels[MAXPLAYERS];
UINT8 numvotes = 0, key = 0; UINT8 numvotes = 0, key = 0;
INT32 i; INT32 i;
@ -1994,16 +1995,16 @@ void D_PickVote(void)
continue; continue;
if (votes[i] != -1) if (votes[i] != -1)
{ {
temppicks[numvotes] = (UINT8)i; temppicks[numvotes] = i;
templevels[numvotes] = (UINT8)votes[i]; templevels[numvotes] = votes[i];
numvotes++; numvotes++;
} }
} }
key = M_RandomKey(numvotes); key = M_RandomKey(numvotes);
buf[0] = temppicks[key]; WRITESINT8(p, temppicks[key]);
buf[1] = templevels[key]; WRITESINT8(p, templevels[key]);
SendNetXCmd(XD_PICKVOTE, &buf, 2); SendNetXCmd(XD_PICKVOTE, &buf, 2);
} }
@ -4599,14 +4600,14 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum)
static void Got_ModifyVotecmd(UINT8 **cp, INT32 playernum) static void Got_ModifyVotecmd(UINT8 **cp, INT32 playernum)
{ {
INT8 voted = READUINT8(*cp); SINT8 voted = READSINT8(*cp);
votes[playernum] = (INT8)(voted-1); votes[playernum] = voted;
} }
static void Got_PickVotecmd(UINT8 **cp, INT32 playernum) static void Got_PickVotecmd(UINT8 **cp, INT32 playernum)
{ {
INT8 pick = READUINT8(*cp); SINT8 pick = READSINT8(*cp);
INT8 level = READUINT8(*cp); SINT8 level = READSINT8(*cp);
if (playernum != serverplayer && !IsPlayerAdmin(playernum)) if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{ {
@ -4622,7 +4623,7 @@ static void Got_PickVotecmd(UINT8 **cp, INT32 playernum)
return; return;
} }
Y_SetupVoteFinish((INT8)pick, (INT8)level); Y_SetupVoteFinish(pick, level);
} }
/** Prints the number of the displayplayer. /** Prints the number of the displayplayer.
@ -4712,7 +4713,7 @@ static void Command_RestartAudio_f(void)
I_ShutdownSound(); I_ShutdownSound();
I_StartupSound(); I_StartupSound();
I_InitMusic(); I_InitMusic();
// These must be called or no sound and music until manually set. // These must be called or no sound and music until manually set.
I_SetSfxVolume(cv_soundvolume.value); I_SetSfxVolume(cv_soundvolume.value);
@ -4720,7 +4721,7 @@ static void Command_RestartAudio_f(void)
I_SetMIDIMusicVolume(cv_midimusicvolume.value); I_SetMIDIMusicVolume(cv_midimusicvolume.value);
if (Playing()) // Gotta make sure the player is in a level if (Playing()) // Gotta make sure the player is in a level
P_RestoreMusic(&players[consoleplayer]); P_RestoreMusic(&players[consoleplayer]);
} }
/** Quits a game and returns to the title screen. /** Quits a game and returns to the title screen.

View File

@ -252,7 +252,7 @@ void Command_Retry_f(void);
void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore
void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect); void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect);
void D_SetupVote(void); void D_SetupVote(void);
void D_ModifyClientVote(INT8 voted); void D_ModifyClientVote(SINT8 voted);
void D_PickVote(void); void D_PickVote(void);
void ObjectPlace_OnChange(void); void ObjectPlace_OnChange(void);
boolean IsPlayerAdmin(INT32 playernum); boolean IsPlayerAdmin(INT32 playernum);

View File

@ -7017,6 +7017,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_BOMBEXPLOSIONSOUND", "MT_BOMBEXPLOSIONSOUND",
"MT_SMOLDERING", // New explosion "MT_SMOLDERING", // New explosion
"MT_BOOMEXPLODE",
"MT_BOOMPARTICLE", "MT_BOOMPARTICLE",
"MT_BLUELIGHTNING", // Lightning stuff "MT_BLUELIGHTNING", // Lightning stuff

View File

@ -254,7 +254,7 @@ typedef struct
// SRB2kart // SRB2kart
//boolean automap; ///< Displays a level's white map outline in modified games //boolean automap; ///< Displays a level's white map outline in modified games
fixed_t mobj_scale; ///< Replacement for TOL_ERZ3 fixed_t mobj_scale; ///< Replacement for TOL_ERZ3
// Lua stuff. // Lua stuff.
// (This is not ifdeffed so the map header structure can stay identical, just in case.) // (This is not ifdeffed so the map header structure can stay identical, just in case.)
@ -450,8 +450,8 @@ extern boolean comebackshowninfo;
extern tic_t curlap, bestlap; extern tic_t curlap, bestlap;
extern INT16 votelevels[4]; extern INT16 votelevels[4];
extern INT8 votes[MAXPLAYERS]; extern SINT8 votes[MAXPLAYERS];
extern INT8 pickedvote; extern SINT8 pickedvote;
extern tic_t hidetime; extern tic_t hidetime;

View File

@ -249,8 +249,8 @@ boolean comeback; // Battle Mode's karma comeback is on/off
// Voting system // Voting system
INT16 votelevels[4]; // Levels that were rolled by the host INT16 votelevels[4]; // Levels that were rolled by the host
INT8 votes[MAXPLAYERS]; // Each player's vote SINT8 votes[MAXPLAYERS]; // Each player's vote
INT8 pickedvote; // What vote the host rolls SINT8 pickedvote; // What vote the host rolls
// Client-sided variables (NEVER use in anything that needs to be synced with other players) // Client-sided variables (NEVER use in anything that needs to be synced with other players)
boolean legitimateexit; // Did this client actually finish the match? boolean legitimateexit; // Did this client actually finish the match?
@ -1407,7 +1407,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
// drift button // drift button
if (InputDown(gc_drift, ssplayer)) if (InputDown(gc_drift, ssplayer))
cmd->buttons |= BT_DRIFT; cmd->buttons |= BT_DRIFT;
// Lua scriptable buttons // Lua scriptable buttons
if (InputDown(gc_custom1, ssplayer)) if (InputDown(gc_custom1, ssplayer))
cmd->buttons |= BT_CUSTOM1; cmd->buttons |= BT_CUSTOM1;
@ -3142,7 +3142,7 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb
} }
} }
} }
if (isokmap) if (isokmap)
okmaps[numokmaps++] = ix; okmaps[numokmaps++] = ix;
} }

View File

@ -15056,6 +15056,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate S_NULL // raisestate
}, },
{ // MT_BOOMEXPLODE
-1, // doomednum
S_SLOWBOOM1, // 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
1, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
0, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_BOUNCE|MF_SCENERY, // flags
S_NULL // raisestate
},
{ // MT_BOOMPARTICLE { // MT_BOOMPARTICLE
-1, // doomednum -1, // doomednum
S_INVISIBLE, // spawnstate S_INVISIBLE, // spawnstate

View File

@ -3999,6 +3999,7 @@ typedef enum mobj_type
MT_BOMBEXPLOSIONSOUND, MT_BOMBEXPLOSIONSOUND,
MT_SMOLDERING, // New explosion MT_SMOLDERING, // New explosion
MT_BOOMEXPLODE,
MT_BOOMPARTICLE, MT_BOOMPARTICLE,
MT_BLUELIGHTNING, // Lightning stuff MT_BLUELIGHTNING, // Lightning stuff

View File

@ -1712,7 +1712,7 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
} }
// Spawns the purely visual explosion // Spawns the purely visual explosion
void K_SpawnBobombExplosion(mobj_t *source) void K_SpawnBobombExplosion(mobj_t *source, UINT8 color)
{ {
INT32 i, radius, height; INT32 i, radius, height;
mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING); mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING);
@ -1724,6 +1724,9 @@ void K_SpawnBobombExplosion(mobj_t *source)
radius = source->radius>>FRACBITS; radius = source->radius>>FRACBITS;
height = source->height>>FRACBITS; height = source->height>>FRACBITS;
if (!color)
color = SKINCOLOR_RED;
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
{ {
dust = P_SpawnMobj(source->x, source->y, source->z, MT_SMOKE); dust = P_SpawnMobj(source->x, source->y, source->z, MT_SMOKE);
@ -1734,15 +1737,15 @@ void K_SpawnBobombExplosion(mobj_t *source)
truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT, truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT,
source->y + P_RandomRange(-radius, radius)*FRACUNIT, source->y + P_RandomRange(-radius, radius)*FRACUNIT,
source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOSSEXPLODE); source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMEXPLODE);
truc->scale = source->scale*2; truc->scale = source->scale*2;
truc->destscale = source->scale*6; truc->destscale = source->scale*6;
P_SetMobjState(truc, S_SLOWBOOM1);
speed = FixedMul(10*FRACUNIT, source->scale)>>FRACBITS; speed = FixedMul(10*FRACUNIT, source->scale)>>FRACBITS;
truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; truc->momx = P_RandomRange(-speed, speed)*FRACUNIT;
truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; truc->momy = P_RandomRange(-speed, speed)*FRACUNIT;
speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS; speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS;
truc->momz = P_RandomRange(-speed, speed)*FRACUNIT; truc->momz = P_RandomRange(-speed, speed)*FRACUNIT;
truc->color = color;
} }
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
@ -1769,6 +1772,7 @@ void K_SpawnBobombExplosion(mobj_t *source)
if (P_RandomChance(FRACUNIT/2)) if (P_RandomChance(FRACUNIT/2))
truc->momz = -truc->momz; truc->momz = -truc->momz;
truc->tics = TICRATE*2; truc->tics = TICRATE*2;
truc->color = color;
} }
} }

View File

@ -28,7 +28,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source);
void K_ExplodePlayer(player_t *player, mobj_t *source); void K_ExplodePlayer(player_t *player, mobj_t *source);
void K_StealBalloon(player_t *player, player_t *victim, boolean force); void K_StealBalloon(player_t *player, player_t *victim, boolean force);
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source); void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source);
void K_SpawnBobombExplosion(mobj_t *source); void K_SpawnBobombExplosion(mobj_t *source, UINT8 color);
void K_SpawnDriftTrail(player_t *player); void K_SpawnDriftTrail(player_t *player);
void K_DoMushroom(player_t *player, boolean doPFlag, boolean startboost); void K_DoMushroom(player_t *player, boolean doPFlag, boolean startboost);
void K_DoBouncePad(mobj_t *mo, fixed_t vertispeed); void K_DoBouncePad(mobj_t *mo, fixed_t vertispeed);

View File

@ -111,7 +111,7 @@ static UINT8 cheatf_devmode(void)
G_SetGameModified(false); G_SetGameModified(false);
for (i = 0; i < MAXUNLOCKABLES; i++) for (i = 0; i < MAXUNLOCKABLES; i++)
unlockables[i].unlocked = true; unlockables[i].unlocked = true;
devparm = TRUE; devparm = true;
cv_debug |= 0x8000; cv_debug |= 0x8000;
// Refresh secrets menu existing. // Refresh secrets menu existing.

View File

@ -8270,7 +8270,10 @@ void A_BobombExplode(mobj_t *actor)
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), true, 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
K_SpawnBobombExplosion(actor); if (actor->target->player)
K_SpawnBobombExplosion(actor, actor->target->player->skincolor);
else
K_SpawnBobombExplosion(actor, SKINCOLOR_RED);
P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOMBEXPLOSIONSOUND); P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOMBEXPLOSIONSOUND);

View File

@ -3039,11 +3039,22 @@ static boolean P_SceneryZMovement(mobj_t *mo)
switch (mo->type) switch (mo->type)
{ {
case MT_BOOMEXPLODE:
case MT_BOOMPARTICLE: case MT_BOOMPARTICLE:
if ((mo->flags & MF_BOUNCE) && (mo->z <= mo->floorz || mo->z+mo->height >= mo->ceilingz)) if ((mo->flags & MF_BOUNCE) && (mo->z <= mo->floorz || mo->z+mo->height >= mo->ceilingz))
{ {
// set standingslope
P_TryMove(mo, mo->x, mo->y, true);
mo->momz = -mo->momz; mo->momz = -mo->momz;
mo->z += mo->momz; #ifdef ESLOPE
if (mo->standingslope)
{
if (mo->flags & MF_NOCLIPHEIGHT)
mo->standingslope = NULL;
else if (!P_IsObjectOnGround(mo))
P_SlopeLaunch(mo);
}
#endif
S_StartSound(mo, mo->info->activesound); S_StartSound(mo, mo->info->activesound);
} }
break; break;
@ -6728,6 +6739,7 @@ void P_MobjThinker(mobj_t *mobj)
P_SetMobjState(smoke, S_QUICKBOOM1); P_SetMobjState(smoke, S_QUICKBOOM1);
smoke->scale = mobj->scale/2; smoke->scale = mobj->scale/2;
smoke->destscale = mobj->scale; smoke->destscale = mobj->scale;
smoke->color = mobj->color;
} }
else else
{ {

View File

@ -177,7 +177,7 @@ typedef struct
typedef struct typedef struct
{ {
INT8 selection; SINT8 selection;
UINT8 delay; UINT8 delay;
UINT8 ranim; UINT8 ranim;
UINT8 rtics; UINT8 rtics;
@ -1351,7 +1351,7 @@ void Y_StartIntermission(void)
{ {
// setup time data // setup time data
data.coop.tics = players[consoleplayer].realtime; data.coop.tics = players[consoleplayer].realtime;
// Update visitation flags // Update visitation flags
mapvisited[gamemap-1] |= MV_BEATEN; mapvisited[gamemap-1] |= MV_BEATEN;
if (ALL7EMERALDS(emeralds)) if (ALL7EMERALDS(emeralds))
@ -1364,7 +1364,7 @@ void Y_StartIntermission(void)
if (modeattacking == ATTACKING_RECORD) if (modeattacking == ATTACKING_RECORD)
Y_UpdateRecordReplays(); Y_UpdateRecordReplays();
} }
// Calculate who won // Calculate who won
Y_CalculateTournamentPoints(); Y_CalculateTournamentPoints();
@ -2497,7 +2497,7 @@ static void Y_UnloadVoteData(void)
// //
// Y_SetupVoteFinish // Y_SetupVoteFinish
// //
void Y_SetupVoteFinish(INT8 pick, INT8 level) void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
{ {
if (pickedvote == -1) if (pickedvote == -1)
{ {

View File

@ -21,7 +21,7 @@ void Y_VoteDrawer(void);
void Y_VoteTicker(void); void Y_VoteTicker(void);
void Y_StartVote(void); void Y_StartVote(void);
void Y_EndVote(void); void Y_EndVote(void);
void Y_SetupVoteFinish(INT8 pick, INT8 level); void Y_SetupVoteFinish(SINT8 pick, SINT8 level);
typedef enum typedef enum
{ {