Botpack
Class CTFMessage

source: e:\games\UnrealTournament\Botpack\Classes\CTFMessage.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Engine.LocalMessage
            |
            +--Botpack.LocalMessagePlus
               |
               +--Botpack.CriticalEventPlus
                  |
                  +--Botpack.CTFMessage
Direct Known Subclasses:None

class CTFMessage
extends Botpack.CriticalEventPlus

// // CTF Messages // // Switch 0: Capture Message // RelatedPRI_1 is the scorer. // OptionalObject is the flag. // // Switch 1: Return Message // RelatedPRI_1 is the scorer. // OptionalObject is the flag. // // Switch 2: Dropped Message // RelatedPRI_1 is the holder. // OptionalObject is the flag's team teaminfo. // // Switch 3: Was Returned Message // OptionalObject is the flag's team teaminfo. // // Switch 4: Has the flag. // RelatedPRI_1 is the holder. // OptionalObject is the flag's team teaminfo. // // Switch 5: Auto Send Home. // OptionalObject is the flag's team teaminfo. // // Switch 6: Pickup stray. // RelatedPRI_1 is the holder. // OptionalObject is the flag's team teaminfo.
Variables
 CaptureBlue, CaptureRed
 DroppedBlue, DroppedRed
 string HasBlue,HasRed
 ReturnBlue, ReturnRed
 ReturnedBlue, ReturnedRed


Function Summary
 string GetString(optional int, optional PlayerReplicationInfo, optional PlayerReplicationInfo, optional Object)



Source Code


00001	//
00002	// CTF Messages
00003	//
00004	// Switch 0: Capture Message
00005	//	RelatedPRI_1 is the scorer.
00006	//	OptionalObject is the flag.
00007	//
00008	// Switch 1: Return Message
00009	//	RelatedPRI_1 is the scorer.
00010	//	OptionalObject is the flag.
00011	//
00012	// Switch 2: Dropped Message
00013	//	RelatedPRI_1 is the holder.
00014	//	OptionalObject is the flag's team teaminfo.
00015	//	
00016	// Switch 3: Was Returned Message
00017	//	OptionalObject is the flag's team teaminfo.
00018	//
00019	// Switch 4: Has the flag.
00020	//	RelatedPRI_1 is the holder.
00021	//	OptionalObject is the flag's team teaminfo.
00022	//
00023	// Switch 5: Auto Send Home.
00024	//	OptionalObject is the flag's team teaminfo.
00025	//
00026	// Switch 6: Pickup stray.
00027	//	RelatedPRI_1 is the holder.
00028	//	OptionalObject is the flag's team teaminfo.
00029	
00030	class CTFMessage extends CriticalEventPlus;
00031	
00032	var localized string ReturnBlue, ReturnRed;
00033	var localized string ReturnedBlue, ReturnedRed;
00034	var localized string CaptureBlue, CaptureRed;
00035	var localized string DroppedBlue, DroppedRed;
00036	var localized string HasBlue,HasRed;
00037	
00038	static function string GetString(
00039		optional int Switch,
00040		optional PlayerReplicationInfo RelatedPRI_1, 
00041		optional PlayerReplicationInfo RelatedPRI_2,
00042		optional Object OptionalObject
00043		)
00044	{
00045		switch (Switch)
00046		{
00047			// Captured the flag.
00048			case 0:
00049				if (RelatedPRI_1 == None)
00050					return "";
00051				if ( CTFFlag(OptionalObject) == None )
00052					return "";
00053	
00054				if ( CTFFlag(OptionalObject).Team == 0 )
00055					return RelatedPRI_1.PlayerName@Default.CaptureRed;
00056				else
00057					return RelatedPRI_1.PlayerName@Default.CaptureBlue;
00058				break;
00059	
00060			// Returned the flag.
00061			case 1:
00062				if ( CTFFlag(OptionalObject) == None )
00063					return "";
00064				if (RelatedPRI_1 == None)
00065				{
00066					if ( CTFFlag(OptionalObject).Team == 0 )
00067						return Default.ReturnedRed;
00068					else
00069						return Default.ReturnedBlue;
00070				}
00071				if ( CTFFlag(OptionalObject).Team == 0 )
00072					return RelatedPRI_1.PlayerName@Default.ReturnRed;
00073				else
00074					return RelatedPRI_1.PlayerName@Default.ReturnBlue;
00075				break;
00076	
00077			// Dropped the flag.
00078			case 2:
00079				if (RelatedPRI_1 == None)
00080					return "";
00081				if ( TeamInfo(OptionalObject) == None )
00082					return "";
00083	
00084				if ( TeamInfo(OptionalObject).TeamIndex == 0 )
00085					return RelatedPRI_1.PlayerName@Default.DroppedRed;
00086				else
00087					return RelatedPRI_1.PlayerName@Default.DroppedBlue;
00088				break;
00089	
00090			// Was returned.
00091			case 3:
00092				if ( TeamInfo(OptionalObject) == None )
00093					return "";
00094	
00095				if ( TeamInfo(OptionalObject).TeamIndex == 0 )
00096					return Default.ReturnedRed;
00097				else
00098					return Default.ReturnedBlue;
00099				break;
00100	
00101			// Has the flag.
00102			case 4:
00103				if (RelatedPRI_1 == None)
00104					return "";
00105				if ( TeamInfo(OptionalObject) == None )
00106					return "";
00107	
00108				if ( TeamInfo(OptionalObject).TeamIndex == 0 )
00109					return RelatedPRI_1.PlayerName@Default.HasRed;
00110				else
00111					return RelatedPRI_1.PlayerName@Default.HasBlue;
00112				break;
00113	
00114			// Auto send home.
00115			case 5:
00116				if ( TeamInfo(OptionalObject) == None )
00117					return "";
00118	
00119				if ( TeamInfo(OptionalObject).TeamIndex == 0 )
00120					return Default.ReturnedRed;
00121				else
00122					return Default.ReturnedBlue;
00123				break;
00124	
00125			// Pickup
00126			case 6:
00127				if (RelatedPRI_1 == None)
00128					return "";
00129				if ( TeamInfo(OptionalObject) == None )
00130					return "";
00131	
00132				if ( TeamInfo(OptionalObject).TeamIndex == 0 )
00133					return RelatedPRI_1.PlayerName@Default.HasRed;
00134				else
00135					return RelatedPRI_1.PlayerName@Default.HasBlue;
00136				break;
00137		}
00138		return "";
00139	}
00140	
00141	defaultproperties
00142	{
00143	     ReturnBlue="returns the blue flag!"
00144	     ReturnRed="returns the red flag!"
00145	     ReturnedBlue="The blue flag was returned!"
00146	     ReturnedRed="The red flag was returned!"
00147	     CaptureBlue="captured the blue flag!  The red team scores!"
00148	     CaptureRed="captured the red flag!  The blue team scores!"
00149	     DroppedBlue="dropped the blue flag!"
00150	     DroppedRed="dropped the red flag!"
00151	     HasBlue="has the blue flag!"
00152	     HasRed="has the red flag!"
00153	}

End Source Code