Advertisement
Guest User

FB

a guest
Jul 30th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.72 KB | None | 0 0
  1. using System;
  2. using Microsoft.Xna.Framework;
  3. using Microsoft.Xna.Framework.Graphics;
  4. using Terraria;
  5. using Terraria.ID;
  6. using Terraria.ModLoader;
  7.  
  8. namespace Upgrades.Weapons
  9. {
  10.     public class fb : ModProjectile
  11.     {
  12.         public override void SetDefaults()
  13.         {
  14.             projectile.name = "Fireball";
  15.             projectile.width = 40;
  16.             projectile.height = 40;
  17.             projectile.friendly = true;
  18.             projectile.penetrate = 1;                      
  19.             projectile.hostile = false;
  20.             projectile.magic = true;                      
  21.             projectile.tileCollide = true;              
  22.             projectile.ignoreWater = false;
  23.             projectile.timeLeft = 400;
  24.         }
  25.  
  26.         public override void AI()
  27.         {
  28.             //this is projectile dust
  29.             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);
  30.             Main.dust[DustID2].noGravity = true;
  31.             projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
  32.             projectile.localAI[0] += 1f;
  33.  
  34.             if (projectile.localAI[0] > 200f)
  35.             {
  36.                 projectile.Kill();
  37.             }
  38.         }
  39.             public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
  40.         {
  41.             base.OnHitNPC(target, damage, knockback, crit);
  42.             Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, ProjectileID.InfernoFriendlyBlast, 40, 4);
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement