]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Increase the maximum number of mutators
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 70100db991cb6512b72dada67d18d539cff3e172..5cae69239ddfb084153e706e5867a8f91d460565 100644 (file)
@@ -10,7 +10,7 @@
 #include "weapons/accuracy.qh"
 #include "weapons/csqcprojectile.qh"
 #include "weapons/selection.qh"
-#include "../common/buffs.qh"
+#include "../common/buffs/all.qh"
 #include "../common/constants.qh"
 #include "../common/deathtypes.qh"
 #include "../common/notifications.qh"
@@ -22,8 +22,8 @@
 #include "../csqcmodellib/sv_model.qh"
 #include "../warpzonelib/common.qh"
 
-float Damage_DamageInfo_SendEntity(entity to, int sf)
-{SELFPARAM();
+bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf)
+{
        WriteByte(MSG_ENTITY, ENT_CLIENT_DAMAGEINFO);
        WriteShort(MSG_ENTITY, self.projectiledeathtype);
        WriteCoord(MSG_ENTITY, floor(self.origin.x));
@@ -265,7 +265,8 @@ float Obituary_WeaponDeath(
        if(death_weapon)
        {
                w_deathtype = deathtype;
-               int death_message = WEP_ACTION(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE));
+               Weapon w = get_weaponinfo(death_weapon);
+               int death_message = ((murder) ? w.wr_killmessage : w.wr_suicidemessage)(w);
                w_deathtype = false;
 
                if (death_message)
@@ -560,6 +561,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
        targ.revive_progress = ((frozen_type == 3) ? 1 : 0);
        targ.health = ((frozen_type == 3) ? targ_maxhealth : 1);
        targ.revive_speed = freeze_time;
+       self.bot_attack = false;
 
        entity ice, head;
        ice = spawn();
@@ -569,15 +571,14 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
        ice.think = Ice_Think;
        ice.nextthink = time;
        ice.frame = floor(random() * 21); // ice model has 20 different looking frames
-       setmodel(ice, "models/ice/ice.md3");
+       setmodel(ice, MDL_ICE);
        ice.alpha = 1;
        ice.colormod = Team_ColorRGB(targ.team);
        ice.glowmod = ice.colormod;
        targ.iceblock = ice;
        targ.revival_time = 0;
 
-       SELFCALL(ice, Ice_Think());
-       SELFCALL_DONE();
+       WITH(entity, self, ice, Ice_Think());
 
        RemoveGrapplingHook(targ);
 
@@ -592,6 +593,9 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
 
 void Unfreeze (entity targ)
 {
+       if(!targ.frozen)
+               return;
+
        if(targ.frozen && targ.frozen != 3) // only reset health if target was frozen
                targ.health = ((IS_PLAYER(targ)) ? start_health : targ.max_health);
 
@@ -599,6 +603,7 @@ void Unfreeze (entity targ)
        targ.frozen = 0;
        targ.revive_progress = 0;
        targ.revival_time = time;
+       self.bot_attack = true;
 
        WaypointSprite_Kill(targ.waypointsprite_attached);