diff --git a/Tiles/Astral/AstralVines.cs b/Tiles/Astral/AstralVines.cs index 6ad3b3e71b..3199f85196 100644 --- a/Tiles/Astral/AstralVines.cs +++ b/Tiles/Astral/AstralVines.cs @@ -12,13 +12,14 @@ namespace CalamityMod.Tiles.Astral { public override void SetStaticDefaults() { + Main.tileLighted[Type] = true; Main.tileCut[Type] = true; Main.tileBlockLight[Type] = true; Main.tileLavaDeath[Type] = true; Main.tileNoFail[Type] = true; TileID.Sets.IsVine[Type] = true; TileID.Sets.ReplaceTileBreakDown[Type] = true; - TileID.Sets.VineThreads[Type] = true; + TileID.Sets.VineThreads[Type] = true; TileID.Sets.DrawFlipMode[Type] = 1; TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Plant"]); @@ -26,16 +27,25 @@ namespace CalamityMod.Tiles.Astral HitSound = SoundID.Grass; - AddMapEntry(new Color(65, 56, 83)); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Astral Vines"); + AddMapEntry(new Color(65, 56, 83), name); } public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) { //GIVE VINE ROPE IF SPECIAL VINE BOOK - if (WorldGen.genRand.Next(2) == 0 && Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].cordage) + if (WorldGen.genRand.NextBool() && Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].cordage) { Item.NewItem(new EntitySource_TileBreak(i, j), new Vector2(i * 16 + 8f, j * 16 + 8f), ItemID.VineRope); } } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = Main.DiscoR / 255f * 0.5f; + g = 0.5f; + b = (255 - Main.DiscoR) / 255f * 0.5f; + } } } diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index a51508e688..2588b8238b 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -69,18 +69,18 @@ namespace CalamityMod.Tiles { // Custom plant framing for (int k = 0; k < PlantTypes.Length; k++) + { if (type == PlantTypes[k]) { TileFraming.PlantFrame(i, j); return false; } + } // Custom vine framing if (type == TileID.Vines || type == TileID.CrimsonVines || type == TileID.HallowedVines || type == ModContent.TileType()) - { TileFraming.VineFrame(i, j); - return false; - } + return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); } @@ -142,6 +142,7 @@ namespace CalamityMod.Tiles { if (xPos < 0 || xPos >= Main.maxTilesX || yPos < 0 || yPos >= Main.maxTilesY) return; + Tile t = Main.tile[xPos, yPos]; if (t.HasTile && (t.TileType == ModContent.TileType() || (t.TileType == ModContent.TileType() && DownedBossSystem.downedDesertScourge))) { @@ -232,6 +233,7 @@ namespace CalamityMod.Tiles if (player.breath > player.breathMax) player.breath = player.breathMax; } + // Mining set gives a chance for additional ore. This can be abused for infinite ore but it has a cooldown to prevent too much abuse if (player.Calamity().miningSet && player.Calamity().miningSetCooldown <= 0 && !fail) { diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index 8eb55d40d9..522a5d9f97 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -265,6 +265,7 @@ namespace CalamityMod return; if (y < 0 || y >= Main.maxTilesY) return; + Tile tile = Main.tile[x, y]; int myType = tile.TileType; @@ -284,25 +285,30 @@ namespace CalamityMod return; } } - + // If the tile above is an identical vine, nothing else needs to be done. if (northType == myType) return; // If the tile above isn't sloped correctly or otherwise isn't a valid anchor for this vine, check whether the vine must die. bool tileMustDie = northType == -1; - if(northType != -1) + if (northType != -1) { // Vanilla vines can hang from vanilla grass and vanilla leaf blocks. if (myType == TileID.Vines && northType != TileID.Grass && northType != TileID.LeafBlock) - tileMustDie = true; - else for (int i = 0; i < vines.Length; ++i) { - // Not matching grass? Die. - if (myType == vines[i] && northType != VineToGrass[vines[i]]) + tileMustDie = true; + } + else + { + for (int i = 0; i < vines.Length; ++i) { - tileMustDie = true; - break; + // Not matching grass? Die. + if (myType == vines[i] && northType != VineToGrass[vines[i]]) + { + tileMustDie = true; + break; + } } } }