Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
plasma.qc
Go to the documentation of this file.
1#include "plasma.qh"
2
3#ifdef SVQC
4
5spawnfunc(turret_plasma) { if (!turret_initialize(this, TUR_PLASMA)) delete(this); }
6
7METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it))
8{
9 if(MUTATOR_IS_ENABLED(mutator_instagib))
10 {
11 .entity weaponentity = weaponentities[0]; // TODO: unhardcode
12 FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000, false,
13 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id);
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 }
22 else
23 {
24 SUPER(PlasmaTurret).tr_attack(this, it);
25 }
26 if (it.tur_head.frame == 0)
27 it.tur_head.frame = 1;
28}
29METHOD(PlasmaTurret, tr_think, void(PlasmaTurret thistur, entity it))
30{
31 if (it.tur_head.frame != 0)
32 it.tur_head.frame = it.tur_head.frame + 1;
33
34 if (it.tur_head.frame > 5)
35 it.tur_head.frame = 0;
36}
37METHOD(PlasmaTurret, tr_setup, void(PlasmaTurret this, entity it))
38{
40 it.damage_flags |= TFL_DMG_HEADSHAKE;
41 it.firecheck_flags |= TFL_FIRECHECK_AFF;
43
45}
46
47#endif // SVQC
48#ifdef MENUQC
50#include "plasma_dual.qh"
51
52METHOD(PlasmaTurret, describe, string(PlasmaTurret this))
53{
54 TC(PlasmaTurret, this);
56 PAR(_("The %s is a turret that fires electric balls forwards, similar to those of the %s."), COLORED_NAME(this), COLORED_NAME(WEP_ELECTRO));
57 PAR(_("It is a weaker version of the %s, which has two electric ball cannons."), COLORED_NAME(TUR_PLASMA_DUAL));
58 return PAGE_TEXT;
59}
60
61#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
void turret_do_updates(entity t_turret)
updates enemy distances, predicted impact point/time and updated aim<->predict impact distance.
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
const int TFL_DMG_HEADSHAKE
Definition turret.qh:172
const int TFL_AIM_LEAD
Definition turret.qh:99
const int TFL_AIM_SPLASH
Definition turret.qh:98
const int TFL_AIM_SHOTTIMECOMPENSATE
Definition turret.qh:100
const int TFL_AMMO_ENERGY
Definition turret.qh:157
const int TFL_AMMO_RECHARGE
Definition turret.qh:160
const int TFL_AMMO_RECIEVE
Definition turret.qh:161
const int TFL_FIRECHECK_AFF
Definition turret.qh:119
int max_shot_distance
Definition weapon.qh:203
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17