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

Go to the source code of this file.

Functions

void nade_napalm_ball (entity this)
void nade_napalm_boom (entity this)
void napalm_ball_think (entity this)
bool napalm_damage_cond (entity e)
void napalm_fountain_think (entity this)

Function Documentation

◆ nade_napalm_ball()

void nade_napalm_ball ( entity this)

Definition at line 42 of file napalm.qc.

43{
45
46 entity proj = new(grenade);
47 proj.owner = this.owner;
48 proj.realowner = this.realowner;
49 proj.team = this.owner.team;
50 proj.bot_dodge = true;
51 proj.bot_dodgerating = autocvar_g_nades_napalm_ball_damage;
53 proj.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
55 setmodel(proj, MDL_Null);
56 proj.scale = 1;//0.5;
57 setsize(proj, '-4 -4 -4', '4 4 4');
58 setorigin(proj, this.origin);
60 proj.nextthink = time;
62 proj.effects = EF_LOWPRECISION | EF_FLAME;
63
64 vector kick;
67 kick.z = autocvar_g_nades_napalm_ball_spread * (random() * 0.5 + 0.5);
68 proj.velocity = kick;
69
71
72 proj.angles = vectoangles(proj.velocity);
73 proj.flags = FL_PROJECTILE;
75 IL_PUSH(g_bot_dodge, proj);
76 proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
77
78 //CSQCProjectile(proj, true, PROJECTILE_NAPALM_FIRE, true);
79}
IntrusiveList g_bot_dodge
Definition api.qh:150
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity owner
Definition main.qh:87
#define setmodel(this, m)
Definition model.qh:26
const int FL_PROJECTILE
Definition constants.qh:77
float time
const float EF_FLAME
vector origin
float EF_LOWPRECISION
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
float random(void)
vector vectoangles(vector v)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_BOUNCE
Definition movetypes.qh:143
void napalm_ball_think(entity this)
Definition napalm.qc:12
float autocvar_g_nades_napalm_ball_damage
Definition napalm.qh:9
float autocvar_g_nades_napalm_ball_damageforcescale
Definition napalm.qh:10
float autocvar_g_nades_napalm_ball_lifetime
Definition napalm.qh:11
float autocvar_g_nades_napalm_ball_spread
Definition napalm.qh:8
#define crandom()
Returns a random number between -1.0 and 1.0.
Definition random.qh:32
#define setthink(e, f)
vector
Definition self.qh:96
const int MIF_SPLASH
Definition common.qh:58
IntrusiveList g_projectiles
Definition common.qh:70
const int MIF_PROXY
Definition common.qh:60
const int MIF_ARC
Definition common.qh:59
#define PROJECTILE_MAKETRIGGER(e)
Definition common.qh:46
const float VOL_BASE
Definition sound.qh:36
const int CH_SHOTS
Definition sound.qh:14
const float ATTEN_NORM
Definition sound.qh:30
#define SND_NADE_NAPALM_FIRE
Definition all.inc:185
float spamsound(entity e, int chan, Sound samp, float vol, float _atten)
use this one if you might be causing spam (e.g.
Definition all.qc:124
entity realowner

References ATTEN_NORM, autocvar_g_nades_napalm_ball_damage, autocvar_g_nades_napalm_ball_damageforcescale, autocvar_g_nades_napalm_ball_lifetime, autocvar_g_nades_napalm_ball_spread, CH_SHOTS, crandom, EF_FLAME, EF_LOWPRECISION, entity(), FL_PROJECTILE, g_bot_dodge, g_projectiles, IL_PUSH(), MIF_ARC, MIF_PROXY, MIF_SPLASH, MOVETYPE_BOUNCE, napalm_ball_think(), origin, owner, PROJECTILE_MAKETRIGGER, random(), realowner, set_movetype(), setmodel, setthink, SND_NADE_NAPALM_FIRE, spamsound(), time, vectoangles(), vector, and VOL_BASE.

Referenced by nade_napalm_boom(), and napalm_fountain_think().

◆ nade_napalm_boom()

void nade_napalm_boom ( entity this)

Definition at line 116 of file napalm.qc.

117{
118 for (int c = 0; c < autocvar_g_nades_napalm_ball_count; ++c)
119 nade_napalm_ball(this);
120
121 entity fountain = new(nade_napalm_fountain);
122 fountain.owner = this.owner;
123 fountain.realowner = this.realowner;
124 fountain.origin = this.origin;
125 fountain.flags = FL_PROJECTILE;
126 IL_PUSH(g_projectiles, fountain);
127 IL_PUSH(g_bot_dodge, fountain);
128 setorigin(fountain, fountain.origin);
130 fountain.nextthink = time;
132 fountain.pushltime = fountain.ltime;
133 fountain.team = this.team;
134 set_movetype(fountain, MOVETYPE_TOSS);
135 fountain.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
136 fountain.bot_dodge = true;
137 fountain.bot_dodgerating = autocvar_g_nades_napalm_fountain_damage;
138 fountain.nade_special_time = time;
139 setsize(fountain, '-16 -16 -16', '16 16 16');
140 CSQCProjectile(fountain, true, PROJECTILE_NAPALM_FOUNTAIN, true);
141}
int team
Definition main.qh:188
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
const int MOVETYPE_TOSS
Definition movetypes.qh:139
void napalm_fountain_think(entity this)
Definition napalm.qc:81
void nade_napalm_ball(entity this)
Definition napalm.qc:42
const int PROJECTILE_NAPALM_FOUNTAIN
Definition napalm.qh:27
float autocvar_g_nades_napalm_fountain_lifetime
Definition napalm.qh:13
int autocvar_g_nades_napalm_ball_count
Definition napalm.qh:7
float autocvar_g_nades_napalm_fountain_damage
Definition napalm.qh:16

References autocvar_g_nades_napalm_ball_count, autocvar_g_nades_napalm_fountain_damage, autocvar_g_nades_napalm_fountain_lifetime, CSQCProjectile(), entity(), FL_PROJECTILE, g_bot_dodge, g_projectiles, IL_PUSH(), MOVETYPE_TOSS, nade_napalm_ball(), napalm_fountain_think(), origin, owner, PROJECTILE_NAPALM_FOUNTAIN, realowner, set_movetype(), setthink, team, and time.

Referenced by nade_boom().

◆ napalm_ball_think()

void napalm_ball_think ( entity this)

Definition at line 12 of file napalm.qc.

13{
15 || time > this.pushltime)
16 {
17 delete(this);
18 return;
19 }
20
21 vector midpoint = (this.absmin + this.absmax) * 0.5;
22 if (pointcontents(midpoint) == CONTENT_WATER)
23 {
24 this.velocity *= 0.5;
25
26 if (pointcontents(midpoint + '0 0 16') == CONTENT_WATER)
27 this.velocity.z = 200;
28 }
29
30 this.angles = vectoangles(this.velocity);
31
32 W_LaserPlay(this,
35 autocvar_g_nades_napalm_ball_damage, // TODO: missing cvar
38
39 this.nextthink = time + 0.1;
40}
vector velocity
const float CONTENT_WATER
float nextthink
vector absmax
vector absmin
ent angles
Definition ent_cs.qc:146
float pushltime
Definition jumppads.qh:21
bool napalm_damage_cond(entity e)
Definition napalm.qc:4
float autocvar_g_nades_napalm_burntime
Definition napalm.qh:18
float autocvar_g_nades_napalm_ball_radius
Definition napalm.qh:12
#define round_handler_IsActive()
#define round_handler_IsRoundStarted()
void W_LaserPlay(entity this, float rad, float damage, float edgedamage, float burntime, WarpZone_FindRadius_cond_callback_t cb)
Randomly chooses a player within the radius to shoot a laser towards.
Definition common.qc:191

References absmax, absmin, angles, autocvar_g_nades_napalm_ball_damage, autocvar_g_nades_napalm_ball_radius, autocvar_g_nades_napalm_burntime, CONTENT_WATER, entity(), napalm_damage_cond(), nextthink, pushltime, round_handler_IsActive, round_handler_IsRoundStarted, time, vectoangles(), vector, velocity, and W_LaserPlay().

Referenced by nade_napalm_ball().

◆ napalm_damage_cond()

bool napalm_damage_cond ( entity e)

Definition at line 4 of file napalm.qc.

5{
6 return (e.takedamage == DAMAGE_AIM
9 && !STAT(FROZEN, e));
10}
#define IS_PLAYER(s)
Definition player.qh:242
#define STAT(...)
Definition stats.qh:94
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
Definition common.qh:71
bool autocvar_g_nades_napalm_selfdamage
Definition napalm.qh:19
const int DAMAGE_AIM
Definition subs.qh:81
#define DIFF_TEAM(a, b)
Definition teams.qh:242

References autocvar_g_nades_napalm_selfdamage, DAMAGE_AIM, DIFF_TEAM, entity(), IS_PLAYER, STAT, and WarpZone_SearchInRadius_otherent.

Referenced by napalm_ball_think(), and napalm_fountain_think().

◆ napalm_fountain_think()

void napalm_fountain_think ( entity this)

Definition at line 81 of file napalm.qc.

82{
84 || time >= this.ltime)
85 {
86 delete(this);
87 return;
88 }
89
90 vector midpoint = (this.absmin + this.absmax) * 0.5;
91 if (pointcontents(midpoint) == CONTENT_WATER)
92 {
93 this.velocity *= 0.5;
94
95 if (pointcontents(midpoint + '0 0 16') == CONTENT_WATER)
96 this.velocity.z = 200;
97
99 }
100
101 W_LaserPlay(this,
107
108 this.nextthink = time + 0.1;
109 if (time >= this.nade_special_time)
110 {
112 nade_napalm_ball(this);
113 }
114}
float ltime
Definition net.qh:10
void UpdateCSQCProjectile(entity e)
float autocvar_g_nades_napalm_fountain_radius
Definition napalm.qh:15
float autocvar_g_nades_napalm_fountain_edgedamage
Definition napalm.qh:17
float autocvar_g_nades_napalm_fountain_delay
Definition napalm.qh:14
float nade_special_time
Definition sv_nades.qh:47

References absmax, absmin, autocvar_g_nades_napalm_burntime, autocvar_g_nades_napalm_fountain_damage, autocvar_g_nades_napalm_fountain_delay, autocvar_g_nades_napalm_fountain_edgedamage, autocvar_g_nades_napalm_fountain_radius, CONTENT_WATER, entity(), ltime, nade_napalm_ball(), nade_special_time, napalm_damage_cond(), nextthink, round_handler_IsActive, round_handler_IsRoundStarted, time, UpdateCSQCProjectile(), vector, velocity, and W_LaserPlay().

Referenced by nade_napalm_boom().