Even More Modifiers  1.0.0.0
A mod for rolling various bonus stats on items
SoulLantern.cs
Go to the documentation of this file.
1 using System.Collections.Generic;
2 using Terraria;
3 using Terraria.ModLoader;
4 
5 namespace Loot.Soulforging
6 {
7  internal class SoulLantern : ModItem
8  {
9  public override string Texture => "Loot/Placeholder";
10 
11  public override void SetStaticDefaults()
12  {
13  DisplayName.SetDefault("Soul Lantern");
14  }
15 
16  public override void SetDefaults()
17  {
18  item.rare = 1;
19  }
20 
21  public override void ModifyTooltips(List<TooltipLine> tooltips)
22  {
23  int i = tooltips.FindIndex(x => x.mod == "Terraria" && x.Name == "ItemName");
24  if (i != -1)
25  {
26  var player = Main.LocalPlayer.GetModPlayer<LootEssencePlayer>();
27  tooltips.Insert(i+1, new TooltipLine(mod, "Loot: SoulLantern:BonusEssenceGain", $"You gain {player.BonusEssenceGain} bonus essence every 10 kills."));
28  tooltips.Insert(i+2, new TooltipLine(mod, "Loot: SoulLantern:SoulWeapon", $"You have no soul weapon equipped and have no additional powers."));
29  tooltips.Insert(i+3, new TooltipLine(mod, "Loot: SoulLantern:TotalEssence", $"You have collected {player.Essence} essence."));
30  }
31  }
32  }
33 }