Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
veil.qc
Go to the documentation of this file.
1#include "veil.qh"
2
3#ifdef SVQC
4#include "entrap.qh"
5
7{
8 if ( IS_REAL_CLIENT(toucher) || (IS_VEHICLE(toucher) && toucher.owner) )
9 {
10 entity real_toucher = (IS_VEHICLE(toucher) && toucher.owner) ? toucher.owner : toucher;
11
12 float tint_alpha = 0.75;
13 if(SAME_TEAM(toucher, this.realowner))
14 {
15 tint_alpha = 0.45;
16 if(!real_toucher.nade_veil_time)
17 {
18 toucher.nade_veil_prevalpha = toucher.alpha;
19 toucher.alpha = -1;
20 }
21 }
22 real_toucher.nade_veil_time = time + 0.1;
23 }
24}
25
27{
29
31 orb.colormod = NADE_TYPE_VEIL.m_color;
32}
33
35{
36 if(player.nade_veil_time && player.nade_veil_time <= time)
37 {
38 player.nade_veil_time = 0;
39 if(player.vehicle)
40 player.vehicle.alpha = player.vehicle.nade_veil_prevalpha;
41 else
42 player.alpha = player.nade_veil_prevalpha;
43 }
44}
45#endif // SVQC
46#ifdef MENUQC
47#include "darkness.qh"
48
49METHOD(VeilNade, describe, string(VeilNade this))
50{
51 TC(VeilNade, this);
53 PAR(_("The %s detonates after a short delay, temporarily creating an orb around the point where it detonated for several seconds. "
54 "Players inside the orb will be invisible to those outside it."), COLORED_NAME(this));
55 PAR(_("This is sort of the opposite of the %s."), COLORED_NAME(NADE_TYPE_DARKNESS));
56 return PAGE_TEXT;
57}
58#endif // MENUQC
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity owner
Definition main.qh:87
#define COLORED_NAME(this)
Definition color.qh:195
float time
vector origin
#define TC(T, sym)
Definition _all.inc:82
#define METHOD(cname, name, prototype)
Definition oo.qh:269
entity entity toucher
Definition self.qh:72
#define settouch(e, f)
Definition self.qh:73
#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
entity nades_spawn_orb(entity own, entity realown, vector org, float orb_ltime, float orb_rad)
Definition sv_nades.qc:75
#define SAME_TEAM(a, b)
Definition teams.qh:241
entity realowner
#define IS_REAL_CLIENT(v)
Definition utils.qh:17
#define IS_VEHICLE(v)
Definition utils.qh:22
void nade_veil_Apply(entity player)
Definition veil.qc:34
void nade_veil_boom(entity this)
Definition veil.qc:26
void nade_veil_touch(entity this, entity toucher)
Definition veil.qc:6
float autocvar_g_nades_veil_radius
Definition veil.qh:8
float autocvar_g_nades_veil_time
Definition veil.qh:7