diff --git a/Content/Buffs/Debuffs/Hyperthermic.cs b/Content/Buffs/Debuffs/Hyperthermic.cs index 9bc07e8..ffc7b3d 100644 --- a/Content/Buffs/Debuffs/Hyperthermic.cs +++ b/Content/Buffs/Debuffs/Hyperthermic.cs @@ -1,7 +1,5 @@ -using System; -using Decimation.Lib.Buffs; +using Decimation.Lib.Buffs; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace Decimation.Content.Buffs.Debuffs @@ -9,7 +7,10 @@ namespace Decimation.Content.Buffs.Debuffs internal class Hyperthermic : DecimationBuff { protected override string DisplayName => "Hyperthermic!"; - protected override string Description => "Water, water everywhere but not a drop to drink... \nBlock mana potions use \nLowers defense by 10% \nLowers speed by 5%"; + + protected override string Description => + "Water, water everywhere but not a drop to drink... \nBlock mana potions use \nLowers defense by 10% \nLowers speed by 5%"; + public override bool Debuff => true; protected override void Init() @@ -21,13 +22,13 @@ namespace Decimation.Content.Buffs.Debuffs public override void Update(Player player, ref int buffIndex) { - player.statDefense = (int)(player.statDefense * 0.90f); + player.statDefense = (int) (player.statDefense * 0.90f); player.moveSpeed *= 0.95f; } public override void Update(NPC npc, ref int buffIndex) { - npc.defense = (int)(npc.defense * 0.90f); + npc.defense = (int) (npc.defense * 0.90f); npc.velocity *= 0.95f; } } @@ -36,7 +37,8 @@ namespace Decimation.Content.Buffs.Debuffs { public override bool CanUseItem(Item item, Player player) { - return !(player.HasBuff(ModContent.BuffType()) && item.healMana > 0); + if (player.HasBuff(ModContent.BuffType()) && item.healMana > 0) return false; + return base.CanUseItem(item, player); } } -} +} \ No newline at end of file diff --git a/Content/Buffs/Debuffs/Singed.cs b/Content/Buffs/Debuffs/Singed.cs index c95c688..da33b9d 100644 --- a/Content/Buffs/Debuffs/Singed.cs +++ b/Content/Buffs/Debuffs/Singed.cs @@ -41,7 +41,7 @@ namespace Decimation.Content.Buffs.Debuffs { return !(item.UseSound != null && item.useStyle == 2); } - return true; + return base.CanUseItem(item, player); } } } \ No newline at end of file diff --git a/Content/Buffs/Debuffs/Slimed.cs b/Content/Buffs/Debuffs/Slimed.cs index ac13dcd..87a0cee 100644 --- a/Content/Buffs/Debuffs/Slimed.cs +++ b/Content/Buffs/Debuffs/Slimed.cs @@ -42,7 +42,7 @@ namespace Decimation.Content.Buffs.Debuffs { return !(item.UseSound != null && item.useStyle == 2); } - return true; + return base.CanUseItem(item, player); } } } \ No newline at end of file diff --git a/Content/DecimationPlayer.cs b/Content/DecimationPlayer.cs index 18f524a..bd60bcb 100644 --- a/Content/DecimationPlayer.cs +++ b/Content/DecimationPlayer.cs @@ -865,6 +865,7 @@ namespace Decimation.Content DecimationPlayer modPlayer = player.GetModPlayer(); if (item.type == ItemID.CobaltShield || item.type == ItemID.AnkhShield || item.type == ItemID.PaladinsShield || item.type == ItemID.ObsidianShield) modPlayer.HasShield = true; + base.UpdateAccessory(item, player, hideVisual); } } } \ No newline at end of file diff --git a/Content/Items/CursedItem.cs b/Content/Items/CursedItem.cs index ebb1baf..11a2d02 100644 --- a/Content/Items/CursedItem.cs +++ b/Content/Items/CursedItem.cs @@ -142,14 +142,17 @@ namespace Decimation.Content.Items CursedNPC.DamageBonus = 7; } } + + base.UpdateAccessory(item, player, hideVisual); } public override bool CanEquipAccessory(Item item, Player player, int slot) { // Maximize to one cursed item at once DecimationPlayer modPlayer = player.GetModPlayer(); - return !modPlayer.hasCursedAccessory || - modPlayer.hasCursedAccessory && !item.GetGlobalItem().Cursed; + if (!modPlayer.hasCursedAccessory || + modPlayer.hasCursedAccessory && !item.GetGlobalItem().Cursed) return true; + return base.CanEquipAccessory(item, player, slot); } public override void NetSend(Item item, BinaryWriter writer) @@ -272,12 +275,7 @@ namespace Decimation.Content.Items } } - return false; - } - - public override bool ConsumeItem(Item item, Player player) - { - return true; + return base.UseItem(item, player); } } } \ No newline at end of file diff --git a/Content/Items/Placeable/ShrineoftheMoltenOne/ShrineAltar.cs b/Content/Items/Placeable/ShrineoftheMoltenOne/ShrineAltar.cs index 2467fd7..0dacbf9 100644 --- a/Content/Items/Placeable/ShrineoftheMoltenOne/ShrineAltar.cs +++ b/Content/Items/Placeable/ShrineoftheMoltenOne/ShrineAltar.cs @@ -1,4 +1,6 @@ using Decimation.Lib.Items; +using Decimation.Lib.Util; +using Terraria.DataStructures; using Terraria.ModLoader; namespace Decimation.Content.Items.Placeable.ShrineoftheMoltenOne @@ -7,11 +9,14 @@ namespace Decimation.Content.Items.Placeable.ShrineoftheMoltenOne { protected override string ItemName => "Shrine Altar"; protected override int Tile => ModContent.TileType(); + protected override DrawAnimation Animation => new DrawAnimationVertical(5, 6); protected override void InitPlaceable() { - item.width = 66; - item.height = 32; + item.width = 68; + item.height = 42; + item.maxStack = 1; + item.rare = Rarity.Red.GetRarityValue(); } } } \ No newline at end of file diff --git a/Content/Items/Placeable/ShrineoftheMoltenOne/ShrineAltar.png b/Content/Items/Placeable/ShrineoftheMoltenOne/ShrineAltar.png index 51f496c..c2397d5 100644 Binary files a/Content/Items/Placeable/ShrineoftheMoltenOne/ShrineAltar.png and b/Content/Items/Placeable/ShrineoftheMoltenOne/ShrineAltar.png differ diff --git a/Content/Synergies/FireAmuletSynergy.cs b/Content/Synergies/FireAmuletSynergy.cs index 61ece36..43754da 100644 --- a/Content/Synergies/FireAmuletSynergy.cs +++ b/Content/Synergies/FireAmuletSynergy.cs @@ -45,7 +45,7 @@ namespace Decimation.Content.Synergies Main.projectile[proj].friendly = true; } - return true; + return base.UseItem(item, player); } } diff --git a/Content/Tiles/ShrineoftheMoltenOne/ShrineAltar.cs b/Content/Tiles/ShrineoftheMoltenOne/ShrineAltar.cs index 806fc09..8a459e3 100644 --- a/Content/Tiles/ShrineoftheMoltenOne/ShrineAltar.cs +++ b/Content/Tiles/ShrineoftheMoltenOne/ShrineAltar.cs @@ -1,37 +1,39 @@ -using Decimation.Content.Items; -using Decimation.Content.Items.Boss.Arachnus; +using Decimation.Content.Items.Boss.Arachnus; using Decimation.Content.NPCs.Arachnus; +using Decimation.Lib.Tiles; +using Decimation.Lib.Util; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.World.Generation; namespace Decimation.Content.Tiles.ShrineoftheMoltenOne { - class ShrineAltar : ModTile + class ShrineAltar : DecimationMultiTile { - public override void SetDefaults() + public override Color MapColor => new Color(33, 28, 25); + public override int TileItem => ModContent.ItemType(); + public override TileObjectData Style => TileObjectData.Style5x4; + public override int? Height => 3; + public override Point16 Origin => new Point16(2, 1); + public override string Name => "Shrine Altar"; + public override int DustType => DustID.LavaMoss; + public override int? AnimationFrameCount => 6; + public override int? AnimationFrameHeight => 54; + public override bool HasLight => true; + + private readonly Vector3 _lightColor = LightingUtils.Rgb255ToRgb1(255, 155, 48); + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - Main.tileSolidTop[Type] = false; - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style5x4); - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; - TileObjectData.addTile(Type); - ModTranslation name = CreateMapEntryName(); - name.SetDefault("Shrine Altar"); - AddMapEntry(new Color(33, 28, 25), name); - dustType = DustID.LavaMoss; - disableSmartCursor = true; + r = _lightColor.X; + g = _lightColor.Y; + b = _lightColor.Z; } - public override void RightClick(int i, int j) + public override bool NewRightClick(int i, int j) { Player player = Main.LocalPlayer; Item[] inventory = player.inventory; @@ -51,17 +53,19 @@ namespace Decimation.Content.Tiles.ShrineoftheMoltenOne if (Main.netMode == 1) { ModPacket packet = mod.GetPacket(); - packet.Write((byte)DecimationModMessageType.SpawnBoss); + packet.Write((byte) DecimationModMessageType.SpawnBoss); packet.Write(ModContent.NPCType()); packet.Write(player.whoAmI); packet.Send(); } else if (Main.netMode == 0) { - Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); + Main.PlaySound(15, (int) player.position.X, (int) player.position.Y, 0); NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); } } + + return inventoryContainAmulet; } public override void MouseOver(int i, int j) @@ -72,14 +76,9 @@ namespace Decimation.Content.Tiles.ShrineoftheMoltenOne player.showItemIcon2 = ModContent.ItemType(); } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(i * 16, j * 16, 80, 32, ModContent.ItemType()); - } - public override bool CanKillTile(int i, int j, ref bool blockDamaged) { return DecimationWorld.downedArachnus; } } -} +} \ No newline at end of file diff --git a/Content/Tiles/ShrineoftheMoltenOne/ShrineAltar.png b/Content/Tiles/ShrineoftheMoltenOne/ShrineAltar.png index 8f1e64a..1169a13 100644 Binary files a/Content/Tiles/ShrineoftheMoltenOne/ShrineAltar.png and b/Content/Tiles/ShrineoftheMoltenOne/ShrineAltar.png differ diff --git a/Content/Tiles/TitanForge.cs b/Content/Tiles/TitanForge.cs index 52da694..bb48a26 100644 --- a/Content/Tiles/TitanForge.cs +++ b/Content/Tiles/TitanForge.cs @@ -12,7 +12,7 @@ namespace Decimation.Content.Tiles public override string Name => "Titan Forge"; public override Color MapColor => new Color(104, 140, 183); public override int DustType => DustID.Iron; - public override int AnimationFrameCount => 8; + public override int? AnimationFrameCount => 8; public override int? AnimationFrameHeight => 54; public override int TileItem => ModContent.ItemType(); } diff --git a/Lib/Items/DecimationPlaceableItem.cs b/Lib/Items/DecimationPlaceableItem.cs index b180190..3ca54c6 100644 --- a/Lib/Items/DecimationPlaceableItem.cs +++ b/Lib/Items/DecimationPlaceableItem.cs @@ -16,7 +16,6 @@ item.useStyle = 1; item.autoReuse = true; item.useTurn = true; - InitPlaceable(); diff --git a/Lib/Tiles/DecimationMultiTile.cs b/Lib/Tiles/DecimationMultiTile.cs index bce788d..d965112 100644 --- a/Lib/Tiles/DecimationMultiTile.cs +++ b/Lib/Tiles/DecimationMultiTile.cs @@ -40,14 +40,23 @@ namespace Decimation.Lib.Tiles TileObjectData.newTile.CoordinateHeights = CoordinateHeights; TileObjectData.newTile.CoordinateWidth = CoordinateWidth; TileObjectData.newTile.CoordinatePadding = CoordinatePadding; + TileObjectData.newTile.Origin = Origin; if (AnchorBottom) TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width - 1, 0); TileObjectData.addTile(Type); + // TODO not working + // if (AnimationFrameCount.HasValue && !AnimationFrameHeight.HasValue) + // { + // AnimationFrameHeight = (16 + TileObjectData.newTile.CoordinatePadding) * TileObjectData.newTile.Height; + // } + _width = TileObjectData.newTile.Width * 16; _height = TileObjectData.newTile.Height * 16; } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Lib/Tiles/DecimationTile.cs b/Lib/Tiles/DecimationTile.cs index 1f6cdbe..d9f95d8 100644 --- a/Lib/Tiles/DecimationTile.cs +++ b/Lib/Tiles/DecimationTile.cs @@ -10,11 +10,12 @@ namespace Decimation.Lib.Tiles public virtual bool SolidTop { get; set; } = false; public virtual bool TilesCanAttach { get; set; } = false; public virtual bool DisableSmartCursor { get; set; } = false; + public virtual bool HasLight { get; } = false; public virtual float MineResistance { get; set; } = 1f; public virtual int DustType { get; } = 0; - public virtual int AnimationFrameCount { get; } = 0; + public virtual int? AnimationFrameCount { get; } = null; public virtual int AnimationFps { get; } = 5; - public virtual int? AnimationFrameHeight { get; } = null; + public virtual int? AnimationFrameHeight { get; set; } public virtual string Name { get; } = null; public virtual int MinimumPickaxePower { get; set; } = 0; @@ -26,12 +27,12 @@ namespace Decimation.Lib.Tiles Main.tileSolid[Type] = Solid; Main.tileSolidTop[Type] = SolidTop; Main.tileNoAttach[Type] = !TilesCanAttach; + Main.tileLighted[Type] = HasLight; minPick = MinimumPickaxePower; mineResist = MineResistance; dustType = DustType; drop = TileItem; disableSmartCursor = DisableSmartCursor; - if (AnimationFrameHeight.HasValue) animationFrameHeight = AnimationFrameHeight.Value; if (Name == null) { @@ -45,6 +46,8 @@ namespace Decimation.Lib.Tiles } InitTile(); + + if (AnimationFrameHeight.HasValue) animationFrameHeight = AnimationFrameHeight.Value; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -54,6 +57,8 @@ namespace Decimation.Lib.Tiles public override void AnimateTile(ref int frame, ref int frameCounter) { + if (!AnimationFrameCount.HasValue) return; + frameCounter++; if (frameCounter > AnimationFps) {