]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/ctf.qc
Allow forcing the player to a given team in campaign mode. Useful for story based...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / ctf.qc
index 1d40efcc2c5bcfd67b15485ea2b75e6155d0ca27..6e314c88efd50f223f1c6ef15a8a1ae2a7c721e6 100644 (file)
@@ -290,7 +290,8 @@ void DropFlag(entity e, entity penalty_receiver, entity attacker)
                dprint("FLAG: drop - owner is not carrying this flag??\n");
                return;
        }
-       bprint(p.netname, "^7 lost the ", e.netname, "\n");
+       //bprint(p.netname, "^7 lost the ", e.netname, "\n");
+       Send_KillNotification (p.netname, e.netname, "", INFO_LOSTFLAG, MSG_INFO);
 
        if(penalty_receiver)
                UpdateFrags(penalty_receiver, -ctf_score_value("penalty_suicidedrop"));
@@ -472,7 +473,7 @@ void FlagTouch()
                                h0 = strcat(h0, "^7's"); // h0: display text for previous netname
                        if (flagcaptimerecord == 0)
                        {
-                               bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, " seconds\n");
+                               s = strcat(" in ", s, " seconds");
                                flagcaptimerecord = t;
                                db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
                                db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
@@ -480,7 +481,7 @@ void FlagTouch()
                        }
                        else if (t < flagcaptimerecord)
                        {
-                               bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", breaking ", strcat(h0, " previous record of ", s0, " seconds\n"));
+                               s = strcat(" in ", s, " seconds, breaking ", h0, " previous record of ", s0, " seconds");
                                flagcaptimerecord = t;
                                db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
                                db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
@@ -488,11 +489,13 @@ void FlagTouch()
                        }
                        else
                        {
-                               bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", failing to break ", strcat(h0, " record of ", s0, " seconds\n"));
+                               s = strcat(" in ", s, " seconds, failing to break ", h0, " record of ", s0, " seconds");
                        }
                }
                else
-                       bprint(other.netname, "^7 captured the ", other.flagcarried.netname, "\n");
+                       s = "";
+
+               Send_KillNotification (other.netname, other.flagcarried.netname, s, INFO_CAPTUREFLAG, MSG_INFO);
 
                PlayerTeamScore_Add(other, SP_CTF_CAPS, ST_CTF_CAPS, 1);
                LogCTF("capture", other.flagcarried.team, other);
@@ -542,7 +545,8 @@ void FlagTouch()
                other.flagcarried = self;
                self.cnt = FLAG_CARRY;
                self.angles = '0 0 0';
-               bprint(other.netname, "^7 got the ", self.netname, "\n");
+               //bprint(other.netname, "^7 got the ", self.netname, "\n");
+               Send_KillNotification (other.netname, self.netname, "", INFO_GOTFLAG, MSG_INFO);
                UpdateFrags(other, ctf_score_value("score_pickup_base"));
                self.dropperid = other.playerid;
                PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
@@ -569,7 +573,8 @@ void FlagTouch()
                if (other.team == self.team || (other.team != COLOR_TEAM1 && other.team != COLOR_TEAM2))
                {
                        // return flag
-                       bprint(other.netname, "^7 returned the ", self.netname, "\n");
+                       Send_KillNotification (other.netname, self.netname, "", INFO_RETURNFLAG, MSG_INFO);
+                       //bprint(other.netname, "^7 returned the ", self.netname, "\n");
 
                        // punish the player who last had it
                        FOR_EACH_PLAYER(player)
@@ -619,7 +624,8 @@ void FlagTouch()
                        self.owner = other;
                        other.flagcarried = self;
                        self.cnt = FLAG_CARRY;
-                       bprint(other.netname, "^7 picked up the ", self.netname, "\n");
+                       Send_KillNotification (other.netname, self.netname, "", INFO_PICKUPFLAG, MSG_INFO);
+                       //bprint(other.netname, "^7 picked up the ", self.netname, "\n");
 
                        float f;
                        f = bound(0, (self.pain_finished - time) / cvar("g_ctf_flag_returntime"), 1);