- add freezetics actor property

This commit is contained in:
Rachael Alexanderson 2022-08-23 12:06:32 -04:00 committed by Rachael Alexanderson
parent 06ee21c51d
commit ca6a2152b9
5 changed files with 13 additions and 1 deletions

View file

@ -1200,6 +1200,8 @@ public:
sector_t *BlockingCeiling; // Sector that blocked the last move (ceiling plane slope)
sector_t *BlockingFloor; // Sector that blocked the last move (floor plane slope)
uint32_t freezetics; // actor has actions completely frozen (including movement) for this many tics, but they still get Tick() calls
int PoisonDamage; // Damage received per tic from poison.
FName PoisonDamageType; // Damage type dealt by poison.
int PoisonDuration; // Duration left for receiving poison damage.

View file

@ -159,6 +159,8 @@ inline DVector3 AActor::Vec3Angle(double length, DAngle angle, double dz, bool a
inline bool AActor::isFrozen() const
{
if (freezetics > 0)
return true;
if (!(flags5 & MF5_NOTIMEFREEZE))
{
auto state = Level->isFrozen();

View file

@ -332,6 +332,7 @@ void AActor::Serialize(FSerializer &arc)
A("damagemultiply", DamageMultiply)
A("waveindexxy", WeaveIndexXY)
A("weaveindexz", WeaveIndexZ)
A("freezetics", freezetics)
A("pdmgreceived", PoisonDamageReceived)
A("pdurreceived", PoisonDurationReceived)
A("ppreceived", PoisonPeriodReceived)
@ -3374,7 +3375,7 @@ bool AActor::IsOkayToAttack (AActor *link)
if (P_CheckSight (this, link))
{
// AMageStaffFX2::IsOkayToAttack had an extra check here, generalized with a flag,
// to only allow the check to succeed if the enemy was in a ~84<EFBFBD> FOV of the player
// to only allow the check to succeed if the enemy was in a ~84 FOV of the player
if (flags3 & MF3_SCREENSEEKER)
{
DAngle angle = absangle(Friend->AngleTo(link), Friend->Angles.Yaw);
@ -3633,6 +3634,11 @@ void AActor::Tick ()
static const uint8_t HereticScrollDirs[4] = { 6, 9, 1, 4 };
static const uint8_t HereticSpeedMuls[5] = { 5, 10, 25, 30, 35 };
if (freezetics > 0)
{
freezetics--;
return;
}
AActor *onmo;

View file

@ -1969,6 +1969,7 @@ DEFINE_FIELD(AActor, BlockingLine)
DEFINE_FIELD(AActor, Blocking3DFloor)
DEFINE_FIELD(AActor, BlockingCeiling)
DEFINE_FIELD(AActor, BlockingFloor)
DEFINE_FIELD(AActor, freezetics)
DEFINE_FIELD(AActor, PoisonDamage)
DEFINE_FIELD(AActor, PoisonDamageType)
DEFINE_FIELD(AActor, PoisonDuration)

View file

@ -258,6 +258,7 @@ class Actor : Thinker native
native int16 lightlevel;
native readonly int SpawnTime;
private native int InventoryID; // internal counter.
native uint freezetics;
meta String Obituary; // Player was killed by this actor
meta String HitObituary; // Player was killed by this actor in melee