homm3-parsers
Version:
Collection of binary parsers able to parse various file formats related to Heroes of Might and Magic III
52 lines (51 loc) • 2.06 kB
TypeScript
import { Hero } from './enums/Hero';
import { FlaggedProp } from '../../../helpers/types';
import { Artifacts, PrimarySkills, SecondarySkillData } from './common';
import { Gender } from '../constants';
import { Spell } from './enums/Spell';
import { SecondarySkillType } from './enums/SecondarySkill';
import { WinConditionData } from './additionalInfo/WinCondition';
import { LoseConditionData } from './additionalInfo/LoseCondition';
export interface Rumor {
name: string;
desciption: string;
}
export interface CustomHero {
hero: Hero;
face: number;
name: string;
allowed_players: number;
}
export interface SecondarySkills {
count: number;
entries: SecondarySkillData[];
}
declare type WithExperience = FlaggedProp<'hasExperience', 'experience', number>;
declare type WithSecondarySkills = FlaggedProp<'hasSecondarySkills', 'secondarySkills', SecondarySkills>;
declare type WithArtifacts = FlaggedProp<'hasArtifacts', 'artifacts', Artifacts>;
declare type WithBiography = FlaggedProp<'hasBiography', 'biography', string>;
declare type WithSpells = FlaggedProp<'hasSpells', 'spells', number[]>;
declare type WithPrimarySkills = FlaggedProp<'hasPrimarySkills', 'primarySkills', PrimarySkills>;
export declare type HeroSetting = {
gender: Gender;
} & WithExperience & WithSecondarySkills & WithArtifacts & WithBiography & WithSpells & WithPrimarySkills;
export declare type HeroSettings = FlaggedProp<'hasSettings', 'settings', HeroSetting>;
export declare type AdditionalInfoBase = {
teamsCount: number;
teams?: number[];
availableHeroes: number[];
rumorsCount: number;
rumors: Rumor[];
} & WinConditionData & LoseConditionData;
export declare type AdditionalInfo = AdditionalInfoBase & {
customHeroesCount: number;
customHeroes: CustomHero[];
availableArtifacts: number[];
availableSpells: Spell[];
availableSkills: SecondarySkillType[];
heroSettings: HeroSettings[];
};
export declare type AdditionalInfoAB = AdditionalInfoBase & {
availableArtifacts: number[];
};
export {};