//============================================================================= // SchlonzLivingBioSplash. //============================================================================= class SchlonzLivingBioSplash expands UT_BioGel; var Pawn target; var Vector lastHitNormal; function setTarget( Pawn newTarget ) { target = newTarget; } auto state Flying { function ProcessTouch (Actor Other, vector HitLocation) { if ( Other.IsA('UT_BioGel') ) return; if ( Pawn(Other)!=Instigator || bOnGround) Global.Timer(); } simulated function HitWall( vector HitNormal, actor Wall ) { if( target == none ) { Super.HitWall( HitNormal, Wall ); } else { lastHitNormal = HitNormal; SetPhysics(PHYS_None); MakeNoise(0.3); bOnGround = True; PlaySound(ImpactSound); SetWall(HitNormal, Wall); PlayAnim('Hit'); GoToState('RestOnSurface'); } } } state RestOnSurface { function ProcessTouch (Actor Other, vector HitLocation) { if ( Other.IsA('UT_BioGel') ) return; if ( Pawn(Other)!=Instigator || bOnGround) Global.Timer(); } function Timer() { local Vector hopTo; hopTo = Normal(target.Location - Location) * 10 + 2 * VRand(); hopTo.Y += 5; if( Normal(hopTo) Dot lastHitNormal > 0 ) { SetPhysics(PHYS_Falling); bOnGround = false; SetRotation( Rotator( hopTo+Location ) ); Velocity = Normal(hopTo) * Default.Speed; } else { GotoState('OnSurface'); } } function BeginState() { SetTimer( 0.2, false ); } } defaultproperties { Damage=60.000000 MomentumTransfer=60000 }