]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/nades/nades.qc
Merged master
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / nades / nades.qc
index 7f2bed6973aafcdd50327c74e9a5d8b6b266267a..9447ba3955e9d14355a539e45dc702b81612243a 100644 (file)
@@ -74,7 +74,7 @@ MUTATOR_HOOKFUNCTION(cl_nades, EditProjectile)
 
        if (proj.cnt == PROJECTILE_NAPALM_FOUNTAIN)
        {
-               loopsound(proj, CH_SHOTS_SINGLE, SND(FIREBALL_FLY2), VOL_BASE, ATTEN_NORM);
+               loopsound(proj, CH_SHOTS_SINGLE, SND_FIREBALL_FLY2, VOL_BASE, ATTEN_NORM);
                proj.mins = '-16 -16 -16';
                proj.maxs = '16 16 16';
        }
@@ -133,7 +133,7 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan
                DrawNadeProgressBar(myPos, mySize, bonusProgress, nadeColor);
 
                if(autocvar_hud_panel_ammo_text)
-                       drawstring_aspect(textPos, ftos(bonusNades), eX * (2/3) * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(textPos, ftos(bonusNades), vec2((2/3) * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
                if(draw_expanding)
                        drawpic_aspect_skin_expanding(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, expand_time);
@@ -220,7 +220,7 @@ void napalm_damage(entity this, float dist, float damage, float edgedamage, floa
        {
                d = vlen(WarpZone_UnTransformOrigin(RandomSelection_chosen_ent, this.origin) - RandomSelection_chosen_ent.fireball_impactvec);
                d = damage + (edgedamage - damage) * (d / dist);
-               Fire_AddDamage(RandomSelection_chosen_ent, this.realowner, d * burntime, burntime, this.projectiledeathtype | HITTYPE_BOUNCE);
+               Fire_AddDamage(RandomSelection_chosen_ent, this.realowner, d * burntime, burntime, this.projectiledeathtype);
                //trailparticles(this, particleeffectnum(EFFECT_FIREBALL_LASER), this.origin, RandomSelection_chosen_ent.fireball_impactvec);
                Send_Effect(EFFECT_FIREBALL_LASER, this.origin, RandomSelection_chosen_ent.fireball_impactvec - this.origin, 1);
        }
@@ -265,7 +265,7 @@ void nade_napalm_ball(entity this)
        entity proj;
        vector kick;
 
-       spamsound(this, CH_SHOTS, SND(FIREBALL_FIRE), VOL_BASE, ATTEN_NORM);
+       spamsound(this, CH_SHOTS, SND_FIREBALL_FIRE, VOL_BASE, ATTEN_NORM);
 
        proj = new(grenade);
        proj.owner = this.owner;
@@ -577,7 +577,7 @@ void nade_entrap_touch(entity this, entity toucher)
                if(!pushdeltatime) return;
 
                // div0: ticrate independent, 1 = identity (not 20)
-               toucher.velocity = toucher.velocity * pow(autocvar_g_nades_entrap_strength, pushdeltatime);
+               toucher.velocity = toucher.velocity * (autocvar_g_nades_entrap_strength ** pushdeltatime);
 
        #ifdef SVQC
                UpdateCSQCProjectile(toucher);
@@ -769,7 +769,6 @@ void nade_touch(entity this, entity toucher)
        if(autocvar_g_nades_pickup)
        if(time >= this.spawnshieldtime)
        if(!toucher.nade && this.health == this.max_health) // no boosted shot pickups, thank you very much
-       if(!STAT(FROZEN, toucher))
        if(CanThrowNade(toucher)) // prevent some obvious things, like dead players
        if(IS_REAL_CLIENT(toucher)) // above checks for IS_PLAYER, don't need to do it here
        {
@@ -799,7 +798,7 @@ void nade_touch(entity this, entity toucher)
        //UpdateCSQCProjectile(this);
        if(this.health == this.max_health)
        {
-               spamsound(this, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTEN_NORM);
+               spamsound(this, CH_SHOTS, SND_GRENADE_BOUNCE_RANDOM(), VOL_BASE, ATTEN_NORM);
                return;
        }
 
@@ -1106,9 +1105,6 @@ bool CanThrowNade(entity this)
        if(this.vehicle)
                return false;
 
-       if(gameover)
-               return false;
-
        if(IS_DEAD(this))
                return false;
 
@@ -1377,19 +1373,19 @@ MUTATOR_HOOKFUNCTION(nades, PlayerDies, CBC_ORDER_LAST)
        if(!STAT(FROZEN, frag_target) || !autocvar_g_freezetag_revive_nade)
                toss_nade(frag_target, true, '0 0 100', max(frag_target.nade.wait, time + 0.05));
 
-       float killcount_bonus = ((frag_attacker.killcount >= 1) ? bound(0, autocvar_g_nades_bonus_score_minor * frag_attacker.killcount, autocvar_g_nades_bonus_score_medium) : autocvar_g_nades_bonus_score_minor);
-
        if(IS_PLAYER(frag_attacker))
        {
+               float killcount_bonus = ((CS(frag_attacker).killcount >= 1) ? bound(0, autocvar_g_nades_bonus_score_minor * CS(frag_attacker).killcount, autocvar_g_nades_bonus_score_medium) : autocvar_g_nades_bonus_score_minor);
+
                if (SAME_TEAM(frag_attacker, frag_target) || frag_attacker == frag_target)
                        nades_RemoveBonus(frag_attacker);
                else if(frag_target.flagcarried)
                        nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_medium);
-               else if(autocvar_g_nades_bonus_score_spree && frag_attacker.killcount > 1)
+               else if(autocvar_g_nades_bonus_score_spree && CS(frag_attacker).killcount > 1)
                {
                        #define SPREE_ITEM(counta,countb,center,normal,gentle) \
                                case counta: { nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_spree); break; }
-                       switch(frag_attacker.killcount)
+                       switch(CS(frag_attacker).killcount)
                        {
                                KILL_SPREE_LIST
                                default: nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_minor); break;
@@ -1403,7 +1399,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerDies, CBC_ORDER_LAST)
        nades_RemoveBonus(frag_target);
 }
 
-MUTATOR_HOOKFUNCTION(nades, PlayerDamage_Calculate)
+MUTATOR_HOOKFUNCTION(nades, Damage_Calculate)
 {
        entity frag_inflictor = M_ARGV(0, entity);
        entity frag_attacker = M_ARGV(1, entity);