]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Split projectiles and scores out of constants.qh and remove lib definitions from...
authorMario <mario@smbclan.net>
Thu, 13 Jul 2017 02:12:43 +0000 (12:12 +1000)
committerMario <mario@smbclan.net>
Thu, 13 Jul 2017 02:12:43 +0000 (12:12 +1000)
15 files changed:
qcsrc/client/hud/hud.qh
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/main.qc
qcsrc/common/constants.qh
qcsrc/common/scores.qh [new file with mode: 0644]
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/projectiles.qh [new file with mode: 0644]
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/gamemode.qh
qcsrc/server/scores.qc
qcsrc/server/scores.qh

index 8eaef9068c3bb4f2e64abe72d136544e22773867..1418dff830e28379454380c5a848c056eac51766 100644 (file)
@@ -1,6 +1,7 @@
 #pragma once
 
 #include <common/weapons/_all.qh>
+#include <common/scores.qh>
 
 void Hud_Dynamic_Frame();
 
index 065e632f19313ac532db6214bc0dc9e7b96ab7c9..e8464cc147cb5d92176dfd6d71f6b923f286eb29 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <common/mapinfo.qh>
 #include <common/ent_cs.qh>
+#include <common/scores.qh>
 #include <server/mutators/mutator/gamemode_ctf.qh> // TODO: remove
 
 // Mod icons (#10)
index 24be15432d12f18e5d6766d01533f96bf7940bab..2f0f9909ce2f8188bb93c7c091f900f64b9bb5df 100644 (file)
@@ -3,6 +3,7 @@
 #include "scoreboard.qh"
 #include <common/ent_cs.qh>
 #include <common/mapinfo.qh>
+#include <common/scores.qh>
 
 // Score (#7)
 
index e6e5f36495c79f90c23356f41737c48c8190f4b8..3872197c7b9940c6c94bfaa96c420ea63e28c824 100644 (file)
@@ -6,6 +6,7 @@
 #include <common/net_linked.qh>
 #include <common/mapinfo.qh>
 #include <common/minigames/cl_minigames.qh>
+#include <common/scores.qh>
 #include <common/stats.qh>
 #include <common/teams.qh>
 
index 87f3a1bb4afff6f94c43b6df8a7d32c76193b065..bf82ccb3425840d2b82409c12bf23bf001dbd66f 100644 (file)
@@ -17,6 +17,7 @@
 #include <common/minigames/cl_minigames_hud.qh>
 #include <common/net_linked.qh>
 #include <common/net_notice.qh>
+#include <common/scores.qh>
 #include <common/triggers/include.qh>
 #include <common/vehicles/all.qh>
 #include <lib/csqcmodel/cl_model.qh>
index 98710d25b8d6f0e5ad9ff1141e9692f9ecd19a40..6fd6fe9c7e97233023d7a530a812462140659e8e 100644 (file)
@@ -34,194 +34,8 @@ const int HUD_BUMBLEBEE_GUN = 25;
 // # of maps, I'll use arrays for them :P
 const int MAPVOTE_COUNT = 30;
 
-/**
- * Lower scores are better (e.g. suicides)
- */
-const int SFL_LOWER_IS_BETTER = BIT(0);
-
-/**
- * Don't show zero values as scores
- */
-const int SFL_HIDE_ZERO = BIT(1);
-
-/**
- * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
- */
-const int SFL_ALLOW_HIDE = BIT(4);
-
-/**
- * Display as a rank (with st, nd, rd, th suffix)
- */
-const int SFL_RANK = BIT(5);
-
-/**
- * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
- */
-const int SFL_TIME = BIT(6);
-
-// not an extra constant yet
-#define SFL_ZERO_IS_WORST SFL_TIME
-
-/**
- * Scoring priority (NOTE: PRIMARY is used for fraglimit)
- */
-const int SFL_SORT_PRIO_SECONDARY = 4;
-const int SFL_SORT_PRIO_PRIMARY = 8;
-const int SFL_SORT_PRIO_MASK = 12;
-
-/*
- * Score indices
- */
-
-#ifdef GAMEQC
-
-#define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER )
-#define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) )
-
-
-#define MAX_SCORE 64
-
-#define REGISTER_SP(id) REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField))
-REGISTRY(Scores, MAX_SCORE);
-#define Scores_from(i) _Scores_from(i, NULL)
-REGISTER_REGISTRY(Scores)
-REGISTRY_SORT(Scores);
-REGISTRY_CHECK(Scores);
-STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); }
-
-USING(PlayerScoreField, entity);
-.int _scores[MAX_SCORE];
-.string m_name;
-.int m_flags;
-
-#define scores(this) _scores[(this).m_id]
-#define scores_label(this) ((this).m_name)
-#define scores_flags(this) ((this).m_flags)
-
-REGISTER_SP(END);
-
-REGISTER_SP(PING);
-REGISTER_SP(PL);
-REGISTER_SP(NAME);
-REGISTER_SP(KDRATIO);
-REGISTER_SP(SUM);
-
-REGISTER_SP(SEPARATOR);
-
-REGISTER_SP(SCORE);
-
-REGISTER_SP(DMG);
-REGISTER_SP(DMGTAKEN);
-
-REGISTER_SP(KILLS);
-REGISTER_SP(DEATHS);
-REGISTER_SP(SUICIDES);
-REGISTER_SP(FRAGS);
-
-REGISTER_SP(ELO);
-
-// TODO: move to common mutators
-
-REGISTER_SP(RACE_TIME);
-REGISTER_SP(RACE_LAPS);
-REGISTER_SP(RACE_FASTEST);
-
-//REGISTER_SP(CTS_TIME);
-//REGISTER_SP(CTS_LAPS);
-//REGISTER_SP(CTS_FASTEST);
-
-REGISTER_SP(ASSAULT_OBJECTIVES);
-
-REGISTER_SP(CTF_PICKUPS);
-REGISTER_SP(CTF_FCKILLS);
-REGISTER_SP(CTF_RETURNS);
-REGISTER_SP(CTF_CAPS);
-REGISTER_SP(CTF_CAPTIME);
-REGISTER_SP(CTF_DROPS);
-
-REGISTER_SP(DOM_TAKES);
-REGISTER_SP(DOM_TICKS);
-
-REGISTER_SP(FREEZETAG_REVIVALS);
-
-REGISTER_SP(KEEPAWAY_PICKUPS);
-REGISTER_SP(KEEPAWAY_BCTIME);
-REGISTER_SP(KEEPAWAY_CARRIERKILLS);
-
-REGISTER_SP(KH_PICKUPS);
-REGISTER_SP(KH_CAPS);
-REGISTER_SP(KH_KCKILLS);
-REGISTER_SP(KH_PUSHES);
-REGISTER_SP(KH_DESTROYS);
-REGISTER_SP(KH_LOSSES);
-
-REGISTER_SP(LMS_RANK);
-REGISTER_SP(LMS_LIVES);
-
-REGISTER_SP(NEXBALL_GOALS);
-REGISTER_SP(NEXBALL_FAULTS);
-
-REGISTER_SP(ONS_TAKES);
-REGISTER_SP(ONS_CAPS);
-
-#define MAX_TEAMSCORE 2
-USING(ScoreTeam, string);
-.int _teamscores[MAX_TEAMSCORE];
-#define teamscores(i) _teamscores[i]
-string _teamscores_label[MAX_TEAMSCORE];
-#define teamscores_label(i) _teamscores_label[i]
-int _teamscores_flags[MAX_TEAMSCORE];
-#define teamscores_flags(i) _teamscores_flags[i]
-
-#endif
-
-const int ST_SCORE = 0;
-
 // game mode specific indices are not in common/, but in server/scores_rules.qc!
 
-// WEAPONTODO: move this into separate/new projectile handling code // this sets sounds and other properties of the projectiles in csqc
-const int PROJECTILE_ELECTRO = 1;
-const int PROJECTILE_ROCKET = 2;
-const int PROJECTILE_TAG = 3;
-const int PROJECTILE_CRYLINK = 5;
-const int PROJECTILE_ELECTRO_BEAM = 6;
-const int PROJECTILE_GRENADE = 7;
-const int PROJECTILE_GRENADE_BOUNCING = 8;
-const int PROJECTILE_MINE = 9;
-const int PROJECTILE_BLASTER = 10;
-const int PROJECTILE_HLAC = 11;
-const int PROJECTILE_SEEKER = 12;
-const int PROJECTILE_FLAC = 13;
-const int PROJECTILE_PORTO_RED = 14;
-const int PROJECTILE_PORTO_BLUE = 15;
-const int PROJECTILE_HOOKBOMB = 16;
-const int PROJECTILE_HAGAR = 17;
-const int PROJECTILE_HAGAR_BOUNCING = 18;
-const int PROJECTILE_CRYLINK_BOUNCING = 20;
-const int PROJECTILE_FIREBALL = 21;
-const int PROJECTILE_FIREMINE = 22;
-
-const int PROJECTILE_RAPTORCANNON = 24;
-const int PROJECTILE_RAPTORBOMB = 25;
-const int PROJECTILE_RAPTORBOMBLET = 26;
-const int PROJECTILE_SPIDERROCKET = 27;
-const int PROJECTILE_WAKIROCKET = 28;
-const int PROJECTILE_WAKICANNON = 29;
-
-const int PROJECTILE_BUMBLE_GUN = 30;
-const int PROJECTILE_BUMBLE_BEAM = 31;
-
-const int PROJECTILE_MAGE_SPIKE = 32;
-const int PROJECTILE_SHAMBLER_LIGHTNING = 33;
-
-const int PROJECTILE_ROCKETMINSTA_LASER = 34;
-
-const int PROJECTILE_ARC_BOLT = 35;
-
-// projectile IDs 40-50 reserved
-
-const int PROJECTILE_RPC = 60;
-
 const int SPECIES_HUMAN = 0;
 const int SPECIES_ROBOT_SOLID = 1;
 const int SPECIES_ALIEN = 2;
diff --git a/qcsrc/common/scores.qh b/qcsrc/common/scores.qh
new file mode 100644 (file)
index 0000000..0451fd9
--- /dev/null
@@ -0,0 +1,144 @@
+#pragma once
+
+#define MAX_SCORE 64
+
+#define REGISTER_SP(id) REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField))
+REGISTRY(Scores, MAX_SCORE);
+#define Scores_from(i) _Scores_from(i, NULL)
+REGISTER_REGISTRY(Scores)
+REGISTRY_SORT(Scores);
+REGISTRY_CHECK(Scores);
+STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); }
+
+/*
+ * Score indices
+ */
+
+#ifdef GAMEQC
+REGISTER_SP(END);
+
+REGISTER_SP(PING);
+REGISTER_SP(PL);
+REGISTER_SP(NAME);
+REGISTER_SP(KDRATIO);
+REGISTER_SP(SUM);
+
+REGISTER_SP(SEPARATOR);
+
+REGISTER_SP(SCORE);
+
+REGISTER_SP(DMG);
+REGISTER_SP(DMGTAKEN);
+
+REGISTER_SP(KILLS);
+REGISTER_SP(DEATHS);
+REGISTER_SP(SUICIDES);
+REGISTER_SP(FRAGS);
+
+REGISTER_SP(ELO);
+
+// TODO: move to common mutators
+
+REGISTER_SP(RACE_TIME);
+REGISTER_SP(RACE_LAPS);
+REGISTER_SP(RACE_FASTEST);
+
+//REGISTER_SP(CTS_TIME);
+//REGISTER_SP(CTS_LAPS);
+//REGISTER_SP(CTS_FASTEST);
+
+REGISTER_SP(ASSAULT_OBJECTIVES);
+
+REGISTER_SP(CTF_PICKUPS);
+REGISTER_SP(CTF_FCKILLS);
+REGISTER_SP(CTF_RETURNS);
+REGISTER_SP(CTF_CAPS);
+REGISTER_SP(CTF_CAPTIME);
+REGISTER_SP(CTF_DROPS);
+
+REGISTER_SP(DOM_TAKES);
+REGISTER_SP(DOM_TICKS);
+
+REGISTER_SP(FREEZETAG_REVIVALS);
+
+REGISTER_SP(KEEPAWAY_PICKUPS);
+REGISTER_SP(KEEPAWAY_BCTIME);
+REGISTER_SP(KEEPAWAY_CARRIERKILLS);
+
+REGISTER_SP(KH_PICKUPS);
+REGISTER_SP(KH_CAPS);
+REGISTER_SP(KH_KCKILLS);
+REGISTER_SP(KH_PUSHES);
+REGISTER_SP(KH_DESTROYS);
+REGISTER_SP(KH_LOSSES);
+
+REGISTER_SP(LMS_RANK);
+REGISTER_SP(LMS_LIVES);
+
+REGISTER_SP(NEXBALL_GOALS);
+REGISTER_SP(NEXBALL_FAULTS);
+
+REGISTER_SP(ONS_TAKES);
+REGISTER_SP(ONS_CAPS);
+#endif
+
+
+// the stuff you don't need to see
+
+/**
+ * Lower scores are better (e.g. suicides)
+ */
+const int SFL_LOWER_IS_BETTER = BIT(0);
+
+/**
+ * Don't show zero values as scores
+ */
+const int SFL_HIDE_ZERO = BIT(1);
+
+/**
+ * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
+ */
+const int SFL_ALLOW_HIDE = BIT(4);
+
+/**
+ * Display as a rank (with st, nd, rd, th suffix)
+ */
+const int SFL_RANK = BIT(5);
+
+/**
+ * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
+ */
+const int SFL_TIME = BIT(6);
+
+// not an extra constant yet
+#define SFL_ZERO_IS_WORST SFL_TIME
+
+/**
+ * Scoring priority (NOTE: PRIMARY is used for fraglimit)
+ */
+const int SFL_SORT_PRIO_SECONDARY = 4;
+const int SFL_SORT_PRIO_PRIMARY = 8;
+const int SFL_SORT_PRIO_MASK = 12;
+
+#define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER )
+#define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) )
+
+USING(PlayerScoreField, entity);
+.int _scores[MAX_SCORE];
+.string m_name;
+.int m_flags;
+
+#define scores(this) _scores[(this).m_id]
+#define scores_label(this) ((this).m_name)
+#define scores_flags(this) ((this).m_flags)
+
+#define MAX_TEAMSCORE 2
+USING(ScoreTeam, string);
+.int _teamscores[MAX_TEAMSCORE];
+#define teamscores(i) _teamscores[i]
+string _teamscores_label[MAX_TEAMSCORE];
+#define teamscores_label(i) _teamscores_label[i]
+int _teamscores_flags[MAX_TEAMSCORE];
+#define teamscores_flags(i) _teamscores_flags[i]
+
+const int ST_SCORE = 0;
index 91d68f1ba1313cb0a7eb543dd7b6406fafd26d7e..6340c007ad19cc3c62d947f61233859bb0026036 100644 (file)
@@ -1,20 +1,19 @@
 #include "util.qh"
 
 #if defined(CSQC)
-    #include "../client/defs.qh"
     #include "constants.qh"
        #include "../client/mutators/events.qh"
     #include "mapinfo.qh"
     #include "notifications/all.qh"
+       #include "scores.qh"
     #include <common/deathtypes/all.qh>
 #elif defined(MENUQC)
 #elif defined(SVQC)
     #include "constants.qh"
-    #include "../server/autocvars.qh"
-    #include "../server/defs.qh"
        #include "../server/mutators/events.qh"
     #include "notifications/all.qh"
     #include <common/deathtypes/all.qh>
+       #include "scores.qh"
     #include "mapinfo.qh"
 #endif
 
@@ -183,6 +182,7 @@ void depthfirst(entity start, .entity up, .entity downleft, .entity right, void(
        }
 }
 
+#ifdef GAMEQC
 string ScoreString(int pFlags, float pValue)
 {
        string valstr;
@@ -214,6 +214,7 @@ string ScoreString(int pFlags, float pValue)
 
        return valstr;
 }
+#endif
 
 // compressed vector format:
 // like MD3, just even shorter
index da86bf22ea63eccf1c7a408c815bb2d049e7f6ad..d74275a9c970bdc990be1575665df09d11868276 100644 (file)
@@ -1,10 +1,12 @@
 #pragma once
 
 #ifdef GAMEQC
-
 vector real_origin(entity ent);
 #endif
 
+.string netname;
+.string message;
+
 IntrusiveList g_saved_cvars;
 STATIC_INIT(g_saved_cvars) { g_saved_cvars = IL_NEW(); }
 
@@ -25,38 +27,11 @@ string draw_UseSkinFor(string pic);
 // for each element, funcPre is called first, then funcPre and funcPost for all its children, and funcPost last
 void depthfirst(entity start, .entity up, .entity downleft, .entity right, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass);
 
-float median(float a, float b, float c);
-
-// converts a number to a string with the indicated number of decimals
-string ftos_decimals(float number, float decimals);
-string ftos_mindecimals(float number);
-
-bool fexists(string f);
-
-// unzone the string, and return it as tempstring. Safe to be called on string_null
-string fstrunzone(string s);
-
-// database (NOTE: keys are case sensitive)
-void db_save(int db, string filename);
-void db_dump(int db, string pFilename);
-int db_create();
-int db_load(string filename);
-void db_close(int db);
-string db_get(int db, string key);
-void db_put(int db, string key, string value);
-
-// stringbuffer loading/saving
-int buf_load(string filename);
-void buf_save(int buf, string filename);
-
 // adding just 0.4 for race times so it rounds down in the .5 case (matching the timer display)
 // FIXME it doesn't round properly
 #define TIME_TO_NTHS(t,n) floor((t) * (n) + 0.4)
-string format_time(float seconds);
-string mmsss(float t);
-string mmssss(float t);
 
-const float TIME_DECIMALS = 2;
+const int TIME_DECIMALS = 2;
 const float TIME_FACTOR = 100;
 #define TIME_ENCODED_TOSTRING(n) mmssss(n)
 #define RACE_RECORD "/race100record/"
@@ -65,7 +40,9 @@ const float TIME_FACTOR = 100;
 #define TIME_ENCODE(t) TIME_TO_NTHS(t, TIME_FACTOR)
 #define TIME_DECODE(n) ((n) / TIME_FACTOR)
 
+#ifdef GAMEQC
 string ScoreString(float vflags, float value);
+#endif
 
 vector decompressShortVector(float data);
 float compressShortVector(vector vec);
@@ -78,8 +55,6 @@ string fixPriorityList(string pl, float from, float to, float subtract, float co
 string mapPriorityList(string order, string(string) mapfunc);
 string swapInPriorityList(string order, float i, float j);
 
-float cvar_value_issafe(string s);
-
 float cvar_settemp(string pKey, string pValue);
 float cvar_settemp_restore();
 
@@ -102,12 +77,6 @@ vector mi_pictexcoord3; // texcoords of the image corners (after transforming, t
 void get_mi_min_max_texcoords(float mode);
 #endif
 
-float almost_equals(float a, float b);
-float almost_in_bounds(float a, float b, float c);
-
-float boxesoverlap(vector m1, vector m2, vector m3, vector m4);
-float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs);
-
 USING(textLengthUpToWidth_widthFunction_t, float(string s, vector size));
 USING(textLengthUpToLength_lenFunction_t, float(string s));
 float textLengthUpToWidth(string theText, float maxWidth, vector size, textLengthUpToWidth_widthFunction_t tw);
@@ -121,17 +90,6 @@ string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw);
 
 float isGametypeInFilter(entity gt, float tp, float ts, string pattern);
 
-string swapwords(string str, float i, float j);
-string shufflewords(string str);
-
-string substring_range(string s, float b, float e);
-
-vector solve_quadratic(float a, float b, float c);
-// solution 1 -> x
-// solution 2 -> y
-// z = 1 if a real solution exists, 0 if not
-// if no real solution exists, x contains the real part and y the imaginary part of the complex solutions x+iy and x-iy
-
 vector solve_shotdirection(vector myorg, vector myvel, vector eorg, vector evel, float spd, float newton_style);
 vector get_shotvelocity(vector myvel, vector mydir, float spd, float newton_style, float mi, float ma);
 
@@ -150,11 +108,6 @@ vector healtharmor_applydamage(float a, float armorblock, int deathtype, float d
 
 string getcurrentmod();
 
-float float2range11(float f);
-float float2range01(float f);
-
-float gsl_ran_gaussian(float sigma);
-
 float matchacl(string acl, string str); // matches str against ACL acl (with entries +foo*, +foo, +*foo, +*foo*, and same with - for forbidding)
 
 string get_model_datafilename(string mod, float skn, string fil); // skin -1 will return wildcard, mod string_null will also put wildcard there
@@ -176,14 +129,6 @@ float get_model_parameters_fixbone;
 string get_model_parameters_desc;
 float get_model_parameters(string mod, float skn); // call with string_null to clear; skin -1 means mod is the filename of the txt file and is to be split
 
-#ifdef GAMEQC
-vector NearestPointOnBox(entity box, vector org);
-#endif
-
-float vercmp(string v1, string v2);
-
-float u8_strsize(string s);
-
 // x-encoding (encoding as zero length invisible string)
 // encodes approx. 14 bits into 5 bytes of color code string
 const float XENCODE_MAX = 21295; // 2*22*22*22-1
@@ -195,8 +140,6 @@ float xdecode(string s);
 string strtolower(string s);
 #endif
 
-string MakeConsoleSafe(string input);
-
 // generic shutdown handler
 void Shutdown();
 
@@ -206,29 +149,11 @@ void Skeleton_SetBones(entity e);
 // loops through the tags of model v using counter tagnum
 #define FOR_EACH_TAG(v) float tagnum; Skeleton_SetBones(v); for(tagnum = 0; tagnum < v.skeleton_bones; tagnum++, gettaginfo(v, tagnum))
 #endif
-#ifdef SVQC
-void WriteApproxPastTime(float dst, float t);
-#endif
-#ifdef CSQC
-float ReadApproxPastTime();
-#endif
 
 // execute-stuff-next-frame subsystem
 void execute_next_frame();
 void queue_to_execute_next_frame(string s);
 
-// a function f with:
-// f(0) = 0
-// f(1) = 1
-// f'(0) = startspeedfactor
-// f'(1) = endspeedfactor
-float cubic_speedfunc(float startspeedfactor, float endspeedfactor, float spd);
-
-// checks whether f'(x) = 0 anywhere from 0 to 1
-// because if this is the case, the function is not usable for platforms
-// as it may exceed 0..1 bounds, or go in reverse
-float cubic_speedfunc_is_sane(float startspeedfactor, float endspeedfactor);
-
 USING(findNextEntityNearFunction_t, entity(entity cur, entity near, entity pass));
 USING(isConnectedFunction_t, float(entity a, entity b, entity pass));
 void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t nxt, isConnectedFunction_t iscon, entity pass);
@@ -240,10 +165,6 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
 #define fprintf(file, ...) fputs(file, sprintf(__VA_ARGS__))
 #define bprintf(...) bprint(sprintf(__VA_ARGS__))
 
-#ifdef GAMEQC
-string CCR(string input);
-#endif
-
 #ifdef GAMEQC
        #ifdef CSQC
                #define GENTLE (autocvar_cl_gentle || autocvar_cl_gentle_messages)
@@ -258,13 +179,13 @@ vector animfixfps(entity e, vector a, vector b);
 #endif
 
 #ifdef GAMEQC
-const float CNT_NORMAL = 1;
-const float CNT_GAMESTART = 2;
-const float CNT_IDLE = 3;
-const float CNT_KILL = 4;
-const float CNT_RESPAWN = 5;
-const float CNT_ROUNDSTART = 6;
-entity Announcer_PickNumber(float type, float num);
+const int CNT_NORMAL = 1;
+const int CNT_GAMESTART = 2;
+const int CNT_IDLE = 3;
+const int CNT_KILL = 4;
+const int CNT_RESPAWN = 5;
+const int CNT_ROUNDSTART = 6;
+entity Announcer_PickNumber(int type, int num);
 #endif
 
 #ifdef GAMEQC
@@ -272,10 +193,6 @@ int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents);
 int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents);
 #endif
 
-// Quadratic splines (bezier)
-vector bezier_quadratic_getpoint(vector a, vector p, vector b, float t);
-vector bezier_quadratic_getderivative(vector a, vector p, vector b, float t);
-
 #define APPEND_TO_STRING(list,sep,add) ((list) = (((list) != "") ? strcat(list, sep, add) : (add)))
 
 // Returns the correct difference between two always increasing numbers
index 22d0e294eb1df06fadf46de4a9558bb7e7592345..83fe0c19673ccc513463f50eb13145c90a8d5f1b 100644 (file)
@@ -20,6 +20,7 @@ WepSet ReadWepSet();
 
 #ifdef GAMEQC
 #include "calculations.qh"
+#include "projectiles.qh"
 #include <common/models/all.qh>
 #endif
 
diff --git a/qcsrc/common/weapons/projectiles.qh b/qcsrc/common/weapons/projectiles.qh
new file mode 100644 (file)
index 0000000..73cd00d
--- /dev/null
@@ -0,0 +1,43 @@
+#pragma once
+
+const int PROJECTILE_ELECTRO = 1;
+const int PROJECTILE_ROCKET = 2;
+const int PROJECTILE_TAG = 3;
+const int PROJECTILE_CRYLINK = 5;
+const int PROJECTILE_ELECTRO_BEAM = 6;
+const int PROJECTILE_GRENADE = 7;
+const int PROJECTILE_GRENADE_BOUNCING = 8;
+const int PROJECTILE_MINE = 9;
+const int PROJECTILE_BLASTER = 10;
+const int PROJECTILE_HLAC = 11;
+const int PROJECTILE_SEEKER = 12;
+const int PROJECTILE_FLAC = 13;
+const int PROJECTILE_PORTO_RED = 14;
+const int PROJECTILE_PORTO_BLUE = 15;
+const int PROJECTILE_HOOKBOMB = 16;
+const int PROJECTILE_HAGAR = 17;
+const int PROJECTILE_HAGAR_BOUNCING = 18;
+const int PROJECTILE_CRYLINK_BOUNCING = 20;
+const int PROJECTILE_FIREBALL = 21;
+const int PROJECTILE_FIREMINE = 22;
+
+const int PROJECTILE_RAPTORCANNON = 24;
+const int PROJECTILE_RAPTORBOMB = 25;
+const int PROJECTILE_RAPTORBOMBLET = 26;
+const int PROJECTILE_SPIDERROCKET = 27;
+const int PROJECTILE_WAKIROCKET = 28;
+const int PROJECTILE_WAKICANNON = 29;
+
+const int PROJECTILE_BUMBLE_GUN = 30;
+const int PROJECTILE_BUMBLE_BEAM = 31;
+
+const int PROJECTILE_MAGE_SPIKE = 32;
+const int PROJECTILE_SHAMBLER_LIGHTNING = 33;
+
+const int PROJECTILE_ROCKETMINSTA_LASER = 34;
+
+const int PROJECTILE_ARC_BOLT = 35;
+
+// projectile IDs 40-50 reserved
+
+const int PROJECTILE_RPC = 60;
index 958566ac4a63bf063d3da32186085bd2bf81c20b..bc09d7a8cd9d92d3da6340807e8a09fd13b384cc 100644 (file)
@@ -801,7 +801,7 @@ MUTATOR_HOOKABLE(CheckRules_World, EV_CheckRules_World);
 MUTATOR_HOOKABLE(WantWeapon, EV_WantWeapon);
 
 #define EV_AddPlayerScore(i, o) \
-    /** score field */  i(PlayerScoreField, MUTATOR_ARGV_0_entity) \
+    /** score field */  i(entity, MUTATOR_ARGV_0_entity) \
     /** score */        i(float, MUTATOR_ARGV_1_float) \
     /**/                o(float, MUTATOR_ARGV_1_float) \
     /** player */       i(entity, MUTATOR_ARGV_2_entity) \
index 9a473affdf8bc1f8105cdbc9cef20fca5d8a1cea..05e1d3d3890474e7871fb4299642420b31b23066 100644 (file)
@@ -15,6 +15,7 @@
 #include <lib/warpzone/util_server.qh>
 #include <lib/warpzone/server.qh>
 #include <common/constants.qh>
+#include <common/scores.qh>
 #include <common/stats.qh>
 #include <common/teams.qh>
 #include <common/util.qh>
index 7854b875e040ad08560926b2e4c67ef2d094cb9c..6bfb09cc97a2978be06048928dbf4366a675a6c2 100644 (file)
@@ -5,6 +5,7 @@
 #include <common/net_linked.qh>
 #include "../common/playerstats.qh"
 #include "../common/teams.qh"
+#include <common/scores.qh>
 
 .entity scorekeeper;
 entity teamscorekeepers[16];
index 2f9c0787239dbff7d6b7452e840b3de17b2e3860..fc4c19602727a34b54454836aa720c9294e8a5e4 100644 (file)
@@ -1,6 +1,6 @@
 #pragma once
 
-#include <common/constants.qh>
+#include <common/scores.qh>
 
 entity scores_initialized; // non-NULL when scores labels/rules have been set
 .float scoreboard_pos;