X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fhavocbot%2Frole_keyhunt.qc;h=b1603c792ac033806577bcd189016cac89040674;hp=8e30b37b5c569ce3f900f9b3e95934a0cef3acd3;hb=7ad79253dd5e08e66c0b3bab415da69cd3c2a296;hpb=f209ef256e1c8cc09fcfb1cf3b3f30f34345e88b diff --git a/qcsrc/server/bot/havocbot/role_keyhunt.qc b/qcsrc/server/bot/havocbot/role_keyhunt.qc index 8e30b37b5..b1603c792 100644 --- a/qcsrc/server/bot/havocbot/role_keyhunt.qc +++ b/qcsrc/server/bot/havocbot/role_keyhunt.qc @@ -1,14 +1,22 @@ +#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) @@ -33,16 +41,16 @@ void havocbot_goalrating_kh(float ratingscale_team, float ratingscale_dropped, f } 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; @@ -63,13 +71,13 @@ void havocbot_role_kh_carrier() } 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; @@ -79,7 +87,7 @@ void havocbot_role_kh_defense() 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; @@ -101,16 +109,16 @@ void havocbot_role_kh_defense() 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; @@ -120,7 +128,7 @@ void havocbot_role_kh_offense() 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; @@ -143,16 +151,16 @@ void havocbot_role_kh_offense() 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; @@ -164,12 +172,12 @@ void havocbot_role_kh_freelancer() { 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; @@ -193,11 +201,11 @@ void havocbot_role_kh_freelancer() navigation_goalrating_end(); } -}; +} void havocbot_chooserole_kh() -{ - local float r; +{SELFPARAM(); + float r; if(self.deadflag != DEAD_NO) return; @@ -209,4 +217,4 @@ void havocbot_chooserole_kh() self.havocbot_role = havocbot_role_kh_defense; else self.havocbot_role = havocbot_role_kh_freelancer; -}; +}