+#include "role_keyhunt.qh"
+#include "../../_all.qh"
+
+#include "havocbot.qh"
+
+#include "../bot.qh"
+#include "../navigation.qh"
+
+#include "../../mutators/mutators_include.qh"
+
void() havocbot_role_kh_carrier;
void() havocbot_role_kh_defense;
void() havocbot_role_kh_offense;
void() havocbot_role_kh_freelancer;
-entity kh_worldkeylist;
-.entity kh_worldkeynext;
void havocbot_goalrating_kh(float ratingscale_team, float ratingscale_dropped, float ratingscale_enemy)
-{
- local entity head;
+{SELFPARAM();
+ entity head;
for (head = kh_worldkeylist; head; head = head.kh_worldkeynext)
{
if(head.owner == self)
}
havocbot_goalrating_items(1, self.origin, 10000);
-};
+}
void havocbot_role_kh_carrier()
-{
+{SELFPARAM();
if(self.deadflag != DEAD_NO)
return;
if (!(self.kh_next))
{
- dprint("changing role to freelancer\n");
+ LOG_TRACE("changing role to freelancer\n");
self.havocbot_role = havocbot_role_kh_freelancer;
self.havocbot_role_timeout = 0;
return;
}
void havocbot_role_kh_defense()
-{
+{SELFPARAM();
if(self.deadflag != DEAD_NO)
return;
if (self.kh_next)
{
- dprint("changing role to carrier\n");
+ LOG_TRACE("changing role to carrier\n");
self.havocbot_role = havocbot_role_kh_carrier;
self.havocbot_role_timeout = 0;
return;
self.havocbot_role_timeout = time + random() * 10 + 20;
if (time > self.havocbot_role_timeout)
{
- dprint("changing role to freelancer\n");
+ LOG_TRACE("changing role to freelancer\n");
self.havocbot_role = havocbot_role_kh_freelancer;
self.havocbot_role_timeout = 0;
return;
navigation_goalrating_end();
}
-};
+}
void havocbot_role_kh_offense()
-{
+{SELFPARAM();
if(self.deadflag != DEAD_NO)
return;
if (self.kh_next)
{
- dprint("changing role to carrier\n");
+ LOG_TRACE("changing role to carrier\n");
self.havocbot_role = havocbot_role_kh_carrier;
self.havocbot_role_timeout = 0;
return;
self.havocbot_role_timeout = time + random() * 10 + 20;
if (time > self.havocbot_role_timeout)
{
- dprint("changing role to freelancer\n");
+ LOG_TRACE("changing role to freelancer\n");
self.havocbot_role = havocbot_role_kh_freelancer;
self.havocbot_role_timeout = 0;
return;
navigation_goalrating_end();
}
-};
+}
void havocbot_role_kh_freelancer()
-{
+{SELFPARAM();
if(self.deadflag != DEAD_NO)
return;
if (self.kh_next)
{
- dprint("changing role to carrier\n");
+ LOG_TRACE("changing role to carrier\n");
self.havocbot_role = havocbot_role_kh_carrier;
self.havocbot_role_timeout = 0;
return;
{
if (random() < 0.5)
{
- dprint("changing role to offense\n");
+ LOG_TRACE("changing role to offense\n");
self.havocbot_role = havocbot_role_kh_offense;
}
else
{
- dprint("changing role to defense\n");
+ LOG_TRACE("changing role to defense\n");
self.havocbot_role = havocbot_role_kh_defense;
}
self.havocbot_role_timeout = 0;
navigation_goalrating_end();
}
-};
+}
void havocbot_chooserole_kh()
-{
- local float r;
+{SELFPARAM();
+ float r;
if(self.deadflag != DEAD_NO)
return;
self.havocbot_role = havocbot_role_kh_defense;
else
self.havocbot_role = havocbot_role_kh_freelancer;
-};
+}