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"
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."
.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);
}
}
}
}
- MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate)
+ MUTATOR_HOOKFUNCTION(buffs, Damage_Calculate)
{
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
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)
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)
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)
{
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)
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;
}
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);
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