├── .gitignore ├── src ├── libraryTypes │ ├── dexie.d.ts │ ├── swalGlobal.d.ts │ ├── dagre.d.ts │ ├── fflate.d.ts │ ├── pixijsGlobal.d.ts │ ├── viewportGlobal.d.ts │ ├── petite-vue.d.ts │ ├── fuseGlobal.d.ts │ ├── sortableGlobal.d.ts │ ├── ifvisibleGlobal.d.ts │ ├── simplebarGlobal.d.ts │ ├── versionCheck.d.ts │ ├── mitt.d.ts │ ├── ionRangeSlider.d.ts │ ├── tippyGlobal.d.ts │ └── listFormat.d.ts └── gameTypes │ ├── README.md │ ├── db.d.ts │ ├── ui.d.ts │ ├── eventMenu.d.ts │ ├── achievements.d.ts │ ├── composables.d.ts │ ├── attackStyle.d.ts │ ├── localizationGeneration.d.ts │ ├── damageSplash.d.ts │ ├── mastery2.d.ts │ ├── account.d.ts │ ├── itemSynergies.d.ts │ ├── assets.d.ts │ ├── language.d.ts │ ├── progressbar.d.ts │ ├── eventManager.d.ts │ ├── itemCharges.d.ts │ ├── statsTable.d.ts │ ├── lore.d.ts │ ├── combatLoot.d.ts │ ├── golbin.d.ts │ ├── typeOverloads.d.ts │ ├── rockMenu.d.ts │ ├── tutorialMenus.d.ts │ ├── mod.d.ts │ ├── passives.d.ts │ ├── pages.d.ts │ ├── equippedFood.d.ts │ ├── statTracker.d.ts │ ├── altMagicMenu.d.ts │ ├── expressionAST.d.ts │ ├── harvestingMenu.d.ts │ ├── milestones.d.ts │ ├── woodcuttingMenu.d.ts │ ├── combatTriangle.d.ts │ ├── raidPlayer.d.ts │ ├── minibar.d.ts │ ├── potionManager.d.ts │ ├── effectRenderer.d.ts │ ├── combatSkills.d.ts │ ├── expressionBuilder.d.ts │ ├── crafting.d.ts │ ├── cloud.d.ts │ ├── pets.d.ts │ ├── classInterfaces.d.ts │ ├── thievingMenu.d.ts │ ├── smithing.d.ts │ ├── herblore.d.ts │ ├── cookingMenu.d.ts │ ├── artisanMenu.d.ts │ ├── characterSelectMenus.d.ts │ ├── ancientRelics.d.ts │ ├── firemakingMenus.d.ts │ ├── uiCallbacks.d.ts │ ├── fishingMenus.d.ts │ ├── runecrafting.d.ts │ ├── corruption.d.ts │ ├── enemy.d.ts │ ├── clueHunt.d.ts │ ├── fletching.d.ts │ ├── skillTree.d.ts │ ├── prayer.d.ts │ ├── realms.d.ts │ ├── dataStructures.d.ts │ ├── harvesting.d.ts │ ├── attacks2.d.ts │ ├── main.d.ts │ ├── summoningMenus.d.ts │ ├── skillTreeMenus.d.ts │ ├── monsters.d.ts │ ├── farmingMenus.d.ts │ ├── components.d.ts │ ├── tutorialIsland.d.ts │ └── statProvider.d.ts ├── tsconfig.json ├── README.md ├── package.json └── CHANGES.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json -------------------------------------------------------------------------------- /src/libraryTypes/dexie.d.ts: -------------------------------------------------------------------------------- 1 | import Dexie from 'dexie'; 2 | export as namespace Dexie; 3 | export = Dexie; 4 | -------------------------------------------------------------------------------- /src/libraryTypes/swalGlobal.d.ts: -------------------------------------------------------------------------------- 1 | import Swal from 'sweetalert2'; 2 | export = Swal; 3 | export as namespace Swal; -------------------------------------------------------------------------------- /src/libraryTypes/dagre.d.ts: -------------------------------------------------------------------------------- 1 | import * as dagre from '@dagrejs/dagre'; 2 | export as namespace dagre; 3 | export = dagre; -------------------------------------------------------------------------------- /src/libraryTypes/fflate.d.ts: -------------------------------------------------------------------------------- 1 | import * as fflate from 'fflate'; 2 | export as namespace fflate; 3 | export = fflate; 4 | -------------------------------------------------------------------------------- /src/libraryTypes/pixijsGlobal.d.ts: -------------------------------------------------------------------------------- 1 | export * from 'pixi.js'; 2 | export * from '@pixi/basis'; 3 | export as namespace PIXI; -------------------------------------------------------------------------------- /src/libraryTypes/viewportGlobal.d.ts: -------------------------------------------------------------------------------- 1 | import * as pixi_viewport from 'pixi-viewport' 2 | export = pixi_viewport; 3 | export as namespace pixi_viewport; -------------------------------------------------------------------------------- /src/libraryTypes/petite-vue.d.ts: -------------------------------------------------------------------------------- 1 | import { createApp, reactive } from 'petite-vue'; 2 | export as namespace PetiteVue; 3 | export = { createApp, reactive }; 4 | -------------------------------------------------------------------------------- /src/libraryTypes/fuseGlobal.d.ts: -------------------------------------------------------------------------------- 1 | // This file is to make fuse work as a UMD global 2 | import * as Fuse from 'fuse.js'; 3 | export as namespace Fuse; 4 | export = Fuse; -------------------------------------------------------------------------------- /src/libraryTypes/sortableGlobal.d.ts: -------------------------------------------------------------------------------- 1 | // Exposes the Sortable library as a global object 2 | import Sortable = require("sortablejs"); 3 | export = Sortable; 4 | export as namespace Sortable; -------------------------------------------------------------------------------- /src/libraryTypes/ifvisibleGlobal.d.ts: -------------------------------------------------------------------------------- 1 | // Exports ifvisible in globally accessible manner 2 | import * as ifvisible from "ifvisible"; 3 | export as namespace ifvisible; 4 | export = ifvisible; -------------------------------------------------------------------------------- /src/libraryTypes/simplebarGlobal.d.ts: -------------------------------------------------------------------------------- 1 | // Exposes the Simplebar library as a global object 2 | import SimpleBar = require("simplebar"); 3 | export = SimpleBar; 4 | export as namespace SimpleBar; -------------------------------------------------------------------------------- /src/libraryTypes/versionCheck.d.ts: -------------------------------------------------------------------------------- 1 | declare const gameFileVersion: string; 2 | declare let gameFileVersionCheckPassed: boolean; 3 | declare function checkFileVersion(fileVersion: string): void; -------------------------------------------------------------------------------- /src/libraryTypes/mitt.d.ts: -------------------------------------------------------------------------------- 1 | import mitt, { EventType as _EventType, Handler as _Handler, WildcardHandler as _WildcardHandler, Emitter as _Emitter } from 'mitt'; 2 | export as namespace mitt; 3 | export = mitt; -------------------------------------------------------------------------------- /src/gameTypes/README.md: -------------------------------------------------------------------------------- 1 | # A Note on Game Types 2 | Contained within this folder are the official type definitions generated from the game's typescript files. 3 | Permission to distribute these has been granted by Malcs. -------------------------------------------------------------------------------- /src/gameTypes/db.d.ts: -------------------------------------------------------------------------------- 1 | declare class MelvorDatabase extends Dexie { 2 | mods: Dexie.Table; 3 | localMods: Dexie.Table; 4 | constructor(); 5 | } 6 | -------------------------------------------------------------------------------- /src/libraryTypes/ionRangeSlider.d.ts: -------------------------------------------------------------------------------- 1 | // Exports ion range slider callback event in globally accessible manner 2 | import { IonRangeSliderEvent } from "ion-rangeslider"; 3 | export type EventCallback = (obj: IonRangeSliderEvent) => void; 4 | export as namespace IonRangeSlider; -------------------------------------------------------------------------------- /src/gameTypes/ui.d.ts: -------------------------------------------------------------------------------- 1 | declare type ComponentProps = { 2 | $template: string; 3 | [key: string]: unknown; 4 | }; 5 | declare const ui: { 6 | create: (props: ComponentProps, host: Element) => Element; 7 | createStatic: (template: string, host: Element) => Element; 8 | createStore: >(props: T) => T; 9 | }; 10 | -------------------------------------------------------------------------------- /src/gameTypes/eventMenu.d.ts: -------------------------------------------------------------------------------- 1 | declare class CombatEventMenuElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | _title: HTMLHeadingElement; 4 | _startButton: HTMLButtonElement; 5 | _passiveButton: HTMLButtonElement; 6 | constructor(); 7 | connectedCallback(): void; 8 | setButtonCallbacks(): void; 9 | } 10 | -------------------------------------------------------------------------------- /src/gameTypes/achievements.d.ts: -------------------------------------------------------------------------------- 1 | interface SteamAchievementData { 2 | id: string; 3 | requirements: AnyRequirementData[]; 4 | requiredGamemodeID?: string; 5 | } 6 | declare class SteamAchievement { 7 | id: string; 8 | requirements: AnyRequirement[]; 9 | requiredGamemode?: Gamemode; 10 | constructor(data: SteamAchievementData, game: Game); 11 | } 12 | -------------------------------------------------------------------------------- /src/libraryTypes/tippyGlobal.d.ts: -------------------------------------------------------------------------------- 1 | import {Tippy, HideAll, Delegate, CreateSingleton, roundArrow} from 'tippy.js'; 2 | export as namespace tippy 3 | export = tippy; 4 | interface TippyGlobal extends Tippy { 5 | hideAll: HideAll; 6 | delegate: Delegate; 7 | createSingleton: CreateSingleton; 8 | readonly roundArrow: typeof roundArrow; 9 | } 10 | 11 | declare const tippy: TippyGlobal; -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2015", 4 | "lib": ["ES2020", "dom"], 5 | "allowUmdGlobalAccess": true, 6 | "strict": true, 7 | "moduleResolution": "node", 8 | "module": "ES2020", 9 | "skipLibCheck": true 10 | }, 11 | "include": ["./src/libraryTypes/*","./src/gameTypes/*"], 12 | "typeAcquisition": { 13 | "enable": true 14 | }, 15 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Melvor Typing Project 2 | ## About 3 | This project provides official type definitions for Melvor Idle, for use in developing mods. 4 | 5 | The types are divided into two folders: 6 | - gameTypes: This contains typedefs that were generated using the game's source files 7 | - libraryTypes: This contains typedefs that are used to expose libararies that the game has to global scope 8 | 9 | ## Library Dependencies 10 | This project also contains a package.json which can be used to install the typedefs and libraries that Melvor currently uses with node.js. These are available in global scope and may be utilized by mods. 11 | -------------------------------------------------------------------------------- /src/gameTypes/composables.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Helpful function wrappers for common functionalities 3 | */ 4 | declare const useMitt: >() => { 5 | readonly all: () => import("mitt").EventHandlerMap; 6 | emit: { 7 | (type: Key, event: T[Key]): void; 8 | (type: undefined extends T[Key_1] ? Key_1 : never): void; 9 | }; 10 | on: (key: K, handler: (value: T[K]) => void) => () => void; 11 | cleanup: () => void; 12 | }; 13 | declare const useEvents: (...events: (() => void)[]) => () => void; 14 | -------------------------------------------------------------------------------- /src/gameTypes/attackStyle.d.ts: -------------------------------------------------------------------------------- 1 | interface AttackStyleData extends IDData, IStatObjectData { 2 | experienceGain: { 3 | skillID: string; 4 | ratio: number; 5 | }[]; 6 | attackType: AttackType; 7 | name: string; 8 | } 9 | declare class AttackStyle extends NamespacedObject { 10 | stats: StatObject; 11 | experienceGain: { 12 | skill: AnySkill; 13 | ratio: number; 14 | }[]; 15 | attackType: AttackType; 16 | get name(): string; 17 | get toolTipContent(): string; 18 | get buttonID(): string; 19 | _name: string; 20 | constructor(namespace: DataNamespace, data: AttackStyleData, game: Game); 21 | } 22 | -------------------------------------------------------------------------------- /src/gameTypes/localizationGeneration.d.ts: -------------------------------------------------------------------------------- 1 | declare const missingLangStrings: Record; 2 | declare let englishLangJson: LanguageData; 3 | declare function addMissingLangString(identifier: string, langString: string): void; 4 | declare function getMissingLanguageStrings(): Promise; 5 | declare function formatStringForCSV(text: string): string; 6 | declare function buildCSVFile(headers: string[], rows: string[][]): string; 7 | declare function convertMissingStringsToCSV(): Promise; 8 | declare function addMissingLoreStrings(): void; 9 | declare function addMissingModifierStrings(): void; 10 | declare function addMissingStringsFromDataPackage(dataPackage: GameDataPackage): void; 11 | -------------------------------------------------------------------------------- /src/gameTypes/damageSplash.d.ts: -------------------------------------------------------------------------------- 1 | declare class SplashManager { 2 | container: HTMLElement; 3 | queue: DamageSplash[]; 4 | splashDelay: number; 5 | maxSplashes: number; 6 | constructor(container: HTMLElement); 7 | add(splash: DamageSplash): void; 8 | render(): void; 9 | renderSplash(splash: DamageSplash): void; 10 | static splashClasses: Record; 11 | } 12 | declare type DamageSplash = { 13 | /** Controls the colour of the splash */ 14 | source: SplashType; 15 | /** Amount to display */ 16 | amount: number; 17 | /** Optionally display instead of amount */ 18 | text?: string; 19 | xOffset: number; 20 | }; 21 | declare type SplashType = DOTType | 'Attack' | 'Crit' | 'Heal' | 'SummonAttack'; 22 | -------------------------------------------------------------------------------- /src/gameTypes/mastery2.d.ts: -------------------------------------------------------------------------------- 1 | interface OldMasteryData { 2 | pool: number; 3 | xp: number[]; 4 | } 5 | declare type OldMastery = NumberDictionary; 6 | /** Sorts the recipe array in ascending order of category, and then level requirement */ 7 | declare function sortRecipesByCategoryAndLevel(recipes: RecipeType[], categories: CategoryType[]): RecipeType[]; 11 | declare abstract class MasteryAction extends RealmedObject { 12 | abstract readonly name: string; 13 | abstract readonly media: string; 14 | } 15 | declare class DummyMasteryAction extends MasteryAction { 16 | get name(): string; 17 | get media(): string; 18 | constructor(namespace: DataNamespace, id: string, game: Game); 19 | } 20 | -------------------------------------------------------------------------------- /src/gameTypes/account.d.ts: -------------------------------------------------------------------------------- 1 | declare const gameVersion = "v1.3.1"; 2 | declare const previousGameVersion = "v1.3"; 3 | declare const characterSelectAnnouncementVersion = 4; 4 | /** Locks/Unlocks Base Game skills based on full version entitlement */ 5 | declare const setupSkillLock: (game: Game) => void; 6 | /** Callback function for the "Change Character Name" button in the account menu */ 7 | declare function showUsernameChange(): void; 8 | /** Callback function for changing the character name */ 9 | declare function changeName(): void; 10 | /** Callback function for the "Delete Character" button on the Settings page */ 11 | declare function accountDeletion(confirmation?: boolean): void; 12 | /** Notifies the player if the game has updated, if they last loaded the game on an older version */ 13 | declare function gameUpdate(): void; 14 | -------------------------------------------------------------------------------- /src/gameTypes/itemSynergies.d.ts: -------------------------------------------------------------------------------- 1 | declare type SynergyGroup = 'ThrowingWeapon' | 'Melee2HWeapon'; 2 | interface ItemSynergyData { 3 | itemIDs: (string | SynergyGroup)[]; 4 | playerModifiers?: ModifierValuesRecordData; 5 | enemyModifiers?: ModifierValuesRecordData; 6 | conditionalModifiers?: ConditionalModifierData[]; 7 | equipmentStats?: AnyEquipStatData[]; 8 | combatEffects?: TriggeredCombatEffectApplicatorData[]; 9 | } 10 | declare class ItemSynergy implements SoftDataDependant { 11 | items: (EquipmentItem | SynergyGroup)[]; 12 | playerModifiers?: ModifierValue[]; 13 | enemyModifiers?: ModifierValue[]; 14 | conditionalModifiers?: ConditionalModifier[]; 15 | equipmentStats?: AnyEquipStat[]; 16 | combatEffects?: CombatEffectApplicator[]; 17 | get name(): string; 18 | constructor(data: ItemSynergyData, game: Game); 19 | registerSoftDependencies(data: ItemSynergyData, game: Game): void; 20 | } 21 | -------------------------------------------------------------------------------- /src/gameTypes/assets.d.ts: -------------------------------------------------------------------------------- 1 | declare const assets: Readonly<{ 2 | getURI: (baseURI: string) => string; 3 | replaceLangStringURIs: (langString: string) => string; 4 | setImageSources: () => void; 5 | logNonLocalImages: () => void; 6 | setCSSAssetStyle: () => Promise; 7 | readonly USE_CDN: boolean; 8 | readonly CDNDIR: string; 9 | readonly CDNVersion: string; 10 | readonly CDNEndpoint: string; 11 | readonly CDNDIR_ORIGINAL: string; 12 | }>; 13 | /** @deprecated Use assets.getURI instead */ 14 | declare const cdnMedia: (baseURI: string) => string; 15 | /** @deprecated Use assets.getURI instead */ 16 | declare const useCDN: boolean; 17 | /** @deprecated Use assets.getURI instead */ 18 | declare const CDNDIR: () => string; 19 | /** @deprecated Use assets.CDNVersion instead */ 20 | declare const CDNVersion: string; 21 | /** @deprecated Use assets.CDNEndpoint instead */ 22 | declare const CDNEndpoint: string; 23 | /** @deprecated Use assets.CDNDIR_ORIGINAL instead */ 24 | declare const CDNDIR_ORIGINAL: string; 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "melvor-typing-project", 3 | "version": "1.13.0", 4 | "description": "Official Type Definitions for Melvor Idle", 5 | "license": "GPL-3.0", 6 | "author": { 7 | "name": "Coolrox95" 8 | }, 9 | "files": [ 10 | "**/src/gameTypes", 11 | "**/src/libraryTypes" 12 | ], 13 | "private": true, 14 | "devDependencies": { 15 | "@types/bootstrap": "^4.5.0", 16 | "@types/ifvisible": "^1.1.0", 17 | "@types/ion-rangeslider": "^2.3.2", 18 | "@types/jquery": "^3.5.6", 19 | "@types/sortablejs": "^1.10.6", 20 | "@types/toastify-js": "^1.9.1", 21 | "dexie": "^3.2.2", 22 | "fflate": "^0.7.3", 23 | "fuse.js": "^3.4.6", 24 | "intl-list-format": "^1.0.3", 25 | "mitt": "^3.0.0", 26 | "petite-vue": "^0.4.1", 27 | "simplebar": "^5.3.6", 28 | "sweetalert2": "^11.4.16", 29 | "tippy.js": "^6.2.6", 30 | "typescript": "^4.7.4", 31 | "pixi.js": "^7.2.4", 32 | "@pixi/basis": "^7.2.4", 33 | "pixi-viewport": "^5.0.1", 34 | "@dagrejs/dagre": "^1.0.4" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/gameTypes/language.d.ts: -------------------------------------------------------------------------------- 1 | declare let setLang: SupportedLanguage; 2 | declare let loadedLangJson: LanguageData; 3 | /** Language specific collator for the currently loaded language. Useful for sorting things alphabetically. */ 4 | declare let langCollator: Intl.Collator; 5 | declare const langVersion = 1656; 6 | declare const LANGS: SupportedLanguage[]; 7 | declare function fetchLanguageJSON(lang: 'catOrder'): Promise; 8 | declare function fetchLanguageJSON(lang: SupportedLanguage): Promise; 9 | declare function setLanguage(lang: SupportedLanguage): Promise; 10 | declare function localiseSwal2(): void; 11 | declare const defaultSwalCustomClass: SweetAlertCustomClass; 12 | declare let SwalLocale: typeof Swal; 13 | /** Creates a custom class object for Swal2 based on the default custom styling */ 14 | declare function createSwalCustomClass(customClass: SweetAlertCustomClass): SweetAlertCustomClass; 15 | declare function updateUIForLanguageChange(): void; 16 | declare function getLangString(identifier: string | number): string; 17 | declare function initializeAltText(): void; 18 | -------------------------------------------------------------------------------- /src/gameTypes/progressbar.d.ts: -------------------------------------------------------------------------------- 1 | declare class ProgressBarElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | outerBar: HTMLDivElement; 4 | innerBar: HTMLDivElement; 5 | currentStyle: ProgressBarStyle; 6 | isStriped: boolean; 7 | isReversed: boolean; 8 | constructor(); 9 | connectedCallback(): void; 10 | animateProgressFromTimer(timer: Timer): void; 11 | /** Animates the progress bar from start to end over the alloted interval */ 12 | animateProgress(elapsedTime: number, totalTime: number): void; 13 | animateStriped(): void; 14 | stopAnimation(): void; 15 | /** Sets the style class of the progress bar element */ 16 | setStyle(newStyle: ProgressBarStyle): void; 17 | setAnimation(animation: string): void; 18 | /** Sets the progress bar to a fixed position. Will stop existing progress animations. */ 19 | setFixedPosition(percent: number): void; 20 | static stripeClasses: string[]; 21 | } 22 | declare type ProgressBarStyle = 'bg-danger' | 'bg-info' | 'bg-warning' | 'bg-slowed' | 'bg-success' | 'bg-primary' | 'bg-woodcutting' | 'bg-secondary' | 'bg-mining' | 'bg-archaeology' | 'bg-harvesting'; 23 | -------------------------------------------------------------------------------- /src/gameTypes/eventManager.d.ts: -------------------------------------------------------------------------------- 1 | declare class EventManager { 2 | activeEvents: EventsData[]; 3 | getEventData(id: Events): EventsData | undefined; 4 | isEventActive(event: EventsData): boolean; 5 | getActiveEvents(): EventsData[]; 6 | createEventContainerElement(event: EventsData): HTMLElement; 7 | loadEventSidebarElements(event: EventsData): void; 8 | loadEventContainerElements(event: EventsData): void; 9 | populateEventContainerElement(event: EventsData): void; 10 | loadSavedEventData(event: EventsData): void; 11 | loadEvents(): void; 12 | updateGameLogo(event: EventsData): void; 13 | rollForEventRewards(actionInterval: number, skill: AnySkill, rewards: Rewards): void; 14 | rollForEventRewardsOffline(actionInterval: number, skill: AnySkill): number; 15 | updateEventUI(id: number): void; 16 | } 17 | declare const EVENTS: EventsData[]; 18 | interface EventsData { 19 | id: number; 20 | name: string; 21 | media: string; 22 | startDate: number; 23 | endDate: number; 24 | pageId: number; 25 | sidebarColour: string; 26 | borderClass: string; 27 | bgClass: string; 28 | containerId: string; 29 | logo: string; 30 | } 31 | -------------------------------------------------------------------------------- /src/libraryTypes/listFormat.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace Intl { 2 | function getCanonicalLocales(locales: string | string[] | undefined): string[]; 3 | 4 | type Locale = string; 5 | type Locales = Locale[]; 6 | type Type = "conjunction" | "disjunction" | "unit"; 7 | type Style = "long" | "short" | "narrow"; 8 | type LocaleMatcher = "lookup" | "best fit"; 9 | 10 | interface ListFormatOptions { 11 | type: Type; 12 | style: Style; 13 | localeMatcher: LocaleMatcher; 14 | } 15 | 16 | interface ResolvedListFormatOptions { 17 | type: Type; 18 | style: Style; 19 | locale: Locale; 20 | } 21 | 22 | interface ElementPartition { 23 | type: "element"; 24 | value: ListPartition[] | string; 25 | } 26 | 27 | interface ListPartitionBase { 28 | value: string; 29 | } 30 | 31 | interface LiteralPartition extends ListPartitionBase { 32 | type: "literal"; 33 | } 34 | 35 | type ListPartition = ElementPartition | LiteralPartition; 36 | 37 | type ListPartitions = ReadonlyArray; 38 | 39 | class ListFormat { 40 | constructor(locales?: Locale | Locales | undefined, options?: Partial); 41 | 42 | public static supportedLocalesOf(locales: Locale | Locales, options?: Intl.SupportedLocalesOptions | undefined): Locales; 43 | 44 | public format(list?: Iterable): string; 45 | 46 | public formatToParts(list?: Iterable): ListPartitions; 47 | 48 | public resolvedOptions(): ResolvedListFormatOptions; 49 | } 50 | } -------------------------------------------------------------------------------- /src/gameTypes/itemCharges.d.ts: -------------------------------------------------------------------------------- 1 | declare class ItemChargesChangedEvent extends GameEvent { 2 | item: EquipmentItem; 3 | oldCharges: number; 4 | newCharges: number; 5 | constructor(item: EquipmentItem, oldCharges: number, newCharges: number); 6 | } 7 | declare type ItemChargesEvents = { 8 | chargesChanged: ItemChargesChangedEvent; 9 | }; 10 | declare class ItemCharges extends GameEventEmitter implements EncodableObject { 11 | game: Game; 12 | charges: Map; 13 | renderQueue: ItemChargeRenderQueue; 14 | constructor(game: Game); 15 | render(): void; 16 | getSnapShot(): Map; 17 | /** Returns true if the item has any charges */ 18 | itemHasCharge(item: EquipmentItem): boolean; 19 | /** Returns the number of charges an item has */ 20 | getCharges(item: EquipmentItem): number; 21 | /** Adds the amount of charges to the item */ 22 | addCharges(item: EquipmentItem, amount: number): void; 23 | /** Removes the amount of charges from the item */ 24 | removeCharges(item: EquipmentItem, amount: number): void; 25 | /** Removes all charges from an item */ 26 | removeAllCharges(item: EquipmentItem): void; 27 | encode(writer: SaveWriter): SaveWriter; 28 | decode(reader: SaveWriter, version: number): void; 29 | convertFromOldFormat(oldGloveData: OldGloveChargeTracker[], idMap: NumericIDMap): void; 30 | } 31 | interface ItemChargeRenderQueue { 32 | items: Set; 33 | } 34 | -------------------------------------------------------------------------------- /src/gameTypes/statsTable.d.ts: -------------------------------------------------------------------------------- 1 | declare type StatsTableRow = { 2 | readonly name: HTMLTableCellElement; 3 | readonly value: HTMLTableCellElement; 4 | }; 5 | declare type StatsRowData = { 6 | /** Value of the rows name. Should be a getter with translation. */ 7 | readonly name: string; 8 | /** Value of the table row. Should be a getter. */ 9 | readonly value: number; 10 | readonly isTime?: boolean; 11 | /** Optional. If present, this row only shows if the given namespace is registered */ 12 | readonly namespace?: Namespaces; 13 | }; 14 | declare type StatsTableData = { 15 | /** Element ID of the table */ 16 | readonly tableID: string; 17 | /** Value of the tables title. Should be a getter with translation. */ 18 | readonly title: string; 19 | /** Border class of table */ 20 | readonly borderClass: string; 21 | readonly rows: StatsRowData[]; 22 | readonly trackerKey: KeysMatching; 23 | }; 24 | /** Tables for displaying statistics. Must be initialized with setData method. */ 25 | declare class StatTableElement extends HTMLElement implements CustomElement { 26 | _content: DocumentFragment; 27 | _title: HTMLHeadingElement; 28 | _body: HTMLTableSectionElement; 29 | _rows: StatsTableRow[]; 30 | _data: StatsTableData; 31 | _border: HTMLDivElement; 32 | constructor(); 33 | connectedCallback(): void; 34 | removeRows(): void; 35 | setData(data: StatsTableData): void; 36 | addRow(rowData: StatsRowData): void; 37 | updateRowValues(): void; 38 | formatRowData(rowData: StatsRowData): string; 39 | localize(): void; 40 | } 41 | -------------------------------------------------------------------------------- /src/gameTypes/lore.d.ts: -------------------------------------------------------------------------------- 1 | interface LoreText { 2 | title: string; 3 | paragraphs: string; 4 | } 5 | interface LoreBookData extends IDData { 6 | title: string; 7 | media: string; 8 | unlockRequirements: AnyRequirementData[]; 9 | } 10 | declare class LoreBook extends NamespacedObject { 11 | get title(): string; 12 | get media(): string; 13 | unlockRequirements: AnyRequirement[]; 14 | _title: string; 15 | _media: string; 16 | constructor(namespace: DataNamespace, data: LoreBookData, game: Game); 17 | } 18 | declare class Lore { 19 | game: Game; 20 | books: NamespaceRegistry; 21 | renderUnlocks: boolean; 22 | bookButtons: Map; 23 | constructor(game: Game); 24 | registerLore(namespace: DataNamespace, loreData: LoreBookData[]): void; 25 | loadLoreButtons(): void; 26 | onLoad(): void; 27 | render(): void; 28 | updateLoreBookUnlocks(): void; 29 | readLore(book: LoreBook): void; 30 | static readonly LORE: LoreText[]; 31 | } 32 | declare class LoreBookButtonElement extends HTMLElement implements CustomElement { 33 | _content: DocumentFragment; 34 | bookImage: HTMLImageElement; 35 | bookTitle: HTMLHeadingElement; 36 | readButton: HTMLButtonElement; 37 | constructor(); 38 | connectedCallback(): void; 39 | setImage(book: LoreBook): void; 40 | updateForUnlock(book: LoreBook, game: Game): void; 41 | createUnlockElement(costNodes: (string | Node)[], met: boolean): HTMLDivElement; 42 | createUnlockElements(book: LoreBook, game: Game): HTMLDivElement[]; 43 | getTextClass(met: boolean): "text-success" | "text-danger"; 44 | } 45 | -------------------------------------------------------------------------------- /src/gameTypes/combatLoot.d.ts: -------------------------------------------------------------------------------- 1 | declare class CombatLoot implements Serializable, EncodableObject { 2 | maxLoot: number; 3 | game: Game; 4 | drops: AnyItemQuantity[]; 5 | renderRequired: boolean; 6 | lostLoot: Map; 7 | constructor(maxLoot: number, game: Game); 8 | initializeMenus(): void; 9 | add(item: AnyItem, quantity: number, stack?: boolean): void; 10 | removeAll(): void; 11 | makeDropRoom(): void; 12 | lootAll(): void; 13 | destroyAllLoot(): void; 14 | actuallyDestroyAllLootNow(): void; 15 | getSnapshot(): Map; 16 | lootItem(id: number): void; 17 | render(): void; 18 | encode(writer: SaveWriter): SaveWriter; 19 | decode(reader: SaveWriter, version: number): void; 20 | deserialize(reader: DataReader, version: number, idMap: NumericIDMap): void; 21 | } 22 | declare type LootElements = { 23 | container: HTMLDivElement; 24 | image: HTMLImageElement; 25 | qty: HTMLDivElement; 26 | tooltip: TippyTooltip; 27 | }; 28 | declare class CombatLootMenuElement extends HTMLElement implements CustomElement { 29 | _content: DocumentFragment; 30 | lootQuantity: HTMLHeadingElement; 31 | lootAllButton: HTMLButtonElement; 32 | lootContainer: HTMLDivElement; 33 | lootingAmuletText: HTMLElement; 34 | dropElements: LootElements[]; 35 | constructor(); 36 | connectedCallback(): void; 37 | /** Set callbacks and translations */ 38 | initialize(loot: CombatLoot): void; 39 | renderDrops(drops: AnyItemQuantity[], maxDrops: number, loot: CombatLoot): void; 40 | createDropElement(): void; 41 | createTooltip(parent: HTMLDivElement): TippyTooltip; 42 | } 43 | -------------------------------------------------------------------------------- /src/gameTypes/golbin.d.ts: -------------------------------------------------------------------------------- 1 | /** Enemy Class for Golbin Raid */ 2 | declare class Golbin extends Enemy { 3 | manager: RaidManager; 4 | get encodeMonster(): boolean; 5 | /** Constructs an enemy for golbin raid */ 6 | constructor(manager: RaidManager, game: Game); 7 | tempNamespace: DataNamespace; 8 | modifyAttackInterval(interval: number): number; 9 | computeMagicMaxHit(): number; 10 | modifyMaxHP(maxHP: number): number; 11 | modifyEvasion(evasion: Evasion): void; 12 | modifyMaxHit(maxHit: number): number; 13 | modifyAccuracy(accuracy: number): number; 14 | getMonster(wave: number, isBoss: boolean, hasExtraPassiveChance: boolean, game: Game): Monster; 15 | static getName(): string; 16 | computeModifiers(): void; 17 | mergeUninheritedEffectApplicators(): void; 18 | static getLevel(wave: number, isBoss: boolean, hitpoints?: boolean): number; 19 | static getAttackType(): AttackType; 20 | static getMedia(isBoss: boolean): string; 21 | static getStats(wave: number, isBoss: boolean): AnyEquipStatData[]; 22 | static getStatValue(wave: number, isBoss: boolean): number; 23 | encode(writer: SaveWriter): SaveWriter; 24 | /** Encodes the current Golbins monster data */ 25 | encodeMonsterData(writer: SaveWriter): void; 26 | decode(reader: SaveWriter, version: number): void; 27 | decodeMonster(reader: SaveWriter, version: number): void; 28 | deserialize(reader: DataReader, version: number, idMap: NumericIDMap): void; 29 | deserializeMonsterData(reader: DataReader, version: number, idMap: NumericIDMap): GolbinMonster; 30 | static readonly names: string[]; 31 | static readonly traits: string[]; 32 | } 33 | -------------------------------------------------------------------------------- /src/gameTypes/typeOverloads.d.ts: -------------------------------------------------------------------------------- 1 | declare type ValFcnForInput = (() => string) & ((value: string) => void); 2 | interface JQueryStatic { 3 | (selector: '#username-set-main'): JQueryInputElement; 4 | (selector: '#username-set'): JQueryInputElement; 5 | (selector: '#searchTextbox'): JQueryInputElement; 6 | (selector: '#dropdown-content-custom-amount'): JQueryInputElement; 7 | (selector: '#dropdown-content-custom-amount-1'): JQueryInputElement; 8 | (selector: '#import-save-character-selection'): JQueryInputElement; 9 | (selector: '#dropdown-content-custom-amount-2'): JQueryInputElement; 10 | (selector: "#searchTextbox-items"): JQueryInputElement; 11 | (selector: "#import-save-link-character-selection"): JQueryInputElement; 12 | } 13 | interface JQueryInputElement extends Omit, 'val'> { 14 | val: ValFcnForInput; 15 | } 16 | interface Document { 17 | getElementById(elementID: 'username-change'): HTMLInputElement; 18 | getElementById(elementID: 'game-broke-error-msg'): HTMLTextAreaElement; 19 | getElementById(elementID: 'exportSaveField'): HTMLTextAreaElement; 20 | getElementById(elementID: 'exportSaveField2'): HTMLTextAreaElement; 21 | getElementById(elementID: 'exportSaveFieldUpdate'): HTMLTextAreaElement; 22 | getElementById(elementID: 'exportSaveFieldUpdate2'): HTMLTextAreaElement; 23 | getElementById(elementID: 'importSaveField'): HTMLTextAreaElement; 24 | } 25 | interface ObjectConstructor { 26 | keys(obj: OldSettingsData): (keyof OldSettingsData)[]; 27 | keys(obj: NewSaveGame): NewSaveKey[]; 28 | entries(obj: NumberDictionary): [string, T][]; 29 | entries(obj: CombatLevels): [CombatLevelKey, number][]; 30 | } 31 | -------------------------------------------------------------------------------- /src/gameTypes/rockMenu.d.ts: -------------------------------------------------------------------------------- 1 | declare class MiningRockElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | statusText: LangStringElement; 4 | nameText: HTMLSpanElement; 5 | typeText: HTMLElement; 6 | xpIcon: XpIconElement; 7 | abyssalXPIcon: AbyssalXpIconElement; 8 | masteryIcon: MasteryXpIconElement; 9 | masteryPoolIcon: MasteryPoolIconElement; 10 | intervalIcon: IntervalIconElement; 11 | rockImage: HTMLImageElement; 12 | hpProgressText: HTMLElement; 13 | hpProgress: ProgressBarElement; 14 | miningProgress: ProgressBarElement; 15 | mastery: MasteryDisplayElement; 16 | requirementText: HTMLDivElement; 17 | gemVeinText: HTMLDivElement; 18 | meteoriteText: HTMLDivElement; 19 | fragmentText: HTMLDivElement; 20 | lockedContainer: HTMLDivElement; 21 | unlockedContainer: HTMLAnchorElement; 22 | nextLevel: HTMLSpanElement; 23 | nextAbyssalLevel: HTMLSpanElement; 24 | requiredPickaxe: HTMLDivElement; 25 | _rock?: MiningRock; 26 | constructor(); 27 | setLockedContainer(rock: MiningRock): void; 28 | setLocked(): void; 29 | setUnlocked(): void; 30 | connectedCallback(): void; 31 | setRock(rock: MiningRock): void; 32 | updateHP(rock: MiningRock): void; 33 | setStatus(statusID: string): void; 34 | setRequirement(reqText: string): void; 35 | hideRequirement(): void; 36 | /** Updates the XP, Mastery XP, Mastery Pool XP and interval icons */ 37 | updateGrants(xp: number, baseXP: number, masteryXP: number, baseMasteryXP: number, masteryPoolXP: number, interval: number, rock: MiningRock): void; 38 | /** Updates the Abyssal XP */ 39 | updateAbyssalGrants(xp: number, baseXP: number): void; 40 | } 41 | -------------------------------------------------------------------------------- /src/gameTypes/tutorialMenus.d.ts: -------------------------------------------------------------------------------- 1 | declare class TutorialStageDisplayElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | header: HTMLDivElement; 4 | stageStatus: HTMLSpanElement; 5 | stageName: HTMLSpanElement; 6 | stageDescription: HTMLSpanElement; 7 | taskCompletion: HTMLHeadingElement; 8 | pageIcon: HTMLImageElement; 9 | pageLink: HTMLAnchorElement; 10 | taskContainer: HTMLDivElement; 11 | claimRewardsButton: HTMLButtonElement; 12 | get displayedStage(): TutorialStage | undefined; 13 | _displayedStage?: TutorialStage; 14 | displayedTasks: { 15 | taskImage: HTMLImageElement; 16 | taskQuantity: HTMLSpanElement; 17 | taskIcon: HTMLElement; 18 | }[]; 19 | rewardSpans: HTMLSpanElement[]; 20 | constructor(); 21 | connectedCallback(): void; 22 | setStage(stage: TutorialStage, tutorial: Tutorial): void; 23 | updateTasks(stage: TutorialStage): void; 24 | getTaskCount(task: TutorialTask): string; 25 | getTaskIconClass(task: TutorialTask): string; 26 | updateTaskCompletion(completedTasks: number, totalTasks: number): void; 27 | updateStageStatus(stage: TutorialStage): void; 28 | setActive(): void; 29 | setCompleted(): void; 30 | setClaimed(): void; 31 | setHeaderClass(className: 'bg-tutorial-claimed' | 'bg-primary'): void; 32 | } 33 | declare class TutorialProgressDisplayElement extends HTMLElement implements CustomElement { 34 | _content: DocumentFragment; 35 | skipButton: HTMLButtonElement; 36 | stagesCompleted: HTMLSpanElement; 37 | totalStages: HTMLSpanElement; 38 | constructor(); 39 | connectedCallback(): void; 40 | init(tutorial: Tutorial): void; 41 | updateProgress(tutorial: Tutorial): void; 42 | } 43 | -------------------------------------------------------------------------------- /src/gameTypes/mod.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Melvor Idle mod support module 3 | * typedefs found in mod.d.ts 4 | */ 5 | declare const mod: { 6 | manager: { 7 | readonly activeProfile: Modding.Profile | null; 8 | hasProfile(id: string): boolean; 9 | currentProfileName(id: string): string | null; 10 | init: () => Promise; 11 | isLoggedIn: () => boolean; 12 | isEnabled: () => boolean; 13 | open: (openToMyMods?: boolean, query?: string) => Promise; 14 | isProcessing(): any; 15 | hasChanges(): boolean; 16 | showPromptForProfileMismatch: (profile: Omit | null) => Promise; 17 | showPromptForProfileButNotLoggedIn: () => Promise; 18 | showPromptForReload: (canDefer?: boolean) => Promise; 19 | showPromptForInProgress: () => Promise; 20 | getLoadedModList(): string[]; 21 | }; 22 | register: (setup: (ctx: Modding.ModContext) => Promise) => Promise; 23 | trigger: { 24 | modsLoaded: () => Promise; 25 | characterSelectionLoaded: () => Promise; 26 | interfaceAvailable: () => Promise; 27 | characterLoaded: () => Promise; 28 | interfaceReady: () => Promise; 29 | creatorToolkitOpen: () => Promise; 30 | }; 31 | api: Modding.ModApi; 32 | getContext: (namespaceOrResource: string | HTMLScriptElement | ImportMeta) => Modding.ModContext; 33 | getDevContext: () => Modding.ModContext; 34 | getModErrorFromError: (error: unknown) => Modding.ModError; 35 | encode: (writer: SaveWriter) => SaveWriter; 36 | decode: (reader: SaveWriter, version: number) => void; 37 | persist: () => Promise | undefined; 38 | }; 39 | -------------------------------------------------------------------------------- /src/gameTypes/passives.d.ts: -------------------------------------------------------------------------------- 1 | interface CombatPassiveData extends IDData { 2 | /** Display name of the passive */ 3 | name: string; 4 | /** Modifiers provided to Enemy by the passive */ 5 | modifiers?: ModifierValuesRecordData; 6 | /** CombatEffects merged with the enemy by the Passive */ 7 | combatEffects?: TriggeredCombatEffectApplicatorData[]; 8 | /** Modifiers provided to the player by the Passive */ 9 | playerModifiers?: ModifierValuesRecordData; 10 | /** CombatEffects merged with the player by the Passive */ 11 | playerCombatEffects?: TriggeredCombatEffectApplicatorData[]; 12 | /** Conditional Modifiers provided by the Passive */ 13 | conditionalModifiers?: ConditionalModifierData[]; 14 | /** Optional. Specifies a custom description which overrides the modifier generated one. */ 15 | customDescription?: string; 16 | } 17 | declare class CombatPassive extends NamespacedObject implements SoftDataDependant { 18 | modifiers?: ModifierValue[]; 19 | combatEffects?: CombatEffectApplicator[]; 20 | enemyModifiers?: ModifierValue[]; 21 | enemyCombatEffects?: CombatEffectApplicator[]; 22 | conditionalModifiers?: ConditionalModifier[]; 23 | get name(): string; 24 | get englishName(): string; 25 | get description(): string; 26 | _modifiedDescription: string | undefined; 27 | get modifiedDescription(): string; 28 | _name: string; 29 | _customDescription?: string; 30 | constructor(namespace: DataNamespace, data: CombatPassiveData, game: Game); 31 | registerSoftDependencies(data: CombatPassiveData, game: Game): void; 32 | } 33 | declare class ControlledAffliction extends CombatPassive { 34 | constructor(namespace: DataNamespace, game: Game); 35 | registerSoftDependencies(data: CombatPassiveData, game: Game): void; 36 | } 37 | -------------------------------------------------------------------------------- /src/gameTypes/pages.d.ts: -------------------------------------------------------------------------------- 1 | declare type NoElementConfig = { 2 | [Property in keyof Type]: Exclude; 3 | }; 4 | declare type PageSideBarItemOptions = Omit, 'name' | 'link' | 'onClick' | 'onRender'> & { 5 | categoryID: string; 6 | }; 7 | declare type PageSideBarSubItemOptions = Omit, 'link' | 'onClick' | 'onRender'> & { 8 | categoryID: string; 9 | itemID: string; 10 | }; 11 | interface PageData extends IDData { 12 | customName?: string; 13 | media: string; 14 | containerID: string; 15 | headerBgClass: string; 16 | hasGameGuide: boolean; 17 | canBeDefault: boolean; 18 | action?: string; 19 | skills?: string[]; 20 | sidebarItem?: PageSideBarItemOptions; 21 | sidebarSubItems?: PageSideBarSubItemOptions[]; 22 | skillSidebarCategoryID?: string; 23 | displayClass?: string; 24 | } 25 | interface PageModificationData extends IDData { 26 | skills?: { 27 | add?: { 28 | skillID: string; 29 | insertAt?: number; 30 | }[]; 31 | remove?: string[]; 32 | }; 33 | } 34 | declare class Page extends NamespacedObject { 35 | get name(): string; 36 | get media(): string; 37 | containerID: string; 38 | headerBgClass: string; 39 | hasGameGuide: boolean; 40 | canBeDefault: boolean; 41 | action?: Action; 42 | skills?: AnySkill[]; 43 | skillSidebarCategoryID?: string; 44 | sidebarItem?: PageSideBarItemOptions; 45 | sidebarSubItems?: PageSideBarSubItemOptions[]; 46 | displayClass?: string; 47 | _media: string; 48 | _customName?: string; 49 | constructor(namespace: DataNamespace, data: PageData, game: Game); 50 | applyDataModification(modData: PageModificationData, game: Game): void; 51 | /** Generates sidebar elements for the page, with the exception of skills */ 52 | generateSideBar(): void; 53 | } 54 | -------------------------------------------------------------------------------- /src/gameTypes/equippedFood.d.ts: -------------------------------------------------------------------------------- 1 | declare class EquippedFood implements EncodableObject, Serializable { 2 | maxSlots: number; 3 | game: Game; 4 | slots: FoodData[]; 5 | selectedSlot: number; 6 | get currentSlot(): FoodData; 7 | constructor(maxSlots: number, game: Game); 8 | addSlot(): void; 9 | equip(item: FoodItem, quantity: number): boolean; 10 | unequipSelected(): void; 11 | consume(quantity?: number): void; 12 | setSlot(slotID: number): void; 13 | checkSlotid(slotID: number): void; 14 | encode(writer: SaveWriter): SaveWriter; 15 | decode(reader: SaveWriter, version: number, addOnFail?: boolean): void; 16 | deserialize(reader: DataReader, version: number, idMap: NumericIDMap, addOnFail?: boolean): void; 17 | convertFromOldSaveFormat(oldData: OldItemQuantity2[], idMap: NumericIDMap): void; 18 | } 19 | declare type FoodData = { 20 | item: FoodItem; 21 | quantity: number; 22 | }; 23 | declare class FoodSelectOptionElement extends HTMLElement implements CustomElement { 24 | _content: DocumentFragment; 25 | quantity: HTMLSpanElement; 26 | image: HTMLImageElement; 27 | hitpoints: HTMLSpanElement; 28 | modifiers: HTMLDivElement; 29 | constructor(); 30 | connectedCallback(): void; 31 | setFood(food: FoodData, player: Player): void; 32 | } 33 | declare class FoodSelectMenuElement extends HTMLElement implements CustomElement { 34 | _content: DocumentFragment; 35 | eatButton: HTMLButtonElement; 36 | selected: FoodSelectOptionElement; 37 | optionsContainer: HTMLDivElement; 38 | dropDivider: HTMLDivElement; 39 | unequipButton: HTMLAnchorElement; 40 | dropOptions: FoodSelectOptionElement[]; 41 | constructor(); 42 | connectedCallback(): void; 43 | addDropdownOption(): void; 44 | removeDropOption(): void; 45 | showHoldToEat(): void; 46 | hideHoldToEat(): void; 47 | renderSelection(foods: FoodData[], player: Player): void; 48 | render(player: Player): void; 49 | setCallbacks(player: Player): void; 50 | } 51 | -------------------------------------------------------------------------------- /src/gameTypes/statTracker.d.ts: -------------------------------------------------------------------------------- 1 | /** Generic class for tracking statistics */ 2 | declare class StatTracker implements Serializable, EncodableObject { 3 | stats: Map; 4 | wasMutated: boolean; 5 | add(stat: number, qty: number): void; 6 | set(stat: number, value: number): void; 7 | /** Increments a stat by 1 */ 8 | inc(stat: number): void; 9 | get(stat: number): number; 10 | /** Gets the sum of a number of stats */ 11 | getSum(stats: number[]): number; 12 | remove(stat: number): void; 13 | /** Gets a stat and then removes it */ 14 | convert(stat: number): number; 15 | encode(writer: SaveWriter): SaveWriter; 16 | decode(reader: SaveWriter, version: number): void; 17 | deserialize(reader: DataReader, version: number): void; 18 | convertFromOldStatArray(oldStats: OldGameStat[]): void; 19 | static dumpData(reader: SaveWriter, version: number): void; 20 | } 21 | /** Generic class for tracking stats for registries */ 22 | declare class MappedStatTracker implements EncodableObject { 23 | registry: NamespaceRegistry; 24 | game: Game; 25 | dummyConstructor?: (new (namespace: DataNamespace, localID: string, game: Game) => KeyType) | undefined; 26 | statsMap: Map; 27 | constructor(registry: NamespaceRegistry, game: Game, dummyConstructor?: (new (namespace: DataNamespace, localID: string, game: Game) => KeyType) | undefined); 28 | add(key: KeyType, statID: number, qty: number): void; 29 | get(key: KeyType, statID: number): number; 30 | getTracker(key: KeyType): StatTracker; 31 | encode(writer: SaveWriter): SaveWriter; 32 | decode(reader: SaveWriter, version: number): void; 33 | deserialize(reader: DataReader, version: number, idMap: NumberDictionary): void; 34 | static dumpData(reader: SaveWriter, version: number): void; 35 | } 36 | declare class CurrencyStatTracker extends StatTracker { 37 | skill: MappedStatTracker; 38 | constructor(game: Game); 39 | encode(writer: SaveWriter): SaveWriter; 40 | decode(reader: SaveWriter, version: number): void; 41 | static dumpData(reader: SaveWriter, version: number): void; 42 | } 43 | -------------------------------------------------------------------------------- /src/gameTypes/altMagicMenu.d.ts: -------------------------------------------------------------------------------- 1 | declare class AltMagicMenuElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | spellImage: HTMLImageElement; 4 | clickImageInfo: HTMLDivElement; 5 | spellName: HTMLSpanElement; 6 | spellDescription: HTMLElement; 7 | runeRequirements: RequiresBoxElement; 8 | itemRequirementsContainer: HTMLDivElement; 9 | itemRequirements: QuantityIconsElement; 10 | runeHaves: HavesBoxElement; 11 | itemHavesContainer: HTMLDivElement; 12 | itemHaves: CurrentQuantityIconsElement; 13 | producesSingle: ProducesBoxElement; 14 | producesCurrent: HavesBoxElement; 15 | grants: GrantsBoxElement; 16 | interval: IntervalIconElement; 17 | progressBar: ProgressBarElement; 18 | castButton: HTMLButtonElement; 19 | doublingIcon: DoublingIconElement; 20 | doublingCont: HTMLDivElement; 21 | constructor(); 22 | connectedCallback(): void; 23 | setCastCallback(altMagic: AltMagic): void; 24 | setSpell(altMagic: AltMagic, spell: AltMagicSpell): void; 25 | setSpellImage(altMagic: AltMagic): void; 26 | setSpellQuantities(altMagic: AltMagic, game: Game): void; 27 | resetSpellQuantities(): void; 28 | updateQuantities(game: Game): void; 29 | updateRates(altMagic: AltMagic): void; 30 | unsetSpell(): void; 31 | renderProgress(altMagic: AltMagic, timer: Timer): void; 32 | } 33 | declare class AltMagicItemMenuElement extends HTMLElement implements CustomElement { 34 | _content: DocumentFragment; 35 | buttonContainer: HTMLDivElement; 36 | selectItemFragment: DocumentFragment; 37 | selectBarFragment: DocumentFragment; 38 | lockedBarFragment: DocumentFragment; 39 | constructor(); 40 | connectedCallback(): void; 41 | createItemButton(item: AnyItem, callback: VoidFunction): DocumentFragment; 42 | createBarButton(item: AnyItem, callback: VoidFunction): DocumentFragment; 43 | createLockedBarButton(unlockLevel: number): DocumentFragment; 44 | /** Sets the available item selection for the given spell */ 45 | setItemSelection(altMagic: AltMagic, spell: AltMagicSpell): void; 46 | /** Sets the available bar selection */ 47 | setBarSelection(altMagic: AltMagic): void; 48 | } 49 | -------------------------------------------------------------------------------- /src/gameTypes/expressionAST.d.ts: -------------------------------------------------------------------------------- 1 | declare abstract class Expr { 2 | abstract accept(visitor: ExprVisitor): T; 3 | } 4 | interface ExprVisitor { 5 | visitTernaryExpr(expr: TernaryExpr): T; 6 | visitLogicalExpr(expr: LogicalExpr): T; 7 | visitBinaryExpr(expr: BinaryExpr): T; 8 | visitUnaryExpr(expr: UnaryExpr): T; 9 | visitLiteralExpr(expr: LiteralExpr): T; 10 | visitBuiltInExpr(expr: BuiltInExpr): T; 11 | visitReferenceExpr(expr: ReferenceExpr): T; 12 | visitGroupingExpr(expr: GroupingExpr): T; 13 | } 14 | declare class TernaryExpr extends Expr { 15 | readonly condition: Expr; 16 | readonly operator: ExprToken; 17 | readonly left: Expr; 18 | readonly right: Expr; 19 | constructor(condition: Expr, operator: ExprToken, left: Expr, right: Expr); 20 | accept(visitor: ExprVisitor): T; 21 | } 22 | declare class LogicalExpr extends Expr { 23 | readonly left: Expr; 24 | readonly operator: ExprToken; 25 | readonly right: Expr; 26 | constructor(left: Expr, operator: ExprToken, right: Expr); 27 | accept(visitor: ExprVisitor): T; 28 | } 29 | declare class BinaryExpr extends Expr { 30 | readonly left: Expr; 31 | readonly operator: ExprToken; 32 | readonly right: Expr; 33 | constructor(left: Expr, operator: ExprToken, right: Expr); 34 | accept(visitor: ExprVisitor): T; 35 | } 36 | declare class UnaryExpr extends Expr { 37 | readonly operator: ExprToken; 38 | readonly right: Expr; 39 | constructor(operator: ExprToken, right: Expr); 40 | accept(visitor: ExprVisitor): T; 41 | } 42 | declare class LiteralExpr extends Expr { 43 | readonly value: number | boolean; 44 | constructor(value: number | boolean); 45 | accept(visitor: ExprVisitor): T; 46 | } 47 | declare class BuiltInExpr extends Expr { 48 | readonly name: ExprToken; 49 | readonly paren: ExprToken; 50 | readonly callArgs: Expr[]; 51 | constructor(name: ExprToken, paren: ExprToken, callArgs: Expr[]); 52 | accept(visitor: ExprVisitor): T; 53 | } 54 | declare class ReferenceExpr extends Expr { 55 | readonly names: ExprToken[]; 56 | constructor(names: ExprToken[]); 57 | accept(visitor: ExprVisitor): T; 58 | } 59 | declare class GroupingExpr extends Expr { 60 | readonly expression: Expr; 61 | constructor(expression: Expr); 62 | accept(visitor: ExprVisitor): T; 63 | } 64 | -------------------------------------------------------------------------------- /src/gameTypes/harvestingMenu.d.ts: -------------------------------------------------------------------------------- 1 | declare class HarvestingVeinProductElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | productImage: HTMLImageElement; 4 | productName: HTMLDivElement; 5 | requiredIntensity: HTMLDivElement; 6 | constructor(); 7 | connectedCallback(): void; 8 | setProduct(product: HarvestingProduct): void; 9 | updateProduct(vein: HarvestingVein, product: HarvestingProduct): void; 10 | } 11 | declare class HarvestingVeinElement extends HTMLElement implements CustomElement { 12 | _content: DocumentFragment; 13 | statusText: LangStringElement; 14 | button: HTMLAnchorElement; 15 | nameText: HTMLSpanElement; 16 | abyssalXPIcon: AbyssalXpIconElement; 17 | masteryIcon: MasteryXpIconElement; 18 | masteryPoolIcon: MasteryPoolIconElement; 19 | intervalIcon: IntervalIconElement; 20 | veinImage: HTMLImageElement; 21 | hpProgressText: HTMLElement; 22 | baseQuantityText: HTMLElement; 23 | chanceText: HTMLElement; 24 | hpProgress: ProgressBarElement; 25 | harvestingProgress: ProgressBarElement; 26 | veinProductsList: HTMLUListElement; 27 | veinProducts: Map; 28 | mastery: MasteryDisplayElement; 29 | requirementText: HTMLDivElement; 30 | lockedContainer: HTMLDivElement; 31 | unlockedContainer: HTMLDivElement; 32 | nextLevel: HTMLSpanElement; 33 | nextAbyssalLevel: HTMLSpanElement; 34 | constructor(); 35 | setLockedContainer(vein: HarvestingVein): void; 36 | setLocked(): void; 37 | setUnlocked(): void; 38 | connectedCallback(): void; 39 | setVein(vein: HarvestingVein): void; 40 | setProducts(vein: HarvestingVein): void; 41 | updateProducts(vein: HarvestingVein): void; 42 | updateIntensity(vein: HarvestingVein): void; 43 | updateQuantity(vein: HarvestingVein, harvesting: Harvesting): void; 44 | updateChanceForItem(vein: HarvestingVein): void; 45 | setStatus(statusID: string): void; 46 | setRequirement(reqText: string): void; 47 | hideRequirement(): void; 48 | /** Updates the XP, Mastery XP, Mastery Pool XP and interval icons */ 49 | updateGrants(masteryXP: number, baseMasteryXP: number, masteryPoolXP: number, interval: number, vein: HarvestingVein): void; 50 | /** Updates the Abyssal XP */ 51 | updateAbyssalGrants(xp: number, baseXP: number): void; 52 | } 53 | -------------------------------------------------------------------------------- /src/gameTypes/milestones.d.ts: -------------------------------------------------------------------------------- 1 | interface MilestoneLike { 2 | level: number; 3 | name: string; 4 | media: string; 5 | } 6 | interface AbyssalMilestoneLike { 7 | abyssalLevel: number; 8 | name: string; 9 | media: string; 10 | } 11 | declare type MilestoneData = CustomSkillMilestoneData | EquipItemMilestoneData; 12 | interface CustomSkillMilestoneData extends MilestoneLike { 13 | type: 'Custom'; 14 | abyssalLevel?: number; 15 | milestoneID?: string; 16 | } 17 | declare class CustomSkillMilestone { 18 | level: number; 19 | abyssalLevel: number; 20 | get name(): string; 21 | get media(): string; 22 | _name: string; 23 | _milestoneID?: string; 24 | _media: string; 25 | constructor(data: CustomSkillMilestoneData); 26 | } 27 | interface EquipItemMilestoneData { 28 | type: 'EquipItem'; 29 | itemID: string; 30 | } 31 | declare class EquipItemMilestone { 32 | level: number; 33 | abyssalLevel: number; 34 | get name(): string; 35 | get media(): string; 36 | item: EquipmentItem; 37 | constructor(data: EquipItemMilestoneData, game: Game, skill: AnySkill); 38 | setLevel(skill: AnySkill): void; 39 | } 40 | declare class SkillMasteryMilestone implements MilestoneLike { 41 | skill: AnySkill; 42 | get level(): number; 43 | get media(): string; 44 | get name(): string; 45 | constructor(skill: AnySkill); 46 | } 47 | declare class AgilityObstacleMilestone implements MilestoneLike, AbyssalMilestoneLike { 48 | tier: number; 49 | course: AgilityCourse; 50 | get media(): string; 51 | get name(): string; 52 | get level(): number; 53 | get abyssalLevel(): number; 54 | constructor(tier: number, course: AgilityCourse); 55 | } 56 | declare class AgilityPillarMilestone implements MilestoneLike, AbyssalMilestoneLike { 57 | agility: Agility; 58 | tier: number; 59 | course: AgilityCourse; 60 | get level(): number; 61 | get abyssalLevel(): number; 62 | get media(): string; 63 | get name(): string; 64 | constructor(agility: Agility, tier: number, course: AgilityCourse); 65 | } 66 | declare class SlayerAreaMilestone implements MilestoneLike, AbyssalMilestoneLike { 67 | area: SlayerArea; 68 | level: number; 69 | abyssalLevel: number; 70 | get name(): string; 71 | get media(): string; 72 | constructor(area: SlayerArea, level: number, abyssalLevel?: number); 73 | } 74 | -------------------------------------------------------------------------------- /src/gameTypes/woodcuttingMenu.d.ts: -------------------------------------------------------------------------------- 1 | declare class WoodcuttingTreeElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | button: HTMLAnchorElement; 4 | treeName: HTMLSpanElement; 5 | xpText: HTMLSpanElement; 6 | intervalText: HTMLSpanElement; 7 | treeImage: HTMLImageElement; 8 | progressBar: HTMLDivElement; 9 | requirements: HTMLDivElement; 10 | requirementElements: HTMLElement[]; 11 | levelRequired: HTMLSpanElement; 12 | abyssalLevelRequired: HTMLDivElement; 13 | mastery: MasteryDisplayElement; 14 | lockedContainer: HTMLDivElement; 15 | constructor(); 16 | connectedCallback(): void; 17 | updateTreeVisibility(tree: WoodcuttingTree, woodcutting: Woodcutting): void; 18 | setMastery(woodcutting: Woodcutting, tree: WoodcuttingTree): void; 19 | setTree(tree: WoodcuttingTree, woodcutting: Woodcutting): void; 20 | setTreeUnlocked(): void; 21 | setTreeLocked(tree: WoodcuttingTree, game: Game): void; 22 | updateLockedRequirements(tree: WoodcuttingTree, game: Game): void; 23 | updateRates(tree: WoodcuttingTree, woodcutting: Woodcutting): void; 24 | setActive(): void; 25 | setInactive(): void; 26 | } 27 | /** Class to manage the woodcutting page's menu */ 28 | declare class WoodcuttingMenu { 29 | woodcutting: Woodcutting; 30 | treeMenus: Map; 31 | progressBar: ProgressBarElement; 32 | infoMessage: HTMLHeadingElement; 33 | grantsContainer: HTMLDivElement; 34 | treeContainer: HTMLDivElement; 35 | treeGrants: TreeGrantElements[]; 36 | lowerGrants: HTMLDivElement; 37 | xpIcon: XpIconElement; 38 | abyssalXPIcon: AbyssalXpIconElement; 39 | poolXPIcon: MasteryPoolIconElement; 40 | intervalIcon: IntervalIconElement; 41 | selectedTrees: Set; 42 | constructor(woodcutting: Woodcutting); 43 | createTreeMenus(game: Game): void; 44 | updateTreeRates(woodcutting: Woodcutting): void; 45 | updateTreeUnlocks(game: Game): void; 46 | setTrees(trees: Set): void; 47 | destroyTreeGrants(treeGrant: TreeGrantElements): void; 48 | /** Updates the currently selected tree icons */ 49 | updateSelectedTrees(): void; 50 | } 51 | interface TreeGrantElements { 52 | itemIcon: ItemQuantityIconElement; 53 | masteryXPIcon: MasteryXpIconElement; 54 | container: HTMLDivElement; 55 | } 56 | -------------------------------------------------------------------------------- /src/gameTypes/combatTriangle.d.ts: -------------------------------------------------------------------------------- 1 | declare type CombatTriangleType = 'Standard' | 'Hardcore' | 'InvertedHardcore'; 2 | interface BaseCombatTriangleData extends IDData { 3 | name: string; 4 | media: string; 5 | } 6 | declare type CombatTriangle = { 7 | damageModifier: AttackTypeObject>; 8 | reductionModifier: AttackTypeObject>; 9 | }; 10 | declare type AttackTypeObject = { 11 | melee: T; 12 | ranged: T; 13 | magic: T; 14 | }; 15 | declare type CombatTriangleSetData = BaseCombatTriangleData & Record; 16 | declare class CombatTriangleSet extends NamespacedObject implements Record { 17 | get name(): string; 18 | get media(): string; 19 | _name: string; 20 | _media: string; 21 | Standard: CombatTriangle; 22 | Hardcore: CombatTriangle; 23 | InvertedHardcore: CombatTriangle; 24 | constructor(namespace: DataNamespace, data: CombatTriangleSetData); 25 | /** Data used to construct the Normal triangle set */ 26 | static normalSetData: CombatTriangleSetData; 27 | } 28 | declare class CombatTriangleSetTableElement extends HTMLElement implements CustomElement { 29 | _content: DocumentFragment; 30 | tableBody: HTMLTableSectionElement; 31 | name: HTMLSpanElement; 32 | img: HTMLImageElement; 33 | gamemodeName: HTMLSpanElement; 34 | gamemodeImg: HTMLImageElement; 35 | areaName: HTMLSpanElement; 36 | areaImg: HTMLImageElement; 37 | constructor(); 38 | connectedCallback(): void; 39 | setCombatTriangle(area: AnyCombatArea): void; 40 | createRows(combatTriangle: CombatTriangle): void; 41 | attackTypeMedia: { 42 | melee: string; 43 | ranged: Assets; 44 | magic: Assets; 45 | random: Assets; 46 | }; 47 | } 48 | declare class CombaTriangleSetTableRowElement extends HTMLElement implements CustomElement { 49 | _content: DocumentFragment; 50 | playerAttackType: HTMLSpanElement; 51 | vsMeleeDmg: HTMLSpanElement; 52 | vsMeleeDR: HTMLSpanElement; 53 | vsRangedDmg: HTMLSpanElement; 54 | vsRangedDR: HTMLSpanElement; 55 | vsMagicDmg: HTMLSpanElement; 56 | vsMagicDR: HTMLSpanElement; 57 | constructor(); 58 | connectedCallback(): void; 59 | setRow(combatTriangle: CombatTriangle, attackType: AttackType, attackTypeMedia: string): void; 60 | setSpan(el: HTMLSpanElement, value: number): void; 61 | getSpanClass(value: number): string; 62 | } 63 | -------------------------------------------------------------------------------- /src/gameTypes/raidPlayer.d.ts: -------------------------------------------------------------------------------- 1 | /** Player Class for Golbin Raid */ 2 | declare class RaidPlayer extends Player { 3 | manager: RaidManager; 4 | food: EquippedFood; 5 | altAttacks: Map; 6 | get isPrayerUnlocked(): boolean; 7 | get prayerPointsOnWaveCompletion(): number; 8 | get allowRegen(): boolean; 9 | get useCombinationRunes(): boolean; 10 | get addItemsToBankOnLoadFail(): boolean; 11 | /** Constructs a player for golbin raid */ 12 | constructor(manager: RaidManager, game: Game); 13 | isEquipmentSlotUnlocked(slot: EquipmentSlot): boolean; 14 | modifyAttackInterval(interval: number): number; 15 | resetAltAttacks(): void; 16 | getSlotAttacks(equipped: EquippedItem): SpecialAttack[]; 17 | computeLevels(): void; 18 | computeModifiers(): void; 19 | mergeUninheritedEffectApplicators(): void; 20 | processDeath(): void; 21 | baseSpawnInterval: number; 22 | equipItem(item: EquipmentItem, set: number, slot?: EquipmentSlot, quantity?: number, altAttacks?: SpecialAttack[]): boolean; 23 | updateForEquipmentChange(): void; 24 | /** Equips the selected food, replacing it if it is different */ 25 | equipFood(item: FoodItem, quantity: number): boolean; 26 | /** Sets default starting equipment for golbin raid */ 27 | setEquipmentToDefault(): void; 28 | addMiscModifiers(): void; 29 | getSkillLevel(skill: CombatLevelKey): number; 30 | getLevelHistory(): number[]; 31 | getEquipmentHistory(): EquipmentItem[]; 32 | getFoodHealingBonus(item: FoodItem): number; 33 | onMagicAttackFailure(): void; 34 | onRangedAttackFailure(quiver: EquipmentItem): void; 35 | consumeAmmo(): void; 36 | equipDefaultWeapon(): void; 37 | rewardForDamage(damage: number): void; 38 | trackItemUsage(costs: AnyItemQuantity[]): void; 39 | trackWeaponStat(stat: ItemStats, amount?: number): void; 40 | consumeItemCharges(e: GameEvent, item: EquipmentItem): void; 41 | consumeItemQuantities(e: GameEvent, equipped: EquippedItem): void; 42 | consumeSynergyTablets(e: GameEvent): void; 43 | trackArmourStat(stat: ItemStats, amount?: number): void; 44 | addItemStat(item: EquipmentItem, stat: ItemStats, amount: number): void; 45 | trackPrayerStats(stat: PrayerStats, amount: number): void; 46 | checkIfCantEquip(): boolean; 47 | render(): void; 48 | renderLevels(): void; 49 | encode(writer: SaveWriter): SaveWriter; 50 | decode(reader: SaveWriter, version: number): void; 51 | deserializeAltAttacks(reader: DataReader, version: number, idMap: NumericIDMap): void; 52 | deserialize(reader: DataReader, version: number, idMap: NumericIDMap): void; 53 | } 54 | -------------------------------------------------------------------------------- /src/gameTypes/minibar.d.ts: -------------------------------------------------------------------------------- 1 | declare type QuickEquipIcon = { 2 | button: HTMLDivElement; 3 | tooltip: TippyTooltip; 4 | equippedTick: HTMLImageElement; 5 | }; 6 | declare class Minibar implements EncodableObject { 7 | game: Game; 8 | get minibarElement(): HTMLDivElement; 9 | get quickEquipContainer(): HTMLElement; 10 | masteryUnlocks: MinibarItem; 11 | milestones: MinibarItem; 12 | summoning: MinibarItem; 13 | quickEquip: MinibarItem; 14 | ancientRelics: MinibarItem; 15 | pets: MinibarItem[]; 16 | upgrades: MinibarItem[]; 17 | customItems: Map; 18 | activeSkill?: AnySkill; 19 | renderQueue: { 20 | quickEquipIcons: boolean; 21 | }; 22 | quickEquipIcons: Map; 23 | minibar: MinibarItem[]; 24 | toggleDeleteItems: boolean; 25 | constructor(game: Game); 26 | /** Appends the minibar items to the DOM */ 27 | initialize(): void; 28 | render(): void; 29 | encode(writer: SaveWriter): SaveWriter; 30 | decode(reader: SaveWriter, version: number): void; 31 | convertFromOldformat(save: NewSaveGame, idMap: NumericIDMap): void; 32 | getCustomItemsForSkill(skill: AnySkill): EquipmentItem[]; 33 | setCustomItemsToDefault(skill: AnySkill): EquipmentItem[]; 34 | /** Adds an item to a skills custom items */ 35 | addItemOnDiscovery(item: EquipmentItem): void; 36 | /** Toggles a custom quick-equip item for the given skill. Returns true if the item was added. */ 37 | toggleCustomItem(skill: AnySkill, item: EquipmentItem): boolean; 38 | /** Returns if the skill has the given item in the minibar selection */ 39 | isCustomItemSet(skill: AnySkill, item: EquipmentItem): boolean; 40 | setSkill(skill?: AnySkill): void; 41 | updateEquippedTicks(): void; 42 | destroyQuickEquipIcons(): void; 43 | createQuickEquipIcons(skill: AnySkill): void; 44 | createQuickEquipIcon(item: EquipmentItem, skill: AnySkill): void; 45 | removeItemFromQuickEquip(skill: AnySkill, item: EquipmentItem): void; 46 | toggleRemoveItemsQuickEquip(skill: AnySkill): void; 47 | createPetItem(pet: Pet): MinibarItem; 48 | createUpgradeItem(upgrade: ShopPurchase): MinibarItem; 49 | createMinibarItem(elementID: string, media: string, tooltipContent: string, options: MinibarOption): MinibarItem; 50 | applyOptionsToElement(element: HTMLButtonElement, options: MinibarOption): void; 51 | createElementTooltip(element: HTMLButtonElement, tooltipContent: string): TippyTooltip; 52 | removeItem(item: MinibarItem): void; 53 | changeItemOrder(newIndex: number, oldIndex: number): void; 54 | } 55 | interface MinibarItem { 56 | element: HTMLButtonElement; 57 | tooltip?: TippyTooltip; 58 | } 59 | interface MinibarOption { 60 | hideOnCreate?: boolean; 61 | onClick?: () => void; 62 | } 63 | declare function toggleSkillMinibar(): void; 64 | declare function displayQuickItemEquip(): void; 65 | -------------------------------------------------------------------------------- /src/gameTypes/potionManager.d.ts: -------------------------------------------------------------------------------- 1 | declare type PotionEvents = { 2 | potionUsed: PotionUsedEvent; 3 | chargeUsed: PotionChargeUsedEvent; 4 | /** Fired whenever the potion for an action changes */ 5 | potionChanged: PotionChangedEvent; 6 | }; 7 | /** Management class for potion consumption and charges */ 8 | declare class PotionManager extends GameEventEmitter implements EncodableObject { 9 | game: Game; 10 | activePotions: Map; 11 | /** Actions for which potions should not be automatically re-used */ 12 | autoReuseActions: Set; 13 | renderRequired: boolean; 14 | providedStats: StatProvider; 15 | constructor(game: Game); 16 | isPotionActiveForAction(action: Action): boolean; 17 | getActivePotionForAction(action: Action): PotionItem | undefined; 18 | isPotionActive(potion: PotionItem): boolean; 19 | autoReusePotionsForAction(action: Action): boolean; 20 | getPotionCharges(item: PotionItem): number; 21 | usePotion(item: PotionItem, loadPotions?: boolean): void; 22 | /** Creates an ActivePotion object, and assigns its event matchers */ 23 | createActivePotion(item: PotionItem, charges: number): ActivePotion; 24 | removePotion(action: Action, loadPotions?: boolean): void; 25 | consumeChargeForAction(e: GameEvent, action: Action): void; 26 | toggleAutoReusePotion(action: Action): void; 27 | /** Callback function for opening the potion selection menu */ 28 | openPotionSelectOnClick(action: Action): void; 29 | /** Recomputes the stats provided by potions */ 30 | computeProvidedStats(updatePlayer?: boolean): void; 31 | render(): void; 32 | onLoad(): void; 33 | updatePotionHeader(potion: ActivePotion | undefined): void; 34 | encode(writer: SaveWriter): SaveWriter; 35 | decode(reader: SaveWriter, version: number): void; 36 | convertFromOldFormat(save: NewSaveGame, idMap: NumericIDMap): void; 37 | } 38 | interface ActivePotion { 39 | item: PotionItem; 40 | charges: number; 41 | unassigners: VoidFunction[]; 42 | } 43 | declare class PotionSelectMenuItemElement extends HTMLElement implements CustomElement { 44 | _content: DocumentFragment; 45 | potionImage: HTMLImageElement; 46 | potionQuantity: HTMLHeadingElement; 47 | potionName: HTMLSpanElement; 48 | useButton: HTMLButtonElement; 49 | potionDescription: HTMLHeadingElement; 50 | potionCharges: HTMLHeadingElement; 51 | constructor(); 52 | connectedCallback(): void; 53 | setPotion(potion: PotionItem, game: Game): void; 54 | } 55 | declare class PotionSelectMenuElement extends HTMLElement implements CustomElement { 56 | _content: DocumentFragment; 57 | potionContainer: HTMLDivElement; 58 | autoReuseCheckBox: HTMLInputElement; 59 | menuItems: PotionSelectMenuItemElement[]; 60 | constructor(); 61 | connectedCallback(): void; 62 | showPotionSelection(potions: PotionItem[], action: Action, game: Game): void; 63 | } 64 | -------------------------------------------------------------------------------- /src/gameTypes/effectRenderer.d.ts: -------------------------------------------------------------------------------- 1 | declare class EffectRenderer { 2 | iconContainer: HTMLElement; 3 | progressBarContainer: HTMLElement; 4 | progressIconContainer: HTMLElement; 5 | icons: Map; 6 | progressBarPool: CombatEffectProgressBar[]; 7 | progressBars: Map; 8 | removalQueue: Set; 9 | constructor(iconContainer: HTMLElement, progressBarContainer: HTMLElement, progressIconContainer: HTMLElement); 10 | /** Renders an effect */ 11 | removeEffects(): void; 12 | /** Clears the removal queue */ 13 | flushRemovalQueue(): void; 14 | /** Adds a new icon for an active effect */ 15 | createEffect(icon: string, turns: string, tooltipContent: HTMLElement): CombatEffectIcon; 16 | /** Creates a tooltip instance for an icon */ 17 | createTooltip(element: HTMLElement, content: HTMLElement): TippyTooltip; 18 | /** If the activeEffect is already rendered, updates its turnText and tooltip, else adds a new icon */ 19 | addEffectIcon(activeEffect: ActiveCombatEffect, turnText: string, tooltipContent: HTMLElement, media: string): void; 20 | /** Gets a progress bar for use. Attempts to remove one from the pool first before creating a new one */ 21 | getProgressBar(): CombatEffectProgressBar; 22 | addEffectProgressBar(activeEffect: ActiveCombatEffect, progressBar: CombatEffectProgressBarModel): void; 23 | /** Adds/Updates the rendering of an active combat effect */ 24 | add(activeEffect: ActiveCombatEffect): void; 25 | getTooltipContent(activeEffect: ActiveCombatEffect): HTMLDivElement; 26 | /** Queues the removal of an effect */ 27 | queueRemoval(activeEffect: ActiveCombatEffect): void; 28 | queueRemoveAll(): void; 29 | } 30 | declare const effectMedia: { 31 | offenseUp: string; 32 | defenseUp: string; 33 | offenseDown: string; 34 | defenseDown: string; 35 | frozen: string; 36 | stun: string; 37 | sleep: string; 38 | slowed: string; 39 | markOfDeath: string; 40 | afflicted: string; 41 | speedup: string; 42 | frostBurn: string; 43 | decay: string; 44 | madness: string; 45 | torment: string; 46 | despair: string; 47 | stunImmunity: string; 48 | shocked: string; 49 | crystallize: string; 50 | crystalSanction: string; 51 | }; 52 | declare const dotMedia: { 53 | Burn: string; 54 | Bleed: string; 55 | Poison: string; 56 | Regen: string; 57 | DeadlyPoison: string; 58 | BarrierBleed: string; 59 | BarrierBurn: string; 60 | }; 61 | declare type CombatEffectIcon = { 62 | tooltip: TippyTooltip; 63 | container: HTMLDivElement; 64 | icon: HTMLImageElement; 65 | number: HTMLDivElement; 66 | }; 67 | interface CombatEffectProgressBar { 68 | tooltip: TippyTooltip; 69 | barContainer: HTMLDivElement; 70 | bar: HTMLDivElement; 71 | iconSpan: HTMLSpanElement; 72 | image: HTMLImageElement; 73 | current: HTMLSpanElement; 74 | max: HTMLSpanElement; 75 | } 76 | -------------------------------------------------------------------------------- /src/gameTypes/combatSkills.d.ts: -------------------------------------------------------------------------------- 1 | declare abstract class CombatSkill extends Skill { 2 | get isCombat(): boolean; 3 | get hasMinibar(): boolean; 4 | onAnyLevelUp(): void; 5 | } 6 | declare class Attack extends CombatSkill { 7 | readonly _media = Assets.Attack; 8 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 9 | renderQueue: SkillRenderQueue; 10 | postDataRegistration(): void; 11 | constructor(namespace: DataNamespace, game: Game); 12 | shouldShowSkillInSidebar(): boolean; 13 | } 14 | declare class Strength extends CombatSkill { 15 | readonly _media = Assets.Strength; 16 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 17 | renderQueue: SkillRenderQueue; 18 | postDataRegistration(): void; 19 | constructor(namespace: DataNamespace, game: Game); 20 | shouldShowSkillInSidebar(): boolean; 21 | } 22 | declare class Defence extends CombatSkill { 23 | readonly _media = Assets.Defence; 24 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 25 | renderQueue: SkillRenderQueue; 26 | constructor(namespace: DataNamespace, game: Game); 27 | postDataRegistration(): void; 28 | shouldShowSkillInSidebar(): boolean; 29 | } 30 | declare class Hitpoints extends CombatSkill { 31 | readonly _media = Assets.Hitpoints; 32 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 33 | renderQueue: SkillRenderQueue; 34 | constructor(namespace: DataNamespace, game: Game); 35 | get tutorialLevelCap(): number; 36 | postDataRegistration(): void; 37 | get startingLevel(): number; 38 | onLevelUp(oldLevel: number, newLevel: number): void; 39 | onAbyssalLevelUp(oldLevel: number, newLevel: number): void; 40 | shouldShowSkillInSidebar(): boolean; 41 | } 42 | declare class Ranged extends CombatSkill { 43 | readonly _media = Assets.Ranged; 44 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 45 | renderQueue: SkillRenderQueue; 46 | constructor(namespace: DataNamespace, game: Game); 47 | postDataRegistration(): void; 48 | shouldShowSkillInSidebar(): boolean; 49 | } 50 | declare class PrayerRenderQueue extends SkillRenderQueue { 51 | prayerMenu: boolean; 52 | } 53 | declare class Prayer extends CombatSkill { 54 | readonly _media = Assets.Prayer; 55 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 56 | /** Renders required for the skill */ 57 | renderQueue: PrayerRenderQueue; 58 | constructor(namespace: DataNamespace, game: Game); 59 | postDataRegistration(): void; 60 | render(): void; 61 | renderPrayerMenu(): void; 62 | onAnyLevelUp(): void; 63 | shouldShowSkillInSidebar(): boolean; 64 | } 65 | declare class Slayer extends CombatSkill { 66 | readonly _media = Assets.Slayer; 67 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 68 | renderQueue: SkillRenderQueue; 69 | constructor(namespace: DataNamespace, game: Game); 70 | postDataRegistration(): void; 71 | shouldShowSkillInSidebar(): boolean; 72 | } 73 | -------------------------------------------------------------------------------- /src/gameTypes/expressionBuilder.d.ts: -------------------------------------------------------------------------------- 1 | declare type ExprPrimary = number | boolean; 2 | declare enum ExprTokenType { 3 | QUESTION_MARK = 0, 4 | COLON = 1, 5 | MINUS = 2, 6 | PLUS = 3, 7 | SLASH = 4, 8 | STAR = 5, 9 | CARET = 6, 10 | LEFT_PAREN = 7, 11 | RIGHT_PAREN = 8, 12 | COMMA = 9, 13 | DOT = 10, 14 | PERCENT = 11, 15 | DOUBLE_PIPE = 12, 16 | DOUBLE_AMPERSAND = 13, 17 | BANG = 14, 18 | BANG_EQUAL = 15, 19 | DOUBLE_EQUAL = 16, 20 | GREATER = 17, 21 | GREATER_EQUAL = 18, 22 | LESS = 19, 23 | LESS_EQUAL = 20, 24 | NUMBER = 21, 25 | IDENTIFIER = 22, 26 | TRUE = 23, 27 | FALSE = 24, 28 | EOS = 25 29 | } 30 | interface IExprPosition { 31 | line: number; 32 | column: number; 33 | } 34 | declare class ExprToken implements IExprPosition { 35 | readonly type: ExprTokenType; 36 | readonly lexeme: string; 37 | readonly literal?: ExprPrimary; 38 | readonly line: number; 39 | readonly column: number; 40 | constructor(type: ExprTokenType, lexeme: string, literal: ExprPrimary | undefined, line: number, column: number); 41 | toString(): string; 42 | } 43 | declare class ExprError { 44 | readonly line: number; 45 | readonly column: number; 46 | readonly message: string; 47 | constructor(token: IExprPosition, message: string); 48 | } 49 | declare enum ExprPrimaryType { 50 | NumberBool = 0, 51 | Number = 1, 52 | Boolean = 2 53 | } 54 | declare type AnyFunction = (...args: any[]) => any; 55 | interface IExprTranspiler { 56 | /** Builds a function from an expression string */ 57 | buildFunction(exprString: string | number, message: string): FunctionType; 58 | /** Builds a function from an expression string and returns the expression as well */ 59 | buildFunctionExpr(exprString: string | number, message: string): { 60 | func: FunctionType; 61 | expr: Expr; 62 | }; 63 | } 64 | interface ExprTestResult { 65 | isValid: boolean; 66 | isLiteral: boolean; 67 | errors: ExprError[]; 68 | } 69 | declare type ExprTestFunction = (exprString: string | number, type: ExprPrimaryType) => ExprTestResult; 70 | interface IExprTester { 71 | /** Validates that an expression is valid and evaluates to the given type */ 72 | validateWithType(exprString: string | number, type: ExprPrimaryType): ExprTestResult; 73 | } 74 | declare const expressions: { 75 | updateModifiers: (namespace: DataNamespace, modifiers: Modifier[]) => void; 76 | getCharacterNumberTranspiler: () => IExprTranspiler<(character: Character) => number>; 77 | getCombatEffectNumberTranspiler: (effect: CombatEffect) => IExprTranspiler; 78 | getInitialParamNumberTranspiler: (paramNames: string[]) => IExprTranspiler<(initialParams: Record) => number>; 79 | getModifierValueTranspiler: () => IExprTranspiler<(value: number) => number>; 80 | getCharacterExprTester: () => ExprTestFunction; 81 | getCombatEffectExprTester: (namedProps: CombatEffectNamedProperties) => ExprTestFunction; 82 | getInitialParamExprTester: (namedProps: CombatEffectNamedProperties) => ExprTestFunction; 83 | }; 84 | -------------------------------------------------------------------------------- /src/gameTypes/crafting.d.ts: -------------------------------------------------------------------------------- 1 | interface CraftingSkillData extends MasterySkillData { 2 | categories?: SkillCategoryData[]; 3 | subcategories?: SkillSubcategoryData[]; 4 | recipes?: CraftingRecipeData[]; 5 | } 6 | interface CraftingModificationData extends MasterySkillModificationData { 7 | recipes?: CraftingRecipeModificationData[]; 8 | } 9 | declare type CraftingEvents = { 10 | action: CraftingActionEvent; 11 | } & SkillWithMasteryEvents; 12 | declare class Crafting extends ArtisanSkill implements SkillCategoryObject { 13 | readonly _media = Assets.Crafting; 14 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 15 | isMasteryActionUnlocked(action: CraftingRecipe): boolean; 16 | readonly baseInterval: number; 17 | get menu(): ArtisanMenuElement; 18 | selectionTabs: Map>; 19 | get categoryMenu(): RealmedCategoryMenuElement; 20 | renderQueue: ArtisanSkillRenderQueue; 21 | categories: NamespaceRegistry; 22 | subcategories: NamespaceRegistry; 23 | get noCostsMessage(): string; 24 | get actionItem(): AnyItem; 25 | get unmodifiedActionQuantity(): number; 26 | get activeRecipe(): CraftingRecipe; 27 | get masteryModifiedInterval(): number; 28 | constructor(namespace: DataNamespace, game: Game); 29 | registerData(namespace: DataNamespace, data: CraftingSkillData): void; 30 | modifyData(data: CraftingModificationData): void; 31 | postDataRegistration(): void; 32 | resetToDefaultSelectedRecipeBasedOnRealm(): void; 33 | updateRealmSelection(): void; 34 | getRecipeAutoSubcategory(recipe: CraftingRecipe): SkillSubcategory | undefined; 35 | getFlatCostReduction(action?: CraftingRecipe, item?: AnyItem): number; 36 | getActionModifierQueryParams(action?: NamedObject): SkillModifierQueryParams; 37 | onMasteryLevelUp(action: CraftingRecipe, oldLevel: number, newLevel: number): void; 38 | recordCostPreservationStats(costs: Costs): void; 39 | recordCostConsumptionStats(costs: Costs): void; 40 | preAction(): void; 41 | get actionRewards(): Rewards; 42 | postAction(): void; 43 | getActionIDFromOldID(oldActionID: number, idMap: NumericIDMap): string; 44 | setFromOldOffline(offline: OfflineSkill, idMap: NumericIDMap): void; 45 | testTranslations(): void; 46 | getObtainableItems(): Set; 47 | getRegistry(type: ScopeSourceType): NamespaceRegistry | undefined; 48 | getPkgObjects(pkg: GameDataPackage, type: ScopeSourceType): IDData[] | undefined; 49 | } 50 | interface CraftingRecipeData extends SingleProductArtisanSkillRecipeData { 51 | subcategoryID?: string; 52 | } 53 | interface CraftingRecipeModificationData extends SingleProductArtisanSkillRecipeModificationData { 54 | subcategoryID?: string; 55 | } 56 | declare class CraftingRecipe extends SingleProductArtisanSkillRecipe { 57 | subcategory?: SkillSubcategory; 58 | constructor(namespace: DataNamespace, data: CraftingRecipeData, game: Game, skill: Crafting); 59 | applyDataModification(data: CraftingRecipeModificationData, game: Game): void; 60 | } 61 | -------------------------------------------------------------------------------- /src/gameTypes/cloud.d.ts: -------------------------------------------------------------------------------- 1 | declare const CLOUDURL = ""; 2 | declare const ENABLEPLAYFABAUTH = false; 3 | /** Future function to be used to determine whether or not the correct URL origin is used to access the game */ 4 | declare const gameOriginCheck: () => boolean; 5 | /** Character Selection UI update if connection to PlayFab Failed */ 6 | declare function connectionFailedPlayFab(): void; 7 | /** Character Selection UI update if connection to PlayFab Failed */ 8 | declare function connectionSuccessPlayFab(): void; 9 | /** Game version checker to notify idle players of an update that was released */ 10 | declare function checkGameVersion(): void; 11 | /** Loads/Creates the Cloud Settings area within the Settings Page */ 12 | declare function loadCloudOptions(isCloud: boolean): void; 13 | /** 14 | * Function used to get the value of a key from the PlayFab title data of the user. 15 | * @param {string} key - The key to get the value of 16 | * @returns {string} The value of the key 17 | */ 18 | declare function getPlayFabData(key: string): Promise; 19 | /** 20 | * Stores key:value pairs in the PlayFab title data of the user. 21 | * @param {string} key - The key to set the value of 22 | * @param {any} value - The value to set the key to 23 | */ 24 | declare function playFabStoreData(key: string, value: string | null): void; 25 | /** Callback for above store data method */ 26 | declare function playFabStoreDataCallback(result: PlayFabModule.SuccessContainer, error: PlayFabModule.IPlayFabError): void; 27 | /** Cloud save deleted notification */ 28 | declare function showPlayFabSaveDeletedNotification(): void; 29 | declare function createPlayFabSaves(): string; 30 | declare function enableCloudCharacterButton(): void; 31 | declare function registerToMelvorCloud(): Promise; 32 | declare function forgotPasswordMelvorCloud(): void; 33 | declare function disableLoginForm(): void; 34 | declare function enableLoginForm(): void; 35 | declare function disableRegisterForm(): void; 36 | declare function enableRegisterForm(): void; 37 | declare function disableForgotForm(): void; 38 | declare function enableForgotForm(): void; 39 | declare function disableChangeEmailForm(): void; 40 | declare function enableChangeEmailForm(): void; 41 | declare function disableChangePasswordForm(): void; 42 | declare function enableChangePasswordForm(): void; 43 | declare function updateEmailMelvorCloud(): void; 44 | declare function updatePasswordMelvorCloud(): void; 45 | /** Links the user's Steam ID to their PlayFab account which can be used alongside Steam Web API */ 46 | declare const linkSteamAccountToPlayFab: (forceLink: boolean) => void; 47 | /** Genereates a UUID for active user tracking */ 48 | declare function generateUUID(length: number): string; 49 | declare function failMobilePurchase(): void; 50 | declare function confirmMobilePurchase(): void; 51 | declare function warningMobilePurchase(): void; 52 | declare function failBrowserPurchase(): void; 53 | declare function confirmBrowserPurchase(): void; 54 | declare function warningBrowserPurchase(): void; 55 | declare function showActivationError(error: number): void; 56 | declare function hideActivationError(error: number): void; 57 | declare function warnActivationNotLoggedIn(): void; 58 | declare const updatePlayerTags: () => void; 59 | declare const updatePlayerLangTags: () => void; 60 | -------------------------------------------------------------------------------- /src/gameTypes/pets.d.ts: -------------------------------------------------------------------------------- 1 | interface PetData extends IDData, IStatObjectData { 2 | /** Display name of the pet */ 3 | name: string; 4 | /** Media string for pet */ 5 | media: string; 6 | /** Optional custom hint for the pet */ 7 | hint?: string; 8 | /** Language string for pet hint */ 9 | langHint?: string; 10 | /** Optional skill this pet is obtained from */ 11 | skillID?: string; 12 | /** If the chance to receive the pet should scale with the skill's mastery pool progress */ 13 | scaleChanceWithMasteryPool: boolean; 14 | /** True if pet does not count towards game completion */ 15 | ignoreCompletion: boolean; 16 | /** True if pets bonus should only apply to Golbin Raid */ 17 | activeInRaid: boolean; 18 | /** Optional, name of patreon who created this pet */ 19 | patreonName?: string; 20 | /** Custom description for the pet. Appended to custom modifier description. */ 21 | customDescription?: string; 22 | /** Optional, Language string for custom description */ 23 | langCustomDescription?: string; 24 | /** Optional, What realms this pet drop is exclusive to */ 25 | realms?: string[]; 26 | } 27 | declare type PetModificationData = IDData & IStatObjectModificationData; 28 | declare class Pet extends NamespacedObject { 29 | get name(): string; 30 | get media(): string; 31 | get acquiredBy(): string; 32 | get description(): string; 33 | skill?: AnySkill; 34 | scaleChanceWithMasteryPool: boolean; 35 | ignoreCompletion: boolean; 36 | stats: StatObject; 37 | activeInRaid: boolean; 38 | _name: string; 39 | _media: string; 40 | _hint?: string; 41 | _langHint?: string; 42 | _patreonName?: string; 43 | _customDescription?: string; 44 | _langCustomDescription?: string; 45 | realms: Set; 46 | constructor(namespace: DataNamespace, data: PetData, game: Game); 47 | applyDataModification(data: PetModificationData, game: Game): void; 48 | isCorrectRealmForPetDrop(realm: Realm): boolean; 49 | } 50 | declare class DummyPet extends Pet { 51 | constructor(namespace: DataNamespace, id: string, game: Game); 52 | } 53 | declare class PetManager extends StatProvider implements IRaidStatProvider, EncodableObject { 54 | game: Game; 55 | raidStats: StatProvider; 56 | unlocked: Set; 57 | constructor(game: Game); 58 | onLoad(): void; 59 | isPetUnlocked(pet: Pet): boolean; 60 | /** Rolls to unlock a pet with a fixed percentage chance */ 61 | rollForPet(chance: PetChance): void; 62 | /** Rolls to unlock a skill pet */ 63 | rollForSkillPet(pet: Pet, actionInterval: number, forceSkill?: AnySkill): void; 64 | /** Unlocks a pet, if it wasn't already unlocked */ 65 | unlockPet(pet: Pet): void; 66 | /** 67 | * @description Attempts to unlock a pet with the given id. Throws an error if the pet is not registered. 68 | * @param petID 69 | */ 70 | unlockPetByID(petID: string): void; 71 | /** 72 | * @description Callback function for petting a pet 73 | * @param pet The pet to pet 74 | */ 75 | petPet(pet: Pet): void; 76 | firePetUnlockModal(pet: Pet): void; 77 | computeProvidedStats(updatePlayers?: boolean): void; 78 | encode(writer: SaveWriter): SaveWriter; 79 | decode(reader: SaveWriter, version: number): void; 80 | convertFromOldFormat(save: NewSaveGame, idMap: NumericIDMap): void; 81 | } 82 | -------------------------------------------------------------------------------- /src/gameTypes/classInterfaces.d.ts: -------------------------------------------------------------------------------- 1 | // Design of interfaces that skills may have 2 | interface EncodableObject { 3 | /** Encodes the objects saved properties into a binary save writer. Returns the original SaveWriter */ 4 | encode(writer: SaveWriter): SaveWriter; 5 | /** Decodes the objects saved properties from a binary save reader. */ 6 | decode(reader: SaveWriter, version: number): void; 7 | } 8 | /** Object has state data that needs to be saved */ 9 | interface Serializable { 10 | /** Sets class state data based on the data contained in reader. Used to convert from the old serializing format. */ 11 | deserialize(reader: DataReader, version: number, idMap: NumericIDMap): void; 12 | } 13 | interface Action extends NamespacedObject { 14 | /** Name for the action */ 15 | name: string; 16 | /** media for the action */ 17 | media: string; 18 | /** Returns a log of the action state, in the event an error occurs trying to tick it. */ 19 | getErrorLog(): string; 20 | /** Optional. Called when changing to the actions page, but before the page is visible in the DOM */ 21 | onPageChange?(): void; 22 | /** Optional. Called when changing to the actions page, just after the page is visible in the DOM */ 23 | onPageVisible?(): void; 24 | /** Optional. Called when changing from the actions page. */ 25 | onPageLeave?(): void; 26 | /** Optional. Called when rendering if the player is on a page associated with the action, and player modifiers have changed between the last render */ 27 | renderModifierChange?(): void; 28 | /** Optional. Called when the the specified item's quantity changes in the bank, and the player is on a page associated with the action. Utilized to queue up renders required on the action's page. */ 29 | queueBankQuantityRender?(item: AnyItem): void; 30 | /** Optional. Called when the specified currencies quantity changes, and the player is on a page associated with the action. Utilized to queue up renders required on the action's page. */ 31 | queueCurrencyQuantityRender?(currency: Currency): void; 32 | } 33 | /** Action that has behaviour that is always active */ 34 | interface PassiveAction extends Action { 35 | /** Perform a single tick. Ticks occur regardless of if the action is active or not. */ 36 | passiveTick(): void; 37 | } 38 | /** Action that has behaviour that only occurs when active */ 39 | interface ActiveAction extends Action { 40 | /** If the action is currently active */ 41 | isActive: boolean; 42 | /** Tries to stop the action. Returns true if successfully stopped. */ 43 | stop(): boolean; 44 | /** Perform a single tick. Ticks occur only when the skill is currently active. */ 45 | activeTick(): void; 46 | /** Returns an array of skills which should be highlighted in the sidebar */ 47 | activeSkills: AnySkill[]; 48 | /** Optional. Called when player modifiers change, and this action is the current active action. */ 49 | onModifierChangeWhileActive?(): void; 50 | /** Optional. Called before offline progress occurs, and this action is the current active action. State storage is to be handled by the Action class */ 51 | createOfflineSnapshot?(): void; 52 | /** Optional, Called when generating an offline modal, and this action was/is the current active action. Intended to parse state changes from createOfflineSnapShot */ 53 | getOfflineMessages?(): string[]; 54 | } 55 | interface SkillCategoryObject { 56 | categories: NamespaceRegistry 57 | } -------------------------------------------------------------------------------- /src/gameTypes/thievingMenu.d.ts: -------------------------------------------------------------------------------- 1 | declare class ThievingNPCNavElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | button: HTMLAnchorElement; 4 | buttonContent: HTMLDivElement; 5 | npcImage: HTMLImageElement; 6 | npcName: HTMLSpanElement; 7 | masteryDisplay: CompactMasteryDisplayElement; 8 | perception: HTMLSpanElement; 9 | success: HTMLSpanElement; 10 | maxHit: HTMLSpanElement; 11 | unlock: HTMLDivElement; 12 | level: HTMLSpanElement; 13 | abyssalLevel: HTMLSpanElement; 14 | constructor(); 15 | connectedCallback(): void; 16 | setNPC(npc: ThievingNPC, thieving: Thieving): void; 17 | updateNPC(npc: ThievingNPC, game: Game): void; 18 | setLocked(npc: ThievingNPC, thieving: Thieving): void; 19 | setUnlocked(callback: VoidFunction): void; 20 | } 21 | declare class ThievingInfoBoxElement extends HTMLElement implements CustomElement { 22 | _content: DocumentFragment; 23 | stealth: StealthIconElement; 24 | double: DoublingIconElement; 25 | xp: XpIconElement; 26 | abyssalXP: AbyssalXpIconElement; 27 | masteryXP: MasteryXpIconElement; 28 | poolXP: MasteryPoolIconElement; 29 | interval: IntervalIconElement; 30 | constructor(); 31 | connectedCallback(): void; 32 | setNPC(thieving: Thieving, npc: ThievingNPC): void; 33 | } 34 | declare class ThievingAreaPanelElement extends HTMLElement implements CustomElement { 35 | _content: DocumentFragment; 36 | header: HTMLDivElement; 37 | eyeIcon: HTMLElement; 38 | areaName: HTMLSpanElement; 39 | targetContainer: HTMLDivElement; 40 | infoContainer: HTMLDivElement; 41 | infoSkillName: HTMLElement; 42 | infoBoxName: HTMLSpanElement; 43 | infoBoxImage: HTMLImageElement; 44 | infoBox: ThievingInfoBoxElement; 45 | startButton: HTMLButtonElement; 46 | dropsButton: HTMLButtonElement; 47 | npcNavs: Map; 48 | selectedNPC?: ThievingNPC; 49 | progressBar: ProgressBarElement; 50 | constructor(); 51 | connectedCallback(): void; 52 | setArea(area: ThievingArea, thieving: Thieving): void; 53 | hide(): void; 54 | show(): void; 55 | updateNPCsForLevel(thieving: Thieving, area: ThievingArea): void; 56 | updateNPCButtons(game: Game): void; 57 | selectNPC(area: ThievingArea, npc: ThievingNPC, thieving: Thieving): void; 58 | updateAreaInfo(thieving: Thieving): void; 59 | updateNPCInfo(thieving: Thieving, npc: ThievingNPC): void; 60 | setStopButton(thieving: Thieving): void; 61 | removeStopButton(thieving: Thieving, area: ThievingArea): void; 62 | } 63 | /** Menu class for thieving */ 64 | declare class ThievingMenu { 65 | areaPanels: Map; 66 | activeArea: ThievingArea | undefined; 67 | constructor(containerID: string, thieving: Thieving); 68 | hideAreaPanel(area: ThievingArea): void; 69 | showAreaPanel(area: ThievingArea): void; 70 | hideArea(area: ThievingArea): void; 71 | showArea(area: ThievingArea): void; 72 | updateNPCsForLevel(thieving: Thieving): void; 73 | updateNPCButtons(game: Game): void; 74 | selectNPC(npc: ThievingNPC, area: ThievingArea, thieving: Thieving): void; 75 | updateAllAreaPanels(thieving: Thieving): void; 76 | setStopButton(thieving: Thieving, area: ThievingArea): void; 77 | removeStopButton(thieving: Thieving): void; 78 | getProgressBar(area: ThievingArea): ProgressBarElement | undefined; 79 | } 80 | -------------------------------------------------------------------------------- /src/gameTypes/smithing.d.ts: -------------------------------------------------------------------------------- 1 | interface SmithingSkillData extends MasterySkillData { 2 | categories?: SkillCategoryData[]; 3 | subcategories?: SkillSubcategoryData[]; 4 | recipes?: SmithingRecipeData[]; 5 | } 6 | interface SmithingModificationData extends MasterySkillModificationData { 7 | recipes?: SmithingRecipeModificationData[]; 8 | } 9 | declare type SmithingEvents = { 10 | action: SmithingActionEvent; 11 | } & SkillWithMasteryEvents; 12 | declare class Smithing extends ArtisanSkill implements SkillCategoryObject { 13 | readonly _media = Assets.Smithing; 14 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 15 | isMasteryActionUnlocked(action: SmithingRecipe): boolean; 16 | readonly baseInterval: number; 17 | get menu(): ArtisanMenuElement; 18 | selectionTabs: Map>; 19 | get categoryMenu(): RealmedCategoryMenuElement; 20 | renderQueue: ArtisanSkillRenderQueue; 21 | categories: NamespaceRegistry; 22 | subcategories: NamespaceRegistry; 23 | /** Map of smithing ore to bars */ 24 | oreToBarMap: Map; 25 | get noCostsMessage(): string; 26 | get actionItem(): AnyItem; 27 | get unmodifiedActionQuantity(): number; 28 | get activeRecipe(): SmithingRecipe; 29 | get isMakingBar(): boolean; 30 | get masteryModifiedInterval(): number; 31 | constructor(namespace: DataNamespace, game: Game); 32 | registerData(namespace: DataNamespace, data: SmithingSkillData): void; 33 | modifyData(data: SmithingModificationData): void; 34 | postDataRegistration(): void; 35 | resetToDefaultSelectedRecipeBasedOnRealm(): void; 36 | updateRealmSelection(): void; 37 | getSmithedVersionOfOre(ore: AnyItem): AnyItem | undefined; 38 | getUncappedCostReduction(action?: SmithingRecipe, item?: AnyItem): number; 39 | getFlatCostReduction(action?: SmithingRecipe, item?: AnyItem): number; 40 | modifyItemCost(item: AnyItem, quantity: number, recipe: NamedObject): number; 41 | getActionModifierQueryParams(action?: NamedObject): SkillModifierQueryParams; 42 | onMasteryLevelUp(action: SmithingRecipe, oldLevel: number, newLevel: number): void; 43 | recordCostPreservationStats(costs: Costs): void; 44 | recordCostConsumptionStats(costs: Costs): void; 45 | preAction(): void; 46 | get actionRewards(): Rewards; 47 | postAction(): void; 48 | getActionIDFromOldID(oldActionID: number, idMap: NumericIDMap): string; 49 | setFromOldOffline(offline: OfflineSkill, idMap: NumericIDMap): void; 50 | testTranslations(): void; 51 | getObtainableItems(): Set; 52 | getRegistry(type: ScopeSourceType): NamespaceRegistry | undefined; 53 | getPkgObjects(pkg: GameDataPackage, type: ScopeSourceType): IDData[] | undefined; 54 | } 55 | interface SmithingRecipeData extends SingleProductArtisanSkillRecipeData { 56 | subcategoryID?: string; 57 | } 58 | interface SmithingRecipeModificationData extends SingleProductArtisanSkillRecipeModificationData { 59 | subcategoryID?: string; 60 | } 61 | declare class SmithingRecipe extends SingleProductArtisanSkillRecipe { 62 | subcategory?: SkillSubcategory; 63 | constructor(namespace: DataNamespace, data: SmithingRecipeData, game: Game, skill: Smithing); 64 | applyDataModification(data: SmithingRecipeModificationData, game: Game): void; 65 | } 66 | -------------------------------------------------------------------------------- /src/gameTypes/herblore.d.ts: -------------------------------------------------------------------------------- 1 | interface HerbloreRecipeData extends CategorizedArtisanRecipeData { 2 | potionIDs: [string, string, string, string]; 3 | name: string; 4 | } 5 | interface HerbloreRecipeModificationData extends CategorizedArtisanRecipeModificationData { 6 | potionIDs?: [string, string, string, string]; 7 | } 8 | declare class HerbloreRecipe extends CategorizedArtisanRecipe { 9 | potions: [PotionItem, PotionItem, PotionItem, PotionItem]; 10 | get name(): string; 11 | get media(): string; 12 | _name: string; 13 | skill: Herblore; 14 | constructor(namespace: DataNamespace, data: HerbloreRecipeData, game: Game, skill: Herblore); 15 | applyDataModification(data: HerbloreRecipeModificationData, game: Game): void; 16 | } 17 | interface HerbloreSkillData extends MasterySkillData { 18 | categories?: SkillCategoryData[]; 19 | recipes?: HerbloreRecipeData[]; 20 | } 21 | interface HerbloreModificationData extends MasterySkillModificationData { 22 | recipes?: HerbloreRecipeModificationData[]; 23 | } 24 | declare type HerbloreEvents = { 25 | action: HerbloreActionEvent; 26 | } & SkillWithMasteryEvents; 27 | declare class Herblore extends ArtisanSkill implements SkillCategoryObject { 28 | readonly _media = Assets.Herblore; 29 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 30 | isMasteryActionUnlocked(action: HerbloreRecipe): boolean; 31 | readonly baseInterval: number; 32 | get menu(): HerbloreArtisanMenuElement; 33 | selectionTabs: Map>; 34 | get categoryMenu(): RealmedCategoryMenuElement; 35 | renderQueue: ArtisanSkillRenderQueue; 36 | categories: NamespaceRegistry; 37 | potionToRecipeMap: Map; 38 | get noCostsMessage(): string; 39 | get actionItem(): PotionItem; 40 | get unmodifiedActionQuantity(): number; 41 | get activeRecipe(): HerbloreRecipe; 42 | get masteryModifiedInterval(): number; 43 | constructor(namespace: DataNamespace, game: Game); 44 | registerData(namespace: DataNamespace, data: HerbloreSkillData): void; 45 | modifyData(data: HerbloreModificationData): void; 46 | postDataRegistration(): void; 47 | /** Returns the recipe for a given potion. If none exists, returns undefined instead. */ 48 | getRecipeForPotion(potion: PotionItem): HerbloreRecipe | undefined; 49 | getPotionTier(recipe: HerbloreRecipe): number; 50 | resetToDefaultSelectedRecipeBasedOnRealm(): void; 51 | updateRealmSelection(): void; 52 | onMasteryLevelUp(action: HerbloreRecipe, oldLevel: number, newLevel: number): void; 53 | recordCostPreservationStats(costs: Costs): void; 54 | recordCostConsumptionStats(costs: Costs): void; 55 | getActionModifierQueryParams(action?: NamedObject): SkillModifierQueryParams; 56 | preAction(): void; 57 | get actionRewards(): Rewards; 58 | postAction(): void; 59 | getActionIDFromOldID(oldActionID: number, idMap: NumericIDMap): string; 60 | setFromOldOffline(offline: OfflineSkill, idMap: NumericIDMap): void; 61 | testTranslations(): void; 62 | getObtainableItems(): Set; 63 | getRegistry(type: ScopeSourceType): NamespaceRegistry | undefined; 64 | getPkgObjects(pkg: GameDataPackage, type: ScopeSourceType): IDData[] | undefined; 65 | /** Mastery levels required to craft a tier of potion */ 66 | static tierMasteryLevels: number[]; 67 | } 68 | -------------------------------------------------------------------------------- /src/gameTypes/cookingMenu.d.ts: -------------------------------------------------------------------------------- 1 | declare class CookingMenuElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | upgradeImage: HTMLImageElement; 4 | upgradeName: HTMLHeadingElement; 5 | selectRecipeButton: HTMLButtonElement; 6 | selectedRecipeContainer: HTMLDivElement; 7 | productImage: HTMLImageElement; 8 | productCount: HTMLElement; 9 | productName: HTMLHeadingElement; 10 | productHealing: HTMLSpanElement; 11 | requires: RequiresBoxElement; 12 | grants: GrantsBoxElement; 13 | mastery: MasteryDisplayElement; 14 | haves: HavesBoxElement; 15 | bonuses: CookingBonusBoxElement; 16 | activeCookButton: HTMLButtonElement; 17 | activeCookInterval: HTMLElement; 18 | passiveCookButton: HTMLButtonElement; 19 | passiveCookInterval: HTMLElement; 20 | stockPileIcon: CookingStockpileIconElement; 21 | stockPileButton: HTMLButtonElement; 22 | productQty: number; 23 | productTooltip?: TippyTooltip; 24 | progressBar: ProgressBarElement; 25 | intervalTooltipEl: IntervalIconTooltipElement; 26 | intervalTooltip?: TippyTooltip; 27 | passiveIntervalTooptipEl: IntervalIconTooltipElement; 28 | passiveIntervalTooltip?: TippyTooltip; 29 | constructor(); 30 | connectedCallback(): void; 31 | disconnectedCallback(): void; 32 | init(category: CookingCategory, game: Game): void; 33 | setStockPile(item: AnyItemQuantity | undefined): void; 34 | updateUpgrade(category: CookingCategory): void; 35 | setSelected(recipe: CookingRecipe): void; 36 | getOwnedTooltipContent(normalQty: number, percectQty: number): string; 37 | setSelectedRecipe(recipe: CookingRecipe | undefined, cooking: Cooking, game: Game): void; 38 | setRecipeRates(recipe: CookingRecipe, cooking: Cooking): void; 39 | setBonusValues(values: CookingBonusValues, costReduction: number, costReductionSources: HTMLSpanElement[], additionalPrimaryQuantity: number, additionalPrimaryQuantitySources: HTMLSpanElement[]): void; 40 | updateQuantities(recipe: CookingRecipe, game: Game): void; 41 | setProgressPassive(): void; 42 | renderActiveProgress(timer: Timer): void; 43 | stopProgressBar(): void; 44 | } 45 | declare class CookingRecipeSelectionElement extends HTMLElement implements CustomElement { 46 | _content: DocumentFragment; 47 | productImage: HTMLImageElement; 48 | masteryLevel: HTMLSpanElement; 49 | masteryPercent: HTMLElement; 50 | productName: HTMLSpanElement; 51 | selectButton: HTMLButtonElement; 52 | cookingXP: HTMLSpanElement; 53 | healingAmount: HTMLSpanElement; 54 | intervalIcon: IntervalIconElement; 55 | costIcons: QuantityIconsElement; 56 | foodModifiersCont: HTMLDivElement; 57 | foodModifiers: HTMLDivElement; 58 | perfectFoodModifiersCont: HTMLDivElement; 59 | perfectFoodModifiers: HTMLDivElement; 60 | constructor(); 61 | connectedCallback(): void; 62 | setRecipe(recipe: CookingRecipe, cooking: Cooking, game: Game): void; 63 | /** Updates the interval, XP, hitpoints */ 64 | updateRates(recipe: CookingRecipe): void; 65 | /** Updates the modifiers provided by the food */ 66 | updateModifiers(recipe: CookingRecipe): void; 67 | /** Updates the mastery level and percent */ 68 | updateMastery(recipe: CookingRecipe, cooking: Cooking): void; 69 | /** Updates the quanties of the recipe costs */ 70 | updateQuantities(game: Game): void; 71 | } 72 | declare class LockedCookingRecipeElement extends HTMLElement implements CustomElement { 73 | _content: DocumentFragment; 74 | lockedText: HTMLHeadingElement; 75 | constructor(); 76 | connectedCallback(): void; 77 | setRecipe(recipe: CookingRecipe): void; 78 | } 79 | -------------------------------------------------------------------------------- /src/gameTypes/artisanMenu.d.ts: -------------------------------------------------------------------------------- 1 | declare class ArtisanMenuElement extends HTMLElement implements CustomElement { 2 | get $template(): string; 3 | _content: DocumentFragment; 4 | productImage: HTMLImageElement; 5 | productQuantity: HTMLElement; 6 | productName: HTMLSpanElement; 7 | productDescription: HTMLElement; 8 | selectedText: HTMLElement; 9 | viewStatsText: HTMLHeadingElement; 10 | productPreservation: PreservationIconElement; 11 | productDoubling: DoublingIconElement; 12 | productAdditionalPrimaryQuantity: AdditionalPrimaryQuantityIconElement; 13 | productCostReduction: CostReductionIconElement; 14 | mastery: MasteryDisplayElement; 15 | dropDownContainer: HTMLDivElement; 16 | recipeOptionsContainer: HTMLDivElement; 17 | requires: RequiresBoxElement; 18 | haves: HavesBoxElement; 19 | produces: ProducesBoxElement; 20 | grants: GrantsBoxElement; 21 | createButton: HTMLButtonElement; 22 | interval: IntervalIconElement; 23 | productIcon: ItemQuantityIconElement; 24 | recipeDropdownItems: QuantityIconsElement[]; 25 | progressBar: ProgressBarElement; 26 | progressTimestamp: number; 27 | progressInterval: number; 28 | noneSelected: boolean; 29 | product?: ProductItem; 30 | constructor(); 31 | connectedCallback(): void; 32 | init(skill: SkillWithMastery): void; 33 | setSelected(skill: SkillWithMastery, recipe: ArtisanSkillRecipe): void; 34 | setIngredients(items: AnyItemQuantity[], currencies: CurrencyQuantity[], game: Game): void; 35 | setIngredientsFromRecipe(recipe: ArtisanSkillRecipe, game: Game): void; 36 | setProduct(item: ProductItem, qty: number): void; 37 | updateQuantities(game: Game): void; 38 | updateGrants(xp: number, baseXP: number, masteryXP: number, baseMasteryXP: number, poolXP: number, realm: Realm): void; 39 | updateGrantsSources(skill: AnySkill, action?: NamedObject): void; 40 | updateAbyssalGrants(xp: number, baseXP: number): void; 41 | updateChances(preserveChance: number, preserveCap: number, preserveSources: HTMLSpanElement[], doublingChance: number, doublingSources: HTMLSpanElement[]): void; 42 | updateAdditionalPrimaryQuantity(qty: number, modifierSources: HTMLSpanElement[]): void; 43 | updateCostReduction(reduction: number, modifierSources: HTMLSpanElement[]): void; 44 | updateInterval(interval: number, modifierSources: HTMLSpanElement[]): void; 45 | setCreateCallback(callback: VoidFunction): void; 46 | animateProgressFromTimer(timer: Timer): void; 47 | startProgressBar(interval: number): void; 48 | stopProgressBar(): void; 49 | updateProgressBar(): void; 50 | hideRecipeDropdown(): void; 51 | showRecipeDropdown(): void; 52 | setRecipeDropdown(altRecipeIngredients: { 53 | items: AnyItemQuantity[]; 54 | currencies: CurrencyQuantity[]; 55 | }[], selectCallback: (recipeID: number) => VoidFunction, displayOrder?: number[]): void; 56 | } 57 | declare class HerbloreArtisanMenuElement extends ArtisanMenuElement implements CustomElement { 58 | get $template(): string; 59 | tierContainer: HTMLHeadingElement; 60 | tierText: HTMLElement; 61 | tierImages: HTMLImageElement[]; 62 | tierTooltips: TippyTooltip[]; 63 | constructor(); 64 | disconnectedCallback(): void; 65 | setProductTier(product: PotionItem, productTier: number): void; 66 | setPotionDescription(item: PotionItem, recipe: HerbloreRecipe): void; 67 | setSelected(skill: SkillWithMastery, recipe: ArtisanSkillRecipe): void; 68 | setProduct(item: PotionItem, qty: number): void; 69 | } 70 | -------------------------------------------------------------------------------- /src/gameTypes/characterSelectMenus.d.ts: -------------------------------------------------------------------------------- 1 | declare class CharacterDisplayElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | selectCharacterButton: HTMLButtonElement; 4 | gamemodeBackground: HTMLDivElement; 5 | gamemodeIcon: HTMLImageElement; 6 | saveType: HTMLHeadingElement; 7 | characterName: HTMLHeadingElement; 8 | totalSkillLevel: HTMLSpanElement; 9 | gpAmount: HTMLSpanElement; 10 | offlineActionImage: HTMLImageElement; 11 | offlineActionName: HTMLSpanElement; 12 | offlineActionTime: HTMLSpanElement; 13 | saveTimestamp: HTMLSpanElement; 14 | timestampComparison: HTMLHeadingElement; 15 | modProfileContainer: HTMLHeadingElement; 16 | modProfileIcon: HTMLElement; 17 | modProfileName: HTMLSpanElement; 18 | constructor(); 19 | connectedCallback(): void; 20 | toggleTestWarning(isTest: boolean): void; 21 | setLocalSave(slotID: number, localInfo: SaveGameHeader, cloudInfo?: SaveGameHeader, disableCallbacks?: boolean): void; 22 | setCloudSave(slotID: number, cloudInfo: SaveGameHeader, localInfo?: SaveGameHeader, disableCallbacks?: boolean): void; 23 | setDisabled(): void; 24 | disableCallbacks(): void; 25 | setCharacter(slotID: number, headerInfo: SaveGameHeader, isCloud: boolean, disableCallbacks?: boolean): void; 26 | updateTimestampComparison(viewedInfo: SaveGameHeader, comparedInfo?: SaveGameHeader): void; 27 | } 28 | declare class SaveSlotDisplayElement extends HTMLElement implements CustomElement { 29 | _content: DocumentFragment; 30 | slotTitle: HTMLHeadingElement; 31 | settingsButton: HTMLButtonElement; 32 | importSaveOption: HTMLAnchorElement; 33 | forceLoadOption: HTMLAnchorElement; 34 | settingsDivider: HTMLDivElement; 35 | createSaveLinkOption: HTMLAnchorElement; 36 | downloadSaveOption: HTMLAnchorElement; 37 | exportSaveOption: HTMLAnchorElement; 38 | deleteSettingsDivider: HTMLDivElement; 39 | deleteLocalOption: HTMLAnchorElement; 40 | deleteCloudOption: HTMLAnchorElement; 41 | emptySlotContainer: HTMLDivElement; 42 | emptySlotButton: HTMLButtonElement; 43 | emptySlotText: HTMLHeadingElement; 44 | existingCloudWarning: HTMLHeadingElement; 45 | saveLoadingSpinner: HTMLButtonElement; 46 | saveLoadingMessage: HTMLSpanElement; 47 | characterDisplay: CharacterDisplayElement; 48 | constructor(); 49 | connectedCallback(): void; 50 | setSlotID(slotID: number): void; 51 | showCloudSettings(forceLoad: boolean): void; 52 | showEmptySaveSettings(): void; 53 | showLocalSettings(forceLoad: boolean): void; 54 | setEmptyOutline(type: 'danger' | 'warning' | 'success'): void; 55 | setEmptyLocal(slotID: number, hasCloud: boolean): void; 56 | setEmptyCloud(slotID: number): void; 57 | setError(slotID: number, message: string, isCloud: boolean): void; 58 | setCloudSave(slotID: number, cloudInfo: SaveGameHeader, localInfo?: SaveGameHeader): void; 59 | setLocalSave(slotID: number, localInfo: SaveGameHeader, cloudInfo?: SaveGameHeader): void; 60 | setSaveLoading(): void; 61 | setDisabled(): void; 62 | setLoadingMessage(message: string): void; 63 | } 64 | declare class GamemodeSelectionElement extends HTMLElement implements CustomElement { 65 | _content: DocumentFragment; 66 | selectButton: HTMLButtonElement; 67 | backgroundDiv: HTMLDivElement; 68 | eventNotice: HTMLSpanElement; 69 | timeRemaining: HTMLSpanElement; 70 | name: HTMLHeadingElement; 71 | safety: HTMLHeadingElement; 72 | activeNotice: HTMLHeadingElement; 73 | description: HTMLHeadingElement; 74 | rulesContainer: HTMLUListElement; 75 | rules: HTMLLIElement[]; 76 | constructor(); 77 | connectedCallback(): void; 78 | setGamemode(gamemode: Gamemode): void; 79 | } 80 | -------------------------------------------------------------------------------- /src/gameTypes/ancientRelics.d.ts: -------------------------------------------------------------------------------- 1 | interface AncientRelicData extends IDData, IStatObjectData { 2 | name: string; 3 | skillID: string; 4 | number: number; 5 | } 6 | declare class AncientRelic extends NamespacedObject { 7 | get name(): string; 8 | _name: string; 9 | skill: AnySkill; 10 | number: number; 11 | stats: StatObject; 12 | constructor(namespace: DataNamespace, data: AncientRelicData, game: Game); 13 | } 14 | interface AncientRelicDropData { 15 | /** Ancient Relic that drops */ 16 | relicID: string; 17 | /** The quantity of the relic that drops (always 1, but adding for future proofing) */ 18 | quantity: number; 19 | /** Chance for the drop */ 20 | chance: RareSkillDropChance; 21 | /** Requirements for the drop, if any */ 22 | requirements: AnyRequirementData[]; 23 | } 24 | declare class AncientRelicDrop implements SoftDataDependant { 25 | /** The ancient relic that drops */ 26 | relic: AncientRelic; 27 | /** The quantity of the relic that drops */ 28 | quantity: number; 29 | /** The chance for the item to drop */ 30 | chance: RareSkillDropChance; 31 | /** The requirements for the relic to drop, if any */ 32 | requirements: AnyRequirement[]; 33 | constructor(data: AncientRelicDropData, game: Game, where: string); 34 | registerSoftDependencies(data: AncientRelicDropData, game: Game): void; 35 | } 36 | interface AncientRelicSetData { 37 | realmID: string; 38 | relicDrops: AncientRelicDropData[]; 39 | completedRelicID: string; 40 | levelUpUnlocks?: number[]; 41 | abyssalLevelUpUnlocks?: number[]; 42 | } 43 | declare class AncientRelicSet { 44 | realm: Realm; 45 | relicDrops: AncientRelicDrop[]; 46 | completedRelic: AncientRelic; 47 | /** Upon reaching these levels in a skill, a random relic drop from this set is unlocked */ 48 | levelUpUnlocks: number[]; 49 | /** Upon reaching these abyssal levels in a skill, a random relic drop from this set is unlocked */ 50 | abyssalLevelUpUnlocks: number[]; 51 | /** The relics that have been found in this set */ 52 | foundRelics: Map; 53 | /** The total number of relics that have been found in this set */ 54 | foundCount: number; 55 | get isComplete(): boolean; 56 | constructor(data: AncientRelicSetData, game: Game, where: string); 57 | isRelicFound(relic: AncientRelic): boolean; 58 | getFoundCount(relic: AncientRelic): number; 59 | addRelic(relic: AncientRelic, count?: number): void; 60 | } 61 | declare class AncientRelicElement extends HTMLElement implements CustomElement { 62 | _content: DocumentFragment; 63 | relicContainer: HTMLDivElement; 64 | relicName: HTMLDivElement; 65 | relicModifiers: HTMLDivElement; 66 | tooltip?: TippyTooltip; 67 | constructor(); 68 | connectedCallback(): void; 69 | setRelic(relic: AncientRelic): void; 70 | setHidden(): void; 71 | setUnlocked(): void; 72 | setLocked(): void; 73 | } 74 | declare class AncientRelicsMenuElement extends HTMLElement implements CustomElement { 75 | _content: DocumentFragment; 76 | skillDropdownButton: HTMLButtonElement; 77 | skillDropdownOptions: HTMLDivElement; 78 | realmSelect: RealmTabSelectElement; 79 | relicImage: HTMLImageElement; 80 | levelUnlockNotice: HTMLHeadingElement; 81 | relicsContainer: HTMLUListElement; 82 | completedRelic: AncientRelicElement; 83 | relics: AncientRelicElement[]; 84 | constructor(); 85 | connectedCallback(): void; 86 | init(game: Game): void; 87 | createDropdownItem(skill: AnySkill): HTMLAnchorElement; 88 | selectSkill(skill: AnySkill): void; 89 | showAncientRelicsFromSidebar(game: Game): void; 90 | showAncientRelics(skill: AnySkill, relicSet: AncientRelicSet): void; 91 | getSkillItem(skill: AnySkill): HTMLImageElement; 92 | } 93 | -------------------------------------------------------------------------------- /src/gameTypes/firemakingMenus.d.ts: -------------------------------------------------------------------------------- 1 | declare class FiremakingLogMenuElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | realmSelect: HTMLDivElement; 4 | expandButton: HTMLButtonElement; 5 | expandDiv: HTMLDivElement; 6 | realmContainer: HTMLUListElement; 7 | dropdownSelect: HTMLDivElement; 8 | logSelectButton: HTMLButtonElement; 9 | logOptionsContainer: HTMLDivElement; 10 | logQuantity: ItemCurrentIconElement; 11 | logName: HTMLSpanElement; 12 | preservation: PreservationIconElement; 13 | doubling: DoublingIconElement; 14 | mastery: MasteryDisplayElement; 15 | primaryProducts: HTMLDivElement; 16 | primaryIconContainer: HTMLDivElement; 17 | primaryHaves: HavesBoxElement; 18 | grants: GrantsBoxElement; 19 | burnButton: HTMLButtonElement; 20 | interval: IntervalIconElement; 21 | progressBar: ProgressBarElement; 22 | realmOptions: Map; 23 | recipeOptions: Map; 27 | primaryIcons: ItemChanceIconElement[]; 28 | constructor(); 29 | connectedCallback(): void; 30 | init(game: Game, firemaking: Firemaking): void; 31 | collapseOptions(): void; 32 | updateOptions(game: Game, firemaking: Firemaking): void; 33 | updateRealmUnlock(realm: Realm): void; 34 | setUnselected(): void; 35 | setLog(game: Game, firemaking: Firemaking, recipe: FiremakingLog): void; 36 | updateQuantities(game: Game): void; 37 | updateLogInfo(game: Game, firemaking: Firemaking, recipe: FiremakingLog): void; 38 | setProductIcons(container: HTMLDivElement, icons: ItemChanceIconElement[], products: Item[]): void; 39 | } 40 | declare class FiremakingBonfireMenuElement extends HTMLElement implements CustomElement { 41 | _content: DocumentFragment; 42 | bonfireImage: HTMLImageElement; 43 | statusText: HTMLSpanElement; 44 | statusState: HTMLSpanElement; 45 | standardXpBonus: HTMLDivElement; 46 | standardXpPercent: HTMLSpanElement; 47 | abyssalXpBonus: HTMLDivElement; 48 | abyssalXpPercent: HTMLSpanElement; 49 | lightButton: HTMLButtonElement; 50 | stopButton: HTMLButtonElement; 51 | interval: IntervalIconElement; 52 | progressBar: ProgressBarElement; 53 | constructor(); 54 | connectedCallback(): void; 55 | init(firemaking: Firemaking): void; 56 | updateInfo(firemaking: Firemaking, recipe?: FiremakingLog): void; 57 | setActive(): void; 58 | setInactive(): void; 59 | updateItemQuantity(game: Game, activeBonfire: FiremakingLog): void; 60 | toggleAbyssalState(isAbyssal: boolean): void; 61 | } 62 | declare class FiremakingOilMenuElement extends HTMLElement implements CustomElement { 63 | _content: DocumentFragment; 64 | oilSelectButton: HTMLButtonElement; 65 | oilOptionsContainer: HTMLDivElement; 66 | oilQuantity: ItemCurrentIconElement; 67 | oilName: HTMLSpanElement; 68 | oilInfo: HTMLSpanElement; 69 | oilButton: HTMLButtonElement; 70 | stopButton: HTMLButtonElement; 71 | interval: IntervalIconElement; 72 | recipeOptions: Map; 77 | progressBar: ProgressBarElement; 78 | constructor(); 79 | connectedCallback(): void; 80 | init(firemaking: Firemaking): void; 81 | updateInfo(firemaking: Firemaking, oil: FiremakingOilItem, cost: number): void; 82 | updateOptions(game: Game, firemaking: Firemaking): void; 83 | setUnselected(): void; 84 | setOil(game: Game, firemaking: Firemaking, oil: FiremakingOilItem): void; 85 | updateQuantities(game: Game): void; 86 | setActive(): void; 87 | setInactive(): void; 88 | } 89 | interface FiremakingMenu { 90 | logs: FiremakingLogMenuElement; 91 | bonfire: FiremakingBonfireMenuElement; 92 | oil: FiremakingOilMenuElement; 93 | } 94 | -------------------------------------------------------------------------------- /src/gameTypes/uiCallbacks.d.ts: -------------------------------------------------------------------------------- 1 | declare const equipStatKeys: EquipStatKey[]; 2 | /** Callback function for viewing the contents of an Openable item. Modal will not fire if item is not openable. */ 3 | declare function viewItemContents(item: OpenableItem): void; 4 | declare const enum DiffType { 5 | Negative = 0, 6 | Neutral = 1, 7 | Positive = 2 8 | } 9 | /** 10 | * Views the stats of an item, and the difference in stats if equipped to the specified set 11 | * @param item The item to show the stats of 12 | * @param compareToSet The equipment set to compare the stats of, if the item was equipped 13 | */ 14 | declare function viewItemStats(item: EquipmentItem, compareToSet?: Equipment | false): void; 15 | /** Views the stats of the player's currently equipped items */ 16 | declare function viewEquipmentStats(): void; 17 | /** Callback function for viewing the drops of a monster 18 | * @param monster The ID of the monster to view the drops of 19 | * @param respectArea Whether the drops should obey the type of combat area the player is currently in 20 | */ 21 | declare function viewMonsterDrops(monster: Monster, respectArea: boolean): void; 22 | declare const enum CombatMenuId { 23 | Equipment = 0, 24 | Spellbook = 1, 25 | Prayer = 2, 26 | Runes = 3, 27 | PlayerStats = 4, 28 | Slayer = 5, 29 | Summoning = 6, 30 | Corruption = 7, 31 | /** This provides the total number of menus, and should always be at the end */ 32 | Count = 8 33 | } 34 | /** Currently select combat menu */ 35 | declare let selectedCombatMenu: CombatMenuId; 36 | declare function changeCombatMenu(id: CombatMenuId): void; 37 | declare function togglePlayerContainer(): void; 38 | /** Callback function that changes the summoning category */ 39 | declare function switchSummoningCategory(category: SummoningCategory): void; 40 | /** Callback function that opens the summoning synergy breakdown menu */ 41 | declare function openSynergiesBreakdown(): void; 42 | /** Callback function that opens the browse corruptions menu */ 43 | declare function openBrowseCorruption(): void; 44 | declare let skillsMenu: boolean; 45 | declare let combatMenu: boolean; 46 | /** Callback function for hiding Combat/Non-Combat skills in the sidebar */ 47 | declare function toggleMenu(menu: 0 | 1): void; 48 | /** Callback function for hiding/showing the combat skill progress table */ 49 | declare function toggleCombatSkillMenu(): void; 50 | /** Callback function for viewing a game guide */ 51 | declare function viewGameGuide(): void; 52 | /** @deprecated Callback function for agreeing to a notice? */ 53 | declare function agreeToNotice(noticeID: number): void; 54 | declare function openLink(url: string): void; 55 | declare function openDiscordLink(): void; 56 | declare function openWikiLink(): void; 57 | declare function openExpansionSteamLink(): void; 58 | declare function openExpansion2SteamLink(): void; 59 | declare function openExpansion3SteamLink(): void; 60 | declare function openExpansionEpicLink(): void; 61 | declare function openExpansion2EpicLink(): void; 62 | declare function openExpansion3EpicLink(): void; 63 | declare function openExpandedEditionSteamLink(): void; 64 | declare function viewMonsterStats(monster: Monster): void; 65 | declare const changePage: (page: Page, subCategory?: number, skill?: AnySkill, showRaidShop?: boolean, toggleSidebar?: boolean) => void; 66 | /** Function for reading an lore entry */ 67 | declare function readLore(loreID: number): void; 68 | declare function toggleWikiLinkVisibility(): void; 69 | declare function getSummonMaxHitItemDescription(item: EquipmentItem): string; 70 | declare function setGameBackgroundImage(image: string): void; 71 | declare function filterItemsByAbyssalLevel(skill: AnySkill): string[]; 72 | /** Callback function for opening the skill tree modal */ 73 | declare function openSkillTreeModalFromSidebar(): void; 74 | declare function openCombatTriangleModal(): void; 75 | declare function openViewMonsterListModal(): void; 76 | declare function displayReportContentSwal(): void; 77 | -------------------------------------------------------------------------------- /src/gameTypes/fishingMenus.d.ts: -------------------------------------------------------------------------------- 1 | declare class FishingAreaMenuElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | areaBlock: HTMLDivElement; 4 | areaHeader: HTMLDivElement; 5 | areaName: HTMLSpanElement; 6 | areaEyecon: HTMLElement; 7 | fishChance: HTMLSpanElement; 8 | junkChance: HTMLSpanElement; 9 | specialChance: HTMLSpanElement; 10 | buttonContainer: HTMLDivElement; 11 | infoContainer: HTMLDivElement; 12 | fishButtons: FishingAreaMenuButtonElement[]; 13 | fishName: HTMLSpanElement; 14 | fishImage: HTMLImageElement; 15 | fishInfoContainer: HTMLDivElement; 16 | fishInterval: HTMLSpanElement; 17 | masteryDisplay: MasteryDisplayElement; 18 | startButton: HTMLButtonElement; 19 | statusSpinner: HTMLDivElement; 20 | statusText: HTMLSpanElement; 21 | xpIcon: XpIconElement; 22 | abyssalXPIcon: AbyssalXpIconElement; 23 | strXPIcon: SkillXpIconElement; 24 | masteryIcon: MasteryXpIconElement; 25 | masteryPoolIcon: MasteryPoolIconElement; 26 | constructor(); 27 | connectedCallback(): void; 28 | /** Sets the chances of the menu */ 29 | setChances(chance: FishingAreaChances, area: FishingArea): void; 30 | /** Intializes the menu with the provided fishing data. Also performs localization */ 31 | setAreaData(area: FishingArea): void; 32 | /** Updates the XP, Mastery XP, Mastery Pool XP */ 33 | updateGrants(xp: number, baseXP: number, masteryXP: number, baseMasteryXP: number, masteryPoolXP: number, strengthXP: number, baseStrengthXP: number, fish: Fish): void; 34 | /** Updates the XP, Mastery XP, Mastery Pool XP */ 35 | updateAbyssalGrants(xp: number, baseXP: number): void; 36 | hideAreaPanel(): void; 37 | showAreaPanel(): void; 38 | /** Sets the current fish information */ 39 | setSelectedFish(fish: Fish): void; 40 | /** Sets the area to an unselected state */ 41 | setUnselected(): void; 42 | /** Updates the current information on the selected fish */ 43 | updateSelectedFishRates(fish: Fish): void; 44 | updateButtons(area: FishingArea, fishing: Fishing): void; 45 | /** Turn the status spinner on and change the start button to stop */ 46 | setActionActive(): void; 47 | /** Turns the status spinner off and change the start button to start */ 48 | setActionInactive(): void; 49 | } 50 | declare class FishingAreaMenuButtonElement extends HTMLElement implements CustomElement { 51 | _content: DocumentFragment; 52 | link: HTMLAnchorElement; 53 | fishImage: HTMLImageElement; 54 | fishName: HTMLSpanElement; 55 | level: HTMLSpanElement; 56 | abyssalLevel: HTMLSpanElement; 57 | xpText: HTMLSpanElement; 58 | fishRatesCont: HTMLDivElement; 59 | intervalText: HTMLSpanElement; 60 | constructor(); 61 | connectedCallback(): void; 62 | setFishUnlocked(fish: Fish, area: FishingArea): void; 63 | updateRates(fish: Fish, fishing: Fishing): void; 64 | setFishLocked(fish: Fish, fishing: Fishing): void; 65 | } 66 | declare class FishingContestMenuElement extends HTMLElement implements CustomElement { 67 | _content: DocumentFragment; 68 | blockTitle: HTMLHeadingElement; 69 | btnStopContest: HTMLButtonElement; 70 | contestStatus: HTMLHeadingElement; 71 | requiredFish: HTMLSpanElement; 72 | bestFish: HTMLSpanElement; 73 | leaderboard: HTMLDivElement; 74 | remainingActions: HTMLSpanElement; 75 | difficultiesContainer: HTMLDivElement; 76 | chosenDifficulty: HTMLSpanElement; 77 | constructor(); 78 | connectedCallback(): void; 79 | setHeader(contest: FishingContest): void; 80 | setDifficulties(contest: FishingContest, difficulties: string[]): void; 81 | setDifficultyText(difficulty: string): void; 82 | updateBestFish(result: FishingContestResult): void; 83 | setActiveFish(activeFish: FishingContestFish): void; 84 | updateContestStatus(active: boolean): void; 85 | generateLeaderboard(contest: FishingContest, leaderboard: FishingContestLeaderboardEntry[]): void; 86 | updateLeaderboard(contest: FishingContest, leaderboard: FishingContestLeaderboardEntry[]): void; 87 | updateRemainingActions(remainingActions: number): void; 88 | } 89 | -------------------------------------------------------------------------------- /src/gameTypes/runecrafting.d.ts: -------------------------------------------------------------------------------- 1 | interface RunecraftingSkillData extends MasterySkillData { 2 | categories?: SkillCategoryData[]; 3 | subcategories?: SkillSubcategoryData[]; 4 | recipes?: RunecraftingRecipeData[]; 5 | elementalRuneIDs?: string[]; 6 | comboRuneIDs?: string[]; 7 | } 8 | interface RunecraftingModificationData extends MasterySkillModificationData { 9 | recipes?: RunecraftingRecipeModificationData[]; 10 | } 11 | declare type RunecraftingEvents = { 12 | action: RunecraftingActionEvent; 13 | } & SkillWithMasteryEvents; 14 | declare class Runecrafting extends ArtisanSkill implements SkillCategoryObject { 15 | readonly _media = Assets.Runecrafting; 16 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 17 | isMasteryActionUnlocked(action: RunecraftingRecipe): boolean; 18 | readonly baseInterval: number; 19 | get menu(): ArtisanMenuElement; 20 | selectionTabs: Map>; 21 | get categoryMenu(): RealmedCategoryMenuElement; 22 | renderQueue: ArtisanSkillRenderQueue; 23 | categories: NamespaceRegistry; 24 | subcategories: NamespaceRegistry; 25 | elementalRunes: AnyItem[]; 26 | comboRunes: AnyItem[]; 27 | get noCostsMessage(): string; 28 | get actionXP(): number; 29 | get actionAbyssalXP(): number; 30 | get actionItem(): AnyItem; 31 | get unmodifiedActionQuantity(): number; 32 | get activeRecipe(): RunecraftingRecipe; 33 | get masteryModifiedInterval(): number; 34 | get isMakingRunes(): boolean; 35 | constructor(namespace: DataNamespace, game: Game); 36 | registerData(namespace: DataNamespace, data: RunecraftingSkillData): void; 37 | modifyData(data: RunecraftingModificationData): void; 38 | postDataRegistration(): void; 39 | /** Determines if a recipe makes combo runes that use water runes as an ingredient */ 40 | doesRecipeMakeWaterComboRunes(recipe: RunecraftingRecipe): boolean; 41 | resetToDefaultSelectedRecipeBasedOnRealm(): void; 42 | updateRealmSelection(): void; 43 | getRecipeAutoSubcategory(recipe: RunecraftingRecipe): SkillSubcategory | undefined; 44 | getUncappedCostReduction(recipe?: RunecraftingRecipe, item?: AnyItem): number; 45 | _buildRuneItemCostReductionSources(action?: NamedObject): ModifierSourceBuilder; 46 | getRuneItemCostReductionSources(action?: NamedObject): HTMLSpanElement[]; 47 | getCostReductionSources(action?: NamedObject): HTMLSpanElement[]; 48 | getActionModifierQueryParams(action?: NamedObject): SkillModifierQueryParams; 49 | onMasteryLevelUp(action: RunecraftingRecipe, oldLevel: number, newLevel: number): void; 50 | checkMasteryLevelBonusFilter(action: RunecraftingRecipe, filter: string): boolean; 51 | recordCostPreservationStats(costs: Costs): void; 52 | recordCostConsumptionStats(costs: Costs): void; 53 | preAction(): void; 54 | get actionRewards(): Rewards; 55 | postAction(): void; 56 | getActionIDFromOldID(oldActionID: number, idMap: NumericIDMap): string; 57 | setFromOldOffline(offline: OfflineSkill, idMap: NumericIDMap): void; 58 | testTranslations(): void; 59 | getObtainableItems(): Set; 60 | getRegistry(type: ScopeSourceType): NamespaceRegistry | undefined; 61 | getPkgObjects(pkg: GameDataPackage, type: ScopeSourceType): IDData[] | undefined; 62 | } 63 | interface RunecraftingRecipeData extends SingleProductArtisanSkillRecipeData { 64 | subcategories?: string[]; 65 | } 66 | interface RunecraftingRecipeModificationData extends SingleProductArtisanSkillRecipeModificationData { 67 | subcategories?: { 68 | add?: string[]; 69 | remove?: string[]; 70 | }; 71 | } 72 | declare class RunecraftingRecipe extends SingleProductArtisanSkillRecipe { 73 | subcategories: SkillSubcategory[]; 74 | constructor(namespace: DataNamespace, data: RunecraftingRecipeData, game: Game, skill: Runecrafting); 75 | applyDataModification(data: RunecraftingRecipeModificationData, game: Game): void; 76 | } 77 | -------------------------------------------------------------------------------- /src/gameTypes/corruption.d.ts: -------------------------------------------------------------------------------- 1 | interface CorruptionEffectTableData { 2 | /** The ID of the effect to apply */ 3 | effectID: string; 4 | /** Optional. Determines if this effect starts unlocked. Defaults to false. */ 5 | startsUnlocked?: boolean; 6 | /** The minimum Combat Level a monster must have to roll this as a new effect */ 7 | minMonsterLevel: number; 8 | /** The custom description of the effect */ 9 | customDescription: string; 10 | /** The lang ID of the custom description of the effect */ 11 | langStringID?: string; 12 | } 13 | interface CorruptionEffectTableRow { 14 | effect: CombatEffect; 15 | startsUnlocked: boolean; 16 | isUnlocked: boolean; 17 | minMonsterLevel: number; 18 | customDescription: string; 19 | langStringID: string; 20 | } 21 | declare class CorruptionEffectTable implements EncodableObject { 22 | game: Game; 23 | corruption: Corruption; 24 | allRows: CorruptionEffectTableRow[]; 25 | unlockedRows: CorruptionEffectTableRow[]; 26 | lockedRows: CorruptionEffectTableRow[]; 27 | selectedUnlockRows: Map; 28 | effectRemovalHandler: (e: CharacterEffectRemovedEvent) => void; 29 | readonly NEW_EFFECT_CHANCE = 0.2; 30 | get allEffectRows(): CorruptionEffectTableRow[]; 31 | /** Gets the number of corruptions the player has unlocked */ 32 | get numberUnlocked(): number; 33 | constructor(game: Game, corruption: Corruption); 34 | /** Gets a number of unique effect applicators */ 35 | getApplicators(count: number, monsterLevel?: number): SingleCombatEffectApplicator[]; 36 | unlockRow(row: CorruptionEffectTableRow): void; 37 | onEffectRemoval(e: CharacterEffectRemovedEvent): void; 38 | registerRows(data: CorruptionEffectTableData[]): void; 39 | onLoad(): void; 40 | encode(writer: SaveWriter): SaveWriter; 41 | decode(reader: SaveWriter, version: number): void; 42 | } 43 | interface CorruptionSkillData extends BaseSkillData { 44 | /** Defines the effect applicator for the enemy applying corruption to themselves */ 45 | enemyApplicator?: TriggeredCombatEffectApplicatorData; 46 | /** Defines the effect applicator for the player applying corruption to themselves */ 47 | playerApplicator?: TriggeredCombatEffectApplicatorData; 48 | corruptionEffects?: CorruptionEffectTableData[]; 49 | } 50 | interface CorruptionModificationData extends BaseSkillModificationData { 51 | } 52 | declare class Corruption extends CombatSkill { 53 | readonly _media = "assets/media/skills/corruption/corruption.png"; 54 | renderQueue: SkillRenderQueue; 55 | corruptionEffects: CorruptionEffectTable; 56 | enemyApplicator?: CombatEffectApplicator; 57 | playerApplicator?: CombatEffectApplicator; 58 | get maxLevelCap(): number; 59 | constructor(namespace: DataNamespace, game: Game); 60 | registerData(namespace: DataNamespace, data: CorruptionSkillData): void; 61 | modifyData(data: CorruptionModificationData): void; 62 | postDataRegistration(): void; 63 | addProvidedStats(): void; 64 | incStat(stat: CorruptionStats): void; 65 | onLoad(): void; 66 | onUnlock(): void; 67 | encode(writer: SaveWriter): SaveWriter; 68 | decode(reader: SaveWriter, version: number): void; 69 | shouldShowSkillInSidebar(): boolean; 70 | } 71 | /** Menu for browsing corruptions */ 72 | declare class CorruptionMenuElement extends HTMLElement implements CustomElement { 73 | _content: DocumentFragment; 74 | corruptionElements: Map; 75 | constructor(); 76 | connectedCallback(): void; 77 | updateUnlockedStatus(): void; 78 | } 79 | declare class CorruptionElementElement extends HTMLElement implements CustomElement { 80 | _content: DocumentFragment; 81 | description: HTMLSpanElement; 82 | img: HTMLImageElement; 83 | unlocked: HTMLSpanElement; 84 | locked: HTMLSpanElement; 85 | unlockReqs: HTMLSpanElement; 86 | constructor(); 87 | connectedCallback(): void; 88 | /** Initializes the display */ 89 | initialize(corruptionEffect: CorruptionEffectTableRow): void; 90 | setLocked(): void; 91 | setUnlocked(): void; 92 | } 93 | -------------------------------------------------------------------------------- /src/gameTypes/enemy.d.ts: -------------------------------------------------------------------------------- 1 | declare class Enemy extends Character implements IGameEventEmitter { 2 | manager: BaseManager; 3 | game: Game; 4 | _events: import("mitt").Emitter; 5 | on: { 6 | (type: Key, handler: import("mitt").Handler): void; 7 | (type: "*", handler: import("mitt").WildcardHandler): void; 8 | }; 9 | off: { 10 | (type: Key, handler?: import("mitt").Handler | undefined): void; 11 | (type: "*", handler: import("mitt").WildcardHandler): void; 12 | }; 13 | get type(): string; 14 | state: EnemyState; 15 | modifiers: CharacterModifierTable; 16 | spellSelection: SpellSelection; 17 | stats: CharacterCombatStats; 18 | get statElements(): EnemyRenderHTMLElements; 19 | get splashManager(): SplashManager; 20 | get effectRenderer(): EffectRenderer; 21 | get attackBar(): ProgressBarElement; 22 | get attackBarMinibar(): ProgressBarElement; 23 | renderQueue: EnemyRenderQueue; 24 | randomAttackType: AttackType | 'unset'; 25 | monster?: Monster; 26 | overrideDamageType?: DamageType; 27 | /** Flag for if the monster property should be encoded */ 28 | get encodeMonster(): boolean; 29 | constructor(manager: BaseManager, game: Game); 30 | /** Sets a new monster to this enemy, preparing it for spawning */ 31 | setNewMonster(monster: Monster): void; 32 | computeAttackType(): void; 33 | computeDamageType(): void; 34 | computeAttackSelection(): void; 35 | mergeInheritedEffectApplicators(): void; 36 | mergeUninheritedEffectApplicators(): void; 37 | computeLevels(): void; 38 | computeAbyssalLevels(): void; 39 | computeEquipmentStats(): void; 40 | computeModifiers(): void; 41 | addPassiveModifiers(): void; 42 | addGamemodeModifiers(): void; 43 | /** Adds the enemy modifiers from stat providers */ 44 | addProviderModifiers(): void; 45 | /** Adds the enemy modifiers from player attack styles */ 46 | addPlayerAttackStyleModifiers(): void; 47 | /** Adds the enemy modifiers from the player's equipment */ 48 | addPlayerEquipmentModifiers(): void; 49 | /** Adds the enemy modifiers from the player's food */ 50 | addPlayerFoodModifiers(): void; 51 | addPlayerPrayerModifiers(): void; 52 | addPlayerAuroraModifiers(): void; 53 | /** Adds all conditional modifiers that are active */ 54 | addConditionalModifiers(): void; 55 | getAccuracyValues(): { 56 | effectiveLevel: number; 57 | bonus: number; 58 | }; 59 | getFlatReflectDamage(): number; 60 | damage(amount: number, source: SplashType): void; 61 | processDeath(): void; 62 | regen(): void; 63 | /** Sets the enemy to render as spawning */ 64 | setSpawning(): void; 65 | setRenderAll(): void; 66 | initializeForCombat(): void; 67 | render(): void; 68 | /** Updates all barrier numbers and bars */ 69 | renderBarrier(): void; 70 | renderHitchance(): void; 71 | renderHitpoints(): void; 72 | renderPassives(): void; 73 | renderAttacks(): void; 74 | renderDamageValues(): void; 75 | renderNormalDamage(minHit: string, maxHit: string): void; 76 | renderLevels(): void; 77 | renderImageAndName(): void; 78 | renderStats(): void; 79 | renderNoStats(): void; 80 | resetActionState(): void; 81 | encode(writer: SaveWriter): SaveWriter; 82 | setStatsFromMonster(monster: Monster): void; 83 | decode(reader: SaveWriter, version: number): void; 84 | deserialize(reader: DataReader, version: number, idMap: NumericIDMap): void; 85 | postAttack(): void; 86 | onHit(): void; 87 | onMiss(): void; 88 | } 89 | interface EnemyRenderHTMLElements extends RenderHTMLElements { 90 | image: HTMLDivElement; 91 | name: HTMLElement[]; 92 | attackType: HTMLImageElement[]; 93 | } 94 | declare enum EnemyState { 95 | Dead = 0, 96 | Alive = 1, 97 | Spawning = 2 98 | } 99 | declare class EnemyRenderQueue extends CharacterRenderQueue { 100 | image: boolean; 101 | levels: boolean; 102 | } 103 | -------------------------------------------------------------------------------- /src/gameTypes/clueHunt.d.ts: -------------------------------------------------------------------------------- 1 | declare class ClueHunt { 2 | ifYouAreReadingThisCodeThenYouAreRuiningTheFunForEveryoneAndYouShouldBeAshamedOfYourself: boolean; 3 | clueProgress: ({ 4 | id: string; 5 | progress: number; 6 | required: number; 7 | complete: boolean; 8 | rewardItemID: string; 9 | monsterID?: undefined; 10 | equippedFoodItemId?: undefined; 11 | prayerID?: undefined; 12 | equippedItems?: undefined; 13 | skillIDs?: undefined; 14 | obstacleIDs?: undefined; 15 | monsterIDs?: undefined; 16 | constellationIDs?: undefined; 17 | dungeonIDs?: undefined; 18 | runecraftingIDs?: undefined; 19 | } | { 20 | progress: number; 21 | required: number; 22 | complete: boolean; 23 | rewardItemID: string; 24 | id?: undefined; 25 | monsterID?: undefined; 26 | equippedFoodItemId?: undefined; 27 | prayerID?: undefined; 28 | equippedItems?: undefined; 29 | skillIDs?: undefined; 30 | obstacleIDs?: undefined; 31 | monsterIDs?: undefined; 32 | constellationIDs?: undefined; 33 | dungeonIDs?: undefined; 34 | runecraftingIDs?: undefined; 35 | } | { 36 | progress: number; 37 | required: number; 38 | monsterID: string; 39 | equippedFoodItemId: string; 40 | complete: boolean; 41 | rewardItemID: string; 42 | id?: undefined; 43 | prayerID?: undefined; 44 | equippedItems?: undefined; 45 | skillIDs?: undefined; 46 | obstacleIDs?: undefined; 47 | monsterIDs?: undefined; 48 | constellationIDs?: undefined; 49 | dungeonIDs?: undefined; 50 | runecraftingIDs?: undefined; 51 | } | { 52 | progress: number; 53 | required: number; 54 | monsterID: string; 55 | prayerID: string; 56 | equippedItems: string[]; 57 | complete: boolean; 58 | rewardItemID: string; 59 | id?: undefined; 60 | equippedFoodItemId?: undefined; 61 | skillIDs?: undefined; 62 | obstacleIDs?: undefined; 63 | monsterIDs?: undefined; 64 | constellationIDs?: undefined; 65 | dungeonIDs?: undefined; 66 | runecraftingIDs?: undefined; 67 | } | { 68 | progress: number; 69 | required: number; 70 | skillIDs: string[]; 71 | obstacleIDs: string[]; 72 | complete: boolean; 73 | rewardItemID: string; 74 | id?: undefined; 75 | monsterID?: undefined; 76 | equippedFoodItemId?: undefined; 77 | prayerID?: undefined; 78 | equippedItems?: undefined; 79 | monsterIDs?: undefined; 80 | constellationIDs?: undefined; 81 | dungeonIDs?: undefined; 82 | runecraftingIDs?: undefined; 83 | } | { 84 | progress: number; 85 | required: number; 86 | monsterIDs: string[]; 87 | constellationIDs: string[]; 88 | dungeonIDs: string[]; 89 | runecraftingIDs: string[]; 90 | complete: boolean; 91 | rewardItemID: string; 92 | id?: undefined; 93 | monsterID?: undefined; 94 | equippedFoodItemId?: undefined; 95 | prayerID?: undefined; 96 | equippedItems?: undefined; 97 | skillIDs?: undefined; 98 | obstacleIDs?: undefined; 99 | })[]; 100 | currentStep: number; 101 | constructor(); 102 | encode(writer: SaveWriter): SaveWriter; 103 | decode(reader: SaveWriter, version: number): void; 104 | onLoad(): void; 105 | startClueHunt(): void; 106 | clueCompletedSwal(): void; 107 | clueHuntCompletedSwal(): void; 108 | updateClueEventHandlers(): void; 109 | giveReward(id: number): void; 110 | updateClue1Progress: (event: GameEvent) => void; 111 | updateClue2Progress: (event: GameEvent) => void; 112 | updateClue3Progress: (event: MonsterKilledEvent) => void; 113 | updateClue4Progress: (event: MonsterKilledEvent) => void; 114 | updateClue5Progress: (event: GameEvent) => void; 115 | resetClue6(): void; 116 | updateClue6Progress: (event: GameEvent) => void; 117 | render(): void; 118 | renderArtwork(): void; 119 | } 120 | -------------------------------------------------------------------------------- /src/gameTypes/fletching.d.ts: -------------------------------------------------------------------------------- 1 | interface FletchingSkillData extends MasterySkillData { 2 | categories?: SkillCategoryData[]; 3 | subcategories?: SkillSubcategoryData[]; 4 | recipes?: FletchingRecipeData[]; 5 | } 6 | interface FletchingModificationData extends MasterySkillModificationData { 7 | recipes?: FletchingRecipeModificationData[]; 8 | } 9 | declare type FletchingEvents = { 10 | action: FletchingActionEvent; 11 | } & SkillWithMasteryEvents; 12 | declare class Fletching extends ArtisanSkill implements SkillCategoryObject { 13 | readonly _media = Assets.Fletching; 14 | get levelCompletionBreakdown(): LevelCompletionBreakdown[]; 15 | isMasteryActionUnlocked(action: FletchingRecipe): boolean; 16 | readonly baseInterval: number; 17 | get menu(): ArtisanMenuElement; 18 | selectionTabs: Map>; 19 | get categoryMenu(): RealmedCategoryMenuElement; 20 | renderQueue: ArtisanSkillRenderQueue; 21 | categories: NamespaceRegistry; 22 | subcategories: NamespaceRegistry; 23 | get noCostsMessage(): string; 24 | get actionItem(): AnyItem; 25 | get unmodifiedActionQuantity(): number; 26 | get activeRecipe(): FletchingRecipe; 27 | get masteryModifiedInterval(): number; 28 | /** Gets the set alt. recipe index for the currently selected recipe */ 29 | get selectedAltRecipe(): number; 30 | /** Stores the associated alt. recipe index for a recipe */ 31 | setAltRecipes: Map; 32 | constructor(namespace: DataNamespace, game: Game); 33 | registerData(namespace: DataNamespace, data: FletchingSkillData): void; 34 | modifyData(data: FletchingModificationData): void; 35 | postDataRegistration(): void; 36 | resetToDefaultSelectedRecipeBasedOnRealm(): void; 37 | updateRealmSelection(): void; 38 | getRecipeAutoSubcategory(recipe: FletchingRecipe): SkillSubcategory | undefined; 39 | getActionModifierQueryParams(action?: NamedObject): SkillModifierQueryParams; 40 | getRecipeCosts(recipe: FletchingRecipe): Costs; 41 | /** Callback function for selecting an alternative recipe */ 42 | selectAltRecipeOnClick(altID: number): void; 43 | renderSelectedRecipe(): void; 44 | onMasteryLevelUp(action: FletchingRecipe, oldLevel: number, newLevel: number): void; 45 | recordCostPreservationStats(costs: Costs): void; 46 | recordCostConsumptionStats(costs: Costs): void; 47 | preAction(): void; 48 | get actionRewards(): Rewards; 49 | postAction(): void; 50 | getErrorLog(): string; 51 | getRegistry(type: ScopeSourceType): NamespaceRegistry | undefined; 52 | getPkgObjects(pkg: GameDataPackage, type: ScopeSourceType): IDData[] | undefined; 53 | encode(writer: SaveWriter): SaveWriter; 54 | decode(reader: SaveWriter, version: number): void; 55 | deserialize(reader: DataReader, version: number, idMap: NumericIDMap): void; 56 | getActionIDFromOldID(oldActionID: number, idMap: NumericIDMap): string; 57 | setFromOldOffline(offline: OfflineTuple, idMap: NumericIDMap): void; 58 | testTranslations(): void; 59 | getObtainableItems(): Set; 60 | } 61 | interface FletchingRecipeData extends SingleProductArtisanSkillRecipeData { 62 | /** Optional. Specifies a manually defined subcategory this recipe belongs to */ 63 | subcategoryID?: string; 64 | alternativeCosts?: { 65 | itemCosts: IDQuantity[]; 66 | quantityMultiplier: number; 67 | }[]; 68 | } 69 | interface FletchingRecipeModificationData extends SingleProductArtisanSkillRecipeModificationData { 70 | subcategoryID?: string; 71 | alternativeCosts?: { 72 | itemCosts: IDQuantity[]; 73 | quantityMultiplier: number; 74 | }[]; 75 | } 76 | declare class FletchingRecipe extends SingleProductArtisanSkillRecipe { 77 | subcategory?: SkillSubcategory; 78 | alternativeCosts?: { 79 | itemCosts: AnyItemQuantity[]; 80 | quantityMultiplier: number; 81 | }[]; 82 | constructor(namespace: DataNamespace, data: FletchingRecipeData, game: Game, skill: Fletching); 83 | applyDataModification(data: FletchingRecipeModificationData, game: Game): void; 84 | } 85 | -------------------------------------------------------------------------------- /src/gameTypes/skillTree.d.ts: -------------------------------------------------------------------------------- 1 | interface SkillTreeData extends IDData { 2 | name: string; 3 | nameLang?: string; 4 | media: string; 5 | unlockRequirements: AnyRequirementData[]; 6 | nodes: SkillTreeNodeData[]; 7 | } 8 | interface SkillTreeNodeCostsData extends FixedCostsData { 9 | /** Optional. Specifies the skill tree points required to purchase the node */ 10 | points?: number; 11 | } 12 | declare class SkillTreeNodeCosts extends FixedCosts { 13 | /** The number of skill tree points required to purchase the node */ 14 | points: number; 15 | constructor(data: SkillTreeNodeCostsData, game: Game); 16 | } 17 | interface SkillTreeNodeData extends IDData, IStatObjectData { 18 | name: string; 19 | costs: SkillTreeNodeCostsData; 20 | /** The IDs of the nodes which are parents to this one. If not defined, this is considered a root node of the tree. */ 21 | parents?: string[]; 22 | requirements?: AnyRequirementData[]; 23 | } 24 | declare class SkillTreeNode extends NamespacedObject implements SoftDataDependant { 25 | tree: SkillTree; 26 | game: Game; 27 | /** The name of this node as it shows in modifier sources */ 28 | get name(): string; 29 | get shortName(): string; 30 | /** Returns if this node can be unlocked */ 31 | get canUnlock(): boolean; 32 | get parentsUnlocked(): boolean; 33 | get requirementsMet(): boolean; 34 | _name: string; 35 | /** Returns if this is a root node of the tree */ 36 | get isRoot(): boolean; 37 | /** The parents of this node */ 38 | parents?: SkillTreeNode[]; 39 | /** The child nodes of this node */ 40 | children: SkillTreeNode[]; 41 | requirements: AnyRequirement[]; 42 | costs: SkillTreeNodeCosts; 43 | stats: StatObject; 44 | /** Save state property. If the node has been unlocked. */ 45 | isUnlocked: boolean; 46 | constructor(namespace: DataNamespace, data: SkillTreeNodeData, tree: SkillTree, game: Game); 47 | registerSoftDependencies(data: SkillTreeNodeData, game: Game): void; 48 | } 49 | declare class SkillTreeNodeUnlockedEvent extends GameEvent { 50 | tree: SkillTree; 51 | node: SkillTreeNode; 52 | constructor(tree: SkillTree, node: SkillTreeNode); 53 | } 54 | declare type SkillTreeEvents = { 55 | pointsChanged: GameEvent; 56 | nodeUnlocked: SkillTreeNodeUnlockedEvent; 57 | }; 58 | declare class SkillTree extends NamespacedObject implements EncodableObject, IGameEventEmitter { 59 | game: Game; 60 | skill: AnySkill; 61 | _events: import("mitt").Emitter; 62 | on: { 63 | (type: Key, handler: import("mitt").Handler): void; 64 | (type: "*", handler: import("mitt").WildcardHandler): void; 65 | }; 66 | off: { 67 | (type: Key, handler?: import("mitt").Handler | undefined): void; 68 | (type: "*", handler: import("mitt").WildcardHandler): void; 69 | }; 70 | get media(): string; 71 | get name(): string; 72 | get points(): number; 73 | _name: string; 74 | _nameLang?: string; 75 | _media: string; 76 | unlockRequirements: AnyRequirement[]; 77 | nodes: NamespaceRegistry; 78 | root: SkillTreeNode[]; 79 | /** List of nodes that have been unlocked */ 80 | unlockedNodes: SkillTreeNode[]; 81 | /** Save property. How many skill points are available to spend. */ 82 | _points: number; 83 | constructor(namespace: DataNamespace, data: SkillTreeData, game: Game, skill: AnySkill); 84 | registerSoftDependencies(data: SkillTreeData, game: Game): void; 85 | encode(writer: SaveWriter): SaveWriter; 86 | decode(reader: SaveWriter, version: number): void; 87 | /** Called for each skill tree on save load. */ 88 | onLoad(): void; 89 | getNodeCosts(node: SkillTreeNode): Costs; 90 | canAffordNode(node: SkillTreeNode): boolean; 91 | canAffordAnyNode(): boolean; 92 | onNodeIconClick(node: SkillTreeNode): Promise; 93 | unlockNode(node: SkillTreeNode): void; 94 | onNodeUnlocked(node: SkillTreeNode): void; 95 | addPoints(amount: number): void; 96 | /** Gets the total amount of points spent in this tree */ 97 | getTotalPointsSpent(): number; 98 | } 99 | declare class DummySkillTree extends SkillTree { 100 | constructor(namespace: DataNamespace, localID: string, game: Game); 101 | } 102 | -------------------------------------------------------------------------------- /src/gameTypes/prayer.d.ts: -------------------------------------------------------------------------------- 1 | interface PrayerData extends RealmedObjectData, IStatObjectData { 2 | level: number; 3 | name: string; 4 | media: string; 5 | pointsPerPlayer: number; 6 | pointsPerEnemy: number; 7 | pointsPerRegen: number; 8 | /** Optional. Flags this prayer as Unholy, augmenting it from default mechanics. Defaults to false. */ 9 | isUnholy?: boolean; 10 | /** Optional. Flags this prayer as using Soul Points instead of Prayer Points. Defaults to false. */ 11 | useSoulPoints?: boolean; 12 | /** Optional. The Prayer Abyssal Level required to unlock. */ 13 | abyssalLevel?: number; 14 | /** Optional. Flags this prayer as Abyssal. Defaults to false. */ 15 | isAbyssal?: boolean; 16 | /** Optional. The IDs of the DamageTypes this prayer is allowed to be used with. */ 17 | allowedDamageTypeIDs?: string[]; 18 | } 19 | declare class ActivePrayer extends RealmedObject { 20 | level: number; 21 | _abyssalLevel?: number; 22 | get abyssalLevel(): number; 23 | get media(): string; 24 | pointsPerPlayer: number; 25 | pointsPerEnemy: number; 26 | pointsPerRegen: number; 27 | stats: StatObject; 28 | _media: string; 29 | _name: string; 30 | get name(): string; 31 | /** Flags this prayer as Unholy. */ 32 | isUnholy: boolean; 33 | /** Flags this prayer as Abyssal. */ 34 | isAbyssal: boolean; 35 | /** Flags this prayer to use Soul Points instead of Prayer Points. */ 36 | useSoulPoints: boolean; 37 | allowedDamageTypes: Set; 38 | constructor(namespace: DataNamespace, data: PrayerData, game: Game); 39 | canUseWithDamageType(damageType: DamageType): boolean; 40 | } 41 | interface PrayerMenuElement extends CombatMenuElement { 42 | newDiv: HTMLDivElement; 43 | } 44 | declare class LockedPrayerTooltipElement extends HTMLElement implements CustomElement { 45 | _content: DocumentFragment; 46 | level: HTMLSpanElement; 47 | abyssalLevel: HTMLSpanElement; 48 | constructor(); 49 | connectedCallback(): void; 50 | setPrayer(prayer: ActivePrayer): void; 51 | } 52 | declare class PrayerTooltipElement extends HTMLElement implements CustomElement { 53 | _content: DocumentFragment; 54 | prayerName: HTMLSpanElement; 55 | unholyScaling: HTMLElement; 56 | stats: HTMLElement; 57 | xpInfo: HTMLElement; 58 | playerPoints: HTMLElement; 59 | enemyPoints: HTMLElement; 60 | regenPoints: HTMLElement; 61 | constructor(); 62 | connectedCallback(): void; 63 | setPrayer(prayer: ActivePrayer): void; 64 | } 65 | declare class PrayerButtonElement extends HTMLElement implements CustomElement { 66 | _content: DocumentFragment; 67 | link: HTMLAnchorElement; 68 | prayerImage: HTMLImageElement; 69 | tooltip?: TippyTooltip; 70 | constructor(); 71 | connectedCallback(): void; 72 | disconnectedCallback(): void; 73 | setUnlocked(prayer: ActivePrayer, player: Player): void; 74 | setLocked(prayer: ActivePrayer): void; 75 | highlight(): void; 76 | unhighlight(): void; 77 | } 78 | declare class PrayerBookMenuElement extends HTMLElement implements CustomElement { 79 | _content: DocumentFragment; 80 | bookButtons: HTMLDivElement; 81 | standardButton: HTMLButtonElement; 82 | unholyButton: HTMLButtonElement; 83 | abyssalButton: HTMLButtonElement; 84 | standardContainer: HTMLDivElement; 85 | standardAnchor: HTMLSpanElement; 86 | unholyContainer: HTMLDivElement; 87 | unholyAnchor: HTMLSpanElement; 88 | abyssalContainer: HTMLDivElement; 89 | abyssalAnchor: HTMLSpanElement; 90 | buttonTooltips: TippyTooltip[]; 91 | prayerButtons: Map; 92 | activeButtons: PrayerButtonElement[]; 93 | visibleContainer: HTMLDivElement; 94 | highlightedButton: HTMLButtonElement; 95 | constructor(); 96 | connectedCallback(): void; 97 | disconnectedCallback(): void; 98 | init(game: Game): void; 99 | updateForLevel(player: Player, level: number, abyssalLevel: number): void; 100 | setActiveButtons(active: Set): void; 101 | addButtonTooltip(button: HTMLButtonElement, text: string): void; 102 | createPrayerButton(prayer: ActivePrayer, anchor: HTMLElement): void; 103 | selectContainer(container: HTMLDivElement): void; 104 | highlightButton(button: HTMLButtonElement): void; 105 | } 106 | declare type CombatMenuElement = { 107 | tooltip: TippyTooltip; 108 | image: HTMLImageElement; 109 | button: HTMLAnchorElement; 110 | }; 111 | -------------------------------------------------------------------------------- /src/gameTypes/realms.d.ts: -------------------------------------------------------------------------------- 1 | interface RealmData extends IDData { 2 | name: string; 3 | media: string; 4 | unlockRequirements: AnyRequirementData[]; 5 | showIfLocked?: boolean; 6 | ignoreCompletion?: boolean; 7 | sidebarClass?: string; 8 | realmClass?: string; 9 | } 10 | declare class Realm extends NamespacedObject { 11 | get name(): string; 12 | get media(): string; 13 | _media: string; 14 | _name: string; 15 | unlockRequirements: AnyRequirement[]; 16 | showIfLocked: boolean; 17 | ignoreCompletion: boolean; 18 | modQuery: ModifierQuery; 19 | sidebarClass?: string; 20 | realmClass: string; 21 | constructor(namespace: DataNamespace, data: RealmData, game: Game); 22 | registerSoftDependencies(data: RealmData, game: Game): void; 23 | get isUnlocked(): boolean; 24 | } 25 | declare class RealmManager { 26 | game: Game; 27 | readonly unlockUnlisteners: Map; 28 | currentSidebarRealm?: Realm; 29 | constructor(game: Game); 30 | onLoad(): void; 31 | assignUnlockListeners(): void; 32 | onRealmRequirementMet(realm: Realm): void; 33 | queueRealmUnlockedModal(realm: Realm): void; 34 | queueRealmUnlockRenders(realm: Realm): void; 35 | showRealmUnlockRequirementsModal(realm: Realm): void; 36 | setSidebarTheme(realm: Realm): void; 37 | removeSidebarTheme(): void; 38 | } 39 | interface RealmedObjectData extends IDData { 40 | /** Optional. The ID of the realm the object belongs to. Defaults to melvorD:Melvor */ 41 | realm?: string; 42 | } 43 | /** Base class for namespaced objects that belong to a particular realm */ 44 | declare class RealmedObject extends NamespacedObject { 45 | /** The realm this object belongs to */ 46 | realm: Realm; 47 | constructor(namespace: DataNamespace, data: RealmedObjectData, game: Game); 48 | } 49 | interface NamedRealmedObject extends RealmedObject { 50 | name: string; 51 | } 52 | declare class RealmSelectOptionElement extends HTMLElement implements CustomElement { 53 | _content: DocumentFragment; 54 | listItem: HTMLLIElement; 55 | link: HTMLAnchorElement; 56 | realmImage: HTMLImageElement; 57 | span: HTMLSpanElement; 58 | realmName: HTMLSpanElement; 59 | lockIcon: HTMLElement; 60 | submenu: HTMLUListElement; 61 | tooltip?: TippyTooltip; 62 | hasSubmenu: boolean; 63 | realm: Realm; 64 | constructor(); 65 | connectedCallback(): void; 66 | disconnectedCallback(): void; 67 | setRealm(realm: Realm): void; 68 | setLocked(): void; 69 | setUnlocked(): void; 70 | setSelected(): void; 71 | setUnselected(): void; 72 | currentCallback?: VoidFunction; 73 | setCallback(callback: VoidFunction): void; 74 | setAsSubMenu(): void; 75 | addSubOption(option: HTMLElement): void; 76 | enableSubmenuScrolling(maxHeight: number): void; 77 | enableSubmenu(): void; 78 | disableSubmenu(): void; 79 | addSubmenuFix(): void; 80 | } 81 | declare class RealmSelectMenuElement extends HTMLElement implements CustomElement { 82 | _content: DocumentFragment; 83 | expandBtn: HTMLButtonElement; 84 | expanded: HTMLDivElement; 85 | realmContainer: HTMLUListElement; 86 | realmOptions: Map; 87 | realmSidebarOptions: Map; 88 | constructor(); 89 | connectedCallback(): void; 90 | /** Populates the menu */ 91 | init(skill: AnySkill): void; 92 | updateRealmVisibility(realm: Realm): void; 93 | static initializeForSkill(skill: AnySkill): void; 94 | } 95 | declare class RealmTabSelectElement extends HTMLElement implements CustomElement { 96 | _content: DocumentFragment; 97 | optionsContainer: HTMLUListElement; 98 | options: RealmSelectOptionElement[]; 99 | optionsMap: Map; 100 | selectedOption?: RealmSelectOptionElement; 101 | constructor(); 102 | connectedCallback(): void; 103 | setOptions(realms: Realm[], callback: (realm: Realm) => void, highlightSelected?: boolean): void; 104 | updateRealmUnlock(realm: Realm): void; 105 | setSelectedRealm(realm: Realm): void; 106 | selectOption(option: RealmSelectOptionElement): void; 107 | unselectOption(): void; 108 | } 109 | declare class RealmSidebarSelect { 110 | realmSidebarOptions: Map; 111 | constructor(); 112 | updateRealmVisibility(realm: Realm): void; 113 | } 114 | declare class RealmSidebarSelectOption { 115 | realm: Realm; 116 | sidebarEl: SidebarSubitemWrapper; 117 | constructor(realm: Realm); 118 | setLocked(): void; 119 | setUnlocked(): void; 120 | showRealmSidebarOption(): void; 121 | hideRealmSidebarOption(): void; 122 | setSidebarOptionAsLocked(): void; 123 | setSidebarOptionAsUnlocked(): void; 124 | } 125 | -------------------------------------------------------------------------------- /src/gameTypes/dataStructures.d.ts: -------------------------------------------------------------------------------- 1 | declare type HeapElement = [T, number, number]; 2 | declare const enum HeapIndex { 3 | Obj = 0, 4 | Key = 1, 5 | Ind = 2 6 | } 7 | declare class MinHeapPriorityQueue { 8 | _heap: HeapElement[]; 9 | _objMap: Map>; 10 | get size(): number; 11 | get isEmpty(): boolean; 12 | constructor(objs: T[], priorities: number[]); 13 | /** Builds the min heap from an un-ordered array */ 14 | _build(): void; 15 | /** Performs the min-heapify procedure on the heap at index i. Sifts the element down until the min-heap property is satisfied */ 16 | _heapify(i: number): void; 17 | /** Inserts an object with the specified priority */ 18 | insert(obj: T, priority: number): void; 19 | /** Peeks the object with the lowest priority in the queue */ 20 | peek(): T | undefined; 21 | /** Returns if a given object is in the queue */ 22 | inQueue(obj: T): boolean; 23 | /** Extracts the object with the minimum priority */ 24 | extractMin(): T; 25 | /** Decreases the priority of the specified object to the new priority */ 26 | decreasePriority(obj: T, newPriority: number): void; 27 | /** Deletes an object from the queue */ 28 | delete(obj: T): void; 29 | /** Sifts an element i up, until the min heap propery is satisfied */ 30 | _siftUp(i: number): void; 31 | /** Decrease the key of the specified index in the heap to the new value */ 32 | _decreaseKey(i: number, key: number): void; 33 | _swap(i: number, j: number): void; 34 | _parent(i: number): number; 35 | _left(i: number): number; 36 | _right(i: number): number; 37 | } 38 | interface DLLNode { 39 | prev?: DLLNode; 40 | next?: DLLNode; 41 | obj: T; 42 | } 43 | declare class DoublyLinkedList { 44 | _head?: DLLNode; 45 | _tail?: DLLNode; 46 | /** If there are no nodes in the list */ 47 | get isEmpty(): boolean; 48 | /** Traverses each object, from the start to the end */ 49 | forEachForward(callbackFn: (obj: T, i: number) => void): void; 50 | /** Travereses each object, from the end to the start */ 51 | forEachReverse(callbackFn: (obj: T, i: number) => void): void; 52 | /** Traverses forward in the list looking for the first index of an object that matches predicate. Returns -1 if no match found. */ 53 | findIndex(predicate: (obj: T, i: number) => boolean): number; 54 | /** Inserts a node after the given node */ 55 | _insertAfter(node: DLLNode, newNode: DLLNode): void; 56 | /** Inserts node before the given node */ 57 | _insertBefore(node: DLLNode, newNode: DLLNode): void; 58 | /** Inserts a node at the start of the list */ 59 | _insertStart(newNode: DLLNode): void; 60 | /** Inserts a node at the end of the list */ 61 | _insertEnd(newNode: DLLNode): void; 62 | /** Removed a node from the list */ 63 | _removeNode(node: DLLNode): void; 64 | } 65 | declare class LinkQueue extends DoublyLinkedList { 66 | _objMap: Map>; 67 | /** The number of objects currently in the queue */ 68 | get size(): number; 69 | /** Returns if an object is currently in the queue */ 70 | inQueue(obj: T): boolean; 71 | /** Adds an object to the end of the queue */ 72 | queue(obj: T): void; 73 | /** Removes the first object from the queue and returns it */ 74 | dequeue(): T; 75 | /** Deletes an object from the queue */ 76 | delete(obj: T): void; 77 | /** Peeks the first object in the queue */ 78 | peek(): T | undefined; 79 | /** Removes all objects from the queue */ 80 | clear(): void; 81 | } 82 | declare type NestedMap = Map | T>; 83 | declare class MultiMap { 84 | get depth(): number; 85 | get size(): number; 86 | _size: number; 87 | _depth: number; 88 | _data: NestedMap; 89 | constructor(depth: number); 90 | clear(): void; 91 | /** Deletes the value stored at the specified keys */ 92 | delete(...keys: K[]): void; 93 | /** 94 | * Gets a value stored at the specified keys 95 | * @param keys Keys to index into the map in order 96 | * @returns The value at the given keys, or undefined if not set 97 | */ 98 | get(...keys: K[]): T | undefined; 99 | /** 100 | * Sets the value stored at the specified keys 101 | * @param value Value to set at the specified keys 102 | * @param keys Keys to set the value to in order 103 | */ 104 | set(value: T, ...keys: K[]): void; 105 | /** 106 | * Checks if the map has a value set at the specified keys 107 | * @param keys Keys to index into the map in order 108 | * @returns If the map has a value at the specified keys 109 | */ 110 | has(...keys: K[]): boolean; 111 | _checkKeys(keys: K[]): void; 112 | } 113 | -------------------------------------------------------------------------------- /src/gameTypes/harvesting.d.ts: -------------------------------------------------------------------------------- 1 | declare class HarvestingRenderQueue extends GatheringSkillRenderQueue { 2 | veinIntensity: Set; 3 | veinStatus: Set; 4 | veinItemDrops: Set; 5 | veinRates: boolean; 6 | veinUnlock: boolean; 7 | veinVisibility: boolean; 8 | } 9 | interface HarvestingProductData { 10 | itemID: string; 11 | minIntensityPercent: number; 12 | weight: number; 13 | } 14 | interface HarvestingProduct { 15 | item: AnyItem; 16 | minIntensityPercent: number; 17 | weight: number; 18 | } 19 | declare const veinMenus: Map; 20 | declare function loadHarvestingVeins(): void; 21 | declare function localizeHarvesting(): void; 22 | interface HarvestingVeinData extends BasicSkillRecipeData { 23 | name: string; 24 | media: string; 25 | baseQuantity: number; 26 | shopItemPurchased?: string; 27 | products: HarvestingProductData[]; 28 | uniqueProduct: IDQuantity; 29 | } 30 | declare class HarvestingVein extends BasicSkillRecipe { 31 | get media(): string; 32 | get name(): string; 33 | baseQuantity: number; 34 | shopItemPurchased?: ShopPurchase; 35 | _name: string; 36 | _media: string; 37 | currentIntensity: number; 38 | maxIntensity: number; 39 | get intensityPercent(): number; 40 | products: HarvestingProduct[]; 41 | totalProductWeight: number; 42 | uniqueProduct: AnyItemQuantity; 43 | constructor(namespace: DataNamespace, data: HarvestingVeinData, game: Game); 44 | } 45 | declare const enum ImpDevilResult { 46 | DO_NOTHING = 0, 47 | GAIN_NOTHING = 1, 48 | TRIPLE_ITEMS = 2, 49 | ABYSSAL_PIECES = 3 50 | } 51 | interface HarvestingSkillData extends MasterySkillData { 52 | veinData?: HarvestingVeinData[]; 53 | } 54 | interface HarvestingModificationData extends MasterySkillModificationData { 55 | } 56 | declare type HarvestingEvents = { 57 | action: HarvestingActionEvent; 58 | } & SkillWithMasteryEvents; 59 | declare class Harvesting extends GatheringSkill implements PassiveAction { 60 | readonly _media = "assets/media/skills/harvesting/harvesting.png"; 61 | isMasteryActionUnlocked(action: HarvestingVein): boolean; 62 | hasRealmSelection: boolean; 63 | renderQueue: HarvestingRenderQueue; 64 | readonly baseInterval = 3000; 65 | readonly baseVeinIntensity = 28800; 66 | readonly passiveRegenInterval = 20000; 67 | readonly baseUniqueProductChance = 0.1; 68 | readonly hpCheckpoints: number[]; 69 | get uniqueProductChance(): number; 70 | get actionInterval(): number; 71 | get actionLevel(): number; 72 | get masteryAction(): HarvestingVein; 73 | get masteryModifiedInterval(): number; 74 | get maxLevelCap(): number; 75 | activeProgressVein?: HarvestingVein; 76 | selectedVein?: HarvestingVein; 77 | veinDecayTimer: Timer; 78 | get activeVein(): HarvestingVein; 79 | constructor(namespace: DataNamespace, game: Game); 80 | registerData(namespace: DataNamespace, data: HarvestingSkillData): void; 81 | modifyData(data: HarvestingModificationData): void; 82 | postDataRegistration(): void; 83 | canHarvestVein(vein: HarvestingVein): boolean; 84 | passiveTick(): void; 85 | getErrorLog(): string; 86 | onModifierChange(): void; 87 | onEquipmentChange(): void; 88 | onAnyLevelUp(): void; 89 | onRealmChange(): void; 90 | render(): void; 91 | renderVeinRates(): void; 92 | renderVeinIntensity(): void; 93 | renderVeinStatus(): void; 94 | renderVeinItemDrops(): void; 95 | renderProgressBar(): void; 96 | stopActiveProgressBar(): void; 97 | renderVeinVisibility(): void; 98 | renderVeinUnlock(): void; 99 | /** Callback function for when an ore is clicked */ 100 | onVeinClick(vein: HarvestingVein): void; 101 | onStop(): void; 102 | onLoad(): void; 103 | encode(writer: SaveWriter): SaveWriter; 104 | decode(reader: SaveWriter, version: number): void; 105 | getActionIDFromOldID(oldActionID: number, idMap: NumericIDMap): string; 106 | preAction(): void; 107 | get actionRewards(): Rewards; 108 | postAction(): void; 109 | reduceVeinIntensity(): void; 110 | getVeinMaxIntensity(vein: HarvestingVein): number; 111 | updateVeinMaxIntensity(vein: HarvestingVein): void; 112 | updateAllVeinMaxIntensity(): void; 113 | /** Initializes the HP of rocks that were newly added. */ 114 | initializeVeins(): void; 115 | testTranslations(): void; 116 | getObtainableItems(): Set; 117 | getVeinBaseRewardQuantity(vein: HarvestingVein): number; 118 | getRegistry(type: ScopeSourceType): NamespaceRegistry | undefined; 119 | getPkgObjects(pkg: GameDataPackage, type: ScopeSourceType): IDData[] | undefined; 120 | static IMP_DEVIL_TABLE: WeightedResult[]; 121 | } 122 | -------------------------------------------------------------------------------- /src/gameTypes/attacks2.d.ts: -------------------------------------------------------------------------------- 1 | /** Defines data for the construction of an attack */ 2 | interface AttackData extends IDData { 3 | /** Default chance for attack to happen in %*/ 4 | defaultChance: number; 5 | /** Damage dealt by attack */ 6 | damage: DamageData[]; 7 | /** Effect/EffectTable applicators that are processed before the attack hits */ 8 | prehitEffects: AnyCombatEffectApplicatorData[]; 9 | /** Effect/EffectTable applicators that are processed only when the attack hits */ 10 | onhitEffects: AnyCombatEffectApplicatorData[]; 11 | /** Optional. If true, this attack will be replaced by a normal attack if any of its pre-hit or on-hit effects are active */ 12 | canNormalAttack?: boolean; 13 | /** If the attack cant miss target */ 14 | cantMiss: boolean; 15 | /** Number of attacks */ 16 | attackCount: number; 17 | /** Interval between attacks */ 18 | attackInterval: number; 19 | /** Portion of damage dealt healed */ 20 | lifesteal: number; 21 | /** Optional. If present this attack will remove the given effect from the target character, and increase its attack count by the effects paremeter value */ 22 | consumesEffect?: { 23 | effectID: string; 24 | paramName: string; 25 | }; 26 | /** Attack consumes Runes per hit */ 27 | usesRunesPerProc?: boolean; 28 | /** Attack consumes Prayer Points per hit */ 29 | usesPrayerPointsPerProc?: boolean; 30 | /** Attack consumes Potion Charges per hit */ 31 | usesPotionChargesPerProc?: boolean; 32 | /** Optional. If included, only the provided Attack Types this attack can activate on */ 33 | attackTypes?: AttackType[]; 34 | /** Extra rune consumption for this attack */ 35 | extraRuneConsumption?: IDQuantity[]; 36 | /** Attack is considered to be dragonbreath */ 37 | isDragonbreath?: boolean; 38 | /** Minimum accuracy required for attack to always hit */ 39 | minAccuracy?: number; 40 | /** Name of the attack */ 41 | name: string; 42 | /** Description of the attack */ 43 | description: string; 44 | /** Description generator string */ 45 | descriptionGenerator?: string; 46 | } 47 | declare type DamageData = NormalDamageData | CustomDamageData; 48 | /** Shortcut data for defining damage based on min hit and max hit */ 49 | interface NormalDamageData { 50 | damageType: 'Normal'; 51 | /** Scaling factor for damage */ 52 | amplitude: number; 53 | /** If present, damage occurs only on the specific proc of the special attack */ 54 | attackCount?: number; 55 | } 56 | declare type CustomDamageData = Damage & { 57 | damageType: 'Custom'; 58 | }; 59 | declare class SpecialAttack extends NamespacedObject implements SoftDataDependant { 60 | /** Localized name of the attack */ 61 | get name(): string; 62 | get englishName(): string; 63 | get englishDescription(): string; 64 | /** Localized description of the attack */ 65 | get description(): string; 66 | _modifiedDescription: string | undefined; 67 | get modifiedDescription(): string; 68 | canNormalAttack: boolean; 69 | get descriptionTemplateData(): StringDictionary; 70 | /** Default chance for attack to happen in %*/ 71 | defaultChance: number; 72 | /** Damage dealt by attack */ 73 | damage: Damage[]; 74 | /** Effects of attack before it hits*/ 75 | prehitEffects: AnyCombatEffectApplicator[]; 76 | /** Efects of attack when it hits */ 77 | onhitEffects: AnyCombatEffectApplicator[]; 78 | /** If the attack cant miss target */ 79 | cantMiss: boolean; 80 | /** Number of attacks */ 81 | attackCount: number; 82 | /** Interval between attacks */ 83 | attackInterval: number; 84 | /** Portion of damage dealt healed */ 85 | lifesteal: number; 86 | /** Attack will remove an effect from the target character, and increase its attack count by the effects parameter value */ 87 | consumesEffect?: { 88 | effect: CombatEffect; 89 | paramName: string; 90 | }; 91 | /** Attack consumes Runes per hit */ 92 | usesRunesPerProc: boolean; 93 | /** Attack consumes Prayer Points per hit */ 94 | usesPrayerPointsPerProc: boolean; 95 | /** Attack consumes Potion Charges per hit */ 96 | usesPotionChargesPerProc: boolean; 97 | /** Enabled Attack Types this attack can activate on */ 98 | attackTypes?: Set; 99 | /** Extra rune consumption for this attack */ 100 | extraRuneConsumption?: ItemQuantity[]; 101 | /** Attack is considered to be dragonbreath */ 102 | isDragonbreath: boolean; 103 | minAccuracy: number; 104 | /** String used to automatically generate a description */ 105 | descriptionGenerator?: string; 106 | _name: string; 107 | _description: string; 108 | constructor(namespace: DataNamespace, data: AttackData, game: Game); 109 | registerSoftDependencies(data: AttackData, game: Game): void; 110 | } 111 | declare function constructDamageFromData(data: DamageData[]): Damage[]; 112 | -------------------------------------------------------------------------------- /src/gameTypes/main.d.ts: -------------------------------------------------------------------------------- 1 | declare const DEBUGENABLED = false; 2 | declare const releaseDate = 1637258400000; 3 | declare const DEBUG_REPORTER: string[]; 4 | declare const gameTitle = "Melvor Idle :: v1.3.1"; 5 | declare let currentTitleNewsID: string[]; 6 | declare let playFabEventQueue: { 7 | eventName: string; 8 | args: PlayFabEventBody; 9 | }[]; 10 | declare let isLoaded: boolean; 11 | declare let confirmedLoaded: boolean; 12 | declare let steamAchievements: number[]; 13 | declare let connectedToSteam: boolean; 14 | declare let lolYouDiedGetRekt: boolean; 15 | /** Multiplier for HP and damage values */ 16 | declare let numberMultiplier: number; 17 | declare let returnToGameAfterSubmission: boolean; 18 | declare let modalQueuePaused: boolean; 19 | declare const modalQueue: SweetAlertOptions[]; 20 | declare const cloudSaveHeartbeatLevel = 0; 21 | declare let loadingOfflineProgress: boolean; 22 | declare let modalIsOpen: boolean; 23 | declare let offlineProgressCache: string; 24 | /** Update everything on screen when loading the game */ 25 | declare function updateWindow(): Promise; 26 | /** 27 | * Shows the broken game modal 28 | * @param title The title of the error to report 29 | * @param errorLog The error log that can be copied 30 | * @param brokenMods Optional. Array of mod information from stack trace analysis 31 | */ 32 | declare function showGameErrorModal(title: string, errorLog: string, brokenMods?: Modding.ModBasic[]): void; 33 | /** 34 | * Handles errors when loading the game. Shows the error modal and removes the loader. 35 | * @param e Exception from the try catch block 36 | */ 37 | declare function handleGameLoadingError(title: string, e: unknown): void; 38 | /** Loads the lore book modal text */ 39 | declare function loadLore(): void; 40 | /** Removes old variables from localstorage, and fixes invalid bank tabs */ 41 | declare function cleanSaveFile(): void; 42 | declare function getCloudSaveHeartbeatInterval(): number; 43 | declare const isAdsPath: () => boolean; 44 | /** 45 | * @deprecated Use nativeManager.isIOS 46 | */ 47 | declare function isIOS(): boolean; 48 | /** 49 | * @deprecated Use nativeManager.isAndroid 50 | */ 51 | declare function isAndroid(): boolean; 52 | /** 53 | * @deprecated Use nativeManager.isMobile 54 | */ 55 | declare function isMobile(): boolean; 56 | /** 57 | * @deprecated Use nativeManager.isSteam 58 | */ 59 | declare function isSteam(): boolean; 60 | declare const isDemoSkill: (skill: AnySkill) => boolean; 61 | declare const getLockedTitle: (skill?: AnySkill, dungeon?: Dungeon) => string; 62 | declare const getLockedMessage: (skill?: AnySkill, dungeon?: Dungeon) => string; 63 | declare let IAPPrice: string; 64 | declare const getLocaleIAPPrice: () => void; 65 | declare const IAPPurchaseInProcess = false; 66 | declare let IAPTimer: number; 67 | declare const performUnlockIAP: (productID: string) => void; 68 | declare const performUnlockExpansionIAP: (productID: string, expansionID: number) => void; 69 | declare const performUnlockExpandedEditionIAP: (productID: string) => void; 70 | declare const enableBuyNowExpandedEditionBtn: () => void; 71 | declare const disableBuyNowExpandedEditionBtn: () => void; 72 | declare const enableBuyNowFullGameBtn: () => void; 73 | declare const disableBuyNowFullGameBtn: () => void; 74 | declare const startIAPPurchaseInterval: () => void; 75 | declare const getAndroidIAPStatus: () => Promise; 76 | declare const updateMobilePurchaseStatus: () => void; 77 | declare const getLockedBtn: (productID: string) => string; 78 | /** Temporarily stops modals from being automatically opened when added to the queue */ 79 | declare function pauseModalQueue(): void; 80 | /** Resumes modals being automatically opened when added to the queue, and opens the next one */ 81 | declare function resumeModalQueue(): void; 82 | declare function openNextModal(): void; 83 | declare function addModalToQueue(modal: SweetAlertOptions): void; 84 | declare function showBaneCompletionModal(): void; 85 | declare function onSaveDataLoad(): Promise; 86 | declare function resetAccountData(): void; 87 | declare function setDiscordRPCDetails(): Promise; 88 | declare function initSteam(): void; 89 | declare function unlockSteamAchievement(achievementName: string, i: number): void; 90 | declare function showPageLoader(): void; 91 | declare function initTooltips(): void; 92 | declare function generateLoreModals(): string; 93 | declare function resetSkillsTo99(confirmed?: boolean): void; 94 | declare function resetAbyssalSkills(): void; 95 | declare function setBackground(id: number): void; 96 | declare function initChangelog(): void; 97 | /** CORE GAME FUNCTIONS */ 98 | declare function updateAllGameMedia(): void; 99 | declare function updateGameMedia(media: string): void; 100 | declare function viewExpansion2Details(): void; 101 | declare function resetClient(): void; 102 | declare let shamedThisSession: boolean; 103 | declare function showActionsRunOutSwal(): void; 104 | declare function giveShameToken(): void; 105 | declare function showShameSwal(): void; 106 | declare function showToggleExpansionsModal(): void; 107 | -------------------------------------------------------------------------------- /src/gameTypes/summoningMenus.d.ts: -------------------------------------------------------------------------------- 1 | declare class SummoningMarkDiscoveryElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | status: HTMLElement; 4 | name: HTMLSpanElement; 5 | image: HTMLImageElement; 6 | levelRequired: HTMLHeadingElement; 7 | abyssalLevelRequired: HTMLHeadingElement; 8 | discoveredContent: HTMLDivElement; 9 | progressBar: HTMLDivElement; 10 | skillImageContainer: HTMLHeadingElement; 11 | discoveryTotal: HTMLHeadingElement; 12 | quickCreateButton: HTMLButtonElement; 13 | constructor(); 14 | connectedCallback(): void; 15 | setMark(mark: SummoningRecipe, summoning: Summoning): void; 16 | /** Updates the current state based on the mark discovery count + level */ 17 | updateState(mark: SummoningRecipe, summoning: Summoning): void; 18 | /** Sets the mark to the state of being too high level */ 19 | setLocked(mark: SummoningRecipe, summoning: Summoning): void; 20 | /** Sets the mark to the state of being unlocked via level, but undiscovered */ 21 | setUndiscovered(mark: SummoningRecipe): void; 22 | /** Sets the mark to the state of being discovered */ 23 | setDiscovered(mark: SummoningRecipe): void; 24 | getSkillIcon(skill: AnySkill): HTMLImageElement; 25 | /** Templates and sets the name field for the mark */ 26 | setName(name: string): void; 27 | /** Sets the skill images to the specified skills */ 28 | setSkillImages(skills: AnySkill[]): void; 29 | /** Updates the discovery progress bar and the current discovery count */ 30 | updateDiscoveryCount(mark: SummoningRecipe): void; 31 | } 32 | interface SynergySearchMarkElements { 33 | container: HTMLDivElement; 34 | image: HTMLImageElement; 35 | quantity: HTMLElement; 36 | skillImage: HTMLImageElement; 37 | } 38 | declare class SummoningSynergySearchElement extends HTMLElement implements CustomElement { 39 | _content: DocumentFragment; 40 | flexContainer: HTMLDivElement; 41 | markElements0: SynergySearchMarkElements; 42 | markElements1: SynergySearchMarkElements; 43 | synergyIcon: HTMLImageElement; 44 | synergyDescription: HTMLDivElement; 45 | synergy?: SummoningSynergy; 46 | constructor(); 47 | connectedCallback(): void; 48 | /** Sets the synergy, setting the skill images, lock status and quantities */ 49 | setSynergy(synergy: SummoningSynergy): void; 50 | /** Updates the locked/unlocked status */ 51 | updateLockStatus(): void; 52 | /** Sets the synergy as locked */ 53 | setLocked(): void; 54 | /** Sets the description for locked synergies */ 55 | setLockedDescriptions(): void; 56 | /** Sets the synergy as unlocked */ 57 | setUnlocked(): void; 58 | /** Updates the displayed quantity of summons */ 59 | updateQuantities(): void; 60 | updateMarkQuantity(markElements: SynergySearchMarkElements, mark: SummoningRecipe): void; 61 | } 62 | interface SynergySearchOptionElements { 63 | link: HTMLAnchorElement; 64 | image: HTMLImageElement; 65 | name: HTMLSpanElement; 66 | } 67 | /** Menu for searching for summoning synergies */ 68 | declare class SynergySearchMenuElement extends HTMLElement implements CustomElement { 69 | _content: DocumentFragment; 70 | showAllButton: HTMLButtonElement; 71 | showUnlockedButton: HTMLButtonElement; 72 | filterDropdownButton: HTMLButtonElement; 73 | filterOptionsContainer: HTMLDivElement; 74 | filterOptions: Map; 75 | searchBar: HTMLInputElement; 76 | searchElements: Map; 77 | visibleSynergies: Set; 78 | constructor(); 79 | connectedCallback(): void; 80 | /** Initializes the display of each synergy */ 81 | initialize(): void; 82 | /** Shows all synergies */ 83 | showAllSynergies(): void; 84 | showSynergiesWithMark(mark: SummoningRecipe): void; 85 | /** Shows only the synergies the player has unlocked */ 86 | showUnlockedSynergies(): void; 87 | /** Updates the dropdown menu options based on unlocked marks */ 88 | updateFilterOptions(): void; 89 | /** Updates the unlock state of visible synergies */ 90 | updateVisibleElementUnlocks(): void; 91 | /** Updates the quantities of visible synergies */ 92 | updateVisibleElementQuantities(): void; 93 | /** Updates the visible synergies based on a fuzzy search query */ 94 | querySynergies(query: string): void; 95 | /** Callback for when the current search changes */ 96 | onSearchChange(): void; 97 | } 98 | declare class SummoningMarkMenuElement extends HTMLElement implements CustomElement { 99 | _content: DocumentFragment; 100 | discoveryContainer: HTMLDivElement; 101 | categoryImage: HTMLImageElement; 102 | categoryName: HTMLSpanElement; 103 | discoveryElements: SummoningMarkDiscoveryElement[]; 104 | discoveryElemMap: Map; 105 | activeCategory?: SummoningCategory; 106 | constructor(); 107 | connectedCallback(): void; 108 | showMarksInCategory(category: SummoningCategory, summoning: Summoning): void; 109 | updateMarkState(mark: SummoningRecipe, summoning: Summoning): void; 110 | updateDiscoveryCount(mark: SummoningRecipe): void; 111 | } 112 | -------------------------------------------------------------------------------- /src/gameTypes/skillTreeMenus.d.ts: -------------------------------------------------------------------------------- 1 | declare class SkillTreeButtonElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | viewBtn: HTMLButtonElement; 4 | constructor(); 5 | connectedCallback(): void; 6 | setSkill(skill: AnySkill): void; 7 | } 8 | declare class SkillTreeNodeInfoElement extends HTMLElement implements CustomElement { 9 | _content: DocumentFragment; 10 | name: HTMLSpanElement; 11 | stats: HTMLDivElement; 12 | requirements: HTMLDivElement; 13 | costs: HTMLDivElement; 14 | costElements: HTMLElement[]; 15 | requirementElements: HTMLElement[]; 16 | constructor(); 17 | connectedCallback(): void; 18 | setNode(tree: SkillTree, node: SkillTreeNode): void; 19 | clearRequirements(): void; 20 | setRequirements(node: SkillTreeNode): void; 21 | clearCosts(): void; 22 | setCosts(tree: SkillTree, node: SkillTreeNode): void; 23 | createCost(media: string, text: string): HTMLSpanElement; 24 | updateStatus(tree: SkillTree, node: SkillTreeNode): void; 25 | updateRequirements(node: SkillTreeNode): void; 26 | updateCosts(tree: SkillTree, node: SkillTreeNode): void; 27 | } 28 | declare class SkillTreeNodeIconElement extends HTMLElement implements CustomElement { 29 | _content: DocumentFragment; 30 | name: HTMLSpanElement; 31 | iconImage: HTMLImageElement; 32 | lockedImage: HTMLImageElement; 33 | description: HTMLDivElement; 34 | pointCost: HTMLSpanElement; 35 | tooltipContent: SkillTreeNodeInfoElement; 36 | tooltip?: TippyTooltip; 37 | constructor(); 38 | connectedCallback(): void; 39 | disconnectedCallback(): void; 40 | setNode(tree: SkillTree, node: SkillTreeNode): void; 41 | updateImage(tree: SkillTree, node: SkillTreeNode): void; 42 | updatePointCost(tree: SkillTree, node: SkillTreeNode): void; 43 | updateModifiers(tree: SkillTree, node: SkillTreeNode): void; 44 | updateStatus(tree: SkillTree, node: SkillTreeNode): void; 45 | updateCosts(tree: SkillTree, node: SkillTreeNode): void; 46 | } 47 | declare class SkillTreeRenderQueue { 48 | requirements: boolean; 49 | costs: boolean; 50 | currentPoints: boolean; 51 | dropdownPoints: Set; 52 | } 53 | interface SkillTreeMenuEdge { 54 | from: SkillTreeNode; 55 | to: SkillTreeNode; 56 | path: SVGPathElement; 57 | } 58 | declare class SkillTreeMenuElement extends HTMLElement implements CustomElement { 59 | _content: DocumentFragment; 60 | nodeScrollContainer: HTMLDivElement; 61 | nodeContainer: HTMLDivElement; 62 | edgeContainer: SVGSVGElement; 63 | zoomIn: HTMLButtonElement; 64 | zoomOut: HTMLButtonElement; 65 | pointsCount: HTMLSpanElement; 66 | dropdownBtn: HTMLButtonElement; 67 | dropdownItems: HTMLDivElement; 68 | dropdownItemMap: Map; 69 | elementScrollDragger: ElementScrollDragger; 70 | get currentSkillTree(): SkillTree | undefined; 71 | _currentSkillTree?: SkillTree; 72 | nodeIcons: SkillTreeNodeIconElement[]; 73 | nodeIconMap: Map; 74 | edges: SkillTreeMenuEdge[]; 75 | zoomLevel: number; 76 | get sizeScale(): number; 77 | renderQueue: SkillTreeRenderQueue; 78 | eventUnlisteners: VoidFunction[]; 79 | constructor(); 80 | initialize(game: Game): void; 81 | createDropdownItem(skill: AnySkill): void; 82 | updateDropdownItem(skill: AnySkill): void; 83 | getSkillItem(skill: AnySkill): HTMLImageElement; 84 | connectedCallback(): void; 85 | getNodeIcon(node: SkillTreeNode): SkillTreeNodeIconElement | undefined; 86 | updateMenu(skill: AnySkill): void; 87 | setSkillTree(tree: SkillTree, game: Game): void; 88 | setIconPosition(icon: SkillTreeNodeIconElement, position: { 89 | width: number; 90 | height: number; 91 | x: number; 92 | y: number; 93 | }): void; 94 | computeEdgePath(points: { 95 | x: number; 96 | y: number; 97 | }[]): string; 98 | computeLayout(tree: SkillTree): dagre.graphlib.Graph<{}>; 99 | onZoomChange(): void; 100 | onZoomIn(): void; 101 | onZoomOut(): void; 102 | updateEdge(edge: SkillTreeMenuEdge): void; 103 | assignRenderListeners(tree: SkillTree, game: Game): void; 104 | unassignRenderListeners(): void; 105 | onClose(): void; 106 | render(): void; 107 | renderNodeRequirements(tree: SkillTree): void; 108 | renderNodeCosts(tree: SkillTree): void; 109 | renderCurrentPoints(tree: SkillTree): void; 110 | renderDropdownPoints(): void; 111 | static CONFIG: { 112 | NODE_WIDTH: number; 113 | NODE_HEIGHT: number; 114 | MARGIN_X: number; 115 | NODE_SEPERATION: number; 116 | EDGE_SEPERATION: number; 117 | RANK_SEPERATION: number; 118 | ZOOM_LEVELS: number[]; 119 | }; 120 | } 121 | declare class ElementScrollDragger { 122 | slider: HTMLElement; 123 | isDown: boolean; 124 | preventClick: boolean; 125 | startX: number; 126 | scrollLeft: number; 127 | constructor(element: HTMLElement); 128 | init(): void; 129 | handleMouseDown(e: MouseEvent): void; 130 | handleMouseLeave(): void; 131 | handleMouseUp(): void; 132 | handleMouseMove(e: MouseEvent): void; 133 | handleClick(e: MouseEvent): void; 134 | } 135 | -------------------------------------------------------------------------------- /src/gameTypes/monsters.d.ts: -------------------------------------------------------------------------------- 1 | interface DropTableData { 2 | itemID: string; 3 | minQuantity: number; 4 | maxQuantity: number; 5 | weight: number; 6 | } 7 | interface CurrencyDropData { 8 | currencyID: string; 9 | min: number; 10 | max: number; 11 | } 12 | interface CurrencyDrop { 13 | currency: Currency; 14 | min: number; 15 | max: number; 16 | } 17 | interface MonsterData extends IDData { 18 | name: string; 19 | description?: string; 20 | media: string; 21 | mediaAnimation?: string; 22 | levels: PickPartial, 'Corruption'>; 23 | equipmentStats: AnyEquipStatData[]; 24 | ignoreCompletion: boolean; 25 | attackType: AttackType | 'random'; 26 | specialAttacks: string[]; 27 | combatEffects?: TriggeredCombatEffectApplicatorData[]; 28 | overrideSpecialChances?: number[]; 29 | passives: string[]; 30 | lootChance: number; 31 | lootTable: DropTableData[]; 32 | currencyDrops?: CurrencyDropData[]; 33 | /** @deprecated Use currencyDrops instead */ 34 | gpDrops?: { 35 | min: number; 36 | max: number; 37 | }; 38 | bones?: { 39 | itemID: string; 40 | quantity: number; 41 | }; 42 | canSlayer: boolean; 43 | isBoss: boolean; 44 | selectedSpell: string; 45 | pet?: IDQuantity; 46 | barrierPercent?: number; 47 | damageType?: string; 48 | } 49 | interface MonsterModificationData extends IDData { 50 | attackType?: AttackType | 'random'; 51 | bones?: { 52 | itemID: string; 53 | quantity: number; 54 | } | null; 55 | canSlayer?: boolean; 56 | equipmentStats?: EquipStatsModificationData; 57 | currencyDrops?: { 58 | add?: { 59 | currencyID: string; 60 | min?: number; 61 | max?: number; 62 | }[]; 63 | remove?: string[]; 64 | }; 65 | /** @deprecated Use currencyDrops instead */ 66 | gpDrops?: { 67 | min?: number; 68 | max?: number; 69 | }; 70 | isBoss?: boolean; 71 | levels?: Partial>; 72 | lootChance?: number; 73 | lootTable?: { 74 | add?: DropTableData[]; 75 | remove?: string[]; 76 | }; 77 | passives?: { 78 | add?: string[]; 79 | remove?: string[]; 80 | }; 81 | pet?: IDQuantity | null; 82 | selectedSpell?: string; 83 | specialAttacks?: { 84 | add?: { 85 | attackID: string; 86 | chance?: number; 87 | }[]; 88 | remove?: string[]; 89 | }; 90 | combatEffects?: CombatEffectApplicatorModificationData; 91 | } 92 | declare type MonsterEvents = { 93 | killed: MonsterKilledEvent; 94 | }; 95 | declare class Monster extends NamespacedObject implements IGameEventEmitter { 96 | get media(): string; 97 | get corruptedMedia(): string; 98 | get name(): string; 99 | get englishName(): string; 100 | get wikiName(): string; 101 | get description(): string; 102 | get combatLevel(): number; 103 | levels: Omit; 104 | equipmentStats: AnyEquipStat[]; 105 | ignoreCompletion: boolean; 106 | attackType: AttackType | 'random'; 107 | specialAttacks: AttackSelection[]; 108 | combatEffects: CombatEffectApplicator[]; 109 | passives: CombatPassive[]; 110 | lootChance: number; 111 | lootTable: DropTable; 112 | currencyDrops: CurrencyDrop[]; 113 | /** Bones that the monster drops. If undefined, monster does not drop bones. */ 114 | bones?: { 115 | item: AnyItem; 116 | quantity: number; 117 | }; 118 | canSlayer: boolean; 119 | isBoss: boolean; 120 | selectedSpell: AttackSpell; 121 | _name: string; 122 | _description?: string; 123 | _media: string; 124 | _mediaAnimation?: string; 125 | hasDescription: boolean; 126 | /** Pet that is unlocked if the monster is killed kills times */ 127 | pet?: { 128 | pet: Pet; 129 | kills: number; 130 | }; 131 | get hasBarrier(): boolean; 132 | barrierPercent: number; 133 | /** The type of damage this Monster deals. Defaults to Normal if not set. */ 134 | damageType: DamageType; 135 | _events: import("mitt").Emitter; 136 | on: { 137 | (type: Key, handler: import("mitt").Handler): void; 138 | (type: "*", handler: import("mitt").WildcardHandler): void; 139 | }; 140 | off: { 141 | (type: Key, handler?: import("mitt").Handler | undefined): void; 142 | (type: "*", handler: import("mitt").WildcardHandler): void; 143 | }; 144 | emit: { 145 | (type: Key, event: MonsterEvents[Key]): void; 146 | (type: undefined extends MonsterEvents[Key_1] ? Key_1 : never): void; 147 | }; 148 | constructor(namespace: DataNamespace, data: MonsterData, game: Game); 149 | applyDataModification(modData: MonsterModificationData, game: Game): void; 150 | overrideMedia(media: string): void; 151 | } 152 | declare class DummyMonster extends Monster { 153 | constructor(namespace: DataNamespace, id: string, game: Game); 154 | } 155 | declare class GolbinMonster extends Monster { 156 | get name(): string; 157 | } 158 | -------------------------------------------------------------------------------- /src/gameTypes/farmingMenus.d.ts: -------------------------------------------------------------------------------- 1 | declare class FarmingCategoryButtonElement extends HTMLElement implements CustomElement { 2 | _content: DocumentFragment; 3 | link: HTMLAnchorElement; 4 | categoryImage: HTMLImageElement; 5 | categoryName: HTMLDivElement; 6 | categoryDescription: HTMLDivElement; 7 | harvestReadyNotice: HTMLDivElement; 8 | constructor(); 9 | connectedCallback(): void; 10 | setCategory(category: FarmingCategory, farming: Farming): void; 11 | updateNotice(show: boolean): void; 12 | } 13 | declare class FarmingCategoryOptionsElement extends HTMLElement implements CustomElement { 14 | _content: DocumentFragment; 15 | harvestAllButton: HTMLButtonElement; 16 | plantAllButton: HTMLButtonElement; 17 | compostAllButtons: HTMLButtonElement[]; 18 | plantAllSelectedButton: HTMLButtonElement; 19 | constructor(); 20 | connectedCallback(): void; 21 | setCategory(category: FarmingCategory, game: Game): void; 22 | getCurrencyIconHTML(currency: Currency): string; 23 | } 24 | declare class FarmingPlotElement extends HTMLElement implements CustomElement { 25 | _content: DocumentFragment; 26 | categoryName: HTMLHeadingElement; 27 | selectSeedDropdownButton: HTMLButtonElement; 28 | selectSeedDropdownImage: HTMLImageElement; 29 | selectSeedDropdownOptions: HTMLDivElement; 30 | plantSeedButton: HTMLButtonElement; 31 | seedImage: HTMLImageElement; 32 | growthStatus: HTMLElement; 33 | destroyButton: HTMLButtonElement; 34 | harvestButton: HTMLButtonElement; 35 | compostButtonContainer: HTMLUListElement; 36 | growthChance: HTMLHeadingElement; 37 | seedQuantities: Map; 38 | compostButtons: HTMLButtonElement[]; 39 | compostTooltips?: TippyTooltip[]; 40 | xpIcon: XpIconElement; 41 | abyssalXPIcon: AbyssalXpIconElement; 42 | masteryIcon: MasteryXpIconElement; 43 | masteryPoolIcon: MasteryPoolIconElement; 44 | compostStatus: HTMLSpanElement; 45 | removeCompost: HTMLButtonElement; 46 | constructor(); 47 | connectedCallback(): void; 48 | disconnectedCallback(): void; 49 | destroyTooltips(): void; 50 | setPlot(plot: FarmingPlot, game: Game): void; 51 | updateGrowthChance(plot: FarmingPlot, farming: Farming): void; 52 | /** Updates the compost level + growth chance */ 53 | updateCompost(plot: FarmingPlot): void; 54 | updateGrowthTime(plot: FarmingPlot, farming: Farming): void; 55 | /** Updates the display of the plot */ 56 | updatePlotState(plot: FarmingPlot): void; 57 | updateSelectedSeed(plot: FarmingPlot): void; 58 | updateSeedQuantities(farming: Farming): void; 59 | /** Updates the XP, Mastery XP, Mastery Pool XP and interval icons */ 60 | updateGrants(xp: number, baseXP: number, masteryXP: number, baseMasteryXP: number, masteryPoolXP: number, seed?: FarmingRecipe): void; 61 | /** Updates the Abyssal XP */ 62 | updateAbyssalGrants(xp: number, baseXP: number): void; 63 | } 64 | declare class LockedFarmingPlotElement extends HTMLElement implements CustomElement { 65 | _content: DocumentFragment; 66 | farmingLevelRequired: HTMLSpanElement; 67 | farmingAbyssalLevelRequiredContainer: HTMLParagraphElement; 68 | farmingAbyssalLevelRequired: HTMLSpanElement; 69 | unlockButton: HTMLButtonElement; 70 | itemIcons: ItemQuantityIconElement[]; 71 | currencyIcons: CurrencyQuantityIconElement[]; 72 | iconContainer: HTMLDivElement; 73 | constructor(); 74 | connectedCallback(): void; 75 | setPlot(plot: FarmingPlot, farming: Farming, game: Game): void; 76 | updateQuantities(game: Game): void; 77 | updateRequirements(plot: FarmingPlot, farming: Farming): void; 78 | updateUnlockButton(plot: FarmingPlot, farming: Farming): void; 79 | } 80 | declare class FarmingSeedSelectElement extends HTMLElement implements CustomElement { 81 | _content: DocumentFragment; 82 | seedNotice: HTMLElement; 83 | seedButtonContainer: HTMLDivElement; 84 | recipeOwnedQuantity: HTMLSpanElement; 85 | recipeProductQuantity: HTMLSpanElement; 86 | recipeMastery: MasteryDisplayElement; 87 | recipeCategory: HTMLSpanElement; 88 | recipeLevel: HTMLSpanElement; 89 | recipeAbyssalLevel: HTMLSpanElement; 90 | recipeLevelCont: HTMLDivElement; 91 | recipeAbyssalLevelCont: HTMLDivElement; 92 | recipeQuantity: HTMLSpanElement; 93 | recipeInterval: HTMLSpanElement; 94 | plantButton: HTMLButtonElement; 95 | xpIcon: XpIconElement; 96 | abyssalXPIcon: AbyssalXpIconElement; 97 | masteryIcon: MasteryXpIconElement; 98 | masteryPoolIcon: MasteryPoolIconElement; 99 | realmSelect: RealmTabSelectElement; 100 | constructor(); 101 | connectedCallback(): void; 102 | updateRealmUnlock(realm: Realm): void; 103 | createRealmOptions(category: FarmingCategory, game: Game, plot?: FarmingPlot): void; 104 | setSeedSelection(category: FarmingCategory, game: Game, realm: Realm, plot?: FarmingPlot): void; 105 | setSelectedRecipe(recipe: FarmingRecipe, game: Game, plot?: FarmingPlot): void; 106 | setUnselectedRecipe(): void; 107 | /** Updates the XP, Mastery XP, Mastery Pool XP and interval icons */ 108 | updateGrants(xp: number, baseXP: number, masteryXP: number, baseMasteryXP: number, masteryPoolXP: number, seed?: FarmingRecipe): void; 109 | updateAbyssalGrants(xp: number, baseXP: number): void; 110 | } 111 | -------------------------------------------------------------------------------- /src/gameTypes/components.d.ts: -------------------------------------------------------------------------------- 1 | declare class LangStringElement extends HTMLElement implements CustomElement { 2 | constructor(); 3 | connectedCallback(): void; 4 | updateTranslation(): void; 5 | attributeChangedCallback(name: LangStringAttribute, oldValue: string, newValue: string): void; 6 | static get observedAttributes(): LangStringAttribute[]; 7 | } 8 | declare type LangStringAttribute = 'lang-id'; 9 | declare class ItemChargeDisplayElement extends HTMLElement implements CustomElement { 10 | _content: DocumentFragment; 11 | itemImage: HTMLImageElement; 12 | itemCharges: HTMLSpanElement; 13 | itemTooltip?: TippyTooltip; 14 | initialized: boolean; 15 | constructor(); 16 | connectedCallback(): void; 17 | disconnectedCallback(): void; 18 | setInitialized(): void; 19 | setItem(item: EquipmentItem): void; 20 | updateCharges(charges: number): void; 21 | } 22 | declare class SettingsCheckboxElement extends HTMLElement implements CustomElement { 23 | _content: DocumentFragment; 24 | container: HTMLDivElement; 25 | label: HTMLLabelElement; 26 | input: HTMLInputElement; 27 | constructor(); 28 | connectedCallback(): void; 29 | attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; 30 | initialize(data: SettingData, onChange: VoidFunction): void; 31 | setChecked(isChecked: boolean): void; 32 | static elementCount: number; 33 | static observedAttributes: string[]; 34 | } 35 | declare class SettingsSwitchElement extends HTMLElement implements CustomElement { 36 | _content: DocumentFragment; 37 | label: HTMLLabelElement; 38 | input: HTMLInputElement; 39 | control: HTMLDivElement; 40 | constructor(); 41 | connectedCallback(): void; 42 | initialize(data: SettingData, onChange: VoidFunction): void; 43 | setChecked(isChecked: boolean): void; 44 | attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; 45 | setLabel(labelHTML: string, size: string | null): void; 46 | setSize(oldSize: string | null, newSize: 'small' | 'large'): void; 47 | static get observedAttributes(): string[]; 48 | static elementCount: number; 49 | } 50 | declare class SettingsDropdownElement extends HTMLElement implements CustomElement { 51 | _content: DocumentFragment; 52 | dropdownButton: HTMLButtonElement; 53 | optionsContainer: HTMLDivElement; 54 | label: HTMLSpanElement; 55 | constructor(); 56 | connectedCallback(): void; 57 | initialize(data: ChoiceSettingData, onChange: (newValue: T) => void): void; 58 | appendOptionToElement(option: ChoiceSettingOption, element: HTMLElement): void; 59 | updateValue(newOption: ChoiceSettingOption): void; 60 | } 61 | declare class UpgradeChainDisplayElement extends HTMLElement implements CustomElement { 62 | _content: DocumentFragment; 63 | upgradeImg: HTMLImageElement; 64 | chainName: HTMLElement; 65 | upgradeName: HTMLElement; 66 | descriptionTooltip?: TippyTooltip; 67 | constructor(); 68 | connectedCallback(): void; 69 | disconnectedCallback(): void; 70 | initialize(game: Game): void; 71 | setChain(chain: ShopUpgradeChain): void; 72 | setUpgrade(name: string, description: string, media: string): void; 73 | static initializeAll(game: Game): void; 74 | } 75 | declare class SkillMilestoneDisplayElement extends HTMLElement implements CustomElement { 76 | _content: DocumentFragment; 77 | block: HTMLDivElement; 78 | skillName: HTMLHeadingElement; 79 | levelOptions: HTMLDivElement; 80 | standardTab: HTMLAnchorElement; 81 | abyssalTab: HTMLAnchorElement; 82 | noMilestoneNotice: HTMLElement; 83 | levelText: HTMLTableCellElement; 84 | milestoneContainer: HTMLTableSectionElement; 85 | skill?: AnySkill; 86 | levelMode: 'Standard' | 'Abyssal'; 87 | constructor(); 88 | connectedCallback(): void; 89 | setSkill(skill: AnySkill): void; 90 | updateMilestones(): void; 91 | createMilestone(level: number, skillLevel: number, milestone: { 92 | name: string; 93 | media: string; 94 | }): void; 95 | setLevelMode(levelMode: 'Standard' | 'Abyssal'): void; 96 | changeTab(levelMode: 'Standard' | 'Abyssal'): void; 97 | getTabForMode(levelMode: 'Standard' | 'Abyssal'): HTMLAnchorElement; 98 | } 99 | declare class CharacterResistanceElement extends HTMLElement implements CustomElement { 100 | _content: DocumentFragment; 101 | name: HTMLSpanElement; 102 | media: HTMLImageElement; 103 | resistanceDiv: HTMLDivElement; 104 | resistance: HTMLSpanElement; 105 | resistanceDiff: HTMLSpanElement; 106 | constructor(damageType: DamageType); 107 | connectedCallback(): void; 108 | initialize(damageType: DamageType): void; 109 | showResistanceDiff(): void; 110 | hideResistanceDiff(): void; 111 | updateResistanceDiff(diff: number): void; 112 | updateResistanceSpan(value: number): void; 113 | updateResistanceValue(value: number): void; 114 | setAsActiveResistance(): void; 115 | removeAsActiveResistance(): void; 116 | renderNoResistance(): void; 117 | replaceResistanceDivClass(className: string, newClassName: string): void; 118 | setIconClass(className: string): void; 119 | showResistance(): void; 120 | hideResistance(): void; 121 | toggleResistanceView(show: boolean): void; 122 | } 123 | -------------------------------------------------------------------------------- /src/gameTypes/tutorialIsland.d.ts: -------------------------------------------------------------------------------- 1 | interface OldTutorialTaskData { 2 | customTasks: { 3 | name: string; 4 | media: string; 5 | qty: number; 6 | itemID?: number; 7 | }[]; 8 | items: OldItemQuantity2[]; 9 | monsters: { 10 | monsterID: number; 11 | qty: number; 12 | type?: AttackType; 13 | }[]; 14 | } 15 | interface OldActiveTutorialTask { 16 | taskID: number; 17 | tasks: OldTutorialTaskData; 18 | isActive: boolean; 19 | } 20 | interface TutorialTaskData extends IDData { 21 | description: string; 22 | media: string; 23 | eventMatcher: GameEventMatcherData; 24 | eventCount: number; 25 | countEventQuantity: boolean; 26 | } 27 | declare class TutorialTask { 28 | get description(): string; 29 | get media(): string; 30 | get complete(): boolean; 31 | _description: string; 32 | _media: string; 33 | eventMatcher: AnyGameEventMatcher; 34 | /** Event matcher unassignment function */ 35 | unassigner?: VoidFunction; 36 | eventCount: number; 37 | countEventQuantity: boolean; 38 | id: string; 39 | /** Current progress in the task */ 40 | progress: number; 41 | constructor(game: Game, data: TutorialTaskData); 42 | } 43 | interface TutorialStageData extends IDData { 44 | /** The display name of the stage */ 45 | name: string; 46 | /** A description of the stage */ 47 | description: string; 48 | /** Tasks that must be completed to complete the stage */ 49 | tasks: TutorialTaskData[]; 50 | /** Page which the task can be completed on */ 51 | taskPage: string; 52 | /** Skills that are unlocked with the stage */ 53 | skillUnlocks: string[]; 54 | /** Rewards given upon completion of the stage */ 55 | rewards: { 56 | currencies: IDQuantity[]; 57 | /** @deprecated use currencies instead */ 58 | gp?: number; 59 | /** @deprecated use currencies instead */ 60 | slayerCoins?: number; 61 | items: IDQuantity[]; 62 | }; 63 | /** Purchases that may be made from the shop during the stage */ 64 | allowedShopPurchases: string[]; 65 | /** Monsters that may be killed during the stage */ 66 | allowedMonsters: string[]; 67 | /** Items which cannot be sold during the stage */ 68 | bannedItemSales: string[]; 69 | /** If combat is allowed during the stage */ 70 | allowCombat: boolean; 71 | } 72 | declare class TutorialStage extends NamespacedObject implements EncodableObject { 73 | get name(): string; 74 | get description(): string; 75 | get complete(): boolean; 76 | get completedTasks(): number; 77 | get totalTasks(): number; 78 | claimed: boolean; 79 | tasks: TutorialTask[]; 80 | taskPage: Page; 81 | skillUnlocks: AnySkill[]; 82 | rewards: { 83 | currencies: CurrencyQuantity[]; 84 | items: AnyItemQuantity[]; 85 | }; 86 | allowedShopPurchases: Set; 87 | allowedMonsters: Set; 88 | bannedItemSales: Set; 89 | allowCombat: boolean; 90 | constructor(namespace: DataNamespace, data: TutorialStageData, game: Game); 91 | encode(writer: SaveWriter): SaveWriter; 92 | decode(reader: SaveWriter, version: number): void; 93 | resetProgress(): void; 94 | setClaimed(): void; 95 | } 96 | declare class TutorialRenderQueue { 97 | currentStageTasks: boolean; 98 | currentStageStatus: boolean; 99 | } 100 | declare class Tutorial implements EncodableObject { 101 | game: Game; 102 | /** If the tutorial has been completed */ 103 | complete: boolean; 104 | /** Items that are allowed to be purchased from the shop */ 105 | allowedShopPurchases: Set; 106 | /** Monsters that the player is allowed to fight */ 107 | allowedMonsters: Set; 108 | /** Items which are not allowed to be sold during the stage of the tutorial */ 109 | bannedItemSales: Set; 110 | /** If the tutorial currently allows accessing combat */ 111 | allowCombat: boolean; 112 | get stagesCompleted(): number; 113 | get totalStages(): number; 114 | /** Current stage the user is on. Undefined if tutorial has not been started. */ 115 | currentStage?: TutorialStage; 116 | /** Returns if the tutorial should start for the account */ 117 | get shouldStart(): boolean; 118 | stages: NamespaceRegistry; 119 | _stagesCompleted: number; 120 | renderQueue: TutorialRenderQueue; 121 | stageOrder: NamespacedArray; 122 | constructor(game: Game); 123 | registerStages(namespace: DataNamespace, data: TutorialStageData[]): void; 124 | registerStageOrder(order: InsertOrder[]): void; 125 | render(): void; 126 | continueOnLoad(): void; 127 | start(): void; 128 | completeTutorial(): void; 129 | startNextStage(): void; 130 | setupForStage(stage: TutorialStage): void; 131 | setStageMenus(stage: TutorialStage): void; 132 | renderProgress(): void; 133 | showStageHints(stage: TutorialStage): void; 134 | removeStageHints(stage: TutorialStage): void; 135 | updateTaskProgress(event: GameEvent, task: TutorialTask, stage: TutorialStage): void; 136 | claimStageOnClick(stage: TutorialStage): void; 137 | skipButtonOnClick(): void; 138 | skipTutorial(): void; 139 | encode(writer: SaveWriter): SaveWriter; 140 | decode(reader: SaveWriter, version: number): void; 141 | convertFromOldFormat(savegame: NewSaveGame, idMap: NumericIDMap): void; 142 | } 143 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | ## v1.13.0 3 | - Updated types to match game version V1.2 (?7650) 4 | - Updated package.json to reflect changes to libraries shipped with the game 5 | ## v1.12.0 6 | - Updated types to match game version V1.1.2 (?5867) 7 | ## v1.11.2 8 | - Improved the type definitions for Class method and property patching 9 | ## v1.11.1 10 | - Update types to match game version V1.1.1 (?5064) 11 | - Added missing type definition file for GameDataPackage 12 | - Type definitions have been generated without private/protected fields, to make method patching easier 13 | ## v1.11.0 14 | - Update to V1.1.0 15 | - Removed the old source getting and documentation code as this is no longer required to use the type defs 16 | - Updated the official type definitions 17 | - Changed Read Me to reflect the changes to this project 18 | ## v1.10.2 19 | - Update to Alpha v0.22.1 (?1183) 20 | ## v1.10.1 21 | - Update to support cachebuster version v1181 22 | - Minor fixes to some type defs 23 | ## v1.10.0 24 | - Update to support v0.22, cachebuster version v1180 25 | - Updated Official typedefs 26 | - Changed src/customTypes/gameTypes.ts to gameTypes/gameTypes.d.ts 27 | - If you are updating this project, I recommend removing everything from the `src/game` folder and running `npm run init` before building the typedefs 28 | - Update script now outputs logs to logs/*.txt 29 | ## v1.9.3 30 | - Update to cachebuster version v1120 31 | ## v1.9.2 32 | - Update to cachebuster version v1115 33 | ## v1.9.1 34 | - Update to cachebuster version v1113 35 | - Updated shop.js JSDOC 36 | ## v1.9.0 37 | - Updated to support v0.21, cachebuster version v1106 38 | - Added Official Typedefs from game sources to src/gameTypes 39 | - Removed files that are covered by official typdefs (If you are updating this project, I recommend removing everything from the `src/game` folder and running `npm run init` before building) 40 | - Changed update script to output logs to a file instead of console 41 | ## v1.8.4 42 | - Updated to cachebuster version v960 43 | ## v1.8.3 44 | - Updated to cachebuster version v943 45 | ## v1.8.2 46 | - Updated to cachebuster version v933 47 | ## v1.8.1 48 | - Updated to cachebuster version v908 49 | ## v1.8.0 50 | - Updated to cachebuster version v906 51 | ## v1.7.0 52 | - Updated to cachebuster version v832 53 | - Added type def for gamemode data 54 | - Added type def for random modifier for chaos mode 55 | - Added types to new chaos mode functions 56 | ## v1.6.2 57 | - Updated to cachebuster version v831 58 | ## v1.6.1 59 | - Updated to cachebuster version v826 60 | ## v1.6.0 61 | - Updated to cachebuster version v825 62 | - Removed some old properties from special attack interfaces 63 | - Added description to now implemented lifesteal modifier 64 | - Changed source documentation code to skip existing JSdoc comments in the source code 65 | - Changed source documentation code to support changing existing JSdoc comments to something else 66 | - Documented serializeSave.js 67 | ## v1.5.4 68 | - Fixed a bug where tsc wasn't working 69 | ## v1.5.3 70 | - Updated to cachebuster version v819 71 | ## v1.5.2 72 | - Updated to cachebuster version v818 73 | ## v1.5.1 74 | - Updated to cachebuster version v817 75 | ## v1.5.0 76 | - Updated to cachebuster version v813 77 | - Improved SaveGame type, and added some notes on variables that could be reduced in size or eliminated 78 | - Deprecated unused functions and variables 79 | ## v1.4.1 80 | - Updated to cachebuster version v809 81 | ## v1.4.0 82 | - Fixed fetching the index.html of the splash page and not the game 83 | - Annotated some new combat variables 84 | - Type annotated someCoolFunctions.js (formerly pushNotifications.js) 85 | - Updated to cachebuster version v807 86 | - Added descriptions to the bleed properties of Player special attacks 87 | ## v1.3.0 88 | - Updated to cachebuster version v791 89 | - Added descriptions to PlayerCombatData and EnemyCombatData properties 90 | - Added @types/simplebar to dependencies. You will either need to run `npm install` or `npm install @types/simplebar --save` for this change to take place. 91 | - Typed some untyped functions 92 | - Added typdef and described properties of global data objects combatAreas, slayerAreas, DUNGEONS, SLAYER, combatPassive, masteryMedia, masteryUnlocks,masteryCheckpointBonuses, MILESTONES, SKILLS 93 | - Added typedef for enemy modifiers and extended combatData.enemy by them 94 | - Added EnemyModifierObject for modifiers that apply to monsters 95 | - Finished item property descriptions 96 | - Added descriptions marking functions as callbacks if it appears unused but is actually used in HTML 97 | - Deprecated a number of unused functions and global variables 98 | - Updated modifier descriptions to reflect bug fixes 99 | ## v1.2.2 100 | - Updated to cachebuster verison v790 101 | ## v1.2.1 102 | - Updated to cachebuster version v789 103 | ## v1.2.0 104 | - Seperated ModifierObject into StandardModifierObject and SkillModifierObject 105 | - Started adding descriptions to item properties 106 | - Improved typing of Object.entries of Modifier objects 107 | - Typed new functions in agility.js 108 | - Updated to cachebuster version v788 109 | ## v1.1.1 110 | - Updated to cachebuster version v784 111 | ## v1.1.0 112 | - Improved/Updated modifier descriptions 113 | - Added version update script 114 | - Added Typescript as a dev-dependency. You will either need to run `npm install` or `npm i typescript --save-dev` for this change to take place. If `tsc` wasn't working to generate a typedef file it hopefully should now. 115 | - Added Changelog 116 | ## v1.0.0 117 | Project published. 118 | -------------------------------------------------------------------------------- /src/gameTypes/statProvider.d.ts: -------------------------------------------------------------------------------- 1 | interface IStatObjectData { 2 | modifiers?: ModifierValuesRecordData; 3 | enemyModifiers?: ModifierValuesRecordData; 4 | conditionalModifiers?: ConditionalModifierData[]; 5 | combatEffects?: TriggeredCombatEffectApplicatorData[]; 6 | } 7 | interface IStatObjectModificationData { 8 | modifiers?: ModifierValuesModificationData; 9 | enemyModifiers?: ModifierValuesModificationData; 10 | combatEffects?: CombatEffectApplicatorModificationData; 11 | conditionalModifiers?: ConditionalModifiersModificationData; 12 | } 13 | interface IStatObject { 14 | modifiers?: ModifierValue[]; 15 | enemyModifiers?: ModifierValue[]; 16 | conditionalModifiers?: ConditionalModifier[]; 17 | combatEffects?: CombatEffectApplicator[]; 18 | } 19 | /** An object that can provide modifiers, effect applicators or conditional modifiers */ 20 | declare class StatObject implements IStatObject, SoftDataDependant { 21 | modifiers?: ModifierValue[]; 22 | combatEffects?: CombatEffectApplicator[]; 23 | enemyModifiers?: ModifierValue[]; 24 | conditionalModifiers?: ConditionalModifier[]; 25 | /** If this stat object actually contains any stats */ 26 | get hasStats(): boolean; 27 | constructor(data: IStatObjectData, game: Game, where: string); 28 | registerSoftDependencies(data: IStatObjectData, game: Game): void; 29 | applyDataModification(data: IStatObjectModificationData, game: Game): void; 30 | describeAsSpanHTML(negMult?: number, posMult?: number): string; 31 | describeLineBreak(): string; 32 | describeAsSpans(negMult?: number, posMult?: number): HTMLSpanElement[]; 33 | describeSearch(): string; 34 | describePlain(): string; 35 | /** 36 | * Gets the descriptions of a stat providing object 37 | * @param statObject The object to get descriptions for 38 | * @param negMult A multiplier to apply to effects that are negative to the player 39 | * @param posMult A multiplier to apply to effects that are positive to the player 40 | * @param includeZero If zero valued effects should be included 41 | * @returns An array of [description, textClass] tuples 42 | */ 43 | static getDescriptions(statObject: IStatObject, negMult?: number, posMult?: number, includeZero?: boolean): StatDescription[]; 44 | /** 45 | * Checks if a description should be included when getting descriptions 46 | * @param isNegative If the given effect is negative to the player 47 | * @param negMult The multiplier to apply to effects that are negative to the player 48 | * @param posMult The multiplier to apply to effects that are positive to the player 49 | * @param includeZero If zero valued effects should be shown 50 | * @returns If the description should be shown 51 | */ 52 | static showDescription(isNegative: boolean, negMult: number, posMult: number, includeZero: boolean): boolean; 53 | /** 54 | * Gets the descriptions of a stat providing object, and passes them through a formatting function 55 | * @param statObject The object to get descriptions for 56 | * @param formatter The function to format the descriptions with 57 | * @param negMult A multiplier to apply to effects that are negative to the player 58 | * @param posMult A multiplier to apply to effects that are positive to the player 59 | * @param includeZero If zero valued effects should be included 60 | * @returns An array of formatted descriptions 61 | */ 62 | static formatDescriptions(statObject: IStatObject, formatter: DescriptionFormatter, negMult?: number, posMult?: number, includeZero?: boolean): T[]; 63 | static formatAsPlainList(statObject: IStatObject): string; 64 | /** Checks if an object with stat object data actually has any stats */ 65 | static hasStatsData(data: IStatObjectData): boolean; 66 | /** Checks if a stat object actually has any stats */ 67 | static hasStats(object: IStatObject): boolean; 68 | } 69 | /** Provides modifiers or stats to the Player or Enemy class */ 70 | interface IStatProvider { 71 | /** Modifiers that apply to the player */ 72 | modifiers?: ModifierTable; 73 | /** Modifiers that apply to enemies */ 74 | enemyModifiers?: ModifierTable; 75 | /** Modifiers that can apply to the player/enemy that only apply based on a condition */ 76 | conditionalModifiers?: ConditionalModifierSource[]; 77 | /** Equipment stats that apply to the player */ 78 | equipmentStats?: AnyEquipStat[]; 79 | /** CombatEffects applied via the player at the specified times */ 80 | combatEffects?: CombatEffectApplicator[]; 81 | } 82 | /** Provides modifiers or stats to the Player/Enemy class in Golbin Raid */ 83 | interface IRaidStatProvider { 84 | raidStats: IStatProvider; 85 | } 86 | declare class StatProvider implements IStatProvider { 87 | modifiers: ModifierTable; 88 | enemyModifiers: ModifierTable; 89 | conditionalModifiers: ConditionalModifierSource[]; 90 | equipmentStats: AnyEquipStat[]; 91 | combatEffects: CombatEffectApplicator[]; 92 | reset(): void; 93 | addStatObject(source: ModifierSource, stats: IStatObject, negMult?: number, posMult?: number): void; 94 | } 95 | declare class StatObjectSummary { 96 | modifiers: ModifierTable; 97 | enemyModifiers: ModifierTable; 98 | combatEffects: CombatEffectApplicator[]; 99 | conditionalModifiers: ConditionalModifierSource[]; 100 | addStatObject(source: ModifierSource, stats: IStatObject, negMult?: number, posMult?: number): void; 101 | getAllDescriptions(): StatDescription[]; 102 | } 103 | --------------------------------------------------------------------------------