setLoadout

setLoadout(any loadout, [boolean changeStats]) → boolean success
Applies a loadout for this fight only, without changing the leek's persistent equipment. To be used only inside beforeFight(). If the name does not exist or if setLoadout is called outside of beforeFight(), the function returns false and a warning is added to the report. A restat potion is only consumed if the loadout's allocation requires lowering a characteristic compared to the leek's last fight: chaining fights with the same loadout costs a single potion, while switching to another loadout and back costs another one; without a potion, or if the loadout requires more capital than the leek has, only the equipment is applied. In JS, TS and Python, beforeFight() is only called if the AI defines turn() and the code at the root of the file performs no combat action; otherwise the hook is skipped and a warning is added to the report.

Applies a loadout for this fight only, without changing the leek's persistent equipment. To be used only in beforeFight() (see Fight hooks). If the name does not exist or if setLoadout is called outside of beforeFight(), the function returns false and a warning is added to the report. loadout can also be a loadout built in code, in the getLoadout format (see getInventory). With a name as with an object, each leek gets its own copy of every item: what the farmer's other leeks already wear is skipped with a warning, and copies go to the leeks in the order their beforeFight() runs.

// This function is called automatically before turn 1
function beforeFight() {
	// Choose one of the loadouts defined on the leek's page
	setLoadout("my_loadout"); //applies the loadout "my_loadout" and consumes a restat potion if its capital allocation requires it
}
// This function is called automatically before turn 1
function beforeFight() {
	// Choose one of the loadouts defined on the leek's page
	Fight.me.setLoadout("my_loadout") // applies the loadout "my_loadout" and consumes a restat potion if its capital allocation requires it
}

// In TypeScript and JavaScript, hooks are only called if the AI defines turn()
function turn() {
	// ...
}
# This function is called automatically before turn 1
def beforeFight():
	# Choose one of the loadouts defined on the leek's page
	Fight.me.setLoadout("my_loadout")  # applies the loadout "my_loadout" and consumes a restat potion if its capital allocation requires it

# In Python, hooks are only called if the AI defines turn()
def turn():
	pass
Parameters
Return