]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/turrets/turret/plasma_weapon.qc
Weapons: remove useless weapon return values and implementations
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / plasma_weapon.qc
1 #ifndef TURRET_PLASMA_WEAPON_H
2 #define TURRET_PLASMA_WEAPON_H
3
4 CLASS(PlasmaAttack, PortoLaunch)
5 /* flags     */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
6 /* impulse   */ ATTRIB(PlasmaAttack, impulse, int, 5);
7 /* refname   */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma");
8 /* wepname   */ ATTRIB(PlasmaAttack, message, string, _("Plasma"));
9 ENDCLASS(PlasmaAttack)
10 REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
11
12 #endif
13
14 #ifdef IMPLEMENTATION
15
16 #ifdef SVQC
17
18 METHOD(PlasmaAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
19     SELFPARAM();
20         bool isPlayer = IS_PLAYER(self);
21         if (fire1)
22         if (!isPlayer || weapon_prepareattack(false, WEP_CVAR_PRI(electro, refire))) {
23                 if (isPlayer) {
24             turret_initparams(self);
25             W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
26             self.tur_shotdir_updated = w_shotdir;
27             self.tur_shotorg = w_shotorg;
28             self.tur_head = self;
29             weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
30         }
31         entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, true, true);
32         missile.missile_flags = MIF_SPLASH;
33         Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
34         }
35 }
36
37 #endif
38
39 #endif