38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using Terraria.ID;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
using Terraria.DataStructures;
|
|
using Microsoft.Xna.Framework;
|
|
|
|
namespace ForgottenWawiTech.Content.Items.Materials
|
|
{
|
|
public class RGBass : ModItem
|
|
{
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 20;
|
|
Item.height = 20;
|
|
Item.maxStack = 9999;
|
|
Item.rare = ItemRarityID.Expert; // temp rarity until custom rarity is added
|
|
Item.value = Item.buyPrice(gold: 10);
|
|
}
|
|
}
|
|
public class RGBassFishingPlayer : ModPlayer
|
|
{
|
|
public override void CatchFish(FishingAttempt attempt, ref int itemDrop, ref int npcSpawn, ref AdvancedPopupRequest sonar, ref Vector2 sonarPosition)
|
|
{
|
|
// Only if Moon Lord has been defeated
|
|
if (!NPC.downedMoonlord)
|
|
return;
|
|
|
|
bool inWater = !attempt.inLava && !attempt.inHoney;
|
|
|
|
if (inWater && Main.rand.NextBool(20)) // 5% chance (1 in 20)
|
|
{
|
|
itemDrop = ModContent.ItemType<RGBass>();
|
|
}
|
|
}
|
|
}
|
|
}
|