int autocvar_g_keyhunt_teams_override;
// #define KH_PLAYER_USE_ATTACHMENT
+// TODO? no model exists for this
// #define KH_PLAYER_USE_CARRIEDMODEL
#ifdef KH_PLAYER_USE_ATTACHMENT
.float siren_time; // time delay the siren
//.float stuff_time; // time delay to stuffcmd a cvar
-int kh_keystatus[17];
-//kh_keystatus[0] = status of dropped keys, kh_keystatus[1 - 16] = player #
-//replace 17 with cvar("maxplayers") or similar !!!!!!!!!
-//for(i = 0; i < maxplayers; ++i)
-// kh_keystatus[i] = "0";
-
int kh_Team_ByID(int t)
{
if(t == 0) return NUM_TEAM_1;
return 0;
}
-//entity kh_worldkeylist;
-.entity kh_worldkeynext;
entity kh_controller;
//bool kh_tracking_enabled;
int kh_teams;
key.takedamage = DAMAGE_YES;
// let key.team stay
key.modelindex = kh_key_dropped;
- navigation_dynamicgoal_set(key);
+ navigation_dynamicgoal_set(key, key.owner);
key.kh_previous_owner = key.owner;
key.kh_previous_owner_playerid = key.owner.playerid;
}
if(key.kh_next)
key.kh_next.kh_prev = key;
- float i;
- i = kh_keystatus[key.owner.playerid];
- if(key.netname == "^1red key")
- i += 1;
- if(key.netname == "^4blue key")
- i += 2;
- if(key.netname == "^3yellow key")
- i += 4;
- if(key.netname == "^6pink key")
- i += 8;
- kh_keystatus[key.owner.playerid] = i;
-
kh_Key_Attach(key);
if(key.kh_next == NULL)
kh_interferemsg_time = 0;
FOREACH_CLIENT(IS_PLAYER(it), {
if(it.team == kh_interferemsg_team)
+ {
if(it.kh_next)
Send_Notification(NOTIF_ONE, it, MSG_CENTER, CENTER_KEYHUNT_MEET);
else
Send_Notification(NOTIF_ONE, it, MSG_CENTER, CENTER_KEYHUNT_HELP);
+ }
else
Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_TEAM_NUM(kh_interferemsg_team, CENTER_KEYHUNT_INTERFERE));
});
navigation_routerating(this, head.owner, ratingscale_enemy * 10000, 100000);
}
- havocbot_goalrating_items(this, 1, this.origin, 10000);
+ havocbot_goalrating_items(this, 80000, this.origin, 10000);
}
void havocbot_role_kh_carrier(entity this)
navigation_goalrating_start(this);
if(kh_Key_AllOwnedByWhichTeam() == this.team)
- havocbot_goalrating_kh(this, 10, 0.1, 0.1); // bring home
+ havocbot_goalrating_kh(this, 10, 0.1, 0.05); // bring home
else
- havocbot_goalrating_kh(this, 4, 4, 1); // play defensively
+ havocbot_goalrating_kh(this, 4, 4, 0.5); // play defensively
navigation_goalrating_end(this);
key_owner_team = kh_Key_AllOwnedByWhichTeam();
if(key_owner_team == this.team)
- havocbot_goalrating_kh(this, 10, 0.1, 0.1); // defend key carriers
+ havocbot_goalrating_kh(this, 10, 0.1, 0.05); // defend key carriers
else if(key_owner_team == -1)
- havocbot_goalrating_kh(this, 4, 1, 0.1); // play defensively
+ havocbot_goalrating_kh(this, 4, 1, 0.05); // play defensively
else
- havocbot_goalrating_kh(this, 0.1, 0.1, 10); // ATTACK ANYWAY
+ havocbot_goalrating_kh(this, 0.1, 0.1, 5); // ATTACK ANYWAY
navigation_goalrating_end(this);
key_owner_team = kh_Key_AllOwnedByWhichTeam();
if(key_owner_team == this.team)
- havocbot_goalrating_kh(this, 10, 0.1, 0.1); // defend anyway
+ havocbot_goalrating_kh(this, 10, 0.1, 0.05); // defend anyway
else if(key_owner_team == -1)
- havocbot_goalrating_kh(this, 0.1, 1, 4); // play offensively
+ havocbot_goalrating_kh(this, 0.1, 1, 2); // play offensively
else
- havocbot_goalrating_kh(this, 0.1, 0.1, 10); // ATTACK! EMERGENCY!
+ havocbot_goalrating_kh(this, 0.1, 0.1, 5); // ATTACK! EMERGENCY!
navigation_goalrating_end(this);
int key_owner_team = kh_Key_AllOwnedByWhichTeam();
if(key_owner_team == this.team)
- havocbot_goalrating_kh(this, 10, 0.1, 0.1); // defend anyway
+ havocbot_goalrating_kh(this, 10, 0.1, 0.05); // defend anyway
else if(key_owner_team == -1)
- havocbot_goalrating_kh(this, 1, 10, 4); // prefer dropped keys
+ havocbot_goalrating_kh(this, 1, 10, 2); // prefer dropped keys
else
- havocbot_goalrating_kh(this, 0.1, 0.1, 10); // ATTACK ANYWAY
+ havocbot_goalrating_kh(this, 0.1, 0.1, 5); // ATTACK ANYWAY
navigation_goalrating_end(this);
return true;
}
+MUTATOR_HOOKFUNCTION(kh, LogDeath_AppendItemCodes)
+{
+ entity player = M_ARGV(0, entity);
+ if(player.kh_next)
+ M_ARGV(1, string) = strcat(M_ARGV(1, string), "K"); // item codes
+}
+
MUTATOR_HOOKFUNCTION(kh, DropSpecialItems)
{
entity frag_target = M_ARGV(0, entity);