Hostile lab turrets are highlighted by Dangersense

This commit is contained in:
CongratsIsTrash committed 2025-01-05 17:13:22 -05:00
1 parent 79aaf43409
commit dfc7874885
7 files changed
+84

No files matched your search

@@ -73,6 +73,8 @@ namespace CalamityMod.Tiles.DraedonStructures
te?.Kill(left, top);
}
// Used to highlight the tile with Dangersense.
public override bool IsTileDangerous(int i, int j, Player player) => true;
// The turret tile draws a pulse turret on top of itself.
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
@@ -85,6 +87,16 @@ namespace CalamityMod.Tiles.DraedonStructures
return;
int drawDirection = te.Direction;
Color drawColor = Lighting.GetColor(i, j);
// Make sure the tile entity is also highlighted by Dangersense.
if (Main.LocalPlayer.dangerSense)
{
if (drawColor.R < 255)
drawColor.R = 255;
if (drawColor.G < 50)
drawColor.G = 50;
if (drawColor.B < 50)
drawColor.B = 50;
}
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Projectiles/DraedonsArsenal/PulseTurret").Value;
Vector2 screenOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
@@ -68,6 +68,8 @@ namespace CalamityMod.Tiles.DraedonStructures
te?.Kill(left, top);
}
// Used to highlight the tile with Dangersense.
public override bool IsTileDangerous(int i, int j, Player player) => true;
// The turret tile draws a pulse turret on top of itself.
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
@@ -80,6 +82,16 @@ namespace CalamityMod.Tiles.DraedonStructures
return;
int drawDirection = te.Direction;
Color drawColor = Lighting.GetColor(i, j);
// Make sure the tile entity is also highlighted by Dangersense.
if (Main.LocalPlayer.dangerSense)
{
if (drawColor.R < 255)
drawColor.R = 255;
if (drawColor.G < 50)
drawColor.G = 50;
if (drawColor.B < 50)
drawColor.B = 50;
}
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/PlayerTurrets/FireTurretHead").Value;
Vector2 screenOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
@@ -68,6 +68,8 @@ namespace CalamityMod.Tiles.DraedonStructures
te?.Kill(left, top);
}
// Used to highlight the tile with Dangersense.
public override bool IsTileDangerous(int i, int j, Player player) => true;
// The turret tile draws a pulse turret on top of itself.
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
@@ -80,6 +82,16 @@ namespace CalamityMod.Tiles.DraedonStructures
return;
int drawDirection = te.Direction;
Color drawColor = Lighting.GetColor(i, j);
// Make sure the tile entity is also highlighted by Dangersense.
if (Main.LocalPlayer.dangerSense)
{
if (drawColor.R < 255)
drawColor.R = 255;
if (drawColor.G < 50)
drawColor.G = 50;
if (drawColor.B < 50)
drawColor.B = 50;
}
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/PlayerTurrets/IceTurretHead").Value;
Vector2 screenOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
@@ -68,6 +68,8 @@ namespace CalamityMod.Tiles.DraedonStructures
te?.Kill(left, top);
}
// Used to highlight the tile with Dangersense.
public override bool IsTileDangerous(int i, int j, Player player) => true;
// The turret tile draws a pulse turret on top of itself.
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
@@ -80,6 +82,16 @@ namespace CalamityMod.Tiles.DraedonStructures
return;
int drawDirection = te.Direction;
Color drawColor = Lighting.GetColor(i, j);
// Make sure the tile entity is also highlighted by Dangersense.
if (Main.LocalPlayer.dangerSense)
{
if (drawColor.R < 255)
drawColor.R = 255;
if (drawColor.G < 50)
drawColor.G = 50;
if (drawColor.B < 50)
drawColor.B = 50;
}
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/PlayerTurrets/LaserTurretHead").Value;
Vector2 screenOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
@@ -68,6 +68,8 @@ namespace CalamityMod.Tiles.DraedonStructures
te?.Kill(left, top);
}
// Used to highlight the tile with Dangersense.
public override bool IsTileDangerous(int i, int j, Player player) => true;
// The turret tile draws a pulse turret on top of itself.
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
@@ -80,6 +82,16 @@ namespace CalamityMod.Tiles.DraedonStructures
return;
int drawDirection = te.Direction;
Color drawColor = Lighting.GetColor(i, j);
// Make sure the tile entity is also highlighted by Dangersense.
if (Main.LocalPlayer.dangerSense)
{
if (drawColor.R < 255)
drawColor.R = 255;
if (drawColor.G < 50)
drawColor.G = 50;
if (drawColor.B < 50)
drawColor.B = 50;
}
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/PlayerTurrets/OnyxTurretHead").Value;
Vector2 screenOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
@@ -68,6 +68,8 @@ namespace CalamityMod.Tiles.DraedonStructures
te?.Kill(left, top);
}
// Used to highlight the tile with Dangersense.
public override bool IsTileDangerous(int i, int j, Player player) => true;
// The turret tile draws a pulse turret on top of itself.
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
@@ -80,6 +82,16 @@ namespace CalamityMod.Tiles.DraedonStructures
return;
int drawDirection = te.Direction;
Color drawColor = Lighting.GetColor(i, j);
// Make sure the tile entity is also highlighted by Dangersense.
if (Main.LocalPlayer.dangerSense)
{
if (drawColor.R < 255)
drawColor.R = 255;
if (drawColor.G < 50)
drawColor.G = 50;
if (drawColor.B < 50)
drawColor.B = 50;
}
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/PlayerTurrets/PlagueTurretHead").Value;
Vector2 screenOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
@@ -68,6 +68,8 @@ namespace CalamityMod.Tiles.DraedonStructures
te?.Kill(left, top);
}
// Used to highlight the tile with Dangersense.
public override bool IsTileDangerous(int i, int j, Player player) => true;
// The turret tile draws a pulse turret on top of itself.
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
@@ -80,6 +82,16 @@ namespace CalamityMod.Tiles.DraedonStructures
return;
int drawDirection = te.Direction;
Color drawColor = Lighting.GetColor(i, j);
// Make sure the tile entity is also highlighted by Dangersense.
if (Main.LocalPlayer.dangerSense)
{
if (drawColor.R < 255)
drawColor.R = 255;
if (drawColor.G < 50)
drawColor.G = 50;
if (drawColor.B < 50)
drawColor.B = 50;
}
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/PlayerTurrets/WaterTurretHead").Value;
Vector2 screenOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);