From 40be29c6cb9c85fececa86f789d4a8db471d9f6b Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 3 Mar 2018 13:56:27 +1000 Subject: [PATCH] Give arc an impact effect, and attempt to update beam's shot origin offset using local weapon entity --- effectinfo.txt | 9 +++++++++ qcsrc/common/weapons/weapon/arc.qc | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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; -- 2.39.2