Death Mode underworld geysers.
This commit is contained in:
1 parent
044dfced0c
commit
e878491d17
2 files changed
+75
-3
No files matched your search
@@ -501,5 +501,76 @@ namespace CalamityMod.Tiles
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, int type, bool closer)
|
||||
{
|
||||
if (Main.gamePaused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (CalamityWorld.death && !CalamityPlayer.areThereAnyDamnBosses)
|
||||
{
|
||||
if ((type == TileID.Ash || type == TileID.Hellstone) && closer)
|
||||
{
|
||||
if (j > Main.maxTilesY - 180 && j < Main.maxTilesY - 50)
|
||||
{
|
||||
if (Main.tile[i, j - 1] == null)
|
||||
Main.tile[i, j - 1] = new Tile();
|
||||
|
||||
Tile tileAboveAsh = Main.tile[i, j - 1];
|
||||
if (tileAboveAsh.liquidType() == 1 && !tileAboveAsh.active())
|
||||
{
|
||||
// Only shoot flames if tiles underneath are lava and if tiles above and below aren't active
|
||||
bool shootFlames = Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(300);
|
||||
if (shootFlames)
|
||||
{
|
||||
int lavaTilesAboveAsh = 0;
|
||||
int lavaTopY = 0;
|
||||
Tile lavaTop = new Tile();
|
||||
for (int k = j - 1; k > Main.maxTilesY - 180; k--)
|
||||
{
|
||||
if (!Main.tile[i, k].active() && Main.tile[i, k].liquidType() == 1)
|
||||
{
|
||||
if (lavaTilesAboveAsh < 5)
|
||||
lavaTilesAboveAsh++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lavaTilesAboveAsh == 5)
|
||||
{
|
||||
if (Main.tile[i, k] == null)
|
||||
Main.tile[i, k] = new Tile();
|
||||
|
||||
lavaTopY = k;
|
||||
lavaTop = Main.tile[i, k];
|
||||
}
|
||||
else
|
||||
shootFlames = false;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shootFlames)
|
||||
{
|
||||
for (int l = lavaTopY - 1; l > lavaTopY - 10; l--)
|
||||
{
|
||||
if (Main.tile[i, l].active())
|
||||
{
|
||||
shootFlames = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shootFlames)
|
||||
{
|
||||
float randomVelocity = Main.rand.NextFloat() + 0.5f;
|
||||
Projectile.NewProjectile((float)(i * 16), (float)(j * 16), 0f, -8f * randomVelocity, ProjectileID.GeyserTrap, 20, 2f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Enemy;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.Ores
|
||||
{
|
||||
@@ -42,14 +43,14 @@ namespace CalamityMod.Tiles.Ores
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (closer && Main.rand.Next(300) == 0)
|
||||
if (closer && Main.rand.NextBool(300))
|
||||
{
|
||||
int tileLocationY = j + 1;
|
||||
if (Main.tile[i, tileLocationY] != null)
|
||||
{
|
||||
if (!Main.tile[i, tileLocationY].active())
|
||||
{
|
||||
if (Main.netMode != 1)
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, 0.1f, ModContent.ProjectileType<LavaChunk>(), 25, 2f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user