Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
- */
- class UTVehicle_SManta extends UTHoverVehicle
- abstract;
- var(Movement) float JumpForceMag;
- var(Movement) float MaxJumpZVel;
- /** How far down to trace to check if we can jump */
- var(Movement) float JumpCheckTraceDist;
- var float JumpDelay, LastJumpTime;
- var(Movement) float DuckForceMag;
- var repnotify bool bDoBikeJump;
- var repnotify bool bHoldingDuck;
- var bool bPressingAltFire;
- var soundcue JumpSound;
- var soundcue DuckSound;
- var float BladeBlur, DesiredBladeBlur;
- /** if >= 0, index in VehicleEffects array for fan effect that gets its MantaFanSpin parameter set to BladeBlur */
- var int FanEffectIndex;
- /** parameter name for the fan blur, set to BladeBlur */
- var name FanEffectParameterName;
- /** Manta flame jet effect name**/
- var name FlameJetEffectParameterName;
- /** values for setting the FlameJet Particle System **/
- var float FlameJetValue, DesiredFlameJetValue;
- /** Suspension height when manta is being driven around normally */
- var(Movement) protected float FullWheelSuspensionTravel;
- /** Suspension height when manta is crouching */
- var(Movement) protected float CrouchedWheelSuspensionTravel;
- /** controls how fast to interpolate between various suspension heights */
- var(Movement) protected float SuspensionTravelAdjustSpeed;
- /** Suspension stiffness when manta is being driven around normally */
- var(Movement) protected float FullWheelSuspensionStiffness;
- /** Suspension stiffness when manta is crouching */
- var(Movement) protected float CrouchedWheelSuspensionStiffness;
- /** Adjustment for bone offset when changing suspension */
- var protected float BoneOffsetZAdjust;
- /** max speed while crouched */
- var(Movement) float CrouchedAirSpeed;
- replication
- {
- if ((!bNetOwner || bDemoRecording) && Role == ROLE_Authority)
- bDoBikeJump, bHoldingDuck;
- }
- simulated function PostBeginPlay()
- {
- Super.PostBeginPlay();
- SetMaxRadius(SoundNodeAttenuation(EngineSound.SoundCue.FirstNode));
- }
- /**
- * Are we allowing this Pawn to be based on us?
- */
- simulated function bool CanBeBaseForPawn(Pawn APawn)
- {
- return bCanBeBaseForPawns && !bDriving;
- }
- /** DriverEnter()
- Make Pawn P the new driver of this vehicle
- */
- function bool DriverEnter(Pawn P)
- {
- local Pawn BasedPawn;
- if ( super.DriverEnter(P) )
- {
- ForEach BasedActors(class'Pawn', BasedPawn)
- {
- if(BasedPawn != Driver)
- {
- BasedPawn.JumpOffPawn();
- }
- }
- return true;
- }
- return false;
- }
- simulated function bool OverrideBeginFire(byte FireModeNum)
- {
- if (FireModeNum == 1)
- {
- bPressingAltFire = true;
- return true;
- }
- return false;
- }
- simulated function bool OverrideEndFire(byte FireModeNum)
- {
- if (FireModeNum == 1)
- {
- bPressingAltFire = false;
- return true;
- }
- return false;
- }
- function PossessedBy(Controller C, bool bVehicleTransition)
- {
- super.PossessedBy(C, bVehicleTransition);
- // reset jump/duck properties
- bHoldingDuck = false;
- LastJumpTime = 0;
- bDoBikeJump = false;
- bPressingAltFire = false;
- }
- simulated event MantaJumpEffect();
- simulated event MantaDuckEffect();
- //========================================
- // AI Interface
- function byte ChooseFireMode()
- {
- local UTBot B;
- B = UTBot(Controller);
- if ( B != None
- && (B.Skill > 1.7 + FRand())
- && Pawn(Controller.Focus) != None
- && Vehicle(Controller.Focus) == None
- && Controller.MoveTarget == Controller.Focus
- && Controller.InLatentExecution(Controller.LATENT_MOVETOWARD)
- && VSize(Controller.FocalPoint - Location) < 800
- && Controller.LineOfSightTo(Controller.Focus) )
- {
- return 1;
- }
- return 0;
- }
- function bool Dodge(eDoubleClickDir DoubleClickMove)
- {
- Rise = 1;
- return true;
- }
- function IncomingMissile(Projectile P)
- {
- local UTBot B;
- B = UTBot(Controller);
- if (B != None && B.Skill > 4.0 + 4.0 * FRand() && VSize(P.Location - Location) < VSize(P.Velocity))
- {
- DriverLeave(false);
- }
- else
- {
- Super.IncomingMissile(P);
- }
- }
- // AI hint
- function bool FastVehicle()
- {
- return true;
- }
- simulated function DrivingStatusChanged()
- {
- bPressingAltFire = false;
- Super.DrivingStatusChanged();
- }
- simulated event ReplicatedEvent(name VarName)
- {
- if (VarName == 'bDoBikeJump')
- {
- MantaJumpEffect();
- }
- else if (VarName == 'bHoldingDuck')
- {
- MantaDuckEffect();
- }
- else
- {
- Super.ReplicatedEvent(VarName);
- }
- }
- simulated function float GetChargePower()
- {
- return FClamp( (WorldInfo.TimeSeconds - LastJumpTime), 0, JumpDelay)/JumpDelay;
- }
- simulated event RigidBodyCollision( PrimitiveComponent HitComponent, PrimitiveComponent OtherComponent,
- const out CollisionImpactData RigidCollisionData, int ContactIndex )
- {
- // only process rigid body collision if not hitting ground
- if ( Abs(RigidCollisionData.ContactInfos[0].ContactNormal.Z) < WalkableFloorZ )
- {
- super.RigidBodyCollision(HitComponent, OtherComponent, RigidCollisionData, ContactIndex);
- }
- }
- simulated function bool ShouldClamp()
- {
- return false;
- }
- function bool TooCloseToAttack(Actor Other)
- {
- local float OtherRadius, OtherHeight;
- if (Pawn(Other) != None && Vehicle(Other) == None)
- {
- return false;
- }
- else if (Super.TooCloseToAttack(Other))
- {
- return true;
- }
- else
- {
- Other.GetBoundingCylinder(OtherRadius, OtherHeight);
- return (VSize2D(Other.Location - Location) < OtherRadius + CylinderComponent.CollisionRadius + 150.0);
- }
- }
- function bool RecommendCharge(UTBot B, Pawn Enemy)
- {
- if ( B.Skill < 1 + FRand() )
- {
- return false;
- }
- if ( Vehicle(Enemy) == None )
- {
- return (VSize(Location - Enemy.Location) < 1000.0 + 3000.0*FRand());
- }
- return false;
- }
- defaultproperties
- {
- Health=200000
- MeleeRange=-100.0
- ExitRadius=160.0
- bTakeWaterDamageWhileDriving=false
- COMOffset=(x=0.0,y=0.0,z=0.0)
- UprightLiftStrength=30.0
- UprightTorqueStrength=30.0
- bCanFlip=true
- JumpForceMag=7000.0
- JumpDelay=1.0
- MaxJumpZVel=9000.0
- DuckForceMag=-350.0
- JumpCheckTraceDist=175.0
- FullWheelSuspensionTravel=145
- CrouchedWheelSuspensionTravel=100
- FullWheelSuspensionStiffness=20.0
- CrouchedWheelSuspensionStiffness=40.0
- SuspensionTravelAdjustSpeed=100
- BoneOffsetZAdjust=45.0
- CustomGravityScaling=0.8
- AirSpeed=1800.0
- GroundSpeed=1500.0
- CrouchedAirSpeed=1200.0
- FullAirSpeed=1800.0
- bCanCarryFlag=True
- bFollowLookDir=True
- bTurnInPlace=True
- bScriptedRise=True
- bCanStrafe=True
- ObjectiveGetOutDist=750.0
- MaxDesireability=0.6
- SpawnRadius=125.0
- MomentumMult=3.2
- bStayUpright=true
- StayUprightRollResistAngle=5.0
- StayUprightPitchResistAngle=5.0
- StayUprightStiffness=450
- StayUprightDamping=20
- bRagdollDriverOnDarkwalkerHorn=true
- Begin Object Class=UTVehicleSimHover Name=SimObject
- WheelSuspensionStiffness=20.0
- WheelSuspensionDamping=1.0
- WheelSuspensionBias=0.0
- MaxThrustForce=900.0
- MaxReverseForce=20.0
- LongDamping=0.3
- MaxStrafeForce=260.0
- DirectionChangeForce=375.0
- LatDamping=0.3
- MaxRiseForce=0.0
- UpDamping=0.0
- TurnTorqueFactor=2500.0
- TurnTorqueMax=1000.0
- TurnDamping=0.25
- MaxYawRate=100000.0
- PitchTorqueFactor=200.0
- PitchTorqueMax=18.0
- PitchDamping=0.1
- RollTorqueTurnFactor=1000.0
- RollTorqueStrafeFactor=110.0
- RollTorqueMax=500.0
- RollDamping=0.2
- MaxRandForce=20.0
- RandForceInterval=0.4
- bAllowZThrust=false
- End Object
- SimObj=SimObject
- Components.Add(SimObject)
- Begin Object Class=UTHoverWheel Name=RThruster
- BoneName="Engine"
- BoneOffset=(X=-50.0,Y=100.0,Z=-200.0)
- WheelRadius=10
- SuspensionTravel=145
- bPoweredWheel=false
- LongSlipFactor=0.0
- LatSlipFactor=0.0
- HandbrakeLongSlipFactor=0.0
- HandbrakeLatSlipFactor=0.0
- SteerFactor=1.0
- bHoverWheel=true
- End Object
- Wheels(0)=RThruster
- Begin Object Class=UTHoverWheel Name=LThruster
- BoneName="Engine"
- BoneOffset=(X=-50.0,Y=-100.0,Z=-200.0)
- WheelRadius=10
- SuspensionTravel=145
- bPoweredWheel=false
- LongSlipFactor=0.0
- LatSlipFactor=0.0
- HandbrakeLongSlipFactor=0.0
- HandbrakeLatSlipFactor=0.0
- SteerFactor=1.0
- bHoverWheel=true
- End Object
- Wheels(1)=LThruster
- Begin Object Class=UTHoverWheel Name=FThruster
- BoneName="Engine"
- BoneOffset=(X=80.0,Y=0.0,Z=-200.0)
- WheelRadius=10
- SuspensionTravel=145
- bPoweredWheel=false
- LongSlipFactor=0.0
- LatSlipFactor=0.0
- HandbrakeLongSlipFactor=0.0
- HandbrakeLatSlipFactor=0.0
- SteerFactor=1.0
- bHoverWheel=true
- End Object
- Wheels(2)=FThruster
- bAttachDriver=true
- bDriverIsVisible=true
- bHomingTarget=true
- BaseEyeheight=110
- Eyeheight=110
- bLightArmor=true
- DefaultFOV=90
- CameraLag=0.02
- bCanBeBaseForPawns=true
- bEjectKilledBodies=true
- HornIndex=0
- VehicleIndex=6
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement