Advertisement
Guest User

Untitled

a guest
Feb 15th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. using System;
  2. using Microsoft.Xna.Framework;
  3. using Microsoft.Xna.Framework.Graphics;
  4.  
  5. using TAPI;
  6. using Terraria;
  7.  
  8. namespace HaloMod.Projectiles
  9. {
  10. public class FuelRod : ModProjectile
  11. {
  12. public override void AI()
  13. {
  14. projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
  15. int DustID = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 19, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 0.6f);
  16. projectile.light = 0.9f;
  17. }
  18. public override bool OnTileCollide(ref Vector2 velocityChange)
  19. {
  20. if (projectile.velocity.X != velocityChange.X)
  21. {
  22. projectile.velocity.X = -velocityChange.X;
  23. }
  24. if (projectile.velocity.Y != velocityChange.Y)
  25. {
  26. projectile.velocity.Y = -velocityChange.Y;
  27. }
  28. projectile.timeLeft -= 380;
  29. return false;
  30. }
  31. public override void PostKill()
  32. {
  33. Projectile.NewProjectile(projectile.center().X, projectile.center().Y, 0f, 0f, "HaloMod:FuelRodExplosion", projectile.damage, projectile.knockBack, projectile.owner);
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement