XIIIMP
Class MPBombMutator

source: C:\XIII\XIIIMP\Classes\MPBombMutator.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Engine.Mutator
            |
            +--XIIIMP.XIIIMPMutator
               |
               +--XIIIMP.MPBombMutator
Direct Known Subclasses:XIIIMPDuckMutator

class MPBombMutator
extends XIIIMP.XIIIMPMutator

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 bool AddStorage


Function Summary
 bool CheckReplacement(Actor Other, out byte)
     
//______________________________________________________________________________
 void ModifyPlayer(Pawn Other)



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class MPBombMutator extends XIIIMPMutator;
00005	
00006	var bool AddStorage;
00007	
00008	function ModifyPlayer(Pawn Other)
00009	{
00010	    local XIIIMPPlayerPawn MPPlayer;
00011	    Local Weapon Inv;
00012	    local Armor A;
00013	    local Ammunition Amm;
00014	
00015	    MPPlayer = XIIIMPPlayerPawn(Other);
00016	    switch(MPPlayer.SubClass)
00017	    {
00018	        Case SC_Sniper:
00019	            Inv = Weapon(GiveSomething(class'FusilSnipe', MPPlayer));
00020	            Inv.AmmoType.AmmoAmount = 30;
00021	            if ( MPPlayer.controller.bIsBot )
00022	              Inv = Weapon(GiveSomething(class'FlashBangBot', MPPlayer));
00023	            else
00024	              Inv = Weapon(GiveSomething(class'FlashBang', MPPlayer));
00025	            Inv.AmmoType.AmmoAmount = 2;
00026	            A = Armor(GiveSomething(class'GiletMK1', MPPlayer));
00027	            A.Charge=50;
00028	            break;
00029	
00030	        case SC_Soldier:
00031	            Inv = Weapon(GiveSomething(class'M16', MPPlayer));
00032	            Inv.AmmoType.AmmoAmount = 150;
00033	            Amm = Ammunition(GiveSomething(class'M16GrenadAmmo', MPPlayer));
00034	            Amm.AmmoAmount = 2;
00035	            if ( MPPlayer.controller.bIsBot )
00036	              Inv = Weapon(GiveSomething(class'FlashBangBot', MPPlayer));
00037	            else
00038	              Inv = Weapon(GiveSomething(class'FlashBang', MPPlayer));
00039	            A = Armor(GiveSomething(class'GiletMK1', MPPlayer));
00040	            A.Charge=50;
00041	            A = Armor(GiveSomething(class'Casque', MPPlayer));
00042	            A.Charge=40;
00043	            break;
00044	
00045	        Case SC_HeavySoldier:
00046	            Inv = Weapon(GiveSomething(class'M60', MPPlayer));
00047	            Inv.AmmoType.AmmoAmount = 200;
00048	            A = Armor(GiveSomething(class'GiletMK1', MPPlayer));
00049	            A.Charge=75;
00050	            if ( MPPlayer.controller.bIsBot )
00051	              Inv = Weapon(GiveSomething(class'FGrenad', MPPlayer));
00052	            else
00053	              Inv = Weapon(GiveSomething(class'FGrenadB', MPPlayer));
00054	            Inv.AmmoType.AmmoAmount = 2;
00055	            break;
00056	
00057	        Case SC_Hunter:
00058	            Inv = Weapon(GiveSomething(class'FusilPompe', MPPlayer));
00059	            Inv.AmmoType.AmmoAmount = 30;
00060	            if ( MPPlayer.controller.bIsBot )
00061	              Inv = Weapon(GiveSomething(class'FGrenad', MPPlayer));
00062	            else
00063	              Inv = Weapon(GiveSomething(class'FGrenadB', MPPlayer));
00064	            Inv.AmmoType.AmmoAmount = 2;
00065	            if ( MPPlayer.controller.bIsBot )
00066	              Inv = Weapon(GiveSomething(class'FlashBangBot', MPPlayer));
00067	            else
00068	              Inv = Weapon(GiveSomething(class'FlashBang', MPPlayer));
00069	            Inv.AmmoType.AmmoAmount = 2;
00070	            A = Armor(GiveSomething(class'GiletMK1', MPPlayer));
00071	            A.Charge = 100;
00072	            A = Armor(GiveSomething(class'Casque', MPPlayer));
00073	            A.Charge = 60;
00074	            break;
00075	
00076	        Case SC_Mercenary:
00077	        default:
00078	            Inv = Weapon(GiveSomething(class'FusilPompe', MPPlayer));
00079	            Inv.AmmoType.AmmoAmount = 30;
00080	            if ( MPPlayer.controller.bIsBot )
00081	              Inv = Weapon(GiveSomething(class'FGrenad', MPPlayer));
00082	            else
00083	              Inv = Weapon(GiveSomething(class'FGrenadB', MPPlayer));
00084	            Inv.AmmoType.AmmoAmount = 2;
00085	            if ( MPPlayer.controller.bIsBot )
00086	              Inv = Weapon(GiveSomething(class'FlashBangBot', MPPlayer));
00087	            else
00088	              Inv = Weapon(GiveSomething(class'FlashBang', MPPlayer));
00089	            Inv.AmmoType.AmmoAmount = 2;
00090	            A = Armor(GiveSomething(class'GiletMK1', MPPlayer));
00091	            A.Charge = 100;
00092	            A = Armor(GiveSomething(class'Casque', MPPlayer));
00093	            A.Charge = 100;
00094	    }
00095	
00096	    if ( NextMutator != None )
00097	      NextMutator.ModifyPlayer(Other);
00098	}
00099	
00100	//_____________________________________________________________________________
00101	function Inventory GiveSomething(class<Inventory> ItemClass, XIIIPawn P)
00102	{
00103	  local Inventory NewItem;
00104	  local XIIIMPSabotageStorage BTS;
00105	
00106	  if( ! AddStorage )
00107	  {
00108	      AddStorage = true;
00109	      BTS = Spawn(class'XIIIMPSabotageStorage',,, P.Location);
00110	      BTS.TeamId=0;
00111	      BTS = Spawn(class'XIIIMPSabotageStorage',,, P.Location);
00112	      BTS.TeamId=1;
00113	  }
00114	
00115	  if( P.FindInventoryType(ItemClass)==None )
00116	  {
00117	    NewItem = Spawn(ItemClass,,,P.Location);
00118	    if( NewItem != None )
00119	      NewItem.GiveTo(P);
00120	  }
00121	  else
00122	  {
00123	    NewItem = P.FindInventoryType(ItemClass);
00124	    if ( Ammunition(NewItem) != none )
00125	      Ammunition(NewItem).AmmoAmount += Class<Ammunition>(ItemClass).default.AmmoAmount;
00126	  }
00127	  return NewItem;
00128	}
00129	
00130	//______________________________________________________________________________
00131	function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
00132	{
00133	    if ( DBMutator ) Log("MUTATOR CheckReplacement for"@Other);
00134	
00135	    if ( (Level.Game != none) && Level.Game.bWaitingToStartMatch )
00136	    { // when game starts
00137	      if ( (PickUp(Other) != none) && (XIIIMPBombPick(Other) == none) )
00138	      {
00139	        Other.Destroy();
00140	      }
00141	    }
00142	    else if (XIIIMPBombPick(Other) != none)
00143	    { // when playing
00144	      Other.Destroy();
00145	    }
00146	
00147	    return true;
00148	}
00149	
00150	//______________________________________________________________________________
00151	
00152	
00153	defaultproperties
00154	{
00155	}

End Source Code