]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_keyhunt.qc
Merge remote-tracking branch 'origin/master' into Mario/lms_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_keyhunt.qc
index de12e76cb4f036c74f64fe5dfda4b09c3f4d7520..13a06c367c72ca7084bb4d5d7301fa8affe73f58 100644 (file)
@@ -39,10 +39,10 @@ float kh_keystatus[17];
 
 float kh_Team_ByID(float t)
 {
-       if(t == 0) return FL_TEAM_1;
-       if(t == 1) return FL_TEAM_2;
-       if(t == 2) return FL_TEAM_3;
-       if(t == 3) return FL_TEAM_4;
+       if(t == 0) return NUM_TEAM_1;
+       if(t == 1) return NUM_TEAM_2;
+       if(t == 2) return NUM_TEAM_3;
+       if(t == 3) return NUM_TEAM_4;
        return 0;
 }
 
@@ -330,13 +330,13 @@ void kh_Key_AssignTo(entity key, entity player)  // runs every time a key is pic
                        WaypointSprite_AttachCarrier("", player, RADARICON_FLAGCARRIER, colormapPaletteColor(player.team - 1, 0));
                        player.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_KeyCarrier_waypointsprite_visible_for_player;
                        WaypointSprite_UpdateRule(player.waypointsprite_attachedforcarrier, player.team, SPRITERULE_TEAMPLAY);
-                       if(player.team == FL_TEAM_1)
+                       if(player.team == NUM_TEAM_1)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-red", "keycarrier-friend", "keycarrier-red");
-                       else if(player.team == FL_TEAM_2)
+                       else if(player.team == NUM_TEAM_2)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-blue", "keycarrier-friend", "keycarrier-blue");
-                       else if(player.team == FL_TEAM_3)
+                       else if(player.team == NUM_TEAM_3)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-yellow", "keycarrier-friend", "keycarrier-yellow");
-                       else if(player.team == FL_TEAM_4)
+                       else if(player.team == NUM_TEAM_4)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-pink", "keycarrier-friend", "keycarrier-pink");
                        if(!kh_no_radar_circles)
                                WaypointSprite_Ping(player.waypointsprite_attachedforcarrier);
@@ -405,7 +405,7 @@ void kh_Key_Collect(entity key, entity player)  //a player picks up a dropped ke
                PlayerScore_Add(player, SP_KH_PICKUPS, 1);
        }
        key.kh_dropperteam = 0;
-       Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_4(key, INFO_KEYHUNT_PICKUP_), player.netname);
+       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(key, INFO_KEYHUNT_PICKUP_), player.netname);
 
        kh_Key_AssignTo(key, player); // this also updates .kh_state
 }
@@ -479,7 +479,7 @@ void kh_FinishRound()  // runs when a team captures the keys
                kh_Key_Remove(key);
        kh_no_radar_circles = FALSE;
 
-       Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_ARENA_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
+       Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
        kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound);
 }
 
@@ -513,7 +513,7 @@ void kh_WinnerTeam(float teem)  // runs when a team wins // Samual: Teem?.... TE
                        first = FALSE;
                }
 
-       Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_NUM_4(teem, INFO_KEYHUNT_CAPTURE_), keyowner);
+       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(teem, INFO_KEYHUNT_CAPTURE_), keyowner);
 
        first = TRUE;
        midpoint = '0 0 0';
@@ -628,7 +628,7 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
                }
        }
        
-       Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_4(lostkey, INFO_KEYHUNT_LOST_), lostkey.kh_previous_owner.netname);
+       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(lostkey, INFO_KEYHUNT_LOST_), lostkey.kh_previous_owner.netname);
        
        play2all(kh_sound_destroy);
        te_tarexplosion(lostkey.origin);
@@ -725,16 +725,16 @@ void kh_Key_Spawn(entity initial_owner, float angle, float i)  // runs every tim
 
        switch(initial_owner.team)
        {
-               case FL_TEAM_1:
+               case NUM_TEAM_1:
                        key.netname = "^1red key";
                        break;
-               case FL_TEAM_2:
+               case NUM_TEAM_2:
                        key.netname = "^4blue key";
                        break;
-               case FL_TEAM_3:
+               case NUM_TEAM_3:
                        key.netname = "^3yellow key";
                        break;
-               case FL_TEAM_4:
+               case NUM_TEAM_4:
                        key.netname = "^6pink key";
                        break;
                default:
@@ -746,7 +746,7 @@ void kh_Key_Spawn(entity initial_owner, float angle, float i)  // runs every tim
        key.kh_worldkeynext = kh_worldkeylist;
        kh_worldkeylist = key;
 
-       Send_Notification(NOTIF_ONE, initial_owner, MSG_CENTER, APP_TEAM_ENT_4(key, CENTER_KEYHUNT_START_));
+       Send_Notification(NOTIF_ONE, initial_owner, MSG_CENTER, APP_TEAM_NUM_4(initial_owner.team, CENTER_KEYHUNT_START_));
 
        WaypointSprite_Spawn("key-dropped", 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, key.team, key, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAG, '0 1 1');
        key.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_Key_waypointsprite_visible_for_player;
@@ -789,7 +789,7 @@ void kh_Key_DropOne(entity key)
 
        kh_Scores_Event(player, key, "dropkey", 0, 0);
        PlayerScore_Add(player, SP_KH_LOSSES, 1);
-       Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_4(key, INFO_KEYHUNT_DROP_), player.netname);
+       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(key, INFO_KEYHUNT_DROP_), player.netname);
        
        kh_Key_AssignTo(key, world);
        makevectors(player.v_angle);
@@ -815,7 +815,7 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
                {
                        kh_Scores_Event(player, key, "losekey", 0, 0);
                        PlayerScore_Add(player, SP_KH_LOSSES, 1);
-                       Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_4(key, INFO_KEYHUNT_LOST_), player.netname);
+                       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(key, INFO_KEYHUNT_LOST_), player.netname);
                        kh_Key_AssignTo(key, world);
                        makevectors('-1 0 0' * (45 + 45 * random()) + '0 360 0' * random());
                        key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_dropvelocity * v_forward, FALSE);
@@ -857,19 +857,20 @@ void kh_WaitForPlayers()  // delay start of the round until enough players are p
        float p1 = kh_CheckPlayers(0), p2 = kh_CheckPlayers(1), p3 = kh_CheckPlayers(2), p4 = kh_CheckPlayers(3);
        if not(p1 || p2 || p3 || p4)
        {
-               Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_ARENA_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
+               Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
                kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound);
        }
        else
        {
-               Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_KEYHUNT_WAIT, p1, p2, p3, p4);
+               Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_WAIT, p1, p2, p3, p4);
                kh_Controller_SetThink(1, kh_WaitForPlayers);
        }
 }
 
 void kh_EnableTrackingDevice()  // runs after each round
 {
-       Kill_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_KEYHUNT_HELP);
+       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT);
+       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT_OTHER);
 
        kh_tracking_enabled = TRUE;
 }
@@ -889,11 +890,12 @@ void kh_StartRound()  // runs at the start of each round
        if(p1 || p2 || p3 || p4)
        {
                kh_Controller_SetThink(1, kh_WaitForPlayers);
-               Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_KEYHUNT_WAIT, p1, p2, p3, p4);
+               Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_WAIT, p1, p2, p3, p4);
                return;
        }
        
-       Kill_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_KEYHUNT_HELP);
+       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT);
+       Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT_OTHER);
 
        for(i = 0; i < kh_teams; ++i)
        {
@@ -913,7 +915,7 @@ void kh_StartRound()  // runs at the start of each round
        }
 
        kh_tracking_enabled = FALSE;
-       Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_KEYHUNT_SCAN);
+       Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_SCAN, autocvar_g_balance_keyhunt_delay_tracking);
        kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_tracking, kh_EnableTrackingDevice);
 }