Various fountains

This commit is contained in:
DominicKarma42 committed 2020-04-28 16:06:30 -05:00
1 parent cb819daab8
commit fadf876e6c
23 files changed
+355 -23

No files matched your search

-6
View File
@@ -840,10 +840,6 @@ 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;
@@ -1255,8 +1251,6 @@ 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 AbyssFountainItem : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Abyss Fountain");
}
public override void SetDefaults()
{
item.width = 22;
item.height = 42;
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<AbyssFountainTile>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

@@ -0,0 +1,30 @@
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Tiles.Furniture.Fountains;
namespace CalamityMod.Items.Placeables.Furniture.Fountains
{
public class AstralFountainItem : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Astral Fountain");
}
public override void SetDefaults()
{
item.width = 22;
item.height = 42;
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<AstralFountainTile>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

@@ -0,0 +1,30 @@
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Tiles.Furniture.Fountains;
namespace CalamityMod.Items.Placeables.Furniture.Fountains
{
public class SulphurousFountainItem : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sulphuric Fountain");
}
public override void SetDefaults()
{
item.width = 22;
item.height = 42;
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<SulphurousFountainTile>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

+3
View File
@@ -5605,6 +5605,9 @@ namespace CalamityMod.NPCs
if (type == NPCID.WitchDoctor)
{
SetShopItem(ref shop, ref nextSlot, ModContent.ItemType<SunkenSeaFountain>());
SetShopItem(ref shop, ref nextSlot, ModContent.ItemType<SulphurousFountainItem>());
SetShopItem(ref shop, ref nextSlot, ModContent.ItemType<AbyssFountainItem>(), Main.hardMode);
SetShopItem(ref shop, ref nextSlot, ModContent.ItemType<AstralFountainItem>(), Main.hardMode);
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));
+3
View File
@@ -10,6 +10,8 @@ using CalamityMod.Tiles.SunkenSea;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System.Reflection;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -18,6 +20,7 @@ namespace CalamityMod.Tiles
{
public class CalamityGlobalTile : GlobalTile
{
public static IList<ModWaterStyle> WaterStyles => (IList<ModWaterStyle>)typeof(WaterStyleLoader).GetField("waterStyles", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
public static ushort[] PlantTypes = new ushort[]
{
TileID.Plants,
@@ -0,0 +1,82 @@
using Microsoft.Xna.Framework;
using System.Linq;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Items.Placeables.Furniture.Fountains;
namespace CalamityMod.Tiles.Furniture.Fountains
{
public class AbyssFountainTile : ModTile
{
public override void SetDefaults()
{
this.SetUpFountain();
ModTranslation name = CreateMapEntryName();
name.SetDefault("Abyss Fountain");
AddMapEntry(new Color(71, 93, 107), name);
animationFrameHeight = 72;
}
public override void NearbyEffects(int i, int j, bool closer)
{
if (Main.tile[i, j].frameX < 36)
{
if (CalamityGlobalTile.WaterStyles.Any((style) => style.Name == "AbyssWater"))
{
Main.fountainColor = CalamityGlobalTile.WaterStyles.FirstOrDefault((style) => style.Name == "AbyssWater").Type;
}
}
}
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<AbyssFountainItem>());
}
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<AbyssFountainItem>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -0,0 +1,83 @@
using Microsoft.Xna.Framework;
using System.Linq;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Dusts;
using CalamityMod.Items.Placeables.Furniture.Fountains;
namespace CalamityMod.Tiles.Furniture.Fountains
{
public class AstralFountainTile : ModTile
{
public override void SetDefaults()
{
this.SetUpFountain();
ModTranslation name = CreateMapEntryName();
name.SetDefault("Astral Fountain");
AddMapEntry(new Color(59, 50, 77), name);
animationFrameHeight = 72;
}
public override void NearbyEffects(int i, int j, bool closer)
{
if (Main.tile[i, j].frameX < 36)
{
if (CalamityGlobalTile.WaterStyles.Any((style) => style.Name == "AstralWater"))
{
Main.fountainColor = CalamityGlobalTile.WaterStyles.FirstOrDefault((style) => style.Name == "AstralWater").Type;
}
}
}
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, ModContent.DustType<AstralBlue>());
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, ModContent.DustType<AstralOrange>());
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<AstralFountainItem>());
}
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<AstralFountainItem>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -0,0 +1,82 @@
using Microsoft.Xna.Framework;
using System.Linq;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Items.Placeables.Furniture.Fountains;
namespace CalamityMod.Tiles.Furniture.Fountains
{
public class SulphurousFountainTile : ModTile
{
public override void SetDefaults()
{
this.SetUpFountain();
ModTranslation name = CreateMapEntryName();
name.SetDefault("Sulphuric Fountain");
AddMapEntry(new Color(104, 195, 255), name);
animationFrameHeight = 72;
}
public override void NearbyEffects(int i, int j, bool closer)
{
if (Main.tile[i, j].frameX < 36)
{
if (CalamityGlobalTile.WaterStyles.Any((style) => style.Name == "SulphuricWater"))
{
Main.fountainColor = CalamityGlobalTile.WaterStyles.FirstOrDefault((style) => style.Name == "SulphuricWater").Type;
}
}
}
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<SulphurousFountainItem>());
}
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<SulphurousFountainItem>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -1,7 +1,6 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Items.Placeables.Furniture.Fountains;
@@ -20,17 +19,13 @@ namespace CalamityMod.Tiles.Furniture.Fountains
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;
}
}
if (Main.tile[i, j].frameX < 36)
{
if (CalamityGlobalTile.WaterStyles.Any((style) => style.Name == "SunkenSeaWater"))
{
Main.fountainColor = CalamityGlobalTile.WaterStyles.FirstOrDefault((style) => style.Name == "SunkenSeaWater").Type;
}
}
}
public override bool HasSmartInteract()
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Waters
public override bool ChooseWaterStyle()
{
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
return (modPlayer.ZoneAbyss && modPlayer.fountain == 0) || modPlayer.fountain == 2;
return modPlayer.ZoneAbyss;
}
public override int ChooseWaterfallStyle()
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Waters
public override bool ChooseWaterStyle()
{
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
return (modPlayer.ZoneAstral && modPlayer.fountain == 0) || modPlayer.fountain == 4;
return modPlayer.ZoneAstral;
}
public override int ChooseWaterfallStyle()
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Waters
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
bool greenWater = (inXZone && inYZone) || modPlayer.ZoneSulphur;
return (greenWater && modPlayer.fountain == 0) || modPlayer.fountain == 3;
return greenWater;
}
public override int ChooseWaterfallStyle()
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Waters
public override bool ChooseWaterStyle()
{
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
return (modPlayer.ZoneSunkenSea && modPlayer.fountain == 0) || modPlayer.fountain == 1;
return modPlayer.ZoneSunkenSea;
}
public override int ChooseWaterfallStyle()