Skip to content

Commit

Permalink
fix barb str/agi xp
Browse files Browse the repository at this point in the history
  • Loading branch information
Arodab committed Oct 19, 2024
1 parent a7f251b commit 7b13418
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 24 deletions.
15 changes: 3 additions & 12 deletions src/lib/skilling/skills/fishing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,32 +369,23 @@ const fishes: Fish[] = [
xp: 50,
intercept: 32 / 255,
slope: (192 - 32) / 255 / 98,
otherXP: {
[SkillsEnum.Strength]: 5, // Experience points for Strength
[SkillsEnum.Agility]: 5 // Experience points for Agility
}
otherXP: 5
},
{
id: itemID('Leaping salmon'),
level: 58,
xp: 70,
intercept: 16 / 255,
slope: (96 - 16) / 255 / 98,
otherXP: {
[SkillsEnum.Strength]: 6, // Experience points for Strength
[SkillsEnum.Agility]: 6 // Experience points for Agility
}
otherXP: 6
},
{
id: itemID('Leaping sturgeon'),
level: 70,
xp: 80,
intercept: 8 / 255,
slope: (64 - 8) / 255 / 98,
otherXP: {
[SkillsEnum.Strength]: 7, // Experience points for Strength
[SkillsEnum.Agility]: 7 // Experience points for Agility
}
otherXP: 7
}
],

Expand Down
4 changes: 2 additions & 2 deletions src/lib/skilling/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Bank, Item, LootTable } from 'oldschooljs';

import type { Skills } from '../../lib/types';
//import type { Skills } from '../../lib/types';
import type { Emoji } from '../constants';
import type { QuestID } from '../minions/data/quests';
import type { SlayerTaskUnlocksEnum } from '../slayer/slayerUnlocks';
Expand Down Expand Up @@ -116,7 +116,7 @@ export interface FishInSpot {
xp: number;
intercept: number;
slope: number;
otherXP?: Omit<Skills, 'fishing'>;
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.
*
Expand Down
1 change: 0 additions & 1 deletion src/mahoji/commands/fish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function determineFishingTime({
probabilities[0] = harpoonBoost * (adjustedIntercept + (effFishLvl - 1) * adjustedSlope);
}

console.log(probabilities);
let ticksPerRoll = fish.ticksPerRoll!;
let lostTicks = fish.lostTicks!;
let bankingTime = fish.bankingTime;
Expand Down
22 changes: 13 additions & 9 deletions src/tasks/minions/fishingActivity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { objectEntries, randInt, sumArr } from 'e';
import { randInt, sumArr } from 'e';
//import { objectEntries, randInt, sumArr } from 'e';
import { EItem } from 'oldschooljs';
import { z } from 'zod';

Expand Down Expand Up @@ -50,16 +51,14 @@ export function determineFishingResult({
const fishingLevel = gearBank.skillsAsLevels.fishing;
const minnowRange = determineMinnowRange(fishingLevel);
let totalXP = 0;
let totalOtherXP = 0;

for (const { fish, quantity, loot } of fishingSpotResults) {
totalXP += quantity * fish.xp;
console.log(totalXP);
updateBank.itemLootBank.add(fish.id, loot);

if ('otherXP' in fish && fish.otherXP) {
for (const [skillName, xp] of objectEntries(fish.otherXP)) {
updateBank.xpBank.add(skillName, quantity * xp!);
}
if ('otherXP' in fish) {
totalOtherXP += quantity * fish.otherXP!;
}

if (fish.tertiary) {
Expand All @@ -70,6 +69,10 @@ export function determineFishingResult({
}
}
updateBank.xpBank.add('fishing', totalXP);
if (totalOtherXP > 0) {
updateBank.xpBank.add('strength', totalOtherXP);
updateBank.xpBank.add('agility', totalOtherXP);
}

const anglerBoost = determineAnglerBoost({ gearBank });
if (anglerBoost > 0) {
Expand Down Expand Up @@ -137,7 +140,8 @@ export function temporaryFishingDataConvert(fish: Fish, Qty: number[], loot: num
level: subfish.level,
intercept: subfish.intercept!,
slope: subfish.slope!,
xp: subfish.xp
xp: subfish.xp,
otherXP: subfish.otherXP ?? 0
},
quantity: Qty[i],
loot: loot[i]
Expand All @@ -163,7 +167,7 @@ export const fishingTask: MinionTask = {
const user = await mUserFetch(userID);
const fishLvl = user.skillLevel(SkillsEnum.Fishing);
const fish = Fishing.Fishes.find(fish => fish.name === fishID)!;
console.log('test');

const { updateBank, totalCatches } = determineFishingResult({
gearBank: user.gearBank,
spot: fish,
Expand All @@ -178,7 +182,7 @@ export const fishingTask: MinionTask = {
}

let str = `${user}, ${user.minionName} finished fishing ${totalCatches} ${fish.name}. You received ${updateBank.xpBank}.`;
console.log(Qty);

if (loot[0]) {
str += `\nYou received ${updateResult.itemTransactionResult?.itemsAdded}.`;
}
Expand Down

0 comments on commit 7b13418

Please sign in to comment.