r1687 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Jun 28 13:31:54 EDT 2006
Author: div0
Date: 2006-06-28 13:31:53 -0400 (Wed, 28 Jun 2006)
New Revision: 1687
Modified:
trunk/data/qcsrc/server/arena.qc
trunk/data/qcsrc/server/cl_client.qc
trunk/data/qcsrc/server/cl_weapons.qc
trunk/data/qcsrc/server/ctf.qc
trunk/data/qcsrc/server/defs.qh
trunk/data/qcsrc/server/g_damage.qc
trunk/data/qcsrc/server/g_triggers.qc
trunk/data/qcsrc/server/g_world.qc
trunk/data/qcsrc/server/miscfunctions.qc
trunk/data/qcsrc/server/progs.src
trunk/data/qcsrc/server/t_items.qc
trunk/data/qcsrc/server/t_plats.qc
trunk/data/qcsrc/server/teamplay.qc
trunk/data/qcsrc/server/w_nex.qc
Log:
centerprints now are managed independently per line
Modified: trunk/data/qcsrc/server/arena.qc
===================================================================
--- trunk/data/qcsrc/server/arena.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/arena.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -126,18 +126,16 @@
if(time < warmup && self.spawned)
{
if(champion)
- msg = strcat(msg, "The Champion is ", champion.netname, "^7\n\n\n");
+ centermsg_set(CENTERMSG_ARENACHAMP, strcat("The Champion is ", champion.netname));
if(f)
- msg = strcat(msg, "Round will start in ", ftos(f));
+ centermsg_set(CENTERMSG_ARENATIMER, strcat("Round will start in ", ftos(f)));
else
{
if(self.spawned)
- msg = strcat(msg, "^1Fight!");
+ centermsg_set(CENTERMSG_ARENATIMER, "^1Fight!");
}
- centerprint(self, msg);
-
if(self.spawned)
self.movetype = MOVETYPE_NONE;
@@ -149,7 +147,7 @@
else if(self.movetype == MOVETYPE_NONE)
{
self.movetype = MOVETYPE_WALK;
- centerprint(self, "\n");
+ centermsg_reset();
}
}
Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/cl_client.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -1361,7 +1361,7 @@
//sprint(self, "distance: ", ftos(self.lms_traveled_distance), "\n");
if(self.lms_traveled_distance < cvar("g_lms_campcheck_distance"))
{
- centerprint(self, cvar_string("g_lms_campcheck_message"));
+ centermsg_set(CENTERMSG_CAMP, cvar_string("g_lms_campcheck_message"));
// FIXME KadaverJack: gibbing player here causes playermodel to bounce around, instead of eye.md3
// I wasn't able to find out WHY that happens, so I put a workaround in place that shall prevent players from being gibbed :(
Damage(self, self, self, bound(0, cvar("g_lms_campcheck_damage"), self.health + self.armorvalue * cvar("g_balance_armor_blockpercent") + 5), DEATH_CAMP, self.origin, '0 0 0');
@@ -1484,7 +1484,7 @@
PutClientInServer();
if(self.flags & !FL_NOTARGET)
bprint (strcat("^4", self.netname, "^4 is playing now\n"));
- centerprint(self,"");
+ centermsg_reset();
return;
} else {
self.flags = self.flags & !FL_JUMPRELEASED;
@@ -1517,7 +1517,7 @@
if(cvar("g_campaign"))
campaign_bots_may_start = 1;
PutClientInServer();
- centerprint(self,"");
+ centermsg_reset();
return;
} else {
self.flags = self.flags & !FL_JUMPRELEASED;
Modified: trunk/data/qcsrc/server/cl_weapons.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weapons.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/cl_weapons.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -395,13 +395,19 @@
if(dt >= 1 && dt <= 5)
self.nixnex_lastinfotime = -42;
else
- centerprint(self, strcat("\n\n^2Active weapon: ^3", W_Name(nixnex_weapon), "\n"));
+ {
+ centermsg_free(CENTERMSG_NIXNEXCOUNT);
+ centermsg_set(CENTERMSG_NIXNEX, strcat("^2Active weapon: ^3", W_Name(nixnex_weapon)));
+ }
}
if(self.nixnex_lastinfotime != dt)
{
self.nixnex_lastinfotime = dt; // initial value 0 should count as "not seen"
if(dt >= 1 && dt <= 5)
- centerprint(self, strcat("^3", ftos(dt), "^2 seconds until weapon change...\n\nNext weapon: ^3", W_Name(nixnex_nextweapon), "\n"));
+ {
+ centermsg_set(CENTERMSG_NIXNEXCOUNT, strcat("^3", ftos(dt), "^2 seconds until weapon change..."));
+ centermsg_set(CENTERMSG_NIXNEX, strcat("Next weapon: ^3", W_Name(nixnex_nextweapon)));
+ }
}
if(cvar("g_use_ammunition") && time > self.nixnex_nextincr)
Modified: trunk/data/qcsrc/server/ctf.qc
===================================================================
--- trunk/data/qcsrc/server/ctf.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/ctf.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -274,7 +274,7 @@
player = find(world, classname, "player");
while(player) {
- if(player.team == self.team) centerprint(player, "The enemy got your flag! Retrieve it!");
+ if(player.team == self.team) centermsg_setfor(player, CENTERMSG_CTF, "The enemy got your flag! Retrieve it!");
player = find(player, classname, "player");
}
@@ -311,7 +311,7 @@
player = find(world, classname, "player");
while(player) {
- if(player.team == self.team) centerprint(player, "The enemy got your flag! Retrieve it!");
+ if(player.team == self.team) centermsg_setfor(player, CENTERMSG_CTF, "The enemy got your flag! Retrieve it!");
player = find(player, classname, "player");
}
}
Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/defs.qh 2006-06-28 17:31:53 UTC (rev 1687)
@@ -255,6 +255,7 @@
.float() customizeentityforclient;
.float cvar_cl_playerdetailreduction;
.float cvar_cl_nogibs;
+.float cvar_scr_centertime;
#ifdef ALLOW_VARIABLE_LOD
.float modelindex_lod0;
Modified: trunk/data/qcsrc/server/g_damage.qc
===================================================================
--- trunk/data/qcsrc/server/g_damage.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/g_damage.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -106,11 +106,12 @@
m = strcat(m, "^6Pink Team");
else if (targ.team == 13)
m = strcat(m, "^3Yellow Team");
- centerprint(targ, m);
+ centermsg_setfor(targ, CENTERMSG_TEAMCHANGE, m);
}
else if (deathtype == DEATH_AUTOTEAMCHANGE)
{
- m = "You have been moved into a different team to improve team balance\nYou are now on: ";
+ centermsg_setfor(targ, CENTERMSG_TEAMCHANGE, "You have been moved into a different team to improve team balance");
+ m = "You are now on: ";
if (targ.team == 5)
m = strcat(m, "^1Red Team");
else if (targ.team == 14)
@@ -119,17 +120,17 @@
m = strcat(m, "^6Pink Team");
else if (targ.team == 13)
m = strcat(m, "^3Yellow Team");
- centerprint(targ, m);
+ centermsg_setfor(targ, CENTERMSG_TEAMCHANGE2, m);
return;
}
else if (deathtype == DEATH_CAMP)
- centerprint(targ, strcat("^1Die camper!\n\n\n"));
+ centermsg_setfor(targ, CENTERMSG_DEATH, "^1Die camper!");
else if (deathtype == DEATH_NOAMMO)
- centerprint(targ, strcat("^1You were killed for running out of ammo...\n\n\n"));
+ centermsg_setfor(targ, CENTERMSG_DEATH, "^1You were killed for running out of ammo...");
else if (deathtype == DEATH_ROT)
- centerprint(targ, strcat("^1You grew too old without taking your medcine\n\n\n"));
+ centermsg_setfor(targ, CENTERMSG_DEATH, "^1You grew too old without taking your medcine");
else
- centerprint(targ, strcat("^1You killed your own dumb self!\n\n\n"));
+ centermsg_setfor(targ, CENTERMSG_DEATH, "^1You killed your own dumb self!");
if (deathtype == IT_GRENADE_LAUNCHER)
bprint ("^1",s, "^1 detonated\n");
@@ -161,7 +162,7 @@
}
else if (teamplay && attacker.team == targ.team)
{
- centerprint(attacker, strcat("^1Moron! You fragged a teammate!\n\n\n"));
+ centermsg_setfor(attacker, CENTERMSG_DEATH, "^1Moron! You fragged a teammate!");
bprint ("^1", attacker.netname, "^1 mows down a teammate\n");
GiveFrags(attacker, targ, -1);
//attacker.frags = attacker.frags - 1;
@@ -184,8 +185,8 @@
bprint("^1",attacker.netname, "^1 drew first blood", "\n");
}
- centerprint(attacker, strcat("^4You fragged ^7", s, "\n\n\n"));
- centerprint(targ, strcat("^1You were fragged by ^7", attacker.netname, "\n\n\n"));
+ centermsg_setfor(attacker, CENTERMSG_KILL, strcat("^4You fragged ^7", s));
+ centermsg_setfor(targ, CENTERMSG_DEATH, strcat("^1You were fragged by ^7", attacker.netname));
if (deathtype == IT_LASER)
bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n");
@@ -272,7 +273,7 @@
}
else
{
- centerprint(targ, strcat("^1Watch your step!\n\n\n"));
+ centermsg_setfor(targ, CENTERMSG_DEATH, "^1Watch your step!");
if (deathtype == DEATH_HURTTRIGGER && attacker.message != "")
bprint ("^1",s, "^1 ", attacker.message, "\n");
else if (deathtype == DEATH_DROWN)
@@ -360,7 +361,7 @@
if (targ.extralives && (deathtype == IT_NEX) && damage)
{
targ.extralives -= 1;
- centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.extralives),"\n"));
+ centermsg_setfor(targ, CENTERMSG_MINSTAGIB, strcat("^3Remaining extra lives: ",ftos(targ.extralives)));
damage = 0;
targ.armorvalue = targ.extralives;
if(clienttype(targ) == CLIENTTYPE_REAL) stuffcmd(targ, "play2 misc/hit.wav\n");
@@ -376,7 +377,7 @@
if (targ != attacker)
{
if (targ.classname == "player")
- centerprint(attacker, "Secondary fire inflicts no damage!\n");
+ centermsg_setfor(attacker, CENTERMSG_MINSTAGIB, "Secondary fire inflicts no damage!\n");
damage = 0;
force = '0 0 0';
attacker = targ;
Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/g_triggers.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -54,7 +54,7 @@
//
if (activator.classname == "player" && self.message != "")
{
- centerprint (activator, self.message);
+ centermsg_setfor (activator, CENTERMSG_TRIGGER, self.message);
if (!self.noise)
sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM);
}
@@ -307,20 +307,20 @@
&& (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
{
if (self.count >= 4)
- centerprint (activator, "There are more to go...");
+ centermsg_setfor (activator, CENTERMSG_TRIGGER, "There are more to go...");
else if (self.count == 3)
- centerprint (activator, "Only 3 more to go...");
+ centermsg_setfor (activator, CENTERMSG_TRIGGER, "Only 3 more to go...");
else if (self.count == 2)
- centerprint (activator, "Only 2 more to go...");
+ centermsg_setfor (activator, CENTERMSG_TRIGGER, "Only 2 more to go...");
else
- centerprint (activator, "Only 1 more to go...");
+ centermsg_setfor (activator, CENTERMSG_TRIGGER, "Only 1 more to go...");
}
return;
}
if (activator.classname == "player"
&& (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
- centerprint(activator, "Sequence completed!");
+ centermsg_setfor(activator, CENTERMSG_TRIGGER, "Sequence completed!");
self.enemy = activator;
multi_trigger ();
};
Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/g_world.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -830,6 +830,7 @@
// fixme: don't check players; instead check dom_team and ctf_team entities
// (div0: and that in CheckRules_World please)
+ centermsg_check();
};
float checkrules_oneminutewarning;
Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/miscfunctions.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -396,6 +396,7 @@
{
GetCvars_handleFloat(f, cvar_cl_playerdetailreduction, "cl_playerdetailreduction");
GetCvars_handleFloat(f, cvar_cl_nogibs, "cl_nogibs");
+ GetCvars_handleFloat(f, cvar_scr_centertime, "scr_centertime");
}
float fexists(string f)
Modified: trunk/data/qcsrc/server/progs.src
===================================================================
--- trunk/data/qcsrc/server/progs.src 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/progs.src 2006-06-28 17:31:53 UTC (rev 1687)
@@ -8,6 +8,7 @@
extensions.qh
campaign.qh
+centermsg.qh
../common/campaign_common.qh
../common/util.qh
../common/util.qc
@@ -79,3 +80,5 @@
campaign.qc
../common/campaign_file.qc
../common/campaign_setup.qc
+
+centermsg.qc
Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/t_items.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -53,7 +53,8 @@
if (self.ammo_cells)
{
// play some cool sounds ;)
- centerprint(other, "\n");
+ centermsg_freefor(other, CENTERMSG_MINSTAGIB);
+ centermsg_freefor(other, CENTERMSG_MINSTAGIB2);
if(other.health <= 5)
stuffcmd(other, "play2 announcer/robotic/lastsecond.ogg\n");
else if(other.health < 50)
Modified: trunk/data/qcsrc/server/t_plats.qc
===================================================================
--- trunk/data/qcsrc/server/t_plats.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/t_plats.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -815,7 +815,7 @@
if (self.owner.message != "")
{
if (other.flags & FL_CLIENT)
- centerprint (other, self.owner.message);
+ centermsg_setfor (other, CENTERMSG_TRIGGER, self.owner.message);
sound (other, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM);
}
};
@@ -1203,7 +1203,7 @@
if (self.message)
{
if (other.flags & FL_CLIENT)
- centerprint (other, self.message);
+ centermsg_setfor (other, CENTERMSG_TRIGGER, self.message);
sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM);
}
};
Modified: trunk/data/qcsrc/server/teamplay.qc
===================================================================
--- trunk/data/qcsrc/server/teamplay.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/teamplay.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -313,16 +313,16 @@
if(self.classname == "observer")
{
if(cvar("g_lms") && self.frags <= 0 && self.frags > -666)
- return centerprint(self, strcat(newlines, "^1You have no more lives left\nwait for next round\n\n\n^7press attack to spectate other players"));
+ return centermsg_setall(strcat(newlines, "^1You have no more lives left\nwait for next round\n\n\n^7press attack to spectate other players"));
else if(cvar("g_lms") && self.frags == -666)
- return centerprint(self, strcat(newlines, "^1Match has already begun\nwait for next round\n\n\n^7press attack to spectate other players"));
+ return centermsg_setall(strcat(newlines, "^1Match has already begun\nwait for next round\n\n\n^7press attack to spectate other players"));
}
else if(self.classname == "spectator")
{
if ((cvar("g_lms") && self.frags < 1) || cvar("g_arena"))
- return centerprint(self, strcat(newlines, "spectating ", self.enemy.netname, "\n\n\n^7press attack for next player\npress attack2 for free fly mode"));
+ return centermsg_setall(strcat(newlines, "spectating ", self.enemy.netname, "\n\n\n^7press attack for next player\npress attack2 for free fly mode"));
else
- return centerprint(self, strcat(newlines, "spectating ", self.enemy.netname, "\n\n\n^7press jump to play\n^7press attack for next player\npress attack2 for free fly mode"));
+ return centermsg_setall(strcat(newlines, "spectating ", self.enemy.netname, "\n\n\n^7press jump to play\n^7press attack for next player\npress attack2 for free fly mode"));
}
@@ -331,7 +331,7 @@
if(cvar("g_campaign"))
{
- centerprint(pl, campaign_message);
+ centermsg_setallfor(pl, campaign_message);
return;
}
@@ -405,7 +405,7 @@
s = strzone(s);
- centerprint(pl, s);
+ centermsg_setallfor(pl, s);
//sprint(pl, s);
strunzone(s);
@@ -1048,6 +1048,7 @@
if(selected.deadflag == DEAD_NO)
Damage(selected, selected, selected, 100000, DEATH_AUTOTEAMCHANGE, selected.origin, '0 0 0');
+ /*
m = "You have been moved into a different team to improve team balance\nYou are now on: ";
if (selected.team == 5)
m = strcat(m, "^1Red Team");
@@ -1058,6 +1059,7 @@
else if (selected.team == 13)
m = strcat(m, "^3Yellow Team");
centerprint(selected, m);
+ */
}
// part of g_balance_teams_force
Modified: trunk/data/qcsrc/server/w_nex.qc
===================================================================
--- trunk/data/qcsrc/server/w_nex.qc 2006-06-28 09:00:24 UTC (rev 1686)
+++ trunk/data/qcsrc/server/w_nex.qc 2006-06-28 17:31:53 UTC (rev 1687)
@@ -67,67 +67,68 @@
{
if (self.health == 5)
{
- centerprint(self, "you're dead now...\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "you're dead now...");
Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/terminated.ogg\n");
}
if (self.health == 10)
{
- centerprint(self, "^11^7 second left to find some ammo\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "^11^7 second left to find some ammo");
Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/1.ogg\n");
}
if (self.health == 20)
{
- centerprint(self, "^12^7 seconds left to find some ammo\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "^12^7 seconds left to find some ammo");
Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/2.ogg\n");
}
if (self.health == 30)
{
- centerprint(self, "^13^7 seconds left to find some ammo\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "^13^7 seconds left to find some ammo");
Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/3.ogg\n");
}
if (self.health == 40)
{
- centerprint(self, "^14^7 seconds left to find some ammo\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "^14^7 seconds left to find some ammo");
Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/4.ogg\n");
}
if (self.health == 50)
{
- centerprint(self, "^15^7 seconds left to find some ammo\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "^15^7 seconds left to find some ammo");
Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/5.ogg\n");
}
if (self.health == 60)
{
- centerprint(self, "^36^7 seconds left to find some ammo\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "^36^7 seconds left to find some ammo");
Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/6.ogg\n");
}
if (self.health == 70)
{
- centerprint(self, "^37^7 seconds left to find some ammo\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "^37^7 seconds left to find some ammo");
Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/7.ogg\n");
}
if (self.health == 80)
{
- centerprint(self, "^38^7 seconds left to find some ammo\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "^38^7 seconds left to find some ammo");
Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/8.ogg\n");
}
if (self.health == 90)
{
- centerprint(self, "^39^7 seconds left to find some ammo\n");
+ centermsg_set(CENTERMSG_MINSTAGIB, "^39^7 seconds left to find some ammo");
Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/9.ogg\n");
}
if (self.health == 100)
{
- centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
+ centermsg_set(CENTERMSG_MINSTAGIB, "get some ammo or");
+ centermsg_set(CENTERMSG_MINSTAGIB2, "you'll be dead in ^310^7 seconds...");
Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
stuffcmd(self, "play2 announcer/robotic/10.ogg\n");
}
More information about the nexuiz-commits
mailing list