public override void AI() { Lighting.AddLight(npc.Center, AAColor.YamataA.R / 255, AAColor.YamataA.G / 255, AAColor.YamataA.B / 255); AAAI.AIShadowflameGhost(npc, ref npc.ai, false, 660f, 0.3f, 15f, 0.2f, 8f, 5f, 10f, 0.4f, 0.4f, 0.95f, 5f); if (!NPC.AnyNPCs(ModContent.NPCType <YamataA>())) { npc.life = 0; } if (npc.alpha != 0) { for (int spawnDust = 0; spawnDust < 2; spawnDust++) { int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("YamataAuraDust"), 0f, 0f, 100, default, 2f);
public override void AI() { if (internalAI[3] > 0 || (AAGlobalProjectile.AnyProjectiles(mod.ProjectileType("ShenWaveDeathray")) || AAGlobalProjectile.AnyProjectiles(mod.ProjectileType("ShenWaveDeathraySmall")))) { npc.TargetClosest(false); npc.rotation = 0; npc.velocity *= .2f; NPC shen = Main.npc[(int)internalAI[0]]; int shotdirection = npc.spriteDirection = npc.direction; if (internalAI[4] == 0) { npc.spriteDirection = npc.direction = shen.spriteDirection; shotdirection = npc.direction; npc.Center = new Vector2(shen.Center.X + internalAI[1] * shotdirection, shen.Center.Y + internalAI[2]); } if (shen.ai[0] == 0 && shen.ai[2] == 360 && Main.netMode != NetmodeID.MultiplayerClient) { float ai0 = (float)Math.PI * 2 / 300 * (internalAI[3] == 2 ? 1 : -1) * Math.Sign(internalAI[2]); Projectile.NewProjectile(npc.Center + npc.direction * new Vector2(npc.width / 2, 0), Vector2.UnitX * shotdirection, mod.ProjectileType("ShenWaveDeathraySmall"), npc.damage, 0f, Main.myPlayer, ai0, npc.whoAmI); internalAI[4] = 1; npc.netUpdate = true; } if (shen.ai[0] == 14 && shen.ai[1] == internalAI[3] * 120 - 30) { internalAI[4] = 1; if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(npc.Center + npc.direction * new Vector2(npc.width / 2, 0), npc.DirectionTo(Main.player[shen.target].Center), mod.ProjectileType("ShenWaveDeathraySmall"), npc.damage / 4, 0f, Main.myPlayer, 0f, npc.whoAmI); } } if (shen.ai[0] != 0 && shen.ai[0] != 1 && shen.ai[0] != 13 && shen.ai[0] != 14) { internalAI[3] = 0; npc.netUpdate = true; } return; } internalAI[4] = 0; AI86(); Lighting.AddLight(npc.Center, AAColor.Shen3.R / 255, AAColor.Shen3.G / 255, AAColor.Shen3.B / 255); AAAI.AIShadowflameGhost(npc, ref npc.ai, false, 660f, 0.3f, 15f, 0.2f, 8f, 5f, 10f, 0.4f, 0.4f, 0.95f, 5f); if (!NPC.AnyNPCs(mod.NPCType("ShenA"))) { npc.life = 0; npc.active = false; } if (npc.alpha != 0) { for (int spawnDust = 0; spawnDust < 2; spawnDust++) { int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType <DiscordDust>(), 0f, 0f, 100, default, 2f);
public override void AI() { Lighting.AddLight(npc.Center, Color.DarkOrange.R / 255, Color.DarkOrange.G / 255, Color.DarkOrange.B / 255); AAAI.AIShadowflameGhost(npc, ref npc.ai, false, 660f, 0.3f, 10f, 0.2f, 6f, 5f, 10f, 0.4f, 0.4f, 0.95f, 5f); npc.spriteDirection = npc.velocity.X > 0 ? -1 : 1; BaseAI.LookAt(npc.Center + npc.velocity, npc, 0); npc.frameCounter++; if (npc.frameCounter > 3) { npc.frameCounter = 0; npc.frame.Y += 76; if (npc.frame.Y > 76 * 7) { npc.frame.Y = 0; } } float num1276 = 120f; if (npc.localAI[0] < num1276) { npc.localAI[0] += 1f; float num1279 = 1f - npc.localAI[0] / num1276; float num1280 = num1279 * 20f; int num1281 = 0; while (num1281 < num1280) { if (Main.rand.Next(5) == 0) { int num1282 = Dust.NewDust(npc.position, npc.width, npc.height, ModContent.DustType <Dusts.DragonflameDust>(), 0f, 0f, 0); Main.dust[num1282].alpha = 100; Main.dust[num1282].velocity *= 0.3f; Main.dust[num1282].velocity += npc.velocity * 0.75f; Main.dust[num1282].noGravity = true; } num1281++; } } }
public override void AI() { Lighting.AddLight(npc.Center, AAColor.YamataA.R / 255, AAColor.YamataA.G / 255, AAColor.YamataA.B / 255); AAAI.AIShadowflameGhost(npc, ref npc.ai, false, 660f, 0.3f, 15f, 0.2f, 8f, 5f, 10f, 0.4f, 0.4f, 0.95f, 5f); if (!NPC.AnyNPCs(mod.NPCType("YamataA"))) { npc.life = 0; } if (Main.npc[(int)internalAI[0]].active && Main.npc[(int)internalAI[0]].life > 0) { float dist = npc.Distance(Main.npc[(int)internalAI[0]].Center); if (dist > 2000) { npc.position = Main.npc[(int)internalAI[0]].Center; } } if (internalAI[3] > 0) { internalAI[3]--; } else { npc.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) { int Head = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("YamataAHeadF")); Main.npc[Head].ai[0] = internalAI[0]; if (!((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head2.active) { ((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head2 = Main.npc[Head]; Main.npc[Head].ai[1] = 300 * -3f; Main.npc[Head].ai[2] = -500 * .7f; Main.npc[Head].ai[3] = 3f; } else if (!((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head3.active) { ((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head3 = Main.npc[Head]; Main.npc[Head].ai[1] = 300 * -2f; Main.npc[Head].ai[2] = -500 * .8f; Main.npc[Head].ai[3] = 2f; } else if (!((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head4.active) { ((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head4 = Main.npc[Head]; Main.npc[Head].ai[1] = 300 * -1f; Main.npc[Head].ai[2] = -500 * .9f; Main.npc[Head].ai[3] = 1f; } else if (!((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head5.active) { ((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head5 = Main.npc[Head]; Main.npc[Head].ai[1] = 300 * 1f; Main.npc[Head].ai[2] = -500 * .9f; Main.npc[Head].ai[3] = 1f; } else if (!((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head6.active) { ((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head6 = Main.npc[Head]; Main.npc[Head].ai[1] = 300 * 2f; Main.npc[Head].ai[2] = -500 * .8f; Main.npc[Head].ai[3] = 2f; } else if (!((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head7.active) { ((YamataA)Main.npc[(int)internalAI[0]].modNPC).Head7 = Main.npc[Head]; Main.npc[Head].ai[1] = 300 * 3f; Main.npc[Head].ai[2] = -500 * .7f; Main.npc[Head].ai[3] = 3f; } else { Main.npc[Head].active = false; } Main.npc[Head].netUpdate = true; } } if (npc.alpha != 0) { for (int spawnDust = 0; spawnDust < 2; spawnDust++) { int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType <YamataAuraDust>(), 0f, 0f, 100, default, 2f);