Skip to content

Commit

Permalink
grimoire mushroom garden (#2080)
Browse files Browse the repository at this point in the history
* grimoire mushroom garden

use tearaway pants (can replace with libram shortly)

* tentacle

* use libram
  • Loading branch information
Rinn authored Sep 10, 2024
1 parent e8d31e7 commit 312ead5
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 81 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/garbo-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"eslint": "^9.9.0",
"eslint-config-garbo": "^0.0.1",
"kolmafia": "^5.28021.0",
"libram": "^0.9.5",
"libram": "^0.9.6",
"lint-staged": "^15.2.9",
"madge": "^8.0.0",
"prettier": "^3.3.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/garbo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"garbo-lib": "*",
"grimoire-kolmafia": "^0.3.26",
"kolmafia": "^5.28021.0",
"libram": "^0.9.5"
"libram": "^0.9.6"
},
"devDependencies": {
"@babel/cli": "^7.24.8",
Expand Down
70 changes: 0 additions & 70 deletions packages/garbo/src/fights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
Familiar,
familiarEquippedEquipment,
getAutoAttack,
getCampground,
getWorkshed,
haveEquipped,
haveOutfit,
Expand Down Expand Up @@ -1054,75 +1053,6 @@ const freeFightSources = [
true,
pygmyOptions(),
),

// Mushroom garden
new FreeFight(
() =>
(have($item`packet of mushroom spores`) ||
getCampground()["packet of mushroom spores"] !== undefined) &&
get("_mushroomGardenFights") === 0,
() => {
if (have($item`packet of mushroom spores`)) {
use($item`packet of mushroom spores`);
}
if (SourceTerminal.have()) {
SourceTerminal.educate([$skill`Extract`, $skill`Portscan`]);
}
garboAdventure(
$location`Your Mushroom Garden`,
Macro.externalIf(
!doingGregFight(),
Macro.if_($skill`Macrometeorite`, Macro.trySkill($skill`Portscan`)),
).basicCombat(),
);
if (have($item`packet of tall grass seeds`)) {
use($item`packet of tall grass seeds`);
}
},
true,
{
spec: () =>
have($familiar`Robortender`)
? { familiar: $familiar`Robortender` }
: {},
},
),

// Portscan and mushroom garden
new FreeFight(
() =>
!doingGregFight() &&
(have($item`packet of mushroom spores`) ||
getCampground()["packet of mushroom spores"] !== undefined) &&
Counter.get("portscan.edu") === 0 &&
have($skill`Macrometeorite`) &&
get("_macrometeoriteUses") < 10,
() => {
if (have($item`packet of mushroom spores`)) {
use($item`packet of mushroom spores`);
}
if (SourceTerminal.have()) {
SourceTerminal.educate([$skill`Extract`, $skill`Portscan`]);
}
garboAdventure(
$location`Your Mushroom Garden`,
Macro.if_(
$monster`Government agent`,
Macro.skill($skill`Macrometeorite`),
).if_(
$monster`piranha plant`,
Macro.if_(
$skill`Macrometeorite`,
Macro.trySkill($skill`Portscan`),
).basicCombat(),
),
);
if (have($item`packet of tall grass seeds`)) {
use($item`packet of tall grass seeds`);
}
},
true,
),
new FreeFight(
() =>
get("neverendingPartyAlways") && questStep("_questPartyFair") < 999
Expand Down
112 changes: 109 additions & 3 deletions packages/garbo/src/tasks/freeFight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
canAdventure,
canEquip,
changeMcd,
equippedAmount,
getCampground,
gnomadsAvailable,
guildStoreAvailable,
handlingChoice,
Expand Down Expand Up @@ -44,13 +46,16 @@ import {
ChateauMantegna,
clamp,
CombatLoversLocket,
Counter,
Delayed,
ensureEffect,
get,
have,
maxBy,
set,
SourceTerminal,
sum,
TearawayPants,
TunnelOfLove,
undelay,
uneffect,
Expand All @@ -62,7 +67,7 @@ import { globalOptions } from "../config";
import { garboValue } from "../garboValue";
import { freeFightOutfit } from "../outfit";
import { GarboTask } from "./engine";
import { doCandyTrick, shouldAugustCast } from "../resources";
import { doCandyTrick, doingGregFight, shouldAugustCast } from "../resources";
import { isFreeAndCopyable, kramcoGuaranteed, valueDrops } from "../lib";
import { wanderer } from "../garboWanderer";

Expand Down Expand Up @@ -491,8 +496,109 @@ const FreeFightTasks: GarboFreeFightTask[] = [
),
tentacle: true,
},
// mushroom garden
// portscan
{
name: "Mushroom garden",
ready: () =>
have($item`packet of mushroom spores`) ||
getCampground()["packet of mushroom spores"] !== undefined,
completed: () => get("_mushroomGardenFights") > 0,
prepare: () => {
if (have($item`packet of mushroom spores`)) {
use($item`packet of mushroom spores`);
}
if (SourceTerminal.have()) {
SourceTerminal.educate([$skill`Extract`, $skill`Portscan`]);
}
},
do: () => $location`Your Mushroom Garden`,
post: () => {
if (have($item`packet of tall grass seeds`)) {
use($item`packet of tall grass seeds`);
}
},
outfit: () =>
freeFightOutfit(
{
familiar: have($familiar`Robortender`)
? $familiar`Robortender`
: undefined,
bonuses: new Map<Item, number>([
[
$item`tearaway pants`,
get("valueOfAdventure") * TearawayPants.plantsAdventureChance(),
],
]),
},
{ canChooseMacro: false, allowAttackFamiliars: false },
),
combat: new GarboStrategy(() =>
Macro.externalIf(
!doingGregFight(),
Macro.if_($skill`Macrometeorite`, Macro.trySkill($skill`Portscan`)),
)
.externalIf(
equippedAmount($item`tearaway pants`) > 0,
Macro.trySkill($skill`Tear Away your Pants!`),
)
.basicCombat(),
),
combatCount: () => clamp(1 - get("_mushroomGardenFights"), 0, 1),
tentacle: true,
},
{
name: "Portscan + Macrometeorite + Mushroom garden",
ready: () =>
(have($item`packet of mushroom spores`) ||
getCampground()["packet of mushroom spores"] !== undefined) &&
!doingGregFight() &&
Counter.get("portscan.edu") === 0 &&
have($skill`Macrometeorite`) &&
get("_macrometeoriteUses") < 10,
completed: () => get("_mushroomGardenFights") > 0,
prepare: () => {
if (have($item`packet of mushroom spores`)) {
use($item`packet of mushroom spores`);
}
if (SourceTerminal.have()) {
SourceTerminal.educate([$skill`Extract`, $skill`Portscan`]);
}
},
do: () => $location`Your Mushroom Garden`,
post: () => {
if (have($item`packet of tall grass seeds`)) {
use($item`packet of tall grass seeds`);
}
},
outfit: () =>
freeFightOutfit(
{
familiar: have($familiar`Robortender`)
? $familiar`Robortender`
: undefined,
bonuses: new Map<Item, number>([
[
$item`tearaway pants`,
get("valueOfAdventure") * TearawayPants.plantsAdventureChance(),
],
]),
},
{ canChooseMacro: false, allowAttackFamiliars: false },
),
combat: new GarboStrategy(() =>
Macro.if_($monster`Government agent`, Macro.skill($skill`Macrometeorite`))
.if_(
$monster`piranha plant`,
Macro.if_($skill`Macrometeorite`, Macro.trySkill($skill`Portscan`)),
)
.externalIf(
equippedAmount($item`tearaway pants`) > 0,
Macro.trySkill($skill`Tear Away your Pants!`),
)
.basicCombat(),
),
combatCount: () => clamp(10 - get("_macrometeoriteUses"), 0, 10),
tentacle: true,
},
{
name: "God Lobster",
ready: () => have($familiar`God Lobster`),
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4335,7 +4335,7 @@ __metadata:
eslint: ^9.9.0
eslint-config-garbo: ^0.0.1
kolmafia: ^5.28021.0
libram: ^0.9.5
libram: ^0.9.6
lint-staged: ^15.2.9
madge: ^8.0.0
prettier: ^3.3.3
Expand Down Expand Up @@ -4390,7 +4390,7 @@ __metadata:
garbo-lib: "*"
grimoire-kolmafia: ^0.3.26
kolmafia: ^5.28021.0
libram: ^0.9.5
libram: ^0.9.6
lint-staged: ^15.2.9
madge: ^8.0.0
prettier: ^3.3.3
Expand Down Expand Up @@ -5054,14 +5054,14 @@ __metadata:
languageName: node
linkType: hard

"libram@npm:^0.9.5":
version: 0.9.5
resolution: "libram@npm:0.9.5"
"libram@npm:^0.9.6":
version: 0.9.6
resolution: "libram@npm:0.9.6"
dependencies:
html-entities: ^2.5.2
peerDependencies:
kolmafia: ^5.27668.0
checksum: 3167d6cb86b1633f058fff49cd848b63f4cc38700c173b10397a58e4b29ece0d041a1dd21bd06cb2bee3394f35c6c0ecf7cc27d1912b52c1baa6d91468b29ab9
checksum: 0d9709958dc6a6f0b970fa64ed2319d31de1ab18e3c5d791f59c29c863f2f453a32b1e3f51663454a995e400a970ada5c409988636a1d872a4e0c1e0aefed51d
languageName: node
linkType: hard

Expand Down

0 comments on commit 312ead5

Please sign in to comment.