// Notification area (#4)
//
- string Weapon_SuicideMessage(float deathtype)
+ void HUD_Notify_Push(string icon, string attacker, string victim)
{
- w_deathtype = deathtype;
- get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_SUICIDEMESSAGE);
- return w_deathtypestring;
- }
-
- string Weapon_KillMessage(float deathtype)
- {
- w_deathtype = deathtype;
- get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_KILLMESSAGE);
- return w_deathtypestring;
- }
+ if(icon != "")
+ {
+ --kn_index;
+ if (kn_index == -1) { kn_index = KN_MAX_ENTRIES-1; }
+ notify_times[kn_index] = time;
- #define KN_MAX_ENTRIES 10
- float kn_index;
- float killnotify_times[KN_MAX_ENTRIES];
- float killnotify_deathtype[KN_MAX_ENTRIES];
- float killnotify_actiontype[KN_MAX_ENTRIES]; // 0 = "Y [used by] X", 1 = "X [did action to] Y"
- string killnotify_attackers[KN_MAX_ENTRIES];
- string killnotify_victims[KN_MAX_ENTRIES];
- void HUD_KillNotify_Push(string attacker, string victim, float actiontype, float wpn)
- {
- --kn_index;
- if (kn_index == -1)
- kn_index = KN_MAX_ENTRIES-1;
- killnotify_times[kn_index] = time;
- killnotify_deathtype[kn_index] = wpn;
- killnotify_actiontype[kn_index] = actiontype;
- if(killnotify_attackers[kn_index])
- strunzone(killnotify_attackers[kn_index]);
- killnotify_attackers[kn_index] = strzone(attacker);
- if(killnotify_victims[kn_index])
- strunzone(killnotify_victims[kn_index]);
- killnotify_victims[kn_index] = strzone(victim);
- }
+ // icon
+ if(notify_icon[kn_index]) { strunzone(notify_icon[kn_index]); }
+ notify_icon[kn_index] = strzone(icon);
- void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s1 = attacker, s2 = victim
- {
- float w;
- float alsoprint, gentle;
- alsoprint = (autocvar_hud_panel_notify_print || !panel_enabled); // print message to console if: notify panel disabled, or cvar to do so enabled
- gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages);
-
- if ((msg == MSG_SUICIDE || msg == MSG_KILL || msg == MSG_KILL_ACTION) && gametype == MAPINFO_TYPE_CTS) // selfkill isn't interesting in CTS and only spams up the notify panel
- return;
+ // attacker
+ if(notify_attackers[kn_index]) { strunzone(notify_attackers[kn_index]); }
+ notify_attackers[kn_index] = strzone(attacker);
- if(msg == MSG_SUICIDE) {
- w = DEATH_WEAPONOF(type);
- if(WEP_VALID(w)) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if (alsoprint)
- print("^1", sprintf(Weapon_SuicideMessage(type), strcat(s1, "^1")), "\n");
- } else if (type == DEATH_KILL) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_KILL);
- if (alsoprint)
- print (sprintf(_("^1%s^1 couldn't take it anymore\n"), s1));
- } else if (type == DEATH_ROT) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if (alsoprint)
- print (sprintf(_("^1%s^1 died\n"), s1));
- } else if (type == DEATH_NOAMMO) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_NOAMMO);
- if (alsoprint)
- print (sprintf(_("^7%s^7 committed suicide. What's the point of living without ammo?\n"), s1));
- } else if (type == DEATH_CAMP) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_CAMP);
- if (alsoprint)
- print (sprintf(_("^1%s^1 thought they found a nice camping ground\n"), s1));
- } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) {
- HUD_KillNotify_Push(s1, "", 0, type);
- if (alsoprint)
- print (sprintf(_("^1%s^1 didn't become friends with the Lord of Teamplay\n"), s1));
- } else if (type == DEATH_CHEAT) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if (alsoprint)
- print (sprintf(_("^1%s^1 unfairly eliminated themself\n"), s1));
- } else if (type == DEATH_FIRE) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if (alsoprint)
- print (sprintf(_("^1%s^1 burned to death\n"), s1));
- } else if (type != DEATH_TEAMCHANGE && type != DEATH_QUIET) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if (alsoprint)
- print (sprintf(_("^1%s^1 couldn't resist the urge to self-destruct\n"), s1));
- }
-
- if (stof(s2) > 2) // killcount > 2
- print (sprintf(_("^1%s^1 ended it all after a %d kill spree\n"), s1, stof(s2)));
- } else if(msg == MSG_KILL) {
- w = DEATH_WEAPONOF(type);
- if(WEP_VALID(w)) {
- HUD_KillNotify_Push(s1, s2, 1, type);
- if (alsoprint)
- 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);
- if(alsoprint)
- {
- if(gentle) {
- print (sprintf(_("^1%s^1 took action against a team mate\n"), s1));
- } else {
- print (sprintf(_("^1%s^1 mows down a team mate\n"), s1));
- }
- }
- if (stof(s2) > 2 && type == KILL_TEAM_SPREE) {
- if(gentle)
- print (sprintf(_("^1%s^1 ended a %d scoring spree by going against a team mate\n"), s1, stof(s3)));
- else
- print (sprintf(_("^1%s^1 ended a %d kill spree by killing a team mate\n"), s1, stof(s3)));
- }
- else if (stof(s2) > 2) {
- if(gentle)
- print (sprintf(_("^1%s^1's %s scoring spree was ended by a team mate!\n"), s1, stof(s3)));
- else
- print (sprintf(_("^1%s^1's %s kill spree was ended by a team mate!\n"), s1, stof(s3)));
- }
- }
- else if(type == KILL_FIRST_BLOOD)
- print(sprintf(_("^1%s^1 drew first blood\n"), s1));
- else if (type == DEATH_TELEFRAG) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_TELEFRAG);
- if(gentle)
- print (sprintf(_("^1%s^1 tried to occupy %s^1's teleport destination space\n"), s2, s1));
- else
- print (sprintf(_("^1%s^1 was telefragged by %s\n"), s2, s1));
- }
- else if (type == DEATH_DROWN) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_DROWN);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was drowned by %s\n"), s2, s1));
- }
- else if (type == DEATH_SLIME) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_SLIME);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was slimed by %s\n"), s2, s1));
- }
- else if (type == DEATH_LAVA) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_LAVA);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was cooked by %s\n"), s2, s1));
- }
- else if (type == DEATH_FALL) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_FALL);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was grounded by %s\n"), s2, s1));
- }
- else if (type == DEATH_SHOOTING_STAR) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_SHOOTING_STAR);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was shot into space by %s\n"), s2, s1));
- }
- else if (type == DEATH_SWAMP) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was conserved by %s\n"), s2, s1));
- }
- else if (type == DEATH_HURTTRIGGER)
- {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_HURTTRIGGER);
- if(alsoprint)
- print(sprintf(_("^1%s^1 was thrown into a world of hurt by %s\n"), s2, s1));
- } else if(type == DEATH_VHCRUSH) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was crushed by %s\n"), s2, s1));
- } else if(type == DEATH_SBMINIGUN) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 got shredded by %s\n"), s2, s1));
- } else if(type == DEATH_SBROCKET) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was blasted to bits by %s\n"), s2, s1));
- } else if(type == DEATH_SBBLOWUP) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 got caught in the blast when %s^1's destroys a vehicle\n"), s2, s1));
- } else if(type == DEATH_WAKIGUN) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was bolted down by %s\n"), s2, s1));
- } else if(type == DEATH_BUMB_GUN) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 saw %s's preddy lights.\n"), s2, s1));
- } else if(type == DEATH_WAKIROCKET) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 could find no shelter from %s^1's rockets\n"), s2, s1));
- } else if(type == DEATH_WAKIBLOWUP) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 got caught in the blast when %s^1's destroys a vehicle\n"), s2, s1));
- } else if(type == DEATH_RAPTOR_CANNON) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 nailed to hell by %s\n"), s2, s1));
- } else if(type == DEATH_RAPTOR_BOMB) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 cluster crushed by %s\n"), s2, s1));
- } else if(type == DEATH_RAPTOR_DEATH) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 got caught in the blast when %s^1's destroys a vehicle\n"), s2, s1));
- } else if(type == DEATH_TURRET) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was pushed into the line of fire by %s\n"), s2, s1));
- } else if(type == DEATH_TOUCHEXPLODE) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was pushed into an accident by %s\n"), s2, s1));
- } else if(type == DEATH_CHEAT) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was unfairly eliminated by %s\n"), s2, s1));
- } else if (type == DEATH_FIRE) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was burnt to death by %s\n"), s2, s1));
- } else if (type == DEATH_CUSTOM) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_CUSTOM);
- if(alsoprint)
- print("^1", sprintf(s3, strcat(s2, "^1"), strcat(s1, "^1")), "\n");
- } else if (type == DEATH_HURTTRIGGER) {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_HURTTRIGGER);
- if(alsoprint)
- print("^1", sprintf(s3, strcat(s2, "^1"), strcat(s1, "^1")), "\n");
- } else {
- HUD_KillNotify_Push(s1, s2, 1, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was fragged by %s\n"), s2, s1));
- }
- } else if(msg == MSG_SPREE) {
- if(type == KILL_END_SPREE) {
- if(gentle)
- print (sprintf(_("^1%s^1's %s scoring spree was ended by %s\n"), s1, s2, s3));
- else
- print (sprintf(_("^1%s^1's %s kill spree was ended by %s\n"), s1, s2, s3));
- } else if(type == KILL_SPREE) {
- if(gentle)
- print (sprintf(_("^1%s^1 made %s scores in a row\n"), s1, s2));
- else
- print (sprintf(_("^1%s^1 has %s frags in a row\n"), s1, s2));
- } else if(type == KILL_SPREE_3) {
- if(gentle)
- print (sprintf(_("%s^7 made a ^1TRIPLE SCORE\n"), s1));
- else
- print (sprintf(_("%s^7 made a ^1TRIPLE FRAG\n"), s1));
- } else if(type == KILL_SPREE_5) {
- if(gentle)
- print (sprintf(_("%s^7 unleashes ^1SCORING RAGE\n"), s1));
- else
- print (sprintf(_("%s^7 unleashes ^1RAGE\n"), s1));
- } else if(type == KILL_SPREE_10) {
- if(gentle)
- print (sprintf(_("%s^7 made ^1TEN SCORES IN A ROW!\n"), s1));
- else
- print (sprintf(_("%s^7 starts the ^1MASSACRE!\n"), s1));
- } else if(type == KILL_SPREE_15) {
- if(gentle)
- print (sprintf(_("%s^7 made ^1FIFTEEN SCORES IN A ROW!\n"), s1));
- else
- print (sprintf(_("%s^7 executes ^1MAYHEM!\n"), s1));
- } else if(type == KILL_SPREE_20) {
- if(gentle)
- print (sprintf(_("%s^7 made ^1TWENTY SCORES IN A ROW!\n"), s1));
- else
- print (sprintf(_("%s^7 is a ^1BERSERKER!\n"), s1));
- } else if(type == KILL_SPREE_25) {
- if(gentle)
- print (sprintf(_("%s^7 made ^1TWENTY FIVE SCORES IN A ROW!\n"), s1));
- else
- print (sprintf(_("%s^7 inflicts ^1CARNAGE!\n"), s1));
- } else if(type == KILL_SPREE_30) {
- if(gentle)
- print (sprintf(_("%s^7 made ^1THIRTY SCORES IN A ROW!\n"), s1));
- else
- print (sprintf(_("%s^7 unleashes ^1ARMAGEDDON!\n"), s1));
- }
- } else if(msg == MSG_KILL_ACTION) { // wtf is this? isnt it basically the same as MSG_SUICIDE?
- if (type == DEATH_DROWN) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_DROWN);
- if(alsoprint)
- {
- if(gentle)
- print (sprintf(_("^1%s^1 was in the water for too long\n"), s1));
- else
- print (sprintf(_("^1%s^1 drowned\n"), s1));
- }
- } else if (type == DEATH_SLIME) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_SLIME);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was slimed\n"), s1));
- } else if (type == DEATH_LAVA) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_LAVA);
- if(alsoprint)
- {
- if(gentle)
- print (sprintf(_("^1%s^1 found a hot place\n"), s1));
- else
- print (sprintf(_("^1%s^1 turned into hot slag\n"), s1));
- }
- } else if (type == DEATH_FALL) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if(alsoprint)
- {
- if(gentle)
- print (sprintf(_("^1%s^1 tested gravity (and it worked)\n"), s1));
- else
- print (sprintf(_("^1%s^1 hit the ground with a crunch\n"), s1));
- }
- } else if (type == DEATH_SHOOTING_STAR) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_SHOOTING_STAR);
- if(alsoprint)
- print (sprintf(_("^1%s^1 became a shooting star\n"), s1));
- } else if (type == DEATH_SWAMP) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if(alsoprint)
- {
- if(gentle)
- print (sprintf(_("^1%s^1 discovered a swamp\n"), s1));
- else
- print (sprintf(_("^1%s^1 is now conserved for centuries to come\n"), s1));
- }
- } else if(DEATH_ISTURRET(type)) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if(alsoprint)
- {
- if(gentle)
- print (sprintf(_("^1%s^1 ran into a turret\n"), s1));
- else
- {
- switch(type)
- {
- case DEATH_TURRET_EWHEEL:
- print (sprintf(_("^1%s^1 was laserd down by a eWheel turret \n"), s1));
- break;
- case DEATH_TURRET_FLAC:
- print (sprintf(_("^1%s^1 got caught in the flac \n"), s1));
- break;
- case DEATH_TURRET_MACHINEGUN:
- print (sprintf(_("^1%s^1 was riddeld full of riddled by a machinegun turret \n"), s1));
- break;
- case DEATH_TURRET_WALKER_GUN:
- print (sprintf(_("^1%s^1 got served a led enrichment by a walker turret \n"), s1));
- break;
- case DEATH_TURRET_WALKER_MEELE:
- print (sprintf(_("^1%s^1 was impaled by a walker turret \n"), s1));
- break;
- case DEATH_TURRET_WALKER_ROCKET:
- print (sprintf(_("^1%s^1 was rocketed to hell by a walker turret \n"), s1));
- break;
- case DEATH_TURRET_HELLION:
- print (sprintf(_("^1%s^1 was blasted away hellion turret \n"), s1));
- break;
- case DEATH_TURRET_HK:
- print (sprintf(_("^1%s^1 could not hide from the hunter turret \n"), s1));
- break;
- case DEATH_TURRET_MLRS:
- print (sprintf(_("^1%s^1 got turned into smoldering gibs by a mlrs turret \n"), s1));
- break;
- case DEATH_TURRET_PLASMA:
- print (sprintf(_("^1%s^1 got served some superheated plasma from a plasma turret \n"), s1));
- break;
- case DEATH_TURRET_PHASER:
- print (sprintf(_("^1%s^1 was phased out \n"), s1));
- break;
- case DEATH_TURRET_TESLA:
- print (sprintf(_("^1%s^1 was electrocuted by a tesla turret \n"), s1));
- break;
- }
- }
- }
- } else if(DEATH_ISMONSTER(type)) {
++ if(msg == MSG_KILL_ACTION) { // wtf is this? isnt it basically the same as MSG_SUICIDE?
++ if(DEATH_ISMONSTER(type)) {
+ HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
+ if(alsoprint)
+ {
+ if(gentle)
+ print (sprintf(_("^1%s^1 hit a monster, and the monster hit back\n"), s1));
+ else
+ {
+ switch(type)
+ {
+ case DEATH_MONSTER_DEMON_MELEE:
+ print (sprintf(_("^1%s^1 was eviscerated by a Fiend \n"), s1));
+ break;
+ case DEATH_MONSTER_DEMON_JUMP:
+ print (sprintf(_("^1%s^1 didn't see the Fiend pouncing at them \n"), s1));
+ break;
+ case DEATH_MONSTER_SHAMBLER_MELEE:
+ print (sprintf(_("^1%s^1 was smashed by a Shambler \n"), s1));
+ break;
+ case DEATH_MONSTER_SHAMBLER_CLAW:
+ print (sprintf(_("^1%s^1's insides were ripped out by a Shambler \n"), s1));
+ break;
+ case DEATH_MONSTER_SHAMBLER_LIGHTNING:
+ print (sprintf(_("^1%s^1 was zapped to death by a Shambler \n"), s1));
+ break;
+ case DEATH_MONSTER_SOLDIER_NAIL:
+ print (sprintf(_("^1%s^1 was riddled full of holes by a Soldier \n"), s1));
+ break;
+ case DEATH_MONSTER_ENFORCER_NAIL:
+ print (sprintf(_("^1%s^1 was riddled full of holes by an Enforcer \n"), s1));
+ break;
+ case DEATH_MONSTER_DOG_BITE:
+ print (sprintf(_("^1%s^1 was mauled by a Rottweiler \n"), s1));
+ break;
+ case DEATH_MONSTER_DOG_JUMP:
+ print (sprintf(_("^1%s^1 didn't see the pouncing Rottweiler \n"), s1));
+ break;
+ case DEATH_MONSTER_TARBABY_BLOWUP:
+ print (sprintf(_("^1%s^1 was slimed by a Spawn \n"), s1));
+ break;
+ case DEATH_MONSTER_FISH_BITE:
+ print (sprintf(_("^1%s^1 was fed to the Rotfish \n"), s1));
+ break;
+ case DEATH_MONSTER_HELLFISH_BITE:
+ print (sprintf(_("^1%s^1 was eaten alive by a Hellfish \n"), s1));
+ break;
+ case DEATH_MONSTER_SHALRATH_MELEE:
+ print (sprintf(_("^1%s^1 was exploded by a Vore \n"), s1));
+ break;
+ case DEATH_MONSTER_OGRE_CHAINSAW:
+ print (sprintf(_("^1%s^1 was destroyed by an Ogre \n"), s1));
+ break;
+ case DEATH_MONSTER_OGRE_NAIL:
+ print (sprintf(_("^1%s^1 was riddled full of holes by an Ogre \n"), s1));
+ break;
+ case DEATH_MONSTER_ZOMBIE:
+ print (sprintf(_("^1%s^1's brains were eaten by a Zombie \n"), s1));
+ break;
+ case DEATH_MONSTER_HELLKNIGHT_FIREBALL:
+ print (sprintf(_("^1%s^1 was exploded by a Hell-Knight's fireball \n"), s1));
+ case DEATH_MONSTER_MELEE:
+ print (sprintf(_("^1%s^1 was killed by a monster \n"), s1));
+ break;
+ }
+ }
+ }
- }
- else if (type == DEATH_CUSTOM) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_CUSTOM);
- if(alsoprint)
- print("^1", sprintf(s2, strcat(s1, "^1")), "\n");
- } else if (type == DEATH_HURTTRIGGER) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_HURTTRIGGER);
- if(alsoprint)
- print("^1", sprintf(s2, strcat(s1, "^1")), "\n");
- } else if(type == DEATH_TOUCHEXPLODE) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 died in an accident\n"), s1));
- } else if(type == DEATH_CHEAT) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if(alsoprint)
- print (sprintf(_("^1%s^1 was unfairly eliminated\n"), s1));
- } else if(type == DEATH_FIRE) {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if(alsoprint)
- {
- if(gentle)
- print (sprintf(_("^1%s^1 felt a little hot\n"), s1));
- else
- print (sprintf(_("^1%s^1 burnt to death\n"), s1));
- }
- } else {
- HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
- if(alsoprint)
- {
- if(gentle)
- print (sprintf(_("^1%s^1 needs a restart\n"), s1));
- else
- print (sprintf(_("^1%s^1 died\n"), s1));
- }
- }
- } else if(msg == MSG_KILL_ACTION_SPREE) {
- if(gentle)
- print (sprintf(_("^1%s^1 needs a restart after a %d scoring spree\n"), s1, stof(s2)));
- else
- print (sprintf(_("^1%s^1 died with a %d kill spree\n"), s1, stof(s2)));
- } else if(msg == MSG_INFO) {
- if(type == INFO_GOTFLAG) { // here, s2 is the flag name
- HUD_KillNotify_Push(s1, s2, 0, INFO_GOTFLAG);
- print(sprintf(_("%s^7 got the %s\n"), s1, s2));
- } else if(type == INFO_LOSTFLAG) {
- HUD_KillNotify_Push(s1, s2, 0, INFO_LOSTFLAG);
- print(sprintf(_("%s^7 lost the %s\n"), s1, s2));
- } else if(type == INFO_PICKUPFLAG) {
- HUD_KillNotify_Push(s1, s2, 0, INFO_GOTFLAG);
- print(sprintf(_("%s^7 picked up the %s\n"), s1, s2));
- } else if(type == INFO_RETURNFLAG) {
- HUD_KillNotify_Push(s1, s2, 0, INFO_RETURNFLAG);
- print(sprintf(_("%s^7 returned the %s\n"), s1, s2));
- } else if(type == INFO_CAPTUREFLAG) {
- HUD_KillNotify_Push(s1, s2, 0, INFO_CAPTUREFLAG);
- print(sprintf(_("%s^7 captured the %s%s\n"), s1, s2, s3));
- }
- } else if(msg == MSG_RACE) {
- if(type == RACE_SERVER_RECORD) {
- HUD_KillNotify_Push(s1, s2, 1, RACE_SERVER_RECORD);
- }
- else if(type == RACE_NEW_RANK) {
- HUD_KillNotify_Push(s1, s2, 1, RACE_NEW_RANK);
- }
- else if(type == RACE_NEW_TIME) {
- HUD_KillNotify_Push(s1, s2, 1, RACE_NEW_TIME);
- }
- else if(type == RACE_FAIL) {
- HUD_KillNotify_Push(s1, s2, 1, RACE_FAIL);
- }
- } else if(msg == MSG_KA) {
- if(type == KA_PICKUPBALL) {
- HUD_KillNotify_Push(s1, s2, 0, KA_PICKUPBALL);
- if(alsoprint)
- print (sprintf(_("%s^7 has picked up the ball!\n"), s1));
- }
- else if(type == KA_DROPBALL) {
- HUD_KillNotify_Push(s1, s2, 0, KA_DROPBALL);
- if(alsoprint)
- print(sprintf(_("%s^7 has dropped the ball!\n"), s1));
- }
- }
- }
-
- void HUD_KillCenterprint(string s1, string s2, float type, float msg)
- {
- float gentle;
- gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages);
- if(msg == MSG_SUICIDE) {
- if (type == DEATH_TEAMCHANGE) {
- centerprint_hud(sprintf(_("You are now on: %s"), s1));
- } else if (type == DEATH_AUTOTEAMCHANGE) {
- centerprint_hud(sprintf(_("You have been moved into a different team to improve team balance\nYou are now on: %s"), s1));
- } else if (type == DEATH_CAMP) {
- if(gentle)
- centerprint_hud(_("^1Reconsider your tactics, camper!"));
- else
- centerprint_hud(_("^1Die camper!"));
- } else if (type == DEATH_NOAMMO) {
- if(gentle)
- centerprint_hud(_("^1You are reinserted into the game for running out of ammo..."));
- else
- centerprint_hud(_("^1You were killed for running out of ammo..."));
- } else if (type == DEATH_ROT) {
- if(gentle)
- centerprint_hud(_("^1You need to preserve your health"));
- else
- centerprint_hud(_("^1You grew too old without taking your medicine"));
- } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) {
- if(gentle)
- centerprint_hud(_("^1Don't go against team mates!"));
- else
- centerprint_hud(_("^1Don't shoot your team mates!"));
- } else if (type == DEATH_QUIET) {
- // do nothing
- } else { // generic message
- if(gentle)
- centerprint_hud(_("^1You need to be more careful!"));
- else
- centerprint_hud(_("^1You killed your own dumb self!"));
- }
- } else if(msg == MSG_KILL) {
- if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) {
- if(gentle) {
- centerprint_hud(sprintf(_("^1Moron! You went against ^7%s^1, a team mate!"), s1));
- } else {
- centerprint_hud(sprintf(_("^1Moron! You fragged ^7%s^1, a team mate!"), s1));
- }
- } else if (type == KILL_FIRST_BLOOD) {
- if(gentle) {
- centerprint_hud(_("^1First score"));
- } else {
- centerprint_hud(_("^1First blood"));
- }
- } else if (type == KILL_FIRST_VICTIM) {
- if(gentle) {
- centerprint_hud(_("^1First casualty"));
- } else {
- centerprint_hud(_("^1First victim"));
- }
- } else if (type == KILL_TYPEFRAG) { // s2 contains "advanced kill messages" such as ping, handicap...
- if(gentle) {
- centerprint_hud(strcat(sprintf(_("^1You scored against ^7%s^1 who was typing!"), s1), s2));
- } else {
- centerprint_hud(strcat(sprintf(_("^1You typefragged ^7%s"), s1), s2));
- }
- } else if (type == KILL_TYPEFRAGGED) {
- if(gentle) {
- centerprint_hud(strcat(sprintf(_("^1You were scored against by ^7%s^1 while you were typing!"), s1), s2));
- } else {
- centerprint_hud(strcat(sprintf(_("^1You were typefragged by ^7%s"), s1), s2));
- }
- } else if (type == KILL_FRAG) {
- if(gentle) {
- centerprint_hud(strcat(sprintf(_("^4You scored against ^7%s"), s1), s2));
- } else {
- centerprint_hud(strcat(sprintf(_("^4You fragged ^7%s"), s1), s2));
- }
- } else { // generic message
- if(gentle) {
- centerprint_hud(strcat(sprintf(_("^1You were scored against by ^7%s"), s1), s2));
- } else {
- centerprint_hud(strcat(sprintf(_("^1You were fragged by ^7%s"), s1), s2));
- }
++ }
+ }
- } else if(msg == MSG_KILL_ACTION) {
- // TODO: invent more centerprints here?
- centerprint_hud(_("^1Watch your step!"));
+ // victim
+ if(notify_victims[kn_index]) { strunzone(notify_victims[kn_index]); }
+ notify_victims[kn_index] = strzone(victim);
}
}
}
else
{
- if (!checkrules_firstblood)
- {
- checkrules_firstblood = TRUE;
- Send_KillNotification(a, "", "", KILL_FIRST_BLOOD, MSG_KILL);
- // TODO: make these print a newline if they dont
- Send_CSQC_KillCenterprint(attacker, "", "", KILL_FIRST_BLOOD, MSG_KILL);
- Send_CSQC_KillCenterprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
- PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
- }
-
- if(targ.istypefrag) {
- Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_TYPEFRAG, MSG_KILL);
- Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_TYPEFRAGGED, MSG_KILL);
- } else {
- Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_FRAG, MSG_KILL);
- Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_FRAGGED, MSG_KILL);
- }
-
- attacker.taunt_soundtime = time + 1;
+ kill_count_to_attacker = attacker.killcount;
+ kill_count_to_target = 0;
+ }
- if (deathtype == DEATH_HURTTRIGGER && inflictor.message2 != "")
- msg = inflictor.message2;
- else if (deathtype == DEATH_CUSTOM)
- msg = deathmessage;
+ float verbose_allowed = (autocvar_notification_server_allows_frag_verbose && ((autocvar_notification_server_allows_frag_verbose == 2) || inWarmupStage));
+ if(targ.istypefrag)
+ {
+ if(attacker.FRAG_VERBOSE && verbose_allowed)
+ Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping));
else
- msg = "";
-
- if(strstrofs(msg, "%", 0) < 0)
- msg = strcat("%s ", msg, " by %s");
+ Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG, targ.netname, kill_count_to_attacker);
- Send_KillNotification(a, s, msg, deathtype, MSG_KILL);
+ if(targ.FRAG_VERBOSE && verbose_allowed)
+ Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping));
+ else
+ Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED, attacker.netname, kill_count_to_target);
+ }
+ else
+ {
+ if(attacker.FRAG_VERBOSE && verbose_allowed)
+ Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_FRAG_VERBOSE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping));
+ else
+ Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_FRAG, targ.netname, kill_count_to_attacker);
- GiveFrags(attacker, targ, 1, deathtype);
+ if(targ.FRAG_VERBOSE && verbose_allowed)
+ Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED_VERBOSE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping));
+ else
+ Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED, attacker.netname, kill_count_to_target);
+ }
- if (targ.killcount > 2) {
- Send_KillNotification(s, ftos(targ.killcount), a, KILL_END_SPREE, MSG_SPREE);
- }
+ if not(Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker))
+ Obituary_SpecialDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker, 0);
+ }
+ }
- attacker.killcount = attacker.killcount + 1;
+ // =============
+ // ACCIDENT/TRAP
+ // =============
+ else
+ {
+ switch(deathtype)
+ {
+ // For now, we're just forcing HURTTRIGGER to behave as "DEATH_VOID" and giving it no special options...
+ // Later on you will only be able to make custom messages using DEATH_CUSTOM,
+ // and there will be a REAL DEATH_VOID implementation which mappers will use.
+ /*case DEATH_HURTTRIGGER:
+ {
+ s1 = targ.netname;
+ s2 = inflictor.message;
+ if(strstrofs(s2, "%", 0) < 0) { s2 = strcat("%s ", s2); }
+ break;
+ }*/
- if (attacker.killcount == 3)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_3, MSG_SPREE);
- AnnounceTo(attacker, "03kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3, 1);
- }
- else if (attacker.killcount == 5)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_5, MSG_SPREE);
- AnnounceTo(attacker, "05kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5, 1);
- }
- else if (attacker.killcount == 10)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_10, MSG_SPREE);
- AnnounceTo(attacker, "10kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10, 1);
- }
- else if (attacker.killcount == 15)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_15, MSG_SPREE);
- AnnounceTo(attacker, "15kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15, 1);
- }
- else if (attacker.killcount == 20)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_20, MSG_SPREE);
- AnnounceTo(attacker, "20kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20, 1);
- }
- else if (attacker.killcount == 25)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_25, MSG_SPREE);
- AnnounceTo(attacker, "25kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25, 1);
- }
- else if (attacker.killcount == 30)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_30, MSG_SPREE);
- AnnounceTo(attacker, "30kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30, 1);
- }
- else if (attacker.killcount > 2) {
- Send_KillNotification(a, ftos(attacker.killcount), "", KILL_SPREE, MSG_SPREE);
- }
- LogDeath("frag", deathtype, attacker, targ);
+ case DEATH_CUSTOM:
+ {
+ Obituary_SpecialDeath(targ, FALSE, deathtype,
+ targ.netname,
+ ((strstrofs(deathmessage, "%", 0) < 0) ? strcat("%s ", deathmessage) : deathmessage),
+ deathlocation,
+ targ.killcount,
+ 0,
+ 0);
+ break;
}
- }
- else
- {
- Send_CSQC_KillCenterprint(targ, "", "", deathtype, MSG_KILL_ACTION);
- if (deathtype == DEATH_HURTTRIGGER && inflictor.message != "")
- msg = inflictor.message;
- else if (deathtype == DEATH_CUSTOM)
- msg = deathmessage;
- else
- msg = "";
- if(strstrofs(msg, "%", 0) < 0)
- msg = strcat("%s ", msg);
-
- GiveFrags(targ, targ, -1, deathtype);
- if(PlayerScore_Add(targ, SP_SCORE, 0) == -5) {
- AnnounceTo(targ, "botlike");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
+
+ default:
+ {
+ Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0);
+ break;
}
- Send_KillNotification(s, msg, "", deathtype, MSG_KILL_ACTION);
-
- if (targ.killcount > 2)
- Send_KillNotification(s, ftos(targ.killcount), "", 0, MSG_KILL_ACTION_SPREE);
-
- LogDeath("accident", deathtype, targ, targ);
}
- targ.death_origin = targ.origin;
- if(targ != attacker)
- targ.killer_origin = attacker.origin;
+ LogDeath("accident", deathtype, targ, targ);
+ GiveFrags(targ, targ, -1, deathtype);
- // FIXME: this should go in PutClientInServer
- if (targ.killcount)
- targ.killcount = 0;
+ if(PlayerScore_Add(targ, SP_SCORE, 0) == -5)
+ {
+ AnnounceTo(targ, "botlike");
+ PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
+ }
}
+
+ // reset target kill count
+ if(targ.killcount) { targ.killcount = 0; }
}
+void Ice_Think()
+{
+ if(self.owner.health < 1)
+ {
+ remove(self);
+ return;
+ }
+ setorigin(self, self.owner.origin - '0 0 16');
+ self.nextthink = time;
+}
+
+void Freeze (entity targ, float freeze_time)
+{
+ float monster = (targ.flags & FL_MONSTER);
+ float player = (targ.flags & FL_CLIENT);
+
+ if(!player && !monster) // only specified entities can be freezed
+ return;
+
+ if(targ.frozen || targ.freezetag_frozen)
+ return;
+
+ targ.frozen = 1;
+ targ.revive_progress = 0;
+ targ.health = 1;
+ targ.revive_speed = freeze_time;
+
+ entity ice;
+ ice = spawn();
+ ice.owner = targ;
+ ice.classname = "ice";
+ ice.scale = targ.scale;
+ ice.think = Ice_Think;
+ ice.nextthink = time;
+ ice.frame = floor(random() * 21); // ice model has 20 different looking frames
+ setmodel(ice, "models/ice/ice.md3");
+
+ entity oldself;
+ oldself = self;
+ self = ice;
+ Ice_Think();
+ self = oldself;
+
+ RemoveGrapplingHook(targ);
+}
+
+void Unfreeze (entity targ)
+{
+ targ.frozen = 0;
+ targ.revive_progress = 0;
+ targ.health = ((targ.classname == STR_PLAYER) ? autocvar_g_balance_health_start : targ.max_health);
+
+ // remove the ice block
+ entity ice;
+ for(ice = world; (ice = find(ice, classname, "ice")); ) if(ice.owner == targ)
+ {
+ remove(ice);
+ break;
+ }
+}
+
// these are updated by each Damage call for use in button triggering and such
entity damage_targ;
entity damage_inflictor;