Merge: Delicious Meat nerfs
This commit is contained in:
2 files changed
+40
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Effects;
|
||||
using CalamityMod.Items.Tools;
|
||||
using Terraria.Localization;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Systems.Graphic.PixelationSystem;
|
||||
using CalamityMod.Utilities.Daybreak;
|
||||
@@ -19,8 +19,10 @@ namespace CalamityMod.Items.Potions.Food
|
||||
{
|
||||
private static Asset<Texture2D> FadedStarRing;
|
||||
private static Asset<Texture2D> BloomFlare;
|
||||
private static int DeliciousMeatCooldown = CalamityUtils.MinutesToFrames(15);
|
||||
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DeliciousMeatCooldown / 60).FramesToSeconds());
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
@@ -56,11 +58,17 @@ namespace CalamityMod.Items.Potions.Food
|
||||
Item.UseSound = SoundID.Item2;
|
||||
Item.useStyle = ItemUseStyleID.EatFood;
|
||||
Item.buffType = BuffID.WellFed2;
|
||||
Item.buffTime = CalamityUtils.MinutesToFrames(30);
|
||||
Item.buffTime = CalamityUtils.MinutesToFrames(15);
|
||||
Item.useTurn = true;
|
||||
Item.consumable = false;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player) => player.GetModPlayer<DeliciousMeatPlayer>().deliciousMeatCooldown <= 0;
|
||||
public override bool? UseItem(Player player)
|
||||
{
|
||||
player.GetModPlayer<DeliciousMeatPlayer>().deliciousMeatCooldown = DeliciousMeatCooldown;
|
||||
return null;
|
||||
}
|
||||
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
||||
{
|
||||
// Spawn some cute sparkles for added effect when dropped in the world.
|
||||
@@ -113,5 +121,34 @@ namespace CalamityMod.Items.Potions.Food
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
if (Main.LocalPlayer.GetModPlayer<DeliciousMeatPlayer>().deliciousMeatCooldown <= 0)
|
||||
return;
|
||||
|
||||
Vector2 barScale = new Vector2(1.25f, 1f);
|
||||
var barBG = ModContent.Request<Texture2D>("CalamityMod/UI/MiscTextures/GenericBarBack").Value;
|
||||
var barFG = ModContent.Request<Texture2D>("CalamityMod/UI/MiscTextures/GenericBarFront").Value;
|
||||
|
||||
Vector2 drawPos = position + new Vector2((frame.Width - barBG.Width * 0.95f) * scale, (frame.Height - 3f) * scale);
|
||||
Rectangle frameCrop = new Rectangle(0, 0, (int)((1 - Main.LocalPlayer.GetModPlayer<DeliciousMeatPlayer>().deliciousMeatCooldown / (float)DeliciousMeatCooldown) * barFG.Width), barFG.Height);
|
||||
Color colorBG = Color.Black;
|
||||
Color colorFG = Color.White;
|
||||
|
||||
spriteBatch.Draw(barBG, drawPos, null, colorBG, 0f, origin, scale * barScale, 0f, 0f);
|
||||
spriteBatch.Draw(barFG, drawPos, frameCrop, colorFG * 0.8f, 0f, origin, scale * barScale, 0f, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
public class DeliciousMeatPlayer : ModPlayer
|
||||
{
|
||||
public int deliciousMeatCooldown = 0;
|
||||
|
||||
public override void PostUpdateMiscEffects()
|
||||
{
|
||||
if (deliciousMeatCooldown > 0)
|
||||
deliciousMeatCooldown--;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ DeliciousMeat: {
|
||||
Tooltip:
|
||||
'''
|
||||
{$CommonItemTooltip.MediumStats}
|
||||
{$Common.NotConsumable}
|
||||
{$Common.NotConsumable}, but takes {0} minutes to regenerate
|
||||
'A blessed strip of pork that never seems to be entirely consumed...'
|
||||
'''
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user