]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/vortex.qc
Merge branch 'master' into z411/annce_queue
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / vortex.qc
index 5a1cd1a9200469c801d85576596ec7bf43117761..98762a03e13f4fe1c96a7a187348fdc069e1d81f 100644 (file)
@@ -51,8 +51,8 @@ void SendCSQCVortexBeamParticle(float charge) {
 NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew)
 {
        float charge;
-    vector shotorg = ReadVector();
-    vector endpos = ReadVector();
+       vector shotorg = ReadVector();
+       vector endpos = ReadVector();
        charge = ReadByte() / 255.0;
 
        //pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1);
@@ -63,7 +63,7 @@ NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew)
 
        if(!MUTATOR_CALLHOOK(Particles_VortexBeam, shotorg, endpos))
        {
-               if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo()))
+               if(autocvar_cl_particles_oldvortexbeam)
                        WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
                else
                        WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
@@ -112,9 +112,9 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i
        myforcehalflife = WEP_CVAR_BOTH(vortex, !issecondary, damagefalloff_forcehalflife);
        myammo = WEP_CVAR_BOTH(vortex, !issecondary, ammo);
 
-    float dtype = thiswep.m_id;
-    if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce))
-        dtype |= HITTYPE_ARMORPIERCE;
+       float dtype = thiswep.m_id;
+       if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce))
+               dtype |= HITTYPE_ARMORPIERCE;
 
        float flying;
        flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
@@ -138,21 +138,21 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i
        }
 
        yoda = 0;
-       damage_goodhits = 0;
+       impressive_hits = 0;
        FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, false, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, dtype);
 
        if(yoda && flying)
                Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
-       if(damage_goodhits && actor.vortex_lasthit)
+       if(impressive_hits && actor.vortex_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.vortex_lasthit = damage_goodhits;
+       actor.vortex_lasthit = impressive_hits;
 
        //beam done on client
-    vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+       vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg));
        SendCSQCVortexBeamParticle(charge);
 
@@ -164,23 +164,18 @@ void W_Vortex_Attack(Weapon thiswep, entity actor, .entity weaponentity, float i
 void W_Vortex_Charge(entity actor, .entity weaponentity, float dt)
 {
     if(WEP_CVAR(vortex, charge) && actor.(weaponentity).vortex_charge < WEP_CVAR(vortex, charge_limit))
-        actor.(weaponentity).vortex_charge = min(1, actor.(weaponentity).vortex_charge + WEP_CVAR(vortex, charge_rate) * dt / W_TICSPERFRAME);
+        actor.(weaponentity).vortex_charge = min(1, actor.(weaponentity).vortex_charge + WEP_CVAR(vortex, charge_rate) * dt);
 }
 
 METHOD(Vortex, 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
-    {
-        if(WEP_CVAR(vortex, charge))
-            PHYS_INPUT_BUTTON_ATCK2(actor) = true;
-    }
 }
 METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
     if(!WEP_CVAR(vortex, charge_always))
-        W_Vortex_Charge(actor, weaponentity, frametime);
+        W_Vortex_Charge(actor, weaponentity, frametime / W_TICSPERFRAME);
 
     if(WEP_CVAR_SEC(vortex, chargepool))
         if(actor.(weaponentity).vortex_chargepool_ammo < 1)