Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
flight.qc
Go to the documentation of this file.
1#include "flight.qh"
2
3#ifdef SVQC
4METHOD(FlightBuff, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
5{
6 bool was_active = actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE);
7 if (!was_active)
8 {
9 actor.buff_flight_oldgravity = actor.gravity;
10 if (!actor.gravity)
11 actor.gravity = 1;
12 }
13 SUPER(FlightBuff).m_apply(this, actor, eff_time, eff_flags);
14}
15METHOD(FlightBuff, m_remove, void(StatusEffect this, entity actor, int removal_type))
16{
17 bool was_active = actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE);
18 if (was_active)
19 actor.gravity = (actor.trigger_gravity_check)
20 ? actor.trigger_gravity_check.enemy.gravity
22 actor.buff_flight_oldgravity = 0;
23 SUPER(FlightBuff).m_remove(this, actor, removal_type);
24}
25#endif // SVQC
26#ifdef MENUQC
27METHOD(FlightBuff, describe, string(FlightBuff this))
28{
29 TC(FlightBuff, this);
31 PAR(_("While you have the %s buff, you can crouch while mid-air to switch your gravity, allowing flight."), COLORED_NAME(this));
32 return PAGE_TEXT;
33}
34#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define COLORED_NAME(this)
Definition color.qh:195
int m_id
Definition effect.qh:19
float buff_flight_oldgravity
Definition flight.qh:6
#define TC(T, sym)
Definition _all.inc:82
@ STATUSEFFECT_FLAG_ACTIVE
Definition all.qh:22
#define SUPER(cname)
Definition oo.qh:231
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define PAGE_TEXT
Definition string.qh:643
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:649
#define PAGE_TEXT_INIT()
Definition string.qh:642