r78 - trunk/basezym/progsqc

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Nov 8 20:06:47 EST 2007


Author: Vermeulen
Date: 2007-11-08 20:06:47 -0500 (Thu, 08 Nov 2007)
New Revision: 78

Modified:
   trunk/basezym/progsqc/actor.qc
   trunk/basezym/progsqc/bots.qc
   trunk/basezym/progsqc/damage.qc
   trunk/basezym/progsqc/gamedefs.qc
   trunk/basezym/progsqc/inventory.qc
   trunk/basezym/progsqc/player.qc
Log:
Added back reloading, and some basic item stuff

Modified: trunk/basezym/progsqc/actor.qc
===================================================================
--- trunk/basezym/progsqc/actor.qc	2007-11-03 21:10:43 UTC (rev 77)
+++ trunk/basezym/progsqc/actor.qc	2007-11-09 01:06:47 UTC (rev 78)
@@ -12,7 +12,11 @@
 float ACTORTYPE_CLASS1 = 1;
 float ACTORTYPE_CLASS2 = 2;
 float ACTORTYPE_CLASS3 = 3;
-float ACTORTYPE_TOTAL = 4;
+float ACTORTYPE_CLASS4 = 4;
+float ACTORTYPE_CLASS5 = 5;
+float ACTORTYPE_CLASS6 = 6;
+float ACTORTYPE_CLASS7 = 7;
+float ACTORTYPE_TOTAL = 8;
 
 .float actortype;
 
@@ -125,7 +129,7 @@
 	self.actorpart_viewweapon.model = ""; // will be changed by weapon code as needed
 	
 	self.scale = self.scaleratio;
-	//setsize(self, self.boxmin, self.boxmax);
+	setsize(self, self.boxmin, self.boxmax);
 	
 	// FIXME: add a hands viewmodel for each player model (animated to match the torso) and attach the weapon to it, until this is done this setorigin is necessary to put it in roughly the right place on the screen
 	v = self.weapon_ofs - self.view_ofs + '10 4 -10'; // front side up
@@ -448,8 +452,13 @@
 		projcolormod = iteminfo_ammo1colormod;
 	}
 
-	Inventory_ModifyItem(self, self.weaponitem, 0, 0 - mintofire, 0);
+	if (self.weaponitem >= ITEMTYPE_ITEM1) 
+	   Inventory_ModifyItem(self, self.weaponitem, 0 - mintofire, 0, 0);
+	else
+	   Inventory_ModifyItem(self, self.weaponitem, 0, 0 - mintofire, 0);
+	   
 	weapon_recoil(recoil);
+	
 	while (numberof != 0)
 	{
 		  weapon_fireprojectile(shotmodel, shotorg, shotdir, shotdamage, shotdamagetype, shotlifetime, shotprojectileflags, shotfiresound, shotexplodesound, shotbouncesound, tracer, tracermodel, modelscale, projhealth, projmass, projcolormod);	

Modified: trunk/basezym/progsqc/bots.qc
===================================================================
--- trunk/basezym/progsqc/bots.qc	2007-11-03 21:10:43 UTC (rev 77)
+++ trunk/basezym/progsqc/bots.qc	2007-11-09 01:06:47 UTC (rev 78)
@@ -129,7 +129,7 @@
 				self.enemy = world;
 				return;
 			}
-			ai_strafe();
+			//ai_strafe();
 			Inventory_GetItemInfo(self, self.weaponitem);
 			if (!iteminfo_weapon_canfire1)
 			if (!iteminfo_weapon_canfire2)
@@ -161,7 +161,9 @@
 					self.button3 = 1;
 			}
 			else
-				MoveToGoal(); // a tad different
+			{
+				   MoveToGoal(); // a tad different
+			}
 		}
 	}
 };
@@ -175,33 +177,80 @@
 	PlayerPostThink();
 };
 
-void() monster_light_guard
+void() bot_serverframe =
 {
+ 	   // keep spawning new bots
+}
+
+void() enemy_class2
+{
  	if (cvar("g_gametype") == 1)
 	{
 		setorigin(self, self.origin + '0 0 1');
 		self.think = bot_npcthink;
 		self.nextthink = time;
-		self.netname = "Light Guard";
 		self.team = 2;
 		player_spawn(ACTORTYPE_CLASS2);
 	}
 };
 
-void() monster_heavy_guard
+void() enemy_class3
 {
  	if (cvar("g_gametype") == 1)
 	{
 		setorigin(self, self.origin + '0 0 1');
 		self.think = bot_npcthink;
 		self.nextthink = time;
-		self.netname = "Heavy Guard";
 		self.team = 2;
 		player_spawn(ACTORTYPE_CLASS3);
 	}
 };
 
-void() bot_serverframe =
+void() enemy_class4
 {
- 	   // keep spawning new bots
-}
\ No newline at end of file
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = 2;
+		player_spawn(ACTORTYPE_CLASS4);
+	}
+};
+
+void() enemy_class5
+{
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = 2;
+		player_spawn(ACTORTYPE_CLASS5);
+	}
+};
+
+
+void() enemy_class6
+{
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = 2;
+		player_spawn(ACTORTYPE_CLASS6);
+	}
+};
+
+void() enemy_class7
+{
+ 	if (cvar("g_gametype") == 1)
+	{
+		setorigin(self, self.origin + '0 0 1');
+		self.think = bot_npcthink;
+		self.nextthink = time;
+		self.team = 2;
+		player_spawn(ACTORTYPE_CLASS7);
+	}
+};

Modified: trunk/basezym/progsqc/damage.qc
===================================================================
--- trunk/basezym/progsqc/damage.qc	2007-11-03 21:10:43 UTC (rev 77)
+++ trunk/basezym/progsqc/damage.qc	2007-11-09 01:06:47 UTC (rev 78)
@@ -1,5 +1,5 @@
 
-float ACTOR_SHIELD_REGENDELAY = 1;
+float ACTOR_SHIELD_REGENDELAY = 0.5;
 .float armorregentime;
 .float armorregenplaysound;
 .float armorregenrate;
@@ -234,8 +234,11 @@
 		self.armorregentime = max(self.armorregentime, time + ACTOR_SHIELD_REGENDELAY);
 		self.armorregenplaysound = TRUE;
 	}
-	te_blood(location, force, take);
-	te_blood(location, force, save);
+	if (self.bloodtype == 1)
+	{
+		te_blood(location, force, take);
+		te_blood(location, force, save);
+	}
 	
 	/*
 	if (self.entitytype == ETYPE_HUMAN)

Modified: trunk/basezym/progsqc/gamedefs.qc
===================================================================
--- trunk/basezym/progsqc/gamedefs.qc	2007-11-03 21:10:43 UTC (rev 77)
+++ trunk/basezym/progsqc/gamedefs.qc	2007-11-09 01:06:47 UTC (rev 78)
@@ -29,6 +29,9 @@
 .float jetpack_use;
 .float jetpackactive;
 
+.float bloodtype;
+.float gibtype;
+
 .float aitype;
 .float animationtype;
 .float team;

Modified: trunk/basezym/progsqc/inventory.qc
===================================================================
--- trunk/basezym/progsqc/inventory.qc	2007-11-03 21:10:43 UTC (rev 77)
+++ trunk/basezym/progsqc/inventory.qc	2007-11-09 01:06:47 UTC (rev 78)
@@ -15,17 +15,23 @@
 float ITEMTYPE_AI_WEAP1 = 7;
 float ITEMTYPE_AI_WEAP2 = 8;
 float ITEMTYPE_AI_WEAP3 = 9;
+float ITEMTYPE_AI_WEAP4 = 10;
+float ITEMTYPE_AI_WEAP5 = 11;
+float ITEMTYPE_AI_WEAP6 = 12;
 
-float ITEMTYPE_WEAP1_AMMO = 10;
-float ITEMTYPE_WEAP2_AMMO = 11;
-float ITEMTYPE_WEAP3_AMMO = 12;
-float ITEMTYPE_WEAP4_AMMO = 13;
-float ITEMTYPE_WEAP5_AMMO = 14;
-float ITEMTYPE_WEAP6_AMMO = 15;
-float ITEMTYPE_WEAP7_AMMO = 16;
+float ITEMTYPE_ITEM1 = 13;
+float ITEMTYPE_ITEM2 = 14;
 
-float ITEMTYPE_TOTAL = 17;
+float ITEMTYPE_WEAP1_AMMO = 15;
+float ITEMTYPE_WEAP2_AMMO = 16;
+float ITEMTYPE_WEAP3_AMMO = 17;
+float ITEMTYPE_WEAP4_AMMO = 18;
+float ITEMTYPE_WEAP5_AMMO = 19;
+float ITEMTYPE_WEAP6_AMMO = 20;
+float ITEMTYPE_WEAP7_AMMO = 21;
 
+float ITEMTYPE_TOTAL = 22;
+
 float WS_IDLE = 0;
 float WS_FIRE1 = 1;
 float WS_FIRE2 = 2;
@@ -84,7 +90,6 @@
 string iteminfo_pickupsound;
 string iteminfo_pickupmodel;
 string iteminfo_name;
-string iteminfo_pickupsprite;
 float iteminfo_ammo1tracer;
 float iteminfo_ammo2tracer;
 string iteminfo_ammo1tracermodel;
@@ -154,7 +159,6 @@
 	iteminfo_name = "unknown";
 	iteminfo_pickupsound = "";
 	iteminfo_quantitymax = 0;
-	iteminfo_pickupsprite = "";
 	iteminfo_ammo1max = 0;
 	iteminfo_ammo1inventorymax = 0;
 	iteminfo_ammo1minimumtofire = 0;
@@ -213,7 +217,7 @@
 	iteminfo_weapon_rank = 0;
 	
 	
-	if (itemtype < ITEMTYPE_WEAP1_AMMO)
+	if (itemtype < ITEMTYPE_ITEM1)
 	{
 	   	// set the settings for all weapons
 		iteminfo_quantitymax = 1;
@@ -236,7 +240,6 @@
 		
 		iteminfo_name = cvar_string(wname);
 		iteminfo_model = cvar_string(wname,"_model");
-		iteminfo_pickupsprite = cvar_string(wname,"_pickupsprite");
 		iteminfo_weapon_viewmodel = cvar_string(wname,"_viewmodel");
 		iteminfo_pickupmodel = cvar_string(wname,"_pickupmodel");
 		
@@ -246,7 +249,7 @@
 		iteminfo_ammo1firesound = cvar_string(wname,"_ammo1firesound");
 		//iteminfo_ammo1explodesound = strzone(cvar_string(wname,"_ammo1explodesound")); // BAD
 		iteminfo_ammo1max = cvar(wname,"_ammo1max");
-		iteminfo_ammo1inventorymax = cvar(wname,"_ammo1max");
+		iteminfo_ammo1inventorymax = cvar(wname,"_ammo1inventorymax");
 		iteminfo_ammo1flags = cvar(wname,"_ammo1flags");
 		iteminfo_ammo1numberof = cvar(wname,"_ammo1numberof");
 		iteminfo_ammo1recoil = cvar(wname,"_ammo1recoil");
@@ -266,7 +269,8 @@
 		iteminfo_ammo2firesound = cvar_string(wname,"_ammo2firesound");
 		//iteminfo_ammo2explodesound = strzone(cvar_string(wname,"_ammo2explodesound")); // BAD
 		iteminfo_ammo2max = cvar(wname,"_ammo2max");
-		iteminfo_ammo2inventorymax = cvar(wname,"_ammo2max");
+		iteminfo_ammo2inventorymax = cvar(wname,"_ammo2inventorymax");
+		
 		iteminfo_ammo2flags = cvar(wname,"_ammo2flags");
 		iteminfo_ammo2numberof = cvar(wname,"_ammo2numberof");
 		iteminfo_ammo2recoil = cvar(wname,"_ammo2recoil");
@@ -280,6 +284,20 @@
 		iteminfo_ammo2colormod = stov(cvar_string(wname,"_ammo2colormod"));
 		iteminfo_weapon_viewmodelanim_fire2 = stov(cvar_string(wname,"_fire2"));
 	}
+	else if (itemtype < ITEMTYPE_WEAP1_AMMO)
+	{
+	 	wname = strcat("g_item",ftos(itemtype - ITEMTYPE_ITEM1 + 1));
+		
+		iteminfo_name = cvar_string(wname,"_name");
+		iteminfo_model =  cvar_string(wname,"_model");
+		iteminfo_pickupsound = cvar_string(wname,"_pickupsound");
+		iteminfo_ammo1firesound = cvar_string(wname,"_firesound");
+		iteminfo_ammo1explodesound = cvar_string(wname,"_explodesound");
+		iteminfo_ammo1bouncesound =  cvar_string(wname,"_bouncesound");
+		iteminfo_quantitymax = cvar(wname,"_quantitymax");
+		iteminfo_ammo1speeds = stov(cvar_string(wname,"_speeds"));
+		iteminfo_ammo1itemtype = itemtype;
+	}
 	else if (itemtype < ITEMTYPE_TOTAL)
 	{
 		wname = strcat("g_weap",ftos(itemtype - ITEMTYPE_WEAP1_AMMO + 1));
@@ -287,7 +305,7 @@
 		iteminfo_model = cvar_string(wname,"_ammo_model");
 		iteminfo_pickupsound = cvar_string(wname,"_ammo_pickupsound");
 		iteminfo_quantitymax = cvar(wname,"_ammo_quantitymax");
-		iteminfo_pickupsprite = cvar_string(wname,"_ammo_pickupsprite");
+		iteminfo_pickupmodel = cvar_string(wname,"_ammo_pickupmodel");
 	}
 	else
 		error(ftos(itemtype)," Inventory_GetItemInfo: unknown itemtype\n");
@@ -382,9 +400,9 @@
 			character.ammo_shells = iteminfo_ammo1inventory * 200 / (iteminfo_ammo1max + iteminfo_ammo1inventorymax);
 		}
 		if (iteminfo_ammo2max + iteminfo_ammo2inventorymax)
-		{
-			character.ammo_nails = character.jetpack_fuel;
-			character.ammo_rockets = 0;
+		{  //character.jetpack_fuel;
+			character.ammo_nails = iteminfo_ammo2 * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
+			character.ammo_rockets = iteminfo_ammo2inventory * 200 / (iteminfo_ammo2max + iteminfo_ammo2inventorymax);
 		}
 	}
 	if (character.unlimitedinventory)
@@ -548,7 +566,6 @@
 	self.nextthink = time;
 	if (self.flags & FL_ONGROUND)
 	{
-		self.angles_x = self.angles_z = 0;
 		self.avelocity = '0 0 0';
 	}
 };
@@ -563,16 +580,21 @@
 void() Item_Pickup =
 {
 	if (other.classname != "player")
-	if (vlen(self.velocity) > 10)
 		return;
 	sound(other, CHAN_AUTO, self.noise, 1, ATTN_NORM);
 	bprint(self.netname,"\n");
-	Inventory_AddFromInventory(other, self);
 	
+	if (self.health)
+	   other.health = other.health + self.health;
+	else if (self.armorvalue)
+	   other.armorvalue = other.armorvalue + self.armorvalue;
+	else
+		Inventory_AddFromInventory(other, self);
+	
 	self.solid = SOLID_NOT;
-	self.nextthink = time + 10;
+	self.nextthink = time + 15;
 	self.think = Item_Respawn;
-	self.alpha = 0.1;
+	self.alpha = 0.05;
 	setorigin (self, self.origin);
 };
 
@@ -588,18 +610,23 @@
 	newmis.solid = SOLID_BBOX;
 	newmis.movetype = MOVETYPE_TOSS;
 	newmis.velocity = vel;
-	newmis.angles = '0 360 0' * random();
+	newmis.angles = '25 0 0';
 	newmis.nextthink = time + 10;
 	newmis.think = Item_EnableOwner;
 	newmis.use = Item_Pickup;
+	
+	newmis.health = 0;
+	newmis.armorvalue = 0;
+	
 	if (cvar("g_itemtouchpickup"))
 		newmis.touch = Item_Pickup;
 	newmis.noise = iteminfo_pickupsound;
 	setorigin(newmis, org);
 	setmodel(newmis, iteminfo_pickupmodel);
-	setsize(newmis, '-8 -8 -8', '8 8 8');
+	setsize(newmis, '-25 -25 -25', '8 8 8');
 	Inventory_ModifyItem(newmis, itemtype, quantity, ammo1, ammo2);
-	// NOTE: should match viewweapon_animframefunc WS_TURNON code
+	
+	newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT;
 };
 
 void() weapon_weap1 =
@@ -665,6 +692,58 @@
 {
  	Item_Spawn(ITEMTYPE_WEAP7_AMMO,1,100,100,self.origin,'0 0 0',1,world);
 }
+
+void() item_health1 =
+{
+	newmis = spawn();
+	newmis.health = 5;
+	newmis.owner = world;
+	newmis.classname = "Health";
+	newmis.netname = "Health";
+	newmis.ispointable = TRUE;
+	newmis.solid = SOLID_BBOX;
+	newmis.movetype = MOVETYPE_TOSS;
+	newmis.velocity = '0 0 0';
+	newmis.angles = '0 0 0';
+	newmis.nextthink = time + 10;
+	newmis.think = Item_Think;
+	newmis.use = Item_Pickup;
+	if (cvar("g_itemtouchpickup"))
+		newmis.touch = Item_Pickup;
+	newmis.noise = "pickuphealth";
+	setorigin(newmis, self.origin);
+	setmodel(newmis, "models/items/health1.md3");
+	setsize(newmis, '-8 -8 -8', '8 8 8');
+	
+	newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT;
+}
+
+void() item_armor1 =
+{
+	newmis = spawn();
+	newmis.armorvalue = 5;
+	newmis.owner = world;
+	newmis.classname = "Armor";
+	newmis.netname = "Armor";
+	newmis.ispointable = TRUE;
+	newmis.solid = SOLID_BBOX;
+	newmis.movetype = MOVETYPE_TOSS;
+	newmis.velocity = '0 0 0';
+	newmis.angles = '0 0 0';
+	newmis.nextthink = time + 10;
+	newmis.think = Item_Think;
+	newmis.use = Item_Pickup;
+	if (cvar("g_itemtouchpickup"))
+		newmis.touch = Item_Pickup;
+	newmis.noise = "pickuphealth";
+	setorigin(newmis, self.origin);
+	setmodel(newmis, "models/items/armor1.md3");
+	setsize(newmis, '-8 -8 -8', '8 8 8');
+	
+	newmis.effects = newmis.effects | EF_ADDITIVE | EF_FULLBRIGHT;
+}
+
+
 /*
 // _x = quantity, _y = ammo type, _z = ammo quantity
 .vector inventory_weap1;

Modified: trunk/basezym/progsqc/player.qc
===================================================================
--- trunk/basezym/progsqc/player.qc	2007-11-03 21:10:43 UTC (rev 77)
+++ trunk/basezym/progsqc/player.qc	2007-11-09 01:06:47 UTC (rev 78)
@@ -6,7 +6,7 @@
 void() bot_npcthink;
 
 
-entity(float actortyp, float aityp, float animtype, string mdldir, string mdlext, string snddir) playerclass_spawn =
+entity(float actortyp, float aityp, string mdldir, string mdlext, string snddir) playerclass_spawn =
 {
 	local entity e;
 	e = spawn();
@@ -16,12 +16,9 @@
 	e.modeldir = mdldir;
 	e.modelext = mdlext;
 	e.sounddir = snddir;
-	if (animtype == 1)
-	{
-	 	  precache_model(strcat(e.modeldir, "/lower", e.modelext));
-	 	  precache_model(strcat(e.modeldir, "/upper", e.modelext));
-	 	  precache_model(strcat(e.modeldir, "/head", e.modelext));
-	}
+	precache_model(strcat(e.modeldir, "/lower", e.modelext));
+	precache_model(strcat(e.modeldir, "/upper", e.modelext));
+	precache_model(strcat(e.modeldir, "/head", e.modelext));
 	precache_sound(strcat(e.sounddir, "/hardlanding.wav"));
 	precache_sound(strcat(e.sounddir, "/landing.wav"));
 	precache_sound(strcat(e.sounddir, "/jump.wav"));
@@ -43,7 +40,7 @@
 	{
 	 	  cname = strcat("g_class",ftos(classnum));
 	
-		  pc = playerclass_spawn(classnum, cvar(cname,"_aitype"), cvar(cname,"_animationtype"), strzone(cvar_string(cname,"_model")), ".md3", strzone(cvar_string(cname,"_name")));
+		  pc = playerclass_spawn(classnum, cvar(cname,"_aitype"), strzone(cvar_string(cname,"_model")), ".md3", strzone(cvar_string(cname,"_name")));
 		  
 		  pc.health = cvar(cname,"_healthstart");
 		  pc.max_health = cvar(cname,"_healthmax");
@@ -54,8 +51,11 @@
 		  pc.gibhealth = cvar(cname,"_gibhealth");
 		  pc.paintake = 20;
 		  pc.unlimitedinventory = FALSE;
-		  pc.mass = 90;
+		  pc.mass = cvar(cname,"_mass");
 		  
+		  pc.bloodtype = cvar(cname,"_bloodtype");
+		  pc.gibtype = cvar(cname,"_gibtype");
+
 		  pc.jetpack_fuelmax = cvar(cname,"_jetpack_fuelmax");
 		  pc.jetpack_acc = cvar(cname,"_jetpack_acc");
 		  pc.jetpack_accadd = cvar(cname,"_jetpack_accadd");
@@ -84,7 +84,7 @@
 		  pc.jumpspeed = cvar(cname,"_jumpspeed");
 		  pc.speedratio = cvar(cname,"_speedratio");
 		  
-		  if (cvar(cname,"_animationtype") == 1)
+		  if (pc.animationtype == 1)
 		  {
 	   	   	 	pc.actoranim_BOTH_DEATH1   = '0 30 25';
 		  		pc.actoranim_BOTH_DEAD1    = '29 1 25';
@@ -113,13 +113,44 @@
 		  		pc.actoranim_LEGS_IDLECR   = '236 5 15' + legsframesoffset;
 		  		pc.actoranim_LEGS_TURN     = '245 7 15' + legsframesoffset;
 		 }
+		 else if (pc.animationtype == 2)
+		 {
+	   	   	 	pc.actoranim_BOTH_DEATH1   = '0 30 25';
+		  		pc.actoranim_BOTH_DEAD1    = '29 1 25';
+		  		pc.actoranim_BOTH_DEATH2   = '30 30 25';
+		  		pc.actoranim_BOTH_DEAD2    = '59 1 25';
+		  		pc.actoranim_BOTH_DEATH3   = '60 30 25';
+		  		pc.actoranim_BOTH_DEAD3    = '89 1 25';
+		  		pc.actoranim_TORSO_GESTURE = '90 40 20';
+		  		pc.actoranim_TORSO_ATTACK  = '130 6 15';
+		  		pc.actoranim_TORSO_ATTACK2 = '130 6 15';
+		 		pc.actoranim_TORSO_DROP    = '142 5 20';
+		  		pc.actoranim_TORSO_RAISE   = '147 4 20';
+		  		pc.actoranim_TORSO_STAND   = '151 1 15';
+		  		pc.actoranim_TORSO_STAND2  = '152 1 15';
+		  		legsframesoffset = '-1 0 0' * (pc.actoranim_TORSO_STAND2_x + pc.actoranim_TORSO_STAND2_y - pc.actoranim_TORSO_GESTURE_x);
+		  		pc.actoranim_LEGS_WALKCR   = '153 9 20' + legsframesoffset;
+		  		pc.actoranim_LEGS_WALK     = '170 13 18' + legsframesoffset;
+		  		pc.actoranim_LEGS_RUN      = '170 13 18' + legsframesoffset;
+		  		pc.actoranim_LEGS_BACK     = '183 10 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_SWIM     = '193 10 20' + legsframesoffset;
+		  		pc.actoranim_LEGS_JUMP     = '203 9 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_LAND     = '212 5 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_JUMPB    = '217 9 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_LANDB    = '226 3 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_IDLE     = '229 10 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_IDLECR   = '239 8 15' + legsframesoffset;
+		  		pc.actoranim_LEGS_TURN     = '247 7 15' + legsframesoffset;
+		 }
+		 
 		 Inventory_Clear(pc);
+		 
 		 if (cvar(cname,"_startinguserweapon") != 0) // User weapons
 		 {
 		  		startingweapon = cvar(cname,"_startinguserweapon") - 1;
 		  		Inventory_GetItemInfo(pc, startingweapon);
 		  		Inventory_ModifyItem(pc, startingweapon, 1, iteminfo_ammo1max, iteminfo_ammo2max);
-		  		Inventory_ModifyItem(pc, ITEMTYPE_WEAP1_AMMO + cvar(cname,"_startingweapon"), iteminfo_ammo1inventorymax * 2, 0, 0);
+		  		Inventory_ModifyItem(pc, ITEMTYPE_WEAP1_AMMO + startingweapon, iteminfo_ammo1inventorymax * 2, 0, 0);
 		 }
 		 else if (cvar(cname,"_startingaiweapon") != 0) // AI weapons
 		 {
@@ -181,6 +212,9 @@
 	self.unlimitedinventory = pc.unlimitedinventory;
 	self.mass = pc.mass;
 	
+	self.bloodtype = pc.bloodtype;
+	self.gibtype = pc.gibtype;
+	
 	self.jetpack_fuel = pc.jetpack_fuelmax;
 	self.jetpack_fuelmax = pc.jetpack_fuelmax;
 	self.jetpack_acc = pc.jetpack_acc;
@@ -196,31 +230,18 @@
 	
 	self.scaleratio = pc.scaleratio;
 	
+	self.boxmin = pc.boxmin;
+	self.boxmax = pc.boxmax;
+	
 	self.jumpspeed = pc.jumpspeed;
 	self.speedratio = pc.speedratio;
 	
 	setsize (self, pc.mins, pc.maxs);
 	Inventory_CloneFromInventory(self, pc);
 	
-	if (self.animationtype == 1)
-	{
-		actor_setup();
-		player_selectlegsanim(TRUE);
-		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
-	}
-	else
-	{
-		local vector v;
-		self.movetype = MOVETYPE_WALK;
-		self.solid = SOLID_SLIDEBOX;
-		self.takedamage = DAMAGE_AIM;
-		self.ammo_shells = 0;
-		self.ammo_nails = 0;
-		self.ammo_rockets = 0;
-		self.ammo_cells = 0;
-		self.deadflag = DEAD_NO;
-		setmodel(self, strcat(self.playerclass.modeldir, "/model", self.playerclass.modelext));
-	}
+	actor_setup();
+	player_selectlegsanim(TRUE);
+	anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
 	
 	weapon_setup(self, Inventory_GetBestWeapon(self));
 };
@@ -411,13 +432,12 @@
 .float deadtime;
 void() PlayerPreThink =
 {
-	local float im;
-	
 	if ((self.jetpack_fuel < self.jetpack_fuelmax) && (!(self.jetpackactive)))
 	{
 	   self.jetpack_fuel = self.jetpack_fuel + self.jetpack_fuelregenair;
 	}
 	
+	local float im;
 	if (self.flags & FL_CLIENT) // only real players can respawn, not NPCs
 	if (self.deadflag)
 	{
@@ -469,8 +489,6 @@
 		if (self.button5)
 		{
 			self.jetpack_fuel = max(0, self.jetpack_fuel - self.jetpack_use * frametime);
-			//self.armorregentime = max(self.armorregentime, time + ACTOR_SHIELD_REGENDELAY);
-			//self.armorregenplaysound = TRUE;
 			if (!self.jetpackactive)
 			{
 				sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/jetpack.wav"), 1, ATTN_NORM);
@@ -515,10 +533,7 @@
 	local entity oldself;
 	player_regen();
 	
-	if (self.animationtype == 1)
-	    actor_update();
-	else
-		anim_update(self);
+	actor_update();
 	   
 	if (self.pointitem)
 	if (self.pointitem.classname != "")
@@ -847,26 +862,34 @@
 {
 	self.deadflag = DEAD_DEAD;
 	
-	float multiplier = 1;
-	te_bloodshower (self.origin + self.mins, self.origin + self.maxs, 50, 3000);	
+	if (self.gibtype == 1)
+	{
+		te_bloodshower (self.origin + self.mins, self.origin + self.maxs, 50, 3000);	
+		// make a meaty mess
+		TossGib (world, "models/gibs/bloodyskull.md3", self.origin, '0 0 600',0);
+		TossGib (world, "models/gibs/gib1.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/gib1.mdl", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/gib2.mdl", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/gib3.mdl", self.origin, self.velocity,0);
+		// these destory on impact
+		TossGib (world, "models/gibs/gib5.md3", self.origin, '-500 0 450',1);
+		TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 -500 450',1);
+		TossGib (world, "models/gibs/chunk.mdl", self.origin, '500 0 450',1);
+		TossGib (world, "models/gibs/chunk.mdl", self.origin, self.velocity,1);
+		TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 0 450',1);
+		sound (self, CHAN_VOICE, "misc/gib.wav", 1, ATTN_NORM);
+	}
+	else if (self.gibtype == 2)
+	{
+		te_explosion(self.origin);
+		TossGib (world, "models/gibs/m_gib1.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib2.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib3.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib4.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib5.md3", self.origin, self.velocity,0);
+		TossGib (world, "models/gibs/m_gib6.md3", self.origin, self.velocity,0);
+	}
 	
-	// make a meaty mess
-	TossGib (world, "models/gibs/bloodyskull.md3", self.origin, '0 0 600',0);
-
-	TossGib (world, "models/gibs/gib1.md3", self.origin, self.velocity,0);
-	TossGib (world, "models/gibs/gib1.mdl", self.origin, self.velocity,0);
-	TossGib (world, "models/gibs/gib2.mdl", self.origin, self.velocity,0);
-	TossGib (world, "models/gibs/gib3.mdl", self.origin, self.velocity,0);
-
-	// these destory on impact
-	TossGib (world, "models/gibs/gib5.md3", self.origin, '-500 0 450',1);
-	TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 -500 450',1);
-	TossGib (world, "models/gibs/chunk.mdl", self.origin, '500 0 450',1);
-	TossGib (world, "models/gibs/chunk.mdl", self.origin, self.velocity,1);
-	TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 0 450',1);
-
-	sound (self, CHAN_VOICE, "misc/gib.wav", 1, ATTN_NORM);
-	
 	if (self.flags & FL_CLIENT)
 	   TossGib (self, "models/gibs/eye.md3", self.origin, self.velocity,0);
 	else
@@ -895,8 +918,8 @@
 
 void() player_regen =
 {
-	if (self.armorvalue < self.armorregenmax)
 	if (time > self.armorregentime)
+	if (self.armorvalue < self.armorregenmax)
 	if (!self.deadflag)
 	{
 		if (self.armorregenplaysound)
@@ -998,6 +1021,7 @@
 {
 	local float c;
 	local float w;
+	local float select;
 	local entity oldself;
 	if (self.deadflag)
 		return;
@@ -1013,7 +1037,7 @@
 			printsurfaceinfo(self.cursor_trace_ent, self.cursor_trace_endpos);
 			return;
 		}
-		if ((impuls >= 30) && (impuls <= 33))
+		if ((impuls >= 31) && (impuls < 30 + ACTORTYPE_TOTAL))
 		{
 			makevectors(self.v_angle);
 			newmis = spawn();
@@ -1023,68 +1047,43 @@
 			newmis.nextthink = time;
 			oldself = self;
 			self = newmis;
+			self.team = 2;
+			player_spawn(impuls - 30);
 			
-			if (impuls == 30)
-			{
-				self.netname = "Mine Soldier";
-				self.team = 1;
-				player_spawn(ACTORTYPE_CLASS1);
-			}
-			if (impuls == 31) // Players team
-			{
-				self.netname = "Light Guard";
-				self.team = 1;
-				player_spawn(ACTORTYPE_CLASS2);
-			}
-			if (impuls == 32)
-			{
-				self.netname = "Heavy Guard";
-				self.team = 1;
-				player_spawn(ACTORTYPE_CLASS3);
-			}
-			if (impuls == 33) // AI team
-			{
-				self.netname = "Mine Soldier";
-				self.team = 2;
-				player_spawn(ACTORTYPE_CLASS2);
-			}
-			if (impuls == 34)
-			{
-				self.netname = "Light Guard";
-				self.team = 2;
-				player_spawn(ACTORTYPE_CLASS2);
-			}
-			if (impuls == 35)
-			{
-				self.netname = "Heavy Guard";
-				self.team = 2;
-				player_spawn(ACTORTYPE_CLASS3);
-			}
-			
 			self = oldself;
 		}
-		if (impuls == 9)
+		if (impuls == 20)
 		{
 			c = 0;
 			while (c < ITEMTYPE_TOTAL)
 			{
 				Inventory_GetItemInfo(self, c);
 				Inventory_ModifyItem(self, c, iteminfo_quantitymax, iteminfo_ammo1max, iteminfo_ammo2max);
-				bprint(ftos(iteminfo_ammo1max),"\n");
+				bprint(iteminfo_name, " ", ftos(iteminfo_ammo1max)," ", ftos(iteminfo_ammo1inventorymax)," ", ftos(iteminfo_quantitymax),"\n");
 				c = c + 1;
 			}
 			self.switchweaponitem = Inventory_GetBestWeapon(self);
 		}
 	}
-	if (impuls >= 1 && impuls <= 8)
+	if (impuls >= 1 && impuls <= 9)
 	{
-		w = impuls - 1;
-		if (w != self.switchweaponitem)
+		select = impuls;
+		w = 0;
+		while (select >= 0)
 		{
+			if (w >= ITEMTYPE_TOTAL)
+				break;
 			Inventory_GetItemInfo(self, w);
-			bprint("weapon switch: ", ftos(w), " ", ftos(iteminfo_weapon_canfire1), " ", ftos(iteminfo_weapon_canfire2), " ", ftos(iteminfo_weapon_canreload));bprint(" ", ftos(iteminfo_weapon_canraise), "\n");
 			if (iteminfo_weapon_canraise)
-				self.switchweaponitem = w;
+			{
+				select = select - 1;
+				if (select == 0)
+				{
+				   self.switchweaponitem = w;
+				   break;
+				}
+			}
+			w = w + 1;
 		}
 	}
 	if (impuls == 10)




More information about the zymotic-commits mailing list