[nexuiz-commits] r6894 - in trunk/data: . qcsrc/common qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jun 6 15:57:38 EDT 2009


Author: div0
Date: 2009-06-06 15:57:38 -0400 (Sat, 06 Jun 2009)
New Revision: 6894

Added:
   trunk/data/qcsrc/server/w_tuba.qc
Modified:
   trunk/data/defaultNexuiz.cfg
   trunk/data/qcsrc/common/items.qc
   trunk/data/qcsrc/common/items.qh
   trunk/data/qcsrc/server/progs.src
   trunk/data/weapons.cfg
Log:
Here it is: the @!#%'n Tuba.

But it does not work yet, audio samples do not exist yet.

DO NOT MERGE THIS INTO BRANCH.


Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg	2009-06-06 19:42:23 UTC (rev 6893)
+++ trunk/data/defaultNexuiz.cfg	2009-06-06 19:57:38 UTC (rev 6894)
@@ -186,6 +186,12 @@
 seta crosshair_campingrifle_color_blue 0.25	"crosshair color blue component to display when wielding the campingrifle"
 seta crosshair_campingrifle_color_alpha 1	"crosshair alpha value to display when wielding the campingrifle"
 seta crosshair_campingrifle_size 0.85	"crosshair size when wielding the campingrifle"
+seta crosshair_tuba ""	"crosshair to display when wielding the tuba"
+seta crosshair_tuba_color_red 0.85	"crosshair color red component to display when wielding the tuba"
+seta crosshair_tuba_color_green 0.5	"crosshair color green component to display when wielding the tuba"
+seta crosshair_tuba_color_blue 0.25	"crosshair color blue component to display when wielding the tuba"
+seta crosshair_tuba_color_alpha 1	"crosshair alpha value to display when wielding the tuba"
+seta crosshair_tuba_size 0.85	"crosshair size when wielding the tuba"
 fov 90
 seta cl_zoomfactor 5	"how much +zoom will zoom (1-16)"
 seta cl_zoomspeed 3.5	"how fast it will zoom (0.5-16), negative values mean instant zoom"

Modified: trunk/data/qcsrc/common/items.qc
===================================================================
--- trunk/data/qcsrc/common/items.qc	2009-06-06 19:42:23 UTC (rev 6893)
+++ trunk/data/qcsrc/common/items.qc	2009-06-06 19:57:38 UTC (rev 6894)
@@ -113,6 +113,7 @@
 	register_weapon(WEP_SEEKER,           w_seeker,       IT_ROCKETS,       8, 0, 0, BOT_PICKUP_RATING_HIGH, "seeker",       "seeker",          "T.A.G. Seeker");
 	register_weapon(WEP_HLAC,             w_hlac,         IT_CELLS,         6, 1, 0, BOT_PICKUP_RATING_MID,  "hlac",         "hlac",            "Heavy Laser Assault Cannon");
 	register_weapon(WEP_CAMPINGRIFLE,     w_campingrifle, IT_NAILS,         3, 1, 0, BOT_PICKUP_RATING_MID,  "campingrifle", "campingrifle",    "Rifle");
+	register_weapon(WEP_TUBA,             w_tuba,         0,                1, 0, 0, BOT_PICKUP_RATING_MID,  "tuba",         "tuba",            "@!#%'n Tuba");
 
 	register_weapons_done();
 }

Modified: trunk/data/qcsrc/common/items.qh
===================================================================
--- trunk/data/qcsrc/common/items.qh	2009-06-06 19:42:23 UTC (rev 6893)
+++ trunk/data/qcsrc/common/items.qh	2009-06-06 19:57:38 UTC (rev 6894)
@@ -16,8 +16,9 @@
 float WEP_HLAC			    = 13; float WEPBIT_HLAC		        = 4096;
 float WEP_SEEKER			= 14; float WEPBIT_SEEKER		    = 8192;
 float WEP_CAMPINGRIFLE	    = 15; float WEPBIT_CAMPINGRIFLE     = 16384;
-float WEP_LAST				= 15; float WEPBIT_ALL              = 32767;
-float WEP_COUNT             = 16;
+float WEP_TUBA        	    = 16; float WEPBIT_TUBA             = 32768;
+float WEP_LAST				= 16; float WEPBIT_ALL              = 65535;
+float WEP_COUNT             = 17;
 
 float BOT_PICKUP_RATING_LOW	= 2500;
 float BOT_PICKUP_RATING_MID	= 5000;

Modified: trunk/data/qcsrc/server/progs.src
===================================================================
--- trunk/data/qcsrc/server/progs.src	2009-06-06 19:42:23 UTC (rev 6893)
+++ trunk/data/qcsrc/server/progs.src	2009-06-06 19:57:38 UTC (rev 6894)
@@ -105,6 +105,7 @@
 w_hlac.qc
 w_seeker.qc
 w_campingrifle.qc
+w_tuba.qc
 
 t_items.qc
 cl_weapons.qc

Added: trunk/data/qcsrc/server/w_tuba.qc
===================================================================
--- trunk/data/qcsrc/server/w_tuba.qc	                        (rev 0)
+++ trunk/data/qcsrc/server/w_tuba.qc	2009-06-06 19:57:38 UTC (rev 6894)
@@ -0,0 +1,95 @@
+float Tuba_GetNote(entity pl, float hittype)
+{
+	float note;
+	float movestate;
+	print(etos(pl), "\n");
+	movestate = 5;
+	if(pl.movement_x < 0) movestate -= 3;
+	if(pl.movement_x > 0) movestate += 3;
+	if(pl.movement_y < 0) movestate -= 1;
+	if(pl.movement_y > 0) movestate += 1;
+	switch(movestate)
+	{
+		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 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#
+	}
+	print(ftos(movestate), "\n");
+	if(pl.BUTTON_CROUCH)
+		note -= 12;
+	if(hittype & HITTYPE_SECONDARY)
+		note += 7;
+	
+	// total range of notes:
+	//                       0
+	//                 ***  ** ****
+	//                        ***  ** ****
+	//     ***  ** ****
+	//            ***  ** ****
+	//     -18.........................+12
+	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"));
+	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);
+}
+
+void spawnfunc_weapon_tuba (void)
+{
+	error("The tuba does not work yet. Forget it.");
+	weapon_defaultspawnfunc(WEP_TUBA);
+}
+
+float w_tuba(float req)
+{
+	if (req == WR_AIM)
+	{
+		// bots cannot play the Tuba yet
+		// I think they should start with the recorder first
+	}
+	else if (req == WR_THINK)
+	{
+		if (self.BUTTON_ATCK)
+		if (weapon_prepareattack(0, cvar("g_balance_tuba_refire")))
+		{
+			W_Tuba_Attack(0);
+			weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_tuba_animtime"), w_ready);
+		}
+		if (self.BUTTON_ATCK2)
+		if (weapon_prepareattack(1, cvar("g_balance_tuba_refire")))
+		{
+			W_Tuba_Attack(HITTYPE_SECONDARY);
+			weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_tuba_animtime"), w_ready);
+		}
+	}
+	else if (req == WR_PRECACHE)
+	{
+		precache_model ("models/weapons/g_tuba.md3");
+		precache_model ("models/weapons/v_tuba.md3");
+		precache_model ("models/weapons/h_tuba.dpm");
+	}
+	else if (req == WR_SETUP)
+		weapon_setup(WEP_TUBA);
+	else if (req == WR_CHECKAMMO1)
+		return TRUE; // TODO use fuel?
+	else if (req == WR_CHECKAMMO2)
+		return TRUE; // TODO use fuel?
+	else if (req == WR_SUICIDEMESSAGE)
+	{
+		w_deathtypestring = "hurt his own ears";
+	}
+	else if (req == WR_KILLMESSAGE)
+	{
+		w_deathtypestring = "died of #'s great playing";
+	}
+	return TRUE;
+};

Modified: trunk/data/weapons.cfg
===================================================================
--- trunk/data/weapons.cfg	2009-06-06 19:42:23 UTC (rev 6893)
+++ trunk/data/weapons.cfg	2009-06-06 19:57:38 UTC (rev 6894)
@@ -24,6 +24,7 @@
 set g_weaponreplace_seeker ""
 set g_weaponreplace_hlac ""
 set g_weaponreplace_campingrifle ""
+set g_weaponreplace_tuba ""
 
 
 set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
@@ -41,6 +42,7 @@
 set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
 set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
 set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
+set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default"
 set g_start_ammo_shells 40
 set g_start_ammo_nails 0
 set g_start_ammo_rockets 0
@@ -415,3 +417,11 @@
 set g_balance_campingrifle_secondary_animtime 0.1
 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_attenuation 0.5
+set g_balance_tuba_damage 80
+set g_balance_tuba_edgedamage 0
+set g_balance_tuba_radius 100
+set g_balance_tuba_force 200



More information about the nexuiz-commits mailing list