X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fw_shockwave.qc;h=574e996831cce4698360f788a755b1c27ef7879a;hb=8c24bad1afeccde39828a5902cf96a858146c8cd;hp=21ed3815b3f9c61e8133c217a4d046ef8e30159d;hpb=680a2f11618558901cddf9fc74b15ef07db66e55;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/w_shockwave.qc b/qcsrc/common/weapons/w_shockwave.qc index 21ed3815b..574e99683 100644 --- a/qcsrc/common/weapons/w_shockwave.qc +++ b/qcsrc/common/weapons/w_shockwave.qc @@ -1,77 +1,69 @@ #ifdef REGISTER_WEAPON REGISTER_WEAPON( -/* WEP_##id */ SHOCKWAVE, -/* function */ W_Shockwave, -/* ammotype */ IT_SHELLS, -/* impulse */ 2, -/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | 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) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_damage) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_distance) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_edgedamage) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_force) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_force_forwardbias) \ - /*w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_force_velocitybias)*/ \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_force_zscale) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_damage) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_edgedamage) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_force) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_force_velocitybias) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_force_zscale) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_multiplier_accuracy) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_multiplier_distance) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_multiplier_min) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_radius) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_multiplier_accuracy) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_multiplier_distance) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_multiplier_min) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_damage) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_edgedamage) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_force) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_force_forwardbias) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_multiplier_accuracy) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_multiplier_distance) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_multiplier_min) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_radius) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_spread_max) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_spread_min) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_animtime) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_damage) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_delay) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_force) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_multihit) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_no_doubleslap) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_nonplayerdamage) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_range) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_refire) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_swing_side) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_swing_up) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_time) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_traces) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_ammo) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_animtime) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_bulletconstant) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_bullets) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_damage) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_force) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_refire) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_speed) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_spread) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, primary) \ - w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, secondary) \ - w_prop(WEP_SHOCKWAVE, shockwave, float, reloading_ammo, reload_ammo) \ - w_prop(WEP_SHOCKWAVE, shockwave, float, reloading_time, reload_time) \ - w_prop(WEP_SHOCKWAVE, shockwave, float, switchdelay_raise, switchdelay_raise) \ - w_prop(WEP_SHOCKWAVE, shockwave, float, switchdelay_drop, switchdelay_drop) \ - w_prop(WEP_SHOCKWAVE, shockwave, string, weaponreplace, weaponreplace) \ - w_prop(WEP_SHOCKWAVE, shockwave, float, weaponstart, weaponstart) \ - w_prop(WEP_SHOCKWAVE, shockwave, float, weaponstartoverride, weaponstartoverride) +#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, 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) \ + w_prop(id, sn, float, weaponstart, weaponstart) \ + w_prop(id, sn, float, weaponstartoverride, weaponstartoverride) #ifdef SVQC SHOCKWAVE_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) @@ -80,83 +72,24 @@ SHOCKWAVE_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) #ifdef SVQC void spawnfunc_weapon_shockwave() { - //if(autocvar_sv_q3acompat_machineshockwaveswap) + //if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO 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_pelletstime; -entity shockwave_hit[32]; -float shockwave_hit_damage[32]; -vector shockwave_hit_force[32]; - -// LEGACY ATTACK MODE: Scattered bullets -void W_Shockwave_Pellets(void) -{ - float sc; - entity flash; - - W_DecreaseAmmo(ammo_shells, WEP_CVAR(shockwave, pellets_ammo), WEP_CVAR(shockwave, reload_ammo)); - - W_SetupShot(self, TRUE, 5, "weapons/shockwave_fire.wav", CH_WEAPON_A, WEP_CVAR(shockwave, pellets_damage) * WEP_CVAR(shockwave, pellets_bullets)); - - for(sc = 0; sc < WEP_CVAR(shockwave, pellets_bullets); ++sc) - { - fireBallisticBullet( - w_shotorg, - w_shotdir, - WEP_CVAR(shockwave, pellets_spread), - WEP_CVAR(shockwave, pellets_speed), - 5, - WEP_CVAR(shockwave, pellets_damage), - WEP_CVAR(shockwave, pellets_force), - WEP_SHOCKWAVE, - 0, - WEP_CVAR(shockwave, pellets_bulletconstant) - ); - } - endFireBallisticBullet(); - - pointparticles(particleeffectnum("shockwave_muzzleflash"), w_shotorg, w_shotdir * 1000, WEP_CVAR(shockwave, pellets_ammo)); - - // casing code - if(autocvar_g_casings >= 1) - { - for(sc = 0;sc < WEP_CVAR(shockwave, pellets_ammo); ++sc) - { - SpawnCasing( - ( - ((random () * 50 + 50) * v_right) - - - (v_forward * (random () * 25 + 25)) - - - ((random () * 5 - 30) * v_up) - ), - 2, - vectoangles(v_forward), - '0 250 0', - 100, - 1, - self - ); - } - } - - // muzzle flash for 1st person view - flash = spawn(); - setmodel(flash, "models/uziflash.md3"); // precision set below - flash.think = SUB_Remove; - flash.nextthink = time + 0.06; - flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION; - W_AttachToShotorg(flash, '5 0 0'); -} +.float shockwave_blasttime; +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() @@ -166,27 +99,29 @@ void W_Shockwave_Melee_Think() entity target_victim; vector targpos; - if(!self.cnt) // set start time of melee + // check to see if we can still continue, otherwise give up now + if((self.realowner.deadflag != DEAD_NO) && WEP_CVAR(shockwave, melee_no_doubleslap)) + { + remove(self); + return; + } + + // set start time of melee + if(!self.cnt) { self.cnt = time; W_PlayStrengthSound(self.realowner); } - makevectors(self.realowner.v_angle); // update values for v_* vectors + // update values for v_* vectors + makevectors(self.realowner.v_angle); // calculate swing percentage based on time meleetime = WEP_CVAR(shockwave, melee_time) * W_WeaponRateFactor(); swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10); f = ((1 - swing) * WEP_CVAR(shockwave, melee_traces)); - // check to see if we can still continue, otherwise give up now - if((self.realowner.deadflag != DEAD_NO) && WEP_CVAR(shockwave, melee_no_doubleslap)) - { - remove(self); - return; - } - - // if okay, perform the traces needed for this frame + // perform the traces needed for this frame for(i=self.swing_prev; i < f; ++i) { swing_factor = ((1 - (i / WEP_CVAR(shockwave, melee_traces))) * 2 - 1); @@ -196,7 +131,14 @@ void W_Shockwave_Melee_Think() + (v_up * swing_factor * WEP_CVAR(shockwave, melee_swing_up)) + (v_right * swing_factor * WEP_CVAR(shockwave, melee_swing_side))); - WarpZone_traceline_antilag(self.realowner, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, self.realowner, ANTILAG_LATENCY(self.realowner)); + WarpZone_traceline_antilag( + self.realowner, + (self.realowner.origin + self.realowner.view_ofs), + targpos, + FALSE, + self.realowner, + ANTILAG_LATENCY(self.realowner) + ); // draw lightning beams for debugging te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5); @@ -204,28 +146,46 @@ void W_Shockwave_Melee_Think() is_player = (trace_ent.classname == "player" || trace_ent.classname == "body"); - if((trace_fraction < 1) // if trace is good, apply the damage and remove self + if((trace_fraction < 1) // if trace is good, apply the damage and remove self if necessary && (trace_ent.takedamage == DAMAGE_AIM) && (trace_ent != self.swing_alreadyhit) && (is_player || WEP_CVAR(shockwave, melee_nonplayerdamage))) { target_victim = trace_ent; // so it persists through other calls - if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught. - swing_damage = (WEP_CVAR(shockwave, melee_damage * min(1, swing_factor + 1))); + if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught + swing_damage = (WEP_CVAR(shockwave, melee_damage) * min(1, swing_factor + 1)); else - swing_damage = (WEP_CVAR(shockwave, melee_nonplayerdamage * min(1, swing_factor + 1))); - - //print(strcat(self.realowner.netname, " hitting ", target_victim.netname, " with ", strcat(ftos(swing_damage), " damage (factor: ", ftos(swing_factor), ") at "), ftos(time), " seconds.\n")); - - Damage(target_victim, self.realowner, self.realowner, - swing_damage, WEP_SHOCKWAVE | HITTYPE_SECONDARY, - self.realowner.origin + self.realowner.view_ofs, - v_forward * WEP_CVAR(shockwave, melee_force)); - - if(accuracy_isgooddamage(self.realowner, target_victim)) { accuracy_add(self.realowner, WEP_SHOCKWAVE, 0, swing_damage); } - - if(WEP_CVAR(shockwave, melee_multihit)) // allow multiple hits with one swing, but not against the same player twice. + swing_damage = (WEP_CVAR(shockwave, melee_nonplayerdamage) * min(1, swing_factor + 1)); + + // trigger damage with this calculated info + Damage( + target_victim, + self.realowner, + self.realowner, + swing_damage, + (WEP_SHOCKWAVE | HITTYPE_SECONDARY), + (self.realowner.origin + self.realowner.view_ofs), + (v_forward * WEP_CVAR(shockwave, melee_force)) + ); + + // handle accuracy + if(accuracy_isgooddamage(self.realowner, target_victim)) + { accuracy_add(self.realowner, WEP_SHOCKWAVE, 0, swing_damage); } + + #ifdef DEBUG_SHOCKWAVE + print(sprintf( + "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.\n", + self.realowner.netname, + target_victim.netname, + swing_damage, + swing_factor, + time + )); + #endif + + // allow multiple hits with one swing, but not against the same player twice + if(WEP_CVAR(shockwave, melee_multihit)) { self.swing_alreadyhit = target_victim; continue; // move along to next trace @@ -341,10 +301,8 @@ float W_Shockwave_Attack_CheckHit( { if(!head) { return FALSE; } float i; - - ++queue; - for(i = 1; i <= queue; ++i) + for(i = 0; i <= queue; ++i) { if(shockwave_hit[i] == head) { @@ -533,7 +491,7 @@ void W_Shockwave_Attack() 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( @@ -576,9 +534,8 @@ void W_Shockwave_Attack() 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); // todo: 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 @@ -592,7 +549,7 @@ void W_Shockwave_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 ) @@ -625,7 +582,7 @@ void W_Shockwave_Attack() 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( @@ -643,7 +600,7 @@ void W_Shockwave_Attack() 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]; @@ -676,7 +633,6 @@ void W_Shockwave_Attack() float W_Shockwave(float req) { - float ammo_amount; switch(req) { case WR_AIM: @@ -690,50 +646,22 @@ float W_Shockwave(float req) } case WR_THINK: { - if(WEP_CVAR(shockwave, reload_ammo) && self.clip_load < WEP_CVAR(shockwave, pellets_ammo)) // forced reload - { - // don't force reload an empty shockwave if its melee attack is active - if(!(WEP_CVAR(shockwave, secondary) && self.ammo_shells < WEP_CVAR(shockwave, pellets_ammo))) - WEP_ACTION(self.weapon, WR_RELOAD); - } - else + if(self.BUTTON_ATCK) { - if(self.BUTTON_ATCK) + if(time >= self.shockwave_blasttime) // handle refire separately so the secondary can be fired straight after a primary { - switch(WEP_CVAR(shockwave, primary)) + if(weapon_prepareattack(0, WEP_CVAR(shockwave, blast_animtime))) { - case 1: - { - if(time >= self.shockwave_pelletstime) // handle refire separately so the secondary can be fired straight after a primary - { - if(weapon_prepareattack(0, WEP_CVAR(shockwave, pellets_animtime))) - { - W_Shockwave_Attack(); - self.shockwave_pelletstime = time + WEP_CVAR(shockwave, pellets_refire) * W_WeaponRateFactor(); - weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(shockwave, pellets_animtime), w_ready); - } - } - break; - } - case 2: - { - if(time >= self.shockwave_pelletstime) // handle refire separately so the secondary can be fired straight after a primary - { - if(weapon_prepareattack(0, WEP_CVAR(shockwave, pellets_animtime))) - { - W_Shockwave_Pellets(); - self.shockwave_pelletstime = time + WEP_CVAR(shockwave, pellets_refire) * W_WeaponRateFactor(); - weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(shockwave, pellets_animtime), w_ready); - } - } - break; - } + W_Shockwave_Attack(); + self.shockwave_blasttime = time + WEP_CVAR(shockwave, blast_refire) * W_WeaponRateFactor(); + weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(shockwave, blast_animtime), w_ready); } } - - if(self.clip_load >= 0) // we are not currently reloading + } + else if(self.BUTTON_ATCK2) + { + //if(self.clip_load >= 0) // we are not currently reloading if(!self.crouch) // no crouchmelee please - if(self.BUTTON_ATCK2 && WEP_CVAR(shockwave, secondary)) if(weapon_prepareattack(1, WEP_CVAR(shockwave, melee_refire))) { // attempt forcing playback of the anim by switching to another anim (that we never play) here... @@ -752,23 +680,13 @@ float W_Shockwave(float req) precache_sound("misc/itempickup.wav"); precache_sound("weapons/shockwave_fire.wav"); precache_sound("weapons/shockwave_melee.wav"); - SHOCKWAVE_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP) - return TRUE; - } - case WR_SETUP: - { - self.current_ammo = ammo_shells; + SHOCKWAVE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP) return TRUE; } case WR_CHECKAMMO1: - { - ammo_amount = self.ammo_shells >= WEP_CVAR(shockwave, pellets_ammo); - ammo_amount += self.(weapon_load[WEP_SHOCKWAVE]) >= WEP_CVAR(shockwave, pellets_ammo); - return ammo_amount; - } case WR_CHECKAMMO2: { - // melee attack is always available + // shockwave has infinite ammo return TRUE; } case WR_CONFIG: @@ -776,11 +694,6 @@ float W_Shockwave(float req) SHOCKWAVE_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS) return TRUE; } - case WR_RELOAD: - { - W_Reload(WEP_CVAR(shockwave, pellets_ammo), "weapons/reload.wav"); - return TRUE; - } case WR_SUICIDEMESSAGE: { return WEAPON_THINKING_WITH_PORTALS; @@ -815,6 +728,11 @@ float W_Shockwave(float req) //precache_sound("weapons/ric3.wav"); return FALSE; } + case WR_ZOOMRETICLE: + { + // no weapon specific image for this weapon + return FALSE; + } } return TRUE; }