XIDPawn
Class Prock03_Fioles

source: C:\XIII\XIDPawn\Classes\Prock03_Fioles.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Projectile
         |
         +--XIII.XIIIProjectile
            |
            +--XIII.TKnifeFlying
               |
               +--XIDPawn.Prock03_Fioles
Direct Known Subclasses:None

class Prock03_Fioles
extends XIII.TKnifeFlying

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 int NbDegats
 vector PointDExplosion


Function Summary
 
simulated
BlowUp(vector HitLocation)
     
//_____________________________________________________________________________
 
simulated
Explode(vector HitLocation, vector HitNormal)
 
simulated
PostBeginPlay()
     
//_____________________________________________________________________________
// Set up speed



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class Prock03_Fioles extends TKnifeFlying;
00005	
00006	var int NbDegats;
00007	var vector PointDExplosion;
00008	
00009	//_____________________________________________________________________________
00010	// Set up speed
00011	simulated function PostBeginPlay()
00012	{
00013	    Super.PostBeginPlay();
00014	    Velocity = Vector(Rotation) * Speed;
00015	    Velocity.z += 100;
00016	    RotationRate.Pitch = -80000;
00017		 SetPhysics(PHYS_Falling);
00018	}
00019	
00020	
00021	simulated function Explode(vector HitLocation, vector HitNormal)
00022	{
00023	    BlowUp(HitLocation);
00024	    Spawn(class'Prock03FioleExploEmitter');
00025	    SetPhysics(PHYS_None);
00026	    Velocity = vect(0,0,0);
00027	    bHidden = true;
00028		 SetDrawtype(DT_none);
00029		 settimer(0.7,true);
00030	    //destroy();
00031	}
00032	
00033	//_____________________________________________________________________________
00034	simulated function BlowUp(vector HitLocation)
00035	{
00036	    if ( bHaveBlownUp )
00037	      return;
00038	
00039	    bHaveBlownUp=true;
00040	    PointDExplosion=HitLocation;
00041	    HurtRadius1(Damage,DamageRadius, MyDamageType, MomentumTransfer, HitLocation );
00042	    PlaySound(hExploSound);
00043	}
00044	
00045	event timer()
00046	{
00047		if (NbDegats<10)
00048		{
00049			HurtRadius1(10,DamageRadius, MyDamageType, MomentumTransfer, PointDExplosion );
00050			NbDegats++;
00051		}
00052		else
00053		{
00054			destroy();
00055		}
00056	}
00057	
00058	/* HurtRadius()
00059	 Hurt locally authoritative actors within the radius.
00060	*/
00061	simulated final function HurtRadius1( float DamageAmount, float DamageRadius, class<DamageType> DamageType, float Momentum, vector HitLocation )
00062	{
00063	     local actor Victims;
00064	     local float damageScale, dist;
00065	     local vector dir;
00066	
00067	     if( bHurtEntry )
00068	          return;
00069	
00070	     bHurtEntry = true;
00071	     foreach VisibleDamageableActors( class 'Actor', Victims, DamageRadius, HitLocation )
00072	     {
00073	          if(Victims != self)
00074	          {
00075	               //FRD
00076	               /*if (xiiiplayerpawn(victims)!=none)
00077	               {
00078	                   JOhansson(instigator).GenEffects.XIIIBurned();
00079	               }
00080	               else */if (victims.isa('johansson'))
00081	                  continue;
00082	               //
00083	               dir = Victims.Location - HitLocation;
00084	               dist = FMax(1,VSize(dir));
00085	               dir = dir/dist;
00086	               damageScale = 1 - FMax(0,(dist - Victims.CollisionRadius)/DamageRadius);
00087	               Victims.TakeDamage
00088	               (
00089	                    damageScale * DamageAmount,
00090	                    Instigator,
00091	                    Victims.Location - 0.5 * (Victims.CollisionHeight + Victims.CollisionRadius) * dir,
00092	                    (damageScale * Momentum * dir),
00093	                    DamageType
00094	               );
00095	          }
00096	     }
00097	     bHurtEntry = false;
00098	}
00099	
00100	
00101	
00102	defaultproperties
00103	{
00104	     MyTrailClass=Class'XIII.GrenadTrail'
00105	     Speed=900.000000
00106	     MaxSpeed=2000.000000
00107	     DamageRadius=350.000000
00108	     bFixedRotationDir=True
00109	     StaticMesh=StaticMesh'MeshArmesPickup.fiole'
00110	     Mass=400.000000
00111	}

End Source Code