Merge in xonotic/xonotic-data.pk3dir.git: mirceakitsune/weapon_hagar_secondary_load
git-manager created issue #418 (closed) on 2011-04-20T16:17:40Z:
Purpose of the branch:
The code should be finished and ok. I reverted all balances to how they were before, so my code does not change anything by default now. It has also been on my test server for a week, and no one's reported any bugs or cons about it. If the code is sane, I believe it should be ok to merge now.
Repository: xonotic/xonotic-data.pk3dir.git Commit: 801fd819 Branch: mirceakitsune/weapon_hagar_secondary_load
Merge commands:
cd data/xonotic-data.pk3dir
git checkout master
git reset --hard origin/master
git pull && git diff '801fd8197b1e453d4abb50413cd2c1014514f95a'..'origin/mirceakitsune/weapon_hagar_secondary_load'
git merge --no-ff 'origin/mirceakitsune/weapon_hagar_secondary_load'
git push && git push --delete origin 'mirceakitsune/weapon_hagar_secondary_load'
Diffstat:
balance25.cfg | 6 ++
balanceLeeStricklin.cfg | 6 ++
balanceSamual.cfg | 6 ++
balanceXonotic.cfg | 16 +++-
balancetZork.cfg | 6 ++
defaultXonotic.cfg | 3 +
qcsrc/client/Defs.qc | 2 +
qcsrc/client/Main.qc | 2 +
qcsrc/client/View.qc | 7 ++
qcsrc/client/autocvars.qh | 2 +
qcsrc/common/constants.qh | 3 +
qcsrc/server/autocvars.qh | 6 ++
qcsrc/server/cl_client.qc | 3 +
qcsrc/server/cl_player.qc | 1 +
qcsrc/server/cl_weapons.qc | 2 +
qcsrc/server/cl_weaponsystem.qc | 4 +
qcsrc/server/defs.qh | 3 +
qcsrc/server/g_world.qc | 2 +
qcsrc/server/w_hagar.qc | 177 ++++++++++++++++++++++++++++++++++++++-
sound/weapons/hagar_beep.ogg | Bin 0 -> 5500 bytes
sound/weapons/hagar_load.ogg | Bin 0 -> 13436 bytes
xonotic-credits.txt | 1 +
22 files changed, 251 insertions(+), 7 deletions(-)
Revision log:
commit 801fd8197b1e453d4abb50413cd2c1014514f95a
Author: Mircea Kitsune
Commit: Mircea Kitsune
Lastly, default the default balance back to what it was, and just comment the defaults. This should make the code ready for merge, as discussed last night on the balance channel.
commit 55e994013cfe2e71a51fe4a5cd2430c34ed984fd
Author: Mircea Kitsune
Commit: Mircea Kitsune
Always play the beep sound when loading the last rocket, even if we can only load fewer rockets due to lack of ammo. This should perfect the hagar loading to the finest detail of functionality :)
commit 9bf9a65f2cf25525f8544df2980d1146d713217d
Author: Mircea Kitsune
Commit: Mircea Kitsune
Check both ammos before attempting to switch guns
commit d0a8b2bf9da92dae97ad2b2ccd8520e67f724573
Author: Mircea Kitsune
Commit: Mircea Kitsune
Default damage to 36. Else primary fire is still too good compared to secondary
commit d80e411d43ece10f150d4e7a7623e4f8147c38d9
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix issues when hagar is reloadable (now respects weapon load properly)
commit bccfb396e18cb0cd10ec150263d892415a23e3f3
Merge: db9ea36 396be1f
Author: Mircea Kitsune
Commit: Mircea Kitsune
Merge branch 'master' into mirceakitsune/weapon_hagar_secondary_load
commit db9ea3663a9a30a73fd9717f99ae883c59786139
Author: Mircea Kitsune
Commit: Mircea Kitsune
Disable the load block in WR_SETUP, to prevent a minor possible inconvenience
commit 523f600dd419465e53b18d6af8a97e5597257289
Author: Mircea Kitsune
Commit: Mircea Kitsune
Remove the WR_DROP weapon_action, now that it's not needed any more. I don't know how safe that was, nor believe it has any real utility now.
commit 1cb4bd58f977b4ab6d48eb8f5de4c23137b090bf
Author: Mircea Kitsune
Commit: Mircea Kitsune
More correct sorting
commit f884797b17fa38d33fb8efc0615aff6481e455c1
Author: Mircea Kitsune
Commit: Mircea Kitsune
Actually, create a weapon independent function that forbids the player to change their weapon (drop or switch to another) while active. Can once again be used for other weapons and reasons.
commit 8fa8744659b9f15317db5641e8ccb08b87349b36
Author: Mircea Kitsune
Commit: Mircea Kitsune
Actually, forbid throwing the hagar at all while loading it!
commit ec794159873ed097ad8fe0f63b143039fa84f5e2
Author: Mircea Kitsune
Commit: Mircea Kitsune
Further secure dropping while loading, and also create a WR_DROP event for weapons, which can be useful
commit 6b06fdda5f275989358af7f65974b0db7dbabf89
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix giving back ammo to the player if they drop the weapon while loading. This code should also secure against other possible issues I think.
commit 33208e83c98ff02534dd71699f4859a59cea669e
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix a bug with dropping the hagar while loading it. You still lose the ammo though, which needs to be fixed too
commit 8b9e4e7deedfc986862f849d749a031b67a30d73
Author: Mircea Kitsune
Commit: Mircea Kitsune
Reduce now useless ammo checking code
commit db005924619ad5faf8580d7af03d8598499b5f15
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix ammo checks, all works properly again
commit 2f8b796c02260d180a6b8e5ea63517e4808ca0b4
Author: Mircea Kitsune
Commit: Mircea Kitsune
Decrease ammo with each rocket we load, and not suddenly when firing. If the loading is aborted, the ammo is then given back to the player (unless he dies).
commit 361ffa180aed430baddde7e03f576b9abe3e78cf
Author: Mircea Kitsune
Commit: Mircea Kitsune
Cvar the feature of releasing loaded rockets upon death
commit ce739edbbc63e396bcdaccad69a8b29d1a5b7c26
Author: Mircea Kitsune
Commit: Mircea Kitsune
Release loaded rockets when the player dies
commit ec553fe574daf3e947de51b4a965bfd4723b96b7
Author: Mircea Kitsune
Commit: Mircea Kitsune
Move the releasing of loaded rockets in its own function.
commit c5fbc5b5d03d71370c444a901664fa27138bdd24
Author: Mircea Kitsune
Commit: Mircea Kitsune
Implement a new weapon check called WR_PLAYERDEATH. It will be used in the hagar code to make players release the rockets they have loaded when they die.
commit 07aca341b89653d4d8979c34f099d6a04d23dd10
Merge: c731a33 f7f36e7
Author: Mircea Kitsune
Commit: Mircea Kitsune
Merge branch 'master' into mirceakitsune/weapon_hagar_secondary_load
commit c731a33a3c2e08a9c7db32fa5e1e31fab7b24ab8
Author: Mircea Kitsune
Commit: Mircea Kitsune
Don't allow switching to another weapon if we're loading rockets into the hagar
commit 87d64df6bae9310309694d87ac3ca15603ad35f3
Author: Mircea Kitsune
Commit: Mircea Kitsune
Also use the beep sound when aborting loading.
commit abb4fad81911568f8627ed6175236d6de437f79f
Author: Mircea Kitsune
Commit: Mircea Kitsune
Higher pitch beep sound
commit 2e39cb9464c314591c5ce8cf8998e9475732c2ee
Author: Mircea Kitsune
Commit: Mircea Kitsune
Play the beep sound when the last rocket is loaded, to notify the player of that. Idea by FruitieX
commit 420d537ec172cff94c6fa8b30b2db75cb254fbe7
Author: Mircea Kitsune
Commit: Mircea Kitsune
Hagar beep, sound file
commit 5dde9508620c69848a29ad5e2f533a90bc522e7c
Author: Mircea Kitsune
Commit: Mircea Kitsune
Cvar the abort feature
commit 79af92f2c605cc0d9b1870c6dfff396ee04bf3be
Author: Mircea Kitsune
Commit: Mircea Kitsune
Pause until we can load rockets again, once we re-press the alt fire button
commit 9a15b8c0245fda5c2ec2cf1b18a5c509fa00db9e
Author: Mircea Kitsune
Commit: Mircea Kitsune
Rename stuff in the code
commit 1bf795df04a33ce72adfd5fb945430179ddc629e
Author: Mircea Kitsune
Commit: Mircea Kitsune
Another change to the buttons, making them work much better
commit 450330511485324e619be20124d422bcb6fb5980
Author: Mircea Kitsune
Commit: Mircea Kitsune
Another minor code sorting to the button checks
commit ccd60a91f2958d3b3f240be521aca7b6aae45acb
Author: Mircea Kitsune
Commit: Mircea Kitsune
Further improve that last check, and make sure it does run each frame all the time (unless the feature is disabled or reloading is blocking it)
commit d64d2b05a6a4aac377d2719d443ae12dc6088f2d
Author: Mircea Kitsune
Commit: Mircea Kitsune
Improve how firing buttons are checked
commit 6dff2908371d25aebd7c41c00cbafb9fe8f4b6b4
Author: Mircea Kitsune
Commit: Mircea Kitsune
Require letting go of both firing buttons before we can load again, if we abort with primary fire
commit 6f9fb0d6c6339e12504e2ce27062a3d93bd13e33
Author: Mircea Kitsune
Commit: Mircea Kitsune
Allow primary fire button to abort loading if clicking it while holding secondary down to load. Not ready yet.
commit cb2bff54b356236daa51e17f122080864d328467
Author: Mircea Kitsune
Commit: Mircea Kitsune
Also apply a loading brake after the last rocket has been loaded, rather than firing it instantly, as discussed with FruitieX
commit 4642aba5e48e56dffe435903fff97128d286bc2d
Author: Mircea Kitsune
Commit: Mircea Kitsune
Bump secondary push to 160
commit 0828417c61f485a10ac3f10a8175ccfff42a1732
Author: Mircea Kitsune
Commit: Mircea Kitsune
Bump default damage up to 32. 20 is way too useless, and everyone would just use primary instead (might need to be even higher than this eventually)
commit 16f7ffd77bc757eb879498c4b73f674d145d8acc
Author: Mircea Kitsune
Commit: Mircea Kitsune
Revert that last change, as it cannot check for ammo any longer.
commit bc79763325f92e7688f6e61d24b42d35eb08d989
Author: Mircea Kitsune
Commit: Mircea Kitsune
If no loading speed is set, fill in all the rockets at once. Might be a better and safer behavior.
commit 96ea031dd92efd767415cbcbdc3fd51ab7106938
Author: Mircea Kitsune
Commit: Mircea Kitsune
Change the default load speed in all balances.
commit 4ba4dd43e76ebec436db40a173197c62c0e66c05
Author: Mircea Kitsune
Commit: Mircea Kitsune
And a refire of 0.8 however
commit f267ed72ffe22d2aa53ac316a692ec13c8d69ebd
Author: Mircea Kitsune
Commit: Mircea Kitsune
Faster rocket loading speed with slightly less damage
commit 81fc9097421be3811f105b432858fb8776cea2ec
Author: Mircea Kitsune
Commit: Mircea Kitsune
A bit lower pitch though
commit 0129f3b0508573c8d3b66274112707bb078b984b
Author: Mircea Kitsune
Commit: Mircea Kitsune
Make the sound faster, so it can match faster loading speeds like 0.6. Xonotic is too fast-paced for rocket loading speed to be 1.
commit ea8e86c3860ef96072e7a764da130fb25a316b06
Author: Mircea Kitsune
Commit: Mircea Kitsune
Bump damage from 22 to 24. It's much better practically.
commit b4ec898eb13cf6f7e68b1cdbc4c851973d876049
Author: Mircea Kitsune
Commit: Mircea Kitsune
Remove an useless code
commit ac7e93f7b7d74c34c8b9e9240cb9bc7f82ba9f7a
Author: Mircea Kitsune
Commit: Mircea Kitsune
Rename something in the code
commit d164a617a115fecf953129c9e897601ac342647c
Author: Mircea Kitsune
Commit: Mircea Kitsune
Default refire to 0.6, while leaving rocket loading speed at 1.
commit 34f7830b54f9eae3cfbf778284835f6a3c21e03b
Author: Mircea Kitsune
Commit: Mircea Kitsune
Use a different cvar for rocket loading speed than refire. So the delay after the weapon fires (and may fire again) is different than the speed rockets are loaded with.
commit cd6a73490b8c9d18a31346f5bfb547239b1537f1
Author: Mircea Kitsune
Commit: Mircea Kitsune
OMG, forgot the firing animation *beats self*
commit 1b02ffa0176be47b6be915a579cbc8bca9610954
Author: Mircea Kitsune
Commit: Mircea Kitsune
Also update the reload delay when firing, to add a forced pause that was missing
commit 36ad047878fda40ed208a4880cca522e3d3edec0
Author: Mircea Kitsune
Commit: Mircea Kitsune
Add some weapon firing functions that are prolly important.
commit cde2650f0c177f5e22b735415656335f64587ae2
Author: Mircea Kitsune
Commit: Mircea Kitsune
Rename some cvars
commit 65b58650ee5c40f64965b1da4b199d6804d8bc4b
Author: Mircea Kitsune
Commit: Mircea Kitsune
Bump rocket damage up to 22. Don't worry, it doesn't really do that much damage, and this seems like a good balancing from my tests. With this, I declare the code ready for testing, and finding any existing bugs. Otherwise, it is ready.
commit e315f7717d2bc0b832b64fde4f10744492a04ca6
Author: Mircea Kitsune
Commit: Mircea Kitsune
Add the correct .use function, fixes damage value
commit e8940a4a303fc98ce4b39fa78fec3e646b960ee0
Author: Mircea Kitsune
Commit: Mircea Kitsune
Use the normal secondary spread cvar
commit 3935ce9a9eec3f3b4a3820f9c4411f74d67323be
Author: Mircea Kitsune
Commit: Mircea Kitsune
A bit more spread and much more damage (as it's unlikely for all 4 rockets to hit someone full-on).
commit 695cd1f79336cc38ce083bafe2118b44a638fde5
Author: Mircea Kitsune
Commit: Mircea Kitsune
Code comments and cleanups
commit 4d9494bad9bda5e0a9db48b452e409167bfb806d
Author: Mircea Kitsune
Commit: Mircea Kitsune
Force switch to another weapon when out of ammo (needs to be done separately here)
commit 6749f47852787e911ee1163192542db53039cb0f
Author: Mircea Kitsune
Commit: Mircea Kitsune
Release the rockets we loaded so far if canhold is disabled and we ran out of ammo, even if we didn't reach maximum amount.
commit fd6dfc119e0ff8a14bb0ca5fa68880408b8692b6
Author: Mircea Kitsune
Commit: Mircea Kitsune
Make sure we have enough ammo for all the rockets we are about to load. If not, stop loading rockets when running out of ammo (or weapon load, when the hagar is set reloadable).
commit b0d21523c2463ae756c5fc37127c4289ab8c3fc7
Author: Mircea Kitsune
Commit: Mircea Kitsune
Add cvars to all balances, so Samual won't kill me :P Disabled by default in all but the default balance, as it's for the owners of these balances to decide to tweak it. Also increase default spread a tiny bit.
commit 1fcd4711874c4295feb50c667c5c12e7de249a60
Author: Mircea Kitsune
Commit: Mircea Kitsune
No need to keep the fully loaded status a global any more
commit bde4893d6bfd2dd2e77e88b34523db372067f157
Author: Mircea Kitsune
Commit: Mircea Kitsune
Add a canhold cvar. When enabled, reaching the maximum number of rockets will allow you to hold your hagar without auto-firing it. Else when the hagar is fully loaded, it discharges automatically. Currently disabled by default.
commit d80f98d6459a84621f64054cf8c827b7a692aac7
Author: Mircea Kitsune
Commit: Mircea Kitsune
5 sounds like an ok value for rocket damage
commit 5b11c9b2bee5ab92ecb745ab94afbbe2fec4a4cb
Author: Mircea Kitsune
Commit: Mircea Kitsune
Way lower damage, now that we fire 4 rockets at a time (max). lower each rocket's damage from 14 to 4. Better balancing can be decided later in time though.
commit 108ecd86de7cdc82066acd558cd55099497ac441
Author: Mircea Kitsune
Commit: Mircea Kitsune
Add the name of the person who's sound I used. http://www.pdsounds.org/sounds/pocket_camera_start_and_shut_down Believe it or not, I Auditioned it from that :D
commit dca149ece5ff5233cbb4400d156a6a0739aea223
Author: Mircea Kitsune
Commit: Mircea Kitsune
Play the sound on CHAN_WEAPON2, to avoid cutting it with the fire sound
commit 93657564725ca5bc8f85f83fe3009d0f4867bfd6
Author: Mircea Kitsune
Commit: Mircea Kitsune
Set refire to 1 by default, with the new feature.
commit 657f8291953db7c5dde7ab4e6393ee7c1a2fe841
Author: Mircea Kitsune
Commit: Mircea Kitsune
Code for using the new sound
commit 07448c5a392889f63461109ea0dd6bc9888c3a57
Author: Mircea Kitsune
Commit: Mircea Kitsune
A sound for loading the hagar. Public domain, found randomly around the internetz
commit 6e3050bb5c8dc67ed5b7763dcca25464a8cd2057
Author: Mircea Kitsune
Commit: Mircea Kitsune
Clear loaded rockets whenever hagar is reset.
commit c327e1d274671fcdaa8789040cf82374dcb40da3
Author: Mircea Kitsune
Commit: Mircea Kitsune
Don't allow primary fire to shoot while loading.
commit 598da6b0ff4459cbc22238fd9e7c8f2f10aa74ec
Author: Mircea Kitsune
Commit: Mircea Kitsune
Decrease ammo as well. Each rocket decreases ammo by the secondary shot ammo amount, based on how many rockets are fired.
commit 491f2d5500b2dc37eb4d51aca1799a68c4008820
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix a bug in the loaded rockets stat. Crosshair ring now indicates the proper value.
commit 8ecbce2cfec216531c46cfacb4cf61dadcbaa5bf
Author: Mircea Kitsune
Commit: Mircea Kitsune
No longer send the maximum number of rockets as a stat, but use the same system as minelayer_maxmines
commit ed21c873117b71545a269bf9f446f2742e24e6a0
Author: Mircea Kitsune
Commit: Mircea Kitsune
Crosshair ring to indicate how many rockets are loaded into the hagar
commit 094128ef3612f482c07d05eaaf0842847c27d81e
Author: Mircea Kitsune
Commit: Mircea Kitsune
Set the maxload stat in hagar code
commit dcd4f9823b1327ac55e0c759015dda97a3974875
Author: Mircea Kitsune
Commit: Mircea Kitsune
First step in making the hagar slowly loadable. Does not work as intended yet, but getting there.
commit b730aeae9a2f20c3364bf10a1afb760e10f47753
Author: Mircea Kitsune
Commit: Mircea Kitsune
Create two stats for the hagar loading feature. Will be used for the crosshair inner ring, to show how many rockets have been loaded.
commit e66112aaa6e336d3e535b599d3f613cd60e04133
Author: Mircea Kitsune
Commit: Mircea Kitsune
Give the hagar its own load cvar. In this case, it will specify the maximum number of rockets you can load at a time.
commit 6c52115927a87bc0c18c6d4192fbd0ea5a076ee5
Author: Mircea Kitsune
Commit: Mircea Kitsune
Fix loadable secondary lifetime
commit 16522be1a38abfc8147a13aa449d514131deb79e
Author: Mircea Kitsune
Commit: Mircea Kitsune
Begin implementation of loadable hagar secondary. What this will do: When enabled, the user holds down the alt fire button to load rockets. The more it's held down, the more rockets are loaded into the hagar (one every X seconds). Once the button is released, the number of rockets that were loaded till that moment will be fired, in a pattern similar to the crylink primary. This will also be Xonotic's first "hold do load, the more the many" firing type.
Current code just causes hagar secondary to fire rockats in the same pattern as the crylink, which is just the first step.
User agreed to the GPLv2*.
Diff:
<pre>diff —git a/balance25.cfg b/balance25.cfg
index bcc374c..5e1671d 100644
— a/balance25.cfg
**+ b/balance25.cfg
@ -538,6 +538,12
@ set g\_balance\_hagar\_primary\_lifetime 30
set g\_balance\_hagar\_primary\_refire 0.15
set g\_balance\_hagar\_primary\_ammo 1
set g\_balance\_hagar\_secondary 1
*set g\_balance\_hagar\_secondary\_load 0
*set g\_balance\_hagar\_secondary\_load\_speed 0.6
*set g\_balance\_hagar\_secondary\_load\_max 4
*set g\_balance\_hagar\_secondary\_load\_hold 0
*set g\_balance\_hagar\_secondary\_load\_releasedeath 1
*set g\_balance\_hagar\_secondary\_load\_abort 1
set g\_balance\_hagar\_secondary\_damage 37
set g\_balance\_hagar\_secondary\_edgedamage 15
set g\_balance\_hagar\_secondary\_force 100
diff —git a/balanceLeeStricklin.cfg b/balanceLeeStricklin.cfg
index 4de61dc..48fbefe 100644
— a/balanceLeeStricklin.cfg
**+ b/balanceLeeStricklin.cfg
@ -538,6 +538,12
@ set g\_balance\_hagar\_primary\_lifetime 30
set g\_balance\_hagar\_primary\_refire 0.15
set g\_balance\_hagar\_primary\_ammo 2
set g\_balance\_hagar\_secondary 1
*set g\_balance\_hagar\_secondary\_load 0
*set g\_balance\_hagar\_secondary\_load\_speed 0.6
*set g\_balance\_hagar\_secondary\_load\_max 4
*set g\_balance\_hagar\_secondary\_load\_hold 0
*set g\_balance\_hagar\_secondary\_load\_releasedeath 1
*set g\_balance\_hagar\_secondary\_load\_abort 1
set g\_balance\_hagar\_secondary\_damage 43
set g\_balance\_hagar\_secondary\_edgedamage 15
set g\_balance\_hagar\_secondary\_force 100
diff —git a/balanceSamual.cfg b/balanceSamual.cfg
index 5da6f77..75843d4 100644
— a/balanceSamual.cfg
**+ b/balanceSamual.cfg
@ -538,6 +538,12
@ set g\_balance\_hagar\_primary\_lifetime 5
set g\_balance\_hagar\_primary\_refire 0.15
set g\_balance\_hagar\_primary\_ammo 1
set g\_balance\_hagar\_secondary 1
*set g\_balance\_hagar\_secondary\_load 0
*set g\_balance\_hagar\_secondary\_load\_speed 0.6
*set g\_balance\_hagar\_secondary\_load\_max 4
*set g\_balance\_hagar\_secondary\_load\_hold 0
*set g\_balance\_hagar\_secondary\_load\_releasedeath 1
*set g\_balance\_hagar\_secondary\_load\_abort 1
set g\_balance\_hagar\_secondary\_damage 35
set g\_balance\_hagar\_secondary\_edgedamage 17.5
set g\_balance\_hagar\_secondary\_force 100
diff —git a/balanceXonotic.cfg b/balanceXonotic.cfg
index e3e5862..379990c 100644
— a/balanceXonotic.cfg
**+ b/balanceXonotic.cfg
@ -538,15 +538,21
@ set g\_balance\_hagar\_primary\_lifetime 5
set g\_balance\_hagar\_primary\_refire 0.12
set g\_balance\_hagar\_primary\_ammo 1
set g\_balance\_hagar\_secondary 1
~~set g\_balance\_hagar\_secondary\_damage 14
~~set g\_balance\_hagar\_secondary\_edgedamage 6
-set g\_balance\_hagar\_secondary\_force 70
*set g\_balance\_hagar\_secondary\_load 0
*set g\_balance\_hagar\_secondary\_load\_speed 0.6
*set g\_balance\_hagar\_secondary\_load\_max 4
*set g\_balance\_hagar\_secondary\_load\_hold 0
*set g\_balance\_hagar\_secondary\_load\_releasedeath 1
*set g\_balance\_hagar\_secondary\_load\_abort 1
*set g\_balance\_hagar\_secondary\_damage 14 // default for *load: 32
*set g\_balance\_hagar\_secondary\_edgedamage 6 // default for \_load: 10
set g_balance_hagar_secondary_force 70 // default forload: 160
set g\_balance\_hagar\_secondary\_radius 125
~~set g\_balance\_hagar\_secondary\_spread 0.15
*set g\_balance\_hagar\_secondary\_spread 0.15 // default for \_load: 0.08
set g\_balance\_hagar\_secondary\_speed 1800
set g\_balance\_hagar\_secondary\_lifetime\_min 5
set g\_balance\_hagar\_secondary\_lifetime\_rand 0
~~set g\_balance\_hagar\_secondary\_refire 0.12
*set g\_balance\_hagar\_secondary\_refire 0.12 // default for \_load: 0.8
set g\_balance\_hagar\_secondary\_ammo 1
set g\_balance\_hagar\_reload\_ammo 0 //default: 25
set g\_balance\_hagar\_reload\_time 2
diff —git a/balancetZork.cfg b/balancetZork.cfg
index 8886d54..a88cc3b 100644
— a/balancetZork.cfg
**+ b/balancetZork.cfg
@ -537,6 +537,12
@ set g\_balance\_hagar\_primary\_lifetime 30
set g\_balance\_hagar\_primary\_refire 0.2
set g\_balance\_hagar\_primary\_ammo 1
set g\_balance\_hagar\_secondary 1
*set g\_balance\_hagar\_secondary\_load 0
*set g\_balance\_hagar\_secondary\_load\_speed 0.6
*set g\_balance\_hagar\_secondary\_load\_max 4
*set g\_balance\_hagar\_secondary\_load\_hold 0
*set g\_balance\_hagar\_secondary\_load\_releasedeath 1
*set g\_balance\_hagar\_secondary\_load\_abort 1
set g\_balance\_hagar\_secondary\_damage 30
set g\_balance\_hagar\_secondary\_edgedamage 15
set g\_balance\_hagar\_secondary\_force 50
diff —git a/defaultXonotic.cfg b/defaultXonotic.cfg
index 6aa33a8..042dd8b 100644
— a/defaultXonotic.cfg
**+ b/defaultXonotic.cfg
@ -205,6 +205,9
@ seta crosshair\_ring\_nex\_currentcharge\_movingavg\_rate 0.05
seta crosshair\_ring\_minelayer 1
seta crosshair\_ring\_minelayer\_alpha 0.15
*seta crosshair\_ring\_hagar 1
*seta crosshair\_ring\_hagar\_alpha 0.15
*
seta crosshair\_ring\_reload 1 “main cvar to enable or disable ammo crosshair rings”
seta crosshair\_ring\_reload\_size 2.5 “reload ring size”
seta crosshair\_ring\_reload\_alpha 0.2 “reload ring alpha”
diff —git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc
index b3b0569..666fd88 100644
— a/qcsrc/client/Defs.qc
**+ b/qcsrc/client/Defs.qc
@ -263,6 +263,8
@ float nex\_scope;
float minelayer\_maxmines;
*float hagar\_maxrockets;
*
float bgmtime;
string weaponorder\_byimpulse;
diff —git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc
index 91ce464..6bd4402 100644
— a/qcsrc/client/Main.qc
**+ b/qcsrc/client/Main.qc
@ -1099,6 +1099,8
@ void Ent\_Init
minelayer\_maxmines = ReadByte;
- hagar_maxrockets = ReadByte;
g_trueaim_minrange = ReadCoord;
if
diff —git a/qcsrc/client/View.qc b/qcsrc/client/View.qc
index 1a1c376..fd8c44c 100644
— a/qcsrc/client/View.qc
**+ b/qcsrc/client/View.qc
@ -1133,6 +1133,13
@ void CSQC_UpdateView
ring_rgb = wcross_color;
ring_image = “gfx/crosshair_ring.tga”;
}
- else if && autocvar_crosshair_ring_hagar)
- {
- ring_value = bound / hagar_maxrockets, 1);
- ring_alpha = autocvar_crosshair_ring_hagar_alpha;
- ring_rgb = wcross_color;
- ring_image = “gfx/crosshair_ring.tga”;
- }
if // forces there to be only an ammo ring
{
diff —git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh
index e11266c..41e34cf 100644
— a/qcsrc/client/autocvars.qh
**+ b/qcsrc/client/autocvars.qh
@ -112,6 +112,8
@ float autocvar_crosshair_ring; float autocvar_crosshair_ring_inner; float autocvar_crosshair_ring_minelayer; float autocvar_crosshair_ring_minelayer_alpha; *float autocvar_crosshair_ring_hagar; *float autocvar_crosshair_ring_hagar_alpha; float autocvar_crosshair_ring_nex; float autocvar_crosshair_ring_nex_alpha; float autocvar_crosshair_ring_nex_currentcharge_movingavg_rate; diff —git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 419ab73..7b0ef38 100644 — a/qcsrc/common/constants.qh **+ b/qcsrc/common/constants.qh@ -63,6 +63,7
@ const float TE_CSQC_NOTIFY = 112; const float TE_CSQC_WEAPONCOMPLAIN = 113; const float TE_CSQC_NEX_SCOPE = 116; const float TE_CSQC_MINELAYER_MAXMINES = 117; *const float TE_CSQC_HAGAR_MAXROCKETS = 118; const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder const float RACE_NET_CHECKPOINT_CLEAR = 1;@ -317,6 +318,7
@ const float STAT_NEX_CHARGEPOOL = 53; const float STAT_HIT_TIME = 54; const float STAT_TYPEHIT_TIME = 55; const float STAT_LAYED_MINES = 56; *const float STAT_HAGAR_LOAD = 57; // see DP source, quakedef.h const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;@ -626,6 +628,7
@ float WR_RELOAD = 9; // does not need to do anything float WR_RESETPLAYER = 10; // does not need to do anything float WR_IMPACTEFFECT = 11; // impact effect float WR_SWITCHABLE = 12; // impact effect *float WR_PLAYERDEATH = 13; // does not need to do anything
float HUD_PANEL_WEAPONS = 0;
diff —git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh
index 467838c..97971d2 100644
— a/qcsrc/server/autocvars.qh
**+ b/qcsrc/server/autocvars.qh
@ -320,6 +320,12
@ float autocvar_g_balance_hagar_primary_radius;
float autocvar_g_balance_hagar_primary_refire;
float autocvar_g_balance_hagar_primary_speed;
float autocvar_g_balance_hagar_secondary;
*float autocvar_g_balance_hagar_secondary_load;
*float autocvar_g_balance_hagar_secondary_load_speed;
*float autocvar_g_balance_hagar_secondary_load_max;
*float autocvar_g_balance_hagar_secondary_load_hold;
*float autocvar_g_balance_hagar_secondary_load_releasedeath;
*float autocvar_g_balance_hagar_secondary_load_abort;
float autocvar_g_balance_hagar_secondary_ammo;
float autocvar_g_balance_hagar_secondary_damage;
float autocvar_g_balance_hagar_secondary_edgedamage;
diff —git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc
index a1047ea..a59ef51 100644
— a/qcsrc/server/cl_client.qc
**+ b/qcsrc/server/cl_client.qc
@ -1064,6 +1064,7
@ void PutClientInServer
if // prevent accessing undefined cvars
self.weapon_load[j] = cvar);
}
- self.weapon_forbidchange = FALSE;
oldself = self;
self = spot;
@ -1121,6 +1122,7
@ float ClientInit_SendEntity WriteByte; // client has to know if it should zoom or not WriteByte; // client has to know if it should zoom or not WriteByte; // minelayer max mines
- WriteByte; // hagar max loadable rockets
WriteCoord;
return TRUE;
}
@ -2369,6 +2371,7
@ void SpectateCopy { self.weapon = spectatee.weapon; self.nex_charge = spectatee.nex_charge; self.nex_chargepool_ammo = spectatee.nex_chargepool_ammo; - self.hagar_load = spectatee.hagar_load;
self.minelayer_mines = spectatee.minelayer_mines;
self.punchangle = spectatee.punchangle;
self.view_ofs = spectatee.view_ofs;
diff —git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc
index 3426c4c..5db6a91 100644
— a/qcsrc/server/cl_player.qc
**+ b/qcsrc/server/cl_player.qc
@ -627,6 +627,7
@ void PlayerDamage ;
- weapon_action;
if
{
diff —git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc
index e605a06..548f7d7 100644
— a/qcsrc/server/cl_weapons.qc
**+ b/qcsrc/server/cl_weapons.qc
@ -282,6 +282,8
@ void W_ThrowWeapon w = self.weapon; if return; // just in case - if
- return;
if)
return;
if
diff —git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc
index f954378..ee4b703 100644
— a/qcsrc/server/cl_weaponsystem.qc
**+ b/qcsrc/server/cl_weaponsystem.qc
@ -34,6 +34,10
@ float W_WeaponRateFactor void W_SwitchWeapon_Force {
- // don’t switch to another weapon if we’re not allowed to
- if
- return;
e.cnt = e.switchweapon;
e.switchweapon = w;
e.selectweapon = w;
diff —git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh
index d7179fa..02f0849 100644
— a/qcsrc/server/defs.qh
**+ b/qcsrc/server/defs.qh
@ -208,6 +208,7
@ void w_clear;
void w_ready;
// VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes
.float weapon_nextthink;
*.float weapon_forbidchange;
.void weapon_think;
//float PLAYER_WEAPONSELECTION_DELAY = );
@ -658,6 +659,8
@ string deathmessage;
.float nex_charge_rottime;
.float nex_chargepool_ammo;
*.float hagar_load;
+
float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn
float serverflags;
diff —git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc
index c45ad96..135f65b 100644
— a/qcsrc/server/g_world.qc
**+ b/qcsrc/server/g_world.qc
@ -833,6 +833,8
@ void spawnfunc_worldspawn
addstat;
addstat;
- addstat;
if
{
addstat;
diff —git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc
index df0d966..7dfd446 100644
— a/qcsrc/server/w_hagar.qc
**+ b/qcsrc/server/w_hagar.qc
@ -112,6 +112,154
@ void W_Hagar_Attack2
other = missile; MUTATOR_CALLHOOK;
}
*.float hagar_loadstep, hagar_loadblock, hagar_loadbeep;
*void W_Hagar_Attack2_Load_Release
*{
- // time to release the rockets we’ve loaded
- local entity missile;
- local float counter, shots;
- local vector s;
- vector forward, right, up;
- if
- return;
- weapon_prepareattack_do;
- W_SetupShot ;
- pointparticles, w_shotorg, w_shotdir * 1000, 1);
- forward = v_forward;
- right = v_right;
- up = v_up;
- shots = self.hagar_load;
- missile = world;
- while
- {
- missile = spawn ;
- missile.owner = missile.realowner = self;
- missile.classname = “missile”;
- missile.bot_dodge = TRUE;
- missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
- missile.touch = W_Hagar_Touch; // not bouncy
- missile.use = W_Hagar_Explode2;
- missile.think = adaptor_think2use_hittype_splash;
- missile.nextthink = time + autocvar_g_balance_hagar_secondary_lifetime_min + random * autocvar_g_balance_hagar_secondary_lifetime_rand;
- PROJECTILE_MAKETRIGGER;
- missile.projectiledeathtype = WEP_HAGAR;
- setorigin ;
- setsize;
- missile.movetype = MOVETYPE_FLY;
- s = ‘0 0 0’;
- if
- s = ‘0 0 0’;
- else
- {
- makevectors / ));
- s_y = v_forward_x;
- s_z = v_forward_y;
- }
- s = s * cvar * g_weaponspreadfactor;
- W_SetupProjectileVelocityEx, 0, 0, 0, FALSE);
- missile.angles = vectoangles ;
- missile.flags = FL_PROJECTILE;
- CSQCProjectile;
- other = missile; MUTATOR_CALLHOOK;
- counter = counter + 1;
- }
- weapon_thinkf;
- self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_refire;
- self.hagar_load = 0; *}
*void W_Hagar_Attack2_Load *{
- // loadable hagar secondary attack, must always run each frame
- local float loaded, enough_ammo;
- loaded = self.hagar_load >= autocvar_g_balance_hagar_secondary_load_max;
- // this is different than WR_CHECKAMMO when it comes to reloading
- if
- enough_ammo = self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo;
- else
- enough_ammo = self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
- if
- {
- if
- {
- if
- {
- // if we pressed primary fire while loading, unload all rockets and abort
- W_DecreaseAmmo; // give back ammo
- self.hagar_load = 0;
- sound;
- // pause until we can load rockets again, once we re-press the alt fire button
- self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_speed;
- // require letting go of the alt fire button before we can load again
- self.hagar_loadblock = TRUE;
- }
- }
- else
- {
- // check if we can attempt to load another rocket
- if
- {
- if
- {
- W_DecreaseAmmo;
- self.hagar_load *= 1;
- sound;
- self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_speed;
- }
- }
- else if // prevents the beep from playing each frame
- {
- // if this is the last rocket we can load, play a beep sound to notify the player
- sound;
- self.hagar_loadbeep = TRUE;
- }
- }
- }
- else if
- {
- // the alt fire button has been released, so re-enable loading if blocked
- self.hagar_loadblock = FALSE;
- }
- if
- {
- self.weapon_forbidchange = TRUE;
- if && self.hagar_loadstep < time && !autocvar_g_balance_hagar_secondary_load_hold))
- W_Hagar_Attack2_Load_Release;
- }
- else
- {
- self.weapon_forbidchange = FALSE;
- self.hagar_loadbeep = FALSE;
- }
- // we aren’t checking ammo during an attack, so we must do it here
- if not + weapon_action)
- {
- W_SwitchToOtherWeapon;
- return;
- } *}
void spawnfunc_weapon_hagar
{
weapon_defaultspawnfunc;
@ -130,9 +278,14
@ float w_hagar
}
else if
{
- local float loadable_secondary;
- loadable_secondary = autocvar_g_balance_hagar_secondary_load && autocvar_g_balance_hagar_secondary;
- if
- W_Hagar_Attack2_Load; // must always run each frame if) // forced reload weapon_action; ~~ else if
- else if // not while secondary is loaded or awaiting reset
{
if )
{
@ -140,7 +293,7
@ float w_hagar weapon_thinkf; } } ~~ else if (self.BUTTON_ATCK2 && autocvar_g_balance_hagar_secondary)
- else if (self.BUTTON_ATCK2 && !loadable_secondary && autocvar_g_balance_hagar_secondary)
{
if (weapon_prepareattack(1, autocvar_g_balance_hagar_secondary_refire))
{
@ -155,12 +308,21
@ float w_hagar(float req) precache_model (“models/weapons/v_hagar.md3”); precache_model (“models/weapons/h_hagar.iqm”); precache_sound (“weapons/hagar_fire.wav”); - precache_sound (“weapons/hagar_load.wav”);
- precache_sound (“weapons/hagar_beep.wav”); //precache_sound (“weapons/reload.wav”); // until weapons have individual reload sounds, precache the reload sound somewhere else } else if (req WR_SETUP) { weapon_setup(WEP_HAGAR); self.current_ammo = ammo_rockets;
-
self.hagar\_loadblock = FALSE;
-
if(self.hagar\_load)
-
{
-
W\_DecreaseAmmo(ammo\_rockets, autocvar\_g\_balance\_hagar\_secondary\_ammo \* self.hagar\_load \* -1, autocvar\_g\_balance\_hagar\_reload\_ammo); // give back ammo if necessary
-
self.hagar\_load = 0;
-
}
@ -174,8 +336,19
@ float w_hagar(float req) ammo_amount *= self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo; return ammo_amount; }
- else if (req WR_RESETPLAYER)
- {
-
self.hagar\_load = 0;
- }
- else if (req WR_PLAYERDEATH)
- {
- // if we have any rockets loaded when we die, release them
- if(self.hagar_load && autocvar_g_balance_hagar_secondary_load_releasedeath)
- W_Hagar_Attack2_Load_Release();
- } else if (req == WR_RELOAD) {
- if not(self.hagar_load) // require releasing loaded rockets first
W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, “weapons/reload.wav”);
}
return TRUE;
diff —git a/sound/weapons/hagar_beep.ogg b/sound/weapons/hagar_beep.ogg
new file mode 100644
index 0000000..52ef8e8
Binary files /dev/null and b/sound/weapons/hagar_beep.ogg differ
diff —git a/sound/weapons/hagar_load.ogg b/sound/weapons/hagar_load.ogg
new file mode 100644
index 0000000..92b88be
Binary files /dev/null and b/sound/weapons/hagar_load.ogg differ
diff —git a/xonotic-credits.txt b/xonotic-credits.txt
index dc5b5c4..4769b35 100644
— a/xonotic-credits.txt
+*+ b/xonotic-credits.txt
@ -32,6 +32,7
@ MirceaKitsune mand1nga Merlijn Hofstra remaxim *Stephan
*Engine Code Additions & QA Rudolf “divVerent” Polzer