* Fixed Cosmolight to work properly in MP * Remove redundent WorldSync on CausticTear * Fixed MartianRemote to work on MP
55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
using CalamityMod.Events;
|
|
using CalamityMod.Items.Materials;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.SummonItems.Invasion
|
|
{
|
|
public class CausticTear : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.SummonItems";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
ItemID.Sets.SortingPriorityBossSpawns[Type] = 4; // Goblin Battle Standard
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 16;
|
|
Item.height = 28;
|
|
Item.maxStack = 1;
|
|
Item.rare = ItemRarityID.Green;
|
|
Item.useAnimation = 10;
|
|
Item.useTime = 10;
|
|
Item.useStyle = ItemUseStyleID.HoldUp;
|
|
Item.consumable = false;
|
|
}
|
|
|
|
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
|
|
{
|
|
itemGroup = ContentSamples.CreativeHelper.ItemGroup.EventItem;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player)
|
|
{
|
|
return !AcidRainEvent.AcidRainEventIsOngoing;
|
|
}
|
|
|
|
public override bool? UseItem(Player player)
|
|
{
|
|
AcidRainEvent.TryStartEvent(forceRain: true);
|
|
//CalamityNetcode.SyncWorld(); //TryStartEvent(forceRain: true) already sync the world data
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<SulphuricScale>(5).
|
|
AddCondition(Condition.NearWater).
|
|
Register();
|
|
}
|
|
}
|
|
}
|