Skip to content

Commit

Permalink
Fix the pull logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignose committed Dec 3, 2023
1 parent d0b77bb commit 5142904
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
myMaxhp,
myMp,
myPrimestat,
numericModifier,
print,
restoreMp,
retrieveItem,
Expand Down Expand Up @@ -53,7 +52,6 @@ import {
$slot,
$stat,
canRememberSong,
clamp,
CombatLoversLocket,
CommunityService,
get,
Expand Down Expand Up @@ -201,13 +199,26 @@ export function computeWeaponDamage(): number {
return wDmgNumber;
}

function computeWdmgPoints(wdmg: number): number {
const threshold = 3000;
const increment = 25;
const currentPoints = computeWeaponDamage();
const totalDamage = currentPoints + wdmg;

if (currentPoints >= threshold) return 0;

if (currentPoints < threshold) {
return Math.floor((totalDamage - currentPoints) / increment);
}
return 0;
}

const famJacksValue = have($familiar`Comma Chameleon`) && !have($skill`Summon Clip Art`) ? 21 : 0;
const greatWolfs = clamp(3, 2, (3000 - computeWeaponDamage() + 50) / 25 + 2);
const stickKnife =
myPrimestat() === $stat`muscle` ? clamp(6, 4, (3000 - computeWeaponDamage() + 50) / 25 + 4) : 0;
const greatWolfs = computeWdmgPoints(50) + 2;
const stickKnife = myPrimestat() === $stat`muscle` ? computeWdmgPoints(130) + 4 : 0;
const staff = have($skill`Spirit of Rigatoni`) ? 4 : 0;
const tobikoSoda = have($skill`Summon Alice's Army Cards`) ? 0 : 3;
const meteorite = clamp(12, 4, (3000 - computeWeaponDamage() + 200) / 25 + 4);
const meteorite = computeWdmgPoints(200) + 4;

export const pullValue = new Map([
[$item`box of Familiar Jacks`, famJacksValue],
Expand Down

0 comments on commit 5142904

Please sign in to comment.