- decrappification

This commit is contained in:
Christoph Oelckers 2020-06-30 22:59:20 +02:00
parent 2e98b2f8da
commit 4baf065370
4 changed files with 42 additions and 72 deletions

View file

@ -253,7 +253,6 @@ void G_HandleLocalKeys(void);
void G_HandleSpecialKeys(void); void G_HandleSpecialKeys(void);
//void G_SE40(int32_t smoothratio); //void G_SE40(int32_t smoothratio);
void G_UpdatePlayerFromMenu(void); void G_UpdatePlayerFromMenu(void);
void P_DoQuote(int32_t q,DukePlayer_t *p);
void FTA(int q, struct player_struct* p); void FTA(int q, struct player_struct* p);
void P_SetGamePalette(DukePlayer_t* player, uint32_t palid, ESetPalFlags flags); void P_SetGamePalette(DukePlayer_t* player, uint32_t palid, ESetPalFlags flags);

View file

@ -303,7 +303,7 @@ void G_DoCheats(void)
//case CHEAT_RESERVED3: //case CHEAT_RESERVED3:
break; break;
default: default:
P_DoQuote(QUOTE_CHEATS_DISABLED, pPlayer); FTA(QUOTE_CHEATS_DISABLED, pPlayer);
osdcmd_cheatsinfo_stat.cheatnum = -1; osdcmd_cheatsinfo_stat.cheatnum = -1;
return; return;
} }
@ -347,7 +347,7 @@ void G_DoCheats(void)
if (!((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9'))) if (!((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9')))
{ {
pPlayer->cheat_phase = 0; pPlayer->cheat_phase = 0;
// P_DoQuote(QUOTE_46,pPlayer); // FTA(QUOTE_46,pPlayer);
return; return;
} }
@ -435,7 +435,7 @@ void G_DoCheats(void)
if (RRRA) pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 1; if (RRRA) pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 1;
P_DoQuote(QUOTE_CHEAT_ALL_WEAPONS, pPlayer); FTA(QUOTE_CHEAT_ALL_WEAPONS, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
} }
@ -443,7 +443,7 @@ void G_DoCheats(void)
case CHEAT_INVENTORY: case CHEAT_INVENTORY:
G_CheatGetInv(pPlayer); G_CheatGetInv(pPlayer);
P_DoQuote(QUOTE_CHEAT_ALL_INV, pPlayer); FTA(QUOTE_CHEAT_ALL_INV, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
@ -453,7 +453,7 @@ void G_DoCheats(void)
for (int key = 0; key < 5; key++) for (int key = 0; key < 5; key++)
pPlayer->keys[key] = 1; pPlayer->keys[key] = 1;
inputState.keyFlushChars(); inputState.keyFlushChars();
P_DoQuote(QUOTE_CHEAT_ALL_KEYS, pPlayer); FTA(QUOTE_CHEAT_ALL_KEYS, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
@ -464,14 +464,14 @@ void G_DoCheats(void)
case CHEAT_CLIP: case CHEAT_CLIP:
ud.clipping = !ud.clipping; ud.clipping = !ud.clipping;
P_DoQuote(QUOTE_CHEAT_NOCLIP-!ud.clipping, pPlayer); FTA(QUOTE_CHEAT_NOCLIP-!ud.clipping, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
case CHEAT_RESERVED2: case CHEAT_RESERVED2:
if (RR) if (RR)
{ {
P_DoQuote(QUOTE_JETPACK_ON, pPlayer); FTA(QUOTE_JETPACK_ON, pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
} }
else else
@ -483,7 +483,7 @@ void G_DoCheats(void)
return; return;
case CHEAT_ALLEN: case CHEAT_ALLEN:
P_DoQuote(QUOTE_CHEAT_ALLEN, pPlayer); FTA(QUOTE_CHEAT_ALLEN, pPlayer);
pPlayer->cheat_phase = 0; pPlayer->cheat_phase = 0;
inputState.ClearKeyStatus(sc_N); inputState.ClearKeyStatus(sc_N);
return; return;
@ -517,14 +517,14 @@ void G_DoCheats(void)
//if (cheatNum != CHEAT_COMEGETSOME) //if (cheatNum != CHEAT_COMEGETSOME)
//{ //{
P_DoQuote(QUOTE_CHEAT_GODMODE_ON, pPlayer); FTA(QUOTE_CHEAT_GODMODE_ON, pPlayer);
//} //}
//else //else
//{ //{
// Bstrcpy(pStrings[QUOTE_RESERVED4], "Come Get Some!"); // Bstrcpy(pStrings[QUOTE_RESERVED4], "Come Get Some!");
// //
// S_PlaySound(DUKE_GETWEAPON2); // S_PlaySound(DUKE_GETWEAPON2);
// P_DoQuote(QUOTE_RESERVED4, pPlayer); // FTA(QUOTE_RESERVED4, pPlayer);
// G_CheatGetInv(pPlayer); // G_CheatGetInv(pPlayer);
// //
// for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS; weaponNum++) // for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS; weaponNum++)
@ -541,7 +541,7 @@ void G_DoCheats(void)
sprite[pi].extra = max_player_health; sprite[pi].extra = max_player_health;
actor[pi].extra = -1; actor[pi].extra = -1;
pPlayer->last_extra = max_player_health; pPlayer->last_extra = max_player_health;
P_DoQuote(QUOTE_CHEAT_GODMODE_OFF, pPlayer); FTA(QUOTE_CHEAT_GODMODE_OFF, pPlayer);
} }
sprite[pi].extra = max_player_health; sprite[pi].extra = max_player_health;
@ -572,9 +572,9 @@ void G_DoCheats(void)
if (RR) if (RR)
for (int key = 0; key < 5; key++) for (int key = 0; key < 5; key++)
pPlayer->keys[key] = 1; pPlayer->keys[key] = 1;
P_DoQuote(QUOTE_CHEAT_EVERYTHING, pPlayer); FTA(QUOTE_CHEAT_EVERYTHING, pPlayer);
// P_DoQuote(QUOTE_21,pPlayer); // FTA(QUOTE_21,pPlayer);
pPlayer->inven_icon = ICON_FIRSTAID; pPlayer->inven_icon = ICON_FIRSTAID;
end_cheat(pPlayer); end_cheat(pPlayer);
@ -621,13 +621,13 @@ void G_DoCheats(void)
pPlayer->over_shoulder_on ^= 1; pPlayer->over_shoulder_on ^= 1;
CAMERADIST = 0; CAMERADIST = 0;
CAMERACLOCK = (int32_t) totalclock; CAMERACLOCK = (int32_t) totalclock;
// P_DoQuote(QUOTE_CHEATS_DISABLED,pPlayer); // FTA(QUOTE_CHEATS_DISABLED,pPlayer);
} }
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
case CHEAT_TIME: case CHEAT_TIME:
// P_DoQuote(QUOTE_21,pPlayer); // FTA(QUOTE_21,pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
@ -647,7 +647,7 @@ void G_DoCheats(void)
} }
fi.operateforcefields(pPlayer->i, -1); fi.operateforcefields(pPlayer->i, -1);
P_DoQuote(QUOTE_CHEAT_UNLOCK, pPlayer); FTA(QUOTE_CHEAT_UNLOCK, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
@ -663,14 +663,14 @@ void G_DoCheats(void)
if (RR) if (RR)
for(int key = 0; key < 5; key++) for(int key = 0; key < 5; key++)
pPlayer->keys[key] = 1; pPlayer->keys[key] = 1;
P_DoQuote(QUOTE_CHEAT_EVERYTHING, pPlayer); FTA(QUOTE_CHEAT_EVERYTHING, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
case CHEAT_SHOWMAP: // SHOW ALL OF THE MAP TOGGLE; case CHEAT_SHOWMAP: // SHOW ALL OF THE MAP TOGGLE;
gFullMap = !gFullMap; gFullMap = !gFullMap;
P_DoQuote(gFullMap ? QUOTE_SHOW_MAP_ON : QUOTE_SHOW_MAP_OFF, FTA(gFullMap ? QUOTE_SHOW_MAP_ON : QUOTE_SHOW_MAP_OFF,
pPlayer); pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
@ -680,11 +680,11 @@ void G_DoCheats(void)
if (NAM_WW2GI) if (NAM_WW2GI)
{ {
quoteMgr.InitializeQuote(QUOTE_RESERVED4, g_NAMMattCheatQuote); quoteMgr.InitializeQuote(QUOTE_RESERVED4, g_NAMMattCheatQuote);
P_DoQuote(QUOTE_RESERVED4, pPlayer); FTA(QUOTE_RESERVED4, pPlayer);
} }
else else
{ {
P_DoQuote(QUOTE_CHEAT_TODD, pPlayer); FTA(QUOTE_CHEAT_TODD, pPlayer);
} }
end_cheat(pPlayer); end_cheat(pPlayer);
@ -696,7 +696,7 @@ void G_DoCheats(void)
return; return;
case CHEAT_BETA: case CHEAT_BETA:
P_DoQuote(QUOTE_CHEAT_BETA, pPlayer); FTA(QUOTE_CHEAT_BETA, pPlayer);
inputState.ClearKeyStatus(sc_H); inputState.ClearKeyStatus(sc_H);
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
@ -705,7 +705,7 @@ void G_DoCheats(void)
pPlayer->inv_amount[GET_STEROIDS] = 399; pPlayer->inv_amount[GET_STEROIDS] = 399;
if (!RR) if (!RR)
pPlayer->inv_amount[GET_HEATS] = 1200; pPlayer->inv_amount[GET_HEATS] = 1200;
P_DoQuote(QUOTE_CHEAT_STEROIDS, pPlayer); FTA(QUOTE_CHEAT_STEROIDS, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
@ -717,7 +717,7 @@ void G_DoCheats(void)
g_noEnemies = 0; g_noEnemies = 0;
quoteMgr.FormatQuote(QUOTE_RESERVED4, "%s: %s", GStrings("NETMNU_MONSTERS"), s[g_noEnemies]); quoteMgr.FormatQuote(QUOTE_RESERVED4, "%s: %s", GStrings("NETMNU_MONSTERS"), s[g_noEnemies]);
P_DoQuote(QUOTE_RESERVED4, pPlayer); FTA(QUOTE_RESERVED4, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
return; return;
@ -727,7 +727,7 @@ void G_DoCheats(void)
//case CHEAT_RESERVED3: //case CHEAT_RESERVED3:
if (RR) if (RR)
{ {
P_DoQuote(51, pPlayer); FTA(51, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
} }
else else
@ -742,14 +742,14 @@ void G_DoCheats(void)
case CHEAT_RAJOSEPH: case CHEAT_RAJOSEPH:
OnMotorcycle(pPlayer, 0); OnMotorcycle(pPlayer, 0);
pPlayer->ammo_amount[MOTORCYCLE_WEAPON] = max_ammo_amount[MOTORCYCLE_WEAPON]; pPlayer->ammo_amount[MOTORCYCLE_WEAPON] = max_ammo_amount[MOTORCYCLE_WEAPON];
P_DoQuote(126, pPlayer); FTA(126, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
return; return;
case CHEAT_RAMRBILL: case CHEAT_RAMRBILL:
quickkill(pPlayer); quickkill(pPlayer);
P_DoQuote(127, pPlayer); FTA(127, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
return; return;
@ -771,7 +771,7 @@ void G_DoCheats(void)
pPlayer->curr_weapon = KNEE_WEAPON; pPlayer->curr_weapon = KNEE_WEAPON;
pPlayer->nocheat = 1; pPlayer->nocheat = 1;
sprite[pPlayer->i].extra = 1; sprite[pPlayer->i].extra = 1;
P_DoQuote(128, pPlayer); FTA(128, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
return; return;
@ -785,7 +785,7 @@ void G_DoCheats(void)
case CHEAT_RANOCHEAT: case CHEAT_RANOCHEAT:
pPlayer->nocheat = 1; pPlayer->nocheat = 1;
P_DoQuote(130, pPlayer); FTA(130, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
return; return;
@ -810,7 +810,7 @@ void G_DoCheats(void)
sprite[newSprite].xrepeat <<= 2; sprite[newSprite].xrepeat <<= 2;
sprite[newSprite].yrepeat <<= 2; sprite[newSprite].yrepeat <<= 2;
} }
P_DoQuote(139, pPlayer); FTA(139, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
return; return;
@ -819,12 +819,12 @@ void G_DoCheats(void)
if (pPlayer->drink_amt) if (pPlayer->drink_amt)
{ {
pPlayer->drink_amt = 0; pPlayer->drink_amt = 0;
P_DoQuote(132, pPlayer); FTA(132, pPlayer);
} }
else else
{ {
pPlayer->drink_amt = 90; pPlayer->drink_amt = 90;
P_DoQuote(131, pPlayer); FTA(131, pPlayer);
} }
end_cheat(pPlayer); end_cheat(pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
@ -843,7 +843,7 @@ void G_DoCheats(void)
pPlayer->got_access = 7; pPlayer->got_access = 7;
for (int key = 0; key < 5; key++) for (int key = 0; key < 5; key++)
pPlayer->keys[key] = 1; pPlayer->keys[key] = 1;
P_DoQuote(5, pPlayer); FTA(5, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
return; return;
@ -852,12 +852,12 @@ void G_DoCheats(void)
if (pPlayer->sea_sick_stat) if (pPlayer->sea_sick_stat)
{ {
pPlayer->sea_sick_stat = 0; pPlayer->sea_sick_stat = 0;
P_DoQuote(129, pPlayer); FTA(129, pPlayer);
} }
else else
{ {
pPlayer->sea_sick_stat = 1; pPlayer->sea_sick_stat = 1;
P_DoQuote(137, pPlayer); FTA(137, pPlayer);
} }
end_cheat(pPlayer); end_cheat(pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
@ -867,7 +867,7 @@ void G_DoCheats(void)
case CHEAT_RADONUT: case CHEAT_RADONUT:
OnBoat(pPlayer, 0); OnBoat(pPlayer, 0);
pPlayer->ammo_amount[BOAT_WEAPON] = max_ammo_amount[BOAT_WEAPON]; pPlayer->ammo_amount[BOAT_WEAPON] = max_ammo_amount[BOAT_WEAPON];
P_DoQuote(136, pPlayer); FTA(136, pPlayer);
end_cheat(pPlayer); end_cheat(pPlayer);
inputState.keyFlushChars(); inputState.keyFlushChars();
return; return;
@ -897,13 +897,13 @@ void G_DoCheats(void)
{ {
if (ud.player_skill == 4) if (ud.player_skill == 4)
{ {
P_DoQuote(QUOTE_CHEATS_DISABLED, pPlayer); FTA(QUOTE_CHEATS_DISABLED, pPlayer);
pPlayer->cheat_phase = 0; pPlayer->cheat_phase = 0;
} }
else else
{ {
pPlayer->cheat_phase = 1; pPlayer->cheat_phase = 1;
// P_DoQuote(QUOTE_25,pPlayer); // FTA(QUOTE_25,pPlayer);
cheatbuflen = 0; cheatbuflen = 0;
} }
inputState.keyFlushChars(); inputState.keyFlushChars();

View file

@ -1305,14 +1305,14 @@ void G_HandleLocalKeys(void)
{ {
buttonMap.ClearButton(gamefunc_Show_Opponents_Weapon); buttonMap.ClearButton(gamefunc_Show_Opponents_Weapon);
ud.config.ShowOpponentWeapons = ud.showweapons = 1-ud.showweapons; ud.config.ShowOpponentWeapons = ud.showweapons = 1-ud.showweapons;
P_DoQuote(QUOTE_WEAPON_MODE_OFF-ud.showweapons,g_player[screenpeek].ps); FTA(QUOTE_WEAPON_MODE_OFF-ud.showweapons,g_player[screenpeek].ps);
} }
if (buttonMap.ButtonDown(gamefunc_Toggle_Crosshair)) if (buttonMap.ButtonDown(gamefunc_Toggle_Crosshair))
{ {
buttonMap.ClearButton(gamefunc_Toggle_Crosshair); buttonMap.ClearButton(gamefunc_Toggle_Crosshair);
cl_crosshair = !cl_crosshair; cl_crosshair = !cl_crosshair;
P_DoQuote(QUOTE_CROSSHAIR_OFF-cl_crosshair,g_player[screenpeek].ps); FTA(QUOTE_CROSSHAIR_OFF-cl_crosshair,g_player[screenpeek].ps);
} }
if (ud.overhead_on && buttonMap.ButtonDown(gamefunc_Map_Follow_Mode)) if (ud.overhead_on && buttonMap.ButtonDown(gamefunc_Map_Follow_Mode))
@ -1325,7 +1325,7 @@ void G_HandleLocalKeys(void)
ud.foly = g_player[screenpeek].ps->opos.y; ud.foly = g_player[screenpeek].ps->opos.y;
ud.fola = fix16_to_int(g_player[screenpeek].ps->oq16ang); ud.fola = fix16_to_int(g_player[screenpeek].ps->oq16ang);
} }
P_DoQuote(QUOTE_MAP_FOLLOW_OFF+ud.scrollmode,g_player[myconnectindex].ps); FTA(QUOTE_MAP_FOLLOW_OFF+ud.scrollmode,g_player[myconnectindex].ps);
} }
@ -1378,7 +1378,7 @@ void G_HandleLocalKeys(void)
CAMERADIST = 0; CAMERADIST = 0;
CAMERACLOCK = (int32_t) totalclock; CAMERACLOCK = (int32_t) totalclock;
P_DoQuote(QUOTE_VIEW_MODE_OFF + g_player[myconnectindex].ps->over_shoulder_on, g_player[myconnectindex].ps); FTA(QUOTE_VIEW_MODE_OFF + g_player[myconnectindex].ps->over_shoulder_on, g_player[myconnectindex].ps);
} }
} }
@ -2150,36 +2150,7 @@ int G_DoMoveThings(void)
if (g_RTSPlaying > 0) if (g_RTSPlaying > 0)
g_RTSPlaying--; g_RTSPlaying--;
// Name display when aiming at opponents
if (cl_idplayers && (g_netServer || ud.multimode > 1)
)
{
hitdata_t hitData;
DukePlayer_t *const pPlayer = g_player[screenpeek].ps;
for (bssize_t TRAVERSE_CONNECT(i))
if (g_player[i].ps->holoduke_on != -1)
sprite[g_player[i].ps->holoduke_on].cstat ^= 256;
hitscan((vec3_t *)pPlayer, pPlayer->cursectnum, sintable[(fix16_to_int(pPlayer->q16ang) + 512) & 2047],
sintable[fix16_to_int(pPlayer->q16ang) & 2047], fix16_to_int(F16(100) - pPlayer->q16horiz - pPlayer->q16horizoff) << 11, &hitData,
0xffff0030);
for (bssize_t TRAVERSE_CONNECT(i))
if (g_player[i].ps->holoduke_on != -1)
sprite[g_player[i].ps->holoduke_on].cstat ^= 256;
if ((hitData.sprite >= 0) && !(g_player[myconnectindex].ps->gm & MODE_MENU) &&
sprite[hitData.sprite].picnum == TILE_APLAYER)
{
int const playerNum = P_Get(hitData.sprite);
if (playerNum != screenpeek && g_player[playerNum].ps->dead_flag == 0)
{
Printf(PRINT_HIGH|PRINT_NOTIFY, "%s\n", &g_player[playerNum].user_name[0]);
}
}
}
if (g_showShareware > 0) if (g_showShareware > 0)
{ {

View file

@ -563,7 +563,7 @@ int G_EnterLevel(int gameMode)
#ifndef EDUKE32_TOUCH_DEVICES #ifndef EDUKE32_TOUCH_DEVICES
if (VOLUMEONE && ud.level_number == 0 && ud.recstat != 2) if (VOLUMEONE && ud.level_number == 0 && ud.recstat != 2)
P_DoQuote(QUOTE_F1HELP,g_player[myconnectindex].ps); FTA(QUOTE_F1HELP,g_player[myconnectindex].ps);
#endif #endif
for (TRAVERSE_CONNECT(i)) for (TRAVERSE_CONNECT(i))