WillOWisp
This commit is contained in:
1 parent
6218083e5f
commit
4b2985d98d
7 files changed
+91
-5
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using CalamityMod.Items.Placeables.SunkenSea;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -25,10 +26,9 @@ namespace CalamityMod.Items.Materials
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<PearlShard>(2).
|
||||
AddIngredient(ItemID.Coral, 2).
|
||||
AddIngredient(ItemID.Starfish, 2).
|
||||
AddIngredient(ItemID.Seashell, 2).
|
||||
AddIngredient<WillOWisp>(1).
|
||||
//AddIngredient<PolypItem>(2).
|
||||
AddIngredient<PearlShard>(3).
|
||||
AddTile(TileID.Furnaces).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
using CalamityMod.Cooldowns;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
|
||||
namespace CalamityMod.Items.Materials
|
||||
{
|
||||
public class WillOWisp : ModItem, ILocalizedModType
|
||||
{
|
||||
public int textureVariant = 0;
|
||||
|
||||
public static Asset<Texture2D> altTexture = null;
|
||||
public new string LocalizationCategory => "Items.Materials";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 25;
|
||||
ItemID.Sets.SortingPriorityMaterials[Type] = 60; // Meteorite
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 20;
|
||||
Item.height = 26;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
Item.value = Item.sellPrice(silver: 1);
|
||||
Item.rare = ItemRarityID.Green;
|
||||
}
|
||||
|
||||
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
|
||||
{
|
||||
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Material;
|
||||
}
|
||||
|
||||
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
||||
{
|
||||
if (textureVariant == 0)
|
||||
return true;
|
||||
else
|
||||
{
|
||||
spriteBatch.Draw(altTexture.Value, Item.Center - Main.screenPosition, null, lightColor, rotation, altTexture.Size() / 2, scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
if (textureVariant == 0)
|
||||
return true;
|
||||
else
|
||||
{
|
||||
spriteBatch.Draw(altTexture.Value, position, null, drawColor, 0, altTexture.Size() / 2, scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override void OnSpawn(IEntitySource source)
|
||||
{
|
||||
textureVariant = Main.rand.NextBool().ToInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 475 B |
Binary file not shown.
|
After Width: | Height: | Size: 420 B |
@@ -326,3 +326,8 @@ AnodizedWulfrumMetal: {
|
||||
DisplayName: Anodized Wulfrum Metal
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
WillOWisp: {
|
||||
DisplayName: Will O Wisp
|
||||
Tooltip: ""
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
using System.IO;
|
||||
using CalamityMod.BiomeManagers;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Enemy;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -216,5 +219,9 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
spriteBatch.Draw(tex, NPC.Center - screenPos, frame, drawColor, NPC.rotation, frame.Size() / 2f, NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ModContent.ItemType<WillOWisp>(), 1, 1, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Utilities;
|
||||
using System.IO;
|
||||
using CalamityMod.Items.Materials;
|
||||
|
||||
namespace CalamityMod.NPCs.SunkenSea
|
||||
{
|
||||
@@ -179,5 +180,9 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ModContent.ItemType<WillOWisp>(), 1, 1, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user