//----------------------------------------------------------- // SchlonzONSAttackCraftGun. //----------------------------------------------------------- class SchlonzONSAttackCraftGun extends ONSAttackCraftGun; var class BombClass; var int iFireMode; state ProjectileFireMode { function Fire(Controller C) { local ONSAttackCraftMissle M; local Vehicle V, Best; local float CurAim, BestAim; switch( iFireMode ) { case 1: // normal Raptor if (Vehicle(Owner) != None && Vehicle(Owner).Team < 2) ProjectileClass = TeamProjectileClasses[Vehicle(Owner).Team]; else ProjectileClass = TeamProjectileClasses[0]; Super.Fire(C); break; case 2: // normal AltFire M = ONSAttackCraftMissle(SpawnProjectile(AltFireProjectileClass, True)); if (M != None) { if (AIController(Instigator.Controller) != None) { V = Vehicle(Instigator.Controller.Enemy); if (V != None && (V.bCanFly || V.IsA('ONSHoverCraft')) && Instigator.FastTrace(V.Location, Instigator.Location)) M.SetHomingTarget(V); } else { BestAim = MinAim; for (V = Level.Game.VehicleList; V != None; V = V.NextVehicle) if ((V.bCanFly || V.IsA('ONSHoverCraft')) && V != Instigator && Instigator.GetTeamNum() != V.GetTeamNum()) { CurAim = Normal(V.Location - WeaponFireLocation) dot vector(WeaponFireRotation); if (CurAim > BestAim && Instigator.FastTrace(V.Location, Instigator.Location)) { Best = V; BestAim = CurAim; } } if (Best != None) M.SetHomingTarget(Best); } } break; case 3: // now a little bombing spawn(BombClass,,, Location - ((CollisionHeight + BombClass.default.CollisionHeight) * vect(0,0,2)), rotator(vect(0,0,-1))); break; } } function AltFire(Controller C) { iFireMode += 1; if( iFireMode > 3 ) iFireMode = 1; switch( iFireMode ) { case 1: Instigator.ClientMessage( "Raptor FireMode: Normal Fire"); FireInterval=0.200000; if( Instigator.PlayerReplicationInfo != None ) { if( Instigator.PlayerReplicationInfo.bBot ) FireInterval=0.250000; else FireInterval=0.150000; } break; case 2: Instigator.ClientMessage( "Raptor FireMode: Rocket"); FireInterval=2.000000; break; case 3: Instigator.ClientMessage( "Raptor FireMode: Bombing"); FireInterval=0.500000; break; } } } defaultproperties { iFireMode = 1; BombClass=class'SchlonzUT.SchlonzRaptorBomb'; AltFireInterval=0.500000 }