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_AIM)
13 self.button0 = bot_aim(cvar("g_balance_laser_speed"), 0, cvar("g_balance_laser_lifetime"), FALSE);
14 else if (req == WR_FIRE1)
15 weapon_prepareattack(laser_check, laser_check, laser_fire1_01, cvar("g_balance_laser_refire"));
16 else if (req == WR_FIRE2)
18 weapon_hasammo = TRUE;
19 if (client_hasweapon(self, self.cnt, TRUE))
20 self.switchweapon = self.cnt;
22 else if (req == WR_RAISE)
24 else if (req == WR_UPDATECOUNTS)
26 else if (req == WR_DROP)
28 else if (req == WR_SETUP)
29 weapon_setup(WEP_LASER, "w_laser.zym", 0);
30 else if (req == WR_CHECKAMMO)
31 weapon_hasammo = laser_check();
34 void W_Laser_Touch (void)
39 if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
45 if (other == self.owner)
48 dir = normalize (self.owner.origin - self.origin);
49 org2 = findbetterlocation (self.origin, 8);
52 WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
53 WriteByte (MSG_BROADCAST, TE_FLAMEJET);
54 WriteCoord (MSG_BROADCAST, self.origin_x);
55 WriteCoord (MSG_BROADCAST, self.origin_y);
56 WriteCoord (MSG_BROADCAST, self.origin_z);
57 WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
58 WriteCoord (MSG_BROADCAST, 0);
59 WriteCoord (MSG_BROADCAST, 0);
60 WriteByte (MSG_BROADCAST, 155);
62 te_customflash(self.origin, 160, 0.2, '1 0 0');
68 self.event_damage = SUB_Null;
69 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);
70 sound (self, CHAN_BODY, "weapons/laserimpact.ogg", 1, ATTN_NORM);
75 void W_Laser_Attack (void)
81 trueaim = W_TrueAim();
83 sound (self, CHAN_WEAPON, "weapons/lasergun_fire.ogg", 1, ATTN_NORM);
84 if (self.items & IT_STRENGTH)
85 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
87 self.punchangle_x = -3;
89 org = W_MuzzleOrigin (self, '24 9 -9');
90 //te_customflash(org, 160, 0.2, '1 0 0');
94 missile.classname = "laserbolt";
95 missile.bot_dodge = TRUE;
96 missile.bot_dodgerating = cvar("g_balance_laser_damage");
98 missile.movetype = MOVETYPE_FLY;
99 missile.solid = SOLID_BBOX;
101 setmodel (missile, "models/laser.mdl");
102 setsize (missile, '0 0 0', '0 0 0');
103 setorigin (missile, org);
105 missile.velocity = normalize(trueaim - org) * cvar("g_balance_laser_speed");
106 missile.angles = vectoangles (missile.velocity);
107 //missile.glow_color = 250; // 244, 250
108 //missile.glow_size = 120;
109 missile.touch = W_Laser_Touch;
110 missile.think = SUB_Remove;
111 missile.nextthink = time + cvar("g_balance_laser_lifetime");
113 missile.effects = EF_NOSHADOW | EF_FULLBRIGHT | EF_FULLBRIGHT | EF_LOWPRECISION;
114 missile.flags = FL_PROJECTILE;
119 void() laser_ready_01 =
121 weapon_thinkf(WFRAME_IDLE, 0.1, laser_ready_01);
122 self.weaponentity.state = WS_READY;
124 void() laser_select_01 =
126 weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready);
127 weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');
129 void() laser_deselect_01 =
131 weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear);
132 weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);
134 void() laser_fire1_01 =
136 weapon_doattack(laser_check, laser_check, W_Laser_Attack);
137 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_laser_animtime"), laser_ready_01);