Advertisement
Guest User

Untitled

a guest
May 24th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. using System;
  2.  
  3. using Microsoft.Xna.Framework;
  4.  
  5. using Terraria;
  6.  
  7. using Terraria.ModLoader;
  8.  
  9.  
  10.  
  11. namespace CMS.Projectiles
  12.  
  13. {
  14.  
  15. public class TheVows : ModProjectile
  16.  
  17. {
  18.  
  19. public int delay = 20;
  20.  
  21. public override void SetDefaults()
  22.  
  23. {
  24.  
  25. delay = 10;
  26.  
  27. projectile.width = 24;
  28.  
  29. projectile.height = 24;
  30.  
  31. projectile.friendly = true;
  32.  
  33. projectile.aiStyle = 0;
  34.  
  35. projectile.thrown = true;
  36.  
  37. projectile.penetrate = -1;
  38.  
  39. projectile.extraUpdates = 1;
  40.  
  41. aiType = 48;
  42.  
  43. }
  44.  
  45.  
  46.  
  47. public override void AI()
  48.  
  49. {
  50.  
  51.  
  52.  
  53. projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
  54. projectile.velocity.Y += projectile.ai[0];
  55. if (Main.rand.Next(3) == 0)
  56. {
  57. Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("RedSparkle"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
  58. }
  59.  
  60. }
  61.  
  62.  
  63.  
  64. public override bool OnTileCollide(Vector2 oldVelocity)
  65.  
  66. {
  67.  
  68. {
  69.  
  70. projectile.Kill();
  71.  
  72.  
  73.  
  74. Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 10);
  75.  
  76. }
  77.  
  78. return false;
  79.  
  80. }
  81.  
  82. }
  83.  
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement