2017-01-19 16:40:34 +00:00
|
|
|
// This file contains compatibility wrappers for DECORATE functions with bad parameters or other things that were refactored since the first release.
|
|
|
|
|
|
|
|
extend class Object
|
|
|
|
{
|
2017-03-05 13:03:27 +00:00
|
|
|
deprecated("2.4") static int GameType()
|
2017-01-19 16:40:34 +00:00
|
|
|
{
|
|
|
|
return gameinfo.gametype;
|
|
|
|
}
|
|
|
|
|
2017-03-05 13:03:27 +00:00
|
|
|
deprecated("2.4") static void C_MidPrint(string fontname, string textlabel, bool bold = false)
|
2017-01-19 16:40:34 +00:00
|
|
|
{
|
2017-02-05 12:14:22 +00:00
|
|
|
let f = Font.GetFont(fontname);
|
|
|
|
if (f == null) return;
|
2018-10-31 12:13:32 +00:00
|
|
|
Console.MidPrint(f, textlabel, bold);
|
2017-01-19 16:40:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2016-12-24 13:46:34 +00:00
|
|
|
|
|
|
|
extend class Actor
|
|
|
|
{
|
2018-12-05 17:33:59 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CheckClass
|
|
|
|
//
|
|
|
|
// NON-ACTION function to check a pointer's class.
|
|
|
|
// deprecated because functionality is directly accessible.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
deprecated("3.7") bool CheckClass(class<Actor> checkclass, int ptr_select = AAPTR_DEFAULT, bool match_superclass = false)
|
|
|
|
{
|
|
|
|
let check = GetPointer(ptr_select);
|
|
|
|
if (check == null || checkclass == null)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else if (match_superclass)
|
|
|
|
{
|
|
|
|
return check is checkclass;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return check.GetClass() == checkclass;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// GetDistance
|
|
|
|
//
|
|
|
|
// NON-ACTION function to get the distance in double.
|
|
|
|
// deprecated because it requires AAPTR to work.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
deprecated("3.7") double GetDistance(bool checkz, int ptr = AAPTR_TARGET) const
|
|
|
|
{
|
|
|
|
let target = GetPointer(ptr);
|
|
|
|
|
|
|
|
if (!target || target == self)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
let diff = Vec3To(target);
|
|
|
|
if (checkz)
|
|
|
|
diff.Z += (target.Height - self.Height) / 2;
|
|
|
|
else
|
|
|
|
diff.Z = 0.;
|
|
|
|
|
|
|
|
return diff.Length();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// GetAngle
|
|
|
|
//
|
|
|
|
// NON-ACTION function to get the angle in degrees (normalized to -180..180)
|
|
|
|
// deprecated because it requires AAPTR to work.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
deprecated("3.7") double GetAngle(int flags, int ptr = AAPTR_TARGET)
|
|
|
|
{
|
|
|
|
let target = GetPointer(ptr);
|
|
|
|
|
|
|
|
if (!target || target == self)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
let angto = (flags & GAF_SWITCH) ? target.AngleTo(self) : self.AngleTo(target);
|
|
|
|
let yaw = (flags & GAF_SWITCH) ? target.Angle : self.Angle;
|
|
|
|
if (flags & GAF_RELATIVE) angto = deltaangle(yaw, angto);
|
|
|
|
return angto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// GetSpriteAngle
|
|
|
|
//
|
|
|
|
// NON-ACTION function returns the sprite angle of a pointer.
|
|
|
|
// deprecated because direct access to the data is now possible.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
deprecated("3.7") double GetSpriteAngle(int ptr = AAPTR_DEFAULT)
|
|
|
|
{
|
|
|
|
let target = GetPointer(ptr);
|
|
|
|
return target? target.SpriteAngle : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// GetSpriteRotation
|
|
|
|
//
|
|
|
|
// NON-ACTION function returns the sprite rotation of a pointer.
|
|
|
|
// deprecated because direct access to the data is now possible.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
deprecated("3.7") double GetSpriteRotation(int ptr = AAPTR_DEFAULT)
|
|
|
|
{
|
|
|
|
let target = GetPointer(ptr);
|
|
|
|
return target? target.SpriteRotation : 0;
|
|
|
|
}
|
|
|
|
|
2017-03-05 13:03:27 +00:00
|
|
|
deprecated("2.3") void A_CustomMissile(class<Actor> missiletype, double spawnheight = 32, double spawnofs_xy = 0, double angle = 0, int flags = 0, double pitch = 0, int ptr = AAPTR_TARGET)
|
2016-12-24 13:46:34 +00:00
|
|
|
{
|
|
|
|
A_SpawnProjectile(missiletype, spawnheight, spawnofs_xy, angle, flags|CMF_BADPITCH, pitch, ptr);
|
|
|
|
}
|
2016-12-24 15:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extend class StateProvider
|
|
|
|
{
|
2017-03-05 13:03:27 +00:00
|
|
|
deprecated("2.3") action void A_FireCustomMissile(class<Actor> missiletype, double angle = 0, bool useammo = true, double spawnofs_xy = 0, double spawnheight = 0, int flags = 0, double pitch = 0)
|
2016-12-24 15:34:45 +00:00
|
|
|
{
|
|
|
|
A_FireProjectile(missiletype, angle, useammo, spawnofs_xy, spawnheight, flags, -pitch);
|
|
|
|
}
|
|
|
|
}
|