## XIDPawn
Class Plongeur_USA01

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

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Pawn
             |
             +--XIII.XIIIPawn
                |
                +--XIDPawn.Plongeur_USA01

Direct Known Subclasses:None

class Plongeur_USA01
extends XIII.XIIIPawn

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

Variables
`int` | `Count`
`float` | `DistanceAttaque`
`GenPlongeurs` | `GenEnnemi`
`class` | `Inventory`
`int` | `NumReseauPropre`
`float` | `Temps_Acquisition`
`bool` | `bBasesGenere`
`bool` | `bWaitToTouchWaterVolume`

Function Summary
`void` | `InitializeInventory()`
    //---------------------------------------------------------------------------------
    //Inventaire par defaut appele par initialize pawn dans le controller
    //----------------------------------------------------------------------------------
`simulated` | `PlayFiring(float Rate, name FiringMode)`
    //_____________________________________________________________________________
`simulated` | `PlayMoving()`
    //_____________________________________________________________________________
`simulated` | `PlayReLoading(float Rate, name FiringMode)`
    //_____________________________________________________________________________
`simulated` | `PlaySpearGunFiring()`
`simulated` | `PlayWaiting()`
`void` | `PostBeginPlay()`
`void` | `TakeDrowningDamage()`
    //FRD ne prend pas de dommage pour noyade

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class Plongeur_USA01 extends XIIIPawn;
    00005
    00006	struct InventoryItem  {
    00007	     var() class<Inventory> Inventory;
    00008	     var() int              Count;
    00009	};
    00010
    00011	var() float Temps_Acquisition;
    00012	var() float DistanceAttaque;
    00013	//var() float SwimmingSpeed;
    00014	var() int NumReseauPropre;
    00015	var(inventory) InventoryItem InitialInventory[8];  // inventaire par defaut du pawn
    00016	var GenPlongeurs GenEnnemi;
    00017	var bool bBasesGenere;
    00018	var bool bWaitToTouchWaterVolume;
    00019
    00020	//_____________________________________________________________________________
    00021	event ParseDynamicLoading(LevelInfo MyLI)
    00022	{
    00023	    local int i;
    00024
    00025	    Log("ParseDynamicLoading Actor="$self);
    00026	    for (i=0; i<8; i++)
    00027	    {
    00028	      if ( InitialInventory[i].Inventory != none )
    00029	      {
    00030	        MyLI.ForcedClasses[MyLI.ForcedClasses.Length] = InitialInventory[i].Inventory;
    00031	        (InitialInventory[i].Inventory).Static.StaticParseDynamicLoading(MyLI);
    00032	      }
    00033	    }
    00034	}
    00035
    00036	FUNCTION PostBeginPlay()
    00037	{
    00038		Super.PostBeginPlay();
    00039
    00040	   LinkSkelAnim(MeshAnimation'XIIIPersos.PlongeurspeA');
    00041		LinkSkelAnim(MeshAnimation'XIIIPersosG.MigA');
    00042	}
    00043
    00044
    00045	event HeadVolumeChange( PhysicsVolume NewHeadVolume )
    00046	{
    00047		// log("event change volume"@bWaitToTouchWaterVolume@NewHeadVolume.bWaterVolume);
    00048
    00049	    if (NewHeadVolume.bWaterVolume)
    00050		 {
    00051			setphysics(phys_swimming);
    00052			if (bWaitToTouchWaterVolume)
    00053			{
    00054				bWaitToTouchWaterVolume=false;
    00055				PlayMoving();
    00056	   	}
    00057		 }
    00058	}
    00059
    00060	simulated event AnimEnd(int Channel)
    00061	{
    00062		playwaiting();
    00063	}
    00064	//_____________________________________________________________________________
    00065	simulated function PlayMoving()
    00066	{
    00067		if (physics==PHYS_SWIMMING)
    00068		{
    00069	    //Log("--@ PlayMoving call for "$self@"in physics"@Physics);
    00070			loopanim('plongnage',,0.3);
    00071		}
    00072	}
    00073
    00074	//_____________________________________________________________________________
    00075	simulated function PlayReLoading(float Rate, name FiringMode)
    00076	{
    00077	/*log("--@ PlayReLoading call for "$self@"w/FiringMode="$FiringMode);
    00078	    if ( bIsDead )
    00079	      return;
    00080		playanim('plongnage',,0.4);
    00081	  */
    00082	}
    00083
    00084	simulated function PlayWaiting()
    00085	{
    00086		if (physics==PHYS_SWIMMING)
    00087		{
    00088	 		//Log("--@ PlayWaitingcall for "$self@"in physics"@Physics);
    00089			loopanim('plongnage',,0.3);
    00090		}
    00091	}
    00092
    00093	//_____________________________________________________________________________
    00094	simulated function PlayFiring(float Rate, name FiringMode)
    00095	{
    00096	}
    00097
    00098	simulated function PlaySpearGunFiring()
    00099	{
    00100	   //log("--@ PlayFiringcall 2222222222222222222222222 for "$self@"in physics"@Physics);
    00101	  	playanim('plongtir',,0.2);
    00102	}
    00103
    00104
    00105
    00106	//---------------------------------------------------------------------------------
    00107	//Inventaire par defaut appele par initialize pawn dans le controller
    00108	//----------------------------------------------------------------------------------
    00109	function InitializeInventory()
    00110	{
    00111	    local int       i, j;
    00112	    local Inventory inv;
    00113	    local ammunition AmmoTmp;
    00114
    00115	    //initialise poings
    00116	    inv = spawn(class'Fists', self);
    00117	    if (inv != None)
    00118	    {
    00119	      inv.gotostate('');
    00120	      inv.GiveTo(Self);
    00121	    }
    00122
    00123	    // Add initial inventory items
    00124	    for (i=0; i<8; i++)
    00125	    {
    00126	      if ( InitialInventory[i].Inventory != None )
    00127	      {
    00128	        inv = spawn(InitialInventory[i].Inventory);
    00129	        if ( Weapon(inv) != none )
    00130	        {
    00131	          Inv.GiveTo(self);
    00132	          // Add clips
    00133	          AmmoTmp = Weapon(Inv).AmmoType;
    00134	          if ( AmmoTmp.PickupClass != none )
    00135	            AmmoTmp.AmmoAmount += InitialInventory[i].count * class<Ammo>(AmmoTmp.PickupClass).Default.AmmoAmount;
    00136	        }
    00137	        else if ( Ammunition(Inv) != none )
    00138	        {
    00139	          AmmoTmp = ammunition(FindInventoryType(Inv.Class));
    00140	          if ( AmmoTmp == none )
    00141	          {
    00142	            Inv.GiveTo(self);
    00143	            if ( Inv.PickupClass != none )
    00144	              Ammunition(Inv).AmmoAmount += InitialInventory[i].count * class<Ammo>(Inv.PickupClass).Default.AmmoAmount;
    00145	          }
    00146	          else
    00147	          {
    00148	            if ( Inv.PickupClass != none )
    00149	              AmmoTmp.ammoAmount += InitialInventory[i].count * class<Ammo>(Inv.PickupClass).Default.AmmoAmount;
    00150	            Inv.Destroy();
    00151	          }
    00152	        }
    00153	        else if ( Casque(Inv) != none )
    00154	        {
    00155	          Inv.GiveTo(self);
    00156	          Inv.Charge = 40;
    00157	          // No special treatment
    00158	        }
    00159	        else
    00160	        {
    00161	          Inv.GiveTo(self);
    00162	          // No special treatment
    00163	        }
    00164	      }
    00165	    }
    00166	}
    00167
    00168	simulated event Destroyed()
    00169	{
    00170	     if (bBasesGenere)
    00171	     {
    00172	          if (GenEnnemi!=none)
    00173	          {
    00174	               GenEnnemi.NbNMIPresents--;
    00175	               if (GenEnnemi.isinstate('AttendMortNMIs'))
    00176	                  GenEnnemi.UnNMIenMoins();
    00177	               else if (GenEnnemi.isinstate('PauseGenese'))
    00178	                  GenEnnemi.gotostate('genese','suitegeneration');
    00179	          }
    00180	          else
    00181	               bBasesGenere=false;
    00182	     }
    00183	  	 Super.Destroyed();
    00184	}
    00185
    00186	//FRD ne prend pas de dommage pour noyade
    00187	function TakeDrowningDamage()
    00188	{
    00189	}
    00190
    00191	function Died(Controller Killer, class<DamageType> damageType, vector HitLocCode)
    00192	{
    00193	    local Controller Other;
    00194	    local int i;
    00195	    local inventory Kapio;
    00196
    00197	    PawnKiller = Killer.Pawn;
    00198
    00199	    HitDamageType = DamageType;
    00200
    00201	    if ( bDeleteMe )
    00202	      return;   // Already destroyed
    00203
    00204	    if ( Level.Game.PreventDeath(self, Killer, damageType, HitLocCode) )
    00205	    {
    00206	      Health = max(Health, 1); // mutator should set this higher
    00207	      return;
    00208	    }
    00209
    00210	    // ELR
    00211	    ShouldCrouch(false);
    00212
    00213	    Health = Min(0, Health);
    00214
    00215	    Level.Game.Killed(Killer, Controller, self, damageType);
    00216
    00217	    // ELR Characters that are stunned MUST NOT Cause their event
    00218	    if ( bCauseEventOnStun || ((DamageType != class'DTStunned') && (DamageType != class'DTSureStunned') && (DamageType != class'DTDropAfterStun')) )
    00219	    {
    00220	      if ( Killer != None )
    00221	        TriggerEvent(Event, self, Killer.Pawn);
    00222	      else
    00223	        TriggerEvent(Event, self, None);
    00224	    }
    00225
    00226	    Velocity.Z *= 1.3;
    00227
    00228	    TakeHitLocation = HitLocCode;
    00229
    00230	    PlayDying(DamageType, HitLocCode);    // HitLocCode instead of HitLocation
    00231
    00232	    bIsDead = true;
    00233	    SetBoneDirection( FIRINGBLENDBONE, rot(0,0,0), vect(0,0,0), 0.0 );
    00234
    00235	    if ( Level.Game.bGameEnded )
    00236	      return;
    00237	}
    00238
    00239	simulated function PlayDyingAnim(class<DamageType> DamageType, vector HitLoc)
    00240	{
    00241	    if ( bDBAnim ) Log("### PlayDyingAnim call for "$self@" HitLoc="$HitLoc);
    00242
    00243	    PlayAnim('plongmort',,0.5); //mettre death nage
    00244	    mass=70;
    00245
Buoyancy=105.00000; 00246 acceleration*=vect(0,0,1); 00247 } 00248 00249 00250 00251 defaultproperties 00252 { 00253 Temps_Acquisition=0.500000 00254 DistanceAttaque=600.000000 00255 InitialInventory(0)=(Inventory=Class'XIII.LHarpon',Count=12) 00256 bCanJump=False 00257 HearingThreshold=1500.000000 00258 SightRadius=2000.000000 00259 PeripheralVision=120.000000 00260 WaterSpeed=150.000000 00261 ControllerClass=Class'XIDPawn.Plongeur_Usa01_Controller' 00262 CarcassCollisionHeight=30.000000 00263 Skill=1 00264 Mesh=SkeletalMesh'XIIIPersos.PlongeurM' 00265 CollisionRadius=44.000000 00266 CollisionHeight=30.000000 00267 }

End Source Code