mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 00:20:51 +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)
|
October 8, 2009 (Changes by Graf Zahl)
|
||||||
|
- Added a PainThreshold actor property.
|
||||||
- fixed: Teleport_EndGame did not set the end sequence name properly.
|
- fixed: Teleport_EndGame did not set the end sequence name properly.
|
||||||
|
|
||||||
October 7, 2009
|
October 7, 2009
|
||||||
|
|
|
@ -842,6 +842,7 @@ public:
|
||||||
fixed_t MaxDropOffHeight, MaxStepHeight;
|
fixed_t MaxDropOffHeight, MaxStepHeight;
|
||||||
SDWORD Mass;
|
SDWORD Mass;
|
||||||
SWORD PainChance;
|
SWORD PainChance;
|
||||||
|
int PainThreshold;
|
||||||
FNameNoInit DamageType;
|
FNameNoInit DamageType;
|
||||||
|
|
||||||
FState *SpawnState;
|
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;
|
pc = target->GetClass()->ActorInfo->PainChances;
|
||||||
painchance = target->PainChance;
|
painchance = target->PainChance;
|
||||||
if (pc != NULL)
|
if (pc != NULL)
|
||||||
|
@ -1279,11 +1284,10 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dopain:
|
if ((damage > target->PainThreshold && pr_damagemobj() < painchance) ||
|
||||||
if (!(target->flags5 & MF5_NOPAIN) && (inflictor == NULL || !(inflictor->flags5 & MF5_PAINLESS)) &&
|
(inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)))
|
||||||
!G_SkillProperty(SKILLP_NoPain) && (pr_damagemobj() < painchance ||
|
|
||||||
(inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))) && !(target->flags & MF_SKULLFLY))
|
|
||||||
{
|
{
|
||||||
|
dopain:
|
||||||
if (mod == NAME_Electric)
|
if (mod == NAME_Electric)
|
||||||
{
|
{
|
||||||
if (pr_lightning() < 96)
|
if (pr_lightning() < 96)
|
||||||
|
@ -1315,6 +1319,7 @@ dopain:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
target->reactiontime = 0; // we're awake now...
|
target->reactiontime = 0; // we're awake now...
|
||||||
if (source)
|
if (source)
|
||||||
{
|
{
|
||||||
|
|
|
@ -301,6 +301,11 @@ void AActor::Serialize (FArchive &arc)
|
||||||
<< Score
|
<< Score
|
||||||
<< Tag;
|
<< Tag;
|
||||||
|
|
||||||
|
if (SaveVersion >= 1900)
|
||||||
|
{
|
||||||
|
arc << PainThreshold;
|
||||||
|
}
|
||||||
|
|
||||||
for(int i=0; i<10; i++) arc << uservar[i];
|
for(int i=0; i<10; i++) arc << uservar[i];
|
||||||
|
|
||||||
if (arc.IsStoring ())
|
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