forked from cdrock/TourGuide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ioty2022cmg
77 lines (71 loc) · 3.7 KB
/
ioty2022cmg
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
70
71
72
73
74
75
76
77
//2022: cursed magnifying glass
RegisterTaskGenerationFunction("IOTYCursedMagnifyingGlassGenerateTasks");
void IOTYCursedMagnifyingGlassGenerateTasks(ChecklistEntry [int] task_entries, ChecklistEntry [int] optional_task_entries, ChecklistEntry [int] future_task_entries)
{
if (lookupItem("cursed magnifying glass").available_amount() == 0) return;
int free_void_fights_left = clampi(5 - get_property_int("_voidFreeFights"), 0, 5);
int cursedGlassCounter = get_property_int("cursedMagnifyingGlassCount");
string url;
string [int] description;
url = invSearch("cursed magnifying glass");
{
if (cursedGlassCounter < 12)
{
url = invSearch("cursed magnifying glass");
description.listAppend((13 - cursedGlassCounter).pluralise("combat", "combats") + " until next void fight.");
}
if (free_void_fights_left > 0)
{
if (cursedGlassCounter == 12)
{
description.listAppend(HTMLGenerateSpanFont("One more fight until you encounter a void.", "blue"));
}
else if (cursedGlassCounter == 13)
{
if (lookupItem("cursed magnifying glass").equipped_amount() == 0)
{
description.listAppend(HTMLGenerateSpanFont("Void combat ready, equip the magnifying glass", "red"));
}
else
{
description.listAppend(HTMLGenerateSpanFont("Void combat ready, ", "red") + HTMLGenerateSpanFont("magnifying glass equipped", "blue"));
}
}
description.listAppend("" + free_void_fights_left + " free void fights remaining.");
task_entries.listAppend(ChecklistEntryMake("__item void stone", url, ChecklistSubentryMake("Cursed magnifying glass combat", "", description), -11));
}
if (free_void_fights_left == 0)
{
if (lookupItem("cursed magnifying glass").equipped_amount() == 1)
{
description.listAppend(HTMLGenerateSpanFont("Void combat ready, may want to unequip!", "red"));
task_entries.listAppend(ChecklistEntryMake("__item void stone", url, ChecklistSubentryMake("Cursed magnifying glass combat", "", description), -11));
}
if (lookupSkill("Meteor Lore").have_skill() || lookupItem("powerful glove").available_amount() > 0)
{
description.listAppend("No free void fights remaining, but you can replace them with lobsterfrogmen or something.");
optional_task_entries.listAppend(ChecklistEntryMake("__item cursed magnifying glass", url, ChecklistSubentryMake("Cursed magnifying glass combat", "", description), 11));
}
else
{
description.listAppend("You can charge it up for tomorrow?");
optional_task_entries.listAppend(ChecklistEntryMake("__item cursed magnifying glass", url, ChecklistSubentryMake("Cursed magnifying glass combat", "", description), 11));
}
}
}
}
RegisterResourceGenerationFunction("IOTYCursedMagnifyingGlassGenerateResource");
void IOTYCursedMagnifyingGlassGenerateResource(ChecklistEntry [int] resource_entries)
{
if (lookupItem("cursed magnifying glass").available_amount() == 0) return;
int free_void_fights_left = clampi(5 - get_property_int("_voidFreeFights"), 0, 5);
int cursedGlassCounter = get_property_int("cursedMagnifyingGlassCount");
string url;
string [int] description;
if (get_property_int("_voidFreeFights") < 5) {
int cursedGlassCounter = get_property_int("cursedMagnifyingGlassCount");
url = invSearch("cursed magnifying glass");
description.listAppend((13 - cursedGlassCounter).pluralise("combat", "combats") + " until next void fight.");
resource_entries.listAppend(ChecklistEntryMake("__item void stone", "", ChecklistSubentryMake(pluralise(free_void_fights_left, "void glass monster", "void glass monsters"), "", description), 8).ChecklistEntrySetCombinationTag("daily free fight").ChecklistEntrySetIDTag("Cursed magnifying glass free fight"));
}
}