mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-25 13:31:07 +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_MonsterHealth,
|
||||
SKILLP_FriendlyHealth,
|
||||
SKILLP_KickbackFactor,
|
||||
};
|
||||
|
||||
int G_SkillProperty(ESkillProperty prop);
|
||||
|
@ -514,6 +515,7 @@ struct FSkillInfo
|
|||
double DamageFactor;
|
||||
double ArmorFactor;
|
||||
double HealthFactor;
|
||||
double KickbackFactor;
|
||||
|
||||
bool FastMonsters;
|
||||
bool SlowMonsters;
|
||||
|
|
|
@ -66,6 +66,7 @@ void FMapInfoParser::ParseSkill ()
|
|||
skill.DamageFactor = 1.;
|
||||
skill.ArmorFactor = 1.;
|
||||
skill.HealthFactor = 1.;
|
||||
skill.KickbackFactor = 1.;
|
||||
skill.FastMonsters = false;
|
||||
skill.SlowMonsters = false;
|
||||
skill.DisableCheats = false;
|
||||
|
@ -118,6 +119,12 @@ void FMapInfoParser::ParseSkill ()
|
|||
sc.MustGetFloat ();
|
||||
skill.DamageFactor = sc.Float;
|
||||
}
|
||||
else if (sc.Compare("kickbackfactor"))
|
||||
{
|
||||
ParseAssign();
|
||||
sc.MustGetFloat();
|
||||
skill.KickbackFactor = sc.Float;
|
||||
}
|
||||
else if (sc.Compare ("fastmonsters"))
|
||||
{
|
||||
skill.FastMonsters = true;
|
||||
|
@ -436,6 +443,9 @@ double G_SkillProperty(EFSkillProperty prop)
|
|||
case SKILLP_FriendlyHealth:
|
||||
return AllSkills[gameskill].FriendlyHealth;
|
||||
|
||||
case SKILLP_KickbackFactor:
|
||||
return AllSkills[gameskill].KickbackFactor;
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -501,6 +511,7 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
|
|||
DoubleAmmoFactor = other.DoubleAmmoFactor;
|
||||
DropAmmoFactor = other.DropAmmoFactor;
|
||||
DamageFactor = other.DamageFactor;
|
||||
KickbackFactor = other.KickbackFactor;
|
||||
FastMonsters = other.FastMonsters;
|
||||
SlowMonsters = other.SlowMonsters;
|
||||
DisableCheats = other.DisableCheats;
|
||||
|
|
|
@ -1212,6 +1212,7 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da
|
|||
else
|
||||
kickback = source->player->ReadyWeapon->Kickback;
|
||||
|
||||
kickback = int(kickback * G_SkillProperty(SKILLP_KickbackFactor));
|
||||
if (kickback)
|
||||
{
|
||||
AActor *origin = (source && (flags & DMG_INFLICTOR_IS_PUFF))? source : inflictor;
|
||||
|
|
Loading…
Reference in a new issue