Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Disc expands Weapon;
- var() float SDamage;
- var() float SBackDamage;
- var() float SDecapitateDamage;
- function float RateSelf( out int bUseAltMode )
- {
- local float EnemyDist;
- local bool bRetreating;
- local vector EnemyDir;
- if ( Pawn(Owner).Enemy == None )
- {
- bUseAltMode = 0;
- return AIRating;
- }
- if ( ( vsize(pawn(owner).location-Pawn(Owner).Enemy.Location) > (pawn(owner).collisionradius+Pawn(Owner).Enemy.collisionradius+350) ) )
- {
- bUseAltMode = 0;
- return 0;
- }
- if ( ( vsize(pawn(owner).location-Pawn(Owner).Enemy.Location) < (pawn(owner).collisionradius+Pawn(Owner).Enemy.collisionradius+48) ) )
- {
- bUseAltMode = 0;
- return 0.8;
- }
- if ( ( vsize(pawn(owner).location-Pawn(Owner).Enemy.Location) < (pawn(owner).collisionradius+Pawn(Owner).Enemy.collisionradius+350) ) )
- {
- bUseAltMode = 1;
- return 0.8;
- }
- bUseAltMode = 0;
- return 0.8;
- }
- function Fire( float Value )
- {
- if (owner.isa('playerpawn')) Owner.PlaySound(FireSound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
- GotoState('NormalFire');
- if ( PlayerPawn(Owner) != None )
- PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
- bPointing=True;
- PlayFiring();
- if ( !bRapidFire && (FiringSpeed > 0) )
- Pawn(Owner).PlayRecoil(FiringSpeed);
- if ( bInstantHit )
- TraceFire(0.0);
- else
- ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);
- if ( Owner.bHidden )
- CheckVisibility();
- }
- function AltFire( float Value )
- {
- ProjectileFire(altProjectileClass, ProjectileSpeed, bWarnTarget);
- Owner.PlaySound(FireSound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
- destroy();
- GoToState('AltFiring');
- }
- function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
- {
- local Vector Start, X,Y,Z;
- local Pawn PawnOwner;
- PawnOwner = Pawn(Owner);
- GetAxes(PawnOwner.ViewRotation,X,Y,Z);
- Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
- AdjustedAim = PawnOwner.AdjustAim(ProjSpeed, Start, AimError, True, bWarn);
- return Spawn(ProjClass,,, Start,AdjustedAim);
- }
- function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
- {
- local DiscSpark Ds;
- local Ghost bro;
- local float i;
- if ( PlayerPawn(Owner) != None )
- {
- PlayerPawn(Owner).ClientInstantFlash( -0.4, vect(650, 450, 190));
- if ( PlayerPawn(Owner).DesiredFOV == PlayerPawn(Owner).DefaultFOV )
- bMuzzleFlash++;
- }
- if ( Other.IsA('Pawn') && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight) && ( vsize(pawn(owner).location-hitlocation) < 85))
- {
- Other.TakeDamage(SDecapitateDamage, Pawn(Owner), HitLocation, 35000 * X, 'decapitated');
- Owner.PlaySound(Misc3Sound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
- }
- if ( Other.IsA('Pawn') && (HitLocation.Z - Other.Location.Z <= 0.62 * Other.CollisionHeight) && ( vsize(pawn(owner).location-hitlocation) < 85))
- {
- i=other.rotation.yaw;
- bro = Spawn(class'Ghost',,, other.location, other.rotation);
- if (!bro.CanSee(instigator))
- {
- Other.TakeDamage(SBackDamage, Pawn(Owner), HitLocation, 35000*X, 'shot');
- }
- else Other.TakeDamage(sdamage, Pawn(Owner), HitLocation, 30000.0*X, 'shot');
- Pawn(other).PlaySound(Misc3Sound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
- }
- if ( !Other.IsA('Pawn') && (Other!=level) && vsize(pawn(owner).location-hitlocation) < 85)
- Other.TakeDamage(sdamage, Pawn(Owner), HitLocation, 30000.0*X, 'shot');
- if ((Other == Level) && ( vsize(pawn(owner).location-hitlocation) < (pawn(owner).collisionradius*4 )))
- {
- Owner.PlaySound(Misc2Sound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
- Ds=spawn(class'DiscSpark',,,HitLocation+HitNormal*9);
- }
- }
- state NormalFire
- {
- Begin:
- Sleep(0.5);
- Finish();
- }
- state AltFiring
- {
- Begin:
- Sleep(1.0);
- Finish();
- }
- state Active
- {
- function Fire(float F)
- {
- }
- function AltFire(float F)
- {
- }
- function bool PutDown()
- {
- if ( bWeaponUp || (AnimFrame < 0.75) )
- GotoState('DownWeapon');
- else
- bChangeWeapon = true;
- return True;
- }
- function BeginState()
- {
- bChangeWeapon = false;
- }
- Begin:
- Sleep(0.5);
- FinishAnim();
- if ( bChangeWeapon )
- GotoState('DownWeapon');
- bWeaponUp = True;
- PlayPostSelect();
- FinishAnim();
- Finish();
- }
- ----------------------------------------------------------------------------------------------------------------
- class DiscProjectile expands Projectile;
- var rotator GuidedRotation;
- var bool bLighting;
- var float DelayTime;
- var() float sDamage;
- var() float sDecapitateDamage;
- var() float sBackDamage;
- ////////////////////////Where's waldo?////////////////////////////
- simulated function PostBeginPlay()
- {
- Super.PostBeginPlay();
- GuidedRotation = Rotation;
- }
- auto state Flying
- {
- simulated function Tick(float DeltaTime)
- {
- Guidedrotation.Roll=Guidedrotation.Roll-400 ;
- SetRotation(Guidedrotation);
- }
- simulated function ProcessTouch( Actor Other, Vector HitLocation )
- {
- local int hitdamage;
- local vector hitDir;
- local Disc Dc;
- local float i;
- local Ghost bro;
- if (Other != instigator && StingerProjectile(Other) == none)
- {
- if ( Role == ROLE_Authority )
- {
- hitDir = Normal(Velocity);
- if ( FRand() < 0.2 )
- hitDir *= 5;
- i=other.rotation.yaw;
- if (other.isa('pawn'))
- {
- bro = Spawn(class'Ghost',,, other.location, other.rotation);
- if (!bro.CanSee(instigator)) Other.TakeDamage(sbackdamage, instigator,HitLocation,(MomentumTransfer * hitDir), 'shot');
- else Other.TakeDamage(sdamage, instigator,HitLocation,(MomentumTransfer * hitDir), 'shot');
- }
- else Other.TakeDamage(sdamage, instigator,HitLocation,(MomentumTransfer * hitDir), 'shot');
- PlaySound(MiscSound, SLOT_Misc, 0.5,,, 0.5+FRand());
- }
- Dc=spawn(class'Disc',,, location, rotation);
- Destroy();
- }
- }
- simulated function HitWall( vector HitNormal, actor Wall )
- {
- local Disc Dc;
- local DiscSpark Ds;
- Ds=spawn(class'DiscSpark');
- Dc=spawn(class'Disc',,, location, rotation);
- Super.HitWall(HitNormal, Wall);
- PlaySound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand());
- MakeNoise(0.3);
- SetPhysics(PHYS_None);
- SetCollision(false,false,false);
- RemoteRole = ROLE_None;
- Destroy();
- }
- ///////////////////////////////
- simulated function Timer()
- {
- local bubble1 b;
- if (Level.NetMode!=NM_DedicatedServer)
- {
- b=spawn(class'Bubble1');
- b.DrawScale= 0.1 + FRand()*0.2;
- b.SetLocation(Location+FRand()*vect(2,0,0)+FRand()*Vect(0,2,0)+FRand()*Vect(0,0,2));
- b.buoyancy = b.mass+(FRand()*0.4+0.1);
- }
- DelayTime+=FRand()*0.1+0.1;
- SetTimer(DelayTime,False);
- }
- simulated function ZoneChange( Zoneinfo NewZone )
- {
- if (NewZone.bWaterZone)
- {
- Velocity=0.7*Velocity;
- DelayTime=0.03;
- SetTimer(DelayTime,False);
- }
- }
- function BeginState()
- {
- local rotator RandRot;
- Velocity = Vector(Rotation) * speed;
- // RandRot.Pitch = FRand() * 200 - 100;
- // RandRot.Yaw = FRand() * 200 - 100;
- // RandRot.Roll = FRand() * 200 - 100;
- Velocity = Velocity >> RandRot;
- if( Region.zone.bWaterZone )
- Velocity=0.5*Velocity;
- }
- }
- ///////////////////////////////////////////////////////
- simulated function Explode(vector HitLocation, vector HitNormal)
- {
- }
- simulated function AnimEnd()
- {
- Destroy();
- }
Add Comment
Please, Sign In to add comment