RuneI
Class RuneOfHealth

source: c:\runehov\RuneI\Classes\RuneOfHealth.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Pickup
            |
            +--RuneI.Runes
               |
               +--RuneI.RuneOfHealth
Direct Known Subclasses:None

class RuneOfHealth
extends RuneI.Runes

//============================================================================= // RuneOfHealth. // Increases maximum health //=============================================================================

Function Summary
 bool PawnWantsRune(Pawn Other)
 void PickupFunction(Pawn Other)



Source Code


00001	//=============================================================================
00002	// RuneOfHealth.
00003	// Increases maximum health
00004	//=============================================================================
00005	class RuneOfHealth extends Runes;
00006	
00007	function PickupFunction(Pawn Other)
00008	{
00009		local int i;
00010	
00011		Other.MaxHealth += RunePower;
00012		Other.MaxHealth = Clamp(Other.MaxHealth, 0, 200);
00013		Other.Health = Other.MaxHealth;
00014	
00015		// Cure eater of any ailments
00016		if(Other.Fatness != 128)
00017			Other.DesiredFatness = 128;
00018		if(Other.ScaleGlow != 1.0)
00019			Other.ScaleGlow = 1.0;
00020		if(Other.BodyPartMissing(BODYPART_LARM1))
00021			Other.RestoreBodyPart(BODYPART_LARM1);
00022		if(Other.BodyPartMissing(BODYPART_RARM1))
00023			Other.RestoreBodyPart(BODYPART_RARM1);
00024	
00025		// Restore health of bodyparts (must be after restoring limbs)
00026		for (i=0; i<NUM_BODYPARTS; i++)
00027			Other.BodyPartHealth[i] = Other.Default.BodyPartHealth[i];
00028	
00029		Destroy();
00030	}
00031	
00032	function bool PawnWantsRune(Pawn Other)
00033	{// return whether the pawn should currently want this rune
00034		return (Other.MaxHealth < 200 ||
00035				Other.Health < Other.MaxHealth ||
00036				Other.BodyPartMissing(BODYPART_LARM1) ||
00037				Other.BodyPartMissing(BODYPART_RARM1));
00038	}
00039	
00040	defaultproperties
00041	{
00042	     RunePower=20.000000
00043	     SpheresClass=Class'RuneI.RuneSpheresHealth'
00044	     PickupMessage="You picked up a Rune of Health"
00045	     PickupSound=Sound'OtherSnd.Pickups.pickup12'
00046	     SoundRadius=21
00047	     SoundVolume=126
00048	     SoundPitch=83
00049	     AmbientSound=Sound'WeaponsSnd.PowerUps.power66L'
00050	     CollisionRadius=11.000000
00051	     CollisionHeight=11.000000
00052	     Skeletal=SkelModel'objects.Rune3'
00053	}

End Source Code