This commit is contained in:
Doze-Zoze committed 2026-06-04 23:09:50 -05:00
commit ba681ab035
42 files changed
+1356 -79

No files matched your search

+47
View File
@@ -4980,6 +4980,53 @@ namespace CalamityMod.CalPlayer
RecipeUnlockHandler.HasFoundIceSchematic = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<LuxorsGift>() && !RecipeUnlockHandler.HasFoundLuxorsGift)
{
RecipeUnlockHandler.HasFoundLuxorsGift = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<FungalSymbiote>() && !RecipeUnlockHandler.HasFoundFungalSymbiote)
{
RecipeUnlockHandler.HasFoundFungalSymbiote = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<TrinketofChi>() && !RecipeUnlockHandler.HasFoundTrinketOfChi)
{
RecipeUnlockHandler.HasFoundTrinketOfChi = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<FrozenCube>() && !RecipeUnlockHandler.HasFoundFrozenCube)
{
RecipeUnlockHandler.HasFoundFrozenCube = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<GladiatorsLocket>() && !RecipeUnlockHandler.HasFoundGladiatorsLocket)
{
RecipeUnlockHandler.HasFoundGladiatorsLocket = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<UnstableGraniteCore>() && !RecipeUnlockHandler.HasFoundUnstableGraniteCore)
{
RecipeUnlockHandler.HasFoundUnstableGraniteCore = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<CrimsonEffigy>() && !RecipeUnlockHandler.HasFoundCrimsonEffigy)
{
RecipeUnlockHandler.HasFoundCrimsonEffigy = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<CorruptionEffigy>() && !RecipeUnlockHandler.HasFoundCorruptionEffigy)
{
RecipeUnlockHandler.HasFoundCorruptionEffigy = true;
shouldSync = true;
}
}
if (shouldSync)
+31 -30
View File
@@ -33,36 +33,37 @@ namespace CalamityMod
// Calamity Boss Flag conditions
//
public static readonly Condition DownedDesertScourge = Create("Drops.DownedDS", () => DownedBossSystem.downedDesertScourge);
public static readonly Condition DownedCrabulon = Create("Drops.DownedCrabulon", () => DownedBossSystem.downedCrabulon);
public static readonly Condition DownedHiveMind = Create("Drops.DownedHM", () => DownedBossSystem.downedHiveMind);
public static readonly Condition DownedPerforator = Create("Drops.DownedPerfs", () => DownedBossSystem.downedPerforator);
public static readonly Condition DownedSlimeGod = Create("Drops.DownedSG", () => DownedBossSystem.downedSlimeGod);
public static readonly Condition DownedCryogen = Create("Drops.DownedCryo", () => DownedBossSystem.downedCryogen);
public static readonly Condition DownedAquaticScourge = Create("Drops.DownedAS", () => DownedBossSystem.downedAquaticScourge);
public static readonly Condition DownedBrimstoneElemental = Create("Drops.DownedBrim", () => DownedBossSystem.downedBrimstoneElemental);
public static readonly Condition DownedCalamitasClone = Create("Drops.DownedCal", () => DownedBossSystem.downedCalamitasClone);
public static readonly Condition DownedLeviathan = Create("Drops.DownedLevi", () => DownedBossSystem.downedLeviathan);
public static readonly Condition DownedAstrumAureus = Create("Drops.DownedAureus", () => DownedBossSystem.downedAstrumAureus);
public static readonly Condition DownedPlaguebringer = Create("Drops.DownedPBG", () => DownedBossSystem.downedPlaguebringer);
public static readonly Condition DownedRavager = Create("Drops.DownedRav", () => DownedBossSystem.downedRavager);
public static readonly Condition DownedAstrumDeus = Create("Drops.DownedAD", () => DownedBossSystem.downedAstrumDeus);
public static readonly Condition DownedGuardians = Create("Drops.DownedGuard", () => DownedBossSystem.downedGuardians);
public static readonly Condition DownedBumblebird = Create("Drops.DownedBirb", () => DownedBossSystem.downedDragonfolly);
public static readonly Condition DownedProvidence = Create("Drops.DownedProv", () => DownedBossSystem.downedProvidence);
public static readonly Condition DownedSignus = Create("Drops.DownedSig", () => DownedBossSystem.downedSignus);
public static readonly Condition DownedStormWeaver = Create("Drops.DownedSW", () => DownedBossSystem.downedStormWeaver);
public static readonly Condition DownedCeaselessVoid = Create("Drops.DownedCV", () => DownedBossSystem.downedCeaselessVoid);
public static readonly Condition DownedPolterghast = Create("Drops.DownedPolter", () => DownedBossSystem.downedPolterghast);
public static readonly Condition DownedOldDuke = Create("Drops.DownedOD", () => DownedBossSystem.downedBoomerDuke);
public static readonly Condition DownedDevourerOfGods = Create("Drops.DownedDoG", () => DownedBossSystem.downedDoG);
public static readonly Condition DownedYharon = Create("Drops.DownedYharon", () => DownedBossSystem.downedYharon);
public static readonly Condition DownedExoMechs = Create("Drops.DownedExos", () => DownedBossSystem.downedExoMechs);
public static readonly Condition DownedSupremeCalamitas = Create("Drops.DownedSCal", () => DownedBossSystem.downedCalamitas);
public static readonly Condition DownedPrimordialWyrm = Create("Drops.DownedAEW", () => DownedBossSystem.downedPrimordialWyrm);
public static readonly Condition DownedClam = Create("Drops.DownedClam", () => DownedBossSystem.downedCLAM);
public static readonly Condition DownedBuffedClam = Create("Drops.DownedClamHM", () => DownedBossSystem.downedCLAMHardMode);
public static readonly Condition DownedGreatSandShark = Create("Drops.DownedGSS", () => DownedBossSystem.downedGSS);
public static readonly Condition DownedDesertScourge = Create("Drops.DownedDS", () => DownedBossSystem.downedDesertScourge);
public static readonly Condition DownedCrabulon = Create("Drops.DownedCrabulon", () => DownedBossSystem.downedCrabulon);
public static readonly Condition DownedHiveMind = Create("Drops.DownedHM", () => DownedBossSystem.downedHiveMind);
public static readonly Condition DownedPerforator = Create("Drops.DownedPerfs", () => DownedBossSystem.downedPerforator);
public static readonly Condition DownedSlimeGod = Create("Drops.DownedSG", () => DownedBossSystem.downedSlimeGod);
public static readonly Condition DownedCryogen = Create("Drops.DownedCryo", () => DownedBossSystem.downedCryogen);
public static readonly Condition DownedAquaticScourge = Create("Drops.DownedAS", () => DownedBossSystem.downedAquaticScourge);
public static readonly Condition DownedBrimstoneElemental = Create("Drops.DownedBrim", () => DownedBossSystem.downedBrimstoneElemental);
public static readonly Condition DownedCalamitasClone = Create("Drops.DownedCal", () => DownedBossSystem.downedCalamitasClone);
public static readonly Condition DownedLeviathan = Create("Drops.DownedLevi", () => DownedBossSystem.downedLeviathan);
public static readonly Condition DownedAstrumAureus = Create("Drops.DownedAureus", () => DownedBossSystem.downedAstrumAureus);
public static readonly Condition DownedPlaguebringer = Create("Drops.DownedPBG", () => DownedBossSystem.downedPlaguebringer);
public static readonly Condition DownedRavager = Create("Drops.DownedRav", () => DownedBossSystem.downedRavager);
public static readonly Condition DownedAstrumDeus = Create("Drops.DownedAD", () => DownedBossSystem.downedAstrumDeus);
public static readonly Condition DownedGuardians = Create("Drops.DownedGuard", () => DownedBossSystem.downedGuardians);
public static readonly Condition DownedBumblebird = Create("Drops.DownedBirb", () => DownedBossSystem.downedDragonfolly);
public static readonly Condition DownedProvidence = Create("Drops.DownedProv", () => DownedBossSystem.downedProvidence);
public static readonly Condition DownedSignus = Create("Drops.DownedSig", () => DownedBossSystem.downedSignus);
public static readonly Condition DownedStormWeaver = Create("Drops.DownedSW", () => DownedBossSystem.downedStormWeaver);
public static readonly Condition DownedCeaselessVoid = Create("Drops.DownedCV", () => DownedBossSystem.downedCeaselessVoid);
public static readonly Condition DownedPolterghast = Create("Drops.DownedPolter", () => DownedBossSystem.downedPolterghast);
public static readonly Condition DownedOldDuke = Create("Drops.DownedOD", () => DownedBossSystem.downedBoomerDuke);
public static readonly Condition DownedDevourerOfGods = Create("Drops.DownedDoG", () => DownedBossSystem.downedDoG);
public static readonly Condition DownedYharon = Create("Drops.DownedYharon", () => DownedBossSystem.downedYharon);
public static readonly Condition DownedExoMechs = Create("Drops.DownedExos", () => DownedBossSystem.downedExoMechs);
public static readonly Condition DownedSupremeCalamitas = Create("Drops.DownedSCal", () => DownedBossSystem.downedCalamitas);
public static readonly Condition DownedPrimordialWyrm = Create("Drops.DownedAEW", () => DownedBossSystem.downedPrimordialWyrm);
public static readonly Condition DownedHorribleHog = Create("Drops.DownedHorribleHog", () => DownedBossSystem.downedHorribleHog);
public static readonly Condition DownedClam = Create("Drops.DownedClam", () => DownedBossSystem.downedCLAM);
public static readonly Condition DownedBuffedClam = Create("Drops.DownedClamHM", () => DownedBossSystem.downedCLAMHardMode);
public static readonly Condition DownedGreatSandShark = Create("Drops.DownedGSS", () => DownedBossSystem.downedGSS);
// Mixed
public static readonly Condition DownedHiveMindOrPerforator = Create("Drops.DownedHMOrPerfs",() => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator);
+53
View File
@@ -0,0 +1,53 @@
using System;
using CalamityMod.NPCs.DevourerofGods;
using CalamityMod.Rarities;
using CalamityMod.Utilities.Daybreak;
using CalamityMod.Utilities.Daybreak.Buffers;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.UI.Chat;
namespace CalamityMod.ChatTags
{
public sealed class SmallTextHandler : AbstractTagHandler<SmallTextHandler>
{
protected override string[] TagNames { get; } = ["scale"];
public override TextSnippet Parse(string text, Color baseColor = new(), string options = null)
{
if (float.TryParse(options, out float result))
return new SmallTextSnippet(text, baseColor,result);
return new SmallTextSnippet(text, baseColor);
}
}
public sealed class SmallTextSnippet(string text) : TextSnippet
{
public SmallTextSnippet( string text, Color color, float scale = 0.5f) : this(text)
{
textColor = color;
Scale = scale;
}
Color textColor = Color.White;
public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1)
{
color = textColor;
size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * Scale);
if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0) && Color != Color.Transparent)
{
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, text, position, color, 0, Vector2.Zero, new Vector2(scale));
}
return true;
}
public override float GetStringLength(DynamicSpriteFont font)
{
float size = font.MeasureString(text).X;
return size * Scale;
}
}
}
+49
View File
@@ -18,6 +18,16 @@ namespace CalamityMod.CustomRecipes
public static bool HasFoundHellSchematic = false;
public static bool HasFoundIceSchematic = false;
public static bool HasFoundLuxorsGift = false;
public static bool HasFoundFungalSymbiote = false;
public static bool HasFoundTrinketOfChi = false;
public static bool HasFoundFrozenCube = false;
public static bool HasFoundGladiatorsLocket = false;
public static bool HasFoundUnstableGraniteCore = false;
public static bool HasFoundCrimsonEffigy = false;
public static bool HasFoundCorruptionEffigy = false;
public static void Save(List<string> boolTagContainer)
{
boolTagContainer.AddWithCondition("HasUnlockedT1ArsenalRecipes", HasUnlockedT1ArsenalRecipes);
@@ -31,6 +41,15 @@ namespace CalamityMod.CustomRecipes
boolTagContainer.AddWithCondition("HasFoundJungleSchematic", HasFoundJungleSchematic);
boolTagContainer.AddWithCondition("HasFoundHellSchematic", HasFoundHellSchematic);
boolTagContainer.AddWithCondition("HasFoundIceSchematic", HasFoundIceSchematic);
boolTagContainer.AddWithCondition("HasFoundLuxorsGift", HasFoundLuxorsGift);
boolTagContainer.AddWithCondition("HasFoundFungalSymbiote", HasFoundFungalSymbiote);
boolTagContainer.AddWithCondition("HasFoundTrinketOfChi", HasFoundTrinketOfChi);
boolTagContainer.AddWithCondition("HasFoundFrozenCube", HasFoundFrozenCube);
boolTagContainer.AddWithCondition("HasFoundGladiatorsLocket", HasFoundGladiatorsLocket);
boolTagContainer.AddWithCondition("HasFoundUnstableGraniteCore", HasFoundUnstableGraniteCore);
boolTagContainer.AddWithCondition("HasFoundCrimsonEffigy", HasFoundCrimsonEffigy);
boolTagContainer.AddWithCondition("HasFoundCorruptionEffigy", HasFoundCorruptionEffigy);
}
public static void Load(IList<string> boolTagContainer)
@@ -46,6 +65,16 @@ namespace CalamityMod.CustomRecipes
HasFoundJungleSchematic = boolTagContainer.Contains("HasFoundJungleSchematic");
HasFoundHellSchematic = boolTagContainer.Contains("HasFoundHellSchematic");
HasFoundIceSchematic = boolTagContainer.Contains("HasFoundIceSchematic");
HasFoundLuxorsGift = boolTagContainer.Contains("HasFoundLuxorsGift");
HasFoundFungalSymbiote = boolTagContainer.Contains("HasFoundFungalSymbiote");
HasFoundTrinketOfChi = boolTagContainer.Contains("HasFoundTrinketOfChi");
HasFoundFrozenCube = boolTagContainer.Contains("HasFoundFrozenCube");
HasFoundGladiatorsLocket = boolTagContainer.Contains("HasFoundGladiatorsLocket");
HasFoundUnstableGraniteCore = boolTagContainer.Contains("HasFoundUnstableGraniteCore");
HasFoundCrimsonEffigy = boolTagContainer.Contains("HasFoundCrimsonEffigy");
HasFoundCorruptionEffigy = boolTagContainer.Contains("HasFoundCorruptionEffigy");
}
public static void SendData(BinaryWriter writer)
@@ -63,9 +92,19 @@ namespace CalamityMod.CustomRecipes
BitsByte flags2 = new BitsByte();
flags2[0] = HasFoundHellSchematic;
flags2[1] = HasFoundIceSchematic;
flags2[2] = HasFoundLuxorsGift;
flags2[3] = HasFoundFungalSymbiote;
flags2[4] = HasFoundTrinketOfChi;
flags2[5] = HasFoundGladiatorsLocket;
flags2[6] = HasFoundUnstableGraniteCore;
flags2[7] = HasFoundCrimsonEffigy;
BitsByte flags3 = new BitsByte();
flags3[0] = HasFoundCorruptionEffigy;
writer.Write(flags);
writer.Write(flags2);
writer.Write(flags3);
}
public static void ReceiveData(BinaryReader reader)
@@ -83,6 +122,16 @@ namespace CalamityMod.CustomRecipes
BitsByte flags2 = reader.ReadByte();
HasFoundHellSchematic = flags2[0];
HasFoundIceSchematic = flags2[1];
HasFoundLuxorsGift = flags2[2];
HasFoundFungalSymbiote = flags2[3];
HasFoundTrinketOfChi = flags2[4];
HasFoundGladiatorsLocket = flags2[5];
HasFoundUnstableGraniteCore = flags2[6];
HasFoundCrimsonEffigy = flags2[7];
BitsByte flags3 = reader.ReadByte();
HasFoundCorruptionEffigy = flags3[0];
}
}
}
+2 -1
View File
@@ -14,10 +14,11 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 30;
Item.height = 38;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.value = Item.buyPrice(gold: 5);
Item.rare = ItemRarityID.Blue;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().fishStocks = true;
+12
View File
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using CalamityMod.CustomRecipes;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
@@ -35,6 +36,16 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
}
public override void UpdateInventory(Player player)
{
if (Main.netMode != NetmodeID.MultiplayerClient && !RecipeUnlockHandler.HasFoundFrozenCube)
{
RecipeUnlockHandler.HasFoundFrozenCube = true;
CalamityNetcode.SyncWorld();
}
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
@@ -48,6 +59,7 @@ namespace CalamityMod.Items.Accessories
Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, projectile, damage, 0f, player.whoAmI);
}
}
public override void ModifyTooltips(List<TooltipLine> list)
{
if (Main.LocalPlayer != null)
+10
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.CustomRecipes;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -17,6 +18,15 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override void UpdateInventory(Player player)
{
if (Main.netMode != NetmodeID.MultiplayerClient && !RecipeUnlockHandler.HasFoundFungalSymbiote)
{
RecipeUnlockHandler.HasFoundFungalSymbiote = true;
CalamityNetcode.SyncWorld();
}
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
+9
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.CustomRecipes;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -16,6 +17,14 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
}
public override void UpdateInventory(Player player)
{
if (Main.netMode != NetmodeID.MultiplayerClient && !RecipeUnlockHandler.HasFoundGladiatorsLocket)
{
RecipeUnlockHandler.HasFoundGladiatorsLocket = true;
CalamityNetcode.SyncWorld();
}
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
+9
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.CustomRecipes;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
@@ -35,6 +36,14 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
}
public override void UpdateInventory(Player player)
{
if (Main.netMode != NetmodeID.MultiplayerClient && !RecipeUnlockHandler.HasFoundLuxorsGift)
{
RecipeUnlockHandler.HasFoundLuxorsGift = true;
CalamityNetcode.SyncWorld();
}
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
+10
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.CalPlayer;
using CalamityMod.CustomRecipes;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
@@ -25,6 +26,15 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override void UpdateInventory(Player player)
{
if (Main.netMode != NetmodeID.MultiplayerClient && !RecipeUnlockHandler.HasFoundTrinketOfChi)
{
RecipeUnlockHandler.HasFoundTrinketOfChi = true;
CalamityNetcode.SyncWorld();
}
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
+10
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.CustomRecipes;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -25,6 +26,15 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override void UpdateInventory(Player player)
{
if (Main.netMode != NetmodeID.MultiplayerClient && !RecipeUnlockHandler.HasFoundUnstableGraniteCore)
{
RecipeUnlockHandler.HasFoundUnstableGraniteCore = true;
CalamityNetcode.SyncWorld();
}
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Fishing
Item.height = 12;
Item.maxStack = Item.CommonMaxStack;
Item.rare = ItemRarityID.Blue;
Item.value = Item.sellPrice(copper: 1);
Item.value = Item.buyPrice(copper: 5);
Item.bait = 100;
Item.consumable = true;
}
+11 -1
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.CustomRecipes;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
@@ -21,6 +22,15 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.rare = ItemRarityID.Orange;
}
public override void UpdateInventory(Player player)
{
if (Main.netMode != NetmodeID.MultiplayerClient && !RecipeUnlockHandler.HasFoundCorruptionEffigy)
{
RecipeUnlockHandler.HasFoundCorruptionEffigy = true;
CalamityNetcode.SyncWorld();
}
}
public override void AddRecipes()
{
CreateRecipe().
+11 -1
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.CustomRecipes;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
@@ -21,6 +22,15 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.rare = ItemRarityID.Orange;
}
public override void UpdateInventory(Player player)
{
if (Main.netMode != NetmodeID.MultiplayerClient && !RecipeUnlockHandler.HasFoundCrimsonEffigy)
{
RecipeUnlockHandler.HasFoundCrimsonEffigy = true;
CalamityNetcode.SyncWorld();
}
}
public override void AddRecipes()
{
CreateRecipe().
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Furniture
{
Item.DefaultToPlaceableTile(ModContent.TileType<GluttonyBlenderTile>());
Item.rare = ItemRarityID.Orange;
Item.value = Item.buyPrice(gold: 5);
Item.value = Item.sellPrice(gold: 2);
}
}
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Placeables.Furniture
public override void SetDefaults()
{
Item.DefaultToFood(32, 30, BuffID.WellFed3, CalamityUtils.MinutesToFrames(30));
Item.value = Item.sellPrice(gold: 1);
Item.value = Item.sellPrice(gold: 2);
Item.rare = ItemRarityID.Orange;
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.width = 40;
Item.height = 50;
Item.rare = ItemRarityID.Pink;
Item.value = Item.buyPrice(gold: 5);
Item.value = Item.buyPrice(platinum: 1);
}
public override void Load()
+1 -1
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.Items.Potions.Alcohol
public override void SetDefaults()
{
Item.DefaultToFood(20, 32, ModContent.BuffType<BaconOilBuff>(), CalamityUtils.MinutesToFrames(6), true);
Item.value = Item.sellPrice(silver: 2);
Item.value = Item.buyPrice(silver: 30);
Item.rare = ItemRarityID.Blue;
}
+1 -1
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Potions.Food
public override void SetDefaults()
{
Item.DefaultToFood(70, 48, ModContent.BuffType<Malnourished>(), CalamityUtils.MinutesToFrames(10));
Item.value = Item.sellPrice(silver: 20);
Item.value = Item.buyPrice(silver: 20);
Item.rare = ItemRarityID.Blue;
}
public override void UseAnimation(Player player)
+31 -23
View File
@@ -14,8 +14,6 @@ namespace CalamityMod.Items.Potions
{
public class TheConcoction : ModItem, ILocalizedModType
{
private static int hoverTimer = 0;
private static bool wasHovering = false;
public new string LocalizationCategory => "Items.Potions";
public override void SetStaticDefaults()
@@ -32,37 +30,28 @@ namespace CalamityMod.Items.Potions
public override void SetDefaults()
{
Item.DefaultToHealingPotion(50, 56, 500);
Item.value = Item.sellPrice(silver: 60);
Item.value = Item.buyPrice(gold: 1);
Item.rare = ItemRarityID.Green;
}
public override void OnConsumeItem(Player player)
{
TheConcoctionPlayer cocPlayer = player.GetModPlayer<TheConcoctionPlayer>();
cocPlayer.swinesWrathCounter = 1200; // Creates a 10 second delay before the buff is visible (triggers at 600)
TheConcoctionPlayer concoctionPlayer = player.GetModPlayer<TheConcoctionPlayer>();
concoctionPlayer.swinesWrathCounter = 1200; // Creates a 10 second delay before the buff is visible (triggers at 600)
}
public override void UpdateInventory(Player player)
{
wasHovering = Main.HoverItem?.type == Type;
}
// Display different text for the first 10 frames of hovering over the item's tooltip.
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
bool isHovering = Main.HoverItem?.type == Type;
TheConcoctionPlayer concoctionPlayer = Main.LocalPlayer.GetModPlayer<TheConcoctionPlayer>();
if (isHovering && !wasHovering)
hoverTimer = 0;
if (isHovering)
hoverTimer++;
if (hoverTimer <= 10 && hoverTimer > 0)
if (concoctionPlayer.hoverTimer <= 10 && concoctionPlayer.hoverTimer > 0)
{
TooltipLine healLine = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "HealLife");
healLine?.Text = this.GetLocalization("EasterEggText").Value;
if (healLine != null)
{
healLine.Text = this.GetLocalization("EasterEggText").Value;
}
}
}
}
@@ -70,20 +59,39 @@ namespace CalamityMod.Items.Potions
public class TheConcoctionPlayer : ModPlayer
{
public int swinesWrathCounter = -1;
public int hoverTimer = 0;
public bool wasHovering = false;
public override void PostUpdate()
{
if (swinesWrathCounter > 0)
{
swinesWrathCounter--;
if (swinesWrathCounter <= 600 && !Player.HasBuff<SwinesWrathBuff>()) // When there is 10 seconds left
if (swinesWrathCounter <= 600 && !Player.HasBuff<SwinesWrathBuff>())
{
Player.AddBuff(ModContent.BuffType<SwinesWrathBuff>(), 600);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/SwinesWrathProc"), Player.Center);
}
}
if (Main.myPlayer == Player.whoAmI)
{
// Check if hover over the right item
bool isHovering = Main.HoverItem?.type == ModContent.ItemType<TheConcoction>();
if (isHovering && !wasHovering)
hoverTimer = 0;
if (isHovering)
hoverTimer++;
else
hoverTimer = 0;
// Save the state for the next frame
wasHovering = isHovering;
}
}
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Potions
public override void SetDefaults()
{
Item.value = Item.sellPrice(silver: 2);
Item.value = Item.buyPrice(silver: 10);
Item.rare = ItemRarityID.Blue;
Item.DefaultToFood(28, 51, 0, 0, true);
}
@@ -33,6 +33,7 @@ Drops: {
DownedExos: After defeating the Exo Mechs
DownedSCal: After defeating Calamitas
DownedAEW: After defeating the Primordial Wyrm
DownedHorribleHog: After defeating the Horrible Hog
DownedClam: After defeating the Giant Clam
DownedClamHM: After defeating the Giant Clam in Hardmode
DownedGSS: After defeating the Great Sand Shark
@@ -62,3 +63,11 @@ InSulph: In the Sulphurous Sea
InSunken: In the Sunken Sea
InRev: In Revengeance Mode
InRevOrMM: In Revengeance Mode or in Master Mode
HasFoundCorruptionEffigy: After obtaining Corruption Effigy
HasFoundCrimsonEffigy: After obtaining Crimson Effigy
HasFoundUnstableGraniteCore: After obtaining Unstable Granite Core
HasFoundGladiatorsLocket: After obtaining Gladiator's Locket
HasFoundFrozenCube: After obtaining Frozen Cube
HasFoundTrinketOfChi: After obtaining Trinket of Chi
HasFoundFungalSymbiote: After obtaining Fungal Symbiote
HasFoundLuxorsGift: After obtaining Luxor's Gift
@@ -805,6 +805,11 @@ FishStocks: {
+0.55 luck
1.5x coin drops
'''
SalesPitch:
'''
'Fishing is hard, but you know what's easy? Economy! With this little gadget made by my partner Hoggart, you can make the process just as easy!'
'Pull the line when it's up, don't when it's down! It's as simple as that!'
'''
}
FlameLickedShell: {
@@ -363,10 +363,11 @@ TheDevourerofCods: {
TrustyOldRod: {
DisplayName: Trusty Old Rod
Tooltip:
Tooltip: Allows for especially..."exotic" hauls
SalesPitch:
'''
This ol' thing has never failed to pull in a big haul
Who knows what it will reel in next!
'Me and Hoggart have worked together with the best fishermen in the world to bring you the most effective rod on the market!'
'With state-of-the-art technology, you can fish anything! Don't let a single creature elude your hook anymore!'
'''
}
@@ -393,8 +394,13 @@ RageBait: {
DisplayName: Rage Bait
Tooltip:
'''
The absolute best bait on the market! And for so cheap too...
Even comes with free Sonar Potion effect!
Detects hooked fish
Profoundly unreliable
'''
SalesPitch:
'''
'Do you want to know a secret? Fishing takes so long because the fish are dumb! They'll always swim right by your hook!'
'But with this bait right here? No longer! It'll make your hook the only thing they can think of. You'll be swimming in fishes in the blink of an eye!'
'''
}
@@ -786,6 +786,11 @@ GluttonyBlender: {
A strange industrial contraption which appears to process food
Has the potential to turn food into something more nutritious... maybe
'''
SalesPitch:
'''
'A state of the art machine, created by my partner Hoggart! You can put anything in it, and it'll make a nutritious delicacy for you to snack on!'
'I myself can attest for its quality, I use it to make my breakfast, lunch and dinner!'
'''
}
LanternCenter: {
@@ -968,6 +973,11 @@ TheMonument: {
A monument celebrating the accomplishments of capitalism
Funded by the taxes of nearby Town NPCs, though they may not be too happy about that
'''
SalesPitch:
'''
'Don't you think your town is a bit too boring? Don't you wish you could get more money out of your troubles? Well, I've got you the perfect two-in-one deal!'
'This statue I made myself is so marvelous that it'll singlehandedly raise the price of housing around here! Just sit back, and enjoy the sight and the money!'
'''
}
ThermalTorch: {
@@ -4679,6 +4689,11 @@ MossyStone: {
GreedPot: {
DisplayName: Urn of Avarice
Tooltip: Offer your treasures to the Urn, and your avarice may at last be satiated
SalesPitch:
'''
'Say, you use all kinds of ores for your stuff, but finding precious minerals isn't easy, is it? Well, I got the solution for you!'
'Just throw any ore you got in this urn and they'll turn into even rarer ones! No more looking for tungsten for hours on end!'
'''
}
HorribleHogBanner.DisplayName: Horrible Hog Banner
@@ -161,6 +161,11 @@ TheConcoction: {
DisplayName: The Concoction
EasterEggText: Removes 500 life
Tooltip: ""
SalesPitch:
'''
'Aren't you tired of how unreliable your healing potions are? What if you're in the middle of a zombie horde and sick to the core of those things?!'
'With my concoction, you won't have to worry about that! Just a sip of this bad boy and you'll be good as new, ready to take on the world!'
'''
}
ZenPotion: {
@@ -187,6 +192,11 @@ BaconOil: {
Counts as 3 alcohols for {$Buffs.AlcoholPoisoning.DisplayName}
When combined with drinking Bacon Oil straight, mobility becomes zanier
'''
SalesPitch:
'''
'Monks go on and on about forgoing attachment. I don't think this is what they meant. It's better!'
'Don't mind the accident disclaimer: get yourself some of this slippery fat oil, and not a bit of this world will be able to hold you down!'
'''
}
BloodyMary: {
@@ -494,6 +504,11 @@ TheElixir: {
Functions as a Potion of Return
Occasionally sends you... [c/AA23C4:somewhere else]
'''
SalesPitch:
'''
'Return potions are nifty and all, but they taste like bogus! But with my special formula, it'll magically taste like your favorite food!'
'Besides, you ain't finding them for much cheaper around these parts. Trust me, you're practically stealing me!'
'''
}
Vodka: {
@@ -566,7 +581,7 @@ DivineMeat: {
Tooltip:
'''
{$CommonItemTooltip.MinorStats}
Not consumabale
{$Common.NotConsumable}
'A blessed strip of pork that never seems to be entirely consumed...'
'''
}
@@ -624,4 +639,9 @@ TheSandwich: {
Alcohol effects will not expire while under the effects of The Sandwich
'Might actually taste good if it was the only thing you'd ever eaten...'
'''
SalesPitch:
'''
'...You want to buy my lunch?'
'Well, no matter! But it won't be cheap! This sandwich is made with the best the market can offer, so ready your wallet!'
'''
}
@@ -23,6 +23,11 @@ AggressiveVoucher: {
Selectable Reforges: {1}
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
'''
SalesPitch:
'''
'That goblin over there, he's just scamming you for your money, you know? But don't worry, me and Hoggart have a solution for that!'
'Just give him this and watch as he hammers your gear like he was struck with divine inspiration! It'll be like a new item!”
'''
}
AntiCystOintment: {
@@ -160,6 +165,11 @@ CombatVoucher: {
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
This effect only applies when reforging weapons
'''
SalesPitch:
'''
'That goblin over there, he's just scamming you for your money, you know? But don't worry, me and Hoggart have a solution for that!'
'Just give him this and watch as he hammers your gear like he was struck with divine inspiration! It'll be like a new item!”
'''
}
Cosmolight: {
@@ -236,6 +246,11 @@ HurriedVoucher: {
Selectable Reforges: {1}
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
'''
SalesPitch:
'''
'That goblin over there, he's just scamming you for your money, you know? But don't worry, me and Hoggart have a solution for that!'
'Just give him this and watch as he hammers your gear like he was struck with divine inspiration! It'll be like a new item!”
'''
}
InfernaCutter: {
@@ -311,6 +326,11 @@ OddVoucher: {
Selectable Reforges: {1}
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
'''
SalesPitch:
'''
'That goblin over there, he's just scamming you for your money, you know? But don't worry, me and Hoggart have a solution for that!'
'Just give him this and watch as he hammers your gear like he was struck with divine inspiration! It'll be like a new item!”
'''
}
ReefclawHamaxe: {
@@ -409,10 +429,14 @@ TheGift: {
DisplayName: The Gift
Tooltip:
'''
Drop this fine gift on one of your Town NPCs as a token of appreciation
Drop this gift on one of your Town NPCs as a token of appreciation
May make them either love you or hate you, you'll never know until they open it!
Effect will last for 24 hours
[c/F54278:'There's no return policy, better be responsible']
'''
SalesPitch:
'''
'Buying gifts for people is hard, and you gotta make sure your people are happy, so how about we kill two birds with one stone?'
'Hand this nifty box to someone and it'll suddenly contain the perfect gift for the person you handed it to!'
'''
}
@@ -436,6 +460,11 @@ UnbreakableVoucher: {
Selectable Reforges: {1}
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
'''
SalesPitch:
'''
'That goblin over there, he's just scamming you for your money, you know? But don't worry, me and Hoggart have a solution for that!'
'Just give him this and watch as he hammers your gear like he was struck with divine inspiration! It'll be like a new item!”
'''
}
VoodooDemonVoodooDoll: {
@@ -856,8 +856,11 @@ OmniGun: {
The second shot is a burst of 10 standard bullets
The third shot is a devastating point blank spread
The fourth shot is a dangerous but powerful grenade which destroys everything, including you
'What kind of gun is it?'
'Yes'
'''
SalesPitch:
'''
'Why carry four different guns when you can carry just one? That's what I used to ask myself!'
'With this thing-a-beauty, even a bumbling moron can become invincible - and for the right price, it can be yours!'
'''
}
@@ -286,6 +286,12 @@ SupremeCataclysm.DisplayName: Cataclysm
SupremeCatastrophe.DisplayName: Catastrophe
Yharon.DisplayName: Yharon, Dragon of Rebirth
YharonPhase2: Yharon, Resplendent Phoenix
DraconicSwarmer.DisplayName: Draconic Swarmer
Dragonfolly.DisplayName: Dragonfolly
Shoreskipper.DisplayName: Shoreskipper
BrainIllusion.DisplayName: Brain Illusion
FalseBrain.DisplayName: False Brain
BloodBomb.DisplayName: Blood Bomb
AndroombaFriendly.DisplayName: Androomba Pal
// Town NPCs, Pets, etc
@@ -546,6 +552,34 @@ SeaKing: {
}
}
ShadySalesman: {
DisplayName: Shady Salesman
Census.SpawnCondition: Defeat a Horrible Hog
Chat: {
Normal1: Have you ever wondered why coins are shiny? Simple! It's to match my partner's dazzling products!
Normal2: Have you ever had a dream? If you have the cash, I can sell you several!
Normal3: Whatever you are thinking, I have the perfect thing for you, at a genuinely excessive discount!
Normal4: Is your life rapidly shrinking? Want to know this world's marvels before your time comes? Are the local merchants only showing you worthless hogwash?! Worry not, Hoggart and I have just the solution! Hogwash sold separately.
Normal5: There's a saying that goes "the grass is greener on the other side." It's absolute balderdash!! For 5 platinum coins, you can buy our Greener Paint and make your life the greenest!
Normal6: They say keeping an Angel Statue nearby is more dangerous than a loaded gun. That's why I own multiple guns - in case some hooligan tries to sell me an Angel Statue!
TownPigPresent1: You're searching for the lil' Piggy? Don't worry, chum! Hoggart and I gave it a Camo-Projector 2000 so it could disappear into the night. This way, not a single rotbrain will lay their nasty half-fingers on it, huehe!
TownPigPresent2: Rumors are runnin' around that I'm inexplicably two Pigg'ins stacked on top of each other. What shameless slander! Don't they know that, if that were true, I'd charge twice the price? Hahaha!
TownPigPresent3: You better take real good care of that piglet. Your sight gotta be good for something other than eyeballing my discounts! Otherwise, who knows what will happen to the swine stock market...
TownPigPresent4: Where the Piggy went? Could've sworn I saw it chasing down a four-legged carrot. Now's your chance to chase Fortune and Glory, pal, by buying these MARVELOUS wares!
Rain: People always say "rain, rain, go away! Come back another day!", but everyone knows it would be better if it came back never! To solve this, I intend to invest in Hoggart's Dome Program, we just need 500 platinum coins to get it off the ground!
WindyDay: Aren't you tired of your house being blown away by any shoddy gust of wind? Well, I have the solution to your problem! With my state-of-the-art industrial super glue (for only 5 gold coins a pack), you too may survive the attack of invaders with outstanding lung capacity!
Desert: Exhausted from this oven-like heat? Yearning for something to help you cool down? Check out our revolutionary new product: water! It comes in all flavors of flavorless! Any bottle shape is available, from round to triangular! Feel the chill of molten ice as it enters your guts! It even has healing properties! Sip our free sample for the low price of 50 gold!
Tundra: Did you ever hear the tragedy of Kevin Bacon the Wise? I thought not, It's not a story the Elumphants would tell you. Kevin Bacon was a Ham Lord of the Hogs, so powerful and so wise he could use his Hogtusk to influence metal to create gold... Unfortunately, he taught his apprentice everything he knew, then his apprentice out-cashed and deposed him. Ironic. He could save others from debt, but not himself.
Graveyard: Does that zombie look like a happy customer? No!! It's full of maggots!! It has no life savings!! While you still do, hurry up and spend yours on a funky edition, happiness-smelling Maggot Repellent!
BloodMoon1: These shambling deadheads are the worst! How am I supposed to rip people off when they're all either dead, broke or fighting for their lives?!
BloodMoon2: Like my partner always says, price makes the prize! Hire our Moon Doom Cannon, and enjoy a whole year without the meatsack invasion! Fund the construction of the Eclipse variant and get a deluxe model with a neat robotic decal! All for 5000 platinum coins!
BloodMoon3: Violence is at every corner tonight, huh? Remember these words, buddy: make deals, not war!
Hardmode: Those pesky merchants still want to sell you full-price, low quality copper tools?! Bird droppings!! Barter with me, and you'll receive Palladium at HOG-WILD prizes!
MoonLordDefeated: I've been told this land is ruled by three gnomes in a suit of armor. That's impossible! Gnomes are the most deplorable customers I've dealt with. They can't handle a spoon without snapping it in half!! It's always the halflings...
}
}
TownPiggy: {
DisplayName: Town Piggy
Census.SpawnCondition: Use The Housing Contract
@@ -41,6 +41,7 @@ CursorProj.DisplayName: Aestheticus Crystal
CursorProjSplit.DisplayName: Aestheticus Crystal
CyanLabSeeker.DisplayName: Seeking Mechanism
DarkIce.DisplayName: Dark Ice
DebuffSpreadEffect.DisplayName: Debuff Spread Effect
DeepseaBlaze.DisplayName: Deepsea Blaze
DevourerofCodsBobber.DisplayName: Devourer of Cods Bobber
DiamondOfTheDeepProjectile.DisplayName: Abyss Spirit
@@ -135,6 +136,7 @@ SerpentsBiteHook.DisplayName: Serpent's Bite
ShadeNimbus.DisplayName: Shade Nimbus
ShadeNimbusRain.DisplayName: Shade Rain
ShadeNimbusSpawner.DisplayName: Dank Creeper
ShadySalesmanGunshot.DisplayName: Elephant-Killing Round
SkyFlareFriendly.DisplayName: Flare
SlimeStream.DisplayName: Slime Stream
SlurperBobber.DisplayName: Slurper Bobber
@@ -145,6 +147,7 @@ StarStruckWaterBottle.DisplayName: Bottle
StepStoolBonusFX.DisplayName: Step Stool Bonus
StickyFeatherAero.DisplayName: Feather
StomperSlam.DisplayName: Stomper Slam
StratusBlackHole.DisplayName: Stratus Singularity
SuicideBomberDemon.DisplayName: Demon
SulphuricAcidBubbleFriendly.DisplayName: Acid Bubble
SulphurousSandBallGun.DisplayName: Sulphurous Sand Ball
@@ -174,5 +177,3 @@ WulfrumLureSignal.DisplayName: Signal
YellowLabSeeker.DisplayName: Seeking Mechanism
XykDeathAnim.DisplayName: Xyk Death Animation
XykWings.DisplayName: Xyk Wings
StratusBlackHole.DisplayName: Stratus Singularity
DebuffSpreadEffect.DisplayName: Debuff Spread Effect
+6
View File
@@ -49,6 +49,12 @@ namespace CalamityMod
case "desert scourge":
return DownedBossSystem.downedDesertScourge;
case "horriblehog":
case "horrible hog":
case "thehorriblehog":
case "the horrible hog":
return DownedBossSystem.downedHorribleHog;
case "clam":
case "giantclam":
case "giant clam":
+1
View File
@@ -70,6 +70,7 @@ namespace CalamityMod
internal class Downed
{
public static readonly Func<bool> DownedDesertScourge = () => DownedBossSystem.downedDesertScourge;
public static readonly Func<bool> DownedHorribleHog = () => DownedBossSystem.downedHorribleHog;
public static readonly Func<bool> DownedGiantClam = () => DownedBossSystem.downedCLAM;
public static readonly Func<bool> DownedCrabulon = () => DownedBossSystem.downedCrabulon;
public static readonly Func<bool> DownedHiveMind = () => DownedBossSystem.downedHiveMind;
+29 -3
View File
@@ -113,6 +113,7 @@ namespace CalamityMod.NPCs
"Johnny Test", // <@!589966747977777197> (konorango)
"Bling Bling Boy", // <@!522970788203069442> (phallguy)
"RICE", // <@!400107830889152524> (rice_xd.)
"Quest Boy", // <@!770103186093637663> (justanothersoldiermain)
];
private static readonly string[] ArmsDealerNames =
[
@@ -132,13 +133,14 @@ namespace CalamityMod.NPCs
"Storm Havik", // <@!1013452363178197072> (fishnotduck)
"Magorfis Splunt the Greater Finklejim", // <@!147490809334333440> (eidolbyssus)
"Perrin", // <@!253764551139393537> (easyperrin)
"Dorkyy", // <@!427765391662514185> (dorkblaze01)
"Spud McGee", // <@!727111000658018326> (starchman)
];
private static readonly string[] CyborgNames =
[
"Sylux", // <@!331812782183809025> (gonkachino)
"Nemesis", // <@!1104036024063107082> (yashimayamanata)
"Univerze", // <@!1256376346536448150> (unizumi02)
"Hunk", // <@!447597886260248578> (bagel_san)
];
private static readonly string[] DemolitionistNames =
[
@@ -172,6 +174,8 @@ namespace CalamityMod.NPCs
"Bars Boldia", // <@!332989575708540939> (careless_imp)
"Basel Raiden John Clive Fantasy 16", // <@!529392083136413696> (raiden_ii)
"Gobby, Destroyer of Wallets", // <@!429024941296582658> (bwlstorm)
"Potential Man", // <@!320787277007552512> (veruze)
"Donny G", // <@!308736236523225088> (donnyg66)
];
private static readonly string[] GolferNames = null;
private static readonly string[] GuideNames =
@@ -195,6 +199,7 @@ namespace CalamityMod.NPCs
"Wamy", // Fab added this name with no Discord ID. May be a donor who has no Discord account.
"Baggute", // <@!535140564174110720> (thebaggutegamer)
"Jacob Bryson", // <@!879794107218817026> (.melongun)
"ImaShoe", // <@!926957605056819261> (imashoe.)
];
private static readonly string[] MechanicNames =
[
@@ -217,6 +222,8 @@ namespace CalamityMod.NPCs
"Fanny", // <@!799749125720637460> (zombiewolf511)
"Mausi", // <@!194156349347594241> (sadouken)
"Fiona", // <@!475216964168450048> (thatgayguy69)
"Tikoh", // <@!618149904224616458> (r.fractal)
"Vivienne", // <@!1043188879185952848> (thanat.oshi)
];
private static readonly string[] PainterNames =
[
@@ -228,6 +235,7 @@ namespace CalamityMod.NPCs
"Arin", // <@!268169458302976012> (kiyotu)
"Typhäne", // <@!222064016107896832> (typhane.)
"Charlotte Linlin", // <@!563406464522125323> (vixcalibur)
"Shmizzle Dizzle", // <@!1070551501283528724> (shmizzledizzle)
];
private static readonly string[] PirateNames =
[
@@ -264,6 +272,9 @@ namespace CalamityMod.NPCs
"Papyrus Undertale", // <@!262663471189983242> (nycro)
"Mr. Bones", // <@!359215912856977408> (jaybones.)
"Freakbob", // <@!377863128140087296> (jevilamv)
"Bone Cold Steve Austin", // <@!282704860992897024> (raendrag_of_rovan)
"Them Bones", // <@!322208584534589450> (dogvtf)
"Deep-Vein Thrombonesis", // <@!557473830457704458> (thessyll)
];
private static readonly string[] SteampunkerNames =
[
@@ -275,6 +286,7 @@ namespace CalamityMod.NPCs
"Kreutz", // <@!553445849149997056> (red_r_kreutz)
"Cathlyn", // <@!156672312425316352> (xaqult)
"Eunice", // <@!358376627400605699> (srmg267)
"Zera", // <@!543914166969172106> (zer0_0_0_0)
];
private static readonly string[] StylistNames =
[
@@ -282,9 +294,9 @@ namespace CalamityMod.NPCs
"Faith", // <@!509050283871961123> (toasty1007)
"Xsiana", // <@!625780237489143839> (lokistic)
"Lain", // <@!655201622863118337> (literallyadeerfr)
"Hamis", // <@!608455754093035521> (haefer)
"Brio Scarlet", // <@!358576903701004289> (brio_scarlet)
"Vanessa", // <@!638901548591611945> (mediocreking)
"Melanie", // <@!356115964800139267> (schwarzerhumor)
];
private static readonly string[] TavernkeepNames =
[
@@ -298,6 +310,7 @@ namespace CalamityMod.NPCs
"Emmett",
"Bagman", // <@!701831892990820383> (supportcrispy)
"Old Man Scrooge", // <@!1392141158255427655> (vortexgaming18)
"Jerry Atric", // <@!181545975901454337> (halleyvetica)
];
private static readonly string[] TravelingMerchantNames =
[
@@ -307,6 +320,8 @@ namespace CalamityMod.NPCs
"Postman Hiss", // <@!454638106122125312> (karinthefairy)
"Cosmoec", // <@!793660591449309204> (cosmoecark)
"Junorism", // <@!740625002596008036> (hewhoshallnotbebaned)
"Koral", // <@!1354908256681590845> (koral12244_)
"Phantom", // <@!1360706992506667241> (phantomz980)
];
private static readonly string[] TruffleNames =
[
@@ -323,6 +338,7 @@ namespace CalamityMod.NPCs
"Amnesia Wapers", // <@!326821498323075073> (retardedadvicefromaretard)
"Tequila", // <@!889175547744239677> (thecrispistofnuggets)
"Bee Movie Script", // <@!407949998173454341> (literally_jesuschrist)
"Which Doctor", // <@!746103484017016832> (sepulchre0001)
];
private static readonly string[] WizardNames =
[
@@ -337,6 +353,7 @@ namespace CalamityMod.NPCs
"Mike Cyclops", // <@!702327497475227741> (seichoseicho)
"Derin", // <@!466703979695308820> (god_15)
"Umbara", // <@!450062421294579712> (umbaraeclipse)
"Reyloth Grey", // <@!255043013116428298> (pantyslack)
];
private static readonly string[] ZoologistNames =
[
@@ -347,11 +364,16 @@ namespace CalamityMod.NPCs
"Gwenhwyvar", // <@!291342874497515531> (diamondnife)
"Daxie", // <@!465438861103988737> (daxie626)
"Zora", // <@!752687500656640030> (oxytoxy365)
"Summer", // <@!608455754093035521> (haefer)
"Foxy", // <@!602954046332207164> (squid_san)
];
// Town Slimes
private static readonly string[] ClumsySlimeNames = null;
private static readonly string[] CoolSlimeNames = null;
private static readonly string[] DivaSlimeNames = null;
private static readonly string[] DivaSlimeNames =
[
"Rise Kujikawa", // <@!630100236689342475> (roald27)
];
private static readonly string[] ElderSlimeNames = null;
private static readonly string[] MysticSlimeNames = null;
private static readonly string[] NerdySlimeNames =
@@ -377,6 +399,7 @@ namespace CalamityMod.NPCs
"Ozymandias", // <@!146333264871686145> (ozzatron)
"Miss Throws a Lot", // <@!799345607847182400> (oakhamsam)
"Brikwilla", // <@!543803736909414438> (lavendercobra)
"Melody", // <@!1030635650963214446> (weisslerren)
];
private static readonly string[] TownDogLabradorNames =
[
@@ -387,6 +410,7 @@ namespace CalamityMod.NPCs
private static readonly string[] TownDogPitBullNames =
[
"Splinter", // <@!320320801213775873> (kaimonick)
"Mack", // <@!427765391662514185> (dorkblaze01)
];
private static readonly string[] TownDogBeagleNames =
[
@@ -401,6 +425,7 @@ namespace CalamityMod.NPCs
[
"Yoshi", // <@!541127291426832384> (gregthespinarak)
"Franklin", // <@!338315261352476682> (tyeski)
"Rocco", // <@!682411821067796480> (little_one777)
];
private const int TownCatSiameseVanillaNames = 12;
@@ -417,6 +442,7 @@ namespace CalamityMod.NPCs
"Lucerne", // <@!271954788676141066> (lord_lucerne)
"Milo", // <@!401849201597874179> (maskedmilo)
"Octo", // <@!796112889353994281> (octolinggrimm)
"Kreska", // <@!130037366852157440> (nuclearnecro)
];
private static readonly string[] TownCatSiameseNames =
[
@@ -10,6 +10,7 @@ using CalamityMod.Items.Accessories;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Items.Tools;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Enemy;
using CalamityMod.Utilities.Daybreak;
@@ -821,6 +822,15 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog
}
}
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
// Mark Horrible Hog as dead
DownedBossSystem.downedHorribleHog = true;
CalamityNetcode.SyncWorld();
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
//Always drops Disgusting Meat, 50% chance to drop Money Trough, 25%/33% chance to drop Laudanum
+1
View File
@@ -121,6 +121,7 @@ namespace CalamityMod.NPCs.TownNPCs
"Ariallis", // <@!518231218806980609> (ariallis)
"Shade", // <@!613133259563466755> (shade__storm)
"Orion", // <@!119164557657636865> (canacx)
"Yuhru", // <@!194276252452913154> (yuhru_)
// Original names
this.GetLocalizedValue("Name.Laura"),
+742
View File
@@ -0,0 +1,742 @@
using System;
using System.Collections.Generic;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Systems.Collections;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.ChatTags;
using CalamityMod.CustomRecipes;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Fishing.FishingRods;
using CalamityMod.Items.Placeables;
using CalamityMod.Items.Potions.Food;
using CalamityMod.Items.SummonItems.TownPets;
using CalamityMod.Items.Tools;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Typeless;
using Terraria.Audio;
using Terraria.Chat;
using Terraria.GameContent.Bestiary;
using Terraria.UI.Chat;
using Terraria.Utilities;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.NPCs.TownNPCs
{
[AutoloadHead]
public class ShadySalesman : ModNPC
{
public bool hasFiredShotThisAttack = false;
public int attackFrameTimer = 0;
public override void SetStaticDefaults()
{
Main.npcFrameCount[Type] = 10;
NPCID.Sets.AttackFrameCount[Type] = 1;
NPCID.Sets.DangerDetectRange[Type] = 700;
NPCID.Sets.AttackType[Type] = 1;
NPCID.Sets.AttackTime[Type] = 30;
NPCID.Sets.AttackAverageChance[Type] = 10;
NPCID.Sets.HatOffsetY[Type] = 18;
NPCID.Sets.ShimmerTownTransform[Type] = false;
NPCID.Sets.NoTownNPCHappiness[Type] = true;
NPCID.Sets.IsTownChild[Type] = true;
NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers()
{
Velocity = 1f // Draws the NPC in the bestiary as if its walking +1 tiles in the x direction
};
NPCID.Sets.NPCBestiaryDrawOffset.Add(NPC.type, drawModifiers);
}
public override void SetDefaults()
{
NPC.townNPC = true;
NPC.friendly = true;
NPC.lavaImmune = false;
NPC.width = 48;
NPC.height = 64;
NPC.aiStyle = NPCAIStyleID.Passive;
NPC.damage = 10;
NPC.defense = 15;
NPC.lifeMax = 250;
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
NPC.knockBackResist = 0.99f;
NPC.Calamity().VulnerableToCold = true;
NPC.Calamity().VulnerableToHeat = true;
NPC.Calamity().VulnerableToSickness = true;
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
{
bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[]
{
BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert,
new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.ShadySalesman")
});
}
public override List<string> SetNPCNameList() => ModContent.GetInstance<TownPiggy>().SetNPCNameList();
public override void PartyHatPosition(ref Vector2 position, ref SpriteEffects spriteEffects) => position.X -= 4f * NPC.direction;
public override void SendExtraAI(System.IO.BinaryWriter writer)
{
writer.Write(hasFiredShotThisAttack);
writer.Write(attackFrameTimer);
}
public override void ReceiveExtraAI(System.IO.BinaryReader reader)
{
hasFiredShotThisAttack = reader.ReadBoolean();
attackFrameTimer = reader.ReadInt32();
}
public override bool PreAI()
{
if (Main.dayTime && !IsNpcOnscreen(NPC.Center))
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
if (Main.netMode == NetmodeID.SinglePlayer)
Main.NewText(Language.GetTextValue("LegacyMisc.35", NPC.FullName), 50, 125, 255);
else
ChatHelper.BroadcastChatMessage(NetworkText.FromKey("LegacyMisc.35", NPC.GetFullNetName()), new Color(50, 125, 255));
if (CalamityWorld.unlockedTownPig)
{
string name = NPC.GivenName;
NPC.Transform(ModContent.NPCType<TownPiggy>());
NPC.GivenName = name;
}
else
{
NPC.active = false;
NPC.netSkip = -1;
}
return false;
}
}
return true;
}
public override void AI()
{
NPC.homeless = true;
if (NPC.ai[0] == 12f) // Attacking
{
attackFrameTimer++;
if (attackFrameTimer >= 3 && !hasFiredShotThisAttack)
{
if (Main.netMode != NetmodeID.Server)
{
Texture2D gunTex = TextureAssets.Item[ModContent.ItemType<ElephantKiller>()].Value;
int holdoutOffset = -21;
Vector2 gunDrawPos = NPC.Center + new Vector2(0f, 8f);
float rotation = NPC.ai[2] * ((float)Math.PI / 2f) * NPC.spriteDirection;
Vector2 origin = NPC.spriteDirection == -1 ? new Vector2(gunTex.Width + holdoutOffset, gunTex.Height / 2f) : new Vector2(-holdoutOffset, gunTex.Height / 2f);
Vector2 muzzleLocal = NPC.spriteDirection == -1 ? new Vector2(0f, 6f) : new Vector2(gunTex.Width, 6f);
Vector2 muzzlePos = gunDrawPos + (muzzleLocal - origin).RotatedBy(rotation);
Vector2 barrelDirection = new Vector2(NPC.spriteDirection, 0f).RotatedBy(rotation);
Particle bloom = new CustomSpark(muzzlePos, Vector2.Zero, "CalamityMod/Particles/BrightFlash", false, 5, 0.18f, Color.Khaki, Vector2.One, true, true, glowOpacity: 0.45f, colorFadeSpeed: 8);
GeneralParticleHandler.SpawnParticle(bloom, true);
for (int i = 0; i < 8; i++)
{
Vector2 vel = barrelDirection.RotatedByRandom(0.18f) * Main.rand.NextFloat(3f, 7f);
Particle spark = new CustomSpark(muzzlePos, vel, "CalamityMod/Particles/FadeLine", false, Main.rand.Next(10, 18), 0.18f, new Color(255, 230, 140), new Vector2(0.5f, 1f), true, shrinkSpeed: 0.4f, colorFadeSpeed: 10);
GeneralParticleHandler.SpawnParticle(spark, true);
}
SoundEngine.PlaySound(ElephantKiller.Shot with { Volume = 0.9f, PitchVariance = 0.15f, MaxInstances = 3 }, NPC.Center);
}
hasFiredShotThisAttack = true;
NPC.netUpdate = true;
}
}
else
{
if (hasFiredShotThisAttack)
{
hasFiredShotThisAttack = false;
NPC.netUpdate = true; // Syncs state exit
}
attackFrameTimer = 0;
}
}
private static bool IsNpcOnscreen(Vector2 center)
{
int w = NPC.sWidth + NPC.safeRangeX * 2;
int h = NPC.sHeight + NPC.safeRangeY * 2;
Rectangle npcScreenRect = new Rectangle((int)center.X - w / 2, (int)center.Y - h / 2, w, h);
foreach (Player player in Main.ActivePlayers)
if (player.getRect().Intersects(npcScreenRect))
return true;
return false;
}
public override string GetChat()
{
int piggyIndex = NPC.FindFirstNPC(ModContent.NPCType<TownPiggy>());
WeightedRandom<string> dialogue = new WeightedRandom<string>();
dialogue.Add(this.GetLocalizedValue("Chat.Normal1"));
dialogue.Add(this.GetLocalizedValue("Chat.Normal2"));
dialogue.Add(this.GetLocalizedValue("Chat.Normal3"));
dialogue.Add(this.GetLocalizedValue("Chat.Normal4"));
dialogue.Add(this.GetLocalizedValue("Chat.Normal5"));
dialogue.Add(this.GetLocalizedValue("Chat.Normal6"));
if (piggyIndex != -1)
{
dialogue.Add(this.GetLocalizedValue("Chat.TownPigPresent1"));
dialogue.Add(this.GetLocalizedValue("Chat.TownPigPresent2"));
dialogue.Add(this.GetLocalizedValue("Chat.TownPigPresent3"));
dialogue.Add(this.GetLocalizedValue("Chat.TownPigPresent4"));
}
if (Main.raining)
{
dialogue.Add(this.GetLocalizedValue("Chat.Rain"));
}
if (Main._shouldUseWindyDayMusic)
{
dialogue.Add(this.GetLocalizedValue("Chat.WindyDay"));
}
if (Main.LocalPlayer.ZoneDesert)
{
dialogue.Add(this.GetLocalizedValue("Chat.Desert"));
}
if (Main.LocalPlayer.ZoneSnow)
{
dialogue.Add(this.GetLocalizedValue("Chat.Tundra"));
}
if (Main.LocalPlayer.ZoneGraveyard)
{
dialogue.Add(this.GetLocalizedValue("Chat.Graveyard"));
}
if (Main.bloodMoon)
{
dialogue.Add(this.GetLocalizedValue("Chat.BloodMoon1"));
dialogue.Add(this.GetLocalizedValue("Chat.BloodMoon2"));
dialogue.Add(this.GetLocalizedValue("Chat.BloodMoon3"));
}
if (Main.hardMode)
{
dialogue.Add(this.GetLocalizedValue("Chat.Hardmode"));
}
if (NPC.downedMoonlord)
{
dialogue.Add(this.GetLocalizedValue("Chat.MoonLordDefeated"));
}
return dialogue;
}
public override void SetChatButtons(ref string button, ref string button2)
{
button = Language.GetTextValue("LegacyInterface.28");
}
public override void OnChatButtonClicked(bool firstButton, ref string shopName)
{
if (firstButton)
{
shopName = "Shop";
}
}
public override void AddShops()
{
NPCShop shop = new(Type);
shop.Add<TheConcoction>(Condition.MoonPhasesEven)
.Add<TheElixir>(Condition.MoonPhasesOdd)
.Add<BaconOil>(Condition.MoonPhasesHalf0)
.Add<TheSandwich>(Condition.MoonPhasesHalf1)
.Add<RageBait>()
.Add<CombatVoucher>(Condition.DownedGoblinArmy)
.Add<AggressiveVoucher>(Condition.DownedGoblinArmy, Condition.MoonPhases04)
.Add<OddVoucher>(Condition.DownedGoblinArmy, Condition.MoonPhases15)
.Add<UnbreakableVoucher>(Condition.DownedGoblinArmy, Condition.MoonPhases26)
.Add<HurriedVoucher>(Condition.DownedGoblinArmy, Condition.MoonPhases37)
.Add<TrustyOldRod>()
.Add<GluttonyBlender>()
.Add<GreedPot>()
.Add<FishStocks>()
.Add<TheGift>()
.Add<GladiatorsLocket>(new Condition(CalamityUtils.GetText("Condition.HasFoundGladiatorsLocket"), () => RecipeUnlockHandler.HasFoundGladiatorsLocket && Main.moonPhase == 0))
.Add<LuxorsGift>(new Condition(CalamityUtils.GetText("Condition.HasFoundLuxorsGift"), () => RecipeUnlockHandler.HasFoundLuxorsGift && Main.moonPhase == 1))
.Add<CrimsonEffigy>(new Condition(CalamityUtils.GetText("Condition.HasFoundCrimsonEffigy"), () => RecipeUnlockHandler.HasFoundCrimsonEffigy && Main.moonPhase == 2))
.Add<FungalSymbiote>(new Condition(CalamityUtils.GetText("Condition.HasFoundFungalSymbiote"), () => RecipeUnlockHandler.HasFoundFungalSymbiote && Main.moonPhase == 3))
.Add<UnstableGraniteCore>(new Condition(CalamityUtils.GetText("Condition.HasFoundUnstableGraniteCore"), () => RecipeUnlockHandler.HasFoundUnstableGraniteCore && Main.moonPhase == 4))
.Add<FrozenCube>(new Condition(CalamityUtils.GetText("Condition.HasFoundFrozenCube"), () => RecipeUnlockHandler.HasFoundFrozenCube && Main.moonPhase == 5))
.Add<CorruptionEffigy>(new Condition(CalamityUtils.GetText("Condition.HasFoundCorruptionEffigy"), () => RecipeUnlockHandler.HasFoundCorruptionEffigy && Main.moonPhase == 6))
.Add<TrinketofChi>(new Condition(CalamityUtils.GetText("Condition.HasFoundTrinketOfChi"), () => RecipeUnlockHandler.HasFoundTrinketOfChi && Main.moonPhase == 7))
.Add<TheMonument>(Condition.Hardmode)
.Add<TheHousingContract>(Condition.Hardmode)
.Add<OmniGun>(Condition.DownedGolem)
.Register();
}
public override void FindFrame(int frameHeight)
{
NPC.gfxOffY = -2f;
if (NPC.ai[0] == 12f) // Attacking
{
NPC.spriteDirection = NPC.direction;
NPC.frameCounter = 0;
NPC.frame.Y = frameHeight * 9;
}
else if (NPC.velocity.Y == 0f)
{
if (!NPC.IsABestiaryIconDummy)
{
if (NPC.direction == 1)
NPC.spriteDirection = 1;
else if (NPC.direction == -1)
NPC.spriteDirection = -1;
if (NPC.velocity.X == 0f)
{
NPC.frame.Y = 0;
NPC.frameCounter = 0.0;
return;
}
}
NPC.frameCounter += NPC.IsABestiaryIconDummy ? 0.6f : Math.Abs(NPC.velocity.X) * 0.25f;
NPC.frameCounter += 1.0;
if (NPC.frameCounter > 12.0)
{
NPC.frame.Y = NPC.frame.Y + frameHeight;
NPC.frameCounter = 0.0;
}
if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type] - 1)
NPC.frame.Y = frameHeight;
}
else
{
NPC.frameCounter = 0.0;
NPC.frame.Y = 0;
}
}
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
// Manually draw gun frame when attacking
if (NPC.ai[0] == 12f && !NPC.IsABestiaryIconDummy)
{
Texture2D gunTex = TextureAssets.Item[ModContent.ItemType<ElephantKiller>()].Value;
int holdoutOffset = -2;
Vector2 origin = NPC.spriteDirection == -1 ? new Vector2(gunTex.Width + holdoutOffset, gunTex.Height / 2f) : new Vector2(-holdoutOffset, gunTex.Height / 2f);
Vector2 drawPos = NPC.Center - screenPos + new Vector2(0f, 8f);
float rotation = NPC.ai[2] * ((float)Math.PI / 2f) * NPC.spriteDirection;
spriteBatch.Draw(gunTex, drawPos, null, drawColor, rotation, origin, NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f);
}
}
//Pulled and modified from Vanilla, originally is used to spawn the Travelling Merchant
internal static void SpawnTravelNPC(int npcToSpawnNextTo)
{
int bestX = Main.npc[npcToSpawnNextTo].homeTileX;
int bestY = Main.npc[npcToSpawnNextTo].homeTileY;
int minValue = bestX;
int num3 = bestX;
int num4 = bestY;
int num5 = bestX;
while (num5 > bestX - 10 && (WorldGen.SolidTile(num5, num4) || Main.tileSolidTop[Main.tile[num5, num4].TileType]) && (!Main.tile[num5, num4 - 1].IsTileSolid() || !Main.tileSolid[Main.tile[num5, num4 - 1].TileType] || Main.tileSolidTop[Main.tile[num5, num4 - 1].TileType]) && (!Main.tile[num5, num4 - 2].IsTileSolid() || !Main.tileSolid[Main.tile[num5, num4 - 2].TileType] || Main.tileSolidTop[Main.tile[num5, num4 - 2].TileType]) && (!Main.tile[num5, num4 - 3].IsTileSolid() || !Main.tileSolid[Main.tile[num5, num4 - 3].TileType] || Main.tileSolidTop[Main.tile[num5, num4 - 3].TileType]))
{
minValue = num5;
num5--;
}
for (int k = bestX; k < bestX + 10 && (WorldGen.SolidTile(k, num4) || Main.tileSolidTop[Main.tile[k, num4].TileType]) && (!Main.tile[k, num4 - 1].IsTileSolid() || !Main.tileSolid[Main.tile[k, num4 - 1].TileType] || Main.tileSolidTop[Main.tile[k, num4 - 1].TileType]) && (!Main.tile[k, num4 - 2].IsTileSolid() || !Main.tileSolid[Main.tile[k, num4 - 2].TileType] || Main.tileSolidTop[Main.tile[k, num4 - 2].TileType]) && (!Main.tile[k, num4 - 3].IsTileSolid() || !Main.tileSolid[Main.tile[k, num4 - 3].TileType] || Main.tileSolidTop[Main.tile[k, num4 - 3].TileType]); k++)
{
num3 = k;
}
for (int l = 0; l < 30; l++)
{
int num6 = Main.rand.Next(minValue, num3 + 1);
if (l < 20)
{
if (num6 < bestX - 1 || num6 > bestX + 1)
{
bestX = num6;
break;
}
}
else if (num6 != bestX)
{
bestX = num6;
break;
}
}
int num7 = bestX;
int num8 = bestY;
bool flag = false;
if (!flag && !((double)num8 > Main.worldSurface))
{
for (int m = 20; m < 500; m++)
{
for (int n = 0; n < 2; n++)
{
num7 = ((n != 0) ? (bestX - m * 2) : (bestX + m * 2));
if (num7 > 10 && num7 < Main.maxTilesX - 10)
{
int num9 = bestY - m;
double num10 = bestY + m;
if (num9 < 10)
{
num9 = 10;
}
if (num10 > Main.worldSurface)
{
num10 = Main.worldSurface;
}
for (int num11 = num9; (double)num11 < num10; num11++)
{
num8 = num11;
if (!Main.tile[num7, num8].IsTileSolid() || !Main.tileSolid[Main.tile[num7, num8].TileType])
{
continue;
}
if (Main.tile[num7, num8 - 3].LiquidType != LiquidID.Water || Main.tile[num7, num8 - 2].LiquidType != LiquidID.Water || Main.tile[num7, num8 - 1].LiquidType != LiquidID.Water || Collision.SolidTiles(num7 - 1, num7 + 1, num8 - 3, num8 - 1))
{
break;
}
flag = true;
Rectangle value = new Rectangle(num7 * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, num8 * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2);
for (int num12 = 0; num12 < 255; num12++)
{
if (Main.player[num12].active && new Rectangle((int)Main.player[num12].position.X, (int)Main.player[num12].position.Y, Main.player[num12].width, Main.player[num12].height).Intersects(value))
{
flag = false;
break;
}
}
break;
}
}
if (flag)
{
break;
}
}
if (flag)
{
break;
}
}
}
int myIndex = NPC.NewNPC(NPC.GetSpawnSourceForTownSpawn(), num7 * 16, num8 * 16, ModContent.NPCType<ShadySalesman>(), 1);
Main.npc[myIndex].homeTileX = bestX;
Main.npc[myIndex].homeTileY = bestY;
Main.npc[myIndex].homeless = true;
if (num7 < bestX)
{
Main.npc[myIndex].direction = 1;
}
else if (num7 > bestX)
{
Main.npc[myIndex].direction = -1;
}
Main.npc[myIndex].netUpdate = true;
string fullName = Main.npc[myIndex].FullName;
if (Main.netMode == NetmodeID.SinglePlayer)
{
Main.NewText(Language.GetTextValue("Announcement.HasArrived", fullName), 50, 125);
}
else if (Main.netMode == NetmodeID.Server)
{
ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasArrived", Main.npc[myIndex].GetFullNetName()), new Color(50, 125, 255));
}
}
public override void TownNPCAttackStrength(ref int damage, ref float knockback)
{
damage = 10;
knockback = 1f;
}
public override void TownNPCAttackProj(ref int projType, ref int attackDelay)
{
projType = ModContent.ProjectileType<ShadySalesmanGunshot>();
attackDelay = 1;
}
public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset)
{
multiplier = 8f;
gravityCorrection = 0f;
randomOffset = 0f;
}
public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown)
{
cooldown = 75;
randExtraCooldown = 10;
}
// Spawn the effects used for Tinkerer's Voucher failing when below 1 life
public override void HitEffect(NPC.HitInfo hit)
{
if (NPC.life <= 0)
{
for (int d = 0; d < 10; d++)
{
for (int smokeCount = 0; smokeCount < 3; smokeCount++)
{
Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, 12f);
Color smokeStart = Main.rand.NextBool() ? Color.Gray : Color.LightGray;
Color smokeEnd = Color.DimGray;
float smokeSize = Main.rand.NextFloat(0.9f, 2f);
Particle smoke = new SmallSmokeParticle(NPC.Center, velocity, smokeStart, smokeEnd, smokeSize, Main.rand.Next(90, 140));
GeneralParticleHandler.SpawnParticle(smoke);
}
Particle skull = new DesertProwlerSkullParticle(NPC.Center, new Vector2(2.5f, 2.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), Main.rand.NextBool() ? Color.LightGray : Color.Silver, Color.Gray, Main.rand.NextFloat(0.15f, 0.5f), Main.rand.Next(100, 190));
GeneralParticleHandler.SpawnParticle(skull);
}
SoundEngine.PlaySound(SoundID.NPCDeath6, NPC.Center);
}
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
var hardmode = npcLoot.DefineConditionalDropSet(DropHelper.Hardmode());
hardmode.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, ModContent.ItemType<ElephantKiller>()));
}
public override void ModifyActiveShop(string shopName, Item[] items)
{
ShadySalesmanShopTooltips.addSalesPitch = true;
}
public override void ResetEffects()
{
if (Main.npcShop < 1) //ModifyActiveShop only runs once when shop opens, so we only reset this if no shop is open
ShadySalesmanShopTooltips.addSalesPitch = false;
}
}
public class ShadySalesmanSpawnSystem : ModSystem
{
private static bool CanSpawnTonight = true;
public override void PreUpdateWorld()
{
if (!DownedBossSystem.downedHorribleHog) // Cannot spawn before Horrible Hog has been killed.
return;
if (Main.dayTime)
{
CanSpawnTonight = true;
return;
}
if (!CanSpawnTonight || Main.eclipse || (Main.invasionType > 0 && Main.invasionDelay == 0 && Main.invasionSize > 0))
return;
for (int i = 0; i < 200; i++)
if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType<ShadySalesman>())
return;
List<int> townNPCs = [];
if (!NPC.AnyNPCs(ModContent.NPCType<TownPiggy>()))
{
for (int j = 0; j < 200; j++)
if (Main.npc[j].active && Main.npc[j].townNPC && Main.npc[j].type != NPCID.OldMan && !Main.npc[j].homeless)
townNPCs.Add(j);
if (townNPCs.Count <= 1)
return;
}
if (!Main.rand.NextBool(4))
{
CanSpawnTonight = false;
return;
}
int petPig = NPC.FindFirstNPC(ModContent.NPCType<TownPiggy>());
if (petPig == -1)
ShadySalesman.SpawnTravelNPC(townNPCs[Main.rand.Next(townNPCs.Count)]);
else
{
string name = Main.npc[petPig].GivenName;
Main.npc[petPig].Transform(ModContent.NPCType<ShadySalesman>());
Main.npc[petPig].GivenName = name;
string fullName = Main.npc[petPig].FullName;
if (Main.netMode == NetmodeID.SinglePlayer)
{
Main.NewText(Language.GetTextValue("Announcement.HasArrived", fullName), 50, 125);
}
else if (Main.netMode == NetmodeID.Server)
{
ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasArrived", Main.npc[petPig].GetFullNetName()), new Color(50, 125, 255));
}
}
CanSpawnTonight = false;
}
}
public class ShadySalesmanShopTooltips : GlobalItem
{
/// <summary>
/// Scale for the "fine print" of the shop.
/// </summary>
public static float SmallTextSize => 0.8f;
/// <summary>
/// Tooltip Line names that should be left alone instead of becoming fine print
/// All exempted tooltip lines are moved above the fine print section
/// </summary>
static List<string> ExemptFromSmall => [
"ItemName",
"SalesPitch",
"Price",
"SpecialPrice",
"JourneyResearch",
];
public override void Load()
{
On_ChatManager.DrawColorCodedStringShadow_SpriteBatch_DynamicSpriteFont_TextSnippetArray_Vector2_Color_float_Vector2_Vector2_float_float += HideDefaultShadowForSmallText;
}
// Doze May 30 2026
// Terraria forces drawing the shadow effects for all tooltip texts.
// This system forces the shadows to be transparent for SmallTextSnippets as it draws the shadows manually
private void HideDefaultShadowForSmallText(On_ChatManager.orig_DrawColorCodedStringShadow_SpriteBatch_DynamicSpriteFont_TextSnippetArray_Vector2_Color_float_Vector2_Vector2_float_float orig, SpriteBatch spriteBatch, ReLogic.Graphics.DynamicSpriteFont font, TextSnippet[] snippets, Vector2 position, Color baseColor, float rotation, Vector2 origin, Vector2 baseScale, float maxWidth, float spread)
{
List<Color> colorsToRestore = [];
foreach (var item in snippets)
{
if (item is SmallTextSnippet s)
{
colorsToRestore.Add(s.Color);
s.Color = Color.Transparent;
}
}
orig(spriteBatch, font, snippets, position, baseColor, rotation, origin, baseScale, maxWidth, spread);
if (colorsToRestore.Count > 0)
foreach (var item in snippets)
{
if (item is SmallTextSnippet s)
{
s.Color = colorsToRestore[0];
colorsToRestore.RemoveAt(0);
}
}
}
public static bool addSalesPitch = false; //Used to track if the shop should show the pitches
public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
{
if (!addSalesPitch || !CalamityItemSets.HasSalesmanText[item.type])
return;
tooltips.Insert(1, new TooltipLine(Mod, "SalesPitch", item.ModItem?.GetLocalizedValue("SalesPitch") ?? "Error: Sales Pitches not supported for vanilla items") // While vanilla item support COULD be added, salesman won't need sales pitches for vanilla items ever and so this is fine.
{
});
int placetoMove = -1;
for (var i = 0; i < tooltips.Count; i++)
{
var line = tooltips[i];
if (!ExemptFromSmall.Contains(line.Name))
{
if (placetoMove < 0)
placetoMove = i;
TextSnippet[] snippets = ChatManager.ParseMessage(line.Text, Color.White).ToArray();
ChatManager.ConvertNormalSnippets(snippets);
string lineText = "";
for (int i2 = 0; i2 < snippets.Length; i2++)
{
lineText += snippets[i2].Text;
}
if (string.IsNullOrWhiteSpace(lineText))
//Sometimes the game tries to draw entirely empty lines with no size.
//This would cause no issue except for it still applies the Y offset those lines
//So, we just force hide those lines entirely here
line.Hide();
else
{
string[] lines = lineText.Split('\n');
tooltips.RemoveAt(i);
for (int k = 0; k < lines.Length; k++)
{
if (string.IsNullOrWhiteSpace(lines[k]))
continue;
// Create a distinct TooltipLine for each line of text
TooltipLine newLine = new TooltipLine(Mod, $"{line.Name}_{k}", $"[scale/{SmallTextSize}:{lines[k]}]")
{
OverrideColor = line.OverrideColor
};
// Insert it back into the list at the current position
tooltips.Insert(i, newLine);
i++;
}
i--;
}
}
else if (placetoMove > 0)
{
tooltips.RemoveAt(i);
tooltips.Insert(placetoMove, line);
placetoMove++;
}
}
}
public override bool PreDrawTooltipLine(Item item, DrawableTooltipLine line, ref int yOffset)
{
//Applies the Y offset to lines that are small to ensure they line up properly visually.
//Without this, they'd stay spaced the same as normal text...
//although the tooltip background would still size as if they're stacked closer like this does. Thanks vanilla code jank.
if (line.Text.StartsWith($"[scale/{SmallTextSize}:"))
{
yOffset = -(int)(FontAssets.MouseText.Value.MeasureString(" ") * (1 - SmallTextSize)).Y - 1;
}
return base.PreDrawTooltipLine(item, line, ref yOffset);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

@@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Fishing.FishingRods;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
{
public class ShadySalesmanGunshot : ModProjectile, ILocalizedModType
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public new string LocalizationCategory => "Projectiles.Typeless";
public override void SetDefaults()
{
Projectile.width = 12;
Projectile.height = 12;
Projectile.friendly = true;
Projectile.hostile = false;
Projectile.penetrate = 3;
Projectile.timeLeft = 600;
Projectile.tileCollide = true;
Projectile.ignoreWater = true;
Projectile.extraUpdates = 10;
Projectile.DamageType = DamageClass.Ranged;
Projectile.localNPCHitCooldown = -1;
Projectile.usesLocalNPCImmunity = true;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, Color.Khaki.ToVector3() * 0.2f);
}
public override void OnSpawn(IEntitySource source)
{
// Shift the projectile up to about the center of the salesman and override its speed
if (source is EntitySource_Parent parentSource && parentSource.Entity is NPC npc && npc.type == ModContent.NPCType<ShadySalesman>())
{
Projectile.position.Y -= 4f;
float rotation = npc.ai[2];
Vector2 barrelDirection = rotation.ToRotationVector2();
if (npc.spriteDirection == -1)
barrelDirection.X *= -1;
float speed = Projectile.velocity.Length();
Projectile.velocity = barrelDirection * speed;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
SpawnImpactEffects(target.Center);
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
SpawnImpactEffects(Projectile.Center);
return true;
}
public void SpawnImpactEffects(Vector2 hitPoint)
{
Vector2 velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX);
Particle bloom = new CustomSpark(hitPoint, Vector2.Zero, "CalamityMod/Particles/BrightFlash", false, 6, 0.35f, Color.Khaki, Vector2.One, true, true, glowOpacity: 0.5f, colorFadeSpeed: 10);
GeneralParticleHandler.SpawnParticle(bloom, true);
for (int i = 0; i < 4; i++)
{
Vector2 dustVel = velocity.RotatedByRandom(0.35f) * Main.rand.NextFloat(2f, 7f);
Dust dust = Dust.NewDustPerfect(hitPoint, DustID.Smoke, dustVel, 120, default, Main.rand.NextFloat(0.8f, 1.1f));
dust.noGravity = true;
}
for (int i = 0; i < 3; i++)
{
Vector2 sparkVel = velocity.RotatedByRandom(0.22f) * Main.rand.NextFloat(3f, 8f);
Particle spark = new CustomSpark(hitPoint, sparkVel, "CalamityMod/Particles/FadeLine", false, Main.rand.Next(12, 18), 0.22f, Color.LightGray, new Vector2(0.45f, 1f), true, shrinkSpeed: 0.45f, colorFadeSpeed: 10);
GeneralParticleHandler.SpawnParticle(spark, true);
}
}
}
}
+16 -1
View File
@@ -1,4 +1,11 @@
using CalamityMod.Items.Fishing.FishingRods;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Fishing.FishingRods;
using CalamityMod.Items.Placeables;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.Potions.Food;
using CalamityMod.Items.Tools;
using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.Items.Weapons.Magic;
@@ -134,5 +141,13 @@ namespace CalamityMod.Systems.Collections
public static bool[] RogueSpikyBall = Factory.CreateNamedSet("RogueSpikyBall")
.Description("Labels this item as a rogue spiky ball, only exists for objective classification.")
.RegisterBoolSet(ItemType<BurningStrife>(), ItemType<GodsParanoia>(), ItemType<MetalMonstrosity>(), ItemType<NastyCholla>(), ItemType<SystemBane>(), ItemType<WebBall>());
/// <summary>
/// Marks that this item has Shady Salesman text and the actual tooltip should draw small below it. Does not support Vanilla items
/// </summary>
public static bool[] HasSalesmanText = Factory.CreateNamedSet("HasSalesmanText")
.Description("Marks that this item has Shady Salesman text and the actual tooltip should draw small below it. Does not support Vanilla items")
.RegisterBoolSet(ItemType<FishStocks>(), ItemType<TrustyOldRod>(), ItemType<RageBait>(), ItemType<GluttonyBlender>(), ItemType<TheMonument>(), ItemType<GreedPot>(), ItemType<BaconOil>(), ItemType<TheSandwich>(), ItemType<TheConcoction>(), ItemType<TheElixir>(), ItemType<TheGift>(), ItemType<OmniGun>(),
ItemType<CombatVoucher>(), ItemType<AggressiveVoucher>(), ItemType<OddVoucher>(), ItemType<UnbreakableVoucher>(), ItemType<HurriedVoucher>());
}
}
@@ -45,6 +45,7 @@ namespace CalamityMod
// Minibosses
internal static bool _downedGSS = false;
internal static bool _downedHorribleHog = false;
internal static bool _downedCLAM = false;
internal static bool _downedCLAMHardMode = false;
internal static bool _downedCragmawMire = false;
@@ -381,6 +382,17 @@ namespace CalamityMod
NPC.SetEventFlagCleared(ref _downedPrimordialWyrm, -1);
}
}
public static bool downedHorribleHog
{
get => _downedHorribleHog;
set
{
if (!value)
_downedHorribleHog = false;
else
NPC.SetEventFlagCleared(ref _downedHorribleHog, -1);
}
}
public static bool downedCLAM
{
get => _downedCLAM;
@@ -548,6 +560,7 @@ namespace CalamityMod
downedSecondSentinels = false;
downedHorribleHog = false;
downedCLAM = false;
downedEoCAcidRain = false;
@@ -644,6 +657,8 @@ namespace CalamityMod
downed.Add("adultEidolonWyrm");
// Minibosses and events
if (downedHorribleHog)
downed.Add("horribleHog");
if (downedCLAM)
downed.Add("clam");
if (downedEoCAcidRain)
@@ -711,6 +726,7 @@ namespace CalamityMod
downedCalamitas = downed.Contains("supremeCalamitas");
downedPrimordialWyrm = downed.Contains("adultEidolonWyrm");
downedHorribleHog = downed.Contains("horribleHog");
downedCLAM = downed.Contains("clam");
downedEoCAcidRain = downed.Contains("eocRain");
+2
View File
@@ -301,6 +301,7 @@ namespace CalamityMod
flags12[3] = downedBossRush;
flags12[4] = DraedonMechdusa;
flags12[5] = unlockedTownPig;
flags12[5] = downedHorribleHog;
writer.Write(flags);
writer.Write(flags2);
@@ -456,6 +457,7 @@ namespace CalamityMod
downedBossRush = flags12[3];
DraedonMechdusa = flags12[4];
unlockedTownPig = flags12[5];
downedHorribleHog = flags12[5];
RecipeUnlockHandler.ReceiveData(reader);
+1
View File
@@ -888,6 +888,7 @@ namespace CalamityMod
public static IItemDropRuleCondition PostExos(bool ui = true) => CalamityConditions.DownedExoMechs.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never);
public static IItemDropRuleCondition PostSCal(bool ui = true) => CalamityConditions.DownedSupremeCalamitas.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never);
public static IItemDropRuleCondition PostAEW(bool ui = true) => CalamityConditions.DownedPrimordialWyrm.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never);
public static IItemDropRuleCondition PostHorribleHog(bool ui = true) => CalamityConditions.DownedHorribleHog.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never);
public static IItemDropRuleCondition PostClam(bool ui = true) => CalamityConditions.DownedClam.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never);
public static IItemDropRuleCondition PostClamHM(bool ui = true) => CalamityConditions.DownedBuffedClam.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never);
public static IItemDropRuleCondition PostGSS(bool ui = true) => CalamityConditions.DownedGreatSandShark.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never);