Even More Modifiers  1.0.0.0
A mod for rolling various bonus stats on items
LootEsseneGlobalNPC.cs
Go to the documentation of this file.
1 using Terraria;
2 using Terraria.ModLoader;
3 
4 namespace Loot.Soulforging
5 {
6  internal class LootEsseneGlobalNPC : GlobalNPC
7  {
8  public override void NPCLoot(NPC npc)
9  {
10  var player = Main.LocalPlayer.GetModPlayer<LootEssencePlayer>();
11  if (!ModContent.GetInstance<LootEssenceWorld>().SoulforgingUnlocked) return;
12 
13  // TODO did this player kill the npc though? is the player close enough?
14  player.KillCount++;
15 
16  if (npc.boss)
17  {
18  player.GainEssence(10);
19  }
20 
21  if (player.KillCount >= 9)
22  {
23  player.KillCount = 0;
24  player.GainEssence(1);
25  }
26  }
27  }
28 }