-
Notifications
You must be signed in to change notification settings - Fork 37
/
DynamicDungeonsAPI.cs
34 lines (30 loc) · 1.16 KB
/
DynamicDungeonsAPI.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;
using StardewValley;
using SObject = StardewValley.Object;
namespace Entoarox.DynamicDungeons
{
internal class DynamicDungeonsAPI
{
/*********
** Accessors
*********/
public double CurrentDifficulty => ModEntry.Location?.Difficulty ?? 0;
public int CurrentFloorLevel => ModEntry.Location?.Floor ?? 0;
public bool InDungeon => Game1.currentLocation != null && Game1.currentLocation is DynamicDungeon;
/*********
** Public methods
*********/
public void RegisterLootEntry(string table, double dropChance, SObject itemLoot)
{
if (!LootHandler.LootTables.ContainsKey(table))
LootHandler.LootTables.Add(table, new LootHandler());
LootHandler.LootTables[table].Add(dropChance, itemLoot);
}
public void RegisterLootEntry(string table, double dropChance, Func<SObject> itemLootCallback)
{
if (!LootHandler.LootTables.ContainsKey(table))
LootHandler.LootTables.Add(table, new LootHandler());
LootHandler.LootTables[table].Add(dropChance, itemLootCallback);
}
}
}