Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
plasma_dual.qc
Go to the documentation of this file.
1#include "plasma_dual.qh"
2
3#ifdef SVQC
4
5spawnfunc(turret_plasma_dual) { if (!turret_initialize(this, TUR_PLASMA_DUAL)) delete(this); }
6
7METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it))
8{
9 if (MUTATOR_IS_ENABLED(mutator_instagib)) {
10 .entity weaponentity = weaponentities[0]; // TODO: unhardcode
11 FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000, false,
12 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id);
13
14
15 Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, it.tur_shotorg, it.tur_shotdir_updated * 1000, 1);
16
17 // teamcolor / hit beam effect
19 vector rgb = Team_ColorRGB(it.team);
20 Send_Effect_Except(EFFECT_VAPORIZER_BEAM, it.tur_shotorg, v, 1, rgb, rgb, NULL);
21 } else {
22 SUPER(PlasmaTurret).tr_attack(thistur, it);
23 }
24 it.tur_head.frame += 1;
25}
26METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur, entity it))
27{
28 if ((it.tur_head.frame != 0) && (it.tur_head.frame != 3))
29 it.tur_head.frame = it.tur_head.frame + 1;
30
31 if (it.tur_head.frame > 6)
32 it.tur_head.frame = 0;
33}
34
35#endif // SVQC
36#ifdef MENUQC
38#include "plasma.qh"
39
40METHOD(DualPlasmaTurret, describe, string(DualPlasmaTurret this))
41{
42 TC(DualPlasmaTurret, this);
44 PAR(_("The %s is a turret that fires electric balls forwards from its two cannons, shooting balls similar to those of the %s."), COLORED_NAME(this), COLORED_NAME(WEP_ELECTRO));
45 PAR(_("It is a stronger version of the %s, which only has one electric ball cannon."), COLORED_NAME(TUR_PLASMA));
46 return PAGE_TEXT;
47}
48
49#endif // MENUQC
#define MUTATOR_IS_ENABLED(this)
Definition base.qh:193
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define COLORED_NAME(this)
Definition color.qh:195
vector trace_endpos
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:124
void Send_Effect_Except(entity eff, vector eff_loc, vector eff_vel, int eff_cnt, vector eff_col_min, vector eff_col_max, entity ignore)
Definition all.qc:105
#define TC(T, sym)
Definition _all.inc:82
vector WarpZone_UnTransformOrigin(entity wz, vector v)
Definition common.qc:545
entity WarpZone_trace_transform
Definition common.qh:37
#define SUPER(cname)
Definition oo.qh:231
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define NULL
Definition post.qh:14
vector
Definition self.qh:92
#define spawnfunc(id)
Definition spawnfunc.qh:96
#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
bool turret_initialize(entity this, Turret tur)
vector Team_ColorRGB(int teamid)
Definition teams.qh:76
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
int max_shot_distance
Definition weapon.qh:203
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17