mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 08:30:50 +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.;
|
FastSpeed = -1.;
|
||||||
RDFactor = 1.;
|
RDFactor = 1.;
|
||||||
SelfDamageFactor = 1.;
|
SelfDamageFactor = 1.;
|
||||||
|
StealthAlpha = 0.;
|
||||||
CameraHeight = INT_MIN;
|
CameraHeight = INT_MIN;
|
||||||
|
|
||||||
DropItems = NULL;
|
DropItems = NULL;
|
||||||
|
@ -319,6 +320,7 @@ void PClassActor::DeriveData(PClass *newclass)
|
||||||
newa->FastSpeed = FastSpeed;
|
newa->FastSpeed = FastSpeed;
|
||||||
newa->RDFactor = RDFactor;
|
newa->RDFactor = RDFactor;
|
||||||
newa->SelfDamageFactor = SelfDamageFactor;
|
newa->SelfDamageFactor = SelfDamageFactor;
|
||||||
|
newa->StealthAlpha = StealthAlpha;
|
||||||
newa->CameraHeight = CameraHeight;
|
newa->CameraHeight = CameraHeight;
|
||||||
newa->HowlSound = HowlSound;
|
newa->HowlSound = HowlSound;
|
||||||
newa->BloodType = BloodType;
|
newa->BloodType = BloodType;
|
||||||
|
|
|
@ -301,6 +301,7 @@ public:
|
||||||
double RDFactor; // Radius damage factor
|
double RDFactor; // Radius damage factor
|
||||||
double SelfDamageFactor;
|
double SelfDamageFactor;
|
||||||
double CameraHeight; // Height of camera when used as such
|
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
|
FSoundID HowlSound; // Sound being played when electrocuted or poisoned
|
||||||
FName BloodType; // Blood replacement type
|
FName BloodType; // Blood replacement type
|
||||||
FName BloodType2; // Bloopsplatter replacement type
|
FName BloodType2; // Bloopsplatter replacement type
|
||||||
|
|
|
@ -322,6 +322,7 @@ DEFINE_FIELD(PClassActor, WoundHealth)
|
||||||
DEFINE_FIELD(PClassActor, FastSpeed)
|
DEFINE_FIELD(PClassActor, FastSpeed)
|
||||||
DEFINE_FIELD(PClassActor, RDFactor)
|
DEFINE_FIELD(PClassActor, RDFactor)
|
||||||
DEFINE_FIELD(PClassActor, SelfDamageFactor)
|
DEFINE_FIELD(PClassActor, SelfDamageFactor)
|
||||||
|
DEFINE_FIELD(PClassActor, StealthAlpha)
|
||||||
DEFINE_FIELD(PClassActor, CameraHeight)
|
DEFINE_FIELD(PClassActor, CameraHeight)
|
||||||
DEFINE_FIELD(PClassActor, HowlSound)
|
DEFINE_FIELD(PClassActor, HowlSound)
|
||||||
DEFINE_FIELD(PClassActor, BloodType)
|
DEFINE_FIELD(PClassActor, BloodType)
|
||||||
|
@ -4100,9 +4101,9 @@ void AActor::Tick ()
|
||||||
else if (visdir < 0)
|
else if (visdir < 0)
|
||||||
{
|
{
|
||||||
Alpha -= 1.5/TICRATE;
|
Alpha -= 1.5/TICRATE;
|
||||||
if (Alpha < 0)
|
if (Alpha < GetClass()->StealthAlpha)
|
||||||
{
|
{
|
||||||
Alpha = 0;
|
Alpha = GetClass()->StealthAlpha;
|
||||||
visdir = 0;
|
visdir = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1440,6 +1440,16 @@ DEFINE_PROPERTY(selfdamagefactor, F, Actor)
|
||||||
static_cast<PClassActor *>(info)->SelfDamageFactor = i;
|
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