mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
- added kickback factor skill property.
This commit is contained in:
parent
b0eb19bbc8
commit
7267e608cf
3 changed files with 13 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;
|
||||
|
|
|
@ -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