--- /dev/null
+- General:
+ 0) Delete more code we don't need.
+ 1) Remove unused functions.
+ 2) Remove dumb global variables.
+ 3) Reformat to Chad coding style.
+ 4) Remove MD3 and IQM models.
+ 5) Use TGA instead of PNG?
+ 6) Optimize for speed instead of size?
+- Frag messages:
+ 0) Clean up and move to a function.
+ 1) Make it a dynamic array?
+ 2) Colour the names?
+ 3) Add ping, accuracy and more?
+- Balance:
+ 0) Playtest current weapons and armours.
+ 1) Playtest the bots (old AI).
+- HUD:
+ 0) Add accuracy, frags, deaths, suicides and more.
+ 1) Add accuracy per weapon, with icons.
+ 2) Add player movement speed.
+- Scoreboard:
+ 0) Add accuracy per client?
+ 1) Add frags, deaths, suicides and more.
VARP(teamcolorfrags, 0, 1, 1);
+ /// xolatile: HUD frag messages
+
+#define fragmessageduration (2000)
+
+ string hudfragger, hudfragged;
+ int hudfraggun, hudfragmillis;
+
+ void sethudfragdata(char *fragger, char *fragged, int gunid)
+ {
+ copystring(hudfragger, fragger ? fragger : "");
+ copystring(hudfragged, fragged);
+ hudfraggun = gunid;
+ hudfragmillis = lastmillis;
+ }
+
void killed(fpsent *d, fpsent *actor)
{
if(d->state==CS_EDITING)
}
else
{
- if(d==player1) conoutf(contype, "\f2%s got fragged by %s", dname, aname);
- else conoutf(contype, "\f2%s fragged %s", aname, dname);
+ if(d==player1)
+ {
+ conoutf(contype, "\f2%s got fragged by %s", dname, aname);
+ sethudfragdata(actor->name, d->name, actor->gunselect);
+ }
+ else
+ {
+ conoutf(contype, "\f2%s fragged %s", aname, dname);
+ sethudfragdata(actor->name, d->name, actor->gunselect);
+ }
}
deathstate(d);
- ai::killed(d, actor);
+ ai::killed(d, actor);
}
void timeupdate(int secs)
if(!m_edit)
{
- if(gameclock) drawgameclock(w, h);
- if(hudscore) drawhudscore(w, h);
+ if(gameclock) drawgameclock(w, h);
+ if(hudscore) drawhudscore(w, h);
+ }
+
+ /// Frag message.
+
+ if(hudfragmillis+fragmessageduration > lastmillis)
+ {
+ vec2 center = vec2(0.5*w, 0.2*h);
+ float width = 0, height = 0;
+ pushhudmatrix();
+ hudmatrix.scale(0.8, 0.8, 1);
+ flushhudmatrix();
+ draw_textf("%s", center.x, center.y, hudfragger);
+ text_boundsf(hudfragger, width, height);
+ drawicon(HICON_FIST+hudfraggun, center.x+width, center.y, height);
+ draw_textf("%s", center.x+width+height, center.y, hudfragged);
+ pophudmatrix();
}
}