3 void() laser_deselect_01;
4 void() laser_select_01;
6 float() laser_check = {return TRUE;};
8 void(float req) w_laser =
12 else if (req == WR_FIRE1)
13 weapon_prepareattack(laser_check, laser_check, laser_fire1_01, cvar("g_balance_laser_refire"));
14 else if (req == WR_FIRE2)
16 weapon_hasammo = TRUE;
17 if (client_hasweapon(self, self.cnt, TRUE))
18 self.switchweapon = self.cnt;
20 else if (req == WR_RAISE)
22 else if (req == WR_UPDATECOUNTS)
24 else if (req == WR_DROP)
26 else if (req == WR_SETUP)
27 weapon_setup(WEP_LASER, "w_laser.zym", 0);
28 else if (req == WR_CHECKAMMO)
29 weapon_hasammo = laser_check();
32 void W_Laser_Touch (void)
37 if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
43 if (other == self.owner)
46 dir = normalize (self.owner.origin - self.origin);
47 org2 = findbetterlocation (self.origin, 8);
50 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
51 WriteByte (MSG_BROADCAST, TE_FLAMEJET);
52 WriteCoord (MSG_BROADCAST, self.origin_x);
53 WriteCoord (MSG_BROADCAST, self.origin_y);
54 WriteCoord (MSG_BROADCAST, self.origin_z);
55 WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
56 WriteCoord (MSG_BROADCAST, 0);
57 WriteCoord (MSG_BROADCAST, 0);
58 WriteByte (MSG_BROADCAST, 155);
60 te_customflash(self.origin, 160, 0.2, '1 0 0');
66 self.event_damage = SUB_Null;
67 RadiusDamage (self, self.owner, cvar("g_balance_laser_damage"), cvar("g_balance_laser_edgedamage"), cvar("g_balance_laser_radius"), world, cvar("g_balance_laser_force"), IT_LASER);
68 sound (self, CHAN_BODY, "weapons/laserimpact.ogg", 1, ATTN_NORM);
73 void W_Laser_Attack (void)
79 trueaim = W_TrueAim();
81 sound (self, CHAN_WEAPON, "weapons/lasergun_fire.ogg", 1, ATTN_NORM);
82 if (self.items & IT_STRENGTH)
83 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
85 self.punchangle_x = -3;
87 org = W_MuzzleOrigin (self, '24 9 -9');
88 //te_customflash(org, 160, 0.2, '1 0 0');
92 missile.classname = "laserbolt";
94 missile.movetype = MOVETYPE_FLY;
95 missile.solid = SOLID_BBOX;
97 setmodel (missile, "models/laser.mdl");
98 setsize (missile, '0 0 0', '0 0 0');
99 setorigin (missile, org);
101 missile.velocity = normalize(trueaim - org) * cvar("g_balance_laser_speed");
102 missile.angles = vectoangles (missile.velocity);
103 //missile.glow_color = 250; // 244, 250
104 //missile.glow_size = 120;
105 missile.touch = W_Laser_Touch;
106 missile.think = SUB_Remove;
107 missile.nextthink = time + cvar("g_balance_laser_lifetime");
109 missile.effects = EF_NOSHADOW | EF_FULLBRIGHT | EF_FULLBRIGHT | EF_LOWPRECISION;
110 missile.flags = FL_PROJECTILE;
115 void() laser_ready_01 =
117 weapon_thinkf(WFRAME_IDLE, 0.1, laser_ready_01);
118 self.weaponentity.state = WS_READY;
120 void() laser_select_01 =
122 weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready);
123 weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');
125 void() laser_deselect_01 =
127 weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear);
128 weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);
130 void() laser_fire1_01 =
132 weapon_doattack(laser_check, laser_check, W_Laser_Attack);
133 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_laser_animtime"), laser_ready_01);