forked from SamsonAllen13/ClickerClass
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClickerConditions.cs
More file actions
26 lines (23 loc) · 1.09 KB
/
ClickerConditions.cs
File metadata and controls
26 lines (23 loc) · 1.09 KB
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
using Terraria;
using Terraria.Localization;
namespace ClickerClass
{
public static class ClickerConditions
{
public static readonly string CommonKey = "Conditions.";
public static readonly Condition ClickerSelected = new Condition(Language.GetOrRegister(ClickerClass.mod.GetLocalizationKey($"{CommonKey}ClickerSelected")), () => Main.LocalPlayer.GetModPlayer<ClickerPlayer>().clickerSelected);
//Alternatively hardcode each amount
/// <summary>
/// Returns a new condition specifically with the amount listed.
/// </summary>
public static Condition ClickerTotalExceeds(int amount)
{
return new Condition(Language.GetOrRegister(ClickerClass.mod.GetLocalizationKey($"{CommonKey}ClickerTotalExceeds")).WithFormatArgs(amount), () => Main.LocalPlayer.GetModPlayer<ClickerPlayer>().clickerTotal >= amount);
}
//This is a copy of the code tml uses
public static Condition BestiaryFilledPercent(int percent)
{
return new(Language.GetText("Conditions.BestiaryPercentage").WithFormatArgs(percent), () => Main.GetBestiaryProgressReport().CompletionPercent >= percent / 100f);
}
}
}