Skip to content

Commit

Permalink
Added colored variations of Spell Resonator
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurocosh committed Mar 31, 2024
1 parent 30b1765 commit e0efa89
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Common/System/TomeSpawnSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Spellwright.Content.Items;
using Spellwright.Content.Items.Resonators;
using Spellwright.Content.Items.SpellTomes;
using System;
using System.Collections.Generic;
Expand All @@ -14,6 +14,9 @@ internal class ChestItemSpawnSystem : ModSystem
public override void PostWorldGen()
{
PlaceItemsInChests(ModContent.ItemType<SpellResonator>(), 3, new int[] { 0, 1 });
PlaceItemsInChests(ModContent.ItemType<SpellResonatorBlue>(), 2, new int[] { 0, 1 });
PlaceItemsInChests(ModContent.ItemType<SpellResonatorPurple>(), 2, new int[] { 0, 1 });
PlaceItemsInChests(ModContent.ItemType<SpellResonatorRed>(), 2, new int[] { 0, 1 });
PlaceItemsInChests(ModContent.ItemType<BeginnerSpellTome>(), 30, new int[] { 0, 1 });
PlaceItemsInChests(ModContent.ItemType<AdvancedSpellTome>(), 25, new int[] { 0, 1 });
PlaceItemsInChests(ModContent.ItemType<SupremeSpellTome>(), 15, new int[] { 0, 1, 2 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Terraria.ModLoader;
using Terraria.ModLoader.IO;

namespace Spellwright.Content.Items
namespace Spellwright.Content.Items.Resonators
{
public class SpellResonator : ModItem
{
Expand Down
File renamed without changes
12 changes: 12 additions & 0 deletions Content/Items/Resonators/SpellResonatorBlue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Spellwright.Content.Items.Resonators
{
internal class SpellResonatorBlue : SpellResonator
{
}
}
Binary file added Content/Items/Resonators/SpellResonatorBlue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Content/Items/Resonators/SpellResonatorPurple.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Spellwright.Content.Items.Resonators
{
internal class SpellResonatorPurple : SpellResonator
{
}
}
Binary file added Content/Items/Resonators/SpellResonatorPurple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Content/Items/Resonators/SpellResonatorRed.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Spellwright.Content.Items.Resonators
{
internal class SpellResonatorRed : SpellResonator
{
}
}
Binary file added Content/Items/Resonators/SpellResonatorRed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion Content/NPCs/SpellwrightNPC.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Spellwright.Common.Players;
using Spellwright.Content.Items;
using Spellwright.Content.Items.Mirrors;
using Spellwright.Content.Items.Reagents;
using Spellwright.Content.Items.Resonators;
using Spellwright.Content.Items.SpellTomes;
using Spellwright.Content.Items;
using Spellwright.Content.Projectiles;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -210,6 +211,9 @@ public override void AddShops()
{
var npcShop = new NPCShop(Type, "SpellwrightShop")
.Add<SpellResonator>()
.Add<SpellResonatorBlue>()
.Add<SpellResonatorPurple>()
.Add<SpellResonatorRed>()
.Add<SilverMirror>()
.Add<CommonSpellReagent>()
.Add<RareSpellReagent>()
Expand Down
6 changes: 3 additions & 3 deletions Content/Spells/SpellProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.Xna.Framework;
using Spellwright.Common.Players;
using Spellwright.Config;
using Spellwright.Content.Items;
using Spellwright.Content.Items.Resonators;
using Spellwright.Content.Spells.Base;
using Spellwright.Content.Spells.Base.Modifiers;
using Spellwright.Core.Spells;
Expand Down Expand Up @@ -63,9 +63,9 @@ public static SpellCastResult ProcessCast(string incantationText)
var itemType = ModContent.ItemType<SpellResonator>();

var item = player.inventory[player.selectedItem];
if (item.type != itemType)
if (item.ModItem is not SpellResonator)
{
item = player.InventoryFindItem(itemType, InventoryArea.Hotbar);
item = player.InventoryFindItem(item => item.ModItem is SpellResonator, InventoryArea.Hotbar);
if (item == null)
return SpellCastResult.NoResonatorToBind;
}
Expand Down
17 changes: 16 additions & 1 deletion Localization/en-US.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ Mods: {

SpellResonator: {
Type: Tool
Description: Special tool required to cast a subtype of spells called Echo spells. To use this item you have to bind a spell to it. To do so you have to cast any Echo spell while this item is located in your toolbar. When you successfully bind a spell, the name of the spell will be displayed in the name of the item. If you hover your mouse over the resonator with a spell a tooltip with additional information will appear, such as spell level and damage. Resonator with bound spell can be used like any standard projectile shooting item, point it in the direction that you wanna shoot and left click. Can be bought from Spellwright.
Description: Special tool required to cast a subtype of spells called Echo spells. To use this item you have to bind a spell to it. To do so you have to cast any Echo spell while this item is located in your toolbar. When you successfully bind a spell, the name of the spell will be displayed in the name of the item. If you hover your mouse over the resonator with a spell a tooltip with additional information will appear, such as spell level and damage. Resonator with bound spell can be used like any standard projectile shooting item, point it in the direction that you wanna shoot and left click. Can be bought from Spellwright. Comes in several colored versions. The difference between colored versions of the Spell Resonator is purely cosmetic.
}
}
}
Expand Down Expand Up @@ -1161,6 +1161,21 @@ Mods: {
DisplayName: Example Buff Potion
Tooltip: Gives a light defense buff.
}

SpellResonatorBlue: {
DisplayName: Spell Resonator Blue
Tooltip: Magical artefact resonating with your voice and capable of binding your words to itself.
}

SpellResonatorPurple: {
DisplayName: Spell Resonator Purple
Tooltip: Magical artefact resonating with your voice and capable of binding your words to itself.
}

SpellResonatorRed: {
DisplayName: Spell Resonator Red
Tooltip: Magical artefact resonating with your voice and capable of binding your words to itself.
}
}

Projectiles: {
Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
displayName = Spellwright
author = Aurocosh
version = 0.8.3.0
version = 0.8.3.1
dllReferences = NetSerializer
languageVersion = 7
buildIgnore = *.csproj, *.sln, *.user, *.md, obj\*, bin\*, .vs\*, .git\*, .gitignore
Expand Down

0 comments on commit e0efa89

Please sign in to comment.