[nexuiz-commits] r6898 - in trunk/data: . qcsrc/server sound/weapons

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Jun 7 07:08:49 EDT 2009


Author: div0
Date: 2009-06-07 07:08:49 -0400 (Sun, 07 Jun 2009)
New Revision: 6898

Added:
   trunk/data/sound/weapons/tuba_note-1.ogg
   trunk/data/sound/weapons/tuba_note-10.ogg
   trunk/data/sound/weapons/tuba_note-11.ogg
   trunk/data/sound/weapons/tuba_note-12.ogg
   trunk/data/sound/weapons/tuba_note-13.ogg
   trunk/data/sound/weapons/tuba_note-14.ogg
   trunk/data/sound/weapons/tuba_note-15.ogg
   trunk/data/sound/weapons/tuba_note-16.ogg
   trunk/data/sound/weapons/tuba_note-17.ogg
   trunk/data/sound/weapons/tuba_note-18.ogg
   trunk/data/sound/weapons/tuba_note-2.ogg
   trunk/data/sound/weapons/tuba_note-3.ogg
   trunk/data/sound/weapons/tuba_note-4.ogg
   trunk/data/sound/weapons/tuba_note-5.ogg
   trunk/data/sound/weapons/tuba_note-6.ogg
   trunk/data/sound/weapons/tuba_note-7.ogg
   trunk/data/sound/weapons/tuba_note-8.ogg
   trunk/data/sound/weapons/tuba_note-9.ogg
   trunk/data/sound/weapons/tuba_note0.ogg
   trunk/data/sound/weapons/tuba_note1.ogg
   trunk/data/sound/weapons/tuba_note10.ogg
   trunk/data/sound/weapons/tuba_note11.ogg
   trunk/data/sound/weapons/tuba_note12.ogg
   trunk/data/sound/weapons/tuba_note13.ogg
   trunk/data/sound/weapons/tuba_note14.ogg
   trunk/data/sound/weapons/tuba_note15.ogg
   trunk/data/sound/weapons/tuba_note2.ogg
   trunk/data/sound/weapons/tuba_note3.ogg
   trunk/data/sound/weapons/tuba_note4.ogg
   trunk/data/sound/weapons/tuba_note5.ogg
   trunk/data/sound/weapons/tuba_note6.ogg
   trunk/data/sound/weapons/tuba_note7.ogg
   trunk/data/sound/weapons/tuba_note8.ogg
   trunk/data/sound/weapons/tuba_note9.ogg
Modified:
   trunk/data/qcsrc/server/w_tuba.qc
   trunk/data/weapons.cfg
Log:
The @!#%'n Tuba can be played now! Only model still missing.

Sound samples generated from freepats.


Modified: trunk/data/qcsrc/server/w_tuba.qc
===================================================================
--- trunk/data/qcsrc/server/w_tuba.qc	2009-06-07 01:01:42 UTC (rev 6897)
+++ trunk/data/qcsrc/server/w_tuba.qc	2009-06-07 11:08:49 UTC (rev 6898)
@@ -1,3 +1,6 @@
+#define TUBA_NOTE(n) strcat("weapons/tuba_note", ftos(n), ".wav")
+.float tuba_notecount;
+
 float Tuba_GetNote(entity pl, float hittype)
 {
 	float note;
@@ -2,3 +5,2 @@
 	float movestate;
-	print(etos(pl), "\n");
 	movestate = 5;
@@ -10,36 +12,66 @@
 	if(pl.movement_y > 0) movestate += 1;
 	switch(movestate)
 	{
+	// layout: originally I wanted
+	//   eb e  e#=f
+	//   B  c  d
+	//   Gb G  G#
+	// but then you only use forward and right key. So to make things more
+	// interesting, I swapped B with e#. Har har har...
+	//   eb e  B
+	// f=e# c  d
+	//   Gb G  G#
 		case 1: note = -6; break; // Gb
 		case 2: note = -5; break; // G
 		case 3: note = -4; break; // G#
-		case 4: note = -1; break; // B
+		case 4: note = +5; break; // e#
 		case 5: note =  0; break; // c
 		case 6: note = +2; break; // d
 		case 7: note = +3; break; // eb
 		case 8: note = +4; break; // e
-		case 9: note = +5; break; // e#
+		case 9: note = -1; break; // B
 	}
-	print(ftos(movestate), "\n");
 	if(pl.BUTTON_CROUCH)
 		note -= 12;
 	if(hittype & HITTYPE_SECONDARY)
 		note += 7;
 	
+	// we support two kinds of tubas, those tuned in Eb and those tuned in C
+	// kind of tuba currently is player slot number, or team number if in
+	// teamplay
+	// that way, holes in the range of notes are "plugged"
+	if(teams_matter)
+	{
+		if(pl.team == COLOR_TEAM2 || pl.team == COLOR_TEAM4)
+			note += 3;
+	}
+	else
+	{
+		if(mod(num_for_edict(pl), 2) == 0)
+			note += 3;
+	}
+	
 	// total range of notes:
 	//                       0
 	//                 ***  ** ****
 	//                        ***  ** ****
 	//     ***  ** ****
 	//            ***  ** ****
+	//     ***  ********************* ****
 	//     -18.........................+12
+	//        ***  ********************* ****
+	//     -18............................+15
 	return note;
 }
 
 void W_Tuba_Attack(float hittype)
 {
 	W_SetupShot(self, FALSE, 2, "");
-	sound(self, CHAN_WEAPON, strcat("weapons/tuba_note", ftos(Tuba_GetNote(self, hittype)), ".wav"), VOL_BASE, cvar("g_balance_tuba_attenuation"));
+	self.tuba_notecount = !self.tuba_notecount;
+	if(self.tuba_notecount)
+		sound(self, CHAN_WEAPON, TUBA_NOTE(Tuba_GetNote(self, hittype)), VOL_BASE, cvar("g_balance_tuba_attenuation"));
+	else
+		sound(self, CHAN_WEAPON2, TUBA_NOTE(Tuba_GetNote(self, hittype)), VOL_BASE, cvar("g_balance_tuba_attenuation"));
 	RadiusDamage(self, self, cvar("g_balance_tuba_damage"), cvar("g_balance_tuba_edgedamage"), cvar("g_balance_tuba_radius"), world, cvar("g_balance_tuba_force"), hittype | WEP_TUBA, world);
 }
 
@@ -76,6 +108,10 @@
 		precache_model ("models/weapons/g_tuba.md3");
 		precache_model ("models/weapons/v_tuba.md3");
 		precache_model ("models/weapons/h_tuba.dpm");
+
+		float i;
+		for(i = -18; i <= +15; ++i)
+			precache_sound(TUBA_NOTE(i));
 	}
 	else if (req == WR_SETUP)
 		weapon_setup(WEP_TUBA);

Added: trunk/data/sound/weapons/tuba_note-1.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-1.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-10.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-10.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-11.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-11.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-12.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-12.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-13.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-13.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-14.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-14.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-15.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-15.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-16.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-16.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-17.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-17.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-18.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-18.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-2.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-2.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-3.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-3.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-4.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-4.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-5.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-5.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-6.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-6.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-7.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-7.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-8.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-8.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note-9.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note-9.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note0.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note0.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note1.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note1.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note10.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note10.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note11.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note11.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note12.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note12.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note13.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note13.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note14.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note14.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note15.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note15.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note2.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note2.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note3.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note3.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note4.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note4.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note5.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note5.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note6.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note6.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note7.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note7.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note8.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note8.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/sound/weapons/tuba_note9.ogg
===================================================================
(Binary files differ)


Property changes on: trunk/data/sound/weapons/tuba_note9.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/data/weapons.cfg
===================================================================
--- trunk/data/weapons.cfg	2009-06-07 01:01:42 UTC (rev 6897)
+++ trunk/data/weapons.cfg	2009-06-07 11:08:49 UTC (rev 6898)
@@ -418,10 +418,10 @@
 set g_balance_campingrifle_secondary_ammo 10
 set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
 
-set g_balance_tuba_refire 0.3
-set g_balance_tuba_animtime 0.3
+set g_balance_tuba_refire 0.5
+set g_balance_tuba_animtime 0.5
 set g_balance_tuba_attenuation 0.5
-set g_balance_tuba_damage 80
+set g_balance_tuba_damage 30
 set g_balance_tuba_edgedamage 0
-set g_balance_tuba_radius 100
+set g_balance_tuba_radius 200
 set g_balance_tuba_force 200



More information about the nexuiz-commits mailing list