public override void AI() { base.AI(); madeturrets = madeturrets + 1; if (laserblast == -1000) { laserblast = (int)Main.rand.Next(0, 50) - 300; } NPC ownerz = Main.npc[NPC.FindFirstNPC(mod.NPCType("CobaltWraith"))]; if (ownerz != null) { if ((ownerz.modNPC as CobaltWraith).raged == true) { laserblast = laserblast + 1; Player P = Main.player[ownerz.target]; if (laserblast % 20 == 0 && laserblast % 300 > 200 && laserblast > 0 && P != null && Main.expertMode && (Main.netMode != 1)) { Idglib.Shattershots(npc.Center, P.position, new Vector2(P.width, P.height), ProjectileID.WaterBolt, 20, 30, 0, 1, true, 0, true, 100); } } } if (madeturrets == 5) { //madeturrets=true; int nexus = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 24, mod.NPCType(Main.rand.Next(0, 100) < 50 ? "CobaltArmorBow" : "CobaltChainSawPiece")); NPC armpeice = Main.npc[nexus]; CopperArmorPiece newguy3 = armpeice.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; armpeice.lifeMax = (int)(npc.lifeMax * 0.75f); armpeice.ai[1] = -16; armpeice.ai[1] = -0f; armpeice.life = (int)(npc.lifeMax * (0.75f)); armpeice.knockBackResist = 1f; armpeice.netUpdate = true; } }
public void createarmorthings() { for (float fx = -14f; fx < 15f; fx = fx + 28f) { int itz = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("CobaltBrickArmor")); NPC arm = Main.npc[itz]; CopperArmorPiece newguy3 = arm.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; arm.lifeMax = (int)(npc.lifeMax * 1.25f); arm.ai[1] = -fx; arm.ai[2] = 0f; arm.life = (int)(npc.lifeMax * (1.25f)); arm.knockBackResist = 1f; int lastone = itz; int nexus = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("CobaltBrickArmorNexus")); NPC armpeice = Main.npc[nexus]; newguy3 = armpeice.modNPC as CopperArmorPiece; newguy3.attachedID = itz; armpeice.lifeMax = (int)(npc.lifeMax * 0.75f); armpeice.ai[1] = -186 * (fx > 0 ? 1 : -1) / 2; armpeice.ai[2] = -24f; armpeice.life = (int)(npc.lifeMax * (0.75f)); armpeice.knockBackResist = 1f; for (float fx2 = 5f; fx2 < 35f; fx2 = fx2 + 12f) { int newguyleggings = NPC.NewNPC((int)npc.position.X + 0, (int)npc.position.Y, mod.NPCType("CobaltBrickArmor")); armpeice = Main.npc[newguyleggings]; newguy3 = armpeice.modNPC as CopperArmorPiece; newguy3.attachedID = lastone; newguy3.speed = newguy3.speed / (1 + (fx2 / 300)); lastone = newguyleggings; armpeice.lifeMax = (int)(npc.lifeMax * 0.75f); armpeice.ai[1] = Main.rand.Next(-80, 80); armpeice.ai[2] = Main.rand.Next(-80, 80); armpeice.life = (int)(npc.lifeMax * (0.75f)); armpeice.knockBackResist = 1f; armpeice.netUpdate = true; nexus = NPC.NewNPC((int)npc.position.X + 0, (int)npc.position.Y, mod.NPCType("CobaltBrickArmorNexus")); armpeice = Main.npc[nexus]; newguy3 = armpeice.modNPC as CopperArmorPiece; newguy3.speed = newguy3.speed / (1 + (fx2 / 200)); newguy3.attachedID = newguyleggings; armpeice.lifeMax = (int)(npc.lifeMax * 0.75f); armpeice.ai[1] = Main.rand.Next(-80, 80); armpeice.ai[2] = Main.rand.Next(-80, 80); armpeice.life = (int)(npc.lifeMax * (0.75f)); armpeice.knockBackResist = 1f; armpeice.netUpdate = true; } } }
public override bool CheckActive() { CopperArmorPiece myself = npc.modNPC as CopperArmorPiece; int npctype = mod.NPCType(myself.attachedType); NPC myowner = Main.npc[myself.attachedID]; return(!myowner.active); }
public virtual void ArmorMalfunction() { selfdestruct = true; CopperArmorPiece myself = npc.modNPC as CopperArmorPiece; npc.velocity = new Vector2(Main.rand.Next(-5, 5), Main.rand.Next(-5, 5)); npc.StrikeNPCNoInteraction((int)(npc.lifeMax * 0.15f), 0f, 0); }
public override void AI() { float speedmulti = 0.75f; if (!Main.expertMode) { speedmulti = 0.5f; } if (SGAWorld.NightmareHardcore > 0) { speedmulti = 1f; } CopperArmorPiece myself = npc.modNPC as CopperArmorPiece; int npctype = mod.NPCType(myself.attachedType); NPC myowner = Main.npc[myself.attachedID]; if (myowner.active == false) { myself.ArmorMalfunction(); } else { Player P = Main.player[myowner.target]; npc.ai[0] += 1; npc.spriteDirection = npc.velocity.X > 0 ? -1 : 1; Vector2 itt = (myowner.Center - npc.Center + new Vector2(npc.ai[1] * npc.spriteDirection, npc.ai[2])); float locspeed = 0.25f * speedmulti; if (npc.ai[0] % 600 > 350) { npc.damage = (int)npc.defDamage * 3; itt = itt = (P.position - npc.position + new Vector2(npc.ai[1] * npc.spriteDirection, -8)); if (npc.ai[0] % 180 == 0 && SGAWorld.NightmareHardcore > 0) { Vector2 zxx = itt; zxx += P.velocity * 3f; zxx.Normalize(); npc.velocity += zxx * 18; } npc.rotation = npc.rotation + (0.65f * npc.spriteDirection); } else { npc.damage = (int)npc.defDamage; if (npc.ai[0] % 300 < 60) { locspeed = 2.5f * speedmulti; npc.velocity = npc.velocity * 0.92f; } npc.rotation = (float)npc.velocity.X * 0.09f; locspeed = 0.5f * speedmulti; } npc.velocity = npc.velocity * 0.96f; itt.Normalize(); npc.velocity = npc.velocity + (itt * locspeed); npc.timeLeft = 999; } }
public override void SetDefaults() { base.SetDefaults(); npc.width = 48; npc.height = 48; npc.HitSound = SoundID.NPCHit7; npc.DeathSound = SoundID.NPCDeath7; CopperArmorPiece myself = npc.modNPC as CopperArmorPiece; myself.friction = 0.95f; myself.speed = 0.04f; }
public override void AI() { CopperArmorPiece myself = npc.modNPC as CopperArmorPiece; int npctype = mod.NPCType(myself.attachedType); NPC myowner = Main.npc[myself.attachedID]; if (myowner.active == false) { myself.ArmorMalfunction(); } else { CobaltFloat(myowner); } }
public override void AI() { CopperArmorPiece myself = npc.modNPC as CopperArmorPiece; int npctype = mod.NPCType(myself.attachedType); NPC myowner = Main.npc[myself.attachedID]; if (myowner.active == false) { myself.ArmorMalfunction(); } else { Player P = Main.player[npc.target]; if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) { npc.TargetClosest(false); P = Main.player[npc.target]; if (!P.active || P.dead) { npc.active = false; Main.npc[(int)npc.ai[1]].active = false; } } else { npc.ai[0] = npc.ai[0] + 1; if (npc.ai[0] % 300 < 150) { npc.velocity = npc.velocity + ((myowner.Center + new Vector2((float)npc.ai[1], (float)npc.ai[2]) - npc.Center)) / (50); } else { npc.velocity = npc.velocity + (P.Center - npc.Center) * (0.02f); } npc.velocity = npc.velocity * 0.5f; Vector2 dif = npc.Center - myowner.Center; dif.Normalize(); npc.position = npc.position + (dif * 5); npc.rotation = (float)Math.Atan2(npc.position.Y - (myowner.position.Y + (myowner.height * 0.5f)), npc.position.X - (myowner.position.X + (myowner.width * 0.5f))) + 90f; npc.timeLeft = 999; } } }
public override void AI() { CopperArmorPiece myself = npc.modNPC as CopperArmorPiece; NPC myowner = Main.npc[myself.attachedID]; if (myowner.active == false) { myself.ArmorMalfunction(); } else { npc.velocity = npc.velocity + (myowner.Center + new Vector2((float)npc.ai[1], (float)npc.ai[2]) - npc.Center) * (myself.speed); npc.velocity = npc.velocity * myself.friction; npc.rotation = (float)npc.velocity.X * 0.1f; //npc.position=myowner.position; npc.timeLeft = 999; } }
public override void AI() { base.AI(); madeturrets = madeturrets + 1; if (laserblast == -1000) { laserblast = (int)Main.rand.Next(0, 50) - 300; } int findthem = NPC.FindFirstNPC(mod.NPCType("CobaltWraith")); if (findthem >= 0 && findthem < Main.maxNPCs) { NPC ownerz = Main.npc[findthem]; if ((ownerz.modNPC as CobaltWraith).raged == true) { laserblast = laserblast + 1; Player P = Main.player[ownerz.target]; if (laserblast % 20 == 0 && laserblast % 400 > 200 && laserblast > 0 && P != null && Main.expertMode && (Main.netMode != 1)) { if (mode == 0) { //if (laserblast % 400 > 300) //Idglib.Shattershots(npc.Center, npc.Center + new Vector2(Math.Sign(P.Center.X - npc.Center.X) * 8f, 0), Vector2.Zero, ProjectileID.WaterBolt, 20, 30, 0, 1, true, 0, true, 100); } else { Idglib.Shattershots(npc.Center, npc.Center + Vector2.UnitY, Vector2.Zero, ProjectileID.WaterBolt, 20, 30, 0, 1, true, 0, true, 100); } } } } if (madeturrets == 5) { //madeturrets=true; int nexus = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 24, mod.NPCType(Main.rand.Next(0, 100) < 50 && mode == 0 ? "CobaltArmorBow" : "CobaltChainSawPiece")); NPC armpeice = Main.npc[nexus]; CopperArmorPiece newguy3 = armpeice.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; armpeice.lifeMax = (int)(npc.lifeMax * 0.75f); armpeice.ai[1] = -16; armpeice.ai[1] = -0f; armpeice.life = (int)(npc.lifeMax * (0.75f)); armpeice.knockBackResist = 1f; armpeice.netUpdate = true; } }
public override void SetDefaults() { npc.width = 32; npc.height = 32; npc.damage = 0; npc.defense = 5; npc.lifeMax = 500; npc.HitSound = SoundID.NPCHit7; npc.DeathSound = SoundID.NPCDeath7; npc.value = 0f; npc.knockBackResist = 0f; npc.aiStyle = -1; aiType = -1; animationType = 0; npc.noTileCollide = true; npc.noGravity = true; CopperArmorPiece myself = npc.modNPC as CopperArmorPiece; myself.friction = myself.friction / 8; myself.speed = 0.54f; npc.buffImmune[BuffID.Daybreak] = true; }
public override void AI() { Player P = Main.player[npc.target]; if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) { npc.TargetClosest(false); P = Main.player[npc.target]; if (!P.active || P.dead) { npc.active = false; Main.npc[(int)npc.ai[1]].active = false; } } else { if ((P.Center - npc.Center).Length() < 700) { npc.timeLeft = 400; } base.AI(); if (npc.ai[0] > 10) { npc.ai[0]++; } if (npc.ai[0] == 1) { int newguyleggings = 0; CopperArmorPiece newguy3 = null; /*==int newguy=NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("CobaltArmorChainmail")); * myarmor=Main.npc[newguy]; * newguy3 = myarmor.modNPC as CopperArmorPiece; newguy3.attachedID=npc.whoAmI; * myarmor.lifeMax=(int)(npc.lifeMax*2f); myarmor.ai[2]=-4f; myarmor.life=(int)(npc.lifeMax*(2f)); myarmor.knockBackResist=1f; * * newguyleggings=NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("CobaltArmorGreaves")); * temparmor=Main.npc[newguyleggings]; * newguy3 = temparmor.modNPC as CopperArmorPiece; newguy3.attachedID=newguy; * temparmor.lifeMax=(int)(npc.lifeMax*1.25f); temparmor.ai[2]=12f; temparmor.life=(int)(npc.lifeMax*(1.25f)); temparmor.knockBackResist=1f; * * newguyleggings=NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("CobaltArmorHelmet")); * temparmor=Main.npc[newguyleggings]; * newguy3 = temparmor.modNPC as CopperArmorPiece; newguy3.attachedID=newguy; * temparmor.lifeMax=(int)(npc.lifeMax*1.25f); temparmor.ai[2]=-20f; temparmor.life=(int)(npc.lifeMax*(1.25f)); temparmor.knockBackResist=1f;*/ if (madearmor == false) { madearmor = true; for (float fx = -14f; fx < 15f; fx = fx + 28f) { int itz = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("CobaltBrickArmor")); NPC arm = Main.npc[itz]; newguy3 = arm.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; arm.lifeMax = (int)(npc.lifeMax * 1.25f); arm.ai[1] = -fx; arm.ai[2] = 0f; arm.life = (int)(npc.lifeMax * (1.25f)); arm.knockBackResist = 1f; arm.netUpdate = true; int lastone = itz; int nexus = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("CobaltBrickArmorNexus")); NPC armpeice = Main.npc[nexus]; newguy3 = armpeice.modNPC as CopperArmorPiece; newguy3.attachedID = itz; armpeice.lifeMax = (int)(npc.lifeMax * 0.75f); armpeice.ai[1] = -16 * (fx > 0 ? 1 : -1) / 2; armpeice.ai[2] = -24f; armpeice.life = (int)(npc.lifeMax * (0.75f)); armpeice.knockBackResist = 1f; armpeice.netUpdate = true; for (float fx2 = 20f; fx2 < 75f; fx2 = fx2 + 18f) { newguyleggings = NPC.NewNPC((int)npc.position.X + 0, (int)npc.position.Y, mod.NPCType("CobaltBrickArmor")); armpeice = Main.npc[newguyleggings]; newguy3 = armpeice.modNPC as CopperArmorPiece; newguy3.attachedID = lastone; newguy3.speed = newguy3.speed / (1 + (fx2 / 300)); lastone = newguyleggings; armpeice.lifeMax = (int)(npc.lifeMax * 0.75f); armpeice.ai[1] = Main.rand.Next(-80, 80); armpeice.ai[2] = Main.rand.Next(-80, 80); armpeice.life = (int)(npc.lifeMax * (0.75f)); armpeice.knockBackResist = 1f; armpeice.netUpdate = true; nexus = NPC.NewNPC((int)npc.position.X + 0, (int)npc.position.Y, mod.NPCType("CobaltBrickArmorNexus")); armpeice = Main.npc[nexus]; newguy3 = armpeice.modNPC as CopperArmorPiece; newguy3.speed = newguy3.speed / (1 + (fx2 / 200)); newguy3.attachedID = newguyleggings; armpeice.lifeMax = (int)(npc.lifeMax * 0.75f); armpeice.ai[1] = Main.rand.Next(-80, 80); armpeice.ai[2] = Main.rand.Next(-80, 80); armpeice.life = (int)(npc.lifeMax * (0.75f)); armpeice.knockBackResist = 1f; armpeice.netUpdate = true; } } } } } }
public override void SpawnMoreExpert() { Idglib.Chat("Turn.... baacckk...", 5, 5, 60); int newguy = NPC.NewNPC((int)npc.position.X + 400, (int)npc.position.Y, mod.NPCType(level > 0 ? "CobaltArmorChainmail" : "CopperArmorChainmail")); NPC newguy2 = Main.npc[newguy]; CopperArmorPiece newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.lifeMax = (int)(npc.lifeMax * 1.5f); newguy2.life = (int)(npc.lifeMax * (1.5f)); newguy2.knockBackResist = 1f; newguy2.netUpdate = true; raged = true; createarmorthings(); }
public override void AI() { CopperArmorPiece myself = npc.modNPC as CopperArmorPiece; int npctype = mod.NPCType(myself.attachedType); NPC myowner = Main.npc[myself.attachedID]; if (myowner.active == false) { myself.ArmorMalfunction(); } else { Player P = Main.player[npc.target]; if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) { npc.TargetClosest(false); P = Main.player[npc.target]; if (!P.active || P.dead) { npc.active = false; Main.npc[(int)npc.ai[1]].active = false; } } else { npc.ai[0] += 1; Vector2 itt = (myowner.Center - npc.Center + new Vector2(npc.ai[1] * npc.spriteDirection, npc.ai[2])); if (npc.ai[0] % 1500 > 1250) { itt = (P.position - npc.position + new Vector2(3f * npc.ai[1] * npc.spriteDirection, npc.ai[2] * 2f)); } float locspeed = 0.25f; if (npc.ai[0] % 900 > 550) { Vector2 cas = new Vector2(npc.position.X - P.position.X, npc.position.Y - P.position.Y); double dist = cas.Length(); float rotation = (float)Math.Atan2(npc.position.Y - (P.position.Y - (new Vector2(0, (float)(dist * 0.05f))).Y + (P.height * 0.5f)), npc.position.X - (P.position.X + (P.width * 0.5f))); npc.rotation = rotation;//npc.rotation+((rotation-npc.rotation)*0.1f); npc.velocity = npc.velocity * 0.86f; if (npc.ai[0] % 20 == 0 && npc.ai[0] % 900 > 650) { List <Projectile> one = Idglib.Shattershots(npc.Center, npc.Center + new Vector2(-15 * npc.spriteDirection, 0), new Vector2(0, 0), SGAWorld.NightmareHardcore > 0 ? mod.ProjectileType("UnmanedArrow2") : ProjectileID.WoodenArrowHostile, 20, 20, 0, 1, true, (Main.rand.Next(-100, 100) * 0.000f) - npc.rotation, true, 300); one[0].hostile = true; one[0].friendly = false; one[0].localAI[0] = P.whoAmI; one[0].netUpdate = true; } npc.spriteDirection = 1; } else { if (Math.Abs(npc.velocity.X) > 2) { npc.spriteDirection = npc.velocity.X > 0 ? -1 : 1; } npc.rotation = (float)npc.velocity.X * 0.09f; locspeed = 0.5f; } npc.velocity = npc.velocity * 0.96f; itt.Normalize(); npc.velocity = npc.velocity + (itt * locspeed); npc.timeLeft = 999; } } }
public override void AI() { float speedmulti = 0.75f; if (GetType() == typeof(CopperWraith)) { if (!Main.expertMode) { speedmulti = 0.5f; } if (SGAWorld.NightmareHardcore > 0) { speedmulti = 1f; } } if (GetType() == typeof(CobaltWraith)) { speedmulti = 1.25f; if (!Main.expertMode) { speedmulti = 1f; } if (SGAWorld.NightmareHardcore > 0) { speedmulti = 1.4f; } } //npc.netUpdate = true; Player P = Main.player[npc.target]; if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) { npc.TargetClosest(false); P = Main.player[npc.target]; if (!P.active || P.dead) { npc.active = false; Main.npc[(int)npc.ai[1]].active = false; } } else { int expert = 0; if (Main.expertMode) { expert = 1; } npc.ai[0] += 1; if (npc.type == mod.NPCType("CobaltWraith")) { level = 1; } npc.defense = (int)(((NPC.CountNPCS(mod.NPCType("CopperArmorChainmail")) * 6) + (NPC.CountNPCS(mod.NPCType("CopperArmorGreaves"))) * 3 + (NPC.CountNPCS(mod.NPCType("CopperArmorHelmet")) * 4)) * ((expert + 1) * 0.4f)); if (NPC.CountNPCS(mod.NPCType("CopperArmorChainmail")) + NPC.CountNPCS(mod.NPCType("CobaltArmorChainmail")) < 1) { if (npc.ai[0] > 50) { npc.ai[0] = -500; } } if (npc.life < npc.lifeMax * 0.5f) { if (expert > 0) { if (npc.ai[0] > -1500 && npc.ai[1] == 0) { npc.ai[0] = -2000; npc.ai[1] = 1; } if (npc.ai[0] == -1850) { List <Projectile> itz = Idglib.Shattershots(npc.position, npc.position + new Vector2(0, 200), new Vector2(0, 0), ProjectileID.DD2BetsyArrow, 10, 5, 360, 20, true, 0, true, 150); for (int f = 0; f < 20; f = f + 1) { itz[f].aiStyle = 0; itz[f].rotation = -((float)Math.Atan2((double)itz[f].velocity.Y, (double)itz[f].velocity.X)); } SpawnMoreExpert(); } if (npc.ai[0] == -1800) { npc.ai[0] = 0; } } } if ((npc.ai[0] == 1 || npc.ai[0] == -1) && npc.ai[1] < 1) { float mul = (npc.ai[0] < 0 ? 0.10f : 0.45f); if (NPC.CountNPCS(mod.NPCType("CopperArmorChainmail")) < 1) { int newguy = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 10, mod.NPCType(level > 0 ? "CobaltArmorChainmail" : "CopperArmorChainmail")); NPC newguy2 = Main.npc[newguy]; CopperArmorPiece newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.lifeMax = (int)npc.lifeMax * 2; newguy2.life = (int)(npc.lifeMax * (2 * mul)); newguy2.knockBackResist = 0.85f; newguy2.netUpdate = true; } if (NPC.CountNPCS(mod.NPCType("CopperArmorSword")) < 1) { int newguy = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 10, mod.NPCType(level > 0 ? "CobaltArmorSword" : "CopperArmorSword")); NPC newguy2 = Main.npc[newguy]; CopperArmorPiece newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.ai[1] = -32f; newguy2.ai[2] = -16f; newguy2.lifeMax = (int)(npc.lifeMax * 1f); newguy2.life = (int)(npc.lifeMax * (1f)); newguy2.knockBackResist = 0.75f; newguy2.netUpdate = true; } if (NPC.CountNPCS(mod.NPCType("CopperArmorHelmet")) < 1) { int newguy = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 10, mod.NPCType(level > 0 ? "CobaltArmorHelmet" : "CopperArmorHelmet")); NPC newguy2 = Main.npc[newguy]; CopperArmorPiece newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.ai[2] = -12f; newguy2.lifeMax = (int)(npc.lifeMax * 1.5f); newguy2.life = (int)(npc.lifeMax * (1.5f * mul)); newguy2.knockBackResist = 0.8f; newguy2.netUpdate = true; } if (NPC.CountNPCS(mod.NPCType("CopperArmorGreaves")) < 1) { int newguy = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 10, mod.NPCType(level > 0 ? "CobaltArmorGreaves" : "CopperArmorGreaves")); NPC newguy2 = Main.npc[newguy]; CopperArmorPiece newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.ai[2] = 12f; newguy2.lifeMax = (int)(npc.lifeMax * 1.5f); newguy2.life = (int)(npc.lifeMax * (1.5f * mul)); newguy2.knockBackResist = 0.8f; newguy2.netUpdate = true; } if (NPC.CountNPCS(mod.NPCType("CopperArmorBow")) < 1) { int newguy = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 10, mod.NPCType(level > 0 ? "CobaltArmorSword" : "CopperArmorBow")); NPC newguy2 = Main.npc[newguy]; CopperArmorPiece newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.ai[1] = 32f; newguy2.ai[2] = -16f; newguy2.lifeMax = (int)(npc.lifeMax * (1f)); newguy2.life = (int)(npc.lifeMax * (1f)); newguy2.knockBackResist = 0.75f; newguy2.netUpdate = true; } } if (npc.ai[0] > 1) { if (npc.ai[0] % 600 < 250) { Vector2 itt = ((P.Center + OffsetPoints) - npc.position); itt.Normalize(); npc.velocity = npc.velocity + (itt * (speed * speedmulti)); } npc.velocity = npc.velocity * 0.98f; } if (npc.ai[0] < 0 && npc.ai[0] > -2000) { if (npc.ai[0] % 110 < -95) { npc.velocity = new Vector2(Main.rand.Next(-20, 20), 0); if (npc.ai[0] % 10 == 0) { Idglib.Shattershots(npc.position, P.position, new Vector2(P.width, P.height), 100, 10, 8, 0, 1, true, 0, true, 300); } } else { Vector2 itt = ((P.Center + OffsetPoints + new Vector2(0, -250)) - npc.position); itt.Normalize(); float speedz = (float)level + 0.45f; npc.velocity = npc.velocity + ((itt * speedz) * speedmulti); } float fric = 0.96f + ((float)level * 0.01f); npc.velocity = npc.velocity * fric; } } }
public virtual void SpawnMoreExpert() { int newguy = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("CopperArmorSword")); NPC newguy2 = Main.npc[newguy]; CopperArmorPiece newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.ai[0] = 300f; newguy2.ai[1] = -64f; newguy2.ai[2] = 48f; newguy2.lifeMax = (int)npc.lifeMax * 1; newguy2.life = (int)(npc.lifeMax * (1)); newguy2.knockBackResist = 0.9f; newguy2.netUpdate = true; newguy = NPC.NewNPC((int)npc.position.X - 400, (int)npc.position.Y, mod.NPCType("CopperArmorSword")); newguy2 = Main.npc[newguy]; newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.ai[1] = 64f; newguy2.ai[2] = 48f; newguy2.lifeMax = (int)npc.lifeMax * 1; newguy2.life = (int)(npc.lifeMax * (1)); newguy2.knockBackResist = 0.9f; newguy2.netUpdate = true; newguy = NPC.NewNPC((int)npc.position.X - 400, (int)npc.position.Y, mod.NPCType("CopperArmorBow")); newguy2 = Main.npc[newguy]; newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.ai[0] = 450f; newguy2.ai[1] = 16f; newguy2.ai[2] = -64f; newguy2.lifeMax = (int)npc.lifeMax * 1; newguy2.life = (int)(npc.lifeMax * (1)); newguy2.knockBackResist = 0.2f; newguy2.netUpdate = true; newguy = NPC.NewNPC((int)npc.position.X + 400, (int)npc.position.Y, mod.NPCType("CopperArmorBow")); newguy2 = Main.npc[newguy]; newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.ai[1] = -16f; newguy2.ai[2] = -64f; newguy2.lifeMax = (int)npc.lifeMax * 1; newguy2.life = (int)(npc.lifeMax * (1)); newguy2.knockBackResist = 0.2f; newguy2.netUpdate = true; newguy = NPC.NewNPC((int)npc.position.X + 400, (int)npc.position.Y, mod.NPCType(level > 0 ? "CobaltArmorChainmail" : "CopperArmorChainmail")); newguy2 = Main.npc[newguy]; newguy3 = newguy2.modNPC as CopperArmorPiece; newguy3.attachedID = npc.whoAmI; newguy2.lifeMax = (int)(npc.lifeMax * 1.5f); newguy2.life = (int)(npc.lifeMax * (1.5f)); newguy2.knockBackResist = 1f; newguy2.netUpdate = true; }