Star Struck Water + simplified Conversion
Also added back common conversions for evil solutions
This commit is contained in:
1 parent
f2c13839e7
commit
35caf1a9cd
5 files changed
+35
-132
No files matched your search
@@ -151,7 +151,6 @@ VictideSpirit.DisplayName: Bubbly Spirit
|
||||
VoidFieldGenerator.DisplayName: Void Field Generator
|
||||
WarbannerDamage.DisplayName: The Unmatched Power of the Sun
|
||||
WarbannerLight.DisplayName: Warbanner Light
|
||||
WaterConvertor.DisplayName: Water Convertor
|
||||
WhiteLabSeeker.DisplayName: Seeking Mechanism
|
||||
WulfrumBobber.DisplayName: Wulfrum Bobber
|
||||
WulfrumDiggingTurtleProjectile.DisplayName: Digging Turtle
|
||||
|
||||
@@ -4365,25 +4365,12 @@ namespace CalamityMod.Projectiles
|
||||
Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType<BloomStoneFlower>(), 0, 0f, projectile.owner, projectile.whoAmI);
|
||||
}
|
||||
|
||||
// optimization to remove conversion X/Y loop for irrelevant projectiles
|
||||
bool isConversionProjectile = projectile.type == ProjectileID.PurificationPowder
|
||||
|| projectile.type == ProjectileID.VilePowder
|
||||
|| projectile.type == ProjectileID.ViciousPowder
|
||||
|| projectile.type == ProjectileID.PureSpray
|
||||
|| projectile.type == ProjectileID.CorruptSpray
|
||||
|| projectile.type == ProjectileID.CrimsonSpray
|
||||
|| projectile.type == ProjectileID.HallowSpray
|
||||
|| projectile.type == ProjectileID.Fertilizer;
|
||||
if (!isConversionProjectile)
|
||||
return;
|
||||
|
||||
if (projectile.owner == Main.myPlayer/* && Main.netMode != NetmodeID.MultiplayerClient*/)
|
||||
// Fertilizer
|
||||
if (projectile.type == ProjectileID.Fertilizer && projectile.owner == Main.myPlayer/* && Main.netMode != NetmodeID.MultiplayerClient*/)
|
||||
{
|
||||
int x = (int)(projectile.Center.X / 16f);
|
||||
int y = (int)(projectile.Center.Y / 16f);
|
||||
|
||||
bool isPowder = projectile.type == ProjectileID.PurificationPowder || projectile.type == ProjectileID.VilePowder || projectile.type == ProjectileID.ViciousPowder;
|
||||
|
||||
if (!WorldGen.InWorld(x, y, 3))
|
||||
return;
|
||||
|
||||
@@ -4391,47 +4378,27 @@ namespace CalamityMod.Projectiles
|
||||
{
|
||||
for (int j = y - 1; j <= y + 1; j++)
|
||||
{
|
||||
if (projectile.type == ProjectileID.Fertilizer)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Tile tile = Main.tile[i, j];
|
||||
|
||||
if (tile.TileType == ModContent.TileType<AstralTreeSapling>() || tile.TileType == ModContent.TileType<AstralSnowTreeSapling>())
|
||||
{
|
||||
bool isPlayerNear = WorldGen.PlayerLOS(i, j);
|
||||
bool success = WorldGen.GrowTree(i, j);
|
||||
if (success && isPlayerNear)
|
||||
WorldGen.TreeGrowFXCheck(i, j);
|
||||
}
|
||||
else if (tile.TileType == ModContent.TileType<AstralPalmSapling>() || tile.TileType == ModContent.TileType<AcidWoodTreeSapling>())
|
||||
{
|
||||
bool isPlayerNear = WorldGen.PlayerLOS(i, j);
|
||||
bool success = WorldGen.GrowPalmTree(i, j);
|
||||
if (success && isPlayerNear)
|
||||
WorldGen.TreeGrowFXCheck(i, j);
|
||||
}
|
||||
else if (tile.TileType == ModContent.TileType<SpineSapling>())
|
||||
{
|
||||
bool isPlayerNear = WorldGen.PlayerLOS(i, j);
|
||||
if (isPlayerNear && Main.tile[i, j + 1].TileType != ModContent.TileType<SpineSapling>())
|
||||
SpineTree.Spawn(i, j, 22, 28, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (projectile.type == ProjectileID.PureSpray || projectile.type == ProjectileID.PurificationPowder)
|
||||
if (tile.TileType == ModContent.TileType<AstralTreeSapling>() || tile.TileType == ModContent.TileType<AstralSnowTreeSapling>())
|
||||
{
|
||||
AstralBiome.ConvertFromAstral(i, j, ConvertType.Pure, !isPowder);
|
||||
bool isPlayerNear = WorldGen.PlayerLOS(i, j);
|
||||
bool success = WorldGen.GrowTree(i, j);
|
||||
if (success && isPlayerNear)
|
||||
WorldGen.TreeGrowFXCheck(i, j);
|
||||
}
|
||||
if (projectile.type == ProjectileID.CorruptSpray || projectile.type == ProjectileID.VilePowder)
|
||||
else if (tile.TileType == ModContent.TileType<AstralPalmSapling>() || tile.TileType == ModContent.TileType<AcidWoodTreeSapling>())
|
||||
{
|
||||
AstralBiome.ConvertFromAstral(i, j, ConvertType.Corrupt, !isPowder);
|
||||
bool isPlayerNear = WorldGen.PlayerLOS(i, j);
|
||||
bool success = WorldGen.GrowPalmTree(i, j);
|
||||
if (success && isPlayerNear)
|
||||
WorldGen.TreeGrowFXCheck(i, j);
|
||||
}
|
||||
if (projectile.type == ProjectileID.CrimsonSpray || projectile.type == ProjectileID.ViciousPowder)
|
||||
else if (tile.TileType == ModContent.TileType<SpineSapling>())
|
||||
{
|
||||
AstralBiome.ConvertFromAstral(i, j, ConvertType.Crimson, !isPowder);
|
||||
}
|
||||
if (projectile.type == ProjectileID.HallowSpray)
|
||||
{
|
||||
AstralBiome.ConvertFromAstral(i, j, ConvertType.Hallow);
|
||||
bool isPlayerNear = WorldGen.PlayerLOS(i, j);
|
||||
if (isPlayerNear && Main.tile[i, j + 1].TileType != ModContent.TileType<SpineSapling>())
|
||||
SpineTree.Spawn(i, j, 22, 28, true);
|
||||
}
|
||||
NetMessage.SendTileSquare(-1, i, j, 1, 1);
|
||||
}
|
||||
@@ -5231,15 +5198,6 @@ namespace CalamityMod.Projectiles
|
||||
modPlayer.scuttlerCooldown = 30;
|
||||
}
|
||||
}
|
||||
|
||||
if (projectile.type == ProjectileID.UnholyWater)
|
||||
Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType<WaterConvertor>(), 0, 0f, projectile.owner, 1f);
|
||||
|
||||
if (projectile.type == ProjectileID.BloodWater)
|
||||
Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType<WaterConvertor>(), 0, 0f, projectile.owner, 2f);
|
||||
|
||||
if (projectile.type == ProjectileID.HolyWater)
|
||||
Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType<WaterConvertor>(), 0, 0f, projectile.owner, 3f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -12,6 +13,9 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public new string LocalizationCategory => "Projectiles.Typeless";
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Typeless/StarStruckWater";
|
||||
|
||||
public static int ConversionType;
|
||||
public override void SetStaticDefaults() => ConversionType = ModContent.GetInstance<AstralConversion>().Type;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 14;
|
||||
@@ -46,7 +50,12 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
dust.velocity.X *= 1.5f;
|
||||
dust.velocity *= 3f;
|
||||
}
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<WaterConvertor>(), 0, 0f, Projectile.owner, 4f);
|
||||
|
||||
if (Main.myPlayer == Projectile.owner)
|
||||
{
|
||||
Point tileCenter = Projectile.Center.ToTileCoordinates();
|
||||
WorldGen.Convert(tileCenter.X, tileCenter.Y, ConversionType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class WaterConvertor : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Typeless";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.width = 160;
|
||||
Projectile.height = 160;
|
||||
Projectile.friendly = true;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.timeLeft = 10;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
ConvertShit(Projectile);
|
||||
}
|
||||
|
||||
public override void PostAI()
|
||||
{
|
||||
ConvertShit(Projectile);
|
||||
}
|
||||
|
||||
public static void ConvertShit(Projectile projectile)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int x = (int)(projectile.Center.X / 16f);
|
||||
int y = (int)(projectile.Center.Y / 16f);
|
||||
for (int i = x - 5; i <= x + 5; i++)
|
||||
{
|
||||
for (int j = y - 5; j <= y + 5; j++)
|
||||
{
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
AstralBiome.ConvertFromAstral(i, j, ConvertType.Pure);
|
||||
}
|
||||
if (projectile.ai[0] == 1f)
|
||||
{
|
||||
AstralBiome.ConvertFromAstral(i, j, ConvertType.Corrupt);
|
||||
}
|
||||
if (projectile.ai[0] == 2f)
|
||||
{
|
||||
AstralBiome.ConvertFromAstral(i, j, ConvertType.Crimson);
|
||||
}
|
||||
if (projectile.ai[0] == 3f)
|
||||
{
|
||||
AstralBiome.ConvertFromAstral(i, j, ConvertType.Hallow);
|
||||
}
|
||||
if (projectile.ai[0] == 4f)
|
||||
{
|
||||
AstralBiome.ConvertToAstral(i, j);
|
||||
NetMessage.SendTileSquare(-1, i, j, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool? CanDamage() => false;
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,14 @@ namespace CalamityMod.World
|
||||
WallLoader.RegisterSimpleConversion(WallID.HardenedSand, Type, HardenedSandWallType);
|
||||
WallLoader.RegisterSimpleConversion(WallID.DesertFossil, Type, FossilWallType);
|
||||
WallLoader.RegisterSimpleConversion(WallID.LivingWoodUnsafe, Type, WoodWallType);
|
||||
|
||||
// Evil solutions cleanse back certain common/abundant Astral tiles
|
||||
TileLoader.RegisterConversion(DirtType, BiomeConversionID.Corruption, TileID.Dirt);
|
||||
TileLoader.RegisterConversion(DirtType, BiomeConversionID.Crimson, TileID.Dirt);
|
||||
TileLoader.RegisterConversion(DirtType, BiomeConversionID.Hallow, TileID.Dirt);
|
||||
TileLoader.RegisterConversion(SnowType, BiomeConversionID.Corruption, TileID.SnowBlock);
|
||||
TileLoader.RegisterConversion(SnowType, BiomeConversionID.Crimson, TileID.SnowBlock);
|
||||
TileLoader.RegisterConversion(SnowType, BiomeConversionID.Hallow, TileID.SnowBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user