RuneI
Class RuneOfPower

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

class RuneOfPower
extends RuneI.Runes

//============================================================================= // RuneOfPower. // Increases maximum rune power //=============================================================================

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



Source Code


00001	//=============================================================================
00002	// RuneOfPower.
00003	// Increases maximum rune power
00004	//=============================================================================
00005	class RuneOfPower extends Runes;
00006	
00007	function PickupFunction(Pawn Other)
00008	{
00009	/*
00010		local float percent;
00011	
00012		percent = float(Other.RunePower)/float(Other.MaxPower);
00013		Other.MaxPower += RunePower;
00014		Other.RunePower = percent * Other.MaxPower;
00015	*/
00016		Other.MaxPower += RunePower;
00017		Other.MaxPower = Clamp(Other.MaxPower, 0, 200);
00018		Other.RunePower = Other.MaxPower; // Fill the player fully up
00019	
00020		// Cure eater of any ailments
00021		if(Other.Fatness != 128)
00022			Other.DesiredFatness = 128;
00023		if(Other.ScaleGlow != 1.0)
00024			Other.ScaleGlow = 1.0;
00025		if(Other.BodyPartMissing(BODYPART_LARM1))
00026			Other.RestoreBodyPart(BODYPART_LARM1);
00027		if(Other.BodyPartMissing(BODYPART_RARM1))
00028			Other.RestoreBodyPart(BODYPART_RARM1);
00029	
00030		Destroy();
00031	}
00032	
00033	function bool PawnWantsRune(Pawn Other)
00034	{// return whether the pawn should currently want this rune
00035		return (Other.MaxPower < 200 ||
00036				Other.RunePower < Other.MaxPower ||
00037				Other.BodyPartMissing(BODYPART_LARM1) ||
00038				Other.BodyPartMissing(BODYPART_RARM1));
00039	}
00040	
00041	defaultproperties
00042	{
00043	     RunePower=20.000000
00044	     SpheresClass=Class'RuneI.RuneSpheresPower'
00045	     PickupMessage="You picked up a Rune of Power"
00046	     PickupSound=Sound'OtherSnd.Pickups.pickup08'
00047	     SoundRadius=21
00048	     SoundVolume=101
00049	     SoundPitch=83
00050	     AmbientSound=Sound'WeaponsSnd.PowerUps.power69L'
00051	     CollisionRadius=11.000000
00052	     CollisionHeight=10.000000
00053	     Skeletal=SkelModel'objects.Rune1'
00054	}

End Source Code