Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
door_rotating.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void door_rotating_go_down (entity this)
void door_rotating_go_up (entity this, entity oth)

Variables

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)

Function Documentation

◆ door_rotating_go_down()

void door_rotating_go_down ( entity this)

Definition at line 54 of file door_rotating.qc.

55{
56 if (this.noise2 != "")
58 if (this.max_health)
59 {
61 SetResourceExplicit(this, RES_HEALTH, this.max_health);
62 }
63
64 this.state = STATE_DOWN;
66}
float max_health
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
int state
void door_rotating_hit_bottom(entity this)
float speed
Definition dynlight.qc:9
const int CH_TRIGGER_SINGLE
Definition sound.qh:13
const float VOL_BASE
Definition sound.qh:36
#define _sound(e, c, s, v, a)
Definition sound.qh:43
const float ATTEN_NORM
Definition sound.qh:30
void SUB_CalcAngleMove(entity this, vector destangle, float tspeedtype, float tspeed, void(entity this) func)
Definition subs.qc:347
const int DAMAGE_YES
Definition subs.qh:80
vector pos1
Definition subs.qh:50
string noise2
Definition subs.qh:83
const int TSPEED_LINEAR
Definition subs.qh:71
float takedamage
Definition subs.qh:78
#define STATE_DOWN
Definition sys-pre.qh:31

References _sound, ATTEN_NORM, CH_TRIGGER_SINGLE, DAMAGE_YES, door_rotating_hit_bottom(), entity(), max_health, noise2, pos1, SetResourceExplicit(), speed, state, STATE_DOWN, SUB_CalcAngleMove(), takedamage, TSPEED_LINEAR, and VOL_BASE.

Referenced by door_blocked(), door_generic_plat_blocked(), door_hit_top(), door_rotating_hit_top(), and door_use().

◆ door_rotating_go_up()

void door_rotating_go_up ( entity this,
entity oth )

Definition at line 68 of file door_rotating.qc.

69{
70 if (this.state == STATE_UP)
71 return; // already going up
72
73 if (this.state == STATE_TOP)
74 { // reset top wait time
75 this.nextthink = this.ltime + this.wait;
76 return;
77 }
78 if (this.noise2 != "")
80 this.state = STATE_UP;
82
83 string oldmessage;
84 oldmessage = this.message;
85 this.message = "";
86 SUB_UseTargets(this, NULL, oth); // TODO: is oth needed here?
87 this.message = oldmessage;
88}
string message
Definition powerups.qc:19
float wait
Definition items.qc:17
float nextthink
void door_rotating_hit_top(entity this)
void SUB_UseTargets(entity this, entity actor, entity trigger)
Definition triggers.qc:344
float ltime
Definition net.qc:10
#define NULL
Definition post.qh:14
vector pos2
Definition subs.qh:50
#define STATE_UP
Definition sys-pre.qh:30
#define STATE_TOP
Definition sys-pre.qh:28

References _sound, ATTEN_NORM, CH_TRIGGER_SINGLE, door_rotating_hit_top(), entity(), ltime, message, nextthink, noise2, NULL, pos2, speed, state, STATE_TOP, STATE_UP, SUB_CalcAngleMove(), SUB_UseTargets(), TSPEED_LINEAR, VOL_BASE, and wait.

Referenced by door_blocked(), door_generic_plat_blocked(), and door_use().

Variable Documentation

◆ DOOR_ROTATING_BIDIR

const int DOOR_ROTATING_BIDIR = BIT(1)

Definition at line 4 of file door_rotating.qh.

Referenced by door_use().

◆ DOOR_ROTATING_BIDIR_IN_DOWN

const int DOOR_ROTATING_BIDIR_IN_DOWN = BIT(3)

Definition at line 5 of file door_rotating.qh.

Referenced by door_use().

◆ DOOR_ROTATING_XAXIS

const int DOOR_ROTATING_XAXIS = BIT(6)

Definition at line 7 of file door_rotating.qh.

Referenced by spawnfunc().

◆ DOOR_ROTATING_YAXIS

const int DOOR_ROTATING_YAXIS = BIT(7)

Definition at line 8 of file door_rotating.qh.

Referenced by spawnfunc().