Deific uses Sweetheart Necklace. Toggles for Deific+ and Talisman
This commit is contained in:
1 parent
90b84e6be3
commit
82078fa821
6 files changed
+173
-12
No files matched your search
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using CalamityMod.Balancing;
|
||||
using CalamityMod.Buffs.Cooldowns;
|
||||
@@ -2546,7 +2546,8 @@ namespace CalamityMod.CalPlayer
|
||||
Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, 0f, ModContent.ProjectileType<HideOfAstrumDeusExplosion>(), blazeDamage, 5f, Player.whoAmI, 0f, 1f);
|
||||
}
|
||||
// TODO -- Make Deific Amulet and Rampart of Deities' retaliation effects way cooler
|
||||
// In the meantime, gave them homing astral bombers instead of the lame falling stars
|
||||
// In the meantime, gave them homing astral stars instead of the lame falling stars.
|
||||
// This also serves to make the Honeycomb in Sweetheart Necklace make sense
|
||||
if (dAmulet)
|
||||
{
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<DeificAmulet>()));
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.SunkenSea;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
@@ -23,20 +28,61 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
#region Toggleable Panic Necklace
|
||||
|
||||
bool panicNecklaceEnabled = true;
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.FindAndReplace("[TOGGLE]", panicNecklaceEnabled ? this.GetLocalizedValue("ToggleEffect") : "");
|
||||
}
|
||||
public override bool CanRightClick() => Main.keyState.PressingShift();
|
||||
public override void RightClick(Player player)
|
||||
{
|
||||
panicNecklaceEnabled = !panicNecklaceEnabled;
|
||||
Item.NetStateChanged();
|
||||
}
|
||||
public override bool ConsumeItem(Player player) => false;
|
||||
public override void SaveData(TagCompound tag)
|
||||
{
|
||||
tag.Add("panic", panicNecklaceEnabled);
|
||||
}
|
||||
|
||||
public override void LoadData(TagCompound tag)
|
||||
{
|
||||
panicNecklaceEnabled = tag.GetBool("panic");
|
||||
}
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(panicNecklaceEnabled);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
panicNecklaceEnabled = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
CalamityUtils.DrawInventoryDot(spriteBatch, position, new Vector2(16, 16) * Main.inventoryScale, panicNecklaceEnabled);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
player.longInvince = true;
|
||||
modPlayer.dAmulet = true;
|
||||
player.panic = panicNecklaceEnabled;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.StarVeil).
|
||||
AddIngredient(ItemID.SweetheartNecklace).
|
||||
AddIngredient<AstralBar>(10).
|
||||
AddIngredient<SeaPrism>(15).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
AddTile(TileID.TinkerersWorkbench).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
@@ -19,14 +24,53 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.accessory = true;
|
||||
Item.rare = ModContent.RarityType<CosmicPurple>();
|
||||
}
|
||||
#region Toggleable Mana Flower
|
||||
|
||||
bool manaFlowerEnabled = true;
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
if (!manaFlowerEnabled)
|
||||
tooltips.RemoveAll(x => x.Name == "Tooltip3");
|
||||
}
|
||||
public override bool CanRightClick() => Main.keyState.PressingShift();
|
||||
public override void RightClick(Player player)
|
||||
{
|
||||
manaFlowerEnabled = !manaFlowerEnabled;
|
||||
Item.NetStateChanged();
|
||||
}
|
||||
public override bool ConsumeItem(Player player) => false;
|
||||
public override void SaveData(TagCompound tag)
|
||||
{
|
||||
tag.Add("manaFlower", manaFlowerEnabled);
|
||||
}
|
||||
|
||||
public override void LoadData(TagCompound tag)
|
||||
{
|
||||
manaFlowerEnabled = tag.GetBool("manaFlower");
|
||||
}
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(manaFlowerEnabled);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
manaFlowerEnabled = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
CalamityUtils.DrawInventoryDot(spriteBatch, position, new Vector2(16, 16) * Main.inventoryScale, manaFlowerEnabled);
|
||||
}
|
||||
#endregion
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.eTalisman = true;
|
||||
|
||||
player.manaMagnet = true;
|
||||
if (!hideVisual)
|
||||
if (manaFlowerEnabled)
|
||||
player.manaFlower = true;
|
||||
|
||||
player.statManaMax2 += 150;
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
@@ -13,6 +19,7 @@ namespace CalamityMod.Items.Accessories
|
||||
public class RampartofDeities : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 64;
|
||||
@@ -23,6 +30,45 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.rare = ModContent.RarityType<BurnishedAuric>();
|
||||
}
|
||||
|
||||
#region Toggleable Panic Necklace
|
||||
|
||||
bool panicNecklaceEnabled = true;
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.FindAndReplace("[TOGGLE]", panicNecklaceEnabled ? this.GetLocalizedValue("ToggleEffect") : "");
|
||||
}
|
||||
public override bool CanRightClick() => Main.keyState.PressingShift();
|
||||
public override void RightClick(Player player)
|
||||
{
|
||||
panicNecklaceEnabled = !panicNecklaceEnabled;
|
||||
Item.NetStateChanged();
|
||||
}
|
||||
public override bool ConsumeItem(Player player) => false;
|
||||
public override void SaveData(TagCompound tag)
|
||||
{
|
||||
tag.Add("panic", panicNecklaceEnabled);
|
||||
}
|
||||
|
||||
public override void LoadData(TagCompound tag)
|
||||
{
|
||||
panicNecklaceEnabled = tag.GetBool("panic");
|
||||
}
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(panicNecklaceEnabled);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
panicNecklaceEnabled = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
CalamityUtils.DrawInventoryDot(spriteBatch, position, new Vector2(16, 16) * Main.inventoryScale, panicNecklaceEnabled);
|
||||
}
|
||||
#endregion
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
@@ -31,6 +77,9 @@ namespace CalamityMod.Items.Accessories
|
||||
player.longInvince = true;
|
||||
modPlayer.dAmulet = true;
|
||||
|
||||
//Panic Necklace effect if enabled
|
||||
player.panic = panicNecklaceEnabled;
|
||||
|
||||
// Large hit iframe effect taken from Seraph Tracers
|
||||
modPlayer.rampartOfDeities = true;
|
||||
|
||||
|
||||
@@ -573,10 +573,13 @@ DeificAmulet: {
|
||||
DisplayName: Deific Amulet
|
||||
Tooltip:
|
||||
'''
|
||||
Causes stars to fall and increases length of invincibility after taking damage
|
||||
Grants bonus invincibility frames based on your missing health
|
||||
Releases a burst of homing stars [TOGGLE]after taking damage
|
||||
Increases the length of invincibility from various sources
|
||||
Grants bonus invincibility frames when hurt, based on your missing health
|
||||
This effect scales from 10 frames at full HP to 40 frames at 25% or less HP
|
||||
[c/aaaaaa:Shift-<right> this item in your inventory to toggle] [i:PanicNecklace] [c/aaaaaa:Panic Necklace's effect]
|
||||
'''
|
||||
ToggleEffect: "and increases movement speed "
|
||||
}
|
||||
|
||||
DepthCharm: {
|
||||
@@ -751,7 +754,8 @@ EtherealTalisman: {
|
||||
15% increased magic damage, 5% increased magic critical strike chance
|
||||
+150 max mana and 10% decreased mana usage
|
||||
Increases pickup range for mana stars
|
||||
You automatically use mana potions when needed if visibility is on
|
||||
You automatically use mana potions when needed
|
||||
[c/aaaaaa:Shift-<right> to toggle] [i:ManaFlower] [c/aaaaaa:Mana Flower's effect]
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1433,14 +1437,17 @@ RampartofDeities: {
|
||||
DisplayName: Rampart of Deities
|
||||
Tooltip:
|
||||
'''
|
||||
Causes stars to fall and increases length of invincibility after taking damage
|
||||
Grants bonus invincibility frames based on your missing health
|
||||
Releases a burst of homing stars [TOGGLE]after taking damage
|
||||
Increases the length of invincibility from various sources
|
||||
Grants bonus invincibility frames when struck, based on your missing health
|
||||
This effect scales from 10 frames at full HP to 40 frames at 25% or less HP
|
||||
Being struck for over 200 damage grants 30 additional invincibility frames
|
||||
Grants immunity to knockback
|
||||
Puts a shell around the owner when below 50% life that reduces damage by 25%
|
||||
Absorbs 25% of damage done to players on your team when above 25% life
|
||||
[c/aaaaaa:Shift-<right> this item in your inventory to toggle] [i:PanicNecklace] [c/aaaaaa:Panic Necklace's effect]
|
||||
'''
|
||||
ToggleEffect: "and increases movement speed "
|
||||
}
|
||||
|
||||
RareElementalinaBottle: {
|
||||
|
||||
@@ -293,6 +293,20 @@ namespace CalamityMod
|
||||
spriteBatch.Draw(texture, position, frame, drawColor, 0f, origin, wantedScale, SpriteEffects.None, 0);
|
||||
}
|
||||
|
||||
static Asset<Texture2D> ItemDotTexture;
|
||||
/// <summary>
|
||||
/// Draws an enabled/disabled dot at the bottom right of the item's sprite
|
||||
/// Used for effects that are enabled/disabled
|
||||
/// </summary>
|
||||
/// <param name="itemPosition"></param>
|
||||
/// <param name="enabled"></param>
|
||||
public static void DrawInventoryDot(SpriteBatch spriteBatch, Vector2 itemPosition, Vector2 dotOffset, bool enabled)
|
||||
{
|
||||
var tex = CalamityUtils.GetTextureEfficient(ref ItemDotTexture, "Terraria/Images/Extra_20").Value;
|
||||
var dotFrame = tex.Frame(1,4, frameY: enabled ? 1 : 2);
|
||||
spriteBatch.Draw(tex, itemPosition + dotOffset, dotFrame, Color.White, 0, dotFrame.Size() * 0.5f, Main.inventoryScale, SpriteEffects.None, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws a treasure bag in the world in the exact same way as how Terraria 1.4's bags are drawn.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user