XIDMaps
Class DialogueManagerFight

source: C:\XIII\XIDMaps\Classes\DialogueManagerFight.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--XIDCine.DialogueManager
            |
            +--XIDMaps.DialogueManagerFight
Direct Known Subclasses:None

class DialogueManagerFight
extends XIDCine.DialogueManager

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 int MaxAlive
 int MinimumAlive


Function Summary
 int HowManyLeft()
     
/*
 bool MustBeStop( )
     
//break;
        }
    }

    return MaxAlive;
}
*/



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class DialogueManagerFight extends DialogueManager;
00005	
00006	var() int MinimumAlive;
00007	var int MaxAlive;
00008	//##############################################################################
00009	
00010	//event PostBeginPlay()
00011	/*
00012	function int HowManyLeft()
00013	{
00014	    local int i,j;
00015	    local pawn p,q;
00016	    local array<pawn> AlivePawn;
00017	
00018	   // MaxAlive=0;
00019	
00020	    for ( i = 0; i < Speakers.Length; ++i )
00021	    {
00022	        p = Pawn(Speakers[i].Pawn);
00023	        //if (p!=none)
00024	        if (( p==none ) ||  ( p.bDeleteMe ) ||  p.bIsDead)
00025	        {
00026	            for ( j = 0; j < Speakers.Length; ++j )
00027	            {
00028	                q = AlivePawn[j];
00029	                if(p!=q)
00030	                {
00031	                    //if (q!=none)
00032	                    //{
00033	                        MaxAlive++;
00034	                    //}
00035	                    AlivePawn[i]=p;
00036	                    //break;
00037	                }
00038	            }
00039	        }
00040	        else
00041	        {
00042	          MaxAlive--;
00043	          AlivePawn[i]=none;
00044	          //break;
00045	        }
00046	    }
00047	
00048	    return MaxAlive;
00049	}
00050	*/
00051	
00052	function bool MustBeStop( )
00053	{
00054	    LOCAL int i, j;
00055	    local Pawn p,q;
00056	    local bool bFoundNext;
00057	    local int iCurrentAlive;
00058	
00059	    for ( i = 0; i < Speakers.Length; ++i )
00060	    {
00061	        if  ( bool( bGivenSpeaker[ i ] ) )
00062	        {
00063	            p = Pawn(Speakers[i].Pawn);
00064	           /* if  (
00065	                    ( p==none ) ||  ( p.bDeleteMe ) ||  p.bIsDead   // Pawn only conditions
00066	                ||
00067	                    ( p.Controller==none )
00068	                ||
00069	                    ( p.Controller.IsA( 'IAController' ) && ( p.controller.Enemy!=none ) )
00070	                )
00071	            {
00072	//              DebugLog("MUST BE STOPPED !!!");
00073	                return true;
00074	            } */
00075	            if  (( p==none ) ||  ( p.bDeleteMe ) ||  p.bIsDead)
00076	            {
00077	
00078	                //iCurrentAlive=0;
00079	                //current pawn is dead hence should try another one
00080	                for ( j = 0; j < Speakers.Length; ++j)
00081	                {
00082	                    q = Pawn(Speakers[j].Pawn);
00083	                    if (( q!=none ) &&  ( !q.bDeleteMe ) &&  !q.bIsDead)
00084	                    {
00085	                        if (!bFoundNext)
00086	                        {
00087	                          Speakers[i].pawn=q;
00088	                          p=q;
00089	                         // break;
00090	                          bFoundNext=true;
00091	                        }
00092	                        iCurrentAlive++;
00093	                        //log("current alive"@iCurrentAlive);
00094	                        //log("desired alive"@MinimumAlive);
00095	                       if (j==Speakers.Length-1)
00096	                       {
00097	                            //iCurrentAlive = HowManyLeft();
00098	                            //log("current alive"@iCurrentAlive);
00099	                            //if ((HowManyLeft()>=MinimumAlive) && bFoundNext)
00100	                           if ((iCurrentAlive>=MinimumAlive) && bFoundNext)
00101	                           {
00102	                              break;
00103	                            }
00104	                            else
00105	                            {
00106	                                //if (j==Speakers.Length-1)
00107	                                //{
00108	                                    return true;
00109	                                //}
00110	                            }
00111	
00112	                       //break;
00113	                       }
00114	                   }
00115	                   // else
00116	                   // {
00117	                   //     return true;
00118	                   // }
00119	                    }
00120	                //return true;
00121	            }
00122	        }
00123	    }
00124	    return false;
00125	    super.mustbestop();
00126	}
00127	
00128	
00129	
00130	
00131	defaultproperties
00132	{
00133	}

End Source Code