## XIIIMP
Class BotPlayer

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

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Pawn
             |
             +--XIII.XIIIPawn
                |
                +--XIII.XIIIPlayerPawn
                   |
                   +--XIIIMP.XIIIMPPlayerPawn
                      |
                      +--XIIIMP.BotPlayer

Direct Known Subclasses:Bot_GI, Bot_Killer1, Bot_Killer2, Bot_XIII

class BotPlayer
extends XIIIMP.XIIIMPPlayerPawn

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

Function Summary
`simulated` | `AnimateRunning()`
    //__________________________________________________________________
`void` | `Heal(int H)`
    //_____________________________________________________________________________
    // ELR to heal

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class BotPlayer extends XIIIMPPlayerPawn;
    00005
    00006	//_____________________________________________________________________________
    00007	// ELR to heal
    00008	function Heal(int H)
    00009	{
    00010	    Local int i;
    00011
    00012	//    log("Heal called w/ ammount="$H);
    00013	    Health = Min(Default.Health, Health+H);
    00014	//    PlaySound(hHealSound); // NO PLAYSOUND FOR BOTS
    00015	//    CheckMaluses(); // no need in this now that we don't have any negative fx for low health
    00016	}
    00017
    00018	event GainedChild( Actor Other )
    00019	{
    00020	    if( ( XIIIAmmo( Other ) != none ) || ( XIIIWeapon( Other ) != none ) )
    00021	    {
    00022	        BotController(Controller).SwitchWeapon();
    00023	    }
    00024	}
    00025
    00026	//_____________________________________________________________________________
    00027	event FellOutOfWorld()
    00028	{
    00029		if ( Role < ROLE_Authority )
    00030			return;
    00031		Health = -1;
    00032		SetPhysics(PHYS_None);
    00033		Weapon = None;
    00034		Died(None, class'Gibbed', Location);
    00035	}
    00036
    00037	//_____________________________________________________________________________
    00038	function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, class<DamageType> damageType)
    00039	{
    00040	    Super.TakeDamage(Damage, instigatedBy, hitlocation, momentum, damageType);
    00041
    00042	    if( ( Controller == none ) || ( instigatedBy == none ) )
    00043	        return;
    00044
    00045	    if( Controller.bIsBot )
    00046	        BotController( Controller ).SomeoneWantKillMe( instigatedBy );
    00047	}
    00048
    00049	//_____________________________________________________________________________
    00050	event Landed(vector HitNormal)
    00051	{
    00052	    BotController(controller).bIsJumping = false;
    00053
    00054	    super.Landed(HitNormal);
    00055	}
    00056
    00057	//__________________________________________________________________
    00058
    00059	event Touch( Actor Other )
    00060	{
    00061	    local NavigationPoint NavPoint, TmpNext, TmpNext2;
    00062
    00063	    if( JumpPathNode(Other) != none )
    00064	    {
    00065	        if ( Physics != PHYS_Falling )
    00066	        {
    00067	            TmpNext = NavigationPoint(BotController( Controller ).PathCache[ BotController( Controller ).PathIndex ]);
    00068
    00069	            if( BotController( Controller ).PathIndex +1 < BotController( Controller ).PathCacheSize )
    00070	                TmpNext2 = NavigationPoint(BotController( Controller ).PathCache[ BotController( Controller ).PathIndex +1 ]);
    00071
    00072	            if( ( JumpPathNode(Other).JumpTarget == TmpNext ) || ( JumpPathNode(Other).JumpTarget == TmpNext2 ) )
    00073	                BotController(controller).InitBotJump( JumpPathNode(Other).V, JumpPathNode(Other).H, JumpPathNode(Other).JumpTarget );
    00074	        }
    00075	    }
    00076	    else if( CrouchPathNode(Other) != none )
    00077	        ShouldCrouch( true );
    00078	    else if( GrenadPathNode(Other) != none )
    00079	        BotController(controller).GrenadPossibility( GrenadPathNode(Other) );
    00080	}
    00081
    00082	//__________________________________________________________________
    00083
    00084	simulated function AnimateRunning()
    00085	{
    00086	    super.AnimateRunning();
    00087
    00088	    MovementAnims[1] = 'StrafeG';
    00089	    MovementAnims[3] = 'StrafeD';
    00090	}
    00091
    00092
    00093
    00094	defaultproperties
    00095	{
    00096	     bUpdateEyeheight=True
    00097	     bSameZoneHearing=False
    00098	     bAdjacentZoneHearing=False
    00099	     bMuffledHearing=False
    00100	     SightRadius=2500.000000
    00101	     ControllerClass=Class'XIIIMP.BotController'
    00102	}

End Source Code