attempted (and failed) at sunken sea fountain
This commit is contained in:
1 parent
8791c8ecce
commit
cb819daab8
12 files changed
+165
-4
No files matched your search
@@ -840,6 +840,10 @@ namespace CalamityMod.CalPlayer
|
||||
public bool tundraFlameBlossom = false;
|
||||
#endregion
|
||||
|
||||
#region Fountains
|
||||
public int fountain = 0;
|
||||
#endregion
|
||||
|
||||
#region Biome
|
||||
public bool ZoneCalamity = false;
|
||||
public bool ZoneAstral = false;
|
||||
@@ -1251,6 +1255,8 @@ namespace CalamityMod.CalPlayer
|
||||
externalColdImmunity = externalHeatImmunity = false;
|
||||
alcoholPoisonLevel = 0;
|
||||
|
||||
fountain = 0;
|
||||
|
||||
thirdSage = false;
|
||||
if (player.immuneTime <= 0)
|
||||
thirdSageH = false;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Tiles.Furniture.Fountains;
|
||||
|
||||
namespace CalamityMod.Items.Placeables.Furniture.Fountains
|
||||
{
|
||||
public class SunkenSeaFountain : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Sunken Water Fountain");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 26;
|
||||
item.height = 32;
|
||||
item.maxStack = 999;
|
||||
item.useTurn = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = 15;
|
||||
item.useTime = 10;
|
||||
item.useStyle = 1;
|
||||
item.consumable = true;
|
||||
item.value = Item.buyPrice(0, 4, 0, 0);
|
||||
item.rare = 0;
|
||||
item.createTile = ModContent.TileType<SunkenSeaFountainTile>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 499 B |
@@ -13,6 +13,7 @@ using CalamityMod.Items.Ammo;
|
||||
using CalamityMod.Items.Dyes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Pets;
|
||||
using CalamityMod.Items.Placeables.Furniture.Fountains;
|
||||
using CalamityMod.Items.Placeables.Walls;
|
||||
using CalamityMod.Items.SummonItems;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
@@ -5603,6 +5604,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (type == NPCID.WitchDoctor)
|
||||
{
|
||||
SetShopItem(ref shop, ref nextSlot, ModContent.ItemType<SunkenSeaFountain>());
|
||||
SetShopItem(ref shop, ref nextSlot, ItemID.Abeemination, CalamityMod.CalamityConfig.SellBossSummons, price: Item.buyPrice(0, 8));
|
||||
SetShopItem(ref shop, ref nextSlot, ModContent.ItemType<BulbofDoom>(), NPC.downedPlantBoss && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20));
|
||||
SetShopItem(ref shop, ref nextSlot, ItemID.SolarTablet, NPC.downedGolemBoss, Item.buyPrice(0, 25));
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Placeables.Furniture.Fountains;
|
||||
|
||||
namespace CalamityMod.Tiles.Furniture.Fountains
|
||||
{
|
||||
public class SunkenSeaFountainTile : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
this.SetUpFountain();
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Sunken Sea Fountain");
|
||||
AddMapEntry(new Color(104, 195, 255), name);
|
||||
animationFrameHeight = 72;
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Player player = Main.LocalPlayer;
|
||||
if (player is null)
|
||||
return;
|
||||
if (player.active)
|
||||
{
|
||||
if (tile.frameX < 54)
|
||||
{
|
||||
player.Calamity().fountain = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HasSmartInteract()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 1, 0f, 0f, 1, new Color(119, 102, 255), 1f);
|
||||
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 33, 0f, 0f, 1, new Color(255, 255, 255), 1f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 1 : 3;
|
||||
}
|
||||
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter >= 6)
|
||||
{
|
||||
frame = (frame + 1) % 4;
|
||||
frameCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void KillMultiTile(int i, int j, int frameX, int frameY)
|
||||
{
|
||||
Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType<SunkenSeaFountain>());
|
||||
}
|
||||
|
||||
public override void HitWire(int i, int j)
|
||||
{
|
||||
CalamityUtils.LightHitWire(Type, i, j, 2, 4);
|
||||
}
|
||||
|
||||
public override bool NewRightClick(int i, int j)
|
||||
{
|
||||
CalamityUtils.LightHitWire(Type, i, j, 2, 4);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void MouseOver(int i, int j)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
player.noThrow = 2;
|
||||
player.showItemIcon = true;
|
||||
player.showItemIcon2 = ModContent.ItemType<SunkenSeaFountain>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -2138,6 +2138,33 @@ namespace CalamityMod
|
||||
// All work benches count as tables.
|
||||
mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension which initializes a ModTile to be a fountain.
|
||||
/// </summary>
|
||||
/// <param name="mt">The ModTile which is being initialized.</param>
|
||||
internal static void SetUpFountain(this ModTile mt)
|
||||
{
|
||||
//All fountains are immune to lava
|
||||
Main.tileLighted[mt.Type] = true;
|
||||
Main.tileFrameImportant[mt.Type] = true;
|
||||
Main.tileLavaDeath[mt.Type] = false;
|
||||
Main.tileWaterDeath[mt.Type] = false;
|
||||
//TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4);
|
||||
//TileObjectData.newTile.Width = 2;
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(mt.Type);
|
||||
TileID.Sets.HasOutlines[mt.Type] = true;
|
||||
|
||||
TileObjectData.newTile.Width = 2;
|
||||
TileObjectData.newTile.Height = 4;
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 };
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.Origin = new Point16(0, 3);
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 2, 0);
|
||||
TileObjectData.addTile(mt.Type);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -8,7 +9,8 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public override bool ChooseWaterStyle()
|
||||
{
|
||||
return Main.LocalPlayer.Calamity().ZoneAbyss;
|
||||
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
|
||||
return (modPlayer.ZoneAbyss && modPlayer.fountain == 0) || modPlayer.fountain == 2;
|
||||
}
|
||||
|
||||
public override int ChooseWaterfallStyle()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -8,7 +9,8 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public override bool ChooseWaterStyle()
|
||||
{
|
||||
return Main.LocalPlayer.Calamity().ZoneAstral;
|
||||
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
|
||||
return (modPlayer.ZoneAstral && modPlayer.fountain == 0) || modPlayer.fountain == 4;
|
||||
}
|
||||
|
||||
public override int ChooseWaterfallStyle()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -32,7 +33,9 @@ namespace CalamityMod.Waters
|
||||
|
||||
bool inYZone = Main.LocalPlayer.Center.Y < Main.rockLayer * 16f - 320 && Main.LocalPlayer.Center.Y >= 5800f;
|
||||
|
||||
return (inXZone && inYZone) || Main.LocalPlayer.Calamity().ZoneSulphur;
|
||||
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
|
||||
bool greenWater = (inXZone && inYZone) || modPlayer.ZoneSulphur;
|
||||
return (greenWater && modPlayer.fountain == 0) || modPlayer.fountain == 3;
|
||||
}
|
||||
|
||||
public override int ChooseWaterfallStyle()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -8,7 +9,8 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public override bool ChooseWaterStyle()
|
||||
{
|
||||
return Main.LocalPlayer.Calamity().ZoneSunkenSea;
|
||||
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
|
||||
return (modPlayer.ZoneSunkenSea && modPlayer.fountain == 0) || modPlayer.fountain == 1;
|
||||
}
|
||||
|
||||
public override int ChooseWaterfallStyle()
|
||||
|
||||
Reference in new issue
Block a user