public override void Attack() { int a = Projectile.NewProjectile(npc.Center, ArchaeaNPC.AngleToSpeed(ArchaeaNPC.AngleTo(npc, npcTarget) + compensate, 4f), ProjectileID.Fireball, 10, 1f); Main.projectile[a].timeLeft = 300; Main.projectile[a].hostile = true; Main.projectile[a].friendly = false; Main.projectile[a].tileCollide = false; }
public static Dust[] DustSpread(Vector2 v, int width = 1, int height = 1, int dustType = 6, int total = 10, float scale = 1f) { Dust[] dusts = new Dust[total]; for (int k = 0; k < total; k++) { Vector2 speed = ArchaeaNPC.AngleToSpeed(ArchaeaNPC.RandAngle(), 8f); dusts[k] = Dust.NewDustDirect(v + speed, width, height, dustType, speed.X, speed.Y, 0, default(Color), 2f); } return(dusts); }
public bool canSee() { Vector2 line; for (float k = 0; k < npc.Distance(target().position); k += 0.5f) { line = npc.Center + ArchaeaNPC.AngleToSpeed(ArchaeaNPC.AngleTo(npc, target()), k); int i = (int)line.X / 16; int j = (int)line.Y / 16; Tile tile = Main.tile[i, j]; if (tile.active() && Main.tileSolid[tile.type]) { return(false); } } return(true); }
public override void Attack() { projIndex = 0; for (int k = -3; k <= 3; k += 2) { bombs[projIndex] = Projectile.NewProjectileDirect(npc.Center, ArchaeaNPC.AngleToSpeed(ArchaeaNPC.RandAngle(), 4f), ProjectileID.BouncyGrenade, 15, 5f); bombs[projIndex].timeLeft = 180; bombs[projIndex].hostile = true; bombs[projIndex].friendly = false; projIndex++; } }