private void Publish(UIMouseEvent evt, UIElement listeningElement) { if (ModLoader.modBrowserPassphrase == "") { Main.menuMode = Interface.enterPassphraseMenuID; Interface.enterPassphraseMenu.SetGotoMenu(Interface.modSourcesID); return; } Main.PlaySound(10, -1, -1, 1); try { TmodFile[] modFiles = ModLoader.FindMods(); bool ok = false; TmodFile theTModFile = null; foreach (TmodFile tModFile in modFiles) { if (Path.GetFileName(tModFile.path).Equals(@Path.GetFileName(mod) + @".tmod")) { ok = true; theTModFile = tModFile; } } if (!ok) { throw new Exception(); } System.Net.ServicePointManager.Expect100Continue = false; string filename = @ModLoader.ModPath + @Path.DirectorySeparatorChar + @Path.GetFileName(mod) + @".tmod"; string url = "http://javid.ddns.net/tModLoader/publishmod.php"; using (var iconStream = theTModFile.HasFile("icon.png") ? new MemoryStream(theTModFile.GetFile("icon.png")) : null) using (var stream = File.Open(filename, FileMode.Open)) { var files = new List <UploadFile>(); files.Add(new IO.UploadFile { Name = "file", Filename = Path.GetFileName(filename), // ContentType = "text/plain", Stream = stream } ); if (iconStream != null) { files.Add(new IO.UploadFile { Name = "iconfile", Filename = "icon.png", Stream = iconStream } ); } BuildProperties bp = BuildProperties.ReadModFile(theTModFile); var values = new NameValueCollection { { "displayname", bp.displayName }, { "name", Path.GetFileNameWithoutExtension(filename) }, { "version", "v" + bp.version }, { "author", bp.author }, { "homepage", bp.homepage }, { "description", bp.description }, { "steamid64", ModLoader.SteamID64 }, { "modloaderversion", "tModLoader v" + theTModFile.tModLoaderVersion }, { "passphrase", ModLoader.modBrowserPassphrase }, { "modreferences", String.Join(", ", bp.modReferences.Select(x => x.mod)) }, { "modside", bp.side.ToFriendlyString() }, }; using (PatientWebClient client = new PatientWebClient()) { ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback((sender, certificate, chain, policyErrors) => { return(true); }); Interface.uploadMod.SetDownloading(Path.GetFileNameWithoutExtension(filename)); Interface.uploadMod.SetCancel(() => { Main.menuMode = Interface.modSourcesID; client.CancelAsync(); }); client.UploadProgressChanged += (s, e) => Interface.uploadMod.SetProgress(e); client.UploadDataCompleted += (s, e) => PublishUploadDataComplete(s, e, theTModFile); var boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x", System.Globalization.NumberFormatInfo.InvariantInfo); client.Headers["Content-Type"] = "multipart/form-data; boundary=" + boundary; boundary = "--" + boundary; byte[] data = IO.UploadFile.GetUploadFilesRequestData(files, values); client.UploadDataAsync(new Uri(url), data); } Main.menuMode = Interface.uploadModID; } } catch (WebException e) { ErrorLogger.LogModBrowserException(e); } }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(ModLoader.GetMod("AAMod").BuffType("DragonFire"), 200); }
public override void SetupShop(Chest shop, ref int nextSlot) { if (OH) { shop.item[nextSlot].SetDefaults(ItemID.Amethyst); shop.item[nextSlot].shopCustomPrice = 1000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.Topaz); shop.item[nextSlot].shopCustomPrice = 1000; nextSlot++; if (NPC.downedBoss2) { shop.item[nextSlot].SetDefaults(ItemID.Sapphire); shop.item[nextSlot].shopCustomPrice = 3000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.Emerald); shop.item[nextSlot].shopCustomPrice = 3000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.Amber); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.FossilOre); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; if (ModLoader.GetMod("ThoriumMod") != null) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("Opal")); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("Onyx")); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; } shop.item[nextSlot].SetDefaults(ItemID.BandofStarpower); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.BandofRegeneration); shop.item[nextSlot].shopCustomPrice = 50000; nextSlot++; if (Main.netMode == 1 || Main.netMode == 2) { shop.item[nextSlot].SetDefaults(ItemID.LifeCrystal); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; if (NPC.downedGolemBoss) { shop.item[nextSlot].SetDefaults(ItemID.LifeFruit); shop.item[nextSlot].shopCustomPrice = 200000; nextSlot++; } } } if (NPC.downedBoss3) { shop.item[nextSlot].SetDefaults(ItemID.Ruby); shop.item[nextSlot].shopCustomPrice = 7500; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.Diamond); shop.item[nextSlot].shopCustomPrice = 7500; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.DiamondRing); shop.item[nextSlot].shopCustomPrice = 2000000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("HorrifyingSkull")); shop.item[nextSlot].shopCustomPrice = 250000; nextSlot++; if (ModLoader.GetMod("Tremor") != null) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("Rupicide")); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("Opal")); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("MagiumShard")); shop.item[nextSlot].shopCustomPrice = 7500; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("RuneBar")); shop.item[nextSlot].shopCustomPrice = 7500; nextSlot++; } if (NPC.downedMoonlord) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("LapisLazuli")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } } if (ModLoader.GetMod("ThoriumMod") != null) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("GraniteEnergyCore")); shop.item[nextSlot].shopCustomPrice = 10000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("BronzeFragments")); shop.item[nextSlot].shopCustomPrice = 10000; nextSlot++; } if (ModLoader.GetMod("SpiritMod") != null) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("SpiritMod").ItemType("GraniteChunk")); shop.item[nextSlot].shopCustomPrice = 10000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("SpiritMod").ItemType("MarbleChunk")); shop.item[nextSlot].shopCustomPrice = 10000; nextSlot++; } if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("AlchemistHorcrux")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("BrewerHorcrux")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("JewelerHorcrux")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ArchitectHorcrux")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("MusicianHorcrux")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } } } if (AS) { shop.item[nextSlot].SetDefaults(ItemID.Campfire); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; if (NPC.downedBoss2) { if (ModLoader.GetMod("ThoriumMod") != null) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("Mistletoe")); shop.item[nextSlot].shopCustomPrice = 50000; nextSlot++; } } if (NPC.downedBoss3) { shop.item[nextSlot].SetDefaults(ItemID.WaterBucket); shop.item[nextSlot].shopCustomPrice = 15000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.HoneyBucket); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.LavaBucket); shop.item[nextSlot].shopCustomPrice = 50000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.HeartLantern); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.StarinaBottle); shop.item[nextSlot].shopCustomPrice = 10000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.WaterCandle); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.PeaceCandle); shop.item[nextSlot].shopCustomPrice = 50000; nextSlot++; if (ModLoader.GetMod("CalamityMod") != null) { if (NPC.downedPlantBoss) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("TranquilityCandle")); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("ChaosCandle")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } } shop.item[nextSlot].SetDefaults(ItemID.Spike); shop.item[nextSlot].shopCustomPrice = 10000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.DartTrap); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.GeyserTrap); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.SharpeningStation); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.BewitchingTable); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.AmmoBox); shop.item[nextSlot].shopCustomPrice = 250000; nextSlot++; if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ItemID.CrystalBall); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (NPC.downedGolemBoss) { shop.item[nextSlot].SetDefaults(ItemID.WoodenSpike); shop.item[nextSlot].shopCustomPrice = 20000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.SpearTrap); shop.item[nextSlot].shopCustomPrice = 50000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.SpikyBallTrap); shop.item[nextSlot].shopCustomPrice = 50000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.SuperDartTrap); shop.item[nextSlot].shopCustomPrice = 750000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.FlameTrap); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } } } }
public UIModItem(TmodFile mod) { this.mod = mod; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); //base.OnClick += this.ToggleEnabled; properties = BuildProperties.ReadModFile(mod); string text = properties.displayName.Length > 0 ? properties.displayName : mod.name; text += " v" + mod.version; if (mod.tModLoaderVersion < new Version(0, 10)) { text += " [c/FF0000:(Old mod, enable at own risk)]"; } this.modName = new UIText(text, 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); this.enabled = ModLoader.IsEnabled(mod); UITextPanel <string> button = new UITextPanel <string>("More info", 1f, false); button.Width.Set(100f, 0f); button.Height.Set(30f, 0f); button.Left.Set(430f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; button.OnMouseOver += UICommon.FadedMouseOver; button.OnMouseOut += UICommon.FadedMouseOut; button.OnClick += this.Moreinfo; base.Append(button); button2 = new UITextPanel <string>(this.enabled ? "Disable" : "Enable", 1f, false); button2.Width.Set(100f, 0f); button2.Height.Set(30f, 0f); button2.Left.Set(button.Left.Pixels - button2.Width.Pixels - 5f, 0f); button2.Top.Set(40f, 0f); button2.PaddingTop -= 2f; button2.PaddingBottom -= 2f; button2.OnMouseOver += UICommon.FadedMouseOver; button2.OnMouseOut += UICommon.FadedMouseOut; button2.OnClick += this.ToggleEnabled; base.Append(button2); if (properties.modReferences.Length > 0 && !enabled) { string refs = String.Join(", ", properties.modReferences.Select(x => x.mod)); UIHoverImage modReferenceIcon = new UIHoverImage(Main.quicksIconTexture, "This mod depends on: " + refs); modReferenceIcon.Left.Set(button2.Left.Pixels - 10f, 0f); modReferenceIcon.Top.Set(50f, 0f); base.Append(modReferenceIcon); } if (mod.ValidModBrowserSignature) { keyImage = new UIHoverImage(Main.itemTexture[ID.ItemID.GoldenKey], "This mod originated from the Mod Browser"); keyImage.Left.Set(-20, 1f); base.Append(keyImage); } if (ModLoader.ModLoaded(mod.name)) { Mod loadedMod = ModLoader.GetMod(mod.name); int[] values = { loadedMod.items.Count, loadedMod.npcs.Count, loadedMod.tiles.Count, loadedMod.walls.Count, loadedMod.buffs.Count, loadedMod.mountDatas.Count }; string[] strings = { " items", " NPCs", " tiles", " walls", " buffs", " mounts" }; int xOffset = -40; for (int i = 0; i < values.Length; i++) { if (values[i] > 0) { Texture2D iconTexture = Main.instance.infoIconTexture[i]; keyImage = new UIHoverImage(iconTexture, values[i] + strings[i]); keyImage.Left.Set(xOffset, 1f); base.Append(keyImage); xOffset -= 18; } } } }
public override bool Autoload(ref string name) { return(ModLoader.GetLoadedMods().Contains("ThoriumMod")); }
internal static bool ClearEvents(ref bool eventOccurring) { bool canClearEvent = FargoWorld.AbomClearCD <= 0; if (Main.invasionType != 0) { eventOccurring = true; if (canClearEvent) { Main.invasionType = 0; } } if (Main.pumpkinMoon) { eventOccurring = true; if (canClearEvent) { Main.pumpkinMoon = false; } } if (Main.snowMoon) { eventOccurring = true; if (canClearEvent) { Main.snowMoon = false; } } if (Main.eclipse) { eventOccurring = true; if (canClearEvent) { Main.eclipse = false; } } if (Main.bloodMoon) { eventOccurring = true; if (canClearEvent) { Main.bloodMoon = false; } } if (Main.raining) { eventOccurring = true; if (canClearEvent) { Main.raining = false; } } if (Main.slimeRain) { eventOccurring = true; if (canClearEvent) { Main.StopSlimeRain(); Main.slimeWarningDelay = 1; Main.slimeWarningTime = 1; } } if (BirthdayParty.PartyIsUp) { eventOccurring = true; if (canClearEvent) { BirthdayParty.WorldClear(); } } if (DD2Event.Ongoing) { eventOccurring = true; if (canClearEvent) { DD2Event.StopInvasion(); } } if (Sandstorm.Happening) { eventOccurring = true; if (canClearEvent) { Sandstorm.Happening = false; Sandstorm.TimeLeft = 0; } } if (NPC.LunarApocalypseIsUp || NPC.ShieldStrengthTowerNebula > 0 || NPC.ShieldStrengthTowerSolar > 0 || NPC.ShieldStrengthTowerStardust > 0 || NPC.ShieldStrengthTowerVortex > 0) { eventOccurring = true; if (canClearEvent) { NPC.LunarApocalypseIsUp = false; NPC.ShieldStrengthTowerNebula = 0; NPC.ShieldStrengthTowerSolar = 0; NPC.ShieldStrengthTowerStardust = 0; NPC.ShieldStrengthTowerVortex = 0; // Purge all towers for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && (Main.npc[i].type == NPCID.LunarTowerNebula || Main.npc[i].type == NPCID.LunarTowerSolar || Main.npc[i].type == NPCID.LunarTowerStardust || Main.npc[i].type == NPCID.LunarTowerVortex)) { Main.npc[i].dontTakeDamage = false; Main.npc[i].GetGlobalNPC <FargoGlobalNPC>().NoLoot = true; Main.npc[i].StrikeNPCNoInteraction(int.MaxValue, 0f, 0); } } } } foreach (MutantSummonInfo summon in summonTracker.EventSummons) { if ((bool)ModLoader.GetMod(summon.modSource).Call("AbominationnClearEvents", canClearEvent)) { eventOccurring = true; } } if (eventOccurring && canClearEvent) { FargoWorld.AbomClearCD = 7200; } return(eventOccurring && canClearEvent); }
public override void AI() { npc.wet = false; npc.lavaWet = false; npc.honeyWet = false; npc.velocity.X = npc.velocity.Y = 0f; npc.dontTakeDamage = true; npc.immune[255] = 30; if (WorldGen.crimson) { Main.npcTexture[npc.type] = ModLoader.GetTexture("Antiaris/NPCs/Miscellaneous/BrokenMirror2"); } else { Main.npcTexture[npc.type] = ModLoader.GetTexture("Antiaris/NPCs/Miscellaneous/BrokenMirror"); } if (Main.npc[(int)npc.ai[2]].active && Main.npc[(int)npc.ai[2]].type == mod.NPCType("TowerKeeperNonActive")) { this.startRitual = false; } if (AntiarisWorld.DownedTowerKeeper) { this.startRitual = false; } foreach (var golem in Main.npc) { if (!golem.active && (golem.type == mod.NPCType("TowerKeeperNonActive") || golem.type == mod.NPCType("TowerKeeper") || golem.type == mod.NPCType("TowerKeeper2")) && !AntiarisWorld.DownedTowerKeeper) { npc.Transform(mod.NPCType("Mirror")); } } if (startRitual) { npc.ai[0] = -1f; npc.ai[1] = 0.0f; int x = (int)npc.Center.X / 16 + 2; int y = (int)npc.Center.Y / 16 - 15; int boss = NPC.NewNPC(x * 16 + 10, y * 16 - 2, mod.NPCType("TowerKeeperNonActive"), 0, 0.0f, 0.0f, 0.0f, 0.0f, 255); npc.ai[2] = (float)boss; npc.netUpdate = true; startRitual = false; } if (!startRitual && !AntiarisWorld.DownedTowerKeeper) { if (Main.npc[(int)npc.ai[2]].alpha == 0) { ++npc.ai[3]; } if ((double)npc.ai[3] % 3.0 == 1.0 && (double)npc.ai[3] >= 200.0 && (double)npc.ai[3] < 300.0 && Main.netMode != 1) { float speed = (float)(3.0 + (double)Main.rand.NextFloat() * 6.0); Vector2 start = Vector2.UnitY.RotatedByRandom(6.28318548202515); Projectile.NewProjectile(npc.Center.X, npc.Center.Y, start.X * speed, start.Y * speed, mod.ProjectileType("Energy"), 0, 0.0f, Main.myPlayer, Main.npc[(int)npc.ai[2]].Center.X, Main.npc[(int)npc.ai[2]].Center.Y - 5f); } } if (Main.netMode != 1) { npc.homeless = false; npc.homeTileX = -1; npc.homeTileY = -1; npc.netUpdate = true; } }
public override bool Autoload(ref string name) { name = "Squirrel"; return(ModLoader.GetMod("FargowiltasSouls") != null); }
private void TryAddItem(Item item, Chest shop, ref int nextSlot) { const int maxShop = 40; if (item.modItem == null || !item.modItem.mod.Name.Equals("FargowiltasSouls") || nextSlot >= maxShop) { return; } bool duplicateItem = false; if (item.Name.EndsWith("Enchantment")) { foreach (Item item2 in shop.item) { if (item2.type == item.type) { duplicateItem = true; break; } } if (duplicateItem == false && nextSlot < maxShop) { shop.item[nextSlot].SetDefaults(item.type); nextSlot++; } } else if (item.Name.Contains("Force")) { RecipeFinder finder = new RecipeFinder(); finder.SetResult(item.type); Recipe exactRecipe = finder.SearchRecipes()[0]; foreach (Item item2 in exactRecipe.requiredItem) { foreach (Item item3 in shop.item) { if (item3.type == item2.type) { duplicateItem = true; break; } } if (duplicateItem == false && nextSlot < maxShop) { if (item2.Name.Contains("Enchantment")) { shop.item[nextSlot].SetDefaults(item2.type); nextSlot++; } } } } else if (item.Name.StartsWith("Soul")) { RecipeFinder finder = new RecipeFinder(); finder.SetResult(item.type); Recipe exactRecipe = finder.SearchRecipes()[0]; foreach (Item item2 in exactRecipe.requiredItem) { foreach (Item item3 in shop.item) { if (item3.type == item2.type) { duplicateItem = true; break; } } if (duplicateItem == false && nextSlot < maxShop) { if (item2.Name.Contains("Force") || item2.Name.Contains("Soul")) { shop.item[nextSlot].SetDefaults(item2.type); nextSlot++; } } } } else if (item.Name.EndsWith("Essence")) { foreach (Item item2 in shop.item) { if (item2.type == item.type) { duplicateItem = true; break; } } if (duplicateItem == false && nextSlot < maxShop) { shop.item[nextSlot].SetDefaults(item.type); nextSlot++; } } else if (item.Name.EndsWith("Soul")) { RecipeFinder finder = new RecipeFinder(); finder.SetResult(item.type); Recipe exactRecipe = finder.SearchRecipes()[0]; foreach (Item item2 in exactRecipe.requiredItem) { foreach (Item item3 in shop.item) { if (item3.type == item2.type) { duplicateItem = true; break; } } if (duplicateItem == false && nextSlot < maxShop) { if (item2.Name.EndsWith("Essence")) { shop.item[nextSlot].SetDefaults(item2.type); nextSlot++; } } } duplicateItem = false; foreach (Item item4 in shop.item) { if (item4.type == item.type) { duplicateItem = true; break; } } if (duplicateItem == false && nextSlot < maxShop) { shop.item[nextSlot].SetDefaults(item.type); nextSlot++; } } else if (item.type == ModLoader.GetMod("FargowiltasSouls").ItemType("AeolusBoots")) { foreach (Item item2 in shop.item) { if (item2.type == ItemID.FrostsparkBoots || item2.type == ItemID.BalloonHorseshoeFart) { duplicateItem = true; break; } } if (duplicateItem == false && nextSlot < maxShop) { shop.item[nextSlot].SetDefaults(ItemID.FrostsparkBoots); nextSlot++; } if (duplicateItem == false && nextSlot < maxShop) { shop.item[nextSlot].SetDefaults(ItemID.BalloonHorseshoeFart); nextSlot++; } } }
public override void Update(Player player, ref int buffIndex) { if (player.HasBuff(mod.BuffType("MageComb")) || player.HasBuff(mod.BuffType("RangerComb")) || player.HasBuff(mod.BuffType("BattleComb"))) { ++player.maxMinions; ++player.maxMinions; player.buffImmune[13] = true; player.buffImmune[110] = true; player.buffImmune[115] = true; player.buffImmune[150] = true; } else { if (ModLoader.GetMod("CalamityMod") != null) { if (!player.HasBuff(ModLoader.GetMod("CalamityMod").BuffType("HolyWrathBuff"))) { player.thrownDamage += 0.1f; player.meleeDamage += 0.1f; player.rangedDamage += 0.1f; player.magicDamage += 0.1f; player.minionDamage += 0.1f; } if (!player.HasBuff(ModLoader.GetMod("CalamityMod").BuffType("HolyWrathBuff"))) { CalamityBoost(player); } } if (ModLoader.GetMod("CalamityMod") == null) { player.thrownDamage += 0.1f; player.meleeDamage += 0.1f; player.rangedDamage += 0.1f; player.magicDamage += 0.1f; player.minionDamage += 0.1f; } ++player.maxMinions; ++player.maxMinions; player.buffImmune[13] = true; player.buffImmune[110] = true; player.buffImmune[115] = true; player.buffImmune[150] = true; if (ModLoader.GetMod("ThoriumMod") != null) { ThoriumBoosts(player); } if (ModLoader.GetMod("Redemption") != null) { RedemptionBoost(player); } } if (ModLoader.GetMod("MorePotions") != null) { if (player.HasBuff(mod.BuffType("MorePotionsComb")) || player.HasBuff(ModLoader.GetMod("MorePotions").BuffType("SoulbindingElixerPotionBuff"))) { --player.maxMinions; } } }
public override bool Shoot(Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { penCount = 0; if (item.thrown) { if (item.useAmmo == ItemID.Javelin) { //Javelins if (type == mod.ProjectileType("TrueSapphireJavelin")) { tempDmgJavelin = 10; tempUseTimeJavelin = 14; tempUseAnimationJavelin = 12; } else if (type == mod.ProjectileType("SapphireJavelin")) { tempDmgJavelin = 5; tempUseTimeJavelin = 10; tempUseAnimationJavelin = 10; } else if (type == mod.ProjectileType("TrueDiamondJavelin") || type == mod.ProjectileType("TrueAmberJavelin") || type == mod.ProjectileType("TrueHellfireJavelin") || type == mod.ProjectileType("TrueJesterJavelin") || type == mod.ProjectileType("TrueMeteorJavelin")) { tempUseTimeJavelin = 8; tempUseAnimationJavelin = 8; } else if (type == mod.ProjectileType("DiamondJavelin") || type == mod.ProjectileType("AmberJavelin") || type == mod.ProjectileType("TrueAmethystJavelin") || type == mod.ProjectileType("TrueTopazJavelin") || type == mod.ProjectileType("TrueEmeraldJavelin") || type == mod.ProjectileType("TrueRubyJavelin") || type == mod.ProjectileType("SplinterJavelin")) { tempUseTimeJavelin = 4; tempUseAnimationJavelin = 4; } if ((tempTypeJavelin != type) && tempTypeTrueJavelin == false) { tempDmgJavelin2 = tempDmgJavelin; tempUseTimeJavelin2 = tempUseTimeJavelin; tempUseAnimationJavelin2 = tempUseAnimationJavelin; item.damage -= tempDmgJavelin; item.useTime -= tempUseTimeJavelin; item.useAnimation -= tempUseAnimationJavelin; tempTypeTrueJavelin = true; tempTypeJavelin = type; } else if ((tempTypeJavelin != type) && tempTypeTrueJavelin == true) { item.damage += tempDmgJavelin2; item.useTime += tempUseTimeJavelin2; item.useAnimation += tempUseAnimationJavelin2; tempTypeTrueJavelin = false; } if (item.useTime < 2 || item.useAnimation < 2) { item.useTime = 2; item.useAnimation = 2; } } else if (item.useAmmo == ItemID.ThrowingKnife) { //Knives if (type == ProjectileID.ShadowFlameKnife) { tempUseTimeKnife = 3; tempUseAnimationKnife = 3; } else if (type == ProjectileID.FrostDaggerfish) { tempUseTimeKnife = 2; tempUseAnimationKnife = 2; } else if (type == ProjectileID.BoneDagger) { tempUseTimeKnife = 1; tempUseAnimationKnife = 1; } else if (ModLoader.GetMod("ThoriumMod") != null) { if (type == ModLoader.GetMod("ThoriumMod").ProjectileType("BlackDaggerPro")) { tempUseTimeKnife = 6; tempUseAnimationKnife = 6; } } if ((tempTypeKnife != type) && tempTypeKnifeTrue == false) { tempDmgKnife2 = tempDmgKnife; tempUseTimeKnife2 = tempUseTimeKnife; tempUseAnimationKnife2 = tempUseAnimationKnife; item.damage -= tempDmgKnife; item.useTime -= tempUseTimeKnife; item.useAnimation -= tempUseAnimationKnife; tempTypeKnifeTrue = true; tempTypeKnife = type; } else if ((tempTypeKnife != type) && tempTypeKnifeTrue == true) { item.damage += tempDmgKnife2; item.useTime += tempUseTimeKnife2; item.useAnimation += tempUseAnimationKnife2; tempTypeKnifeTrue = false; } if (item.useTime < 2 || item.useAnimation < 2) { item.useTime = 2; item.useAnimation = 2; } } else if (item.useAmmo == ItemID.Shuriken) { if ((tempTypeShuriken != type) && tempTypeShurikenTrue == false) { tempDmgShuriken2 = tempDmgShuriken; tempUseTimeShuriken2 = tempUseTimeShuriken; tempUseAnimationShuriken2 = tempUseAnimationShuriken; item.damage -= tempDmgShuriken; item.useTime -= tempUseTimeShuriken; item.useAnimation -= tempUseAnimationShuriken; tempTypeShurikenTrue = true; tempTypeShuriken = type; } else if ((tempTypeShuriken != type) && tempTypeShurikenTrue == true) { item.damage += tempDmgShuriken2; item.useTime += tempUseTimeShuriken2; item.useAnimation += tempUseAnimationShuriken2; tempTypeShurikenTrue = false; } if (item.useTime < 2 || item.useAnimation < 2) { item.useTime = 2; item.useAnimation = 2; } } else if (item.useAmmo == ItemID.Grenade) { //Grenades if (type == ProjectileID.HappyBomb) { tempUseTimeGrenade = 20; tempUseAnimationGrenade = 20; } else if (type == ProjectileID.Beenade || type == mod.ProjectileType("Waspnade")) { tempDmgGrenade = 20; tempUseTimeGrenade = 20; tempUseAnimationGrenade = 20; } else if (type == mod.ProjectileType("ShroomNade")) { tempUseTimeGrenade = 10; tempUseAnimationGrenade = 10; } else if (type == mod.ProjectileType("IchorGrenade")) { tempUseTimeGrenade = 12; tempUseAnimationGrenade = 12; } else if (type == mod.ProjectileType("CursedGrenade")) { tempUseTimeGrenade = 14; tempUseAnimationGrenade = 14; } else if (type == ProjectileID.BouncyGrenade || type == ProjectileID.MolotovCocktail) { tempUseTimeGrenade = 5; tempUseAnimationGrenade = 5; } if ((tempTypeGrenade != type) && tempTypeGrenadeTrue == false) { tempDmgGrenade2 = tempDmgGrenade; tempUseTimeGrenade2 = tempUseTimeGrenade; tempUseAnimationGrenade2 = tempUseAnimationGrenade; item.damage -= tempDmgGrenade; item.useTime -= tempUseTimeGrenade; item.useAnimation -= tempUseAnimationGrenade; tempTypeGrenadeTrue = true; tempTypeGrenade = type; } else if ((tempTypeGrenade != type) && tempTypeGrenadeTrue == true) { item.damage += tempDmgGrenade2; item.useTime += tempUseTimeGrenade2; item.useAnimation += tempUseAnimationGrenade2; tempTypeGrenadeTrue = false; } if (item.useTime < 2 || item.useAnimation < 2) { item.useTime = 2; item.useAnimation = 2; } } int actualShots = 1; int chance = 0; int fired = 0; int odd = 0; int checkOdd = 0; int even = 0; int checkEven = -1; float rotation = MathHelper.ToRadians(6f); position += Vector2.Normalize(new Vector2(speedX, speedY)) * 6f; for (int shots = 0; shots < numberShots; shots++) { if (Main.rand.NextFloat() < chanceShots) { chance += 1; } } actualShots = chance + 1; for (int shots = 0; shots < actualShots; shots++) { if (fired % 2 != 1 && actualShots % 2 != 1) { even = 1; } if (fired == 0) { checkEven -= 1; } Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(rotation / (1 - checkOdd - checkEven) * (fired - odd % 2 + even)); // Watch out for dividing by 0 if there is only 1 projectile. Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI); rotation = -rotation; if (fired % 2 != 1) { even = 0; } fired += 1; if (fired != 1 && actualShots % 2 != 0) { odd += 1; } if (fired == 1) { checkOdd -= 1; } penCount += 1; } return(false); } else { return(true); } }
public override bool CanUseItem(Player player) { if (NPC.downedSlimeKing) { item.damage = 25; } if (NPC.downedBoss1) { item.damage = 30; } if (NPC.downedBoss2) { item.damage = 35; } if (NPC.downedQueenBee) { item.damage = 40; } if (NPC.downedBoss3) { item.damage = 45; } if (Main.hardMode) { item.damage = 50; } if (NPC.downedMechBossAny) { item.damage = 75; } if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3) { item.damage = 100; } if (NPC.downedPlantBoss) { item.damage = 125; } if (NPC.downedGolemBoss) { item.damage = 150; } if (NPC.downedFishron) { item.damage = 200; } if (NPC.downedAncientCultist) { item.damage = 300; } if (NPC.downedMoonlord) { item.damage = 500; } if (ModLoader.GetLoadedMods().Contains("CalamityMod")) { if (CalamityModDownedGuardian) { item.damage = 600; } } if (ModLoader.GetLoadedMods().Contains("ThoriumMod")) { if (ThoriumModDownedRagnarok) { item.damage = 1000; } } if (ModLoader.GetLoadedMods().Contains("CalamityMod")) { if (CalamityModDownedProvidence) { item.damage = 1200; } if (CalamityModDownedPolter) { item.damage = 1500; } if (CalamityModDownedDOG) { item.damage = 3500; } if (CalamityModDownedYharon) { item.damage = 6000; } if (CalamityModDownedSCal) { item.damage = 10000; } } return(true); }
private void ReloadMods(UIMouseEvent evt, UIElement listeningElement) { SoundEngine.PlaySound(10, -1, -1, 1); if (items.Count > 0) ModLoader.Reload(); }
public virtual void emptyBagOnMagicStorage(Player p, int x, int y) { Mod magicStorage = ModLoader.GetMod("MagicStorage"); if (magicStorage != null) { try { if (Main.tile[x, y].frameX % 36 == 18) { x--; } if (Main.tile[x, y].frameY % 36 == 18) { y--; } ModTile t = TileLoader.GetTile(Main.tile[x, y].type); MethodInfo getHeart = (t.GetType()).GetMethod("GetHeart", BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(int), typeof(int) }, null); if (getHeart == null) { BagsOfHoldingMod.debugChat("GetHeart() is null. Report to author."); ErrorLogger.Log("GetHeart() is null on " + (Main.netMode == NetmodeID.MultiplayerClient ? "client" : "server")); return; } object[] param = new object[2]; param[0] = x; param[1] = y; TileEntity heart = (TileEntity)getHeart.Invoke(t, param); if (heart == null) { BagsOfHoldingMod.sendChat("This Access does not have an associated Storage Heart."); return; } Type[] depCal = new Type[1]; depCal[0] = typeof(Item); MethodInfo deposit = heart.GetType().GetMethod("DepositItem", BindingFlags.Public | BindingFlags.Instance, null, depCal, null); if (deposit == null) { BagsOfHoldingMod.debugChat("DepositItem(Item) is null. Report to author."); ErrorLogger.Log("DepositItem(Item) is null on " + (Main.netMode == NetmodeID.MultiplayerClient ? "client" : "server")); return; } for (int i = 0; i < order.Count; i++) { if (items.ContainsKey(order[i])) { long remain = items.GetAsLong(order[i]); bool prematureBreak = false; while (remain > 0 && !prematureBreak) { Item itm = getItemFromTag(order[i]); int stackSize = (int)Math.Min(remain, itm.maxStack); itm.stack = stackSize; deposit.Invoke(heart, new object[] { itm }); if (itm.IsAir) { remain -= stackSize; } else { remain -= (stackSize - itm.stack); prematureBreak = true; } } items.Remove(order[i]); if (remain > 0) { items[order[i]] = remain; } } } }catch (Exception e) { BagsOfHoldingMod.debugChat(e.ToString()); } if (Main.netMode == NetmodeID.MultiplayerClient) { ModPacket pack = mod.GetPacket(); pack.Write((byte)2); pack.Write((byte)p.whoAmI); pack.Write((byte)p.selectedItem); TagIO.Write(items, pack); pack.Send(); } } }
public override void AddRecipeGroups() { //drax RecipeGroup group = new RecipeGroup(() => Lang.misc[37] + " Drax", ItemID.Drax, ItemID.PickaxeAxe); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyDrax", group); //cobalt group = new RecipeGroup(() => Lang.misc[37] + " Cobalt Repeater", ItemID.CobaltRepeater, ItemID.PalladiumRepeater); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyCobaltRepeater", group); //mythril group = new RecipeGroup(() => Lang.misc[37] + " Mythril Repeater", ItemID.MythrilRepeater, ItemID.OrichalcumRepeater); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyMythrilRepeater", group); //adamantite group = new RecipeGroup(() => Lang.misc[37] + " Adamantite Repeater", ItemID.AdamantiteRepeater, ItemID.TitaniumRepeater); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyAdamantiteRepeater", group); if (Instance.ThoriumLoaded) { Mod thorium = ModLoader.GetMod("ThoriumMod"); //combo yoyos group = new RecipeGroup(() => Lang.misc[37] + " Combination Yoyo", thorium.ItemType("Nocturnal"), thorium.ItemType("Sanguine")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyThoriumYoyo", group); } if (Instance.CalamityLoaded) { Mod calamity = ModLoader.GetMod("CalamityMod"); //aerospec group = new RecipeGroup(() => Lang.misc[37] + " Aerospec Helmet", calamity.ItemType("AerospecHat"), calamity.ItemType("AerospecHeadgear"), calamity.ItemType("AerospecHelm"), calamity.ItemType("AerospecHood"), calamity.ItemType("AerospecHelmet")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyAerospecHelmet", group); //ataxia group = new RecipeGroup(() => Lang.misc[37] + " Ataxia Helmet", calamity.ItemType("AtaxiaHeadgear"), calamity.ItemType("AtaxiaHelm"), calamity.ItemType("AtaxiaHood"), calamity.ItemType("AtaxiaHelmet"), calamity.ItemType("AtaxiaMask")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyAtaxiaHelmet", group); //auric group = new RecipeGroup(() => Lang.misc[37] + " Auric Helmet", calamity.ItemType("AuricTeslaHelm"), calamity.ItemType("AuricTeslaPlumedHelm"), calamity.ItemType("AuricTeslaHoodedFacemask"), calamity.ItemType("AuricTeslaSpaceHelmet"), calamity.ItemType("AuricTeslaWireHemmedVisage")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyAuricHelmet", group); //bloodflare group = new RecipeGroup(() => Lang.misc[37] + " Bloodflare Helmet", calamity.ItemType("BloodflareHelm"), calamity.ItemType("BloodflareHelmet"), calamity.ItemType("BloodflareHornedHelm"), calamity.ItemType("BloodflareHornedMask"), calamity.ItemType("BloodflareMask")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyBloodflareHelmet", group); //daedalus group = new RecipeGroup(() => Lang.misc[37] + " Daedalus Helmet", calamity.ItemType("DaedalusHelm"), calamity.ItemType("DaedalusHelmet"), calamity.ItemType("DaedalusHat"), calamity.ItemType("DaedalusHeadgear"), calamity.ItemType("DaedalusVisor")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyDaedalusHelmet", group); //godslayer group = new RecipeGroup(() => Lang.misc[37] + " Godslayer Helmet", calamity.ItemType("GodSlayerHelm"), calamity.ItemType("GodSlayerHelmet"), calamity.ItemType("GodSlayerVisage"), calamity.ItemType("GodSlayerHornedHelm"), calamity.ItemType("GodSlayerMask")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyGodslayerHelmet", group); //reaver group = new RecipeGroup(() => Lang.misc[37] + " Reaver Helmet", calamity.ItemType("ReaverHelm"), calamity.ItemType("ReaverVisage"), calamity.ItemType("ReaverMask"), calamity.ItemType("ReaverHelmet"), calamity.ItemType("ReaverCap")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyReaverHelmet", group); //silva group = new RecipeGroup(() => Lang.misc[37] + " Silva Helmet", calamity.ItemType("SilvaHelm"), calamity.ItemType("SilvaHornedHelm"), calamity.ItemType("SilvaMaskedCap"), calamity.ItemType("SilvaHelmet"), calamity.ItemType("SilvaMask")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnySilvaHelmet", group); //statigel group = new RecipeGroup(() => Lang.misc[37] + " Statigel Helmet", calamity.ItemType("StatigelHelm"), calamity.ItemType("StatigelHeadgear"), calamity.ItemType("StatigelCap"), calamity.ItemType("StatigelHood"), calamity.ItemType("StatigelMask")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyStatigelHelmet", group); //tarragon group = new RecipeGroup(() => Lang.misc[37] + " Tarragon Helmet", calamity.ItemType("TarragonHelm"), calamity.ItemType("TarragonVisage"), calamity.ItemType("TarragonMask"), calamity.ItemType("TarragonHornedHelm"), calamity.ItemType("TarragonHelmet")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyTarragonHelmet", group); //victide group = new RecipeGroup(() => Lang.misc[37] + " Victide Helmet", calamity.ItemType("VictideHelm"), calamity.ItemType("VictideVisage"), calamity.ItemType("VictideMask"), calamity.ItemType("VictideHelmet"), calamity.ItemType("VictideHeadgear")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyVictideHelmet", group); //wulfrum group = new RecipeGroup(() => Lang.misc[37] + " Wulfrum Helmet", calamity.ItemType("WulfrumHelm"), calamity.ItemType("WulfrumHeadgear"), calamity.ItemType("WulfrumHood"), calamity.ItemType("WulfrumHelmet"), calamity.ItemType("WulfrumMask")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyWulfrumHelmet", group); } if (Instance.SOALoaded) { Mod soa = ModLoader.GetMod("SacredTools"); //flarium group = new RecipeGroup(() => Lang.misc[37] + " Flarium Helmet", soa.ItemType("FlariumCowl"), soa.ItemType("FlariumHelmet"), soa.ItemType("FlariumHood"), soa.ItemType("FlariumCrown"), soa.ItemType("FlariumMask")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyFlariumHelmet", group); //asthraltite group = new RecipeGroup(() => Lang.misc[37] + " Asthraltite Helmet", soa.ItemType("AsthralMelee"), soa.ItemType("AsthralRanged"), soa.ItemType("AsthralMage"), soa.ItemType("AsthralSummon"), soa.ItemType("AsthralThrown")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyAstralHelmet", group); } //evil wood group = new RecipeGroup(() => Lang.misc[37] + " Evil Wood", ItemID.Ebonwood, ItemID.Shadewood); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyEvilWood", group); //anvil HM group = new RecipeGroup(() => Lang.misc[37] + " Mythril Anvil", ItemID.MythrilAnvil, ItemID.OrichalcumAnvil); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyAnvil", group); //forge HM group = new RecipeGroup(() => Lang.misc[37] + " Adamantite Forge", ItemID.AdamantiteForge, ItemID.TitaniumForge); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyForge", group); //any adamantite group = new RecipeGroup(() => Lang.misc[37] + " Adamantite Bar", ItemID.AdamantiteBar, ItemID.TitaniumBar); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyAdamantite", group); //shroomite head group = new RecipeGroup(() => Lang.misc[37] + " Shroomite Head Piece", ItemID.ShroomiteHeadgear, ItemID.ShroomiteMask, ItemID.ShroomiteHelmet); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyShroomHead", group); //orichalcum head group = new RecipeGroup(() => Lang.misc[37] + " Orichalcum Head Piece", ItemID.OrichalcumHeadgear, ItemID.OrichalcumMask, ItemID.OrichalcumHelmet); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyOriHead", group); //palladium head group = new RecipeGroup(() => Lang.misc[37] + " Palladium Head Piece", ItemID.PalladiumHeadgear, ItemID.PalladiumMask, ItemID.PalladiumHelmet); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyPallaHead", group); //cobalt head group = new RecipeGroup(() => Lang.misc[37] + " Cobalt Head Piece", ItemID.CobaltHelmet, ItemID.CobaltHat, ItemID.CobaltMask); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyCobaltHead", group); //mythril head group = new RecipeGroup(() => Lang.misc[37] + " Mythril Head Piece", ItemID.MythrilHat, ItemID.MythrilHelmet, ItemID.MythrilHood); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyMythrilHead", group); //titanium head group = new RecipeGroup(() => Lang.misc[37] + " Titanium Head Piece", ItemID.TitaniumHeadgear, ItemID.TitaniumMask, ItemID.TitaniumHelmet); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyTitaHead", group); //hallowed head group = new RecipeGroup(() => Lang.misc[37] + " Hallowed Head Piece", ItemID.HallowedMask, ItemID.HallowedHeadgear, ItemID.HallowedHelmet); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyHallowHead", group); //adamantite head group = new RecipeGroup(() => Lang.misc[37] + " Adamantite Head Piece", ItemID.AdamantiteHelmet, ItemID.AdamantiteMask, ItemID.AdamantiteHeadgear); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyAdamHead", group); //chloro head group = new RecipeGroup(() => Lang.misc[37] + " Chlorophyte Head Piece", ItemID.ChlorophyteMask, ItemID.ChlorophyteHelmet, ItemID.ChlorophyteHeadgear); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyChloroHead", group); //spectre head group = new RecipeGroup(() => Lang.misc[37] + " Spectre Head Piece", ItemID.SpectreHood, ItemID.SpectreMask); RecipeGroup.RegisterGroup("FargowiltasSouls:AnySpectreHead", group); //book cases group = new RecipeGroup(() => Lang.misc[37] + " Wooden Bookcase", ItemID.Bookcase, ItemID.EbonwoodBookcase, ItemID.RichMahoganyBookcase, ItemID.LivingWoodBookcase, ItemID.ShadewoodBookcase, ItemID.PalmWoodBookcase, ItemID.BorealWoodBookcase); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyBookcase", group); //beetle body group = new RecipeGroup(() => Lang.misc[37] + " Beetle Body", ItemID.BeetleShell, ItemID.BeetleScaleMail); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyBeetle", group); //phasesabers group = new RecipeGroup(() => Lang.misc[37] + " Phasesaber", ItemID.RedPhasesaber, ItemID.BluePhasesaber, ItemID.GreenPhasesaber, ItemID.PurplePhasesaber, ItemID.WhitePhasesaber, ItemID.YellowPhasesaber); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyPhasesaber", group); //vanilla butterflies group = new RecipeGroup(() => Lang.misc[37] + " Butterfly", ItemID.JuliaButterfly, ItemID.MonarchButterfly, ItemID.PurpleEmperorButterfly, ItemID.RedAdmiralButterfly, ItemID.SulphurButterfly, ItemID.TreeNymphButterfly, ItemID.UlyssesButterfly, ItemID.ZebraSwallowtailButterfly); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyButterfly", group); if (ThoriumLoaded) { Mod thorium = ModLoader.GetMod("ThoriumMod"); //jester mask group = new RecipeGroup(() => Lang.misc[37] + " Jester Mask", thorium.ItemType("JestersMask"), thorium.ItemType("JestersMask2")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyJesterMask", group); //jester shirt group = new RecipeGroup(() => Lang.misc[37] + " Jester Shirt", thorium.ItemType("JestersShirt"), thorium.ItemType("JestersShirt2")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyJesterShirt", group); //jester legging group = new RecipeGroup(() => Lang.misc[37] + " Jester Leggings", thorium.ItemType("JestersLeggings"), thorium.ItemType("JestersLeggings2")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyJesterLeggings", group); //evil wood tambourine group = new RecipeGroup(() => Lang.misc[37] + " Evil Wood Tambourine", thorium.ItemType("EbonWoodTambourine"), thorium.ItemType("ShadeWoodTambourine")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyTambourine", group); //fan letter group = new RecipeGroup(() => Lang.misc[37] + " Fan Letter", thorium.ItemType("FanLetter"), thorium.ItemType("FanLetter2")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyLetter", group); //butterflies group = new RecipeGroup(() => Lang.misc[37] + " Dungeon Butterfly", thorium.ItemType("BlueDungeonButterfly"), thorium.ItemType("GreenDungeonButterfly"), thorium.ItemType("PinkDungeonButterfly")); RecipeGroup.RegisterGroup("FargowiltasSouls:AnyDungeonButterfly", group); } }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoPlayer modPlayer = player.GetModPlayer <FargoPlayer>(); //auto use, debuffs, mana up modPlayer.Eternity = true; //UNIVERSE modPlayer.UniverseEffect = true; modPlayer.AllDamageUp(2.5f); if (player.GetToggleValue("Universe")) { modPlayer.AttackSpeed += 2.5f; } player.maxMinions += 20; player.maxTurrets += 10; //accessorys if (player.GetToggleValue("YoyoBag", false)) { player.counterWeight = 556 + Main.rand.Next(6); player.yoyoGlove = true; player.yoyoString = true; } if (player.GetToggleValue("Sniper")) { player.scope = true; } player.manaFlower = true; player.manaMagnet = true; player.magicCuffs = true; player.manaCost -= 0.5f; //DIMENSIONS player.statLifeMax2 *= 5; player.buffImmune[BuffID.ChaosState] = true; modPlayer.ColossusSoul(0, 0.4f, 15, hideVisual); modPlayer.SupersonicSoul(hideVisual); modPlayer.FlightMasterySoul(); modPlayer.TrawlerSoul(hideVisual); modPlayer.WorldShaperSoul(hideVisual); //TERRARIA mod.GetItem("TerrariaSoul").UpdateAccessory(player, hideVisual); //M*******T mod.GetItem("MasochistSoul").UpdateAccessory(player, hideVisual); if (ModLoader.GetMod("FargowiltasSoulsDLC") != null) { Mod fargoDLC = ModLoader.GetMod("FargowiltasSoulsDLC"); if (ModLoader.GetMod("ThoriumMod") != null) { fargoDLC.GetItem("ThoriumSoul").UpdateAccessory(player, hideVisual); } if (ModLoader.GetMod("CalamityMod") != null) { fargoDLC.GetItem("CalamitySoul").UpdateAccessory(player, hideVisual); } if (ModLoader.GetMod("SacredTools") != null) { fargoDLC.GetItem("SoASoul").UpdateAccessory(player, hideVisual); } } }
//Needed to stop ModLoader from assigning a default display name public override void AutoStaticDefaults() { Main.itemTexture[item.type] = ModLoader.GetTexture(Texture); }
public override bool CanUseItem(Player player) { Mod calamityMod = ModLoader.GetMod("CalamityMod"); return((bool)calamityMod.Call("GetBossDowned", "devourerofgods")); }
public override void AI() { Mod orthoceraDLC = ModLoader.GetMod("CalValPlus"); if (CalValEX.month != 4 && orthoceraDLC == null) { npc.active = false; } int num2 = (int)((double)npc.lifeMax * 0.1); if (npc.ai[3] == 0f && npc.life > 0) { npc.ai[3] = npc.lifeMax; } if (npc.life <= 0 || Main.netMode == 1) { return; } if ((float)(npc.life + num2) < npc.ai[3]) { npc.ai[3] = npc.life; int num1 = (ModLoader.GetMod("CalamityMod").NPCType("Providence")); if (!prov1) { prov1 = true; } else if (!prov2) { prov2 = true; num1 = (ModLoader.GetMod("CalamityMod").NPCType("Providence")); } else if (!prov3) { prov3 = true; num1 = (ModLoader.GetMod("CalamityMod").NPCType("Providence")); } else if (!dog1) { dog1 = true; num1 = (ModLoader.GetMod("CalamityMod").NPCType("DevourerofGodsHead")); } else if (!dog2) { dog2 = true; num1 = (ModLoader.GetMod("CalamityMod").NPCType("DevourerofGodsHead")); } else if (!dog3) { dog3 = true; num1 = (ModLoader.GetMod("CalamityMod").NPCType("DevourerofGodsHead")); } else if (!yharon1) { yharon1 = true; num1 = (ModLoader.GetMod("CalamityMod").NPCType("Yharon")); } else if (!yharon2) { yharon2 = true; num1 = (ModLoader.GetMod("CalamityMod").NPCType("Yharon")); } else if (!yharon3) { yharon3 = true; num1 = (ModLoader.GetMod("CalamityMod").NPCType("Yharon")); } else if (!scal1) { scal1 = true; num1 = (ModLoader.GetMod("CalamityMod").NPCType("Yharon")); } NPC.SpawnOnPlayer(npc.FindClosestPlayer(), num1); NPC.SpawnOnPlayer(npc.FindClosestPlayer(), (ModLoader.GetMod("CalamityMod").NPCType("Polterghast"))); } }
public override string GetChat() { string EntryM1 = Language.GetTextValue("Mods.AlchemistNPC.EntryM1"); string EntryM2 = Language.GetTextValue("Mods.AlchemistNPC.EntryM2"); string EntryM3 = Language.GetTextValue("Mods.AlchemistNPC.EntryM3"); string EntryM4 = Language.GetTextValue("Mods.AlchemistNPC.EntryM4"); string EntryM5 = Language.GetTextValue("Mods.AlchemistNPC.EntryM5"); string EntryM6 = Language.GetTextValue("Mods.AlchemistNPC.EntryM6"); string EntryM7 = Language.GetTextValue("Mods.AlchemistNPC.EntryM7"); string EntryM8 = Language.GetTextValue("Mods.AlchemistNPC.EntryM8"); string EntryM9 = Language.GetTextValue("Mods.AlchemistNPC.EntryM9"); string EntryM10 = Language.GetTextValue("Mods.AlchemistNPC.EntryM10"); string EntryM11 = Language.GetTextValue("Mods.AlchemistNPC.EntryM11"); string EntryM12 = Language.GetTextValue("Mods.AlchemistNPC.EntryM12"); string EntryM13 = Language.GetTextValue("Mods.AlchemistNPC.EntryM13"); string EntryM14 = Language.GetTextValue("Mods.AlchemistNPC.EntryM14"); string EntryM15 = Language.GetTextValue("Mods.AlchemistNPC.EntryM15"); string EntryM16 = Language.GetTextValue("Mods.AlchemistNPC.EntryM16"); string EntryM17 = Language.GetTextValue("Mods.AlchemistNPC.EntryM17"); string EntryM18 = Language.GetTextValue("Mods.AlchemistNPC.EntryM18"); string EntryM19 = Language.GetTextValue("Mods.AlchemistNPC.EntryM19"); string EntryM20 = Language.GetTextValue("Mods.AlchemistNPC.EntryM20"); string EntryM21 = Language.GetTextValue("Mods.AlchemistNPC.EntryM21"); string Gamma = Language.GetTextValue("Mods.AlchemistNPC.Gamma"); int Cyborg = NPC.FindFirstNPC(NPCID.Cyborg); int Mechanic = NPC.FindFirstNPC(NPCID.Mechanic); int Clothier = NPC.FindFirstNPC(NPCID.Clothier); int Wizard = NPC.FindFirstNPC(NPCID.Wizard); int Explorer = NPC.FindFirstNPC(mod.NPCType("Explorer")); int Musician = NPC.FindFirstNPC(mod.NPCType("Musician")); if (Main.musicVolume == 0) { return(EntryM19); } if (Main.bloodMoon) { return(EntryM20); } if (Cyborg >= 0 && Main.npc[Cyborg].GivenName == "Gamma" && Main.npc[Musician].GivenName == Gamma && Main.rand.Next(15) == 0) { return(EntryM3); } if (Explorer >= 0 && Main.rand.Next(20) == 0) { return(EntryM7); } if (Mechanic >= 0 && Main.rand.Next(20) == 0) { return(EntryM8 + Main.npc[Mechanic].GivenName + EntryM9); } if (Wizard >= 0 && Main.rand.Next(20) == 0) { return(EntryM10 + Main.npc[Wizard].GivenName + EntryM11); } if (Clothier >= 0 && Main.rand.Next(20) == 0) { return(EntryM12 + Main.npc[Clothier].GivenName + EntryM13); } if (ModLoader.GetLoadedMods().Contains("ThoriumMod")) { if (Main.rand.Next(15) == 0) { return(EntryM18); } } if (ModLoader.GetLoadedMods().Contains("CalamityModMusic")) { if (Main.rand.Next(15) == 0) { return(EntryM17); } } switch (Main.rand.Next(9)) { case 0: return(EntryM1); case 1: return(EntryM2); case 2: return(EntryM4); case 3: return(EntryM5); case 4: return(EntryM6); case 5: return(EntryM14); case 6: return(EntryM15); case 7: return(EntryM16); case 8: return(EntryM21); default: return(EntryM1); } }
public override void Load() { instance = this; herosmod = ModLoader.GetMod("HEROsMod"); }
public override void SetupShop(Chest shop, ref int nextSlot) { if (S1) { if (!NPC.downedMechBossAny) { shop.item[nextSlot].SetDefaults(576); nextSlot++; } if (NPC.downedMechBossAny) { shop.item[nextSlot].SetDefaults(562); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(563); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(564); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(565); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(566); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(568); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(569); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(570); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(571); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(573); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1596); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1597); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1598); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1600); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1601); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1602); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1603); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1604); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1605); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1608); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1610); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(1964); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(2742); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(3237); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(3796); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; if (NPC.downedPlantBoss) { shop.item[nextSlot].SetDefaults(567); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(572); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; shop.item[nextSlot].SetDefaults(574); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; if (NPC.downedQueenBee) { shop.item[nextSlot].SetDefaults(1599); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } if (NPC.downedGolemBoss) { shop.item[nextSlot].SetDefaults(1607); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } shop.item[nextSlot].SetDefaults(1606); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; if (NPC.downedMoonlord) { shop.item[nextSlot].SetDefaults(3044); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } if (NPC.downedGoblins) { shop.item[nextSlot].SetDefaults(3371); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } if (NPC.downedPirates) { shop.item[nextSlot].SetDefaults(3236); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } if (DD2Event.DownedInvasionT1) { shop.item[nextSlot].SetDefaults(3869); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } shop.item[nextSlot].SetDefaults(1609); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; if (NPC.downedHalloweenKing) { shop.item[nextSlot].SetDefaults(1963); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } if (NPC.downedChristmasIceQueen) { shop.item[nextSlot].SetDefaults(1965); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } if (NPC.downedMartians) { shop.item[nextSlot].SetDefaults(3235); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } if (NPC.downedMoonlord) { shop.item[nextSlot].SetDefaults(3370); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } } } } if (S2) { if (ModLoader.GetLoadedMods().Contains("CalamityMod") && ModLoader.GetLoadedMods().Contains("CalamityModMusic")) { if (CalamityModMusicDownedDesertScourge) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("DesertScourgeMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedCrabulon) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CrabulonMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedHiveMind) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("HiveMindMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedPerforators) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("PerforatorMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedSlimeGod) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SlimeGodMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CragMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SirenIdleMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SulphurousMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("HigherAbyssMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AbyssLowerMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("VoidMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; if (CalamityModMusicDownedCryogen) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CryogenMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedAquaticScourge) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AquaticScourgeMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedBrimstoneElemental) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("BrimmyMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedCalamitas) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CalamitasMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CalamityMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedLeviathan) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SirenMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("LeviathanMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedAstrum) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AstralMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AstrageldonMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AstrumDeusMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedPlaguebringer) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("PlaguebringerMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; if (CalamityModMusicDownedRavager) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("RavagerMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (NPC.downedMoonlord) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CultistMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedGuardian) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("ProfanedGuardianMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedProvidence) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("ProvidenceMusicbox")); shop.item[nextSlot].shopCustomPrice = 250000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("StormWeaverMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CeaselessVoidMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SignusMusicbox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (CalamityModMusicDownedPolter) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("PolterghastMusicbox")); shop.item[nextSlot].shopCustomPrice = 300000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SunkenSeaMusicbox")); shop.item[nextSlot].shopCustomPrice = 300000; nextSlot++; } if (CalamityModMusicDownedDOG) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("DoGMusicbox")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("DoGP2Musicbox")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; } if (CalamityModMusicDownedYharon) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("Yharon1Musicbox")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("Yharon2Musicbox")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("Yharon3Musicbox")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; } if (CalamityModMusicDownedSCal) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SCalGMusicbox")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SCalLMusicbox")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SCalEMusicbox")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SCalAMusicbox")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; } } } } if (S3) { if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("FieldsMusicBox")); shop.item[nextSlot].shopCustomPrice = 400000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("SheamMusicBox")); shop.item[nextSlot].shopCustomPrice = 250000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ChaosKingMusicBox")); shop.item[nextSlot].shopCustomPrice = 250000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("TheWorldRevolvingMusicBox")); shop.item[nextSlot].shopCustomPrice = 250000; nextSlot++; } if (ModLoader.GetLoadedMods().Contains("ThoriumMod")) { if (ThoriumModDownedGTBird) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("ThunderBirdMusicBox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (ThoriumModDownedViscount) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("ViscountMusicBox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (ThoriumModDownedBoreanStrider) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("BoreanStriderMusicBox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (ThoriumModDownedFallenBeholder) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("FallenBeholderMusicBox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } if (ThoriumModDownedAbyssion) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("DepthsMusicBox")); shop.item[nextSlot].shopCustomPrice = 150000; nextSlot++; } } } }
public override bool Autoload(ref string name) { return(ModLoader.GetMod("ThoriumMod") != null); }
public UIStatInfo(string stat, float width, float height, bool isMinorStat = false, bool button = true, float textScale = 1f) { this.stat = stat; this.statValue = 0; this.bonusValue = 0; this.isMinorStat = isMinorStat; this.statText = new UIText(stat, textScale); this.statText.Left.Set(0, 0); this.statText.Top.Set(0, 0); this.Width.Set(width, 0); this.Height.Set(height, 0); if (button) { this.button = new UIImageButton(ModLoader.GetTexture("VapeRPG/Textures/UI/Button/AddButton")); this.button.Width.Set(30, 0); this.button.Height.Set(30, 0); this.button.Top.Set(0, 0); MouseEvent onMouseDown; if (this.isMinorStat) { onMouseDown = (x, y) => { VapePlayer vp = Main.player[Main.myPlayer].GetModPlayer <VapePlayer>(); if (this.stat.Contains("Max Minions")) { if (vp.chaosPoints >= 5) { vp.ChaosBonuses[this.stat] += 1; vp.chaosPoints -= 5; } } else { if (vp.chaosPoints > 0) { float value = 0.02f; if (this.stat.Contains("Crit")) { value = 1; } if (this.stat.Contains("Dodge")) { value = 0.005f; if (vp.dodgeChance >= 0.7f) { return; } } vp.ChaosBonuses[this.stat] += value; vp.chaosPoints--; } } }; this.button.Left.Set(-50, 1f); } else { onMouseDown = (x, y) => { VapePlayer vp = Main.player[Main.myPlayer].GetModPlayer <VapePlayer>(); if (vp.statPoints > 0) { vp.BaseStats[this.stat]++; vp.statPoints--; } }; this.button.Left.Set(-80, 1f); } this.button.OnClick += onMouseDown; this.Append(this.button); } if (!this.isMinorStat) { this.bonusText = new UIText("+ 0"); this.bonusText.Left.Set(-50, 1f); this.bonusText.Height.Set(0, 1f); this.bonusText.TextColor = Color.LimeGreen; this.Append(this.bonusText); } this.Append(this.statText); }
public sealed override void AI() { SetUpFlyingPet(); SetUpAuraAndGlowmask(); SetUpLight(); Player owner = Main.player[projectile.owner]; if (shouldLightUp) { float r = RGB.X / 255 * intensity; float g = RGB.Y / 255 * intensity; float b = RGB.Z / 255 * intensity; Lighting.AddLight(projectile.Center, r, g, b); Mod calamityMod = ModLoader.GetMod("CalamityMod"); if (calamityMod != null) { calamityMod.Call("AddAbyssLightStrength", owner, abyssLightLevel); } } if (auraRotates) { float tempRot = auraRotation ? 1f : -1f; tempRot *= auraRotationSpeedMult; rotation += tempRot; } if (!owner.active) { projectile.active = false; return; } Vector2 offset = new Vector2(offSetX, offSetY); Vector2 vectorToOwner = owner.Center - projectile.Center; float distanceToOwner = vectorToOwner.Length(); if (facingLeft && shouldFlip) { projectile.spriteDirection = projectile.velocity.X > 0 ? -1 : 1; } else if (!facingLeft && shouldFlip) { projectile.spriteDirection = projectile.velocity.X > 0 ? 1 : -1; } if (distanceToOwner > distance[0]) { projectile.position = owner.Center; projectile.velocity *= 0.1f; projectile.netUpdate = true; } if (distanceToOwner > distance[1]) { speed *= 1.25f; inertia *= 0.75f; } switch ((int)projectile.localAI[1]) { case 0: projectile.tileCollide = false; vectorToOwner += offset; distanceToOwner = vectorToOwner.Length(); //movement if (distanceToOwner > 20f) { vectorToOwner.Normalize(); vectorToOwner *= speed; projectile.velocity = (projectile.velocity * (inertia - 1) + vectorToOwner) / inertia; } else if (projectile.velocity == Vector2.Zero) { //boop it so it moves projectile.velocity.X = -0.15f; projectile.velocity.Y = -0.15f; } //animation if (animationSpeed > 0) { projectile.frameCounter++; if (projectile.frameCounter >= animationSpeed) { projectile.frameCounter = 0; projectile.frame++; if (projectile.frame >= Main.projFrames[projectile.type]) { projectile.frame = 0; } } if (!spinRotation) { projectile.rotation = projectile.velocity.X * 0.1f; //so that it turns towards where its flying } } break; } if (spinRotation) { if (Math.Abs(projectile.velocity.X) != 0) { float spinRotationSpeed = (projectile.velocity.X / 10) * spinRotationSpeedMult; projectile.rotation += spinRotationSpeed; } } }
//bool sheet public override void PostSetupContent() { try { FargosLoaded = ModLoader.GetMod("Fargowiltas") != null; BlueMagicLoaded = ModLoader.GetMod("Bluemagic") != null; CalamityLoaded = ModLoader.GetMod("CalamityMod") != null; ThoriumLoaded = ModLoader.GetMod("ThoriumMod") != null; AALoaded = ModLoader.GetMod("AAMod") != null; DBTLoaded = ModLoader.GetMod("DBZMOD") != null; SOALoaded = ModLoader.GetMod("SacredTools") != null; MasomodeEX = ModLoader.GetMod("MasomodeEX") != null; DebuffIDs = new List <int> { 20, 22, 23, 24, 36, 39, 44, 46, 47, 67, 68, 69, 70, 80, 88, 94, 103, 137, 144, 145, 148, 149, 153, 156, 160, 163, 164, 195, 196, 197, 199 }; DebuffIDs.Add(BuffType("Antisocial")); DebuffIDs.Add(BuffType("Atrophied")); DebuffIDs.Add(BuffType("Berserked")); DebuffIDs.Add(BuffType("Bloodthirsty")); DebuffIDs.Add(BuffType("ClippedWings")); DebuffIDs.Add(BuffType("Crippled")); DebuffIDs.Add(BuffType("CurseoftheMoon")); DebuffIDs.Add(BuffType("Defenseless")); DebuffIDs.Add(BuffType("FlamesoftheUniverse")); DebuffIDs.Add(BuffType("Flipped")); DebuffIDs.Add(BuffType("FlippedHallow")); DebuffIDs.Add(BuffType("Fused")); DebuffIDs.Add(BuffType("GodEater")); DebuffIDs.Add(BuffType("Guilty")); DebuffIDs.Add(BuffType("Hexed")); DebuffIDs.Add(BuffType("Infested")); DebuffIDs.Add(BuffType("Jammed")); DebuffIDs.Add(BuffType("Lethargic")); DebuffIDs.Add(BuffType("LightningRod")); DebuffIDs.Add(BuffType("LivingWasteland")); DebuffIDs.Add(BuffType("MarkedforDeath")); DebuffIDs.Add(BuffType("Midas")); DebuffIDs.Add(BuffType("MutantNibble")); DebuffIDs.Add(BuffType("NullificationCurse")); DebuffIDs.Add(BuffType("Oiled")); DebuffIDs.Add(BuffType("OceanicMaul")); DebuffIDs.Add(BuffType("Purified")); DebuffIDs.Add(BuffType("ReverseManaFlow")); DebuffIDs.Add(BuffType("Rotting")); DebuffIDs.Add(BuffType("SqueakyToy")); DebuffIDs.Add(BuffType("Stunned")); DebuffIDs.Add(BuffType("Unstable")); Mod bossChecklist = ModLoader.GetMod("BossChecklist"); if (bossChecklist != null) { bossChecklist.Call("AddBossWithInfo", "Duke Fishron EX", 14.1f, (Func <bool>)(() => FargoSoulsWorld.downedFishronEX), "Fish using a [i:" + ItemType("TruffleWormEX") + "]"); bossChecklist.Call("AddBossWithInfo", "Mutant", 14.2f, (Func <bool>)(() => FargoSoulsWorld.downedMutant), "Spawn by throwing [i:" + ItemType("AbominationnVoodooDoll") + "] in lava in Mutant's presence"); } if (ThoriumLoaded) { Mod thorium = ModLoader.GetMod("ThoriumMod"); ModProjDict.Add(thorium.ProjectileType("IFO"), 1); ModProjDict.Add(thorium.ProjectileType("BioFeederPet"), 2); ModProjDict.Add(thorium.ProjectileType("BlisterPet"), 3); ModProjDict.Add(thorium.ProjectileType("WyvernPet"), 4); ModProjDict.Add(thorium.ProjectileType("SupportLantern"), 5); ModProjDict.Add(thorium.ProjectileType("LockBoxPet"), 6); ModProjDict.Add(thorium.ProjectileType("Devil"), 7); ModProjDict.Add(thorium.ProjectileType("Angel"), 8); ModProjDict.Add(thorium.ProjectileType("LifeSpirit"), 9); ModProjDict.Add(thorium.ProjectileType("HolyGoat"), 10); ModProjDict.Add(thorium.ProjectileType("MinionSapling"), 11); ModProjDict.Add(thorium.ProjectileType("SnowyOwlPet"), 12); ModProjDict.Add(thorium.ProjectileType("JellyfishPet"), 13); ModProjDict.Add(thorium.ProjectileType("LilMog"), 14); ModProjDict.Add(thorium.ProjectileType("Maid1"), 15); ModProjDict.Add(thorium.ProjectileType("PinkSlime"), 16); ModProjDict.Add(thorium.ProjectileType("ShinyPet"), 17); ModProjDict.Add(thorium.ProjectileType("DrachmaBag"), 18); } } catch (Exception e) { ErrorLogger.Log("FargowiltasSouls PostSetupContent Error: " + e.StackTrace + e.Message); } }
public override bool Autoload(ref string name) { return(ModLoader.GetMod("SacredTools") != null); }
public override void AddRecipes() { if (ThoriumLoaded) { Mod thorium = ModLoader.GetMod("ThoriumMod"); ModRecipe recipe = new ModRecipe(this); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelArrow")); recipe.AddRecipe(); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelAxe")); recipe.AddRecipe(); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelBattleAxe"), 10); recipe.AddRecipe(); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelBlade")); recipe.AddRecipe(); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelBow")); recipe.AddRecipe(); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelChestplate")); recipe.AddRecipe(); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelGreaves")); recipe.AddRecipe(); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelHelmet")); recipe.AddRecipe(); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelMallet")); recipe.AddRecipe(); recipe = new ModRecipe(this); recipe.AddIngredient(thorium.ItemType("FoldedMetal")); recipe.AddTile(thorium, "ArcaneArmorFabricator"); recipe.SetResult(thorium.ItemType("SteelPickaxe")); recipe.AddRecipe(); } }
public override bool Autoload(ref string name) { return(ModLoader.GetMod("CalamityMod") != null); }
public void BattleRodEffects(Player player) { player.GetModPlayer <UnuBattleRods.FishPlayer>(ModLoader.GetMod("UnuBattleRods")).bobberDamage *= 0.8f; }