Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing leagues 5 code #600

Merged
merged 2 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions scripts/generateEquipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@
'Combat style'
]

ITEMS_TO_SKIP = [
'The dogsword',
'Drygore blowpipe',
'Amulet of the monarchs',
'Emperor ring',
'Devil\'s element',
'Nature\'s reprisal',
'Gloves of the damned',
'Crystal blessing',
'Sunlight spear',
'Sunlit bracers',
'Thunder khopesh',
'Thousand-dragon ward'
]

def getEquipmentData():
equipment = {}
offset = 0
Expand Down Expand Up @@ -147,6 +162,9 @@ def main():
if "(Last Man Standing)" in equipment['name']:
continue

if equipment['name'] in ITEMS_TO_SKIP:
continue

# Append the current equipment item to the calc's equipment list
data.append(equipment)

Expand Down
9 changes: 3 additions & 6 deletions src/app/components/generic/GridItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ interface IGridItemProps<T> {
image: string | StaticImageData;
onClick: (item: T) => void;
active: boolean;
width?: number;
height?: number;
className?: string;
}

/**
* Reusable component for clickable cells of certain grids, such as the Prayer grid.
*/
const GridItem: React.FC<IGridItemProps<number>> = observer(<T extends number>(props: IGridItemProps<T>) => {
const {
item, name, image, active, onClick, width, height, className,
item, name, image, active, onClick,
} = props;

return (
Expand All @@ -28,15 +25,15 @@ const GridItem: React.FC<IGridItemProps<number>> = observer(<T extends number>(p
data-tooltip-id="tooltip"
data-tooltip-content={name}
onClick={() => onClick(item)}
className={`cursor-pointer flex justify-center items-center ${className}`}
className="cursor-pointer w-[28px] h-[23px] flex justify-center items-center"
>
<div className="relative">
{active && (
<IconCircleCheckFilled
className="filter drop-shadow absolute top-[-10px] left-[-12px] text-green-400 dark:text-green-200 w-5"
/>
)}
<Image src={image} alt={name} width={width ?? 28} height={height ?? 23} />
<Image src={image} alt={name} />
</div>
</button>
);
Expand Down
123 changes: 0 additions & 123 deletions src/app/components/player/EchoesLeague.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions src/app/components/player/PlayerInnerContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import options from '@/public/img/tabs/options.webp';
import prayer from '@/public/img/tabs/prayer.png';
import React, { useState } from 'react';
import PlayerTab from '@/app/components/player/PlayerTab';
import league from '@/public/img/tabs/league.png';
import EchoesLeague from '@/app/components/player/EchoesLeague';
import Equipment from './Equipment';
import Combat from './Combat';
import Skills from './Skills';
Expand All @@ -30,8 +28,6 @@ const PlayerInnerContainer: React.FC = () => {
return <Prayers />;
case 'options':
return <ExtraOptions />;
case 'league':
return <EchoesLeague />;
default:
break;
}
Expand All @@ -47,7 +43,6 @@ const PlayerInnerContainer: React.FC = () => {
<PlayerTab name="Equipment" isActive={selected === 'equipment'} image={equipment} onClick={() => setSelected('equipment')} />
<PlayerTab name="Prayer" isActive={selected === 'prayer'} image={prayer} onClick={() => setSelected('prayer')} />
<PlayerTab name="Extra options" isActive={selected === 'options'} image={options} onClick={() => setSelected('options')} />
<PlayerTab name="Raging Echoes League" isActive={selected === 'league'} image={league} onClick={() => setSelected('league')} />
</div>
{renderSelected()}
</div>
Expand Down
9 changes: 0 additions & 9 deletions src/app/components/results/HitDistribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { observer } from 'mobx-react-lite';
import { max } from 'd3-array';
import { toJS } from 'mobx';
import { isDefined } from '@/utils';
import { MeleeMastery } from '@/lib/LeaguesV';

const CustomTooltip: React.FC<TooltipProps<ValueType, NameType>> = ({ active, payload, label }) => {
if (active && payload && payload.length) {
Expand Down Expand Up @@ -138,14 +137,6 @@ const HitDistribution: React.FC = observer(() => {
<Bar dataKey="value" fill="tan" isAnimationActive={false} />
</BarChart>
</ResponsiveContainer>
{store.loadouts[selectedLoadout].leagues.five.melee >= MeleeMastery.MELEE_2 && (
<p className="text-sm text-gray-400 pt-2">
<em>
Echoes are intentionally omitted from the above graph for clarity,
but are included in all other calculations.
</em>
</p>
)}
</div>
</SectionAccordion>
);
Expand Down
1 change: 0 additions & 1 deletion src/enums/EquipmentCategory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export enum EquipmentCategory {
CROSSBOW = 'Crossbow',
DAGGER = 'Dagger',
GUN = 'Gun',
MULTISTYLE = 'Multi-Style',
PARTISAN = 'Partisan',
PICKAXE = 'Pickaxe',
POLEARM = 'Polearm',
Expand Down
16 changes: 4 additions & 12 deletions src/lib/BaseCalc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export default class BaseCalc {
}

protected isWearingGodsword(): boolean {
return this.wearing(['Ancient godsword', 'Armadyl godsword', 'Bandos godsword', 'Saradomin godsword', 'Zamorak godsword', 'The dogsword']);
return this.wearing(['Ancient godsword', 'Armadyl godsword', 'Bandos godsword', 'Saradomin godsword', 'Zamorak godsword']);
}

/**
Expand Down Expand Up @@ -382,7 +382,7 @@ export default class BaseCalc {
* @see https://oldschool.runescape.wiki/w/Karil_the_Tainted%27s_equipment
*/
protected isWearingKarils(): boolean {
return this.wearingAll(["Karil's coif", "Karil's leathertop", "Karil's leatherskirt", "Karil's crossbow"]) && this.isWearingAnyDamnedItems();
return this.wearingAll(["Karil's coif", "Karil's leathertop", "Karil's leatherskirt", "Karil's crossbow", 'Amulet of the damned']);
}

/**
Expand All @@ -391,19 +391,15 @@ export default class BaseCalc {
*/

protected isWearingAhrims(): boolean {
return this.wearingAll(["Ahrim's staff", "Ahrim's hood", "Ahrim's robetop", "Ahrim's robeskirt"]) && this.isWearingAnyDamnedItems();
return this.wearingAll(["Ahrim's staff", "Ahrim's hood", "Ahrim's robetop", "Ahrim's robeskirt", 'Amulet of the damned']);
}

/**
* Whether the player is wearing the entire Torag the Corrupted's equipment set including a damned item.
* @see https://oldschool.runescape.wiki/w/Torag_the_Corrupted%27s_equipment
*/
protected isWearingTorags(): boolean {
return this.wearingAll(["Torag's helm", "Torag's platebody", "Torag's platelegs", "Torag's hammers"]) && this.isWearingAnyDamnedItems();
}

protected isWearingAnyDamnedItems(): boolean {
return this.wearing('Amulet of the damned') || this.wearing('Gloves of the damned');
return this.wearingAll(["Torag's helm", "Torag's platebody", "Torag's platelegs", "Torag's hammers", 'Amulet of the damned']);
}

protected isWearingBloodMoonSet(): boolean {
Expand Down Expand Up @@ -523,10 +519,6 @@ export default class BaseCalc {
return true;
}

if (this.wearing('Thunder khopesh')) {
return true;
}

return false;
}

Expand Down
5 changes: 0 additions & 5 deletions src/lib/CalcDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ export enum DetailKey {
NPC_ACCURACY_ROLL_BONUS = 'NPC accuracy bonus',
NPC_ACCURACY_ROLL_FINAL = 'NPC accuracy roll',

// leagues relics
PLAYER_ACCURACY_LEAGUES_5_PASSIVE = 'Leagues V passive accuracy',
MAX_HIT_FOCUS_BLASTS = 'Focus blasts max hit',
MAX_HIT_ADRENALINE_CHARGES = 'Adrenaline charges max hit',
MAX_HIT_REPEAT_SHOOTER = 'Repeat shooter max hit',
}

export interface DetailEntry {
Expand Down
25 changes: 0 additions & 25 deletions src/lib/Equipment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,29 +254,6 @@ export const calculateAttackSpeed = (player: Player, monster: Monster): number =
}
}

let activeRelic: number;
if (player.style.type === 'ranged') {
activeRelic = player.leagues.five.ranged;
} else if (player.style.type === 'magic') {
activeRelic = player.leagues.five.magic;
} else {
activeRelic = player.leagues.five.melee;
}

if (activeRelic >= 5) {
if (attackSpeed >= 5) {
attackSpeed = Math.trunc(attackSpeed / 2);
} else {
attackSpeed = Math.ceil(attackSpeed / 2);
}
} else if (activeRelic >= 3) {
attackSpeed = Math.trunc(attackSpeed * 4 / 5);
}

if (player.style.type === 'magic' && activeRelic >= 2) {
attackSpeed += player.leagues.five.ticksDelayed;
}

return Math.max(attackSpeed, 1);
};

Expand Down Expand Up @@ -422,8 +399,6 @@ export const WEAPON_SPEC_COSTS: { [canonicalName: string]: number } = {
'Armadyl godsword': 50,
'Zamorak godsword': 50,
'Abyssal bludgeon': 50,
'The dogsword': 50,
'Thunder khopesh': 50,

'Magic shortbow': 55,
'Dark bow': 55,
Expand Down
Loading