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)
6{
7 if (!turret_initialize(this, TUR_PLASMA_DUAL))
8 delete(this);
9}
10
11METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it))
12{
13 if (MUTATOR_IS_ENABLED(mutator_instagib))
14 {
15 .entity weaponentity = weaponentities[0]; // TODO: unhardcode
16 FireRailgunBullet(it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance,
17 10000000000,
18 false,
19 800,
20 0,
21 0,
22 0,
23 0,
24 DEATH_TURRET_PLASMA.m_id
25 );
26
27 Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, it.tur_shotorg, it.tur_shotdir_updated * 1000, 1);
28
29 // teamcolor / hit beam effect
31 vector rgb = Team_ColorRGB(it.team);
32 Send_Effect_Except(EFFECT_VAPORIZER_BEAM, it.tur_shotorg, v, 1, rgb, rgb, NULL);
33 }
34 else
35 SUPER(PlasmaTurret).tr_attack(thistur, it);
36 ++it.tur_head.frame;
37}
38METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur, entity it))
39{
40 if (it.tur_head.frame != 0 && it.tur_head.frame != 3)
41 ++it.tur_head.frame;
42 if (it.tur_head.frame > 6)
43 it.tur_head.frame = 0;
44}
45
46#endif // SVQC
47#ifdef MENUQC
49#include "plasma.qh"
50
51METHOD(DualPlasmaTurret, describe, string(DualPlasmaTurret this))
52{
53 TC(DualPlasmaTurret, this);
55 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));
56 PAR(_("It is a stronger version of the %s, which only has one electric ball cannon."), COLORED_NAME(TUR_PLASMA));
57 return PAGE_TEXT;
58}
59
60#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:120
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:101
#define TC(T, sym)
Definition _all.inc:82
vector WarpZone_UnTransformOrigin(entity wz, vector v)
Definition common.qc:544
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: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
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:231
int max_shot_distance
Definition weapon.qh:245
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17