- added two new things which can set a sector's color without the need of tags

or scripts. ColorSetter (#9038) sets the sector's color and FadeSetter (#9039)
  sets the fog color.
- added new flags MF5_ALWAYSFAST and MF5_NEVERFAST. These flags unconditionally
  enable or disable fast movement logic, regardless of skill settings.
- added an abstraction layer for skill related settings. This is a preparation
  for implementing custom skill definitions but right now all it does is
  returning the original values but keeping the related information all in one
  place


SVN r557 (trunk)
This commit is contained in:
Christoph Oelckers 2007-10-29 22:15:46 +00:00
commit 170b633e91
19 changed files with 185 additions and 104 deletions

View file

@ -1549,23 +1549,8 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
}
delete map;
if (dmflags & DF_MONSTERS_RESPAWN)
{
respawnmonsters = TICRATE;
}
else if (gameinfo.gametype & (GAME_Doom|GAME_Strife) && gameskill == sk_nightmare)
{
respawnmonsters = TICRATE;
}
else
{
respawnmonsters = 0;
}
// Monsters wait longer before respawning in Strife.
respawnmonsters *= gameinfo.gametype != GAME_Strife ? 12 : 16;
oldSpeed = GameSpeed;
wantFast = (dmflags & DF_FAST_MONSTERS) || (gameskill == sk_nightmare);
wantFast = !!G_SkillProperty(SKILLP_FastMonsters);
GameSpeed = wantFast ? SPEED_Fast : SPEED_Normal;
if (oldSpeed != GameSpeed)
@ -3028,3 +3013,54 @@ static void InitPlayerClasses ()
}
}
}
int G_SkillProperty(ESkillProperty prop)
{
switch(prop)
{
case SKILLP_AmmoFactor:
if (gameskill == sk_baby || (gameskill == sk_nightmare && gameinfo.gametype != GAME_Strife))
{
if (gameinfo.gametype & (GAME_Doom|GAME_Strife))
return FRACUNIT;
else
return FRACUNIT*3/2;
}
return FRACUNIT;
case SKILLP_DamageFactor:
if (gameskill == sk_baby) return FRACUNIT/2;
return FRACUNIT;
case SKILLP_FastMonsters:
return (gameskill == sk_nightmare || (dmflags & DF_FAST_MONSTERS));
case SKILLP_Respawn:
if (dmflags & DF_MONSTERS_RESPAWN ||
gameinfo.gametype & (GAME_DoomStrife) && gameskill == sk_nightmare)
{
return TICRATE * (gameinfo.gametype != GAME_Strife ? 12 : 16);
}
else
{
return 0;
}
case SKILLP_Aggressiveness:
return FRACUNIT;
case SKILLP_DisableCheats:
return gameskill == sk_nightmare;
case SKILLP_AutoUseHealth:
return gameskill == sk_baby;
case SKILLP_EasyBossBrain:
return gameskill == sk_baby;
case SKILLP_SpawnFilter:
return gameskill <= sk_easy? MTF_EASY : gameskill == sk_medium? MTF_NORMAL : MTF_HARD;
}
return 0;
}