From: FruitieX Date: Tue, 20 Jul 2010 15:04:09 +0000 (+0300) Subject: trace lightning through warpzones, add shotgun secondary melee mode (still lacks... X-Git-Tag: xonotic-v0.1.0preview~423^2~26^2~18 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9e458cd552b677a696c23b80d134dbd3501f54cf;p=xonotic%2Fxonotic-data.pk3dir.git trace lightning through warpzones, add shotgun secondary melee mode (still lacks sound, needs tracebox for easier aiming too) --- diff --git a/balanceFruit.cfg b/balanceFruit.cfg index 6b7a9fbef..ff9567877 100644 --- a/balanceFruit.cfg +++ b/balanceFruit.cfg @@ -241,14 +241,18 @@ set g_balance_shotgun_primary_animtime 0.4 set g_balance_shotgun_primary_ammo 1 set g_balance_shotgun_primary_speed 12000 set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu -set g_balance_shotgun_secondary 0 +set g_balance_shotgun_secondary 1 +set g_balance_shotgun_secondary_melee 1 +set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim +set g_balance_shotgun_secondary_melee_range 60 +set g_balance_shotgun_secondary_melee_size 50 set g_balance_shotgun_secondary_bullets 6 // one more per shot than 15/3 (primary bullets/amount of shots = 3) -set g_balance_shotgun_secondary_damage 7 -set g_balance_shotgun_secondary_force 20 -set g_balance_shotgun_secondary_spread 0.20 -set g_balance_shotgun_secondary_refire 1.35 -set g_balance_shotgun_secondary_animtime 0.33 -set g_balance_shotgun_secondary_ammo 1 +set g_balance_shotgun_secondary_damage 90 +set g_balance_shotgun_secondary_force 150 +set g_balance_shotgun_secondary_spread 0 +set g_balance_shotgun_secondary_refire 1.1 +set g_balance_shotgun_secondary_animtime 1 +set g_balance_shotgun_secondary_ammo 0 set g_balance_shotgun_secondary_speed 12000 set g_balance_shotgun_secondary_bulletconstant 75 // 3.8qu // }}} diff --git a/models/weapons/h_shotgun.iqm b/models/weapons/h_shotgun.iqm index 1fb76f81d..89b121b90 100644 Binary files a/models/weapons/h_shotgun.iqm and b/models/weapons/h_shotgun.iqm differ diff --git a/models/weapons/h_shotgun.iqm.framegroups b/models/weapons/h_shotgun.iqm.framegroups index 0a59625b6..1dcb1b644 100644 --- a/models/weapons/h_shotgun.iqm.framegroups +++ b/models/weapons/h_shotgun.iqm.framegroups @@ -1,4 +1,4 @@ 1 8 20 0 // fire -9 5 20 0 // fire2 -15 200 20 1 // idle -215 40 20 0 // reload +9 31 20 0 // fire2 +32 231 20 1 // idle +232 271 20 0 // reload diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index 4eadbac21..4d4fda1ca 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -201,7 +201,7 @@ void lgbeam_think() vector angle; angle = v_forward; - traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_electro_primary_range"), FALSE, self.owner, ANTILAG_LATENCY(self.owner)); + WarpZone_traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_electro_primary_range"), FALSE, self.owner, ANTILAG_LATENCY(self.owner)); if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO) self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime); diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index c347648df..5775f3dda 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -89,6 +89,37 @@ void W_Shotgun_Attack2 (void) W_AttachToShotorg(flash, '5 0 0'); } +void shotgun_meleethink (void) +{ + makevectors(self.owner.v_angle); + vector angle; + angle = v_forward; + + // broken? fix, needs to be easier to hit + //WarpZone_tracebox_antilag(self.owner, self.owner.origin + self.owner.view_ofs, self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_shotgun_secondary_melee_range") - (v_right + v_up) * cvar("g_balance_shotgun_secondary_melee_size"), self.owner.origin + self.owner.view_ofs + (v_right + v_up) * cvar("g_balance_shotgun_secondary_melee_size"), self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_shotgun_secondary_melee_range"), FALSE, self.owner, ANTILAG_LATENCY(self.owner)); + WarpZone_traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_shotgun_secondary_melee_range"), FALSE, self.owner, ANTILAG_LATENCY(self.owner)); + + // apply the damage + if(trace_fraction < 1) + { + vector force; + force = angle * cvar("g_balance_shotgun_secondary_force"); + Damage (trace_ent, self.owner, self.owner, cvar("g_balance_shotgun_secondary_damage"), WEP_SHOTGUN, self.owner.origin + self.owner.view_ofs, force); + } + remove(self); +} + +void W_Shotgun_Attack3 (void) +{ + weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_shotgun_secondary_animtime"), w_ready); + + entity meleetemp; + meleetemp = spawn(); + meleetemp.owner = self; + meleetemp.think = shotgun_meleethink; + meleetemp.nextthink = time + cvar("g_balance_shotgun_secondary_melee_delay"); +} + // weapon frames void shotgun_fire2_03() { @@ -121,8 +152,16 @@ float w_shotgun(float req) if (self.BUTTON_ATCK2 && cvar("g_balance_shotgun_secondary")) if (weapon_prepareattack(1, cvar("g_balance_shotgun_secondary_refire"))) { - W_Shotgun_Attack2(); - weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_shotgun_secondary_animtime"), shotgun_fire2_02); + if(cvar("g_balance_shotgun_secondary_melee")) + { + // force playback of the anim by switching to another anim (that we never play) here... + weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack3); + } + else + { + W_Shotgun_Attack2(); + weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_shotgun_secondary_animtime"), shotgun_fire2_02); + } } } else if (req == WR_PRECACHE) @@ -139,7 +178,11 @@ float w_shotgun(float req) else if (req == WR_CHECKAMMO1) return self.ammo_shells >= cvar("g_balance_shotgun_primary_ammo"); else if (req == WR_CHECKAMMO2) + { + if(cvar("g_balance_shotgun_secondary_melee")) + return TRUE; return self.ammo_shells >= cvar("g_balance_shotgun_secondary_ammo") * 3; + } return TRUE; }; #endif