]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move minstagib messages to the notifications system
authorMario <mario.mario@y7mail.com>
Thu, 7 Mar 2013 06:37:04 +0000 (17:37 +1100)
committerMario <mario.mario@y7mail.com>
Thu, 7 Mar 2013 06:37:04 +0000 (17:37 +1100)
qcsrc/common/notifications.qh
qcsrc/server/mutators/mutator_minstagib.qc

index 04a1cec22250a1439a023bdf533cdaf85a86cd96..867540ebb51d2b79c068526b741ab5ad0bda4bf1 100644 (file)
@@ -454,6 +454,8 @@ void Send_Notification_WOVA(
        MSG_CENTER_NOTIF(1, CENTER_LMS_CAMPCHECK,               0, 0, "",              CPID_LMS_CAMP,         "0 0", _("^F2Don't camp!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO,             0, 0, "",              CPID_MINSTA_FINDAMMO,  "1 9", _("^F4^COUNT^BG left to find some ammo!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO_FIRST,       0, 0, "",              CPID_MINSTA_FINDAMMO,  "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("^BGGet some ammo! ^F4^COUNT^BG left!")) \
+       MSG_CENTER_NOTIF(1, CENTER_MINSTA_LIVES_REMAINING,      0, 1, "f1",            NO_CPID,                           "0 0", _("^F2Extra lives remaining: ^K1%s"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_MINSTA_SECONDARY,            0, 0, "",              NO_CPID,                           "0 0", _("^BGSecondary fire inflicts no damage!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_MOTD,                        1, 0, "s1",            CPID_MOTD,             "-1 0", _("^BG%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_NIX_COUNTDOWN,               0, 2, "item_wepname",  CPID_NIX,              "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_NIX_NEWWEAPON,               0, 1, "item_wepname",  CPID_NIX,              "0 0", _("^F2Active weapon: ^F1%s"), "") \
index 9b6edfae7b3d6130c2c4872fd666434b6e03aa6f..49c4a8f57e80417ff7a9aac45feac9584d288b68 100644 (file)
@@ -15,7 +15,7 @@ void minstagib_stop_countdown(entity e)
 {
        if (!e.minstagib_needammo)
                return;
-       Send_CSQC_Centerprint_Generic_Expire(e, CPID_MINSTA_FINDAMMO);
+       Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_MINSTA_FINDAMMO);
        e.minstagib_needammo = FALSE;
 }
 void minstagib_ammocheck(void)
@@ -81,13 +81,13 @@ void minstagib_ammocheck(void)
                }
                else if (self.health == 90)
                {
-                       Send_CSQC_Centerprint_Generic(self, CPID_MINSTA_FINDAMMO, "^1%d^7 seconds left to find some ammo", 1, 9);
+                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MINSTA_FINDAMMO);
                        Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
                        AnnounceTo(self, "9");
                }
                else if (self.health == 100)
                {
-                       Send_CSQC_Centerprint_Generic(self, CPID_MINSTA_FINDAMMO, "get some ammo or\nyou'll be dead in ^3%d^7 seconds...", 1, 10);
+                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MINSTA_FINDAMMO_FIRST);
                        Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
                        if not(self.flags & FL_GODMODE)
                                AnnounceTo(self, "10");
@@ -135,7 +135,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
                        self.alpha = default_player_alpha;
                        self.exteriorweaponentity.alpha = default_weapon_alpha;
                        self.items &~= IT_STRENGTH;
-                       sprint(self, "^3Invisibility has worn off\n");
+                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
                }
        }
        else
@@ -145,7 +145,8 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
                        self.alpha = g_minstagib_invis_alpha;
                        self.exteriorweaponentity.alpha = g_minstagib_invis_alpha;
                        self.items |= IT_STRENGTH;
-                       sprint(self, "^3You are invisible\n");
+                       Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_INVISIBILITY, self.netname);
+                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_INVISIBILITY);
                }
        }
 
@@ -155,7 +156,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
                if (time > self.invincible_finished)
                {
                        self.items &~= IT_INVINCIBLE;
-                       sprint(self, "^3Speed has worn off\n");
+                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SPEED);
                }
        }
        else
@@ -163,7 +164,8 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
                if (time < self.invincible_finished)
                {
                        self.items |= IT_INVINCIBLE;
-                       sprint(self, "^3You are on speed\n");
+                       Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SPEED, self.netname);
+                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_SPEED);
                }
        }
        return FALSE;
@@ -217,7 +219,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
                if (frag_target.armorvalue && (frag_deathtype == WEP_MINSTANEX) && frag_damage)
                {
                        frag_target.armorvalue -= 1;
-                       centerprint(frag_target, strcat("^3Remaining extra lives: ",ftos(frag_target.armorvalue)));
+                       Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_MINSTA_LIVES_REMAINING, frag_target.armorvalue);
                        frag_damage = 0;
                        frag_target.hitsound += 1;
                        frag_attacker.hitsound += 1; // TODO change this to a future specific hitsound for armor hit
@@ -228,8 +230,8 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
                        frag_mirrordamage = 0;
                        if (frag_target != frag_attacker)
                        {
-                               if ((frag_target.health >= 1) && (frag_target.classname == "player"))
-                                       centerprint(frag_attacker, "Secondary fire inflicts no damage!");
+                               if ((frag_target.health >= 1) && IS_PLAYER(frag_target))
+                                       Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_MINSTA_SECONDARY);
                                frag_force = '0 0 0';
                                // keep mirrorfrag_force
                                frag_attacker = frag_target;
@@ -243,7 +245,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage)
                if(frag_attacker.armorvalue > 0)
                {
                        frag_attacker.armorvalue = frag_attacker.armorvalue - 1;
-                       centerprint(frag_attacker, strcat("^3Remaining extra lives: ", ftos(frag_attacker.armorvalue)));
+                       Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_MINSTA_LIVES_REMAINING, frag_attacker.armorvalue);
                        frag_attacker.hitsound += 1;
                }
                frag_mirrordamage = 0;