mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- Added a PainThreshold actor property.
SVN r1900 (trunk)
This commit is contained in:
parent
3900381565
commit
0c2288a010
5 changed files with 56 additions and 34 deletions
|
@ -1,4 +1,5 @@
|
|||
October 8, 2009 (Changes by Graf Zahl)
|
||||
- Added a PainThreshold actor property.
|
||||
- fixed: Teleport_EndGame did not set the end sequence name properly.
|
||||
|
||||
October 7, 2009
|
||||
|
|
|
@ -842,6 +842,7 @@ public:
|
|||
fixed_t MaxDropOffHeight, MaxStepHeight;
|
||||
SDWORD Mass;
|
||||
SWORD PainChance;
|
||||
int PainThreshold;
|
||||
FNameNoInit DamageType;
|
||||
|
||||
FState *SpawnState;
|
||||
|
|
|
@ -1268,6 +1268,11 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (!(target->flags5 & MF5_NOPAIN) && (inflictor == NULL || !(inflictor->flags5 & MF5_PAINLESS)) &&
|
||||
!G_SkillProperty(SKILLP_NoPain) && !(target->flags & MF_SKULLFLY))
|
||||
{
|
||||
|
||||
pc = target->GetClass()->ActorInfo->PainChances;
|
||||
painchance = target->PainChance;
|
||||
if (pc != NULL)
|
||||
|
@ -1279,11 +1284,10 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
}
|
||||
}
|
||||
|
||||
dopain:
|
||||
if (!(target->flags5 & MF5_NOPAIN) && (inflictor == NULL || !(inflictor->flags5 & MF5_PAINLESS)) &&
|
||||
!G_SkillProperty(SKILLP_NoPain) && (pr_damagemobj() < painchance ||
|
||||
(inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))) && !(target->flags & MF_SKULLFLY))
|
||||
if ((damage > target->PainThreshold && pr_damagemobj() < painchance) ||
|
||||
(inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)))
|
||||
{
|
||||
dopain:
|
||||
if (mod == NAME_Electric)
|
||||
{
|
||||
if (pr_lightning() < 96)
|
||||
|
@ -1315,6 +1319,7 @@ dopain:
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
target->reactiontime = 0; // we're awake now...
|
||||
if (source)
|
||||
{
|
||||
|
|
|
@ -301,6 +301,11 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< Score
|
||||
<< Tag;
|
||||
|
||||
if (SaveVersion >= 1900)
|
||||
{
|
||||
arc << PainThreshold;
|
||||
}
|
||||
|
||||
for(int i=0; i<10; i++) arc << uservar[i];
|
||||
|
||||
if (arc.IsStoring ())
|
||||
|
|
|
@ -363,6 +363,16 @@ DEFINE_PROPERTY(painchance, ZI, Actor)
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
DEFINE_PROPERTY(painthreshold, I, Actor)
|
||||
{
|
||||
PROP_INT_PARM(id, 0);
|
||||
|
||||
defaults->PainThreshold = id;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue