- floatification of g_shared.

- rewrote FraggleScript's movecamera function because it was utterly incomprehensible.
This commit is contained in:
Christoph Oelckers 2016-03-24 01:46:11 +01:00
commit 4a79602325
30 changed files with 281 additions and 416 deletions

View file

@ -59,10 +59,12 @@ void FMapInfoParser::ParseSkill ()
bool thisisdefault = false;
bool acsreturnisset = false;
skill.AmmoFactor = FRACUNIT;
skill.DoubleAmmoFactor = 2*FRACUNIT;
skill.DropAmmoFactor = -1;
skill.AmmoFactor = 1.;
skill.DoubleAmmoFactor = 2.;
skill.DropAmmoFactor = -1.;
skill.DamageFactor = 1.;
skill.ArmorFactor = 1.;
skill.HealthFactor = 1.;
skill.FastMonsters = false;
skill.SlowMonsters = false;
skill.DisableCheats = false;
@ -71,7 +73,7 @@ void FMapInfoParser::ParseSkill ()
skill.AutoUseHealth = false;
skill.RespawnCounter = 0;
skill.RespawnLimit = 0;
skill.Aggressiveness = FRACUNIT;
skill.Aggressiveness = 1.;
skill.SpawnFilter = 0;
skill.ACSReturn = 0;
skill.MustConfirm = false;
@ -79,12 +81,10 @@ void FMapInfoParser::ParseSkill ()
skill.TextColor = "";
skill.Replace.Clear();
skill.Replaced.Clear();
skill.MonsterHealth = FRACUNIT;
skill.FriendlyHealth = FRACUNIT;
skill.MonsterHealth = 1.;
skill.FriendlyHealth = 1.;
skill.NoPain = false;
skill.ArmorFactor = FRACUNIT;
skill.Infighting = 0;
skill.HealthFactor = FRACUNIT;
sc.MustGetString();
skill.Name = sc.String;
@ -97,19 +97,19 @@ void FMapInfoParser::ParseSkill ()
{
ParseAssign();
sc.MustGetFloat ();
skill.AmmoFactor = FLOAT2FIXED(sc.Float);
skill.AmmoFactor = sc.Float;
}
else if (sc.Compare ("doubleammofactor"))
{
ParseAssign();
sc.MustGetFloat ();
skill.DoubleAmmoFactor = FLOAT2FIXED(sc.Float);
skill.DoubleAmmoFactor = sc.Float;
}
else if (sc.Compare ("dropammofactor"))
{
ParseAssign();
sc.MustGetFloat ();
skill.DropAmmoFactor = FLOAT2FIXED(sc.Float);
skill.DropAmmoFactor = sc.Float;
}
else if (sc.Compare ("damagefactor"))
{
@ -157,7 +157,7 @@ void FMapInfoParser::ParseSkill ()
{
ParseAssign();
sc.MustGetFloat ();
skill.Aggressiveness = FRACUNIT - FLOAT2FIXED(clamp(sc.Float, 0.,1.));
skill.Aggressiveness = 1. - clamp(sc.Float, 0.,1.);
}
else if (sc.Compare("SpawnFilter"))
{
@ -250,13 +250,13 @@ void FMapInfoParser::ParseSkill ()
{
ParseAssign();
sc.MustGetFloat();
skill.MonsterHealth = FLOAT2FIXED(sc.Float);
skill.MonsterHealth = sc.Float;
}
else if (sc.Compare("FriendlyHealth"))
{
ParseAssign();
sc.MustGetFloat();
skill.FriendlyHealth = FLOAT2FIXED(sc.Float);
skill.FriendlyHealth = sc.Float;
}
else if (sc.Compare("NoPain"))
{
@ -266,13 +266,13 @@ void FMapInfoParser::ParseSkill ()
{
ParseAssign();
sc.MustGetFloat();
skill.ArmorFactor = FLOAT2FIXED(sc.Float);
skill.ArmorFactor = sc.Float;
}
else if (sc.Compare("HealthFactor"))
{
ParseAssign();
sc.MustGetFloat();
skill.HealthFactor = FLOAT2FIXED(sc.Float);
skill.HealthFactor = sc.Float;
}
else if (sc.Compare("NoInfighting"))
{
@ -341,16 +341,6 @@ int G_SkillProperty(ESkillProperty prop)
{
switch(prop)
{
case SKILLP_AmmoFactor:
if (dmflags2 & DF2_YES_DOUBLEAMMO)
{
return AllSkills[gameskill].DoubleAmmoFactor;
}
return AllSkills[gameskill].AmmoFactor;
case SKILLP_DropAmmoFactor:
return AllSkills[gameskill].DropAmmoFactor;
case SKILLP_FastMonsters:
return AllSkills[gameskill].FastMonsters || (dmflags & DF_FAST_MONSTERS);
@ -365,9 +355,6 @@ int G_SkillProperty(ESkillProperty prop)
case SKILLP_RespawnLimit:
return AllSkills[gameskill].RespawnLimit;
case SKILLP_Aggressiveness:
return AllSkills[gameskill].Aggressiveness;
case SKILLP_DisableCheats:
return AllSkills[gameskill].DisableCheats;
@ -386,21 +373,9 @@ int G_SkillProperty(ESkillProperty prop)
case SKILLP_ACSReturn:
return AllSkills[gameskill].ACSReturn;
case SKILLP_MonsterHealth:
return AllSkills[gameskill].MonsterHealth;
case SKILLP_FriendlyHealth:
return AllSkills[gameskill].FriendlyHealth;
case SKILLP_NoPain:
return AllSkills[gameskill].NoPain;
case SKILLP_ArmorFactor:
return AllSkills[gameskill].ArmorFactor;
case SKILLP_HealthFactor:
return AllSkills[gameskill].HealthFactor;
case SKILLP_Infight:
// This property also needs to consider the level flags for the same info.
if (level.flags2 & LEVEL2_TOTALINFIGHTING) return 1;
@ -425,9 +400,34 @@ double G_SkillProperty(EFSkillProperty prop)
{
switch (prop)
{
case SKILLP_AmmoFactor:
if (dmflags2 & DF2_YES_DOUBLEAMMO)
{
return AllSkills[gameskill].DoubleAmmoFactor;
}
return AllSkills[gameskill].AmmoFactor;
case SKILLP_DropAmmoFactor:
return AllSkills[gameskill].DropAmmoFactor;
case SKILLP_ArmorFactor:
return AllSkills[gameskill].ArmorFactor;
case SKILLP_HealthFactor:
return AllSkills[gameskill].HealthFactor;
case SKILLP_DamageFactor:
return AllSkills[gameskill].DamageFactor;
break;
case SKILLP_Aggressiveness:
return AllSkills[gameskill].Aggressiveness;
case SKILLP_MonsterHealth:
return AllSkills[gameskill].MonsterHealth;
case SKILLP_FriendlyHealth:
return AllSkills[gameskill].FriendlyHealth;
}
}
return 0;