Skip to content

Commit

Permalink
fish
Browse files Browse the repository at this point in the history
  • Loading branch information
Arodab committed Dec 8, 2024
1 parent 5fb86f0 commit 4245aef
Show file tree
Hide file tree
Showing 11 changed files with 614 additions and 359 deletions.
2 changes: 1 addition & 1 deletion src/lib/allObtainableItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ for (const a of Enchantables) {
totalBankToAdd.add(a.output);
}
for (const fish of Fishing.Fishes) {
ALL_OBTAINABLE_ITEMS.add(fish.id);
ALL_OBTAINABLE_ITEMS.add(fish.id!);
}
for (const clue of ClueTiers) {
ALL_OBTAINABLE_ITEMS.add(clue.id);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/skilling/skills/fishing.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sumArr } from 'e';
import { EItem } from 'oldschooljs';
import { Emoji } from '../../constants';
import type { GearBank } from '../../structures/GearBank';
import { EItem } from 'oldschooljs';
import itemID from '../../util/itemID';
import type { Fish } from '../types';
import { SkillsEnum } from '../types';
Expand Down
34 changes: 29 additions & 5 deletions src/lib/skilling/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,43 @@ export interface Burnable {
inputLogs: number;
}

export interface Fish {
export interface FishInSpot {
id: number;
level: number;
xp: number;
id: number;
intercept: number;
slope: number;
otherXP?: number; // Omit<Skills, 'fishing'>;
/**
* Items that have a tertiary chance to drop from catching one of these fish, i.e "Big swordfish" from swordfish.
*
* 1 in X chance, to receive item with the id
*/
tertiary?: { chance: number; id: number };
}

export interface Fish {
name: string;
alias?: string[];
subfishes?: FishInSpot[]; // Array of subfishes with level, xp, and id

petChance?: number;
timePerFish: number;
clueScrollChance?: number;
lostTicks?: number;
bankingTime?: number;
ticksPerRoll?: number;
bait?: number;
qpRequired?: number;
bigFish?: number;
bigFishRate?: number;
clueScrollChance?: number;
alias?: string[];

// still needed for camdozaal
timePerFish?: number;
level?: number;
xp?: number;
id?: number;

skillReqs?: Omit<LevelRequirements, 'fishing'>;
}

export interface Course {
Expand Down
12 changes: 8 additions & 4 deletions src/lib/types/minions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,14 @@ export interface ClueActivityTaskOptions extends ActivityTaskOptions {

export interface FishingActivityTaskOptions extends ActivityTaskOptions {
type: 'Fishing';
fishID: number;
quantity: number;
flakesQuantity?: number;
iQty?: number;
fishID: string;
duration: number;
quantity?: number;
Qty: number[];
loot?: number[];
flakesToRemove?: number;
powerfish?: boolean;
spirit_flakes?: boolean;
}

export interface MiningActivityTaskOptions extends ActivityTaskOptions {
Expand Down
5 changes: 0 additions & 5 deletions src/lib/util/calcMaxTripLength.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ export function calcMaxTripLength(user: MUser, activity?: activity_type_enum) {
max += patronMaxTripBonus(user);

switch (activity) {
case 'Fishing':
if (user.allItemsOwned.has('Fish sack barrel') || user.allItemsOwned.has('Fish barrel')) {
max += Time.Minute * 9;
}
break;
case 'Nightmare':
case 'GroupMonsterKilling':
case 'MonsterKilling':
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/minionStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function minionStatus(user: MUser) {
case 'Fishing': {
const data = currentTask as FishingActivityTaskOptions;

const fish = Fishing.Fishes.find(fish => fish.id === data.fishID);
const fish = Fishing.Fishes.find(fish => fish.name === data.fishID);

return `${name} is currently fishing ${data.quantity}x ${fish?.name}. ${formattedDuration} Your ${
Emoji.Fishing
Expand Down
4 changes: 2 additions & 2 deletions src/lib/util/repeatStoredTrip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ const tripHandlers = {
commandName: 'fish',
args: (data: FishingActivityTaskOptions) => ({
name: data.fishID,
quantity: data.iQty,
flakes: data.flakesQuantity !== undefined
quantity: data.quantity,
flakes: data.spirit_flakes
})
},
[activity_type_enum.FishingTrawler]: {
Expand Down
Loading

0 comments on commit 4245aef

Please sign in to comment.