//============================================================================= // SchlonzPulseGun. //============================================================================= class SchlonzPulseGun expands PulseGun; simulated function PlayFiring() { FlashCount++; AmbientSound = FireSound; SoundVolume = Pawn(Owner).SoundDampening*255; LoopAnim( 'shootLOOP', 1 + 0.5 * FireAdjust, 0.0); bWarnTarget = (FRand() < 0.2); } simulated function PlayAltFiring() { FlashCount++; AmbientSound = FireSound; SoundVolume = Pawn(Owner).SoundDampening*255; LoopAnim( 'shootLOOP', 1 + 0.5 * FireAdjust, 0.0); bWarnTarget = (FRand() < 0.2); } state ClientAltFiring { simulated function Tick( float DeltaTime ) { if ( (Pawn(Owner) != None) && (Pawn(Owner).bAltFire != 0) ) AmbientSound = FireSound; else AmbientSound = None; } } state NormalFire { function Projectile ProjectileFire(class ProjClass, float ProjSpeed, bool bWarn) { local Vector Start, X,Y,Z; //local Bot B; local Pawn P; if (AmmoType.UseAmmo(1)) { //bCanClientFire = true; //bPointing=True; Start = Owner.Location + CalcDrawOffset(); //B = Bot(Owner); P = Pawn(Owner); //P.PlayRecoil(FiringSpeed); //Owner.MakeNoise(2.0 * P.SoundDampening); AdjustedAim = P.AdjustAim(ProjectileSpeed, Start, AimError, True, bWarnTarget); GetAxes(AdjustedAim,X,Y,Z); Spawn(class'WeaponLight',,'',Start+X*20,rot(0,0,0)); Start = Start + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; Spawn( class 'UTChunk1',, '', Start, AdjustedAim); Spawn( class 'UTChunk2',, '', Start - Z, AdjustedAim); Spawn( class 'UTChunk3',, '', Start + 2 * Y + Z, AdjustedAim); Spawn( class 'UTChunk4',, '', Start - Y, AdjustedAim); /* Spawn( class 'UTChunk1',, '', Start + 2 * Y - Z, AdjustedAim); Spawn( class 'UTChunk2',, '', Start, AdjustedAim); // lower skill bots fire less flak chunks if ( (B == None) || !B.bNovice || ((B.Enemy != None) && (B.Enemy.Weapon != None) && B.Enemy.Weapon.bMeleeWeapon) ) { Spawn( class 'UTChunk3',, '', Start + Y - Z, AdjustedAim); Spawn( class 'UTChunk4',, '', Start + 2 * Y + Z, AdjustedAim); } else if ( B.Skill > 1 ) Spawn( class 'UTChunk3',, '', Start + Y - Z, AdjustedAim); ClientFire(Value); GoToState('NormalFire'); */ } } } state AltFiring { ignores AnimEnd; function Projectile ProjectileFire(class ProjClass, float ProjSpeed, bool bWarn) { local Vector Start, X,Y,Z; Owner.MakeNoise(Pawn(Owner).SoundDampening); GetAxes(Pawn(owner).ViewRotation,X,Y,Z); Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn); Start = Start - Sin(Angle)*Y*4 + (Cos(Angle)*4 - 10.78)*Z; Angle += 1.8; return Spawn(ProjClass,,, Start,AdjustedAim); } function Tick( float DeltaTime ) { if (Owner==None) GotoState('Pickup'); } function BeginState() { Super.BeginState(); Angle = 0; AmbientGlow = 200; } function EndState() { PlaySpinDown(); AmbientSound = None; AmbientGlow = 0; OldFlashCount = FlashCount; Super.EndState(); } Begin: Sleep(0.18); Finish(); } function float RateSelf( out int bUseAltMode ) { local float EnemyDist, rating; local vector EnemyDir; if ( AmmoType.AmmoAmount <=0 ) return -2; if ( Pawn(Owner).Enemy == None ) { bUseAltMode = 0; return AIRating; } EnemyDir = Pawn(Owner).Enemy.Location - Owner.Location; EnemyDist = VSize(EnemyDir); rating = FClamp(AIRating - (EnemyDist - 450) * 0.001, 0.2, AIRating); if ( Pawn(Owner).Enemy.IsA('StationaryPawn') ) { bUseAltMode = 0; return AIRating + 0.3; } if ( EnemyDist > 900 ) { bUseAltMode = 0; if ( EnemyDist > 2000 ) { if ( EnemyDist > 3500 ) return 0.2; return (AIRating - 0.3); } if ( EnemyDir.Z < -0.5 * EnemyDist ) { bUseAltMode = 1; return (AIRating - 0.3); } } else if ( (EnemyDist < 750) && (Pawn(Owner).Enemy.Weapon != None) && Pawn (Owner).Enemy.Weapon.bMeleeWeapon ) { bUseAltMode = 0; return (AIRating + 0.3); } else if ( (EnemyDist < 340) || (EnemyDir.Z > 30) ) { bUseAltMode = 0; return (AIRating + 0.2); } else bUseAltMode = int( FRand() < 0.65 ); return rating; } defaultproperties { ProjectileClass=Class'Botpack.UTChunk' AltProjectileClass=Class'Botpack.flakslug' }