mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
- add freezetics actor property
This commit is contained in:
parent
06ee21c51d
commit
ca6a2152b9
5 changed files with 13 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue