Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using TAPI;
- using Terraria;
- namespace HaloMod.Projectiles
- {
- public class FuelRod : ModProjectile
- {
- public override void AI()
- {
- projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
- 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);
- projectile.light = 0.9f;
- }
- public override bool OnTileCollide(ref Vector2 velocityChange)
- {
- if (projectile.velocity.X != velocityChange.X)
- {
- projectile.velocity.X = -velocityChange.X;
- }
- if (projectile.velocity.Y != velocityChange.Y)
- {
- projectile.velocity.Y = -velocityChange.Y;
- }
- projectile.timeLeft -= 380;
- return false;
- }
- public override void PostKill()
- {
- Projectile.NewProjectile(projectile.center().X, projectile.center().Y, 0f, 0f, "HaloMod:FuelRodExplosion", projectile.damage, projectile.knockBack, projectile.owner);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement