Guest User

UTVehicle_SManta

a guest
Nov 26th, 2015
26
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
  3. */
  4. class UTVehicle_SManta extends UTHoverVehicle
  5.  
  6. abstract;
  7.  
  8. var(Movement) float JumpForceMag;
  9.  
  10. var(Movement) float MaxJumpZVel;
  11.  
  12. /** How far down to trace to check if we can jump */
  13. var(Movement) float JumpCheckTraceDist;
  14.  
  15. var float JumpDelay, LastJumpTime;
  16.  
  17. var(Movement) float DuckForceMag;
  18.  
  19. var repnotify bool bDoBikeJump;
  20. var repnotify bool bHoldingDuck;
  21. var bool bPressingAltFire;
  22.  
  23. var soundcue JumpSound;
  24. var soundcue DuckSound;
  25.  
  26. var float BladeBlur, DesiredBladeBlur;
  27. /** if >= 0, index in VehicleEffects array for fan effect that gets its MantaFanSpin parameter set to BladeBlur */
  28. var int FanEffectIndex;
  29. /** parameter name for the fan blur, set to BladeBlur */
  30. var name FanEffectParameterName;
  31.  
  32. /** Manta flame jet effect name**/
  33. var name FlameJetEffectParameterName;
  34. /** values for setting the FlameJet Particle System **/
  35. var float FlameJetValue, DesiredFlameJetValue;
  36.  
  37. /** Suspension height when manta is being driven around normally */
  38. var(Movement) protected float FullWheelSuspensionTravel;
  39.  
  40. /** Suspension height when manta is crouching */
  41. var(Movement) protected float CrouchedWheelSuspensionTravel;
  42.  
  43. /** controls how fast to interpolate between various suspension heights */
  44. var(Movement) protected float SuspensionTravelAdjustSpeed;
  45.  
  46. /** Suspension stiffness when manta is being driven around normally */
  47. var(Movement) protected float FullWheelSuspensionStiffness;
  48.  
  49. /** Suspension stiffness when manta is crouching */
  50. var(Movement) protected float CrouchedWheelSuspensionStiffness;
  51.  
  52. /** Adjustment for bone offset when changing suspension */
  53. var protected float BoneOffsetZAdjust;
  54.  
  55. /** max speed while crouched */
  56. var(Movement) float CrouchedAirSpeed;
  57.  
  58.  
  59.  
  60. replication
  61. {
  62. if ((!bNetOwner || bDemoRecording) && Role == ROLE_Authority)
  63. bDoBikeJump, bHoldingDuck;
  64. }
  65.  
  66. simulated function PostBeginPlay()
  67. {
  68. Super.PostBeginPlay();
  69. SetMaxRadius(SoundNodeAttenuation(EngineSound.SoundCue.FirstNode));
  70. }
  71.  
  72. /**
  73. * Are we allowing this Pawn to be based on us?
  74. */
  75. simulated function bool CanBeBaseForPawn(Pawn APawn)
  76. {
  77. return bCanBeBaseForPawns && !bDriving;
  78. }
  79.  
  80. /** DriverEnter()
  81. Make Pawn P the new driver of this vehicle
  82. */
  83. function bool DriverEnter(Pawn P)
  84. {
  85. local Pawn BasedPawn;
  86.  
  87. if ( super.DriverEnter(P) )
  88. {
  89. ForEach BasedActors(class'Pawn', BasedPawn)
  90. {
  91. if(BasedPawn != Driver)
  92. {
  93. BasedPawn.JumpOffPawn();
  94. }
  95. }
  96. return true;
  97. }
  98. return false;
  99. }
  100.  
  101. simulated function bool OverrideBeginFire(byte FireModeNum)
  102. {
  103. if (FireModeNum == 1)
  104. {
  105. bPressingAltFire = true;
  106. return true;
  107. }
  108.  
  109. return false;
  110. }
  111.  
  112. simulated function bool OverrideEndFire(byte FireModeNum)
  113. {
  114. if (FireModeNum == 1)
  115. {
  116. bPressingAltFire = false;
  117. return true;
  118. }
  119.  
  120. return false;
  121. }
  122.  
  123. function PossessedBy(Controller C, bool bVehicleTransition)
  124. {
  125. super.PossessedBy(C, bVehicleTransition);
  126.  
  127. // reset jump/duck properties
  128. bHoldingDuck = false;
  129. LastJumpTime = 0;
  130. bDoBikeJump = false;
  131. bPressingAltFire = false;
  132. }
  133.  
  134. simulated event MantaJumpEffect();
  135.  
  136. simulated event MantaDuckEffect();
  137.  
  138. //========================================
  139. // AI Interface
  140.  
  141. function byte ChooseFireMode()
  142. {
  143. local UTBot B;
  144.  
  145. B = UTBot(Controller);
  146. if ( B != None
  147. && (B.Skill > 1.7 + FRand())
  148. && Pawn(Controller.Focus) != None
  149. && Vehicle(Controller.Focus) == None
  150. && Controller.MoveTarget == Controller.Focus
  151. && Controller.InLatentExecution(Controller.LATENT_MOVETOWARD)
  152. && VSize(Controller.FocalPoint - Location) < 800
  153. && Controller.LineOfSightTo(Controller.Focus) )
  154. {
  155. return 1;
  156. }
  157.  
  158. return 0;
  159. }
  160.  
  161. function bool Dodge(eDoubleClickDir DoubleClickMove)
  162. {
  163. Rise = 1;
  164. return true;
  165. }
  166.  
  167. function IncomingMissile(Projectile P)
  168. {
  169. local UTBot B;
  170.  
  171. B = UTBot(Controller);
  172. if (B != None && B.Skill > 4.0 + 4.0 * FRand() && VSize(P.Location - Location) < VSize(P.Velocity))
  173. {
  174. DriverLeave(false);
  175. }
  176. else
  177. {
  178. Super.IncomingMissile(P);
  179. }
  180. }
  181.  
  182. // AI hint
  183. function bool FastVehicle()
  184. {
  185. return true;
  186. }
  187.  
  188. simulated function DrivingStatusChanged()
  189. {
  190. bPressingAltFire = false;
  191.  
  192. Super.DrivingStatusChanged();
  193. }
  194.  
  195. simulated event ReplicatedEvent(name VarName)
  196. {
  197. if (VarName == 'bDoBikeJump')
  198. {
  199. MantaJumpEffect();
  200. }
  201. else if (VarName == 'bHoldingDuck')
  202. {
  203. MantaDuckEffect();
  204. }
  205. else
  206. {
  207. Super.ReplicatedEvent(VarName);
  208. }
  209. }
  210.  
  211. simulated function float GetChargePower()
  212. {
  213. return FClamp( (WorldInfo.TimeSeconds - LastJumpTime), 0, JumpDelay)/JumpDelay;
  214. }
  215.  
  216. simulated event RigidBodyCollision( PrimitiveComponent HitComponent, PrimitiveComponent OtherComponent,
  217. const out CollisionImpactData RigidCollisionData, int ContactIndex )
  218. {
  219. // only process rigid body collision if not hitting ground
  220. if ( Abs(RigidCollisionData.ContactInfos[0].ContactNormal.Z) < WalkableFloorZ )
  221. {
  222. super.RigidBodyCollision(HitComponent, OtherComponent, RigidCollisionData, ContactIndex);
  223. }
  224. }
  225.  
  226. simulated function bool ShouldClamp()
  227. {
  228. return false;
  229. }
  230.  
  231. function bool TooCloseToAttack(Actor Other)
  232. {
  233. local float OtherRadius, OtherHeight;
  234.  
  235. if (Pawn(Other) != None && Vehicle(Other) == None)
  236. {
  237. return false;
  238. }
  239. else if (Super.TooCloseToAttack(Other))
  240. {
  241. return true;
  242. }
  243. else
  244. {
  245. Other.GetBoundingCylinder(OtherRadius, OtherHeight);
  246. return (VSize2D(Other.Location - Location) < OtherRadius + CylinderComponent.CollisionRadius + 150.0);
  247. }
  248. }
  249.  
  250. function bool RecommendCharge(UTBot B, Pawn Enemy)
  251. {
  252. if ( B.Skill < 1 + FRand() )
  253. {
  254. return false;
  255. }
  256. if ( Vehicle(Enemy) == None )
  257. {
  258. return (VSize(Location - Enemy.Location) < 1000.0 + 3000.0*FRand());
  259. }
  260. return false;
  261. }
  262.  
  263. defaultproperties
  264. {
  265. Health=200000
  266. MeleeRange=-100.0
  267. ExitRadius=160.0
  268. bTakeWaterDamageWhileDriving=false
  269.  
  270. COMOffset=(x=0.0,y=0.0,z=0.0)
  271. UprightLiftStrength=30.0
  272. UprightTorqueStrength=30.0
  273. bCanFlip=true
  274. JumpForceMag=7000.0
  275. JumpDelay=1.0
  276. MaxJumpZVel=9000.0
  277. DuckForceMag=-350.0
  278. JumpCheckTraceDist=175.0
  279. FullWheelSuspensionTravel=145
  280. CrouchedWheelSuspensionTravel=100
  281. FullWheelSuspensionStiffness=20.0
  282. CrouchedWheelSuspensionStiffness=40.0
  283. SuspensionTravelAdjustSpeed=100
  284. BoneOffsetZAdjust=45.0
  285. CustomGravityScaling=0.8
  286.  
  287. AirSpeed=1800.0
  288. GroundSpeed=1500.0
  289. CrouchedAirSpeed=1200.0
  290. FullAirSpeed=1800.0
  291. bCanCarryFlag=True
  292. bFollowLookDir=True
  293. bTurnInPlace=True
  294. bScriptedRise=True
  295. bCanStrafe=True
  296. ObjectiveGetOutDist=750.0
  297. MaxDesireability=0.6
  298. SpawnRadius=125.0
  299. MomentumMult=3.2
  300.  
  301. bStayUpright=true
  302. StayUprightRollResistAngle=5.0
  303. StayUprightPitchResistAngle=5.0
  304. StayUprightStiffness=450
  305. StayUprightDamping=20
  306.  
  307. bRagdollDriverOnDarkwalkerHorn=true
  308.  
  309. Begin Object Class=UTVehicleSimHover Name=SimObject
  310. WheelSuspensionStiffness=20.0
  311. WheelSuspensionDamping=1.0
  312. WheelSuspensionBias=0.0
  313. MaxThrustForce=900.0
  314. MaxReverseForce=20.0
  315. LongDamping=0.3
  316. MaxStrafeForce=260.0
  317. DirectionChangeForce=375.0
  318. LatDamping=0.3
  319. MaxRiseForce=0.0
  320. UpDamping=0.0
  321. TurnTorqueFactor=2500.0
  322. TurnTorqueMax=1000.0
  323. TurnDamping=0.25
  324. MaxYawRate=100000.0
  325. PitchTorqueFactor=200.0
  326. PitchTorqueMax=18.0
  327. PitchDamping=0.1
  328. RollTorqueTurnFactor=1000.0
  329. RollTorqueStrafeFactor=110.0
  330. RollTorqueMax=500.0
  331. RollDamping=0.2
  332. MaxRandForce=20.0
  333. RandForceInterval=0.4
  334. bAllowZThrust=false
  335. End Object
  336. SimObj=SimObject
  337. Components.Add(SimObject)
  338.  
  339. Begin Object Class=UTHoverWheel Name=RThruster
  340. BoneName="Engine"
  341. BoneOffset=(X=-50.0,Y=100.0,Z=-200.0)
  342. WheelRadius=10
  343. SuspensionTravel=145
  344. bPoweredWheel=false
  345. LongSlipFactor=0.0
  346. LatSlipFactor=0.0
  347. HandbrakeLongSlipFactor=0.0
  348. HandbrakeLatSlipFactor=0.0
  349. SteerFactor=1.0
  350. bHoverWheel=true
  351. End Object
  352. Wheels(0)=RThruster
  353.  
  354. Begin Object Class=UTHoverWheel Name=LThruster
  355. BoneName="Engine"
  356. BoneOffset=(X=-50.0,Y=-100.0,Z=-200.0)
  357. WheelRadius=10
  358. SuspensionTravel=145
  359. bPoweredWheel=false
  360. LongSlipFactor=0.0
  361. LatSlipFactor=0.0
  362. HandbrakeLongSlipFactor=0.0
  363. HandbrakeLatSlipFactor=0.0
  364. SteerFactor=1.0
  365. bHoverWheel=true
  366. End Object
  367. Wheels(1)=LThruster
  368.  
  369. Begin Object Class=UTHoverWheel Name=FThruster
  370. BoneName="Engine"
  371. BoneOffset=(X=80.0,Y=0.0,Z=-200.0)
  372. WheelRadius=10
  373. SuspensionTravel=145
  374. bPoweredWheel=false
  375. LongSlipFactor=0.0
  376. LatSlipFactor=0.0
  377. HandbrakeLongSlipFactor=0.0
  378. HandbrakeLatSlipFactor=0.0
  379. SteerFactor=1.0
  380. bHoverWheel=true
  381. End Object
  382. Wheels(2)=FThruster
  383.  
  384. bAttachDriver=true
  385. bDriverIsVisible=true
  386.  
  387. bHomingTarget=true
  388.  
  389. BaseEyeheight=110
  390. Eyeheight=110
  391.  
  392. bLightArmor=true
  393. DefaultFOV=90
  394. CameraLag=0.02
  395. bCanBeBaseForPawns=true
  396. bEjectKilledBodies=true
  397.  
  398. HornIndex=0
  399. VehicleIndex=6
  400. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×