- 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:
parent
905e44713f
commit
9e2830a3db
44 changed files with 1042 additions and 794 deletions
40
src/info.cpp
40
src/info.cpp
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue