.float silent;
+float w_deathtype, w_issilent, w_random;
+vector w_org, w_backoff;
+
void Ent_DamageInfo(float isNew)
{
- float hittype, dmg, rad, edge, thisdmg, forcemul;
- float issilent;
- vector force, org, thisforce;
+ float dmg, rad, edge, thisdmg, forcemul;
+ vector force, thisforce;
entity oldself;
oldself = self;
- hittype = ReadShort();
-
- issilent = (hittype & 0x8000);
- hittype = (hittype & 0x7FFF);
+ w_deathtype = ReadShort();
+ w_issilent = (w_deathtype & 0x8000);
+ w_deathtype = (w_deathtype & 0x7FFF);
- org_x = ReadCoord();
- org_y = ReadCoord();
- org_z = ReadCoord();
+ w_org_x = ReadCoord();
+ w_org_y = ReadCoord();
+ w_org_z = ReadCoord();
dmg = ReadByte();
rad = ReadByte();
else
forcemul = 1;
- for(self = findradius(org, rad); self; self = self.chain)
+ for(self = findradius(w_org, rad); self; self = self.chain)
{
if(rad)
{
- thisdmg = vlen(self.origin - org) / rad;
+ thisdmg = vlen(self.origin - w_org) / rad;
if(thisdmg >= 1)
continue;
if(dmg)
{
thisdmg = dmg + (edge - dmg) * thisdmg;
- thisforce = forcemul * vlen(force) * (thisdmg / dmg) * normalize(self.origin - org);
+ thisforce = forcemul * vlen(force) * (thisdmg / dmg) * normalize(self.origin - w_org);
}
else
{
thisdmg = 0;
- thisforce = forcemul * vlen(force) * normalize(self.origin - org);
+ thisforce = forcemul * vlen(force) * normalize(self.origin - w_org);
}
}
else
//print("pushed ", ftos(num_for_edict(self)), " loose\n");
}
- if(issilent)
+ if(w_issilent)
self.silent = 1;
if(self.event_damage)
- self.event_damage(thisdmg, hittype, org, thisforce);
+ self.event_damage(thisdmg, w_deathtype, w_org, thisforce);
}
self = oldself;
- // TODO spawn particle effects and sounds based on hittype
+ // TODO spawn particle effects and sounds based on w_deathtype
- if(!DEATH_ISSPECIAL(hittype))
+ if(!DEATH_ISSPECIAL(w_deathtype))
{
- float hitwep, secondary, bounce, headshot;
- vector org2, backoff;
- float r;
+ float hitwep;
- hitwep = DEATH_WEAPONOFWEAPONDEATH(hittype);
- secondary = hittype & HITTYPE_SECONDARY;
- bounce = hittype & HITTYPE_BOUNCE;
- headshot = hittype & HITTYPE_HEADSHOT;
- r = prandom();
+ hitwep = DEATH_WEAPONOFWEAPONDEATH(w_deathtype);
+ w_random = prandom();
- traceline(org - normalize(force) * 16, org + normalize(force) * 16, MOVE_NOMONSTERS, world);
+ traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
if(trace_fraction < 1 && hitwep != WEP_NEX && hitwep != WEP_MINSTANEX)
- backoff = trace_plane_normal;
+ w_backoff = trace_plane_normal;
else
- backoff = -1 * normalize(force);
-
- setorigin(self, org + backoff * 2); // for sound() calls
+ w_backoff = -1 * normalize(force);
+ setorigin(self, w_org + w_backoff * 2); // for sound() calls
- switch(hitwep)
- {
- case WEP_LASER:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("laser_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_SHOTGUN:
- org2 = org + backoff * 2;
- pointparticles(particleeffectnum("shotgun_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- {
- if(r < 0.05)
- sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.1)
- sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.2)
- sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
- }
- break;
- case WEP_UZI:
- org2 = org + backoff * 2;
- pointparticles(particleeffectnum("machinegun_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- if(r < 0.05)
- sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.1)
- sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.2)
- sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_GRENADE_LAUNCHER:
- org2 = org + backoff * 12;
- pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_ELECTRO:
- org2 = org + backoff * 6;
- if(secondary)
- {
- pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
- }
- else
- {
- if(bounce)
- {
- // this is sent as "primary bounce" to distinguish it from secondary bounced balls
- pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/electro_impact_combo.wav", VOL_BASE, ATTN_NORM);
- }
- else
- {
- pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
- }
- }
- break;
- case WEP_CRYLINK:
- org2 = org + backoff * 2;
- if(secondary)
- {
- pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
- }
- else
- {
- pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
- }
- break;
- case WEP_NEX:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_HAGAR:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
- if(!issilent)
- {
- if (r<0.15)
- sound(self, CHAN_PROJECTILE, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
- else if (r<0.7)
- sound(self, CHAN_PROJECTILE, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
- else
- sound(self, CHAN_PROJECTILE, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
- }
- break;
- case WEP_ROCKET_LAUNCHER:
- org2 = org + backoff * 12;
- pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_PORTO:
- print("Since when does Porto send DamageInfo?\n");
- break;
- case WEP_MINSTANEX:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_HOOK:
- org2 = org + backoff * 2;
- pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_SEEKER:
- org2 = org + backoff * 6;
- if(secondary)
- {
- pointparticles(particleeffectnum("flac_explode"), org2, '0 0 0', 1);
- if(!issilent)
- {
- if (r<0.15)
- sound(self, CHAN_PROJECTILE, "weapons/flacexp1.wav", 1, ATTN_NORM);
- else if (r<0.7)
- sound(self, CHAN_PROJECTILE, "weapons/flacexp2.wav", 1, ATTN_NORM);
- else
- sound(self, CHAN_PROJECTILE, "weapons/flacexp3.wav", 1, ATTN_NORM);
- }
- }
- else
- {
- if(bounce)
- {
- pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
- if(!issilent)
- {
- if (r<0.15)
- sound(self, CHAN_PROJECTILE, "weapons/tagexp1.wav", 1, ATTN_NORM);
- else if (r<0.7)
- sound(self, CHAN_PROJECTILE, "weapons/tagexp2.wav", 1, ATTN_NORM);
- else
- sound(self, CHAN_PROJECTILE, "weapons/tagexp3.wav", 1, ATTN_NORM);
- }
- }
- else if(headshot)
- {
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/tag_impact.wav", 1, ATTN_NORM);
- }
- else
- {
- pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
- if(!issilent)
- {
- if (r<0.15)
- sound(self, CHAN_PROJECTILE, "weapons/seekerexp1.wav", 1, ATTN_NORM);
- else if (r<0.7)
- sound(self, CHAN_PROJECTILE, "weapons/seekerexp2.wav", 1, ATTN_NORM);
- else
- sound(self, CHAN_PROJECTILE, "weapons/seekerexp3.wav", 1, ATTN_NORM);
- }
- }
- }
- break;
- case WEP_HLAC:
- org2 = org + backoff * 6;
- pointparticles(particleeffectnum("laser_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
- break;
- case WEP_CAMPINGRIFLE:
- org2 = org + backoff * 2;
- pointparticles(particleeffectnum("machinegun_impact"), org2, backoff * 1000, 1);
- if(!issilent)
- {
- if(r < 0.2)
- sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.4)
- sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
- else if(r < 0.5)
- sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
- }
- break;
- case WEP_TUBA:
- break;
- case WEP_FIREBALL:
- if(secondary)
- {
- // firemine goes out silently
- }
- else
- {
- org2 = org + backoff * 16;
- pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1);
- if(!issilent)
- sound(self, CHAN_PROJECTILE, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom
- }
- break;
- default:
- dprint("Unhandled damage of weapon ", ftos(hitwep), "\n");
- break;
- }
+ (get_weaponinfo(hitwep)).weapon_func(WR_IMPACTEFFECT);
}
}
void DamageInfo_Precache()
{
- precache_sound("weapons/crylink_impact2.wav");
- precache_sound("weapons/crylink_impact.wav");
- precache_sound("weapons/electro_impact.wav");
- precache_sound("weapons/electro_impact_combo.wav");
- precache_sound("weapons/flacexp1.wav");
- precache_sound("weapons/flacexp2.wav");
- precache_sound("weapons/flacexp3.wav");
- precache_sound("weapons/grenade_impact.wav");
- precache_sound("weapons/hagexp1.wav");
- precache_sound("weapons/hagexp2.wav");
- precache_sound("weapons/hagexp3.wav");
- precache_sound("weapons/flacexp1.wav");
- precache_sound("weapons/flacexp2.wav");
- precache_sound("weapons/flacexp3.wav");
- precache_sound("weapons/hookbomb_impact.wav");
- precache_sound("weapons/laserimpact.wav");
- precache_sound("weapons/neximpact.wav");
- precache_sound("weapons/ric1.wav");
- precache_sound("weapons/ric2.wav");
- precache_sound("weapons/ric3.wav");
- precache_sound("weapons/rocket_impact.wav");
- precache_sound("weapons/fireball_impact.wav");
- precache_sound("weapons/fireball_impact2.wav");
- precache_sound("weapons/seekerexp1.wav");
- precache_sound("weapons/seekerexp2.wav");
- precache_sound("weapons/seekerexp3.wav");
- precache_sound("weapons/tagexp1.wav");
- precache_sound("weapons/tagexp2.wav");
- precache_sound("weapons/tagexp3.wav");
- precache_sound("weapons/tag_impact.wav");
+ float i;
+ for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+ (get_weaponinfo(i)).weapon_func(WR_PRECACHE);
}
if(type == DEATH_WEAPON) {
HUD_KillNotify_Push(s1, "", stof(s3));
if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print"))
- print("^1", s1, "^1 ", Weapon_SuicideMessage(stof(s3)), "\n");
+ print("^1", s1, "^1 ", Weapon_SuicideMessage(stof(s2)), "\n");
}
else if (type == DEATH_KILL)
print ("^1",s1, "^1 couldn't take it anymore\n");
../common/gamecommand.qc
../common/mapinfo.qc
../common/items.qc
+../server/w_all.qc
../warpzonelib/anglestransform.qc
../warpzonelib/mathlib.qc
float KILL_SPREE_20 = 14;
float KILL_SPREE_25 = 15;
float KILL_SPREE_30 = 16;
+
+// weapon requests
+float WR_SETUP = 1; // (SVQC) setup weapon data
+float WR_THINK = 2; // (SVQC) logic to run every frame
+float WR_CHECKAMMO1 = 3; // (SVQC) checks ammo for weapon
+float WR_CHECKAMMO2 = 4; // (SVQC) checks ammo for weapon
+float WR_AIM = 5; // (SVQC) runs bot aiming code for this weapon
+float WR_PRECACHE = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
+float WR_SUICIDEMESSAGE = 7; // (SVQC) sets w_deathtypestring or leaves it alone (and may inspect w_deathtype for details)
+float WR_KILLMESSAGE = 8; // (SVQC) sets w_deathtypestring or leaves it alone
+float WR_RELOAD = 9; // (SVQC) does not need to do anything
+float WR_RESETPLAYER = 10; // (SVQC) does not need to do anything
+float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
register_weapon(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
} \
ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id)
-#ifdef SVQC
+#ifdef MENUQC
#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
- REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+ REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
#else
#define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
- REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+ REGISTER_WEAPON_2(WEP_##id,WEPBIT_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
#endif
#include "../server/w_all.qc"
float WS_INUSE = 3; // fire state
float WS_READY = 4; // idle frame
-// weapon requests
-float WR_SETUP = 1; // setup weapon data
-float WR_THINK = 2; // logic to run every frame
-float WR_CHECKAMMO1 = 3; // checks ammo for weapon
-float WR_CHECKAMMO2 = 4; // checks ammo for weapon
-float WR_AIM = 5; // runs bot aiming code for this weapon
-float WR_PRECACHE = 6; // precaches models/sounds used by this weapon
-float WR_SUICIDEMESSAGE = 7; // sets w_deathtypestring or leaves it alone (and may inspect w_deathtype for details)
-float WR_KILLMESSAGE = 8; // sets w_deathtypestring or leaves it alone
-float WR_RELOAD = 9; // does not need to do anything
-float WR_RESETPLAYER = 10; // does not need to do anything
-
void weapon_defaultspawnfunc(float wpn);
string w_deathtypestring;
}
*/
- //w = DEATH_WEAPONOF(deathtype);
+ w = DEATH_WEAPONOF(deathtype);
bprint("deathtype: ", ftos(deathtype), "\n");
if(WEP_VALID(w))
{
+ msg = ftos(deathtype);
deathtype = DEATH_WEAPON;
}
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(CAMPINGRIFLE, w_campingrifle, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "campingrifle", "campingrifle", "Rifle");
#else
+#ifdef SVQC
//Camping rifle Primary mode: manually operated bolt*, Secondary: full automatic**
//* Manually operating the bolt means that all the power of the gas is used to propell the bullet. In this mode the bolt is prevented from moving backwards in response to the firing of the bullet.
//** In fully automatic mode some of the gas is used to extract and reload the next cartrige, thus there is less power and range.
return TRUE;
};
#endif
+#ifdef CSQC
+float w_campingrifle(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ {
+ if(w_random < 0.2)
+ sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.4)
+ sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.5)
+ sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/ric1.wav");
+ precache_sound("weapons/ric2.wav");
+ precache_sound("weapons/ric3.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(CRYLINK, w_crylink, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "crylink", "crylink", "Crylink");
#else
+#ifdef SVQC
.float gravity;
.entity realowner;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_crylink(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
+ }
+ else
+ {
+ pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/crylink_impact2.wav");
+ precache_sound("weapons/crylink_impact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(ELECTRO, w_electro, IT_CELLS, 5, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "electro", "electro", "Electro");
#else
+#ifdef SVQC
.float electro_count;
.float electro_secondarytime;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_electro(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ {
+ // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
+ pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/electro_impact_combo.wav", VOL_BASE, ATTN_NORM);
+ }
+ else
+ {
+ pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/electro_impact.wav");
+ precache_sound("weapons/electro_impact_combo.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", "Fireball");
#else
+#ifdef SVQC
.float bot_primary_fireballmooth; // whatever a mooth is
.vector fireball_impactvec;
.float fireball_primarytime;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_fireball(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ // firemine goes out silently
+ }
+ else
+ {
+ org2 = w_org + w_backoff * 16;
+ pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/fireball_impact.wav");
+ precache_sound("weapons/fireball_impact2.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, 4, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "gl", "grenadelauncher", "Mortar");
#else
+#ifdef SVQC
void W_Grenade_Explode (void)
{
if(other.takedamage == DAMAGE_AIM)
return TRUE;
};
#endif
+#ifdef CSQC
+float w_glauncher(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 12;
+ pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/grenade_impact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hagar", "hagar", "Hagar");
#else
+#ifdef SVQC
// NO bounce protection, as bounces are limited!
void W_Hagar_Explode (void)
{
return TRUE;
};
#endif
+#ifdef CSQC
+float w_hagar(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ {
+ if (w_random<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/hagexp1.wav");
+ precache_sound("weapons/hagexp2.wav");
+ precache_sound("weapons/hagexp3.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hlac", "hlac", "Heavy Laser Assault Cannon");
#else
+#ifdef SVQC
.float HLAC_bulletcounter;
void W_HLAC_Touch (void)
{
return TRUE;
};
#endif
+#ifdef CSQC
+float w_hlac(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/laserimpact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(HOOK, w_hook, IT_CELLS|IT_FUEL, 0, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "hookgun", "hook", "Grappling Hook");
#else
+#ifdef SVQC
.float dmg;
.float dmg_edge;
.float dmg_radius;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_hook(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/hookbomb_impact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "laser", "laser", "Laser");
#else
+#ifdef SVQC
void(float imp) W_SwitchWeapon;
void W_Laser_Touch (void)
return TRUE;
};
#endif
+#ifdef CSQC
+float w_laser(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/laserimpact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_CANCLIMB | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "minstanex", "minstanex", "MinstaNex");
#else
+#ifdef SVQC
.float minstanex_lasthit;
void W_MinstaNex_Attack (void)
return TRUE;
};
#endif
+#ifdef CSQC
+float w_minstanex(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/neximpact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "nex", "nex", "Nex");
#else
+#ifdef SVQC
void SendCSQCNexBeamParticle() {
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
return TRUE;
};
#endif
+#ifdef CSQC
+float w_nex(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/neximpact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(PORTO, w_porto, 0, 0, WEP_TYPE_OTHER, 0, "porto" , "porto", "Port-O-Launch");
#else
+#ifdef SVQC
.entity porto_current;
.vector porto_v_angle; // holds "held" view angles
.float porto_v_angle_held;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_porto(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ print("Since when does Porto send DamageInfo?\n");
+ }
+ else if(req == WR_PRECACHE)
+ {
+ // nothing to do
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "rl", "rocketlauncher", "Rocket Launcher");
#else
+#ifdef SVQC
.float rl_release;
.float rl_detonate_later;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_rlauncher(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 12;
+ pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/rocket_impact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "seeker", "seeker", "T.A.G. Seeker");
#else
+#ifdef SVQC
//.float speed; = switchweapon
//.float proxytime; = autoswitch
//.float tl; = wait
return TRUE;
};
#endif
+#ifdef CSQC
+float w_seeker(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ pointparticles(particleeffectnum("flac_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ {
+ if (w_random<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/flacexp1.wav", 1, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/flacexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/flacexp3.wav", 1, ATTN_NORM);
+ }
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ {
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ {
+ if (w_random<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/tagexp1.wav", 1, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/tagexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/tagexp3.wav", 1, ATTN_NORM);
+ }
+ }
+ else if(w_deathtype & HITTYPE_HEADSHOT)
+ {
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/tag_impact.wav", 1, ATTN_NORM);
+ }
+ else
+ {
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ {
+ if (w_random<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/seekerexp1.wav", 1, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/seekerexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/seekerexp3.wav", 1, ATTN_NORM);
+ }
+ }
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/flacexp1.wav");
+ precache_sound("weapons/flacexp2.wav");
+ precache_sound("weapons/flacexp3.wav");
+ precache_sound("weapons/seekerexp1.wav");
+ precache_sound("weapons/seekerexp2.wav");
+ precache_sound("weapons/seekerexp3.wav");
+ precache_sound("weapons/tagexp1.wav");
+ precache_sound("weapons/tagexp2.wav");
+ precache_sound("weapons/tagexp3.wav");
+ precache_sound("weapons/tag_impact.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_LOW, "shotgun", "shotgun", "Shotgun");
#else
+#ifdef SVQC
void W_Shotgun_Attack (void)
{
float sc;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_shotgun(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ pointparticles(particleeffectnum("shotgun_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ {
+ if(w_random < 0.05)
+ sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.1)
+ sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.2)
+ sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/ric1.wav");
+ precache_sound("weapons/ric2.wav");
+ precache_sound("weapons/ric3.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(TUBA, w_tuba, 0, 1, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "tuba", "tuba", "@!#%'n Tuba");
#else
+#ifdef SVQC
//#define TUBA_NOTE(n) strcat("weapons/tuba_note", ftos(n), ".wav")
.float tuba_notecount;
.entity tuba_note;
return TRUE;
};
#endif
+#ifdef CSQC
+float w_tuba(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ // nothing to do here; particles of tuba are handled differently
+ }
+ else if(req == WR_PRECACHE)
+ {
+ // nothing to do
+ }
+ return TRUE;
+}
+#endif
+#endif
#ifdef REGISTER_WEAPON
REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "uzi", "uzi", "Machine Gun");
#else
+#ifdef SVQC
// leilei's fancy muzzleflash stuff
void W_Uzi_Flash_Go() {
if (self.frame > 10){
return TRUE;
};
#endif
+#ifdef CSQC
+float w_uzi(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 2;
+ pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ if(w_random < 0.05)
+ sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.1)
+ sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+ else if(w_random < 0.2)
+ sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/ric1.wav");
+ precache_sound("weapons/ric2.wav");
+ precache_sound("weapons/ric3.wav");
+ }
+ return TRUE;
+}
+#endif
+#endif