]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/overkill/oknex.qc
Merge branch 'drjaska/maplist-remove' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / overkill / oknex.qc
index ca44a070a0cf99c2db176642d49cd07efaa34bfc..a30a2bf52136b162cf8384e7ceec8c1a7d0cf14d 100644 (file)
@@ -7,22 +7,18 @@
 
 #if defined(GAMEQC)
 
-METHOD(OverkillNex, wr_glow, vector(OverkillNex this, entity actor, entity wepent))
+METHOD(OverkillNex, wr_glow, vector(OverkillNex this, int actor_colors, entity wepent))
 {
        if (!WEP_CVAR(oknex, charge)) return '0 0 0';
-       float charge = wepent.oknex_charge;
+       float charge = max(0.25, wepent.oknex_charge);
        float animlimit = WEP_CVAR(oknex, charge_animlimit);
-       float f = autocvar_g_weapon_charge_colormod_hdrmultiplier * min(1, charge / animlimit);
-       vector g;
-       g.x = f * autocvar_g_weapon_charge_colormod_red_half;
-       g.y = f * autocvar_g_weapon_charge_colormod_green_half;
-       g.z = f * autocvar_g_weapon_charge_colormod_blue_half;
+       float f = min(1, charge / animlimit);
+       vector mycolors = colormapPaletteColor(actor_colors & 0x0F, true);
+       vector g = f * (mycolors * 0.3);
        if (charge > animlimit)
        {
-               f = autocvar_g_weapon_charge_colormod_hdrmultiplier * (charge - animlimit) / (1 - animlimit);
-               g.x += f * autocvar_g_weapon_charge_colormod_red_full;
-               g.y += f * autocvar_g_weapon_charge_colormod_green_full;
-               g.z += f * autocvar_g_weapon_charge_colormod_blue_full;
+               f = (charge - animlimit) / (1 - animlimit);
+               g += f * (mycolors * 0.7);
        }
        // transition color can't be '0 0 0' as it defaults to player model glow color
        if (g == '0 0 0')
@@ -94,18 +90,18 @@ void W_OverkillNex_Attack(Weapon thiswep, entity actor, .entity weaponentity, fl
        }
 
        yoda = 0;
-       damage_goodhits = 0;
-       FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, thiswep.m_id);
+       impressive_hits = 0;
+       FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, true, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, thiswep.m_id);
 
        if(yoda && flying)
                Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
-       if(damage_goodhits && actor.oknex_lasthit)
+       if(impressive_hits && actor.oknex_lasthit)
        {
                Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
-               damage_goodhits = 0; // only every second time
+               impressive_hits = 0; // only every second time
        }
 
-       actor.oknex_lasthit = damage_goodhits;
+       actor.oknex_lasthit = impressive_hits;
 
        //beam and muzzle flash done on client
        SendCSQCVortexBeamParticle(charge);
@@ -117,7 +113,7 @@ void W_OverkillNex_Attack(Weapon thiswep, entity actor, .entity weaponentity, fl
 
 METHOD(OverkillNex, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
 {
-       if(bot_aim(actor, weaponentity, 1000000, 0, 1, false))
+       if(bot_aim(actor, weaponentity, 1000000, 0, 1, false, true))
                PHYS_INPUT_BUTTON_ATCK(actor) = true;
        else
        {
@@ -145,7 +141,8 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
        {
                // Secondary uses it's own refire timer if refire_type is 1.
                actor.jump_interval = time + WEP_CVAR_SEC(oknex, refire) * W_WeaponRateFactor(actor);
-               BLASTER_SECONDARY_ATTACK(oknex, actor, weaponentity);
+               makevectors(actor.v_angle);
+               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
                if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
                        (actor.(weaponentity).wframe == WFRAME_FIRE2))
                {
@@ -154,7 +151,7 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
                        FOREACH_CLIENT(true, LAMBDA(
                                if (it == actor || (IS_SPEC(it) && it.enemy == actor))
                                {
-                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+                                       wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
                                }
                        ));
                        animdecide_setaction(actor, ANIMACTION_SHOOT, true);
@@ -184,7 +181,8 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
                {
                        return;
                }
-               BLASTER_SECONDARY_ATTACK(oknex, actor, weaponentity);
+               makevectors(actor.v_angle);
+               W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
                weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(oknex, animtime), w_ready);
                return;
        }
@@ -328,7 +326,7 @@ METHOD(OverkillNex, wr_zoom, bool(entity thiswep, entity actor))
 METHOD(OverkillNex, wr_impacteffect, void(entity thiswep, entity actor))
 {
        entity this = actor;
-       vector org2 = w_org + w_backoff * 6;
+       vector org2 = w_org + w_backoff * 2;
        pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
        if(!w_issilent)
                sound(this, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);