forked from cdrock/TourGuide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iotm2015DMT
147 lines (131 loc) · 6.97 KB
/
iotm2015DMT
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
//Machine Elf DMT stuff
RegisterTaskGenerationFunction("IOTMMachineElfGenerateTasks");
void IOTMMachineElfGenerateTasks(ChecklistEntry [int] task_entries, ChecklistEntry [int] optional_task_entries, ChecklistEntry [int] future_task_entries)
{
string [int] description;
string url = "place.php?whichplace=dmt";
int DMTDuplicationAscension = get_property_int("lastDMTDuplication");
int DMTTimer = get_property_int("encountersUntilDMTChoice");
if (DMTTimer == 0 && my_ascensions() > DMTDuplicationAscension)
{
description.listAppend("" + HTMLGenerateSpanFont("Item duplication available!", "blue") + "");
description.listAppend("Copy a PVPable potion, food, drink, or spleen item.");
task_entries.listAppend(ChecklistEntryMake("__item abstraction: comprehension", url, ChecklistSubentryMake("Deep Machine Tunnels noncom ready!", "", description), -11));
}
}
RegisterResourceGenerationFunction("IOTMMachineElfFamiliarGenerateResource");
void IOTMMachineElfFamiliarGenerateResource(ChecklistEntry [int] resource_entries)
{
if (!$familiar[machine elf].familiar_is_usable())
return;
string url = "place.php?whichplace=dmt";
if (my_familiar() != $familiar[machine elf])
url = "familiar.php";
int importance = 0;
if (!__misc_state["in run"] || !__misc_state["need to level"])
importance = 6;
ChecklistEntry entry;
entry.image_lookup_name = "__familiar machine elf";
entry.url = url;
entry.tags.id = "Machine elf tunnels resource";
entry.importance_level = importance;
if (__last_adventure_location == $location[the deep machine tunnels])
entry.should_highlight = true;
int free_fights_remaining = clampi(5 - get_property_int("_machineTunnelsAdv"), 0, 5);
if (free_fights_remaining > 0 && mafiaIsPastRevision(16550))
{
string [int] description;
string [int] modifiers;
string [int] tasks;
if (my_familiar() != $familiar[machine elf])
{
tasks.listAppend("bring along your machine elf");
}
tasks.listAppend("adventure in the machine tunnels");
string line = tasks.listJoinComponents(", ", "and").capitaliseFirstLetter();
if (__misc_state["need to level"])
{
modifiers.listAppend("+" + my_primestat().to_lower_case());
line += " to gain stats";
}
line += ".";
description.listAppend(line);
if (spleen_limit() > 0)
{
//abstraction: sensation -> square monster -> abstraction: motion (+100% init)
//abstraction: thought -> triangle monster -> abstraction: certainty (+100% item)
//abstraction: action -> circle monster -> abstraction: joy (+10 familiar weight)
//FIXME suggest abstraction methods.
item [item] abstraction_conversions;
abstraction_conversions[$item[abstraction: sensation]] = $item[abstraction: motion];
abstraction_conversions[$item[abstraction: thought]] = $item[abstraction: certainty];
if (!__misc_state["familiars temporarily blocked"])
abstraction_conversions[$item[abstraction: action]] = $item[abstraction: joy];
monster [item] abstraction_monsters;
abstraction_monsters[$item[abstraction: sensation]] = $monster[Performer of Actions];
abstraction_monsters[$item[abstraction: thought]] = $monster[Perceiver of Sensations];
abstraction_monsters[$item[abstraction: action]] = $monster[Thinker of Thoughts];
string [monster] monster_descriptions;
monster_descriptions[$monster[Performer of Actions]] = "square";
monster_descriptions[$monster[Perceiver of Sensations]] = "triangle";
monster_descriptions[$monster[Thinker of Thoughts]] = "circle";
foreach source, result in abstraction_conversions
{
string result_description = __machine_elf_abstractions_description[result];
if (result_description == "")
continue;
if (source.item_amount() == 0)
continue;
monster m = abstraction_monsters[source];
string monster_text = monster_descriptions[m] + " monster";
string line = "Throw " + source + " at " + monster_text;
if (last_monster() == m)
line = HTMLGenerateSpanOfClass(line, "r_bold");
line += " for " + result_description + " spleen potion. (50 turns)";
description.listAppend(line);
}
if ($item[abstraction: thought].item_amount() == 0)
description.listAppend("Possibly run the machine elf elsewhere first, for transmutable potions.");
}
//entry.subentries.listAppend(ChecklistSubentryMake(pluralise(free_fights_remaining, "free elf fight", "free elf fights"), modifiers, description));
resource_entries.listAppend(ChecklistEntryMake(entry.image_lookup_name, entry.url, ChecklistSubentryMake(pluralise(free_fights_remaining, "free elf fight", "free elf fights"), modifiers, description)).ChecklistEntrySetCombinationTag("daily free fight").ChecklistEntrySetIDTag("Machine elf free fights"));
}
if (entry.subentries.count() > 0)
{
resource_entries.listAppend(entry);
}
}
RegisterResourceGenerationFunction("IOTMMachineElfGenerateResource");
void IOTMMachineElfGenerateResource(ChecklistEntry [int] resource_entries)
{
if (in_ronin() && spleen_limit() > 0)
{
boolean [item] useful_abstractions;
useful_abstractions[$item[abstraction: motion]] = true;
useful_abstractions[$item[abstraction: certainty]] = true;
if (!__misc_state["familiars temporarily blocked"])
useful_abstractions[$item[abstraction: joy]] = true;
if (__misc_state["need to level"])
{
if (my_primestat() == $stat[muscle])
useful_abstractions[$item[abstraction: purpose]] = true;
else if (my_primestat() == $stat[mysticality])
useful_abstractions[$item[abstraction: category]] = true;
else if (my_primestat() == $stat[moxie])
useful_abstractions[$item[abstraction: perception]] = true;
}
string image_name = "";
ChecklistSubentry [int] abstraction_lines;
foreach it in useful_abstractions
{
if (it.available_amount() == 0 || !it.is_unrestricted())
continue;
string description = __machine_elf_abstractions_description[it] + ". (50 turns, one spleen)";
if (image_name == "")
image_name = "__item " + it;
abstraction_lines.listAppend(ChecklistSubentryMake(pluralise(it), "", description));
}
if (abstraction_lines.count() > 0)
resource_entries.listAppend(ChecklistEntryMake(image_name, "inventory.php?which=1", abstraction_lines, 7).ChecklistEntrySetIDTag("Machine elf abstraction resource"));
}
}