## XIIIMP
Class MarioSuperBonusPickUp

source: C:\XIII\XIIIMP\Classes\MarioSuperBonusPickUp.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Pickup
             |
             +--XIIIMP.MarioSuperBonusPickUp

Direct Known Subclasses:None

class MarioSuperBonusPickUp
extends Engine.Pickup

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Variables
`int` | `PlayerRank`
`class` | `RandomInventoryType[9]`
`string` | `RandomPickupMessage[9]`
`sound` | `RandomPickupSound[9]`

States
Pickup

Function Summary
`float` | `BotDesireability(Pawn Bot)`
    //______________________________________________________________________________
`void` | `GetRandomItem()`
    //______________________________________________________________________________
`void` | `GetRank(Actor P)`
    //______________________________________________________________________________

State Pickup Function Summary

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class MarioSuperBonusPickUp extends Pickup;
    00005
    00006	var class<Inventory> RandomInventoryType[9];
    00007	var localized string RandomPickupMessage[9];
    00008	var sound RandomPickupSound[9];
    00009	var int PlayerRank;
    00010
    00011	//______________________________________________________________________________
    00012
    00013	function GetRank( Actor P)
    00014	{
    00015	    local int Loop;
    00016	    local controller C;
    00017	    local HUD D;
    00018
    00019	    if( XIIIMPPlayerPawn(P) != none )
    00020	    {
    00021	        C = XIIIMPPlayerPawn(P).Controller;
    00022	        D = PlayerController(C).MyHUD;
    00023
    00024	        if( D != none )
    00025	        {
    00026	            for( Loop = 0 ; Loop < 32 ; Loop++ )
    00027	            {
    00028	                if(  XIIIMPScoreBoard(D.Scoring).Ordered[ Loop ] == XIIIMPPlayerPawn(P).PlayerReplicationInfo )
    00029	                {
    00030	                    PlayerRank = Loop+1;
    00031	                    break;
    00032	                }
    00033	            }
    00034	        }
    00035	    }
    00036	}
    00037
    00038	//______________________________________________________________________________
    00039
    00040	function GetRandomItem()
    00041	{
    00042	    local int RandId;
    00043
    00044	    RandId=Rand(9)-Rand(PlayerRank);
    00045
    00046	    if( RandId < 0 )
    00047	        RandId = 0;
    00048
    00049	    InventoryType=RandomInventoryType[RandId];
    00050
    00051	    default.InventoryType=RandomInventoryType[RandId];
    00052	}
    00053
    00054	//______________________________________________________________________________
    00055
    00056	auto state Pickup
    00057	{
    00058	    event Touch( actor Other )
    00059	    {
    00060	        GetRank( Other );
    00061	        GetRandomItem();
    00062
    00063	        super.Touch( Other );
    00064	    }
    00065	}
    00066
    00067	//______________________________________________________________________________
    00068
    00069	function float BotDesireability( pawn Bot )
    00070	{
    00071	    return MaxDesireability;
    00072	}
    00073
    00074	//_____________________________________________________________________________
    00075
    00076
    00077
    00078	defaultproperties
    00079	{
    00080	     RandomInventoryType(0)=Class'XIIIMP.Invulnerability'
    00081	     RandomInventoryType(1)=Class'XIIIMP.Invisibility'
    00082	     RandomInventoryType(2)=Class'XIIIMP.SuperDamage'
    00083	     RandomInventoryType(3)=Class'XIIIMP.Regeneration'
    00084	     RandomInventoryType(4)=Class'XIIIMP.SuperArmor'
    00085	     RandomInventoryType(5)=Class'XIIIMP.Teleport'
    00086	     RandomInventoryType(6)=Class'XIIIMP.SuperBoost'
    00087	     RandomInventoryType(7)=Class'XIIIMP.LoseArmor'
    00088	     RandomInventoryType(8)=Class'XIIIMP.LoseLife'
    00089	     MaxDesireability=1.000000
    00090	     RespawnTime=20.000000
    00091	     PickupMessage="Bonus Item"
    00092	     PickupSound=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hCaisse'
    00093	     hRespawnSound=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hRespawnGun'
    00094	     DrawType=DT_StaticMesh
    00095	     StaticMesh=StaticMesh'MeshArmesPickup.MultiBoxBonus'
    00096	     DrawScale3D=(X=0.500000,Y=0.500000,Z=0.500000)
    00097	     CollisionHeight=32.000000
    00098	     MessageClass=Class'XIII.XIIIPickupMessage'
    00099	}

End Source Code