UNPKG

priconne-cb

Version:

A priconne Clan Battle Simulator, intended to be used for managing CB

77 lines (76 loc) 2.71 kB
import { CbProgress } from './types'; export declare const HP: number[][]; export declare const TIER_CHANGES: number[]; /** * A fuction to return a new CB element with previous progress * @param prog previous CB progess with variables only * @param validate Set it to false if validation not required */ export declare const loadProgress: (prog: CbProgress, validate?: boolean) => Promise<CB>; declare class CB { private TierChanges; private HP; rounds: number[]; tier: number; boss: { hp: number; maxHp: number; isHittable: boolean; }[]; minRound: number; maxRound: number; /** * Starts a cb instance at a specified round(s) or by default round 1 * @param startRounds the specified round(s) */ constructor(startRounds?: number[] | number); /** * Force adjust CB rounds based on the specified round(s) and hp * @param rounds the specified round(s) default is 1 * @param hp the specified hp with default max hp */ adjustRounds(rounds?: number[] | number, hp?: number[]): void; /** * Syncs the cb instance based on its current rounds and hp if provided. It is/should be called every time the cb round is changed * @param hp the optional provided hp */ sync(hp?: number[]): void; /** * Kills the specified boss * @param boss boss number (0 to 4) where 0 is boss 1, 1 is boss 2, 2 is boss 3 and so on. */ kill(boss: 0 | 1 | 2 | 3 | 4): void; /** * Hits a boss for a specified amount * @param boss boss number (0 to 4) where 0 is boss 1, 1 is boss 2, 2 is boss 3 and so on. * @param amount amount of damage dealt */ hit(boss: 0 | 1 | 2 | 3 | 4, amount: number): void; /** * Force sets current hp of a boss to a specified amount * @param boss boss number (0 to 4) where 0 is boss 1, 1 is boss 2, 2 is boss 3 and so on. * @param amount suitable hp amount */ setHp(boss: 0 | 1 | 2 | 3 | 4, amount: number): void; /** * Customises maxHP instead of using the hard coded default one * @param arr 2d array with max HPs of bosses in the format arr[boss number][tier] */ setMaxHp(arr: number[][]): void; /** * Customises tier changes instead of using the hard coded default one * @param arr Array with each element denoting the first round of a tier */ setTierChanges(arr: number[]): void; /** * * @returns 2d array with max HPs of bosses in the format arr[boss number][tier] */ getMaxHp(): any; /** * * @returns Array with each element denoting the first round of a tier */ getTierChanges(): any; } export default CB;