class SchlonzMinigun2 extends Minigun2; function GenerateBullet() { LightType = LT_Steady; bFiredShot = true; if ( PlayerPawn(Owner) != None ) PlayerPawn(Owner).ClientInstantFlash( -0.2, vect(325, 225, 95) ); if( Count > 0 || AmmoType.UseAmmo( 1 ) ) TraceFire( ShotAccuracy ); else GotoState( 'FinishFire' ); } function TraceFire( float Accuracy ) { local vector HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z, AimDir; local actor Other; local int hitCount; Owner.MakeNoise(Pawn(Owner).SoundDampening); GetAxes(Pawn(owner).ViewRotation,X,Y,Z); StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.Y * Y + FireOffset.Z * Z; AdjustedAim = pawn(owner).AdjustAim(1000000, StartTrace, 2.75*AimError, False, False); EndTrace = StartTrace + Accuracy * (FRand() - 0.5 )* Y * 1000 + Accuracy * (FRand() - 0.5 ) * Z * 1000; AimDir = vector(AdjustedAim); EndTrace += (20000 * AimDir); Count++; if( Count == 4 ) { Count = 0; if ( VSize(HitLocation - StartTrace) > 250 ) Spawn(class'MTracer',,, StartTrace + 96 * AimDir,rotator(EndTrace - StartTrace)); } hitCount = 0; foreach TraceActors( class'Actor', Other, HitLocation, HitNormal, EndTrace, StartTrace ) { if( Other.isA( 'Pawn' ) ) { ProcessTraceHitPawn( Other, HitLocation, HitNormal, vector(AdjustedAim),Y,Z,hitCount); hitCount++; if( hitCount >= 5 ) { break; } } else { if( Other == Level ) { Spawn( class'UT_LightWallHitEffect',,, HitLocation+HitNormal, Rotator(HitNormal) ); } break; } } } function ProcessTraceHitPawn( Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z, int hitCount ) { local int rndDam; if ( (Other!=self) && (Other!=Owner) && (Other != None) ) { if ( !Other.bIsPawn && !Other.IsA('Carcass') ) spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9); else Other.PlaySound(Sound 'ChunkHit',, 4.0,,100); if ( Other.IsA('Bot') && (FRand() < 0.2) ) Pawn(Other).WarnTarget(Pawn(Owner), 500, X); rndDam = (9 + Rand(6)) * (8 - hitCount) * 10; if( FRand() < 0.2 ) { // random increased momentum X *= 2.5; } if( Other.bIsPawn && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight) && (instigator.IsA('PlayerPawn') || (instigator.IsA('Bot') && !Bot(Instigator).bNovice)) ) { rndDam *= 2.5; } Other.TakeDamage(rndDam, Pawn(Owner), HitLocation, rndDam*500.0*X, MyDamageType); } } defaultproperties { }