Decimation_Mod/Content/Buffs/Debuffs/Hyperthermic.cs
FyloZ 57423952bf Fixed items were always consumed.
Added possibility to add light to tiles.
Updated Shrine Altar's sprite.
2020-07-09 15:47:54 -04:00

44 lines
1.3 KiB
C#

using Decimation.Lib.Buffs;
using Terraria;
using Terraria.ModLoader;
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%";
public override bool Debuff => true;
protected override void Init()
{
save = false;
clearable = false;
displayTime = true;
}
public override void Update(Player player, ref int buffIndex)
{
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.velocity *= 0.95f;
}
}
public class HyperthermicManaBlock : GlobalItem
{
public override bool CanUseItem(Item item, Player player)
{
if (player.HasBuff(ModContent.BuffType<Hyperthermic>()) && item.healMana > 0) return false;
return base.CanUseItem(item, player);
}
}
}