]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qh
Add a note about DMG_NOWEP
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qh
index 9a4a8b95d759579f9f3902ffc9165c8246fcf987..54866348d44627f8336e083db6993c19672452fa 100644 (file)
@@ -3,6 +3,8 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
+    #include <server/defs.qh>
+    #include <server/miscfunctions.qh>
     #include <lib/warpzone/common.qh>
     #include <common/constants.qh>
     #include <common/teams.qh>
@@ -57,7 +59,7 @@ void UpdateFrags(entity player, int f);
 // NOTE: f=0 means still count as a (positive) kill, but count no frags for it
 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
 entity GiveFrags_randomweapons;
-void GiveFrags (entity attacker, entity targ, float f, int deathtype);
+void GiveFrags (entity attacker, entity targ, float f, int deathtype, .entity weaponentity);
 
 string AppendItemcodes(string s, entity player);
 
@@ -78,7 +80,7 @@ float Obituary_WeaponDeath(
        string s1, string s2, string s3,
        float f1, float f2);
 
-void Obituary(entity attacker, entity inflictor, entity targ, int deathtype);
+void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .entity weaponentity);
 
 void Ice_Think(entity this);
 
@@ -86,18 +88,14 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
 
 void Unfreeze (entity targ);
 
-// these are updated by each Damage call for use in button triggering and such
-entity damage_targ;
-entity damage_inflictor;
-entity damage_attacker;
-
-void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
+// NOTE: the .weaponentity parameter can be set to DMG_NOWEP if the attack wasn't caused by a weapon or player
+void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force);
 
 float RadiusDamage_running;
-float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, int deathtype, entity directhitentity);
+float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity);
        // Returns total damage applies to creatures
 
-float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, entity directhitentity);
+float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity);
 
 .float fire_damagepersec;
 .float fire_endtime;
@@ -115,3 +113,6 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt);
 void Fire_ApplyDamage(entity e);
 
 void Fire_ApplyEffect(entity e);
+
+// WEAPONTODO
+#define DMG_NOWEP (weaponentities[0])