Plenty of weapon changes with some experimental garbo. It's fun.
This commit is contained in:
parent
19a52bf611
commit
cfc9becb72
7 changed files with 213 additions and 12 deletions
|
@ -439,6 +439,14 @@ void CSQC_Parse_Event(void)
|
|||
float fHeader = readbyte();
|
||||
|
||||
switch (fHeader) {
|
||||
case EV_SPEAK:
|
||||
string msg;
|
||||
float pit;
|
||||
entity t = findfloat( world, entnum, readentitynum() );
|
||||
msg = readstring();
|
||||
pit = readfloat();
|
||||
sound(t, CHAN_VOICE, msg, 1.0, ATTN_NORM, pit);
|
||||
break;
|
||||
case EV_TAUNT:
|
||||
#ifdef VALVE
|
||||
Animation_Q2PlayerTaunt();
|
||||
|
|
|
@ -18,7 +18,7 @@ float Scientist_PreDraw(void)
|
|||
self.initedsci = TRUE;
|
||||
}
|
||||
|
||||
self.bonecontrol5 = getchannellevel(self, CHAN_VOICE);
|
||||
//self.bonecontrol5 = getchannellevel(self, CHAN_VOICE);
|
||||
|
||||
/* HACK: We're abusing this networked field, so reset */
|
||||
self.colormod = [0,0,0];
|
||||
|
|
|
@ -25,6 +25,7 @@ enum {
|
|||
EV_MODELGIB,
|
||||
EV_CAMERATRIGGER,
|
||||
EV_ORBITUARY,
|
||||
EV_SPEAK,
|
||||
EV_TAUNT,
|
||||
EV_CHAT,
|
||||
EV_CHAT_TEAM,
|
||||
|
|
|
@ -296,8 +296,20 @@ class monster_scientist:CBaseEntity
|
|||
virtual void() Scream;
|
||||
virtual void() Gib;
|
||||
virtual void() WarnOthers;
|
||||
virtual void(string) Speak;
|
||||
};
|
||||
|
||||
void monster_scientist::Speak(string msg)
|
||||
{
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EV_SPEAK);
|
||||
WriteEntity(MSG_MULTICAST, this);
|
||||
WriteString(MSG_MULTICAST, msg);
|
||||
WriteFloat(MSG_MULTICAST, m_flPitch);
|
||||
msg_entity = this;
|
||||
multicast(origin, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
void monster_scientist::Gib(void)
|
||||
{
|
||||
takedamage = DAMAGE_NO;
|
||||
|
@ -324,7 +336,7 @@ void monster_scientist::Scream(void)
|
|||
}
|
||||
|
||||
int rand = floor(random(0,sci_sndscream.length));
|
||||
sound(this, CHAN_VOICE, sci_sndscream[rand], 1.0, ATTN_NORM, m_flPitch);
|
||||
Speak(sci_sndscream[rand]);
|
||||
m_flScreamTime = time + 5.0f;
|
||||
}
|
||||
|
||||
|
@ -347,7 +359,7 @@ void monster_scientist::Physics(void)
|
|||
|
||||
if (random() < 0.5) {
|
||||
int rand = floor(random(0,sci_sndsee.length));
|
||||
sound(this, CHAN_VOICE, sci_sndsee[rand], 1.0, ATTN_NORM, m_flPitch);
|
||||
Speak(sci_sndsee[rand]);
|
||||
}
|
||||
|
||||
m_iFlags |= SCIF_SEEN;
|
||||
|
@ -448,7 +460,7 @@ void monster_scientist::Physics(void)
|
|||
|
||||
if (!(flags & FL_ONGROUND) && velocity[2] < -100) {
|
||||
if (!(m_iFlags & SCIF_FALLING)) {
|
||||
sound(this, CHAN_VOICE, sci_sndscream[0], 1.0, ATTN_NORM, m_flPitch);
|
||||
Speak(sci_sndscream[0]);
|
||||
}
|
||||
m_iFlags |= SCIF_FALLING;
|
||||
} else {
|
||||
|
@ -478,14 +490,14 @@ void monster_scientist::PlayerUse(void)
|
|||
}
|
||||
|
||||
r = floor(random(0,sci_snduse.length));
|
||||
sound(this, CHAN_VOICE, sci_snduse[r], 1.0, ATTN_NORM, m_flPitch);
|
||||
Speak(sci_snduse[r]);
|
||||
|
||||
m_eUser = eActivator;
|
||||
m_eRescuer = m_eUser;
|
||||
m_vecLastUserPos = m_eUser.origin;
|
||||
} else {
|
||||
r = floor(random(0,sci_snduseno.length));
|
||||
sound(this, CHAN_VOICE, sci_snduseno[r], 1.0, ATTN_NORM, m_flPitch);
|
||||
Speak(sci_snduseno[r]);
|
||||
|
||||
m_eUser = world;
|
||||
}
|
||||
|
@ -505,7 +517,7 @@ void monster_scientist::vPain(int iHitBody)
|
|||
}
|
||||
|
||||
int rand = floor(random(0,sci_sndpain.length));
|
||||
sound(this, CHAN_VOICE, sci_sndpain[rand], 1.0, ATTN_NORM, m_flPitch);
|
||||
Speak(sci_sndpain[rand]);
|
||||
|
||||
frame = SCIA_FLINCH + floor(random(0, 5));
|
||||
m_iFlags |= SCIF_FEAR;
|
||||
|
@ -517,7 +529,7 @@ void monster_scientist::vDeath(int iHitBody)
|
|||
{
|
||||
int r;
|
||||
r = floor(random(0,sci_snddie.length));
|
||||
sound(this, CHAN_VOICE, sci_snddie[r], 1.0, ATTN_NORM, m_flPitch);
|
||||
Speak(sci_snddie[r]);
|
||||
|
||||
WarnOthers();
|
||||
|
||||
|
|
|
@ -24,6 +24,11 @@ void w_gauss_precache(void)
|
|||
precache_model("models/v_gauss.mdl");
|
||||
precache_model("models/w_gauss.mdl");
|
||||
precache_model("models/p_gauss.mdl");
|
||||
precache_sound("weapons/gauss2.wav");
|
||||
precache_sound("weapons/electro4.wav");
|
||||
precache_sound("weapons/electro5.wav");
|
||||
precache_sound("weapons/electro6.wav");
|
||||
precache_sound("ambience/pulsemachine.wav");
|
||||
}
|
||||
string w_gauss_vmodel(void)
|
||||
{
|
||||
|
@ -56,6 +61,57 @@ void w_gauss_holster(void)
|
|||
{
|
||||
Weapons_ViewAnimation(GAUSS_HOLSTER);
|
||||
}
|
||||
|
||||
void w_gauss_fire(int one)
|
||||
{
|
||||
player pl = (player)self;
|
||||
int iLoop = 10;
|
||||
int iDamage;
|
||||
|
||||
Weapons_MakeVectors();
|
||||
vector src = Weapons_GetCameraPos();
|
||||
vector endpos = src + v_forward * 1024;
|
||||
traceline(src, endpos, FALSE, pl);
|
||||
#ifdef SSQC
|
||||
sound(pl, CHAN_WEAPON, "weapons/gauss2.wav", 1, ATTN_NORM);
|
||||
iDamage = one ? 20 : 200;
|
||||
|
||||
if (trace_ent.takedamage == DAMAGE_YES) {
|
||||
Damage_Apply(trace_ent, self, iDamage, trace_endpos, FALSE);
|
||||
sound(trace_ent, CHAN_ITEM, sprintf("weapons/electro%d.wav", random(0,3)+4), 1, ATTN_NORM);
|
||||
}
|
||||
#else
|
||||
te_beam(world, src, trace_endpos);
|
||||
#endif
|
||||
if (one) {
|
||||
return;
|
||||
}
|
||||
|
||||
// reflection equation:
|
||||
vector dir = v_forward;
|
||||
while (iLoop > 0) {
|
||||
float n;
|
||||
vector r;
|
||||
n = -dotproduct(trace_plane_normal, dir);
|
||||
r = 2 * trace_plane_normal * n + dir;
|
||||
dir = r;
|
||||
src = trace_endpos + (dir * 1);
|
||||
endpos = trace_endpos + (dir * 8192);
|
||||
traceline(src, endpos, FALSE, pl);
|
||||
te_beam(world, src, trace_endpos);
|
||||
iLoop--;
|
||||
#ifdef SSQC
|
||||
if (trace_ent.takedamage == DAMAGE_YES) {
|
||||
Damage_Apply(trace_ent, self, iDamage, trace_endpos, FALSE);
|
||||
sound(trace_ent, CHAN_ITEM, sprintf("weapons/electro%d.wav", random(0,3)+4), 1, ATTN_NORM);
|
||||
}
|
||||
#else
|
||||
te_beam(world, src, trace_endpos);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void w_gauss_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
@ -63,15 +119,40 @@ void w_gauss_primary(void)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(GAUSS_FIRE2);
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/gauss2.wav", 1, ATTN_NORM);
|
||||
#endif
|
||||
w_gauss_fire(1);
|
||||
|
||||
pl.w_attack_next = 0.2f;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
void w_gauss_secondary(void)
|
||||
{
|
||||
|
||||
player pl = (player)self;
|
||||
|
||||
#ifdef CSQC
|
||||
if (pl.a_ammo3)
|
||||
soundupdate(pl, CHAN_WEAPON, "", 2, ATTN_NORM, 150, 0, 0);
|
||||
#endif
|
||||
if (pl.w_attack_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 == 1) {
|
||||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(GAUSS_SPIN);
|
||||
#endif
|
||||
pl.a_ammo3 = 2;
|
||||
pl.w_idle_next = 0.0f;
|
||||
} else if (!pl.a_ammo3) {
|
||||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(GAUSS_SPINUP);
|
||||
sound(pl, CHAN_WEAPON, "ambience/pulsemachine.wav", 2, ATTN_NORM);
|
||||
#endif
|
||||
pl.a_ammo3 = 1;
|
||||
}
|
||||
pl.w_attack_next = 1.0f;
|
||||
}
|
||||
void w_gauss_reload(void)
|
||||
{
|
||||
|
@ -84,8 +165,25 @@ void w_gauss_release(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 == 1) {
|
||||
pl.w_attack_next = 0.0f;
|
||||
pl.w_idle_next = 4.0f;
|
||||
w_gauss_primary();
|
||||
pl.a_ammo3 = 0;
|
||||
return;
|
||||
} else if (pl.a_ammo3 == 2) {
|
||||
w_gauss_fire(0);
|
||||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(GAUSS_FIRE1);
|
||||
soundupdate(pl, CHAN_WEAPON, "", -1, ATTN_NORM, 0, 0, 0);
|
||||
#endif
|
||||
pl.w_attack_next = 1.5f;
|
||||
pl.w_idle_next = 4.0f;
|
||||
pl.a_ammo3 = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int r = floor(random(0,3));
|
||||
|
||||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(GAUSS_IDLE1);
|
||||
|
|
|
@ -41,6 +41,58 @@ string w_handgrenade_deathmsg(void)
|
|||
return "";
|
||||
}
|
||||
|
||||
#ifdef SSQC
|
||||
void w_handgrenade_throw(void)
|
||||
{
|
||||
static void WeaponFrag_Throw_Explode( void )
|
||||
{
|
||||
Effect_CreateExplosion(self.origin);
|
||||
Damage_Radius(self.origin, self.owner, 150, 150 * 2.5f, TRUE);
|
||||
sound(self, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM);
|
||||
remove(self);
|
||||
}
|
||||
|
||||
static void WeaponFrag_Throw_Touch( void )
|
||||
{
|
||||
sound( self, CHAN_BODY, "weapons/grenade/land.wav", 1, ATTN_NORM );
|
||||
self.frame = 0;
|
||||
}
|
||||
|
||||
player pl = (player)self;
|
||||
vector vPLAngle = pl.v_angle;
|
||||
if ( vPLAngle[0] < 0 ) {
|
||||
vPLAngle[0] = -10 + vPLAngle[0] * ((90 - 10) / 90.0);
|
||||
} else {
|
||||
vPLAngle[0] = -10 + vPLAngle[0] * ((90 + 10) / 90.0);
|
||||
}
|
||||
|
||||
float flVel = (90 - vPLAngle[0]) * 5;
|
||||
if ( flVel > 1000 ) {
|
||||
flVel = 1000;
|
||||
}
|
||||
|
||||
makevectors( vPLAngle );
|
||||
vector vecSrc = pl.origin + pl.view_ofs + v_forward * 16;
|
||||
vector vecThrow = v_forward * flVel + pl.velocity;
|
||||
|
||||
entity eGrenade = spawn();
|
||||
eGrenade.owner = pl;
|
||||
eGrenade.classname = "remove_me";
|
||||
eGrenade.solid = SOLID_BBOX;
|
||||
//eGrenade.angles = vectoangles( vDir );
|
||||
eGrenade.velocity = vecThrow;
|
||||
eGrenade.movetype = MOVETYPE_BOUNCE;
|
||||
eGrenade.think = WeaponFrag_Throw_Explode;
|
||||
eGrenade.touch = WeaponFrag_Throw_Touch;
|
||||
eGrenade.nextthink = time + 4.0f;
|
||||
eGrenade.frame = 1;
|
||||
setmodel( eGrenade, "models/w_grenade.mdl" );
|
||||
eGrenade.frame = 1;
|
||||
setorigin( eGrenade, vecSrc );
|
||||
setsize( eGrenade, [-4,-4,-4], [4,4,4] );
|
||||
}
|
||||
#endif
|
||||
|
||||
void w_handgrenade_draw(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
|
@ -62,9 +114,14 @@ void w_handgrenade_primary(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(HANDGRENADE_PULLPIN);
|
||||
#endif
|
||||
pl.a_ammo3 = 1;
|
||||
|
||||
pl.w_attack_next = 0.2f;
|
||||
pl.w_idle_next = 2.5f;
|
||||
|
@ -79,7 +136,17 @@ void w_handgrenade_reload(void)
|
|||
}
|
||||
void w_handgrenade_release(void)
|
||||
{
|
||||
|
||||
player pl = (player)self;
|
||||
if (pl.a_ammo3) {
|
||||
#ifdef CSQC
|
||||
Weapons_ViewAnimation(HANDGRENADE_THROW1);
|
||||
#else
|
||||
pl.a_ammo3 = 0;
|
||||
w_handgrenade_throw();
|
||||
#endif
|
||||
pl.w_attack_next = 0.2f;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
}
|
||||
float w_handgrenade_aimanim(void)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
r_part te_beam
|
||||
{
|
||||
texture "particles/fteparticlefont.tga"
|
||||
tcoords 97 97 191 191 256
|
||||
scale 1
|
||||
scaledelta 0.5
|
||||
alpha 1
|
||||
step 4
|
||||
randomvel 0
|
||||
rgb 255 150 0
|
||||
rgbdelta 0 -150 -150
|
||||
type beam
|
||||
blend add
|
||||
}
|
||||
|
||||
r_part part_spark
|
||||
{
|
||||
type texturedspark
|
||||
|
|
Loading…
Reference in a new issue