- converted the rest of actors/shared.

- moved damagetype definitions to MAPINFO. These were in DECORATE which is not correct. The old code is left for compatibility.
This commit is contained in:
Christoph Oelckers 2016-10-14 10:46:15 +02:00
commit 9e2830a3db
44 changed files with 1042 additions and 794 deletions

View file

@ -817,3 +817,43 @@ int DamageTypeDefinition::ApplyMobjDamageFactor(int damage, FName type, DmgFacto
double factor = GetMobjDamageFactor(type, factors);
return int(damage * factor);
}
//==========================================================================
//
// Reads a damage definition
//
//==========================================================================
void FMapInfoParser::ParseDamageDefinition()
{
sc.MustGetString();
FName damageType = sc.String;
DamageTypeDefinition dtd;
ParseOpenBrace();
while (sc.MustGetAnyToken(), sc.TokenType != '}')
{
if (sc.Compare("FACTOR"))
{
sc.MustGetStringName("=");
sc.MustGetFloat();
dtd.DefaultFactor = sc.Float;
if (dtd.DefaultFactor == 0) dtd.ReplaceFactor = true;
}
else if (sc.Compare("REPLACEFACTOR"))
{
dtd.ReplaceFactor = true;
}
else if (sc.Compare("NOARMOR"))
{
dtd.NoArmor = true;
}
else
{
sc.ScriptError("Unexpected data (%s) in damagetype definition.", sc.String);
}
}
dtd.Apply(damageType);
}