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)
36 if (other == self.owner)
38 else if (pointcontents (self.origin) == CONTENT_SKY)
44 dir = normalize (self.owner.origin - self.origin);
46 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
47 WriteByte (MSG_BROADCAST, TE_FLAMEJET);
48 WriteCoord (MSG_BROADCAST, self.origin_x);
49 WriteCoord (MSG_BROADCAST, self.origin_y);
50 WriteCoord (MSG_BROADCAST, self.origin_z);
51 WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
52 WriteCoord (MSG_BROADCAST, 0);
53 WriteCoord (MSG_BROADCAST, 0);
54 WriteByte (MSG_BROADCAST, 155);
56 te_customflash(self.origin, 160, 0.2, '1 0 0');
59 self.event_damage = SUB_Null;
60 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);
61 sound (self, CHAN_BODY, "weapons/laserimpact.ogg", 1, ATTN_NORM);
66 void W_Laser_Attack (void)
72 trueaim = W_TrueAim();
74 sound (self, CHAN_WEAPON, "weapons/lasergun_fire.ogg", 1, ATTN_NORM);
75 if (self.items & IT_STRENGTH) {
76 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
79 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12;
80 //te_customflash(org, 160, 0.2, '1 0 0');
84 missile.classname = "laserbolt";
86 missile.movetype = MOVETYPE_FLY;
87 missile.solid = SOLID_BBOX;
89 setmodel (missile, "models/laser.mdl");
90 setsize (missile, '0 0 0', '0 0 0');
91 setorigin (missile, org);
93 missile.velocity = normalize(trueaim - org) * cvar("g_balance_laser_speed");
94 missile.angles = vectoangles (missile.velocity);
95 //missile.glow_color = 250; // 244, 250
96 //missile.glow_size = 120;
97 missile.touch = W_Laser_Touch;
98 missile.think = SUB_Remove;
99 missile.nextthink = time + cvar("g_balance_laser_lifetime");
101 missile.effects = EF_NOSHADOW | EF_FULLBRIGHT | EF_FULLBRIGHT | EF_LOWPRECISION;
106 void() laser_ready_01 =
108 weapon_thinkf(WFRAME_IDLE, 0.1, laser_ready_01);
109 self.weaponentity.state = WS_READY;
111 void() laser_select_01 =
113 weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready);
114 weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');
116 void() laser_deselect_01 =
118 weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear);
119 weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);
121 void() laser_fire1_01 =
123 weapon_doattack(laser_check, laser_check, W_Laser_Attack);
124 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_laser_animtime"), laser_ready_01);