ijontichy

<stdin>

Apr 28th, 2014
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. //////
  2. ///
  3. // DECORATE
  4. ///
  5. /////
  6.  
  7.  
  8. actor OneshotBullet
  9. {
  10. +SERVERSIDEONLY
  11. +NOINTERACTION
  12. +NOTIMEFREEZE
  13.  
  14. Radius 1
  15. Height 1
  16.  
  17. Projectile
  18. Speed 20
  19.  
  20. States
  21. {
  22. Spawn:
  23. TNT1 A 0
  24. TNT1 A 0 A_SpawnItemEx("ActualOneshotBullet", 0,0,0, ACS_ExecuteWithResult(430, 2, 0) / 2.0, 0, ACS_ExecuteWithResult(430, 2, 1) / 2.0, 0)
  25. stop
  26. }
  27. }
  28.  
  29. actor ActualOneshotBullet: FastProjectile
  30. {
  31. Radius 1
  32. Height 1
  33.  
  34. Speed 32767
  35. Damage (random(1,3)*5)
  36.  
  37. +SERVERSIDEONLY
  38. +NOBLOCKMONST
  39. +PUFFGETSOWNER
  40. +NOTIMEFREEZE
  41. +MTHRUSPECIES
  42.  
  43. Decal BulletChip
  44.  
  45. Scale 0.5
  46.  
  47. States
  48. {
  49. Spawn:
  50. TNT1 A 1
  51. loop
  52.  
  53. XDeath:
  54. TNT1 A 8 A_SpawnItemEx("OneshotFakeBlood")
  55. stop
  56.  
  57. Crash:
  58. Death:
  59. TNT1 A 8 A_SpawnItemEx("BulletPuff", 0,0,0, 0,0,1)
  60. stop
  61. }
  62. }
  63.  
  64. actor OneshotFakeBlood: Blood
  65. {
  66. States
  67. {
  68. Spawn:
  69. BLUD A 0
  70. TNT1 A 0 A_Jump(256, 1, 2, 3)
  71. goto Super::Spawn
  72. TNT1 A 0
  73. goto Super::Spawn
  74. TNT1 A 0
  75. goto Super::Spawn+1
  76. TNT1 A 0
  77. goto Super::Spawn+2
  78. }
  79. }
  80.  
  81.  
  82.  
  83. /////
  84. ///
  85. // ACS
  86. ///
  87. /////
  88.  
  89. script ONESHOT_DECORATE (int which, int a1, int a2)
  90. {
  91. int ret = 0;
  92. int x, y, z, xymag, xyzmag;
  93.  
  94. switch (which)
  95. {
  96. case 2:
  97. x = GetActorVelX(0);
  98. y = GetActorVelY(0);
  99. z = GetActorVelZ(0);
  100. xymag = magnitudeTwo_f(x, y);
  101. xyzmag = magnitudeThree_f(x, y, z);
  102.  
  103. if (xyzmag == 0) { ret = 0; break; }
  104.  
  105. if (a1 == 1) // get sin(pitch)
  106. {
  107. ret = FixedDiv(z, xyzmag);
  108. }
  109. else // get cos(pitch)
  110. {
  111. ret = FixedDiv(xymag, xyzmag);
  112. }
  113.  
  114. ret = min(ret, 65535);
  115. break;
  116. }
  117.  
  118. SetResultValue(ret);
  119. }
Advertisement
Add Comment
Please, Sign In to add comment