1 using Microsoft.Xna.Framework;
6 namespace Loot.Soulforging
8 internal class LootEssencePlayer :
ModPlayer 10 public int Essence {
get;
private set; } = 0;
11 public int BonusEssenceGain {
get;
private set; } = 0;
12 public int KillCount {
get;
set; } = 0;
13 public int TopEssence {
get;
set; } = 1000;
15 public int GainEssence(
int amount)
17 if (!ModContent.GetInstance<LootEssenceWorld>().SoulforgingUnlocked)
return 0;
19 var player = Main.LocalPlayer;
20 var gain = amount + BonusEssenceGain;
22 CombatText.NewText(
new Rectangle((
int)player.position.X, (
int)player.position.Y, player.width, player.height),
new Color(49, 207, 238), $
"+{gain} essence",
false,
false);
26 public int UseEssence(
int amount)
32 public void RecalcTopEssence()
34 if (!ModContent.GetInstance<LootEssenceWorld>().SoulforgingUnlocked)
return;
37 if (NPC.downedBoss1) amount += 100;
38 if (NPC.downedBoss2) amount += 500;
39 if (NPC.downedBoss3) amount += 100;
44 public override TagCompound Save()
46 return new TagCompound
49 {
"KillCount", KillCount}
53 public override void Load(TagCompound tag)
55 Essence = tag.GetInt(
"Essence");
56 KillCount = tag.GetInt(
"KillCount");