This commit is contained in:
Nathanael Overton committed 2025-04-30 16:10:00 -04:00
commit 8ea35f9e44
46 files changed
+993 -228

No files matched your search

-8
View File
@@ -2540,14 +2540,6 @@ namespace CalamityMod.CalPlayer
{
int duration = Main.rand.Next(300 + hurtInfo.Damage / 3, 480 + hurtInfo.Damage / 2);
npc.AddBuff(BuffID.Confused, duration, false);
if (amalgam)
{
npc.AddBuff(BuffID.Venom, duration);
npc.AddBuff(ModContent.BuffType<Plague>(), duration);
npc.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), duration);
npc.AddBuff(ModContent.BuffType<SulphuricPoisoning>(), duration);
npc.AddBuff(ModContent.BuffType<Irradiated>(), duration);
}
}
}
+12
View File
@@ -90,6 +90,8 @@ namespace CalamityMod.CalPlayer
target.Calamity().IncreasedSicknessAndWaterEffects_EvergreenGin = evergreenGin;
target.Calamity().IncreasedSicknessAndWaterEffects_CorrosiveSpine = corrosiveSpine;
target.Calamity().IncreasedDebuffEffects_Amalgam = amalgam;
switch (item.type)
{
case ItemID.DeathSickle:
@@ -225,6 +227,8 @@ namespace CalamityMod.CalPlayer
cgn.IncreasedSicknessAndWaterEffects_EvergreenGin = evergreenGin;
cgn.IncreasedSicknessAndWaterEffects_CorrosiveSpine = corrosiveSpine;
cgn.IncreasedDebuffEffects_Amalgam = amalgam;
switch (proj.type)
{
case ProjectileID.ObsidianSwordfish:
@@ -1230,6 +1234,14 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffType<Irradiated>(), 180);
}
}
if (amalgam)
{
target.AddBuff(BuffID.Daybreak, 120);
target.AddBuff(BuffType<Nightwither>(), 120);
target.AddBuff(BuffType<Plague>(), 120);
target.AddBuff(BuffType<VermillionFlux>(), 120);
target.AddBuff(BuffType<CrushDepth>(), 120);
}
if (voidOfExtinction)
CalamityUtils.Inflict246DebuffsNPC(target, BuffType<BrimstoneFlames>());
if (frostFlare)
+24
View File
@@ -0,0 +1,24 @@
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.Effects
{
public class StormlionEffects
{
// Energy
public static int EnergyDust = ModContent.DustType<LightDust>();
public static Color EnergyColor = new Color(5, 187, 177);
// Flesh
public static int FleshDust = 192;
public static Color FleshColor = new Color(171, 113, 91);
// Sounds
public static readonly SoundStyle Hit = new("CalamityMod/Sounds/NPCHit/StormlionAltHit");
public static readonly SoundStyle Killed = new("CalamityMod/Sounds/NPCKilled/StormlionAltDeath");
public static readonly SoundStyle Attack = new("CalamityMod/Sounds/Custom/StormlionAltShoot");
public static readonly SoundStyle Idle1 = new("CalamityMod/Sounds/Custom/StormlionAltIdle1");
public static readonly SoundStyle Idle2 = new("CalamityMod/Sounds/Custom/StormlionAltIdle2");
}
}
+6 -5
View File
@@ -1,5 +1,6 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
@@ -36,19 +37,19 @@ namespace CalamityMod.Items.Accessories
modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit
modPlayer.amalgam = true;
player.brainOfConfusionItem = Item;
player.GetDamage<GenericDamageClass>() += 0.15f;
player.GetDamage<GenericDamageClass>() += 0.1f;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<AmalgamatedBrain>().
AddIngredient<CosmiliteBar>(5).
AddIngredient<AscendantSpiritEssence>(4).
AddIngredient<UnholyCore>(5).
AddIngredient<MolluskHusk>(10).
AddIngredient<CorrodedFossil>(15).
AddIngredient(ItemID.LunarBar, 10).
AddIngredient(ItemID.FragmentSolar, 10).
AddIngredient<PlagueCellCanister>(15).
AddIngredient<DepthCells>(15).
AddIngredient<EffulgentFeather>(8).
AddTile<CosmicAnvil>().
Register();
}
+2 -2
View File
@@ -98,7 +98,7 @@ namespace CalamityMod.Items.Accessories
{
modNPC.warbannerBurnDirection = Utils.DirectionTo(player.Center, nPC.Center);
modNPC.warbannerBurnMarked = true;
modNPC.warbannerBurnTimer = 2;
modNPC.warbannerBurnTimer = 180;
}
if (modNPC.warbannerBurnMarked)
{
@@ -107,7 +107,7 @@ namespace CalamityMod.Items.Accessories
int burnDamage = (int)player.GetBestClassDamage().ApplyTo(47 * damageMult); // There is up to a 3x multiplier on this damage depending on distance from the enemy
modNPC.warbannerBurnDamage = burnDamage;
modNPC.warbannerBurnStacks++;
modNPC.warbannerBurnTimer++;
modNPC.warbannerBurnTimer = 180;
modNPC.warbannerBurnHideEffects = hideVisual;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 936 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

+1 -2
View File
@@ -64,8 +64,7 @@ namespace CalamityMod.Items.SummonItems
AddIngredient<GalacticaSingularity>(10).
AddIngredient<Necroplasm>(40).
AddTile(TileID.LunarCraftingStation).
Register()
.DisableDecraft();
Register();
}
}
}
+34 -37
View File
@@ -111,7 +111,7 @@ namespace CalamityMod.Items.Weapons.Magic
returnColor = new(79, 255, 124);
break;
case ItemID.SoulofFright:
returnColor = new(255, 128, 20);
returnColor = new(255, 96, 20);
break;
}
return returnColor;
@@ -146,7 +146,6 @@ namespace CalamityMod.Items.Weapons.Magic
#endregion
public override Vector2? HoldoutOffset() => new Vector2(-35, -10);
public override bool AltFunctionUse(Player player) => true;
public override void OnCreated(ItemCreationContext context)
@@ -157,40 +156,33 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool CanUseItem(Player player)
{
if (player.altFunctionUse == 2)
{
Item.useTime = 3;
Item.useAnimation = 3 * storedSoulpower;
Item.UseSound = null;
}
else
{
Item.useTime = Item.useAnimation = 60;
Item.UseSound = FireSound;
}
return storedSoulpower > 0 || (FindSoulForAmmo(player) != -1 && player.altFunctionUse != 2);
Item.channel = Item.noUseGraphic = player.altFunctionUse == 2;
return ((player.altFunctionUse == 0 && (storedSoulpower > 0 || (FindSoulForAmmo(player) != -1))) || player.altFunctionUse == 2) &&
player.ownedProjectileCounts[ModContent.ProjectileType<SHPV>()] <= 0;
}
public override bool? UseItem(Player player)
{
if (storedSoulpower > 0)
storedSoulpower--;
if (storedSoulpower <= 0 && player.altFunctionUse != 2)
if (player.altFunctionUse != 2)
{
bool ammoConsumed = false;
if (storedSoulpower > 0)
storedSoulpower--;
if (FindSoulForAmmo(player) != -1)
if (storedSoulpower <= 0)
{
int soulType = FindSoulForAmmo(player);
player.ConsumeItem(soulType);
storedSoulType = soulType;
ammoConsumed = true;
}
bool ammoConsumed = false;
if (ammoConsumed)
storedSoulpower = ShotsPerSoul;
if (FindSoulForAmmo(player) != -1)
{
int soulType = FindSoulForAmmo(player);
player.ConsumeItem(soulType);
storedSoulType = soulType;
ammoConsumed = true;
}
if (ammoConsumed)
storedSoulpower = ShotsPerSoul;
}
}
return base.UseItem(player);
@@ -199,7 +191,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void ModifyManaCost(Player player, ref float reduce, ref float mult)
{
if (player.altFunctionUse == 2)
mult *= 0.3f;
mult *= 0f;
}
public override float UseSpeedMultiplier(Player player)
@@ -214,12 +206,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
if (player.altFunctionUse == 2)
{
SoundEngine.PlaySound(CommonCalamitySounds.ELRFireSound, player.Center);
if (storedSoulpower % 2 == 0)
{
Vector2 Speed = new Vector2(velocity.X + Main.rand.NextFloat(-1f, 1f), velocity.Y + Main.rand.NextFloat(-1f, 1f));
Projectile.NewProjectile(source, position + new Vector2(0, -10) + velocity * 2.6f, Speed, ModContent.ProjectileType<SHPL>(), (int)(damage * 0.25f), knockback * 0.5f, player.whoAmI, TransferColorToProj());
}
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<SHPV>(), 0, 0f, player.whoAmI);
return false;
}
else
@@ -247,7 +234,11 @@ namespace CalamityMod.Items.Weapons.Magic
}
#region Recoil Stuff
public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true;
public override void HoldItem(Player player)
{
player.Calamity().mouseWorldListener = true;
player.Calamity().rightClickListener = true;
}
public override void UseStyle(Player player, Rectangle heldItemFrame)
{
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
@@ -307,7 +298,13 @@ namespace CalamityMod.Items.Weapons.Magic
damage *= damageMult;
}
}
public override void ModifyTooltips(List<TooltipLine> list) => list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")));
public override void ModifyTooltips(List<TooltipLine> list)
{
if (Main.zenithWorld)
list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalizedValue("TooltipGFB")));
else
list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalization("TooltipNormal").Format(this.GetLocalizedValue(storedSoulpower == 0 ? "NoSoul" : "SoulDesc" + storedSoulType))));
}
public override void AddRecipes()
{
+1
View File
@@ -52,6 +52,7 @@ namespace CalamityMod.Items.Weapons.Ranged
AddIngredient(ItemID.ChainGun).
AddIngredient<P90>().
AddIngredient<AuricBar>(5).
AddIngredient<LifeAlloy>(3).
AddTile<CosmicAnvil>().
Register();
}
+2 -1
View File
@@ -46,9 +46,10 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<GoldenEagle>().
AddIngredient<RubicoPrime>().
AddIngredient<AntiMaterielRifle>().
AddIngredient<AuricBar>(5).
AddIngredient<LifeAlloy>(3).
AddTile<CosmicAnvil>().
Register();
}
@@ -142,6 +142,7 @@ Searslug: A distant cousin of the Slugbuns which can withstand the extreme heat
Sharkoon: The bulbous Sharkoon wanders the reefs on the outskirts of the Sunken Sea. It retaliates against threats through the unusual method of exploding a sac on its body that stores highly reactive chemicals, fleeing in the confusion caused by its shockwave.
Slugbun: The name of these cute sea dwellers is actually a misnomer given to them by outside visitors of the sea kingdom, who often sold them as exotic pets. In fact, their "bunny ear" appendages are actually their antennae taking on the appearance of the various sea prisms scattered throughout their home.
Stormlion: Some Ilmerian survivors claim that enough magical lightning surged through the sea during its final days that there existed not a single drop of water without levin coursing through it. Even now, electricity remains buried in the sands, with several antlion species having learned to channel the former kingdom's power.
StormlionSentry: Some Ilmeran survivors claim that enough magical lightning surged through the sea during its final days that there existed not a single drop of water without levin coursing through it. Even now, electricity remains buried in the sands, with several antlion species having learned to channel the former kingdom's power.
//Town NPCs
AndroombaFriendly: Reverse-engineered Androombas that have been retrofitted to spread the Steampunker's solutions rather than clean dust and debris off of floors. They can be used to purify the world– or ruin it further, if one so desires.
Archmage: One of the world's foremost experts on magical theory, he is renowned for his skill with the arcane arts. In his days when he traveled with Yharim's entourage, he acted as the Godseeker's advisor, due to both his status and his distaste for actively participating in battle.
@@ -1835,12 +1835,14 @@ TheAmalgam: {
DisplayName: The Amalgam
Tooltip:
'''
15% increased damage
10% increased damage
All attacks inflict a variety of debuffs and multiplies all elemental debuff damage by 3.5x
Most buffs last twice as long, and persist after dying
Taking damage inflicts several debuffs on nearby enemies and spawns a dank creeper
Taking damage confuses nearby enemies and spawns a dank creeper
The dank creeper flies above you, exploding into several shaderain clouds
Grants the ability to dodge attacks
After dodging, summon damage and crit chance are boosted by 10%
'You have no idea how it's staying together'
'''
HoldShiftTooltip: "{$Common.DodgeInformation}"
}
@@ -796,11 +796,21 @@ SHPC: {
TooltipNormal:
'''
Consumes Souls as ammo
Fires orbs of unstable, concentrated soulpower that linger after ejection
Orbs create a large explosion and emit seeking souls after collapse
Ejects orbs of unstable, concentrated soulpower that linger and explode
Orbs emit seeking souls and lingering pickup souls after collapse
Orbs have varying effects depending on Soul type used
Press Right Click to discharge all soulpower in the weapon as weak energy beams
{0}
Press Right Click to use the machine as a vacuum, pulling in lingering souls
Once released, a torrent of soul lasers is discharged scaling with the number of souls pulled in
'''
// These are the soul effect descriptions, the number is the item ID of the soul
NoSoul: "[c/808080:There is currently no soul type injected into the weapon]"
SoulDesc520: "[c/F01DC4:Light-infused orbs create larger explosions]"
SoulDesc521: "[c/7B1DDC:Night-infused orbs create longer lasting explosions]"
SoulDesc575: "[c/6AF0FA:Flight-infused orbs travel faster and restore flight time on direct hits]"
SoulDesc548: "[c/0433DE:Might-infused orbs apply mighty knockback to enemies]"
SoulDesc549: "[c/4FFF7C:Sight-infused orbs seek out nearby enemies]"
SoulDesc547: "[c/FF6014:Fright-infused orbs deal extra flat damage with their hatred]"
LegendaryText:
'''
'Though soul-powered machines were a near failure, potential remained in souls as a form of fuel.
@@ -196,6 +196,7 @@ SkeletronPrime2.DisplayName: Skeletron Alpha
AlphaVice.DisplayName: Alpha Vice
AlphaCannon.DisplayName: Alpha Cannon
Stormlion.DisplayName: Stormlion
StormlionSentry.DisplayName: Stormlion Sentry
Sunskater.DisplayName: Sunskater
SuperDummyNPC.DisplayName: Super Dummy
WildBumblefuck.DisplayName: Draconic Swarmer
@@ -40,6 +40,7 @@ PodobooSpitUltima.DisplayName: Ultima Podoboo Spit
PrismBackCrystal.DisplayName: Prism-Back Shard
PufferExplosion.DisplayName: Explosion
SharkoonExplosion.DisplayName: Sharkoon Explosion
StormlionSentryBullet.DisplayName: Stormlion Sentry Bullet
StormMarkHostile.DisplayName: Mark
SulphuricAcidBubble.DisplayName: Acid Bubble
SulphuricAcidMist.DisplayName: Acid Mist
@@ -201,6 +201,7 @@ SHPB.DisplayName: SHPB
SHPExplosion.DisplayName: SHPB Explosion
SHPL.DisplayName: SHPL
SHPS.DisplayName: SHPS
SHPV.DisplayName: SHPV
SilvaBurst.DisplayName: Silva Burst
SlitheringEelProjectile.DisplayName: Slithering Eel
SmallSpirit.DisplayName: Small Angry Spirit
@@ -470,7 +470,4 @@ WitchDoctorChat: {
Jungle: I wonder how my relatives are doing, last time I checked on them they were too busy praising the... Sun, I think.
}
WizardChat: {
Hardmode: Space just got way too close for comfort.
MentionRoD: I saw some teleporting pink apparitions in the Hallow. If you let me live nearby, I should be able to channel their magic into a special staff for you.
}
WizardChat.Hardmode: Space just got way too close for comfort.
+50 -29
View File
@@ -178,6 +178,9 @@ namespace CalamityMod.NPCs
public bool IncreasedSicknessAndWaterEffects_EvergreenGin = false;
public bool IncreasedSicknessAndWaterEffects_CorrosiveSpine = false;
// Universal debuff effects
public bool IncreasedDebuffEffects_Amalgam = false;
/// <summary> Constant variable representing the grace period, in frames, in which a boss can remain outside of its native biome before enraging. </summary>
public const int biomeEnrageTimerMax = 300;
@@ -553,6 +556,7 @@ namespace CalamityMod.NPCs
myClone.IncreasedWaterEffects_Amulet2 = IncreasedWaterEffects_Amulet2;
myClone.IncreasedSicknessAndWaterEffects_CorrosiveSpine = IncreasedSicknessAndWaterEffects_CorrosiveSpine;
myClone.IncreasedSicknessAndWaterEffects_EvergreenGin = IncreasedSicknessAndWaterEffects_EvergreenGin;
myClone.IncreasedDebuffEffects_Amalgam = IncreasedDebuffEffects_Amalgam;
myClone.velocityPriorToPhaseSwap = velocityPriorToPhaseSwap;
@@ -1006,6 +1010,16 @@ namespace CalamityMod.NPCs
waterDamageMult += EvergreenGin.SicknessWaterDebuffBoost;
}
//Amalgam triples all elemental debuff damage. Ironically this excludes Elemental Mix
if (IncreasedDebuffEffects_Amalgam)
{
heatDamageMult += 3.5;
coldDamageMult += 3.5;
waterDamageMult += 3.5;
sicknessDamageMult += 3.5;
electricityDamageMult += 3.5;
}
// Subtract 1 for the vanilla damage multiplier because it's already dealing DoT in the vanilla regen code.
double vanillaHeatDamageMult = heatDamageMult - BaseDoTDamageMult;
double vanillaColdDamageMult = coldDamageMult - BaseDoTDamageMult;
@@ -5790,6 +5804,10 @@ namespace CalamityMod.NPCs
warbannerBurnMarked = false;
warbannerBurnStacks = 0;
}
if (warbannerBurnTimer <= 60)
{
warbannerBurnStacks = (int)(warbannerBurnStacks * 0.9f);
}
if (warbannerBurnMarked)
{
int maxStacks = 300; // Time in frames needed to reach max power
@@ -6224,10 +6242,14 @@ namespace CalamityMod.NPCs
target.AddBuff(BuffID.BrokenArmor, 300);
break;
case NPCID.PossessedArmor:
target.AddBuff(BuffID.Cursed, 60);
break;
case NPCID.Ghost:
case NPCID.PirateGhost:
target.AddBuff(BuffID.Cursed, 120);
target.AddBuff(BuffID.Silenced, 120);
target.AddBuff(BuffID.Cursed, 60);
target.AddBuff(BuffID.Silenced, 180);
break;
case NPCID.ChaosElemental:
@@ -7020,51 +7042,34 @@ namespace CalamityMod.NPCs
spawnRate = (int)(spawnRate * 0.85);
if (Main.SceneMetrics.WaterCandleCount > 0)
spawnRate = (int)(spawnRate * 0.8888); // On top of 0.75 = 0.6666x (1.33x -> 1.5x spawn rate)
if (player.enemySpawns) // Battle Potion
{
spawnRate = (int)(spawnRate * 0.9);
maxSpawns = (int)(maxSpawns * 1.1f);
}
if (player.enemySpawns)
{
spawnRate = (int)(spawnRate * 0.8);
maxSpawns = (int)(maxSpawns * 1.2f);
spawnRate = (int)(spawnRate * 0.8); // On top of 0.5 = 0.4x (2x -> 2.5x spawn rate)
maxSpawns = (int)(maxSpawns * 1.25f); // On top of 2 (2x -> 2.5x max spawns)
}
if (player.Calamity().chaosCandle)
{
spawnRate = (int)(spawnRate * 0.6);
spawnRate = (int)(spawnRate * 0.4); // 2.5x spawn rate
maxSpawns = (int)(maxSpawns * 2.5f);
}
if (player.Calamity().zerg)
{
spawnRate = (int)(spawnRate * 0.2);
spawnRate = (int)(spawnRate * 0.2); // 5x spawn rate
maxSpawns = (int)(maxSpawns * 5f);
}
// This is horribly unoptimized, I'm leaving it commented out. - Fab
/*if (NPC.AnyNPCs(NPCType<WulfrumAmplifier>()))
{
int otherWulfrumEnemies = NPC.CountNPCS(NPCType<WulfrumDrone>()) + NPC.CountNPCS(NPCType<WulfrumGyrator>()) + NPC.CountNPCS(NPCType<WulfrumHovercraft>()) + NPC.CountNPCS(NPCType<WulfrumRover>());
if (otherWulfrumEnemies < 4)
{
spawnRate = (int)(spawnRate * 0.8);
maxSpawns = (int)(maxSpawns * 1.2f);
}
}*/
// Reductions
if (Main.SceneMetrics.PeaceCandleCount > 0)
{
spawnRate = (int)(spawnRate * 1.1);
maxSpawns = (int)(maxSpawns * 0.9f);
}
spawnRate = (int)(spawnRate * 1.0989); // On top of 1.3 = 1.4286x (0.77x -> 0.7x spawn rate)
if (player.Calamity().tranquilityCandle)
{
spawnRate = (int)(spawnRate * 1.4);
maxSpawns = (int)(maxSpawns * 0.4f);
spawnRate = (int)(spawnRate * 1.6666); // 0.6x spawn rate
maxSpawns = (int)(maxSpawns * 0.6f);
}
if (player.Calamity().zen || (CalamityServerConfig.Instance.ForceTownSafety && player.townNPCs > 1f && Main.expertMode))
{
spawnRate = (int)(spawnRate * 2.5);
spawnRate = (int)(spawnRate * 3.3333); // 0.3x spawn rate
maxSpawns = (int)(maxSpawns * 0.3f);
}
if (player.Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen)
@@ -7232,6 +7237,22 @@ namespace CalamityMod.NPCs
}
}
// Fuck Chaos Elementals, overrides the vanilla spawn so they can be afk farmed once more
if (Main.hardMode && spawnInfo.Player.ZoneRockLayerHeight && !calamityBiomeZone)
{
// Added more tiles for them to spawn on
bool isChaosElementalSpawnTile =
spawnInfo.SpawnTileType == TileID.Pearlstone ||
spawnInfo.SpawnTileType == TileID.Pearlsand ||
spawnInfo.SpawnTileType == TileID.HallowedIce ||
spawnInfo.SpawnTileType == TileID.HallowedGrass ||
spawnInfo.SpawnTileType == TileID.HallowHardenedSand ||
spawnInfo.SpawnTileType == TileID.HallowSandstone;
if (isChaosElementalSpawnTile)
pool[NPCID.ChaosElemental] = SpawnCondition.Cavern.Chance * 0.125f;
}
// Replace vanilla Lava Slimes with Calamity Lava Slimes to avoid annoying lava drops
if (spawnInfo.Player.ZoneUnderworldHeight && !calamityBiomeZone && CalamityServerConfig.Instance.RemoveLavaDropsFromLavaSlimes && Main.expertMode)
{
+13
View File
@@ -98,6 +98,12 @@ namespace CalamityMod.NPCs
case NPCID.Werewolf:
npcLoot.ChangeDropRate(ItemID.MoonCharm, 1, 20);
break;
// Possessed Armor
// Nazar @ 1% Normal, 2% Expert+
case NPCID.PossessedArmor:
npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Nazar, 100, 50));
break;
#endregion
#region Sky / Space
@@ -417,8 +423,15 @@ namespace CalamityMod.NPCs
// Chaos Elemental
// Megaphone @ 1% Normal, 2% Expert+
// Rod of Discord @ 0.5% Normal, 0.625% Expert+ (2.5 times higher chance than vanilla)
case NPCID.ChaosElemental:
npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Megaphone, 100, 50));
// Remove the vanilla loot rule for Rod of Discord.
npcLoot.RemoveWhere((rule) => rule is CommonDrop conditionalRule && conditionalRule.itemId == ItemID.RodofDiscord);
// Define a replacement rule which has an increased chance.
npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.RodofDiscord, 200, 160));
break;
// Illuminant Bat
+1 -4
View File
@@ -242,7 +242,7 @@ namespace CalamityMod.NPCs
private static readonly string[] WitchDoctorNames =
{
"Sok'ar",
"Toxin", // <@!348174404984766465> (Toxin#9598),
"Aeroni", // <@!348174404984766465> (aeroni) (previously: toxin)
"Mixcoatl", // <@!284775927294984203> (.sharzz)
"Khatunz", // <@!303022375191183360> (jackshiz)
"Amnesia Wapers", // <@!326821498323075073> (retardedadvicefromaretard)
@@ -1024,8 +1024,6 @@ namespace CalamityMod.NPCs
break;
case NPCID.Wizard:
if (Main.rand.NextBool(6) && !Main.LocalPlayer.InventoryHas(ItemID.RodofDiscord) && !Main.LocalPlayer.InventoryHas(ItemType<NormalityRelocator>()) && !Main.LocalPlayer.ZoneHallow)
chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.MentionRoD");
if (Main.rand.NextBool(10) && Main.hardMode)
chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.Hardmode");
break;
@@ -1222,7 +1220,6 @@ namespace CalamityMod.NPCs
{
shop.AddWithCustomValue(ItemType<HowlsHeart>(), CalamityGlobalItem.RarityLightRedBuyPrice * 3)
.AddWithCustomValue(ItemID.MagicMissile, Item.buyPrice(gold: 5))
.AddWithCustomValue(ItemID.RodofDiscord, Item.buyPrice(gold: 50), Condition.Hardmode, Condition.InHallow)
.AddWithCustomValue(ItemID.SpectreStaff, Item.buyPrice(gold: 25), Condition.DownedGolem)
.AddWithCustomValue(ItemID.InfernoFork, Item.buyPrice(gold: 25), Condition.DownedGolem)
.AddWithCustomValue(ItemID.ShadowbeamStaff, Item.buyPrice(gold: 25), Condition.DownedGolem)
+329
View File
@@ -0,0 +1,329 @@
using System;
using System.IO;
using CalamityMod.BiomeManagers;
using CalamityMod.Dusts;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.Enemy;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.Utilities;
namespace CalamityMod.NPCs.SunkenSea
{
public class StormlionSentry : ModNPC
{
public ref float time => ref NPC.ai[0];
public ref float attackTimer => ref NPC.ai[1];
public ref float jitter => ref NPC.ai[2];
public ref float jitterRate => ref NPC.localAI[0];
public ref float headRot => ref NPC.localAI[1];
public ref float attackFeedback => ref NPC.localAI[2];
public bool canBeMoved => NPC.localAI[3] == 0;
public enum Mode
{
Idle,
Agressive,
Leaping,
Digging
}
public Mode AIState
{
get => (Mode)(int)NPC.ai[3];
set => NPC.ai[3] = (int)value;
}
public float fxFade = 1;
public float fxFadeInv => attackFeedback - 1;
public float targetRange = 830;
public int attackRate = 180;
public int digDir = 1;
public Vector2 headPosition;
public Vector2 attackPosition;
public override void SetStaticDefaults()
{
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionXOverride = 20f };
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
}
public override void SetDefaults()
{
NPC.width = 50;
NPC.height = 108;
NPC.lifeMax = 60;
NPC.damage = 15;
NPC.defense = 3;
NPC.knockBackResist = 0f;
NPC.HitSound = Effects.StormlionEffects.Hit;
NPC.DeathSound = Effects.StormlionEffects.Killed;
NPC.noGravity = true;
NPC.noTileCollide = true; // Custom tile collision
AIState = Mode.Idle;
attackFeedback = 1;
headRot = -MathHelper.PiOver2;
SpawnModBiomes = new int[1] { ModContent.GetInstance<SunkenSeaBiome>().Type };
//Banner = NPC.type;
//BannerItem = ModContent.ItemType<StormlionSentryBanner>();
}
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(NPC.localAI[0]);
writer.Write(NPC.localAI[1]);
writer.Write(NPC.localAI[2]);
writer.Write(NPC.localAI[3]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
NPC.localAI[0] = reader.ReadSingle();
NPC.localAI[1] = reader.ReadSingle();
NPC.localAI[2] = reader.ReadSingle();
NPC.localAI[3] = reader.ReadSingle();
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
{
bestiaryEntry.Info.AddRange(
[
new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.StormlionSentry")
]);
}
public override void AI()
{
NPC.TargetClosest(false);
Player target = Main.player[NPC.target];
NPC.spriteDirection = NPC.direction;
bool npcFullyInTiles = Collision.SolidCollision(NPC.Center - Vector2.UnitY * 13, 15, 15);
bool npcOnTiles = Collision.SolidCollision(NPC.Center + Vector2.UnitY * 10, 15, 15);
bool targetInRange = Utils.Distance(target.Center, NPC.Center) <= targetRange && Collision.CanHit(headPosition, 1, 1, target.Center, 1, 1);
attackFeedback = MathHelper.Lerp(attackFeedback, 1, 0.025f);
fxFade = Utils.GetLerpValue(0, attackRate, attackTimer, true);
if (!npcOnTiles)
{
if (NPC.velocity.Y < 0)
NPC.velocity.Y *= 0.97f;
if (NPC.velocity.Y < 20)
NPC.velocity.Y += 0.5f;
NPC.velocity.X *= 0.97f;
}
if (!npcFullyInTiles && npcOnTiles && AIState != Mode.Digging)
{
NPC.localAI[3] = 5;
AIState = Mode.Digging;
}
if (AIState == Mode.Idle)
{
attackTimer = (int)MathHelper.Lerp(attackTimer, 0, 0.01f);
jitterRate = MathHelper.Lerp(jitterRate, 0.1f, 0.05f);
headRot = headRot.AngleLerp(-Vector2.UnitY.ToRotation(), 0.02f);
if (targetInRange && !canBeMoved)
AIState = Mode.Agressive;
if (Main.rand.NextBool(15) && time % 60 == 0)
{
jitterRate = 4.7f;
SoundEngine.PlaySound((Main.rand.NextBool() ? Effects.StormlionEffects.Idle1 : Effects.StormlionEffects.Idle2) with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.2f, 0.1f) }, NPC.Center);
}
}
if (AIState == Mode.Agressive)
{
if (!targetInRange && attackTimer >= 0)
AIState = Mode.Idle;
if (attackTimer >= 0)
{
jitterRate = MathHelper.Lerp(jitterRate, 1f + 3f * Utils.GetLerpValue(0, attackRate, attackTimer), 0.035f);
headRot = headRot.AngleLerp(NPC.Center.DirectionTo(target.Center).ToRotation(), 0.035f);
}
else
headRot = headRot.AngleLerp(NPC.Center.DirectionTo(target.Center).ToRotation(), 0.01f);
if (attackTimer == attackRate)
{
SoundEngine.PlaySound(Effects.StormlionEffects.Attack with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, NPC.Center);
Projectile.NewProjectile(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 12), ModContent.ProjectileType<StormlionSentryBullet>(), NPC.damage, 0f, Main.myPlayer);
for (int i = 0; i <= 12; i++)
{
float variance = Main.rand.NextFloat(-0.6f, 0.6f);
int dustStyle = Effects.StormlionEffects.EnergyDust;
Dust dust2 = Dust.NewDustPerfect(attackPosition, dustStyle);
dust2.scale = Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance);
dust2.velocity = (headRot.ToRotationVector2() * 15).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance));
dust2.noGravity = true;
dust2.color = Effects.StormlionEffects.EnergyColor;
}
attackFeedback = 2;
attackTimer = -60;
jitterRate = 0;
NPC.ForceNetUpdate();
}
attackTimer++;
}
if (AIState == Mode.Digging)
{
if (time % 10 == 0)
{
NPC.velocity = Vector2.Zero;
headRot = MathHelper.ToRadians(4 * digDir) - MathHelper.PiOver2;
SoundEngine.PlaySound(SoundID.WormDig with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, NPC.Center);
NPC.Center += Vector2.UnitY * 2;
digDir *= -1;
}
if (npcFullyInTiles)
AIState = Mode.Idle;
}
if (!canBeMoved)
NPC.velocity = Vector2.Zero;
bool dancing = false; // They will dance if a "music projectile" is on screen of if the player is using an instrument (except drums because that would be annoying to make work)
for (int x = 0; x < Main.maxProjectiles; x++)
{
if (Main.mouseLeft && (target.HeldItem.type == ItemID.Bell || target.HeldItem.type == ItemID.CarbonGuitar || target.HeldItem.type == ItemID.IvyGuitar || target.HeldItem.type == ItemID.Harp || target.HeldItem.type == ItemID.TheAxe))
{
dancing = true;
}
Projectile projectile = Main.projectile[x];
if (!dancing && projectile.active && (projectile.type == ModContent.ProjectileType<AnahitasArpeggioNote>() || projectile.type == ModContent.ProjectileType<MelterNote1>() || projectile.type == ModContent.ProjectileType<MelterNote2>() || projectile.type == ModContent.ProjectileType<AmphibiansGuitarHoldout>() || projectile.type == ProjectileID.SparkleGuitar || projectile.type == ProjectileID.EighthNote || projectile.type == ProjectileID.QuarterNote || projectile.type == ProjectileID.TiedEighthNote))
{
dancing = true;
}
}
if (dancing)
{
float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 14.37f / MathHelper.Pi);
if (Main.zenithWorld)
{
if (time % 2 == 0)
{
SoundEngine.PlaySound(Effects.StormlionEffects.Attack with { Volume = 0.2f, Pitch = 0.4f * sine, MaxInstances = 30 }, NPC.Center);
Projectile proj = Projectile.NewProjectileDirect(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 6), ModContent.ProjectileType<StormlionSentryBullet>(), NPC.damage * target.statLifeMax2, 0f, Main.myPlayer);
proj.friendly = true;
proj.hostile = false;
}
fxFade = 1;
attackTimer = attackRate * 0.9f;
}
else
attackTimer = 0;
jitterRate = 1;
NPC.dontTakeDamage = true;
headRot = MathHelper.ToRadians(100 * sine) - MathHelper.PiOver2;
AIState = Mode.Idle;
}
else
NPC.dontTakeDamage = false;
float orbSine = (float)Math.Sin(time * 0.575f / MathHelper.Pi) * Utils.GetLerpValue(attackRate * 1.1f, 0, attackTimer);
headPosition = NPC.Center - (Vector2.UnitY * 27).RotatedBy(NPC.rotation) + headRot.ToRotationVector2() * 12 + NPC.velocity;
attackPosition = headPosition + headRot.ToRotationVector2() * (25 + 8 * orbSine);
NPC.rotation = Utils.AngleLerp(0, headRot + MathHelper.PiOver2, 0.35f);
if (fxFade > 0)
{
Lighting.AddLight(attackPosition, Effects.StormlionEffects.EnergyColor.ToVector3() * 0.7f * fxFade);
}
time++;
jitter += jitterRate;
}
public override void HitEffect(NPC.HitInfo hit)
{
for (int k = 0; k < 5; k++)
{
int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, Effects.StormlionEffects.FleshDust, hit.HitDirection, -1f, 0, Effects.StormlionEffects.FleshColor, Main.rand.NextFloat(0.7f, 1.1f));
}
if (NPC.life <= 0)
{
for (int k = 0; k < 35; k++)
{
bool type = !Main.rand.NextBool(3);
int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, type ? Effects.StormlionEffects.EnergyDust : Effects.StormlionEffects.FleshDust, hit.HitDirection, -1f, 0, type ? Effects.StormlionEffects.EnergyColor : Effects.StormlionEffects.FleshColor, Main.rand.NextFloat(0.7f, 1.1f));
}
// Gores go here once they're done
/*
if (!Main.dedServ)
{
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("StormlionSentry").Type, 1f);
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("StormlionSentry2").Type, 1f);
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("StormlionSentry3").Type, 1f);
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("StormlionSentry4").Type, 1f);
}
*/
}
}
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
{
return false;
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (spawnInfo.Player.Calamity().ZoneTimelessShores && !spawnInfo.Water && !spawnInfo.Player.Calamity().clamity)
{
return SpawnCondition.Cavern.Chance * 0.5f;
}
return 0f;
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ModContent.ItemType<StormlionMandible>());
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
Texture2D tex = TextureAssets.Npc[Type].Value;
if (NPC.IsABestiaryIconDummy)
{
spriteBatch.Draw(tex, NPC.Center - screenPos, null, drawColor, NPC.rotation, tex.Size() / 2f, NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
return false;
}
if (time == 0)
return false;
Texture2D body = ModContent.Request<Texture2D>("CalamityMod/NPCs/SunkenSea/StormlionSentryBody").Value;
Texture2D head = ModContent.Request<Texture2D>("CalamityMod/NPCs/SunkenSea/StormlionSentryHead").Value;
Texture2D mandible = ModContent.Request<Texture2D>("CalamityMod/NPCs/SunkenSea/StormlionSentryMandible").Value;
Texture2D attack = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
spriteBatch.Draw(body, NPC.Center - screenPos, null, drawColor, NPC.rotation, body.Size() / 2f, NPC.scale, SpriteEffects.None, 0f);
spriteBatch.Draw(head, headPosition - screenPos, null, drawColor, headRot + MathHelper.PiOver2, head.Size() / 2f, NPC.scale, SpriteEffects.None, 0f);
for (int i = -1; i <= 1; i += 2)
{
float sine = (float)Math.Sin(jitter * 0.575f / MathHelper.Pi) * Utils.GetLerpValue(4.8f, 0, jitterRate);
Vector2 madiblePos = headPosition + (Vector2.UnitX * 10 * i).RotatedBy(headRot + MathHelper.PiOver2);
Vector2 madibleOrigin = (new Vector2(i == 1 ? 0 : mandible.Width, mandible.Height));
float mandibleRot = MathHelper.ToRadians(5 * i) + MathHelper.Lerp(MathHelper.ToRadians(20) * sine * i, MathHelper.ToRadians(50) * i * fxFadeInv, fxFadeInv);
spriteBatch.Draw(mandible, madiblePos - screenPos, null, drawColor, headRot + mandibleRot + MathHelper.PiOver2, madibleOrigin, NPC.scale, i == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
}
if (attackTimer > 0)
{
float fade = (float)Math.Pow(fxFade, 2);
for (int i = 0; i < 3; i++)
spriteBatch.Draw(attack, attackPosition - screenPos, null, Color.Lerp(Effects.StormlionEffects.EnergyColor, Color.White, i * 0.3f) with { A = 0 } * fade, headRot, attack.Size() / 2f, (NPC.scale * 0.3f - (i * 0.08f)) * fade * Main.rand.NextFloat(0.8f, 1.1f), SpriteEffects.None, 0f);
}
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+4 -2
View File
@@ -11,13 +11,14 @@ namespace CalamityMod.Particles
{
public Color InitialColor;
public bool AffectedByGravity;
public float ExtraRotation;
public override bool SetLifetime => true;
public override bool UseCustomDraw => true;
public override bool UseAdditiveBlend => true;
public override string Texture => "CalamityMod/Particles/Square";
public SquareParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color)
public SquareParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, float extraRotation = 0f)
{
Position = relativePosition;
Velocity = velocity;
@@ -25,6 +26,7 @@ namespace CalamityMod.Particles
Scale = scale;
Lifetime = lifetime;
Color = InitialColor = color;
ExtraRotation = extraRotation;
}
public override void Update()
@@ -37,7 +39,7 @@ namespace CalamityMod.Particles
Velocity.X *= 0.94f;
Velocity.Y += 0.25f;
}
Rotation = Velocity.ToRotation() + MathHelper.PiOver2;
Rotation = Velocity.ToRotation() + MathHelper.PiOver2 + ExtraRotation;
}
public override void CustomDraw(SpriteBatch spriteBatch)
-1
View File
@@ -132,7 +132,6 @@ namespace CalamityMod.Projectiles.Boss
if (info.Damage <= 0 || Projectile.Opacity != 1f)
return;
target.AddBuff(BuffID.OnFire, 360);
target.AddBuff(BuffID.CursedInferno, 180);
}
-1
View File
@@ -184,7 +184,6 @@ namespace CalamityMod.Projectiles.Boss
if (info.Damage <= 0)
return;
target.AddBuff(BuffID.OnFire, 360);
target.AddBuff(BuffID.CursedInferno, 180);
}
@@ -49,13 +49,5 @@ namespace CalamityMod.Projectiles.Boss
public override void PostAI() => Lighting.AddLight(Projectile.Center, 0.2f, 0.1f, 0f);
public override bool CanHitPlayer(Player target) => CalamityUtils.CircularHitboxCollision(Projectile.Center, CurrentRadius * Projectile.scale * 0.4f, target.Hitbox) && Projectile.timeLeft > 6;
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
if (info.Damage <= 0)
return;
target.AddBuff(BuffID.OnFire, 480);
}
}
}
@@ -77,14 +77,6 @@ namespace CalamityMod.Projectiles.Boss
public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f;
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
if (info.Damage <= 0 || Projectile.Opacity != 1f)
return;
target.AddBuff(BuffID.OnFire, 180);
}
public override bool PreDraw(ref Color lightColor)
{
lightColor.R = (byte)(255 * Projectile.Opacity);
-1
View File
@@ -75,7 +75,6 @@ namespace CalamityMod.Projectiles.Boss
if (info.Damage <= 0 || Projectile.Opacity != 1f)
return;
target.AddBuff(BuffID.OnFire, 180);
target.AddBuff(BuffID.CursedInferno, 90);
}
-1
View File
@@ -131,7 +131,6 @@ namespace CalamityMod.Projectiles.Boss
if (info.Damage <= 0 || Projectile.Opacity != 1f)
return;
target.AddBuff(BuffID.OnFire, 360);
target.AddBuff(BuffID.CursedInferno, 180);
}
@@ -0,0 +1,64 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Enemy
{
public class StormlionSentryBullet : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Enemy";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 8;
Projectile.height = 8;
Projectile.hostile = true;
Projectile.timeLeft = 160;
Projectile.extraUpdates = 6;
Projectile.tileCollide = true;
Projectile.penetrate = -1;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, Effects.StormlionEffects.EnergyColor.ToVector3() * 0.3f);
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
if (Main.rand.NextBool())
{
int dustStyle = ModContent.DustType<LightDust>();
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, dustStyle);
dust2.scale = Main.rand.NextFloat(0.4f, 0.7f);
dust2.velocity = Projectile.velocity * Main.rand.NextFloat(0.6f, 1f);
dust2.noGravity = true;
dust2.color = Effects.StormlionEffects.EnergyColor;
}
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
if (info.Damage <= 0)
return;
target.AddBuff(ModContent.BuffType<StaticDischarge>(), 60);
}
public override void OnKill(int timeLeft)
{
}
public override bool PreDraw(ref Color lightColor)
{
Asset<Texture2D> orb = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
for (int i = 0; i < 4; i++)
{
Vector2 scale = Projectile.scale * new Vector2(0.2f, 1.4f) * (0.05f + i * 0.02f) * 4;
Main.EntitySpriteDraw(orb.Value, Projectile.Center - Main.screenPosition, null, Effects.StormlionEffects.EnergyColor with { A = 0 }, Projectile.rotation, orb.Size() * 0.5f, scale, SpriteEffects.None);
}
return false;
}
}
}
+7 -4
View File
@@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Magic
case 4:
return new(79, 255, 124);
case 5:
return new(255, 128, 20);
return new(255, 96, 20);
default:
return new(0, 0, 0);
@@ -211,10 +211,13 @@ namespace CalamityMod.Projectiles.Magic
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<SHPExplosion>(), (int)(Projectile.damage * 1.5f), Projectile.knockBack, Projectile.owner, Projectile.ai[0], 0f);
for (int i = 0; i < 5; i++)
for (int i = 0; i < 8; i++)
{
Vector2 soulVelocity = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(6f, 9f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, soulVelocity, ModContent.ProjectileType<SHPS>(), (int)(Projectile.damage * 0.33f), 0f, Projectile.owner, Main.rand.Next(6));
bool pickup = i >= 5;
Vector2 soulVelocity = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (pickup ? 3f : Main.rand.NextFloat(6f, 9f));
int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, soulVelocity, ModContent.ProjectileType<SHPS>(), (int)(Projectile.damage * 0.33f), 0f, Projectile.owner, Main.rand.Next(6), 0f, pickup ? 1f : 0f);
if (pickup)
Main.projectile[p].timeLeft *= 3;
}
}
}
+1
View File
@@ -14,6 +14,7 @@ namespace CalamityMod.Projectiles.Magic
{
Projectile.width = 5;
Projectile.height = 5;
Projectile.scale = 3f;
Projectile.friendly = true;
Projectile.extraUpdates = 3;
Projectile.timeLeft = 600;
+65 -38
View File
@@ -12,10 +12,12 @@ namespace CalamityMod.Projectiles.Magic
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public ref float Timer => ref Projectile.ai[1];
public ref float State => ref Projectile.ai[2]; // 0 = Idle; 1 = Homing to enemy
public const float HomingRange = 560f;
public ref float Pickup => ref Projectile.ai[2]; // 0 if attacking soul, 1 if pickup soul
private float AIState = 0f; // 0 = Idle, 1 = Homing to enemy, 2 = Getting sucked to player
private const float HomingRange = 560f;
public NPC Target;
private NPC Target;
private Projectile ToSuckTowards;
public float RandomAnglingStrength = 0f;
public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true;
@@ -30,65 +32,90 @@ namespace CalamityMod.Projectiles.Magic
}
// Can only deal damage after it starts homing
public override bool? CanDamage() => Timer >= 25f;
public override bool? CanDamage() => Timer >= 25f && Pickup == 0f ? null : false;
public override void AI()
{
Timer++;
// Randomly changes the strength of idle turning
if (Timer % 30 == 1f)
RandomAnglingStrength = Main.rand.NextFloat(-0.16f, 0.16f);
// Determine behavior
if (Timer < 25) // Don't try to home at the start
State = 0f;
else
if (Timer >= 25) // Always remains idle for a short delay
{
float npcDistCheck = HomingRange;
int index = -1;
foreach (NPC n in Main.ActiveNPCs)
if (Pickup == 0f) // Only run homing code if not a pickup
{
if (!n.CanBeChasedBy(Projectile))
continue;
float currentNPCDist = Vector2.Distance(n.Center, Projectile.Center);
if (currentNPCDist < npcDistCheck)
float npcDistCheck = HomingRange;
int index = -1;
foreach (NPC n in Main.ActiveNPCs)
{
npcDistCheck = currentNPCDist;
index = n.whoAmI;
if (!n.CanBeChasedBy(Projectile))
continue;
float currentNPCDist = Vector2.Distance(n.Center, Projectile.Center);
if (currentNPCDist < npcDistCheck)
{
npcDistCheck = currentNPCDist;
index = n.whoAmI;
}
}
if (index == -1)
AIState = 0f;
else
{
Target = Main.npc[index];
AIState = 1f;
}
}
if (index == -1)
State = 0f;
else
else // Only run suction code if a pickup
{
Target = Main.npc[index];
State = 1f;
foreach (Projectile p in Main.ActiveProjectiles)
{
if (p.type == ModContent.ProjectileType<SHPV>() && p.Colliding(p.Hitbox, Projectile.Hitbox))
{
AIState = 2f;
ToSuckTowards = p;
break;
}
else
AIState = 0f;
}
}
}
// Actual behavior
if (State == 0f)
switch (AIState)
{
Projectile.extraUpdates = 0;
Projectile.velocity = Projectile.velocity.RotatedBy(RandomAnglingStrength);
}
else if (State == 1f)
{
Projectile.extraUpdates = 1;
float speed = Projectile.velocity.Length();
Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.SafeDirectionTo(Target.Center).ToRotation(), 0.15f).ToRotationVector2() * speed;
case 0f:
Projectile.extraUpdates = 0;
// Randomly changes the strength of idle turning
if (Timer % 30 == 1f)
RandomAnglingStrength = Main.rand.NextFloat(-0.16f, 0.16f);
Projectile.velocity = Projectile.velocity.RotatedBy(RandomAnglingStrength);
if (Projectile.velocity.Length() > 3f && Pickup == 1f)
Projectile.velocity *= 0.985f;
break;
case 1f:
Projectile.extraUpdates = 1;
float speed = Projectile.velocity.Length();
Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.SafeDirectionTo(Target.Center).ToRotation(), 0.15f).ToRotationVector2() * speed;
break;
case 2f:
Projectile.velocity = (Projectile.velocity * 15f + Utils.DirectionTo(Projectile.Center, ToSuckTowards.ModProjectile<SHPV>().TipPosition) * 15f) / 16f;
if (Vector2.Distance(Projectile.Center, ToSuckTowards.ModProjectile<SHPV>().TipPosition) < 40f)
{
ToSuckTowards.ModProjectile<SHPV>().SoulColors.Add(Projectile.ai[0]);
Projectile.Kill();
}
break;
}
// Appearance
if (Timer % 1 == 0f)
{
SquareParticle trail = new(Projectile.Center, Vector2.Zero, false, 25, 3f, SHPB.FindColorForSoul((int)Projectile.ai[0]));
SquareParticle trail = new(Projectile.Center, Vector2.Zero, false, 25, 3f, SHPB.FindColorForSoul((int)Projectile.ai[0]), Pickup == 1f ? MathHelper.PiOver4 : 0f);
GeneralParticleHandler.SpawnParticle(trail);
}
SquareParticle mainSpot = new(Projectile.Center, Vector2.Zero, false, 2, 1.4f, Color.White);
SquareParticle mainSpot = new(Projectile.Center, Vector2.Zero, false, 2, 1.4f, Color.White, Pickup == 1f ? MathHelper.PiOver4 : 0f);
GeneralParticleHandler.SpawnParticle(mainSpot);
}
}
+148
View File
@@ -0,0 +1,148 @@
using System;
using System.Collections.Generic;
using System.Threading;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Particles;
using CalamityMod.Sounds;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class SHPV : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
private Player Owner => Main.player[Projectile.owner];
public ref float Timer => ref Projectile.ai[0];
// The maximum distance in pixels out from the tip of the gun in which souls can be sucked in.
private const float Size = 480f;
// The spread of the suction on each side. 25 degrees on each side, 50 degrees total.
private const float Spread = MathHelper.Pi / 7.2f;
// Manual offset used for drawing the gun.
private static Vector2 Offset => new Vector2(27f, -10f);
// The position of the tip of the gun. Used for most projectile logic.
public Vector2 TipPosition => Projectile.Center + Vector2.UnitX.RotatedBy(Projectile.rotation) * 62f + Vector2.UnitY * Offset.Y;
// A list containing the ai[0] values of each soul that is sucked in, used for determining the color to draw the soul as.
public List<float> SoulColors = [];
// Tracks whether or not the gun should be doing the laser attack.
private bool FiringLasers = false;
public override void SetDefaults()
{
Projectile.width = Projectile.height = 70;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
}
public override void AI()
{
// Stop using the holdout if you cannot
if (Owner.CantUseHoldout(false))
{
Projectile.Kill();
return;
}
Timer++;
// If you release right click, use the laser attack
if (!Owner.Calamity().mouseRight)
FiringLasers = true;
if (FiringLasers)
{
if (SoulColors.Count > 0)
{
if (Timer % 10 == 0f)
{
if (Owner.HeldItem.ModItem is SHPC shpc && shpc.storedSoulpower > 0)
{
shpc.storedSoulpower -= Math.Min(shpc.storedSoulpower, 2);
SoundEngine.PlaySound(CommonCalamitySounds.ELRFireSound, Owner.Center);
Vector2 laserVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * 20f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), TipPosition, laserVel, ModContent.ProjectileType<SHPL>(), Projectile.damage, 3f, Projectile.owner, SoulColors[0]);
SoulColors.RemoveAt(0);
}
else
SoulColors.Clear();
}
}
}
else
{
// Debug code used for assessing the visual and functional area of the vacuum
/*BloomLineVFX l = new(Owner.Center, Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedBy(Spread) * Size, 0.4f, Color.Gray, 2, true);
BloomLineVFX l2 = new(Owner.Center, Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedBy(-Spread) * Size, 0.4f, Color.Gray, 2, true);
GeneralParticleHandler.SpawnParticle(l);
GeneralParticleHandler.SpawnParticle(l2);*/
// Spawn faded smoke particles idly
if (Timer % 2 == 0f)
{
Vector2 spawn = Owner.Center + Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedByRandom(Spread) * Size * Main.rand.NextFloat(0.4f, 1f);
MediumMistParticle smoky = new(spawn, Utils.DirectionTo(spawn, TipPosition) * 4.5f, Color.Gray, Color.DarkGray, 1.25f, 96f);
GeneralParticleHandler.SpawnParticle(smoky);
}
}
// Typical held projectile shit
Owner.heldProj = Projectile.whoAmI;
Owner.ChangeDir(Math.Sign((Owner.Calamity().mouseWorld - Owner.Center).X));
Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, (Owner.Center - Owner.Calamity().mouseWorld).ToRotation() * Owner.gravDir + MathHelper.PiOver2);
Projectile.rotation = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).ToRotation();
Projectile.velocity = Vector2.Zero;
Projectile.Center = Owner.Center;
// This is used to make the projectile naturally despawn after running out of souls
if (!FiringLasers || SoulColors.Count > 0)
Projectile.timeLeft = 30;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
bool withinAngle = Math.Abs(Utils.DirectionTo(TipPosition, Owner.Calamity().mouseWorld).ToRotation() - Utils.DirectionTo(TipPosition, targetHitbox.Center.ToVector2()).ToRotation()) <= Spread;
// This extra safety hitbox is a square around the gun tip used so that the soul doesn't need to perfectly travel down the narrow end of the vacuum to get sucked in
Rectangle extraSafetyHitbox = new Rectangle((int)TipPosition.X - (Projectile.width / 2), (int)TipPosition.Y - (Projectile.height / 2), Projectile.width, Projectile.height);
return (CalamityUtils.CircularHitboxCollision(TipPosition, Size, targetHitbox) && withinAngle) || targetHitbox.Intersects(extraSafetyHitbox);
}
public override bool PreDraw(ref Color lightColor)
{
// Draw spiraling smoke particles representing the suction radius
Vector2 farthestPos = Owner.Center + Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * Size;
float rotation = Utils.DirectionTo(TipPosition, farthestPos).ToRotation();
if (!FiringLasers)
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Particles/MediumMist").Value;
Rectangle frame = tex.Frame(1, 3, 0, Main.rand.Next(3));
Main.spriteBatch.SetBlendState(BlendState.Additive);
for (int i = 0; i < 6; i++)
{
// There are 3 separate streams offset from one another
for (int j = 0; j < 3; j++)
{
float distRatio = 1f - (Main.GameUpdateCount + j * 10) % 30 / 30f;
Vector2 posOffset = new Vector2(MathF.Sin(MathHelper.TwoPi / 6f * i) * 25f * distRatio, MathF.Cos(Main.GameUpdateCount * MathHelper.Pi / 30f + MathHelper.TwoPi / 6f * i) * 160f * distRatio).RotatedBy(rotation);
float colorMult = 0.5f * Utils.GetLerpValue(1f, 0.8f, distRatio, true);
Main.EntitySpriteDraw(tex, Vector2.Lerp(TipPosition, farthestPos, distRatio) + posOffset - Main.screenPosition, frame, Color.Gray * colorMult, rotation + MathHelper.Pi, frame.Size() / 2f, 1.5f * distRatio, SpriteEffects.None);
}
}
Main.spriteBatch.SetBlendState(BlendState.AlphaBlend);
}
// Manually draw the gun itself
Texture2D shpc = TextureAssets.Item[ModContent.ItemType<SHPC>()].Value;
Vector2 position = Owner.Center - Main.screenPosition + Vector2.UnitX.RotatedBy(rotation) * Offset.X + Vector2.UnitY * Offset.Y;
SpriteEffects sp = Owner.Calamity().mouseWorld.X < Owner.Center.X ? SpriteEffects.FlipVertically : SpriteEffects.None;
Main.EntitySpriteDraw(shpc, position, null, lightColor, rotation, shpc.Size() / 2f, 1f, sp);
return false;
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -235,7 +235,7 @@ namespace CalamityMod.Systems.Collections
"oracle",
"YumeiSenshi",
"Cameron",
"Toxin",
"Aeroni", // previously "Toxin"
"Fweepachino",
"DESPACITO",
"Altzeus",
+17 -65
View File
@@ -722,7 +722,6 @@ namespace CalamityMod.Systems
AddEarlyGameAccessoryRecipes();
AddHardmodeItemRecipes();
AddArmorRecipes();
AddAnkhShieldRecipes();
}
#endregion
@@ -1600,6 +1599,7 @@ namespace CalamityMod.Systems
// Fledgling Wings
r = Recipe.Create(ItemID.CreativeWings);
r.AddIngredient(ModContent.ItemType<AncientBoneDust>(), 2);
r.AddIngredient(ItemID.Cloud, 5);
r.AddIngredient(ItemID.Feather, 10);
r.AddTile(TileID.Anvils);
@@ -1638,6 +1638,13 @@ namespace CalamityMod.Systems
r.DisableDecraft();
#endregion
// Cobalt Shield
r = Recipe.Create(ItemID.CobaltShield);
r.AddRecipeGroup(AnyCobaltBar, 5);
r.AddTile(TileID.Anvils);
r.Register();
r.DisableDecraft();
// Flame Waker Boots
r = Recipe.Create(ItemID.FlameWakerBoots);
r.AddIngredient(ItemID.Silk, 8);
@@ -1712,70 +1719,6 @@ namespace CalamityMod.Systems
}
#endregion
#region Ankh Shield Components
private static void AddAnkhShieldRecipes()
{
// Cobalt Shield
Recipe r = Recipe.Create(ItemID.CobaltShield);
r.AddRecipeGroup(AnyCobaltBar, 5);
r.AddTile(TileID.Anvils);
r.Register();
r.DisableDecraft();
// The Plan:
// Trifold Map (confusion)
r = Recipe.Create(ItemID.TrifoldMap);
r.AddIngredient(ItemID.Silk, 10);
r.AddIngredient(ItemID.SoulofLight, 10);
r.AddTile(TileID.Anvils);
r.Register();
r.DisableDecraft();
// Fast Clock (slow)
r = Recipe.Create(ItemID.FastClock);
r.AddIngredient(ItemID.Timer1Second);
r.AddIngredient(ItemID.PixieDust, 25);
r.AddTile(TileID.Anvils);
r.Register();
r.DisableDecraft();
// Countercurse Mantra:
// Nazar (curse)
r = Recipe.Create(ItemID.Nazar);
r.AddIngredient(ItemID.SoulofNight, 10);
r.AddIngredient(ItemID.Lens, 3);
r.AddTile(TileID.Anvils);
r.Register();
r.DisableDecraft();
// Megaphone (silence)
r = Recipe.Create(ItemID.Megaphone);
r.AddRecipeGroup(AnyCobaltBar, 5);
r.AddIngredient(ItemID.Wire, 10);
r.AddTile(TileID.Anvils);
r.Register();
r.DisableDecraft();
// Reflective Shades:
// Blindfold (darkness)
r = Recipe.Create(ItemID.Blindfold);
r.AddIngredient(ItemID.Silk, 10);
r.AddIngredient(ItemID.TatteredCloth);
r.AddTile(TileID.Anvils);
r.Register();
r.DisableDecraft();
// Pocket Mirror (petrification)
r = Recipe.Create(ItemID.PocketMirror);
r.AddIngredient(ItemID.Glass, 10);
r.AddRecipeGroup(AnyGoldBar, 8);
r.AddIngredient(ItemID.CrystalShard, 8);
r.AddTile(TileID.Anvils);
r.Register();
r.DisableDecraft();
}
#endregion
#region Hardmode Items and Accessories
private static void AddHardmodeItemRecipes()
{
@@ -1786,6 +1729,15 @@ namespace CalamityMod.Systems
r.Register();
r.DisableDecraft();
// Rod of Discord
r = Recipe.Create(ItemID.RodofDiscord);
r.AddIngredient(ItemID.SoulofLight, 30);
r.AddIngredient(ItemID.CrystalShard, 25);
r.AddIngredient(ItemID.ChaosFish, 5);
r.AddTile(TileID.MythrilAnvil);
r.Register();
r.DisableDecraft();
// Sergeant United Shield
r = Recipe.Create(ItemID.BouncingShield);
r.AddRecipeGroup(AnyCobaltBar, 12);
+189 -1
View File
@@ -620,6 +620,182 @@ namespace CalamityMod.World
// Obsidian and hellstone towers...
AddHellHouses();
// Generate after houses to avoid complications
// Place pillars of walls to show that the roof of the underworld is being held up
// Do not place any pillars in the Brimstone Crags
bool cragsLocationIsLeft = GenVars.dungeonX < Main.maxTilesX / 2;
int brimstoneCragsSize = Main.maxTilesX / 5;
int brimstoneCragsLocationStart = cragsLocationIsLeft ? (25 + brimstoneCragsSize) : ((Main.maxTilesX - brimstoneCragsSize) - 25);
int pillarDistanceFromCragsLimit = 160;
int pillarIndexStartX = (cragsLocationIsLeft ? brimstoneCragsLocationStart : 0) + pillarDistanceFromCragsLimit;
int pillarIndexEndX = (cragsLocationIsLeft ? Main.maxTilesX : brimstoneCragsLocationStart) - pillarDistanceFromCragsLimit;
int pillarIndexStarY = Main.maxTilesY - 200;
int pillarIndexEndY = smoulderingStoneWallStartDepth + randomizedWallSectionsHeight;
int pillarMidPointY = pillarIndexStarY + (pillarIndexEndY - pillarIndexStarY) / 2;
int pillarCutOffCheckStart = pillarMidPointY - 10;
int pillarMinWidth = 6;
int pillarMinWidthPerSide = pillarMinWidth / 2;
int pillarMinStartingWidth = 18;
int pillarMaxWidth = 24;
int pillarMaxWidthPerSide = pillarMaxWidth / 2;
int pillarY = 0;
int pillarLeftSize = 0;
int pillarRightSize = 0;
int topTileSectionSize = 10;
int pillarTopTileSectionCutOff = pillarIndexStarY + topTileSectionSize;
ushort pillarTileID = Main.zenithWorld ? TileID.PoopBlock : TileID.StoneSlab;
ushort pillarWallID = Main.zenithWorld ? WallID.PoopWall : WallID.RocksUnsafe3;
// Use the x tile index to find pillar locations
for (int x = pillarIndexStartX; x < pillarIndexEndX; x += WorldGen.genRand.Next(80, pillarDistanceFromCragsLimit + 1))
{
int pillarStartingWidth = WorldGen.genRand.Next(pillarMinStartingWidth, pillarMaxWidth + 1);
pillarLeftSize = pillarStartingWidth / 2;
pillarRightSize = pillarStartingWidth / 2;
if (pillarStartingWidth % 2 != 0)
{
if (WorldGen.genRand.NextBool())
pillarLeftSize++;
else
pillarRightSize++;
}
int startOfPillarX = x - pillarMaxWidthPerSide;
int endOfPillarX = x + pillarMaxWidthPerSide;
int wallsDetected = 0;
bool tooManyWallsToPlacePillarRow = false;
// Start the pillar at the top of the underworld and extend down to the hellstone wall
for (int y = pillarIndexStarY; y <= pillarIndexEndY; y++)
{
// The amount of walls required to stop generating the pillar when it's deeper than pillarCutoffCheckStart
int pillarCutOffSize = pillarLeftSize + pillarRightSize + 2;
// Get the amount of empty space on the left and right of the pillar's X mid point
int emptySpaceOnLeft = pillarMaxWidthPerSide - pillarLeftSize;
int emptySpaceOnRight = pillarMaxWidthPerSide - pillarRightSize;
// Used for wall cleanup around top tile section
int topTileSectionWallCleanupLeft = startOfPillarX + emptySpaceOnLeft + 1;
int topTileSectionWallCleanupRight = endOfPillarX - emptySpaceOnRight - 1;
// Create sections of pillar
for (int x2 = startOfPillarX; x2 <= endOfPillarX; x2++)
{
// Check if there are too many walls in a line (this ends the current pillar generation and moves to the next)
if (Main.tile[x2, y].WallType != WallID.None)
{
// Only try to kill further pillar gen if the gen is beyond the pillar's mid point minus 10 tiles
if (y > pillarCutOffCheckStart)
wallsDetected++;
if (wallsDetected > pillarCutOffSize)
{
tooManyWallsToPlacePillarRow = true;
break;
}
}
else
{
if (x2 >= startOfPillarX + emptySpaceOnLeft && x2 <= endOfPillarX - emptySpaceOnRight)
{
Main.tile[x2, y].WallType = pillarWallID;
// Blocks on top to hold the pillars
if (y < pillarTopTileSectionCutOff)
{
// Clean up walls at the top so it doesn't look ugly
if (x2 <= topTileSectionWallCleanupLeft || x2 >= topTileSectionWallCleanupRight || y == pillarIndexStarY)
Main.tile[x2, y].WallType = WallID.None;
Main.tile[x2, y].Get<TileWallWireStateData>().HasTile = true;
Main.tile[x2, y].TileType = pillarTileID;
}
}
}
}
// Break out if too many walls are already in place
if (tooManyWallsToPlacePillarRow)
break;
else
wallsDetected = 0;
if (y < pillarMidPointY)
{
// Becomes more likely to become thinner the further down the pillar is before the mid point
pillarY++;
int chance = pillarY / 3;
if (chance < 2)
chance = 2;
if (!WorldGen.genRand.NextBool(chance))
{
switch (WorldGen.genRand.Next(4))
{
default:
break;
case 0:
pillarLeftSize--;
break;
case 1:
pillarRightSize--;
break;
case 2:
pillarLeftSize--;
pillarRightSize--;
break;
}
// Cap the min width of each side of the pillar
if (pillarLeftSize < pillarMinWidthPerSide)
pillarLeftSize = pillarMinWidthPerSide;
if (pillarRightSize < pillarMinWidthPerSide)
pillarRightSize = pillarMinWidthPerSide;
}
}
else
{
// Becomes more likely to become thicker the further down the pillar is beyond the mid point
pillarY -= 2;
int chance = pillarY;
if (chance < 2)
chance = 2;
if (WorldGen.genRand.NextBool(chance))
{
switch (WorldGen.genRand.Next(4))
{
default:
break;
case 0:
pillarLeftSize++;
break;
case 1:
pillarRightSize++;
break;
case 2:
pillarLeftSize++;
pillarRightSize++;
break;
}
// Cap the max width of each side of the pillar
if (pillarLeftSize > pillarMaxWidthPerSide)
pillarLeftSize = pillarMaxWidthPerSide;
if (pillarRightSize > pillarMaxWidthPerSide)
pillarRightSize = pillarMaxWidthPerSide;
}
}
}
}
// Drunk world ash grass and trees
if (WorldGen.drunkWorldGen)
{
@@ -770,7 +946,7 @@ namespace CalamityMod.World
if (!WorldGen.remixWorldGen)
{
// Generate some small houses on the ash island
// Generate some structures on the ash island
int ashIslandX = (int)((double)Main.maxTilesX * (WorldGen.remixWorldGen ? 0.38 : 0.36));
int ashIslandX2 = (int)((double)Main.maxTilesX * (WorldGen.remixWorldGen ? 0.62 : 0.64));
int ashIslandDistance = ashIslandX2 - ashIslandX;
@@ -1180,11 +1356,23 @@ namespace CalamityMod.World
y = (paintingPlacementY + paintingPlacementY2) / 2;
}
// Clamp this due to out of bounds errors
y = (int)MathHelper.Clamp(y, 1, Main.maxTilesY - 1);
paintingPlacementX = x;
paintingPlacementX2 = x;
while (!Main.tile[paintingPlacementX, y].HasTile && !Main.tile[paintingPlacementX, y - 1].HasTile && !Main.tile[paintingPlacementX, y + 1].HasTile)
{
paintingPlacementX--;
// Ensure we don't get out of bounds errors
if (paintingPlacementX < 0)
{
paintingPlacementX = 0;
break;
}
}
paintingPlacementX++;
for (; !Main.tile[paintingPlacementX2, y].HasTile && !Main.tile[paintingPlacementX2, y - 1].HasTile && !Main.tile[paintingPlacementX2, y + 1].HasTile; paintingPlacementX2++)
{