2006-02-24 04:48:15 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// $Id:$
|
|
|
|
//
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
//
|
|
|
|
// This source is available for distribution and/or modification
|
|
|
|
// only under the terms of the DOOM Source Code License as
|
|
|
|
// published by id Software. All rights reserved.
|
|
|
|
//
|
|
|
|
// The source is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
// DESCRIPTION:
|
|
|
|
// Map Objects, MObj, definition and handling.
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __P_MOBJ_H__
|
|
|
|
#define __P_MOBJ_H__
|
|
|
|
|
|
|
|
// Basics.
|
|
|
|
#include "tables.h"
|
|
|
|
|
|
|
|
// We need the thinker_t stuff.
|
|
|
|
#include "dthinker.h"
|
|
|
|
|
|
|
|
|
2012-07-27 01:53:21 +00:00
|
|
|
// States are tied to finite states are tied to animation frames.
|
2006-02-24 04:48:15 +00:00
|
|
|
#include "info.h"
|
|
|
|
|
|
|
|
#include "doomdef.h"
|
2008-06-15 18:36:26 +00:00
|
|
|
#include "textures/textures.h"
|
2011-07-06 07:35:36 +00:00
|
|
|
#include "r_data/renderstyle.h"
|
2008-06-15 02:25:09 +00:00
|
|
|
#include "s_sound.h"
|
2011-01-12 00:17:13 +00:00
|
|
|
#include "memarena.h"
|
2012-07-27 01:53:21 +00:00
|
|
|
#include "g_level.h"
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2010-08-27 15:20:05 +00:00
|
|
|
struct subsector_t;
|
2006-02-24 04:48:15 +00:00
|
|
|
//
|
|
|
|
// NOTES: AActor
|
|
|
|
//
|
|
|
|
// Actors are used to tell the refresh where to draw an image,
|
|
|
|
// tell the world simulation when objects are contacted,
|
|
|
|
// and tell the sound driver how to position a sound.
|
|
|
|
//
|
|
|
|
// The refresh uses the next and prev links to follow
|
|
|
|
// lists of things in sectors as they are being drawn.
|
|
|
|
// The sprite, frame, and angle elements determine which patch_t
|
|
|
|
// is used to draw the sprite if it is visible.
|
|
|
|
// The sprite and frame values are almost always set
|
|
|
|
// from state_t structures.
|
|
|
|
// The statescr.exe utility generates the states.h and states.c
|
|
|
|
// files that contain the sprite/frame numbers from the
|
|
|
|
// statescr.txt source file.
|
|
|
|
// The xyz origin point represents a point at the bottom middle
|
|
|
|
// of the sprite (between the feet of a biped).
|
|
|
|
// This is the default origin position for patch_ts grabbed
|
|
|
|
// with lumpy.exe.
|
|
|
|
// A walking creature will have its z equal to the floor
|
|
|
|
// it is standing on.
|
|
|
|
//
|
|
|
|
// The sound code uses the x,y, and sometimes z fields
|
|
|
|
// to do stereo positioning of any sound emitted by the actor.
|
|
|
|
//
|
|
|
|
// The play simulation uses the blocklinks, x,y,z, radius, height
|
|
|
|
// to determine when AActors are touching each other,
|
|
|
|
// touching lines in the map, or hit by trace lines (gunshots,
|
|
|
|
// lines of sight, etc).
|
|
|
|
// The AActor->flags element has various bit flags
|
|
|
|
// used by the simulation.
|
|
|
|
//
|
|
|
|
// Every actor is linked into a single sector
|
|
|
|
// based on its origin coordinates.
|
|
|
|
// The subsector_t is found with R_PointInSubsector(x,y),
|
|
|
|
// and the sector_t can be found with subsector->sector.
|
|
|
|
// The sector links are only used by the rendering code,
|
|
|
|
// the play simulation does not care about them at all.
|
|
|
|
//
|
|
|
|
// Any actor that needs to be acted upon by something else
|
|
|
|
// in the play world (block movement, be shot, etc) will also
|
|
|
|
// need to be linked into the blockmap.
|
|
|
|
// If the thing has the MF_NOBLOCK flag set, it will not use
|
|
|
|
// the block links. It can still interact with other things,
|
|
|
|
// but only as the instigator (missiles will run into other
|
|
|
|
// things, but nothing can run into a missile).
|
|
|
|
// Each block in the grid is 128*128 units, and knows about
|
|
|
|
// every line_t that it contains a piece of, and every
|
|
|
|
// interactable actor that has its origin contained.
|
|
|
|
//
|
|
|
|
// A valid actor is an actor that has the proper subsector_t
|
|
|
|
// filled in for its xy coordinates and is linked into the
|
|
|
|
// sector from which the subsector was made, or has the
|
|
|
|
// MF_NOSECTOR flag set (the subsector_t needs to be valid
|
|
|
|
// even if MF_NOSECTOR is set), and is linked into a blockmap
|
|
|
|
// block or has the MF_NOBLOCKMAP flag set.
|
|
|
|
// Links should only be modified by the P_[Un]SetThingPosition()
|
|
|
|
// functions.
|
|
|
|
// Do not change the MF_NO* flags while a thing is valid.
|
|
|
|
//
|
|
|
|
// Any questions?
|
|
|
|
//
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
// --- mobj.flags ---
|
|
|
|
|
2006-11-25 12:25:05 +00:00
|
|
|
MF_SPECIAL = 0x00000001, // call P_SpecialThing when touched
|
|
|
|
MF_SOLID = 0x00000002,
|
|
|
|
MF_SHOOTABLE = 0x00000004,
|
|
|
|
MF_NOSECTOR = 0x00000008, // don't use the sector links
|
|
|
|
// (invisible but touchable)
|
|
|
|
MF_NOBLOCKMAP = 0x00000010, // don't use the blocklinks
|
|
|
|
// (inert but displayable)
|
|
|
|
MF_AMBUSH = 0x00000020, // not activated by sound; deaf monster
|
|
|
|
MF_JUSTHIT = 0x00000040, // try to attack right back
|
|
|
|
MF_JUSTATTACKED = 0x00000080, // take at least one step before attacking
|
|
|
|
MF_SPAWNCEILING = 0x00000100, // hang from ceiling instead of floor
|
|
|
|
MF_NOGRAVITY = 0x00000200, // don't apply gravity every tic
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// movement flags
|
2006-11-25 12:25:05 +00:00
|
|
|
MF_DROPOFF = 0x00000400, // allow jumps from high places
|
|
|
|
MF_PICKUP = 0x00000800, // for players to pick up items
|
|
|
|
MF_NOCLIP = 0x00001000, // player cheat
|
|
|
|
MF_INCHASE = 0x00002000, // [RH] used by A_Chase and A_Look to avoid recursion
|
|
|
|
MF_FLOAT = 0x00004000, // allow moves to any height, no gravity
|
|
|
|
MF_TELEPORT = 0x00008000, // don't cross lines or look at heights
|
|
|
|
MF_MISSILE = 0x00010000, // don't hit same species, explode on block
|
|
|
|
|
|
|
|
MF_DROPPED = 0x00020000, // dropped by a demon, not level spawned
|
|
|
|
MF_SHADOW = 0x00040000, // actor is hard for monsters to see
|
|
|
|
MF_NOBLOOD = 0x00080000, // don't bleed when shot (use puff)
|
|
|
|
MF_CORPSE = 0x00100000, // don't stop moving halfway off a step
|
|
|
|
MF_INFLOAT = 0x00200000, // floating to a height for a move, don't
|
|
|
|
// auto float to target's height
|
|
|
|
MF_INBOUNCE = 0x00200000, // used by Heretic bouncing missiles
|
|
|
|
|
|
|
|
MF_COUNTKILL = 0x00400000, // count towards intermission kill total
|
|
|
|
MF_COUNTITEM = 0x00800000, // count towards intermission item total
|
|
|
|
|
|
|
|
MF_SKULLFLY = 0x01000000, // skull in flight
|
|
|
|
MF_NOTDMATCH = 0x02000000, // don't spawn in death match (key cards)
|
|
|
|
|
|
|
|
MF_SPAWNSOUNDSOURCE = 0x04000000, // Plays missile's see sound at spawning object.
|
|
|
|
MF_FRIENDLY = 0x08000000, // [RH] Friendly monsters for Strife (and MBF)
|
|
|
|
MF_UNMORPHED = 0x10000000, // [RH] Actor is the unmorphed version of something else
|
|
|
|
MF_NOLIFTDROP = 0x20000000, // [RH] Used with MF_NOGRAVITY to avoid dropping with lifts
|
|
|
|
MF_STEALTH = 0x40000000, // [RH] Andy Baker's stealth monsters
|
|
|
|
MF_ICECORPSE = 0x80000000, // a frozen corpse (for blasting) [RH] was 0x800000
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// --- mobj.flags2 ---
|
|
|
|
|
2007-02-24 12:09:36 +00:00
|
|
|
MF2_DONTREFLECT = 0x00000001, // this projectile cannot be reflected
|
2006-02-24 04:48:15 +00:00
|
|
|
MF2_WINDTHRUST = 0x00000002, // gets pushed around by the wind specials
|
2009-05-30 08:56:40 +00:00
|
|
|
MF2_DONTSEEKINVISIBLE=0x00000004, // For seeker missiles: Don't home in on invisible/shadow targets
|
2006-02-24 04:48:15 +00:00
|
|
|
MF2_BLASTED = 0x00000008, // actor will temporarily take damage from impact
|
|
|
|
MF2_FLY = 0x00000010, // fly mode is active
|
|
|
|
MF2_FLOORCLIP = 0x00000020, // if feet are allowed to be clipped
|
|
|
|
MF2_SPAWNFLOAT = 0x00000040, // spawn random float z
|
|
|
|
MF2_NOTELEPORT = 0x00000080, // does not teleport
|
|
|
|
MF2_RIP = 0x00000100, // missile rips through solid targets
|
|
|
|
MF2_PUSHABLE = 0x00000200, // can be pushed by other moving actors
|
|
|
|
MF2_SLIDE = 0x00000400, // slides against walls
|
|
|
|
MF2_ONMOBJ = 0x00000800, // actor is resting on top of another actor
|
|
|
|
MF2_PASSMOBJ = 0x00001000, // Enable z block checking. If on,
|
|
|
|
// this flag will allow the actor to
|
|
|
|
// pass over/under other actors.
|
|
|
|
MF2_CANNOTPUSH = 0x00002000, // cannot push other pushable mobjs
|
|
|
|
MF2_THRUGHOST = 0x00004000, // missile will pass through ghosts [RH] was 8
|
|
|
|
MF2_BOSS = 0x00008000, // mobj is a major boss
|
|
|
|
|
2006-11-29 10:03:35 +00:00
|
|
|
MF2_DONTTRANSLATE = 0x00010000, // Don't apply palette translations
|
2006-02-24 04:48:15 +00:00
|
|
|
MF2_NODMGTHRUST = 0x00020000, // does not thrust target when damaging
|
|
|
|
MF2_TELESTOMP = 0x00040000, // mobj can stomp another
|
|
|
|
MF2_FLOATBOB = 0x00080000, // use float bobbing z movement
|
2009-05-30 08:56:40 +00:00
|
|
|
MF2_THRUACTORS = 0x00100000, // performs no actor<->actor collision checks
|
2006-02-24 04:48:15 +00:00
|
|
|
MF2_IMPACT = 0x00200000, // an MF_MISSILE mobj can activate SPAC_IMPACT
|
|
|
|
MF2_PUSHWALL = 0x00400000, // mobj can push walls
|
|
|
|
MF2_MCROSS = 0x00800000, // can activate monster cross lines
|
|
|
|
MF2_PCROSS = 0x01000000, // can activate projectile cross lines
|
|
|
|
MF2_CANTLEAVEFLOORPIC=0x02000000, // stay within a certain floor type
|
|
|
|
MF2_NONSHOOTABLE = 0x04000000, // mobj is totally non-shootable,
|
|
|
|
// but still considered solid
|
|
|
|
MF2_INVULNERABLE = 0x08000000, // mobj is invulnerable
|
|
|
|
MF2_DORMANT = 0x10000000, // thing is dormant
|
2006-12-02 15:38:50 +00:00
|
|
|
MF2_ARGSDEFINED = 0x20000000, // Internal flag used by DECORATE to signal that the
|
|
|
|
// args should not be taken from the mapthing definition
|
2006-02-24 04:48:15 +00:00
|
|
|
MF2_SEEKERMISSILE = 0x40000000, // is a seeker (for reflection)
|
|
|
|
MF2_REFLECTIVE = 0x80000000, // reflects missiles
|
|
|
|
|
|
|
|
// --- mobj.flags3 ---
|
|
|
|
|
|
|
|
MF3_FLOORHUGGER = 0x00000001, // Missile stays on floor
|
|
|
|
MF3_CEILINGHUGGER = 0x00000002, // Missile stays on ceiling
|
|
|
|
MF3_NORADIUSDMG = 0x00000004, // Actor does not take radius damage
|
|
|
|
MF3_GHOST = 0x00000008, // Actor is a ghost
|
|
|
|
MF3_ALWAYSPUFF = 0x00000010, // Puff always appears, even when hit nothing
|
|
|
|
MF3_SPECIALFLOORCLIP= 0x00000020, // Actor uses floorclip for special effect (e.g. Wraith)
|
|
|
|
MF3_DONTSPLASH = 0x00000040, // Thing doesn't make a splash
|
|
|
|
MF3_NOSIGHTCHECK = 0x00000080, // Go after first acceptable target without checking sight
|
|
|
|
MF3_DONTOVERLAP = 0x00000100, // Don't pass over/under other things with this bit set
|
|
|
|
MF3_DONTMORPH = 0x00000200, // Immune to arti_egg
|
|
|
|
MF3_DONTSQUASH = 0x00000400, // Death ball can't squash this actor
|
|
|
|
MF3_EXPLOCOUNT = 0x00000800, // Don't explode until special2 counts to special1
|
|
|
|
MF3_FULLVOLACTIVE = 0x00001000, // Active sound is played at full volume
|
|
|
|
MF3_ISMONSTER = 0x00002000, // Actor is a monster
|
|
|
|
MF3_SKYEXPLODE = 0x00004000, // Explode missile when hitting sky
|
|
|
|
MF3_STAYMORPHED = 0x00008000, // Monster cannot unmorph
|
|
|
|
MF3_DONTBLAST = 0x00010000, // Actor cannot be pushed by blasting
|
|
|
|
MF3_CANBLAST = 0x00020000, // Actor is not a monster but can be blasted
|
|
|
|
MF3_NOTARGET = 0x00040000, // This actor not targetted when it hurts something else
|
|
|
|
MF3_DONTGIB = 0x00080000, // Don't gib this corpse
|
|
|
|
MF3_NOBLOCKMONST = 0x00100000, // Can cross ML_BLOCKMONSTERS lines
|
|
|
|
MF3_CRASHED = 0x00200000, // Actor entered its crash state
|
|
|
|
MF3_FULLVOLDEATH = 0x00400000, // DeathSound is played full volume (for missiles)
|
2009-09-16 15:54:04 +00:00
|
|
|
MF3_AVOIDMELEE = 0x00800000, // Avoids melee attacks (same as MBF's monster_backing but must be explicitly set)
|
2009-10-09 20:54:28 +00:00
|
|
|
MF3_SCREENSEEKER = 0x01000000, // Fails the IsOkayToAttack test if potential target is outside player FOV
|
2006-02-24 04:48:15 +00:00
|
|
|
MF3_FOILINVUL = 0x02000000, // Actor can hurt MF2_INVULNERABLE things
|
|
|
|
MF3_NOTELEOTHER = 0x04000000, // Monster is unaffected by teleport other artifact
|
|
|
|
MF3_BLOODLESSIMPACT = 0x08000000, // Projectile does not leave blood
|
|
|
|
MF3_NOEXPLODEFLOOR = 0x10000000, // Missile stops at floor instead of exploding
|
|
|
|
MF3_WARNBOT = 0x20000000, // Missile warns bot
|
|
|
|
MF3_PUFFONACTORS = 0x40000000, // Puff appears even when hit bleeding actors
|
|
|
|
MF3_HUNTPLAYERS = 0x80000000, // Used with TIDtoHate, means to hate players too
|
|
|
|
|
|
|
|
// --- mobj.flags4 ---
|
|
|
|
|
|
|
|
MF4_NOHATEPLAYERS = 0x00000001, // Ignore player attacks
|
|
|
|
MF4_QUICKTORETALIATE= 0x00000002, // Always switch targets when hurt
|
|
|
|
MF4_NOICEDEATH = 0x00000004, // Actor never enters an ice death, not even the generic one
|
|
|
|
MF4_BOSSDEATH = 0x00000008, // A_FreezeDeathChunks calls A_BossDeath
|
|
|
|
MF4_RANDOMIZE = 0x00000010, // Missile has random initial tic count
|
|
|
|
MF4_NOSKIN = 0x00000020, // Player cannot use skins
|
|
|
|
MF4_FIXMAPTHINGPOS = 0x00000040, // Fix this actor's position when spawned as a map thing
|
2013-08-12 18:23:54 +00:00
|
|
|
MF4_ACTLIKEBRIDGE = 0x00000080, // Pickups can "stand" on this actor / cannot be moved by any sector action.
|
2006-02-24 04:48:15 +00:00
|
|
|
MF4_STRIFEDAMAGE = 0x00000100, // Strife projectiles only do up to 4x damage, not 8x
|
|
|
|
|
2007-04-22 21:01:35 +00:00
|
|
|
MF4_CANUSEWALLS = 0x00000200, // Can activate 'use' specials
|
|
|
|
MF4_MISSILEMORE = 0x00000400, // increases the chance of a missile attack
|
|
|
|
MF4_MISSILEEVENMORE = 0x00000800, // significantly increases the chance of a missile attack
|
2007-05-12 11:14:09 +00:00
|
|
|
MF4_FORCERADIUSDMG = 0x00001000, // if put on an object it will override MF3_NORADIUSDMG
|
2007-04-22 21:01:35 +00:00
|
|
|
MF4_DONTFALL = 0x00002000, // Doesn't have NOGRAVITY disabled when dying.
|
2006-02-24 04:48:15 +00:00
|
|
|
MF4_SEESDAGGERS = 0x00004000, // This actor can see you striking with a dagger
|
|
|
|
MF4_INCOMBAT = 0x00008000, // Don't alert others when attacked by a dagger
|
|
|
|
MF4_LOOKALLAROUND = 0x00010000, // Monster has eyes in the back of its head
|
|
|
|
MF4_STANDSTILL = 0x00020000, // Monster should not chase targets unless attacked?
|
|
|
|
MF4_SPECTRAL = 0x00040000,
|
2009-06-30 20:57:51 +00:00
|
|
|
MF4_SCROLLMOVE = 0x00080000, // velocity has been applied by a scroller
|
2006-02-24 04:48:15 +00:00
|
|
|
MF4_NOSPLASHALERT = 0x00100000, // Splashes don't alert this monster
|
|
|
|
MF4_SYNCHRONIZED = 0x00200000, // For actors spawned at load-time only: Do not randomize tics
|
|
|
|
MF4_NOTARGETSWITCH = 0x00400000, // monster never switches target until current one is dead
|
|
|
|
MF4_VFRICTION = 0x00800000, // Internal flag used by A_PainAttack to push a monster down
|
2009-06-27 19:37:53 +00:00
|
|
|
MF4_DONTHARMCLASS = 0x01000000, // Don't hurt one's own kind with explosions (hitscans, too?)
|
2006-02-24 04:48:15 +00:00
|
|
|
MF4_SHIELDREFLECT = 0x02000000,
|
|
|
|
MF4_DEFLECT = 0x04000000, // different projectile reflection styles
|
|
|
|
MF4_ALLOWPARTICLES = 0x08000000, // this puff type can be replaced by particles
|
|
|
|
MF4_NOEXTREMEDEATH = 0x10000000, // this projectile or weapon never gibs its victim
|
|
|
|
MF4_EXTREMEDEATH = 0x20000000, // this projectile or weapon always gibs its victim
|
2006-04-11 16:27:41 +00:00
|
|
|
MF4_FRIGHTENED = 0x40000000, // Monster runs away from player
|
2010-06-20 17:57:32 +00:00
|
|
|
MF4_BOSSSPAWNED = 0x80000000, // Spawned by a boss spawn cube
|
2006-04-16 13:29:50 +00:00
|
|
|
|
2009-09-14 19:44:14 +00:00
|
|
|
// --- mobj.flags5 ---
|
|
|
|
|
2013-06-24 14:42:43 +00:00
|
|
|
MF5_DONTDRAIN = 0x00000001, // cannot be drained health from.
|
2013-08-12 18:23:54 +00:00
|
|
|
/* = 0x00000002, reserved for use by scripting branch */
|
2006-04-17 16:04:27 +00:00
|
|
|
MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances.
|
2013-08-09 18:20:23 +00:00
|
|
|
MF5_NOFORWARDFALL = 0x00000008, // Does not make any actor fall forward by being damaged by this
|
2010-09-19 00:06:45 +00:00
|
|
|
MF5_COUNTSECRET = 0x00000010, // From Doom 64: actor acts like a secret
|
2006-05-13 12:41:15 +00:00
|
|
|
MF5_AVOIDINGDROPOFF = 0x00000020, // Used to move monsters away from dropoffs
|
2006-05-07 00:27:22 +00:00
|
|
|
MF5_NODAMAGE = 0x00000040, // Actor can be shot and reacts to being shot but takes no damage
|
2006-05-13 12:41:15 +00:00
|
|
|
MF5_CHASEGOAL = 0x00000080, // Walks to goal instead of target if a valid goal is set.
|
|
|
|
MF5_BLOODSPLATTER = 0x00000100, // Blood splatter like in Raven's games.
|
2006-07-02 21:58:10 +00:00
|
|
|
MF5_OLDRADIUSDMG = 0x00000200, // Use old radius damage code (for barrels and boss brain)
|
2006-10-15 20:27:16 +00:00
|
|
|
MF5_DEHEXPLOSION = 0x00000400, // Use the DEHACKED explosion options when this projectile explodes
|
2006-10-22 10:32:41 +00:00
|
|
|
MF5_PIERCEARMOR = 0x00000800, // Armor doesn't protect against damage from this actor
|
2006-12-24 12:51:24 +00:00
|
|
|
MF5_NOBLOODDECALS = 0x00001000, // Actor bleeds but doesn't spawn blood decals
|
2007-05-12 11:14:09 +00:00
|
|
|
MF5_USESPECIAL = 0x00002000, // Actor executes its special when being 'used'.
|
2007-05-26 10:50:32 +00:00
|
|
|
MF5_NOPAIN = 0x00004000, // If set the pain state won't be entered
|
2007-10-29 22:15:46 +00:00
|
|
|
MF5_ALWAYSFAST = 0x00008000, // always uses 'fast' attacking logic
|
|
|
|
MF5_NEVERFAST = 0x00010000, // never uses 'fast' attacking logic
|
2008-03-01 16:59:17 +00:00
|
|
|
MF5_ALWAYSRESPAWN = 0x00020000, // always respawns, regardless of skill setting
|
|
|
|
MF5_NEVERRESPAWN = 0x00040000, // never respawns, regardless of skill setting
|
2013-08-12 18:23:54 +00:00
|
|
|
MF5_DONTRIP = 0x00080000, // Ripping projectiles explode when hitting this actor
|
2008-03-24 22:16:21 +00:00
|
|
|
MF5_NOINFIGHTING = 0x00100000, // This actor doesn't switch target when it's hurt
|
2008-04-03 10:49:54 +00:00
|
|
|
MF5_NOINTERACTION = 0x00200000, // Thing is completely excluded from any gameplay related checks
|
2008-04-06 09:24:41 +00:00
|
|
|
MF5_NOTIMEFREEZE = 0x00400000, // Actor is not affected by time freezer
|
2008-05-12 22:52:13 +00:00
|
|
|
MF5_PUFFGETSOWNER = 0x00800000, // [BB] Sets the owner of the puff to the player who fired it
|
2010-09-19 00:06:45 +00:00
|
|
|
MF5_SPECIALFIREDAMAGE=0x01000000, // Special treatment of PhoenixFX1 turned into a flag to remove
|
2008-08-04 22:30:45 +00:00
|
|
|
// dependence of main engine code of specific actor types.
|
2008-08-06 19:25:59 +00:00
|
|
|
MF5_SUMMONEDMONSTER = 0x02000000, // To mark the friendly Minotaur. Hopefully to be generalized later.
|
2008-08-07 20:16:07 +00:00
|
|
|
MF5_NOVERTICALMELEERANGE=0x04000000,// Does not check vertical distance for melee range
|
2008-12-06 10:22:37 +00:00
|
|
|
MF5_BRIGHT = 0x08000000, // Actor is always rendered fullbright
|
2009-02-19 14:36:37 +00:00
|
|
|
MF5_CANTSEEK = 0x10000000, // seeker missiles cannot home in on this actor
|
2009-02-22 10:25:12 +00:00
|
|
|
MF5_INCONVERSATION = 0x20000000, // Actor is having a conversation
|
2009-02-24 21:19:10 +00:00
|
|
|
MF5_PAINLESS = 0x40000000, // Actor always inflicts painless damage.
|
2009-04-09 02:25:37 +00:00
|
|
|
MF5_MOVEWITHSECTOR = 0x80000000, // P_ChangeSector() will still process this actor if it has MF_NOBLOCKMAP
|
2008-03-01 16:59:17 +00:00
|
|
|
|
2009-09-14 19:44:14 +00:00
|
|
|
// --- mobj.flags6 ---
|
|
|
|
|
2009-05-30 08:56:40 +00:00
|
|
|
MF6_NOBOSSRIP = 0x00000001, // For rippermissiles: Don't rip through bosses.
|
2009-05-31 20:14:16 +00:00
|
|
|
MF6_THRUSPECIES = 0x00000002, // Actors passes through other of the same species.
|
|
|
|
MF6_MTHRUSPECIES = 0x00000004, // Missile passes through actors of its shooter's species.
|
2009-06-05 21:44:34 +00:00
|
|
|
MF6_FORCEPAIN = 0x00000008, // forces target into painstate (unless it has the NOPAIN flag)
|
2009-06-06 12:46:35 +00:00
|
|
|
MF6_NOFEAR = 0x00000010, // Not scared of frightening players
|
2009-06-09 17:13:03 +00:00
|
|
|
MF6_BUMPSPECIAL = 0x00000020, // Actor executes its special when being collided (as the ST flag)
|
2009-06-27 19:37:53 +00:00
|
|
|
MF6_DONTHARMSPECIES = 0x00000040, // Don't hurt one's own species with explosions (hitscans, too?)
|
2009-08-05 01:13:41 +00:00
|
|
|
MF6_STEPMISSILE = 0x00000080, // Missile can "walk" up steps
|
2009-08-07 03:41:23 +00:00
|
|
|
MF6_NOTELEFRAG = 0x00000100, // [HW] Actor can't be telefragged
|
2009-09-14 20:47:53 +00:00
|
|
|
MF6_TOUCHY = 0x00000200, // From MBF: killough 11/98: dies when solids touch it
|
|
|
|
MF6_CANJUMP = 0x00000400, // From MBF: a dedicated flag instead of the BOUNCES+FLOAT+sentient combo
|
|
|
|
MF6_JUMPDOWN = 0x00000800, // From MBF: generalization of dog behavior wrt. dropoffs.
|
|
|
|
MF6_VULNERABLE = 0x00001000, // Actor can be damaged (even if not shootable).
|
|
|
|
MF6_ARMED = 0x00002000, // From MBF: Object is armed (for MF6_TOUCHY objects)
|
|
|
|
MF6_FALLING = 0x00004000, // From MBF: Object is falling (for pseudotorque simulation)
|
|
|
|
MF6_LINEDONE = 0x00008000, // From MBF: Object has already run a line effect
|
2009-10-10 12:42:57 +00:00
|
|
|
MF6_NOTRIGGER = 0x00010000, // actor cannot trigger any line actions
|
2009-12-16 16:09:48 +00:00
|
|
|
MF6_SHATTERING = 0x00020000, // marks an ice corpse for forced shattering
|
2009-12-25 11:09:56 +00:00
|
|
|
MF6_KILLED = 0x00040000, // Something that was killed (but not necessarily a corpse)
|
2010-05-30 20:12:32 +00:00
|
|
|
MF6_BLOCKEDBYSOLIDACTORS = 0x00080000, // Blocked by solid actors, even if not solid itself
|
2010-07-23 21:36:17 +00:00
|
|
|
MF6_ADDITIVEPOISONDAMAGE = 0x00100000,
|
|
|
|
MF6_ADDITIVEPOISONDURATION = 0x00200000,
|
2010-09-19 08:27:20 +00:00
|
|
|
MF6_NOMENU = 0x00400000, // Player class should not appear in the class selection menu.
|
2011-01-23 08:33:30 +00:00
|
|
|
MF6_BOSSCUBE = 0x00800000, // Actor spawned by A_BrainSpit, flagged for timefreeze reasons.
|
2011-05-26 23:25:02 +00:00
|
|
|
MF6_SEEINVISIBLE = 0x01000000, // Monsters can see invisible player.
|
2011-05-26 23:27:58 +00:00
|
|
|
MF6_DONTCORPSE = 0x02000000, // [RC] Don't autoset MF_CORPSE upon death and don't force Crash state change.
|
2011-06-13 10:25:03 +00:00
|
|
|
MF6_POISONALWAYS = 0x04000000, // Always apply poison, even when target can't take the damage.
|
2011-06-13 10:43:07 +00:00
|
|
|
MF6_DOHARMSPECIES = 0x08000000, // Do hurt one's own species with projectiles.
|
2012-03-18 03:52:18 +00:00
|
|
|
MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove
|
2012-04-07 12:40:50 +00:00
|
|
|
MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim.
|
2013-08-10 06:53:37 +00:00
|
|
|
MF6_NOTONAUTOMAP = 0x40000000, // will not be shown on automap with the 'scanner' powerup.
|
2013-08-10 07:32:55 +00:00
|
|
|
MF6_RELATIVETOFLOOR = 0x80000000, // [RC] Make flying actors be affected by lifts.
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2013-09-18 01:44:13 +00:00
|
|
|
// --- mobj.flags7 ---
|
2013-08-12 18:41:33 +00:00
|
|
|
|
|
|
|
MF7_NEVERTARGET = 0x00000001, // can not be targetted at all, even if monster friendliness is considered.
|
|
|
|
MF7_NOTELESTOMP = 0x00000002, // cannot telefrag under any circumstances (even when set by MAPINFO)
|
2013-08-13 19:01:14 +00:00
|
|
|
MF7_ALWAYSTELEFRAG = 0x00000004, // will unconditionally be telefragged when in the way. Overrides all other settings.
|
2013-09-18 01:44:13 +00:00
|
|
|
MF7_HANDLENODELAY = 0x00000008, // respect NoDelay state flag
|
2014-07-27 08:07:37 +00:00
|
|
|
MF7_WEAPONSPAWN = 0x00000010, // subject to DF_NO_COOP_WEAPON_SPAWN dmflag
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// --- mobj.renderflags ---
|
|
|
|
|
|
|
|
RF_XFLIP = 0x0001, // Flip sprite horizontally
|
|
|
|
RF_YFLIP = 0x0002, // Flip sprite vertically
|
|
|
|
RF_ONESIDED = 0x0004, // Wall/floor sprite is visible from front only
|
|
|
|
RF_FULLBRIGHT = 0x0010, // Sprite is drawn at full brightness
|
|
|
|
|
|
|
|
RF_RELMASK = 0x0300, // ---Relative z-coord for bound actors (these obey texture pegging)
|
|
|
|
RF_RELABSOLUTE = 0x0000, // Actor z is absolute
|
|
|
|
RF_RELUPPER = 0x0100, // Actor z is relative to upper part of wall
|
|
|
|
RF_RELLOWER = 0x0200, // Actor z is relative to lower part of wall
|
|
|
|
RF_RELMID = 0x0300, // Actor z is relative to middle part of wall
|
|
|
|
|
|
|
|
RF_CLIPMASK = 0x0c00, // ---Clipping for bound actors
|
|
|
|
RF_CLIPFULL = 0x0000, // Clip sprite to full height of wall
|
|
|
|
RF_CLIPUPPER = 0x0400, // Clip sprite to upper part of wall
|
|
|
|
RF_CLIPMID = 0x0800, // Clip sprite to mid part of wall
|
|
|
|
RF_CLIPLOWER = 0x0c00, // Clip sprite to lower part of wall
|
|
|
|
|
|
|
|
RF_DECALMASK = RF_RELMASK|RF_CLIPMASK,
|
|
|
|
|
|
|
|
RF_SPRITETYPEMASK = 0x7000, // ---Different sprite types, not all implemented
|
|
|
|
RF_FACESPRITE = 0x0000, // Face sprite
|
|
|
|
RF_WALLSPRITE = 0x1000, // Wall sprite
|
|
|
|
RF_FLOORSPRITE = 0x2000, // Floor sprite
|
|
|
|
RF_VOXELSPRITE = 0x3000, // Voxel object
|
|
|
|
RF_INVISIBLE = 0x8000, // Don't bother drawing this actor
|
|
|
|
|
2007-12-06 08:55:17 +00:00
|
|
|
RF_FORCEYBILLBOARD = 0x10000, // [BB] OpenGL only: draw with y axis billboard, i.e. anchored to the floor (overrides gl_billboard_mode setting)
|
|
|
|
RF_FORCEXYBILLBOARD = 0x20000, // [BB] OpenGL only: draw with xy axis billboard, i.e. unanchored (overrides gl_billboard_mode setting)
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// --- dummies for unknown/unimplemented Strife flags ---
|
|
|
|
|
|
|
|
MF_STRIFEx8000000 = 0, // seems related to MF_SHADOW
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TRANSLUC25 (FRACUNIT/4)
|
|
|
|
#define TRANSLUC33 (FRACUNIT/3)
|
|
|
|
#define TRANSLUC50 (FRACUNIT/2)
|
|
|
|
#define TRANSLUC66 ((FRACUNIT*2)/3)
|
|
|
|
#define TRANSLUC75 ((FRACUNIT*3)/4)
|
|
|
|
|
|
|
|
// <wingdi.h> also #defines OPAQUE
|
|
|
|
#ifndef OPAQUE
|
|
|
|
#define OPAQUE (FRACUNIT)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// This translucency value produces the closest match to Heretic's TINTTAB.
|
|
|
|
// ~40% of the value of the overlaid image shows through.
|
|
|
|
#define HR_SHADOW (0x6800)
|
|
|
|
|
|
|
|
// Hexen's TINTTAB is the same as Heretic's, just reversed.
|
|
|
|
#define HX_SHADOW (0x9800)
|
|
|
|
#define HX_ALTSHADOW (0x6800)
|
|
|
|
|
2006-07-16 09:10:45 +00:00
|
|
|
// This could easily be a bool but then it'd be much harder to find later. ;)
|
|
|
|
enum replace_t
|
|
|
|
{
|
|
|
|
NO_REPLACE = 0,
|
|
|
|
ALLOW_REPLACE = 1
|
|
|
|
};
|
|
|
|
|
2009-09-14 19:44:14 +00:00
|
|
|
enum EBounceFlags
|
2009-05-23 08:30:36 +00:00
|
|
|
{
|
2009-09-06 01:49:17 +00:00
|
|
|
BOUNCE_Walls = 1<<0, // bounces off of walls
|
|
|
|
BOUNCE_Floors = 1<<1, // bounces off of floors
|
|
|
|
BOUNCE_Ceilings = 1<<2, // bounces off of ceilings
|
|
|
|
BOUNCE_Actors = 1<<3, // bounces off of some actors
|
|
|
|
BOUNCE_AllActors = 1<<4, // bounces off of all actors (requires BOUNCE_Actors to be set, too)
|
2012-06-10 10:17:49 +00:00
|
|
|
BOUNCE_AutoOff = 1<<5, // when bouncing off a sector plane, if the new Z velocity is below 3.0, disable further bouncing
|
2009-09-14 19:44:14 +00:00
|
|
|
BOUNCE_HereticType = 1<<6, // goes into Death state when bouncing on floors or ceilings
|
2009-09-06 01:49:17 +00:00
|
|
|
|
|
|
|
BOUNCE_UseSeeSound = 1<<7, // compatibility fallback. This will only be set by
|
|
|
|
// the compatibility handlers for the old bounce flags.
|
|
|
|
BOUNCE_NoWallSound = 1<<8, // don't make noise when bouncing off a wall
|
|
|
|
BOUNCE_Quiet = 1<<9, // Strife's grenades don't make a bouncing sound
|
|
|
|
BOUNCE_ExplodeOnWater = 1<<10, // explodes when hitting a water surface
|
|
|
|
BOUNCE_CanBounceWater = 1<<11, // can bounce on water
|
2009-09-14 19:44:14 +00:00
|
|
|
// MBF bouncing is a bit different from other modes as Killough coded many special behavioral cases
|
|
|
|
// for them that are not present in ZDoom, so it is necessary to identify it properly.
|
|
|
|
BOUNCE_MBF = 1<<12, // This in itself is not a valid mode, but replaces MBF's MF_BOUNCE flag.
|
2012-06-10 10:17:49 +00:00
|
|
|
BOUNCE_AutoOffFloorOnly = 1<<13, // like BOUNCE_AutoOff, but only on floors
|
2013-05-04 22:52:37 +00:00
|
|
|
BOUNCE_UseBounceState = 1<<14, // Use Bounce[.*] states
|
2009-09-06 01:49:17 +00:00
|
|
|
|
2009-09-16 21:03:09 +00:00
|
|
|
BOUNCE_TypeMask = BOUNCE_Walls | BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_Actors | BOUNCE_AutoOff | BOUNCE_HereticType | BOUNCE_MBF,
|
2009-09-06 01:49:17 +00:00
|
|
|
|
|
|
|
// The three "standard" types of bounciness are:
|
|
|
|
// HERETIC - Missile will only bounce off the floor once and then enter
|
|
|
|
// its death state. It does not bounce off walls at all.
|
|
|
|
// HEXEN - Missile bounces off of walls and floors indefinitely.
|
|
|
|
// DOOM - Like Hexen, but the bounce turns off if its vertical velocity
|
|
|
|
// is too low.
|
|
|
|
BOUNCE_None = 0,
|
|
|
|
BOUNCE_Heretic = BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_HereticType,
|
|
|
|
BOUNCE_Doom = BOUNCE_Walls | BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_Actors | BOUNCE_AutoOff,
|
|
|
|
BOUNCE_Hexen = BOUNCE_Walls | BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_Actors,
|
2009-09-14 19:44:14 +00:00
|
|
|
BOUNCE_Grenade = BOUNCE_MBF | BOUNCE_Doom, // Bounces on walls and flats like ZDoom bounce.
|
|
|
|
BOUNCE_Classic = BOUNCE_MBF | BOUNCE_Floors | BOUNCE_Ceilings, // Bounces on flats only, but
|
|
|
|
// does not die when bouncing.
|
2009-05-23 08:30:36 +00:00
|
|
|
|
|
|
|
// combined types
|
|
|
|
BOUNCE_DoomCompat = BOUNCE_Doom | BOUNCE_UseSeeSound,
|
|
|
|
BOUNCE_HereticCompat = BOUNCE_Heretic | BOUNCE_UseSeeSound,
|
2009-09-06 01:49:17 +00:00
|
|
|
BOUNCE_HexenCompat = BOUNCE_Hexen | BOUNCE_UseSeeSound
|
|
|
|
|
|
|
|
// The distinction between BOUNCE_Actors and BOUNCE_AllActors: A missile with
|
|
|
|
// BOUNCE_Actors set will bounce off of reflective and "non-sentient" actors.
|
|
|
|
// A missile that also has BOUNCE_AllActors set will bounce off of any actor.
|
|
|
|
// For compatibility reasons when BOUNCE_Actors was implied by the bounce type
|
|
|
|
// being "Doom" or "Hexen" and BOUNCE_AllActors was the separate
|
|
|
|
// MF5_BOUNCEONACTORS, you must set BOUNCE_Actors for BOUNCE_AllActors to have
|
|
|
|
// an effect.
|
2009-09-14 19:44:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-10-09 20:35:07 +00:00
|
|
|
// Used to affect the logic for thing activation through death, USESPECIAL and BUMPSPECIAL
|
2009-09-14 19:44:14 +00:00
|
|
|
// "thing" refers to what has the flag and the special, "trigger" refers to what used or bumped it
|
|
|
|
enum EThingSpecialActivationType
|
|
|
|
{
|
2009-10-09 20:35:07 +00:00
|
|
|
THINGSPEC_Default = 0, // Normal behavior: a player must be the trigger, and is the activator
|
|
|
|
THINGSPEC_ThingActs = 1, // The thing itself is the activator of the special
|
|
|
|
THINGSPEC_ThingTargets = 1<<1, // The thing changes its target to the trigger
|
|
|
|
THINGSPEC_TriggerTargets = 1<<2, // The trigger changes its target to the thing
|
|
|
|
THINGSPEC_MonsterTrigger = 1<<3, // The thing can be triggered by a monster
|
|
|
|
THINGSPEC_MissileTrigger = 1<<4, // The thing can be triggered by a projectile
|
|
|
|
THINGSPEC_ClearSpecial = 1<<5, // Clears special after successful activation
|
|
|
|
THINGSPEC_NoDeathSpecial = 1<<6, // Don't activate special on death
|
|
|
|
THINGSPEC_TriggerActs = 1<<7, // The trigger is the activator of the special
|
|
|
|
// (overrides LEVEL_ACTOWNSPECIAL Hexen hack)
|
|
|
|
THINGSPEC_Activate = 1<<8, // The thing is activated when triggered
|
|
|
|
THINGSPEC_Deactivate = 1<<9, // The thing is deactivated when triggered
|
|
|
|
THINGSPEC_Switch = 1<<10, // The thing is alternatively activated and deactivated when triggered
|
2009-05-23 08:30:36 +00:00
|
|
|
};
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// [RH] Like msecnode_t, but for the blockmap
|
|
|
|
struct FBlockNode
|
|
|
|
{
|
|
|
|
AActor *Me; // actor this node references
|
|
|
|
int BlockIndex; // index into blocklinks for the block this node is in
|
|
|
|
FBlockNode **PrevActor; // previous actor in this block
|
|
|
|
FBlockNode *NextActor; // next actor in this block
|
|
|
|
FBlockNode **PrevBlock; // previous block this actor is in
|
|
|
|
FBlockNode *NextBlock; // next block this actor is in
|
|
|
|
|
|
|
|
static FBlockNode *Create (AActor *who, int x, int y);
|
|
|
|
void Release ();
|
|
|
|
|
|
|
|
static FBlockNode *FreeBlocks;
|
|
|
|
};
|
|
|
|
|
|
|
|
class FDecalBase;
|
|
|
|
class AInventory;
|
|
|
|
|
|
|
|
inline AActor *GetDefaultByName (const char *name)
|
|
|
|
{
|
2006-05-10 02:40:43 +00:00
|
|
|
return (AActor *)(PClass::FindClass(name)->Defaults);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
2006-05-10 02:40:43 +00:00
|
|
|
inline AActor *GetDefaultByType (const PClass *type)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2006-05-10 02:40:43 +00:00
|
|
|
return (AActor *)(type->Defaults);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
inline T *GetDefault ()
|
|
|
|
{
|
2006-05-10 02:40:43 +00:00
|
|
|
return (T *)(RUNTIME_CLASS(T)->Defaults);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
2008-04-08 20:52:49 +00:00
|
|
|
struct line_t;
|
2006-02-24 04:48:15 +00:00
|
|
|
struct secplane_t;
|
|
|
|
struct FStrifeDialogueNode;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
AMETA_BASE = 0x12000,
|
|
|
|
|
|
|
|
AMETA_Obituary, // string (player was killed by this actor)
|
|
|
|
AMETA_HitObituary, // string (player was killed by this actor in melee)
|
|
|
|
AMETA_DeathHeight, // fixed (height on normal death)
|
|
|
|
AMETA_BurnHeight, // fixed (height on burning death)
|
|
|
|
AMETA_StrifeName, // string (for named Strife objects)
|
|
|
|
AMETA_BloodColor, // colorized blood
|
|
|
|
AMETA_GibHealth, // negative health below which this monster dies an extreme death
|
|
|
|
AMETA_WoundHealth, // health needed to enter wound state
|
2006-05-07 00:27:22 +00:00
|
|
|
AMETA_FastSpeed, // Speed in fast mode
|
2006-06-03 12:30:11 +00:00
|
|
|
AMETA_RDFactor, // Radius damage factor
|
2006-10-22 10:32:41 +00:00
|
|
|
AMETA_CameraHeight, // Height of camera when used as such
|
2006-11-27 00:01:30 +00:00
|
|
|
AMETA_HowlSound, // Sound being played when electrocuted or poisoned
|
2006-11-29 10:03:35 +00:00
|
|
|
AMETA_BloodType, // Blood replacement type
|
|
|
|
AMETA_BloodType2, // Bloodsplatter replacement type
|
|
|
|
AMETA_BloodType3, // AxeBlood replacement type
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
struct FDropItem
|
|
|
|
{
|
|
|
|
FName Name;
|
|
|
|
int probability;
|
|
|
|
int amount;
|
|
|
|
FDropItem * Next;
|
|
|
|
};
|
|
|
|
|
|
|
|
class FDropItemPtrArray : public TArray<FDropItem *>
|
|
|
|
{
|
|
|
|
public:
|
2010-12-14 00:50:02 +00:00
|
|
|
~FDropItemPtrArray()
|
|
|
|
{
|
|
|
|
Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Clear();
|
2008-09-21 18:02:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern FDropItemPtrArray DropItemList;
|
|
|
|
|
|
|
|
void FreeDropItemChain(FDropItem *chain);
|
|
|
|
int StoreDropItemChain(FDropItem *chain);
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// Map Object definition.
|
|
|
|
class AActor : public DThinker
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (AActor, DThinker)
|
|
|
|
HAS_OBJECT_POINTERS
|
|
|
|
public:
|
|
|
|
AActor () throw();
|
|
|
|
AActor (const AActor &other) throw();
|
|
|
|
AActor &operator= (const AActor &other);
|
|
|
|
void Destroy ();
|
|
|
|
~AActor ();
|
|
|
|
|
|
|
|
void Serialize (FArchive &arc);
|
|
|
|
|
2009-10-25 15:26:19 +00:00
|
|
|
static AActor *StaticSpawn (const PClass *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement, bool SpawningMapThing = false);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
inline AActor *GetDefault () const
|
|
|
|
{
|
2006-05-10 02:40:43 +00:00
|
|
|
return (AActor *)(RUNTIME_TYPE(this)->Defaults);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
2008-09-21 18:02:38 +00:00
|
|
|
FDropItem *GetDropItems();
|
2008-08-07 20:16:07 +00:00
|
|
|
|
|
|
|
// Return true if the monster should use a missile attack, false for melee
|
|
|
|
bool SuggestMissileAttack (fixed_t dist);
|
|
|
|
|
|
|
|
// Adjusts the angle for deflection/reflection of incoming missiles
|
|
|
|
// Returns true if the missile should be allowed to explode anyway
|
|
|
|
bool AdjustReflectionAngle (AActor *thing, angle_t &angle);
|
|
|
|
|
|
|
|
// Returns true if this actor is within melee range of its target
|
2012-08-22 23:17:49 +00:00
|
|
|
bool CheckMeleeRange();
|
|
|
|
|
|
|
|
virtual void BeginPlay(); // Called immediately after the actor is created
|
|
|
|
virtual void PostBeginPlay(); // Called immediately before the actor's first tick
|
|
|
|
virtual void LevelSpawned(); // Called after BeginPlay if this actor was spawned by the world
|
|
|
|
virtual void HandleSpawnFlags(); // Translates SpawnFlags into in-game flags.
|
|
|
|
|
|
|
|
virtual void MarkPrecacheSounds() const; // Marks sounds used by this actor for precaching.
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
virtual void Activate (AActor *activator);
|
|
|
|
virtual void Deactivate (AActor *activator);
|
|
|
|
|
|
|
|
virtual void Tick ();
|
|
|
|
|
|
|
|
// Called when actor dies
|
2012-05-13 07:54:44 +00:00
|
|
|
virtual void Die (AActor *source, AActor *inflictor, int dmgflags = 0);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Perform some special damage action. Returns the amount of damage to do.
|
|
|
|
// Returning -1 signals the damage routine to exit immediately
|
2012-06-29 04:21:31 +00:00
|
|
|
virtual int DoSpecialDamage (AActor *target, int damage, FName damagetype);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Like DoSpecialDamage, but called on the actor receiving the damage.
|
2006-10-31 14:53:21 +00:00
|
|
|
virtual int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Centaurs and ettins squeal when electrocuted, poisoned, or "holy"-ed
|
2006-11-27 00:01:30 +00:00
|
|
|
// Made a metadata property so no longer virtual
|
|
|
|
void Howl ();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Actor just hit the floor
|
|
|
|
virtual void HitFloor ();
|
|
|
|
|
2009-05-23 08:30:36 +00:00
|
|
|
// plays bouncing sound
|
|
|
|
void PlayBounceSound(bool onfloor);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// Called when an actor with MF_MISSILE and MF2_FLOORBOUNCE hits the floor
|
|
|
|
virtual bool FloorBounceMissile (secplane_t &plane);
|
|
|
|
|
|
|
|
// Called when an actor is to be reflected by a disc of repulsion.
|
|
|
|
// Returns true to continue normal blast processing.
|
|
|
|
virtual bool SpecialBlastHandling (AActor *source, fixed_t strength);
|
|
|
|
|
|
|
|
// Called by RoughBlockCheck
|
2009-10-09 20:54:28 +00:00
|
|
|
bool IsOkayToAttack (AActor *target);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Plays the actor's ActiveSound if its voice isn't already making noise.
|
|
|
|
void PlayActiveSound ();
|
|
|
|
|
|
|
|
// Actor had MF_SKULLFLY set and rammed into something
|
|
|
|
// Returns false to stop moving and true to keep moving
|
|
|
|
virtual bool Slam (AActor *victim);
|
|
|
|
|
|
|
|
// Called by PIT_CheckThing() and needed for some Hexen things.
|
|
|
|
// Returns -1 for normal behavior, 0 to return false, and 1 to return true.
|
|
|
|
// I'm not sure I like it this way, but it will do for now.
|
|
|
|
virtual int SpecialMissileHit (AActor *victim);
|
|
|
|
|
|
|
|
// Returns true if it's okay to switch target to "other" after being attacked by it.
|
|
|
|
virtual bool OkayToSwitchTarget (AActor *other);
|
|
|
|
|
|
|
|
// Something just touched this actor.
|
|
|
|
virtual void Touch (AActor *toucher);
|
|
|
|
|
|
|
|
// Adds the item to this actor's inventory and sets its Owner.
|
|
|
|
virtual void AddInventory (AInventory *item);
|
|
|
|
|
|
|
|
// Removes the item from the inventory list.
|
|
|
|
virtual void RemoveInventory (AInventory *item);
|
|
|
|
|
|
|
|
// Uses an item and removes it from the inventory.
|
|
|
|
virtual bool UseInventory (AInventory *item);
|
|
|
|
|
|
|
|
// Tosses an item out of the inventory.
|
|
|
|
virtual AInventory *DropInventory (AInventory *item);
|
|
|
|
|
2012-05-31 09:46:07 +00:00
|
|
|
// Removes all items from the inventory.
|
|
|
|
void ClearInventory();
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// Returns true if this view is considered "local" for the player.
|
|
|
|
bool CheckLocalView (int playernum) const;
|
|
|
|
|
|
|
|
// Finds the first item of a particular type.
|
2010-06-13 10:11:50 +00:00
|
|
|
AInventory *FindInventory (const PClass *type, bool subclass = false);
|
2008-03-12 02:56:11 +00:00
|
|
|
AInventory *FindInventory (FName type);
|
|
|
|
template<class T> T *FindInventory ()
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
return static_cast<T *> (FindInventory (RUNTIME_CLASS(T)));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Adds one item of a particular type. Returns NULL if it could not be added.
|
2006-05-10 02:40:43 +00:00
|
|
|
AInventory *GiveInventoryType (const PClass *type);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Returns the first item held with IF_INVBAR set.
|
2008-03-12 02:56:11 +00:00
|
|
|
AInventory *FirstInv ();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Tries to give the actor some ammo.
|
2006-05-10 02:40:43 +00:00
|
|
|
bool GiveAmmo (const PClass *type, int amount);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-06-18 04:10:47 +00:00
|
|
|
// Destroys all the inventory the actor is holding.
|
|
|
|
void DestroyAllInventory ();
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// Set the alphacolor field properly
|
|
|
|
void SetShade (DWORD rgb);
|
|
|
|
void SetShade (int r, int g, int b);
|
|
|
|
|
|
|
|
// Plays a conversation animation
|
2006-05-13 21:22:08 +00:00
|
|
|
void ConversationAnimation (int animnum);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Make this actor hate the same things as another actor
|
2011-03-18 08:02:23 +00:00
|
|
|
void CopyFriendliness (AActor *other, bool changeTarget, bool resetHealth=true);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Moves the other actor's inventory to this one
|
|
|
|
void ObtainInventory (AActor *other);
|
|
|
|
|
|
|
|
// Die. Now.
|
|
|
|
virtual bool Massacre ();
|
|
|
|
|
2009-05-15 17:21:45 +00:00
|
|
|
// Transforms the actor into a finely-ground paste
|
2013-04-16 17:55:17 +00:00
|
|
|
virtual bool Grind(bool items);
|
2009-05-15 17:21:45 +00:00
|
|
|
|
2006-03-03 03:57:01 +00:00
|
|
|
// Is the other actor on my team?
|
|
|
|
bool IsTeammate (AActor *other);
|
|
|
|
|
|
|
|
// Is the other actor my friend?
|
|
|
|
bool IsFriend (AActor *other);
|
|
|
|
|
|
|
|
// Do I hate the other actor?
|
|
|
|
bool IsHostile (AActor *other);
|
|
|
|
|
2012-08-22 21:31:48 +00:00
|
|
|
inline bool IsNoClip2() const;
|
|
|
|
|
2006-03-03 03:57:01 +00:00
|
|
|
// What species am I?
|
2009-05-11 15:15:06 +00:00
|
|
|
virtual FName GetSpecies();
|
2012-07-27 01:53:21 +00:00
|
|
|
|
|
|
|
fixed_t GetBobOffset(fixed_t ticfrac=0) const
|
|
|
|
{
|
|
|
|
if (!(flags2 & MF2_FLOATBOB))
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return finesine[MulScale22(((FloatBobPhase + level.maptime) << FRACBITS) + ticfrac, FINEANGLES) & FINEMASK] * 8;
|
|
|
|
}
|
|
|
|
|
2006-11-29 10:03:35 +00:00
|
|
|
// Enter the crash state
|
|
|
|
void Crash();
|
|
|
|
|
2009-07-04 18:17:44 +00:00
|
|
|
// Return starting health adjusted by skill level
|
|
|
|
int SpawnHealth();
|
2010-09-19 10:39:34 +00:00
|
|
|
int GibHealth();
|
2009-07-04 18:17:44 +00:00
|
|
|
|
2011-06-13 10:22:47 +00:00
|
|
|
inline bool isMissile(bool precise=true)
|
|
|
|
{
|
|
|
|
return (flags&MF_MISSILE) || (precise && GetDefault()->flags&MF_MISSILE);
|
|
|
|
}
|
|
|
|
|
2006-04-16 13:29:50 +00:00
|
|
|
// Check for monsters that count as kill but excludes all friendlies.
|
|
|
|
bool CountsAsKill() const
|
|
|
|
{
|
|
|
|
return (flags & MF_COUNTKILL) && !(flags & MF_FRIENDLY);
|
|
|
|
}
|
2006-03-03 03:57:01 +00:00
|
|
|
|
2008-04-15 10:04:41 +00:00
|
|
|
bool intersects(AActor *other) const
|
|
|
|
{
|
|
|
|
fixed_t blockdist = radius + other->radius;
|
|
|
|
return ( abs(x - other->x) < blockdist && abs(y - other->y) < blockdist);
|
|
|
|
}
|
|
|
|
|
2010-03-21 08:09:45 +00:00
|
|
|
PalEntry GetBloodColor() const
|
|
|
|
{
|
|
|
|
return (PalEntry)GetClass()->Meta.GetMetaInt(AMETA_BloodColor);
|
|
|
|
}
|
|
|
|
|
2013-10-10 02:50:24 +00:00
|
|
|
// These also set CF_INTERPVIEW for players.
|
2014-05-08 07:43:58 +00:00
|
|
|
void SetPitch(int p, bool interpolate);
|
|
|
|
void SetAngle(angle_t ang, bool interpolate);
|
2013-10-10 02:50:24 +00:00
|
|
|
|
2010-03-21 08:09:45 +00:00
|
|
|
const PClass *GetBloodType(int type = 0) const
|
|
|
|
{
|
2010-08-21 19:50:07 +00:00
|
|
|
const PClass *bloodcls;
|
2010-03-21 08:09:45 +00:00
|
|
|
if (type == 0)
|
|
|
|
{
|
2010-08-21 19:50:07 +00:00
|
|
|
bloodcls = PClass::FindClass((ENamedName)GetClass()->Meta.GetMetaInt(AMETA_BloodType, NAME_Blood));
|
2010-03-21 08:09:45 +00:00
|
|
|
}
|
|
|
|
else if (type == 1)
|
|
|
|
{
|
2010-08-21 19:50:07 +00:00
|
|
|
bloodcls = PClass::FindClass((ENamedName)GetClass()->Meta.GetMetaInt(AMETA_BloodType2, NAME_BloodSplatter));
|
2010-03-21 08:09:45 +00:00
|
|
|
}
|
|
|
|
else if (type == 2)
|
|
|
|
{
|
2010-08-21 19:50:07 +00:00
|
|
|
bloodcls = PClass::FindClass((ENamedName)GetClass()->Meta.GetMetaInt(AMETA_BloodType3, NAME_AxeBlood));
|
2010-03-21 08:09:45 +00:00
|
|
|
}
|
|
|
|
else return NULL;
|
2010-08-21 19:50:07 +00:00
|
|
|
|
|
|
|
if (bloodcls != NULL)
|
|
|
|
{
|
2010-08-26 20:59:15 +00:00
|
|
|
bloodcls = bloodcls->GetReplacement();
|
2010-08-21 19:50:07 +00:00
|
|
|
}
|
|
|
|
return bloodcls;
|
2010-03-21 08:09:45 +00:00
|
|
|
}
|
|
|
|
|
2012-06-09 04:15:56 +00:00
|
|
|
inline void SetFriendPlayer(player_t *player);
|
|
|
|
|
2011-09-08 01:28:26 +00:00
|
|
|
bool IsVisibleToPlayer() const;
|
|
|
|
|
- Added the ACS commands
ReplaceTextures (str old_texture, str new_texture, optional bool not_lower,
optional bool not_mid, optional bool not_upper, optional bool not_floor,
optional bool not_ceiling); and
SectorDamage (int tag, int amount, str type, bool players_only, bool in_air,
str protection_item, bool subclasses_okay);
- Added the vid_nowidescreen cvar to disable widescreen aspect ratio
correction. When this is enabled, the only display ratio available is 4:3
(and 5:4 if vid_tft is set).
- Added support for setting an actor's damage property to an expression
through decorate. Just enclose it within parentheses, and the expression
will be evaluated exactly as-is without the normal Doom damage calculation.
So if you want something that does exactly 6 damage, use a "Damage (6)"
property. To deal normal Doom missile damage, you can use
"Damage (random(1,8)*6)" instead of "Damage 6".
- Moved InvFirst and InvSel into APlayerPawn so that they can be consistantly
maintained by ObtainInventory.
SVN r288 (trunk)
2006-08-12 02:30:57 +00:00
|
|
|
// Calculate amount of missile damage
|
|
|
|
virtual int GetMissileDamage(int mask, int add);
|
|
|
|
|
2009-05-30 08:56:40 +00:00
|
|
|
bool CanSeek(AActor *target) const;
|
|
|
|
|
2009-09-14 19:44:14 +00:00
|
|
|
fixed_t GetGravity() const;
|
|
|
|
bool IsSentient() const;
|
2009-09-14 21:41:44 +00:00
|
|
|
const char *GetTag(const char *def = NULL) const;
|
2011-01-12 00:17:13 +00:00
|
|
|
void SetTag(const char *def);
|
2009-09-14 19:44:14 +00:00
|
|
|
|
2012-03-18 03:52:18 +00:00
|
|
|
// Triggers SECSPAC_Exit/SECSPAC_Enter and related events if oldsec != current sector
|
|
|
|
void CheckSectorTransition(sector_t *oldsec);
|
2009-09-14 19:44:14 +00:00
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// info for drawing
|
|
|
|
// NOTE: The first member variable *must* be x.
|
|
|
|
fixed_t x,y,z;
|
|
|
|
AActor *snext, **sprev; // links in sector (if needed)
|
|
|
|
angle_t angle;
|
|
|
|
WORD sprite; // used to find patch_t and flip value
|
|
|
|
BYTE frame; // sprite frame to draw
|
2006-11-14 16:54:02 +00:00
|
|
|
fixed_t scaleX, scaleY; // Scaling values; FRACUNIT is normal size
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
FRenderStyle RenderStyle; // Style to draw this actor with
|
2006-05-03 14:54:48 +00:00
|
|
|
DWORD renderflags; // Different rendering flags
|
2008-06-15 18:36:26 +00:00
|
|
|
FTextureID picnum; // Draw this instead of sprite if valid
|
2006-02-24 04:48:15 +00:00
|
|
|
DWORD effects; // [RH] see p_effect.h
|
|
|
|
fixed_t alpha;
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
DWORD fillcolor; // Color to draw when STYLE_Shaded
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// interaction info
|
|
|
|
fixed_t pitch, roll;
|
|
|
|
FBlockNode *BlockNode; // links in blocks (if needed)
|
|
|
|
struct sector_t *Sector;
|
2010-08-27 15:20:05 +00:00
|
|
|
subsector_t * subsector;
|
2006-02-24 04:48:15 +00:00
|
|
|
fixed_t floorz, ceilingz; // closest together of contacted secs
|
|
|
|
fixed_t dropoffz; // killough 11/98: the lowest floor over all contacted Sectors.
|
|
|
|
|
|
|
|
struct sector_t *floorsector;
|
2008-06-15 18:36:26 +00:00
|
|
|
FTextureID floorpic; // contacted sec floorpic
|
2006-04-17 13:53:34 +00:00
|
|
|
struct sector_t *ceilingsector;
|
2008-06-15 18:36:26 +00:00
|
|
|
FTextureID ceilingpic; // contacted sec ceilingpic
|
2006-02-24 04:48:15 +00:00
|
|
|
fixed_t radius, height; // for movement checking
|
2008-10-05 11:23:41 +00:00
|
|
|
fixed_t projectilepassheight; // height for clipping projectile movement against this actor
|
2009-06-30 20:57:51 +00:00
|
|
|
fixed_t velx, vely, velz; // velocity
|
2006-02-24 04:48:15 +00:00
|
|
|
SDWORD tics; // state tic counter
|
|
|
|
FState *state;
|
- Added the ACS commands
ReplaceTextures (str old_texture, str new_texture, optional bool not_lower,
optional bool not_mid, optional bool not_upper, optional bool not_floor,
optional bool not_ceiling); and
SectorDamage (int tag, int amount, str type, bool players_only, bool in_air,
str protection_item, bool subclasses_okay);
- Added the vid_nowidescreen cvar to disable widescreen aspect ratio
correction. When this is enabled, the only display ratio available is 4:3
(and 5:4 if vid_tft is set).
- Added support for setting an actor's damage property to an expression
through decorate. Just enclose it within parentheses, and the expression
will be evaluated exactly as-is without the normal Doom damage calculation.
So if you want something that does exactly 6 damage, use a "Damage (6)"
property. To deal normal Doom missile damage, you can use
"Damage (random(1,8)*6)" instead of "Damage 6".
- Moved InvFirst and InvSel into APlayerPawn so that they can be consistantly
maintained by ObtainInventory.
SVN r288 (trunk)
2006-08-12 02:30:57 +00:00
|
|
|
SDWORD Damage; // For missiles and monster railgun
|
2011-06-13 09:16:57 +00:00
|
|
|
int projectileKickback;
|
2006-02-24 04:48:15 +00:00
|
|
|
DWORD flags;
|
|
|
|
DWORD flags2; // Heretic flags
|
|
|
|
DWORD flags3; // [RH] Hexen/Heretic actor-dependant behavior made flaggable
|
|
|
|
DWORD flags4; // [RH] Even more flags!
|
2006-04-16 13:29:50 +00:00
|
|
|
DWORD flags5; // OMG! We need another one.
|
2009-05-30 08:56:40 +00:00
|
|
|
DWORD flags6; // Shit! Where did all the flags go?
|
2013-08-12 18:09:21 +00:00
|
|
|
DWORD flags7; //
|
2011-09-08 01:28:26 +00:00
|
|
|
|
|
|
|
// [BB] If 0, everybody can see the actor, if > 0, only members of team (VisibleToTeam-1) can see it.
|
|
|
|
DWORD VisibleToTeam;
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
int special1; // Special info
|
|
|
|
int special2; // Special info
|
|
|
|
int health;
|
|
|
|
BYTE movedir; // 0-7
|
|
|
|
SBYTE visdir;
|
|
|
|
SWORD movecount; // when 0, select a new dir
|
2009-09-16 21:03:09 +00:00
|
|
|
SWORD strafecount; // for MF3_AVOIDMELEE
|
2008-03-12 02:56:11 +00:00
|
|
|
TObjPtr<AActor> target; // thing being chased/attacked (or NULL)
|
2006-02-24 04:48:15 +00:00
|
|
|
// also the originator for missiles
|
2009-09-14 19:44:14 +00:00
|
|
|
TObjPtr<AActor> lastenemy; // Last known enemy -- killough 2/15/98
|
2008-03-12 02:56:11 +00:00
|
|
|
TObjPtr<AActor> LastHeard; // [RH] Last actor this one heard
|
2006-02-24 04:48:15 +00:00
|
|
|
SDWORD reactiontime; // if non 0, don't attack yet; used by
|
|
|
|
// player to freeze a bit after teleporting
|
|
|
|
SDWORD threshold; // if > 0, the target will be chased
|
|
|
|
// no matter what (even if shot)
|
2008-06-01 07:52:33 +00:00
|
|
|
player_t *player; // only valid if type of APlayerPawn
|
2008-03-12 02:56:11 +00:00
|
|
|
TObjPtr<AActor> LastLookActor; // Actor last looked for (if TIDtoHate != 0)
|
2008-05-08 08:06:26 +00:00
|
|
|
fixed_t SpawnPoint[3]; // For nightmare respawn
|
2006-02-24 04:48:15 +00:00
|
|
|
WORD SpawnAngle;
|
2014-04-10 22:58:59 +00:00
|
|
|
int StartHealth;
|
2009-12-25 00:19:28 +00:00
|
|
|
BYTE WeaveIndexXY; // Separated from special2 because it's used by globally accessible functions.
|
|
|
|
BYTE WeaveIndexZ;
|
2008-01-26 16:42:16 +00:00
|
|
|
int skillrespawncount;
|
2009-05-11 15:15:06 +00:00
|
|
|
int TIDtoHate; // TID of things to hate (0 if none)
|
2009-09-14 19:44:14 +00:00
|
|
|
FNameNoInit Species; // For monster families
|
2008-03-12 02:56:11 +00:00
|
|
|
TObjPtr<AActor> tracer; // Thing being chased/attacked for tracers
|
|
|
|
TObjPtr<AActor> master; // Thing which spawned this one (prevents mutual attacks)
|
2006-02-24 04:48:15 +00:00
|
|
|
fixed_t floorclip; // value to use for floor clipping
|
2008-10-19 21:43:36 +00:00
|
|
|
int tid; // thing identifier
|
|
|
|
int special; // special
|
2006-04-16 13:29:50 +00:00
|
|
|
int args[5]; // special arguments
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2012-03-11 09:08:35 +00:00
|
|
|
int accuracy, stamina; // [RH] Strife stats -- [XA] moved here for DECORATE/ACS access.
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
AActor *inext, **iprev;// Links to other mobjs in same bucket
|
2008-03-12 02:56:11 +00:00
|
|
|
TObjPtr<AActor> goal; // Monster's goal if not chasing anything
|
2008-10-19 21:43:36 +00:00
|
|
|
int waterlevel; // 0=none, 1=feet, 2=waist, 3=eyes
|
2007-01-07 09:43:58 +00:00
|
|
|
BYTE boomwaterlevel; // splash information for non-swimmable water sectors
|
2006-02-24 04:48:15 +00:00
|
|
|
BYTE MinMissileChance;// [RH] If a random # is > than this, then missile attack.
|
2008-03-12 02:56:11 +00:00
|
|
|
SBYTE LastLookPlayerNumber;// Player number last looked for (if TIDtoHate == 0)
|
2009-09-06 01:49:17 +00:00
|
|
|
WORD BounceFlags; // which bouncing type?
|
2010-09-19 00:06:45 +00:00
|
|
|
DWORD SpawnFlags; // Increased to DWORD because of Doom 64
|
2007-04-22 21:01:35 +00:00
|
|
|
fixed_t meleerange; // specifies how far a melee attack reaches.
|
|
|
|
fixed_t meleethreshold; // Distance below which a monster doesn't try to shoot missiles anynore
|
|
|
|
// but instead tries to come closer for a melee attack.
|
|
|
|
// This is not the same as meleerange
|
|
|
|
fixed_t maxtargetrange; // any target farther away cannot be attacked
|
2006-04-11 16:27:41 +00:00
|
|
|
fixed_t bouncefactor; // Strife's grenades use 50%, Hexen's Flechettes 70.
|
2008-06-10 09:16:01 +00:00
|
|
|
fixed_t wallbouncefactor; // The bounce factor for walls can be different.
|
2006-04-18 22:15:05 +00:00
|
|
|
int bouncecount; // Strife's grenades only bounce twice before exploding
|
2007-01-20 14:27:44 +00:00
|
|
|
fixed_t gravity; // [GRB] Gravity factor
|
2014-07-29 04:15:50 +00:00
|
|
|
fixed_t Friction;
|
2007-11-28 13:53:55 +00:00
|
|
|
int FastChaseStrafeCount;
|
2009-06-05 21:44:34 +00:00
|
|
|
fixed_t pushfactor;
|
2009-06-14 13:47:38 +00:00
|
|
|
int lastpush;
|
2009-09-14 19:44:14 +00:00
|
|
|
int activationtype; // How the thing behaves when activated with USESPECIAL or BUMPSPECIAL
|
2009-10-09 20:35:07 +00:00
|
|
|
int lastbump; // Last time the actor was bumped, used to control BUMPSPECIAL
|
2009-09-14 19:44:14 +00:00
|
|
|
int Score; // manipulated by score items, ACS or DECORATE. The engine doesn't use this itself for anything.
|
2011-01-12 00:17:13 +00:00
|
|
|
FString * Tag; // Strife's tag name.
|
2011-01-22 03:35:33 +00:00
|
|
|
int DesignatedTeam; // Allow for friendly fire cacluations to be done on non-players.
|
2008-04-08 20:52:49 +00:00
|
|
|
|
|
|
|
AActor *BlockingMobj; // Actor that blocked the last move
|
|
|
|
line_t *BlockingLine; // Line that blocked the last move
|
|
|
|
|
2010-07-23 21:36:17 +00:00
|
|
|
int PoisonDamage; // Damage received per tic from poison.
|
2011-06-13 10:39:14 +00:00
|
|
|
FNameNoInit PoisonDamageType; // Damage type dealt by poison.
|
2010-07-23 21:36:17 +00:00
|
|
|
int PoisonDuration; // Duration left for receiving poison damage.
|
|
|
|
int PoisonPeriod; // How often poison damage is applied. (Every X tics.)
|
|
|
|
|
|
|
|
int PoisonDamageReceived; // Damage received per tic from poison.
|
2011-06-13 10:39:14 +00:00
|
|
|
FNameNoInit PoisonDamageTypeReceived; // Damage type received by poison.
|
2010-07-23 21:36:17 +00:00
|
|
|
int PoisonDurationReceived; // Duration left for receiving poison damage.
|
|
|
|
int PoisonPeriodReceived; // How often poison damage is applied. (Every X tics.)
|
|
|
|
TObjPtr<AActor> Poisoner; // Last source of received poison damage.
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// a linked list of sectors where this object appears
|
2008-06-01 20:43:02 +00:00
|
|
|
struct msecnode_t *touching_sectorlist; // phares 3/14/98
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-03-12 02:56:11 +00:00
|
|
|
TObjPtr<AInventory> Inventory; // [RH] This actor's inventory
|
2006-02-24 04:48:15 +00:00
|
|
|
DWORD InventoryID; // A unique ID to keep track of inventory items
|
|
|
|
|
|
|
|
//Added by MC:
|
|
|
|
SDWORD id; // Player ID (for items, # in list.)
|
|
|
|
|
2008-04-04 14:31:20 +00:00
|
|
|
BYTE smokecounter;
|
2006-02-24 04:48:15 +00:00
|
|
|
BYTE FloatBobPhase;
|
|
|
|
BYTE FriendPlayer; // [RH] Player # + 1 this friendly monster works for (so 0 is no player, 1 is player 0, etc)
|
2007-12-26 16:06:03 +00:00
|
|
|
DWORD Translation;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// [RH] Stuff that used to be part of an Actor Info
|
2008-06-15 02:25:09 +00:00
|
|
|
FSoundIDNoInit SeeSound;
|
|
|
|
FSoundIDNoInit AttackSound;
|
|
|
|
FSoundIDNoInit PainSound;
|
|
|
|
FSoundIDNoInit DeathSound;
|
|
|
|
FSoundIDNoInit ActiveSound;
|
|
|
|
FSoundIDNoInit UseSound; // [RH] Sound to play when an actor is used.
|
2009-05-23 08:30:36 +00:00
|
|
|
FSoundIDNoInit BounceSound;
|
|
|
|
FSoundIDNoInit WallBounceSound;
|
2010-03-21 08:09:45 +00:00
|
|
|
FSoundIDNoInit CrushPainSound;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
fixed_t Speed;
|
2006-05-14 14:30:13 +00:00
|
|
|
fixed_t FloatSpeed;
|
2006-02-24 04:48:15 +00:00
|
|
|
fixed_t MaxDropOffHeight, MaxStepHeight;
|
|
|
|
SDWORD Mass;
|
|
|
|
SWORD PainChance;
|
2009-10-08 17:43:50 +00:00
|
|
|
int PainThreshold;
|
2006-10-31 14:53:21 +00:00
|
|
|
FNameNoInit DamageType;
|
2011-06-06 22:23:43 +00:00
|
|
|
FNameNoInit DamageTypeReceived;
|
2009-10-15 20:09:22 +00:00
|
|
|
fixed_t DamageFactor;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2011-06-13 17:15:09 +00:00
|
|
|
FNameNoInit PainType;
|
|
|
|
FNameNoInit DeathType;
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
FState *SpawnState;
|
|
|
|
FState *SeeState;
|
|
|
|
FState *MeleeState;
|
|
|
|
FState *MissileState;
|
|
|
|
|
2010-08-20 12:20:51 +00:00
|
|
|
|
|
|
|
int ConversationRoot; // THe root of the current dialogue
|
|
|
|
FStrifeDialogueNode *Conversation; // [RH] The dialogue to show when this actor is "used."
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// [RH] Decal(s) this weapon/projectile generates on impact.
|
|
|
|
FDecalBase *DecalGenerator;
|
|
|
|
|
|
|
|
// [RH] Used to interpolate the view to get >35 FPS
|
|
|
|
fixed_t PrevX, PrevY, PrevZ;
|
2009-12-30 12:20:47 +00:00
|
|
|
angle_t PrevAngle;
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// ThingIDs
|
|
|
|
static void ClearTIDHashes ();
|
|
|
|
void AddToHash ();
|
|
|
|
void RemoveFromHash ();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static AActor *TIDHash[128];
|
|
|
|
static inline int TIDHASH (int key) { return key & 127; }
|
2011-01-12 00:17:13 +00:00
|
|
|
static FSharedStringArena mStringPropertyData;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
friend class FActorIterator;
|
2012-08-01 03:12:43 +00:00
|
|
|
friend bool P_IsTIDUsed(int tid);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
sector_t *LinkToWorldForMapThing ();
|
|
|
|
|
|
|
|
public:
|
|
|
|
void LinkToWorld (bool buggy=false);
|
|
|
|
void LinkToWorld (sector_t *sector);
|
|
|
|
void UnlinkFromWorld ();
|
|
|
|
void AdjustFloorClip ();
|
|
|
|
void SetOrigin (fixed_t x, fixed_t y, fixed_t z);
|
2006-04-16 13:29:50 +00:00
|
|
|
bool InStateSequence(FState * newstate, FState * basestate);
|
|
|
|
int GetTics(FState * newstate);
|
2010-04-19 02:46:50 +00:00
|
|
|
bool SetState (FState *newstate, bool nofunction=false);
|
2007-02-04 00:22:56 +00:00
|
|
|
virtual bool UpdateWaterLevel (fixed_t oldz, bool splash=true);
|
2007-10-29 22:15:46 +00:00
|
|
|
bool isFast();
|
2014-04-15 19:01:49 +00:00
|
|
|
bool isSlow();
|
2008-04-03 10:49:54 +00:00
|
|
|
void SetIdle();
|
2010-09-19 00:06:45 +00:00
|
|
|
void ClearCounters();
|
2014-05-05 09:24:20 +00:00
|
|
|
FState *GetRaiseState();
|
|
|
|
void Revive();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-09-22 18:55:29 +00:00
|
|
|
FState *FindState (FName label) const
|
|
|
|
{
|
|
|
|
return GetClass()->ActorInfo->FindState(1, &label);
|
|
|
|
}
|
|
|
|
|
|
|
|
FState *FindState (FName label, FName sublabel, bool exact = false) const
|
|
|
|
{
|
2008-10-14 01:56:28 +00:00
|
|
|
FName names[] = { label, sublabel };
|
|
|
|
return GetClass()->ActorInfo->FindState(2, names, exact);
|
2008-09-22 18:55:29 +00:00
|
|
|
}
|
|
|
|
|
2013-05-04 22:52:37 +00:00
|
|
|
FState *FindState(int numnames, FName *names, bool exact = false) const
|
|
|
|
{
|
|
|
|
return GetClass()->ActorInfo->FindState(numnames, names, exact);
|
|
|
|
}
|
|
|
|
|
2006-10-31 21:49:45 +00:00
|
|
|
bool HasSpecialDeathStates () const;
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class FActorIterator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FActorIterator (int i) : base (NULL), id (i)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
FActorIterator (int i, AActor *start) : base (start), id (i)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
AActor *Next ()
|
|
|
|
{
|
|
|
|
if (id == 0)
|
|
|
|
return NULL;
|
|
|
|
if (!base)
|
|
|
|
base = AActor::TIDHash[id & 127];
|
|
|
|
else
|
|
|
|
base = base->inext;
|
|
|
|
|
|
|
|
while (base && base->tid != id)
|
|
|
|
base = base->inext;
|
|
|
|
|
|
|
|
return base;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
AActor *base;
|
|
|
|
int id;
|
|
|
|
};
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
class TActorIterator : public FActorIterator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TActorIterator (int id) : FActorIterator (id) {}
|
|
|
|
T *Next ()
|
|
|
|
{
|
|
|
|
AActor *actor;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
actor = FActorIterator::Next ();
|
|
|
|
} while (actor && !actor->IsKindOf (RUNTIME_CLASS(T)));
|
|
|
|
return static_cast<T *>(actor);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-12-02 15:38:50 +00:00
|
|
|
class NActorIterator : public FActorIterator
|
|
|
|
{
|
|
|
|
const PClass *type;
|
|
|
|
public:
|
|
|
|
NActorIterator (const PClass *cls, int id) : FActorIterator (id) { type = cls; }
|
|
|
|
NActorIterator (FName cls, int id) : FActorIterator (id) { type = PClass::FindClass(cls); }
|
|
|
|
NActorIterator (const char *cls, int id) : FActorIterator (id) { type = PClass::FindClass(cls); }
|
|
|
|
AActor *Next ()
|
|
|
|
{
|
|
|
|
AActor *actor;
|
|
|
|
if (type == NULL) return NULL;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
actor = FActorIterator::Next ();
|
|
|
|
} while (actor && !actor->IsKindOf (type));
|
|
|
|
return actor;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-08-01 03:12:43 +00:00
|
|
|
bool P_IsTIDUsed(int tid);
|
|
|
|
int P_FindUniqueTID(int start_tid, int limit);
|
|
|
|
|
2006-07-16 09:10:45 +00:00
|
|
|
inline AActor *Spawn (const PClass *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2006-07-16 09:10:45 +00:00
|
|
|
return AActor::StaticSpawn (type, x, y, z, allowreplacement);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
2006-07-31 10:22:53 +00:00
|
|
|
AActor *Spawn (const char *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement);
|
2010-01-08 03:24:22 +00:00
|
|
|
AActor *Spawn (FName classname, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
template<class T>
|
2006-07-16 09:10:45 +00:00
|
|
|
inline T *Spawn (fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2006-07-16 09:10:45 +00:00
|
|
|
return static_cast<T *>(AActor::StaticSpawn (RUNTIME_CLASS(T), x, y, z, allowreplacement));
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
2011-06-13 10:22:47 +00:00
|
|
|
|
2009-09-14 19:44:14 +00:00
|
|
|
void PrintMiscActorInfo(AActor * query);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
#define S_FREETARGMOBJ 1
|
|
|
|
|
|
|
|
#endif // __P_MOBJ_H__
|