This commit is contained in:
Altixal committed 2024-10-19 23:30:45 +07:00
commit 8546be16fc
52 files changed
+90 -835

No files matched your search

+2 -2
View File
@@ -1896,8 +1896,8 @@ namespace CalamityMod.ILEditing
drawColor = glowMaskTile.GlowMaskPaintInteraction switch
{
GlowMaskTile.PaintColorTint.OnlyByDeepPaint => GlowMaskTile.ApplyPaint(colType, drawColor, deepPaintOnly: true),
GlowMaskTile.PaintColorTint.ByEveryPaint => GlowMaskTile.ApplyPaint(colType, drawColor, deepPaintOnly: false),
GlowMaskTile.PaintColorTint.OnlyByDeepPaint => CalamityUtils.ApplyPaint(colType, drawColor, deepPaintOnly: true),
GlowMaskTile.PaintColorTint.ByEveryPaint => CalamityUtils.ApplyPaint(colType, drawColor, deepPaintOnly: false),
_ => drawColor
};
+3 -4
View File
@@ -6064,11 +6064,10 @@ namespace CalamityMod.NPCs
if (CalamityLists.DesertScourgeIDs.Contains(npc.type) || CalamityLists.EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper ||
CalamityLists.PerforatorIDs.Contains(npc.type) || CalamityLists.AquaticScourgeIDs.Contains(npc.type) || CalamityLists.DestroyerIDs.Contains(npc.type) ||
CalamityLists.AstrumDeusIDs.Contains(npc.type) || CalamityLists.StormWeaverIDs.Contains(npc.type) || CalamityLists.ThanatosIDs.Contains(npc.type) ||
npc.type == NPCType<DarkEnergy>() || npc.type == NPCType<RavagerBody>() || CalamityLists.AresIDs.Contains(npc.type) || npc.type == NPCType<Crabulon.Crabulon>() ||
npc.type == NPCType<ProfanedRocks>())
npc.type == NPCType<DarkEnergy>() || npc.type == NPCType<RavagerBody>() || npc.type == NPCType<Crabulon.Crabulon>() || npc.type == NPCType<ProfanedRocks>())
{
float damageMult = CalamityLists.ThanatosIDs.Contains(npc.type) ? 0.35f : 0.5f;
if (item.CountsAsClass<MeleeDamageClass>() && item.type != ItemType<UltimusCleaver>() && item.type != ItemType<InfernaCutter>())
float damageMult = CalamityLists.ThanatosIDs.Contains(npc.type) ? 0.35f : (CalamityLists.DesertScourgeIDs.Contains(npc.type) || npc.type == NPCType<Crabulon.Crabulon>()) ? 0.75f : 0.5f;
if (item.CountsAsClass<MeleeDamageClass>() && item.type != ItemType<InfernaCutter>())
modifiers.SourceDamage *= damageMult;
}
}
+1 -14
View File
@@ -77,7 +77,7 @@ namespace CalamityMod.Tiles.Astral
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/Astral/AstralMonolithGlow").Value;
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Color drawColour = GetDrawColour(i, j, new Color(50, 50, 50, 50));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(50, 50, 50, 50));
if (!tile.IsHalfBlock && tile.Slope == 0)
{
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
@@ -132,19 +132,6 @@ namespace CalamityMod.Tiles.Astral
}
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override bool IsTileBiomeSightable(int i, int j, ref Color sightColor)
{
sightColor = Color.Cyan;
-59
View File
@@ -51,64 +51,5 @@ namespace CalamityMod.Tiles.Crags
{
return TileFramingSystem.BrimstoneFraming(i, j, resetFrame);
}
/*public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
Tile tile = Main.tile[i, j];
Texture2D sprite = ModContent.GetTexture("CalamityMod/Tiles/Crags/BrimstoneSlagGlow");
int frameXOffset = i % 2 * subsheetWidth;
int frameYOffset = j % 2 * subsheetHeight;
Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange);
Color drawColour = GetDrawColour(i, j, new Color(50, 50, 50, 50));
if (Main.drawToScreen)
{
zero = Vector2.Zero;
}
if (tile.Slope == (byte)0 && !tile.IsHalfBlock)
Main.spriteBatch.Draw(sprite, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle(tile.frameX + frameXOffset, tile.frameY + frameYOffset, 16, 16), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
else if (tile.IsHalfBlock)
{
Main.spriteBatch.Draw(sprite, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y + 10) + 8) + zero, new Rectangle(tile.frameX + frameXOffset, tile.frameY + frameYOffset, 16, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
else
{
byte num9 = tile.Slope;
for (int index4 = 0; index4 < 8; ++index4)
{
int width2 = index4 << 1;
Rectangle drawRectangle = new Rectangle(tile.frameX + frameXOffset, tile.frameY + frameYOffset + index4 * 2, width2, 2);
int num10 = 0;
switch (num9)
{
case 2:
drawRectangle.X = 16 - width2;
num10 = 16 - width2;
break;
case 3:
drawRectangle.Width = 16 - width2;
break;
case 4:
drawRectangle.Width = 14 - width2;
drawRectangle.X = width2 + 2;
num10 = width2 + 2;
break;
}
Main.spriteBatch.Draw(sprite, new Vector2((float)(i * 16 - (int)Main.screenPosition.X) + (float)num10, (float)(j * 16 - (int)Main.screenPosition.Y + index4 * 2)) + zero, drawRectangle, drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
}
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}*/
}
}
+1 -22
View File
@@ -149,7 +149,7 @@ namespace CalamityMod.Tiles.Crags
{
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Color drawColour = GetDrawColour(i, j);
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j));
Texture2D leaves = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/CinderBlossomGrassGrass").Value;
DrawExtraTop(i, j, leaves, drawOffset, drawColour);
@@ -279,27 +279,6 @@ namespace CalamityMod.Tiles.Crags
return Main.tile[i + x, j - y].TileType == type == equal;
}
private Color GetDrawColour(int i, int j)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
private int GetExtraState(string type)
{
switch (type)
+1 -1
View File
@@ -77,7 +77,7 @@ namespace CalamityMod.Tiles.Furniture
var drawPos = new Vector2(i * 16, j * 16) - Main.screenPosition + zero + CalamityUtils.TileDrawOffset + Vector2.UnitY * 2;
var animateFrameOffset = Main.tileFrame[Type] * AnimationFrameHeight;
var height = 16;
var finalColor = Lighting.GetColor(i, j);
var finalColor = CalamityUtils.ApplyPaint(tile.TileColor, Lighting.GetColor(i, j), false);
var rect = new Rectangle(tile.TileFrameX, tile.TileFrameY + animateFrameOffset, 16, height);
@@ -31,23 +31,10 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/CraftingStations/MonolithAmalgamGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
@@ -36,23 +36,10 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/CraftingStations/WulfrumLabstationGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
+1 -1
View File
@@ -70,7 +70,7 @@ namespace CalamityMod.Tiles.Furniture
var drawPos = new Vector2(i * 16, j * 16) - Main.screenPosition + zero + CalamityUtils.TileDrawOffset + Vector2.UnitY * 2;
var animateFrameOffset = Main.tileFrame[Type] * AnimationFrameHeight;
var height = 16;
var finalColor = Lighting.GetColor(i, j);
var finalColor = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false);
var rect = new Rectangle(tile.TileFrameX, tile.TileFrameY + animateFrameOffset, 16, height);
+1 -1
View File
@@ -69,7 +69,7 @@ namespace CalamityMod.Tiles.Furniture
var drawPos = new Vector2(i * 16, j * 16) - Main.screenPosition + zero + CalamityUtils.TileDrawOffset + Vector2.UnitY * 2;
var animateFrameOffset = Main.tileFrame[Type] * AnimationFrameHeight;
var height = 16;
var finalColor = Lighting.GetColor(i, j);
var finalColor = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false);
var rect = new Rectangle(tile.TileFrameX, tile.TileFrameY + animateFrameOffset, 16, height);
+1 -14
View File
@@ -512,7 +512,7 @@ namespace CalamityMod.Tiles.FurnitureAshen
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureAshen/AshenSlabGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(64, 64, 64, 64));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(64, 64, 64, 64));
Tile trackTile = Main.tile[i, j];
if (!trackTile.IsHalfBlock && trackTile.Slope == 0)
{
@@ -524,19 +524,6 @@ namespace CalamityMod.Tiles.FurnitureAshen
}
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
/*
/// <summary>
/// Gets the tile variant to use. Returns -1 by default
+1 -14
View File
@@ -512,7 +512,7 @@ namespace CalamityMod.Tiles.FurnitureAshen
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureAshen/AshenSlabGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(64, 64, 64, 64));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(64, 64, 64, 64));
Tile trackTile = Main.tile[i, j];
if (!trackTile.IsHalfBlock && trackTile.Slope == 0)
{
@@ -524,19 +524,6 @@ namespace CalamityMod.Tiles.FurnitureAshen
}
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
/*
/// <summary>
/// Gets the tile variant to use. Returns -1 by default
+1 -15
View File
@@ -24,23 +24,9 @@ namespace CalamityMod.Tiles.FurnitureAuric
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
var tileCache = Main.tile[i, j];
Color drawColour = GetDrawColour(i, j, Color.White);
TileFramingSystem.SlopedGlowmask(in tileCache, i, j, TextureAssets.Tile[Type].Value, null, GetDrawColour(i, j, drawColour), default);
TileFramingSystem.SlopedGlowmask(in tileCache, i, j, TextureAssets.Tile[Type].Value, null, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White), default);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame);
+1 -14
View File
@@ -25,23 +25,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithBathtubGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
+1 -14
View File
@@ -27,25 +27,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithBedGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j);
+1 -14
View File
@@ -28,25 +28,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithBenchGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.BenchSitInfo(i, j, ref info);
public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j);
+1 -14
View File
@@ -26,23 +26,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithBookcaseGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
+1 -14
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithCandelabraGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
@@ -35,19 +35,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith
Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
if (Main.tile[i, j].TileFrameX < 18)
+1 -14
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithCandleGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y - 4) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 20)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
@@ -35,19 +35,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith
Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 20)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
if (Main.tile[i, j].TileFrameX < 18)
+1 -14
View File
@@ -29,25 +29,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithChairGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info);
public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j);
+1 -14
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithChandelierGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
@@ -35,19 +35,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith
Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
if (Main.tile[i, j].TileFrameX < 18)
+1 -14
View File
@@ -66,23 +66,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithChestGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
+1 -14
View File
@@ -29,25 +29,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithClockGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override bool RightClick(int x, int y)
{
return CalamityUtils.ClockRightClick();
+1 -14
View File
@@ -32,25 +32,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithDoorClosedGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
public override void MouseOver(int i, int j)
+1 -14
View File
@@ -33,25 +33,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithDoorOpenGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
public override void MouseOver(int i, int j)
+1 -14
View File
@@ -35,23 +35,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithDresserGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
+1 -14
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithLampGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
@@ -35,19 +35,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith
Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
if (Main.tile[i, j].TileFrameX < 18)
+1 -14
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithLanternGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
@@ -36,19 +36,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith
Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
if (Main.tile[i, j].TileFrameX < 18)
+1 -14
View File
@@ -28,23 +28,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithPianoGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
+1 -14
View File
@@ -26,23 +26,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithSinkGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
+1 -14
View File
@@ -26,23 +26,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithTableGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
+1 -14
View File
@@ -26,23 +26,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureMonolith/MonolithWorkBenchGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100));
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
@@ -53,7 +53,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly
{
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Color drawColour = GetDrawColour(i, j);
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false);
Texture2D cloth = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureOtherworldly/OtherworldlyStone_Cloth").Value;
DrawExtraTop(i, j, cloth, drawOffset, drawColour);
@@ -183,27 +183,6 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly
return Main.tile[i + x, j - y].TileType == type == equal;
}
private Color GetDrawColour(int i, int j)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
private int GetExtraState(string type)
{
switch (type)
-15
View File
@@ -64,20 +64,5 @@ namespace CalamityMod.Tiles
public virtual void OnUnload() { }
public abstract Color GetGlowMaskColor(int i, int j, TileDrawInfo drawData);
public static Color ApplyPaint(int paintType, Color color, bool deepPaintOnly = true)
{
if (deepPaintOnly && !IsDeepPaint(paintType))
return color;
Color paintCol = WorldGen.paintColor(paintType);
color = color.MultiplyRGB(paintCol);
return color;
}
private static bool IsDeepPaint(int paintType)
{
return PaintID.DeepRedPaint <= paintType && paintType <= PaintID.DeepPinkPaint;
}
}
}
+1 -13
View File
@@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.Ores
xPos += xOffset;
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 50));
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 50));
if (!tile.IsHalfBlock && tile.Slope == 0)
{
Main.spriteBatch.Draw(GlowTexture, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
@@ -92,17 +92,5 @@ namespace CalamityMod.Tiles.Ores
Main.spriteBatch.Draw(GlowTexture, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xPos, yPos, 18, 8)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}
+1 -14
View File
@@ -58,20 +58,7 @@ namespace CalamityMod.Tiles.SunkenSea
Rectangle frame = new Rectangle(tile.TileFrameX + frameXOffset, tile.TileFrameY + frameYOffset, 16, 16);
Color color = Lighting.GetColor(i, j) * transparency;
TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, GetDrawColour(i, j, color), default);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 0 && colType <= 30)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, color, false), default);
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
+1 -22
View File
@@ -59,7 +59,7 @@ namespace CalamityMod.Tiles
{
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Color drawColour = GetDrawColour(i, j);
Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false);
Texture2D leaves = ModContent.Request<Texture2D>("CalamityMod/Tiles/UelibloomBrick_Leaves").Value;
DrawExtraTop(i, j, leaves, drawOffset, drawColour);
@@ -194,27 +194,6 @@ namespace CalamityMod.Tiles
return Main.tile[i + x, j - y].TileType == type == equal;
}
private Color GetDrawColour(int i, int j)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
private int GetExtraState(string type)
{
switch (type)
+38
View File
@@ -226,6 +226,44 @@ namespace CalamityMod
return uniqueAnimationFrame * animationFrameLength;
}
/// <summary>
/// Gets the color of a tile/wall after paint is applied
/// </summary>
/// <param name="paintType">The ID of the paint, this can be received from the tile's TileColor or WallColor</param>
/// <param name="color">The base color to apply the paint to</param>
/// <param name="deepPaintOnly">Whether or not only deep paints should be included. Typically this should be set to false if this isn't being used for a glowmask</param>
/// <returns>The original color with paint applied</returns>
public static Color ApplyPaint(int paintType, Color color, bool deepPaintOnly = true)
{
if (paintType == PaintID.None)
return color;
bool isDeep = IsDeepPaint(paintType);
if (deepPaintOnly && !isDeep)
return color;
Color paintCol = WorldGen.paintColor(paintType);
if (paintType < PaintID.DeepRedPaint)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (paintType == PaintID.ShadowPaint)
{
paintCol = Color.Black;
}
color = color.MultiplyRGB(paintCol);
return color;
}
private static bool IsDeepPaint(int paintType)
{
return PaintID.DeepRedPaint >= paintType && paintType <= PaintID.DeepPinkPaint;
}
public static Tile ParanoidTileRetrieval(int x, int y)
{
if (!WorldGen.InWorld(x, y))
+1 -22
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -54,26 +54,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -53,26 +53,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -59,26 +59,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -54,26 +54,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -54,26 +54,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -93,26 +93,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -53,26 +53,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -88,26 +88,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -55,26 +55,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -54,26 +54,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -56,26 +56,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -48,26 +48,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -101,26 +101,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}
+1 -22
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Walls
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
{
Texture2D sprite = TextureAssets.Wall[Type].Value;
Color lightColor = GetWallColour(i, j);
Color lightColor = CalamityUtils.ApplyPaint(Main.tile[i, j].WallColor, Lighting.GetColor(i, j), false);
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
zero -= new Vector2(8, 8);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
@@ -53,26 +53,5 @@ namespace CalamityMod.Walls
sheetOffset[1] = sheetOffset[1] * 180;
return sheetOffset;
}
private Color GetWallColour(int i, int j)
{
int colType = Main.tile[i, j].WallColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType < 13)
{
paintCol.R = (byte)((paintCol.R / 2f) + 128);
paintCol.G = (byte)((paintCol.G / 2f) + 128);
paintCol.B = (byte)((paintCol.B / 2f) + 128);
}
if (colType == 29)
{
paintCol = Color.Black;
}
Color col = Lighting.GetColor(i, j);
col.R = (byte)(paintCol.R / 255f * col.R);
col.G = (byte)(paintCol.G / 255f * col.G);
col.B = (byte)(paintCol.B / 255f * col.B);
return col;
}
}
}