]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give arc an impact effect, and attempt to update beam's shot origin offset using...
authorMario <mario@smbclan.net>
Sat, 3 Mar 2018 03:56:27 +0000 (13:56 +1000)
committerMario <mario@smbclan.net>
Sat, 3 Mar 2018 03:56:27 +0000 (13:56 +1000)
effectinfo.txt
qcsrc/common/weapons/weapon/arc.qc

index b2544fa0740c89e540773baa6b08dd9cd12483c0..128169c502911d760c7de4707850887c805f6284 100644 (file)
@@ -7581,6 +7581,15 @@ effect arc_lightning
        underwater
        velocityjitter 250 250 250
        velocitymultiplier 20
+effect arc_lightning
+       type smoke
+       alpha 40 40 350
+       color 0x80C0FF 0x80C0FF
+       countabsolute 1
+       sizeincrease 400
+       size 4 4
+       tex 38 38
+       velocitymultiplier 100
 effect arc_beam
        type spark
        airfriction -10
index 7a26bcdb7cf804d4cf69e14091d07d9472ce20ea..e4c82748e9faf536a5f9e308e70748453a741fb8 100644 (file)
@@ -754,6 +754,8 @@ METHOD(Arc, wr_playerdeath, void(entity thiswep, entity actor, .entity weaponent
 bool autocvar_cl_arcbeam_teamcolor = true;
 bool autocvar_cl_arcbeam_simple = true;
 
+.int beam_slot;
+
 METHOD(Arc, wr_impacteffect, void(entity thiswep, entity actor))
 {
     if(w_deathtype & HITTYPE_SECONDARY)
@@ -916,6 +918,9 @@ void Draw_ArcBeam(entity this)
                if(vdist(end_pos - start_pos, <, g_trueaim_minrange))
                        end_pos = start_pos + (forward * g_trueaim_minrange);
 
+               entity wepent = viewmodels[this.beam_slot];
+               this.beam_shotorigin = wepent.movedir;
+
                // move shot origin to the actual gun muzzle origin
                vector origin_offset =
                          right * -this.beam_shotorigin.y
@@ -1166,11 +1171,13 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
        int slot = ReadByte();
        entity flash;
 
+       this.beam_slot = slot;
+
        if(isnew)
        {
                int gunalign = W_GunAlign(viewmodels[slot], STAT(GUNALIGN)) - 1;
 
-               this.beam_shotorigin = arc_shotorigin[gunalign];
+               this.beam_shotorigin = arc_shotorigin[gunalign]; // get a starting point
 
                // set other main attributes of the beam
                this.draw = Draw_ArcBeam;