#ifdef REGISTER_WEAPON
REGISTER_WEAPON(
-/* WEP_##id */ SHOCKWAVE,
-/* function */ W_Shockwave,
-/* ammotype */ ammo_none,
-/* impulse */ 2,
-/* flags */ WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN,
-/* rating */ BOT_PICKUP_RATING_LOW,
-/* model */ "shotgun",
-/* netname */ "shockwave",
-/* fullname */ _("Shockwave")
+/* WEP_##id */ SHOCKWAVE,
+/* function */ W_Shockwave,
+/* ammotype */ ammo_none,
+/* impulse */ 2,
+/* flags */ WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN,
+/* rating */ BOT_PICKUP_RATING_LOW,
+/* color */ '0.5 0.25 0',
+/* modelname */ "shotgun",
+/* simplemdl */ "foobar",
+/* crosshair */ "gfx/crosshairshotgun 0.7",
+/* refname */ "shockwave",
+/* wepname */ _("Shockwave")
);
#define SHOCKWAVE_SETTINGS(w_cvar,w_prop) SHOCKWAVE_SETTINGS_LIST(w_cvar, w_prop, SHOCKWAVE, shockwave)
#define SHOCKWAVE_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
- w_cvar(id, sn, MO_NONE, blast_animtime) \
- w_cvar(id, sn, MO_NONE, blast_damage) \
- w_cvar(id, sn, MO_NONE, blast_distance) \
- w_cvar(id, sn, MO_NONE, blast_edgedamage) \
- w_cvar(id, sn, MO_NONE, blast_force) \
- w_cvar(id, sn, MO_NONE, blast_force_forwardbias) \
- w_cvar(id, sn, MO_NONE, blast_force_zscale) \
- w_cvar(id, sn, MO_NONE, blast_jump_damage) \
- w_cvar(id, sn, MO_NONE, blast_jump_edgedamage) \
- w_cvar(id, sn, MO_NONE, blast_jump_force) \
- w_cvar(id, sn, MO_NONE, blast_jump_force_velocitybias) \
- w_cvar(id, sn, MO_NONE, blast_jump_force_zscale) \
- w_cvar(id, sn, MO_NONE, blast_jump_multiplier_accuracy) \
- w_cvar(id, sn, MO_NONE, blast_jump_multiplier_distance) \
- w_cvar(id, sn, MO_NONE, blast_jump_multiplier_min) \
- w_cvar(id, sn, MO_NONE, blast_jump_radius) \
- w_cvar(id, sn, MO_NONE, blast_multiplier_accuracy) \
- w_cvar(id, sn, MO_NONE, blast_multiplier_distance) \
- w_cvar(id, sn, MO_NONE, blast_multiplier_min) \
- w_cvar(id, sn, MO_NONE, blast_refire) \
- w_cvar(id, sn, MO_NONE, blast_splash_damage) \
- w_cvar(id, sn, MO_NONE, blast_splash_edgedamage) \
- w_cvar(id, sn, MO_NONE, blast_splash_force) \
- w_cvar(id, sn, MO_NONE, blast_splash_force_forwardbias) \
- w_cvar(id, sn, MO_NONE, blast_splash_multiplier_accuracy) \
- w_cvar(id, sn, MO_NONE, blast_splash_multiplier_distance) \
- w_cvar(id, sn, MO_NONE, blast_splash_multiplier_min) \
- w_cvar(id, sn, MO_NONE, blast_splash_radius) \
- w_cvar(id, sn, MO_NONE, blast_spread_max) \
- w_cvar(id, sn, MO_NONE, blast_spread_min) \
- w_cvar(id, sn, MO_NONE, melee_animtime) \
- w_cvar(id, sn, MO_NONE, melee_damage) \
- w_cvar(id, sn, MO_NONE, melee_delay) \
- w_cvar(id, sn, MO_NONE, melee_force) \
- w_cvar(id, sn, MO_NONE, melee_multihit) \
- w_cvar(id, sn, MO_NONE, melee_no_doubleslap) \
- w_cvar(id, sn, MO_NONE, melee_nonplayerdamage) \
- w_cvar(id, sn, MO_NONE, melee_range) \
- w_cvar(id, sn, MO_NONE, melee_refire) \
- w_cvar(id, sn, MO_NONE, melee_swing_side) \
- w_cvar(id, sn, MO_NONE, melee_swing_up) \
- w_cvar(id, sn, MO_NONE, melee_time) \
- w_cvar(id, sn, MO_NONE, melee_traces) \
+ w_cvar(id, sn, NONE, blast_animtime) \
+ w_cvar(id, sn, NONE, blast_damage) \
+ w_cvar(id, sn, NONE, blast_distance) \
+ w_cvar(id, sn, NONE, blast_edgedamage) \
+ w_cvar(id, sn, NONE, blast_force) \
+ w_cvar(id, sn, NONE, blast_force_forwardbias) \
+ w_cvar(id, sn, NONE, blast_force_zscale) \
+ w_cvar(id, sn, NONE, blast_jump_damage) \
+ w_cvar(id, sn, NONE, blast_jump_edgedamage) \
+ w_cvar(id, sn, NONE, blast_jump_force) \
+ w_cvar(id, sn, NONE, blast_jump_force_velocitybias) \
+ w_cvar(id, sn, NONE, blast_jump_force_zscale) \
+ w_cvar(id, sn, NONE, blast_jump_multiplier_accuracy) \
+ w_cvar(id, sn, NONE, blast_jump_multiplier_distance) \
+ w_cvar(id, sn, NONE, blast_jump_multiplier_min) \
+ w_cvar(id, sn, NONE, blast_jump_radius) \
+ w_cvar(id, sn, NONE, blast_multiplier_accuracy) \
+ w_cvar(id, sn, NONE, blast_multiplier_distance) \
+ w_cvar(id, sn, NONE, blast_multiplier_min) \
+ w_cvar(id, sn, NONE, blast_refire) \
+ w_cvar(id, sn, NONE, blast_splash_damage) \
+ w_cvar(id, sn, NONE, blast_splash_edgedamage) \
+ w_cvar(id, sn, NONE, blast_splash_force) \
+ w_cvar(id, sn, NONE, blast_splash_force_forwardbias) \
+ w_cvar(id, sn, NONE, blast_splash_multiplier_accuracy) \
+ w_cvar(id, sn, NONE, blast_splash_multiplier_distance) \
+ w_cvar(id, sn, NONE, blast_splash_multiplier_min) \
+ w_cvar(id, sn, NONE, blast_splash_radius) \
+ w_cvar(id, sn, NONE, blast_spread_max) \
+ w_cvar(id, sn, NONE, blast_spread_min) \
+ w_cvar(id, sn, NONE, melee_animtime) \
+ w_cvar(id, sn, NONE, melee_damage) \
+ w_cvar(id, sn, NONE, melee_delay) \
+ w_cvar(id, sn, NONE, melee_force) \
+ w_cvar(id, sn, NONE, melee_multihit) \
+ w_cvar(id, sn, NONE, melee_no_doubleslap) \
+ w_cvar(id, sn, NONE, melee_nonplayerdamage) \
+ w_cvar(id, sn, NONE, melee_range) \
+ w_cvar(id, sn, NONE, melee_refire) \
+ w_cvar(id, sn, NONE, melee_swing_side) \
+ w_cvar(id, sn, NONE, melee_swing_up) \
+ w_cvar(id, sn, NONE, melee_time) \
+ w_cvar(id, sn, NONE, melee_traces) \
w_prop(id, sn, float, switchdelay_raise, switchdelay_raise) \
w_prop(id, sn, float, switchdelay_drop, switchdelay_drop) \
w_prop(id, sn, string, weaponreplace, weaponreplace) \
if(autocvar_sv_q3acompat_machineshotgunswap)
if(self.classname != "droppedweapon")
{
- weapon_defaultspawnfunc(WEP_UZI);
+ weapon_defaultspawnfunc(WEP_MACHINEGUN);
return;
}
weapon_defaultspawnfunc(WEP_SHOCKWAVE);
}
+#define MAX_SHOCKWAVE_HITS 10
+
.float swing_prev;
.entity swing_alreadyhit;
.float shockwave_blasttime;
-entity shockwave_hit[32];
-float shockwave_hit_damage[32];
-vector shockwave_hit_force[32];
+entity shockwave_hit[MAX_SHOCKWAVE_HITS];
+float shockwave_hit_damage[MAX_SHOCKWAVE_HITS];
+vector shockwave_hit_force[MAX_SHOCKWAVE_HITS];
// MELEE ATTACK MODE
void W_Shockwave_Melee_Think()
{
if(!head) { return FALSE; }
float i;
-
- ++queue;
- for(i = 1; i <= queue; ++i)
+ for(i = 0; i <= queue; ++i)
{
if(shockwave_hit[i] == head)
{
final_force_z *= WEP_CVAR(shockwave, blast_force_zscale);
// queue damage with this calculated info
- if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { ++queue; }
+ if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
#ifdef DEBUG_SHOCKWAVE
print(sprintf(
vector nearest_on_line = (w_shotorg + a * w_shotdir);
vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
- float distance_to_target = vlen(w_shotorg - nearest_to_attacker); // WEAPONTODO: use the findradius function for this
- if((distance_to_target <= WEP_CVAR(shockwave, blast_distance))
+ if((vlen(head.WarpZone_findradius_dist) <= WEP_CVAR(shockwave, blast_distance))
&& (W_Shockwave_Attack_IsVisible(head, nearest_on_line, w_shotorg, attack_endpos)))
{
// calculate importance of distance and accuracy for this attack
);
multiplier_from_distance = (1 -
(distance_to_hit ?
- min(1, (distance_to_target / distance_to_end))
+ min(1, (vlen(head.WarpZone_findradius_dist) / distance_to_end))
:
0
)
final_force_z *= WEP_CVAR(shockwave, blast_force_zscale);
// queue damage with this calculated info
- if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { ++queue; }
+ if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
#ifdef DEBUG_SHOCKWAVE
print(sprintf(
head = head.chain;
}
- for(i = 1; i <= queue; ++i)
+ for(i = 0; i <= queue; ++i)
{
head = shockwave_hit[i];
final_force = shockwave_hit_force[i];
precache_sound("misc/itempickup.wav");
precache_sound("weapons/shockwave_fire.wav");
precache_sound("weapons/shockwave_melee.wav");
- SHOCKWAVE_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
+ SHOCKWAVE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
case WR_CHECKAMMO1:
//precache_sound("weapons/ric3.wav");
return FALSE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}