From 901dc942e7c56dd7b9e986f9ba29763a825c6550 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 23 Jul 2010 22:36:25 +0200 Subject: [PATCH] sprintf'd death messages --- qcsrc/client/hud.qc | 4 ++-- qcsrc/server/w_campingrifle.qc | 14 +++++++------- qcsrc/server/w_crylink.qc | 8 ++++---- qcsrc/server/w_electro.qc | 14 +++++++------- qcsrc/server/w_fireball.qc | 20 ++++++++------------ qcsrc/server/w_grenadelauncher.qc | 10 +++++----- qcsrc/server/w_hagar.qc | 6 +++--- qcsrc/server/w_hlac.qc | 4 ++-- qcsrc/server/w_hook.qc | 4 ++-- qcsrc/server/w_laser.qc | 4 ++-- qcsrc/server/w_minstanex.qc | 4 ++-- qcsrc/server/w_nex.qc | 4 ++-- qcsrc/server/w_porto.qc | 4 ++-- qcsrc/server/w_rocketlauncher.qc | 8 ++++---- qcsrc/server/w_seeker.qc | 18 +++++++++--------- qcsrc/server/w_shotgun.qc | 4 ++-- qcsrc/server/w_tuba.qc | 4 ++-- qcsrc/server/w_uzi.qc | 6 +++--- 18 files changed, 68 insertions(+), 72 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 8b1d5b450..60a510af2 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2412,7 +2412,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) if(WEP_VALID(w)) { HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC); if (alsoprint) - print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n"); + print("^1", sprintf(Weapon_SuicideMessage(type), strcat(s1, "^1")), "\n"); } else if (type == DEATH_KILL) { HUD_KillNotify_Push(s1, "", 0, DEATH_KILL); if (alsoprint) @@ -2454,7 +2454,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) if(WEP_VALID(w)) { HUD_KillNotify_Push(s2, s1, 1, w); if (alsoprint) - print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n"); + print("^1", sprintf(Weapon_KillMessage(type), strcat(s2, "^1"), strcat(s1, "^1")), "\n"); // default order: victim, killer } else if(type == KILL_TEAM_RED || type == KILL_TEAM_BLUE || type == KILL_TEAM_SPREE) { HUD_KillNotify_Push(s1, s2, 1, type); diff --git a/qcsrc/server/w_campingrifle.qc b/qcsrc/server/w_campingrifle.qc index 96dc36fc2..f14d5689b 100644 --- a/qcsrc/server/w_campingrifle.qc +++ b/qcsrc/server/w_campingrifle.qc @@ -307,32 +307,32 @@ float w_campingrifle(float req) else if (req == WR_SUICIDEMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) - w_deathtypestring = "shot themself automatically"; + w_deathtypestring = "%s shot themself automatically"; else - w_deathtypestring = "sniped themself somehow"; + w_deathtypestring = "%s sniped themself somehow"; } else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) { if(w_deathtype & HITTYPE_BOUNCE) - w_deathtypestring = "failed to hide from #'s bullet hail"; + w_deathtypestring = "%s failed to hide from %s's bullet hail"; else - w_deathtypestring = "died in #'s bullet hail"; + w_deathtypestring = "%s died in %s's bullet hail"; } else { if(w_deathtype & HITTYPE_BOUNCE) { // TODO special headshot message here too? - w_deathtypestring = "failed to hide from #'s rifle"; + w_deathtypestring = "%s failed to hide from %s's rifle"; } else { if(w_deathtype & HITTYPE_HEADSHOT) - w_deathtypestring = "got hit in the head by #"; + w_deathtypestring = "%s got hit in the head by %s"; else - w_deathtypestring = "was sniped by #"; + w_deathtypestring = "%s was sniped by %s"; } } } diff --git a/qcsrc/server/w_crylink.qc b/qcsrc/server/w_crylink.qc index d80317a34..3d18ba12d 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -250,16 +250,16 @@ float w_crylink(float req) } else if (req == WR_SUICIDEMESSAGE) { - w_deathtypestring = "succeeded at self-destructing themself with the Crylink"; + w_deathtypestring = "%s succeeded at self-destructing themself with the Crylink"; } else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_BOUNCE) - w_deathtypestring = "could not hide from #'s Crylink"; // unchecked: SPLASH (SECONDARY can't be) + w_deathtypestring = "%s could not hide from %s's Crylink"; // unchecked: SPLASH (SECONDARY can't be) else if(w_deathtype & HITTYPE_SPLASH) - w_deathtypestring = "was too close to #'s Crylink"; // unchecked: SECONDARY + w_deathtypestring = "%s was too close to %s's Crylink"; // unchecked: SECONDARY else - w_deathtypestring = "took a close look at #'s Crylink"; // unchecked: SECONDARY + w_deathtypestring = "%s took a close look at %s's Crylink"; // unchecked: SECONDARY } return TRUE; } diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index 248a77e3f..099fa2984 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -447,27 +447,27 @@ float w_electro(float req) else if (req == WR_SUICIDEMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) - w_deathtypestring = "could not remember where they put plasma"; + w_deathtypestring = "%s could not remember where they put plasma"; else - w_deathtypestring = "played with plasma"; + w_deathtypestring = "%s played with plasma"; } else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) { if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE - w_deathtypestring = "just noticed #'s blue ball"; + w_deathtypestring = "%s just noticed %s's blue ball"; else // unchecked: BOUNCE - w_deathtypestring = "got in touch with #'s blue ball"; + w_deathtypestring = "%s got in touch with %s's blue ball"; } else { if(w_deathtype & HITTYPE_BOUNCE) // combo - w_deathtypestring = "felt the electrifying air of #'s combo"; + w_deathtypestring = "%s felt the electrifying air of %s's combo"; else if(w_deathtype & HITTYPE_SPLASH) - w_deathtypestring = "got too close to #'s blue beam"; + w_deathtypestring = "%s got too close to %s's blue beam"; else - w_deathtypestring = "was blasted by #'s blue beam"; + w_deathtypestring = "%s was blasted by %s's blue beam"; } } return TRUE; diff --git a/qcsrc/server/w_fireball.qc b/qcsrc/server/w_fireball.qc index 278099c63..368faecbf 100644 --- a/qcsrc/server/w_fireball.qc +++ b/qcsrc/server/w_fireball.qc @@ -384,36 +384,32 @@ float w_fireball(float req) else if (req == WR_SUICIDEMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) - w_deathtypestring = "forgot about some firemine"; + w_deathtypestring = "%s forgot about some firemine"; else - w_deathtypestring = "should have used a smaller gun"; + w_deathtypestring = "%s should have used a smaller gun"; } else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) { if(w_deathtype & HITTYPE_HEADSHOT) - w_deathtypestring = "tried to catch #'s firemine"; + w_deathtypestring = "%s tried to catch %s's firemine"; else - w_deathtypestring = "fatefully ignored #'s firemine"; + w_deathtypestring = "%s fatefully ignored %s's firemine"; } else { if(w_deathtype & HITTYPE_BOUNCE) { if(w_deathtype & HITTYPE_SPLASH) // BFG effect - { - w_deathtypestring = "could not hide from #'s fireball"; - } + w_deathtypestring = "%s could not hide from %s's fireball"; else // laser - { - w_deathtypestring = "saw the pretty lights of #'s fireball"; - } + w_deathtypestring = "%s saw the pretty lights of %s's fireball"; } else if(w_deathtype & HITTYPE_SPLASH) - w_deathtypestring = "got too close to #'s fireball"; + w_deathtypestring = "%s got too close to %s's fireball"; else - w_deathtypestring = "tasted #'s fireball"; + w_deathtypestring = "%s tasted %s's fireball"; } } return TRUE; diff --git a/qcsrc/server/w_grenadelauncher.qc b/qcsrc/server/w_grenadelauncher.qc index f6851af21..a8930cd41 100644 --- a/qcsrc/server/w_grenadelauncher.qc +++ b/qcsrc/server/w_grenadelauncher.qc @@ -265,19 +265,19 @@ float w_glauncher(float req) else if (req == WR_SUICIDEMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) - w_deathtypestring = "tried out his own grenade"; + w_deathtypestring = "%s tried out his own grenade"; else - w_deathtypestring = "detonated"; + w_deathtypestring = "%s detonated"; } else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_SPLASH) if(w_deathtype & HITTYPE_BOUNCE) // (must be secondary then) - w_deathtypestring = "didn't see #'s grenade"; + w_deathtypestring = "%s didn't see %s's grenade"; else // unchecked: SECONDARY - w_deathtypestring = "almost dodged #'s grenade"; + w_deathtypestring = "%s almost dodged %s's grenade"; else // unchecked: SECONDARY, BOUNCE - w_deathtypestring = "ate #'s grenade"; + w_deathtypestring = "%s ate %s's grenade"; } return TRUE; } diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index d37235736..1d9e9e698 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -179,13 +179,13 @@ float w_hagar(float req) precache_sound("weapons/hagexp3.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "played with tiny rockets"; + w_deathtypestring = "%s played with tiny rockets"; else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH - w_deathtypestring = "hoped #'s missiles wouldn't bounce"; + w_deathtypestring = "%s hoped %s's missiles wouldn't bounce"; else // unchecked: SPLASH, SECONDARY - w_deathtypestring = "was pummeled by"; + w_deathtypestring = "%s was pummeled by %s"; } return TRUE; } diff --git a/qcsrc/server/w_hlac.qc b/qcsrc/server/w_hlac.qc index 88990de62..9abb8a7a0 100644 --- a/qcsrc/server/w_hlac.qc +++ b/qcsrc/server/w_hlac.qc @@ -226,9 +226,9 @@ float w_hlac(float req) precache_sound("weapons/laserimpact.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "should have used a smaller gun"; + w_deathtypestring = "%s should have used a smaller gun"; else if (req == WR_KILLMESSAGE) - w_deathtypestring = "was cut down by"; + w_deathtypestring = "%s was cut down by %s"; return TRUE; } #endif diff --git a/qcsrc/server/w_hook.qc b/qcsrc/server/w_hook.qc index c8d1369f7..70fe77814 100644 --- a/qcsrc/server/w_hook.qc +++ b/qcsrc/server/w_hook.qc @@ -262,9 +262,9 @@ float w_hook(float req) precache_sound("weapons/hookbomb_impact.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "did the impossible"; + w_deathtypestring = "%s did the impossible"; else if (req == WR_KILLMESSAGE) - w_deathtypestring = "has run into #'s gravity bomb"; + w_deathtypestring = "%s has run into %s's gravity bomb"; return TRUE; } #endif diff --git a/qcsrc/server/w_laser.qc b/qcsrc/server/w_laser.qc index 7ae406a9c..3351816b2 100644 --- a/qcsrc/server/w_laser.qc +++ b/qcsrc/server/w_laser.qc @@ -307,10 +307,10 @@ float w_laser(float req) precache_sound("weapons/laserimpact.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "lasered themself to hell"; + w_deathtypestring = "%s lasered themself to hell"; else if (req == WR_KILLMESSAGE) { - w_deathtypestring = "was lasered to death by"; // unchecked: SPLASH + w_deathtypestring = "%s was lasered to death by %s"; // unchecked: SPLASH } return TRUE; } diff --git a/qcsrc/server/w_minstanex.qc b/qcsrc/server/w_minstanex.qc index 65d02dcb2..352aa2b25 100644 --- a/qcsrc/server/w_minstanex.qc +++ b/qcsrc/server/w_minstanex.qc @@ -255,9 +255,9 @@ float w_minstanex(float req) precache_sound("weapons/neximpact.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "did the impossible"; + w_deathtypestring = "%s did the impossible"; else if (req == WR_KILLMESSAGE) - w_deathtypestring = "has been vaporized by"; + w_deathtypestring = "%s has been vaporized by %s"; return TRUE; } #endif diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index 4c30f4c67..aee2a80a2 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -93,9 +93,9 @@ float w_nex(float req) precache_sound("weapons/neximpact.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "did the impossible"; + w_deathtypestring = "%s did the impossible"; else if (req == WR_KILLMESSAGE) - w_deathtypestring = "has been vaporized by"; + w_deathtypestring = "%s has been vaporized by %s"; return TRUE; } #endif diff --git a/qcsrc/server/w_porto.qc b/qcsrc/server/w_porto.qc index b78e85574..010a0f8b3 100644 --- a/qcsrc/server/w_porto.qc +++ b/qcsrc/server/w_porto.qc @@ -288,9 +288,9 @@ float w_porto(float req) // nothing to do } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "did the impossible"; + w_deathtypestring = "%s did the impossible"; else if (req == WR_KILLMESSAGE) - w_deathtypestring = "felt # doing the impossible to him"; + w_deathtypestring = "%s felt %s doing the impossible to him"; return TRUE; } #endif diff --git a/qcsrc/server/w_rocketlauncher.qc b/qcsrc/server/w_rocketlauncher.qc index f12c2fab1..d4056763a 100644 --- a/qcsrc/server/w_rocketlauncher.qc +++ b/qcsrc/server/w_rocketlauncher.qc @@ -586,15 +586,15 @@ float w_rlauncher(float req) precache_sound("weapons/rocket_impact.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "exploded"; + w_deathtypestring = "%s exploded"; else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation) - w_deathtypestring = "got too close to #'s rocket"; + w_deathtypestring = "%s got too close to %s's rocket"; else if(w_deathtype & HITTYPE_SPLASH) - w_deathtypestring = "almost dodged #'s rocket"; + w_deathtypestring = "%s almost dodged %s's rocket"; else - w_deathtypestring = "ate #'s rocket"; + w_deathtypestring = "%s ate %s's rocket"; } return TRUE; } diff --git a/qcsrc/server/w_seeker.qc b/qcsrc/server/w_seeker.qc index 3b23c2112..c91e4f408 100644 --- a/qcsrc/server/w_seeker.qc +++ b/qcsrc/server/w_seeker.qc @@ -468,15 +468,6 @@ float w_seeker(float req) return self.ammo_rockets >= cvar("g_balance_seeker_tag_ammo") + cvar("g_balance_seeker_missile_ammo"); else if (req == WR_CHECKAMMO2) return self.ammo_rockets >= cvar("g_balance_seeker_flac_ammo"); - else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "played with tiny rockets"; - else if (req == WR_KILLMESSAGE) - { - if(w_deathtype & HITTYPE_SECONDARY) - w_deathtypestring = "ran into #'s flac"; - else - w_deathtypestring = "was tagged by"; - } return TRUE; }; #endif @@ -548,6 +539,15 @@ float w_seeker(float req) precache_sound("weapons/tagexp3.wav"); precache_sound("weapons/tag_impact.wav"); } + else if (req == WR_SUICIDEMESSAGE) + w_deathtypestring = "%s played with tiny rockets"; + else if (req == WR_KILLMESSAGE) + { + if(w_deathtype & HITTYPE_SECONDARY) + w_deathtypestring = "%s ran into %s's flac"; + else + w_deathtypestring = "%s was tagged by %s"; + } return TRUE; } #endif diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index 9d1d8fba5..7b74e5693 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -224,10 +224,10 @@ float w_shotgun(float req) precache_sound("weapons/ric3.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "did the impossible"; + w_deathtypestring = "%s did the impossible"; else if (req == WR_KILLMESSAGE) { - w_deathtypestring = "was gunned by"; // unchecked: SECONDARY + w_deathtypestring = "%s was gunned by %s"; // unchecked: SECONDARY } return TRUE; } diff --git a/qcsrc/server/w_tuba.qc b/qcsrc/server/w_tuba.qc index 243b32b20..c89735e55 100644 --- a/qcsrc/server/w_tuba.qc +++ b/qcsrc/server/w_tuba.qc @@ -257,11 +257,11 @@ float w_tuba(float req) } else if (req == WR_SUICIDEMESSAGE) { - w_deathtypestring = "hurt his own ears with the @!#%'n Tuba"; + w_deathtypestring = "%s hurt his own ears with the @!#%%'n Tuba"; } else if (req == WR_KILLMESSAGE) { - w_deathtypestring = "died of #'s great playing on the @!#%'n Tuba"; + w_deathtypestring = "%s died of %s's great playing on the @!#%%'n Tuba"; } return TRUE; } diff --git a/qcsrc/server/w_uzi.qc b/qcsrc/server/w_uzi.qc index 245ad652f..b11e490f4 100644 --- a/qcsrc/server/w_uzi.qc +++ b/qcsrc/server/w_uzi.qc @@ -152,13 +152,13 @@ float w_uzi(float req) precache_sound("weapons/ric3.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "did the impossible"; + w_deathtypestring = "%s did the impossible"; else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) - w_deathtypestring = "was sniped by"; + w_deathtypestring = "%s was sniped by %s"; else - w_deathtypestring = "was riddled full of holes by"; + w_deathtypestring = "%s was riddled full of holes by %s"; } return TRUE; } -- 2.39.2