forked from cdrock/TourGuide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iotm2022bowling
79 lines (73 loc) · 4.82 KB
/
iotm2022bowling
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
//Cosmic Bowling Ball
RegisterTaskGenerationFunction("IOTMCosmicBowlingBallGenerateTasks");
void IOTMCosmicBowlingBallGenerateTasks(ChecklistEntry [int] task_entries, ChecklistEntry [int] optional_task_entries, ChecklistEntry [int] future_task_entries)
{
if (!get_property_boolean("hasCosmicBowlingBall") == true)
return;
int bowlingUses = get_property_int("_cosmicBowlingSkillsUsed");
int bowlingCooldown2 = bowlingUses * 2 + 6;
int bowlingCooldown = get_property_int("cosmicBowlingBallReturnCombats");
boolean bowlingSupernag = get_property_boolean("tourGuideBowlingBallSupernag");
string url;
if (bowlingCooldown == 0)
{
string [int] description;
string main_title = "Cosmic bowling ball usable";
description.listAppend(HTMLGenerateSpanFont("You can bowl again next turn!", "blue"));
description.listAppend("Next use has " + HTMLGenerateSpanOfClass(bowlingCooldown2, "r_bold") + " duration.");
task_entries.listAppend(ChecklistEntryMake("__item cosmic bowling ball", url, ChecklistSubentryMake("Cosmic bowling ball returns next combat", "", description), -11));
}
if (bowlingCooldown < 0 && bowlingSupernag)
{
string [int] description;
string main_title = "Cosmic bowling ball usable";
description.listAppend(HTMLGenerateSpanFont("You can bowl again -- right now!", "blue"));
description.listAppend("Next use has " + HTMLGenerateSpanOfClass(bowlingCooldown2, "r_bold") + " duration.");
task_entries.listAppend(ChecklistEntryMake("__item cosmic bowling ball", url, ChecklistSubentryMake("Cosmic bowling ball is in your inventory!", "", description), -11));
}
}
RegisterResourceGenerationFunction("IOTMCosmicBowlingBallGenerateResource");
void IOTMCosmicBowlingBallGenerateResource(ChecklistEntry [int] resource_entries)
{
if (!get_property_boolean("hasCosmicBowlingBall") == true)
return;
// Entries
int bowlingUses = get_property_int("_cosmicBowlingSkillsUsed");
int bowlingCooldown2 = bowlingUses * 2 + 6;
int bowlingCooldown = get_property_int("cosmicBowlingBallReturnCombats");
string url;
if (bowlingCooldown == -1)
{
string main_title = "Cosmic bowling ball usable";
string [int] description;
description.listAppend("Hit a strike! Knock the competition down a pin with your hole-y ball.");
description.listAppend("Give yourself an item/meat buff, gain stats in a zone, or banish for the next " + HTMLGenerateSpanOfClass(bowlingCooldown2, "r_bold") + " combats.");
resource_entries.listAppend(ChecklistEntryMake("__item cosmic bowling ball", "", ChecklistSubentryMake("Cosmic bowling ball banish", "", "Has " + HTMLGenerateSpanOfClass(bowlingCooldown2, "r_bold") + " duration and cooldown.")).ChecklistEntrySetCombinationTag("banish").ChecklistEntrySetIDTag("Cosmic bowling ball banish"));
resource_entries.listAppend(ChecklistEntryMake("__item cosmic bowling ball", url, ChecklistSubentryMake("Cosmic bowling ball use available", "", description)).ChecklistEntrySetCombinationTag("special").ChecklistEntrySetIDTag("Cosmic bowling ball skills"));
}
if (bowlingCooldown > -1)
{
string main_title = HTMLGenerateSpanFont("" + bowlingCooldown, "red") + " combats until cosmic bowling ball returns";
string [int] description;
Banish banish_entry = BanishByName("Bowl a Curveball");
int turns_left_of_banish = banish_entry.BanishTurnsLeft();
if (turns_left_of_banish > 0)
{
description.listAppend("Currently used on " + banish_entry.banished_monster + " for " + pluralise(turns_left_of_banish, "more turn", "more turns") + ".");
}
if (bowlingCooldown == 0)
{
description.listAppend(HTMLGenerateSpanFont("You can bowl again next turn!", "blue"));
description.listAppend("Next use has " + HTMLGenerateSpanOfClass(bowlingCooldown2, "r_bold") + " duration.");
resource_entries.listAppend(ChecklistEntryMake("__item cosmic bowling ball", url, ChecklistSubentryMake("Cosmic bowling ball returns next combat", "", description), -11).ChecklistEntrySetCombinationTag("banish").ChecklistEntrySetIDTag("Cosmic bowling ball skills"));
resource_entries.listAppend(ChecklistEntryMake("__item cosmic bowling ball", url, ChecklistSubentryMake(main_title, "", description)).ChecklistEntrySetCombinationTag("special").ChecklistEntrySetIDTag("Cosmic bowling ball skills"));
}
else
{
description.listAppend("Bowling ball in the sky with your diamonds.");
description.listAppend("Next use has " + HTMLGenerateSpanOfClass(bowlingCooldown2, "r_bold") + " duration.");
resource_entries.listAppend(ChecklistEntryMake("__item cosmic bowling ball", url, ChecklistSubentryMake(main_title, "", description)).ChecklistEntrySetCombinationTag("banish").ChecklistEntrySetIDTag("Cosmic bowling ball skills"));
resource_entries.listAppend(ChecklistEntryMake("__effect trash-wrapped", url, ChecklistSubentryMake(main_title, "", description)).ChecklistEntrySetCombinationTag("special").ChecklistEntrySetIDTag("Cosmic bowling ball skills"));
}
}
}