-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathChallenges.cs
More file actions
69 lines (60 loc) · 1.95 KB
/
Challenges.cs
File metadata and controls
69 lines (60 loc) · 1.95 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using spdd.items;
using spdd.items.armor;
using spdd.items.artifacts;
using spdd.items.food;
using spdd.items.potions;
namespace spdd
{
public class Challenges
{
//Some of these internal IDs are outdated and don't represent what these challenges do
public const int NO_FOOD = 1;
public const int NO_ARMOR = 2;
public const int NO_HEALING = 4;
public const int NO_HERBALISM = 8;
public const int SWARM_INTELLIGENCE = 16;
public const int DARKNESS = 32;
public const int NO_SCROLLS = 64;
public const int MAX_VALUE = 127;
public static readonly string[] NAME_IDS = {
"no_food",
"no_armor",
"no_healing",
"no_herbalism",
"swarm_intelligence",
"darkness",
"no_scrolls"
};
public static readonly int[] MASKS = {
NO_FOOD, NO_ARMOR, NO_HEALING, NO_HERBALISM, SWARM_INTELLIGENCE, DARKNESS, NO_SCROLLS
};
public static bool IsItemBlocked(Item item)
{
if (Dungeon.IsChallenged(NO_FOOD))
{
if (item is Food && !(item is SmallRation))
return true;
else if (item is HornOfPlenty)
return true;
}
if (Dungeon.IsChallenged(NO_ARMOR))
{
if (item is Armor && !(item is ClothArmor || item is ClassArmor))
return true;
}
if (Dungeon.IsChallenged(NO_HEALING))
{
if (item is PotionOfHealing)
return true;
else if (item is Blandfruit && ((Blandfruit)item).potionAttrib is PotionOfHealing)
return true;
}
if (Dungeon.IsChallenged(NO_HERBALISM))
{
if (item is Dewdrop)
return true;
}
return false;
}
}
}