import { PlayableCharacter } from './PlayableCharacters';
/**
* Types of game modifications for selection in the daily climb. If the modification is not used
* in the daily climb, then {@link ModificationType}.NONE should be used
* @enum
* @type ModificationType
* @constant
* @example
* const starterModType: ModificationType = ModificationType.STARTER;
*/
export enum ModificationType {
STARTER,
GENERIC,
DIFFICULTY,
LEGACY,
NONE
}
/**
* Game modifications used by the daily climb and custom games. All modifications used by the daily
* climb are pre-initialized in {@link ModificationMap} so they don't need to be reinitialized.
* New {@link Modification}s shouldn't be created unless they are not used by the daily climb
*/
export class Modification {
private readonly _type: ModificationType;
private readonly _id: string;
private readonly _positive: boolean;
private readonly _exclude: PlayableCharacter | null;
/**
* Create a new instance of a game modification
* @param {ModificationType} type Type of modification if used in the daily climb. Use
* {@link ModificationType}.NONE if not part of the daily climb
* @param {string} id ID of the modification
* @param {boolean} positive If the modification is positive
* @param {PlayableCharacter?} exclude {@link PlayableCharacter} to be excluded from being able
* to use this modification
*
* @example
* const blightChestsMod: Modification = new Modification(ModificationType.NONE,
* "Blight Chests", true);
*/
constructor(type: ModificationType, id: string, positive: boolean,
exclude?: PlayableCharacter) {
this._type = type;
this._id = id;
this._positive = positive;
this._exclude = typeof (exclude) === 'number' ? exclude : null;
}
/**
* Get the {@link ModificationType}
* @returns {ModificationType}
*/
get type(): ModificationType {
return this._type;
}
/**
* Get the id
* @returns {string}
*/
get id(): string {
return this._id;
}
/**
* Get the positivity
* @returns {boolean}
*/
get positive(): boolean {
return this._positive;
}
/**
* Get excluded {@link PlayableCharacter}
* @returns {PlayableCharacter}
*/
get exclude(): PlayableCharacter | null {
return this._exclude;
}
}
/**
* A map of {@link Modification}s used by the daily climb indexed by string IDs
* @type Map<string, Modification>
* @constant
*
* @example
* const shinyMod: Modification = ModificationMap.get('Shiny');
*/
export const ModificationMap: Map<string, Modification> = new Map([
['Shiny', new Modification(ModificationType.STARTER, 'Shiny', true)],
['Allstar', new Modification(ModificationType.STARTER, 'Allstar', true)],
['Draft', new Modification(ModificationType.STARTER, 'Draft', true)],
['SealedDeck', new Modification(ModificationType.STARTER, 'SealedDeck', true)],
['Insanity', new Modification(ModificationType.STARTER, 'Insanity', false)],
['Heirloom', new Modification(ModificationType.STARTER, 'Heirloom', true)],
['Specialized', new Modification(ModificationType.STARTER, 'Specialized', true)],
['Chimera', new Modification(ModificationType.STARTER, 'Chimera', true)],
['Cursed Run', new Modification(ModificationType.STARTER, 'Cursed Run', false)],
['Diverse', new Modification(ModificationType.GENERIC, 'Diverse', true)],
['Red Cards', new Modification(ModificationType.GENERIC, 'Red Cards', true, PlayableCharacter.Ironclad)],
['Green Cards', new Modification(ModificationType.GENERIC, 'Green Cards', true, PlayableCharacter.Silent)],
['Blue Cards', new Modification(ModificationType.GENERIC, 'Blue Cards', true, PlayableCharacter.Defect)],
['Purple Cards', new Modification(ModificationType.GENERIC, 'Purple Cards', true, PlayableCharacter.Watcher)],
['Colorless Cards', new Modification(ModificationType.GENERIC, 'Colorless Cards', true)],
['Time Dilation', new Modification(ModificationType.GENERIC, 'Time Dilation', true)],
['Vintage', new Modification(ModificationType.GENERIC, 'Vintage', true)],
['Hoarder', new Modification(ModificationType.GENERIC, 'Hoarder', false)],
['Flight', new Modification(ModificationType.GENERIC, 'Flight', true)],
['Uncertain Future', new Modification(ModificationType.GENERIC, 'Uncertain Future', false)],
['ControlledChaos', new Modification(ModificationType.GENERIC, 'ControlledChaos', true)],
['Elite Swarm', new Modification(ModificationType.DIFFICULTY, 'Elite Swarm', false)],
['Lethality', new Modification(ModificationType.DIFFICULTY, 'Lethality', false)],
['Night Terrors', new Modification(ModificationType.DIFFICULTY, 'Night Terrors', false)],
['Binary', new Modification(ModificationType.DIFFICULTY, 'Binary', false)],
['Midas', new Modification(ModificationType.DIFFICULTY, 'Midas', false)],
['Terminal', new Modification(ModificationType.DIFFICULTY, 'Terminal', false)],
['DeadlyEvents', new Modification(ModificationType.DIFFICULTY, 'DeadlyEvents', false)],
['Brewmaster', new Modification(ModificationType.LEGACY, 'Brewmaster', true)],
['MonsterHunter', new Modification(ModificationType.LEGACY, 'MonsterHunter', false)],
]);
/**
* {@link ModificationMap} in the form of an array
* @type Array<Modification>
* @constant
* @example
* const shinyModId: Modification = MasterModificationList[0];
*/
export const MasterModificationList: Array<Modification> = Array.from(ModificationMap.values());
Source