Classes:Actor

From ZDoom Wiki
(Redirected from Actor)
Jump to navigation Jump to search
Note: Wait! Stop! Before you copy this actor's definition into your mod, remember the following things:
  1. You do not need to copy that actor, since it is already defined.
  2. In fact, it's not just useless, it's actually harmful as it can cause problems.
  3. If you want to modify it, or use a modified version, using inheritance is the way to go.
  4. The actor definitions here are put on the wiki for reference purpose only. Learn from them, don't copy them.
  5. There is only one exception: if what you want is changing Ammo capacity, you need to create a new type from Ammo.
Actor
Actor type Internal Game MiniZDoomLogoIcon.png (ZDoom)
DoomEd Number None Class Name Actor


Classes: Actor
 →All other classes

Actor (internally AActor) is the base class for all DECORATE actors. When a parent class isn't declared in an actor definition, it uses Actor as the parent.

Actor contains and defines all the code to manage map objects such as decorations, monsters, powerups, players, and many more. It itself is derived from Thinker (internally DThinker), which is the parent class for practically everything physically in the game world that performs special actions -- for example, a door or a crushing ceiling is a Thinker too, but not an Actor. Thinker itself is derived from Object (internally DObject) which is the base class for absolutely everything in the game world. Even an ACS script is an Object.

Most action functions are native to Actor, which means that they are available to all actors (since all actors are derived from Actor). A native action is only available to the actor that declares it, and its inherited actors. Actor and Inventory have therefore an impressive quantity of native codepointers.

DECORATE Actor fields

Actors have a number of special variables. Some can be seen from DECORATE code through DECORATE variables, but have some others as well. The most important are the master, target and tracer pointers. Their significations have varying meanings depending on the type of actor:

Pointer Normal Projectile Area-affecting
master Actor that spawned it n/a n/a
target Current enemy Actor that shot it Actor that is responsible for damage dealt in the area
tracer n/a Enemy at which the actor was shot n/a

When an actor dies, the target field is automatically set to the actor responsible for killing it. This system, a bit hackish, allows to have the damage from a barrel's explosion to be credited to the actor that destroyed the barrel, and that from the explosion of a rocket to be credited to the actor that shot it. Some actors have specific uses for the "n/a" fields, for example an Arch-Vile uses the tracer field to keep track of its flames.

Starting with ZDoom 2.6.0, these fields can be manipulated and accessed, further enhancing their usability.

Other than these pointers and the DECORATE variables, the reactiontime and threshold fields are sometimes used by codepointers. Usually, action functions that change an actor's field are restricted to this actor (and those inheriting from it) to prevent conflicts that could arise between two functions that use the same fields for different purposes.

Methods

Action functions

See: Action functions

Static

  • native clearscope static double DeltaAngle(double ang1, double ang2)
  • native clearscope static double AbsAngle(double ang1, double ang2)
  • native clearscope static Vector2 AngleToVector(double angle, double length = 1)
  • native clearscope static Vector2 RotateVector(Vector2 vec, double angle)
  • native clearscope static double Normalize180(double ang)
  • native clearscope static bool InStateSequence(State newstate, State basestate)
  • native static Actor Spawn(class<Actor> type, vector3 pos = (0,0,0), int replace = NO_REPLACE)
  • native clearscope static class<Actor> GetReplacement(class<Actor> cls)
  • native clearscope static class<Actor> GetReplacee(class<Actor> cls)
  • native static int GetSpriteIndex(name sprt)
  • native clearscope static double GetDefaultSpeed(class<Actor> type)
  • native static class<Actor> GetSpawnableType(int spawnnum)
  • native clearscope static int ApplyDamageFactors(class<Inventory> itemcls, Name damagetype, int damage, int defdamage)

Virtual

  • void MarkPrecacheSounds()
Called when sound variables are to be cached for faster access via those variables (e.g. AttackSound, ActiveSound, etc.). Useful for caching custom sound variables.
Called just after the actor is created and before PostBeginPlay and the first call to Tick.
Called after BeginPlay and before the first call to Tick. This is done before the very first state of an actor is ever reached, useful for performing one-time setups like giving local variables a value, without worrying about a monster being dormant at the start and going to Deactivate instead of Spawn.
Called every tic, 35 times a second. As the name implies, this is what makes an entity 'tick', or operate on its own.
Called when an actor is activated (specific meaning of activation and possible conditions are described here).
Called when an actor is deactivated (specific meaning of deactivation and possible conditions are described here).
Called by projectiles when they're about to hit and deal damage to another actor. Called before TakeSpecialDamage. Heretic's Phoenix Rod missile uses this to tell D'Sparil to teleport away and not take damage when hit by it.
Called from the damage taker when they're about to take damage but haven't yet. The return value is the new damage to be taken. This occurs after all forms of damage modifiers are applied.
  • void Die(Actor source, Actor inflictor, int dmgflags = 0, Name MeansOfDeath = 'none')
Called when an actor is killed (a damaging attack causes an actor's health to fall less than or equal to 0)
  • bool Slam(Actor victim)
Called when an actor that has SKULLFLY set collides with another. Normally called by Lost Souls and Maulotaurs. Returning true tells the caller to ignore the rest of the collision code with the victim it hit while returning false uses standard collision behavior.
  • victim - The actor the caller is colliding with.
  • void Touch(Actor toucher)
Called when an actor with the SPECIAL flag gets touched by another. Normally only used by Inventory and SpectralMonster.
  • bool CanTouchItem(Inventory item)
Called when an actor is touching an item but has not yet picked it up. Returning true tells the engine to touch the item while returning false does the opposite.
  • item - The item the caller is touching.
Called from Inventory's CallTryPickup() before other checks to determine if this actor can receive the item.
Called at the end of Inventory's CallTryPickup(), once the item has been received by the actor. Allows to perform additional behavior when items are received without overriding and copying TryPickup() just to do it.
  • bool CanCollideWith(Actor other, bool passive)
Called when two actors may be capable of colliding with each other. This function is called from both actors involved in the collision. If one of the actors returns false then the engine will act as though the two actors didn't collide. If both return true then standard collision behavior is used.
NOTE: This will only be called if regular actor blocking is not bypassed entirely with the use of flags like THRUACTORS or an object lacking SOLID while not having BLOCKEDBYSOLIDACTORS, etc.
WARNING: This function assumes that the two colliding actors are the same before and after the calls. Do not destroy, damage, or perform any complex alterations of either actor within these calls as doing so may cause memory issues. If you need to perform checks like these when a collision occurs, then use CollidedWith() (development version fc6191d only) instead !
  • other - The actor the caller is potentially colliding with.
  • passive - Used to determine which actor is currently calling the function. If false, the actor that may cause the collision is the current caller.
Called when two actors capable of colliding with each other actually do so. This function is called from both actors involved in the collision.
NOTE: This virtual is called back ONLY when a collision actually occurs. If you want to check and abort a potential collision instead. e.g to stop an actor made of multiple smaller actors from colliding with itself, use CanCollideWith() instead.
  • other - The actor the caller collided with.
  • passive - Used to determine which actor is currently calling the function. If false, the actor that caused the collision is the current caller.
Called any time the actor is about to cross a linedef, this is called after most checks on PIT_CheckLine have ran. Returning false will make the actor be blocked by the line.
NOTE This virtual needs the actor to have the CROSSLINECHECK flag to run.
  • crossing - The line that was checked to see if the actor can cross it.
  • next - The absolute Vector3 coordinates in which the actor will be moved to if the check succeeds.
  • void FallAndSink(double grav, double oldfloorz)
Called when the actor is falling and when sinking inside of deep water based on the Transfer_Heights special or swimmable 3D floors. Can be used in conjunction with the waterdepth and waterlevel variables.
  • grav - The current gravity of the actor, returns the same value as GetGravity.
  • oldfloorz - The absolute floor Z coordinate of the sector that the actor is currently sinking within.
Called right before a dead actor is about to be resurrected. This function is called from both the dead actor and its resurrecter. If one of the actors returns false then the dead actor will not be resurrected. If both return true then standard resurrection behavior is used.
  • bool SpecialBlastHandling(Actor source, double strength)
Called when an actor is to be blasted by a disc of repulsion. If false is returned, the actor will not be blasted. If true, standard blast behavior is used.
  • source - The actor calling the blast function
  • strength - The current strength level of the blast
Called when a missile hits an actor. This is called after all other collision checks. Returning one of the following values will determine what the missile does next:
  • 1: The missile ignores the actor
  • 0: The missile hits but does no special behavior (e.g. won't deal damage, explode, etc.)
  • -1: Uses standard missile hit behavior
  • victim - The actor that was hit by the missile.
Called when a bouncing projectile collides with an actor, line or plane, based on its flags.
  • bool Used(Actor user)
Called when an actor is used by a player with the use button. Returns false if the actor wasn't used, otherwise returning true.
  • class<Actor> GetBloodType(int type)
Returns the class type that the actor's blood uses. This will account for classes that replace it i.e. custom blood types
  • type - The specific blood type to return.
  • 0 - Returns the class type for standard blood
  • 1 - Returns the class type for blood splatters
  • 2 - Returns the class type for axe blood
  • int GetGibHealth()
Returns the health value that an actor will gib at upon death.
  • double GetDeathHeight()
Returns the height of the actor when it dies. This will take special deaths into account if the actor is already dead after calling it.
  • string GetObituary(Actor victim, Actor inflictor, Name mod, bool playerattack)
Returns the appropriate obituary for an actor's death depending on how it died.
  • int OnDrain(Actor victim, int damage, Name dmgtype)
Called when an actor is draining health from another actor. Returns the amount of health to be drained.
  • victim - The actor whose health is being drained.
  • damage - The amount of damage dealt in the attack.
  • dmgtype - The damage type applied to the attack.
  • bool OnGiveSecret(bool printmsg, bool playsound)
Called when an actor discovers a secret. Returning false stops the default message from being displayed.
  • printmsg - Whether or not a message is to be displayed
  • playsound - Whether or not a sound is to be played
  • bool PreTeleport(Vector3 destpos, double destangle, int flags)
Called before an actor is teleported to a new location. Returning false stops the teleport.
  • destpos - The 3D position the actor is being teleported to
  • destangle - The angle the actor wishes to face after teleporting
  • flags - The teleportation flags to use in the action
  • void PostTeleport(Vector3 destpos, double destangle, int flags)
Called after an actor teleports to a new location. Can be used to apply special behavior after the fact.
  • destpos - The 3D position the actor teleported to
  • destangle - The angle the actor faced after teleporting
  • flags - The teleportation flags used in the action
  • bool OkayToSwitchTarget(Actor other)
Checks to see if the actor can switch its target to the new one upon being damaged. Returning false tells the caller not to switch targets
  • other - The new target the caller wants to switch to
  • bool Grind(bool items)
Called when an actor is crushed by the environment (e.g. crushers, Hexen's polyobjects, etc.). Returns true if standard crushing behavior should be used.
  • items - Set to true if dropped items are to be crushed alongside the caller.
  • clearscope int GetMaxHealth(bool withupgrades = false) const
Returns the health an actor spawns with.
  • int DamageMobj(Actor inflictor, Actor source, int damage, Name mod, int flags = 0, double angle = 0)
Called by the actor whenever it takes damage. Returns the amount of damage the caller actually took from the attack.
  • bool ShouldSpawn()
Determines whether an actor should spawn into the map. If false is returned the actor will not be spawned at all.
  • void PlayerLandedMakeGruntSound(Actor onmobj)
(Need more info)
  • void SpawnLineAttackBlood(Actor attacker, Vector3 bleedpos, double SrcAngleFromTarget, int originaldamage, int actualdamage)
Spawns the blood after an actor takes damage from a hitscan attack.
  • attacker - The source of the hitscan attack.
  • bleedpos - The 3D position to spawn the blood.
  • SrcAngleFromTarget - The angle the hitscan attack traveled normalized to a range between -180 and 180 degrees
  • originaldamage - The unmodified damage to deal by the hitscan attack.
  • actualdamage - The actual amount of damage the caller took.
  • void ApplyKickback(Actor inflictor, Actor source, int damage, double angle, Name mod, int flags)
Calle by an actor when it's dealt damage and must be thrusted by the attack.
  • void AddInventory(Inventory item)
Adds an item to the caller's inventory.
  • item - The item to be added to the caller's inventory.
  • void RemoveInventory(Inventory item)
Removes an item from the caller's inventory
  • item - The item to be removed from the caller's inventory.
  • bool UseInventory(Inventory item)
Uses an item in the caller's inventory. Returns true if the item was used successfully.
  • item - The item to be used.
  • void ClearInventory()
Destroys all valid inventory items of the caller.
  • Actor, int, int MorphedDeath()
Called when an actor dies while morphed. Returns three values:
  • A pointer to the original actor before it was morphed.
  • The style of morph of the original actor.
  • The amount of health the original actor has.
  • void PreMorph(Actor mo, bool current)
Called right before an actor morphs on both the original actor and the newly created morph actor.
  • mo - A pointer to the other actor in the morph. If the original actor, this is the morph actor. If the morph actor, this is the original actor.
  • current - True if the caller is the newly created morph actor.
  • void PostMorph(Actor mo, bool current)
Called right after an actor morphs on both the original actor and the newly created morph actor.
  • mo - A pointer to the other actor in the morph. If the original actor, this is the morph actor. If the morph actor, this is the original actor.
  • current - True if the caller is the newly created morph actor.
  • void PreUnmorph(Actor mo, bool current)
Called right before an actor changes back on both the original actor and the morph actor.
  • mo - A pointer to the other actor in the morph. If the original actor, this is the morph actor. If the morph actor, this is the original actor.
  • current - True if the caller is the original actor.
  • void PostUnmorph(Actor mo, bool current)
Called right after an actor changes back on both the original actor and the morph actor.
  • mo - A pointer to the other actor in the morph. If the original actor, this is the morph actor. If the morph actor, this is the original actor.
  • current - True if the caller is the original actor.
  • bool Morph(Actor activator, class<PlayerPawn> playerclass, class<MorphedMonster> monsterclass, int duration = 0, int style = 0, class<Actor> morphflash = null, class<Actor>unmorphflash = null)
Called when a morph function is used. Returns true if the actor was successfully morphed.
  • activator - The actor responsible for the morph. Only used when players are morphing.
  • playerclass - The class type to use if a player is morphing.
  • monsterclass - The class type to use if a monster is morphing.
  • duration - The duration of the morph in tics.
  • style - The style of morphing to use.
  • morphflash - The class type to use when spawning a flash as the actor morphs.
  • unmorphflash- The class type to use when spawning a flash as the actor unmorphs.
  • bool UnMorph(Actor activator, int flags, bool force)
Called when a morphed actor is going to unmorph. Returns true if the actor successfully unmorphed.
  • activator - The actor responsible for the unmorph. Only used when players are unmorphing.
  • flags - The flags to check when a player is unmorphing. Only MRF_STANDARDUNDOING is used by default.
  • force - If true, don't collision check when unmorphing back into the original actor.
  • bool MorphMonster(Class<Actor> spawntype, int duration, int style, Class<Actor> enter_flash, Class<Actor> exit_flash)
Called when a monster is being morphed. Returns true if the monster morphed successfully.
  • spawntype - The class type to use for the newly created morph actor.
  • duration - The duration of the morph in tics.
  • style - The style of morphing to use.
  • enter_flash - The class type to use when spawning a flash as the monster morphs.
  • exit_flash - The class type to use when spawning a flash as the monster unmorphs.

ZScript definition

Note: Due to being overly long, the full definition of the Actor class can be found on GZDoom Github


DECORATE definition

Note: This is legacy code, kept here for reference only. DECORATE is still supported but no longer used by GZDoom. GZDoom internally uses the ZScript definition above.
ACTOR Actor native //: Thinker
{
  Scale 1
  Health 1000
  ReactionTime 8
  Radius 20
  Height 16
  Mass 100
  RenderStyle Normal
  Alpha 1
  MinMissileChance 200
  MeleeRange 44
  MaxDropoffHeight 24
  MaxStepHeight 24
  BounceFactor 0.7
  WallBounceFactor 0.75
  BounceCount -1
  FloatSpeed 4
  FloatBobPhase -1 // randomly initialize by default
  Gravity 1
  DamageFactor 1.0
  PushFactor 0.25
  WeaveIndexXY 0
  WeaveIndexZ 16
  DesignatedTeam 255
  PainType Normal
  DeathType Normal
  TeleFogSourceType "TeleportFog"
  TeleFogDestType "TeleportFog"
  RipperLevel 0
  RipLevelMin 0
  RipLevelMax 0
  DefThreshold 100
  BloodType "Blood", "BloodSplatter", "AxeBlood"
  ExplosionDamage 128
  MissileHeight 32
  SpriteAngle 0
  SpriteRotation 0
  StencilColor "00 00 00"
  VisibleAngles 0, 0
  VisiblePitch 0, 0

  // Functions
  native bool CheckClass(class<Actor> checkclass, int ptr_select = AAPTR_DEFAULT, bool match_superclass = FALSE);
  native int CountInv(class<Inventory> itemtype, int ptr_select = AAPTR_DEFAULT);
  native int CountProximity(class<Actor> classname, float distance, int flags = 0, int ptr = AAPTR_DEFAULT);
  native float GetAngle(int flags, int ptr = AAPTR_DEFAULT);
  native float GetCrouchFactor(int ptr = AAPTR_PLAYER1);
  native float GetCVar(string cvar);
  native float GetDistance(bool checkz, int ptr = AAPTR_DEFAULT);
  native int GetGibHealth();
  native int GetMissileDamage(int mask, int add, int ptr = AAPTR_DEFAULT);
  native int GetPlayerInput(int inputnum, int ptr = AAPTR_DEFAULT);
  native int GetSpawnHealth();
  native float GetSpriteAngle(int ptr = AAPTR_DEFAULT);
  native float GetSpriteRotation(int ptr = AAPTR_DEFAULT);
  native float GetZAt(float px = 0, float py = 0, float angle = 0, int flags = 0, int pick_pointer = AAPTR_DEFAULT);
  native bool IsPointerEqual(int ptr_select1, int ptr_select2);
  action native int OverlayID();
  action native float OverlayX(int layer = 0);
  action native float OverlayY(int layer = 0);

  // Action functions
  action native A_ActiveAndUnblock();
  action native A_ActiveSound();
  action native A_AlertMonsters(float maxdist = 0, int flags = 0);
  action native A_BabyMetal();
  action native A_Bang4Cloud();
  action native A_BarrelDestroy();
  native void A_BasicAttack(int meleedamage, sound meleesound, class<actor> missiletype, float missileheight);
  action native A_BetaSkullAttack();
  action native A_BFGSpray(class<Actor> spraytype = "BFGExtra", int numrays = 40, int damagecount = 15, float angle = 90,
                           float distance = 16*64, float vrange = 32, int damage = 0, int flags = 0);
  action native A_BishopMissileWeave();
  action native A_Blast(int flags = 0, float strength = 255, float radius = 255, float speed = 20, 
                        class<Actor> blasteffect = "BlastEffect", sound blastsound = "BlastRadius");
  action native A_BossDeath();
  action native A_BrainAwake();
  action native A_BrainDie();
  action native A_BrainExplode();
  action native A_BrainPain();
  action native A_BrainScream();
  action native A_BrainSpit(class<Actor> spawntype = "none");   // needs special treatment for default
  action native A_BruisAttack();
  action native A_BspiAttack();
  action native A_BulletAttack();
  native void A_Burst(class<Actor> chunktype);
  native bool A_CallSpecial(int special, int arg1=0, int arg2=0, int arg3=0, int arg4=0, int arg5=0);
  action native A_CentaurDefend();
  native void A_ChangeFlag(string flagname, bool value);
  action native A_ChangeVelocity(float x = 0, float y = 0, float z = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
  action native A_Chase(state melee = "*", state missile = "none", int flags = 0);
  native state A_CheckBlock(state block, int flags = 0, int ptr = AAPTR_DEFAULT, float xofs = 0, float yofs = 0,
                                   float zofs = 0, float angle = 0);
  native state A_CheckCeiling(state label);
  native state A_CheckFlag(string flagname, state label, int check_pointer = AAPTR_DEFAULT);
  native state A_CheckFloor(state label);
  native state A_CheckLOF(state jump, int flags = 0, float range = 0, float minrange = 0, float angle = 0,
                                 float pitch = 0, float offsetheight = 0, float offsetwidth = 0,
                                 int ptr_target = AAPTR_DEFAULT, float offsetforward = 0);
  action native A_CheckPlayerDone();
  native state A_CheckProximity(state jump, class<Actor> classname, float distance, int count = 1, int flags = 0,
                                       int ptr = AAPTR_DEFAULT);
  native state A_CheckRange(float distance, state label, bool two_dimension = false);
  native state A_CheckSight(state label);
  native state A_CheckSightOrRange(float distance, state label, bool two_dimension = false);
  native state A_CheckSpecies(state jump, name species = "", int ptr = AAPTR_DEFAULT);
  action native A_CheckTerrain();
  action native A_ClassBossHealth();
  action native A_ClearLastHeard();
  action native int A_ClearOverlays(int sstart = 0, int sstop = 0, bool safety = TRUE);
  action native A_ClearShadow();
  action native A_ClearSoundTarget();
  action native A_ClearTarget();
  action native A_ComboAttack();
  action native A_CopyFriendliness(int ptr_source = AAPTR_MASTER);
  action native bool A_CopySpriteFrame(int from, int to, int flags = 0);
  action native A_Countdown();
  native void A_CountdownArg(int argnum, state targstate = "");
  action native A_CPosAttack();
  action native A_CPosRefire();
  action native A_CStaffMissileSlither();
  native void A_CustomBulletAttack(float spread_xy, float spread_z, int   numbullets, int damageperbullet, 
                                   class<Actor> pufftype = "BulletPuff", float range = 0, int flags = 0,
                                   int ptr = AAPTR_TARGET, class<Actor> missile = "", float Spawnheight = 32,
                                   float Spawnofs_xy = 0);
  native void A_CustomComboAttack(class<Actor> missiletype, float spawnheight, int damage, sound meleesound = "", 
                                    name damagetype = "none", bool bleed = true);
  action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", 
                                    name damagetype = "none", bool bleed = true);
  native void A_CustomMissile(class<Actor> missiletype, float spawnheight = 32, float spawnofs_xy = 0,
                                float angle = 0, int flags = 0, float pitch = 0, int ptr = AAPTR_TARGET);
  native void A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = "", color color2 = "", int flags = 0, 
                                int aim = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff",
                                float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0,
                                float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", 
                                float spawnofs_z = 0, int spiraloffset = 270, int limit = 0);
  action native A_CyberAttack();
  native void A_DamageChildren(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None",
                                 name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  native void A_DamageMaster(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None",
                               name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  native void A_DamageSelf(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None",
                             int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  native void A_DamageSiblings(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None",
                                 name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  native void A_DamageTarget(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None",
                               name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  native void A_DamageTracer(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None",
                               name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  action native A_DeQueueCorpse();
  action native A_Detonate();
  action native A_Die(name damagetype = "none");
  action native A_DropFire();
  native void A_DropInventory(class<Inventory> itemtype);
  native void A_DropItem(class<Actor> item, int dropamount = -1, int chance = 256);
  native void A_DropWeaponPieces(class<Actor> p1, class<Actor> p2, class<Actor> p3);
  action native A_DualPainAttack(class<Actor> spawntype = "LostSoul");
  action native int A_Explode(int damage = -1, int distance = -1, int flags = XF_HURTSOURCE, bool alert = false,
                          int fulldamagedistance = 0, int nails = 0, int naildamage = 10,
                          class<Actor> pufftype = "BulletPuff", name damagetype = "none");
  native void A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false);
  action native A_FaceConsolePlayer(float MaxTurnAngle = 0); // [TP] no-op
  action native A_FaceMaster(float max_turn = 0, float max_pitch = 270, float ang_offset = 0, float pitch_offset = 0,
                             int flags = 0, float z_ofs = 0);
  action native bool A_FaceMovementDirection(float offset = 0, float anglelimit = 0, float pitchlimit = 0, int flags = 0,
                                             int ptr = AAPTR_DEFAULT);
  action native A_FaceTarget(float max_turn = 0, float max_pitch = 270, float ang_offset = 0, float pitch_offset = 0,
                             int flags = 0, float z_ofs = 0);
  action native A_FaceTracer(float max_turn = 0, float max_pitch = 270, float ang_offset = 0, float pitch_offset = 0,
                             int flags = 0, float z_ofs = 0);
  action native A_FadeIn(float reduce = 0.1, int flags = 0);
  action native A_FadeOut(float reduce = 0.1, int flags = 1);
  native void A_FadeTo(float target, float amount = 0.1, int flags = 0);
  action native A_Fall();
  action native A_FastChase();
  action native A_FatAttack1(class<Actor> spawntype = "FatShot");
  action native A_FatAttack2(class<Actor> spawntype = "FatShot");
  action native A_FatAttack3(class<Actor> spawntype = "FatShot");
  action native A_FatRaise();
  action native A_Feathers();
  action native A_Fire(float spawnheight = 0);
  action native A_FireAssaultGun();
  action native A_FireCrackle();
  action native A_FLoopActiveSound();
  action native A_FreezeDeath();
  action native A_FreezeDeathChunks();
  action native A_GenericFreezeDeath();
  action native A_GetHurt();
  native bool A_GiveInventory(class<Inventory> itemtype, int amount = 0, int giveto = AAPTR_DEFAULT);
  native void A_GiveQuestItem(int itemno);
  native int A_GiveToChildren(class<Inventory> itemtype, int amount = 0);
  native int A_GiveToSiblings(class<Inventory> itemtype, int amount = 0);
  native bool A_GiveToTarget(class<Inventory> itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT);
  action native A_Gravity();
  action native A_HeadAttack();
  action native A_HideThing();
  action native A_Hoof();
  action native A_IceGuyDie();
  native state A_Jump(int chance = 256, state label, ...);
  native state A_JumpIf(bool expression, state label);
  native state A_JumpIfArmorType(name Type, state label, int amount = 1);
  native state A_JumpIfCloser(float distance, state label, bool noz = FALSE);
  native state A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT);
  native state A_JumpIfHigherOrLower(state high, state low, float offsethigh = 0, float offsetlow = 0, bool includeHeight = TRUE,
                                            int ptr = AAPTR_TARGET);
  native state A_JumpIfInTargetInventory(class<Inventory> itemtype, int amount, state label,
                                                int forward_ptr = AAPTR_DEFAULT);
  native state A_JumpIfInTargetLOS(state label, float fov = 0, int flags = 0, float dist_max = 0,
                                          float dist_close = 0);
  native state A_JumpIfInventory(class<Inventory> itemtype, int itemamount, state label,
                                        int owner = AAPTR_DEFAULT);
  native state A_JumpIfMasterCloser(float distance, state label, bool noz = FALSE);
  native state A_JumpIfTargetInLOS(state label, float fov = 0, int flags = 0, float dist_max = 0,
                                          float dist_close = 0);
  native state A_JumpIfTargetInsideMeleeRange(state label);
  native state A_JumpIfTargetOutsideMeleeRange(state label);
  native state A_JumpIfTracerCloser(float distance, state label, bool noz = FALSE);
  action native A_KeenDie(int doortag = 666);
  action native A_KillChildren(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None",
                                 int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  action native A_KillMaster(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None",
                               int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  action native A_KillSiblings(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None",
                                 int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  action native A_KillTarget(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None",
                               int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  action native A_KillTracer(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None",
                               int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
  action native A_KlaxonBlare();
  action native bool A_LineEffect(int boomspecial = 0, int tag = 0);
  native void A_Log(string whattoprint);
  native void A_LogFloat(float whattoprint);
  native void A_LogInt(int whattoprint);
  action native A_Look();
  action native A_Look2();
  action native A_LookEx(int flags = 0, float minseedist = 0, float maxseedist = 0, float maxheardist = 0, 
                         float fov = 0, state label = "");
  action native A_LoopActiveSound();
  action native A_LowGravity();
  action native A_M_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2,
                        class<Actor> pufftype = "BulletPuff");
  action native A_MeleeAttack();
  action native A_Metal();
  action native A_MissileAttack();
  action native A_MonsterRail();
  native state A_MonsterRefire(int chance, state label);
  action native A_Mushroom(class<Actor> spawntype = "FatShot", int numspawns = 0, int flags = 0,
                           float vrange = 4.0, float hrange = 0.5);
  action native A_NoBlocking();
  action native A_NoGravity();
  action native bool A_Overlay(int layer, state start = "", bool nooverride = FALSE);
  action native A_OverlayFlags(int layer, int flags, bool set);
  action native A_OverlayOffset(int layer = PSP_WEAPON, float wx = 0, float wy = 32, int flags = 0);
  action native A_Pain();
  action native A_PainAttack(class<Actor> spawntype = "LostSoul", float angle = 0, int flags = 0, int limit = -1);
  action native A_PainDie(class<Actor> spawntype = "LostSoul");
  action native A_PigPain ();
  action native A_PlayerScream();
  native state A_PlayerSkinCheck(state label);
  action native A_PlaySound(sound whattoplay = "weapons/pistol", int slot = CHAN_BODY, float volume = 1.0,
                            bool looping = false, float attenuation = ATTN_NORM);
  native void A_PlaySoundEx(sound whattoplay, coerce name slot, bool looping = false, int attenuation = 0);
  native void A_PlayWeaponSound(sound whattoplay);
  action native A_PosAttack();
  native void A_Print(string whattoprint, float time = 0, name fontname = "");
  native void A_PrintBold(string whattoprint, float time = 0, name fontname = "");
  action native A_Punch();
  native void A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake");
  native void A_QuakeEx(int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad,
                          sound sfx = "world/quake", int flags = 0, float mulWaveX = 1, float mulWaveY = 1, float mulWaveZ = 1,
                          int falloff = 0, int highpoint = 0, float rollIntensity = 0, float rollWave = 0);
  action native A_QueueCorpse();
  action native A_RadiusDamageSelf(int damage = 128, float distance = 128, int flags = 0, class<Actor> flashtype = "None");
  native int A_RadiusGive(class<Inventory> itemtype, float distance, int flags, int amount = 0, class<Actor> filter = "None",
                             name species = "None", float mindist = 0, int limit = 0);
  action native A_RadiusThrust(int force = 128, int distance = -1, int flags = RTF_AFFECTSOURCE, int fullthrustdistance = 0);
  action native A_RaiseChildren(bool copy = 0);
  action native A_RaiseMaster(bool copy = 0);
  action native A_RaiseSiblings(bool copy = 0);
  native void A_RearrangePointers(int newtarget, int newmaster = AAPTR_DEFAULT, 
                                    int newtracer = AAPTR_DEFAULT, int flags=0);
  native void A_Recoil(float xyvel);
  action native A_RemoveChildren(bool removeall = false, int flags = , class<Actor> filter = "None", name species = "None");
  action native A_RemoveForcefield();
  action native A_RemoveMaster (int flags = 0, class<Actor> filter = "None", name species = "None");
  action native A_RemoveSiblings(bool removeall = false, int flags = 0, class<Actor> filter = "None", name species = "None");
  action native A_RemoveTarget(int flags = 0, class<Actor> filter = "None", name species = "None");
  action native A_RemoveTracer(int flags = 0, class<Actor> filter = "None", name species = "None");
  native void A_Remove(int removee, int flags = 0, class<Actor> filter = "None", name species = "None");
  action native A_ResetHealth(int ptr = AAPTR_DEFAULT);
  action native A_Respawn(int flags = 1);
  action native A_RocketInFlight();
  action native A_SargAttack();
  native void A_ScaleVelocity(float scale, int ptr = AAPTR_DEFAULT);
  action native A_Scream();
  action native A_ScreamAndUnblock();
  native void A_SeekerMissile(int threshold, int turnmax, int flags = 0, int chance = 50, int distance = 10);
  native bool A_SelectWeapon(class<Weapon> whichweapon, int flags = 0);
  action native A_SentinelBob();
  action native A_SentinelRefire();
  action native A_SetAngle(float angle = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
  native void A_SetArg(int pos, int value);
  native void A_SetBlend(color color1, float alpha, int tics, color color2 = "");
  native void A_SetChaseThreshold(int threshold, bool def = FALSE, int ptr = AAPTR_DEFAULT);
  native void A_SetDamageType(name damagetype);
  action native A_SetFloat();
  native void A_SetFloatBobPhase(int bob);
  native void A_SetFloatSpeed(float speed, int ptr = AAPTR_DEFAULT);
  action native A_SetFloorClip();
  native void A_SetGravity(float gravity);
  native void A_SetHealth(int health, int ptr = AAPTR_DEFAULT);
  action native bool A_SetInventory(class<Inventory> itemtype, int amount, int ptr = AAPTR_DEFAULT, bool beyondMax = FALSE);
  action native A_SetInvulnerable();
  native void A_SetMass(int mass);
  native void A_SetPainThreshold(int threshold, int ptr = AAPTR_DEFAULT);
  native void A_SetPitch(float pitch, int flags = 0, int ptr = AAPTR_DEFAULT);
  action native A_SetReflective();
  action native A_SetReflectiveInvulnerable();
  native void A_SetRenderStyle(float alpha, int style);
  native void A_SetRipperLevel(int level);
  native void A_SetRipMin(int minimum);
  native void A_SetRipMax(int maximum);
  native void A_SetRoll(float roll, int flags = 0, int ptr = AAPTR_DEFAULT);
  native void A_SetScale(float scalex, float scaley = 0, int ptr = AAPTR_DEFAULT, bool usezero = FALSE);
  action native A_SetShadow();
  action native A_SetShootable();
  action native A_SetSolid();
  native void A_SetSpecial(int spec, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0);
  native void A_SetSpecies(name species, int ptr = AAPTR_DEFAULT);
  native void A_SetSpeed(float speed, int ptr = AAPTR_DEFAULT);
  action native bool A_SetSpriteAngle(float angle = 0, int ptr = AAPTR_DEFAULT);
  action native bool A_SetSpriteRotation(float angle = 0, int ptr = AAPTR_DEFAULT);
  native void A_SetTeleFog(class<Actor> oldpos, class<Actor> newpos);
  action native A_SetTics(int tics);
  native void A_SetTranslation(string transname);
  native void A_SetTranslucent(float alpha, int style = 0);
  native void A_SetUserArray(name varname, int index, int value);
  native void A_SetUserArrayFloat(name varname, int index, float value);
  native void A_SetUserVar(name varname, int value);
  native void A_SetUserVarFloat(name varname, float value);
  action native bool A_SetVisibleRotation(float anglestart = 0, float angleend = 0, float pitchstart = 0, float pitchend = 0,
                                          int flags = 0, int ptr = AAPTR_DEFAULT);
  action native A_ShootGun();
  action native A_SkelFist();
  action native A_SkelMissile();
  action native A_SkelWhoosh();
  action native A_SkullAttack(float speed = 20);
  action native A_SkullPop(class<PlayerChunk> skulltype = "BloodySkull");
  native void A_SpawnDebris(class<Actor> spawntype, bool transfer_translation = false, 
                              float mult_h = 1, float mult_v = 1);
  action native A_SpawnFly(class<Actor> spawntype = "none");   // needs special treatment for default
  action native bool A_SpawnItem(class<Actor> itemtype = "Unknown", float distance = 0, float zheight = 0,
                                 bool useammo = true, bool transfer_translation = false);
  native bool A_SpawnItemEx(class<Actor> itemtype, float xofs = 0, float yofs = 0, float zofs = 0, float xvel = 0, 
                                   float yvel = 0, float zvel = 0, float angle = 0, int flags = 0, int failchance = 0,
                                   int tid = 0);
  native void A_SpawnParticle(color color1, int flags = 0, int lifetime = 35, float size = 1, float angle = 0, float xoff = 0,
                                float yoff = 0, float zoff = 0, float velx = 0, float vely = 0, float velz = 0, float accelx = 0,
                                float accely = 0, float accelz = 0, float startalphaf = 1, float fadestepf = -1, float sizestep = 0);
  action native A_SpawnSound();
  action native A_SpidRefire();
  action native A_SPosAttack();
  action native A_SPosAttackUseAtkSound();
  action native A_StartFire();
  action native A_Stop();
  action native A_StopSound(int slot = CHAN_VOICE); // Bad default but that's what is originally was...
  native void A_StopSoundEx(coerce name slot);
  action native A_SwapTeleFog();
  native int A_TakeFromChildren(class<Inventory> itemtype, int amount = 0);
  native int A_TakeFromSiblings(class<Inventory> itemtype, int amount = 0);
  native bool A_TakeFromTarget(class<Inventory> itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT);
  native bool A_TakeInventory(class<Inventory> itemtype, int amount = 0, int flags = 0, int giveto = AAPTR_DEFAULT);
  action native state, bool A_Teleport(state teleportstate = "", class<SpecialSpot> targettype = "BossSpot",
                                       class<Actor> fogtype = "TeleportFog", int flags = 0, float mindist = 0, float maxdist = 0,
                                       int ptr = AAPTR_DEFAULT);
  action native bool A_ThrowGrenade(class<Actor> itemtype, float zheight = 0, float xyvel = 0, float zvel = 0,
                                    bool useammo = true);
  action native A_TossGib();
  action native A_Tracer();
  action native A_Tracer2();
  native void A_TransferPointer(int ptr_source, int ptr_recipient, int sourcefield, 
                                  int recipientfield=AAPTR_DEFAULT, int flags=0);
  action native A_TroopAttack();
  action native A_TurretLook();
  action native A_Turn(float angle = 0);
  action native A_UnHideThing();
  action native A_UnsetFloat();
  action native A_UnSetFloorClip();
  action native A_UnSetInvulnerable();
  action native A_UnSetReflective();
  action native A_UnSetReflectiveInvulnerable();
  action native A_UnSetShootable();
  action native A_UnsetSolid();
  action native A_VileAttack(sound snd = "vile/stop", int initialdmg = 20, int blastdmg = 70, int blastradius = 70,
                             float thrustfac = 1.0, name damagetype = "Fire", int flags = 0);
  action native A_VileChase();
  action native A_VileStart();
  action native A_VileTarget(class<Actor> fire = "ArchvileFire");
  action native A_Wander(int flags = 0);
  action native state, bool A_Warp(int ptr_destination, float xofs = 0, float yofs = 0, float zofs = 0, float angle = 0,
                                   int flags = 0, state success_state = "", float heightoffset = 0, float radiusoffset = 0,
                                   float pitch = 0);
  action native A_WeaponOffset(float wx = 0, float wy = 32, int flags = 0);
  native void A_Weave(int xspeed, int yspeed, float xdist, float ydist);
  action native A_WolfAttack(int flags = 0, sound whattoplay = "weapons/pistol", float snipe = 1.0,
                              int maxdamage = 64, int blocksize = 128, int pointblank = 2, int longrange = 4,
                              float runspeed = 160.0, class<Actor> pufftype = "BulletPuff");
  action native A_XScream();
  native int ACS_NamedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0);
  native int ACS_NamedSuspend(name script, int mapnum=0);
  native int ACS_NamedTerminate(name script, int mapnum=0);
  native int ACS_NamedLockedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0);
  native int ACS_NamedLockedExecuteDoor(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0);
  native int ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0);
  native void ACS_NamedExecuteAlways(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0);

  States
  {
  Spawn:
    TNT1 A -1
    Stop
  Null:
    TNT1 A 1
    Stop
  GenericFreezeDeath:
    // Generic freeze death frames. Woo!
    "####" "#" 5 A_GenericFreezeDeath
    "----" A 1 A_FreezeDeathChunks
    Wait
  GenericCrush:
    POL5 A -1
    Stop
  }

  // Internal functions
  native state __decorate_internal_state__(state);
  native int __decorate_internal_int__(int);
  native bool __decorate_internal_bool__(bool);
  native float __decorate_internal_float__(float);
}