}
}
-.vector hook_start, hook_end;
-float gauntletbeam_send(entity to, float sf)
-{
- WriteByte(MSG_ENTITY, ENT_CLIENT_GAUNTLET);
- sf = sf & 0x7F;
- if(sound_allowed(MSG_BROADCAST, self.realowner))
- sf |= 0x80;
- WriteByte(MSG_ENTITY, sf);
- if(sf & 1)
- {
- WriteByte(MSG_ENTITY, num_for_edict(self.realowner));
- }
- if(sf & 2)
- {
- WriteCoord(MSG_ENTITY, self.hook_start_x);
- WriteCoord(MSG_ENTITY, self.hook_start_y);
- WriteCoord(MSG_ENTITY, self.hook_start_z);
- }
- if(sf & 4)
- {
- WriteCoord(MSG_ENTITY, self.hook_end_x);
- WriteCoord(MSG_ENTITY, self.hook_end_y);
- WriteCoord(MSG_ENTITY, self.hook_end_z);
- }
- return TRUE;
-}
-.entity gauntletbeam;
-.float prevgauntletfire;
-entity lgbeam_owner_ent;
-void gauntletbeam_think()
-{
- float damage, myforce, myradius;
- damage = autocvar_g_balance_laser_secondary_damage;
- myforce = autocvar_g_balance_laser_secondary_force;
- myradius = autocvar_g_balance_laser_secondary_radius;
-
- self.realowner.prevgauntletfire = time;
- if (self.realowner.weaponentity.state != WS_INUSE || self != self.realowner.gauntletbeam || self.realowner.deadflag != DEAD_NO || !self.realowner.BUTTON_ATCK2)
- {
- remove(self);
- return;
- }
-
- self.nextthink = time;
-
- makevectors(self.realowner.v_angle);
-
- float dt;
- dt = frametime;
-
- W_SetupShot_Range(self.realowner, TRUE, 0, "", 0, damage * dt, myradius);
- if(!lgbeam_owner_ent)
- {
- lgbeam_owner_ent = spawn();
- lgbeam_owner_ent.classname = "lgbeam_owner_ent";
- }
- WarpZone_traceline_antilag(lgbeam_owner_ent, w_shotorg, w_shotend, MOVE_NORMAL, lgbeam_owner_ent, ANTILAG_LATENCY(self.owner));
-
- // apply the damage
- if(trace_ent)
- {
- vector force;
- force = w_shotdir * myforce;
- if(accuracy_isgooddamage(self.owner, trace_ent))
- accuracy_add(self.owner, WEP_LASER, 0, damage * dt);
- Damage (trace_ent, self.owner, self.owner, damage * dt, WEP_LASER | HITTYPE_SECONDARY, trace_endpos, force * dt);
- }
-
- // draw effect
- if(w_shotorg != self.hook_start)
- {
- self.SendFlags |= 2;
- self.hook_start = w_shotorg;
- }
- if(w_shotend != self.hook_end)
- {
- self.SendFlags |= 4;
- self.hook_end = w_shotend;
- }
-}
-
-// experimental gauntlet
-void W_Laser_Attack2 ()
-{
- // only play fire sound if 0.5 sec has passed since player let go the fire button
- if(time - self.prevgauntletfire > 0.5)
- {
- sound (self, CH_WEAPON_A, "weapons/gauntlet_fire.wav", VOL_BASE, ATTN_NORM);
- }
-
- entity beam, oldself;
-
- self.gauntletbeam = beam = spawn();
- beam.solid = SOLID_NOT;
- beam.think = gauntletbeam_think;
- beam.owner = self;
- beam.movetype = MOVETYPE_NONE;
- beam.shot_spread = 0;
- beam.bot_dodge = TRUE;
- beam.bot_dodgerating = autocvar_g_balance_laser_primary_damage;
- Net_LinkEntity(beam, FALSE, 0, gauntletbeam_send);
-
- oldself = self;
- self = beam;
- self.think();
- self = oldself;
-}
-
-void LaserInit()
-{
- weapon_action(WEP_LASER, WR_PRECACHE);
- gauntlet_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LASER), FALSE, FALSE, 1);
- gauntlet_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LASER), FALSE, FALSE, 2);
- gauntlet_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LASER), FALSE, FALSE, 3);
- gauntlet_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LASER), FALSE, FALSE, 4);
-}
-
void spawnfunc_weapon_laser (void)
{
weapon_defaultspawnfunc(WEP_LASER);
break;
}
-
- case 2: // gauntlet secondary
- {
- W_DecreaseAmmo(ammo_none, 1, TRUE);
-
- if (weapon_prepareattack(0, 0))
- {
- W_Laser_Attack2();
- weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_laser_secondary_animtime, w_ready);
- }
-
- break;
- }
}
}
}
precache_model ("models/weapons/v_laser.md3");
precache_model ("models/weapons/h_laser.iqm");
precache_sound ("weapons/lasergun_fire.wav");
- precache_sound ("weapons/gauntlet_fire.wav");
//precache_sound ("weapons/reload.wav"); // until weapons have individual reload sounds, precache the reload sound somewhere else
}
else if (req == WR_SETUP)
else if (req == WR_KILLMESSAGE)
{
if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = _("%s was cut in half by %s's gauntlet"); // unchecked: SPLASH
+ w_deathtypestring = _("%s was cut in half by %s's gauntlet"); // unchecked: SPLASH // TODO
else
w_deathtypestring = _("%s was lasered to death by %s"); // unchecked: SPLASH
}