From: Mario Date: Sat, 3 Mar 2018 03:56:27 +0000 (+1000) Subject: Give arc an impact effect, and attempt to update beam's shot origin offset using... X-Git-Tag: xonotic-v0.8.5~2256^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=40be29c6cb9c85fececa86f789d4a8db471d9f6b;p=xonotic%2Fxonotic-data.pk3dir.git Give arc an impact effect, and attempt to update beam's shot origin offset using local weapon entity --- diff --git a/effectinfo.txt b/effectinfo.txt index b2544fa07..128169c50 100644 --- a/effectinfo.txt +++ b/effectinfo.txt @@ -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 diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 7a26bcdb7..e4c82748e 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -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;