//============================================================================= // SchlonzFlakCannon. //============================================================================= class SchlonzFlakCannon extends UT_FlakCannon; var int IntFireCounter; simulated event RenderTexture(ScriptedTexture Tex) { local Color C; local string Temp; if ( AmmoType != None ) Temp = String(AmmoType.AmmoAmount); while(Len(Temp) < 3) Temp = "0"$Temp; if ( AmmoType.AmmoAmount > 10 ) { C.R = 255; C.G = 255; C.B = 0; } else { C.R = 255; C.G = 0; C.B = 0; } Tex.DrawColoredText( 30, 10, Temp, Font'LEDFont2', C ); } // Fire chunks function Fire( float Value ) { local Vector Start, X,Y,Z; local Bot B; local Pawn P; if ( AmmoType == None ) { // ammocheck GiveAmmo(Pawn(Owner)); } 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(AltProjectileSpeed, 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; if ( B == None ) { Spawn( class 'SchlonzChunk1',, '', Start, AdjustedAim); Spawn( class 'SchlonzChunk2',, '', Start - Z, AdjustedAim); Spawn( class 'SchlonzChunk3',, '', Start + 2 * Y + Z, AdjustedAim); Spawn( class 'SchlonzChunk4',, '', Start - Y, AdjustedAim); Spawn( class 'SchlonzChunk1',, '', Start + 2 * Y - Z, AdjustedAim); Spawn( class 'SchlonzChunk2',, '', Start, AdjustedAim); Spawn( class 'SchlonzChunk3',, '', Start + Y - Z, AdjustedAim); Spawn( class 'SchlonzChunk4',, '', Start + 2 * Y + Z, AdjustedAim); Spawn( class 'SchlonzChunk1',, '', Start + Y - Z, AdjustedAim); Spawn( class 'SchlonzChunk2',, '', Start + 1.5 * Y - Z, AdjustedAim); Spawn( class 'SchlonzChunk3',, '', Start + 1.5 * Y - Z, AdjustedAim); Spawn( class 'SchlonzChunk4',, '', Start + 1.5 * Y - Z, AdjustedAim); Spawn( class 'SchlonzChunk1',, '', Start + 3 * Y , AdjustedAim); Spawn( class 'SchlonzChunk2',, '', Start + 3 * Z, AdjustedAim); Spawn( class 'SchlonzChunk3',, '', Start + 4 * Z, AdjustedAim); Spawn( class 'SchlonzChunk4',, '', Start + 5 * Y + Z, AdjustedAim); Spawn( class 'SchlonzChunk1',, '', Start + 2.5 * Y + Z, AdjustedAim); Spawn( class 'SchlonzChunk2',, '', Start + 2.5 * Z + Y, AdjustedAim); Spawn( class 'SchlonzChunk3',, '', Start + 2.1 * Z - Y, AdjustedAim); Spawn( class 'SchlonzChunk4',, '', Start + 1.9 * Y - Z, AdjustedAim); } else { 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); Spawn( class 'UTChunk3',, '', Start + Y - Z, AdjustedAim); } } ClientFire(Value); GoToState('NormalFire'); } } function AltFire( float Value ) { local Vector Start, X,Y,Z; if ( AmmoType == None ) { // ammocheck GiveAmmo(Pawn(Owner)); } if (AmmoType.UseAmmo(1)) { Pawn(Owner).PlayRecoil(FiringSpeed); bPointing=True; bCanClientFire = true; Owner.MakeNoise(Pawn(Owner).SoundDampening); GetAxes(Pawn(owner).ViewRotation,X,Y,Z); Start = Owner.Location + CalcDrawOffset(); Spawn(class'WeaponLight',,'',Start+X*20,rot(0,0,0)); Start = Start + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; AdjustedAim = pawn(owner).AdjustToss(AltProjectileSpeed, Start, AimError, True, bAltWarnTarget); Spawn(class'SchlonzFlakSlug',,, Start,AdjustedAim); ClientAltFire(Value); GoToState('AltFiring'); } } ///////////////////////////////////////////////////////////// simulated function PlayReloading() { PlayAnim('Loading',10.0, 0.01); Owner.PlayOwnedSound(CockingSound, SLOT_None,0.5*Pawn(Owner).SoundDampening); } simulated function PlayFastReloading() { PlayAnim('Loading',10.0, 0.01); Owner.PlayOwnedSound(CockingSound, SLOT_None,0.5*Pawn(Owner).SoundDampening); } /////////////////////////////////////////////////////////// simulated function TweenDown() { if ( IsAnimating() && (AnimSequence != '') && (GetAnimGroup(AnimSequence) == 'Select') ) TweenAnim( AnimSequence, AnimFrame * 0.1 ); else if ( AmmoType.AmmoAmount < 1 ) TweenAnim('Select', 0.01 ); else PlayAnim('Down',10.0, 0.01 ); } simulated function PlayPostSelect() { PlayAnim('Loading', 10.0, 0.01); Owner.PlayOwnedSound(Misc2Sound, SLOT_None,1.3*Pawn(Owner).SoundDampening); } defaultproperties { AmmoName=Class'SchlonzUT98.SchlonzFlakAmmo' PickupAmmoCount=25 ProjectileClass=Class'SchlonzUT98.SchlonzChunk' AltProjectileClass=Class'SchlonzUT98.SchlonzFlakslug' }