2022-01-23 10:58:54 +00:00
|
|
|
|
2022-11-12 19:17:16 +00:00
|
|
|
enum EClipMask
|
|
|
|
{
|
|
|
|
CLIPMASK0 = (1 << 16) + 1,
|
|
|
|
CLIPMASK1 = (256 << 16) + 64
|
|
|
|
};
|
|
|
|
|
2022-11-21 07:15:41 +00:00
|
|
|
enum EHitBits
|
|
|
|
{
|
|
|
|
kHitNone = 0,
|
|
|
|
kHitSector = 0x4000,
|
|
|
|
kHitWall = 0x8000,
|
|
|
|
kHitSprite = 0xC000,
|
|
|
|
kHitVoid = 0x10000, // SW only
|
|
|
|
};
|
|
|
|
|
2022-11-17 17:38:25 +00:00
|
|
|
const MAXPLAYERS = 8;
|
2022-11-19 08:02:40 +00:00
|
|
|
const MAXSTATUS = 1024;
|
2022-11-19 14:40:35 +00:00
|
|
|
const zmaptoworld = (1. / 256.);
|
|
|
|
const maptoworld = (1. / 16.);
|
2022-11-17 17:38:25 +00:00
|
|
|
|
2022-01-23 10:58:54 +00:00
|
|
|
class CoreActor native
|
|
|
|
{
|
2022-11-14 15:31:45 +00:00
|
|
|
const REPEAT_SCALE = 1. / 64.;
|
2022-11-27 22:36:39 +00:00
|
|
|
native sectortype sector; // cannot be read-only, some code calls clipmove directly on this.
|
2022-10-11 15:55:27 +00:00
|
|
|
|
2022-01-23 18:03:14 +00:00
|
|
|
native int16 cstat;
|
2022-02-13 10:38:21 +00:00
|
|
|
//native int16 picnum; // access is disabled to allow later refactoring.
|
2022-11-13 17:55:32 +00:00
|
|
|
native Vector3 pos;
|
2022-11-27 20:00:22 +00:00
|
|
|
native Vector3 opos;
|
2022-01-23 18:03:14 +00:00
|
|
|
native readonly int16 statnum;
|
2022-10-11 15:55:27 +00:00
|
|
|
native int16 intangle;
|
2022-09-01 15:17:06 +00:00
|
|
|
native int16 xint;
|
|
|
|
native int16 yint;
|
|
|
|
native int16 inittype; // inittype, type and flags are for Blood.
|
2022-01-23 18:03:14 +00:00
|
|
|
native int16 lotag, type;
|
|
|
|
native int16 hitag, flags;
|
|
|
|
native int16 extra;
|
|
|
|
native int16 detail;
|
|
|
|
|
|
|
|
native int8 shade;
|
|
|
|
native uint8 pal;
|
2022-10-04 17:06:49 +00:00
|
|
|
native uint8 intclipdist;
|
2022-01-23 18:03:14 +00:00
|
|
|
native uint8 blend;
|
2022-10-07 21:18:36 +00:00
|
|
|
native Vector2 scale;
|
2022-01-23 18:03:14 +00:00
|
|
|
native int8 xoffset;
|
|
|
|
native int8 yoffset;
|
2022-10-11 15:55:27 +00:00
|
|
|
native int16 intowner;
|
2022-01-23 18:03:14 +00:00
|
|
|
native uint16 cstat2;
|
|
|
|
|
|
|
|
native uint mdanimtims;
|
|
|
|
native int16 mdanimcur;
|
|
|
|
native uint8 renderflags;
|
|
|
|
native float alpha;
|
2022-10-04 17:06:49 +00:00
|
|
|
native double clipdist;
|
2022-10-11 15:55:27 +00:00
|
|
|
native double angle;
|
2022-11-30 18:39:06 +00:00
|
|
|
native double pitch;
|
2022-11-12 19:17:16 +00:00
|
|
|
native Vector3 vel;
|
2022-11-21 03:53:52 +00:00
|
|
|
native double viewzoffset;
|
2022-01-23 18:03:14 +00:00
|
|
|
|
2022-11-13 17:47:50 +00:00
|
|
|
native readonly int16 spritesetindex;
|
2022-01-23 18:03:14 +00:00
|
|
|
native readonly int spawnindex;
|
2022-02-13 08:32:17 +00:00
|
|
|
|
|
|
|
native void setpos(Vector3 newpos, bool relink = true);
|
2022-02-20 23:12:51 +00:00
|
|
|
native void copypos(CoreActor newpos, bool relink = true);
|
2022-02-13 08:32:17 +00:00
|
|
|
native void move(Vector3 newpos, bool relink = true);
|
2022-02-20 23:12:51 +00:00
|
|
|
native void backuppos();
|
2022-11-12 19:17:16 +00:00
|
|
|
native void setPosition(Vector3 pos);
|
|
|
|
native void setPositionZ(Vector3 pos);
|
2022-12-01 19:11:38 +00:00
|
|
|
native bool isAwayFromWall(double dist);
|
2022-01-21 00:04:08 +00:00
|
|
|
|
2022-12-02 16:10:50 +00:00
|
|
|
native void ChangeSector(sectortype s, bool forcetail = false);
|
|
|
|
native void ChangeStat(int s, bool forcetail = false);
|
|
|
|
|
2022-11-27 20:00:22 +00:00
|
|
|
native clearscope static double deltaangle(double ang1, double ang2);
|
|
|
|
native clearscope static double absangle(double ang1, double ang2);
|
2022-11-27 22:36:39 +00:00
|
|
|
native clearscope static double Normalize180(double ang);
|
2022-11-27 20:00:22 +00:00
|
|
|
|
2022-01-21 00:04:08 +00:00
|
|
|
int randomFlip()
|
|
|
|
{
|
|
|
|
int r = random(0, 3);
|
|
|
|
if (r == 0) return 0;
|
|
|
|
if (r == 1) return CSTAT_SPRITE_XFLIP;
|
|
|
|
if (r == 2) return CSTAT_SPRITE_YFLIP;
|
|
|
|
return CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP;
|
|
|
|
}
|
|
|
|
|
2022-11-19 18:01:17 +00:00
|
|
|
int randomXFlip()
|
|
|
|
{
|
|
|
|
int r = random(0, 1);
|
|
|
|
if (r == 0) return 0;
|
|
|
|
return CSTAT_SPRITE_XFLIP;
|
|
|
|
}
|
|
|
|
|
2022-01-21 00:04:08 +00:00
|
|
|
|
2022-01-23 18:03:14 +00:00
|
|
|
}
|
2022-11-27 20:00:22 +00:00
|
|
|
|