- Added Karate Chris's 'sv_degeneration' submission.

- Fixed: 'Bot joined the team' message was passing an FString to Printf.


SVN r627 (trunk)
This commit is contained in:
Christoph Oelckers 2007-12-23 17:03:52 +00:00
parent 154e21d9e7
commit e5ed1c4be3
6 changed files with 20 additions and 2 deletions

View File

@ -1,4 +1,6 @@
December 23, 2007 (Changes by Graf Zahl)
- Added Karate Chris's 'sv_degeneration' submission.
- Fixed: 'Bot joined the team' message was passing an FString to Printf.
- Backported GZDoom's true color font mappings for use with native textures
when the time comes.
- Added Karate Chris's 'sv_doubleammo' submission.

View File

@ -377,7 +377,7 @@ void DCajunMaster::DoAddBot (int bnum, char *info)
botingame[bnum] = true;
if (teamplay)
Printf ("%s joined the %s team\n", players[bnum].userinfo.netname, teams[players[bnum].userinfo.team].name);
Printf ("%s joined the %s team\n", players[bnum].userinfo.netname, teams[players[bnum].userinfo.team].name.GetChars ());
else
Printf ("%s joined the game\n", players[bnum].userinfo.netname);

View File

@ -389,6 +389,7 @@ CVAR (Flag, sv_nocrouch, dmflags, DF_NO_CROUCH);
CVAR (Int, dmflags2, 0, CVAR_SERVERINFO);
CVAR (Flag, sv_weapondrop, dmflags2, DF2_YES_WEAPONDROP);
CVAR (Flag, sv_doubleammo, dmflags2, DF2_YES_DOUBLEAMMO);
CVAR (Flag, sv_degeneration, dmflags2, DF2_YES_DEGENERATION);
CVAR (Flag, sv_nobfgaim, dmflags2, DF2_NO_FREEAIMBFG);
CVAR (Flag, sv_respawnprotect, dmflags2, DF2_YES_INVUL);
CVAR (Flag, sv_barrelrespawn, dmflags2, DF2_BARRELS_RESPAWN);

View File

@ -249,7 +249,7 @@ enum
DF2_YES_DOUBLEAMMO = 1 << 10, // Doubles ammo like skill 1 and 5 do
//#define DF2_NO_CLEARFRAGS 2048 // Don't clear frags after each level
//#define DF2_FORCE_NORESPAWN 4096 // Player cannot respawn
//#define DF2_YES_DEGENERATION 8192 // Quake-style degeneration
DF2_YES_DEGENERATION = 1 << 13, // Quake-style degeneration
//#define DF2_YES_LOSEFRAG 16384 // Lose a frag when killed. More incentive to try to
// // not get yerself killed
DF2_NO_FREEAIMBFG = 1 << 15, // Don't allow BFG to be aimed at the ground

View File

@ -1019,6 +1019,7 @@ static menuitem_t DMFlagsItems[] = {
{ bitflag, "Items respawn", {&dmflags}, {0}, {0}, {0}, {(value_t *)DF_ITEMS_RESPAWN} },
{ bitflag, "Big powerups respawn", {&dmflags}, {0}, {0}, {0}, {(value_t *)DF_RESPAWN_SUPER} },
{ bitflag, "Fast monsters", {&dmflags}, {0}, {0}, {0}, {(value_t *)DF_FAST_MONSTERS} },
{ bitflag, "Degeneration", {&dmflags2}, {0}, {0}, {0}, {(value_t *)DF2_YES_DEGENERATION} },
{ bitflag, "Allow jump", {&dmflags}, {1}, {0}, {0}, {(value_t *)DF_NO_JUMP} },
{ bitflag, "Allow crouch", {&dmflags}, {1}, {0}, {0}, {(value_t *)DF_NO_CROUCH} },
{ bitflag, "Allow freelook", {&dmflags}, {1}, {0}, {0}, {(value_t *)DF_NO_FREELOOK} },

View File

@ -2196,6 +2196,20 @@ void P_PlayerThink (player_t *player)
}
}
// Apply degeneration.
if (dmflags2 & DF2_YES_DEGENERATION)
{
if ((gametic % TICRATE) == 0 && player->health > deh.MaxHealth)
{
if (player->health - 5 < deh.MaxHealth)
player->health = deh.MaxHealth;
else
player->health--;
player->mo->health = player->health;
}
}
// Handle air supply
if (level.airsupply > 0)
{