Merge of new Sulphur Sea worldgen
No files matched your search
@@ -36,7 +36,7 @@ namespace CalamityMod.BiomeManagers
|
||||
if (WeakReferenceSupport.InAnySubworld())
|
||||
return false;
|
||||
|
||||
return point.Y > (Main.rockLayer - y * 0.05) &&
|
||||
return point.Y > SulphurousSea.YStart + SulphurousSea.BlockDepth - 78 &&
|
||||
!player.lavaWet &&
|
||||
!player.honeyWet &&
|
||||
abyssPosY &&
|
||||
|
||||
@@ -80,6 +80,7 @@ namespace CalamityMod.CalPlayer
|
||||
public static bool areThereAnyDamnEvents = false;
|
||||
public bool drawBossHPBar = true;
|
||||
public float stealthUIAlpha = 1f;
|
||||
public float SulphWaterUIOpacity = 1f;
|
||||
public bool shouldDrawSmallText = true;
|
||||
public int projTypeJustHitBy;
|
||||
public int sCalDeathCount = 0;
|
||||
@@ -195,7 +196,6 @@ namespace CalamityMod.CalPlayer
|
||||
public int modStealthTimer;
|
||||
public int dashTimeMod;
|
||||
public int hInfernoBoost = 0;
|
||||
public int pissWaterBoost = 0;
|
||||
public int packetTimer = 0;
|
||||
public int navyRodAuraTimer = 0;
|
||||
public int brimLoreInfernoTimer = 0;
|
||||
@@ -226,6 +226,7 @@ namespace CalamityMod.CalPlayer
|
||||
public int spiritOriginBullseyeShootCountdown = 0;
|
||||
public int spiritOriginConvertedCrit = 0;
|
||||
public int RustyMedallionCooldown = 0;
|
||||
public float SulphWaterPoisoningLevel;
|
||||
|
||||
private const int DashDisableCooldown = 12;
|
||||
|
||||
@@ -776,6 +777,9 @@ namespace CalamityMod.CalPlayer
|
||||
public bool banishingFire = false;
|
||||
public bool wither = false;
|
||||
public bool ManaBurn = false;
|
||||
|
||||
public const int SulphSeaWaterSafetyTime = 720;
|
||||
public const int SulphSeaWaterRecoveryTime = 150;
|
||||
#endregion
|
||||
|
||||
#region Buff
|
||||
@@ -2120,6 +2124,7 @@ namespace CalamityMod.CalPlayer
|
||||
fungalSymbioteTimer = 0;
|
||||
aBulwarkRareTimer = 0;
|
||||
RustyMedallionCooldown = 0;
|
||||
SulphWaterPoisoningLevel = 0f;
|
||||
spiritOriginConvertedCrit = 0;
|
||||
rage = 0f;
|
||||
adrenaline = 0f;
|
||||
@@ -2212,6 +2217,8 @@ namespace CalamityMod.CalPlayer
|
||||
stealthUIAlpha -= 0.035f;
|
||||
stealthUIAlpha = MathHelper.Clamp(stealthUIAlpha, 0f, 1f);
|
||||
}
|
||||
if (SulphWaterUIOpacity > 0f)
|
||||
SulphWaterUIOpacity = MathHelper.Clamp(SulphWaterUIOpacity - 0.035f, 0f, 1f);
|
||||
#endregion
|
||||
|
||||
#region Buffs
|
||||
|
||||
@@ -9,6 +9,9 @@ using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Systems;
|
||||
using System.Linq;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
@@ -156,39 +159,31 @@ namespace CalamityMod.CalPlayer
|
||||
lifeRegenLost += 4;
|
||||
}
|
||||
|
||||
if (ZoneSulphur && Player.IsUnderwater() && !decayEffigy && !abyssalDivingSuit && !Player.lavaWet && !Player.honeyWet)
|
||||
// Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player starts taking damage over time.
|
||||
bool nearSafeZone = false;
|
||||
if (SulphuricWaterSafeZoneSystem.NearbySafeTiles.Count >= 1)
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<SulphuricPoisoning>(), 2, true);
|
||||
pissWaterBoost++;
|
||||
Point closestSafeZone = SulphuricWaterSafeZoneSystem.NearbySafeTiles.Keys.OrderBy(t => t.ToVector2().DistanceSQ(Player.Center / 16f)).First();
|
||||
if (Vector2.Distance(Player.Center.ToTileCoordinates().ToVector2(), closestSafeZone.ToVector2()) < SulphuricWaterSafeZoneSystem.NearbySafeTiles[closestSafeZone] * 17f)
|
||||
nearSafeZone = true;
|
||||
}
|
||||
if (ZoneSulphur && Player.IsUnderwater() && !decayEffigy && !abyssalDivingSuit && !Player.lavaWet && !Player.honeyWet && !nearSafeZone)
|
||||
{
|
||||
float increment = 1f / SulphSeaWaterSafetyTime;
|
||||
if (sulphurskin)
|
||||
increment *= 0.5f;
|
||||
if (sulfurSet)
|
||||
increment *= 0.5f;
|
||||
|
||||
if (Player.lifeRegen > 0)
|
||||
Player.lifeRegen = 0;
|
||||
|
||||
Player.lifeRegenTime = 0;
|
||||
int waterDivisor = 250;
|
||||
int minimumRegenLost = 8;
|
||||
if (sulfurSet && sulphurskin)
|
||||
SulphWaterPoisoningLevel = MathHelper.Clamp(SulphWaterPoisoningLevel + increment, 0f, 1f);
|
||||
if (SulphWaterPoisoningLevel >= 1f)
|
||||
{
|
||||
waterDivisor = 500;
|
||||
minimumRegenLost = 1;
|
||||
SulphWaterPoisoningLevel = 0f;
|
||||
Player.Hurt(PlayerDeathReason.ByCustomReason($"{Player.name}'s flesh was dissolved by sulphuric water."), Math.Min(Player.statLifeMax2 / 2, 200), 0);
|
||||
}
|
||||
else if (sulfurSet)
|
||||
{
|
||||
waterDivisor = 400;
|
||||
minimumRegenLost = 3;
|
||||
}
|
||||
else if (sulphurskin)
|
||||
{
|
||||
waterDivisor = 350;
|
||||
minimumRegenLost = 2;
|
||||
}
|
||||
int sulphurWater = pissWaterBoost / waterDivisor;
|
||||
if (sulphurWater < minimumRegenLost)
|
||||
sulphurWater = minimumRegenLost;
|
||||
lifeRegenLost += sulphurWater;
|
||||
}
|
||||
else
|
||||
pissWaterBoost = 0;
|
||||
SulphWaterPoisoningLevel = MathHelper.Clamp(SulphWaterPoisoningLevel - 1f / SulphSeaWaterRecoveryTime, 0f, 1f);
|
||||
|
||||
if (sulphurPoison)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@ using Terraria.ModLoader.Config;
|
||||
using CalamityMod.Items.PermanentBoosters;
|
||||
using CalamityMod.UI.Rippers;
|
||||
using CalamityMod.UI.DraedonsArsenal;
|
||||
using CalamityMod.UI.SulphurousWaterMeter;
|
||||
|
||||
namespace CalamityMod
|
||||
{
|
||||
@@ -140,6 +141,22 @@ namespace CalamityMod
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.StealthMeterPosY")]
|
||||
public float StealthMeterPosY { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.SulphuricWaterMeterPosX")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(SulphurousWaterMeterUI.DefaultPosX)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.SulphuricWaterMeterPosX")]
|
||||
public float SulphuricWaterMeterPosX { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.SulphuricWaterMeterPosY")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(SulphurousWaterMeterUI.DefaultPosY)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.SulphuricWaterMeterPosY")]
|
||||
public float SulphuricWaterMeterPosY { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.ChargeMeter")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
@@ -394,6 +411,9 @@ namespace CalamityMod
|
||||
new("StealthMeterPosX", ItemID.LaserRuler),
|
||||
new("StealthMeterPosY", ItemID.LaserRuler),
|
||||
|
||||
new("SulphuricWaterMeterPosX", ItemID.LaserRuler),
|
||||
new("SulphuricWaterMeterPosY", ItemID.LaserRuler),
|
||||
|
||||
new("ChargeMeter", ModContent.ItemType<DraedonPowerCell>()),
|
||||
new("ChargeMeterPosX", ItemID.LaserRuler),
|
||||
new("ChargeMeterPosY", ItemID.LaserRuler),
|
||||
|
||||
@@ -54,9 +54,10 @@ namespace CalamityMod.ILEditing
|
||||
On.Terraria.Main.DrawInfernoRings += DrawForegroundParticles;
|
||||
On.Terraria.Main.SetDisplayMode += ResetRenderTargetSizes;
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.DrawPartialLiquid += DrawCustomLava;
|
||||
IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw += DrawCustomLava2;
|
||||
IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw += ChangeWaterQuadColors;
|
||||
IL.Terraria.Main.oldDrawWater += DrawCustomLava3;
|
||||
IL.Terraria.Player.CollectTaxes += MakeTaxCollectorUseful;
|
||||
On.Terraria.Graphics.Light.TileLightScanner.GetTileLight += MakeSulphSeaWaterBetter;
|
||||
On.Terraria.Main.DrawGore += DrawForegroundStuff;
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.PreDrawTiles += ClearForegroundStuff;
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.Draw += ClearTilePings;
|
||||
@@ -165,9 +166,10 @@ namespace CalamityMod.ILEditing
|
||||
On.Terraria.Main.DrawInfernoRings -= DrawForegroundParticles;
|
||||
On.Terraria.Main.SetDisplayMode -= ResetRenderTargetSizes;
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.DrawPartialLiquid -= DrawCustomLava;
|
||||
IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw -= DrawCustomLava2;
|
||||
IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw -= ChangeWaterQuadColors;
|
||||
IL.Terraria.Main.oldDrawWater -= DrawCustomLava3;
|
||||
IL.Terraria.Player.CollectTaxes -= MakeTaxCollectorUseful;
|
||||
On.Terraria.Graphics.Light.TileLightScanner.GetTileLight -= MakeSulphSeaWaterBetter;
|
||||
// IL.Terraria.WaterfallManager.DrawWaterfall -= DrawCustomLavafalls;
|
||||
On.Terraria.NPC.Collision_DecideFallThroughPlatforms -= EnableCalamityBossPlatformCollision;
|
||||
IL.Terraria.Wiring.HitWireSingle -= AddTwinklersToStatue;
|
||||
|
||||
@@ -5,6 +5,10 @@ using MonoMod.Cil;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Audio;
|
||||
using CalamityMod.Systems;
|
||||
using Terraria.Graphics;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace CalamityMod.ILEditing
|
||||
{
|
||||
@@ -110,6 +114,41 @@ namespace CalamityMod.ILEditing
|
||||
return initialLightColor;
|
||||
}
|
||||
|
||||
private static void SelectSulphuricWaterColor(int x, int y, ref VertexColors initialColor)
|
||||
{
|
||||
if (SulphuricWaterSafeZoneSystem.NearbySafeTiles.Count >= 1)
|
||||
{
|
||||
Color cleanWaterColor = new(10, 62, 193);
|
||||
Point closestSafeZone = SulphuricWaterSafeZoneSystem.NearbySafeTiles.Keys.OrderBy(t => t.ToVector2().DistanceSQ(new(x, y))).First();
|
||||
List<Vector2> points = new()
|
||||
{
|
||||
new Vector2(x - 0.5f, y - 0.5f),
|
||||
new Vector2(x + 0.5f, y - 0.5f),
|
||||
new Vector2(x - 0.5f, y + 0.5f),
|
||||
new Vector2(x + 0.5f, y + 0.5f),
|
||||
};
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
float distanceToClosest = points[i].Distance(closestSafeZone.ToVector2());
|
||||
float acidicWaterInterpolant = Utils.GetLerpValue(12f, 20.5f, distanceToClosest + (1f - SulphuricWaterSafeZoneSystem.NearbySafeTiles[closestSafeZone]) * 21f, true);
|
||||
if (i == 0)
|
||||
initialColor.TopLeftColor = Color.Lerp(initialColor.TopLeftColor, cleanWaterColor, 1f - acidicWaterInterpolant);
|
||||
if (i == 1)
|
||||
initialColor.TopRightColor = Color.Lerp(initialColor.TopRightColor, cleanWaterColor, 1f - acidicWaterInterpolant);
|
||||
if (i == 2)
|
||||
initialColor.BottomLeftColor = Color.Lerp(initialColor.BottomLeftColor, cleanWaterColor, 1f - acidicWaterInterpolant);
|
||||
if (i == 3)
|
||||
initialColor.BottomRightColor = Color.Lerp(initialColor.BottomRightColor, cleanWaterColor, 1f - acidicWaterInterpolant);
|
||||
}
|
||||
}
|
||||
|
||||
initialColor.TopLeftColor *= 0.4f;
|
||||
initialColor.TopRightColor *= 0.4f;
|
||||
initialColor.BottomLeftColor *= 0.4f;
|
||||
initialColor.BottomRightColor *= 0.4f;
|
||||
}
|
||||
|
||||
public static void DumpToLog(ILContext il) => CalamityMod.Instance.Logger.Debug(il.ToString());
|
||||
public static void LogFailure(string name, string reason) => CalamityMod.Instance.Logger.Warn($"IL edit \"{name}\" failed! {reason}");
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ using Terraria.GameContent.Events;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Particles.Metaballs;
|
||||
using Terraria.GameContent.Drawing;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CalamityMod.ILEditing
|
||||
{
|
||||
@@ -746,7 +748,7 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawCustomLava2(ILContext il)
|
||||
private static void ChangeWaterQuadColors(ILContext il)
|
||||
{
|
||||
ILCursor cursor = new ILCursor(il);
|
||||
|
||||
@@ -778,12 +780,17 @@ namespace CalamityMod.ILEditing
|
||||
cursor.Emit(OpCodes.Ldloc, 8);
|
||||
cursor.Emit(OpCodes.Ldelem_Ref);
|
||||
cursor.Emit(OpCodes.Ldloc, 8);
|
||||
cursor.EmitDelegate<Func<VertexColors, Texture2D, int, VertexColors>>((initialColor, initialTexture, liquidType) =>
|
||||
cursor.Emit(OpCodes.Ldloc, 3);
|
||||
cursor.Emit(OpCodes.Ldloc, 4);
|
||||
cursor.EmitDelegate<Func<VertexColors, Texture2D, int, int, int, VertexColors>>((initialColor, initialTexture, liquidType, x, y) =>
|
||||
{
|
||||
initialColor.TopLeftColor = SelectLavaColor(initialTexture, initialColor.TopLeftColor, liquidType == 1);
|
||||
initialColor.TopRightColor = SelectLavaColor(initialTexture, initialColor.TopRightColor, liquidType == 1);
|
||||
initialColor.BottomLeftColor = SelectLavaColor(initialTexture, initialColor.BottomLeftColor, liquidType == 1);
|
||||
initialColor.BottomRightColor = SelectLavaColor(initialTexture, initialColor.BottomRightColor, liquidType == 1);
|
||||
if (liquidType == ModContent.Find<ModWaterStyle>("CalamityMod/SulphuricWater").Slot)
|
||||
SelectSulphuricWaterColor(x, y, ref initialColor);
|
||||
|
||||
return initialColor;
|
||||
});
|
||||
}
|
||||
@@ -877,6 +884,27 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
#endregion Custom Lava Visuals
|
||||
|
||||
#region Sulph Sea Water Visuals
|
||||
private static void MakeSulphSeaWaterBetter(On.Terraria.Graphics.Light.TileLightScanner.orig_GetTileLight orig, TileLightScanner self, int x, int y, out Vector3 outputColor)
|
||||
{
|
||||
orig(self, x, y, out outputColor);
|
||||
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
|
||||
if (tile.LiquidAmount <= 0 || tile.HasTile || Main.waterStyle != ModContent.Find<ModWaterStyle>("CalamityMod/SulphuricWater").Slot)
|
||||
return;
|
||||
|
||||
Tile above = CalamityUtils.ParanoidTileRetrieval(x, y - 1);
|
||||
if (!Main.gamePaused && !above.HasTile && above.LiquidAmount <= 0 && Main.rand.NextBool(9))
|
||||
{
|
||||
MediumMistParticle acidFoam = new(new(x * 16f + Main.rand.NextFloat(16f), y * 16f + 8f), -Vector2.UnitY.RotatedByRandom(0.67f) * Main.rand.NextFloat(1f, 2.4f), Color.LightSeaGreen, Color.White, 0.16f, 128f, 0.02f);
|
||||
GeneralParticleHandler.SpawnParticle(acidFoam);
|
||||
}
|
||||
|
||||
if (tile.TileType != (ushort)ModContent.TileType<RustyChestTile>())
|
||||
outputColor = Vector3.Lerp(outputColor, Color.LightSeaGreen.ToVector3(), 0.41f);
|
||||
}
|
||||
#endregion Sulph Sea Water Visuals
|
||||
|
||||
#region Statue Additions
|
||||
/// <summary>
|
||||
/// Change the following code sequence in Wiring.HitWireSingle
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CalamityMod.ILEditing
|
||||
|
||||
cursor.EmitDelegate<Action>(() =>
|
||||
{
|
||||
WorldGen.dungeonX = Utils.Clamp(WorldGen.dungeonX, SulphurousSea.BiomeWidth + 100, Main.maxTilesX - SulphurousSea.BiomeWidth - 100);
|
||||
WorldGen.dungeonX = Utils.Clamp(WorldGen.dungeonX, SulphurousSea.BiomeWidth + 167, Main.maxTilesX - SulphurousSea.BiomeWidth - 167);
|
||||
|
||||
// Adjust the Y position of the dungeon to accomodate for the X shift.
|
||||
WorldUtils.Find(new Point(WorldGen.dungeonX, WorldGen.dungeonY), Searches.Chain(new Searches.Down(9001), new Conditions.IsSolid()), out Point result);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Placeables
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.createTile = ModContent.TileType<Tiles.Abyss.SulphurousSandNoWater>();
|
||||
Item.createTile = ModContent.TileType<Tiles.Abyss.SulphurousSand>();
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.useTurn = true;
|
||||
Item.useAnimation = 15;
|
||||
|
||||
@@ -56,6 +56,8 @@ Config:
|
||||
"StealthMeter": "Display Stealth Meter",
|
||||
"StealthMeterPosX": "Stealth Meter X Position",
|
||||
"StealthMeterPosY": "Stealth Meter Y Position",
|
||||
"SulphuricWaterMeterPosX": "Sulphuric Water Poison Meter X Position",
|
||||
"SulphuricWaterMeterPosY": "Sulphuric Water Poison Meter Y Position",
|
||||
"TownNPCSpawnRateMultiplier": "Town NPC Spawn Rate Multiplier",
|
||||
"TownNPCsSpawnAtNight": "Town NPCs Spawn at Night",
|
||||
"VanillaCooldownDisplay": "Display Vanilla Cooldowns",
|
||||
@@ -102,6 +104,8 @@ Config:
|
||||
"StealthMeter": "Enables the Stealth Meter UI, which shows the player's current stealth level.\nThe Stealth Meter is always hidden if not wearing Rogue armor.",
|
||||
"StealthMeterPosX": "The X position of the Stealth Meter, measured as a % of your screen width.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.",
|
||||
"StealthMeterPosY": "The Y position of the Stealth Meter, measured as a % of your screen height.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.",
|
||||
"SulphuricWaterMeterPosX": "The X position of the Sulphuric Water Poison Meter, measured as a % of your screen width.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.",
|
||||
"SulphuricWaterMeterPosY": "The Y position of the Sulphuric Water Poison Meter, measured as a % of your screen height.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.",
|
||||
"TownNPCSpawnRateMultiplier": "Directly multiply the rate at which town NPCs spawn and respawn.\nThis reduces waiting times if a boss or event wipes your whole town.",
|
||||
"TownNPCsSpawnAtNight": "When enabled, town NPCs can spawn and respawn at night.\nThis includes the Old Man.",
|
||||
"VanillaCooldownDisplay": "Adds the vanilla debuffs Potion Sickness and Chaos State to the Cooldown Rack.\nThis doesn't remove them from your buff list, but can help with visibility nontheless",
|
||||
|
||||
@@ -13,12 +13,29 @@ using Terraria.GameContent.Bestiary;
|
||||
using Terraria.GameContent.ItemDropRules;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.NPCs.AcidRain
|
||||
{
|
||||
public class NuclearToad : ModNPC
|
||||
{
|
||||
public Player Target => Main.player[NPC.target];
|
||||
|
||||
public static float ExplosionStartRadius
|
||||
{
|
||||
get
|
||||
{
|
||||
float explodeDistance = DownedBossSystem.downedAquaticScourge ? 360f : 270f;
|
||||
if (DownedBossSystem.downedPolterghast)
|
||||
explodeDistance = 560f;
|
||||
return explodeDistance;
|
||||
}
|
||||
}
|
||||
|
||||
public ref float ExplosionTimer => ref NPC.ai[0];
|
||||
|
||||
public const float ExplosionTelegraphTime = 120f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Nuclear Toad");
|
||||
@@ -69,8 +86,8 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
{
|
||||
bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] {
|
||||
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("When threatened underwater they rapidly inflate and bob to the surface. As a last resort, they forcefully burst themselves. Their selfless goal is the prolonged survival of their kin.")
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("When threatened underwater they rapidly inflate and bob to the surface. As a last resort, they forcefully burst themselves. Their selfless goal is the prolonged survival of their kin.")
|
||||
});
|
||||
}
|
||||
|
||||
@@ -97,24 +114,22 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
NPC.velocity.Y += 0.16f;
|
||||
if (NPC.velocity.Y > 3f)
|
||||
NPC.velocity.Y = 3f;
|
||||
NPC.ai[0] = 5f;
|
||||
}
|
||||
|
||||
// Make a frog croak sound from time to time.
|
||||
if (Main.rand.NextBool(480))
|
||||
SoundEngine.PlaySound(SoundID.Zombie13, NPC.Center);
|
||||
|
||||
float explodeDistance = DownedBossSystem.downedAquaticScourge ? 295f : 195f;
|
||||
if (DownedBossSystem.downedPolterghast)
|
||||
explodeDistance = 470f;
|
||||
|
||||
// Explode if a player gets too close.
|
||||
if (NPC.WithinRange(Target.Center, explodeDistance))
|
||||
if (NPC.WithinRange(Target.Center, ExplosionStartRadius) || ExplosionTimer >= 1f)
|
||||
ExplosionTimer++;
|
||||
|
||||
if (ExplosionTimer >= ExplosionTelegraphTime)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int damage = Main.expertMode ? DownedBossSystem.downedAquaticScourge ? 21 : 8 : DownedBossSystem.downedAquaticScourge ? 27 : 10;
|
||||
float speed = Main.rand.NextFloat(6f, 9f);
|
||||
float speed = Main.rand.NextFloat(8f, 12f);
|
||||
if (DownedBossSystem.downedPolterghast)
|
||||
{
|
||||
speed *= 1.8f;
|
||||
@@ -122,7 +137,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
}
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Main.rand.NextVector2CircularEdge(speed, speed), ModContent.ProjectileType<NuclearToadGoo>(), damage, 1f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -Vector2.UnitY.RotatedByRandom(0.79f) * speed * Main.rand.NextFloat(0.8f, 1f), ModContent.ProjectileType<NuclearToadGoo>(), damage, 1f);
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.DD2_KoboldExplosion, NPC.Center);
|
||||
NPC.life = 0;
|
||||
@@ -132,6 +147,14 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color drawColor)
|
||||
{
|
||||
float explosionInterpolant = ExplosionTimer / ExplosionTelegraphTime;
|
||||
float fadeToRed = (float)Math.Abs(Math.Sin(MathHelper.Pi * Math.Pow(explosionInterpolant, 3D) * 6f));
|
||||
Color c = Color.Lerp(drawColor, new(232, 40, 12, 0), fadeToRed * 0.75f);
|
||||
return c * NPC.Opacity;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
NPC.frameCounter++;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
NPC.aiStyle = AIType = -1;
|
||||
|
||||
NPC.damage = 12;
|
||||
NPC.lifeMax = 70;
|
||||
NPC.lifeMax = 50;
|
||||
NPC.defense = 6;
|
||||
NPC.knockBackResist = 1f;
|
||||
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
using CalamityMod.BiomeManagers;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.AquaticScourge
|
||||
{
|
||||
public class AquaticUrchin : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Aquatic Urchin");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.aiStyle = -1;
|
||||
AIType = -1;
|
||||
NPC.damage = Main.hardMode ? 50 : 25;
|
||||
NPC.width = 40;
|
||||
NPC.height = 40;
|
||||
NPC.defense = 10;
|
||||
NPC.lifeMax = Main.hardMode ? 300 : 50;
|
||||
NPC.knockBackResist = 0.8f;
|
||||
NPC.value = Item.buyPrice(0, 0, 0, 80);
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath15;
|
||||
NPC.behindTiles = true;
|
||||
Banner = NPC.type;
|
||||
BannerItem = ModContent.ItemType<AquaticUrchinBanner>();
|
||||
NPC.Calamity().VulnerableToHeat = false;
|
||||
NPC.Calamity().VulnerableToSickness = false;
|
||||
NPC.Calamity().VulnerableToElectricity = true;
|
||||
NPC.Calamity().VulnerableToWater = false;
|
||||
SpawnModBiomes = new int[1] { ModContent.GetInstance<SulphurousSeaBiome>().Type };
|
||||
}
|
||||
|
||||
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
|
||||
{
|
||||
bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] {
|
||||
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("A relative of its brethren in the far ocean, this one’s spines have been hardened by the sulphuric waters. They drip with the venom they inhabit, so it’s better to not be struck by them.")
|
||||
});
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityAI.UnicornAI(NPC, Mod, true, NPC.wet ? 12f : 4f, NPC.wet ? 7f : 3f, NPC.wet ? 0.12f : 0.05f, NPC.wet ? -16f : -7.5f, NPC.wet ? -14f : -6.5f, NPC.wet ? -13f : -6f, NPC.wet ? -12f : -5f, NPC.wet ? -15f : -7f);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
if (damage > 0)
|
||||
player.AddBuff(ModContent.BuffType<Irradiated>(), 120, true);
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.PlayerSafe)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water && NPC.CountNPCS(ModContent.NPCType<AquaticUrchin>()) < 2)
|
||||
{
|
||||
return 0.2f;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ModContent.ItemType<UrchinStinger>(), 1, 15, 25);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
if (NPC.life <= 0)
|
||||
{
|
||||
for (int k = 0; k < 20; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("AquaticUrchin").Type, 1f);
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("AquaticUrchin2").Type, 1f);
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("AquaticUrchin3").Type, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2435,7 +2435,7 @@ namespace CalamityMod.NPCs
|
||||
spriteBatch.Draw(texture,
|
||||
npc.Center - screenOffset + offset,
|
||||
npc.frame,
|
||||
Color.White,
|
||||
npc.GetAlpha(Color.White),
|
||||
npc.rotation,
|
||||
npc.frame.Size() * 0.5f,
|
||||
npc.scale,
|
||||
|
||||
@@ -866,6 +866,9 @@ namespace CalamityMod.NPCs
|
||||
EoWKill.Add(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
npcLoot.AddNormalOnly(EoWKill);
|
||||
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddIf((info) => info.npc.boss, ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Master items drop in Revengeance
|
||||
rev.AddIf((info) => info.npc.boss, ItemID.EaterofWorldsMasterTrophy);
|
||||
rev.AddIf((info) => info.npc.boss, ItemID.EaterOfWorldsPetItem, 4);
|
||||
@@ -887,7 +890,7 @@ namespace CalamityMod.NPCs
|
||||
// Expert+ drops are also available on Normal
|
||||
npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.BrainOfConfusion));
|
||||
|
||||
// Would be in the bag otherwise
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddNormalOnly(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Master items drop in Revengeance
|
||||
@@ -934,7 +937,7 @@ namespace CalamityMod.NPCs
|
||||
// Expert+ drops are also available on Normal
|
||||
npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.BoneHelm));
|
||||
|
||||
// Would be in the bag otherwise
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddNormalOnly(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Master items drop in Revengeance
|
||||
@@ -989,7 +992,7 @@ namespace CalamityMod.NPCs
|
||||
// Expert+ drops are also available on Normal
|
||||
npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.BoneGlove));
|
||||
|
||||
// Would be in the bag otherwise
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddNormalOnly(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Master items drop in Revengeance
|
||||
@@ -1068,7 +1071,7 @@ namespace CalamityMod.NPCs
|
||||
// However, Demon Heart does not work in Normal mode, so it's best to not drop it
|
||||
// npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.DemonHeart));
|
||||
|
||||
// Would be in the bag otherwise
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddNormalOnly(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// WoF drops Evil Keys
|
||||
@@ -1089,7 +1092,7 @@ namespace CalamityMod.NPCs
|
||||
npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.VolatileGelatin));
|
||||
npcLoot.AddNormalOnly(ItemID.SoulofLight, 1, 15, 20);
|
||||
|
||||
// Would be in the bag otherwise
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddNormalOnly(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Queen Slime drops the Hallowed Key
|
||||
@@ -1111,7 +1114,7 @@ namespace CalamityMod.NPCs
|
||||
// Expert+ drops are also available on Normal
|
||||
npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.MechanicalWagonPiece));
|
||||
|
||||
// Would be in the bag otherwise
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddNormalOnly(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Master items drop in Revengeance
|
||||
@@ -1150,7 +1153,7 @@ namespace CalamityMod.NPCs
|
||||
npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ItemID.MechanicalWheelPiece);
|
||||
npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ModContent.ItemType<Arbalest>(), 10);
|
||||
|
||||
// Would be in the bag otherwise
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Master items drop in Revengeance
|
||||
@@ -1172,7 +1175,7 @@ namespace CalamityMod.NPCs
|
||||
// Expert+ drops are also available on Normal
|
||||
npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.MechanicalBatteryPiece));
|
||||
|
||||
// Would be in the bag otherwise
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddNormalOnly(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Master items drop in Revengeance
|
||||
@@ -1414,7 +1417,7 @@ namespace CalamityMod.NPCs
|
||||
// Expert+ drops are also available on Normal
|
||||
npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.EmpressFlightBooster));
|
||||
|
||||
// Would be in the bag otherwise
|
||||
// Would be in the bag otherwise
|
||||
npcLoot.AddNormalOnly(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
|
||||
// Master items drop in Revengeance
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
using CalamityMod.BiomeManagers;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.WorldBuilding;
|
||||
|
||||
namespace CalamityMod.NPCs.SulphurousSea
|
||||
{
|
||||
public class AquaticUrchin : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Aquatic Urchin");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.aiStyle = -1;
|
||||
AIType = -1;
|
||||
NPC.damage = Main.hardMode ? 50 : 25;
|
||||
NPC.width = 20;
|
||||
NPC.height = 20;
|
||||
NPC.defense = 10;
|
||||
NPC.lifeMax = Main.hardMode ? 300 : 50;
|
||||
NPC.knockBackResist = 0.8f;
|
||||
NPC.value = Item.buyPrice(0, 0, 0, 80);
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath15;
|
||||
NPC.behindTiles = true;
|
||||
NPC.npcSlots = 0.3333f;
|
||||
Banner = NPC.type;
|
||||
BannerItem = ModContent.ItemType<AquaticUrchinBanner>();
|
||||
NPC.noGravity = true;
|
||||
NPC.noTileCollide = true;
|
||||
NPC.RemoveWaterSlowness();
|
||||
NPC.Calamity().VulnerableToHeat = false;
|
||||
NPC.Calamity().VulnerableToSickness = false;
|
||||
NPC.Calamity().VulnerableToElectricity = true;
|
||||
NPC.Calamity().VulnerableToWater = false;
|
||||
SpawnModBiomes = new int[1] { ModContent.GetInstance<SulphurousSeaBiome>().Type };
|
||||
}
|
||||
|
||||
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
|
||||
{
|
||||
bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] {
|
||||
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("A relative of its brethren in the far ocean, this one’s spines have been hardened by the sulphuric waters. They drip with the venom they inhabit, so it’s better to not be struck by them.")
|
||||
});
|
||||
}
|
||||
|
||||
public static void DoUrchinAI(NPC npc)
|
||||
{
|
||||
// Simply stick to tiles.
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 0f)
|
||||
{
|
||||
GenSearch search = Main.rand.NextBool() ? new Searches.Down(300) : new Searches.Up(300);
|
||||
if (WorldUtils.Find(npc.Center.ToTileCoordinates(), Searches.Chain(search, new Conditions.IsSolid()), out Point result))
|
||||
{
|
||||
npc.Center = result.ToWorldCoordinates();
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
npc.localAI[0] = 1f;
|
||||
}
|
||||
|
||||
// Drift slowly over tiles.
|
||||
float speedFactor = 0.018f;
|
||||
|
||||
npc.collideX = MathHelper.Distance(npc.position.X, npc.oldPosition.X) < 0.01f;
|
||||
npc.collideY = MathHelper.Distance(npc.position.Y, npc.oldPosition.Y) < 0.01f;
|
||||
npc.noGravity = Collision.SolidCollision(npc.TopLeft - Vector2.One * 12, npc.width + 6, npc.height + 6);
|
||||
if (npc.ai[1] == 0f)
|
||||
{
|
||||
if (npc.direction == 0)
|
||||
npc.direction = 1;
|
||||
|
||||
npc.rotation += npc.direction * npc.directionY * speedFactor * 0.006f;
|
||||
if (npc.collideY)
|
||||
npc.ai[0] = 2f;
|
||||
|
||||
if (!npc.collideY && npc.ai[0] == 2f)
|
||||
{
|
||||
npc.direction = -npc.direction;
|
||||
npc.ai[1] = 1f;
|
||||
npc.ai[0] = 1f;
|
||||
}
|
||||
if (npc.collideX)
|
||||
{
|
||||
npc.directionY = -npc.directionY;
|
||||
npc.ai[1] = 1f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.rotation -= npc.direction * npc.directionY * 0.006f;
|
||||
if (npc.collideX)
|
||||
npc.ai[0] = 2f;
|
||||
|
||||
if (!npc.collideX && npc.ai[0] == 2f)
|
||||
{
|
||||
npc.directionY = -npc.directionY;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[0] = 1f;
|
||||
}
|
||||
if (npc.collideY)
|
||||
{
|
||||
npc.direction = -npc.direction;
|
||||
npc.ai[1] = 0f;
|
||||
}
|
||||
}
|
||||
npc.velocity.X = npc.direction * speedFactor;
|
||||
|
||||
if (npc.noGravity)
|
||||
npc.velocity.Y = npc.directionY * speedFactor;
|
||||
|
||||
// Use blazing wheel movement.
|
||||
Vector2 position = npc.Center - Vector2.One * 6f;
|
||||
npc.velocity = Collision.noSlopeCollision(position, npc.velocity, 12, 12, true, true);
|
||||
}
|
||||
|
||||
public override void AI() => DoUrchinAI(NPC);
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
if (damage > 0)
|
||||
player.AddBuff(ModContent.BuffType<Irradiated>(), 120, true);
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.PlayerSafe)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water && NPC.CountNPCS(ModContent.NPCType<AquaticUrchin>()) < 12)
|
||||
{
|
||||
return 1.1f;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ModContent.ItemType<UrchinStinger>(), 1, 15, 25);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
if (NPC.life <= 0)
|
||||
{
|
||||
for (int k = 0; k < 20; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("AquaticUrchin").Type, 1f);
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("AquaticUrchin2").Type, 1f);
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("AquaticUrchin3").Type, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
@@ -48,8 +48,8 @@ namespace CalamityMod.NPCs.SulphurousSea
|
||||
{
|
||||
bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] {
|
||||
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("An animal which adapted to the toxic waters quite naturally. It uses its whiskers to find its way, and its prey in the murky depths.")
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("An animal which adapted to the toxic waters quite naturally. It uses its whiskers to find its way, and its prey in the murky depths.")
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Dusts;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Enemy
|
||||
Projectile.localAI[0] = 1f;
|
||||
}
|
||||
if (Projectile.velocity.Y < 10f)
|
||||
Projectile.velocity.Y += 0.175f;
|
||||
Projectile.velocity.Y += 0.27f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit)
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Enemy
|
||||
Projectile.scale = 0.01f;
|
||||
Projectile.hostile = true;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.Opacity = 0f;
|
||||
Projectile.timeLeft = 360;
|
||||
Projectile.penetrate = 1;
|
||||
|
||||
@@ -1,36 +1,45 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Environment
|
||||
{
|
||||
public class HotSteam : ModProjectile
|
||||
public class HotSteam : ModProjectile, IAdditiveDrawer
|
||||
{
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
public const int Lifetime = 180;
|
||||
|
||||
public override string Texture => "CalamityMod/Projectiles/Summon/SmallAresArms/MinionPlasmaGas";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Steam");
|
||||
|
||||
// This prevents the water from creating a universal distortion wherever it lands, thus making the geysers look weird.
|
||||
ProjectileID.Sets.NoLiquidDistortion[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 40;
|
||||
Projectile.height = 40;
|
||||
Projectile.width = Projectile.height = 184;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.hostile = true;
|
||||
Projectile.tileCollide = true;
|
||||
Projectile.ignoreWater = false;
|
||||
Projectile.timeLeft = 30;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.timeLeft = Lifetime;
|
||||
Projectile.hide = true;
|
||||
Projectile.localAI[0] = 1f;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 4);
|
||||
dust.velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi);
|
||||
dust.alpha = 127;
|
||||
}
|
||||
Projectile.localAI[0] = 0f;
|
||||
Projectile.scale = Utils.Remap(Projectile.timeLeft, Lifetime, 0.4f, 0.02f, 1.4f);
|
||||
Projectile.Opacity = Utils.Remap(Projectile.timeLeft, 160f, 50f, 1.15f, 0.01f);
|
||||
Projectile.velocity.Y *= 0.97f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, int damage, bool crit)
|
||||
@@ -40,5 +49,26 @@ namespace CalamityMod.Projectiles.Environment
|
||||
|
||||
target.AddBuff(BuffID.Poisoned, 180);
|
||||
}
|
||||
|
||||
public override bool? CanDamage() => Projectile.Opacity > 0.6f ? null : false;
|
||||
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
|
||||
{
|
||||
return CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.scale * 92f, targetHitbox);
|
||||
}
|
||||
|
||||
public void AdditiveDraw(SpriteBatch spriteBatch)
|
||||
{
|
||||
if (Projectile.localAI[0] == 1f)
|
||||
return;
|
||||
|
||||
Texture2D texture = TextureAssets.Projectile[Projectile.type].Value;
|
||||
Vector2 origin = texture.Size() * 0.5f;
|
||||
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
|
||||
float opacity = Projectile.Opacity * 0.3f;
|
||||
Color drawColor = new Color(159, 207, 181) * opacity;
|
||||
Vector2 scale = Projectile.Size / texture.Size() * Projectile.scale * 1.35f;
|
||||
spriteBatch.Draw(texture, drawPosition, null, drawColor, Projectile.rotation, origin, scale, 0, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -556,6 +556,7 @@ namespace CalamityMod.Schematics
|
||||
{
|
||||
ModContent.SplitName(tileFullName, out string mod, out string tileName);
|
||||
Mod theMod = ModLoader.GetMod(mod);
|
||||
|
||||
// If that mod isn't loaded, spawn in a TML default UnloadedTile instead.
|
||||
smt.TileType = (ushort)(theMod is null ? ModContent.TileType<UnloadedTile>() : theMod.Find<ModTile>(tileName).Type);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace CalamityMod.Systems
|
||||
BrimstoneCragTiles = tileCounts[ModContent.TileType<CharredOre>()] + tileCounts[ModContent.TileType<BrimstoneSlag>()];
|
||||
SunkenSeaTiles = tileCounts[ModContent.TileType<EutrophicSand>()] + tileCounts[ModContent.TileType<Navystone>()] + tileCounts[ModContent.TileType<SeaPrism>()];
|
||||
AbyssTiles = tileCounts[ModContent.TileType<AbyssGravel>()] + tileCounts[ModContent.TileType<Voidstone>()];
|
||||
SulphurTiles = tileCounts[ModContent.TileType<SulphurousSand>()] + tileCounts[ModContent.TileType<SulphurousSandNoWater>()] + tileCounts[ModContent.TileType<SulphurousSandstone>()] + tileCounts[ModContent.TileType<HardenedSulphurousSandstone>()];
|
||||
SulphurTiles = tileCounts[ModContent.TileType<SulphurousSand>()] + tileCounts[ModContent.TileType<SulphurousSandstone>()] + tileCounts[ModContent.TileType<HardenedSulphurousSandstone>()];
|
||||
|
||||
int astralDesertTiles = tileCounts[ModContent.TileType<AstralSand>()] + tileCounts[ModContent.TileType<AstralSandstone>()] + tileCounts[ModContent.TileType<HardenedAstralSand>()] + tileCounts[ModContent.TileType<CelestialRemains>()];
|
||||
int astralSnowTiles = tileCounts[ModContent.TileType<AstralIce>()] + tileCounts[ModContent.TileType<AstralSnow>()];
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace CalamityMod
|
||||
BossRushEvent.HostileProjectileKillCounter = 0;
|
||||
CustomTemple.NewAlterPosition = Point.Zero;
|
||||
Abyss.AbyssChasmBottom = 0;
|
||||
SulphurousSea.YStart = 0;
|
||||
Abyss.AtLeftSideOfWorld = false;
|
||||
|
||||
spawnedBandit = false;
|
||||
@@ -130,6 +131,7 @@ namespace CalamityMod
|
||||
|
||||
tag["downed"] = downed;
|
||||
tag["abyssChasmBottom"] = Abyss.AbyssChasmBottom;
|
||||
tag["SulphSeaYStart"] = SulphurousSea.YStart;
|
||||
tag["acidRainPoints"] = AcidRainEvent.AccumulatedKillPoints;
|
||||
tag["Reforges"] = Reforges;
|
||||
tag["MoneyStolenByBandit"] = MoneyStolenByBandit;
|
||||
@@ -176,6 +178,7 @@ namespace CalamityMod
|
||||
RecipeUnlockHandler.Load(downed);
|
||||
|
||||
Abyss.AbyssChasmBottom = tag.GetInt("abyssChasmBottom");
|
||||
SulphurousSea.YStart = tag.GetInt("SulphSeaYStart");
|
||||
AcidRainEvent.AccumulatedKillPoints = tag.GetInt("acidRainPoints");
|
||||
Reforges = tag.GetInt("Reforges");
|
||||
MoneyStolenByBandit = tag.GetInt("MoneyStolenByBandit");
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Tiles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Systems
|
||||
{
|
||||
public class SulphuricWaterSafeZoneSystem : ModSystem
|
||||
{
|
||||
public static Dictionary<Point, float> NearbySafeTiles
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = new();
|
||||
|
||||
public override void PreUpdateEntities()
|
||||
{
|
||||
// Make the potency of the current safe tiles gradually dissipate, and eventually disappear from the dictionary once completely gone.
|
||||
foreach (Point p in NearbySafeTiles.Keys)
|
||||
NearbySafeTiles[p] -= 0.06f;
|
||||
foreach (var key in NearbySafeTiles.Keys.Where(key => NearbySafeTiles[key] <= 0f))
|
||||
NearbySafeTiles.Remove(key);
|
||||
|
||||
// TODO -- Uncomment the below code to use an actual block and not the auric tesla bar, once sprites for said blocks are created.
|
||||
|
||||
/*
|
||||
ushort safeTileID = (ushort)ModContent.TileType<AuricTeslaBar>();
|
||||
Point center = Main.LocalPlayer.Center.ToTileCoordinates();
|
||||
|
||||
for (int dx = -56; dx < 56; dx++)
|
||||
{
|
||||
for (int dy = -56; dy < 56; dy++)
|
||||
{
|
||||
Point p = new(center.X + dx, center.Y + dy);
|
||||
Tile t = Main.tile[p];
|
||||
|
||||
if (!t.HasTile)
|
||||
continue;
|
||||
|
||||
if (t.TileType != safeTileID)
|
||||
continue;
|
||||
|
||||
NearbySafeTiles[p] = 1f;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using CalamityMod.UI.DraedonsArsenal;
|
||||
using CalamityMod.UI.DraedonSummoning;
|
||||
using CalamityMod.UI.ModeIndicator;
|
||||
using CalamityMod.UI.Rippers;
|
||||
using CalamityMod.UI.SulphurousWaterMeter;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -89,6 +90,13 @@ namespace CalamityMod.Systems
|
||||
return true;
|
||||
}, InterfaceScaleType.None));
|
||||
|
||||
// Sulphuric water poison bar
|
||||
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Sulphuric Water Poisoning UI", () =>
|
||||
{
|
||||
SulphurousWaterMeterUI.Draw(Main.spriteBatch, Main.LocalPlayer);
|
||||
return true;
|
||||
}, InterfaceScaleType.None));
|
||||
|
||||
// Charge meter
|
||||
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Charge UI", () =>
|
||||
{
|
||||
|
||||
@@ -140,6 +140,7 @@ namespace CalamityMod.Systems
|
||||
RecipeUnlockHandler.SendData(writer);
|
||||
|
||||
writer.Write(Abyss.AbyssChasmBottom);
|
||||
writer.Write(SulphurousSea.YStart);
|
||||
writer.Write(AcidRainEvent.AccumulatedKillPoints);
|
||||
writer.Write(Reforges);
|
||||
writer.Write(MoneyStolenByBandit);
|
||||
@@ -271,6 +272,7 @@ namespace CalamityMod.Systems
|
||||
RecipeUnlockHandler.ReceiveData(reader);
|
||||
|
||||
Abyss.AbyssChasmBottom = reader.ReadInt32();
|
||||
SulphurousSea.YStart = reader.ReadInt32();
|
||||
AcidRainEvent.AccumulatedKillPoints = reader.ReadInt32();
|
||||
Reforges = reader.ReadInt32();
|
||||
MoneyStolenByBandit = reader.ReadInt32();
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace CalamityMod.Systems
|
||||
tasks.Insert(++currentFinalIndex, new PassLegacy("SulphurSea2", (progress, config) =>
|
||||
{
|
||||
progress.Message = "Further polluting one of the oceans";
|
||||
SulphurousSea.FinishGeneratingSulphurSea();
|
||||
SulphurousSea.SulphurSeaGenerationAfterAbyss();
|
||||
}));
|
||||
|
||||
tasks.Insert(++currentFinalIndex, new PassLegacy("Roxcalibur", (progress, config) =>
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
// Grows on sulphurous sand
|
||||
GrowsOnTileId = new int[2] { ModContent.TileType<SulphurousSand>() , ModContent.TileType<SulphurousSandNoWater>()};
|
||||
GrowsOnTileId = new int[] { ModContent.TileType<SulphurousSand>() };
|
||||
}
|
||||
|
||||
//Copypasted from vanilla, just as ExampleMod did, due to the lack of proper explanation
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 };
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.AnchorValidTiles = new[] { ModContent.TileType<SulphurousSand>(), ModContent.TileType<SulphurousSandNoWater>(), ModContent.TileType<HardenedSulphurousSandstone>(), ModContent.TileType<SulphurousSandstone>() };
|
||||
TileObjectData.newTile.AnchorValidTiles = new[] { ModContent.TileType<SulphurousSand>(), ModContent.TileType<HardenedSulphurousSandstone>(), ModContent.TileType<SulphurousSandstone>() };
|
||||
TileObjectData.newTile.StyleHorizontal = true;
|
||||
TileObjectData.newTile.DrawFlipHorizontal = true;
|
||||
TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -57,7 +58,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.tile[i, j + 1] != null && nearbyVineCount < 5)
|
||||
if (Main.tile[i, j + 1] != null && nearbyVineCount < 5 && j >= SulphurousSea.VineGrowTopLimit)
|
||||
{
|
||||
if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType<SulphurousVines>())
|
||||
{
|
||||
|
||||
|
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 254 B |
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 246 B |
|
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 268 B |
|
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 555 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 700 B After Width: | Height: | Size: 324 B |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.Abyss.Stalactite
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.newTile.DrawYOffset = -2;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Stalactite");
|
||||
|
||||
|
Before Width: | Height: | Size: 448 B After Width: | Height: | Size: 256 B |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.Abyss.Stalactite
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.newTile.DrawYOffset = -2;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Stalactite");
|
||||
|
||||
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 245 B |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.Tiles.Abyss.Stalactite
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.newTile.DrawYOffset = -2;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Stalactite");
|
||||
|
||||
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 269 B |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.Tiles.Abyss.Stalactite
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.newTile.DrawYOffset = -2;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Stalactite");
|
||||
|
||||
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 283 B |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Abyss.Stalactite
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.newTile.DrawYOffset = -2;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Stalactite");
|
||||
|
||||
|
Before Width: | Height: | Size: 583 B After Width: | Height: | Size: 288 B |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Abyss.Stalactite
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.newTile.DrawYOffset = -2;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Stalactite");
|
||||
|
||||
|
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 320 B |
@@ -1,7 +1,7 @@
|
||||
using CalamityMod.Dusts;
|
||||
using System;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Projectiles.Environment;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ModLoader;
|
||||
@@ -16,7 +16,6 @@ namespace CalamityMod.Tiles.Abyss
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileNoAttach[Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
|
||||
TileObjectData.newTile.DrawYOffset = 4;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Geyser");
|
||||
@@ -34,18 +33,15 @@ namespace CalamityMod.Tiles.Abyss
|
||||
}
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
bool noTilesBetweenPlayer = Collision.CanHit(new Vector2(i, j) * 16, 1, 1, new Vector2(i * 16f, Main.LocalPlayer.Center.Y), 1, 1);
|
||||
Tile t = CalamityUtils.ParanoidTileRetrieval(i, j);
|
||||
|
||||
if (WorldGen.genRand.NextBool(60) && !Main.gamePaused && noTilesBetweenPlayer)
|
||||
Vector2 spawnPosition = new(i * 16f + 24f, j * 16f - 4f);
|
||||
if (!Main.gamePaused && t.TileFrameX % 36 == 0 && t.TileFrameY % 36 == 0 && Collision.CanHitLine(spawnPosition, 1, 1, spawnPosition - Vector2.UnitY * 100f, 1, 1))
|
||||
{
|
||||
if (Math.Abs(Main.LocalPlayer.Center.X - i * 16) < 80 &&
|
||||
Main.LocalPlayer.Bottom.Y < j * 16 &&
|
||||
Main.LocalPlayer.Bottom.Y > j * 16 - 300)
|
||||
{
|
||||
float yeetSpeed = MathHelper.Clamp(10f - (10f * Math.Abs(Main.LocalPlayer.Bottom.Y - j * 16) / 300f), 0f, 10f);
|
||||
Main.LocalPlayer.velocity.Y -= yeetSpeed;
|
||||
Projectile.NewProjectile(new EntitySource_WorldEvent(), i * 16 + 8, j * 16 - 20, 0f, -10f, ModContent.ProjectileType<HotSteam>(), Main.expertMode ? 12 : 15, 0f);
|
||||
}
|
||||
float positionInterpolant = (i + j) * 0.041f % 1f;
|
||||
Vector2 smokeVelocity = -Vector2.UnitY.RotatedByRandom(0.11f) * MathHelper.Lerp(4.8f, 8.1f, positionInterpolant);
|
||||
smokeVelocity.X += (float)Math.Cos(MathHelper.TwoPi * positionInterpolant) * 1.1f;
|
||||
Projectile.NewProjectile(new EntitySource_WorldEvent(), spawnPosition, smokeVelocity, ModContent.ProjectileType<HotSteam>(), Main.expertMode ? 12 : 15, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 949 B After Width: | Height: | Size: 547 B |
|
Before Width: | Height: | Size: 915 B After Width: | Height: | Size: 385 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 408 B |
|
Before Width: | Height: | Size: 935 B After Width: | Height: | Size: 378 B |
@@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
// Grows on sulphurous sand
|
||||
GrowsOnTileId = new int[2] { ModContent.TileType<SulphurousSand>(), ModContent.TileType<SulphurousSandNoWater>() };
|
||||
GrowsOnTileId = new int[] { ModContent.TileType<SulphurousSand>() };
|
||||
}
|
||||
|
||||
public override Asset<Texture2D> GetTexture() => ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/SulphurousCactus");
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
TileObjectData.newTile.Width = 2;
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(1, 2);
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.CoordinateHeights = new int[]
|
||||
{
|
||||
@@ -32,7 +32,6 @@ namespace CalamityMod.Tiles.Abyss
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
AddMapEntry(new Color(150, 100, 50), name);
|
||||
@@ -41,16 +40,28 @@ namespace CalamityMod.Tiles.Abyss
|
||||
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
Tile t = CalamityUtils.ParanoidTileRetrieval(i, j);
|
||||
Tile left = CalamityUtils.ParanoidTileRetrieval(i - 1, j);
|
||||
Tile right = CalamityUtils.ParanoidTileRetrieval(i + 1, j);
|
||||
if (t.TileFrameX % 36 == 0 && !right.HasTile)
|
||||
WorldGen.KillTile(i, j);
|
||||
if (t.TileFrameX % 36 == 18 && !left.HasTile)
|
||||
WorldGen.KillTile(i, j);
|
||||
}
|
||||
|
||||
public override void KillMultiTile(int i, int j, int frameX, int frameY)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
return;
|
||||
|
||||
// Explode into a bunch of rocks when broken.
|
||||
for (int k = 0; k < WorldGen.genRand.Next(3, 4 + 1); k++)
|
||||
{
|
||||
for (int k = 0; k < WorldGen.genRand.Next(3, 4 + 1); k++)
|
||||
{
|
||||
Gore.NewGore(new EntitySource_TileBreak(i, j), new Vector2(i, j) * 16f,
|
||||
Vector2.One.RotatedByRandom(MathHelper.TwoPi) * WorldGen.genRand.NextFloat(1.4f, 3.2f),
|
||||
Mod.Find<ModGore>($"SulphurousRockGore{WorldGen.genRand.Next(3) + 1}").Type);
|
||||
}
|
||||
int goreID = Mod.Find<ModGore>($"SulphurousRockGore{WorldGen.genRand.Next(3) + 1}").Type;
|
||||
Gore.NewGore(new EntitySource_TileBreak(i, j), new Vector2(i, j) * 16f, Main.rand.NextVector2Unit() * WorldGen.genRand.NextFloat(1.4f, 3.2f), goreID);
|
||||
}
|
||||
}
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 750 B |
|
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 293 B |
|
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 257 B |
|
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 264 B |
|
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 203 B |
@@ -1,6 +1,6 @@
|
||||
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Enemy;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -9,6 +9,10 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Tiles.Abyss
|
||||
{
|
||||
// Old, now deleted sub-variant of sulphurous sand that was only placed by players and did not create water.
|
||||
// It would create block swap issues with regular sulphurous sand and was rendered obsolete with the removal of this tile's water emission mechanic.
|
||||
// For compatibility reasons (including with schematics), however, that tile is converted into this one.
|
||||
[LegacyName("SulphurousSandNoWater")]
|
||||
public class SulphurousSand : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
@@ -32,89 +36,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
{
|
||||
num = fail ? 1 : 3;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (i < 250 && i > 150)
|
||||
{
|
||||
if (!closer)
|
||||
{
|
||||
if (Main.tile[i - 1, j] != null)
|
||||
{
|
||||
if (!Main.tile[i - 1, j].HasTile)
|
||||
{
|
||||
if (Main.tile[i - 1, j].LiquidAmount <= 128)
|
||||
{
|
||||
Main.tile[i - 1, j].LiquidAmount = 255;
|
||||
Main.tile[i - 1, j].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.tile[i - 2, j] != null)
|
||||
{
|
||||
if (!Main.tile[i - 2, j].HasTile)
|
||||
{
|
||||
if (Main.tile[i - 2, j].LiquidAmount <= 128)
|
||||
{
|
||||
Main.tile[i - 2, j].LiquidAmount = 255;
|
||||
Main.tile[i - 2, j].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.tile[i - 3, j] != null)
|
||||
{
|
||||
if (!Main.tile[i - 3, j].HasTile)
|
||||
{
|
||||
if (Main.tile[i - 3, j].LiquidAmount <= 128)
|
||||
{
|
||||
Main.tile[i - 3, j].LiquidAmount = 255;
|
||||
Main.tile[i - 3, j].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (i > Main.maxTilesX - 250 && i < Main.maxTilesX - 150)
|
||||
{
|
||||
if (!closer)
|
||||
{
|
||||
if (Main.tile[i + 1, j] != null)
|
||||
{
|
||||
if (!Main.tile[i + 1, j].HasTile)
|
||||
{
|
||||
if (Main.tile[i + 1, j].LiquidAmount <= 128)
|
||||
{
|
||||
Main.tile[i + 1, j].LiquidAmount = 255;
|
||||
Main.tile[i + 1, j].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.tile[i + 2, j] != null)
|
||||
{
|
||||
if (!Main.tile[i + 2, j].HasTile)
|
||||
{
|
||||
if (Main.tile[i + 2, j].LiquidAmount <= 128)
|
||||
{
|
||||
Main.tile[i + 2, j].LiquidAmount = 255;
|
||||
Main.tile[i + 2, j].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.tile[i + 3, j] != null)
|
||||
{
|
||||
if (!Main.tile[i + 3, j].HasTile)
|
||||
{
|
||||
if (Main.tile[i + 3, j].LiquidAmount <= 128)
|
||||
{
|
||||
Main.tile[i + 3, j].LiquidAmount = 255;
|
||||
Main.tile[i + 3, j].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem)
|
||||
{
|
||||
if (CalamityUtils.ParanoidTileRetrieval(i, j + 1).HasTile &&
|
||||
@@ -131,7 +53,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
if (!Main.tile[i, tileLocationY].HasTile)
|
||||
{
|
||||
if (!CalamityPlayer.areThereAnyDamnBosses && Main.tile[i, tileLocationY].LiquidAmount == 255 && Main.tile[i, tileLocationY - 1].LiquidAmount == 255 &&
|
||||
Main.tile[i, tileLocationY - 2].LiquidAmount == 255 && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
Main.tile[i, tileLocationY - 2].LiquidAmount == 255 && !Main.tile[i, tileLocationY - 2].HasTile && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Projectile.NewProjectile(new EntitySource_WorldEvent(), (float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, ModContent.ProjectileType<SulphuricAcidBubble>(), 0, 2f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
@@ -210,7 +132,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.tile[i, j + 1] != null && nearbyVineCount < 5)
|
||||
if (Main.tile[i, j + 1] != null && nearbyVineCount < 5 && j >= SulphurousSea.VineGrowTopLimit)
|
||||
{
|
||||
if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType<SulphurousVines>())
|
||||
{
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Tiles.Abyss
|
||||
{
|
||||
public class SulphurousSandNoWater : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileBlockLight[Type] = true;
|
||||
|
||||
CalamityUtils.MergeWithGeneral(Type);
|
||||
CalamityUtils.MergeWithAbyss(Type);
|
||||
|
||||
TileID.Sets.CanBeDugByShovel[Type] = true;
|
||||
|
||||
DustType = 32;
|
||||
ItemDrop = ModContent.ItemType<Items.Placeables.SulphurousSand>();
|
||||
AddMapEntry(new Color(150, 100, 50));
|
||||
MineResist = 1f;
|
||||
HitSound = SoundID.Dig;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 1 : 3;
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<SulphurousSandstone>(), false, false, false, false, resetFrame);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 19 KiB |
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -57,7 +58,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.tile[i, j + 1] != null && nearbyVineCount < 5)
|
||||
if (Main.tile[i, j + 1] != null && nearbyVineCount < 5 && j >= SulphurousSea.VineGrowTopLimit)
|
||||
{
|
||||
if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType<SulphurousVines>())
|
||||
{
|
||||
|
||||
|
After Width: | Height: | Size: 166 B |
|
After Width: | Height: | Size: 298 B |
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.UI.SulphurousWaterMeter
|
||||
{
|
||||
public class SulphurousWaterMeterUI : ModSystem
|
||||
{
|
||||
// These values were decided relative to the stealth meter positions, and are by default slightly below them.
|
||||
internal const float DefaultPosX = StealthUI.DefaultStealthPosX;
|
||||
internal const float DefaultPosY = StealthUI.DefaultStealthPosY + 0.0377f;
|
||||
private const float MouseDragEpsilon = 0.05f; // 0.05%
|
||||
|
||||
private static Vector2? dragOffset = null;
|
||||
private static Texture2D edgeTexture, barTexture;
|
||||
|
||||
public override void OnModLoad()
|
||||
{
|
||||
edgeTexture = ModContent.Request<Texture2D>("CalamityMod/UI/SulphurousWaterMeter/SulphWaterMeter", AssetRequestMode.ImmediateLoad).Value;
|
||||
barTexture = ModContent.Request<Texture2D>("CalamityMod/UI/SulphurousWaterMeter/SulphWaterBar", AssetRequestMode.ImmediateLoad).Value;
|
||||
Reset();
|
||||
}
|
||||
|
||||
public override void Unload()
|
||||
{
|
||||
Reset();
|
||||
edgeTexture = barTexture = null;
|
||||
}
|
||||
|
||||
private static void Reset() => dragOffset = null;
|
||||
|
||||
public static void Draw(SpriteBatch spriteBatch, Player player)
|
||||
{
|
||||
// Sanity check the planned position before drawing. This is done relative.
|
||||
Vector2 screenRatioPosition = new Vector2(CalamityConfig.Instance.SulphuricWaterMeterPosX, CalamityConfig.Instance.SulphuricWaterMeterPosY);
|
||||
if (screenRatioPosition.X < 0f || screenRatioPosition.X > 100f)
|
||||
screenRatioPosition.X = DefaultPosX;
|
||||
if (screenRatioPosition.Y < 0f || screenRatioPosition.Y > 100f)
|
||||
screenRatioPosition.Y = DefaultPosY;
|
||||
|
||||
// Convert the screen ratio position to an absolute position in pixels
|
||||
// Cast to integer to prevent blurriness which results from decimal pixel positions
|
||||
float uiScale = Main.UIScale;
|
||||
Vector2 screenPos = screenRatioPosition;
|
||||
screenPos.X = (int)(screenPos.X * 0.01f * Main.screenWidth);
|
||||
screenPos.Y = (int)(screenPos.Y * 0.01f * Main.screenHeight);
|
||||
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
// If not drawing the water meter, save its latest position to config and leave.
|
||||
if (modPlayer.SulphWaterUIOpacity > 0f)
|
||||
DrawWaterBar(spriteBatch, modPlayer, screenPos);
|
||||
else
|
||||
{
|
||||
bool changed = false;
|
||||
if (CalamityConfig.Instance.SulphuricWaterMeterPosX != screenRatioPosition.X)
|
||||
{
|
||||
CalamityConfig.Instance.SulphuricWaterMeterPosX = screenRatioPosition.X;
|
||||
changed = true;
|
||||
}
|
||||
if (CalamityConfig.Instance.SulphuricWaterMeterPosY != screenRatioPosition.Y)
|
||||
{
|
||||
CalamityConfig.Instance.SulphuricWaterMeterPosY = screenRatioPosition.Y;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed)
|
||||
CalamityMod.SaveConfig(CalamityConfig.Instance);
|
||||
}
|
||||
|
||||
Rectangle mouseHitbox = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 8, 8);
|
||||
Rectangle waterBarArea = Utils.CenteredRectangle(screenPos, edgeTexture.Size() * uiScale);
|
||||
|
||||
MouseState ms = Mouse.GetState();
|
||||
Vector2 mousePos = Main.MouseScreen;
|
||||
|
||||
// Handle mouse dragging
|
||||
if (waterBarArea.Intersects(mouseHitbox))
|
||||
{
|
||||
if (!CalamityConfig.Instance.MeterPosLock)
|
||||
Main.LocalPlayer.mouseInterface = true;
|
||||
|
||||
// If the mouse is on top of the meter, show the player's accumulated sulphuric poisoning.
|
||||
if (modPlayer.SulphWaterPoisoningLevel > 0f && modPlayer.SulphWaterUIOpacity >= 0f)
|
||||
{
|
||||
string poisonText = (modPlayer.SulphWaterPoisoningLevel * 100f).ToString("n2");
|
||||
string textToDisplay = $"Sulphuric Poisoning: {poisonText}/100";
|
||||
Main.instance.MouseText(textToDisplay, 0, 0, -1, -1, -1, -1);
|
||||
modPlayer.SulphWaterUIOpacity = MathHelper.Lerp(modPlayer.SulphWaterUIOpacity, 0.25f, 0.035f);
|
||||
}
|
||||
|
||||
Vector2 newScreenRatioPosition = screenRatioPosition;
|
||||
|
||||
// As long as the mouse button is held down, drag the meter along with an offset.
|
||||
if (!CalamityConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
|
||||
{
|
||||
// If the drag offset doesn't exist yet, create it.
|
||||
if (!dragOffset.HasValue)
|
||||
dragOffset = mousePos - screenPos;
|
||||
|
||||
// Given the mouse's absolute current position, compute where the corner of the water bar should be based on the original drag offset.
|
||||
Vector2 newCorner = mousePos - dragOffset.GetValueOrDefault(Vector2.Zero);
|
||||
|
||||
// Convert the new corner position into a screen ratio position.
|
||||
newScreenRatioPosition.X = (100f * newCorner.X) / Main.screenWidth;
|
||||
newScreenRatioPosition.Y = (100f * newCorner.Y) / Main.screenHeight;
|
||||
}
|
||||
|
||||
// Compute the change in position. If it is large enough, actually move the meter
|
||||
Vector2 delta = newScreenRatioPosition - screenRatioPosition;
|
||||
if (Math.Abs(delta.X) >= MouseDragEpsilon || Math.Abs(delta.Y) >= MouseDragEpsilon)
|
||||
{
|
||||
CalamityConfig.Instance.SulphuricWaterMeterPosX = newScreenRatioPosition.X;
|
||||
CalamityConfig.Instance.SulphuricWaterMeterPosY = newScreenRatioPosition.Y;
|
||||
}
|
||||
|
||||
// When the mouse is released, save the config and destroy the drag offset.
|
||||
if (ms.LeftButton == ButtonState.Released)
|
||||
{
|
||||
dragOffset = null;
|
||||
CalamityMod.SaveConfig(CalamityConfig.Instance);
|
||||
}
|
||||
}
|
||||
else
|
||||
modPlayer.SulphWaterUIOpacity = MathHelper.Clamp(modPlayer.SulphWaterUIOpacity + (modPlayer.SulphWaterPoisoningLevel > 0f).ToDirectionInt() * 0.06f, 0f, 1f);
|
||||
}
|
||||
|
||||
private static void DrawWaterBar(SpriteBatch spriteBatch, CalamityPlayer modPlayer, Vector2 screenPos)
|
||||
{
|
||||
float uiScale = Main.UIScale;
|
||||
float offset = (edgeTexture.Width - barTexture.Width) * 0.5f;
|
||||
spriteBatch.Draw(edgeTexture, screenPos, null, Color.White * modPlayer.SulphWaterUIOpacity, 0f, edgeTexture.Size() * 0.5f, uiScale, SpriteEffects.None, 0);
|
||||
|
||||
float completionRatio = MathHelper.Clamp(modPlayer.SulphWaterPoisoningLevel, 0f, 1f);
|
||||
Rectangle barRectangle = new Rectangle(0, 0, (int)(barTexture.Width * completionRatio), barTexture.Width);
|
||||
spriteBatch.Draw(barTexture, screenPos + new Vector2(offset * uiScale, 0), barRectangle, Color.White * modPlayer.SulphWaterUIOpacity, 0f, edgeTexture.Size() * 0.5f, uiScale, SpriteEffects.None, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,6 @@ namespace CalamityMod
|
||||
/// <param name="y">The Y position on the map.</param>
|
||||
/// <param name="octaves">A metric of "instability" of the noise. The higher this is, the more unstable. Lower of bounds of 2-3 are preferable.</param>
|
||||
/// <param name="seed">The seed for the noise.</param>
|
||||
/// <returns></returns>
|
||||
public static float PerlinNoise2D(float x, float y, int octaves, int seed)
|
||||
{
|
||||
float SmoothFunction(float n) => 3f * n * n - 2f * n * n * n;
|
||||
|
||||
@@ -229,6 +229,21 @@ namespace CalamityMod
|
||||
return Main.tile[x, y];
|
||||
}
|
||||
|
||||
public static bool AnySolidTileInSelection(int x, int y, int width, int height)
|
||||
{
|
||||
for (int i = x; i != x + width; i += Math.Sign(width))
|
||||
{
|
||||
for (int j = y; j != y + height; j += Math.Sign(height))
|
||||
{
|
||||
if (WorldGen.InWorld(i, j))
|
||||
continue;
|
||||
if (WorldGen.SolidTile(Framing.GetTileSafely(i, j)))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool TileSelectionSolid(int x, int y, int width, int height)
|
||||
{
|
||||
for (int i = x; i != x + width; i += Math.Sign(width))
|
||||
|
||||
@@ -31,5 +31,42 @@ namespace CalamityMod
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Settles all liquids in the world.
|
||||
/// </summary>
|
||||
public static void SettleWater()
|
||||
{
|
||||
Liquid.worldGenTilesIgnoreWater(true);
|
||||
Liquid.QuickWater(3);
|
||||
WorldGen.WaterCheck();
|
||||
|
||||
Liquid.quickSettle = true;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
int maxLiquid = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer;
|
||||
int m = maxLiquid * 5;
|
||||
double maxLiquidDifferencePercentage = 0D;
|
||||
while (Liquid.numLiquid > 0)
|
||||
{
|
||||
m--;
|
||||
if (m < 0)
|
||||
break;
|
||||
|
||||
double liquidDifferencePercentage = (maxLiquid - Liquid.numLiquid - LiquidBuffer.numLiquidBuffer) / (double)maxLiquid;
|
||||
if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > maxLiquid)
|
||||
maxLiquid = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer;
|
||||
|
||||
if (liquidDifferencePercentage > maxLiquidDifferencePercentage)
|
||||
maxLiquidDifferencePercentage = liquidDifferencePercentage;
|
||||
|
||||
Liquid.UpdateLiquid();
|
||||
}
|
||||
WorldGen.WaterCheck();
|
||||
}
|
||||
Liquid.quickSettle = false;
|
||||
Liquid.worldGenTilesIgnoreWater(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,15 +13,6 @@ namespace CalamityMod.Walls
|
||||
AddMapEntry(new Color(84, 71, 46));
|
||||
}
|
||||
|
||||
public override void RandomUpdate(int i, int j)
|
||||
{
|
||||
if (Main.tile[i, j].LiquidAmount <= 0)
|
||||
{
|
||||
Main.tile[i, j].LiquidAmount = 255;
|
||||
Main.tile[i, j].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
}
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3;
|
||||
}
|
||||
}
|
||||
@@ -13,15 +13,6 @@ namespace CalamityMod.Walls
|
||||
AddMapEntry(new Color(57, 45, 38));
|
||||
}
|
||||
|
||||
public override void RandomUpdate(int i, int j)
|
||||
{
|
||||
if (Main.tile[i, j].LiquidAmount <= 0)
|
||||
{
|
||||
Main.tile[i, j].LiquidAmount = 255;
|
||||
Main.tile[i, j].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
}
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3;
|
||||
}
|
||||
}
|
||||
@@ -65,8 +65,8 @@ namespace CalamityMod.World
|
||||
do
|
||||
{
|
||||
xIslandGen = WorldGen.crimson ?
|
||||
WorldGen.genRand.Next((int)(x * 0.1), (int)(x * 0.2)) :
|
||||
WorldGen.genRand.Next((int)(x * 0.8), (int)(x * 0.9));
|
||||
WorldGen.genRand.Next((int)(x * 0.1), (int)(x * 0.3)) :
|
||||
WorldGen.genRand.Next((int)(x * 0.7), (int)(x * 0.9));
|
||||
yIslandGen = WorldGen.genRand.Next(95, 126);
|
||||
yIslandGen = Math.Min(yIslandGen, (int)WorldGen.worldSurfaceLow - 50);
|
||||
|
||||
|
||||