diff --git a/src/lib/util/repeatStoredTrip.ts b/src/lib/util/repeatStoredTrip.ts index d3495f97c1..4f42ee1f50 100644 --- a/src/lib/util/repeatStoredTrip.ts +++ b/src/lib/util/repeatStoredTrip.ts @@ -464,8 +464,8 @@ export const tripHandlers = { commandName: 'k', args: (data: MonsterActivityTaskOptions) => { let method: PvMMethod = 'none'; - if (data.usingCannon) method = 'cannon'; - if (data.chinning) (method as string) = 'chinning'; + if (data.usingCannon || data.cannonMulti) method = 'cannon'; + if (data.chinning) method = 'chinning'; else if (data.bob === SlayerActivityConstants.IceBarrage) method = 'barrage'; else if (data.bob === SlayerActivityConstants.IceBurst) method = 'burst'; return { diff --git a/src/mahoji/lib/abstracted_commands/minionKill/newMinionKill.ts b/src/mahoji/lib/abstracted_commands/minionKill/newMinionKill.ts index d1aa6806f9..68621bec47 100644 --- a/src/mahoji/lib/abstracted_commands/minionKill/newMinionKill.ts +++ b/src/mahoji/lib/abstracted_commands/minionKill/newMinionKill.ts @@ -7,7 +7,7 @@ import z from 'zod'; import { BitField, type PvMMethod, YETI_ID } from '../../../../lib/constants'; import { getSimilarItems } from '../../../../lib/data/similarItems'; import type { InventionID } from '../../../../lib/invention/inventions'; -import { type CombatOptionsEnum, SlayerActivityConstants } from '../../../../lib/minions/data/combatConstants'; +import { type CombatOptionsEnum } from '../../../../lib/minions/data/combatConstants'; import { revenantMonsters } from '../../../../lib/minions/data/killableMonsters/revs'; import { type AttackStyles, @@ -27,14 +27,12 @@ import { formatDuration, isWeekend, itemID, - itemNameFromID, - numberEnum, - zodEnum + itemNameFromID, zodEnum } from '../../../../lib/util'; import getOSItem from '../../../../lib/util/getOSItem'; import { killsRemainingOnTask } from './calcTaskMonstersRemaining'; import { type PostBoostEffect, postBoostEffects } from './postBoostEffects'; -import { speedCalculations } from './timeAndSpeed'; +import { CombatMethodOptionsSchema, speedCalculations } from './timeAndSpeed'; const newMinionKillReturnSchema = z.object({ duration: z.number().int().positive(), @@ -42,22 +40,11 @@ const newMinionKillReturnSchema = z.object({ isOnTask: z.boolean(), isInWilderness: z.boolean(), attackStyles: z.array(z.enum(zodEnum(attackStylesArr))), - currentTaskOptions: z.object({ - bob: z - .number() - .superRefine(numberEnum([SlayerActivityConstants.IceBarrage, SlayerActivityConstants.IceBurst])) - .optional(), - usingCannon: z.boolean().optional(), - cannonMulti: z.boolean().optional(), - chinning: z.boolean().optional(), - hasWildySupplies: z.boolean().optional(), - died: z.boolean().optional(), - pkEncounters: z.number().int().min(0).optional(), - isInWilderness: z.boolean().optional() - }), + currentTaskOptions: CombatMethodOptionsSchema, messages: z.array(z.string()), updateBank: z.instanceof(UpdateBank) }); + export type MinionKillReturn = z.infer; export interface MinionKillOptions { attackStyles: AttackStyles[]; diff --git a/src/mahoji/lib/abstracted_commands/minionKill/timeAndSpeed.ts b/src/mahoji/lib/abstracted_commands/minionKill/timeAndSpeed.ts index ae18d2177f..c5834b6354 100644 --- a/src/mahoji/lib/abstracted_commands/minionKill/timeAndSpeed.ts +++ b/src/mahoji/lib/abstracted_commands/minionKill/timeAndSpeed.ts @@ -3,19 +3,35 @@ import { Bank } from 'oldschooljs'; import { mergeDeep } from 'remeda'; import z from 'zod'; +import { SlayerActivityConstants } from '../../../../lib/minions/data/combatConstants'; import { type AttackStyles, getAttackStylesContext } from '../../../../lib/minions/functions'; import reducedTimeFromKC from '../../../../lib/minions/functions/reducedTimeFromKC'; import type { Consumable } from '../../../../lib/minions/types'; import { ChargeBank } from '../../../../lib/structures/Bank'; import { UpdateBank } from '../../../../lib/structures/UpdateBank'; import type { SkillsRequired } from '../../../../lib/types'; +import { numberEnum } from '../../../../lib/util'; import { getItemCostFromConsumables } from './handleConsumables'; import { type BoostArgs, type BoostResult, type CombatMethodOptions, mainBoostEffects } from './speedBoosts'; +export const CombatMethodOptionsSchema = z.object({ + bob: z + .number() + .superRefine(numberEnum([SlayerActivityConstants.IceBarrage, SlayerActivityConstants.IceBurst])) + .optional(), + usingCannon: z.boolean().optional(), + cannonMulti: z.boolean().optional(), + chinning: z.boolean().optional(), + hasWildySupplies: z.boolean().optional(), + died: z.boolean().optional(), + pkEncounters: z.number().int().min(0).optional(), + isInWilderness: z.boolean().optional() +}); + const schema = z.object({ timeToFinish: z.number().int().positive(), messages: z.array(z.string()), - currentTaskOptions: z.object({}), + currentTaskOptions: CombatMethodOptionsSchema, finalQuantity: z.number().int().positive().min(1), confirmations: z.array(z.string()), updateBank: z.instanceof(UpdateBank) diff --git a/src/tasks/minions/monsterActivity.ts b/src/tasks/minions/monsterActivity.ts index dfe515542a..4e6ac01ef0 100644 --- a/src/tasks/minions/monsterActivity.ts +++ b/src/tasks/minions/monsterActivity.ts @@ -322,7 +322,8 @@ export function doMonsterTrip(data: newOptions) { }); const superiorTable = slayerContext.hasSuperiorsUnlocked && monster.superior ? monster.superior : undefined; - const isInCatacombs = (!usingCannon ? (monster.existsInCatacombs ?? undefined) : undefined) && !isInWilderness; + const isInCatacombs = + (!(usingCannon || cannonMulti) ? (monster.existsInCatacombs ?? undefined) : undefined) && !isInWilderness; const hasRingOfWealthI = gearBank.gear.wildy.hasEquipped('Ring of wealth (i)') && isInWilderness; if (hasRingOfWealthI) {