mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 00:20:51 +00:00
This commit is contained in:
commit
8c46ab40b1
3 changed files with 14 additions and 0 deletions
|
@ -497,6 +497,7 @@ enum EFSkillProperty // floating point properties
|
||||||
SKILLP_Aggressiveness,
|
SKILLP_Aggressiveness,
|
||||||
SKILLP_MonsterHealth,
|
SKILLP_MonsterHealth,
|
||||||
SKILLP_FriendlyHealth,
|
SKILLP_FriendlyHealth,
|
||||||
|
SKILLP_KickbackFactor,
|
||||||
};
|
};
|
||||||
|
|
||||||
int G_SkillProperty(ESkillProperty prop);
|
int G_SkillProperty(ESkillProperty prop);
|
||||||
|
@ -514,6 +515,7 @@ struct FSkillInfo
|
||||||
double DamageFactor;
|
double DamageFactor;
|
||||||
double ArmorFactor;
|
double ArmorFactor;
|
||||||
double HealthFactor;
|
double HealthFactor;
|
||||||
|
double KickbackFactor;
|
||||||
|
|
||||||
bool FastMonsters;
|
bool FastMonsters;
|
||||||
bool SlowMonsters;
|
bool SlowMonsters;
|
||||||
|
|
|
@ -66,6 +66,7 @@ void FMapInfoParser::ParseSkill ()
|
||||||
skill.DamageFactor = 1.;
|
skill.DamageFactor = 1.;
|
||||||
skill.ArmorFactor = 1.;
|
skill.ArmorFactor = 1.;
|
||||||
skill.HealthFactor = 1.;
|
skill.HealthFactor = 1.;
|
||||||
|
skill.KickbackFactor = 1.;
|
||||||
skill.FastMonsters = false;
|
skill.FastMonsters = false;
|
||||||
skill.SlowMonsters = false;
|
skill.SlowMonsters = false;
|
||||||
skill.DisableCheats = false;
|
skill.DisableCheats = false;
|
||||||
|
@ -118,6 +119,12 @@ void FMapInfoParser::ParseSkill ()
|
||||||
sc.MustGetFloat ();
|
sc.MustGetFloat ();
|
||||||
skill.DamageFactor = sc.Float;
|
skill.DamageFactor = sc.Float;
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("kickbackfactor"))
|
||||||
|
{
|
||||||
|
ParseAssign();
|
||||||
|
sc.MustGetFloat();
|
||||||
|
skill.KickbackFactor = sc.Float;
|
||||||
|
}
|
||||||
else if (sc.Compare ("fastmonsters"))
|
else if (sc.Compare ("fastmonsters"))
|
||||||
{
|
{
|
||||||
skill.FastMonsters = true;
|
skill.FastMonsters = true;
|
||||||
|
@ -436,6 +443,9 @@ double G_SkillProperty(EFSkillProperty prop)
|
||||||
case SKILLP_FriendlyHealth:
|
case SKILLP_FriendlyHealth:
|
||||||
return AllSkills[gameskill].FriendlyHealth;
|
return AllSkills[gameskill].FriendlyHealth;
|
||||||
|
|
||||||
|
case SKILLP_KickbackFactor:
|
||||||
|
return AllSkills[gameskill].KickbackFactor;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -501,6 +511,7 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
|
||||||
DoubleAmmoFactor = other.DoubleAmmoFactor;
|
DoubleAmmoFactor = other.DoubleAmmoFactor;
|
||||||
DropAmmoFactor = other.DropAmmoFactor;
|
DropAmmoFactor = other.DropAmmoFactor;
|
||||||
DamageFactor = other.DamageFactor;
|
DamageFactor = other.DamageFactor;
|
||||||
|
KickbackFactor = other.KickbackFactor;
|
||||||
FastMonsters = other.FastMonsters;
|
FastMonsters = other.FastMonsters;
|
||||||
SlowMonsters = other.SlowMonsters;
|
SlowMonsters = other.SlowMonsters;
|
||||||
DisableCheats = other.DisableCheats;
|
DisableCheats = other.DisableCheats;
|
||||||
|
|
|
@ -1212,6 +1212,7 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da
|
||||||
else
|
else
|
||||||
kickback = source->player->ReadyWeapon->Kickback;
|
kickback = source->player->ReadyWeapon->Kickback;
|
||||||
|
|
||||||
|
kickback = int(kickback * G_SkillProperty(SKILLP_KickbackFactor));
|
||||||
if (kickback)
|
if (kickback)
|
||||||
{
|
{
|
||||||
AActor *origin = (source && (flags & DMG_INFLICTOR_IS_PUFF))? source : inflictor;
|
AActor *origin = (source && (flags & DMG_INFLICTOR_IS_PUFF))? source : inflictor;
|
||||||
|
|
Loading…
Reference in a new issue