]> git.xolatile.top Git - xolatile-badassbug.git/commitdiff
Simple frag messages and TODO...
authorxolatile <xolatile@proton.me>
Tue, 22 Jul 2025 11:10:23 +0000 (13:10 +0200)
committerxolatile <xolatile@proton.me>
Tue, 22 Jul 2025 11:10:23 +0000 (13:10 +0200)
TODO.md [new file with mode: 0644]
autoexec.cfg
src/fpsgame/fps.cpp

diff --git a/TODO.md b/TODO.md
new file mode 100644 (file)
index 0000000..c81eff7
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,23 @@
+- 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.
index d048bb0964a7423b85c9c63dc41d10ec58492850..466ad05c26cf18649abdb2661daf0e37cbc4712f 100755 (executable)
@@ -3,7 +3,9 @@
 
 name xolatile
 
-maxfps 60
+maxfps      60
+fov         120
+sensitivity 4.2
 
 bind e      [setweapon 1] // Shotgun.
 bind q      [setweapon 2] // Chaingun.
index 35a5d656724ba5429f96ff91f1bc7efedfbb617e..2f2986e0af35304be7b2ec2e2fd5104e3fd16575 100644 (file)
@@ -431,6 +431,21 @@ namespace game
 
     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)
@@ -470,11 +485,19 @@ namespace game
         }
         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)
@@ -1039,8 +1062,24 @@ namespace game
 
         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();
         }
     }