Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 |
//============================================================================= // U2Spore. //============================================================================= class U2Spore extends U2PawnBase; #exec OBJ LOAD File=..\System\ParticleRes\spore_FX.u var() name LoopingAnimationName; var() float LoopingAnimRate; var() ParticleGenerator ImpactParticleEffect; var() string ImpactSoundString; var() bool bMultipleAxes; // rotate on multiple axes simultaneously -- results in "tumbling" effect var() bool bRandomizeDirection; // if true, rotation directions randomly reversed var() rotator MinAmbientRotationRate, MaxAmbientRotationRate; // Should be >= 0 //----------------------------------------------------------------------------- event PreBeginPlay() { local rotator NewRotation; local int NumAxes, AxisToUse; Super.PreBeginPlay(); // randomize rotation NewRotation.Pitch = RandRange( 0, 65535 ); NewRotation.Yaw = RandRange( 0, 65535 ); NewRotation.Roll = RandRange( 0, 65535 ); SetRotation( NewRotation ); // randomize ambient rotation rate if( bMultipleAxes ) { if( MaxAmbientRotationRate.Pitch > 0 ) AmbientRotationRate.Pitch = RandRange( MinAmbientRotationRate.Pitch, MaxAmbientRotationRate.Pitch ); if( MaxAmbientRotationRate.Yaw > 0 ) AmbientRotationRate.Yaw = RandRange( MinAmbientRotationRate.Yaw, MaxAmbientRotationRate.Yaw ); if( MaxAmbientRotationRate.Roll > 0 ) AmbientRotationRate.Roll = RandRange( MinAmbientRotationRate.Roll, MaxAmbientRotationRate.Roll ); } else { if( MaxAmbientRotationRate.Pitch > 0 ) NumAxes++; if( MaxAmbientRotationRate.Yaw > 0 ) NumAxes++; if( MaxAmbientRotationRate.Roll > 0 ) NumAxes++; AxisToUse = RandRange( 0, NumAxes ); NumAxes = 0; if( MaxAmbientRotationRate.Pitch > 0 ) { if( NumAxes == AxisToUse ) AmbientRotationRate.Pitch = RandRange( MinAmbientRotationRate.Pitch, MaxAmbientRotationRate.Pitch ); NumAxes++; } if( MaxAmbientRotationRate.Yaw > 0 ) { if( NumAxes == AxisToUse ) AmbientRotationRate.Yaw = RandRange( MinAmbientRotationRate.Yaw, MaxAmbientRotationRate.Yaw ); NumAxes++; } if( MaxAmbientRotationRate.Roll > 0 ) { if( NumAxes == AxisToUse ) AmbientRotationRate.Roll = RandRange( MinAmbientRotationRate.Roll, MaxAmbientRotationRate.Roll ); NumAxes++; } } if( bRandomizeDirection ) { if( FRand() < 0.5 ) AmbientRotationRate.Pitch = -AmbientRotationRate.Pitch; if( FRand() < 0.5 ) AmbientRotationRate.Yaw = -AmbientRotationRate.Yaw; if( FRand() < 0.5 ) AmbientRotationRate.Roll = -AmbientRotationRate.Roll; } //DMTNS( "Ambient Pitch: " $ AmbientRotationRate.Pitch $ " Yaw: " $ AmbientRotationRate.Yaw $ " Roll: " $ AmbientRotationRate.Roll ); if( LoopingAnimationName != '' ) LoopAnim( LoopingAnimationName, LoopingAnimRate ); } //----------------------------------------------------------------------------- event Destroyed() { local ParticleGenerator Particles; Super.Destroyed(); if( ImpactParticleEffect != None ) { Particles = class'ParticleGenerator'.static.CreateNew( Self, ImpactParticleEffect, Location ); //Particles.SetRotation( rotator(Hit.Normal) ); //??? Particles.Trigger( Self, Self ); Particles.ParticleLifeSpan = Particles.GetMaxLifeSpan() + Particles.TimerDuration; if( ImpactSoundString != "" ) PlaySound( Sound(DynamicLoadObject( ImpactSoundString, class'Sound' )), SLOT_Misc ); } } //----------------------------------------------------------------------------- event Bump( Actor Other ) { if( U2Pawn( Other ) != None && U2Spore( Other ) == None ) TakeDamage( Health, Self, Location, vect(0,0,0), class'DamageTypePhysical' ); else Super.Bump( Other ); } /* //----------------------------------------------------------------------------- function Died( Controller Killer, class<DamageType> DamageType, vector HitLocation, vector Momentum ) { Super.Died( Killer, damageType, HitLocation, Momentum ); Destroy(); } */ //----------------------------------------------------------------------------- state @ DyingState { Begin: Destroy(); } //----------------------------------------------------------------------------- defaultproperties { LoopingAnimRate=1.000000 ImpactParticleEffect=ParticleSalamander'spore_FX.ParticleSalamander0' ImpactSoundString="U2SporeA.SporeImpact" bRandomizeDirection=true MinAmbientRotationRate=(Pitch=2048,Yaw=2048,Roll=2048) MaxAmbientRotationRate=(Pitch=32767,Yaw=32767,Roll=32767) AlertOthersRadius=0.000000 bLookForAlertFriends=false bWanderCanTeleportIfStuck=false bWanderLookAtDestination=false WanderAvoidPawnDiffDistance=-30.000000 WanderPauseOdds=0.250000 WanderSpeedMin=0.100000 WanderSpeedMax=0.100000 WanderSpreadAngle=120.000000 AnimationControllerClass=None DamageFilterClass=Class'U2Pawns.DamageFilterSpore' bCanPanic=false bOverridesDamageEffect=true bCanFly=true bAmbientCreature=false SightRadius=2048.000000 SeenRadiusNoFOV=1024.000000 MaxStepHeight=0.000000 SeeOtherOdds=0.200000 WaterSpeed=150.000000 AirSpeed=250.000000 BaseEyeHeight=0.000000 Health=1 UnderWaterTime=-1.000000 ControllerClass=Class'U2Pawns.U2SporeController' TeamNumber=67 DrawType=DT_StaticMesh StaticMesh=StaticMesh'VertexM.Creatures.Alien_Spore' bActorShadows=false AmbientSound=Sound'U2SporeA.SporeAmbient_07' DrawScale=0.500000 PrePivot=(Z=2.000000) SoundRadius=300.000000 TransientSoundRadius=300.000000 CollisionRadius=16.000000 CollisionHeight=16.000000 bNoStaticMeshCollide=true Mass=5.000000 Buoyancy=5.000000 UseReticleOnEvents(0)="UseReticleText" UseReticleOnEvents(1)="UseReticleCorners" UseReticleOnEvents(2)="UseReticleSideBars" ProximityReticleOnEvents(0)="ProximityReticleCorners" ProximityReticleOnEvents(1)="ProximityReticleSideBars" } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |