case ENT_CLIENT_LGBEAM:
vs = electro_shotorigin[s];
break;
- case ENT_CLIENT_GAUNTLET:
- vs = gauntlet_shotorigin[s];
- break;
}
if((self.owner.sv_entnum == player_localentnum - 1))
b = self.origin;
break;
case ENT_CLIENT_LGBEAM:
- case ENT_CLIENT_GAUNTLET:
if(self.HookRange)
b = view_origin + view_forward * self.HookRange;
else
b = self.origin;
break;
case ENT_CLIENT_LGBEAM:
- case ENT_CLIENT_GAUNTLET:
a = self.origin;
b = self.velocity;
break;
tex = "particles/lgbeam";
rgb = '1 1 1';
break;
- case ENT_CLIENT_GAUNTLET:
- intensity = 1;
- offset = Noise_White(self, frametime);
- tex = "particles/gauntletbeam";
- rgb = '1 1 1';
- break;
}
Draw_GrapplingHook_trace_callback_tex = tex;
}
break;
case ENT_CLIENT_LGBEAM:
- case ENT_CLIENT_GAUNTLET:
setorigin(self, a); // beam origin!
break;
}
case ENT_CLIENT_LGBEAM:
pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity);
break;
- case ENT_CLIENT_GAUNTLET:
- pointparticles(particleeffectnum("gauntlet_lightning"), b, normalize(a - b), frametime * intensity);
- break;
}
}
{
default:
case ENT_CLIENT_HOOK:
- case ENT_CLIENT_GAUNTLET:
self.HookRange = 0;
break;
case ENT_CLIENT_LGBEAM:
case ENT_CLIENT_LGBEAM:
sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTN_NORM);
break;
- case ENT_CLIENT_GAUNTLET:
- sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTN_NORM);
- break;
}
}
void Hook_Precache()
{
precache_sound("weapons/lgbeam_fly.wav");
- precache_sound("weapons/gauntletbeam_fly.wav");
precache_model("models/hook.md3");
}
}
}
-.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
}