public override void Load() { slayerMusic = GetSoundSlot(SoundType.Music, "Sounds/Music/UpperDepths"); elvargMusic = GetSoundSlot(SoundType.Music, "Sounds/Music/Attack2"); chaoseleMusic = GetSoundSlot(SoundType.Music, "Sounds/Music/EverlastingFire"); barrowsMusic = GetSoundSlot(SoundType.Music, "Sounds/Music/DangerousWay"); olmMusic = GetSoundSlot(SoundType.Music, "Sounds/Music/MonkeyBadness"); /*slayerMusic = MusicID.Boss1; * elvargMusic = MusicID.Boss1; * chaoseleMusic = MusicID.Boss2; * barrowsMusic = MusicID.Boss3; * olmMusic = MusicID.LunarBoss;*/ AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MainTheme"), ItemType("MainThemeBoxItem"), TileType("MainThemeBox")); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MonkeyBadness"), ItemType("OlmMusicBoxItem"), TileType("OlmMusicBox")); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Attack2"), ItemType("ElvargMusicBoxItem"), TileType("ElvargMusicBox")); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/EverlastingFire"), ItemType("ChaosMusicBoxItem"), TileType("ChaosMusicBox")); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/DangerousWay"), ItemType("BarrowsMusicBoxItem"), TileType("BarrowsMusicBox")); SlayerTokenCurrencyInt = CustomCurrencyManager.RegisterCurrency(new SlayerTokenCurrency(ModContent.ItemType <Items.SlayerToken>(), 999L)); if (!Main.dedServ) { clueInterface = new UserInterface(); clueUI = new ClueUI(); ClueUI.visible = false; clueInterface.SetState(clueUI); clueRewardInterface = new UserInterface(); clueRewardUI = new ClueRewardUI(); ClueRewardUI.visible = false; clueRewardInterface.SetState(clueRewardUI); } }
public override void Load() { for (int k = 1; k <= 4; k++) { AddBossHeadTexture(captiveElementHead + k); AddBossHeadTexture(captiveElement2Head + k); } RandomBuffHotKey = RegisterHotKey("Random Buff", "P"); FaceCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(new ExampleCustomCurrency(ItemType <Items.Face>(), 999L)); if (!Main.dedServ) { AddEquipTexture(null, EquipType.Legs, "ExampleRobe_Legs", "ExampleMod/Items/Armor/ExampleRobe_Legs"); //Main.music[MusicID.Dungeon].ModMusic = GetSound("Sounds/Music/ExampleMusic").CreateInstance(); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/DriveMusic"), ItemType("ExampleMusicBox"), TileType("ExampleMusicBox")); Main.instance.LoadTiles(TileID.Loom); Main.tileTexture[TileID.Loom] = GetTexture("Tiles/AnimatedLoom"); // What if....Replace a vanilla item texture and equip texture. //Main.itemTexture[ItemID.CopperHelmet] = GetTexture("Resprite/CopperHelmet_Item"); //Item copperHelmet = new Item(); //copperHelmet.SetDefaults(ItemID.CopperHelmet); //Main.armorHeadLoaded[copperHelmet.headSlot] = true; //Main.armorHeadTexture[copperHelmet.headSlot] = GetTexture("Resprite/CopperHelmet_Head"); Filters.Scene["ExampleMod:PuritySpirit"] = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh); SkyManager.Instance["ExampleMod:PuritySpirit"] = new PuritySpiritSky(); Filters.Scene["ExampleMod:MonolithVoid"] = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium); SkyManager.Instance["ExampleMod:MonolithVoid"] = new VoidSky(); exampleFont = GetFont("Fonts/ExampleFont"); exampleUI = new ExampleUI(); exampleUI.Activate(); exampleUserInterface = new UserInterface(); exampleUserInterface.SetState(exampleUI); } }
public override void Load() { if (Main.rand == null) { Main.rand = new Terraria.Utilities.UnifiedRandom(); } //Always keep this call in the first line of Load! LoadReferences(); //Don't add any code before LoadReferences(), // unless you know what you're doing. Filters.Scene["SpiritMod:SpiritSky"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0f, 0.5f, 1f).UseOpacity(0.3f), EffectPriority.High); Filters.Scene["SpiritMod:BlueMoonSky"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0f, 0.3f, 1f).UseOpacity(0.75f), EffectPriority.High); instance = this; SpecialKey = RegisterHotKey("Armor Bonus", "Q"); ReachKey = RegisterHotKey("Frenzy Plant", "E"); HolyKey = RegisterHotKey("Holy Ward", "Z"); GlyphCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(new Currency(ItemType <Items.Glyphs.Glyph>(), 999L)); if (!Main.dedServ) { Filters.Scene["SpiritMod:Overseer"] = new Filter(new SeerScreenShaderData("FilterMiniTower").UseColor(0f, 0.3f, 1f).UseOpacity(0.75f), EffectPriority.VeryHigh); SkyManager.Instance["SpiritMod:Overseer"] = new SeerSky(); Filters.Scene["SpiritMod:IlluminantMaster"] = new Filter(new SeerScreenShaderData("FilterMiniTower").UseColor(1.2f, 0.1f, 1f).UseOpacity(0.75f), EffectPriority.VeryHigh); SkyManager.Instance["SpiritMod:IlluminantMasterr"] = new SeerSky(); Filters.Scene["SpiritMod:Atlas"] = new Filter(new AtlasScreenShaderData("FilterMiniTower").UseColor(0.5f, 0.5f, 0.5f).UseOpacity(0.6f), EffectPriority.VeryHigh); SkyManager.Instance["SpiritMod:Atlas"] = new AtlasSky(); } }
public override void Load() { Config.Load(); ModTranslation text = CreateTranslation("DC1"); text.SetDefault("Damage type changed to Magic"); text.AddTranslation(GameCulture.Russian, "Тип урона изменён на Магический"); AddTranslation(text); text = CreateTranslation("DC2"); text.SetDefault("Damage type changed to Melee"); text.AddTranslation(GameCulture.Russian, "Тип урона изменён на Ближний"); AddTranslation(text); LampLight = RegisterHotKey("Lamp Light Toggle", "L"); if (!Main.dedServ) { AddEquipTexture(null, EquipType.Legs, "somebody0214Robe_Legs", "AlchemistNPC/Items/Armor/somebody0214Robe_Legs"); } ReversivityCoinTier1ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier1Data(ItemType <Items.ReversivityCoinTier1>(), 999L)); ReversivityCoinTier2ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier2Data(ItemType <Items.ReversivityCoinTier2>(), 999L)); ReversivityCoinTier3ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier3Data(ItemType <Items.ReversivityCoinTier3>(), 999L)); ReversivityCoinTier4ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier4Data(ItemType <Items.ReversivityCoinTier4>(), 999L)); ReversivityCoinTier5ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier5Data(ItemType <Items.ReversivityCoinTier5>(), 999L)); ReversivityCoinTier6ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier6Data(ItemType <Items.ReversivityCoinTier6>(), 999L)); instance = this; }
public override void Load() { instance = this; ApollyonCoin = CustomCurrencyManager.RegisterCurrency(new Items.ACoins(ModContent.ItemType <Items.ApollyonCoin>())); if (Main.netMode != NetmodeID.Server) { #region sky things Filters.Scene["Eternal:Empraynia"] = new Filter(new EmprayniaScreenShaderData("FilterMiniTower").UseColor(0.229f, 0.84f, 0.255f).UseOpacity(0.6f), EffectPriority.VeryHigh); SkyManager.Instance["Eternal:Empraynia"] = new EmprayniaSky(); Filters.Scene["Eternal:AshpitSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["Eternal:AshpitSky"] = new AshpitSky(); Filters.Scene["Eternal:CosmicEmperorP3"] = new Filter(new EmprayniaScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryHigh); SkyManager.Instance["Eternal:CosmicEmperorP3"] = new EmprayniaSky(); #endregion } #region Radiant Class Bar EtherealPowerBar = new EtherealPowerBar(); _etherealPowerBarUserInterface = new UserInterface(); _etherealPowerBarUserInterface.SetState(EtherealPowerBar); #endregion }
internal static void Unload() { ContentInstance.Clear(); ModTypeLookup.Clear(); ItemLoader.Unload(); EquipLoader.Unload(); ModPrefix.Unload(); ModDust.Unload(); TileLoader.Unload(); ModTileEntity.UnloadAll(); WallLoader.Unload(); ProjectileLoader.Unload(); NPCLoader.Unload(); NPCHeadLoader.Unload(); PlayerHooks.Unload(); BuffLoader.Unload(); MountLoader.Unload(); RarityLoader.Unload(); DamageClassLoader.Unload(); ModGore.Unload(); SoundLoader.Unload(); DisposeMusic(); BackgroundTextureLoader.Unload(); UgBgStyleLoader.Unload(); SurfaceBgStyleLoader.Unload(); GlobalBgStyleLoader.Unload(); WaterStyleLoader.Unload(); WaterfallStyleLoader.Unload(); WorldHooks.Unload(); ResizeArrays(true); for (int k = 0; k < Recipe.maxRecipes; k++) { Main.recipe[k] = new Recipe(); } Recipe.numRecipes = 0; RecipeGroupHelper.ResetRecipeGroups(); Recipe.SetupRecipes(); MapLoader.UnloadModMap(); ItemSorting.SetupWhiteLists(); HotKeyLoader.Unload(); RecipeHooks.Unload(); CommandManager.Unload(); TagSerializer.Reload(); ModNet.Unload(); Config.ConfigManager.Unload(); CustomCurrencyManager.Initialize(); EffectsTracker.RemoveModEffects(); // ItemID.Search = IdDictionary.Create<ItemID, short>(); // NPCID.Search = IdDictionary.Create<NPCID, short>(); // ProjectileID.Search = IdDictionary.Create<ProjectileID, short>(); // TileID.Search = IdDictionary.Create<TileID, ushort>(); // WallID.Search = IdDictionary.Create<WallID, ushort>(); // BuffID.Search = IdDictionary.Create<BuffID, int>(); ContentSamples.Initialize(); CleanupModReferences(); }
public override void Load() { if (!Main.dedServ) { LoadClient(); } FaceCustomCurrencyId = CustomCurrencyManager.RegisterCurrency(new Items.Currency.UnuCreditData(ModContent.ItemType <Items.Currency.UnuCredit>(), 999999L)); }
public override void Load() { mod = this; RegisterHotKey(Channel.Name, Channel.DefaultKey.ToString()); RegisterHotKey(Ult.Name, Ult.DefaultKey.ToString()); LightCurrencyID = CustomCurrencyManager.RegisterCurrency(new LightForgeData(ModContent.ItemType <LightI>(), 999L)); //this defines the item Currency, so CustomCurrencyItem now is a Currency //ChargeKey = Light.Cha; ChargeKey = Channel.DefaultKey.ToString(); }
public override void Load() { Instance = this; Config.Load(); //SBMW:Try to add translation for hotkey, seems worked, but requires to reload mod if change game language, first load after build mod may not work string LampLightToggle = Language.GetTextValue("Lamp Light Toggle"); string DiscordBuffTeleportation = Language.GetTextValue("Discord Buff Teleportation"); string PipBoy = Language.GetTextValue("Pip-Boy Teleportation Menu"); LampLight = RegisterHotKey(LampLightToggle, "L"); DiscordBuff = RegisterHotKey(DiscordBuffTeleportation, "Q"); PipBoyTP = RegisterHotKey(PipBoy, "P"); if (!Main.dedServ) { AddEquipTexture(null, EquipType.Legs, "somebody0214Robe_Legs", "AlchemistNPC/Items/Armor/somebody0214Robe_Legs"); } ReversivityCoinTier1ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier1Data(ItemType <Items.Misc.ReversivityCoinTier1>(), 999L)); ReversivityCoinTier2ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier2Data(ItemType <Items.Misc.ReversivityCoinTier2>(), 999L)); ReversivityCoinTier3ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier3Data(ItemType <Items.Misc.ReversivityCoinTier3>(), 999L)); ReversivityCoinTier4ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier4Data(ItemType <Items.Misc.ReversivityCoinTier4>(), 999L)); ReversivityCoinTier5ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier5Data(ItemType <Items.Misc.ReversivityCoinTier5>(), 999L)); ReversivityCoinTier6ID = CustomCurrencyManager.RegisterCurrency(new ReversivityCoinTier6Data(ItemType <Items.Misc.ReversivityCoinTier6>(), 999L)); instance = this; SetTranslation(); if (!Main.dedServ) { AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Deltarune OST - Chaos King"), ItemType("ChaosKingMusicBox"), TileType("ChaosKingMusicBox")); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Deltarune OST - Field of Hopes And Dreams"), ItemType("FieldsMusicBox"), TileType("FieldsMusicBox")); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Deltarune OST - Lantern"), ItemType("SheamMusicBox"), TileType("SheamMusicBox")); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Deltarune OST - The World Revolving"), ItemType("TheWorldRevolvingMusicBox"), TileType("TheWorldRevolvingMusicBox")); alchemistUI = new ShopChangeUI(); alchemistUI.Activate(); alchemistUserInterface = new UserInterface(); alchemistUserInterface.SetState(alchemistUI); alchemistUIA = new ShopChangeUIA(); alchemistUIA.Activate(); alchemistUserInterfaceA = new UserInterface(); alchemistUserInterfaceA.SetState(alchemistUIA); alchemistUIO = new ShopChangeUIO(); alchemistUIO.Activate(); alchemistUserInterfaceO = new UserInterface(); alchemistUserInterfaceO.SetState(alchemistUIO); pipboyUI = new PipBoyTPMenu(); pipboyUI.Activate(); alchemistUserInterfaceP = new UserInterface(); alchemistUserInterfaceP.SetState(pipboyUI); } }
public override void Load() { for (int k = 1; k <= 4; k++) { AddBossHeadTexture(captiveElementHead + k); AddBossHeadTexture(captiveElement2Head + k); } RandomBuffHotKey = RegisterHotKey("Random Buff", "P"); FaceCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(new ExampleCustomCurrency(ItemType <Items.Face>(), 999L)); if (!Main.dedServ) { AddEquipTexture(null, EquipType.Legs, "ExampleRobe_Legs", "ExampleMod/Items/Armor/ExampleRobe_Legs"); AddEquipTexture(new Items.Armor.BlockyHead(), null, EquipType.Head, "BlockyHead", "ExampleMod/Items/Armor/ExampleCostume_Head"); AddEquipTexture(new Items.Armor.BlockyBody(), null, EquipType.Body, "BlockyBody", "ExampleMod/Items/Armor/ExampleCostume_Body", "ExampleMod/Items/Armor/ExampleCostume_Arms"); AddEquipTexture(new Items.Armor.BlockyLegs(), null, EquipType.Legs, "BlockyLeg", "ExampleMod/Items/Armor/ExampleCostume_Legs"); //Main.music[MusicID.Dungeon].ModMusic = GetSound("Sounds/Music/ExampleMusic").CreateInstance(); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/DriveMusic"), ItemType("ExampleMusicBox"), TileType("ExampleMusicBox")); Main.instance.LoadTiles(TileID.Loom); Main.tileTexture[TileID.Loom] = GetTexture("Tiles/AnimatedLoom"); // What if....Replace a vanilla item texture and equip texture. //Main.itemTexture[ItemID.CopperHelmet] = GetTexture("Resprite/CopperHelmet_Item"); //Item copperHelmet = new Item(); //copperHelmet.SetDefaults(ItemID.CopperHelmet); //Main.armorHeadLoaded[copperHelmet.headSlot] = true; //Main.armorHeadTexture[copperHelmet.headSlot] = GetTexture("Resprite/CopperHelmet_Head"); Filters.Scene["ExampleMod:PuritySpirit"] = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh); SkyManager.Instance["ExampleMod:PuritySpirit"] = new PuritySpiritSky(); Filters.Scene["ExampleMod:MonolithVoid"] = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium); SkyManager.Instance["ExampleMod:MonolithVoid"] = new VoidSky(); // exampleFont = GetFont("Fonts/ExampleFont"); exampleEffect = GetEffect("Effects/ExampleEffect"); Ref <Effect> exampleEffectRef = new Ref <Effect>(); exampleEffectRef.Value = exampleEffect; GameShaders.Armor.BindShader <ArmorShaderData>(ItemType <Items.ExampleDye>(), new ArmorShaderData(exampleEffectRef, "ExampleDyePass")); exampleUI = new ExampleUI(); exampleUI.Activate(); exampleUserInterface = new UserInterface(); exampleUserInterface.SetState(exampleUI); } ModTranslation text = CreateTranslation("LivesLeft"); text.SetDefault("{0} has {1} lives left!"); AddTranslation(text); text = CreateTranslation("LifeLeft"); text.SetDefault("{0} has 1 life left!"); AddTranslation(text); text = CreateTranslation("NPCTalk"); text.SetDefault("<{0}> {1}"); AddTranslation(text); text = CreateTranslation("VolcanoWarning"); text.SetDefault("Did you hear something....A Volcano! Find Cover!"); AddTranslation(text); }
public override void Load() { if (!Main.dedServ) { SlayerMedalID = CustomCurrencyManager.RegisterCurrency(new SlayerMedalData(ItemType("SlayerMedalItem"), 999L)); //this defines the item Currency, so CustomCurrencyItem now is a Currency slayerInterface = new UserInterface(); slayerUI = new SlayerUI(); slayerUI.Activate(); ShowUI(); } }
public override void Load() { Config.Load(); instance = this; RewardCreditID = CustomCurrencyManager.RegisterCurrency(new RewardCredit(ItemType("RewardCredit"), 999L)); ToggleAppHotKey = RegisterHotKey("Toggle App Phone", "P"); ToggleAppHotKey = null; instance = null; }
private static bool Player_CanBuyItem(Func <Player, int, int, bool> orig, Player self, int price, int customCurrency) { if (customCurrency != -1) { return(CustomCurrencyManager.BuyItem(self, price, customCurrency)); } long inventoryCount = Utils.CoinsCount(out bool _, self.inventory, 58, 57, 56, 55, 54); long piggyCount = Utils.CoinsCount(out bool _, self.bank.item); long safeCount = Utils.CoinsCount(out bool _, self.bank2.item); long defendersCount = Utils.CoinsCount(out bool _, self.bank3.item); long walletCount = self.inventory.OfType <Wallet>().Sum(wallet => wallet.Handler.Items.CountCoins()); long combined = Utils.CoinsCombineStacks(out bool _, inventoryCount, piggyCount, safeCount, defendersCount, walletCount); return(combined >= price); }
public override void Load() { Instance = ModContent.GetInstance <KeybrandsPlus>(); QuickEther = RegisterHotKey("Quick Ether", "F"); #region Mod Support SacredTools = ModLoader.GetMod("SacredTools"); SoALoaded = SacredTools != null; #endregion if (!Main.dedServ) { GameShaders.Armor.BindShader(ModContent.ItemType <Items.Other.FullbrightDye>(), new ArmorShaderData(new Ref <Effect>(GetEffect("Effects/Fullbright")), "FullbrightShader")); MunnyCost = CustomCurrencyManager.RegisterCurrency(new MunnyData(ModContent.ItemType <Items.Currency.Munny>(), 9999L)); } }
public override void Load() { StarCall = RegisterHotKey("Star Call", "F"); BronzeCoinID = CustomCurrencyManager.RegisterCurrency(new BronzeCoinCurrency(ItemType <Items.BronzeCoin>(), 999L)); SoulGemID = CustomCurrencyManager.RegisterCurrency(new SoulGemCurrency(ItemType <Items.SoulGem>(), 999L)); ForestSpiritID = CustomCurrencyManager.RegisterCurrency(new ForestSpiritCurrency(ItemType <Items.ForestSpiritSoul>(), 999L)); if (!Main.dedServ) { // Add certain equip textures AddEquipTexture(new Items.Armor.FrostHead(), null, EquipType.Head, "FrostHead", "EnduriumMod/Items/Armor/TheFrozenMoonlight_Head"); AddEquipTexture(new Items.Armor.FrostBody(), null, EquipType.Body, "FrostBody", "EnduriumMod/Items/Armor/TheFrozenMoonlight_Body", "EnduriumMod/Items/Armor/TheFrozenMoonlight_Arms"); AddEquipTexture(new Items.Armor.FrostLeg(), null, EquipType.Legs, "FrostLeg", "EnduriumMod/Items/Armor/TheFrozenMoonlight_Legs"); AddEquipTexture(new Items.Accesories.DemonHead(), null, EquipType.Head, "DemonHead", "EnduriumMod/Items/Accesories/CharmofSacrifises_Head"); AddEquipTexture(new Items.Accesories.DemonBody(), null, EquipType.Body, "DemonBody", "EnduriumMod/Items/Accesories/CharmofSacrifises_Body", "EnduriumMod/Items/Accesories/CharmofSacrifises_Arms"); AddEquipTexture(new Items.Accesories.DemonLeg(), null, EquipType.Legs, "DemonLeg", "EnduriumMod/Items/Accesories/CharmofSacrifises_Legs"); } }
internal static void Unload() { ItemLoader.Unload(); EquipLoader.Unload(); ModPrefix.Unload(); ModDust.Unload(); TileLoader.Unload(); ModTileEntity.Unload(); WallLoader.Unload(); ProjectileLoader.Unload(); NPCLoader.Unload(); NPCHeadLoader.Unload(); PlayerHooks.Unload(); BuffLoader.Unload(); MountLoader.Unload(); ModGore.Unload(); SoundLoader.Unload(); DisposeMusic(); BackgroundTextureLoader.Unload(); UgBgStyleLoader.Unload(); SurfaceBgStyleLoader.Unload(); GlobalBgStyleLoader.Unload(); WaterStyleLoader.Unload(); WaterfallStyleLoader.Unload(); WorldHooks.Unload(); ResizeArrays(true); for (int k = 0; k < Recipe.maxRecipes; k++) { Main.recipe[k] = new Recipe(); } Recipe.numRecipes = 0; RecipeGroupHelper.ResetRecipeGroups(); Recipe.SetupRecipes(); MapLoader.UnloadModMap(); ItemSorting.SetupWhiteLists(); modHotKeys.Clear(); RecipeHooks.Unload(); CommandManager.Unload(); TagSerializer.Reload(); ModNet.Unload(); Config.ConfigManager.Unload(); CustomCurrencyManager.Initialize(); EffectsTracker.RemoveModEffects(); CleanupModReferences(); }
public override void Load() { mod = this; ClickerCompat.Load(); if (ModLoader.GetMod("SacredTools") != null) { LunarCoinCloneID = CustomCurrencyManager.RegisterCurrency((CustomCurrencySystem) new LunarCoinClone(ModLoader.GetMod("SacredTools").ItemType("LunarCoin"), 999L)); } if (!Main.dedServ) { MiceSky.PlanetTexture = GetTexture("NPCs/Bosses/MicePlanet"); Filters.Scene["ClickerAddon:Mice"] = new Filter(new MiceData("FilterMiniTower").UseColor(0.45f, 0.5f, 0.85f).UseOpacity(0.82f), EffectPriority.VeryHigh); SkyManager.Instance["ClickerAddon:Mice"] = new MiceSky(); } ClickerClassGlobalItemStats.astralArmor = new bool[3] { false, false, false }; }
public override void HandleCommand(BinaryReader reader, int playerNumber) { // 服务器端 if (Main.netMode == 2) { var name = reader.ReadString(); var player = Main.player[playerNumber]; var splayer = player.GetServerPlayer(); if (splayer.Union != null) { splayer.SendMessageBox("你已经有公会了", 120, Color.Yellow); return; } if (ServerSideCharacter2.UnionManager.ContainsUnion(name)) { splayer.SendMessageBox("该名字的公会已经存在", 120, Color.OrangeRed); return; } if (Authorization.CheckName(name) != 0) { splayer.SendMessageBox("公会名字不合法,长度应为2-10之间,且不能包含非法字符", 120, Color.OrangeRed); return; } if (splayer.CheckGuCoin(1000, true)) { ServerSideCharacter2.UnionManager.CreateUnion(name, splayer); splayer.SendMessageBox("公会创建成功", 180, Color.LimeGreen); var s = $"玩家 {splayer.Name} 创建了公会 {name},快来看看吧"; ServerPlayer.SendInfoMessageToAll(s); CommandBoardcast.ConsoleMessage(s); } else { string[] tag = new string[3]; int curline = 0; CustomCurrencyManager.GetPriceText(UnionManager.CustomCurrencyID, tag, ref curline, 1000); splayer.SendMessageBox($"创建公会所需资金:" + $"1000 咕币 数量不足!", 180, Color.White); return; } } }
public override bool IsItemValid(int slot, Item item) { switch (slot) { case 0: return(item.type == ItemID.PlatinumCoin); case 1: return(item.type == ItemID.GoldCoin); case 2: return(item.type == ItemID.SilverCoin); case 3: return(item.type == ItemID.CopperCoin); default: return(CustomCurrencyManager.IsCustomCurrency(item)); } }
private static void ItemSlot_DrawSavings(ItemSlot.orig_DrawSavings orig, SpriteBatch sb, float shopx, float shopy, bool horizontal) { Player player = Main.LocalPlayer; int customCurrencyForSavings = typeof(Terraria.UI.ItemSlot).GetValue <int>("_customCurrencyForSavings"); if (customCurrencyForSavings != -1) { CustomCurrencyManager.DrawSavings(sb, customCurrencyForSavings, shopx, shopy, horizontal); return; } long piggyCount = Utils.CoinsCount(out bool _, player.bank.item); long safeCount = Utils.CoinsCount(out bool _, player.bank2.item); long defendersCount = Utils.CoinsCount(out bool _, player.bank3.item); long walletCount = player.inventory.OfType <Wallet>().Sum(wallet => wallet.Handler.Items.CountCoins()); long combined = Utils.CoinsCombineStacks(out bool _, piggyCount, safeCount, defendersCount, walletCount); if (combined > 0L) { int walletType = PortableStorage.Instance.ItemType <Wallet>(); if (defendersCount > 0L) { sb.Draw(Main.itemTexture[ItemID.DefendersForge], Utils.CenteredRectangle(new Vector2(shopx + 92f, shopy + 45f), Main.itemTexture[ItemID.DefendersForge].Size() * 0.65f), null, Color.White); } if (walletCount > 0L) { sb.Draw(Main.itemTexture[walletType], Utils.CenteredRectangle(new Vector2(shopx + 70f, shopy + 40f), Main.itemTexture[walletType].Size() * 0.5f)); } if (safeCount > 0L) { sb.Draw(Main.itemTexture[ItemID.Safe], Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), Main.itemTexture[ItemID.Safe].Size() * 0.65f), null, Color.White); } if (piggyCount > 0L) { sb.Draw(Main.itemTexture[ItemID.PiggyBank], Utils.CenteredRectangle(new Vector2(shopx + 70f, shopy + 60f), Main.itemTexture[ItemID.PiggyBank].Size() * 0.65f), null, Color.White); } Terraria.UI.ItemSlot.DrawMoney(sb, Language.GetTextValue("LegacyInterface.66"), shopx, shopy, Utils.CoinsSplit(combined), horizontal); } }
public override bool Autoload(ref string name) { name = "Contraband Merchant"; OverseenCrystalCustomCurrencySystem = new OverseenCrystalCurrency(ModContent.ItemType <OverseenCrystal>(), 999L); OverseenCrystalCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(OverseenCrystalCustomCurrencySystem); AncientClothCurrencyCustomCurrencySystem = new AncientClothCurrency(ItemID.AncientCloth, 999L); AncientClothCurrencyCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(AncientClothCurrencyCustomCurrencySystem); DesertFossilCurrencyCustomCurrencySystem = new DesertFossilCurrency(ItemID.FossilOre, 999L); DesertFossilCurrencyCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(DesertFossilCurrencyCustomCurrencySystem); GlowrockCustomCurrencySystem = new GlowrockCurrency(ModContent.ItemType <Glowrock>(), 999L); GlowrockCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(GlowrockCustomCurrencySystem); CrateCurrencyCustomCurrencySystem = new CrateCurrency(ModContent.ItemType <TerrariacoCrateBase>(), 999L); CrateCurrencyCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(CrateCurrencyCustomCurrencySystem); return(true); //return mod.Properties.Autoload; }
public override void Load() { bloodLevel = new BloodUI(); bloodLevel.Initialize(); bloodLevelUI = new UserInterface(); bloodLevelUI.SetState(bloodLevel); NoteUI = new NoteUI(); NoteUI.Initialize(); notesUI = new UserInterface(); notesUI.SetState(NoteUI); AetherUI = new AetherUI(); AetherUI.Initialize(); aetherUI = new UserInterface(); aetherUI.SetState(AetherUI); UseBlood = RegisterHotKey("Use Blood Magic", "G"); TynCoinID = CustomCurrencyManager.RegisterCurrency(new TynCoin(ModContent.ItemType <Items.TynCoin>(), 999L)); tng = GetSoundSlot(SoundType.Music, "Sounds/Music/TouchNGo"); alc = GetSoundSlot(SoundType.Music, "Sounds/Music/Alchemy"); }
public override void Load() { instance = this; // Adds boss head textures for the Abomination boss for (int k = 1; k <= 4; k++) { AddBossHeadTexture(captiveElementHead + k); AddBossHeadTexture(captiveElement2Head + k); } // Registers a new hotkey RandomBuffHotKey = RegisterHotKey("Random Buff", "P"); // Registers a new custom currency FaceCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(new ExampleCustomCurrency(ItemType <Items.Face>(), 999L)); // All code below runs only if we're not loading on a server if (!Main.dedServ) { // Add certain equip textures AddEquipTexture(null, EquipType.Legs, "ExampleRobe_Legs", "ExampleMod/Items/Armor/ExampleRobe_Legs"); AddEquipTexture(new Items.Armor.BlockyHead(), null, EquipType.Head, "BlockyHead", "ExampleMod/Items/Armor/ExampleCostume_Head"); AddEquipTexture(new Items.Armor.BlockyBody(), null, EquipType.Body, "BlockyBody", "ExampleMod/Items/Armor/ExampleCostume_Body", "ExampleMod/Items/Armor/ExampleCostume_Arms"); AddEquipTexture(new Items.Armor.BlockyLegs(), null, EquipType.Legs, "BlockyLeg", "ExampleMod/Items/Armor/ExampleCostume_Legs"); // Change the vanilla dungeon track // Main.music[MusicID.Dungeon] = GetMusic("Sounds/Music/DriveMusic"); // Register a new music box AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/DriveMusic"), ItemType("ExampleMusicBox"), TileType("ExampleMusicBox")); // Change the vailla loom texture Main.instance.LoadTiles(TileID.Loom); // First load the tile texture Main.tileTexture[TileID.Loom] = GetTexture("Tiles/AnimatedLoom"); // Now we change it //What if....Replace a vanilla item texture and equip texture. //Main.itemTexture[ItemID.CopperHelmet] = GetTexture("Resprite/CopperHelmet_Item"); //Item copperHelmet = new Item(); //copperHelmet.SetDefaults(ItemID.CopperHelmet); //Main.armorHeadLoaded[copperHelmet.headSlot] = true; //Main.armorHeadTexture[copperHelmet.headSlot] = GetTexture("Resprite/CopperHelmet_Head"); // Create new skies and screen filters Filters.Scene["ExampleMod:PuritySpirit"] = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh); SkyManager.Instance["ExampleMod:PuritySpirit"] = new PuritySpiritSky(); Filters.Scene["ExampleMod:MonolithVoid"] = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium); SkyManager.Instance["ExampleMod:MonolithVoid"] = new VoidSky(); // exampleFont = GetFont("Fonts/ExampleFont"); exampleEffect = GetEffect("Effects/ExampleEffect"); Ref <Effect> exampleEffectRef = new Ref <Effect>(); exampleEffectRef.Value = exampleEffect; GameShaders.Armor.BindShader <ArmorShaderData>(ItemType <Items.ExampleDye>(), new ArmorShaderData(exampleEffectRef, "ExampleDyePass")); // Custom UI exampleUI = new ExampleUI(); exampleUI.Activate(); exampleUserInterface = new UserInterface(); exampleUserInterface.SetState(exampleUI); } // Register custom mod translations, lives left is for Spirit of Purity ModTranslation text = CreateTranslation("LivesLeft"); text.SetDefault("{0} has {1} lives left!"); AddTranslation(text); text = CreateTranslation("LifeLeft"); text.SetDefault("{0} has 1 life left!"); AddTranslation(text); text = CreateTranslation("NPCTalk"); text.SetDefault("<{0}> {1}"); AddTranslation(text); // Volcano warning is for the random vulcano tremor text = CreateTranslation("VolcanoWarning"); text.SetDefault("Did you hear something....A Volcano! Find Cover!"); AddTranslation(text); }
public override void Load() { // Will show up in client.log under the ExampleMod name Logger.InfoFormat("{0} example logging", Name); // In older tModLoader versions we used: ErrorLogger.Log("blabla"); // Replace that with above // Registers a new hotkey RandomBuffHotKey = RegisterHotKey("Random Buff", "P"); // See https://docs.microsoft.com/en-us/previous-versions/windows/xna/bb197781(v%3dxnagamestudio.41) for special keys // Registers a new custom currency FaceCustomCurrencyId = CustomCurrencyManager.RegisterCurrency(new ExampleCustomCurrency(ModContent.ItemType <Items.Face>(), 999L)); Mundane.AddHacks(); // All code below runs only if we're not loading on a server if (!Main.dedServ) { // Add certain equip textures AddEquipTexture(null, EquipType.Legs, "ExampleRobe_Legs", "ExampleMod/Items/Armor/ExampleRobe_Legs"); AddEquipTexture(new Items.Armor.BlockyHead(), null, EquipType.Head, "BlockyHead", "ExampleMod/Items/Armor/ExampleCostume_Head"); AddEquipTexture(new Items.Armor.BlockyBody(), null, EquipType.Body, "BlockyBody", "ExampleMod/Items/Armor/ExampleCostume_Body", "ExampleMod/Items/Armor/ExampleCostume_Arms"); AddEquipTexture(new Items.Armor.BlockyLegs(), null, EquipType.Legs, "BlockyLeg", "ExampleMod/Items/Armor/ExampleCostume_Legs"); // Register a new music box AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MarbleGallery"), ItemType("ExampleMusicBox"), TileType("ExampleMusicBox")); // Change the vanilla loom texture Main.instance.LoadTiles(TileID.Loom); // First load the tile texture Main.tileTexture[TileID.Loom] = GetTexture("Tiles/AnimatedLoom"); // Now we change it //What if....Replace a vanilla item texture and equip texture. //Main.itemTexture[ItemID.CopperHelmet] = GetTexture("Resprite/CopperHelmet_Item"); //Item copperHelmet = new Item(); //copperHelmet.SetDefaults(ItemID.CopperHelmet); //Main.armorHeadLoaded[copperHelmet.headSlot] = true; //Main.armorHeadTexture[copperHelmet.headSlot] = GetTexture("Resprite/CopperHelmet_Head"); // Create new skies and screen filters Filters.Scene["ExampleMod:PuritySpirit"] = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh); SkyManager.Instance["ExampleMod:PuritySpirit"] = new PuritySpiritSky(); Filters.Scene["ExampleMod:MonolithVoid"] = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium); SkyManager.Instance["ExampleMod:MonolithVoid"] = new VoidSky(); GameShaders.Armor.BindShader(ModContent.ItemType <Items.ExampleDye>(), new ArmorShaderData(new Ref <Effect>(GetEffect("Effects/ExampleEffect")), "ExampleDyePass")); GameShaders.Hair.BindShader(ModContent.ItemType <Items.ExampleHairDye>(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Green)); GameShaders.Misc["ExampleMod:DeathAnimation"] = new MiscShaderData(new Ref <Effect>(GetEffect("Effects/ExampleEffectDeath")), "DeathAnimation").UseImage("Images/Misc/Perlin"); if (FontExists("Fonts/ExampleFont")) { exampleFont = GetFont("Fonts/ExampleFont"); } // Custom UI ExampleUI = new ExampleUI(); ExampleUI.Activate(); _exampleUserInterface = new UserInterface(); _exampleUserInterface.SetState(ExampleUI); // Custom Resource Bar ExampleResourceBar = new ExampleResourceBar(); _exampleResourceBarUserInterface = new UserInterface(); _exampleResourceBarUserInterface.SetState(ExampleResourceBar); // UserInterface can only show 1 UIState at a time. If you want different "pages" for a UI, switch between UIStates on the same UserInterface instance. // We want both the Coin counter and the Example Person UI to be independent and coexist simultaneously, so we have them each in their own UserInterface. ExamplePersonUserInterface = new UserInterface(); // We will call .SetState later in ExamplePerson.OnChatButtonClicked } // Register custom mod translations, lives left is for Spirit of Purity // See the .lang files in the Localization folder for an easier to manage approach to translations. These few examples are here just to illustrate the concept. ModTranslation text = CreateTranslation("LivesLeft"); text.SetDefault("{0} has {1} lives left!"); AddTranslation(text); text = CreateTranslation("LifeLeft"); text.SetDefault("{0} has 1 life left!"); AddTranslation(text); text = CreateTranslation("NPCTalk"); text.SetDefault("<{0}> {1}"); AddTranslation(text); text = CreateTranslation("Common.LocalizedLabelDynamic"); text.SetDefault($"[i:{ModContent.ItemType<Items.Weapons.SpectreGun>()}] This dynamic label is added in ExampleMod.Load"); AddTranslation(text); // Volcano warning is for the random volcano tremor text = CreateTranslation("VolcanoWarning"); text.SetDefault("Did you hear something....A Volcano! Find Cover!"); AddTranslation(text); }
public override void Load() { EggPlantCrystalID = CustomCurrencyManager.RegisterCurrency(new EggPlantCrystalData(ItemType <Items.EggPlantCrystal>(), 999L)); }
public static TooltipLine GetPriceTooltipLine(Item item, bool isDisplayPriceText = true) { TooltipLine result = new TooltipLine(NPCInfo.instance, "Price", string.Empty); string[] array = new string[20]; int num4 = 0; int storeValue = item.GetStoreValue(); int a = (int)Main.mouseTextColor; float num20 = (float)Main.mouseTextColor / 255f; if (item.shopSpecialCurrency != -1) { result = new TooltipLine(NPCInfo.instance, "SpecialPrice", string.Empty); CustomCurrencyManager.GetPriceText(item.shopSpecialCurrency, array, ref num4, storeValue); result.text = array[num4]; result.overrideColor = new Color((int)((byte)(255f * num20)), (int)((byte)(255f * num20)), (int)((byte)(255f * num20)), a); } else if (storeValue > 0) { string text = ""; int num21 = 0; int num22 = 0; int num23 = 0; int num24 = 0; int num25 = storeValue * item.stack; if (!item.buy) { num25 = storeValue / 5; if (num25 < 1) { num25 = 1; } num25 *= item.stack; } if (num25 < 1) { num25 = 1; } if (num25 >= 1000000) { num21 = num25 / 1000000; num25 -= num21 * 1000000; } if (num25 >= 10000) { num22 = num25 / 10000; num25 -= num22 * 10000; } if (num25 >= 100) { num23 = num25 / 100; num25 -= num23 * 100; } if (num25 >= 1) { num24 = num25; } if (num21 > 0) { object obj = text; text = string.Concat(new object[] { obj, num21, " ", Lang.inter[15].Value, " " }); } if (num22 > 0) { object obj = text; text = string.Concat(new object[] { obj, num22, " ", Lang.inter[16].Value, " " }); } if (num23 > 0) { object obj = text; text = string.Concat(new object[] { obj, num23, " ", Lang.inter[17].Value, " " }); } if (num24 > 0) { object obj = text; text = string.Concat(new object[] { obj, num24, " ", Lang.inter[18].Value, " " }); } if (!item.buy) { result.text = (isDisplayPriceText ? Lang.tip[49].Value : "") + " " + text; } else { result.text = (isDisplayPriceText ? Lang.tip[50].Value : "") + " " + text; } if (num21 > 0) { result.overrideColor = new Color((int)((byte)(220f * num20)), (int)((byte)(220f * num20)), (int)((byte)(198f * num20)), a); } else if (num22 > 0) { result.overrideColor = new Color((int)((byte)(224f * num20)), (int)((byte)(201f * num20)), (int)((byte)(92f * num20)), a); } else if (num23 > 0) { result.overrideColor = new Color((int)((byte)(181f * num20)), (int)((byte)(192f * num20)), (int)((byte)(193f * num20)), a); } else if (num24 > 0) { result.overrideColor = new Color((int)((byte)(246f * num20)), (int)((byte)(138f * num20)), (int)((byte)(96f * num20)), a); } } else if (Main.HoverItem.type != 3817) { result.text = Lang.tip[51].Value; result.overrideColor = new Color((int)((byte)(120f * num20)), (int)((byte)(120f * num20)), (int)((byte)(120f * num20)), a); } if (result.text == null) { result.text = string.Empty; } return(result); }
public override void Load() { instance = this; // Will show up in client.log under the ExampleMod name Logger.InfoFormat("{0} example logging", this.Name); // ErrorLogger.Log("blabla"); REPLACE THIS WITH ABOVE // Adds boss head textures for the Abomination boss for (int k = 1; k <= 4; k++) { AddBossHeadTexture(captiveElementHead + k); AddBossHeadTexture(captiveElement2Head + k); } // Registers a new hotkey RandomBuffHotKey = RegisterHotKey("Random Buff", "P"); // See https://docs.microsoft.com/en-us/previous-versions/windows/xna/bb197781(v%3dxnagamestudio.41) for special keys // Registers a new custom currency FaceCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(new ExampleCustomCurrency(ItemType <Items.Face>(), 999L)); // All code below runs only if we're not loading on a server if (!Main.dedServ) { // Add certain equip textures AddEquipTexture(null, EquipType.Legs, "ExampleRobe_Legs", "ExampleMod/Items/Armor/ExampleRobe_Legs"); AddEquipTexture(new Items.Armor.BlockyHead(), null, EquipType.Head, "BlockyHead", "ExampleMod/Items/Armor/ExampleCostume_Head"); AddEquipTexture(new Items.Armor.BlockyBody(), null, EquipType.Body, "BlockyBody", "ExampleMod/Items/Armor/ExampleCostume_Body", "ExampleMod/Items/Armor/ExampleCostume_Arms"); AddEquipTexture(new Items.Armor.BlockyLegs(), null, EquipType.Legs, "BlockyLeg", "ExampleMod/Items/Armor/ExampleCostume_Legs"); // Change the vanilla dungeon track // Main.music[MusicID.Dungeon] = GetMusic("Sounds/Music/DriveMusic"); // Register a new music box AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/DriveMusic"), ItemType("ExampleMusicBox"), TileType("ExampleMusicBox")); // Change the vanilla loom texture Main.instance.LoadTiles(TileID.Loom); // First load the tile texture Main.tileTexture[TileID.Loom] = GetTexture("Tiles/AnimatedLoom"); // Now we change it //What if....Replace a vanilla item texture and equip texture. //Main.itemTexture[ItemID.CopperHelmet] = GetTexture("Resprite/CopperHelmet_Item"); //Item copperHelmet = new Item(); //copperHelmet.SetDefaults(ItemID.CopperHelmet); //Main.armorHeadLoaded[copperHelmet.headSlot] = true; //Main.armorHeadTexture[copperHelmet.headSlot] = GetTexture("Resprite/CopperHelmet_Head"); // Create new skies and screen filters Filters.Scene["ExampleMod:PuritySpirit"] = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh); SkyManager.Instance["ExampleMod:PuritySpirit"] = new PuritySpiritSky(); Filters.Scene["ExampleMod:MonolithVoid"] = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium); SkyManager.Instance["ExampleMod:MonolithVoid"] = new VoidSky(); // exampleFont = GetFont("Fonts/ExampleFont"); GameShaders.Armor.BindShader(ItemType <Items.ExampleDye>(), new ArmorShaderData(new Ref <Effect>(GetEffect("Effects/ExampleEffect")), "ExampleDyePass")); GameShaders.Misc["ExampleMod:DeathAnimation"] = new MiscShaderData(new Ref <Effect>(GetEffect("Effects/ExampleEffectDeath")), "DeathAnimation").UseImage("Images/Misc/Perlin"); // Custom UI exampleUI = new ExampleUI(); exampleUI.Activate(); exampleUserInterface = new UserInterface(); exampleUserInterface.SetState(exampleUI); // UserInterface can only show 1 UIState at a time. If you want different "pages" for a UI, switch between UIStates on the same UserInterface instance. // We want both the Coin counter and the Example Person UI to be independent and coexist simultaneously, so we have them each in their own UserInterface. examplePersonUserInterface = new UserInterface(); // We will call .SetState later in ExamplePerson.OnChatButtonClicked } // Register custom mod translations, lives left is for Spirit of Purity ModTranslation text = CreateTranslation("LivesLeft"); text.SetDefault("{0} has {1} lives left!"); AddTranslation(text); text = CreateTranslation("LifeLeft"); text.SetDefault("{0} has 1 life left!"); AddTranslation(text); text = CreateTranslation("NPCTalk"); text.SetDefault("<{0}> {1}"); AddTranslation(text); // Volcano warning is for the random volcano tremor text = CreateTranslation("VolcanoWarning"); text.SetDefault("Did you hear something....A Volcano! Find Cover!"); AddTranslation(text); }
public override void Load() { ZenyID = CustomCurrencyManager.RegisterCurrency(new ZenyCurrency(ItemType("Zeny"), 999L)); }
public override void Load() { PassHotkey = RegisterHotKey("过牌快捷键", "E"); WashHotkey = RegisterHotKey("洗牌快捷键", "Q"); HookCursorHotKey = RegisterHotKey("设置钩爪指针快捷键", "C"); On.Terraria.Player.QuickGrapple += Player_QuickGrapple; On.Terraria.Player.ItemCheck += UnderworldTransportCheck; On.Terraria.Main.DrawInterface_40_InteractItemIcon += CustomHandIcon; //On.Terraria.Main.DrawTiles += Main_DrawTiles; foolTexts = Main.rand.Next(3); Unloading = false; IsCalamityLoaded = ModLoader.GetMod("CalamityMod") != null; Mod yabhb = ModLoader.GetMod("FKBossHealthBar"); if (yabhb != null) { #region Wlta yabhb yabhb.Call("RegisterCustomHealthBar", ModContent.NPCType <Embryo>(), null, //ForceSmall null, //displayName GetTexture("UI/yabhb/瓦卢提奥血条Fill"), //fillTexture GetTexture("UI/yabhb/瓦卢提奥血条头"), GetTexture("UI/yabhb/瓦卢提奥血条条"), GetTexture("UI/yabhb/瓦卢提奥血条尾"), null, //midBarOffsetX 0, //midBarOffsetY null, //fillDecoOffsetX 32, //bossHeadCentreOffsetX 30, //bossHeadCentreOffsetY null, //fillTextureSM null, //leftBarSM null, //midBarSM null, //rightBarSM null, //fillDecoOffsetXSM null, //bossHeadCentreOffsetXSM null, //bossHeadCentreOffsetYSM true); //LoopMidBar yabhb.Call("RegisterCustomHealthBar", ModContent.NPCType <Volutio>(), null, //ForceSmall null, //displayName GetTexture("UI/yabhb/瓦卢提奥血条Fill"), //fillTexture GetTexture("UI/yabhb/瓦卢提奥血条头"), GetTexture("UI/yabhb/瓦卢提奥血条条"), GetTexture("UI/yabhb/瓦卢提奥血条尾"), null, //midBarOffsetX 0, //midBarOffsetY null, //fillDecoOffsetX 32, //bossHeadCentreOffsetX 32, //bossHeadCentreOffsetY null, //fillTextureSM null, //leftBarSM null, //midBarSM null, //rightBarSM null, //fillDecoOffsetXSM null, //bossHeadCentreOffsetXSM null, //bossHeadCentreOffsetYSM true); //LoopMidBar #endregion } MimicryCustomCurrencyId = CustomCurrencyManager.RegisterCurrency(new EntrogicMimicryCurrency(ModContent.ItemType <拟态魔能>(), 999L)); if (!Main.dedServ) { ResourceLoader.LoadAllTextures(); ResourceLoader.LoadAllCardMissions(); AddEquipTexture(new PollutionElementalMask1(), null, EquipType.Head, "PollutionElementalMask1", "Entrogic/Items/PollutElement/PollutionElementalMask1_Head"); AddEquipTexture(new PollutionElementalMask2(), null, EquipType.Head, "PollutionElementalMask2", "Entrogic/Items/PollutElement/PollutionElementalMask2_Head"); AddEquipTexture(new PollutionElementalMask3(), null, EquipType.Head, "PollutionElementalMask3", "Entrogic/Items/PollutElement/PollutionElementalMask3_Head"); AddEquipTexture(new PollutionElementalMask4(), null, EquipType.Head, "PollutionElementalMask4", "Entrogic/Items/PollutElement/PollutionElementalMask4_Head"); AddEquipTexture(new PolluWings1(), null, EquipType.Wings, "PolluWings1", "Entrogic/Items/PollutElement/PolluWings1_Wings"); AddEquipTexture(new PolluWings2(), null, EquipType.Wings, "PolluWings2", "Entrogic/Items/PollutElement/PolluWings2_Wings"); AddEquipTexture(new PolluWings3(), null, EquipType.Wings, "PolluWings3", "Entrogic/Items/PollutElement/PolluWings3_Wings"); AddEquipTexture(new PolluWings4(), null, EquipType.Wings, "PolluWings4", "Entrogic/Items/PollutElement/PolluWings4_Wings"); AddEquipTexture(new PolluWings5(), null, EquipType.Wings, "PolluWings5", "Entrogic/Items/PollutElement/PolluWings5_Wings"); AddEquipTexture(new PolluWings6(), null, EquipType.Wings, "PolluWings6", "Entrogic/Items/PollutElement/PolluWings6_Wings"); AddEquipTexture(new PolluWings7(), null, EquipType.Wings, "PolluWings7", "Entrogic/Items/PollutElement/PolluWings7_Wings"); AddEquipTexture(new PolluWings8(), null, EquipType.Wings, "PolluWings8", "Entrogic/Items/PollutElement/PolluWings8_Wings"); ResourceLoader.LoadAllShaders(); BookUI = new BookUI(); BookUI.Activate(); BookUIE = new UserInterface(); BookUIE.SetState(BookUI); //BookPageUI = new BookPageUI(); //BookPageUI.Activate(); //BookPageUIE = new UserInterface(); //BookPageUIE.SetState(BookPageUI); CardUI = new CardUI(); CardUI.Activate(); CardUIE = new UserInterface(); CardUIE.SetState(CardUI); CardInventoryUI = new CardInventoryUI(); CardInventoryUI.Activate(); CardInventoryUIE = new UserInterface(); CardInventoryUIE.SetState(CardInventoryUI); CardGameUI = new CardGameUI(); CardGameUI.Activate(); CardGameUIE = new UserInterface(); CardGameUIE.SetState(CardGameUI); /*SinsBar.visible = true; * Sinsbar = new SinsBar(); * Sinsbar.Activate(); * SinsBarInterface = new UserInterface(); * SinsBarInterface.SetState(Sinsbar);*/ } Buildings.Cache("Buildings/CardShrine0.ebuilding", "Buildings/CardShrine1.ebuilding", "Buildings/UnderworldPortal.ebuilding"); new PiggyBankAmmo(); new ModHandler(); #region Armor Translates Translation.RegisterTranslation("mspeed", GameCulture.Chinese, "移动速度", " movement speed"); Translation.RegisterTranslation("and", GameCulture.Chinese, "与", " and"); Translation.RegisterTranslation("csc", GameCulture.Chinese, "暴击率", " critical strike chance"); Translation.RegisterTranslation("knockback", GameCulture.Chinese, "击退", " knockback"); Translation.RegisterTranslation("damage", GameCulture.Chinese, "伤害", " damage"); Translation.RegisterTranslation("cntca", GameCulture.Chinese, "的几率不消耗弹药", " chance not to consume ammo"); Translation.RegisterTranslation("immb", GameCulture.Chinese, "最大魔力值增加", "Increases maximum mana by "); Translation.RegisterTranslation("rmub", GameCulture.Chinese, "魔力消耗减少", "Reduces mana usage by "); #endregion #region Boss Checklist Translates ModTranslation bctext = CreateTranslation("BossSpawnInfo.GelSymb"); bctext.AddTranslation(GameCulture.Chinese, "在地下原汤湖使用 [i:" + ModContent.ItemType <GelCultureFlask>() + "] 召唤一只史莱姆, 并将其掷于地下原汤湖中召唤"); bctext.SetDefault("Use [i:" + ModContent.ItemType <GelCultureFlask>() + "] in the underground pool to summon a slime, and thorw it into the pool to summon."); AddTranslation(bctext); bctext = CreateTranslation("BossSpawnInfo.Athanasy"); bctext.AddTranslation(GameCulture.Chinese, "使用 [i:" + ModContent.ItemType <TitansOrder>() + "] 召唤(由地牢怪物掉落或在上锁的金箱中找到)"); bctext.SetDefault("Use [i:" + ModContent.ItemType <TitansOrder>() + "] to spawn, you can find it from locked chests or drop from dungeon monsters"); AddTranslation(bctext); bctext = CreateTranslation("BossSpawnInfo.PollutionElement"); bctext.AddTranslation(GameCulture.Chinese, "在海边使用 [i:" + ModContent.ItemType <ContaminatedLiquor>() + "] 召唤"); bctext.SetDefault("Use [i:" + ModContent.ItemType <ContaminatedLiquor>() + "] in ocean to spawn"); AddTranslation(bctext); #endregion #region Another Translates ModTranslation transform = CreateTranslation("RightClickToTransform"); transform.AddTranslation(GameCulture.Chinese, "右键点击物品以切换状态"); transform.SetDefault("Right click to switch status"); AddTranslation(transform); ModTranslation modTranslation = CreateTranslation("ArcaneDamage"); modTranslation.AddTranslation(GameCulture.Chinese, "奥术"); modTranslation.SetDefault("arcane "); AddTranslation(modTranslation); modTranslation = CreateTranslation("Pollution_SkyDarkened"); modTranslation.AddTranslation(GameCulture.Chinese, "天空变得更加黑暗"); modTranslation.SetDefault("The sky is becomes darkened"); AddTranslation(modTranslation); modTranslation = CreateTranslation("Pollution_Pollutional"); modTranslation.AddTranslation(GameCulture.Chinese, "污染生物正在聚集..."); modTranslation.SetDefault("Pollutional creatures are gathering..."); AddTranslation(modTranslation); modTranslation = CreateTranslation("Pollution_Summon"); modTranslation.AddTranslation(GameCulture.Chinese, "永远不要尝试去挑战自然..."); modTranslation.SetDefault("Never try to challenge the nature..."); AddTranslation(modTranslation); modTranslation = CreateTranslation("Pollution_Summon2"); modTranslation.AddTranslation(GameCulture.Chinese, "呵..."); modTranslation.SetDefault("Heh..."); AddTranslation(modTranslation); ModTranslation text = CreateTranslation("NPCTalk"); text.SetDefault("<{0}> {1}"); AddTranslation(text); text = CreateTranslation("Common.RandomCardImage"); text.SetDefault($"[i:{ModContent.ItemType<RandomCard>()}] [c/ffeb6e:卡牌系统自定义项]"); AddTranslation(text); ModTranslation modGen = CreateTranslation("GenLifeLiquid"); modGen.AddTranslation(GameCulture.Chinese, "正在生成生命湖"); modGen.SetDefault("Life."); AddTranslation(modGen); modGen = CreateTranslation("SmoothLifeLiquid"); modGen.AddTranslation(GameCulture.Chinese, "正在平整生命湖"); modGen.SetDefault("Life."); AddTranslation(modGen); modGen = CreateTranslation("GenCardShrine"); modGen.AddTranslation(GameCulture.Chinese, "正在生成卡牌神龛"); modGen.SetDefault("Card."); AddTranslation(modGen); #endregion }
public override void Load() { //Always keep this call in the first line of Load! LoadReferences(); AdventurerQuests = new AdventurerQuestHandler(this); StructureLoader.Load(this); TrailManager = new TrailManager(this); On.Terraria.Main.DrawProjectiles += Main_DrawProjectiles; On.Terraria.Projectile.NewProjectile_float_float_float_float_int_int_float_int_float_float += Projectile_NewProjectile; instance = this; if (Main.rand == null) { Main.rand = new Terraria.Utilities.UnifiedRandom(); } //Don't add any code before this point, // unless you know what you're doing. Items.Halloween.CandyBag.Initialize(); if (Main.netMode != NetmodeID.Server) { Ref <Effect> screenRef = new Ref <Effect>(GetEffect("Effects/ShockwaveEffect")); // The path to the compiled shader file. Filters.Scene["Shockwave"] = new Filter(new ScreenShaderData(screenRef, "Shockwave"), EffectPriority.VeryHigh); Filters.Scene["Shockwave"].Load(); } Filters.Scene["SpiritMod:ReachSky"] = new Filter(new ScreenShaderData("FilterBloodMoon").UseColor(0.05f, 0.05f, .05f).UseOpacity(0.7f), EffectPriority.High); Filters.Scene["SpiritMod:SpiritUG1"] = new Filter(new ScreenShaderData("FilterBloodMoon").UseColor(0.2f, 0.2f, .2f).UseOpacity(0.8f), EffectPriority.High); Filters.Scene["SpiritMod:SpiritUG2"] = new Filter(new ScreenShaderData("FilterBloodMoon").UseColor(0.45f, 0.45f, .45f).UseOpacity(0.9f), EffectPriority.High); Filters.Scene["SpiritMod:WindEffect"] = new Filter((new BlizzardShaderData("FilterBlizzardForeground")).UseColor(0.4f, 0.4f, 0.4f).UseSecondaryColor(0.2f, 0.2f, 0.2f).UseImage("Images/Misc/noise", 0, null).UseOpacity(0.249f).UseImageScale(new Vector2(3f, 0.75f), 0), EffectPriority.High); Filters.Scene["SpiritMod:WindEffect2"] = new Filter((new BlizzardShaderData("FilterBlizzardForeground")).UseColor(0.4f, 0.4f, 0.4f).UseSecondaryColor(0.2f, 0.2f, 0.2f).UseImage("Images/Misc/noise", 0, null).UseOpacity(0.549f).UseImageScale(new Vector2(3f, 0.75f), 0), EffectPriority.High); SpecialKey = RegisterHotKey("Armor Bonus", "Q"); GlyphCurrencyID = CustomCurrencyManager.RegisterCurrency(new Currency(ModContent.ItemType <Items.Glyphs.Glyph>(), 999L)); if (!Main.dedServ) { AddEquipTexture(null, EquipType.Legs, "TalonGarb_Legs", "SpiritMod/Items/Armor/TalonGarb_Legs"); EmptyTexture = GetTexture("Empty"); auroraEffect = GetEffect("Effects/aurora"); noise = GetTexture("Textures/noise"); noise = GetTexture("Textures/BlueMoonTexture"); glitchEffect = GetEffect("Effects/glitch"); glitchScreenShader = new GlitchScreenShader(glitchEffect); Filters.Scene["SpiritMod:Glitch"] = new Filter(glitchScreenShader, EffectPriority.High); SkyManager.Instance["SpiritMod:AuroraSky"] = new AuroraSky(); Filters.Scene["SpiritMod:AuroraSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); Terraria.Graphics.Effects.Overlays.Scene["SpiritMod:AuroraSky"] = new AuroraOverlay(); Filters.Scene["SpiritMod:BlueMoonSky"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0.1f, 0.2f, 0.5f).UseOpacity(0.53f), EffectPriority.High); SkyManager.Instance["SpiritMod:BlueMoonSky"] = new BlueMoonSky(); SkyManager.Instance["SpiritMod:MeteorSky"] = new MeteorSky(); SkyManager.Instance["SpiritMod:AsteroidSky2"] = new MeteorBiomeSky2(); Filters.Scene["SpiritMod:MeteorSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); Filters.Scene["SpiritMod:AsteroidSky2"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:SpiritBiomeSky"] = new SpiritBiomeSky(); Filters.Scene["SpiritMod:SpiritBiomeSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:PurpleAlgaeSky"] = new PurpleAlgaeSky(); Filters.Scene["SpiritMod:PurpleAlgaeSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:GreenAlgaeSky"] = new GreenAlgaeSky(); Filters.Scene["SpiritMod:GreenAlgaeSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:BlueAlgaeSky"] = new BlueAlgaeSky(); Filters.Scene["SpiritMod:BlueAlgaeSky"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); SkyManager.Instance["SpiritMod:AshstormParticles"] = new AshstormSky(); Filters.Scene["SpiritMod:AshstormParticles"] = new Filter((new ScreenShaderData("FilterMiniTower")).UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryLow); Terraria.Graphics.Effects.Overlays.Scene["SpiritMod:AshstormParticles"] = new AshstormOverlay(EffectPriority.VeryHigh); Filters.Scene["SpiritMod:Overseer"] = new Filter(new SeerScreenShaderData("FilterMiniTower").UseColor(0f, 0.3f, 1f).UseOpacity(0.75f), EffectPriority.VeryHigh); SkyManager.Instance["SpiritMod:Overseer"] = new SeerSky(); Filters.Scene["SpiritMod:Atlas"] = new Filter(new AtlasScreenShaderData("FilterMiniTower").UseColor(0.5f, 0.5f, 0.5f).UseOpacity(0.6f), EffectPriority.VeryHigh); SkyManager.Instance["SpiritMod:Atlas"] = new AtlasSky(); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Asteroids"), ItemType("AsteroidBox"), TileType("AsteroidBox")); AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/Starplate"), ItemType("StarplateBox"), TileType("StarplateBox")); } }