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 Terraria;
- using Terraria.ID;
- using Terraria.ModLoader;
- namespace Upgrades.Weapons
- {
- public class fb : ModProjectile
- {
- public override void SetDefaults()
- {
- projectile.name = "Fireball";
- projectile.width = 40;
- projectile.height = 40;
- projectile.friendly = true;
- projectile.penetrate = 1;
- projectile.hostile = false;
- projectile.magic = true;
- projectile.tileCollide = true;
- projectile.ignoreWater = false;
- projectile.timeLeft = 400;
- }
- public override void AI()
- {
- //this is projectile dust
- int DustID2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width + 2, projectile.height + 2, DustID.SolarFlare, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 20, default(Color), 2.9f);
- Main.dust[DustID2].noGravity = true;
- projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
- projectile.localAI[0] += 1f;
- if (projectile.localAI[0] > 200f)
- {
- projectile.Kill();
- }
- }
- public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
- {
- base.OnHitNPC(target, damage, knockback, crit);
- Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, ProjectileID.InfernoFriendlyBlast, 40, 4);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement