Core.Object | +--Engine.Actor | +--Engine.Projectile | +--UnrealI.RazorBlade
int
NumWallHits
bCanHitInstigator,
bHitWater
void
SetUp()
00001 //============================================================================= 00002 // RazorBlade. 00003 //============================================================================= 00004 class RazorBlade extends Projectile; 00005 00006 #exec MESH IMPORT MESH=razorb ANIVFILE=MODELS\razorb_a.3D DATAFILE=MODELS\razorb_d.3D X=0 Y=0 Z=0 00007 #exec MESH ORIGIN MESH=razorb X=0 Y=0 Z=0 YAW=-64 00008 #exec MESH SEQUENCE MESH=razorb SEQ=All STARTFRAME=0 NUMFRAMES=15 00009 #exec MESH SEQUENCE MESH=razorb SEQ=Spin STARTFRAME=0 NUMFRAMES=15 00010 #exec TEXTURE IMPORT NAME=Jrazor1 FILE=MODELS\razor.PCX 00011 #exec OBJ LOAD FILE=..\UnrealShare\textures\FireEffect54.utx PACKAGE=UNREALI.Effect54 00012 #exec MESHMAP SCALE MESHMAP=razorb X=0.04 Y=0.04 Z=0.08 00013 #exec MESHMAP SETTEXTURE MESHMAP=razorb NUM=1 TEXTURE=Jrazor1 00014 #exec MESHMAP SETTEXTURE MESHMAP=razorb NUM=0 TEXTURE=Unreali.Effect54.FireEffect54 00015 00016 #exec AUDIO IMPORT FILE="Sounds\Razor\fly15.WAV" NAME="RazorHum" GROUP="RazorJack" 00017 #exec AUDIO IMPORT FILE="Sounds\Razor\bladehit.wav" NAME="BladeHit" GROUP="RazorJack" 00018 #exec AUDIO IMPORT FILE="Sounds\Razor\bladethunk.wav" NAME="BladeThunk" GROUP="RazorJack" 00019 #exec AUDIO IMPORT FILE="Sounds\Razor\start9b.WAV" NAME="StartBlade" GROUP="RazorJack" 00020 00021 var int NumWallHits; 00022 var bool bCanHitInstigator, bHitWater; 00023 00024 ///////////////////////////////////////////////////// 00025 auto state Flying 00026 { 00027 simulated function ProcessTouch (Actor Other, Vector HitLocation) 00028 { 00029 if ( bCanHitInstigator || (Other != Instigator) ) 00030 { 00031 if ( Role == ROLE_Authority ) 00032 { 00033 if ( Other.IsA('Pawn') && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight) 00034 && (instigator.IsA('PlayerPawn') || (instigator.skill > 1)) 00035 && (!Other.IsA('ScriptedPawn') || !ScriptedPawn(Other).bIsBoss) ) 00036 Other.TakeDamage(3.5 * damage, instigator,HitLocation, 00037 (MomentumTransfer * Normal(Velocity)), 'decapitated' ); 00038 else 00039 Other.TakeDamage(damage, instigator,HitLocation, 00040 (MomentumTransfer * Normal(Velocity)), 'shredded' ); 00041 } 00042 if ( Other.IsA('Pawn') ) 00043 PlaySound(MiscSound, SLOT_Misc, 2.0); 00044 else 00045 PlaySound(ImpactSound, SLOT_Misc, 2.0); 00046 destroy(); 00047 } 00048 } 00049 00050 simulated function ZoneChange( Zoneinfo NewZone ) 00051 { 00052 local Splash w; 00053 00054 if (!NewZone.bWaterZone || bHitWater) Return; 00055 00056 bHitWater = True; 00057 w = Spawn(class'Splash',,,,rot(16384,0,0)); 00058 w.DrawScale = 0.5; 00059 w.RemoteRole = ROLE_None; 00060 Velocity=0.6*Velocity; 00061 } 00062 00063 simulated function SetRoll(vector NewVelocity) 00064 { 00065 local rotator newRot; 00066 00067 newRot = rotator(NewVelocity); 00068 SetRotation(newRot); 00069 } 00070 00071 simulated function HitWall (vector HitNormal, actor Wall) 00072 { 00073 00074 bCanHitInstigator = true; 00075 PlaySound(ImpactSound, SLOT_Misc, 2.0); 00076 LoopAnim('Spin',1.0); 00077 if ( (Mover(Wall) != None) && Mover(Wall).bDamageTriggered ) 00078 { 00079 if ( Role == ROLE_Authority ) 00080 Wall.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), ''); 00081 Destroy(); 00082 return; 00083 } 00084 NumWallHits++; 00085 SetTimer(0, False); 00086 MakeNoise(0.3); 00087 if ( NumWallHits > 5 ) 00088 Destroy(); 00089 Velocity -= 2 * ( Velocity dot HitNormal) * HitNormal; 00090 SetRoll(Velocity); 00091 } 00092 00093 function SetUp() 00094 { 00095 local vector X; 00096 00097 X = vector(Rotation); 00098 Velocity = Speed * X; // Impart ONLY forward vel 00099 if (Instigator.HeadRegion.Zone.bWaterZone) 00100 bHitWater = True; 00101 PlaySound(SpawnSound, SLOT_None,4.2); 00102 } 00103 00104 simulated function BeginState() 00105 { 00106 00107 SetTimer(0.2, false); 00108 SetUp(); 00109 00110 if ( Level.NetMode != NM_DedicatedServer ) 00111 { 00112 LoopAnim('Spin',1.0); 00113 if ( Level.NetMode == NM_Standalone ) 00114 SoundPitch = 200 + 50 * FRand(); 00115 } 00116 } 00117 00118 simulated function Timer() 00119 { 00120 bCanHitInstigator = true; 00121 } 00122 } 00123 00124 defaultproperties 00125 { 00126 speed=1300.000000 00127 MaxSpeed=1200.000000 00128 Damage=30.000000 00129 MomentumTransfer=15000 00130 SpawnSound=Sound'UnrealI.Razorjack.StartBlade' 00131 ImpactSound=Sound'UnrealI.Razorjack.BladeHit' 00132 MiscSound=Sound'UnrealI.Razorjack.BladeThunk' 00133 RemoteRole=ROLE_SimulatedProxy 00134 LifeSpan=6.000000 00135 AnimSequence=spin 00136 AmbientSound=Sound'UnrealI.Razorjack.RazorHum' 00137 Mesh=LodMesh'UnrealI.razorb' 00138 AmbientGlow=167 00139 bUnlit=True 00140 SoundRadius=12 00141 SoundVolume=128 00142 SoundPitch=200 00143 bBounce=True 00144 }