## XIDPawn
Class GenPlongeurs

source: C:\XIII\XIDPawn\Classes\GenPlongeurs.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Keypoint
             |
             +--XIDPawn.GenFRD
                |
                +--XIDPawn.GenPlongeurs

Direct Known Subclasses:None

class GenPlongeurs
extends XIDPawn.GenFRD

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

Variables
`GenPlongeurs` | `GenEnnemi` attend que tous les persos generes soient morts
`int` | `NbNMIActifs`
`int` | `NbNMIGen`
`int` | `NbNMIGenere` attend que tous les persos generes soient morts
`int` | `NbNMIMax`
`int` | `NbNMIPresents` attend que tous les persos generes soient morts
`int` | `PV_NMI`
`vector` | `PointSpawn`
`Plongeur_USA01` | `SpawnActor` attend que tous les persos generes soient morts
`vector` | `SpawnLocation` attend que tous les persos generes soient morts
`float` | `TimeBetweenGen`
`XIIIPlayerPawn` | `XIII` attend que tous les persos generes soient morts
`bool` | `bGenerationCamouflee` ne genere que si perso peut pas voir le GENNMI
`bool` | `bWaitAllDeadToDestroy` attend que tous les persos generes soient morts
`XIIIGameInfo` | `gameinf` attend que tous les persos generes soient morts

States
AttendMortNMIs, PauseGenese

Function Summary
`void` | `AssignePV()`
    //------------------------------------------------
    // GENESE
    //------------------------------------------------
`void` | `Trigger(Actor Other, Pawn EventInstigator)`
    //------------------------------------------------
    // TRIGGER: Fonction Trigger declenchee par detectionvolume
    //------------------------------------------------
`void` | `UnNMIenMoins()`

State AttendMortNMIs Function Summary
`void` | `UnNMIenMoins()`

State PauseGenese Function Summary

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class GenPlongeurs extends GenFRD;
    00005
    00006	struct InventoryItem  {
    00007		var() class<Inventory> Inventory;
    00008		var() int              Count;
    00009	};
    00010
    00011
    00012	//-----------------------------
    00013	var() int NbNMIMax;
    00014	var() float TimeBetweenGen;
    00015	var() int NbNMIGen;
    00016	var() int NbNMIActifs;
    00017	var() int PV_NMI;
    00018	var() vector PointSpawn;
    00019	var() bool bGenerationCamouflee; //ne genere que si perso peut pas voir le GENNMI
    00020	var() bool bWaitAllDeadToDestroy; // attend que tous les persos generes soient morts
    00021	//pour se detruire et declencher un event
    00022
    00023	//-----------------------------
    00024
    00025	var(AI) float PeripheralVision;
    00026	var(AI) float SightRadius;
    00027	var(AI) float HearingThreshold;
    00028	var(AI) bool     bLOSHearing;
    00029	var(AI) bool     bSameZoneHearing;
    00030	var(AI) bool     bAdjacentZoneHearing;
    00031	var(AI) bool     bMuffledHearing;
    00032	var(AI) bool     bAroundCornerHearing;
    00033
    00034	//-----------------------------
    00035	var(BaseSoldier) int skill;
    00036	var(BaseSoldier) float Temps_Acquisition;
    00037	var(BaseSoldier) name Bases_Event;
    00038	var(BaseSoldier) name Bases_Tag;
    00039	var(Inventory) InventoryItem InitialInventory[8];
    00040	var(BaseSoldier) int NumReseauPropre;
    00041	var(Alliances) name Alliance;
    00042	var(basesoldier) float DistanceAttaque;
    00043
    00044	// GenNMI
    00045	var GenPlongeurs GenEnnemi;
    00046
    00047
    00048	//*------------------------------*
    00049	var vector SpawnLocation;
    00050	var Plongeur_Usa01 SpawnActor;
    00051	var int NbNMIGenere;
    00052	var xiiiplayerpawn XIII;
    00053	var Xiiigameinfo gameinf;
    00054	var int NbNMIPresents;
    00055
    00056	//_____________________________________________________________________________
    00057	event ParseDynamicLoading(LevelInfo MyLI)
    00058	{
    00059	    local int i;
    00060
    00061	    Log("ParseDynamicLoading Actor="$self);
    00062	    for (i=0; i<8; i++)
    00063	    {
    00064			if (InitialInventory[i].Inventory != none )
    00065			{
    00066				MyLI.ForcedClasses[MyLI.ForcedClasses.Length] = InitialInventory[i].Inventory;
    00067				(InitialInventory[i].Inventory).Static.StaticParseDynamicLoading(MyLI);
    00068			}
    00069	    }
    00070	}
    00071
    00072	//------------------------------------------------
    00073	// TRIGGER: Fonction Trigger declenchee par detectionvolume
    00074	//------------------------------------------------
    00075	function Trigger( actor Other, pawn EventInstigator )
    00076	{
    00077		//NbNMIPresents=0;
    00078		if (NbNMIGenere==0)
    00079		{
    00080			NbNMIGenere=0;
    00081			gotostate('genese');
    00082		}
    00083		else
    00084		{
    00085			NbNMIGenere=0;
    00086			gotostate('genese','suitegeneration');
    00087		}
    00088
    00089	}
    00090
    00091	function UnNMIenMoins()
    00092	{
    00093	}
    00094
    00095
    00096	//------------------------------------------------
    00097	// GENESE
    00098	//------------------------------------------------
    00099	state() genese
    00100	{
    00101		function AssignePV()
    00102		{
    00103	        SpawnActor.Health = PV_NMI;
    00104		}
    00105		event Timer()
    00106		{
    00107	        local int i,j;
    00108	        local bool result;
    00109
    00110			if ((NbNMIGenere<NbNMIMax) || (NbNMIMAX==-1))
    00111			{
    00112	            for (i=0;i<NbNMIGen;i++)
    00113	            {
    00114					if (NbNMIPresents<NbNMIActifs)
    00115					{
    00116	                    if (PointSpawn!=vect(0,0,0))
    00117							SpawnLocation=PointSpawn;
    00118						else
    00119							SpawnLocation=self.location + vect(0,0,1)*78+ i*90*((-1)**i)*vect(1,1,0);
    00120						result=false;
    00121						if (!bGenerationCamouflee || (!FastTrace(SpawnLocation,XIII.location+ XIII.eyeposition()) || ((XIII.location-SpawnLocation) dot vector(XIII.rotation))>0))
    00122						{
    00123
    00124							SpawnActor=spawn(class'Plongeur_Usa01',self,,SpawnLocation);
    00125							if (SpawnActor == none)
    00126							{
    00127								SpawnLocation=self.location+vect(0,0,1)*78-i*90*((-1)**i)*vect(1,1,0);
    00128								SpawnActor=spawn(class'Plongeur_Usa01',self,,SpawnLocation);
    00129								if (SpawnActor == none)
    00130								{
    00131									result=false;
    00132									//log(self$"ca merde je peux pas spawner, j'ai pas la place");
    00133								}
    00134								else
    00135									result=true;
    00136							}
    00137							else
    00138							{
    00139								result=true;
    00140							}
    00141						}
    00142
    00143						if (result)
    00144						{
    00145							//        gameinf.BaseSoldierList.Length=gameinf.BaseSoldierList.Length+1;   //pas mis dans basesoldierlist
    00146							//     gameinf.BaseSoldierList[gameinf.BaseSoldierList.Length-1]=SpawnActor;
    00147							NbNMIGenere++;
    00148							NbNMIPresents++;
    00149							//SpawnActor.PreBeginPlay();
    00150							//SpawnActor.PostBeginPlay();
    00151							if ((SpawnActor.ControllerClass != None) && SpawnActor.Controller == None)
    00152								SpawnActor.Controller = spawn(SpawnActor.ControllerClass);
    00153							if (SpawnActor.Controller != None )
    00154								SpawnActor.Controller.Possess(SpawnActor);
    00155							gameinf.MapInfo.GeneratedPawn(self,spawnactor);
    00156							SpawnActor.GenEnnemi=self;
    00157							// initialisation des variables
    00158							//ai
    00159							instigator=spawnactor;
    00160							SpawnActor.bLOSHearing=bLOSHearing;
    00161							SpawnActor.bSameZoneHearing=bSameZoneHearing;
    00162							SpawnActor.bAdjacentZoneHearing=bAdjacentZoneHearing;
    00163							SpawnActor.bMuffledHearing=bMuffledHearing;
    00164							SpawnActor.bAroundCornerHearing=bAroundCornerHearing;
    00165							SpawnActor.SightRadius=sightradius;
    00166							SpawnActor.HearingThreshold=hearingthreshold;
    00167							SpawnActor.PeripheralVision=PeripheralVision;
    00168							//basesoldier
    00169							for (j=0;j<8;j++)
    00170							{
    00171								SpawnActor.InitialInventory[j].Inventory=InitialInventory[j].Inventory;
    00172								SpawnActor.InitialInventory[j].count=InitialInventory[j].count;
    00173							}
    00174							SpawnActor.Temps_Acquisition=Temps_Acquisition;
    00175							SpawnActor.skill=skill;
    00176							SpawnActor.SetCollisionSize(CollisionRadius, CollisionHeight);
    00177							SpawnActor.DistanceAttaque=DistanceAttaque;
    00178							SpawnActor.NumReseauPropre=NumReseauPropre;
    00179							SpawnActor.event=Bases_event;
    00180							SpawnActor.tag=Bases_Tag;
    00181							SpawnActor.Alliance=Alliance;
    00182							SpawnActor.bBasesGenere=true;
    00183							//assigne PVs
    00184							AssignePV();
    00185							SpawnActor.controller.focalpoint=SpawnActor.location+vector(self.rotation);
    00186							if (Mesh!=none)
    00187							{
    00188								SpawnActor.mesh=mesh;
    00189								//BaseSoldier(SpawnActor).setCollisionSize(collisionradius,collisionheight);
    00190							}
    00191							if (Skins.length>0)
    00192							{
    00193								SpawnActor.Skins[0]=Skins[0];
    00194								//BaseSoldier(SpawnActor).setCollisionSize(collisionradius,collisionheight);
    00195							}
    00196						}
    00197					}
    00198					else
    00199					{
    00200						settimer(0,false);
    00201						gotostate('PauseGenese');
    00202						break;
    00203					}
    00204				}
    00205			}
    00206			else
    00207			{
    00208				gotostate('AttendMortNMIs');
    00209			}
    00210	     }
    00211
    00212	begin:
    00213	     //log(self$"GENERE BASESOLDIER");
    00214		 sleep(0.04);
    00215		 gameinf=xiiigameinfo(level.game);
    00216		 XIII=XIIIPlayerpawn(gameinf.mapinfo.XIIIpawn);
    00217		 if (XIII==none)
    00218		 {
    00219			 log("********************* ATTENTION LA VARIABLE XIII N'A PAS ETE INITIALISEE");
    00220			 goto('begin');
    00221		 }
    00222	suitegeneration:
    00223	     timer();
    00224	     sleep(0.04);
    00225		 settimer(TimeBetweenGen,true);
    00226	}
    00227
    00228	State PauseGenese
    00229	{
    00230	}
    00231
    00232	state AttendMortNMIs
    00233	{
    00234		function UnNMIenMoins()
    00235		{
    00236			if (!bWaitAllDeadToDestroy)
    00237			{
    00238				TriggerEvent(Event, Self, none);
    00239
destroy(); 00240 } 00241 else if (NbNMIPresents<=0) 00242 { 00243 TriggerEvent(Event, Self, none); 00244 destroy(); 00245 } 00246 } 00247 begin: 00248 UnNMIenMoins(); 00249 } 00250 00251 00252 00253 defaultproperties 00254 { 00255 NbNMIMax=10 00256 TimeBetweenGen=4.000000 00257 NbNMIGen=1 00258 NbNMIActifs=2 00259 PV_NMI=100 00260 PeripheralVision=120.000000 00261 SightRadius=2000.000000 00262 HearingThreshold=1500.000000 00263 Skill=1 00264 Temps_Acquisition=0.500000 00265 InitialInventory(0)=(Inventory=Class'XIII.LHarpon',Count=12) 00266 DistanceAttaque=600.000000 00267 CollisionRadius=44.000000 00268 CollisionHeight=30.000000 00269 bDirectional=True 00270 }

End Source Code