mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- added StealthAlpha actor property for defining a minimum visibility value of a stealth monster.
This commit is contained in:
parent
f82ab889b2
commit
321c846d01
4 changed files with 16 additions and 2 deletions
|
@ -258,6 +258,7 @@ PClassActor::PClassActor()
|
|||
FastSpeed = -1.;
|
||||
RDFactor = 1.;
|
||||
SelfDamageFactor = 1.;
|
||||
StealthAlpha = 0.;
|
||||
CameraHeight = INT_MIN;
|
||||
|
||||
DropItems = NULL;
|
||||
|
@ -319,6 +320,7 @@ void PClassActor::DeriveData(PClass *newclass)
|
|||
newa->FastSpeed = FastSpeed;
|
||||
newa->RDFactor = RDFactor;
|
||||
newa->SelfDamageFactor = SelfDamageFactor;
|
||||
newa->StealthAlpha = StealthAlpha;
|
||||
newa->CameraHeight = CameraHeight;
|
||||
newa->HowlSound = HowlSound;
|
||||
newa->BloodType = BloodType;
|
||||
|
|
|
@ -301,6 +301,7 @@ public:
|
|||
double RDFactor; // Radius damage factor
|
||||
double SelfDamageFactor;
|
||||
double CameraHeight; // Height of camera when used as such
|
||||
double StealthAlpha; // Minmum alpha for MF_STEALTH.
|
||||
FSoundID HowlSound; // Sound being played when electrocuted or poisoned
|
||||
FName BloodType; // Blood replacement type
|
||||
FName BloodType2; // Bloopsplatter replacement type
|
||||
|
|
|
@ -322,6 +322,7 @@ DEFINE_FIELD(PClassActor, WoundHealth)
|
|||
DEFINE_FIELD(PClassActor, FastSpeed)
|
||||
DEFINE_FIELD(PClassActor, RDFactor)
|
||||
DEFINE_FIELD(PClassActor, SelfDamageFactor)
|
||||
DEFINE_FIELD(PClassActor, StealthAlpha)
|
||||
DEFINE_FIELD(PClassActor, CameraHeight)
|
||||
DEFINE_FIELD(PClassActor, HowlSound)
|
||||
DEFINE_FIELD(PClassActor, BloodType)
|
||||
|
@ -4100,9 +4101,9 @@ void AActor::Tick ()
|
|||
else if (visdir < 0)
|
||||
{
|
||||
Alpha -= 1.5/TICRATE;
|
||||
if (Alpha < 0)
|
||||
if (Alpha < GetClass()->StealthAlpha)
|
||||
{
|
||||
Alpha = 0;
|
||||
Alpha = GetClass()->StealthAlpha;
|
||||
visdir = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1440,6 +1440,16 @@ DEFINE_PROPERTY(selfdamagefactor, F, Actor)
|
|||
static_cast<PClassActor *>(info)->SelfDamageFactor = i;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
DEFINE_PROPERTY(stealthalpha, F, Actor)
|
||||
{
|
||||
PROP_DOUBLE_PARM(i, 0);
|
||||
assert(info->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
||||
static_cast<PClassActor *>(info)->StealthAlpha = i;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue