]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
authorLyberta <lyberta@lyberta.net>
Mon, 5 Feb 2018 17:08:43 +0000 (20:08 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 5 Feb 2018 17:08:43 +0000 (20:08 +0300)
1  2 
defaultServer.cfg
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/server/client.qc

diff --combined defaultServer.cfg
index decd229cbc546cba799381242661089aba131126,4cabc2246ac608a760fa1fc596f576a54cf1e9a9..89f7a2f7c27b1f10ed1975dd27e14d341db6903c
@@@ -83,6 -83,8 +83,8 @@@ set sv_precacheplayermodels 
  set sv_precacheweapons 0
  set sv_precacheitems 0
  set sv_spectator_speed_multiplier 1.5
+ set sv_spectator_speed_multiplier_min 1
+ set sv_spectator_speed_multiplier_max 5
  set sv_spectate 1 "if set to 1, new clients are allowed to spectate or observe the game, if set to 0 joining clients spawn as players immediately (no spectating)"
  set sv_defaultcharacter 0 "master switch, if set to 1 the further configuration for replacing all player models, skins and colors is taken from the sv_defaultplayermodel, sv_defaultplayerskin and sv_defaultplayercolors variables"
  set sv_defaultcharacterskin 0 "if set to 1 the further configuration for replacing all skins is taken from the sv_defaultplayerskin variables"
@@@ -116,7 -118,8 +118,8 @@@ set bot_debug_goalstack 0 "Visualize th
  set bot_wander_enable 1 "Have bots wander around if they are unable to reach any useful goal. Disable only for debugging purposes."
  // general bot AI cvars
  set bot_ai_thinkinterval 0.05
- set bot_ai_strategyinterval 5 "How often a new objective is chosen"
+ set bot_ai_strategyinterval 7 "How often a new objective is chosen"
+ set bot_ai_strategyinterval_movingtarget 5.5 "How often a new objective is chosen when current objective can move"
  set bot_ai_enemydetectioninterval 2 "How often bots pick a new target"
  set bot_ai_enemydetectionradius 10000 "How far bots can see enemies"
  set bot_ai_dodgeupdateinterval 0.2 "How often scan for items to dodge. Currently not in use."
@@@ -134,9 -137,9 +137,9 @@@ set bot_ai_keyboard_threshold 0.5
  set bot_ai_aimskill_offset 0.3 "Amount of error induced to the bots aim"
  set bot_ai_aimskill_think 1 "Aiming velocity. Use values below 1 for slower aiming"
  set bot_ai_custom_weapon_priority_distances "300 850" "Define close and far distances in any order. Based on the distance to the enemy bots will choose different weapons"
 -set bot_ai_custom_weapon_priority_far   "vaporizer vortex rifle electro devastator mortar hagar hlac crylink blaster machinegun fireball seeker shotgun shockwave tuba minelayer"     "Desired weapons for far distances ordered by priority"
 -set bot_ai_custom_weapon_priority_mid   "vaporizer devastator vortex fireball seeker mortar electro machinegun arc crylink hlac hagar shotgun shockwave blaster rifle tuba minelayer" "Desired weapons for middle distances ordered by priority"
 -set bot_ai_custom_weapon_priority_close "vaporizer vortex shotgun shockwave machinegun arc hlac tuba seeker hagar crylink mortar electro devastator blaster fireball rifle minelayer" "Desired weapons for close distances ordered by priority"
 +set bot_ai_custom_weapon_priority_far   "vaporizer okvortex vortex rifle electro devastator mortar hagar hlac crylink blaster okmachinegun machinegun fireball seeker okshotgun shotgun shockwave tuba minelayer"     "Desired weapons for far distances ordered by priority"
 +set bot_ai_custom_weapon_priority_mid   "vaporizer devastator okvortex vortex fireball seeker mortar electro okmachinegun machinegun arc crylink hlac hagar okshotgun shotgun shockwave blaster rifle tuba minelayer" "Desired weapons for middle distances ordered by priority"
 +set bot_ai_custom_weapon_priority_close "vaporizer okvortex vortex okshotgun shotgun shockwave okmachinegun machinegun arc hlac tuba seeker hagar crylink mortar electro devastator blaster fireball rifle minelayer" "Desired weapons for close distances ordered by priority"
  set bot_ai_weapon_combo 1     "Enable bots to do weapon combos"
  set bot_ai_weapon_combo_threshold 0.4 "Try to make a combo N seconds after the last attack"
  set bot_ai_friends_aware_pickup_radius "500"  "Bots will not pickup items if a team mate is this distance near the item"
index 9f9da48c8d98a52a1fcda6a0b17ccdf4ec6d70bf,5611042b0b3100f1bb8cb0dcd2e06e546fa9720a..cb2a84049ee7171661e1e418ff372b335487a46f
@@@ -37,9 -37,9 +37,9 @@@ REGISTER_MUTATOR(ok, expr_evaluate(auto
                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";
        }
  
        MUTATOR_ONREMOVE
@@@ -122,34 -122,56 +122,39 @@@ MUTATOR_HOOKFUNCTION(ok, ForbidThrowCur
  
  MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
  {
 -      if(game_stopped)
 +      if (game_stopped)
 +      {
                return;
 -
 +      }
        entity player = M_ARGV(0, entity);
 -
 -      if(IS_DEAD(player) || !IS_PLAYER(player) || STAT(FROZEN, player))
 +      if (!IS_PLAYER(player) || IS_DEAD(player) || STAT(FROZEN, player))
 +      {
                return;
 -
 -      if(PHYS_INPUT_BUTTON_ATCK2(player) && time >= player.jump_interval)
 -      if( !forbidWeaponUse(player)
 -              || (round_handler_IsActive() && !round_handler_IsRoundStarted()) )
 +      }
 +      if (!PHYS_INPUT_BUTTON_ATCK2(player) || 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)
 +              return;
 +      }
 +      // Allow secondary blaster during countdown.
 +      for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
 +      {
 +              .entity weaponentity = weaponentities[slot];
 +              Weapon weapon = player.(weaponentity).m_weapon;
 +              if (weapon == WEP_Null && slot != 0)
                {
 -                      .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;
 +                      continue;
                }
 +              weapon.wr_think(weapon, player, weaponentity, 2);
        }
 -
        PHYS_INPUT_BUTTON_ATCK2(player) = false;
  }
  
+ MUTATOR_HOOKFUNCTION(ok, ForbidRandomStartWeapons)
+ {
+       return true;
+ }
  MUTATOR_HOOKFUNCTION(ok, PlayerWeaponSelect)
  {
        entity player = M_ARGV(0, entity);
@@@ -245,7 -267,7 +250,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); }
@@@ -275,4 -297,3 +280,4 @@@ MUTATOR_HOOKFUNCTION(ok, SetModname
        M_ARGV(0, string) = "Overkill";
        return true;
  }
 +
diff --combined qcsrc/server/client.qc
index 399d11d63e63185d50053634bf99d55b0c5b2aae,3333c04e49180286b6ef8806c91aa410baf0de1e..769bbd8732c4197c0f85a689b278034a0909315b
@@@ -61,8 -61,6 +61,8 @@@
  
  #include "../lib/warpzone/server.qh"
  
 +#include <common/mutators/mutator/overkill/okvortex.qh>
 +
  STATIC_METHOD(Client, Add, void(Client this, int _team))
  {
      ClientConnect(this);
@@@ -560,8 -558,11 +560,11 @@@ void PutPlayerInServer(entity this
                this.health = start_health;
                this.armorvalue = start_armorvalue;
                this.weapons = start_weapons;
-               GiveRandomWeapons(this, random_start_weapons_count,
-                       autocvar_g_random_start_weapons, random_start_ammo);
+               if (MUTATOR_CALLHOOK(ForbidRandomStartWeapons, this) == false)
+               {
+                       GiveRandomWeapons(this, random_start_weapons_count,
+                               autocvar_g_random_start_weapons, random_start_ammo);
+               }
        }
        SetSpectatee_status(this, 0);
  
        this.fire_endtime = -1;
        this.revive_progress = 0;
        this.revival_time = 0;
        this.air_finished = time + 12;
+       this.waterlevel = WATERLEVEL_NONE;
+       this.watertype = CONTENT_EMPTY;
  
        entity spawnevent = new_pure(spawnevent);
        spawnevent.owner = this;
        setorigin(this, spot.origin + '0 0 1' * (1 - this.mins.z - 24));
        // don't reset back to last position, even if new position is stuck in solid
        this.oldorigin = this.origin;
-       this.lastteleporttime = time; // prevent insane speeds due to changing origin
        if(this.conveyor)
                IL_REMOVE(g_conveyed, this);
        this.conveyor = NULL; // prevent conveyors at the previous location from moving a freshly spawned player
@@@ -1188,12 -1191,10 +1193,10 @@@ void ClientConnect(entity this
        }
        if (!teamplay && this.team_forced > 0) this.team_forced = 0;
  
-     {
-         int id = this.playerid;
-         this.playerid = 0; // silent
-           JoinBestTeam(this, false); // if the team number is valid, keep it
-           this.playerid = id;
-     }
+       int playerid_save = this.playerid;
+       this.playerid = 0; // silent
+       JoinBestTeam(this, false); // if the team number is valid, keep it
+       this.playerid = playerid_save;
  
        if (autocvar_sv_spectate || autocvar_g_campaign || this.team_forced < 0) {
                TRANSMUTE(Observer, this);
@@@ -1760,8 -1761,6 +1763,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;
@@@ -2664,7 -2663,7 +2667,7 @@@ void PlayerPreThink (entity this
  
  void DrownPlayer(entity this)
  {
-       if(IS_DEAD(this))
+       if(IS_DEAD(this) || game_stopped || time < game_starttime)
                return;
  
        if (this.waterlevel != WATERLEVEL_SUBMERGED || this.vehicle)