## XIIIMP
Class XIIIMPMutator

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

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Info
             |
             +--Engine.Mutator
                |
                +--XIIIMP.XIIIMPMutator

Direct Known Subclasses:MarioMutator, XIIIMPCTFMutator, XIIIMPSniperArena, XIIIMPTeamMutator, MPBombMutator

class XIIIMPMutator
extends Engine.Mutator

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

Function Summary
`bool` | `CheckRelevance(Actor Other)`
    //_____________________________________________________________________________
`bool` | `ReplaceWith(Actor Other, string aClassName)`
    //_____________________________________________________________________________

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class XIIIMPMutator extends Mutator;
    00005
    00006	CONST DBMutator=false;
    00007
    00008	//_____________________________________________________________________________
    00009	function bool CheckRelevance(Actor Other)
    00010	{
    00011	    if ( DBMutator ) Log("MUTATOR CheckRelevance for"@Other);
    00012	    // ELR Optimiza, dynamic load mesh for weapons at the init
    00013	    if (XIIIWeaponPickup(Other) != none)
    00014	    {
    00015	      DynamicLoadObject(class<XIIIWeapon>(XIIIWeaponPickup(Other).InventoryType).default.MeshName, class'mesh');
    00016	    }
    00017	    if (XIIIDecoPickup(Other) != none)
    00018	    {
    00019	      DynamicLoadObject(class<XIIIWeapon>(XIIIDecoPickup(Other).InventoryType).default.MeshName, class'mesh');
    00020	    }
    00021	    if ( (XIIIPickup(Other) != none) && (class<XIIIItems>(XIIIPickup(Other).InventoryType)!=none) && (class<XIIIItems>(XIIIPickup(Other).InventoryType).default.MeshName!="") )
    00022	    {
    00023	      DynamicLoadObject(class<XIIIItems>(XIIIPickup(Other).InventoryType).default.MeshName, class'mesh');
    00024	    }
    00025	    return Super.CheckRelevance(other);
    00026	}
    00027
    00028	//_____________________________________________________________________________
    00029	function bool ReplaceWith(actor Other, string aClassName)
    00030	{
    00031	    local Actor A;
    00032	    local class<Actor> aClass;
    00033
    00034	    if ( DBMutator ) Log("MUTATOR ReplaceWith"@Other@"by"@aClassName);
    00035
    00036	    if ( Other.IsA('Inventory') && (Other.Location == vect(0,0,0)) )
    00037	      return false;
    00038
    00039	    aClass = class<Actor>(DynamicLoadObject(aClassName, class'Class'));
    00040	    if ( aClass != None )
    00041	      A = Spawn(aClass,Other.Owner,Other.tag,Other.Location+ (aClass.default.CollisionHeight - Other.default.CollisionHeight) * vect(0,0,1.5), Other.Rotation);
    00042
    00043	    if ( DBMutator ) Log("        ReplaceWith"@Other@"by spawned"@A);
    00044
    00045	    if ( Other.IsA('Pickup') )
    00046	    {
    00047	      if ( Pickup(Other).MyMarker != None )
    00048	      {
    00049	        Pickup(Other).MyMarker.markedItem = Pickup(A);
    00050	        if ( Pickup(A) != None )
    00051	        {
    00052	          Pickup(A).MyMarker = Pickup(Other).MyMarker;
    00053	//          A.SetLocation(A.Location
    00054	//            + (A.CollisionHeight - Other.CollisionHeight) * vect(0,0,1));
    00055	        }
    00056	        Pickup(Other).MyMarker = None;
    00057	      }
    00058	      else if ( A.IsA('Pickup') )
    00059	          Pickup(A).Respawntime = 0.0;
    00060	    }
    00061	    if ( A != None )
    00062	    {
    00063	      A.event = Other.event;
    00064	      A.tag = Other.tag;
    00065	      Other.Destroy();
    00066	      return true;
    00067	    }
    00068	    return false;
    00069	}
    00070
    00071
    00072
    00073	defaultproperties
    00074	{
    00075	     DefaultWeaponName="XIIIMP.BerettaMulti"
    00076	}

End Source Code