mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
Added APROP_DamageMultiply
- Used with Set/GetActorProperty, adds a generic multiplier for damage a source deals.
This commit is contained in:
parent
601852d224
commit
99b2cfa147
5 changed files with 27 additions and 5 deletions
|
@ -971,6 +971,7 @@ public:
|
|||
FNameNoInit DamageType;
|
||||
FNameNoInit DamageTypeReceived;
|
||||
fixed_t DamageFactor;
|
||||
fixed_t DamageMultiply;
|
||||
|
||||
FNameNoInit PainType;
|
||||
FNameNoInit DeathType;
|
||||
|
|
|
@ -3673,6 +3673,7 @@ enum
|
|||
APROP_AttackZOffset = 40,
|
||||
APROP_StencilColor = 41,
|
||||
APROP_Friction = 42,
|
||||
APROP_DamageMultiplier=43,
|
||||
};
|
||||
|
||||
// These are needed for ACS's APROP_RenderStyle
|
||||
|
@ -3862,6 +3863,10 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
|
|||
actor->DamageFactor = value;
|
||||
break;
|
||||
|
||||
case APROP_DamageMultiplier:
|
||||
actor->DamageMultiply = value;
|
||||
break;
|
||||
|
||||
case APROP_MasterTID:
|
||||
AActor *other;
|
||||
other = SingleActorFromTID (value, NULL);
|
||||
|
@ -3933,6 +3938,7 @@ int DLevelScript::GetActorProperty (int tid, int property, const SDWORD *stack,
|
|||
case APROP_Speed: return actor->Speed;
|
||||
case APROP_Damage: return actor->Damage; // Should this call GetMissileDamage() instead?
|
||||
case APROP_DamageFactor:return actor->DamageFactor;
|
||||
case APROP_DamageMultiplier: return actor->DamageMultiply;
|
||||
case APROP_Alpha: return actor->alpha;
|
||||
case APROP_RenderStyle: for (int style = STYLE_None; style < STYLE_Count; ++style)
|
||||
{ // Check for a legacy render style that matches.
|
||||
|
|
|
@ -1065,10 +1065,16 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
|||
}
|
||||
}
|
||||
// Handle active damage modifiers (e.g. PowerDamage)
|
||||
if (source != NULL && source->Inventory != NULL)
|
||||
if (source != NULL)
|
||||
{
|
||||
int olddam = damage;
|
||||
source->Inventory->ModifyDamage(olddam, mod, damage, false);
|
||||
|
||||
damage = FixedMul(damage, source->DamageMultiply);
|
||||
if (source->Inventory != NULL)
|
||||
{
|
||||
source->Inventory->ModifyDamage(olddam, mod, damage, false);
|
||||
}
|
||||
|
||||
if (olddam != damage && damage <= 0)
|
||||
{ // Still allow FORCEPAIN
|
||||
if (MustForcePain(target, inflictor))
|
||||
|
|
|
@ -313,8 +313,16 @@ void AActor::Serialize (FArchive &arc)
|
|||
}
|
||||
arc << lastpush << lastbump
|
||||
<< PainThreshold
|
||||
<< DamageFactor
|
||||
<< WeaveIndexXY << WeaveIndexZ
|
||||
<< DamageFactor;
|
||||
if (SaveVersion >= 4516)
|
||||
{
|
||||
arc << DamageMultiply;
|
||||
}
|
||||
else
|
||||
{
|
||||
DamageMultiply = FRACUNIT;
|
||||
}
|
||||
arc << WeaveIndexXY << WeaveIndexZ
|
||||
<< PoisonDamageReceived << PoisonDurationReceived << PoisonPeriodReceived << Poisoner
|
||||
<< PoisonDamage << PoisonDuration << PoisonPeriod;
|
||||
if (SaveVersion >= 3235)
|
||||
|
@ -3868,6 +3876,7 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
actor->touching_sectorlist = NULL; // NULL head of sector list // phares 3/13/98
|
||||
if (G_SkillProperty(SKILLP_FastMonsters))
|
||||
actor->Speed = actor->GetClass()->Meta.GetMetaFixed(AMETA_FastSpeed, actor->Speed);
|
||||
actor->DamageMultiply = FRACUNIT;
|
||||
|
||||
|
||||
// set subsector and/or block links
|
||||
|
|
|
@ -76,7 +76,7 @@ const char *GetVersionString();
|
|||
|
||||
// Use 4500 as the base git save version, since it's higher than the
|
||||
// SVN revision ever got.
|
||||
#define SAVEVER 4515
|
||||
#define SAVEVER 4516
|
||||
|
||||
#define SAVEVERSTRINGIFY2(x) #x
|
||||
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)
|
||||
|
|
Loading…
Reference in a new issue