setLoadout

setLoadout

> Functions

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