class SchlonzLivingBioGlob extends SchlonzBioGlob; #exec OBJ LOAD FILE=XSchlonzEffectMatGoop.utx // period between throwing glibber var() float GlibberingPeriod; // time to live on the floor var() float OnFloorLifeTime; // how many glibbers per goop var() int GlibberingFactor; // radius in which enemies will be glibbered var() float DetectionRadius; // time to live on floor for a mini glob var() float MiniOnFloorLifeTime; // count of micro globs a mini glob throws var() int MicroGlobCount; // count of timer calls till death var int timerLives; // count of bio globs var int globCount; // mini glob, thrown by bio glob var bool miniGlob; // micro glob, thrown by mini bio glob var bool microGlob; // Controller of the Instigator var Controller controller; state OnGround { simulated function BeginState() { PlayAnim('hit'); SetTimer( GlibberingPeriod, true ); /* if( microGlob ) { // die on floor SetTimer( 0.25, false ); timerLives = 0; return; } else if( miniGlob ) { timerLives = int(MiniOnFloorLifeTime/GlibberingPeriod); globCount = MicroGlobCount; } */ if( miniGlob ) { // die on floor SetTimer( 0.25, false ); timerLives = 0; return; } else { timerLives = int(OnFloorLifeTime/GlibberingPeriod); globCount = (GoopLevel+2) * GlibberingFactor; } } simulated function Timer() { local Pawn pawn; local Vector dir; local float dist; local bool doThrow; local SchlonzLivingBioGlob glob; timerLives--; if( timerLives > 0 ) { if( Instigator == None ) { Instigator = controller.Pawn; } // search for enemies foreach RadiusActors( class'Pawn', pawn, DetectionRadius ) { doThrow = (pawn != Instigator) && (pawn.Health > 0); //doThrow = (pawn.Health > 0); if( doThrow ) { if( Level.Game.bTeamGame ) { if( pawn.PlayerReplicationInfo == None ) { //doThrow = false; //super.Timer();return; } else if( Instigator == None ) { //doThrow = false; //super.Timer();return; } else if( Instigator.PlayerReplicationInfo == None ) { //doThrow = false; //super.Timer();return; } else if( pawn.PlayerReplicationInfo.Team == Instigator.PlayerReplicationInfo.Team ) { doThrow = false; } else { //super.Timer();return; } /* if( pawn.PlayerReplicationInfo == None || Instigator == None || pawn.PlayerReplicationInfo.Team == Instigator.PlayerReplicationInfo.Team ) { doThrow = false; } */ } else { super.Timer();return; } } if( doThrow ) { dir = (pawn.Location-Location) / 2.0; //dist = Dist( Location, pawn.Location ); dist = VSize(dir); dir.Z += dist/3.0; if( FastTrace( Location, Location+dir ) && FastTrace( Location+dir, pawn.Location ) ) { if( Instigator == None ) // homeless glibber glob = Spawn( class'SchlonzUT.SchlonzLivingBioGlob',,, Location+Normal(dir)*20, Rotator(dir+VRand()*(dist/8.0)) ); else glob = Spawn( class'SchlonzUT.SchlonzLivingBioGlob',Instigator,, Location+Normal(dir)*20, Rotator(dir+VRand()*(dist/8.0)) ); if( glob != None ) { glob.Instigator = Instigator; glob.controller = controller; if( miniGlob ) { glob.microGlob = true; glob.miniGlob = true; } else { glob.microGlob = false; glob.miniGlob = true; } } globCount--; if( globCount <= 0 ) { // out of globs, die timerLives = 0; } } } } } else { // have to die super.Timer(); } } simulated function ProcessTouch(Actor Other, Vector HitLocation) { if( Other.IsA('Pawn') ) { bDrip = false; timerLives = 0; } } function TakeDamage( int Damage, Pawn InstigatedBy, Vector HitLocation, Vector Momentum, class DamageType ) { if( DamageType == class'DamTypeRocket' || DamageType == class'DamTypeRocketHoming' || DamageType == class'DamTypeRedeemer' ) { bDrip = false; timerLives = 0; } } simulated function AnimEnd(int Channel) { local float DotProduct; if (!bCheckedSurface) { DotProduct = SurfaceNormal dot Vect(0,0,-1); if (DotProduct > 0.7) { PlayAnim('Drip', 0.66); bDrip = true; //SetTimer(DripTime, false); if (bOnMover) BlowUp(Location); } else if (DotProduct > -0.5) { PlayAnim('Slide', 1.0); if (bOnMover) BlowUp(Location); } bCheckedSurface = true; } } simulated function MergeWithGlob(int AdditionalGoopLevel) { local int NewGoopLevel, ExtraSplash; NewGoopLevel = AdditionalGoopLevel + GoopLevel; if (NewGoopLevel > MaxGoopLevel) { Rand3 = (Rand3 + 1) % 3; ExtraSplash = Rand3; if (Role == ROLE_Authority) SplashGlobs(NewGoopLevel - MaxGoopLevel + ExtraSplash); NewGoopLevel = MaxGoopLevel - ExtraSplash; } SetGoopLevel(NewGoopLevel); SetCollisionSize(GoopVolume*10.0, GoopVolume*10.0); PlaySound(ImpactSound, SLOT_Misc); PlayAnim('hit'); bCheckedSurface = false; //SetTimer(RestTime, false); } } // Skins(0)=FinalBlend'XSchlonzEffectMatGoop.goopBlue.GoopFB' // Skins(0)=FinalBlend'XEffectMat.goop.GoopFB' defaultproperties { GlibberingPeriod=0.400000 OnFloorLifeTime=200.000000 GlibberingFactor=12 DetectionRadius=700.000000 MiniOnFloorLifeTime=1.000000 MicroGlobCount=2 LifeSpan=600.000000 Skins(0)=FinalBlend'XSchlonzEffectMatGoop.goop.GoopFB' }