UnrealShare
Class DispersionAmmo

source: e:\games\UnrealTournament\UnrealShare\Classes\DispersionAmmo.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Projectile
         |
         +--UnrealShare.DispersionAmmo
Direct Known Subclasses:DAmmo2, DAmmo3, DAmmo4, DAmmo5

class DispersionAmmo
extends Engine.Projectile

//============================================================================= // DispersionAmmo. //=============================================================================
Variables
 Float AnimTime
 Sound EffectSound1
 Texture ExpSkin
 Texture ExpType
 int NumFrames
 class ParticleType
 float Pause
 float SparkModifier
 float SparkScale
 Texture SpriteAnim[20]
 bExploded,bAltFire, bExplosionEffect
 int i


Function Summary
 void BlowUp(vector HitLocation)
 
simulated
Explode(vector HitLocation, vector HitNormal)
 void InitSplash(float DamageScale)
 
simulated
PostBeginPlay()
 
simulated
ProcessTouch(Actor Other, vector HitLocation)
 
simulated
TakeDamage(int NDamage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)
 
simulated
Tick(float DeltaTime)



Source Code


00001	//=============================================================================
00002	// DispersionAmmo.
00003	//=============================================================================
00004	class DispersionAmmo extends Projectile;
00005	
00006	#exec MESH IMPORT MESH=plasmaM ANIVFILE=MODELS\cros_t_a.3D DATAFILE=MODELS\cros_t_d.3D X=0 Y=0 Z=0 
00007	#exec MESH ORIGIN MESH=plasmaM X=0 Y=-500 Z=0 YAW=-64
00008	#exec MESH SEQUENCE MESH=plasmaM SEQ=All STARTFRAME=0  NUMFRAMES=1
00009	#exec MESH SEQUENCE MESH=plasmaM SEQ=Still  STARTFRAME=0 NUMFRAMES=1
00010	#exec MESHMAP SCALE MESHMAP=plasmaM X=0.09 Y=0.15 Z=0.08
00011	#exec  OBJ LOAD FILE=Textures\fireeffect1.utx PACKAGE=UnrealShare.Effect1
00012	#exec MESHMAP SETTEXTURE MESHMAP=plasmaM NUM=0 TEXTURE=UnrealShare.Effect1.FireEffect1u
00013	#exec MESHMAP SETTEXTURE MESHMAP=plasmaM NUM=1 TEXTURE=UnrealShare.Effect1.FireEffect1t
00014	
00015	#exec AUDIO IMPORT FILE="Sounds\Dispersion\DFly1.WAV" NAME="DispFly" GROUP="Dispersion"
00016	#exec AUDIO IMPORT FILE="sounds\dispersion\dpexplo4.wav" NAME="DispEX1" GROUP="General"
00017	  
00018	#exec OBJ LOAD FILE=textures\DispExpl.utx PACKAGE=UnrealShare.DispExpl
00019	#exec TEXTURE IMPORT NAME=BluePal FILE=textures\expal2a.pcx GROUP=Effects
00020	
00021	#exec TEXTURE IMPORT NAME=ExplosionPal FILE=textures\exppal.pcx GROUP=Effects
00022	#exec OBJ LOAD FILE=textures\MainE.utx PACKAGE=UnrealShare.MainEffect
00023	
00024	var bool bExploded,bAltFire, bExplosionEffect;
00025	var() float SparkScale;
00026	var() class<SmallSpark> ParticleType;
00027	var() float SparkModifier;
00028	var() texture ExpType;
00029	var() texture ExpSkin;
00030	var() Sound EffectSound1;
00031	var() texture SpriteAnim[20];
00032	var() int NumFrames;
00033	var() float Pause;
00034	var int i;
00035	var Float AnimTime;
00036	
00037	simulated function Tick(float DeltaTime)
00038	{
00039		if ( Physics != PHYS_None )
00040			LifeSpan = 0.7; // keep resetting it - can't make it longer since animspriteeffect base of this
00041	}
00042	
00043	simulated function PostBeginPlay()
00044	{
00045		//log("Spawn "$self$" with role "$Role$" and netmode "$Level.netmode);
00046		Super.PostBeginPlay();
00047		Velocity = Speed * vector(Rotation);
00048	}
00049	
00050	function InitSplash(float DamageScale)
00051	{
00052		Damage *= DamageScale;
00053		MomentumTransfer *= DamageScale;
00054		SparkScale = FClamp(DamageScale*3.0 - 1.2,0.5,4.0);
00055		DrawScale = fMin(DamageScale,2.0);
00056	}
00057	
00058	simulated function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, 
00059						Vector momentum, name damageType)
00060	{
00061		bExploded = True;
00062	}
00063	
00064	function BlowUp(vector HitLocation)
00065	{
00066		if ( bAltFire ) 
00067			HurtRadius(Damage,150.0, 'exploded', MomentumTransfer, HitLocation );	
00068		PlaySound (EffectSound1,,7.0);	
00069	}
00070	
00071	simulated function Explode(vector HitLocation, vector HitNormal)
00072	{
00073		if ( !bExplosionEffect )
00074		{
00075			BlowUp(HitLocation);
00076			bExplosionEffect = true;
00077			if (Level.bHighDetailMode) 
00078				DrawScale = Min(Damage/12.0 + 0.8,2.5);
00079			else 
00080				DrawScale = Min(Damage/20.0 + 0.8,1.5);	
00081			LightRadius = 6;
00082			SetCollision(false,false,false);
00083			LifeSpan = 0.7;
00084			Texture = ExpType;
00085		    LightType = LT_TexturePaletteOnce;
00086			Skin = ExpSkin;
00087			DrawType = DT_SpriteAnimOnce;
00088			Style = STY_Translucent;
00089			SetPhysics(PHYS_None);
00090			Disable('Tick');
00091		}
00092	}
00093	
00094	simulated function ProcessTouch (Actor Other, vector HitLocation)
00095	{
00096		If (Other!=Instigator  && DispersionAmmo(Other)==None)
00097		{
00098			bExploded = ( Other.IsA('Pawn') && !Level.bHighDetailMode );
00099			if ( Role == ROLE_Authority )
00100				Other.TakeDamage( Damage, instigator, HitLocation, MomentumTransfer*Vector(Rotation), 'exploded');	
00101			Explode(HitLocation, vect(0,0,1));
00102		}
00103	}
00104	
00105	defaultproperties
00106	{
00107	     SparkScale=1.000000
00108	     ParticleType=Class'UnrealShare.Spark3'
00109	     SparkModifier=1.000000
00110	     ExpType=Texture'UnrealShare.DispExpl.dseb_A00'
00111	     ExpSkin=Texture'UnrealShare.Effects.BluePal'
00112	     EffectSound1=Sound'UnrealShare.General.DispEX1'
00113	     SpriteAnim(0)=Texture'UnrealShare.MainEffect.e1_a00'
00114	     SpriteAnim(1)=Texture'UnrealShare.MainEffect.e2_a00'
00115	     SpriteAnim(2)=Texture'UnrealShare.MainEffect.e3_a00'
00116	     SpriteAnim(3)=Texture'UnrealShare.MainEffect.e4_a00'
00117	     SpriteAnim(4)=Texture'UnrealShare.MainEffect.e5_a00'
00118	     NumFrames=8
00119	     Pause=0.050000
00120	     speed=1300.000000
00121	     Damage=15.000000
00122	     MomentumTransfer=6000
00123	     ExploWallOut=10.000000
00124	     RemoteRole=ROLE_SimulatedProxy
00125	     LifeSpan=0.700000
00126	     AmbientSound=Sound'UnrealShare.Dispersion.DispFly'
00127	     Style=STY_Translucent
00128	     Texture=FireTexture'UnrealShare.Effect1.FireEffect1u'
00129	     Mesh=LodMesh'UnrealShare.plasmaM'
00130	     DrawScale=0.800000
00131	     AmbientGlow=187
00132	     bUnlit=True
00133	     SoundRadius=10
00134	     SoundVolume=218
00135	     LightType=LT_Steady
00136	     LightEffect=LE_NonIncidence
00137	     LightBrightness=255
00138	     LightHue=170
00139	     LightSaturation=69
00140	     LightRadius=5
00141	     bFixedRotationDir=True
00142	}

End Source Code