X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qh;h=0af110c9e890f29925db0803eedcd8d29f4eba04;hb=ffdfacf539f951ec0ad8bac7fd1a9832ca6603ef;hp=9a4a8b95d759579f9f3902ffc9165c8246fcf987;hpb=9e84ff8daa3826ef32e2891a7c5224a7cd436d23;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_damage.qh b/qcsrc/server/g_damage.qh index 9a4a8b95d..0af110c9e 100644 --- a/qcsrc/server/g_damage.qh +++ b/qcsrc/server/g_damage.qh @@ -3,6 +3,8 @@ #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) + #include + #include #include #include #include @@ -17,7 +19,7 @@ #include "defs.qh" #include #include - #include "mutators/_mod.qh" + #include #include #include #include @@ -56,8 +58,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,26 +79,26 @@ 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); -void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint); +void Freeze(entity targ, float freeze_time, int frozen_type, bool show_waypoint); 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); + +// Calls .event_heal on the target so that they can handle healing themselves +// a limit of RESOURCE_LIMIT_NONE should be handled by the entity as its max health (if applicable) +bool Heal(entity targ, entity inflictor, float amount, float limit); .float fire_damagepersec; .float fire_endtime;