Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR to add in the TES candyswordcane tile #214

Merged
merged 13 commits into from
Mar 2, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// Candy Cane Sword Cane
RegisterTaskGenerationFunction("IOTMCandyCaneSwordGenerateTasks");
void IOTMCandyCaneSwordGenerateTasks(ChecklistEntry [int] task_entries, ChecklistEntry [int] optional_task_entries, ChecklistEntry [int] future_task_entries)
{
// Initialization. Good use of "lookupItem" for backwards compatibility reasons.
if (!__iotms_usable[lookupItem("candy cane sword cane")]) return;
int ccscEquipped = lookupItem("candy cane sword cane").equipped_amount();
string ccscEquipStatement = ccscEquipped > 0 ? "Keep your Candy Cane Sword Cane equipped!" : "Equip your Candy Cane Sword Cane!";
string [int] description;
string [int] describeSupernag;
string [int] options;

// Added a check for all paths where you do not want the tile at all:
// - Community Service & Grey Goo: irrelevant
// - Avatar of Boris: cannot wield a weapon other than trusty or use a familiar
boolean pathCheck = true;
pathCheck = my_path().id == PATH_COMMUNITY_SERVICE ? false : true;
pathCheck = my_path().id == PATH_GREY_GOO ? false : true;
pathCheck = my_path().id == PATH_AVATAR_OF_BORIS ? false : true;

// Only show when in run, for obvious reasons.
if (__misc_state["in run"] && pathCheck)
{
string url = "inventory.php?ftext=candy+cane+sword+cane";
// This is the description for the supernag. The supernag is in the task_entries, buried within conditional ifs and only shows up if you're in the zone.
describeSupernag.listAppend(HTMLGenerateSpanFont("You're", "red") + " " + HTMLGenerateSpanFont("in a", "green") + " " + HTMLGenerateSpanFont("candy", "red") + " " + HTMLGenerateSpanFont("cane", "green") + " " + HTMLGenerateSpanFont("sword", "red") + " " + HTMLGenerateSpanFont("cane", "green") + " " + HTMLGenerateSpanFont("noncom", "red") + " " + HTMLGenerateSpanFont("zone!", "green"));

// This enumerates the useful CCSC adventures
if (!get_property_boolean("_candyCaneSwordLyle")) {
options.listAppend(HTMLGenerateSpanOfClass("Bonus:", "r_bold") + " Lyle's Monorail Buff (+40% init)");
}

// Added a check for if they are past black forest
if (!get_property_boolean("candyCaneSwordBlackForest") && __quest_state["Level 11"].mafia_internal_step < 2) {
options.listAppend(HTMLGenerateSpanOfClass("Bonus:", "r_bold") + " The Black Forest (+8 exploration)");
if (($locations[The Black Forest] contains __last_adventure_location)) {
task_entries.listAppend(ChecklistEntryMake("__item candy cane sword cane", url, ChecklistSubentryMake(ccscEquipStatement, "", describeSupernag), -11));
}
}

// Added a check for if they need the loot token.
if (!get_property_boolean("candyCaneSwordDailyDungeon") && __misc_state_int["fat loot tokens needed"] > 0) {
options.listAppend(HTMLGenerateSpanOfClass("Bonus:", "r_bold") + " Daily Dungeon (+1 fat loot token)");
if (($locations[The Daily Dungeon] contains __last_adventure_location)) {
task_entries.listAppend(ChecklistEntryMake("__item candy cane sword cane", url, ChecklistSubentryMake(ccscEquipStatement, "", describeSupernag), -11));
}
}

// Added a check for if they need a curse
if (!get_property_boolean("candyCaneSwordApartmentBuilding") && get_property_int("hiddenApartmentProgress") < 8) {
options.listAppend(HTMLGenerateSpanOfClass("Bonus:", "r_bold") + " Hidden Apartment (+1 Curse)");
if (($locations[The Hidden Apartment Building] contains __last_adventure_location)) {
task_entries.listAppend(ChecklistEntryMake("__item candy cane sword cane", url, ChecklistSubentryMake(ccscEquipStatement, "", describeSupernag), -11));
}
}

// Added a check for if they need bowling alley access by checking the bowling alley progress var
if (!get_property_boolean("candyCaneSwordBowlingAlley") && get_property_int("hiddenBowlingAlleyProgress") < 7) {
options.listAppend(HTMLGenerateSpanOfClass("Bonus:", "r_bold") + " Hidden Bowling Alley (+1 free bowl)");
if (($locations[The Hidden Bowling Alley] contains __last_adventure_location)) {
task_entries.listAppend(ChecklistEntryMake("__item candy cane sword cane", url, ChecklistSubentryMake(ccscEquipStatement, "", describeSupernag), -11));
}
}

// Added a check for if they need shore access
if (!get_property_boolean("candyCaneSwordShore") && !__misc_state["mysterious island available"]) {
options.listAppend(HTMLGenerateSpanOfClass("Alternate:", "r_bold") + " Shore (2 scrips for the price of 1)");
if (($locations[The Shore\, Inc. Travel Agency] contains __last_adventure_location)) {
task_entries.listAppend(ChecklistEntryMake("__item candy cane sword cane", url, ChecklistSubentryMake(ccscEquipStatement, "", describeSupernag), -11));
}
}

// Added a check for if war is finished
if (locationAvailable($location[The Battlefield (Frat Uniform)]) == false && !__quest_state["Level 12"].finished) {
options.listAppend(HTMLGenerateSpanOfClass("Alternate:", "r_bold") + " Hippy Camp (Redirect to the War Start NC)");
if (($locations[Wartime Hippy Camp,Wartime Frat House] contains __last_adventure_location)) {
task_entries.listAppend(ChecklistEntryMake("__item candy cane sword cane", url, ChecklistSubentryMake(ccscEquipStatement, "", describeSupernag), -11));
}
}

// Changed condition to <80 protestors check
if (get_property_int("zeppelinProtestors") < 80) {
options.listAppend(HTMLGenerateSpanOfClass("Alternate: ", "r_bold") + "Zeppelin Protesters " + HTMLGenerateSpanFont("(double Sleaze damage!)", "purple"));
if (($locations[A Mob of Zeppelin Protesters] contains __last_adventure_location)) {
task_entries.listAppend(ChecklistEntryMake("__item candy cane sword cane", url, ChecklistSubentryMake(ccscEquipStatement, "", describeSupernag), -11));
}
}

if (options.count() > 0) {
description.listAppend("Ensure your CCSC is equipped for useful NCs:" + options.listJoinComponents("<hr>").HTMLGenerateIndentedText());

// Darkened from bright red to maroon as it will be irrelevant for many parts of the run.
if (lookupItem("candy cane sword cane").equipped_amount() == 0) {
description.listAppend(HTMLGenerateSpanFont("Equip the Candy Cane Sword Cane!", "maroon"));
}

optional_task_entries.listAppend(ChecklistEntryMake("__item Candy cane sword cane", url, ChecklistSubentryMake("Candy Cane Sword Cane NCs", description)).ChecklistEntrySetCombinationTag("CCSC tasks").ChecklistEntrySetIDTag("CCSC"));
}

}

}

19 changes: 17 additions & 2 deletions Source/relay/TourGuide/Items of the Month/2024/Spring Shoes.ash
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@ RegisterResourceGenerationFunction("IOTMSpringShoesGenerateResource");

void IOTMSpringShoesGenerateTasks(ChecklistEntry [int] task_entries, ChecklistEntry [int] optional_task_entries, ChecklistEntry [int] future_task_entries)
{
if (__misc_state["in run"] && available_amount($item[spring shoes]) > 0 && my_path().id != PATH_COMMUNITY_SERVICE)
// Initialization. Do not generate if you don't have spring shoes.
if (!__iotms_usable[lookupItem("spring shoes")]) return;

// Added a check for all paths where you do not want the tile at all:
// - Community Service: irrelevant
// - WereProfessor: is not a free run.

boolean pathCheck = true;
pathCheck = my_path().id == PATH_COMMUNITY_SERVICE ? false : true;
pathCheck = my_path().id == PATH_WEREPROFESSOR ? false : true;

// Technically, the available_amount here precludes the need for the initialization up top.
if (__misc_state["in run"] && available_amount($item[spring shoes]) > 0 && pathCheck)
{
if ($effect[everything looks green].have_effect() == 0)
{
string [int] description;
string url = "inventory.php?ftext=spring+shoes";
description.listAppend(HTMLGenerateSpanFont("Run away from your problems!", "green"));
description.listAppend(HTMLGenerateSpanFont("Free-run away from your problems with the <b>Spring Away</b> skill!", "green"));
if (lookupItem("spring shoes").equipped_amount() == 0)
{
description.listAppend(HTMLGenerateSpanFont("Equip the spring shoes first.", "red"));
Expand All @@ -22,6 +34,9 @@ void IOTMSpringShoesGenerateTasks(ChecklistEntry [int] task_entries, ChecklistEn

void IOTMSpringShoesGenerateResource(ChecklistEntry [int] resource_entries)
{
// Initialization. Do not generate iof you don't have spring shoes.
if (!__iotms_usable[lookupItem("spring shoes")]) return;

string [int] banishDescription;
banishDescription.listAppend("All day banish, doesn't end combat");
if (lookupItem("spring shoes").equipped_amount() == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ import "relay/TourGuide/Items of the Month/2023/August Scepter.ash";
import "relay/TourGuide/Items of the Month/2023/Book of Facts.ash";
import "relay/TourGuide/Items of the Month/2023/Jill of all Trades.ash";
import "relay/TourGuide/Items of the Month/2023/A Guide to Burning Leaves.ash";
import "relay/TourGuide/Items of the Month/2023/Candy Cane Sword Cane.ash";

// 2024
import "relay/TourGuide/Items of the Month/2024/Chest Mimic.ash";
Expand Down
7 changes: 7 additions & 0 deletions Source/relay/TourGuide/Support/IOTMs.ash
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ void initialiseIOTMsUsable()
__iotms_usable[lookupItem("Clan Carnival Game")] = true;
__iotms_usable[$item[clan floundry]] = true;
}

if (lookupItem("candy cane sword cane").available_amount() > 0) //Dec 2023
__iotms_usable[lookupItem("candy cane sword cane")] = true;

if (lookupItem("spring shoes").available_amount() > 0) //Feb 2023
__iotms_usable[lookupItem("spring shoes")] = true;

//Can't use many things in G-Lover
if (my_path().id == PATH_G_LOVER) //Path 33
{
Expand Down
4 changes: 4 additions & 0 deletions Source/relay/TourGuide/Support/Statics.ash
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ static {
int PATH_JOURNEYMAN = 45;
int PATH_FALL_OF_THE_DINOSAURS = 46;
int PATH_AVATAR_OF_SHADOWS_OVER_LOATHING = 47;
int PATH_LEGACY_OF_LOATHING = 48;
int PATH_SMOL = 49; // easier to type
int PATH_A_SHRUNKEN_ADVENTURER_AM_I = 49;
int PATH_WEREPROFESSOR = 50;
}

float numeric_modifier_replacement(item it, string modifier_string) {
Expand Down
Loading