]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'martin-t/misc' into 'master'
authorMario <zacjardine@y7mail.com>
Sat, 31 Dec 2016 01:25:48 +0000 (01:25 +0000)
committerMario <zacjardine@y7mail.com>
Sat, 31 Dec 2016 01:25:48 +0000 (01:25 +0000)
martin-t/misc

See merge request !399

1  2 
defaultXonotic.cfg
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc

diff --combined defaultXonotic.cfg
index bbdbdcb74a4873406ac60d3c4ac72fc158aba72e,b2683e2d0b49e9210a7d854c0d1afed8ef7f6f39..a5d81ad303a52a5356b5e5cfd4cf74167a178cde
@@@ -382,7 -382,7 +382,7 @@@ set bot_ai_friends_aware_pickup_radius 
  set bot_ai_ignoregoal_timeout 3       "Ignore goals making bots to get stuck in front of a wall for N seconds"
  set bot_ai_bunnyhop_skilloffset 7     "Bots with skill equal or greater than this value will perform the  \"bunnyhop\" technique"
  set bot_ai_bunnyhop_startdistance 200 "Run to goals located further than this distance"
 -set bot_ai_bunnyhop_stopdistance 200 "Stop jumping after reaching this distance to the goal"
 +set bot_ai_bunnyhop_stopdistance 300 "Stop jumping after reaching this distance to the goal"
  set bot_ai_bunnyhop_firstjumpdelay 0.2 "Start running to the goal only if it was seen for more than N seconds"
  set bot_god 0 "god mode for bots"
  set bot_ai_navigation_jetpack 0 "Enable bots to navigate maps using the jetpack"
@@@ -1072,7 -1072,7 +1072,7 @@@ alias gl_flashblend_update "_gl_flashbl
  
  set sv_clones 0       "number of clones a player may make (reset by the \"kill\" command)"
  
- set cl_handicap 1     "the higher, the more damage you will receive (client setting) NOTE: reconnect or use sendcvar command to update the choice."
+ set cl_handicap 1     "multiplies damage received and divides damage dealt NOTE: reconnect or use 'sendcvar cl_handicap' to update the choice."
  
  seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such. (client setting) NOTE: reconnect or use sendcvar command to update the choice."
  
index d9eed031cd2f15b2fe4d6459bb2d6a19351d6e7a,4bc977d2ba945615872227ac0db9747a0f9b8580..900d16a45d20e6acf376fd297ea922d76b80bc81
@@@ -6,14 -6,11 +6,14 @@@
  .float buff_time = _STAT(BUFF_TIME);
  void buffs_DelayedInit(entity this);
  
 -REGISTER_MUTATOR(buffs, cvar("g_buffs"))
 +AUTOCVAR(g_buffs, int, -1, _("Enable buffs, -1: enabled but no auto location or replacing powerups, 1: enabled and can replace them"));
 +
 +REGISTER_MUTATOR(buffs, autocvar_g_buffs)
  {
        MUTATOR_ONADD
        {
 -              InitializeEntity(NULL, buffs_DelayedInit, INITPRIO_FINDTARGET);
 +              if(autocvar_g_buffs > 0)
 +                      InitializeEntity(NULL, buffs_DelayedInit, INITPRIO_FINDTARGET);
        }
  }
  
@@@ -450,7 -447,7 +450,7 @@@ MUTATOR_HOOKFUNCTION(buffs, PlayerDamag
        }
  }
  
- MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate)
+ MUTATOR_HOOKFUNCTION(buffs, Damage_Calculate)
  {
        entity frag_attacker = M_ARGV(1, entity);
        entity frag_target = M_ARGV(2, entity);
@@@ -595,10 -592,6 +595,10 @@@ MUTATOR_HOOKFUNCTION(buffs, PlayerJump
  
        if(player.buffs & BUFF_JUMP.m_itemid)
                M_ARGV(1, float) = autocvar_g_buffs_jump_height;
 +
 +      if(player.buffs & BUFF_FLIGHT.m_itemid)
 +      if(!IS_JUMP_HELD(player) && PHYS_INPUT_BUTTON_CROUCH(player))
 +              player.gravity *= -1;
  }
  
  MUTATOR_HOOKFUNCTION(buffs, MonsterMove)
@@@ -751,9 -744,6 +751,9 @@@ MUTATOR_HOOKFUNCTION(buffs, CustomizeWa
  
  MUTATOR_HOOKFUNCTION(buffs, OnEntityPreSpawn, CBC_ORDER_LAST)
  {
 +      if(autocvar_g_buffs < 0)
 +              return; // no auto replacing of entities in this mode
 +
        entity ent = M_ARGV(0, entity);
  
        if(autocvar_g_buffs_replace_powerups)
@@@ -909,16 -899,6 +909,16 @@@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreTh
                BUFF_ONREM(BUFF_INVISIBLE)
                        player.alpha = player.buff_invisible_prev_alpha;
  
 +              BUFF_ONADD(BUFF_FLIGHT)
 +              {
 +                      player.buff_flight_oldgravity = player.gravity;
 +                      if(!player.gravity)
 +                              player.gravity = 1;
 +              }
 +
 +              BUFF_ONREM(BUFF_FLIGHT)
 +                      player.gravity = ((player.trigger_gravity_check) ? player.trigger_gravity_check.enemy.gravity : player.buff_flight_oldgravity);
 +
                player.oldbuffs = player.buffs;
                if(player.buffs)
                {
@@@ -1002,14 -982,12 +1002,14 @@@ REPLICATE(cvar_cl_buffs_autoreplace, bo
  
  MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsString)
  {
 -      M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Buffs");
 +      if(autocvar_g_buffs > 0) // only report as a mutator if they're enabled
 +              M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Buffs");
  }
  
  MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsPrettyString)
  {
 -      M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Buffs");
 +      if(autocvar_g_buffs > 0)
 +              M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Buffs");
  }
  
  void buffs_DelayedInit(entity this)
index d1c97bd2856f90d2e227f1deb65f1e314a676227,bbfa775d58c0ff71ea131e498e37ecf9ce7e7722..6036fa529e6ffcf8906a5bd9104bd5f63b300dcc
@@@ -1825,11 -1825,6 +1825,11 @@@ void havocbot_role_ctf_retriever(entit
        mf = havocbot_ctf_find_flag(this);
        if(mf.ctf_status==FLAG_BASE)
        {
 +              if(this.goalcurrent == mf)
 +              {
 +                      navigation_clearroute(this);
 +                      this.bot_strategytime = 0;
 +              }
                havocbot_ctf_reset_role(this);
                return;
        }
@@@ -2083,7 -2078,7 +2083,7 @@@ MUTATOR_HOOKFUNCTION(ctf, PlayerPreThin
                WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id));
  }
  
- MUTATOR_HOOKFUNCTION(ctf, PlayerDamage_Calculate) // for changing damage and force values that are applied to players in g_damage.qc
+ MUTATOR_HOOKFUNCTION(ctf, Damage_Calculate) // for changing damage and force values that are applied to players in g_damage.qc
  {
        entity frag_attacker = M_ARGV(1, entity);
        entity frag_target = M_ARGV(2, entity);
@@@ -2592,14 -2587,6 +2592,14 @@@ spawnfunc(team_CTF_bluespawn)  { spawnf
  spawnfunc(team_CTF_neutralflag)       { spawnfunc_item_flag_neutral(this);  }
  spawnfunc(team_neutralobelisk)        { spawnfunc_item_flag_neutral(this);  }
  
 +// compatibility for wop maps
 +spawnfunc(team_redplayer)      { spawnfunc_info_player_team1(this);  }
 +spawnfunc(team_blueplayer)     { spawnfunc_info_player_team2(this);  }
 +spawnfunc(team_ctl_redlolly)   { spawnfunc_item_flag_team1(this);    }
 +spawnfunc(team_CTL_redlolly)   { spawnfunc_item_flag_team1(this);    }
 +spawnfunc(team_ctl_bluelolly)  { spawnfunc_item_flag_team2(this);    }
 +spawnfunc(team_CTL_bluelolly)  { spawnfunc_item_flag_team2(this);    }
 +
  
  // ==============
  // Initialization