Health
Created By: Marius
eMail: lordshoel@yahoo.com
Difficulty Scale: Easy


After playing Quake 2 and collecting Stimpacks, seeing the health rise above 100 without affecting the maximum was fantastic. In this tutorial I'll show you how to modify the Rotten helath to be similar to that of Quake 2 stimpacks. So lest go shall we...

Step 1.

First open up Items.qc and scroll to the function Item_Health. Find the following code:

	if (self.spawnflags & H_ROTTEN)
	{
		precache_model("maps/b_bh10.bsp");

		precache_sound("items/r_item1.wav");
		setmodel(self, "maps/b_bh10.bsp");
		self.noise = "items/r_item1.wav";
		self.healamount = 15;
		self.healtype = 0;
	}
Now change the value of self.healamount from 15 to 5. Leave everything else as is for now. It should now look like this:

	if (self.spawnflags & H_ROTTEN)
	{
		precache_model("maps/b_bh10.bsp");

		precache_sound("items/r_item1.wav");
		setmodel(self, "maps/b_bh10.bsp");
		self.noise = "items/r_item1.wav";
		self.healamount = 5;
		self.healtype = 0;
	}
When you have made that simple change go on to Step 2.

Step 2.

Now scroll down a little till you come to the function Health_Touch. Find the following segment:

	if (self.healtype == 2) // Megahealth?  Ignore max_health...
	{
		if (other.health >= 250)
			return;
		if (!T_Heal(other, self.healamount, 1))
			return;
	}
	else
	{
		if (!T_Heal(other, self.healamount, 0))
			return;
	}
Once you found it replace it with the following code and that should be it.

	if (self.healtype == 1) // Rotten Health...
	{
		if (other.health >= 150) return;
		if (!T_Heal(other, self.healamount, 1)) return;
	}
	else if (self.healtype == 2) // Megahealth?  Ignore max_health...
	{
		if (other.health >= 250) return;
		if (!T_Heal(other, self.healamount, 1)) return;
	}
	else
	{
		if (!T_Heal(other, self.healamount, 0)) return;
	}

Step 3.

There we go. All done. Save, Compile, and Play. What do you think? If you have any commments or suggestions email me via lordshoel@yahoo.com. Thanks. Marius