X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qh;h=9a4a8b95d759579f9f3902ffc9165c8246fcf987;hb=546842f7e5a63b11a9b862dbf1709318bb97689b;hp=fc8bf9c8f72b8e0d0d894721b8f5cbb6270963d3;hpb=f203a8239ab58e776da8df7bce46be73d2d655a4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_damage.qh b/qcsrc/server/g_damage.qh index fc8bf9c8f..efe6b2e1b 100644 --- a/qcsrc/server/g_damage.qh +++ b/qcsrc/server/g_damage.qh @@ -1,28 +1,29 @@ -#ifndef G_DAMAGE_H -#define G_DAMAGE_H +#pragma once #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) - #include "../lib/warpzone/common.qh" - #include "../common/constants.qh" - #include "../common/teams.qh" - #include "../common/util.qh" - #include "../common/weapons/all.qh" + #include + #include + #include + #include + #include + #include + #include #include "weapons/accuracy.qh" #include "weapons/csqcprojectile.qh" #include "weapons/selection.qh" - #include "t_items.qh" + #include #include "autocvars.qh" #include "constants.qh" #include "defs.qh" - #include "../common/notifications.qh" - #include "../common/deathtypes/all.qh" - #include "mutators/all.qh" - #include "../common/turrets/sv_turrets.qh" - #include "../common/vehicles/all.qh" - #include "../lib/csqcmodel/sv_model.qh" - #include "../common/playerstats.qh" + #include + #include + #include + #include + #include + #include + #include #include "g_hook.qh" #include "scores.qh" #include "spawnpoints.qh" @@ -48,17 +49,16 @@ float damage_gooddamage; .float teamkill_soundtime; .entity teamkill_soundsource; .entity pusher; -.float istypefrag; +.bool istypefrag; .float taunt_soundtime; float IsFlying(entity a); -void UpdateFrags(entity player, float f); +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(entity e, Weapon w); -entity GiveFrags_randomweapons; -void GiveFrags (entity attacker, entity targ, float f, int deathtype); +void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity); +void GiveFrags (entity attacker, entity targ, float f, int deathtype, .entity weaponentity); string AppendItemcodes(string s, entity player); @@ -79,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(); +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); +void Unfreeze(entity targ, bool reset_health); -// 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 RES_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; @@ -107,7 +107,7 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e .float fire_hitsound; .entity fire_burner; -void fireburner_think(); +void fireburner_think(entity this); float Fire_IsBurning(entity e); @@ -116,6 +116,3 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt); void Fire_ApplyDamage(entity e); void Fire_ApplyEffect(entity e); - -void fireburner_think(); -#endif