]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
authorLyberta <lyberta@lyberta.net>
Sat, 2 Sep 2017 19:07:13 +0000 (22:07 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 2 Sep 2017 19:07:13 +0000 (22:07 +0300)
1  2 
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/server/client.qc

index 0c698e6b0dd3d29ef67fdb1c922a82ed94286856,b47e587511643e3076e172835052c16787d3079d..4b7c7f22f1636261693aed7302d185026abc5a83
@@@ -3,6 -3,8 +3,8 @@@
  #include "hmg.qh"
  #include "rpc.qh"
  
+ string autocvar_g_overkill;
  bool autocvar_g_overkill_powerups_replace;
  
  bool autocvar_g_overkill_itemwaypoints = true;
@@@ -18,7 -20,7 +20,7 @@@ bool autocvar_g_overkill_filter_armorme
  
  void ok_Initialize();
  
- REGISTER_MUTATOR(ok, cvar("g_overkill") && !cvar("g_instagib") && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
+ REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !cvar("g_instagib") && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
  {
        MUTATOR_ONADD
        {
@@@ -110,6 -112,53 +112,6 @@@ MUTATOR_HOOKFUNCTION(ok, ForbidThrowCur
        return true;
  }
  
 -MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
 -{
 -      if(game_stopped)
 -              return;
 -
 -      entity player = M_ARGV(0, entity);
 -
 -      if(IS_DEAD(player) || !IS_PLAYER(player) || STAT(FROZEN, player))
 -              return;
 -
 -      if(PHYS_INPUT_BUTTON_ATCK2(player) && time >= player.jump_interval)
 -      if( !forbidWeaponUse(player)
 -              || (round_handler_IsActive() && !round_handler_IsRoundStarted()) )
 -      {
 -              player.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor(player);
 -              makevectors(player.v_angle);
 -
 -              for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
 -              {
 -                      .entity weaponentity = weaponentities[slot];
 -
 -                      if(player.(weaponentity).m_weapon == WEP_Null && slot != 0)
 -                              continue;
 -
 -                      Weapon oldwep = player.(weaponentity).m_weapon;
 -                      player.(weaponentity).m_weapon = WEP_BLASTER;
 -                      W_Blaster_Attack(
 -                              player,
 -                              weaponentity,
 -                              WEP_BLASTER.m_id | HITTYPE_SECONDARY,
 -                              WEP_CVAR_SEC(vaporizer, shotangle),
 -                              WEP_CVAR_SEC(vaporizer, damage),
 -                              WEP_CVAR_SEC(vaporizer, edgedamage),
 -                              WEP_CVAR_SEC(vaporizer, radius),
 -                              WEP_CVAR_SEC(vaporizer, force),
 -                              WEP_CVAR_SEC(vaporizer, speed),
 -                              WEP_CVAR_SEC(vaporizer, spread),
 -                              WEP_CVAR_SEC(vaporizer, delay),
 -                              WEP_CVAR_SEC(vaporizer, lifetime)
 -                      );
 -                      player.(weaponentity).m_weapon = oldwep;
 -              }
 -      }
 -
 -      PHYS_INPUT_BUTTON_ATCK2(player) = false;
 -}
 -
  MUTATOR_HOOKFUNCTION(ok, PlayerWeaponSelect)
  {
        entity player = M_ARGV(0, entity);
@@@ -225,7 -274,7 +227,7 @@@ MUTATOR_HOOKFUNCTION(ok, FilterItem
  
  MUTATOR_HOOKFUNCTION(ok, SetStartItems, CBC_ORDER_LAST)
  {
 -      WepSet ok_start_items = (WEPSET(MACHINEGUN) | WEPSET(VORTEX) | WEPSET(SHOTGUN));
 +      WepSet ok_start_items = (WEPSET(OVERKILL_MACHINEGUN) | WEPSET(OVERKILL_VORTEX) | WEPSET(OVERKILL_SHOTGUN));
  
        if(WEP_RPC.weaponstart > 0) { ok_start_items |= WEPSET(RPC); }
        if(WEP_HMG.weaponstart > 0) { ok_start_items |= WEPSET(HMG); }
@@@ -263,7 -312,7 +265,7 @@@ void ok_Initialize(
        WEP_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
        WEP_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
  
 -      WEP_SHOTGUN.mdl = "ok_shotgun";
 -      WEP_MACHINEGUN.mdl = "ok_mg";
 -      WEP_VORTEX.mdl = "ok_sniper";
 +      //WEP_SHOTGUN.mdl = "ok_shotgun";
 +      //WEP_MACHINEGUN.mdl = "ok_mg";
 +      //WEP_VORTEX.mdl = "ok_sniper";
  }
diff --combined qcsrc/server/client.qc
index b56305b69b8d117e7a2ece7229678c588725fed8,22543766be9af89c136c5725490481e9643c626c..1da873fb2ba25cc2bda6c95c613e396c73b334f2
@@@ -12,6 -12,7 +12,7 @@@
  #include "teamplay.qh"
  #include "playerdemo.qh"
  #include "spawnpoints.qh"
+ #include "resources.qh"
  #include "g_damage.qh"
  #include "g_hook.qh"
  #include "command/common.qh"
@@@ -59,8 -60,6 +60,8 @@@
  
  #include "../lib/warpzone/server.qh"
  
 +#include <common/mutators/mutator/overkill/okvortex.qh>
 +
  STATIC_METHOD(Client, Add, void(Client this, int _team))
  {
      ClientConnect(this);
@@@ -1630,8 -1629,8 +1631,8 @@@ void player_regen(entity this
                float mina, maxa, limith, limita;
                maxa = autocvar_g_balance_armor_rotstable;
                mina = autocvar_g_balance_armor_regenstable;
-               limith = autocvar_g_balance_health_limit;
-               limita = autocvar_g_balance_armor_limit;
+               limith = GetResourceLimit(this, RESOURCE_HEALTH);
+               limita = GetResourceLimit(this, RESOURCE_ARMOR);
  
                regen_health_rotstable = regen_health_rotstable * max_mod;
                regen_health_stable = regen_health_stable * max_mod;
  
                maxf = autocvar_g_balance_fuel_rotstable;
                minf = autocvar_g_balance_fuel_regenstable;
-               limitf = autocvar_g_balance_fuel_limit;
+               limitf = GetResourceLimit(this, RESOURCE_FUEL);
  
                this.ammo_fuel = CalcRotRegen(this.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf);
        }
@@@ -1740,8 -1739,6 +1741,8 @@@ void SpectateCopy(entity this, entity s
        this.weapons = spectatee.weapons;
        this.vortex_charge = spectatee.vortex_charge;
        this.vortex_chargepool_ammo = spectatee.vortex_chargepool_ammo;
 +      this.okvortex_charge = spectatee.okvortex_charge;
 +      this.okvortex_chargepool_ammo = spectatee.okvortex_chargepool_ammo;
        this.hagar_load = spectatee.hagar_load;
        this.arc_heat_percent = spectatee.arc_heat_percent;
        this.minelayer_mines = spectatee.minelayer_mines;