* 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.
45 lines
1.3 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|