// Token: 0x06000042 RID: 66 RVA: 0x0000636C File Offset: 0x0000456C public override void SetDefaults(NPC npc) { if (LanguageManager.Instance.ActiveCulture == GameCulture.Chinese && ModLoader.GetMod("CalamityMod") != null) { if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("BlindedAngler")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "盲眼鮟鱇"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("Clam")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "沉沦渊蛤"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("EutrophicRay")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "沉沦渊鳐"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("GhostBell")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "幽铃水母"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("GhostBellSmall")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "小幽铃水母"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("GiantClam")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "巨像蛤"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("PrismTurtle")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "晶背龟"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("SeaFloaty")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "海蜉虫"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("SeaMinnow")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "渊米诺鱼"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("SeaSerpent1") || npc.type == ModLoader.GetMod("CalamityMod").NPCType("SeaSerpent2") || npc.type == ModLoader.GetMod("CalamityMod").NPCType("SeaSerpent3") || npc.type == ModLoader.GetMod("CalamityMod").NPCType("SeaSerpent4") || npc.type == ModLoader.GetMod("CalamityMod").NPCType("SeaSerpent5")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "沉沦渊蟒"); } } }
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)]"; } int modIconAdjust = 0; if (mod.HasFile("icon.png")) { var modIconTexture = Texture2D.FromStream(Main.instance.GraphicsDevice, new MemoryStream(mod.GetFile("icon.png"))); if (modIconTexture.Width == 80 && modIconTexture.Height == 80) { modIcon = new UIImage(modIconTexture); modIcon.Left.Set(0f, 0f); modIcon.Top.Set(0f, 0f); Append(modIcon); modIconAdjust += 85; } } this.modName = new UIText(text, 1f, false); this.modName.Left.Set(modIconAdjust + 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.GetMod("CalamityMod") != null); }
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++; } } } }
internal static void ReadModTile(ref int i, ref int j, TileTables tables, BinaryReader reader, ref bool nextModTile) { byte flags; flags = reader.ReadByte(); Tile tile = Main.tile[i, j]; if ((flags & 1) == 1) { tile.active(true); ushort saveType = reader.ReadUInt16(); tile.type = tables.tiles[saveType]; if (tables.frameImportant[saveType]) { if ((flags & 2) == 2) { tile.frameX = reader.ReadInt16(); } else { tile.frameX = reader.ReadByte(); } if ((flags & 4) == 4) { tile.frameY = reader.ReadInt16(); } else { tile.frameY = reader.ReadByte(); } } else { tile.frameX = -1; tile.frameY = -1; } if (tile.type == ModLoader.GetMod("ModLoader").TileType("PendingMysteryTile") && tables.tileNames.ContainsKey(saveType)) { MysteryTileInfo info; if (tables.frameImportant[saveType]) { info = new MysteryTileInfo(tables.tileModNames[saveType], tables.tileNames[saveType], tile.frameX, tile.frameY); } else { info = new MysteryTileInfo(tables.tileModNames[saveType], tables.tileNames[saveType]); } MysteryTilesWorld modWorld = (MysteryTilesWorld)ModLoader.GetMod("ModLoader").GetModWorld("MysteryTilesWorld"); int pendingFrameID = modWorld.pendingInfos.IndexOf(info); if (pendingFrameID < 0) { pendingFrameID = modWorld.pendingInfos.Count; modWorld.pendingInfos.Add(info); } MysteryTileFrame pendingFrame = new MysteryTileFrame(pendingFrameID); tile.frameX = pendingFrame.FrameX; tile.frameY = pendingFrame.FrameY; } if ((flags & 8) == 8) { tile.color(reader.ReadByte()); } WorldGen.tileCounts[tile.type] += j <= Main.worldSurface ? 5 : 1; } if ((flags & 16) == 16) { tile.wall = tables.walls[reader.ReadUInt16()]; if ((flags & 32) == 32) { tile.wallColor(reader.ReadByte()); } } if ((flags & 64) == 64) { byte sameCount = reader.ReadByte(); for (byte k = 0; k < sameCount; k++) { NextTile(ref i, ref j); Main.tile[i, j].CopyFrom(tile); WorldGen.tileCounts[tile.type] += j <= Main.worldSurface ? 5 : 1; } } if ((flags & 128) == 128) { nextModTile = true; } }
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)]"; } int modIconAdjust = 0; if (mod.HasFile("icon.png")) { var modIconTexture = Texture2D.FromStream(Main.instance.GraphicsDevice, new MemoryStream(mod.GetFile("icon.png"))); if (modIconTexture.Width == 80 && modIconTexture.Height == 80) { modIcon = new UIImage(modIconTexture); modIcon.Left.Set(0f, 0f); modIcon.Top.Set(0f, 0f); Append(modIcon); modIconAdjust += 85; } } this.modName = new UIText(text, 1f, false); this.modName.Left.Set(modIconAdjust + 10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); this.enabled = ModLoader.IsEnabled(mod); UITextPanel <string> button = new UITextPanel <string>(Language.GetTextValue("tModLoader.ModsMoreInfo"), 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 ? Language.GetTextValue("tModLoader.ModsDisable") : Language.GetTextValue("tModLoader.ModsEnable"), 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 + "\n (click to enable)"); modReferenceIcon.Left.Set(button2.Left.Pixels - 10f, 0f); modReferenceIcon.Top.Set(50f, 0f); modReferenceIcon.OnClick += (a, b) => { var referencedMods = properties.modReferences.Select(x => x.mod); var foundMods = ModLoader.FindMods(); var referencedtModFiles = foundMods.Where(x => referencedMods.Contains(x.name)); foreach (var referencedMod in referencedtModFiles) { ModLoader.EnableMod(referencedMod); } Main.menuMode = Interface.modsMenuID; var missingMods = referencedMods.Where(modstring => foundMods.All(modfile => modfile.name != modstring)); if (missingMods.Count() > 0) { Interface.infoMessage.SetMessage("The following mods were not found: " + String.Join(",", missingMods)); Interface.infoMessage.SetGotoMenu(Interface.modsMenuID); Main.menuMode = Interface.infoMessageID; } }; base.Append(modReferenceIcon); } if (mod.ValidModBrowserSignature) { keyImage = new UIHoverImage(Main.itemTexture[ID.ItemID.GoldenKey], Language.GetTextValue("tModLoader.ModsOriginatedFromModBrowser")); 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.GetMod("Fargowiltas") != null); }
public override void SetupShop(Chest shop, ref int nextSlot) { shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleItem")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("EquipMaterial")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("BossItem")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleWorkbench")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleChair")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleDoor")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleBed")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleChest")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("ExamplePickaxe")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleHamaxe")); nextSlot++; if (Main.LocalPlayer.HasBuff(BuffID.Lifeforce)) { shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleHealingPotion")); nextSlot++; } if (Main.LocalPlayer.GetModPlayer <ExamplePlayer>().ZoneExample&& !ExampleMod.exampleServerConfig.DisableExampleWings) { shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleWings")); nextSlot++; } if (Main.moonPhase < 2) { shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleSword")); nextSlot++; } else if (Main.moonPhase < 4) { shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleGun")); nextSlot++; shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleBullet")); nextSlot++; } else if (Main.moonPhase < 6) { shop.item[nextSlot].SetDefaults(mod.ItemType("ExampleStaff")); nextSlot++; } else { } // Here is an example of how your npc can sell items from other mods. var modSummonersAssociation = ModLoader.GetMod("SummonersAssociation"); if (modSummonersAssociation != null) { shop.item[nextSlot].SetDefaults(modSummonersAssociation.ItemType("BloodTalisman")); nextSlot++; } if (!Main.LocalPlayer.GetModPlayer <ExamplePlayer>().examplePersonGiftReceived&& ExampleMod.exampleServerConfig.ExamplePersonFreeGiftList != null) { foreach (var item in ExampleMod.exampleServerConfig.ExamplePersonFreeGiftList) { if (item.IsUnloaded) { continue; } shop.item[nextSlot].SetDefaults(item.GetID()); shop.item[nextSlot].shopCustomPrice = 0; shop.item[nextSlot].GetGlobalItem <ExampleInstancedGlobalItem>().examplePersonFreeGift = true; nextSlot++; // TODO: Have tModLoader handle index issues. } } }
internal void OpenConfig(UIMouseEvent evt, UIElement listeningElement) { SoundEngine.PlaySound(SoundID.MenuOpen); Interface.modConfig.SetMod(ModLoader.GetMod(ModName)); Main.menuMode = Interface.modConfigID; }
public override void SetDefaults(Item item) { switch (item.type) { case ItemID.GladiatorHelmet: item.rare = 1; item.defense = 4; return; case ItemID.GladiatorBreastplate: item.rare = 1; item.defense = 5; return; case ItemID.GladiatorLeggings: item.rare = 1; item.defense = 4; return; case ItemID.FossilHelm: item.defense = 5; return; case ItemID.FossilPants: item.defense = 5; return; case ItemID.ObsidianHelm: item.defense = 4; item.rare = 1; return; case ItemID.ObsidianShirt: item.defense = 4; item.rare = 1; return; case ItemID.ObsidianPants: item.defense = 3; item.rare = 1; return; case ItemID.Javelin: case ItemID.BoneJavelin: item.ammo = ItemID.Javelin; item.autoReuse = true; item.value = Item.buyPrice(0, 0, 2, 0); return; case ItemID.Shuriken: case ItemID.StarAnise: item.autoReuse = true; item.ammo = ItemID.Shuriken; return; case ItemID.ThrowingKnife: case ItemID.PoisonedKnife: case ItemID.BoneDagger: case ItemID.FrostDaggerfish: item.autoReuse = true; item.ammo = ItemID.ThrowingKnife; return; case ItemID.Grenade: case ItemID.StickyGrenade: case ItemID.BouncyGrenade: case ItemID.Beenade: case ItemID.PartyGirlGrenade: case ItemID.MolotovCocktail: item.autoReuse = true; item.ammo = ItemID.Grenade; return; case ItemID.SpikyBall: item.autoReuse = true; item.ammo = ItemID.SpikyBall; return; case ItemID.Snowball: item.autoReuse = true; return; case ItemID.Bone: item.autoReuse = true; item.ammo = ItemID.Bone; return; case ItemID.RottenEgg: item.autoReuse = true; item.ammo = ItemID.RottenEgg; return; } if (ModLoader.GetMod("ThoriumMod") != null) { if (item.type == ModLoader.GetMod("ThoriumMod").ItemType("BlackDagger")) { item.ammo = ItemID.ThrowingKnife; } } if (ModLoader.GetMod("Infinity") != null) { if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessJavelin")) { item.ammo = ItemID.Javelin; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessBoneJavelin")) { item.ammo = ItemID.Javelin; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessShuriken")) { item.ammo = ItemID.Shuriken; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessStarAnise")) { item.ammo = ItemID.Shuriken; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessKnife")) { item.ammo = ItemID.ThrowingKnife; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessKnifePoisoned")) { item.ammo = ItemID.ThrowingKnife; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessBoneKnife")) { item.ammo = ItemID.ThrowingKnife; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessFrostDaggerfish")) { item.ammo = ItemID.ThrowingKnife; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessGrenade")) { item.ammo = ItemID.Grenade; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessGrenadeSticky")) { item.ammo = ItemID.Grenade; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessGrenadeBouncy")) { item.ammo = ItemID.Grenade; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessPartyGirlGrenade")) { item.ammo = ItemID.Grenade; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessBeenade")) { item.damage = 14; item.useTime = 24; item.ammo = ItemID.Grenade; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessMolotovCocktail")) { item.ammo = ItemID.Grenade; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessSpikyBall")) { item.ammo = ItemID.SpikyBall; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessBone")) { item.ammo = ItemID.Bone; item.autoReuse = true; } if (item.type == ModLoader.GetMod("Infinity").ItemType("EndlessRottenEgg")) { item.ammo = ItemID.RottenEgg; item.autoReuse = true; } } }
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(2f); if (SoulConfig.Instance.GetValue("Universe Attack Speed")) { modPlayer.AttackSpeed *= 2; } player.maxMinions += 20; player.maxTurrets += 10; //accessorys player.counterWeight = 556 + Main.rand.Next(6); player.yoyoGlove = true; player.yoyoString = true; if (SoulConfig.Instance.GetValue("Universe Scope")) { player.scope = true; } player.manaFlower = true; player.manaMagnet = true; player.magicCuffs = true; //DIMENSIONS //COLOSSUS player.statLifeMax2 *= 5; player.endurance += 0.4f; player.lifeRegen += 15; //hand warmer, pocket mirror, ankh shield player.buffImmune[BuffID.Chilled] = true; player.buffImmune[BuffID.Frozen] = true; player.buffImmune[BuffID.Stoned] = true; player.buffImmune[BuffID.Weak] = true; player.buffImmune[BuffID.BrokenArmor] = true; player.buffImmune[BuffID.Bleeding] = true; player.buffImmune[BuffID.Poisoned] = true; player.buffImmune[BuffID.Slow] = true; player.buffImmune[BuffID.Confused] = true; player.buffImmune[BuffID.Silenced] = true; player.buffImmune[BuffID.Cursed] = true; player.buffImmune[BuffID.Darkness] = true; player.buffImmune[BuffID.ChaosState] = true; player.noKnockback = true; player.fireWalk = true; //brain of confusion player.brainOfConfusion = true; //charm of myths player.pStone = true; //bee cloak, sweet heart necklace, star veil if (SoulConfig.Instance.GetValue("Stars On Hit")) { player.starCloak = true; } if (SoulConfig.Instance.GetValue("Bees On Hit")) { player.bee = true; } player.panic = true; player.longInvince = true; //spore sac if (SoulConfig.Instance.GetValue("Spore Sac")) { player.SporeSac(); player.sporeSac = true; } //flesh knuckles player.aggro += 400; //frozen turtle shell if (player.statLife <= player.statLifeMax2 * 0.5) { player.AddBuff(BuffID.IceBarrier, 5, true); } //paladins shield if (player.statLife > player.statLifeMax2 * .25) { player.hasPaladinShield = true; for (int k = 0; k < 255; k++) { Player target = Main.player[k]; if (target.active && player != target && Vector2.Distance(target.Center, player.Center) < 400) { target.AddBuff(BuffID.PaladinsShield, 30); } } } //SUPERSONIC //frost spark plus super speed if (SoulConfig.Instance.GetValue("Supersonic Speed Boosts") && !player.GetModPlayer <FargoPlayer>().noSupersonic) { player.maxRunSpeed += 15f; player.runAcceleration += .25f; player.autoJump = true; player.jumpSpeedBoost += 2.4f; player.jumpBoost = true; player.maxFallSpeed += 5f; } /*else * { * player.maxRunSpeed += 5f; * player.runAcceleration += .1f; * }*/ player.moveSpeed += 0.5f; player.accRunSpeed = 12f; player.rocketBoots = 3; player.iceSkate = true; //arctic diving gear player.arcticDivingGear = true; player.accFlipper = true; player.accDivingHelm = true; //lava waders player.waterWalk = true; player.fireWalk = true; player.lavaImmune = true; //magic carpet player.carpet = true; //frog legs player.autoJump = true; player.jumpSpeedBoost += 2.4f; player.jumpBoost = true; //bundle if (player.wingTime == 0) { player.doubleJumpCloud = true; player.doubleJumpSandstorm = true; player.doubleJumpBlizzard = true; player.doubleJumpFart = true; } //FLIGHT MASTERY player.wingTimeMax = 999999; player.ignoreWater = true; player.wingTime = player.wingTimeMax; //TRAWLER //extra lures modPlayer.FishSoul2 = true; //modPlayer.AddPet("Zephyr Fish Pet", hideVisual, BuffID.ZephyrFish, ProjectileID.ZephyrFish); player.sonarPotion = true; player.fishingSkill += 100; player.cratePotion = true; player.accFishingLine = true; player.accTackleBox = true; player.accFishFinder = true; //WORLD SHAPER //placing speed up player.tileSpeed += 0.5f; player.wallSpeed += 0.5f; //toolbox Player.tileRangeX += 50; Player.tileRangeY += 50; //gizmo pack player.autoPaint = true; //pick speed player.pickSpeed -= 0.90f; //mining helmet if (SoulConfig.Instance.GetValue("Mining Shine Buff")) { Lighting.AddLight(player.Center, 0.8f, 0.8f, 0f); } //presserator player.autoActuator = true; //royal gel player.npcTypeNoAggro[1] = true; player.npcTypeNoAggro[16] = true; player.npcTypeNoAggro[59] = true; player.npcTypeNoAggro[71] = true; player.npcTypeNoAggro[81] = true; player.npcTypeNoAggro[138] = true; player.npcTypeNoAggro[121] = true; player.npcTypeNoAggro[122] = true; player.npcTypeNoAggro[141] = true; player.npcTypeNoAggro[147] = true; player.npcTypeNoAggro[183] = true; player.npcTypeNoAggro[184] = true; player.npcTypeNoAggro[204] = true; player.npcTypeNoAggro[225] = true; player.npcTypeNoAggro[244] = true; player.npcTypeNoAggro[302] = true; player.npcTypeNoAggro[333] = true; player.npcTypeNoAggro[335] = true; player.npcTypeNoAggro[334] = true; player.npcTypeNoAggro[336] = true; player.npcTypeNoAggro[537] = true; //builder mode if (SoulConfig.Instance.GetValue("Builder Mode")) { modPlayer.BuilderMode = true; } //cell phone player.accWatch = 3; player.accDepthMeter = 1; player.accCompass = 1; player.accFishFinder = true; player.accDreamCatcher = true; player.accOreFinder = true; player.accStopwatch = true; player.accCritterGuide = true; player.accJarOfSouls = true; player.accThirdEye = true; player.accCalendar = true; player.accWeatherRadio = true; //TERRARIA mod.GetItem("TerrariaSoul").UpdateAccessory(player, hideVisual); //M*******T mod.GetItem("MasochistSoul").UpdateAccessory(player, hideVisual); if (Fargowiltas.Instance.ThoriumLoaded) { Thorium(player, hideVisual); } if (Fargowiltas.Instance.CalamityLoaded) { Calamity(player, hideVisual); } if (Fargowiltas.Instance.DBZMODLoaded) { DBT(player); } if (Fargowiltas.Instance.SoALoaded) { SOA(player, hideVisual); } if (Fargowiltas.Instance.ApothLoaded) { ModLoader.GetMod("ApothTestMod").GetItem("Ataraxia").UpdateAccessory(player, hideVisual); } }
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.downedTowers && (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 UIModItem(LocalMod mod) { this.mod = mod; BorderColor = new Color(89, 116, 213) * 0.7f; dividerTexture = TextureManager.Load("Images/UI/Divider"); innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); Height.Pixels = 90; Width.Percent = 1f; SetPadding(6f); //base.OnClick += this.ToggleEnabled; string text = mod.DisplayName + " v" + mod.modFile.version; if (mod.tModLoaderVersion < new Version(0, 10)) { text += $" [c/FF0000:({Language.GetTextValue("tModLoader.ModOldWarning")})]"; } if (mod.modFile.HasFile("icon.png")) { try { Texture2D modIconTexture; using (mod.modFile.Open()) using (var s = mod.modFile.GetStream("icon.png")) modIconTexture = Texture2D.FromStream(Main.instance.GraphicsDevice, s); if (modIconTexture.Width == 80 && modIconTexture.Height == 80) { modIcon = new UIImage(modIconTexture) { Left = { Percent = 0f }, Top = { Percent = 0f } }; Append(modIcon); modIconAdjust += 85; } } catch { } } modName = new UIText(text) { Left = new StyleDimension(modIconAdjust + 10f, 0f), Top = { Pixels = 5 } }; Append(modName); var moreInfoButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("tModLoader.ModsMoreInfo")) { Width = { Pixels = 100 }, Height = { Pixels = 36 }, Left = { Pixels = 430 }, Top = { Pixels = 40 } }.WithFadedMouseOver(); moreInfoButton.PaddingTop -= 2f; moreInfoButton.PaddingBottom -= 2f; moreInfoButton.OnClick += Moreinfo; Append(moreInfoButton); toggleModEnabledButton = new UIAutoScaleTextTextPanel <string>(mod.Enabled ? Language.GetTextValue("tModLoader.ModsDisable") : Language.GetTextValue("tModLoader.ModsEnable")) { Width = { Pixels = 100 }, Height = { Pixels = 36 }, Top = { Pixels = 40 } }.WithFadedMouseOver(); toggleModEnabledButton.Left.Pixels = moreInfoButton.Left.Pixels - toggleModEnabledButton.Width.Pixels - 5f; toggleModEnabledButton.PaddingTop -= 2f; toggleModEnabledButton.PaddingBottom -= 2f; toggleModEnabledButton.OnClick += ToggleEnabled; Append(toggleModEnabledButton); Mod loadedMod = ModLoader.GetMod(mod.Name); if (loadedMod != null && ConfigManager.Configs.ContainsKey(loadedMod)) // and has config { configButton = new UITextPanel <string>("Config", 1f, false); configButton.Width.Set(100f, 0f); configButton.Height.Set(30f, 0f); configButton.Left.Set(toggleModEnabledButton.Left.Pixels - configButton.Width.Pixels - 5f, 0f); configButton.Top.Set(40f, 0f); configButton.PaddingTop -= 2f; configButton.PaddingBottom -= 2f; configButton.WithFadedMouseOver(); configButton.OnClick += this.OpenConfig; Append(configButton); if (ConfigManager.ModNeedsReload(loadedMod)) { configChangesRequireReload = true; } } var modRefs = mod.properties.modReferences.Select(x => x.mod).ToArray(); if (modRefs.Length > 0 && !mod.Enabled) { string refs = string.Join(", ", mod.properties.modReferences); var icon = UICommon.buttonExclamationTexture; var modReferenceIcon = new UIHoverImage(icon, Language.GetTextValue("tModLoader.ModDependencyClickTooltip", refs)) { Left = new StyleDimension(toggleModEnabledButton.Left.Pixels - 24f, 0f), Top = { Pixels = 47 } }; modReferenceIcon.OnClick += (a, b) => { var modList = ModOrganizer.FindMods(); var missing = new List <string>(); foreach (var modRef in modRefs) { ModLoader.EnableMod(modRef); if (!modList.Any(m => m.Name == modRef)) { missing.Add(modRef); } } Main.menuMode = Interface.modsMenuID; if (missing.Any()) { Interface.infoMessage.Show(Language.GetTextValue("tModLoader.ModDependencyModsNotFound", String.Join(",", missing)), Interface.modsMenuID); } }; Append(modReferenceIcon); } if (mod.modFile.ValidModBrowserSignature) { keyImage = new UIHoverImage(Main.itemTexture[ID.ItemID.GoldenKey], Language.GetTextValue("tModLoader.ModsOriginatedFromModBrowser")) { Left = { Pixels = -20, Percent = 1f } }; Append(keyImage); } if (ModLoader.badUnloaders.Contains(mod.Name)) { keyImage = new UIHoverImage(UICommon.buttonErrorTexture, "This mod did not fully unload during last unload.") { Left = { Pixels = modIconAdjust + 4 }, Top = { Pixels = 3 } }; Append(keyImage); modName.Left.Pixels += 20; } if (mod.properties.beta) { keyImage = new UIHoverImage(Main.itemTexture[ID.ItemID.ShadowKey], Language.GetTextValue("tModLoader.BetaModCantPublish")) { Left = { Pixels = -10, Percent = 1f } }; Append(keyImage); } if (loadedMod != null) { loaded = true; int[] values = { loadedMod.items.Count, loadedMod.npcs.Count, loadedMod.tiles.Count, loadedMod.walls.Count, loadedMod.buffs.Count, loadedMod.mountDatas.Count }; string[] localizationKeys = { "ModsXItems", "ModsXNPCs", "ModsXTiles", "ModsXWalls", "ModsXBuffs", "ModsXMounts" }; 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, Language.GetTextValue($"tModLoader.{localizationKeys[i]}", values[i])) { Left = { Pixels = xOffset, Percent = 1f } }; Append(keyImage); xOffset -= 18; } } } }
public override void SetupShop(Chest shop, ref int nextSlot) { if (Shop1) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("VanTankCombination")); shop.item[nextSlot].shopCustomPrice = 90000; nextSlot++; if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("TankCombination")); shop.item[nextSlot].shopCustomPrice = 160000; nextSlot++; } shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("BattleCombination")); shop.item[nextSlot].shopCustomPrice = 120000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("RangerCombination")); shop.item[nextSlot].shopCustomPrice = 75000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("MageCombination")); shop.item[nextSlot].shopCustomPrice = 90000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("BuilderCombination")); shop.item[nextSlot].shopCustomPrice = 35000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ExplorerCombination")); shop.item[nextSlot].shopCustomPrice = 80000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("SummonerCombination")); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; if (Main.player[Main.myPlayer].anglerQuestsFinished >= 5) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("FishingCombination")); shop.item[nextSlot].shopCustomPrice = 100000; nextSlot++; } if (ModLoader.GetMod("ThoriumMod") != null) { if (NPC.downedMechBossAny) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ThoriumCombination")); shop.item[nextSlot].shopCustomPrice = 300000; nextSlot++; } } if (ModLoader.GetMod("CalamityMod") != null) { if (NPC.downedGolemBoss) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("CalamityCombination")); shop.item[nextSlot].shopCustomPrice = 350000; nextSlot++; } } if (ModLoader.GetMod("MorePotions") != null) { if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("MorePotionsCombination")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; } } if (ModLoader.GetMod("SpiritMod") != null) { if (NPC.downedMechBossAny) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("SpiritCombination")); shop.item[nextSlot].shopCustomPrice = 250000; nextSlot++; } } if (NPC.downedMoonlord) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("UniversalCombination")); shop.item[nextSlot].shopCustomPrice = 500000; nextSlot++; } if (ModLoader.GetMod("ThoriumMod") != null) { if (NPC.downedBoss3) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("FrostCoatingItem")); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("ExplosiveCoatingItem")); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("GorganCoatingItem")); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("SporeCoatingItem")); shop.item[nextSlot].shopCustomPrice = 2500; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("ToxicCoatingItem")); shop.item[nextSlot].shopCustomPrice = 2500; nextSlot++; } if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("GasContainer")); shop.item[nextSlot].shopCustomPrice = 200; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("CorrosionBeaker")); shop.item[nextSlot].shopCustomPrice = 250; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("CombustionFlask")); shop.item[nextSlot].shopCustomPrice = 250; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("NitrogenVial")); shop.item[nextSlot].shopCustomPrice = 250; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("AphrodisiacVial")); shop.item[nextSlot].shopCustomPrice = 250; nextSlot++; if (NPC.downedPlantBoss) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("PlasmaVial")); shop.item[nextSlot].shopCustomPrice = 350; nextSlot++; } } } } if (Shop2) { if (NPC.downedQueenBee) { shop.item[nextSlot].SetDefaults(ItemID.FlaskofPoison); shop.item[nextSlot].shopCustomPrice = 10000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.FlaskofFire); shop.item[nextSlot].shopCustomPrice = 10000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.FlaskofParty); shop.item[nextSlot].shopCustomPrice = 10000; nextSlot++; } if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ItemID.FlaskofGold); shop.item[nextSlot].shopCustomPrice = 15000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.FlaskofIchor); shop.item[nextSlot].shopCustomPrice = 25000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.FlaskofCursedFlames); shop.item[nextSlot].shopCustomPrice = 25000; nextSlot++; } if (NPC.downedPlantBoss) { shop.item[nextSlot].SetDefaults(ItemID.FlaskofVenom); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.FlaskofNanites); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; } bool WA = false; for (int k = 0; k < 255; k++) { Player player = Main.player[k]; if (player.active) { for (int j = 0; j < player.inventory.Length; j++) { if (player.inventory[j].type == mod.ItemType("WatcherAmulet")) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("RainbowFlask")); shop.item[nextSlot].shopCustomPrice = 1000000; nextSlot++; WA = true; } if (player.inventory[j].type == mod.ItemType("Autoinjector") && !WA) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("RainbowFlask")); shop.item[nextSlot].shopCustomPrice = 1000000; nextSlot++; } } } } if (ModLoader.GetMod("AAMod") != null) { if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AAMod").ItemType("DragonfireFlask")); shop.item[nextSlot].shopCustomPrice = 20000; nextSlot++; shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AAMod").ItemType("HydratoxinFlask")); shop.item[nextSlot].shopCustomPrice = 20000; nextSlot++; } } if (ModLoader.GetMod("SpiritMod") != null) { if (Main.hardMode) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("SpiritMod").ItemType("AcidVial")); shop.item[nextSlot].shopCustomPrice = 30000; nextSlot++; } } if (ModLoader.GetMod("CalamityMod") != null) { if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("CalamitasBrew")); shop.item[nextSlot].shopCustomPrice = 50000; nextSlot++; } } } }
public override bool CanUseItem(Player player) { return(!NPC.AnyNPCs(ModLoader.GetMod("Fargowiltas").NPCType("Abominationn"))); }
public override void AI() { Player player = Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)]; if (ModLoader.GetLoadedMods().Contains("ThoriumMod")) { player.buffImmune[ModLoader.GetMod("ThoriumMod").BuffType("AbyssalShell")] = true; npc.buffImmune[ModLoader.GetMod("ThoriumMod").BuffType("AParalyzed")] = true; npc.buffImmune[ModLoader.GetMod("ThoriumMod").BuffType("Paralyzed")] = true; } npc.buffImmune[mod.BuffType("ArmorDestruction")] = true; npc.buffImmune[mod.BuffType("Twilight")] = true; npc.buffImmune[mod.BuffType("Electrocute")] = true; npc.buffImmune[mod.BuffType("Patience")] = true; if (ModLoader.GetLoadedMods().Contains("CalamityMod")) { npc.buffImmune[ModLoader.GetMod("CalamityMod").BuffType("SilvaStun")] = true; npc.buffImmune[ModLoader.GetMod("CalamityMod").BuffType("ExoFreeze")] = true; } if (ModGlobalNPC.ks == true) { npc.velocity *= 1.2f; int damage1 = 200; int damage2 = 300; int damage3 = 350; if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer <AlchemistNPCPlayer>(mod).MemersRiposte) { damage1 = 100; damage2 = 150; damage3 = 175; } if (player.statDefense > 250 || player.endurance > 0.50f || player.statLifeMax2 > 1300) { player.KillMe(PlayerDeathReason.ByOther(player.Male ? 14 : 15), 1.0, 0, false); if (player.dead) { npc.velocity = new Vector2(2, -10); npc.velocity *= 3f; } damage1 = 666666; damage2 = 666666; damage3 = 666666; } if (!Main.expertMode) { if (npc.life > 166666) { if (Main.rand.Next(20) == 0) { Vector2 vel = new Vector2(-1, -1); vel *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel2 = new Vector2(1, 1); vel2 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel3 = new Vector2(1, -1); vel3 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel4 = new Vector2(-1, 1); vel4 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel5 = new Vector2(0, -1); vel5 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel6 = new Vector2(0, 1); vel6 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel7 = new Vector2(1, 0); vel7 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel8 = new Vector2(-1, 0); vel8 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); } } else { if (Main.rand.Next(25) == 0) { Vector2 vel = new Vector2(-1, -1); vel *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel2 = new Vector2(1, 1); vel2 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel3 = new Vector2(1, -1); vel3 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel4 = new Vector2(-1, 1); vel4 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel5 = new Vector2(0, -1); vel5 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel6 = new Vector2(0, 1); vel6 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel7 = new Vector2(1, 0); vel7 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel8 = new Vector2(-1, 0); vel8 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 449, damage2, 0, Main.myPlayer); } if (Main.rand.Next(60) == 0) { Vector2 vel = new Vector2(-1, -1); vel *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel2 = new Vector2(1, 1); vel2 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel3 = new Vector2(1, -1); vel3 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel4 = new Vector2(-1, 1); vel4 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel5 = new Vector2(0, -1); vel5 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel6 = new Vector2(0, 1); vel6 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel7 = new Vector2(1, 0); vel7 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel8 = new Vector2(-1, 0); vel8 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 448, damage2, 0, Main.myPlayer); } } } if (Main.expertMode) { if (npc.life > 333333) { if (Main.rand.Next(20) == 0) { Vector2 vel = new Vector2(-1, -1); vel *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel2 = new Vector2(1, 1); vel2 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel3 = new Vector2(1, -1); vel3 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel4 = new Vector2(-1, 1); vel4 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel5 = new Vector2(0, -1); vel5 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel6 = new Vector2(0, 1); vel6 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel7 = new Vector2(1, 0); vel7 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); Vector2 vel8 = new Vector2(-1, 0); vel8 *= 8f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer); } } if (npc.life > 166666 && npc.life < 333333) { if (Main.rand.Next(25) == 0) { Vector2 vel = new Vector2(-1, -1); vel *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel2 = new Vector2(1, 1); vel2 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel3 = new Vector2(1, -1); vel3 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel4 = new Vector2(-1, 1); vel4 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel5 = new Vector2(0, -1); vel5 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel6 = new Vector2(0, 1); vel6 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel7 = new Vector2(1, 0); vel7 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 449, damage2, 0, Main.myPlayer); Vector2 vel8 = new Vector2(-1, 0); vel8 *= 9f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 449, damage2, 0, Main.myPlayer); } if (Main.rand.Next(60) == 0) { Vector2 vel = new Vector2(-1, -1); vel *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel2 = new Vector2(1, 1); vel2 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel3 = new Vector2(1, -1); vel3 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel4 = new Vector2(-1, 1); vel4 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel5 = new Vector2(0, -1); vel5 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel6 = new Vector2(0, 1); vel6 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel7 = new Vector2(1, 0); vel7 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 448, damage2, 0, Main.myPlayer); Vector2 vel8 = new Vector2(-1, 0); vel8 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 448, damage2, 0, Main.myPlayer); } } if (npc.life < 166666) { if (Main.rand.Next(20) == 0) { Vector2 vel = new Vector2(-1, -1); vel *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 449, damage3, 0, Main.myPlayer); Vector2 vel2 = new Vector2(1, 1); vel2 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 449, damage3, 0, Main.myPlayer); Vector2 vel3 = new Vector2(1, -1); vel3 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 449, damage3, 0, Main.myPlayer); Vector2 vel4 = new Vector2(-1, 1); vel4 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 449, damage3, 0, Main.myPlayer); Vector2 vel5 = new Vector2(0, -1); vel5 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 449, damage3, 0, Main.myPlayer); Vector2 vel6 = new Vector2(0, 1); vel6 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 449, damage3, 0, Main.myPlayer); Vector2 vel7 = new Vector2(1, 0); vel7 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 449, damage3, 0, Main.myPlayer); Vector2 vel8 = new Vector2(-1, 0); vel8 *= 12f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 449, damage3, 0, Main.myPlayer); } if (Main.rand.Next(50) == 0) { Vector2 vel = new Vector2(-1, -1); vel *= 14f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 448, damage3, 0, Main.myPlayer); Vector2 vel2 = new Vector2(1, 1); vel2 *= 14f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 448, damage3, 0, Main.myPlayer); Vector2 vel3 = new Vector2(1, -1); vel3 *= 14f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 448, damage3, 0, Main.myPlayer); Vector2 vel4 = new Vector2(-1, 1); vel4 *= 14f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 448, damage3, 0, Main.myPlayer); Vector2 vel5 = new Vector2(0, -1); vel5 *= 14f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 448, damage3, 0, Main.myPlayer); Vector2 vel6 = new Vector2(0, 1); vel6 *= 14f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 448, damage3, 0, Main.myPlayer); Vector2 vel7 = new Vector2(1, 0); vel7 *= 14f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 448, damage3, 0, Main.myPlayer); Vector2 vel8 = new Vector2(-1, 0); vel8 *= 14f; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 448, damage3, 0, Main.myPlayer); } } } } }
public override bool UseItem(Player player) { NPC.SpawnOnPlayer(player.whoAmI, ModLoader.GetMod("Fargowiltas").NPCType("Abominationn")); return(true); }
public override bool Autoload(ref string name) { return(ModLoader.GetMod("DevHelp") != null); }
public override void AI() { npc.dontTakeDamage = true; if (npc.collideY) { npc.ai[0]++; if (npc.frame.Y < 78 * 4) { npc.frameCounter = 0; npc.frame.Y = 78 * 4; } if (npc.frame.Y < 78 * 6) { if (npc.frameCounter++ > 5) { npc.frame.Y += 78; npc.frameCounter = 0; } } if (npc.ai[0] == 60) { CombatText.NewText(npc.Hitbox, new Color(72, 78, 117), "..?"); } if (npc.ai[0] == 120) { npc.frame.Y = 78 * 7; } if (npc.ai[0] == 180) { CombatText.NewText(npc.Hitbox, new Color(72, 78, 117), "...Ashe?"); npc.frame.Y = 78 * 6; } if (npc.ai[0] == 240) { npc.frame.Y = 78 * 7; } if (npc.ai[0] == 360) { CombatText.NewText(npc.Hitbox, new Color(72, 78, 117), "...thanks for shutting her up."); if (Main.expertMode) { for (int i = 0; i < 10; i++) { npc.DropBossBags(); } } if (!Main.expertMode) { string[] lootTableH = { "HarukaKunai", "Masamune", "MizuArashi", "HarukaBox" }; int lootH = Main.rand.Next(lootTableH.Length); npc.DropLoot(ModLoader.GetMod("AAMod").ItemType(lootTableH[lootH])); } if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModLoader.GetMod("AAMod").ItemType("HarukaTrophy")); } NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("HarukaVanish"), 0, 0, 4); npc.active = false; npc.netUpdate = true; } } else { if (npc.frameCounter++ > 6) { npc.frameCounter = 0; npc.frame.Y += 78; if (npc.frame.Y > 78 * 3) { npc.frame.Y = 0; } } } }
public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(ModLoader.GetMod("AAMod").BuffType("Poison"), 300); }
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.GetLoadedMods().Contains("ThoriumMod")) { shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("Opal")); 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++; } if (NPC.downedBoss3) { if (ModLoader.GetLoadedMods().Contains("Tremor")) { 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.GetLoadedMods().Contains("ThoriumMod")) { 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.GetLoadedMods().Contains("SpiritMod")) { 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++; } } if (AS) { shop.item[nextSlot].SetDefaults(ItemID.Campfire); shop.item[nextSlot].shopCustomPrice = 5000; nextSlot++; if (NPC.downedBoss3) { shop.item[nextSlot].SetDefaults(ItemID.HoneyBucket); shop.item[nextSlot].shopCustomPrice = 15000; 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 = 20000; nextSlot++; shop.item[nextSlot].SetDefaults(ItemID.PeaceCandle); shop.item[nextSlot].shopCustomPrice = 30000; 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++; } } } }
public override bool Autoload(ref string name) { return(ModLoader.GetMod("SacredTools") != null); }
public override void PostSetupContent() { Mod bossChecklist = ModLoader.GetMod("BossChecklist"); battleRodsLoaded = ModLoader.GetMod("UnuBattleRods") != null; if (bossChecklist != null) { /* * bossChecklist.Call("AddMiniBossWithInfo", "Pinkzor", 0.1f, (Func<bool>)(() => JoostWorld.downedPinkzor), "Rarely found on the surface or underground. The Huntmaster will spawn after it is killed"); * bossChecklist.Call("AddMiniBossWithInfo", "Rogue Tomato", 0.2f, (Func<bool>)(() => JoostWorld.downedRogueTomato), "Quest from the Hunt Master, found on the surface during daytime"); * bossChecklist.Call("AddMiniBossWithInfo", "Forest's Vengeance", 0.3f, (Func<bool>)(() => JoostWorld.downedWoodGuardian), "Quest from the Hunt Master, found in the forest"); * bossChecklist.Call("AddMiniBossWithInfo", "Flowering Cactoid", 1.1f, (Func<bool>)(() => JoostWorld.downedFloweringCactoid), "Quest from the Hunt Master, found in the surface desert"); * bossChecklist.Call("AddMiniBossWithInfo", "ICU", 2.1f, (Func<bool>)(() => JoostWorld.downedICU), "Quest from the Hunt Master, found on the surface during nighttime"); * bossChecklist.Call("AddMiniBossWithInfo", "Spore Mother", 3.1f, (Func<bool>)(() => JoostWorld.downedSporeSpawn), "Quest from the Hunt Master, found in the underground jungle"); * bossChecklist.Call("AddMiniBossWithInfo", "Roc", 4.1f, (Func<bool>)(() => JoostWorld.downedRoc), "Quest from the Hunt Master, found in the sky"); * bossChecklist.Call("AddMiniBossWithInfo", "Skeleton Demolitionist", 5.1f, (Func<bool>)(() => JoostWorld.downedSkeletonDemoman), "Quest from the Hunt Master, found in the dungeon"); * bossChecklist.Call("AddMiniBossWithInfo", "Imp Lord", 5.8f, (Func<bool>)(() => JoostWorld.downedImpLord), "Quest from the Huntmaster, found in hell."); * //14 is the value BossChecklist gives to Moonlord. * bossChecklist.Call("AddBossWithInfo", "Alpha Cactus Worm", 5.7f, (Func<bool>)(() => JoostWorld.downedCactusWorm), "Quest from the Hunt Master, found in the underground desert. Or, use a [i:" + ItemType("CactusBait") + "] in the underground desert"); * bossChecklist.Call("AddBossWithInfo", "Jumbo Cactuar", 14.6f, (Func<bool>)(() => JoostWorld.downedJumboCactuar), "Use a [i:" + ItemType("Cactusofdoom") + "] in the desert"); * bossChecklist.Call("AddBossWithInfo", "SA-X", 15.1f, (Func<bool>)(() => JoostWorld.downedSAX), "Use an [i:" + ItemType("InfectedArmCannon") + "] anywhere"); * bossChecklist.Call("AddBossWithInfo", "Gilgamesh and Enkidu", 15.8f, (Func<bool>)(() => JoostWorld.downedGilgamesh), "Use an [i:" + ItemType("Excalipoor") + "] anywhere"); */ bossChecklist.Call("AddMiniBoss", 0.1f, ModContent.NPCType <NPCs.Hunts.Pinkzor>(), this, "Pinkzor", (Func <bool>)(() => JoostWorld.downedPinkzor), null, null, ModContent.ItemType <Items.Quest.Pinkzor>(), "Rarely found on the surface or underground. The Huntmaster will spawn after it is killed"); bossChecklist.Call("AddMiniBoss", 0.2f, ModContent.NPCType <NPCs.Hunts.RogueTomato>(), this, "Rogue Tomato", (Func <bool>)(() => JoostWorld.downedRogueTomato), null, null, ModContent.ItemType <Items.Quest.RogueTomato>(), "Quest from the Hunt Master, found on the surface during daytime"); bossChecklist.Call("AddMiniBoss", 0.3f, ModContent.NPCType <NPCs.Hunts.WoodGuardian>(), this, "Forest's Vengeance", (Func <bool>)(() => JoostWorld.downedWoodGuardian), null, null, ModContent.ItemType <Items.Quest.WoodGuardian>(), "Quest from the Hunt Master, found in the forest"); bossChecklist.Call("AddMiniBoss", 1.1f, ModContent.NPCType <NPCs.Hunts.FloweringCactoid>(), this, "Flowering Cactoid", (Func <bool>)(() => JoostWorld.downedFloweringCactoid), null, null, ModContent.ItemType <Items.Quest.FloweringCactoid>(), "Quest from the Hunt Master, found in the surface desert"); bossChecklist.Call("AddMiniBoss", 2.1f, ModContent.NPCType <NPCs.Hunts.ICU>(), this, "ICU", (Func <bool>)(() => JoostWorld.downedICU), null, null, ModContent.ItemType <Items.Quest.ICU>(), "Quest from the Hunt Master, found on the surface during nighttime"); bossChecklist.Call("AddMiniBoss", 3.1f, ModContent.NPCType <NPCs.Hunts.SporeSpawn>(), this, "Spore Mother", (Func <bool>)(() => JoostWorld.downedSporeSpawn), null, null, ModContent.ItemType <Items.Quest.SporeSpawn>(), "Quest from the Hunt Master, found in the underground jungle"); bossChecklist.Call("AddMiniBoss", 4.1f, ModContent.NPCType <NPCs.Hunts.Roc>(), this, "Roc", (Func <bool>)(() => JoostWorld.downedRoc), null, null, ModContent.ItemType <Items.Quest.Roc>(), "Quest from the Hunt Master, found in the sky"); bossChecklist.Call("AddMiniBoss", 5.1f, ModContent.NPCType <NPCs.Hunts.SkeletonDemoman>(), this, "Skeleton Demolitionist", (Func <bool>)(() => JoostWorld.downedSkeletonDemoman), null, null, ModContent.ItemType <Items.Quest.SkeletonDemoman>(), "Quest from the Hunt Master, found in the dungeon"); bossChecklist.Call("AddMiniBoss", 5.8f, ModContent.NPCType <NPCs.Hunts.ImpLord>(), this, "Imp Lord", (Func <bool>)(() => JoostWorld.downedImpLord), null, null, ModContent.ItemType <Items.Quest.ImpLord>(), "Quest from the Huntmaster, found in hell."); bossChecklist.Call("AddBoss", 5.7f, ModContent.NPCType <IdleCactusWorm>(), this, "Alpha Cactus Worm", (Func <bool>)(() => JoostWorld.downedCactusWorm), ModContent.ItemType <CactusBait>(), new List <int>() { ModContent.ItemType <Items.Armor.GrandCactusWormMask>(), ModContent.ItemType <Items.Placeable.DeoremMuaMusicBox>(), ModContent.ItemType <Items.Placeable.GrandCactusWormTrophy>() }, new List <int>() { ModContent.ItemType <GrandCactusWormBag>(), ModContent.ItemType <CactusWormHook>(), ModContent.ItemType <LusciousCactus>() }, "Quest from the Hunt Master, found in the underground desert. Or, use a [i:" + ItemType("CactusBait") + "] in the underground desert"); bossChecklist.Call("AddBoss", 14.6f, ModContent.NPCType <JumboCactuar>(), this, "Jumbo Cactuar", (Func <bool>)(() => JoostWorld.downedJumboCactuar), ModContent.ItemType <Cactusofdoom>(), new List <int>() { ModContent.ItemType <Items.Armor.JumboCactuarMask>(), ModContent.ItemType <Items.Placeable.DecisiveBattleMusicBox>(), ModContent.ItemType <Items.Placeable.JumboCactuarTrophy>() }, new List <int>() { ModContent.ItemType <JumboCactuarBag>(), ModContent.ItemType <CactuarShield>(), ModContent.ItemType <Cactustoken>() }, "Use a [i:" + ItemType("Cactusofdoom") + "] in the desert"); bossChecklist.Call("AddBoss", 15.1f, ModContent.NPCType <SAX>(), this, "SA-X", (Func <bool>)(() => JoostWorld.downedSAX), ModContent.ItemType <InfectedArmCannon>(), new List <int>() { ModContent.ItemType <Items.Armor.SAXMask>(), ModContent.ItemType <Items.Placeable.SAXMusicBox>(), ModContent.ItemType <Items.Placeable.SAXTrophy>() }, new List <int>() { ModContent.ItemType <XBag>(), ModContent.ItemType <XShield>(), ModContent.ItemType <IceCoreX>() }, "Use an [i:" + ItemType("InfectedArmCannon") + "] anywhere", "The SA-X disappears into the unknown", "JoostMod/NPCs/Bosses/SAXBossLog"); bossChecklist.Call("AddBoss", 15.8f, new List <int>() { ModContent.NPCType <Gilgamesh>(), ModContent.NPCType <Enkidu>() }, this, "Gilgamesh and Enkidu", (Func <bool>)(() => JoostWorld.downedGilgamesh), ModContent.ItemType <Excalipoor>(), new List <int>() { ModContent.ItemType <Items.Armor.GilgameshMask>(), ModContent.ItemType <Items.Placeable.COTBBMusicBox>(), ModContent.ItemType <Items.Placeable.GilgameshTrophy>() }, new List <int>() { ModContent.ItemType <GilgBag>(), ModContent.ItemType <Items.Weapons.Gilgameshset>(), ModContent.ItemType <GenjiToken>() }, "Use an [i:" + ItemType("Excalipoor") + "] anywhere", "<Gilgamesh> Hah! I won!", "JoostMod/NPCs/Bosses/GilgameshAndEnkiduBossLog"); } Mod fargos = ModLoader.GetMod("Fargowiltas"); if (fargos != null) { // AddSummon, order or value in terms of vanilla bosses, your mod internal name, summon //item internal name, inline method for retrieving downed value, price to sell for in copper fargos.Call("AddSummon", 5.7f, "JoostMod", "CactusBait", (Func <bool>)(() => JoostWorld.downedCactusWorm), 75000); fargos.Call("AddSummon", 14.6f, "JoostMod", "Cactusofdoom", (Func <bool>)(() => JoostWorld.downedJumboCactuar), 7500000); fargos.Call("AddSummon", 15.1f, "JoostMod", "InfectedArmCannon", (Func <bool>)(() => JoostWorld.downedSAX), 12500000); fargos.Call("AddSummon", 15.8f, "JoostMod", "Excalipoor", (Func <bool>)(() => JoostWorld.downedGilgamesh), 20000000); } InitializeHunts(); }
public override void Load() { Calameme = ModLoader.GetMod(nameof(global::CalamityMod.CalamityMod)) as global::CalamityMod.CalamityMod; }
public override void PostUpdate() { if (KeyPress(Keys.F3)) { draw = !draw; } if (update) { Main.chatRelease = true; Main.chatText = string.Empty; if (info == null) { Init(); } if (itemName.active) { itemName.InputText(); if (KeyPress(Keys.Enter) || (HoverOver(enter.box) && LeftClick())) { foreach (string mod in ModLoader.GetLoadedMods()) { getMod = ModLoader.GetMod(mod); modItem = getMod.GetItem(itemName.input); output = getMod.Name; if (modItem != null) { item = modItem.item; output += ", " + item.Name; break; } } } } for (int i = 0; i < max; i++) { if (LeftClick()) { if (HoverOver(itemName.box)) { itemName.active = !itemName.active; selected = -1; } if (HoverOver(info[i].box)) { info[i].active = !info[i].active; itemName.active = false; selected = i; break; } } if (KeyPress(Keys.Tab)) { if (selected++ < max - 1) { ; } else { selected = 0; } if (itemName.active) { selected = 0; itemName.active = false; } info[selected].active = true; break; } if (i != selected) { info[i].active = false; } if (info[i].active) { info[i].InputValues(); } if (i < button.Length) { if (item == null) { continue; } if (HoverOver(button[i].box) && LeftClick()) { switch (button[i].text) { case "Apply": for (int j = 0; j < max; j++) { int.TryParse(info[j].input, out values[j]); } item.width = values[0]; item.height = values[1]; item.damage = values[2]; float.TryParse(info[3].input, out item.knockBack); item.useTime = values[4]; item.useAnimation = values[5]; item.useStyle = values[6]; break; case "Clear": foreach (TextLine line in info) { line.input = string.Empty; } break; case "Output": info[0].input = item.width.ToString(); info[1].input = item.height.ToString(); info[2].input = item.damage.ToString(); info[3].input = item.knockBack.ToString(); info[4].input = item.useTime.ToString(); info[5].input = item.useAnimation.ToString(); info[6].input = item.useStyle.ToString(); break; case "Get Item": Main.item[0] = item; Main.item[0].stack = item.maxStack; Main.item[0].active = true; Main.item[0].position = player.Center; break; case "Export": using (StreamWriter sw = new StreamWriter(ModLoader.ModPath + "\\" + getMod.Name + "\\" + modItem.Name + ".ini")) foreach (TextLine line in info) { sw.Write(line.input + "\r\n"); } break; } } } } } else { if (info == null || itemName == null) { return; } foreach (TextLine line in info.Where(t => t != null)) { line.active = false; } itemName.active = false; } }
public override void AddRecipes() { Mod otherMod = ModLoader.GetMod("imkSushisMod"); if (otherMod != null) { //From ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.Frostbrand); recipe.AddIngredient(otherMod, "SwapToken"); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.IceBow); recipe.AddIngredient(otherMod, "SwapToken"); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.FlowerofFrost); recipe.AddIngredient(otherMod, "SwapToken"); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(this); recipe.AddRecipe(); //To recipe = new ModRecipe(mod); recipe.AddIngredient(this); recipe.AddIngredient(otherMod, "SwapToken"); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(ItemID.Frostbrand); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(this); recipe.AddIngredient(otherMod, "SwapToken"); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(ItemID.IceBow); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(this); recipe.AddIngredient(otherMod, "SwapToken"); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(ItemID.FlowerofFrost); recipe.AddRecipe(); Mod expandedSentries = ModLoader.GetMod("ExpandedSentries"); if (expandedSentries != null) { recipe = new ModRecipe(mod); recipe.AddIngredient(expandedSentries, "BallOfFrostSpitter"); recipe.AddIngredient(otherMod, "SwapToken"); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(this); recipe.AddIngredient(otherMod, "SwapToken"); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(expandedSentries, "BallOfFrostSpitter"); recipe.AddRecipe(); } } }
public override bool Autoload(ref string name) { return(ModLoader.GetMod("ThoriumMod") != null); }
public override bool Autoload(ref string name) => ModLoader.GetMod("BaseLibrary") != null;
// Token: 0x06000024 RID: 36 RVA: 0x00004504 File Offset: 0x00002704 public override void SetDefaults(NPC npc) { if (LanguageManager.Instance.ActiveCulture == GameCulture.Chinese && ModLoader.GetMod("CalamityMod") != null) { if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("Cryocore") || npc.type == ModLoader.GetMod("CalamityMod").NPCType("Cryocore2")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "冰川核心"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("Cryogen")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "极地之灵"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("CryogenIce")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "冰川护盾"); } if (npc.type == ModLoader.GetMod("CalamityMod").NPCType("IceMass")) { NPCLoader.GetNPC(npc.type).DisplayName.AddTranslation(GameCulture.Chinese, "极光之魂"); } } }
public override void ModifyTooltips(Item item, List <TooltipLine> tooltips) { if (LanguageManager.Instance.ActiveCulture == GameCulture.Chinese && ModLoader.GetMod("CalamityMod") != null) { foreach (TooltipLine tooltipLine in tooltips) { if (item.type == ModLoader.GetMod("CalamityMod").ItemType("OddMushroom")) { if (tooltipLine.text == "Trippy") { tooltipLine.text = "幻觉"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("YellowCandle")) { if (tooltipLine.text == "When placed, nearby enemies take 5% more damage.") { tooltipLine.text = "放置时,四周敌人受到额外5%伤害"; } if (tooltipLine.text == "This extra damage bypasses enemy damage reduction") { tooltipLine.text = "此效果无视敌人免伤"; } if (tooltipLine.text == "'Its hateful glow flickers with ire'") { tooltipLine.text = "“它可恨的光芒会随着火闪烁”"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("PurpleCandle")) { if (tooltipLine.text == "When placed, nearby players' defense blocks 5% more damage") { tooltipLine.text = "放置时,附近玩家的防御力抵消伤害效果增强5%"; } if (tooltipLine.text == "'Neither rain nor wind can snuff its undying flame'") { tooltipLine.text = "“暴风骤雨都无法熄灭这永恒的火焰”"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("PinkCandle")) { if (tooltipLine.text == "When placed, nearby players regenerate 0.4% of their maximum health per second") { tooltipLine.text = "放置后,附近的玩家增加0.4%生命上限的生命再生"; } if (tooltipLine.text == "This regeneration is at full power even while moving and bypasses Revengeance Mode caps") { tooltipLine.text = "玩家达到复仇模式的再生上限时,这个生命再生仍处于最大值"; } if (tooltipLine.text == "'Its brilliant light suffuses those nearby with hope'") { tooltipLine.text = "“它灿烂的光芒使附近的人们充满希望。”"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("BloodyMary")) { if (tooltipLine.text == "Boosts damage, movement speed, and melee speed by 15% and crit chance by 7% during a Blood Moon") { tooltipLine.text = "血月期间增加15%伤害,移速,近战攻速以及7%暴击率"; } if (tooltipLine.text == "Reduces life regen by 2 and defense by 6") { tooltipLine.text = "减少2生命再生速度和6点防御"; } if (tooltipLine.text == "Extra spicy and bloody!") { tooltipLine.text = "更辣更血腥!"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("BlueCandle")) { if (tooltipLine.text == "When placed, nearby players gain 15% movement speed, 10% wing time, and 5% acceleration") { tooltipLine.text = "放置时,增加附近玩家15%移动速度,10%飞行时间,5%加速度"; } if (tooltipLine.text == "'The floating flame seems to uplift your very spirit'") { tooltipLine.text = "“漂浮的火焰似乎让你更精神”"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("CaribbeanRum")) { if (tooltipLine.text == "Boosts life regen by 2 and movement speed and wing flight time by 20%") { tooltipLine.text = "增加2生命恢复速度和20%移速以及飞行时间"; } if (tooltipLine.text == "Makes you floaty and reduces defense by 12") { tooltipLine.text = "令你变得飘飘若仙并减少12点防御"; } if (tooltipLine.text == "Why is the rum gone?") { tooltipLine.text = "咦?酒怎么突然没了?"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("CinnamonRoll")) { if (tooltipLine.text == "Boosts mana regeneration rate and all fire-based weapon damage by 15%") { tooltipLine.text = "增加15%魔法恢复速度和所有火属性武器伤害"; } if (tooltipLine.text == "Cursed flame, shadowflame, god slayer inferno, brimstone flame, and frostburn weapons will not receive this benefit") { tooltipLine.text = "咒炎,暗影炎,弑神之火,硫磺火和霜火武器不会受到此增益"; } if (tooltipLine.text == "The weapon must be more fire-related than anything else") { tooltipLine.text = "武器必须跟火焰紧密相关才会受到此加成"; } if (tooltipLine.text == "Reduces defense by 12") { tooltipLine.text = "减少12点防御"; } if (tooltipLine.text == "A great-tasting cinnamon whiskey with a touch of cream soda") { tooltipLine.text = "肉桂威士忌,品起来就如奶油苏打一样,啊,绝赞美味"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("Everclear")) { if (tooltipLine.text == "Boosts damage by 25%") { tooltipLine.text = "增加25%的伤害"; } if (tooltipLine.text == "Reduces life regen by 10 and defense by 40") { tooltipLine.text = "减少10点生命再生和40点防御"; } if (tooltipLine.text == "This is the most potent booze I have, be careful with it") { tooltipLine.text = "这是我喝的最猛的酒,小心点\n(译注:Everclear,清如许,美国烈酒品牌)"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("EvergreenGin")) { if (tooltipLine.text == "Boosts nature-based weapon damage by 15% and damage reduction by 5%") { tooltipLine.text = "使自然属性的武器伤害增加15%,增加5%伤害减免"; } if (tooltipLine.text == "Reduces life regen by 1") { tooltipLine.text = "减少1生命再生"; } if (tooltipLine.text == "It tastes like a Christmas tree if you can imagine that") { tooltipLine.text = "如果你能想象的话,它尝起来就像一棵圣诞树\n(译注:Gin,琴酒,金酒,杜松子酒)"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("FabsolsVodka")) { if (tooltipLine.text == "Boosts all damage stats by 8% but lowers defense by 20") { tooltipLine.text = "增加8%所有伤害,降低20防御"; } if (tooltipLine.text == "Increases immune time after being struck") { tooltipLine.text = "延长受伤后无敌帧时间"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("Fireball")) { if (tooltipLine.text == "Boosts all fire-based weapon damage by 10%") { tooltipLine.text = "增加10%所有火炎属性武器的伤害"; } if (tooltipLine.text == "Cursed flame, shadowflame, god slayer inferno, brimstone flame, and frostburn weapons will not receive this benefit") { tooltipLine.text = "咒炎,暗影炎,弑神之火,硫磺火和霜火武器不会受到此增益"; } if (tooltipLine.text == "The weapon must be more fire-related than anything else") { tooltipLine.text = "武器必须跟火焰紧密相关才会受到此加成"; } if (tooltipLine.text == "Reduces life regen by 1") { tooltipLine.text = "减少1生命再生"; } if (tooltipLine.text == "A great-tasting cinnamon whiskey") { tooltipLine.text = "非常爽口的肉桂威士忌"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("GrapeBeer")) { if (tooltipLine.text == "Restores 100 mana") { tooltipLine.text = "恢复100点魔力"; } if (tooltipLine.text == "Reduces defense by 2 and movement speed by 5%") { tooltipLine.text = "减少2点防御和5%移动速度"; } if (tooltipLine.text == "This crap is abhorrent but you might like it") { tooltipLine.text = "这鬼玩意真恶心,但你可能会喜欢它"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("Margarita")) { if (tooltipLine.text == "Restores 200 mana") { tooltipLine.text = "恢复200点魔力"; } if (tooltipLine.text == "Makes you immune to most debuffs") { tooltipLine.text = "使你对大多数debuff免疫"; } if (tooltipLine.text == "Reduces defense by 6 and life regen by 1") { tooltipLine.text = "减少6点防御和1点生命回复"; } if (tooltipLine.text == "One of the best drinks ever created, enjoy it while it lasts") { tooltipLine.text = "有史以来最好的饮品之一,好好回味吧"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("Moonshine")) { if (tooltipLine.text == "Increases defense by 10 and damage reduction by 5%") { tooltipLine.text = "增加10点防御,减少5%伤害"; } if (tooltipLine.text == "Reduces life regen by 1") { tooltipLine.text = "减少1生命再生"; } if (tooltipLine.text == "This stuff is pretty strong but I'm sure you can handle it") { tooltipLine.text = "这东西很强大,但我相信你轻松掌控\n(译注:为避免被发现所以蒸馏通常在夜间进行,所以美国也用“月光”(英语:Moonshine)一词来指代私酒)"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("MoscowMule")) { if (tooltipLine.text == "Boosts damage and knockback by 9% and critical strike chance by 3%") { tooltipLine.text = "增加9%的伤害和击退,3%暴击率"; } if (tooltipLine.text == "Reduces life regen by 2") { tooltipLine.text = "减少2生命再生"; } if (tooltipLine.text == "I once heard the copper mug can be toxic and I told 'em 'listen dummy, I'm already poisoning myself'") { tooltipLine.text = "听说铜杯有毒,我告诉他们“听着,笨蛋,我中毒了”"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("RedWine")) { if (tooltipLine.text == "Reduces life regen by 1") { tooltipLine.text = "减少1生命再生"; } if (tooltipLine.text == "Too dry for my taste") { tooltipLine.text = "让我觉得太干了"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("RedWine")) { if (tooltipLine.text == "Reduces life regen by 1") { tooltipLine.text = "减少1生命再生"; } if (tooltipLine.text == "Too dry for my taste") { tooltipLine.text = "让我觉得太干了"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("Rum")) { if (tooltipLine.text == "Boosts life regen by 2 and movement speed by 10%") { tooltipLine.text = "增加2生命再生和10%移动速度"; } if (tooltipLine.text == "Reduces defense by 8") { tooltipLine.text = "减少8防御力"; } if (tooltipLine.text == "Sweet and potent, just how I like it") { tooltipLine.text = "又甜又烈,正合我意"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("Rum")) { if (tooltipLine.text == "Boosts piercing projectile damage by 10%") { tooltipLine.text = "增加10%穿透类弹幕的伤害"; } if (tooltipLine.text == "Reduces life regen by 1") { tooltipLine.text = "减少1生命再生"; } if (tooltipLine.text == "Do you have a screw loose?") { tooltipLine.text = "你...耍酒疯吗?"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("StarBeamRye")) { if (tooltipLine.text == "Boosts max mana by 50, magic damage by 8%,") { tooltipLine.text = "+50魔力上限,增加8%魔法伤害"; } if (tooltipLine.text == "and reduces mana usage by 10%") { tooltipLine.text = "减少10%的魔力消耗"; } if (tooltipLine.text == "Reduces defense by 6 and life regen by 1") { tooltipLine.text = "减少6点的防御和1生命再生"; } if (tooltipLine.text == "Made from some stuff I found near the Astral Meteor crash site, don't worry it's safe, trust me") { tooltipLine.text = "这是我在彗星坠落地附近发现的一些东西制作的,别担心,很安全,相信我"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("Tequila")) { if (tooltipLine.text == "Boosts damage, damage reduction, and knockback by 3%, crit chance by 2%, and defense by 5 during daytime") { tooltipLine.text = "在白天增加3%伤害,伤害减免,击退和2%暴击率,增加5防御"; } if (tooltipLine.text == "Reduces life regen by 1") { tooltipLine.text = "减少1生命再生"; } if (tooltipLine.text == "Reduces defense by 6 and life regen by 1") { tooltipLine.text = "减少6点的防御和1生命再生"; } if (tooltipLine.text == "Great for mixing up daytime drinks") { tooltipLine.text = "适合与一些日间酒品调配鸡尾酒"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("TequilaSunrise")) { if (tooltipLine.text == "Boosts damage, damage reduction, and knockback by 7%, crit chance by 3%, and defense by 15 during daytime") { tooltipLine.text = "在白天增加7%伤害,伤害减免,击退和3%暴击率,增加15防御"; } if (tooltipLine.text == "Reduces life regen by 1") { tooltipLine.text = "减少1生命再生"; } if (tooltipLine.text == "The greatest daytime drink I've ever had") { tooltipLine.text = "我白天喝的最好的酒"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("Vodka")) { if (tooltipLine.text == "Boosts damage by 6% and critical strike chance by 2%") { tooltipLine.text = "增加6%的伤害和2%暴击率"; } if (tooltipLine.text == "Reduces life regen by 1 and defense by 4") { tooltipLine.text = "减少1生命再生和4防御力"; } if (tooltipLine.text == "The number one alcohol for creating great mixed drinks") { tooltipLine.text = "适合混调的头号酒"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("Whiskey")) { if (tooltipLine.text == "Boosts damage and knockback by 4% and critical strike chance by 2%") { tooltipLine.text = "增加4%伤害和击退,2%暴击率"; } if (tooltipLine.text == "Reduces defense by 8") { tooltipLine.text = "减少8防御"; } if (tooltipLine.text == "The burning sensation makes it tastier") { tooltipLine.text = "灼烧的口感使它更美味"; } } if (item.type == ModLoader.GetMod("CalamityMod").ItemType("WhiteWine")) { if (tooltipLine.text == "Boosts magic damage by 10%") { tooltipLine.text = "增加10%魔法伤害"; } if (tooltipLine.text == "Reduces defense by 6 and life regen by 1") { tooltipLine.text = "减少6防御和1点生命再生"; } if (tooltipLine.text == "I drank a full barrel of this stuff once in one night, I couldn't remember who I was the next day") { tooltipLine.text = "我昨晚喝一整桶这种东西,第二天我连我叫啥都不知道了"; } } } } }