Files
CalamityModPublic/Items/DifficultyItems/MLGRune.cs
T
DominicKarma42 15b36e1789 Various MP fixes in description
* Partially fixed Golem Free Head in rev (a little jittery, but I couldn't locate the root cause of that)
* Added packets for toggleable items, such as the defiled rune, so that the server and client don't bitch at each other over the boolean
* Added various logic checks and netcode to the mechworm. Hopefully removed most, if not all mechworm bugs.
2019-12-01 16:50:52 -06:00

45 lines
1.3 KiB
C#

using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.DifficultyItems
{
public class MLGRune : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Demon Trophy");
Tooltip.SetDefault("Boosts spawn rate by 1.25 times\n" +
"Effects cannot be reversed");
}
public override void SetDefaults()
{
item.width = 28;
item.height = 28;
item.maxStack = 99;
item.rare = 1;
item.useAnimation = 45;
item.useTime = 45;
item.useStyle = 4;
item.UseSound = SoundID.Item119;
item.consumable = true;
}
public override bool UseItem(Player player)
{
CalamityWorld.demonMode = true;
CalamityMod.UpdateServerBoolean();
if (Main.netMode == NetmodeID.Server)
{
var netMessage = mod.GetPacket();
netMessage.Write((byte)CalamityModMessageType.DemonTrophyBoolSync);
netMessage.Write(CalamityWorld.demonMode);
netMessage.Send();
}
return true;
}
}
}