From: FruitieX Date: Tue, 20 Jul 2010 23:26:02 +0000 (+0300) Subject: make the rifle secondary cvar (serverside of course) toggleable between X-Git-Tag: xonotic-v0.1.0preview~423^2~26^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=da973bcc95fc103f88a72ccb7c98290ca013c626;p=xonotic%2Fxonotic-data.pk3dir.git make the rifle secondary cvar (serverside of course) toggleable between scope/fast fire mode. Also make some ammo tweaks --- diff --git a/balance.cfg b/balance.cfg index 00bf7e5ff..c96b82870 100644 --- a/balance.cfg +++ b/balance.cfg @@ -531,6 +531,7 @@ set g_balance_campingrifle_primary_ammo 10 set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu set g_balance_campingrifle_primary_burstcost 0.35 // require same cooldown as secondary, note it's smaller than primary refire time set g_balance_campingrifle_primary_bullethail 0 +set g_balance_campingrifle_secondary 1 set g_balance_campingrifle_secondary_damage 15 set g_balance_campingrifle_secondary_headshotaddeddamage 25 set g_balance_campingrifle_secondary_spread 0.02 diff --git a/balance25.cfg b/balance25.cfg index 63b8b3cd4..12c356dfc 100644 --- a/balance25.cfg +++ b/balance25.cfg @@ -531,6 +531,7 @@ set g_balance_campingrifle_primary_ammo 10 set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu set g_balance_campingrifle_primary_burstcost 0 set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot +set g_balance_campingrifle_secondary 1 set g_balance_campingrifle_secondary_damage 35 set g_balance_campingrifle_secondary_headshotaddeddamage 15 // 50 damage only on head set g_balance_campingrifle_secondary_spread 0.008 diff --git a/balanceFruit.cfg b/balanceFruit.cfg index 73a360ca0..5d1aae9f1 100644 --- a/balanceFruit.cfg +++ b/balanceFruit.cfg @@ -33,7 +33,7 @@ set g_warmup_start_ammo_fuel 0 "starting values when being in warmup-stage" set g_lms_start_health 250 set g_lms_start_armor 100 set g_lms_start_ammo_shells 30 -set g_lms_start_ammo_nails 300 +set g_lms_start_ammo_nails 250 set g_lms_start_ammo_rockets 100 set g_lms_start_ammo_cells 200 set g_lms_start_ammo_fuel 0 @@ -58,7 +58,7 @@ set g_pickup_shells 10 set g_pickup_shells_max 30 set g_pickup_nails 120 set g_pickup_nails_max 300 -set g_pickup_rockets 15 +set g_pickup_rockets 25 set g_pickup_rockets_max 150 set g_pickup_cells 25 set g_pickup_cells_max 200 @@ -309,7 +309,7 @@ set g_balance_grenadelauncher_secondary_bouncestop 0.075 set g_balance_electro_lightning 1 set g_balance_electro_primary_damage 100 set g_balance_electro_primary_edgedamage 0 -set g_balance_electro_primary_force 800 +set g_balance_electro_primary_force 600 set g_balance_electro_primary_force_up 125 set g_balance_electro_primary_radius 850 set g_balance_electro_primary_comboradius 75 @@ -514,25 +514,26 @@ set g_balance_hlac_secondary_ammo 10 set g_balance_hlac_secondary_shots 6 // }}} // {{{ campingrifle -set g_balance_campingrifle_magazinecapacity 8 +set g_balance_campingrifle_magazinecapacity 0 set g_balance_campingrifle_reloadtime 2 // matches reload anim set g_balance_campingrifle_auto_reload_after_changing_weapons 0 set g_balance_campingrifle_bursttime 0 set g_balance_campingrifle_tracer 1 -set g_balance_campingrifle_primary_damage 60 -set g_balance_campingrifle_primary_headshotaddeddamage 100 +set g_balance_campingrifle_primary_damage 50 +set g_balance_campingrifle_primary_headshotaddeddamage 35 set g_balance_campingrifle_primary_spread 0 set g_balance_campingrifle_primary_force 2 set g_balance_campingrifle_primary_speed 35000 set g_balance_campingrifle_primary_lifetime 5 set g_balance_campingrifle_primary_refire 0.8 -set g_balance_campingrifle_primary_animtime 0.3 +set g_balance_campingrifle_primary_animtime 0.8 set g_balance_campingrifle_primary_ammo 10 set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu set g_balance_campingrifle_primary_burstcost 0 set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot -set g_balance_campingrifle_secondary_damage 35 -set g_balance_campingrifle_secondary_headshotaddeddamage 15 // 50 damage only on head +set g_balance_campingrifle_secondary 0 +set g_balance_campingrifle_secondary_damage 15 +set g_balance_campingrifle_secondary_headshotaddeddamage 25 // 50 damage only on head set g_balance_campingrifle_secondary_spread 0.008 set g_balance_campingrifle_secondary_force 1 set g_balance_campingrifle_secondary_speed 20000 diff --git a/balanceSamual.cfg b/balanceSamual.cfg index daa4e9bc3..40a82f37a 100644 --- a/balanceSamual.cfg +++ b/balanceSamual.cfg @@ -531,6 +531,7 @@ set g_balance_campingrifle_primary_ammo 10 set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu set g_balance_campingrifle_primary_burstcost 0.35 // require same cooldown as secondary, note it's smaller than primary refire time set g_balance_campingrifle_primary_bullethail 0 +set g_balance_campingrifle_secondary 1 set g_balance_campingrifle_secondary_damage 15 set g_balance_campingrifle_secondary_headshotaddeddamage 25 set g_balance_campingrifle_secondary_spread 0.02 diff --git a/balanceXPM.cfg b/balanceXPM.cfg index 3b037b81e..ba0a23c01 100644 --- a/balanceXPM.cfg +++ b/balanceXPM.cfg @@ -531,6 +531,7 @@ set g_balance_campingrifle_primary_ammo 10 set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu set g_balance_campingrifle_primary_burstcost 0 set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot +set g_balance_campingrifle_secondary 1 set g_balance_campingrifle_secondary_damage 35 set g_balance_campingrifle_secondary_headshotaddeddamage 15 // 50 damage only on head set g_balance_campingrifle_secondary_spread 0.008 diff --git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc index 2aaf9cb0c..b1c423b25 100644 --- a/qcsrc/client/Defs.qc +++ b/qcsrc/client/Defs.qc @@ -257,3 +257,4 @@ float w_deathtype, w_issilent, w_random; string w_deathtypestring; vector w_org, w_backoff; +float campingrifle_scope; diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 9fb86a6e2..14a213ef2 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1270,6 +1270,10 @@ void Net_WeaponComplain() { complain_weapon_time = time; } +void Net_CampingrifleScope() { + campingrifle_scope = TRUE; +} + // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer. // You must ALWAYS first acquire the temporary ID, which is sent as a byte. // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event. @@ -1344,6 +1348,10 @@ float CSQC_Parse_TempEntity() Net_WeaponComplain(); bHandled = true; break; + case TE_CSQC_CAMPINGRIFLE_SCOPE: + Net_CampingrifleScope(); + bHandled = true; + break; default: // No special logic for this temporary entity; return 0 so the engine can handle it bHandled = false; diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 8c642415d..05c038e1c 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -137,7 +137,7 @@ vector GetCurrentFov(float fov) zoomspeed = 3.5; zoomdir = button_zoom; - if(getstati(STAT_ACTIVEWEAPON) == WEP_NEX) // do NOT use switchweapon here + if(getstati(STAT_ACTIVEWEAPON) == WEP_NEX || getstati(STAT_ACTIVEWEAPON) == WEP_CAMPINGRIFLE && campingrifle_scope) // do NOT use switchweapon here zoomdir += button_attack2; if(spectatee_status > 0 || isdemo()) { @@ -567,7 +567,7 @@ void CSQC_UpdateView(float w, float h) reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators else if(button_zoom) reticle_type = 1; // normal zoom - else if(activeweapon == WEP_NEX && button_attack2) + else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_CAMPINGRIFLE && button_attack2) reticle_type = 2; // nex zoom if(cvar("cl_reticle_stretch")) diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 5e96ce38a..8a74e964a 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -60,6 +60,7 @@ const float TE_CSQC_TARGET_MUSIC = 111; const float TE_CSQC_NOTIFY = 112; const float TE_CSQC_WEAPONCOMPLAIN = 113; const float TE_CSQC_BEAM = 114; +const float TE_CSQC_CAMPINGRIFLE_SCOPE = 115; const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder const float RACE_NET_CHECKPOINT_CLEAR = 1; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 8b95a3a4a..f4b83c5d8 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2781,7 +2781,7 @@ void PlayerPreThink (void) } if(!zoomstate_set) - SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX)); + SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_CAMPINGRIFLE && cvar("g_balance_campingrifle_secondary") == 0)); float oldspectatee_status; oldspectatee_status = self.spectatee_status; diff --git a/qcsrc/server/w_campingrifle.qc b/qcsrc/server/w_campingrifle.qc index 8fc8d839d..96dc36fc2 100644 --- a/qcsrc/server/w_campingrifle.qc +++ b/qcsrc/server/w_campingrifle.qc @@ -173,6 +173,7 @@ void W_CampingRifle_BulletHail(float mode, void(void) AttackFunc, float fr, floa } .float bot_secondary_campingriflemooth; +.float sent_campingrifle_scope; float w_campingrifle(float req) { float full; @@ -219,17 +220,33 @@ float w_campingrifle(float req) self.campingrifle_accumulator += cvar("g_balance_campingrifle_primary_burstcost"); } if (self.BUTTON_ATCK2) - if (weapon_prepareattack_check(1, cvar("g_balance_campingrifle_secondary_refire"))) - if (time >= self.campingrifle_accumulator + cvar("g_balance_campingrifle_secondary_burstcost")) - { - weapon_prepareattack_do(1, cvar("g_balance_campingrifle_secondary_refire")); - W_CampingRifle_BulletHail(cvar("g_balance_campingrifle_secondary_bullethail"), W_CampingRifle_Attack2, WFRAME_FIRE2, cvar("g_balance_campingrifle_secondary_animtime"), cvar("g_balance_campingrifle_primary_refire")); - self.campingrifle_accumulator += cvar("g_balance_campingrifle_secondary_burstcost"); + { + if (cvar("g_balance_campingrifle_secondary")) + { + if (weapon_prepareattack_check(1, cvar("g_balance_campingrifle_secondary_refire"))) + if (time >= self.campingrifle_accumulator + cvar("g_balance_campingrifle_secondary_burstcost")) + { + weapon_prepareattack_do(1, cvar("g_balance_campingrifle_secondary_refire")); + W_CampingRifle_BulletHail(cvar("g_balance_campingrifle_secondary_bullethail"), W_CampingRifle_Attack2, WFRAME_FIRE2, cvar("g_balance_campingrifle_secondary_animtime"), cvar("g_balance_campingrifle_primary_refire")); + self.campingrifle_accumulator += cvar("g_balance_campingrifle_secondary_burstcost"); + } + } + else + { + if(clienttype(self) == CLIENTTYPE_REAL) + if(!self.sent_campingrifle_scope) + { + msg_entity = self; + WriteByte(MSG_ONE, SVC_TEMPENTITY); + WriteByte(MSG_ONE, TE_CSQC_CAMPINGRIFLE_SCOPE); + self.sent_campingrifle_scope = 1; + } + } } } } else if (req == WR_PRECACHE) - { + { precache_model ("models/weapons/g_campingrifle.md3"); precache_model ("models/weapons/v_campingrifle.md3"); precache_model ("models/weapons/h_campingrifle.iqm");