From: Mario Date: Wed, 5 Jun 2013 05:59:52 +0000 (+1000) Subject: Begin making nades a separate mutator X-Git-Tag: xonotic-v0.8.0~366^2~25^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=66318bb5b5b81df7106a2e7adac8e5ec2807ca66;p=xonotic%2Fxonotic-data.pk3dir.git Begin making nades a separate mutator --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 66ac0b20b..038f99c15 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1601,3 +1601,16 @@ set cl_weapon_stay_color "2 0.5 0.5" "Color of picked up weapons when g_weapon_s set cl_weapon_stay_alpha 0.75 "Alpha of picked up weapons when g_weapon_stay > 0" seta g_superspectate 0 "server side, allows extended spectator functions through the cmd interface. followpowerup, followstrength, followstshield or followfc [red|blue] will transfer spectation to the relevent player, if any" + +set g_nades 0 "enable off-hand grenades" +set g_nades_spawn 1 "give nades right away when player spawns rather than delaying entire refire" +set g_nades_nade_lifetime 3.5 +set g_nades_nade_minforce 400 +set g_nades_nade_maxforce 2000 +set g_nades_nade_health 25 +set g_nades_nade_refire 6 +set g_nades_nade_damage 225 +set g_nades_nade_edgedamage 90 +set g_nades_nade_radius 300 +set g_nades_nade_force 650 +set g_nades_nade_newton_style 0 diff --git a/effectinfo.txt b/effectinfo.txt index c2f702fa5..d069d5f0f 100644 --- a/effectinfo.txt +++ b/effectinfo.txt @@ -7977,3 +7977,976 @@ size 100 100 alpha 190 190 180 sizeincrease -80 color 0xFFFFFF 0xFFFFFF + + +// nade effects +effect nade_blue +trailspacing 1 +type smoke +color 0x006cff 0x0600ff +tex 65 65 +size 3 3 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade_blue +notunderwater +trailspacing 8 +type smoke +color 0x0600ff 0x9794ff +tex 65 65 +size 15 25 +sizeincrease -10 +alpha 30 30 150 +// bubbles +effect nade_blue +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0x006cff 0x0600ff +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 + +effect nade_red +trailspacing 1 +type smoke +color 0xff0000 0xff3c00 +tex 65 65 +size 3 3 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade_red +notunderwater +trailspacing 8 +type smoke +color 0xff0000 0xffa2a2 +tex 65 65 +size 15 25 +sizeincrease -10 +alpha 30 30 150 +// bubbles +effect nade_red +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0xff0000 0xff3c00 +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 + +effect nade_yellow +trailspacing 1 +type smoke +color 0xFFFF0F 0xFFFF0F +tex 65 65 +size 3 3 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade_yellow +notunderwater +trailspacing 8 +type smoke +color 0xFFFF0F 0xFFFF0F +tex 65 65 +size 15 25 +sizeincrease -10 +alpha 30 30 150 +// bubbles +effect nade_yellow +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0xFFFF0F 0xFFFF0F +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 + +effect nade_pink +trailspacing 1 +type smoke +color 0xFF0FFF 0xFF0FFF +tex 65 65 +size 3 3 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade_pink +notunderwater +trailspacing 8 +type smoke +color 0xFF0FFF 0xFF0FFF +tex 65 65 +size 15 25 +sizeincrease -10 +alpha 30 30 150 +// bubbles +effect nade_pink +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0xFF0FFF 0xFF0FFF +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 + +effect nade +trailspacing 1 +type smoke +color 0xFFFFFF 0xFFFFFF +tex 65 65 +size 3 3 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade +notunderwater +trailspacing 8 +type smoke +color 0xFFFFFF 0xFFFFFF +tex 65 65 +size 15 25 +sizeincrease -10 +alpha 30 30 150 +// bubbles +effect nade +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0xFFFFFF 0xFFFFFF +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 + +effect nade_red_burn +trailspacing 1 +type smoke +color 0xff0000 0xff3c00 +tex 65 65 +size 5 5 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade_red_burn +notunderwater +trailspacing 64 +type smoke +color 0xff0000 0xffa2a2 +tex 65 65 +size 45 25 +sizeincrease -30 +alpha 200 200 1000 +// bubbles +effect nade_red_burn +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0xff0000 0xff3c00 +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 +effect nade_red_burn +trailspacing 16 +type smoke +color 0xff0000 0xff3c00 +tex 71 73 +size 15 25 +sizeincrease -40 +rotate -180 180 20 -20 +originjitter 2 2 2 +velocityjitter 10 10 10 +alpha 300 900 1500 + +effect nade_blue_burn +trailspacing 1 +type smoke +color 0x006cff 0x0600ff +tex 65 65 +size 5 5 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade_blue_burn +notunderwater +trailspacing 64 +type smoke +color 0x0600ff 0x9794ff +tex 65 65 +size 45 25 +sizeincrease -30 +alpha 200 200 1000 +// bubbles +effect nade_blue_burn +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0x006cff 0x0600ff +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 +effect nade_blue_burn +trailspacing 16 +type smoke +color 0x006cff 0x0600ff +tex 33 33 +size 25 25 +sizeincrease -30 + +effect nade_yellow_burn +trailspacing 1 +type smoke +color 0xFFFF0F 0xFFFF0F +tex 65 65 +size 5 5 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade_yellow_burn +notunderwater +trailspacing 64 +type smoke +color 0xFFFF0F 0xFFFF0F +tex 65 65 +size 45 25 +sizeincrease -30 +alpha 200 200 1000 +// bubbles +effect nade_yellow_burn +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0xFFFF0F 0xFFFF0F +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 +effect nade_yellow_burn +trailspacing 16 +type smoke +color 0xFFFF0F 0xFFFF0F +tex 33 33 +size 25 25 +sizeincrease -30 + +effect nade_pink_burn +trailspacing 1 +type smoke +color 0xFF0FFF 0xFF0FFF +tex 65 65 +size 5 5 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade_pink_burn +notunderwater +trailspacing 64 +type smoke +color 0xFF0FFF 0xFF0FFF +tex 65 65 +size 45 25 +sizeincrease -30 +alpha 200 200 1000 +// bubbles +effect nade_pink_burn +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0xFF0FFF 0xFF0FFF +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 +effect nade_pink_burn +trailspacing 16 +type smoke +color 0xFF0FFF 0xFF0FFF +tex 33 33 +size 25 25 +sizeincrease -30 + +effect nade_burn +trailspacing 1 +type smoke +color 0xFFFFFF 0xFFFFFF +tex 65 65 +size 5 5 +sizeincrease -1 +alpha 100 100 250 +//gravity -0.11 +// fire +effect nade_burn +notunderwater +trailspacing 64 +type smoke +color 0xFFFFFF 0xFFFFFF +tex 65 65 +size 45 25 +sizeincrease -30 +alpha 200 200 1000 +// bubbles +effect nade_burn +underwater +trailspacing 16 +type bubble +tex 62 62 +color 0xFFFFFF 0xFFFFFF +size 1 1 +alpha 256 256 256 +gravity -0.125 +bounce 1.5 +liquidfriction 4 +velocityjitter 16 16 16 +effect nade_burn +trailspacing 16 +type smoke +color 0xFFFFFF 0xFFFFFF +tex 33 33 +size 25 25 +sizeincrease -30 + +effect nade_blue_explode +countabsolute 1 +type decal +tex 8 16 +size 88 88 +alpha 256 256 0 +originjitter 26 26 26 +lightradius 300 +lightradiusfade 1500 +lightcolor 20 20 100 +// shockwave +effect nade_blue_explode +type smoke +countabsolute 1 +tex 33 33 +size 32 32 +sizeincrease 1800 +color 0x80C0FF 0x80C0FF +alpha 80 80 650 +velocitymultiplier 44 +// fire +effect nade_blue_explode +notunderwater +count 16 +type smoke +color 0x629dff 0x0018ff +tex 48 55 +size 20 24 +sizeincrease 555 +alpha 400 656 2000 +airfriction 30 +originjitter 50 50 50 +velocityjitter 320 320 320 +rotate -180 180 -9 9 +// fire streched +effect nade_blue_explode +count 8 +type spark +tex 48 55 +color 0x629dff 0x0018ff +size 60 90 +alpha 1500 3000 13000 +stretchfactor 80 +sizeincrease 40 +velocityjitter 30 30 30 +airfriction -9 +//smoke +effect nade_blue_explode +type smoke +count 32 +blend alpha +tex 0 7 +size 60 30 +color 0x222222 0x000000 +alpha 128 328 390 +rotate -180 180 2 -2 +velocityjitter 200 200 200 +velocityoffset 0 0 180 +originjitter 50 50 10 +sizeincrease 50 +airfriction 0.04 +gravity 0.4 +// underwater bubbles +effect nade_blue_explode +underwater +count 32 +type bubble +tex 62 62 +color 0x404040 0x808080 +size 3 6 +alpha 128 256 64 +gravity -0.125 +bounce 1.5 +liquidfriction 0.25 +originjitter 16 16 16 +velocityjitter 196 196 196 +rotate 0 0 0 0 +// bouncing sparks +effect nade_blue_explode +notunderwater +count 8 +type spark +tex 40 40 +color 0x006cff 0x0600ff +size 1 2 +alpha 644 956 484 +gravity 1 +airfriction 1 +bounce 1.6 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// notbouncing sparks +effect nade_blue_explode +count 16 +type spark +tex 40 40 +color 0x006cff 0x0600ff +size 1 2 +alpha 644 956 684 +gravity 0.5 +airfriction 0.7 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// derbis +effect nade_blue_explode +notunderwater +count 12 +type alphastatic +tex 66 68 +color 0x6a3d25 0xcac5b4 +size 2 6 +alpha 644 956 684 +gravity 1.3 +airfriction 0.5 +bounce 1.6 +velocityjitter 324 324 524 +rotate -180 180 -1000 1000 + +effect nade_red_explode +countabsolute 1 +type decal +tex 8 16 +size 88 88 +alpha 256 256 0 +originjitter 26 26 26 +lightradius 300 +lightradiusfade 1500 +lightcolor 100 20 20 +// shockwave +effect nade_red_explode +type smoke +countabsolute 1 +tex 33 33 +size 32 32 +sizeincrease 2200 +color 0xff0000 0xffa2a2 +alpha 80 80 650 +velocitymultiplier 44 +// fire +effect nade_red_explode +notunderwater +count 16 +type smoke +color 0xff0000 0xff4200 +tex 48 55 +size 20 24 +sizeincrease 555 +alpha 400 656 2000 +airfriction 30 +originjitter 50 50 50 +velocityjitter 320 320 320 +rotate -180 180 -9 9 +// fire streched +effect nade_red_explode +count 8 +type spark +tex 48 55 +color 0xff0000 0xff4200 +size 60 90 +alpha 1500 3000 13000 +stretchfactor 80 +sizeincrease 40 +velocityjitter 30 30 30 +airfriction -9 +//smoke +effect nade_red_explode +type smoke +count 32 +blend alpha +tex 0 7 +size 60 30 +color 0x222222 0x000000 +alpha 128 328 390 +rotate -180 180 2 -2 +velocityjitter 200 200 200 +velocityoffset 0 0 180 +originjitter 50 50 10 +sizeincrease 50 +airfriction 0.04 +gravity 0.4 +// underwater bubbles +effect nade_red_explode +underwater +count 32 +type bubble +tex 62 62 +color 0x404040 0x808080 +size 3 6 +alpha 128 256 64 +gravity -0.125 +bounce 1.5 +liquidfriction 0.25 +originjitter 16 16 16 +velocityjitter 196 196 196 +rotate 0 0 0 0 +// bouncing sparks +effect nade_red_explode +notunderwater +count 8 +type spark +tex 40 40 +color 0xff0000 0xffa2a2 +size 1 2 +alpha 644 956 484 +gravity 1 +airfriction 1 +bounce 1.6 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// notbouncing sparks +effect nade_red_explode +count 16 +type spark +tex 40 40 +color 0xff0000 0xffa2a2 +size 1 2 +alpha 644 956 684 +gravity 0.5 +airfriction 0.7 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// derbis +effect nade_red_explode +notunderwater +count 8 +type smoke +tex 71 73 +color 0xff0000 0xffa2a2 +size 20 40 +alpha 644 956 2500 +originjitter 64 64 64 +velocityjitter 324 324 324 +rotate -180 180 -100 100 + +effect nade_yellow_explode +countabsolute 1 +type decal +tex 8 16 +size 88 88 +alpha 256 256 0 +originjitter 26 26 26 +lightradius 300 +lightradiusfade 1500 +lightcolor 100 20 20 +// shockwave +effect nade_yellow_explode +type smoke +countabsolute 1 +tex 33 33 +size 32 32 +sizeincrease 2200 +color 0xff0000 0xffa2a2 +alpha 80 80 650 +velocitymultiplier 44 +// fire +effect nade_yellow_explode +notunderwater +count 16 +type smoke +color 0xFFFF0F 0xFFFF0F +tex 48 55 +size 20 24 +sizeincrease 555 +alpha 400 656 2000 +airfriction 30 +originjitter 50 50 50 +velocityjitter 320 320 320 +rotate -180 180 -9 9 +// fire streched +effect nade_yellow_explode +count 8 +type spark +tex 48 55 +color 0xFFFF0F 0xFFFF0F +size 60 90 +alpha 1500 3000 13000 +stretchfactor 80 +sizeincrease 40 +velocityjitter 30 30 30 +airfriction -9 +//smoke +effect nade_yellow_explode +type smoke +count 32 +blend alpha +tex 0 7 +size 60 30 +color 0x222222 0x000000 +alpha 128 328 390 +rotate -180 180 2 -2 +velocityjitter 200 200 200 +velocityoffset 0 0 180 +originjitter 50 50 10 +sizeincrease 50 +airfriction 0.04 +gravity 0.4 +// underwater bubbles +effect nade_yellow_explode +underwater +count 32 +type bubble +tex 62 62 +color 0x404040 0x808080 +size 3 6 +alpha 128 256 64 +gravity -0.125 +bounce 1.5 +liquidfriction 0.25 +originjitter 16 16 16 +velocityjitter 196 196 196 +rotate 0 0 0 0 +// bouncing sparks +effect nade_yellow_explode +notunderwater +count 8 +type spark +tex 40 40 +color 0xff0000 0xffa2a2 +size 1 2 +alpha 644 956 484 +gravity 1 +airfriction 1 +bounce 1.6 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// notbouncing sparks +effect nade_yellow_explode +count 16 +type spark +tex 40 40 +color 0xff0000 0xffa2a2 +size 1 2 +alpha 644 956 684 +gravity 0.5 +airfriction 0.7 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// derbis +effect nade_yellow_explode +notunderwater +count 8 +type smoke +tex 71 73 +color 0xff0000 0xffa2a2 +size 20 40 +alpha 644 956 2500 +originjitter 64 64 64 +velocityjitter 324 324 324 +rotate -180 180 -100 100 + +effect nade_pink_explode +countabsolute 1 +type decal +tex 8 16 +size 88 88 +alpha 256 256 0 +originjitter 26 26 26 +lightradius 300 +lightradiusfade 1500 +lightcolor 100 20 20 +// shockwave +effect nade_pink_explode +type smoke +countabsolute 1 +tex 33 33 +size 32 32 +sizeincrease 2200 +color 0xff0000 0xffa2a2 +alpha 80 80 650 +velocitymultiplier 44 +// fire +effect nade_pink_explode +notunderwater +count 16 +type smoke +color 0xFF0FFF 0xFF0FFF +tex 48 55 +size 20 24 +sizeincrease 555 +alpha 400 656 2000 +airfriction 30 +originjitter 50 50 50 +velocityjitter 320 320 320 +rotate -180 180 -9 9 +// fire streched +effect nade_pink_explode +count 8 +type spark +tex 48 55 +color 0xFF0FFF 0xFF0FFF +size 60 90 +alpha 1500 3000 13000 +stretchfactor 80 +sizeincrease 40 +velocityjitter 30 30 30 +airfriction -9 +//smoke +effect nade_pink_explode +type smoke +count 32 +blend alpha +tex 0 7 +size 60 30 +color 0x222222 0x000000 +alpha 128 328 390 +rotate -180 180 2 -2 +velocityjitter 200 200 200 +velocityoffset 0 0 180 +originjitter 50 50 10 +sizeincrease 50 +airfriction 0.04 +gravity 0.4 +// underwater bubbles +effect nade_pink_explode +underwater +count 32 +type bubble +tex 62 62 +color 0x404040 0x808080 +size 3 6 +alpha 128 256 64 +gravity -0.125 +bounce 1.5 +liquidfriction 0.25 +originjitter 16 16 16 +velocityjitter 196 196 196 +rotate 0 0 0 0 +// bouncing sparks +effect nade_pink_explode +notunderwater +count 8 +type spark +tex 40 40 +color 0xff0000 0xffa2a2 +size 1 2 +alpha 644 956 484 +gravity 1 +airfriction 1 +bounce 1.6 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// notbouncing sparks +effect nade_pink_explode +count 16 +type spark +tex 40 40 +color 0xff0000 0xffa2a2 +size 1 2 +alpha 644 956 684 +gravity 0.5 +airfriction 0.7 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// derbis +effect nade_pink_explode +notunderwater +count 8 +type smoke +tex 71 73 +color 0xff0000 0xffa2a2 +size 20 40 +alpha 644 956 2500 +originjitter 64 64 64 +velocityjitter 324 324 324 +rotate -180 180 -100 100 + +effect nade_explode +countabsolute 1 +type decal +tex 8 16 +size 88 88 +alpha 256 256 0 +originjitter 26 26 26 +lightradius 300 +lightradiusfade 1500 +lightcolor 100 20 20 +// shockwave +effect nade_explode +type smoke +countabsolute 1 +tex 33 33 +size 32 32 +sizeincrease 2200 +color 0xff0000 0xffa2a2 +alpha 80 80 650 +velocitymultiplier 44 +// fire +effect nade_explode +notunderwater +count 16 +type smoke +color 0xFFFFFF 0xFFFFFF +tex 48 55 +size 20 24 +sizeincrease 555 +alpha 400 656 2000 +airfriction 30 +originjitter 50 50 50 +velocityjitter 320 320 320 +rotate -180 180 -9 9 +// fire streched +effect nade_explode +count 8 +type spark +tex 48 55 +color 0xFFFFFF 0xFFFFFF +size 60 90 +alpha 1500 3000 13000 +stretchfactor 80 +sizeincrease 40 +velocityjitter 30 30 30 +airfriction -9 +//smoke +effect nade_explode +type smoke +count 32 +blend alpha +tex 0 7 +size 60 30 +color 0x222222 0x000000 +alpha 128 328 390 +rotate -180 180 2 -2 +velocityjitter 200 200 200 +velocityoffset 0 0 180 +originjitter 50 50 10 +sizeincrease 50 +airfriction 0.04 +gravity 0.4 +// underwater bubbles +effect nade_explode +underwater +count 32 +type bubble +tex 62 62 +color 0x404040 0x808080 +size 3 6 +alpha 128 256 64 +gravity -0.125 +bounce 1.5 +liquidfriction 0.25 +originjitter 16 16 16 +velocityjitter 196 196 196 +rotate 0 0 0 0 +// bouncing sparks +effect nade_explode +notunderwater +count 8 +type spark +tex 40 40 +color 0xff0000 0xffa2a2 +size 1 2 +alpha 644 956 484 +gravity 1 +airfriction 1 +bounce 1.6 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// notbouncing sparks +effect nade_explode +count 16 +type spark +tex 40 40 +color 0xff0000 0xffa2a2 +size 1 2 +alpha 644 956 684 +gravity 0.5 +airfriction 0.7 +liquidfriction 0.8 +velocityoffset 0 0 80 +originjitter 16 16 16 +velocityjitter 424 424 624 +// derbis +effect nade_explode +notunderwater +count 8 +type smoke +tex 71 73 +color 0xff0000 0xffa2a2 +size 20 40 +alpha 644 956 2500 +originjitter 64 64 64 +velocityjitter 324 324 324 +rotate -180 180 -100 100 diff --git a/models/ok_nade_counter/ok_nade_counter.md3 b/models/ok_nade_counter/ok_nade_counter.md3 new file mode 100644 index 000000000..7bcd7ef96 Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter.md3 differ diff --git a/models/ok_nade_counter/ok_nade_counter.md3_0.skin b/models/ok_nade_counter/ok_nade_counter.md3_0.skin new file mode 100644 index 000000000..f51048689 --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_0.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_01 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter.md3_1.skin b/models/ok_nade_counter/ok_nade_counter.md3_1.skin new file mode 100644 index 000000000..c7bfc3b11 --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_1.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_02 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter.md3_2.skin b/models/ok_nade_counter/ok_nade_counter.md3_2.skin new file mode 100644 index 000000000..ee84c4f24 --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_2.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_03 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter.md3_3.skin b/models/ok_nade_counter/ok_nade_counter.md3_3.skin new file mode 100644 index 000000000..df0b108a7 --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_3.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_04 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter.md3_4.skin b/models/ok_nade_counter/ok_nade_counter.md3_4.skin new file mode 100644 index 000000000..d76d11092 --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_4.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_05 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter.md3_5.skin b/models/ok_nade_counter/ok_nade_counter.md3_5.skin new file mode 100644 index 000000000..c25c2b52d --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_5.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_06 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter.md3_6.skin b/models/ok_nade_counter/ok_nade_counter.md3_6.skin new file mode 100644 index 000000000..df0393048 --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_6.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_07 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter.md3_7.skin b/models/ok_nade_counter/ok_nade_counter.md3_7.skin new file mode 100644 index 000000000..3021e514b --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_7.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_08 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter.md3_8.skin b/models/ok_nade_counter/ok_nade_counter.md3_8.skin new file mode 100644 index 000000000..e3df814e3 --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_8.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_09 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter.md3_9.skin b/models/ok_nade_counter/ok_nade_counter.md3_9.skin new file mode 100644 index 000000000..1402b7a0b --- /dev/null +++ b/models/ok_nade_counter/ok_nade_counter.md3_9.skin @@ -0,0 +1 @@ +sprite,models/ok_nade_counter/ok_nade_counter_10 \ No newline at end of file diff --git a/models/ok_nade_counter/ok_nade_counter_01.tga b/models/ok_nade_counter/ok_nade_counter_01.tga new file mode 100644 index 000000000..c58a70da2 Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter_01.tga differ diff --git a/models/ok_nade_counter/ok_nade_counter_02.tga b/models/ok_nade_counter/ok_nade_counter_02.tga new file mode 100644 index 000000000..3d91413b6 Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter_02.tga differ diff --git a/models/ok_nade_counter/ok_nade_counter_03.tga b/models/ok_nade_counter/ok_nade_counter_03.tga new file mode 100644 index 000000000..eddb7cbcc Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter_03.tga differ diff --git a/models/ok_nade_counter/ok_nade_counter_04.tga b/models/ok_nade_counter/ok_nade_counter_04.tga new file mode 100644 index 000000000..7f14db672 Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter_04.tga differ diff --git a/models/ok_nade_counter/ok_nade_counter_05.tga b/models/ok_nade_counter/ok_nade_counter_05.tga new file mode 100644 index 000000000..a7cdf8ca2 Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter_05.tga differ diff --git a/models/ok_nade_counter/ok_nade_counter_06.tga b/models/ok_nade_counter/ok_nade_counter_06.tga new file mode 100644 index 000000000..150f061ff Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter_06.tga differ diff --git a/models/ok_nade_counter/ok_nade_counter_07.tga b/models/ok_nade_counter/ok_nade_counter_07.tga new file mode 100644 index 000000000..36e5c3b31 Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter_07.tga differ diff --git a/models/ok_nade_counter/ok_nade_counter_08.tga b/models/ok_nade_counter/ok_nade_counter_08.tga new file mode 100644 index 000000000..3f4239493 Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter_08.tga differ diff --git a/models/ok_nade_counter/ok_nade_counter_09.tga b/models/ok_nade_counter/ok_nade_counter_09.tga new file mode 100644 index 000000000..31219ab3f Binary files /dev/null and b/models/ok_nade_counter/ok_nade_counter_09.tga differ diff --git a/qcsrc/client/projectile.qc b/qcsrc/client/projectile.qc index fb4fdd5ef..7ee071a75 100644 --- a/qcsrc/client/projectile.qc +++ b/qcsrc/client/projectile.qc @@ -300,6 +300,17 @@ void Ent_Projectile() case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; + + case PROJECTILE_NADE_RED: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_red"); break; + case PROJECTILE_NADE_RED_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_red_burn"); break; + case PROJECTILE_NADE_BLUE: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_blue"); break; + case PROJECTILE_NADE_BLUE_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_blue_burn"); break; + case PROJECTILE_NADE_YELLOW: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_yellow"); break; + case PROJECTILE_NADE_YELLOW_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_yellow_burn"); break; + case PROJECTILE_NADE_PINK: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_pink"); break; + case PROJECTILE_NADE_PINK_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_pink_burn"); break; + case PROJECTILE_NADE: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade"); break; + case PROJECTILE_NADE_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_burn"); break; default: error("Received invalid CSQC projectile, can't work with this!"); @@ -342,6 +353,23 @@ void Ent_Projectile() self.move_bounce_factor = g_balance_grenadelauncher_bouncefactor; self.move_bounce_stopspeed = g_balance_grenadelauncher_bouncestop; break; + case PROJECTILE_NADE_RED_BURN: + case PROJECTILE_NADE_RED: + case PROJECTILE_NADE_BLUE_BURN: + case PROJECTILE_NADE_BLUE: + case PROJECTILE_NADE_YELLOW_BURN: + case PROJECTILE_NADE_YELLOW: + case PROJECTILE_NADE_PINK_BURN: + case PROJECTILE_NADE_PINK: + case PROJECTILE_NADE_BURN: + case PROJECTILE_NADE: + self.mins = '-3 -3 -3'; + self.maxs = '3 3 3'; + self.move_movetype = MOVETYPE_BOUNCE; + self.move_touch = func_null; + self.scale = 1.5; + self.avelocity = randomvec() * 720; + break; case PROJECTILE_MINE: self.mins = '-4 -4 -4'; self.maxs = '4 4 4'; diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index b399f3857..1a70b341d 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -355,6 +355,17 @@ float PROJECTILE_WAKICANNON = 29; float PROJECTILE_BUMBLE_GUN = 30; float PROJECTILE_BUMBLE_BEAM = 31; +float PROJECTILE_NADE_RED = 50; +float PROJECTILE_NADE_RED_BURN = 51; +float PROJECTILE_NADE_BLUE = 52; +float PROJECTILE_NADE_BLUE_BURN = 53; +float PROJECTILE_NADE_YELLOW = 54; +float PROJECTILE_NADE_YELLOW_BURN = 55; +float PROJECTILE_NADE_PINK = 56; +float PROJECTILE_NADE_PINK_BURN = 57; +float PROJECTILE_NADE = 58; +float PROJECTILE_NADE_BURN = 59; + float SPECIES_HUMAN = 0; float SPECIES_ROBOT_SOLID = 1; float SPECIES_ALIEN = 2; diff --git a/qcsrc/common/deathtypes.qh b/qcsrc/common/deathtypes.qh index f9a9ceba2..48a269b1a 100644 --- a/qcsrc/common/deathtypes.qh +++ b/qcsrc/common/deathtypes.qh @@ -15,6 +15,7 @@ DEATHTYPE(DEATH_KILL, DEATH_SELF_SUICIDE, NO_MSG, NORMAL_POS) \ DEATHTYPE(DEATH_LAVA, DEATH_SELF_LAVA, DEATH_MURDER_LAVA, NORMAL_POS) \ DEATHTYPE(DEATH_MIRRORDAMAGE, DEATH_SELF_BETRAYAL, NO_MSG, NORMAL_POS) \ + DEATHTYPE(DEATH_NADE, DEATH_SELF_NADE, DEATH_MURDER_NADE, NORMAL_POS) \ DEATHTYPE(DEATH_NOAMMO, DEATH_SELF_NOAMMO, NO_MSG, NORMAL_POS) \ DEATHTYPE(DEATH_ROT, DEATH_SELF_ROT, NO_MSG, NORMAL_POS) \ DEATHTYPE(DEATH_SHOOTING_STAR, DEATH_SELF_SHOOTING_STAR, DEATH_MURDER_SHOOTING_STAR, NORMAL_POS) \ diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 9bd8d5e32..576743222 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -263,6 +263,7 @@ void Send_Notification_WOVA( MSG_INFO_NOTIF(1, INFO_DEATH_MURDER_FALL, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_fall", _("^BG%s%s^K1 was grounded by ^BG%s^K1%s%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_DEATH_MURDER_FIRE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_death", _("^BG%s%s^K1 was burnt up into a crisp by ^BG%s^K1%s%s\n"), _("^BG%s%s^K1 felt a little hot from ^BG%s^K1's fire^K1%s%s\n")) \ MSG_INFO_NOTIF(1, INFO_DEATH_MURDER_LAVA, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_lava", _("^BG%s%s^K1 was cooked by ^BG%s^K1%s%s\n"), "") \ + MSG_INFO_NOTIF(1, INFO_DEATH_MURDER_NADE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_death", _("^BG%s%s^K1 was blown up by ^BG%s^K1's Nade%s%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_DEATH_MURDER_SHOOTING_STAR, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_shootingstar", _("^BG%s%s^K1 was shot into space by ^BG%s^K1%s%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_DEATH_MURDER_SLIME, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_slime", _("^BG%s%s^K1 was slimed by ^BG%s^K1%s%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_DEATH_MURDER_SWAMP, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "notify_slime", _("^BG%s%s^K1 was preserved by ^BG%s^K1%s%s\n"), "") \ @@ -291,6 +292,7 @@ void Send_Notification_WOVA( MSG_INFO_NOTIF(1, INFO_DEATH_SELF_FIRE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_death", _("^BG%s^K1 became a bit too crispy%s%s\n"), _("^BG%s^K1 felt a little hot%s%s\n")) \ MSG_INFO_NOTIF(1, INFO_DEATH_SELF_GENERIC, 2, 1, "s1 s2loc spree_lost", "s1", "notify_selfkill", _("^BG%s^K1 died%s%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_DEATH_SELF_LAVA, 2, 1, "s1 s2loc spree_lost", "s1", "notify_lava", _("^BG%s^K1 turned into hot slag%s%s\n"), _("^BG%s^K1 found a hot place%s%s\n")) \ + MSG_INFO_NOTIF(1, INFO_DEATH_SELF_NADE, 2, 1, "s1 s2loc spree_lost", "s1", "notify_death", _("^BG%s^K1 mastered the art of self-nading%s%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_DEATH_SELF_NOAMMO, 2, 1, "s1 s2loc spree_lost", "s1", "notify_outofammo", _("^BG%s^K1 died%s%s. What's the point of living without ammo?\n"), _("^BG%s^K1 ran out of ammo%s%s\n")) \ MSG_INFO_NOTIF(1, INFO_DEATH_SELF_ROT, 2, 1, "s1 s2loc spree_lost", "s1", "notify_death", _("^BG%s^K1 rotted away%s%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_DEATH_SELF_SHOOTING_STAR, 2, 1, "s1 s2loc spree_lost", "s1", "notify_shootingstar", _("^BG%s^K1 became a shooting star%s%s\n"), "") \ @@ -463,6 +465,7 @@ void Send_Notification_WOVA( MSG_CENTER_NOTIF(1, CENTER_DEATH_MURDER_TYPEFRAGGED, 1, 1, "spree_cen s1", NO_CPID, "0 0", _("^K1%sYou were typefragged by ^BG%s"), _("^K1%sYou were scored against by ^BG%s^K1 while typing!")) \ MSG_CENTER_NOTIF(1, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE, 1, 4, "spree_cen s1 frag_stats", NO_CPID, "0 0", _("^K1%sYou were typefragged by ^BG%s^BG%s"), _("^K1%sYou were scored against by ^BG%s^K1 while typing^BG%s")) \ MSG_CENTER_NOTIF(1, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE, 1, 2, "spree_cen s1 frag_ping", NO_CPID, "0 0", _("^K1%sYou typefragged ^BG%s^BG%s"), _("^K1%sYou scored against ^BG%s^K1 while they were typing^BG%s")) \ + MSG_CENTER_NOTIF(1, CENTER_NADE_THROW, 0, 0, "", CPID_NADES, "0 0", _("^BGPress ^F2DROPWEAPON^BG again to toss the nade!"), "") \ MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_AUTOTEAMCHANGE, 0, 1, "death_team", NO_CPID, "0 0", _("^BGYou have been moved into a different team\nYou are now on: %s"), "") \ MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_BETRAYAL, 0, 0, "", NO_CPID, "0 0", _("^K1Don't shoot your team mates!"), _("^K1Don't go against your team mates!")) \ MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_CAMP, 0, 0, "", NO_CPID, "0 0", _("^K1Die camper!"), _("^K1Reconsider your tactics, camper!")) \ @@ -473,6 +476,7 @@ void Send_Notification_WOVA( MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_FIRE, 0, 0, "", NO_CPID, "0 0", _("^K1You got a little bit too crispy!"), _("^K1You felt a little too hot!")) \ MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_GENERIC, 0, 0, "", NO_CPID, "0 0", _("^K1You killed your own dumb self!"), _("^K1You need to be more careful!")) \ MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_LAVA, 0, 0, "", NO_CPID, "0 0", _("^K1You couldn't stand the heat!"), "") \ + MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_NADE, 0, 0, "", NO_CPID, "0 0", _("^K1You forgot to put the pin back in!"), _("^K1Try throwing the nade!")) \ MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_NOAMMO, 0, 0, "", NO_CPID, "0 0", _("^K1You were killed for running out of ammo..."), _("^K1You are respawning for running out of ammo...")) \ MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_ROT, 0, 0, "", NO_CPID, "0 0", _("^K1You grew too old without taking your medicine"), _("^K1You need to preserve your health")) \ MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_SHOOTING_STAR, 0, 0, "", NO_CPID, "0 0", _("^K1You became a shooting star!"), "") \ @@ -561,6 +565,7 @@ void Send_Notification_WOVA( MSG_MULTI_NOTIF(1, DEATH_MURDER_FALL, NO_MSG, INFO_DEATH_MURDER_FALL, NO_MSG) \ MSG_MULTI_NOTIF(1, DEATH_MURDER_FIRE, NO_MSG, INFO_DEATH_MURDER_FIRE, NO_MSG) \ MSG_MULTI_NOTIF(1, DEATH_MURDER_LAVA, NO_MSG, INFO_DEATH_MURDER_LAVA, NO_MSG) \ + MSG_MULTI_NOTIF(1, DEATH_MURDER_NADE, NO_MSG, INFO_DEATH_MURDER_NADE, NO_MSG) \ MSG_MULTI_NOTIF(1, DEATH_MURDER_SHOOTING_STAR, NO_MSG, INFO_DEATH_MURDER_SHOOTING_STAR, NO_MSG) \ MSG_MULTI_NOTIF(1, DEATH_MURDER_SLIME, NO_MSG, INFO_DEATH_MURDER_SLIME, NO_MSG) \ MSG_MULTI_NOTIF(1, DEATH_MURDER_SWAMP, NO_MSG, INFO_DEATH_MURDER_SWAMP, NO_MSG) \ @@ -589,6 +594,7 @@ void Send_Notification_WOVA( MSG_MULTI_NOTIF(1, DEATH_SELF_FIRE, NO_MSG, INFO_DEATH_SELF_FIRE, CENTER_DEATH_SELF_FIRE) \ MSG_MULTI_NOTIF(1, DEATH_SELF_GENERIC, NO_MSG, INFO_DEATH_SELF_GENERIC, CENTER_DEATH_SELF_GENERIC) \ MSG_MULTI_NOTIF(1, DEATH_SELF_LAVA, NO_MSG, INFO_DEATH_SELF_LAVA, CENTER_DEATH_SELF_LAVA) \ + MSG_MULTI_NOTIF(1, DEATH_SELF_NADE, NO_MSG, INFO_DEATH_SELF_NADE, CENTER_DEATH_SELF_NADE) \ MSG_MULTI_NOTIF(1, DEATH_SELF_NOAMMO, NO_MSG, INFO_DEATH_SELF_NOAMMO, CENTER_DEATH_SELF_NOAMMO) \ MSG_MULTI_NOTIF(1, DEATH_SELF_ROT, NO_MSG, INFO_DEATH_SELF_ROT, CENTER_DEATH_SELF_ROT) \ MSG_MULTI_NOTIF(1, DEATH_SELF_SHOOTING_STAR, NO_MSG, INFO_DEATH_SELF_SHOOTING_STAR, CENTER_DEATH_SELF_SHOOTING_STAR) \ diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index dead5a9d4..56a1f2ba7 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -1234,3 +1234,15 @@ float autocvar_g_touchexplode_radius; float autocvar_g_touchexplode_damage; float autocvar_g_touchexplode_edgedamage; float autocvar_g_touchexplode_force; +float autocvar_g_nades; +float autocvar_g_nades_spawn; +float autocvar_g_nades_nade_lifetime; +float autocvar_g_nades_nade_minforce; +float autocvar_g_nades_nade_maxforce; +float autocvar_g_nades_nade_health; +float autocvar_g_nades_nade_refire; +float autocvar_g_nades_nade_damage; +float autocvar_g_nades_nade_edgedamage; +float autocvar_g_nades_nade_radius; +float autocvar_g_nades_nade_force; +float autocvar_g_nades_nade_newton_style; diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 26af874e2..3a963d4ba 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -667,6 +667,9 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) complain = 0; if(complain) self.hasweapon_complain_spam = time + 0.2; + + if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !WEPSET_CONTAINS_AW(weaponsInMap, wpn)) + complain = 0; if (wpn < WEP_FIRST || wpn > WEP_LAST) { diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index f69b13321..923bcec80 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -919,6 +919,7 @@ void readlevelcvars(void) CHECK_MUTATOR_ADD("g_rocket_flying", mutator_rocketflying, !cvar("g_minstagib")); CHECK_MUTATOR_ADD("g_vampire", mutator_vampire, !cvar("g_minstagib")); CHECK_MUTATOR_ADD("g_superspectate", mutator_superspec, 1); + CHECK_MUTATOR_ADD("g_nades", mutator_nades, 1); CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1); #undef CHECK_MUTATOR_ADD diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc new file mode 100644 index 000000000..fc2182377 --- /dev/null +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -0,0 +1,346 @@ +.entity nade; +.float nade_refire; + +void nade_timer_think() +{ + self.skin = 8 - (self.owner.wait - time) / (autocvar_g_nades_nade_lifetime / 10); + self.nextthink = time; + if(!self.owner || wasfreed(self.owner)) + remove(self); + +} + +void nade_burn_spawn(entity _nade) +{ + float p; + + switch(_nade.realowner.team) + { + case NUM_TEAM_1: p = PROJECTILE_NADE_RED_BURN; break; + case NUM_TEAM_2: p = PROJECTILE_NADE_BLUE_BURN; break; + case NUM_TEAM_3: p = PROJECTILE_NADE_YELLOW_BURN; break; + case NUM_TEAM_4: p = PROJECTILE_NADE_PINK_BURN; break; + default: p = PROJECTILE_NADE_BURN; break; + } + + CSQCProjectile(_nade, TRUE, p, TRUE); +} + +void nade_spawn(entity _nade) +{ + float p; + entity timer = spawn(); + setmodel(timer, "models/ok_nade_counter/ok_nade_counter.md3"); + setattachment(timer, _nade, ""); + timer.classname = "nade_timer"; + timer.colormap = _nade.colormap; + timer.glowmod = _nade.glowmod; + timer.think = nade_timer_think; + timer.nextthink = time; + timer.wait = _nade.wait; + timer.owner = _nade; + timer.skin = 10; + + switch(_nade.realowner.team) + { + case NUM_TEAM_1: p = PROJECTILE_NADE_RED; break; + case NUM_TEAM_2: p = PROJECTILE_NADE_BLUE; break; + case NUM_TEAM_3: p = PROJECTILE_NADE_YELLOW; break; + case NUM_TEAM_4: p = PROJECTILE_NADE_PINK; break; + default: p = PROJECTILE_NADE; break; + } + + CSQCProjectile(_nade, TRUE, p, TRUE); + +} + +void nade_boom() // TODO: DamageInfo +{ + string expef; + + switch(self.realowner.team) + { + case NUM_TEAM_1: expef = "nade_blue_explode"; break; + case NUM_TEAM_2: expef = "nade_red_explode"; break; + case NUM_TEAM_3: expef = "nade_yellow_explode"; break; + case NUM_TEAM_4: expef = "nade_pink_explode"; break; + default: expef = "nade_explode"; break; + } + + sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); + pointparticles(particleeffectnum(expef), self.origin + '0 0 1', '0 0 0', 1); + + self.takedamage = DAMAGE_NO; + RadiusDamage(self, self.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, + autocvar_g_nades_nade_radius, self, autocvar_g_nades_nade_force, self.projectiledeathtype, self.enemy); + + remove(self); +} + +void nade_touch() +{ + PROJECTILE_TOUCH; + setsize(self, '-2 -2 -2', '2 2 2'); + UpdateCSQCProjectile(self); + if(self.health == autocvar_g_nades_nade_health) + { + spamsound(self, CH_SHOTS, strcat("weapons/grenade_bounce", ftos(1 + rint(random() * 5)), ".wav"), VOL_BASE, ATTN_NORM); + return; + } + + self.enemy = other; + nade_boom(); +} + +void nade_beep() +{ + sound(self, CH_SHOTS_SINGLE, "overkill/grenadebip.ogg", VOL_BASE, 0.5 *(ATTN_LARGE + ATTN_MAX)); + self.think = nade_boom; + self.nextthink = max(self.wait, time); +} + +void nade_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) +{ + if(DEATH_ISWEAPON(deathtype, WEP_LASER)) + return; + + if(DEATH_ISWEAPON(deathtype, WEP_NEX) || DEATH_ISWEAPON(deathtype, WEP_MINSTANEX)) + { + force *= 6; + damage = autocvar_g_nades_nade_health * 0.55; + } + + if(DEATH_ISWEAPON(deathtype, WEP_UZI)) + damage = autocvar_g_nades_nade_health * 0.1; + + if(DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) + damage = autocvar_g_nades_nade_health * 1.1; + + self.velocity += force; + + if(!damage) + return; + + if(self.health == autocvar_g_nades_nade_health) + { + sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, 0.5 *(ATTN_LARGE + ATTN_MAX)); + self.nextthink = max(time + autocvar_g_nades_nade_lifetime, time); + self.think = nade_beep; + } + + self.health -= damage; + self.realowner = attacker; + + if(self.health <= 0) + W_PrepareExplosionByDamage(attacker, nade_boom); + else + nade_burn_spawn(self); +} + +void toss_nade(entity e, vector _velocity, float _time) +{ + entity _nade = e.nade; + e.nade = world; + + Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_NADES); + + setorigin(_nade, gettaginfo(_nade, gettagindex(_nade, "Object001"))); + setattachment(_nade, world, ""); + PROJECTILE_MAKETRIGGER(_nade); + setsize(_nade, '-16 -16 -16', '16 16 16'); + _nade.movetype = MOVETYPE_BOUNCE; + + if(e.crouch) + _nade.velocity = '0 0 -10'; + else if(autocvar_g_nades_nade_newton_style == 1) + _nade.velocity = e.velocity + _velocity; + else if(autocvar_g_nades_nade_newton_style == 2) + _nade.velocity = _velocity; + else + _nade.velocity = W_CalculateProjectileVelocity(e.velocity, _velocity, FALSE); + + _nade.solid = SOLID_BBOX; + _nade.touch = nade_touch; + _nade.health = autocvar_g_nades_nade_health; + _nade.takedamage = DAMAGE_YES; + _nade.event_damage = nade_damage; + _nade.teleportable = TRUE; + + nade_spawn(_nade); + + if(_time) + { + _nade.think = nade_boom; + _nade.nextthink = _time; + } + + e.nade_refire = time + autocvar_g_nades_nade_refire; +} + +void nade_prime() +{ + if(self.nade) + remove(self.nade); + + self.nade = spawn(); + setmodel(self.nade, "models/weapons/h_ok_grenade.iqm"); + setattachment(self.nade, self.weaponentity, ""); + self.nade.classname = "nade"; + self.nade.realowner = self; + self.nade.colormap = self.colormap; + self.nade.glowmod = self.glowmod; + self.nade.wait = time + autocvar_g_nades_nade_lifetime; + self.nade.cnt = time; + self.nade.think = nade_beep; + self.nade.nextthink = max(self.nade.wait - 3, time); + self.nade.projectiledeathtype = DEATH_NADE; +} + +float CanThrowNade() +{ + if(self.vehicle) + return FALSE; + + if(gameover) + return FALSE; + + if not(autocvar_g_nades) + return FALSE; // allow turning them off mid match + + if(forbidWeaponUse()) + return FALSE; + + return TRUE; +} + +MUTATOR_HOOKFUNCTION(nades_ForbidThrowing) +{ + if(!g_weaponarena || !g_minstagib) + return FALSE; // TODO: fix this to support all modes that don't disable weapon dropping + + if(!CanThrowNade()) + return FALSE; + + if(!self.nade) + { + if(self.nade_refire < time) + { + Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_NADE_THROW); + nade_prime(); + self.nade_refire = time + autocvar_g_nades_nade_refire; + } + } + else + { + if(time - self.nade.cnt >= 1) + { + makevectors(self.v_angle); + float _force = time - self.nade.cnt; + _force /= autocvar_g_nades_nade_lifetime; + _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce)); + toss_nade(self, (v_forward * 0.75 + v_up * 0.2 + v_right * 0.05) * _force, 0); + } + } + + return TRUE; +} + +MUTATOR_HOOKFUNCTION(nades_VehicleEnter) +{ + if(other.nade) + toss_nade(other, '0 0 100', max(other.nade.wait, time + 0.05)); + + return FALSE; +} + +MUTATOR_HOOKFUNCTION(nades_PlayerPreThink) +{ + float key_pressed = ((g_grappling_hook) ? self.button16 : self.BUTTON_HOOK); + + if(self.nade) + if(self.nade.wait - 0.1 <= time) + toss_nade(self, '0 0 0', time + 0.05); + + if(CanThrowNade()) + if(self.nade_refire < time) + { + if(key_pressed) + { + if(!self.nade) + nade_prime(); + } + else if(time - self.nade.cnt >= 1) + { + if(self.nade) + { + makevectors(self.v_angle); + float _force = time - self.nade.cnt; + _force /= autocvar_g_nades_nade_lifetime; + _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce)); + toss_nade(self, (v_forward * 0.7 + v_up * 0.2 + v_right * 0.1) * _force, 0); + } + } + } + + return FALSE; +} + +MUTATOR_HOOKFUNCTION(nades_PlayerSpawn) +{ + if(autocvar_g_nades_spawn) + self.nade_refire = time + autocvar_g_spawnshieldtime; + else + self.nade_refire = time + autocvar_g_nades_nade_refire; + + return FALSE; +} + +MUTATOR_HOOKFUNCTION(nades_PlayerDies) +{ + if(self.nade) + toss_nade(self, '0 0 100', max(self.nade.wait, time + 0.05)); + + return FALSE; +} + +MUTATOR_HOOKFUNCTION(nades_BuildMutatorsString) +{ + ret_string = strcat(ret_string, ":Nades"); + return FALSE; +} + +MUTATOR_HOOKFUNCTION(nades_BuildMutatorsPrettyString) +{ + ret_string = strcat(ret_string, ", Nades"); + return FALSE; +} + +MUTATOR_DEFINITION(mutator_nades) +{ + MUTATOR_HOOK(ForbidThrowCurrentWeapon, nades_ForbidThrowing, CBC_ORDER_ANY); + MUTATOR_HOOK(VehicleEnter, nades_VehicleEnter, CBC_ORDER_ANY); + MUTATOR_HOOK(PlayerPreThink, nades_PlayerPreThink, CBC_ORDER_ANY); + MUTATOR_HOOK(PlayerSpawn, nades_PlayerSpawn, CBC_ORDER_ANY); + MUTATOR_HOOK(PlayerDies, nades_PlayerDies, CBC_ORDER_ANY); + MUTATOR_HOOK(BuildMutatorsString, nades_BuildMutatorsString, CBC_ORDER_ANY); + MUTATOR_HOOK(BuildMutatorsPrettyString, nades_BuildMutatorsPrettyString, CBC_ORDER_ANY); + + MUTATOR_ONADD + { + precache_model("models/ok_nade_counter/ok_nade_counter.md3"); + + precache_model("models/weapons/h_ok_grenade.iqm"); + precache_model("models/weapons/v_ok_grenade.md3"); + precache_sound("weapons/rocket_impact.wav"); + precache_sound("weapons/grenade_bounce1.wav"); + precache_sound("weapons/grenade_bounce2.wav"); + precache_sound("weapons/grenade_bounce3.wav"); + precache_sound("weapons/grenade_bounce4.wav"); + precache_sound("weapons/grenade_bounce5.wav"); + precache_sound("weapons/grenade_bounce6.wav"); + precache_sound("overkill/grenadebip.ogg"); + } + + return FALSE; +} diff --git a/qcsrc/server/mutators/mutators.qh b/qcsrc/server/mutators/mutators.qh index 3f9f020af..4f2f87aa4 100644 --- a/qcsrc/server/mutators/mutators.qh +++ b/qcsrc/server/mutators/mutators.qh @@ -21,5 +21,6 @@ MUTATOR_DECLARATION(mutator_vampire); MUTATOR_DECLARATION(mutator_superspec); MUTATOR_DECLARATION(mutator_minstagib); MUTATOR_DECLARATION(mutator_touchexplode); +MUTATOR_DECLARATION(mutator_nades); MUTATOR_DECLARATION(sandbox); diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index df5623f05..021b9b9b0 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -248,6 +248,7 @@ mutators/sandbox.qc mutators/mutator_superspec.qc mutators/mutator_minstagib.qc mutators/mutator_touchexplode.qc +mutators/mutator_nades.qc ../warpzonelib/anglestransform.qc ../warpzonelib/mathlib.qc diff --git a/scripts/ok_nade_counter.shader b/scripts/ok_nade_counter.shader new file mode 100644 index 000000000..130bee7ab --- /dev/null +++ b/scripts/ok_nade_counter.shader @@ -0,0 +1,90 @@ +models/ok_nade_counter/ok_nade_counter_01 +{ + dpnoshadow + deformVertexes autosprite + dppolygonoffset -6000 + { + map "models/ok_nade_counter/ok_nade_counter_01" + blendfunc add + } +} +models/ok_nade_counter/ok_nade_counter_02 +{ + dpnoshadow + deformVertexes autosprite + dppolygonoffset -6000 + { + map "models/ok_nade_counter/ok_nade_counter_02" + blendfunc add + } +} +models/ok_nade_counter/ok_nade_counter_03 +{ + dpnoshadow + deformVertexes autosprite + dppolygonoffset -6000 + { + map "models/ok_nade_counter/ok_nade_counter_03" + blendfunc add + } +} +models/ok_nade_counter/ok_nade_counter_04 +{ + dpnoshadow + deformVertexes autosprite + dppolygonoffset -6000 + { + map "models/ok_nade_counter/ok_nade_counter_04" + blendfunc add + } +} +models/ok_nade_counter/ok_nade_counter_05 +{ + dpnoshadow + deformVertexes autosprite + dppolygonoffset -6000 + { + map "models/ok_nade_counter/ok_nade_counter_05" + blendfunc add + } +} +models/ok_nade_counter/ok_nade_counter_06 +{ + dpnoshadow + deformVertexes autosprite + dppolygonoffset -6000 + { + map "models/ok_nade_counter/ok_nade_counter_06" + blendfunc add + } +} +models/ok_nade_counter/ok_nade_counter_07 +{ + dpnoshadow + deformVertexes autosprite + dppolygonoffset -6000 + { + map "models/ok_nade_counter/ok_nade_counter_07" + blendfunc add + } +} +models/ok_nade_counter/ok_nade_counter_08 +{ + dpnoshadow + deformVertexes autosprite + dppolygonoffset -6000 + { + map "models/ok_nade_counter/ok_nade_counter_08" + blendfunc add + } +} +models/ok_nade_counter/ok_nade_counter_09 +{ + dpnoshadow + deformVertexes autosprite + dppolygonoffset -6000 + { + map "models/ok_nade_counter/ok_nade_counter_09" + blendfunc add + } +} \ No newline at end of file