From: FruitieX Date: Wed, 13 Oct 2010 10:25:35 +0000 (+0300) Subject: set some sane cvars, let the client know if the balance uses the velocity dependent... X-Git-Tag: xonotic-v0.1.0preview~307^2~11 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=cbdd35a0599206a1e656c9cf95e7834fb108a789 set some sane cvars, let the client know if the balance uses the velocity dependent nex and hide the circle if this isn't the case --- diff --git a/balance25.cfg b/balance25.cfg index b4b9494f09..90751d279d 100644 --- a/balance25.cfg +++ b/balance25.cfg @@ -424,6 +424,9 @@ set g_balance_nex_primary_damagefalloff_halflife 0 set g_balance_nex_primary_damagefalloff_forcehalflife 0 set g_balance_nex_secondary 0 +set g_balance_nex_secondary_charge 0 +set g_balance_nex_secondary_charge_rate 200 +set g_balance_nex_secondary_charge_ammo 10 set g_balance_nex_secondary_damage 100 set g_balance_nex_secondary_force 600 set g_balance_nex_secondary_refire 1.5 diff --git a/balanceLeeStricklin.cfg b/balanceLeeStricklin.cfg index ef0994dfc4..36d5435e1b 100644 --- a/balanceLeeStricklin.cfg +++ b/balanceLeeStricklin.cfg @@ -435,6 +435,9 @@ set g_balance_nex_primary_damagefalloff_halflife 9999999 set g_balance_nex_primary_damagefalloff_forcehalflife 9999999 set g_balance_nex_secondary 0 +set g_balance_nex_secondary_charge 0 +set g_balance_nex_secondary_charge_rate 200 +set g_balance_nex_secondary_charge_ammo 10 set g_balance_nex_secondary_damage 80 set g_balance_nex_secondary_force -500 set g_balance_nex_secondary_refire 1.25 diff --git a/balanceNexSVN.cfg b/balanceNexSVN.cfg index 9b3a2e720f..966d58cbff 100644 --- a/balanceNexSVN.cfg +++ b/balanceNexSVN.cfg @@ -423,6 +423,9 @@ set g_balance_nex_primary_damagefalloff_halflife 1500 set g_balance_nex_primary_damagefalloff_forcehalflife 1500 set g_balance_nex_secondary 0 +set g_balance_nex_secondary_charge 0 +set g_balance_nex_secondary_charge_rate 200 +set g_balance_nex_secondary_charge_ammo 10 set g_balance_nex_secondary_damage 90 set g_balance_nex_secondary_force 200 set g_balance_nex_secondary_refire 1.5 diff --git a/balanceSamual.cfg b/balanceSamual.cfg index 0561151bbf..966f0b2dd0 100644 --- a/balanceSamual.cfg +++ b/balanceSamual.cfg @@ -424,6 +424,9 @@ set g_balance_nex_primary_damagefalloff_halflife 1500 set g_balance_nex_primary_damagefalloff_forcehalflife 1500 set g_balance_nex_secondary 0 +set g_balance_nex_secondary_charge 0 +set g_balance_nex_secondary_charge_rate 200 +set g_balance_nex_secondary_charge_ammo 10 set g_balance_nex_secondary_damage 90 set g_balance_nex_secondary_force 300 set g_balance_nex_secondary_refire 1.5 diff --git a/balanceXonotic.cfg b/balanceXonotic.cfg index 02a748d434..225b0db8d9 100644 --- a/balanceXonotic.cfg +++ b/balanceXonotic.cfg @@ -425,8 +425,8 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 2000 set g_balance_nex_secondary 1 set g_balance_nex_secondary_charge 1 -set g_balance_nex_secondary_charge_rate 20 -set g_balance_nex_secondary_charge_ammo 20 +set g_balance_nex_secondary_charge_rate 200 +set g_balance_nex_secondary_charge_ammo 10 set g_balance_nex_secondary_damage 125 set g_balance_nex_secondary_force -700 set g_balance_nex_secondary_refire 1 @@ -440,7 +440,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 4000 set g_balance_nex_velocitydependent_halflife -500 set g_balance_nex_velocitydependent_minspeed 400 set g_balance_nex_velocitydependent_maxspeed 1000 -set g_balance_nex_velocitydependent_falloff_rate 20 +set g_balance_nex_velocitydependent_falloff_rate 40 // }}} // {{{ minstanex set g_balance_minstanex_refire 1.25 diff --git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc index a34e558c75..59a7074d72 100644 --- a/qcsrc/client/Defs.qc +++ b/qcsrc/client/Defs.qc @@ -261,6 +261,7 @@ vector w_org, w_backoff; float campingrifle_scope; float nex_scope; +float nex_velocitydependent; float nex_minvelocity; float nex_maxvelocity; float nex_speed_falloff_rate; diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index c9b344dac3..79881410d8 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1352,6 +1352,7 @@ float CSQC_Parse_TempEntity() bHandled = true; break; case TE_CSQC_NEX_VELOCITY: + nex_velocitydependent = ReadByte(); nex_minvelocity = ReadShort(); nex_maxvelocity = ReadShort(); nex_speed_falloff_rate = ReadByte(); diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index c6d86520d4..b4da5c8158 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -850,7 +850,7 @@ void CSQC_UpdateView(float w, float h) a = cvar("crosshair_campingrifle_bulletcounter_alpha"); DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE); } - else if (activeweapon == WEP_NEX) // ring around crosshair representing velocity-dependent damage for the nex + else if (activeweapon == WEP_NEX && nex_velocitydependent) // ring around crosshair representing velocity-dependent damage for the nex { f = bound(0, (nex_speed - nex_minvelocity) / (nex_maxvelocity - nex_minvelocity), 1); diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index b87dc27e5d..7dc5520abf 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -10,6 +10,7 @@ void send_CSQC_nexvelocity(entity e) { msg_entity = e; WriteByte(MSG_ONE, SVC_TEMPENTITY); WriteByte(MSG_ONE, TE_CSQC_NEX_VELOCITY); + WriteByte(MSG_ONE, bound(0, fabs(cvar("g_balance_nex_velocitydependent_halflife")), 1)); WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_minspeed")); WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_maxspeed")); WriteByte(MSG_ONE, cvar("g_balance_nex_velocitydependent_falloff_rate")); diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index 1da490842d..6b8ffb5328 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -79,7 +79,6 @@ float w_nex(float req) } else if (req == WR_THINK) { - print(ftos(self.nexspeed), "\n"); if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire"))) @@ -92,8 +91,11 @@ float w_nex(float req) { if(cvar("g_balance_nex_secondary_charge")) { - self.nexspeed = min(cvar("g_balance_nex_velocitydependent_maxspeed"), self.nexspeed + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME); - self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_charge_ammo") * frametime / W_TICSPERFRAME); + if(self.ammo_cells) + { + self.nexspeed = min(cvar("g_balance_nex_velocitydependent_maxspeed"), self.nexspeed + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME); + self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_charge_ammo") * frametime / W_TICSPERFRAME); + } } else if(cvar("g_balance_nex_secondary")) {