this.dmgtime2 = time;
// how far to bob
- if (this.spawnflags & 1) // X
+ if (this.spawnflags & BOBBING_XAXIS)
this.movedir = '1 0 0' * this.height;
- else if (this.spawnflags & 2) // Y
+ else if (this.spawnflags & BOBBING_YAXIS)
this.movedir = '0 1 0' * this.height;
else // Z
this.movedir = '0 0 1' * this.height;
#pragma once
+#include "../spawnflags.qh"
#include "button.qh"
+#include "../spawnflags.qh"
#ifdef SVQC
// button and multiple button
#pragma once
-
-const int BUTTON_DONTACCUMULATEDMG = 128;
door_go_up(e, actor, trigger);
} else {
// if the BIDIR spawnflag (==2) is set and the trigger has set trigger_reverse, reverse the opening direction
- if ((e.spawnflags & BIDIR) && trigger.trigger_reverse!=0 && e.lip != 666 && e.state == STATE_BOTTOM) {
+ if ((e.spawnflags & DOOR_ROTATING_BIDIR) && trigger.trigger_reverse!=0 && e.lip != 666 && e.state == STATE_BOTTOM) {
e.lip = 666; // e.lip is used to remember reverse opening direction for door_rotating
e.pos2 = '0 0 0' - e.pos2;
}
// if BIDIR_IN_DOWN (==8) is set, prevent the door from reoping during closing if it is triggered from the wrong side
- if (!((e.spawnflags & BIDIR) && (e.spawnflags & BIDIR_IN_DOWN) && e.state == STATE_DOWN
+ if (!((e.spawnflags & DOOR_ROTATING_BIDIR) && (e.spawnflags & DOOR_ROTATING_BIDIR_IN_DOWN) && e.state == STATE_DOWN
&& (((e.lip == 666) && (trigger.trigger_reverse == 0)) || ((e.lip != 666) && (trigger.trigger_reverse != 0)))))
{
door_rotating_go_up(e, trigger);
#pragma once
+#include "../spawnflags.qh"
-// door constants
-const int DOOR_START_OPEN = BIT(0);
-const int DOOR_DONT_LINK = BIT(2);
-const int DOOR_TOGGLE = BIT(5);
-
-const int DOOR_NOSPLASH = BIT(8); // generic anti-splashdamage spawnflag
-
-const int DOOR_NONSOLID = BIT(10);
-const int DOOR_CRUSH = BIT(11); // can't use PLAT_CRUSH cause that is the same as DOOR_DONT_LINK
-
-const int SPAWNFLAGS_GOLD_KEY = BIT(3);
-const int SPAWNFLAGS_SILVER_KEY = BIT(4);
#ifdef CSQC
// stuff for preload
#pragma once
-const int BIDIR = BIT(1);
-const int BIDIR_IN_DOWN = BIT(3);
-
-const int DOOR_ROTATING_XAXIS = BIT(6);
-const int DOOR_ROTATING_YAXIS = BIT(7);
-
#ifdef GAMEQC
void door_rotating_go_down(entity this);
void door_rotating_go_up(entity this, entity oth);
_sound(this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
this.nextthink = this.ltime + 0.1;
- temp = 1 - (this.spawnflags & SECRET_1ST_LEFT); // 1 or -1
+ temp = 1 - (this.spawnflags & DOOR_SECRET_1ST_LEFT); // 1 or -1
makevectors(this.mangle);
if (!this.t_width)
{
- if (this.spawnflags & SECRET_1ST_DOWN)
+ if (this.spawnflags & DOOR_SECRET_1ST_DOWN)
this.t_width = fabs(v_up * this.size);
else
this.t_width = fabs(v_right * this.size);
if (!this.t_length)
this.t_length = fabs(v_forward * this.size);
- if (this.spawnflags & SECRET_1ST_DOWN)
+ if (this.spawnflags & DOOR_SECRET_1ST_DOWN)
this.dest1 = this.origin - v_up * this.t_width;
else
this.dest1 = this.origin + v_right * (this.t_width * temp);
{
if (this.noise3 != "")
_sound(this, CH_TRIGGER_SINGLE, this.noise3, VOL_BASE, ATTEN_NORM);
- if (!(this.spawnflags & SECRET_OPEN_ONCE) && this.wait >= 0)
+ if (!(this.spawnflags & DOOR_SECRET_OPEN_ONCE) && this.wait >= 0)
{
this.nextthink = this.ltime + this.wait;
setthink(this, fd_secret_move4);
void fd_secret_done(entity this)
{
- if (this.spawnflags&SECRET_YES_SHOOT)
+ if (this.spawnflags&DOOR_SECRET_YES_SHOOT)
{
this.health = 10000;
this.takedamage = DAMAGE_YES;
void secret_reset(entity this)
{
- if (this.spawnflags & SECRET_YES_SHOOT)
+ if (this.spawnflags & DOOR_SECRET_YES_SHOOT)
{
this.health = 10000;
this.takedamage = DAMAGE_YES;
{
}
else
- this.spawnflags |= SECRET_YES_SHOOT;
+ this.spawnflags |= DOOR_SECRET_YES_SHOOT;
- if (this.spawnflags & SECRET_YES_SHOOT)
+ if (this.spawnflags & DOOR_SECRET_YES_SHOOT)
{
//this.canteamdamage = true; // TODO
this.health = 10000;
#pragma once
-
-
-const int SECRET_OPEN_ONCE = BIT(0); // stays open - LEGACY, set wait to -1 instead
-const int SECRET_1ST_LEFT = BIT(1); // 1st move is left of arrow
-const int SECRET_1ST_DOWN = BIT(2); // 1st move is down from arrow
-const int SECRET_NO_SHOOT = BIT(3); // only opened by trigger
-const int SECRET_YES_SHOOT = BIT(4); // shootable even if targeted
+#include "../spawnflags.qh"
#pragma once
+#include "spawnflags.qh"
.float dmgtime2;
void plat_go_up(entity this);
void plat_go_down(entity this);
void plat_crush(entity this, entity blocker);
-const float PLAT_LOW_TRIGGER = 1;
-
-const int PLAT_CRUSH = BIT(2);
.float dmg;
--- /dev/null
+#pragma once
+
+// bobbing
+const int BOBBING_XAXIS = BIT(0);
+const int BOBBING_YAXIS = BIT(1);
+
+// button
+const int BUTTON_DONTACCUMULATEDMG = BIT(7);
+
+// door, door_rotating and door_secret
+const int DOOR_START_OPEN = BIT(0);
+const int DOOR_DONT_LINK = BIT(2);
+const int SPAWNFLAGS_GOLD_KEY = BIT(3); // Quake 1 compat, can only be used with func_door!
+const int SPAWNFLAGS_SILVER_KEY = BIT(4); // Quake 1 compat, can only be used with func_door!
+const int DOOR_TOGGLE = BIT(5);
+
+const int DOOR_NOSPLASH = BIT(8); // generic anti-splashdamage spawnflag
+
+const int DOOR_NONSOLID = BIT(10);
+const int DOOR_CRUSH = BIT(11); // can't use PLAT_CRUSH cause that is the same as DOOR_DONT_LINK
+
+const int DOOR_ROTATING_BIDIR = BIT(1);
+const int DOOR_ROTATING_BIDIR_IN_DOWN = BIT(3);
+
+const int DOOR_ROTATING_XAXIS = BIT(6);
+const int DOOR_ROTATING_YAXIS = BIT(7);
+
+const int DOOR_SECRET_OPEN_ONCE = BIT(0); // stays open - LEGACY, set wait to -1 instead
+const int DOOR_SECRET_1ST_LEFT = BIT(1); // 1st move is left of arrow
+const int DOOR_SECRET_1ST_DOWN = BIT(2); // 1st move is down from arrow
+const int DOOR_SECRET_NO_SHOOT = BIT(3); // only opened by trigger
+const int DOOR_SECRET_YES_SHOOT = BIT(4); // shootable even if targeted
+
+// jumppads
+const int PUSH_ONCE = BIT(0);
+const int PUSH_SILENT = BIT(1); // not used?
+
+// viewloc
+const int VIEWLOC_NOSIDESCROLL = BIT(0); // NOTE: currently unimplemented
+const int VIEWLOC_FREEAIM = BIT(1);
+const int VIEWLOC_FREEMOVE = BIT(2);
+
+// platforms
+const int PLAT_LOW_TRIGGER = BIT(0);
+const int PLAT_CRUSH = BIT(2);
+
+// teleport
+const int TELEPORT_FLAG_SOUND = BIT(0);
+const int TELEPORT_FLAG_PARTICLES = BIT(1);
+const int TELEPORT_FLAG_TDEATH = BIT(2);
+const int TELEPORT_FLAG_FORCE_TDEATH = BIT(3);
+
+// triggers
+const int SF_TRIGGER_INIT = BIT(0);
+const int SF_TRIGGER_UPDATE = BIT(1);
+const int SF_TRIGGER_RESET = BIT(2);
+
+const int SPAWNFLAG_NOMESSAGE = BIT(0);
+const int SPAWNFLAG_NOTOUCH = BIT(0); // why are these the same?
#pragma once
+#include "spawnflags.qh"
IntrusiveList g_teleporters;
STATIC_INIT(g_teleporters) { g_teleporters = IL_NEW(); }
.entity pusher;
-const float TELEPORT_FLAG_SOUND = 1;
-const float TELEPORT_FLAG_PARTICLES = 2;
-const float TELEPORT_FLAG_TDEATH = 4;
-const float TELEPORT_FLAG_FORCE_TDEATH = 8;
#define TELEPORT_FLAGS_WARPZONE 0
#define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
#include "jumppads.qh"
// TODO: split target_push and put it in the target folder
#ifdef SVQC
-#include "jumppads.qh"
#include <common/physics/movetypes/movetypes.qh>
void trigger_push_use(entity this, entity actor, entity trigger)
#pragma once
+#include "../spawnflags.qh"
IntrusiveList g_jumppads;
STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); }
-const float PUSH_ONCE = 1;
-const float PUSH_SILENT = 2;
-
.float pushltime;
.float istypefrag;
.float height;
#pragma once
+#include "../spawnflags.qh"
.entity viewloc;
-const int VIEWLOC_NOSIDESCROLL = BIT(0); // NOTE: currently unimplemented
-const int VIEWLOC_FREEAIM = BIT(1);
-const int VIEWLOC_FREEMOVE = BIT(2);
-
#ifdef CSQC
.entity goalentity;
.entity enemy;
#pragma once
-
-const float SF_TRIGGER_INIT = 1;
-const float SF_TRIGGER_UPDATE = 2;
-const float SF_TRIGGER_RESET = 4;
-
-const float SPAWNFLAG_NOMESSAGE = 1;
-const float SPAWNFLAG_NOTOUCH = 1;
+#include "spawnflags.qh"
.bool pushable;