bool g_onslaught;
-float autocvar_g_onslaught_debug;
float autocvar_g_onslaught_teleport_wait;
bool autocvar_g_onslaught_spawn_at_controlpoints;
bool autocvar_g_onslaught_spawn_at_generator;
// Junk Pile
// ==========
-void ons_debug(string input)
-{
- switch(autocvar_g_onslaught_debug)
- {
- case 1: LOG_TRACE(input); break;
- case 2: LOG_INFO(input); break;
- }
-}
-
void setmodel_fixsize(entity e, Model m)
{
setmodel(e, m);
{
entity l;
// first check if the game has ended
- ons_debug("--- updatelinks ---\n");
+ LOG_DEBUG("--- updatelinks ---\n");
// mark generators as being shielded and networked
for(l = ons_worldgeneratorlist; l; l = l.ons_worldgeneratornext)
{
if (l.iscaptured)
- ons_debug(strcat(etos(l), " (generator) belongs to team ", ftos(l.team), "\n"));
+ LOG_DEBUG(strcat(etos(l), " (generator) belongs to team ", ftos(l.team), "\n"));
else
- ons_debug(strcat(etos(l), " (generator) is destroyed\n"));
+ LOG_DEBUG(strcat(etos(l), " (generator) is destroyed\n"));
l.islinked = l.iscaptured;
l.isshielded = l.iscaptured;
l.sprite.SendFlags |= 16;
l.isshielded = true;
int i;
for(i = 0; i < 17; ++i) { l.isgenneighbor[i] = false; l.iscpneighbor[i] = false; }
- ons_debug(strcat(etos(l), " (point) belongs to team ", ftos(l.team), "\n"));
+ LOG_DEBUG(strcat(etos(l), " (point) belongs to team ", ftos(l.team), "\n"));
l.sprite.SendFlags |= 16;
}
// flow power outward from the generators through the network
{
stop = false;
l.goalentity.islinked = true;
- ons_debug(strcat(etos(l), " (link) is marking ", etos(l.goalentity), " (point) because its team matches ", etos(l.enemy), " (point)\n"));
+ LOG_DEBUG(strcat(etos(l), " (link) is marking ", etos(l.goalentity), " (point) because its team matches ", etos(l.enemy), " (point)\n"));
}
else if (!l.enemy.islinked)
{
stop = false;
l.enemy.islinked = true;
- ons_debug(strcat(etos(l), " (link) is marking ", etos(l.enemy), " (point) because its team matches ", etos(l.goalentity), " (point)\n"));
+ LOG_DEBUG(strcat(etos(l), " (link) is marking ", etos(l.enemy), " (point) because its team matches ", etos(l.goalentity), " (point)\n"));
}
}
}
{
if(DIFF_TEAM(l.goalentity, l.enemy))
{
- ons_debug(strcat(etos(l), " (link) is unshielding ", etos(l.enemy), " (point) because its team does not match ", etos(l.goalentity), " (point)\n"));
+ LOG_DEBUG(strcat(etos(l), " (link) is unshielding ", etos(l.enemy), " (point) because its team does not match ", etos(l.goalentity), " (point)\n"));
l.enemy.isshielded = false;
}
if(l.goalentity.classname == "onslaught_generator")
{
if(DIFF_TEAM(l.goalentity, l.enemy))
{
- ons_debug(strcat(etos(l), " (link) is unshielding ", etos(l.goalentity), " (point) because its team does not match ", etos(l.enemy), " (point)\n"));
+ LOG_DEBUG(strcat(etos(l), " (link) is unshielding ", etos(l.goalentity), " (point) because its team does not match ", etos(l.enemy), " (point)\n"));
l.goalentity.isshielded = false;
}
if(l.enemy.classname == "onslaught_generator")
{
if (l.isshielded)
{
- ons_debug(strcat(etos(l), " (generator) is shielded\n"));
+ LOG_DEBUG(strcat(etos(l), " (generator) is shielded\n"));
l.takedamage = DAMAGE_NO;
l.bot_attack = false;
}
else
{
- ons_debug(strcat(etos(l), " (generator) is not shielded\n"));
+ LOG_DEBUG(strcat(etos(l), " (generator) is not shielded\n"));
l.takedamage = DAMAGE_AIM;
l.bot_attack = true;
}
{
if (l.isshielded)
{
- ons_debug(strcat(etos(l), " (point) is shielded\n"));
+ LOG_DEBUG(strcat(etos(l), " (point) is shielded\n"));
if (l.goalentity)
{
l.goalentity.takedamage = DAMAGE_NO;
}
else
{
- ons_debug(strcat(etos(l), " (point) is not shielded\n"));
+ LOG_DEBUG(strcat(etos(l), " (point) is not shielded\n"));
if (l.goalentity)
{
l.goalentity.takedamage = DAMAGE_AIM;
if(!self.goalentity) { objerror("can not find target\n"); }
if(!self.enemy) { objerror("can not find target2\n"); }
- ons_debug(strcat(etos(self.goalentity), " linked with ", etos(self.enemy), "\n"));
+ LOG_DEBUG(strcat(etos(self.goalentity), " linked with ", etos(self.enemy), "\n"));
self.SendFlags |= 3;
self.think = ons_Link_CheckUpdate;
self.nextthink = time;
if(!needweapons && !needarmor)
return;
- ons_debug(strcat(self.netname, " needs weapons ", ftos(needweapons) , "\n"));
- ons_debug(strcat(self.netname, " needs armor ", ftos(needarmor) , "\n"));
+ LOG_DEBUG(strcat(self.netname, " needs weapons ", ftos(needweapons) , "\n"));
+ LOG_DEBUG(strcat(self.netname, " needs armor ", ftos(needarmor) , "\n"));
// See what is around
head = findchainfloat(bot_pickup, true);
void havocbot_role_ons_setrole(entity bot, int role)
{
- ons_debug(strcat(bot.netname," switched to "));
+ LOG_DEBUG(strcat(bot.netname," switched to "));
switch(role)
{
case HAVOCBOT_ONS_ROLE_DEFENSE:
- ons_debug("defense");
+ LOG_DEBUG("defense");
bot.havocbot_role = havocbot_role_ons_defense;
bot.havocbot_role_flags = HAVOCBOT_ONS_ROLE_DEFENSE;
bot.havocbot_role_timeout = 0;
break;
case HAVOCBOT_ONS_ROLE_ASSISTANT:
- ons_debug("assistant");
+ LOG_DEBUG("assistant");
bot.havocbot_role = havocbot_role_ons_assistant;
bot.havocbot_role_flags = HAVOCBOT_ONS_ROLE_ASSISTANT;
bot.havocbot_role_timeout = 0;
break;
case HAVOCBOT_ONS_ROLE_OFFENSE:
- ons_debug("offense");
+ LOG_DEBUG("offense");
bot.havocbot_role = havocbot_role_ons_offense;
bot.havocbot_role_flags = HAVOCBOT_ONS_ROLE_OFFENSE;
bot.havocbot_role_timeout = 0;
break;
}
- ons_debug("\n");
+ LOG_DEBUG("\n");
}
void havocbot_goalrating_ons_controlpoints_attack(float ratingscale)
if (!cp)
return;
- ons_debug(strcat(self.netname, " chose cp ranked ", ftos(bestvalue), "\n"));
+ LOG_DEBUG(strcat(self.netname, " chose cp ranked ", ftos(bestvalue), "\n"));
if(cp.goalentity)
{
{
navigation_routerating(cp, ratingscale, 10000);
}
- ons_debug(strcat(self.netname, " found an attackable controlpoint at ", vtos(cp.origin) ,"\n"));
+ LOG_DEBUG(strcat(self.netname, " found an attackable controlpoint at ", vtos(cp.origin) ,"\n"));
}
else
{
// Should be touched
- ons_debug(strcat(self.netname, " found a touchable controlpoint at ", vtos(cp.origin) ,"\n"));
+ LOG_DEBUG(strcat(self.netname, " found a touchable controlpoint at ", vtos(cp.origin) ,"\n"));
found = false;
// Look for auto generated waypoint
if(bestwp)
{
- ons_debug("waypoints found around generator\n");
+ LOG_DEBUG("waypoints found around generator\n");
navigation_routerating(bestwp, ratingscale, 10000);
bestwp.cnt += 1;
}
else
{
- ons_debug("generator found without waypoints around\n");
+ LOG_DEBUG("generator found without waypoints around\n");
// if there aren't waypoints near the generator go straight to it
navigation_routerating(g, ratingscale, 10000);
self.havocbot_attack_time = 0;