You can now sit on Calamity sofas/benches. +some other fixes
This commit is contained in:
1 parent
54eb39c1eb
commit
3d2afe84e7
36 files changed
+320
-101
No files matched your search
@@ -12,13 +12,10 @@ namespace CalamityMod.Tiles.Furniture
|
||||
{
|
||||
public class ThaumaticChairTile : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(236, 123, 89), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 257 B |
@@ -11,13 +11,10 @@ namespace CalamityMod.Tiles.FurnitureAbyss
|
||||
{
|
||||
public class AbyssChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureAbyss
|
||||
{
|
||||
@@ -9,9 +13,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -29,5 +31,16 @@ namespace CalamityMod.Tiles.FurnitureAbyss
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssSofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssSofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,10 @@ using CalamityMod.Items.Placeables.FurnitureAcidwood;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureAcidwood
|
||||
{
|
||||
@@ -10,9 +14,7 @@ namespace CalamityMod.Tiles.FurnitureAcidwood
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa();
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -30,5 +32,16 @@ namespace CalamityMod.Tiles.FurnitureAcidwood
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<AcidwoodBench>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<AcidwoodBench>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,6 @@ namespace CalamityMod.Tiles.FurnitureAcidwood
|
||||
{
|
||||
public class AcidwoodChairTile : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
@@ -41,6 +40,7 @@ namespace CalamityMod.Tiles.FurnitureAcidwood
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
TileID.Sets.HasOutlines[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace CalamityMod.Tiles.FurnitureAcidwood
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<AcidwoodChair>());
|
||||
}
|
||||
|
||||
public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, true);
|
||||
public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, 40, true, true);
|
||||
|
||||
public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j);
|
||||
|
||||
|
||||
@@ -11,13 +11,10 @@ namespace CalamityMod.Tiles.FurnitureAncient
|
||||
{
|
||||
public class AncientChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureAncient
|
||||
{
|
||||
@@ -9,9 +13,7 @@ namespace CalamityMod.Tiles.FurnitureAncient
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -30,5 +32,16 @@ namespace CalamityMod.Tiles.FurnitureAncient
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureAncient.AncientSofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureAncient.AncientSofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,10 @@ namespace CalamityMod.Tiles.FurnitureAshen
|
||||
{
|
||||
public class AshenChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureAshen
|
||||
{
|
||||
@@ -9,9 +13,7 @@ namespace CalamityMod.Tiles.FurnitureAshen
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -30,5 +32,16 @@ namespace CalamityMod.Tiles.FurnitureAshen
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureAshen.AshenSofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureAshen.AshenSofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureBotanic
|
||||
{
|
||||
@@ -10,9 +14,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -31,5 +33,16 @@ namespace CalamityMod.Tiles.FurnitureBotanic
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicBench>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicBench>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,13 +12,10 @@ namespace CalamityMod.Tiles.FurnitureBotanic
|
||||
{
|
||||
public class BotanicChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,10 @@ namespace CalamityMod.Tiles.FurnitureCosmilite
|
||||
{
|
||||
public class CosmiliteChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureCosmilite
|
||||
{
|
||||
@@ -9,9 +13,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -30,5 +32,16 @@ namespace CalamityMod.Tiles.FurnitureCosmilite
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteSofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteSofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureEutrophic
|
||||
{
|
||||
@@ -9,9 +13,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa();
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -29,5 +31,16 @@ namespace CalamityMod.Tiles.FurnitureEutrophic
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicBench>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicBench>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,10 @@ namespace CalamityMod.Tiles.FurnitureEutrophic
|
||||
{
|
||||
public class EutrophicChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair();
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace CalamityMod.Tiles.FurnitureExo
|
||||
{
|
||||
public class ExoChairTile : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
@@ -42,6 +41,7 @@ namespace CalamityMod.Tiles.FurnitureExo
|
||||
AddMapEntry(new Color(71, 95, 114), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
TileID.Sets.HasOutlines[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace CalamityMod.Tiles.FurnitureExo
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<ExoChair>());
|
||||
}
|
||||
|
||||
public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, true);
|
||||
public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, 40, true, true);
|
||||
|
||||
public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j);
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@ using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureExo
|
||||
{
|
||||
@@ -11,9 +15,7 @@ namespace CalamityMod.Tiles.FurnitureExo
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(71, 95, 114), name);
|
||||
AddMapEntry(new Color(71, 95, 114), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CanExplode(int i, int j) => false;
|
||||
@@ -34,6 +36,17 @@ namespace CalamityMod.Tiles.FurnitureExo
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<ExoSofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<ExoSofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
int xFrameOffset = Main.tile[i, j].TileFrameX;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.FurnitureExo
|
||||
{
|
||||
public class ExoToiletTile : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
@@ -44,6 +44,7 @@ namespace CalamityMod.Tiles.FurnitureExo
|
||||
AddMapEntry(new Color(71, 95, 114), name);
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
TileID.Sets.HasOutlines[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
@@ -80,7 +81,7 @@ namespace CalamityMod.Tiles.FurnitureExo
|
||||
spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
|
||||
}
|
||||
|
||||
public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, true);
|
||||
public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, NextStyleHeight, true);
|
||||
|
||||
public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j);
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@ using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureMonolith
|
||||
{
|
||||
@@ -11,9 +15,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -55,5 +57,16 @@ namespace CalamityMod.Tiles.FurnitureMonolith
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureMonolith.MonolithBench>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureMonolith.MonolithBench>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,13 +13,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith
|
||||
{
|
||||
public class MonolithChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -13,13 +13,10 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly
|
||||
[LegacyName("OccultChair")]
|
||||
public class OtherworldlyChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureOtherworldly
|
||||
{
|
||||
@@ -11,9 +15,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -32,5 +34,16 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureOtherworldly.OtherworldlySofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureOtherworldly.OtherworldlySofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,10 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate
|
||||
{
|
||||
public class PlaguedPlateChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurniturePlaguedPlate
|
||||
{
|
||||
@@ -9,9 +13,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -29,5 +31,16 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurniturePlagued.PlaguedPlateSofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurniturePlagued.PlaguedPlateSofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureProfaned
|
||||
{
|
||||
@@ -10,9 +14,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -31,5 +33,16 @@ namespace CalamityMod.Tiles.FurnitureProfaned
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedBench>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedBench>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,13 +12,10 @@ namespace CalamityMod.Tiles.FurnitureProfaned
|
||||
{
|
||||
public class ProfanedChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureSilva
|
||||
{
|
||||
@@ -10,9 +15,7 @@ namespace CalamityMod.Tiles.FurnitureSilva
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -31,5 +34,16 @@ namespace CalamityMod.Tiles.FurnitureSilva
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaBench>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaBench>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,13 +12,10 @@ namespace CalamityMod.Tiles.FurnitureSilva
|
||||
{
|
||||
public class SilvaChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,10 @@ namespace CalamityMod.Tiles.FurnitureStatigel
|
||||
{
|
||||
public class StatigelChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair();
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureStatigel
|
||||
{
|
||||
@@ -9,9 +13,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa();
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -29,5 +31,16 @@ namespace CalamityMod.Tiles.FurnitureStatigel
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelSofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelSofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,10 @@ namespace CalamityMod.Tiles.FurnitureStratus
|
||||
{
|
||||
public class StratusChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureStratus
|
||||
{
|
||||
@@ -9,9 +13,7 @@ namespace CalamityMod.Tiles.FurnitureStratus
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -30,5 +32,16 @@ namespace CalamityMod.Tiles.FurnitureStratus
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusSofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusSofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,10 @@ namespace CalamityMod.Tiles.FurnitureVoid
|
||||
{
|
||||
public class VoidChair : ModTile
|
||||
{
|
||||
public const int NextStyleHeight = 40;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpChair(true);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Chair"));
|
||||
TileID.Sets.CanBeSatOnForNPCs[Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[Type] = true;
|
||||
AdjTiles = new int[] { TileID.Chairs };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.ObjectInteractions;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Tiles.FurnitureVoid
|
||||
{
|
||||
@@ -9,9 +13,7 @@ namespace CalamityMod.Tiles.FurnitureVoid
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.SetUpSofa(true);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Bench");
|
||||
AddMapEntry(new Color(191, 142, 111), name);
|
||||
AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench"));
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
@@ -29,5 +31,16 @@ namespace CalamityMod.Tiles.FurnitureVoid
|
||||
{
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidSofa>());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidSofa>());
|
||||
|
||||
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
|
||||
{
|
||||
return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,8 +68,14 @@ namespace CalamityMod
|
||||
|
||||
#region Sitting in Chairs
|
||||
// fat is for 2 tile chairs like Exo Chair and Exo Toilet
|
||||
public static void ChairSitInfo(int i, int j, ref TileRestingInfo info, bool fat = false)
|
||||
public static void ChairSitInfo(int i, int j, ref TileRestingInfo info, int nextStyleHeight = 40, bool fat = false, bool hasOffset = false)
|
||||
{
|
||||
if (hasOffset)
|
||||
{
|
||||
info.DirectionOffset = 0;
|
||||
info.VisualOffset = new Vector2(-8f, 0f);
|
||||
}
|
||||
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
bool frameCheck = fat ? tile.TileFrameX >= 35 : tile.TileFrameX != 0;
|
||||
|
||||
@@ -91,7 +97,7 @@ namespace CalamityMod
|
||||
info.AnchorTilePosition.X = i;
|
||||
info.AnchorTilePosition.Y = j;
|
||||
|
||||
if (tile.TileFrameY % NextStyleHeight == 0)
|
||||
if (tile.TileFrameY % nextStyleHeight == 0)
|
||||
{
|
||||
info.AnchorTilePosition.Y++;
|
||||
}
|
||||
@@ -130,6 +136,49 @@ namespace CalamityMod
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Sitting in Sofas/Benches
|
||||
public static void BenchSitInfo(int i, int j, ref TileRestingInfo info, int nextStyleHeight = 40)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Player player = Main.LocalPlayer;
|
||||
|
||||
info.DirectionOffset = 0;
|
||||
float offset = 0f;
|
||||
if (tile.TileFrameX < 17 && player.direction == 1)
|
||||
offset = 8f;
|
||||
if (tile.TileFrameX < 17 && player.direction == -1)
|
||||
offset = -8f;
|
||||
if (tile.TileFrameX > 34 && player.direction == 1)
|
||||
offset = -8f;
|
||||
if (tile.TileFrameX > 34 && player.direction == -1)
|
||||
offset = 8f;
|
||||
info.VisualOffset = new Vector2(offset, 0f);
|
||||
info.TargetDirection = player.direction;
|
||||
|
||||
info.AnchorTilePosition.X = i;
|
||||
info.AnchorTilePosition.Y = j;
|
||||
|
||||
if (tile.TileFrameY % nextStyleHeight == 0)
|
||||
{
|
||||
info.AnchorTilePosition.Y++;
|
||||
}
|
||||
}
|
||||
|
||||
public static void BenchMouseOver(int i, int j, int itemID)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
|
||||
if (!player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.noThrow = 2;
|
||||
player.cursorItemIconEnabled = true;
|
||||
player.cursorItemIconID = itemID;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static bool ChestRightClick(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
@@ -759,6 +808,9 @@ namespace CalamityMod
|
||||
Main.tileNoAttach[mt.Type] = true;
|
||||
Main.tileLavaDeath[mt.Type] = !lavaImmune;
|
||||
Main.tileWaterDeath[mt.Type] = false;
|
||||
TileID.Sets.CanBeSatOnForNPCs[mt.Type] = true;
|
||||
TileID.Sets.CanBeSatOnForPlayers[mt.Type] = true;
|
||||
TileID.Sets.HasOutlines[mt.Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2);
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 };
|
||||
TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft;
|
||||
@@ -1134,6 +1186,8 @@ namespace CalamityMod
|
||||
Main.tileFrameImportant[mt.Type] = true;
|
||||
Main.tileLavaDeath[mt.Type] = !lavaImmune;
|
||||
Main.tileWaterDeath[mt.Type] = false;
|
||||
TileID.Sets.CanBeSatOnForPlayers[mt.Type] = true;
|
||||
TileID.Sets.HasOutlines[mt.Type] = true;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2);
|
||||
TileObjectData.newTile.LavaDeath = !lavaImmune;
|
||||
TileObjectData.addTile(mt.Type);
|
||||
|
||||
Reference in new issue
Block a user