Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UnrealShare.StingerProjectile


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
//=============================================================================
// StingerProjectile.
//=============================================================================
class StingerProjectile extends Projectile;

#exec MESH IMPORT MESH=TarydiumProjectile ANIVFILE=Models\aniv52.3d DATAFILE=Models\data52.3d X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=TarydiumProjectile X=0 Y=0 Z=0 YAW=64
#exec MESH SEQUENCE MESH=TarydiumProjectile SEQ=All  STARTFRAME=0  NUMFRAMES=1
#exec TEXTURE IMPORT NAME=Tarydium1 FILE=Models\shells.pcx
#exec MESHMAP SCALE MESHMAP=TarydiumProjectile X=0.015 Y=0.015 Z=0.03
#exec MESHMAP SETTEXTURE MESHMAP=TarydiumProjectile NUM=4 TEXTURE=Tarydium1

#exec TEXTURE IMPORT NAME=ExplosionPal3 FILE=Textures\expal2.pcx GROUP=Effects

#exec MESH IMPORT MESH=burst ANIVFILE=Models\burst_a.3d DATAFILE=Models\burst_d.3d X=0 Y=0 Z=0 ZEROTEX=1
#exec MESH ORIGIN MESH=burst X=0 Y=0 Z=0 YAW=-64
#exec MESH SEQUENCE MESH=burst SEQ=All       STARTFRAME=0   NUMFRAMES=6
#exec MESH SEQUENCE MESH=burst SEQ=Explo     STARTFRAME=0   NUMFRAMES=6
#exec TEXTURE IMPORT NAME=Jburst1 FILE=Models\burst.pcx GROUP=Skin
#exec MESHMAP SCALE MESHMAP=burst X=0.2 Y=0.2 Z=0.4 YAW=128
#exec MESHMAP SETTEXTURE MESHMAP=burst NUM=0 TEXTURE=Jburst1

#exec AUDIO IMPORT FILE="Sounds\Stinger\Ricochet.wav" NAME="Ricochet" GROUP="Stinger"
#exec AUDIO IMPORT FILE="..\UnrealI\Sounds\Razor\bladehit.wav" NAME="BladeHit" GROUP="RazorJack"

var bool bLighting;
var float DelayTime;

/////////////////////////////////////////////////////
auto state Flying
{
	simulated function ProcessTouch( Actor Other, Vector HitLocation )
	{
		local vector hitDir;

		if (Other != instigator && StingerProjectile(Other) == none)
		{
			if ( Other.Role==ROLE_Authority )
			{
				hitDir = Normal(Velocity);
				if ( FRand() < 0.2 )
					hitDir *= 5;
				Other.TakeDamage(damage, instigator,HitLocation,(MomentumTransfer * hitDir),'shot');
			}
			Destroy();
		}
	}
	simulated function HitWall( vector HitNormal, actor Wall )
	{
		local Texture T;

		Super.HitWall(HitNormal, Wall);
		MakeNoise(0.3);
		if( Level.NetMode==NM_DedicatedServer )
		{
			Destroy();
			return;
		}
		if (FRand()<0.3)
			PlaySound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand());
		else PlaySound(MiscSound, SLOT_Misc, 0.6,,,1.0);

		if ( !EffectIsRelevant(Location) )
		{
			Destroy();
			return;
		}

		T = GetHitTexture();
		RemoteRole = ROLE_None; // Tear off.
		SetPhysics(PHYS_None);
		SetCollision(false);

		if( T==None || (T.SurfaceType!=EST_Wood && T.SurfaceType!=EST_Plant && T.SurfaceType!=EST_Flesh && T.SurfaceType!=EST_Snow && T.SurfaceType!=EST_Dirt) )
		{
			Mesh = mesh'Burst';
			SetRotation(RotRand());
			Spawn(class'StingerCrack',,,Location, rotator(HitNormal));
			PlayAnim('Explo',0.9);
		}
		else if( T.SurfaceType==EST_Snow )
			Destroy(); // Snow sucks it up.
		else
		{
			LightType = LT_None;
			SetBase(Wall);
			if( Level.bDropDetail )
				LifeSpan = 1.f;
			else LifeSpan = 3.f;
		}
	}

	simulated function Timer()
	{
		local bubble1 b;		
		if (!Region.Zone.bWaterZone)
		{
			SetTimer(0,False);
			Return;
		}
		if ( EffectIsRelevant(Location) && !Level.bDropDetail )
		{
			b=spawn(class'Bubble1',,,Location+FRand()*vect(2,0,0)+FRand()*Vect(0,2,0)+FRand()*Vect(0,0,2));
			if( b!=None )
			{
				b.DrawScale= 0.1 + FRand()*0.2;
				b.buoyancy = b.mass+(FRand()*0.4+0.1);
				b.RemoteRole = ROLE_None;
			}
		}
		DelayTime+=FRand()*0.1+0.1;
		SetTimer(DelayTime,False);
	}

	simulated function ZoneChange( Zoneinfo NewZone )
	{
		if( NewZone.bWaterZone && Region.Zone!=None && !Region.Zone.bWaterZone )
		{
			Velocity=0.7*Velocity;
			DelayTime=0.03;
			SetTimer(DelayTime,False);
		}
	}

	simulated function BeginState()
	{
		local rotator RandRot;

		if ( Role == ROLE_Authority )
		{
			Velocity = Vector(Rotation) * speed;
			RandRot.Pitch = FRand() * 200 - 100;
			RandRot.Yaw = FRand() * 200 - 100;
			RandRot.Roll = FRand() * 200 - 100;
			Velocity = Velocity >> RandRot;
			if ( Region.zone.bWaterZone )
				Velocity=0.7*Velocity;
		}
		DelayTime=0.03;
		if ( Region.zone.bWaterZone )
			SetTimer(DelayTime,False);
	}
}

///////////////////////////////////////////////////////
simulated function Explode(vector HitLocation, vector HitNormal)
{
}

simulated function AnimEnd()
{
	Destroy();
}

defaultproperties
{
				speed=1600.000000
				Damage=14.000000
				MomentumTransfer=4000
				MyDamageType="SHOT"
				ImpactSound=Sound'UnrealShare.Stinger.Ricochet'
				MiscSound=Sound'UnrealShare.RazorJack.BladeHit'
				RemoteRole=ROLE_SimulatedProxy
				LifeSpan=6.000000
				AnimRate=1.000000
				Mesh=LodMesh'UnrealShare.TarydiumProjectile'
				AmbientGlow=215
				bUnlit=True
				bNoSmooth=True
				LightType=LT_Steady
				LightEffect=LE_NonIncidence
				LightBrightness=80
				LightHue=152
				LightSaturation=32
				LightRadius=5
				LightPeriod=50
				bBounce=True
				Mass=2.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:28.000 - Creation time: zo 11-11-2012 21:14:20.475 - Created with UnCodeX