-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlchBuff.cs
34 lines (33 loc) · 1021 Bytes
/
AlchBuff.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Collections.Generic;
using Terraria;
using Terraria.ModLoader;
namespace PotionOverhaul
{
public class AlchBuff : ModBuff
{
public List<Item> ItemsOnPotion = new List<Item>();
public override void SetDefaults()
{
DisplayName.SetDefault("Potion Effects!");
}
public override void Update(Player player, ref int buffIndex)
{
ItemsOnPotion = player.GetModPlayer<AlchPlayer>().ItemsOnPotion;
}
public override void ModifyBuffTip(ref string tip, ref int rare)
{
var positive = "";
var negative = "";
for (int i = 0; i < ItemsOnPotion.Count; i++)
{
var p = AlchEffects.AlchGetPositiveTooltip(ItemsOnPotion[i], ItemsOnPotion[i].stack);
if (p != "")
positive += p + (i == ItemsOnPotion.Count - 1 ? "" : "\n");
var n = AlchEffects.AlchGetNegativeTooltip(ItemsOnPotion[i], ItemsOnPotion[i].stack);
if (n != "")
negative += n + (i == ItemsOnPotion.Count - 1 ? "" : "\n");
}
tip = positive + "\n" + negative;
}
}
}