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

Go to the source code of this file.

Functions

void SendCSQCVaporizerBeamParticle (entity player, int hit)
void W_RocketMinsta_Attack (entity actor,.entity weaponentity, int mode)
void W_RocketMinsta_Explosion (entity actor,.entity weaponentity, vector loc)
void W_RocketMinsta_Laser_Damage (entity this, entity directhitentity)
void W_RocketMinsta_Laser_Explode (entity this, entity directhitentity)
void W_RocketMinsta_Laser_Explode_use (entity this, entity actor, entity trigger)
void W_RocketMinsta_Laser_Touch (entity this, entity toucher)
void W_Vaporizer_Attack (Weapon thiswep, entity actor,.entity weaponentity)

Function Documentation

◆ SendCSQCVaporizerBeamParticle()

void SendCSQCVaporizerBeamParticle ( entity player,
int hit )

Definition at line 8 of file vaporizer.qc.

8 {
9 vector v;
11 WriteHeader(MSG_BROADCAST, TE_CSQC_VAPORBEAMPARTICLE);
12 WriteVector(MSG_BROADCAST, w_shotorg);
13 WriteVector(MSG_BROADCAST, v);
16}
vector trace_endpos
#define WriteHeader(to, id)
Definition net.qh:221
vector WarpZone_UnTransformOrigin(entity wz, vector v)
Definition common.qc:545
entity WarpZone_trace_transform
Definition common.qh:37
void WriteByte(float data, float dest, float desto)
float MSG_BROADCAST
Definition menudefs.qc:55
#define etof(e)
Definition misc.qh:25
vector
Definition self.qh:92
vector w_shotorg
Definition tracing.qh:19

References entity(), etof, MSG_BROADCAST, trace_endpos, vector, w_shotorg, WarpZone_trace_transform, WarpZone_UnTransformOrigin(), WriteByte(), and WriteHeader.

Referenced by W_Vaporizer_Attack().

◆ W_RocketMinsta_Attack()

void W_RocketMinsta_Attack ( entity actor,
.entity weaponentity,
int mode )

Definition at line 191 of file vaporizer.qc.

192{
193 makevectors(actor.v_angle);
194
195 entity proj;
196 int laser_count = max(1, autocvar_g_rm_laser_count);
197 int total = (mode == 0) ? laser_count : 1;
198 Sound snd = (mode == 0) ? SND_CRYLINK_FIRE : SND_ELECTRO_FIRE2; // WEAPONTODO multiple references to other weapons here!
199 W_SetupShot_ProjectileSize(actor, weaponentity, '0 0 -3', '0 0 -3', false, 2, snd, CH_WEAPON_A, autocvar_g_rm_laser_damage, WEP_ELECTRO.m_id);
200
201 // uses electro effects
202 W_MuzzleFlash(WEP_ELECTRO, actor, weaponentity, w_shotorg, w_shotdir);
203
204 for (int counter = 0; counter < total; ++counter)
205 {
206 proj = new(plasma_prim);
207 proj.owner = proj.realowner = actor;
208 proj.bot_dodge = true;
209 proj.bot_dodgerating = autocvar_g_rm_laser_damage;
212 proj.nextthink = time + autocvar_g_rm_laser_lifetime;
214 proj.projectiledeathtype = WEP_ELECTRO.m_id;
215 proj.weaponentity_fld = weaponentity;
216 setorigin(proj, w_shotorg);
217
218 proj.rm_laser_count = total;
219
220 //W_SetupProjectileVelocity(proj, autocvar_g_rm_laser_speed, spread * (rndspread ? random() : 1) * autocvar_g_rm_laser_speed);
221
223 if (mode == 0)
224 {
226 //W_SETUPPROJECTILEVELOCITY(proj, g_balance_minstanex_laser);
227 proj.velocity = (w_shotdir + (((counter + 0.5) / total) * 2 - 1) * v_right * spread) * cvar("g_rm_laser_speed");
228 proj.velocity.z += cvar("g_rm_laser_zspread") * (random() - 0.5);
229 }
230 else
231 proj.velocity = w_shotdir * autocvar_g_rm_laser_speed;
232 proj.velocity = W_CalculateProjectileVelocity(actor, actor.velocity, proj.velocity, true);
233 proj.angles = vectoangles(proj.velocity);
235 setsize(proj, '0 0 -3', '0 0 -3');
236 proj.flags = FL_PROJECTILE;
237 IL_PUSH(g_projectiles, proj);
238 IL_PUSH(g_bot_dodge, proj);
239 proj.missile_flags = MIF_SPLASH;
240
242
243 MUTATOR_CALLHOOK(EditProjectile, actor, proj);
244 }
245}
IntrusiveList g_bot_dodge
Definition api.qh:150
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const int FL_PROJECTILE
Definition constants.qh:85
float time
vector v_right
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
float cvar(string name)
float random(void)
vector vectoangles(vector v)
float max(float f,...)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_BOUNCEMISSILE
Definition movetypes.qh:140
#define makevectors
Definition post.qh:21
const int PROJECTILE_ROCKETMINSTA_LASER
#define setthink(e, f)
#define settouch(e, f)
Definition self.qh:73
void adaptor_think2use_hittype_splash(entity this)
Definition common.qc:106
const int MIF_SPLASH
Definition common.qh:46
IntrusiveList g_projectiles
Definition common.qh:58
#define PROJECTILE_MAKETRIGGER(e)
Definition common.qh:34
const int CH_WEAPON_A
Definition sound.qh:7
float autocvar_g_rm_laser_spread_random
float autocvar_g_rm_laser_spread
float autocvar_g_rm_laser_lifetime
float autocvar_g_rm_laser_count
float autocvar_g_rm_laser_damage
float autocvar_g_rm_laser_speed
vector W_CalculateProjectileVelocity(entity actor, vector pvelocity, vector mvelocity, float forceAbsolute)
Definition tracing.qc:176
vector w_shotdir
Definition tracing.qh:20
#define W_SetupShot_ProjectileSize(ent, wepent, mi, ma, antilag, recoil, snd, chan, maxdamage, deathtype)
Definition tracing.qh:30
void W_RocketMinsta_Laser_Explode_use(entity this, entity actor, entity trigger)
Definition vaporizer.qc:176
void W_RocketMinsta_Laser_Touch(entity this, entity toucher)
Definition vaporizer.qc:181
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
Definition all.qc:728

References adaptor_think2use_hittype_splash(), autocvar_g_rm_laser_count, autocvar_g_rm_laser_damage, autocvar_g_rm_laser_lifetime, autocvar_g_rm_laser_speed, autocvar_g_rm_laser_spread, autocvar_g_rm_laser_spread_random, CH_WEAPON_A, CSQCProjectile(), cvar(), entity(), FL_PROJECTILE, g_bot_dodge, g_projectiles, IL_PUSH(), makevectors, max(), MIF_SPLASH, MOVETYPE_BOUNCEMISSILE, MUTATOR_CALLHOOK, PROJECTILE_MAKETRIGGER, PROJECTILE_ROCKETMINSTA_LASER, random(), set_movetype(), setthink, settouch, time, v_right, vectoangles(), W_CalculateProjectileVelocity(), W_MuzzleFlash(), W_RocketMinsta_Laser_Explode_use(), W_RocketMinsta_Laser_Touch(), W_SetupShot_ProjectileSize, w_shotdir, and w_shotorg.

◆ W_RocketMinsta_Explosion()

void W_RocketMinsta_Explosion ( entity actor,
.entity weaponentity,
vector loc )

Definition at line 106 of file vaporizer.qc.

107{
108 if(accuracy_canbegooddamage(actor))
109 accuracy_add(actor, WEP_DEVASTATOR, autocvar_g_rm_damage, 0, 0); // add to fired
110 entity dmgent = spawn();
111 dmgent.owner = dmgent.realowner = actor;
112 setorigin(dmgent, loc);
114 delete(dmgent);
115}
void accuracy_add(entity this, Weapon w, float fired, float hit, float real)
update accuracy stats
Definition accuracy.qc:102
bool accuracy_canbegooddamage(entity attacker)
if damage were to occur, would accuracy_isgooddamage be able to return true?
Definition accuracy.qc:154
#define spawn
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
Definition damage.qc:981
const int HITTYPE_SPLASH
Definition all.qh:30
#define NULL
Definition post.qh:14
float autocvar_g_rm_radius
float autocvar_g_rm_damage
Definition sv_instagib.qh:9
float autocvar_g_rm_force
float autocvar_g_rm_edgedamage

References accuracy_add(), accuracy_canbegooddamage(), autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_force, autocvar_g_rm_radius, entity(), HITTYPE_SPLASH, NULL, RadiusDamage(), spawn, and vector.

Referenced by W_Vaporizer_Attack().

◆ W_RocketMinsta_Laser_Damage()

void W_RocketMinsta_Laser_Damage ( entity this,
entity directhitentity )

Definition at line 153 of file vaporizer.qc.

154{
155 int laser_count = max(1, this.rm_laser_count);
156 float laser_force = autocvar_g_rm_laser_force / laser_count;
157 float laser_damage = autocvar_g_rm_laser_damage / laser_count;
158 RadiusDamage(this, this.realowner, laser_damage, laser_damage, autocvar_g_rm_laser_radius, NULL, NULL, laser_force, this.projectiledeathtype, this.weaponentity_fld, directhitentity);
159}
int projectiledeathtype
Definition common.qh:21
float autocvar_g_rm_laser_radius
float autocvar_g_rm_laser_force
entity realowner
int rm_laser_count
Definition vaporizer.qh:68
entity weaponentity_fld

References autocvar_g_rm_laser_damage, autocvar_g_rm_laser_force, autocvar_g_rm_laser_radius, entity(), max(), NULL, projectiledeathtype, RadiusDamage(), realowner, rm_laser_count, and weaponentity_fld.

Referenced by W_RocketMinsta_Laser_Explode(), and W_RocketMinsta_Laser_Touch().

◆ W_RocketMinsta_Laser_Explode()

void W_RocketMinsta_Laser_Explode ( entity this,
entity directhitentity )

Definition at line 161 of file vaporizer.qc.

162{
163 if(directhitentity.takedamage == DAMAGE_AIM)
164 if(IS_PLAYER(directhitentity))
165 if(DIFF_TEAM(this.realowner, directhitentity))
166 if(!IS_DEAD(directhitentity))
167 if(IsFlying(directhitentity))
168 Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
169
170 this.event_damage = func_null;
171 this.takedamage = DAMAGE_NO;
172 W_RocketMinsta_Laser_Damage(this, directhitentity);
173 delete(this);
174}
bool IsFlying(entity this)
Definition player.qc:836
#define IS_DEAD(s)
Definition player.qh:245
#define IS_PLAYER(s)
Definition player.qh:243
var void func_null()
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
Definition all.qc:1573
const int DAMAGE_NO
Definition subs.qh:79
const int DAMAGE_AIM
Definition subs.qh:81
float takedamage
Definition subs.qh:78
#define DIFF_TEAM(a, b)
Definition teams.qh:242
void W_RocketMinsta_Laser_Damage(entity this, entity directhitentity)
Definition vaporizer.qc:153

References DAMAGE_AIM, DAMAGE_NO, DIFF_TEAM, entity(), func_null(), IS_DEAD, IS_PLAYER, IsFlying(), realowner, Send_Notification(), takedamage, and W_RocketMinsta_Laser_Damage().

Referenced by W_RocketMinsta_Laser_Explode_use().

◆ W_RocketMinsta_Laser_Explode_use()

void W_RocketMinsta_Laser_Explode_use ( entity this,
entity actor,
entity trigger )

Definition at line 176 of file vaporizer.qc.

177{
178 W_RocketMinsta_Laser_Explode(this, trigger); // we probably don't want trigger used here, but this matches closest to old behaviour
179}
void W_RocketMinsta_Laser_Explode(entity this, entity directhitentity)
Definition vaporizer.qc:161

References entity(), and W_RocketMinsta_Laser_Explode().

Referenced by W_RocketMinsta_Attack().

◆ W_RocketMinsta_Laser_Touch()

void W_RocketMinsta_Laser_Touch ( entity this,
entity toucher )

Definition at line 181 of file vaporizer.qc.

182{
184 //W_RocketMinsta_Laser_Explode ();
186 delete(this);
187}
entity entity toucher
Definition self.qh:72
#define PROJECTILE_TOUCH(e, t)
Definition common.qh:28

References entity(), PROJECTILE_TOUCH, toucher, and W_RocketMinsta_Laser_Damage().

Referenced by W_RocketMinsta_Attack().

◆ W_Vaporizer_Attack()

void W_Vaporizer_Attack ( Weapon thiswep,
entity actor,
.entity weaponentity )

Definition at line 117 of file vaporizer.qc.

118{
119 bool flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
120 float vaporizer_damage = ((WEP_CVAR_PRI(WEP_VAPORIZER, damage) > 0) ? WEP_CVAR_PRI(WEP_VAPORIZER, damage) : 10000);
121
122 W_SetupShot(actor, weaponentity, true, 0, SND_Null, CH_WEAPON_A, vaporizer_damage, thiswep.m_id);
123 // handle sound separately so we can change the volume
124 // added bonus: no longer plays the strength sound (strength gives no bonus to instakill anyway)
125 sound (actor, CH_WEAPON_A, SND_VAPORIZER_FIRE, VOL_BASE * 0.8, ATTEN_NORM);
126
127 yoda = 0;
128 impressive_hits = 0;
129 FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, vaporizer_damage, true, WEP_CVAR_PRI(WEP_VAPORIZER, force), WEP_CVAR_PRI(WEP_VAPORIZER, damagefalloff_mindist), WEP_CVAR_PRI(WEP_VAPORIZER, damagefalloff_maxdist), WEP_CVAR_PRI(WEP_VAPORIZER, damagefalloff_halflife), WEP_CVAR_PRI(WEP_VAPORIZER, damagefalloff_forcehalflife), thiswep.m_id);
130
131 // do this now, as goodhits is disabled below
133 W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg));
135
136 if(yoda && flying)
137 Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
138 if(impressive_hits && actor.vaporizer_lasthit)
139 {
140 Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
141 impressive_hits = 0; // only every second time
142 }
143
144 actor.vaporizer_lasthit = impressive_hits;
145
146 if(autocvar_g_rm)
148 W_RocketMinsta_Explosion(actor, weaponentity, trace_endpos);
149
150 W_DecreaseAmmo(thiswep, actor, ((autocvar_g_instagib) ? 1 : WEP_CVAR_PRI(WEP_VAPORIZER, ammo)), weaponentity);
151}
int m_id
Definition weapon.qh:45
float Q3SURFACEFLAG_SKY
float trace_dphitq3surfaceflags
float Q3SURFACEFLAG_NOIMPACT
float yoda
Definition damage.qh:48
int impressive_hits
Definition damage.qh:49
vector normalize(vector v)
const float VOL_BASE
Definition sound.qh:36
const float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52
float autocvar_g_rm
Definition sv_instagib.qh:8
bool autocvar_g_instagib
float ammo
Definition sv_turrets.qh:43
void FireRailgunBullet(entity this,.entity weaponentity, vector start, vector end, float bdamage, bool headshot_notify, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype)
Definition tracing.qc:238
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
Definition tracing.qh:34
void SendCSQCVaporizerBeamParticle(entity player, int hit)
Definition vaporizer.qc:8
void W_RocketMinsta_Explosion(entity actor,.entity weaponentity, vector loc)
Definition vaporizer.qc:106
#define WEP_CVAR_PRI(wep, name)
Definition all.qh:322
int max_shot_distance
Definition weapon.qh:203
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)

References ammo, ATTEN_NORM, autocvar_g_instagib, autocvar_g_rm, CH_WEAPON_A, entity(), FireRailgunBullet(), impressive_hits, IsFlying(), Weapon::m_id, max_shot_distance, normalize(), Q3SURFACEFLAG_NOIMPACT, Q3SURFACEFLAG_SKY, Send_Notification(), SendCSQCVaporizerBeamParticle(), sound, trace_dphitq3surfaceflags, trace_endpos, vector, VOL_BASE, W_DecreaseAmmo(), W_MuzzleFlash(), W_RocketMinsta_Explosion(), W_SetupShot, w_shotdir, w_shotorg, WarpZone_trace_transform, WarpZone_UnTransformOrigin(), WEP_CVAR_PRI, and yoda.