Guest User

Untitled

a guest
Jan 4th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.46 KB | None | 0 0
  1.  
  2. class Disc expands Weapon;
  3.  
  4. var() float SDamage;
  5. var() float SBackDamage;
  6. var() float SDecapitateDamage;
  7. function float RateSelf( out int bUseAltMode )
  8. {
  9. local float EnemyDist;
  10. local bool bRetreating;
  11. local vector EnemyDir;
  12.  
  13. if ( Pawn(Owner).Enemy == None )
  14. {
  15. bUseAltMode = 0;
  16. return AIRating;
  17. }
  18.  
  19. if ( ( vsize(pawn(owner).location-Pawn(Owner).Enemy.Location) > (pawn(owner).collisionradius+Pawn(Owner).Enemy.collisionradius+350) ) )
  20. {
  21. bUseAltMode = 0;
  22. return 0;
  23. }
  24.  
  25. if ( ( vsize(pawn(owner).location-Pawn(Owner).Enemy.Location) < (pawn(owner).collisionradius+Pawn(Owner).Enemy.collisionradius+48) ) )
  26. {
  27. bUseAltMode = 0;
  28. return 0.8;
  29. }
  30.  
  31. if ( ( vsize(pawn(owner).location-Pawn(Owner).Enemy.Location) < (pawn(owner).collisionradius+Pawn(Owner).Enemy.collisionradius+350) ) )
  32. {
  33. bUseAltMode = 1;
  34. return 0.8;
  35. }
  36. bUseAltMode = 0;
  37. return 0.8;
  38. }
  39.  
  40. function Fire( float Value )
  41. {
  42.  
  43. if (owner.isa('playerpawn')) Owner.PlaySound(FireSound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
  44. GotoState('NormalFire');
  45. if ( PlayerPawn(Owner) != None )
  46. PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
  47. bPointing=True;
  48. PlayFiring();
  49. if ( !bRapidFire && (FiringSpeed > 0) )
  50. Pawn(Owner).PlayRecoil(FiringSpeed);
  51. if ( bInstantHit )
  52. TraceFire(0.0);
  53. else
  54. ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);
  55. if ( Owner.bHidden )
  56. CheckVisibility();
  57.  
  58. }
  59.  
  60. function AltFire( float Value )
  61. {
  62. ProjectileFire(altProjectileClass, ProjectileSpeed, bWarnTarget);
  63. Owner.PlaySound(FireSound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
  64. destroy();
  65. GoToState('AltFiring');
  66. }
  67.  
  68. function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
  69. {
  70. local Vector Start, X,Y,Z;
  71. local Pawn PawnOwner;
  72.  
  73. PawnOwner = Pawn(Owner);
  74.  
  75. GetAxes(PawnOwner.ViewRotation,X,Y,Z);
  76. Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
  77. AdjustedAim = PawnOwner.AdjustAim(ProjSpeed, Start, AimError, True, bWarn);
  78. return Spawn(ProjClass,,, Start,AdjustedAim);
  79. }
  80.  
  81. function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
  82. {
  83. local DiscSpark Ds;
  84. local Ghost bro;
  85. local float i;
  86.  
  87. if ( PlayerPawn(Owner) != None )
  88. {
  89. PlayerPawn(Owner).ClientInstantFlash( -0.4, vect(650, 450, 190));
  90. if ( PlayerPawn(Owner).DesiredFOV == PlayerPawn(Owner).DefaultFOV )
  91. bMuzzleFlash++;
  92. }
  93.  
  94.  
  95.  
  96.  
  97. if ( Other.IsA('Pawn') && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight) && ( vsize(pawn(owner).location-hitlocation) < 85))
  98. {
  99. Other.TakeDamage(SDecapitateDamage, Pawn(Owner), HitLocation, 35000 * X, 'decapitated');
  100. Owner.PlaySound(Misc3Sound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
  101. }
  102.  
  103. if ( Other.IsA('Pawn') && (HitLocation.Z - Other.Location.Z <= 0.62 * Other.CollisionHeight) && ( vsize(pawn(owner).location-hitlocation) < 85))
  104. {
  105. i=other.rotation.yaw;
  106.  
  107.  
  108. bro = Spawn(class'Ghost',,, other.location, other.rotation);
  109. if (!bro.CanSee(instigator))
  110. {
  111. Other.TakeDamage(SBackDamage, Pawn(Owner), HitLocation, 35000*X, 'shot');
  112. }
  113. else Other.TakeDamage(sdamage, Pawn(Owner), HitLocation, 30000.0*X, 'shot');
  114.  
  115. Pawn(other).PlaySound(Misc3Sound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
  116. }
  117.  
  118.  
  119. if ( !Other.IsA('Pawn') && (Other!=level) && vsize(pawn(owner).location-hitlocation) < 85)
  120.  
  121. Other.TakeDamage(sdamage, Pawn(Owner), HitLocation, 30000.0*X, 'shot');
  122.  
  123.  
  124. if ((Other == Level) && ( vsize(pawn(owner).location-hitlocation) < (pawn(owner).collisionradius*4 )))
  125. {
  126. Owner.PlaySound(Misc2Sound, SLOT_None,Pawn(Owner).SoundDampening*3.0,,,0.9 + 0.2 * FRand());
  127. Ds=spawn(class'DiscSpark',,,HitLocation+HitNormal*9);
  128. }
  129.  
  130. }
  131.  
  132.  
  133.  
  134. state NormalFire
  135. {
  136. Begin:
  137.  
  138. Sleep(0.5);
  139. Finish();
  140. }
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. state AltFiring
  148. {
  149. Begin:
  150.  
  151. Sleep(1.0);
  152. Finish();
  153. }
  154.  
  155. state Active
  156. {
  157. function Fire(float F)
  158. {
  159. }
  160.  
  161. function AltFire(float F)
  162. {
  163. }
  164.  
  165. function bool PutDown()
  166. {
  167. if ( bWeaponUp || (AnimFrame < 0.75) )
  168. GotoState('DownWeapon');
  169. else
  170. bChangeWeapon = true;
  171. return True;
  172. }
  173.  
  174. function BeginState()
  175. {
  176. bChangeWeapon = false;
  177. }
  178.  
  179. Begin:
  180. Sleep(0.5);
  181. FinishAnim();
  182. if ( bChangeWeapon )
  183. GotoState('DownWeapon');
  184. bWeaponUp = True;
  185. PlayPostSelect();
  186. FinishAnim();
  187. Finish();
  188. }
  189.  
  190. ----------------------------------------------------------------------------------------------------------------
  191.  
  192. class DiscProjectile expands Projectile;
  193. var rotator GuidedRotation;
  194.  
  195. var bool bLighting;
  196. var float DelayTime;
  197. var() float sDamage;
  198. var() float sDecapitateDamage;
  199. var() float sBackDamage;
  200.  
  201. ////////////////////////Where's waldo?////////////////////////////
  202.  
  203. simulated function PostBeginPlay()
  204. {
  205. Super.PostBeginPlay();
  206. GuidedRotation = Rotation;
  207. }
  208.  
  209. auto state Flying
  210. {
  211. simulated function Tick(float DeltaTime)
  212. {
  213. Guidedrotation.Roll=Guidedrotation.Roll-400 ;
  214. SetRotation(Guidedrotation);
  215. }
  216.  
  217. simulated function ProcessTouch( Actor Other, Vector HitLocation )
  218. {
  219. local int hitdamage;
  220. local vector hitDir;
  221. local Disc Dc;
  222. local float i;
  223. local Ghost bro;
  224.  
  225. if (Other != instigator && StingerProjectile(Other) == none)
  226. {
  227. if ( Role == ROLE_Authority )
  228. {
  229. hitDir = Normal(Velocity);
  230. if ( FRand() < 0.2 )
  231. hitDir *= 5;
  232.  
  233.  
  234. i=other.rotation.yaw;
  235.  
  236. if (other.isa('pawn'))
  237. {
  238. bro = Spawn(class'Ghost',,, other.location, other.rotation);
  239. if (!bro.CanSee(instigator)) Other.TakeDamage(sbackdamage, instigator,HitLocation,(MomentumTransfer * hitDir), 'shot');
  240. else Other.TakeDamage(sdamage, instigator,HitLocation,(MomentumTransfer * hitDir), 'shot');
  241. }
  242. else Other.TakeDamage(sdamage, instigator,HitLocation,(MomentumTransfer * hitDir), 'shot');
  243.  
  244.  
  245. PlaySound(MiscSound, SLOT_Misc, 0.5,,, 0.5+FRand());
  246. }
  247. Dc=spawn(class'Disc',,, location, rotation);
  248. Destroy();
  249. }
  250. }
  251.  
  252. simulated function HitWall( vector HitNormal, actor Wall )
  253. {
  254. local Disc Dc;
  255. local DiscSpark Ds;
  256. Ds=spawn(class'DiscSpark');
  257. Dc=spawn(class'Disc',,, location, rotation);
  258.  
  259.  
  260. Super.HitWall(HitNormal, Wall);
  261. PlaySound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand());
  262.  
  263.  
  264. MakeNoise(0.3);
  265. SetPhysics(PHYS_None);
  266. SetCollision(false,false,false);
  267. RemoteRole = ROLE_None;
  268. Destroy();
  269. }
  270. ///////////////////////////////
  271. simulated function Timer()
  272. {
  273. local bubble1 b;
  274. if (Level.NetMode!=NM_DedicatedServer)
  275. {
  276. b=spawn(class'Bubble1');
  277. b.DrawScale= 0.1 + FRand()*0.2;
  278. b.SetLocation(Location+FRand()*vect(2,0,0)+FRand()*Vect(0,2,0)+FRand()*Vect(0,0,2));
  279. b.buoyancy = b.mass+(FRand()*0.4+0.1);
  280. }
  281. DelayTime+=FRand()*0.1+0.1;
  282. SetTimer(DelayTime,False);
  283. }
  284.  
  285. simulated function ZoneChange( Zoneinfo NewZone )
  286. {
  287. if (NewZone.bWaterZone)
  288. {
  289. Velocity=0.7*Velocity;
  290. DelayTime=0.03;
  291. SetTimer(DelayTime,False);
  292. }
  293. }
  294.  
  295. function BeginState()
  296. {
  297. local rotator RandRot;
  298.  
  299. Velocity = Vector(Rotation) * speed;
  300. // RandRot.Pitch = FRand() * 200 - 100;
  301. // RandRot.Yaw = FRand() * 200 - 100;
  302. // RandRot.Roll = FRand() * 200 - 100;
  303. Velocity = Velocity >> RandRot;
  304. if( Region.zone.bWaterZone )
  305. Velocity=0.5*Velocity;
  306. }
  307. }
  308.  
  309. ///////////////////////////////////////////////////////
  310. simulated function Explode(vector HitLocation, vector HitNormal)
  311. {
  312. }
  313.  
  314. simulated function AnimEnd()
  315. {
  316. Destroy();
  317. }
Add Comment
Please, Sign In to add comment