Skip to content

Commit

Permalink
Merge branch 'main' into tes-parka-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
docrostov committed May 17, 2024
2 parents 233e69c + 54fdbc2 commit fdf1e02
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Source/relay/TourGuide/Daily Resources.ash
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void generateDailyResources(Checklist [int] checklists)
}

//Not sure how I feel about this. It's kind of extraneous?
if (get_property_int("telescopeUpgrades") > 0 && !get_property_boolean("telescopeLookedHigh") && __misc_state["in run"] && my_path().id != PATH_ACTUALLY_ED_THE_UNDYING && !in_bad_moon() && my_path().id != PATH_NUCLEAR_AUTUMN && my_path().id != PATH_G_LOVER) {
if (get_property_int("telescopeUpgrades") > 0 && !get_property_boolean("telescopeLookedHigh") && __misc_state["in run"] && my_path().id != PATH_ACTUALLY_ED_THE_UNDYING && !in_bad_moon() && my_path().id != PATH_NUCLEAR_AUTUMN && my_path().id != PATH_G_LOVER && my_path().id != PATH_WEREPROFESSOR) {
string [int] description;
int percentage = 5 * get_property_int("telescopeUpgrades");
description.listAppend("+" + (percentage == 25 ? "35% or +25" : percentage) + "% to all attributes. (10 turns)");
Expand Down
1 change: 1 addition & 0 deletions Source/relay/TourGuide/Paths/Paths import.ash
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ import "relay/TourGuide/Paths/Grey Goo.ash";
import "relay/TourGuide/Paths/Fall of the Dinosaurs.ash";
import "relay/TourGuide/Paths/Avatar of Shadows over Loathing.ash";
import "relay/TourGuide/Paths/Legacy of Loathing.ash";
import "relay/TourGuide/Paths/WereProfessor.ash";
185 changes: 185 additions & 0 deletions Source/relay/TourGuide/Paths/WereProfessor.ash
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@

RegisterResourceGenerationFunction("PathWereProfessorGenerateResource");
void PathWereProfessorGenerateResource(ChecklistEntry [int] resource_entries)
{
if (my_path().id != PATH_WEREPROFESSOR) return;

// Smashed scientific equipment
location [int] scientific_locations = {
$location[Noob Cave],
$location[The Haunted Pantry],
$location[Madness Bakery],
$location[The Thinknerd Warehouse],
$location[Vanya's Castle],
$location[The Old Landfill],
$location[Cobb's Knob Laboratory],
$location[Cobb's Knob Menagerie, Level 1],
$location[Cobb's Knob Menagerie, Level 2],
$location[Cobb's Knob Menagerie, Level 3],
$location[The Haunted Laboratory],
$location[The Castle in the Clouds in the Sky (Top Floor)],
$location[The Hidden Hospital]
};
string [int] scientific_locations_description;
scientific_locations_description.listAppend("Found in a free non-combat on 7th adventure in a zone.");
if ($effect[Mild-Mannered Professor].have_effect() > 0) scientific_locations_description.listAppend(HTMLGenerateSpanFont("Can only be found as a Beast", "red"));
location [int] scientific_locations_options;
foreach key, loc in scientific_locations {
boolean obtained_equipment = false;
foreach nc_key, nc in loc.locationSeenNoncombats() {
if (nc == "The Antiscientific Method") obtained_equipment = true;
}
if (!obtained_equipment) scientific_locations_options.listAppend(loc);
}
int scientific_locations_sort(location loc) {
int score = 0;
// +1 for each turn spent, up to 6
// -30 if location is inaccessible
// +3 if location is a quest one and the relevant quest is not yet done
// +10 if location is the last adventured location
int turns_spent = loc.turns_spent;
score += min(6, loc.turns_spent);
if (!loc.locationAvailable()) score -= 30;
if (loc == $location[Vanya's Castle]) score += 3; // should always get that one in the optimal scenario
if (loc == $location[The Castle in the Clouds in the Sky (Top Floor)] && !__quest_state["Level 10"].finished) score += 3;
if (loc == $location[The Hidden Hospital] && !__quest_state["Level 11 Hidden City"].state_boolean["Hospital finished"]) score += 3;

if (__last_adventure_location == loc) score += 10;
return score;
}

sort scientific_locations_options by -scientific_locations_sort(value);

string [int] loc_descriptions;

foreach key, loc in scientific_locations_options {
int turns_spent = loc.turns_spent;
string scientific_locations_option = loc.HTMLGenerateFutureTextByLocationAvailability();
if (turns_spent < 6) scientific_locations_option += " - " + pluralise(6 - turns_spent, "turn left", "turns left");
else scientific_locations_option += " - drops next turn";
loc_descriptions.listAppend(scientific_locations_option);
}

if (scientific_locations_options.count() > 0) {
if (scientific_locations_options.count() > 3) {
scientific_locations_description.listAppend("Drop locations:" + (loc_descriptions[0] + "<hr>" + HTMLGenerateSpanOfClass(HTMLGenerateSpanOfClass(loc_descriptions.listJoinComponents("<hr>").HTMLGenerateIndentedText(), "r_tooltip_inner_class") + "All locations", "r_tooltip_outer_class")).HTMLGenerateIndentedText());
}
else scientific_locations_description.listAppend("Drop locations:" + loc_descriptions.listJoinComponents("<hr>").HTMLGenerateIndentedText());

resource_entries.listAppend(ChecklistEntryMake("__item smashed scientific equipment", "", ChecklistSubentryMake("Obtain smashed scientific equipment", "", scientific_locations_description)));
}

// Owned smashed scientific equipment
if (have($item[smashed scientific equipment])) {
string [int] smashed_equipment_description;
string [int] craftable_items;

if ($effect[Savage Beast].have_effect() > 0) smashed_equipment_description.listAppend("Wait until you are a Professor to craft stuff.");

// Science-producting hats -- TODO: ignore if have all Stomach/Liver upgrades (pending Mafia support)
if (!have($item[biphasic molecular oculus]) && !have($item[triphasic molecular oculus])) craftable_items.listAppend("biphasic molecular oculus (more Research Points)");
if (have($item[biphasic molecular oculus])) craftable_items.listAppend("triphasic molecular oculus (more Research Points)");
// Exoskeletons
if (!have($item[high-tension exoskeleton]) && !have($item[ultra-high-tension exoskeleton]) && !have($item[irresponsible-tension exoskeleton])) craftable_items.listAppend("high-tension exoskeleton (avoid attacks)");
if (have($item[high-tension exoskeleton])) craftable_items.listAppend("ultra-high-tension exoskeleton (avoid attacks)");
if (have($item[ultra-high-tension exoskeleton])) craftable_items.listAppend("irresponsible-tension exoskeleton (avoid attacks)");
// Initiative, consider if no Spring Shoes available (since they do the same thing) and cannot equip Parka (protection from the jump)
if (!(__misc_state["Torso aware"] && have($item[Jurassic Parka])) && !have($item[spring shoes]) && !have($item[motion sensor])) craftable_items.listAppend("motion sensor (+100% initiative accessory)");

if (craftable_items.count() > 0) {
smashed_equipment_description.listAppend("Consider crafting:" + craftable_items.listJoinComponents("<hr>").HTMLGenerateIndentedText());
}

resource_entries.listAppend(ChecklistEntryMake("__item smashed scientific equipment", "shop.php?whichshop=wereprofessor_tinker", ChecklistSubentryMake(pluralise($item[smashed scientific equipment]) + " available", "", smashed_equipment_description)));
}
}

RegisterTaskGenerationFunction("PathWereProfessorGenerateTasks");
void PathWereProfessorGenerateTasks(ChecklistEntry [int] task_entries, ChecklistEntry [int] optional_task_entries, ChecklistEntry [int] future_task_entries)
{
if ($effect[Mild-Mannered Professor].have_effect() > 0) {
boolean should_nag = false;

string [int] professor_tips;

// Too high ML!
if (monster_level_adjustment() > 25) {
should_nag = true;
professor_tips.listAppend(HTMLGenerateSpanFont(`Reduce ML, elemental-aligned monsters will kill you at the start of combat with +{monster_level_adjustment()} ML.`, "red"));
}

boolean wearing_quest_outfit = false;
if (is_wearing_outfit("Knob Goblin Harem Girl Disguise")) wearing_quest_outfit = true;
if (is_wearing_outfit("Knob Goblin Elite Guard Uniform")) wearing_quest_outfit = true;
if (is_wearing_outfit("eXtreme Cold-Weather Gear")) wearing_quest_outfit = true;
if (is_wearing_outfit("War Hippy Fatigues")) wearing_quest_outfit = true;
if (is_wearing_outfit("Frat Warrior Fatigues")) wearing_quest_outfit = true;

// Equip research equipment. TODO: don't show it if we have 2250 points total; don't nag it if we have all of stomach and liver skills
foreach it in $items[biphasic molecular oculus,triphasic molecular oculus] {
if (have(it) && it.equipped_amount() == 0) {
if (!wearing_quest_outfit) {
should_nag = true;
professor_tips.listAppend(HTMLGenerateSpanFont(`Equip your {it} to do advanced research.`, "red"));
}
else professor_tips.listAppend(`Equip your {it} to do advanced research.`);
}
}

// Equip attack avoidance pants
foreach it in $items[high-tension exoskeleton,ultra-high-tension exoskeleton,irresponsible-tension exoskeleton] {
if (have(it) && it.equipped_amount() == 0) {
professor_tips.listAppend(`Equip your {it} to avoid enemy attacks.`);
}
}

// Equip something to avoid the jump
if (initiative_modifier() < 100 && $item[Jurassic Parka].equipped_amount() == 0) {
if (__misc_state["Torso aware"] && have($item[Jurassic Parka])) {
should_nag = true;
professor_tips.listAppend(HTMLGenerateSpanFont("Equip your Jurassic Parka to avoid enemies getting the jump and instakilling you.", "red"));
}
else {
professor_tips.listAppend(`Increase your initiative (currently {initiative_modifier()}%) to avoid enemies getting the jump and instakilling you.`);
}
}

// Buy stuff
string [int] stuff_to_buy;
if (get_property_int("_cloversPurchased") < 3) stuff_to_buy.listAppend("11-leaf clovers");
if (!__misc_state["desert beach available"]) {
if (!knoll_available()) stuff_to_buy.listAppend("desert bus pass");
else stuff_to_buy.listAppend("bitchin' meatcar components");
}
if (knoll_available() && !have($item[detuned radio])) stuff_to_buy.listAppend("detuned radio");
if (__quest_state["Level 11"].mafia_internal_step >= 2) { // Black Market open
if (__quest_state["Level 11"].mafia_internal_step == 2 && !have($item[forged identification documents])) stuff_to_buy.listAppend("forged identification documents");
if (!__quest_state["Level 11 Desert"].state_boolean["Black Paint Given"] && !have($item[can of black paint])) stuff_to_buy.listAppend("can of black paint");
if (__quest_state["Level 11 Ron"].mafia_internal_step <= 4 && !have($item[red zeppelin ticket])) stuff_to_buy.listAppend("Red Zeppelin ticket");
}
if (!have($item[UV-resistant compass])) stuff_to_buy.listAppend("UV-resistant compass");
if (!have($item[dinghy plans]) && !__misc_state["mysterious island available"]) stuff_to_buy.listAppend("dinghy plans");
if (!have($item[dingy planks]) && !__misc_state["mysterious island available"]) stuff_to_buy.listAppend("dingy planks");
if (__quest_state["Level 11 Manor"].mafia_internal_step < 4 && !have($item[Dramatic&trade; range]) && !get_property_boolean("hasRange")) stuff_to_buy.listAppend("Dramatic&trade; range");

if (stuff_to_buy.count() > 0) {
professor_tips.listAppend("Buy stuff before you become a Beast again: " + stuff_to_buy.listJoinComponents(", ", "or") + ".");
}

int priority = 12;
ChecklistEntry [int] tips_location = optional_task_entries;
if (should_nag) {
priority = -11;
tips_location = task_entries;
}

if (professor_tips.count() > 0) {
tips_location.listAppend(ChecklistEntryMake("WereProfessor", "", ChecklistSubentryMake("You are a Professor", professor_tips), priority));
}
}
}
4 changes: 1 addition & 3 deletions Source/relay/TourGuide/State.ash
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ void setUpState()
if (my_path().id != PATH_SLOW_AND_STEADY) {
adventures_after_rollover += numeric_modifier("adventures");
adventures_after_rollover += get_property_int("extraRolloverAdventures");
if (getHolidaysTomorrow()["Labór Day"])
adventures_after_rollover += 10;
}
adventures_after_rollover = MAX(adventures_after_rollover, 0); //Who knows?
int adventures_after_rollover_post_cap = MIN(adventures_after_rollover, 200);
Expand Down Expand Up @@ -527,7 +525,7 @@ void setUpState()
//wand
boolean wand_of_nagamar_needed = true;
if (my_path().id == PATH_AVATAR_OF_BORIS || my_path().id == PATH_AVATAR_OF_JARLSBERG || my_path().id == PATH_AVATAR_OF_SNEAKY_PETE || my_path().id == PATH_BUGBEAR_INVASION || my_path().id == PATH_ZOMBIE_SLAYER || my_path().id == PATH_KOLHS || my_path().id == PATH_HEAVY_RAINS || my_path().id == PATH_ACTUALLY_ED_THE_UNDYING || my_path().id == PATH_COMMUNITY_SERVICE || my_path().id == PATH_THE_SOURCE || my_path().id == PATH_LICENSE_TO_ADVENTURE || my_path().id == PATH_POCKET_FAMILIARS || my_path().id == PATH_VAMPIRE || my_path().id == PATH_GREY_GOO || my_path().id == PATH_YOU_ROBOT || my_path().id == PATH_FALL_OF_THE_DINOSAURS || my_path().id == PATH_AVATAR_OF_SHADOWS_OVER_LOATHING)
if (my_path().id == PATH_AVATAR_OF_BORIS || my_path().id == PATH_AVATAR_OF_JARLSBERG || my_path().id == PATH_AVATAR_OF_SNEAKY_PETE || my_path().id == PATH_BUGBEAR_INVASION || my_path().id == PATH_ZOMBIE_SLAYER || my_path().id == PATH_KOLHS || my_path().id == PATH_HEAVY_RAINS || my_path().id == PATH_ACTUALLY_ED_THE_UNDYING || my_path().id == PATH_COMMUNITY_SERVICE || my_path().id == PATH_THE_SOURCE || my_path().id == PATH_LICENSE_TO_ADVENTURE || my_path().id == PATH_POCKET_FAMILIARS || my_path().id == PATH_VAMPIRE || my_path().id == PATH_GREY_GOO || my_path().id == PATH_YOU_ROBOT || my_path().id == PATH_FALL_OF_THE_DINOSAURS || my_path().id == PATH_AVATAR_OF_SHADOWS_OVER_LOATHING || my_path().id == PATH_WEREPROFESSOR)
wand_of_nagamar_needed = false;
int ruby_w_needed = 1;
Expand Down
1 change: 1 addition & 0 deletions Source/relay/TourGuide/Support/KOLImage.ash
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ static
building_images["Avatar of Jarlsberg"] = KOLImageMake("images/otherimages/jarlsberg_avatar_f.gif", Vec2iMake(60,100), RectMake(0,6,59,96));
building_images["Avatar of Boris"] = KOLImageMake("images/otherimages/boris_avatar_f.gif", Vec2iMake(60,100), RectMake(0,4,59,93));
building_images["Zombie Master"] = KOLImageMake("images/otherimages/zombavatar_f.gif", Vec2iMake(60,100), RectMake(10,3,55,99));
building_images["WereProfessor"] = KOLImageMake("images/otherimages/wereprofavatar_f.gif", Vec2iMake(60,100), RectMake(9,7,50,98));
building_images["Hourglass"] = KOLImageMake("images/itemimages/hourglass.gif", Vec2iMake(30,30));

building_images["Nemesis Disco Bandit"] = KOLImageMake("images/adventureimages/newwave.gif", Vec2iMake(100,100));
Expand Down

0 comments on commit fdf1e02

Please sign in to comment.