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 return;
10
11 entity real_toucher = (IS_VEHICLE(toucher) && toucher.owner) ? toucher.owner : toucher;
12
13 float tint_alpha;
14 if (SAME_TEAM(toucher, this.realowner))
15 {
16 tint_alpha = 0.45;
17 if (!real_toucher.nade_veil_time)
18 {
19 toucher.nade_veil_prevalpha = toucher.alpha;
20 toucher.alpha = -1;
21 }
22 }
23 else
24 tint_alpha = 0.75;
25 real_toucher.nade_veil_time = time + 0.1;
26}
27
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
#define COLORED_NAME(this)
Definition color.qh:195
float time
#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:642
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:648
#define PAGE_TEXT_INIT()
Definition string.qh:641
entity nades_spawn_orb(entity this, float orb_lifetime, float orb_rad)
Spawns an orb for some nade types.
Definition sv_nades.qc:79
#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:24
void nade_veil_Apply(entity player)
Definition veil.qc:34
void nade_veil_boom(entity this)
Definition veil.qc:28
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