]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix typo mistake on NADE_TYPE_DARKNESS, correct some indentations again and, in oknex...
authorLegendaryGuard <rootuser999@gmail.com>
Mon, 10 Jul 2023 15:16:16 +0000 (17:16 +0200)
committerLegendaryGuard <rootuser999@gmail.com>
Mon, 10 Jul 2023 15:16:16 +0000 (17:16 +0200)
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/overkill/oknex.qc

index c0d7b29918f8fc60d4fffca717986ab23bebd359..12997c0b51f4211f87793e0db6890556521a0bf3 100644 (file)
@@ -51,7 +51,7 @@ bool darkblink;
 void HUD_DarkBlinking()
 {
        vector bottomright = vec2(vid_conwidth, vid_conheight);
-       drawfill('0 0 0', bottomright, NADE_TYPE_DARNESS.m_color, 0.986, DRAWFLAG_NORMAL);
+       drawfill('0 0 0', bottomright, NADE_TYPE_DARKNESS.m_color, 0.986, DRAWFLAG_NORMAL);
 }
 
 REGISTER_MUTATOR(cl_nades, true);
@@ -59,7 +59,7 @@ MUTATOR_HOOKFUNCTION(cl_nades, HUD_Draw_overlay)
 {
        if (STAT(NADE_DARKNESS_TIME) > time)
        {
-               M_ARGV(0, vector) = NADE_TYPE_DARNESS.m_color;
+               M_ARGV(0, vector) = NADE_TYPE_DARKNESS.m_color;
                HUD_DarkBlinking();
                return true;
        }
@@ -938,7 +938,7 @@ void nade_boom(entity this)
        case nade_type: \
                nade_blast = blast; \
                expef = exp_effect; \
-               break;
+               break
 
        switch ( REGISTRY_GET(Nades, STAT(NADE_BONUS_TYPE, this)) )
        {
@@ -951,7 +951,7 @@ void nade_boom(entity this)
                SET_NADE_EFFECT(NADE_TYPE_ENTRAP,      false,                         EFFECT_SPAWN_YELLOW);
                SET_NADE_EFFECT(NADE_TYPE_VEIL,        false,                         EFFECT_SPAWN_NEUTRAL);
                SET_NADE_EFFECT(NADE_TYPE_AMMO,        false,                         EFFECT_SPAWN_BROWN);
-               SET_NADE_EFFECT(NADE_TYPE_DARNESS,        false,                         EFFECT_EXPLOSION_MEDIUM);
+               SET_NADE_EFFECT(NADE_TYPE_DARKNESS,    false,                         EFFECT_EXPLOSION_MEDIUM);
                SET_NADE_EFFECT(NADE_TYPE_NORMAL,      true,                          EFFECT_NADE_EXPLODE(this.realowner.team));
                default: expef = EFFECT_NADE_EXPLODE(this.realowner.team); break;
        }
@@ -981,7 +981,7 @@ void nade_boom(entity this)
                case NADE_TYPE_ENTRAP:      nade_entrap_boom(this);      break;
                case NADE_TYPE_VEIL:        nade_veil_boom(this);        break;
                case NADE_TYPE_AMMO:        nade_ammo_boom(this);        break;
-               case NADE_TYPE_DARNESS:     nade_darkness_boom(this);    break;
+               case NADE_TYPE_DARKNESS:    nade_darkness_boom(this);    break;
        }
 
        IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this,
@@ -1440,7 +1440,7 @@ int nades_CheckTypes(entity player, int cl_ntype)
                CL_NADE_TYPE_CHECK(NADE_TYPE_ENTRAP,      autocvar_g_nades_entrap);
                CL_NADE_TYPE_CHECK(NADE_TYPE_VEIL,        autocvar_g_nades_veil);
                CL_NADE_TYPE_CHECK(NADE_TYPE_AMMO,        autocvar_g_nades_ammo);
-               CL_NADE_TYPE_CHECK(NADE_TYPE_DARNESS,     autocvar_g_nades_darkness);
+               CL_NADE_TYPE_CHECK(NADE_TYPE_DARKNESS,    autocvar_g_nades_darkness);
        }
        return cl_ntype;
 #undef CL_NADE_TYPE_CHECK
index a30a2bf52136b162cf8384e7ceec8c1a7d0cf14d..311e7a73813a1cdfb828c30f1377f44c01a6d8ee 100644 (file)
@@ -186,79 +186,82 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
                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))