]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Messy rewrite & port of the popular camping rifle arena Nexuiz mod
authorMario <mario.mario@y7mail.com>
Fri, 3 May 2013 19:12:07 +0000 (05:12 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 3 May 2013 19:12:07 +0000 (05:12 +1000)
37 files changed:
defaultXonotic.cfg
effectinfo.txt
models/nade_counter/nade_counter.md3 [new file with mode: 0644]
models/nade_counter/nade_counter.md3_0.skin [new file with mode: 0644]
models/nade_counter/nade_counter.md3_1.skin [new file with mode: 0644]
models/nade_counter/nade_counter.md3_2.skin [new file with mode: 0644]
models/nade_counter/nade_counter.md3_3.skin [new file with mode: 0644]
models/nade_counter/nade_counter.md3_4.skin [new file with mode: 0644]
models/nade_counter/nade_counter.md3_5.skin [new file with mode: 0644]
models/nade_counter/nade_counter.md3_6.skin [new file with mode: 0644]
models/nade_counter/nade_counter.md3_7.skin [new file with mode: 0644]
models/nade_counter/nade_counter.md3_8.skin [new file with mode: 0644]
models/nade_counter/nade_counter.md3_9.skin [new file with mode: 0644]
models/nade_counter/nade_counter_01.tga [new file with mode: 0644]
models/nade_counter/nade_counter_02.tga [new file with mode: 0644]
models/nade_counter/nade_counter_03.tga [new file with mode: 0644]
models/nade_counter/nade_counter_04.tga [new file with mode: 0644]
models/nade_counter/nade_counter_05.tga [new file with mode: 0644]
models/nade_counter/nade_counter_06.tga [new file with mode: 0644]
models/nade_counter/nade_counter_07.tga [new file with mode: 0644]
models/nade_counter/nade_counter_08.tga [new file with mode: 0644]
models/nade_counter/nade_counter_09.tga [new file with mode: 0644]
models/weapons/h_nade.iqm [new file with mode: 0644]
models/weapons/h_nade.iqm.framegroups [new file with mode: 0644]
models/weapons/v_nade.md3 [new file with mode: 0644]
qcsrc/client/projectile.qc
qcsrc/common/constants.qh
qcsrc/common/deathtypes.qh
qcsrc/common/notifications.qh
qcsrc/server/autocvars.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator_riflearena.qc [new file with mode: 0644]
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
scripts/nade_counter.shader [new file with mode: 0644]
scripts/shaderlist.txt
sound/weapons/nade.ogg [new file with mode: 0644]

index de83c9ae57901fc412fcbc804a1a5eae42de5be0..4b942b16e2b8a0799ae210a7cc9dcfd559f39d10 100644 (file)
@@ -1597,3 +1597,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_riflearena 0
+set g_riflearena_nades 1
+set g_riflearena_nade_lifetime 3.5
+set g_riflearena_nade_damage 225
+set g_riflearena_nade_edgedamage 90
+set g_riflearena_nade_radius 300
+set g_riflearena_nade_force 650
+set g_riflearena_nade_health 25
+set g_riflearena_nade_newton_style 0
+set g_riflearena_nade_minforce 400
+set g_riflearena_nade_maxforce 2000
+set g_riflearena_nade_refire 6
index d346a30efbe930804ce535b3fe9b24b31e686fb0..475be8b986cc295d077784e26279bb50c9e2472a 100644 (file)
@@ -7778,3 +7778,395 @@ alpha 190 190 180
 sizeincrease -80
 color 0x0000FF 0x000097
 
+// nades
+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_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_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
diff --git a/models/nade_counter/nade_counter.md3 b/models/nade_counter/nade_counter.md3
new file mode 100644 (file)
index 0000000..7bcd7ef
Binary files /dev/null and b/models/nade_counter/nade_counter.md3 differ
diff --git a/models/nade_counter/nade_counter.md3_0.skin b/models/nade_counter/nade_counter.md3_0.skin
new file mode 100644 (file)
index 0000000..1ce5b17
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_01
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter.md3_1.skin b/models/nade_counter/nade_counter.md3_1.skin
new file mode 100644 (file)
index 0000000..2a3f0f7
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_02
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter.md3_2.skin b/models/nade_counter/nade_counter.md3_2.skin
new file mode 100644 (file)
index 0000000..6fca189
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_03
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter.md3_3.skin b/models/nade_counter/nade_counter.md3_3.skin
new file mode 100644 (file)
index 0000000..cce115d
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_04
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter.md3_4.skin b/models/nade_counter/nade_counter.md3_4.skin
new file mode 100644 (file)
index 0000000..b62ff44
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_05
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter.md3_5.skin b/models/nade_counter/nade_counter.md3_5.skin
new file mode 100644 (file)
index 0000000..c6f3408
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_06
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter.md3_6.skin b/models/nade_counter/nade_counter.md3_6.skin
new file mode 100644 (file)
index 0000000..fe2e9ac
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_07
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter.md3_7.skin b/models/nade_counter/nade_counter.md3_7.skin
new file mode 100644 (file)
index 0000000..ffb0651
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_08
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter.md3_8.skin b/models/nade_counter/nade_counter.md3_8.skin
new file mode 100644 (file)
index 0000000..40d3c04
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_09
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter.md3_9.skin b/models/nade_counter/nade_counter.md3_9.skin
new file mode 100644 (file)
index 0000000..2903092
--- /dev/null
@@ -0,0 +1 @@
+sprite,models/nade_counter/nade_counter_10
\ No newline at end of file
diff --git a/models/nade_counter/nade_counter_01.tga b/models/nade_counter/nade_counter_01.tga
new file mode 100644 (file)
index 0000000..c58a70d
Binary files /dev/null and b/models/nade_counter/nade_counter_01.tga differ
diff --git a/models/nade_counter/nade_counter_02.tga b/models/nade_counter/nade_counter_02.tga
new file mode 100644 (file)
index 0000000..3d91413
Binary files /dev/null and b/models/nade_counter/nade_counter_02.tga differ
diff --git a/models/nade_counter/nade_counter_03.tga b/models/nade_counter/nade_counter_03.tga
new file mode 100644 (file)
index 0000000..eddb7cb
Binary files /dev/null and b/models/nade_counter/nade_counter_03.tga differ
diff --git a/models/nade_counter/nade_counter_04.tga b/models/nade_counter/nade_counter_04.tga
new file mode 100644 (file)
index 0000000..7f14db6
Binary files /dev/null and b/models/nade_counter/nade_counter_04.tga differ
diff --git a/models/nade_counter/nade_counter_05.tga b/models/nade_counter/nade_counter_05.tga
new file mode 100644 (file)
index 0000000..a7cdf8c
Binary files /dev/null and b/models/nade_counter/nade_counter_05.tga differ
diff --git a/models/nade_counter/nade_counter_06.tga b/models/nade_counter/nade_counter_06.tga
new file mode 100644 (file)
index 0000000..150f061
Binary files /dev/null and b/models/nade_counter/nade_counter_06.tga differ
diff --git a/models/nade_counter/nade_counter_07.tga b/models/nade_counter/nade_counter_07.tga
new file mode 100644 (file)
index 0000000..36e5c3b
Binary files /dev/null and b/models/nade_counter/nade_counter_07.tga differ
diff --git a/models/nade_counter/nade_counter_08.tga b/models/nade_counter/nade_counter_08.tga
new file mode 100644 (file)
index 0000000..3f42394
Binary files /dev/null and b/models/nade_counter/nade_counter_08.tga differ
diff --git a/models/nade_counter/nade_counter_09.tga b/models/nade_counter/nade_counter_09.tga
new file mode 100644 (file)
index 0000000..31219ab
Binary files /dev/null and b/models/nade_counter/nade_counter_09.tga differ
diff --git a/models/weapons/h_nade.iqm b/models/weapons/h_nade.iqm
new file mode 100644 (file)
index 0000000..eaffcc2
Binary files /dev/null and b/models/weapons/h_nade.iqm differ
diff --git a/models/weapons/h_nade.iqm.framegroups b/models/weapons/h_nade.iqm.framegroups
new file mode 100644 (file)
index 0000000..ceb09de
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Generated framegroups file for h_laser
+Used by DarkPlaces to simulate frame groups in DPM models.
+*/
+
+1 51 50 0 // h_laser hgrenade_fire
+52 101 50 0 // h_laser hgrenade_idle
+153 101 5 1 // h_laser hgrenade_idle
+254 101 5 1 // h_laser hgrenade_idle
diff --git a/models/weapons/v_nade.md3 b/models/weapons/v_nade.md3
new file mode 100644 (file)
index 0000000..e6f593d
Binary files /dev/null and b/models/weapons/v_nade.md3 differ
index fb4fdd5ef24e1fd245486a58d3a69ecf5fae33a8..2f85c46a0fb73c48cf0b644953658a8e7fe88a42 100644 (file)
@@ -101,6 +101,12 @@ void Projectile_Draw()
                        case PROJECTILE_GRENADE_BOUNCING:
                                rot = '0 -1000 0'; // sideways
                                break;
+                       case PROJECTILE_NADE_RED_BURN:
+                       case PROJECTILE_NADE_RED:
+                       case PROJECTILE_NADE_BLUE_BURN:
+                       case PROJECTILE_NADE_BLUE:
+                               rot = self.avelocity; 
+                               break;
                        case PROJECTILE_HOOKBOMB:
                                rot = '1000 0 0'; // forward
                                break;
@@ -124,6 +130,12 @@ void Projectile_Draw()
        trailorigin = self.origin;
        switch(self.cnt)
        {
+               case PROJECTILE_NADE_RED:
+           case PROJECTILE_NADE_RED_BURN:
+           case PROJECTILE_NADE_BLUE:
+           case PROJECTILE_NADE_BLUE_BURN:
+                       trailorigin += v_up * 4;
+                       break;
                case PROJECTILE_GRENADE:
                case PROJECTILE_GRENADE_BOUNCING:
                        trailorigin += v_right * 1 + v_forward * -10;
@@ -300,6 +312,11 @@ 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_nade.md3");self.traileffect = particleeffectnum("nade_red"); break;
+                       case PROJECTILE_NADE_RED_BURN: setmodel(self, "models/weapons/v_nade.md3");self.traileffect = particleeffectnum("nade_red_burn"); break;
+                       case PROJECTILE_NADE_BLUE: setmodel(self, "models/weapons/v_nade.md3");self.traileffect = particleeffectnum("nade_blue"); break;
+                       case PROJECTILE_NADE_BLUE_BURN: setmodel(self, "models/weapons/v_nade.md3");self.traileffect = particleeffectnum("nade_blue_burn"); break;
 
                        default:
                                error("Received invalid CSQC projectile, can't work with this!");
@@ -334,6 +351,17 @@ void Ent_Projectile()
                                self.mins = '-3 -3 -3';
                                self.maxs = '3 3 3';
                                break;
+                       case PROJECTILE_NADE_RED_BURN:
+                       case PROJECTILE_NADE_RED:
+                       case PROJECTILE_NADE_BLUE_BURN:
+                       case PROJECTILE_NADE_BLUE:
+                               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_GRENADE_BOUNCING:
                                self.mins = '-3 -3 -3';
                                self.maxs = '3 3 3';
index ffec62095b9b9466ffcf5db66a75251f254a18f5..13d204a06a120f013201d290d7e6a868c0b34f88 100644 (file)
@@ -353,6 +353,11 @@ 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 SPECIES_HUMAN        =  0;
 float SPECIES_ROBOT_SOLID  =  1;
 float SPECIES_ALIEN        =  2;
index ca13f15a063e2fc674465312ebe1b600a1e88bd3..f5fe4287c7a480be5faf018a8993003e9eb01b8f 100644 (file)
@@ -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_NORMAL,                    DEATH_SELF_NADE_NORMAL,                         DEATH_MURDER_NADE_NORMAL,          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) \
index 8a9c54fa6a35985fb15da4b227e787c512816dae..a1c0dbfd8c3f3d2d0f8b528b784062c6436ccb57 100644 (file)
@@ -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^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_NORMAL,       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_NORMAL,             2, 1, "s1 s2loc spree_lost", "",                     "",                                             _("^BG%s^K1 ate their own nade%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"), "") \
@@ -468,6 +470,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 ate your own grenade!"), _("^K1Tastes like chicken!")) \
        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!"), "") \
@@ -521,6 +524,7 @@ void Send_Notification_WOVA(
        MSG_CENTER_NOTIF(1, CENTER_MOTD,                        1, 0, "s1",            CPID_MOTD,             "-1 0", _("^BG%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_NIX_COUNTDOWN,               0, 2, "item_wepname",  CPID_NIX,              "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_NIX_NEWWEAPON,               0, 1, "item_wepname",  CPID_NIX,              "0 0", _("^F2Active weapon: ^F1%s"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_NADE,                                0, 0, "",              NO_CPID,                   "0 0", _("^BGPress ^F2DROPWEAPON^BG again to toss the grenade!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_OVERTIME_FRAG,               0, 0, "",              CPID_OVERTIME,         "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nKeep fragging until we have a winner!"), _("^F2Now playing ^F4OVERTIME^F2!\nKeep scoring until we have a winner!")) \
        MSG_CENTER_NOTIF(1, CENTER_OVERTIME_TIME,               0, 1, "f1time",        CPID_OVERTIME,         "0 0", _("^F2Now playing ^F4OVERTIME^F2!\n^BGAdded ^F4%s^BG to the game!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_POWERDOWN_INVISIBILITY,      0, 0, "",              CPID_POWERUP,          "0 0", _("^F2Invisibility has worn off"), "") \
@@ -548,6 +552,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_NORMAL,                     NO_MSG,                INFO_DEATH_MURDER_NADE_NORMAL,                     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) \
@@ -576,6 +581,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_NORMAL,                               NO_MSG,                INFO_DEATH_SELF_NADE_NORMAL,                       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) \
index 15ad76c8745c700de4f0c2a2d464eb42459c15e3..92b5b1b8bc9662f4f5c78e17ad3841e422d48606 100644 (file)
@@ -1226,3 +1226,14 @@ float autocvar_g_touchexplode_radius;
 float autocvar_g_touchexplode_damage;
 float autocvar_g_touchexplode_edgedamage;
 float autocvar_g_touchexplode_force;
+float autocvar_g_riflearena_nades;
+float autocvar_g_riflearena_nade_lifetime;
+float autocvar_g_riflearena_nade_damage;
+float autocvar_g_riflearena_nade_edgedamage;
+float autocvar_g_riflearena_nade_radius;
+float autocvar_g_riflearena_nade_force;
+float autocvar_g_riflearena_nade_health;
+float autocvar_g_riflearena_nade_newton_style;
+float autocvar_g_riflearena_nade_minforce;
+float autocvar_g_riflearena_nade_maxforce;
+float autocvar_g_riflearena_nade_refire;
index 545aa31b258f5dd64f888f834b3226c297ad1c5b..f1d1f74682ccb34e00ec74ed5c9e45803521cdc2 100644 (file)
@@ -1010,6 +1010,8 @@ void readlevelcvars(void)
                MUTATOR_ADD(mutator_physical_items);
        if(cvar("g_touchexplode"))
                MUTATOR_ADD(mutator_touchexplode);
+       if(cvar("g_riflearena"))
+               MUTATOR_ADD(mutator_riflearena);
        if(!g_minstagib)
        {
                if(cvar("g_invincible_projectiles"))
diff --git a/qcsrc/server/mutators/mutator_riflearena.qc b/qcsrc/server/mutators/mutator_riflearena.qc
new file mode 100644 (file)
index 0000000..9575975
--- /dev/null
@@ -0,0 +1,368 @@
+.entity ra_nade;
+.float ra_nade_refire;
+
+void ra_nade_timer_think()
+{
+       self.skin = 8 - (self.owner.wait - time) / (autocvar_g_riflearena_nade_lifetime / 10);
+       self.nextthink = time;
+       if(!self.owner || wasfreed(self.owner))
+               remove(self);
+       
+}
+
+void ra_nade_burn_spawn(entity nade)
+{
+       switch(nade.realowner.team)
+       {
+               case NUM_TEAM_1:
+                       CSQCProjectile(nade, TRUE, PROJECTILE_NADE_RED_BURN, TRUE);
+                       break;
+               case NUM_TEAM_2:
+                       CSQCProjectile(nade, TRUE, PROJECTILE_NADE_BLUE_BURN, TRUE);
+                       break;
+               default:
+                       CSQCProjectile(nade, TRUE, PROJECTILE_NADE_RED_BURN, TRUE);
+                       break;
+       }
+}
+
+void ra_nade_spawn(entity nade)
+{
+       entity timer = spawn();
+       setmodel(timer, "models/nade_counter/nade_counter.md3");
+       setattachment(timer, nade, "");
+       timer.classname = "nade_timer";
+       timer.colormap = nade.colormap;
+       timer.glowmod = nade.glowmod;
+       timer.think = ra_nade_timer_think;
+       timer.nextthink = time;
+       timer.wait = nade.wait;
+       timer.owner = nade;     
+       timer.skin = 10;
+       
+       CSQCProjectile(nade, TRUE, ((nade.realowner.team == NUM_TEAM_2) ? PROJECTILE_NADE_BLUE: PROJECTILE_NADE_RED) , TRUE);
+       
+}
+
+void ra_nade_boom() // TODO: DamageInfo
+{
+       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((self.realowner.team == NUM_TEAM_2) ? "nade_blue_explode" : "nade_red_explode"), self.origin + '0 0 1', '0 0 0', 1);
+
+
+       self.takedamage = DAMAGE_NO;
+       RadiusDamage(self, self.realowner, autocvar_g_riflearena_nade_damage, autocvar_g_riflearena_nade_edgedamage,
+                                autocvar_g_riflearena_nade_radius, self, autocvar_g_riflearena_nade_force, self.projectiledeathtype, self.enemy);
+
+       remove(self);
+}
+
+void ra_nade_touch()
+{
+       PROJECTILE_TOUCH;
+       setsize(self, '-2 -2 -2', '2 2 2');
+       UpdateCSQCProjectile(self);
+       if(self.health == autocvar_g_riflearena_nade_health)
+       {
+               spamsound(self, CH_SHOTS, strcat("weapons/grenade_bounce", ftos(1 + rint(random() * 5)), ".wav"), VOL_BASE, ATTN_NORM);
+               return;
+       }
+
+       self.enemy = other;
+       ra_nade_boom();
+}
+
+void ra_nade_beep()
+{
+       sound(self, CH_SHOTS_SINGLE, "weapons/nade.ogg", VOL_BASE, 0.5 *(ATTN_LARGE + ATTN_MAX));
+       self.think = ra_nade_boom;
+       self.nextthink = max(self.wait, time);
+}
+
+void ra_nade_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+       if(DEATH_ISWEAPON(deathtype, WEP_LASER))
+               return;
+       
+       self.velocity += force;
+
+       if(!damage)
+               return;
+
+       if(self.health == autocvar_g_riflearena_nade_health)
+       {
+               sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, 0.5 *(ATTN_LARGE + ATTN_MAX));
+               self.nextthink = max(time + autocvar_g_riflearena_nade_lifetime, time);
+               self.think = ra_nade_beep;
+       }
+
+       self.health   -= damage;
+       self.realowner = attacker;
+
+       if(self.health <= 0)
+               W_PrepareExplosionByDamage(attacker, ra_nade_boom);
+       else
+               ra_nade_burn_spawn(self);
+}
+
+void ra_toss_nade(vector _velocity, float _time)
+{
+       entity _nade = self.ra_nade;
+       self.ra_nade = world;
+       
+       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(self.crouch)
+               _nade.velocity = '0 0 -10';
+       else if(autocvar_g_riflearena_nade_newton_style == 1)
+               _nade.velocity = self.velocity + _velocity;
+       else if(autocvar_g_riflearena_nade_newton_style == 2)
+               _nade.velocity = _velocity;
+       else
+               _nade.velocity = W_CalculateProjectileVelocity(self.velocity, _velocity, FALSE);
+
+       _nade.solid = SOLID_BBOX;
+       _nade.touch = ra_nade_touch;
+       _nade.health = autocvar_g_riflearena_nade_health;
+       _nade.takedamage = DAMAGE_YES;
+       _nade.event_damage = ra_nade_damage;
+       _nade.teleportable = TRUE;
+
+       ra_nade_spawn(_nade);
+
+       if(_time)
+       {
+               _nade.think = ra_nade_boom;
+               _nade.nextthink = _time;
+       }
+       else
+               _nade.projectiledeathtype = DEATH_NADE_NORMAL;
+
+       self.ra_nade_refire = time + autocvar_g_riflearena_nade_refire;
+}
+
+void ra_nade_prime()
+{
+       if(self.ra_nade)
+               remove(self.ra_nade);
+       
+       self.ra_nade = spawn();
+       setmodel(self.ra_nade, "models/weapons/h_nade.iqm");
+       setattachment(self.ra_nade, self.weaponentity, "");
+       self.ra_nade.classname = "nade";
+       self.ra_nade.realowner = self;
+       self.ra_nade.colormap = self.colormap;
+       self.ra_nade.glowmod = self.glowmod;
+       self.ra_nade.wait = time + autocvar_g_riflearena_nade_lifetime;
+       self.ra_nade.cnt = time;
+       self.ra_nade.think = ra_nade_beep;
+       self.ra_nade.nextthink = max(self.ra_nade.wait - 3, time);
+       self.ra_nade.projectiledeathtype = DEATH_NADE_NORMAL;
+}
+
+MUTATOR_HOOKFUNCTION(ra_PlayerDamage)
+{
+       if(IS_PLAYER(frag_attacker))
+       {
+               if (DEATH_ISWEAPON(frag_deathtype, WEP_LASER))
+               {
+                       if(frag_attacker == frag_target)
+                               frag_damage = 5;
+                       else
+                               frag_damage = 0;
+                       if (frag_target != frag_attacker)
+                       {
+                               if (frag_target.health >= 1 && IS_PLAYER(frag_target))
+                                       centerprint(frag_attacker, "Laser inflicts no damage!");
+                               frag_force = '0 0 0';
+                       }
+               }
+       }
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(ra_PlayerSpawn)
+{
+       WEPSET_CLEAR_E(self);
+       WEPSET_OR_EW(self, WEP_RIFLE);
+       WEPSET_OR_EW(self, WEP_LASER);
+       
+       self.ra_nade_refire = time + 1;
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(ra_FilterItem)
+{
+       switch (self.items)
+       {
+               case IT_5HP:
+               case IT_ARMOR_SHARD:
+                       return FALSE;
+       }
+               
+       return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(ra_PlayerThink)
+{
+       if(self.ra_nade)
+               if(self.ra_nade.wait - 0.1 <= time)
+                       ra_toss_nade('0 0 0', time + 0.05);
+
+       if(self.ra_nade_refire < time)
+       {
+               if(self.BUTTON_HOOK)
+               {
+                       if(!self.ra_nade)
+                               ra_nade_prime();
+               }
+               else if(time - self.ra_nade.cnt >= 1)
+               {
+                       if(self.ra_nade)
+                       {
+                               makevectors(self.v_angle);
+                               float _force = time - self.ra_nade.cnt;
+                               _force /= autocvar_g_riflearena_nade_lifetime;
+                               _force = autocvar_g_riflearena_nade_minforce + (_force * (autocvar_g_riflearena_nade_maxforce - autocvar_g_riflearena_nade_minforce));                          
+                               ra_toss_nade((v_forward * 0.7 + v_up * 0.2 + v_right * 0.1) * _force, 0);
+                       }
+               }
+       }
+       
+       self.hasweapon_complain_spam = time + 5; // this isn't needed, so keep it off
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(ra_RemovePlayer)
+{
+       if(self.ra_nade)
+               remove(self.ra_nade);
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(ra_StartItems)
+{
+       start_items |= IT_UNLIMITED_AMMO;
+       start_ammo_nails = 100;
+       
+       g_grappling_hook = 0;
+
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(ra_PlayerDies)
+{
+       if(self.ra_nade)
+               ra_toss_nade('0 0 100', max(self.ra_nade.wait, time + 0.05));
+
+       return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ra_ForbidThrowCurrentWeapon)
+{
+       if(self.freezetag_frozen || !autocvar_g_riflearena_nades || self.vehicle)
+               return 1;
+
+       if(!self.ra_nade)
+       {
+               if(self.ra_nade_refire < time)
+               {
+                       Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_NADE);
+                       ra_nade_prime();
+                       self.ra_nade_refire  = time + autocvar_g_riflearena_nade_refire;
+               }
+       }
+       else
+       {
+               if(time - self.ra_nade.cnt >= 1)
+               {
+                       makevectors(self.v_angle);
+                       float _force = time - self.ra_nade.cnt;
+                       _force /= autocvar_g_riflearena_nade_lifetime;
+                       _force = autocvar_g_riflearena_nade_minforce + (_force * (autocvar_g_riflearena_nade_maxforce - autocvar_g_riflearena_nade_minforce));
+                       ra_toss_nade((v_forward * 0.75 + v_up * 0.2 + v_right * 0.05) * _force, 0);
+               }
+       }
+       return 1;
+}
+
+MUTATOR_HOOKFUNCTION(ra_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":RA");
+       return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ra_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", Rifle Arena");
+       return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ra_SetModname)
+{
+       modname = "Rifle Arena";
+       return TRUE;
+}
+
+MUTATOR_DEFINITION(mutator_riflearena)
+{
+       MUTATOR_HOOK(PlayerDamage_Calculate, ra_PlayerDamage, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerSpawn, ra_PlayerSpawn, CBC_ORDER_ANY);
+       MUTATOR_HOOK(FilterItem, ra_FilterItem, CBC_ORDER_ANY);
+       MUTATOR_HOOK(SetStartItems, ra_StartItems, CBC_ORDER_ANY);
+       MUTATOR_HOOK(MakePlayerObserver, ra_RemovePlayer, CBC_ORDER_ANY);
+       MUTATOR_HOOK(ClientDisconnect, ra_RemovePlayer, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerDies, ra_PlayerDies, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerPreThink, ra_PlayerThink, CBC_ORDER_ANY);
+       MUTATOR_HOOK(ForbidThrowCurrentWeapon, ra_ForbidThrowCurrentWeapon, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, ra_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, ra_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+       
+       MUTATOR_ONADD
+       {
+               cvar_settemp("g_balance_rifle_secondary_spread", "0");
+               cvar_settemp("g_balance_rifle_secondary_shots", "1");
+               cvar_settemp("g_balance_rifle_secondary_animtime", "0.15");
+               cvar_settemp("g_balance_rifle_secondary_refire", "0.15");
+               cvar_settemp("g_balance_rifle_secondary_damage", "40");
+               precache_model("models/nade_counter/nade_counter.md3");
+               
+               precache_model("models/weapons/h_nade.iqm");
+               precache_model("models/weapons/v_nade.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("weapons/nade.ogg");
+               
+               weapon_action(WEP_LASER, WR_PRECACHE);
+               weapon_action(WEP_RIFLE, WR_PRECACHE);
+               
+               get_weaponinfo(WEP_HOOK).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+       }
+       
+       MUTATOR_ONROLLBACK_OR_REMOVE
+       {
+               get_weaponinfo(WEP_HOOK).spawnflags &~= WEP_FLAG_MUTATORBLOCKED;
+       }
+       
+       MUTATOR_ONREMOVE
+       {
+               print("This cannot be removed at runtime\n");
+               return -1;
+       }
+
+       return 0;
+}
index cf90b957ea5d96e259ef60f2b1558d5ed7654e43..cb0911d7056729c2d9d3ac6f4a6c3e60cf7fb271 100644 (file)
@@ -16,5 +16,6 @@ MUTATOR_DECLARATION(mutator_physical_items);
 MUTATOR_DECLARATION(mutator_vampire);
 MUTATOR_DECLARATION(mutator_superspec);
 MUTATOR_DECLARATION(mutator_touchexplode);
+MUTATOR_DECLARATION(mutator_riflearena);
 
 MUTATOR_DECLARATION(sandbox);
index 157aa38a4377e2dfc74927f741c3e1cd577cd1f7..74b15b53ae22fda1629af33ae238ee6d3216ce05 100644 (file)
@@ -232,6 +232,7 @@ mutators/mutator_physical_items.qc
 mutators/sandbox.qc
 mutators/mutator_superspec.qc
 mutators/mutator_touchexplode.qc
+mutators/mutator_riflearena.qc
 
 ../warpzonelib/anglestransform.qc
 ../warpzonelib/mathlib.qc
diff --git a/scripts/nade_counter.shader b/scripts/nade_counter.shader
new file mode 100644 (file)
index 0000000..162a68d
--- /dev/null
@@ -0,0 +1,90 @@
+models/nade_counter/nade_counter_01
+{
+       dpnoshadow
+       deformVertexes autosprite
+       dppolygonoffset -6000
+       {
+               map "models/nade_counter/nade_counter_01"
+               blendfunc add
+       }
+}
+models/nade_counter/nade_counter_02
+{
+       dpnoshadow
+       deformVertexes autosprite
+       dppolygonoffset -6000
+       {
+               map "models/nade_counter/nade_counter_02"
+               blendfunc add
+       }
+}
+models/nade_counter/nade_counter_03
+{
+       dpnoshadow
+       deformVertexes autosprite
+       dppolygonoffset -6000
+       {
+               map "models/nade_counter/nade_counter_03"
+               blendfunc add
+       }
+}
+models/nade_counter/nade_counter_04
+{
+       dpnoshadow
+       deformVertexes autosprite
+       dppolygonoffset -6000
+       {
+               map "models/nade_counter/nade_counter_04"
+               blendfunc add
+       }
+}
+models/nade_counter/nade_counter_05
+{
+       dpnoshadow
+       deformVertexes autosprite
+       dppolygonoffset -6000
+       {
+               map "models/nade_counter/nade_counter_05"
+               blendfunc add
+       }
+}
+models/nade_counter/nade_counter_06
+{
+       dpnoshadow
+       deformVertexes autosprite
+       dppolygonoffset -6000
+       {
+               map "models/nade_counter/nade_counter_06"
+               blendfunc add
+       }
+}
+models/nade_counter/nade_counter_07
+{
+       dpnoshadow
+       deformVertexes autosprite
+       dppolygonoffset -6000
+       {
+               map "models/nade_counter/nade_counter_07"
+               blendfunc add
+       }
+}
+models/nade_counter/nade_counter_08
+{
+       dpnoshadow
+       deformVertexes autosprite
+       dppolygonoffset -6000
+       {
+               map "models/nade_counter/nade_counter_08"
+               blendfunc add
+       }
+}
+models/nade_counter/nade_counter_09
+{
+       dpnoshadow
+       deformVertexes autosprite
+       dppolygonoffset -6000
+       {
+               map "models/nade_counter/nade_counter_09"
+               blendfunc add
+       }
+}
\ No newline at end of file
index a73e7e2064a38d6966bb223a7b425037d24b8901..29d01db8880891fe7196ab0e215489cb462916c9 100644 (file)
@@ -14,3 +14,4 @@ tree
 tuba
 turrets
 weapons
+nade_counter
diff --git a/sound/weapons/nade.ogg b/sound/weapons/nade.ogg
new file mode 100644 (file)
index 0000000..54cdea4
Binary files /dev/null and b/sound/weapons/nade.ogg differ