]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/overkill/oknex.qc
Fix typo mistake on NADE_TYPE_DARKNESS, correct some indentations again and, in oknex...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / overkill / oknex.qc
index 85f33714054e1560f40c0ccf28a12a83b1b0c048..311e7a73813a1cdfb828c30f1377f44c01a6d8ee 100644 (file)
@@ -141,7 +141,8 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
        {
                // Secondary uses it's own refire timer if refire_type is 1.
                actor.jump_interval = time + WEP_CVAR_SEC(oknex, refire) * W_WeaponRateFactor(actor);
-               BLASTER_SECONDARY_ATTACK(oknex, actor, weaponentity);
+               makevectors(actor.v_angle);
+               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
                if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
                        (actor.(weaponentity).wframe == WFRAME_FIRE2))
                {
@@ -180,83 +181,87 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
                {
                        return;
                }
-               BLASTER_SECONDARY_ATTACK(oknex, actor, weaponentity);
+               makevectors(actor.v_angle);
+               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
                weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(oknex, animtime), w_ready);
                return;
        }
-       //if ((WEP_CVAR(oknex, charge) && (WEP_CVAR(oknex, secondary) == 1)) ? (PHYS_INPUT_BUTTON_ZOOM(actor) | PHYS_INPUT_BUTTON_ZOOMSCRIPT(actor)) : (fire & 2))
-       //{
-       //      if(WEP_CVAR(oknex, charge))
-       //      {
-       //              actor.(weaponentity).oknex_charge_rottime = time + WEP_CVAR(oknex, charge_rot_pause);
-       //              float dt = frametime / W_TICSPERFRAME;
-       //
-       //              if(actor.(weaponentity).oknex_charge < 1)
-       //              {
-       //                      if(WEP_CVAR_SEC(oknex, chargepool))
-       //                      {
-       //                              if(WEP_CVAR_SEC(oknex, ammo))
-       //                              {
-       //                                      // always deplete if secondary is held
-       //                                      actor.(weaponentity).oknex_chargepool_ammo = max(0, actor.(weaponentity).oknex_chargepool_ammo - WEP_CVAR_SEC(oknex, ammo) * dt);
-
-       //                                      dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(oknex, charge_rate));
-       //                                      actor.oknex_chargepool_pauseregen_finished = time + WEP_CVAR_SEC(oknex, chargepool_pause_regen);
-       //                                      dt = min(dt, actor.(weaponentity).oknex_chargepool_ammo);
-       //                                      dt = max(0, dt);
-
-       //                                      actor.(weaponentity).oknex_charge += dt * WEP_CVAR(oknex, charge_rate);
-       //                              }
-       //                      }
-
-       //                      else if(WEP_CVAR_SEC(oknex, ammo))
-       //                      {
-       //                              if(fire & 2) // only eat ammo when the button is pressed
-       //                              {
-       //                                      dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(oknex, charge_rate));
-       //                                      if(!(actor.items & IT_UNLIMITED_AMMO))
-       //                                      {
-       //                                              // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
-       //                                              if(autocvar_g_balance_vortex_reload_ammo)
-       //                                              {
-       //                                                      dt = min(dt, (actor.(weaponentity).clip_load - WEP_CVAR_PRI(oknex, ammo)) / WEP_CVAR_SEC(oknex, ammo));
-       //                                                      dt = max(0, dt);
-       //                                                      if(dt > 0)
-       //                                                      {
-       //                                                              actor.(weaponentity).clip_load = max(WEP_CVAR_SEC(oknex, ammo), actor.(weaponentity).clip_load - WEP_CVAR_SEC(oknex, ammo) * dt);
-       //                                                      }
-       //                                                      actor.(weaponentity).(weapon_load[WEP_OVERKILL_NEX.m_id]) = actor.(weaponentity).clip_load;
-       //                                              }
-       //                                              else
-       //                                              {
-       //                                                      dt = min(dt, (actor.(thiswep.ammo_field) - WEP_CVAR_PRI(oknex, ammo)) / WEP_CVAR_SEC(oknex, ammo));
-       //                                                      dt = max(0, dt);
-       //                                                      if(dt > 0)
-       //                                                      {
-       //                                                              actor.(thiswep.ammo_field) = max(WEP_CVAR_SEC(oknex, ammo), actor.(thiswep.ammo_field) - WEP_CVAR_SEC(oknex, ammo) * dt);
-       //                                                      }
-       //                                              }
-       //                                      }
-       //                                      actor.(weaponentity).oknex_charge += dt * WEP_CVAR(oknex, charge_rate);
-       //                              }
-       //                      }
-
-       //                      else
-       //                      {
-       //                              dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(oknex, charge_rate));
-       //                              actor.(weaponentity).oknex_charge += dt * WEP_CVAR(oknex, charge_rate);
-       //                      }
-       //              }
-       //      }
-       //      else if(WEP_CVAR(oknex, secondary))
-       //      {
-       //              if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_SEC(oknex, refire)))
-       //              {
-       //                      W_OverkillNex_Attack(thiswep, actor, weaponentity, 1);
-       //                      weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(oknex, animtime), w_ready);
-       //              }
-       //      }
-       //}
+
+#if 0
+       if ((WEP_CVAR(oknex, charge) && (WEP_CVAR(oknex, secondary) == 1)) ? (PHYS_INPUT_BUTTON_ZOOM(actor) | PHYS_INPUT_BUTTON_ZOOMSCRIPT(actor)) : (fire & 2))
+       {
+               if(WEP_CVAR(oknex, charge))
+               {
+                       actor.(weaponentity).oknex_charge_rottime = time + WEP_CVAR(oknex, charge_rot_pause);
+                       float dt = frametime / W_TICSPERFRAME;
+       
+                       if(actor.(weaponentity).oknex_charge < 1)
+                       {
+                               if(WEP_CVAR_SEC(oknex, chargepool))
+                               {
+                                       if(WEP_CVAR_SEC(oknex, ammo))
+                                       {
+                                               // always deplete if secondary is held
+                                               actor.(weaponentity).oknex_chargepool_ammo = max(0, actor.(weaponentity).oknex_chargepool_ammo - WEP_CVAR_SEC(oknex, ammo) * dt);
+
+                                               dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(oknex, charge_rate));
+                                               actor.oknex_chargepool_pauseregen_finished = time + WEP_CVAR_SEC(oknex, chargepool_pause_regen);
+                                               dt = min(dt, actor.(weaponentity).oknex_chargepool_ammo);
+                                               dt = max(0, dt);
+
+                                               actor.(weaponentity).oknex_charge += dt * WEP_CVAR(oknex, charge_rate);
+                                       }
+                               }
+
+                               else if(WEP_CVAR_SEC(oknex, ammo))
+                               {
+                                       if(fire & 2) // only eat ammo when the button is pressed
+                                       {
+                                               dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(oknex, charge_rate));
+                                               if(!(actor.items & IT_UNLIMITED_AMMO))
+                                               {
+                                                       // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+                                                       if(autocvar_g_balance_vortex_reload_ammo)
+                                                       {
+                                                               dt = min(dt, (actor.(weaponentity).clip_load - WEP_CVAR_PRI(oknex, ammo)) / WEP_CVAR_SEC(oknex, ammo));
+                                                               dt = max(0, dt);
+                                                               if(dt > 0)
+                                                               {
+                                                                       actor.(weaponentity).clip_load = max(WEP_CVAR_SEC(oknex, ammo), actor.(weaponentity).clip_load - WEP_CVAR_SEC(oknex, ammo) * dt);
+                                                               }
+                                                               actor.(weaponentity).(weapon_load[WEP_OVERKILL_NEX.m_id]) = actor.(weaponentity).clip_load;
+                                                       }
+                                                       else
+                                                       {
+                                                               dt = min(dt, (actor.(thiswep.ammo_field) - WEP_CVAR_PRI(oknex, ammo)) / WEP_CVAR_SEC(oknex, ammo));
+                                                               dt = max(0, dt);
+                                                               if(dt > 0)
+                                                               {
+                                                                       actor.(thiswep.ammo_field) = max(WEP_CVAR_SEC(oknex, ammo), actor.(thiswep.ammo_field) - WEP_CVAR_SEC(oknex, ammo) * dt);
+                                                               }
+                                                       }
+                                               }
+                                               actor.(weaponentity).oknex_charge += dt * WEP_CVAR(oknex, charge_rate);
+                                       }
+                               }
+
+                               else
+                               {
+                                       dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(oknex, charge_rate));
+                                       actor.(weaponentity).oknex_charge += dt * WEP_CVAR(oknex, charge_rate);
+                               }
+                       }
+               }
+               else if(WEP_CVAR(oknex, secondary))
+               {
+                       if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_SEC(oknex, refire)))
+                       {
+                               W_OverkillNex_Attack(thiswep, actor, weaponentity, 1);
+                               weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(oknex, animtime), w_ready);
+                       }
+               }
+       }
+#endif
 }
 
 METHOD(OverkillNex, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
@@ -324,7 +329,7 @@ METHOD(OverkillNex, wr_zoom, bool(entity thiswep, entity actor))
 METHOD(OverkillNex, wr_impacteffect, void(entity thiswep, entity actor))
 {
        entity this = actor;
-       vector org2 = w_org + w_backoff * 6;
+       vector org2 = w_org + w_backoff * 2;
        pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
        if(!w_issilent)
                sound(this, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);