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_RAISE)
16 else if (req == WR_UPDATECOUNTS)
18 else if (req == WR_DROP)
20 else if (req == WR_SETUP)
21 weapon_setup(WEP_LASER, "w_laser.zym", 0);
22 else if (req == WR_CHECKAMMO)
23 weapon_hasammo = laser_check();
26 void W_Laser_Touch (void)
30 if (other == self.owner)
32 else if (pointcontents (self.origin) == CONTENT_SKY)
38 dir = normalize (self.owner.origin - self.origin);
40 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
41 WriteByte (MSG_BROADCAST, TE_FLAMEJET);
42 WriteCoord (MSG_BROADCAST, self.origin_x);
43 WriteCoord (MSG_BROADCAST, self.origin_y);
44 WriteCoord (MSG_BROADCAST, self.origin_z);
45 WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
46 WriteCoord (MSG_BROADCAST, 0);
47 WriteCoord (MSG_BROADCAST, 0);
48 WriteByte (MSG_BROADCAST, 155);
50 te_customflash(self.origin, 160, 0.2, '1 0 0');
53 self.event_damage = SUB_Null;
54 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);
55 sound (self, CHAN_BODY, "weapons/laserimpact.ogg", 1, ATTN_NORM);
60 void W_Laser_Attack (void)
65 sound (self, CHAN_WEAPON, "weapons/lasergun_fire.ogg", 1, ATTN_NORM);
66 if (self.items & IT_STRENGTH) {
67 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
70 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12;
71 //te_customflash(org, 160, 0.2, '1 0 0');
75 missile.classname = "laserbolt";
77 missile.movetype = MOVETYPE_FLY;
78 missile.solid = SOLID_BBOX;
80 setmodel (missile, "models/laser.mdl");
81 setsize (missile, '0 0 0', '0 0 0');
82 setorigin (missile, org);
84 missile.velocity = v_forward * cvar("g_balance_laser_speed");
85 missile.angles = vectoangles (missile.velocity);
86 //missile.glow_color = 250; // 244, 250
87 //missile.glow_size = 120;
88 missile.touch = W_Laser_Touch;
89 missile.think = SUB_Remove;
90 missile.nextthink = time + 9;
92 missile.effects = EF_FULLBRIGHT | EF_FULLBRIGHT | EF_LOWPRECISION;
97 void() laser_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, laser_ready_01); self.weaponentity.state = WS_READY;};
98 void() laser_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
99 void() laser_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
100 void() laser_fire1_01 =
102 weapon_doattack(laser_check, laser_check, W_Laser_Attack);
103 weapon_thinkf(WFRAME_FIRE1, 0.3, laser_ready_01);