Advertisement
Guest User

Terraria paste

a guest
May 24th, 2020
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using Terraria;
  2. using Terraria.DataStructures;
  3. using Terraria.GameInput;
  4. using Terraria.ID;
  5. using Terraria.ModLoader;
  6. using Terraria.ModLoader.IO;
  7. using static Terraria.ModLoader.ModContent;
  8. namespace TutorialMod
  9. {
  10. public class Tutorialplayer : ModPlayer
  11. {
  12. public override void ProcessTriggers(TriggersSet triggersSet) {
  13. if (TutorialMod.ExplodeHotKey.JustPressed) {
  14. public override void Kill(int timeLeft)
  15. {
  16.  
  17. Vector2 position = projectile.Center;
  18. Main.PlaySound(SoundID.Item14, (int)position.X, (int)position.Y);
  19. int radius = 20;
  20.  
  21. for (int x = -radius; x <= radius; x++)
  22. {
  23. for (int y = -radius; y <= radius; y++)
  24. {
  25. int xPosition = (int)(x + position.X / 16.0f);
  26. int yPosition = (int)(y + position.Y / 16.0f);
  27.  
  28. if (Math.Sqrt(x * x + y * y) <= radius + 0.5) /
  29. {
  30. WorldGen.KillTile(xPosition, yPosition, false, false, false);
  31. Dust.NewDust(position, 22, 22, DustID.Smoke, 0.0f, 0.0f, 120, new Color(), 1f);
  32. }
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement