File:  [Quake II] / quake2 / game / vwep.diff
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:59:04 2018 UTC (8 years, 2 months ago) by root
Branches: iD, MAIN
CVS tags: quake2_317, HEAD
Quake II v3.17

--- h:\quake2\code\game\p_weapon.c	Wed Apr 01 15:57:17 1998
+++ p_weapon.c	Wed Apr 01 14:43:35 1998
@@ -152,6 +152,34 @@
 current
 ===============
 */
+
+// ### Hentai ### BEGIN
+void ShowGun(edict_t *ent)
+{
+	char heldmodel[128];
+	int len;
+
+	if(ent->s.modelindex != 255 || ent->deadflag || !ent->client->pers.weapon)
+	{
+		ent->s.modelindex2 = 0;
+		return;
+	}
+
+	strcpy(heldmodel, "players/");
+	strcat(heldmodel, Info_ValueForKey (ent->client->pers.userinfo, "skin"));
+	for(len = 8; heldmodel[len]; len++)
+	{
+		if(heldmodel[len] == '/')
+			heldmodel[++len] = '\0';
+	}
+	strcat(heldmodel, ent->client->pers.weapon->icon);	
+	strcat(heldmodel, ".md2");
+	//gi.dprintf ("%s\n", heldmodel);
+	ent->s.modelindex2 = gi.modelindex(heldmodel);	// Hentai's custom gun models
+
+}
+// ### Hentai ### END
+
 void ChangeWeapon (edict_t *ent)
 {
 	if (ent->client->grenade_time)
@@ -167,9 +195,6 @@
 	ent->client->newweapon = NULL;
 	ent->client->machinegun_shots = 0;
 
-	// set visible model
-	ent->s.skinnum = (ent - g_edicts - 1) || ((ent->client->pers.weapon->weapmodel & 0xff) << 8);
-
 	if (ent->client->pers.weapon && ent->client->pers.weapon->ammo)
 		ent->client->ammo_index = ITEM_INDEX(FindItem(ent->client->pers.weapon->ammo));
 	else
@@ -185,6 +210,7 @@
 	ent->client->ps.gunframe = 0;
 	ent->client->ps.gunindex = gi.modelindex(ent->client->pers.weapon->view_model);
 
+	// ### Hentai ### BEGIN
 	ent->client->anim_priority = ANIM_PAIN;
 	if(ent->client->ps.pmove.pm_flags & PMF_DUCKED)
 	{
@@ -197,6 +223,10 @@
 			ent->client->anim_end = FRAME_pain304;
 			
 	}
+	
+	ShowGun(ent);	
+
+	// ### Hentai ### END
 }
 
 /*
@@ -354,11 +384,12 @@
 {
 	int		n;
 
+	// ### Hentai ### BEGIN
 	if(ent->deadflag || ent->s.modelindex != 255) // VWep animations screw up corpses
 	{
 		return;
 	}
-
+	// ### Hentai ### END 
 	if (ent->client->weaponstate == WEAPON_DROPPING)
 	{
 		if (ent->client->ps.gunframe == FRAME_DEACTIVATE_LAST)
@@ -366,7 +397,9 @@
 			ChangeWeapon (ent);
 			return;
 		}
-		else if ((FRAME_DEACTIVATE_LAST - ent->client->ps.gunframe) == 4)
+
+			// ### Hentai ### BEGIN
+		else if((FRAME_DEACTIVATE_LAST - ent->client->ps.gunframe) == 4)
 		{
 			ent->client->anim_priority = ANIM_REVERSE;
 			if(ent->client->ps.pmove.pm_flags & PMF_DUCKED)
@@ -381,6 +414,8 @@
 				
 			}
 		}
+		// ### Hentai ### END
+
 
 		ent->client->ps.gunframe++;
 		return;
@@ -403,8 +438,8 @@
 	{
 		ent->client->weaponstate = WEAPON_DROPPING;
 		ent->client->ps.gunframe = FRAME_DEACTIVATE_FIRST;
-
-		if ((FRAME_DEACTIVATE_LAST - FRAME_DEACTIVATE_FIRST) < 4)
+				// ### Hentai ### BEGIN
+		if((FRAME_DEACTIVATE_LAST - FRAME_DEACTIVATE_FIRST) < 4)
 		{
 			ent->client->anim_priority = ANIM_REVERSE;
 			if(ent->client->ps.pmove.pm_flags & PMF_DUCKED)
@@ -419,6 +454,7 @@
 				
 			}
 		}
+		// ### Hentai ### END
 		return;
 	}
 
@@ -538,11 +574,7 @@
 	speed = GRENADE_MINSPEED + (GRENADE_TIMER - timer) * ((GRENADE_MAXSPEED - GRENADE_MINSPEED) / GRENADE_TIMER);
 	fire_grenade2 (ent, start, forward, damage, speed, timer, radius, held);
 
-	if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
-		ent->client->pers.inventory[ent->client->ammo_index]--;
-
-	ent->client->grenade_time = level.time + 1.0;
-
+	// ### Hentai ### BEGIN
 	if(ent->deadflag || ent->s.modelindex != 255) // VWep animations screw up corpses
 	{
 		return;
@@ -560,6 +592,13 @@
 		ent->s.frame = FRAME_wave08;
 		ent->client->anim_end = FRAME_wave01;
 	}
+	// ### Hentai ### END
+
+
+	if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
+		ent->client->pers.inventory[ent->client->ammo_index]--;
+
+	ent->client->grenade_time = level.time + 1.0;
 }
 
 void Weapon_Grenade (edict_t *ent)
@@ -875,8 +914,8 @@
 			else
 				damage = 20;
 			Blaster_Fire (ent, offset, damage, true, effect);
-			if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
-				ent->client->pers.inventory[ent->client->ammo_index]--;
+			
+			// ### Hentai ### BEGIN
 
 			ent->client->anim_priority = ANIM_ATTACK;
 			if (ent->client->ps.pmove.pm_flags & PMF_DUCKED)
@@ -889,6 +928,12 @@
 				ent->s.frame = FRAME_attack1 - 1;
 				ent->client->anim_end = FRAME_attack8;
 			}
+	
+			// ### Hentai ### END
+
+
+			if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
+				ent->client->pers.inventory[ent->client->ammo_index]--;
 		}
 
 		ent->client->ps.gunframe++;
@@ -990,8 +1035,7 @@
 
 	PlayerNoise(ent, start, PNOISE_WEAPON);
 
-	if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
-		ent->client->pers.inventory[ent->client->ammo_index]--;
+	// ### Hentai ### BEGIN
 
 	ent->client->anim_priority = ANIM_ATTACK;
 	if (ent->client->ps.pmove.pm_flags & PMF_DUCKED)
@@ -1004,6 +1048,12 @@
 		ent->s.frame = FRAME_attack1 - (int) (random()+0.25);
 		ent->client->anim_end = FRAME_attack8;
 	}
+
+	// ### Hentai ### END
+
+
+	if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
+		ent->client->pers.inventory[ent->client->ammo_index]--;
 }
 
 void Weapon_Machinegun (edict_t *ent)
@@ -1059,6 +1109,8 @@
 		ent->client->weapon_sound = gi.soundindex("weapons/chngnl1a.wav");
 	}
 
+	// ### Hentai ### BEGIN
+
 	ent->client->anim_priority = ANIM_ATTACK;
 	if (ent->client->ps.pmove.pm_flags & PMF_DUCKED)
 	{
@@ -1071,6 +1123,10 @@
 		ent->client->anim_end = FRAME_attack8;
 	}
 
+
+	// ### Hentai ### END
+
+
 	if (ent->client->ps.gunframe <= 9)
 		shots = 1;
 	else if (ent->client->ps.gunframe <= 14)
@@ -1129,6 +1185,7 @@
 
 	PlayerNoise(ent, start, PNOISE_WEAPON);
 
+	
 	if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
 		ent->client->pers.inventory[ent->client->ammo_index] -= shots;
 }
--- h:\quake2\code\game\p_view.c	Fri Feb 27 10:09:55 1998
+++ p_view.c	Sun Mar 08 18:17:03 1998
@@ -860,7 +860,16 @@
 	if (!ent->groundentity && client->anim_priority <= ANIM_WAVE)
 		goto newanim;
 
-	if (ent->s.frame < client->anim_end)
+	// ### Hentai ### BEGIN
+	if(client->anim_priority == ANIM_REVERSE)
+	{
+		if(ent->s.frame > client->anim_end)
+		{
+			ent->s.frame--;
+			return;
+		}
+	}
+	else if (ent->s.frame < client->anim_end) // ### Hentai ### END
 	{	// continue an animation
 		ent->s.frame++;
 		return;
--- h:\quake2\code\game\p_client.c	Wed Apr 01 15:49:55 1998
+++ p_client.c	Sun Mar 08 18:27:09 1998
@@ -956,6 +956,10 @@
 a deathmatch.
 ============
 */
+// ### Hentai ### BEGIN
+void ShowGun(edict_t *ent);
+// ###	Hentai ### END
+
 void PutClientInServer (edict_t *ent)
 {
 	vec3_t	mins = {-16, -16, -24};
@@ -1068,12 +1072,9 @@
 
 	// clear entity state values
 	ent->s.effects = 0;
-	ent->s.modelindex = 255;		// will use the skin specified model
-	ent->s.modelindex2 = 255;		// custom gun model
-	// sknum is player num and weapon number
-	// weapon number will be added in changeweapon
 	ent->s.skinnum = ent - g_edicts - 1;
-
+	ent->s.modelindex = 255;		// will use the skin specified model
+	ShowGun(ent);					// ### Hentai ### special gun model
 	ent->s.frame = 0;
 	VectorCopy (spawn_origin, ent->s.origin);
 	ent->s.origin[2] += 1;	// make sure off ground
@@ -1250,6 +1251,7 @@
 
 	// save off the userinfo in case we want to check something later
 	strncpy (ent->client->pers.userinfo, userinfo, sizeof(ent->client->pers.userinfo)-1);
+	ShowGun(ent);
 }
 
 
--- h:\quake2\code\game\g_local.h	Wed Apr 01 15:57:37 1998
+++ g_local.h	Wed Mar 25 13:32:45 1998
@@ -9,7 +9,7 @@
 #include "game.h"
 
 // the "gameversion" client command will print this plus compile date
-#define	GAMEVERSION	"baseq2"
+#define	GAMEVERSION	"VWep 3.14v4"
 
 // protocol bytes that can be directly added to messages
 #define	svc_muzzleflash		1
@@ -198,19 +198,6 @@
 #define IT_KEY			16
 #define IT_POWERUP		32
 
-// gitem_t->weapmodel for weapons indicates model index
-#define WEAP_BLASTER			1 
-#define WEAP_SHOTGUN			2 
-#define WEAP_SUPERSHOTGUN		3 
-#define WEAP_MACHINEGUN			4 
-#define WEAP_CHAINGUN			5 
-#define WEAP_GRENADES			6 
-#define WEAP_GRENADELAUNCHER	7 
-#define WEAP_ROCKETLAUNCHER		8 
-#define WEAP_HYPERBLASTER		9 
-#define WEAP_RAILGUN			10
-#define WEAP_BFG				11
-
 typedef struct gitem_s
 {
 	char		*classname;	// spawning name
@@ -232,8 +219,6 @@
 	char		*ammo;			// for weapons
 	int			flags;			// IT_* flags
 
-	int			weapmodel;		// weapon model index (for weapons)
-
 	void		*info;
 	int			tag;
 
@@ -537,7 +522,6 @@
 // and saving / loading games
 //
 #define FFL_SPAWNTEMP		1
-#define FFL_NOSPAWN			2
 
 typedef enum {
 	F_INT, 
@@ -549,8 +533,6 @@
 	F_EDICT,			// index on disk, pointer in memory
 	F_ITEM,				// index on disk, pointer in memory
 	F_CLIENT,			// index on disk, pointer in memory
-	F_FUNCTION,
-	F_MMOVE,
 	F_IGNORE
 } fieldtype_t;
 
@@ -785,8 +767,10 @@
 #define	ANIM_PAIN		3
 #define	ANIM_ATTACK		4
 #define	ANIM_DEATH		5
-#define	ANIM_REVERSE	6
 
+// ### Hentai ### BEGIN
+#define ANIM_REVERSE	6
+// ### Hentai ### END
 
 // client data that stays across multiple level loads
 typedef struct

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.