Max health/armor pickups

Looking for Resources for your mod/project? Want to share some of your creations so others can use them? Post them here!
Post Reply
Lollipop
Zandrone
Posts: 1123
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

Max health/armor pickups

#1

Post by Lollipop » Sat Sep 07, 2013 1:42 pm

Hello fellow doomers, I found the idea of max health and armor interesting, so I looked around and found this:
Spoiler: Max bonuses from skulltag (Open)
ACTOR MaxArmorBonus : BasicArmorBonus 5091
{
Game Doom
Game Heretic
Game Hexen
SpawnID 167
Radius 20
Height 16
Inventory.Pickupmessage "$PICKUP_MAXARMORBONUS"
Inventory.Icon "ARM1A0"
Armor.Savepercent 33.33333
Armor.Saveamount 1
Armor.Maxsaveamount 200
Armor.MaxBonus 1
Armor.MaxBonusMax 50
+COUNTITEM
+INVENTORY.ALWAYSPICKUP
States
{
Spawn:
BON4 ABCDCB 6
loop
}
}


ACTOR MaxHealthBonus : MaxHealth 5090
{
Game Doom
Game Heretic
Game Hexen
SpawnID 166
+COUNTITEM
+INVENTORY.ALWAYSPICKUP
Inventory.Amount 1
Inventory.MaxAmount 50
Health 200
Inventory.PickupMessage "$PICKUP_MAXHEALTHBONUS"
States
{
Spawn:
BON3 ABCDCB 6
Loop
}
}

I will give a little explanation on how this works:
Spoiler: Health (Open)
The health bonus is like a normal health pickup, but when inheriting from maxhealth instead of health, it increases the maxhealth of the player.
Inventory.Amount 1 - This defines both how much health you gain, but also the amount your max is increased.
Inventory.MaxAmount 50 - This defines how much you can push the limit over the default playerclass max hp.

This means that health will always give same max increase and same heal, unless you make the pickup give another item upon pickup.
Spoiler: armor (Open)
The armor bonus works differently, instead of using different inheritance, it have other properties:
Armor.MaxBonus 1 - This defines how much your max in increased.
Armor.MaxBonusMax 50 - This is how much your max can get increased.

The armor pickups can however give for example 10 armor but only increase max armor by 1, with no need to use two items.
Note that if you got an item that can give +50 max to either health or armor and another that can give +100, their effects will not stack into a total of +150, it will always cap at +100.
Spoiler: example (Open)
ACTOR MaxHealthBonus : MaxHealth
{
+COUNTITEM
+INVENTORY.ALWAYSPICKUP
Inventory.Amount 1
Inventory.MaxAmount 50
Health 200
Inventory.PickupMessage "Got max health pickup!"
States
{
Spawn:
BON3 ABCDCB 6
Loop
}
}

ACTOR MegaMaxHealthBonus : MaxHealthBonus
{
Inventory.Amount 10
Inventory.MaxAmount 100
Inventory.PickupMessage "Got Mega max health pickup!"
}

If you pick up 10 MegaMaxHealthBonus, then your health wont go higher, when if you pick up regular MaxHealth Bonuses.
Why not do this the strife way, like described on the zdoom wiki? Because that way every health item will fully heal the player.

NOTE: The "health" property in the health pickups is how high your health can go when using that pickup. This put you in better command over how you want your pickups to work.
When it is 200, it works in a way similar to this, and ignores the max increase:
("Health" property in pickup) - ("Health" property in playerclass) = how high above it will give health
for normal doom health bonuses (and skulltag max hp bonus):
200 - 100 = 100
Therefore it will cap at 200 with normal doom health bonuses and 250 when fully filled with skulltag max health bonuses.

Marcus101RR
New User
Posts: 2
Joined: Wed Oct 24, 2012 12:47 am

Re: Max health/armor pickups

#2

Post by Marcus101RR » Mon Apr 18, 2016 11:22 pm

I actually have a problem with this, and rather than typing another thread out for this, I figured to post this here for any of the Decorate geniuses out there.

The code below is suppose to allow players to have a MAX of 200 health if they don't die and manage to collect 100 for health and armor. When they travel to the next level, it capsizes to 150 (+50) again, anyone know how to circumvent this?

Code: Select all

ACTOR MaxHealth2 : Health
{
	Inventory.MaxAmount 100
	Inventory.PickupSound "misc/health_pkup"
}

//=================================================================================================
//
// Max. health bonus
//
//=================================================================================================

ACTOR MaxHealthBonus2 : MaxHealth2 5090
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 166
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.Amount 1
	Inventory.MaxAmount 100
	Health 200
	Inventory.PickupMessage "$PICKUP_MAXHEALTHBONUS"
	States
	{
	Spawn:
		BON3 ABCDCB 6
		Loop
	}
}

ACTOR MaxArmorBonus2 : BasicArmorBonus 5091
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 167
	Radius 20
	Height 16
	Inventory.Pickupmessage "$PICKUP_MAXARMORBONUS"
	Inventory.Icon "ARM1A0"
	Armor.Savepercent 33.33333
	Armor.Saveamount 1
	Armor.Maxsaveamount 200
	Armor.MaxBonus 1
	Armor.MaxBonusMax 100
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	States
	{
	Spawn:
		BON4 ABCDCB 6
		loop
	}
}

Post Reply