npcs can get owned by auric land mine
This commit is contained in:
1 parent
f5b45f40cb
commit
abe4b83bd0
2 files changed
+14
-11
No files matched your search
@@ -691,18 +691,8 @@ namespace CalamityMod.CalPlayer
|
||||
SoundEngine.PlaySound(explode with { Pitch = 0.8f }, touchedTile.ToWorldCoordinates());
|
||||
GenericSparkle sparker = new GenericSparkle(touchedTile.ToWorldCoordinates(), Vector2.Zero, Color.Goldenrod, Color.Gold, 2.5f, 9, Main.rand.NextFloat(-0.01f, 0.01f), 2.68f);
|
||||
GeneralParticleHandler.SpawnParticle(sparker);
|
||||
//GeneralScreenShakePower = 200;
|
||||
Player.RemoveAllIFrames();
|
||||
Projectile.NewProjectile(new EntitySource_TileInteraction(Player, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType<AuricLandMineExplosion>(), 40000, 0f);
|
||||
//for (int i = 0; i < 3; i++)
|
||||
{
|
||||
/* int p = Projectile.NewProjectile(new EntitySource_TileInteraction(Player, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType<AresGaussNukeProjectileBoom>(), 0, 0f);
|
||||
Projectile explosion = Main.projectile[p];
|
||||
explosion.ai[1] = 560f + 90f;
|
||||
explosion.localAI[1] = 0.25f;
|
||||
explosion.Opacity = MathHelper.Lerp(0.18f, 0.6f, 0.2f) + Main.rand.NextFloat(-0.08f, 0.08f);
|
||||
explosion.netUpdate = true;*/
|
||||
}
|
||||
WorldGen.KillTile(touchedTile.X, touchedTile.Y, noItem: true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5318,11 +5318,12 @@ namespace CalamityMod.NPCs
|
||||
npc.velocity *= 0.9f;
|
||||
}
|
||||
|
||||
// Auric Ore/Repulsers reject Town NPCs and dummies
|
||||
// Auric Ore/Repulsers reject Town NPCs and dummies (Auric Land Mines work on them too)
|
||||
if ((NPCID.Sets.ActsLikeTownNPC[npc.type] || npc.townNPC) && !npc.dontTakeDamage || npc.type == NPCType<SuperDummyNPC>())
|
||||
{
|
||||
int auricOreID = TileType<AuricOre>();
|
||||
int auricRepulserID = TileType<AuricRepulserPanelTile>();
|
||||
int auricLandMineID = TileType<AuricLandMineTile>();
|
||||
|
||||
// Get a list of tiles near the npc
|
||||
// This is just Collision.GetEntityTiles but with a larger detection square because the sheer speed from auric boosts causes the detection to fail at higher speeds
|
||||
@@ -5372,6 +5373,18 @@ namespace CalamityMod.NPCs
|
||||
Tile tile = Framing.GetTileSafely(touchedTile);
|
||||
if (!tile.HasTile || !tile.HasUnactuatedTile)
|
||||
continue;
|
||||
|
||||
if (tile.TileType == auricLandMineID)
|
||||
{
|
||||
SoundStyle explode = new("CalamityMod/Sounds/Item/DudFire");
|
||||
SoundEngine.PlaySound(explode with { Pitch = 0.8f }, touchedTile.ToWorldCoordinates());
|
||||
GenericSparkle sparker = new GenericSparkle(touchedTile.ToWorldCoordinates(), Vector2.Zero, Color.Goldenrod, Color.Gold, 2.5f, 9, Main.rand.NextFloat(-0.01f, 0.01f), 2.68f);
|
||||
GeneralParticleHandler.SpawnParticle(sparker);
|
||||
Projectile.NewProjectile(new EntitySource_TileInteraction(npc, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType<AuricLandMineExplosion>(), 40000, 0f);
|
||||
WorldGen.KillTile(touchedTile.X, touchedTile.Y, noItem: true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tile.TileType != auricOreID && tile.TileType != auricRepulserID)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in new issue
Block a user