export interface IUnit { id: string; name: string; unit_type: UnitType; movement: number; movement_type: MovementType; defense_type: DefenseType; cost: number; fuel: number; fuel_usage: number; vision: number; ability_data: IAbilityData[]; weapon_data: IWeaponData[]; sprite: UnitSprite; } export interface IUnitData { id: string; health: number; coord: ICoord; faction: number; team: number; state: UnitState; load_data: string[]; load_parent: string | null; cost: number; fuel: number; unit_id: string; user_id: string; ability_data: IAbilityData[]; weapon_data: IWeaponData[]; } export enum DefenseType { Infantry = "Infantry", MediumInfantry = "MediumInfantry", Armor = "Armor", MediumArmor = "MediumArmor", HeavyArmor = "HeavyArmor", SuperArmor = "SuperArmor", Recon = "Recon", Rockets = "Rockets", Missiles = "Missiles", APC = "APC", Artillery = "Artillery", AntiAir = "AntiAir", Fighter = "Fighter", MediumFighter = "MediumFighter", Helicopter = "Helicopter", MediumHelicopter = "MediumHelicopter", Bomber = "Bomber", Missile = "Missile", Battleship = "Battleship", Carrier = "Carrier", Cruiser = "Cruiser", Submarine = "Submarine", Lander = "Lander", SupportShip = "SupportShip" } export enum MovementType { Foot = "Foot", Boots = "Boots", Treads = "Treads", Tires = "Tires", Pipe = "Pipe", Tracks = "Tracks", Ship = "Ship", Sub = "Sub", Lander = "Lander", Heli = "Heli", Plane = "Plane" } export enum UnitType { Land = "Land", Air = "Air", Sea = "Sea" } export enum Tag { // UnitType All = "All", Land = "Land", Air = "Air", Sea = "Sea", // MovementType Foot = "Foot", Boots = "Boots", Treads = "Treads", Tires = "Tires", Pipe = "Pipe", Tracks = "Tracks", Ship = "Ship", Sub = "Sub", Lander = "Lander", Heli = "Heli", Plane = "Plane", // General Unit Type Soldier = "Soldier", Vehicle = "Vehicle", Direct = "Direct", Indirect = "Indirect", Transport = "Transport", // Tiles Plains = "Plains", Mountain = "Mountain", Forest = "Forest", River = "River", Road = "Road", Bridge = "Bridge", Ocean = "Ocean", Reef = "Reef", Shoal = "Shoal", PipeSeam = "PipeSeam", City = "City", Base = "Base", Port = "Port", HQ = "HQ", Airport = "Airport", Lab = "Lab", Beacon = "Beacon", Silo = "Silo", Income = "Income", Urban = "Urban", Support = "Support", // Stats Health = "Health" } export enum TileKind { Plains = 0, Mountain = 8, Forest = 11, River = 53, Road = 33, Bridge = 28, Ocean = 117, Reef = 162, Shoal = 163, Pipe = 199, PipeSeam = 209, City = 213, Base = 215, Port = 216, HQ = 220, Airport = 218, Lab = 222, Beacon = 224, Silo = 226 } export enum VictoryState { Rout = "Rout", Takeover = "Takeover", CaptureLimit = "CaptureLimit", RoundLimit = "RoundLimit" } export enum Weather { Random = "Random", Clear = "Clear", Rain = "Rain", Snow = "Snow" } export interface IBoundary { commander_cache: { [key: string]: ICommander }; unit_cache: { [key: string]: IUnit }; } export interface IGame { id: string; name: string; active: boolean; weather: Weather; weather_turn: number | null; victory_state: VictoryState | null; victory_team: number | null; victory_user_ids: string[]; map_data: number[][]; map_type: GridType; map_settings: IMapSettings; width: number; height: number; turn: number; round: number; creator_id: string; current_user_id: string | null; turn_user_id: string; user_data: IUserData[]; tile_data: ITileData[]; unit_data: IUnitData[]; boundary: IBoundary; } export enum UnitSprite { Infantry = "Infantry", MediumInfantry = "MediumInfantry", Tank = "Tank", Artillery = "Artillery", AntiAir = "AntiAir", APC = "APC", Rockets = "Rockets", Missiles = "Missiles", SuperTank = "SuperTank", Submarine = "Submarine", Cruiser = "Cruiser", Bomber = "Bomber", Missile = "Missile", SupportShip = "SupportShip", Fighter = "Fighter", StealthFighter = "StealthFighter", Battleship = "Battleship", MediumTank = "MediumTank", HeavyTank = "HeavyTank", Recon = "Recon", PipeRunner = "PipeRunner", Carrier = "Carrier", TransportShip = "TransportShip", MediumHelicopter = "MediumHelicopter", TransportHelicopter = "TransportHelicopter" } export interface IUserData { id: string; user_id: string; commander_id: string; active: boolean; funds: number; faction: number; team: number; turn: boolean; position: number; skip_count: number; power_active: PowerType | null; power_count: number; power_turn: number | null; power_data: IPowerData[]; charge: number; state: ActionKind | null; inactive_index: number | null; } export enum CommanderSprite { Andy = "Andy", Jake = "Jake", Max = "Max", Sami = "Sami", Nell = "Nell", Rachel = "Rachel", Olaf = "Olaf", Grit = "Grit", Colin = "Colin", Sasha = "Sasha", Drake = "Drake", Javier = "Javier", Grimm = "Grimm", Kanbei = "Kanbei", Sonja = "Sonja", Hachi = "Hachi", Eagle = "Eagle", Jess = "Jess", Sensei = "Sensei", Lash = "Lash", Kindle = "Kindle", Adder = "Adder", Flak = "Flak", Hawke = "Hawke", Jugger = "Jugger", Koal = "Koal", Sturm = "Sturm", VonBolt = "VonBolt", Girder = "Girder" } export enum AbilityKind { Capture = "Capture", Construct = "Construct", Delete = "Delete", Detonate = "Detonate", Fire = "Fire", Launch = "Launch", Load = "Load", Merge = "Merge", Produce = "Produce", Repair = "Repair", Stealth = "Stealth", Supply = "Supply", Unload = "Unload", Wait = "Wait" } export interface IAbilityData { id: string; ability_id: AbilityKind; active: boolean; magnitude: number | null; params: string[]; tags: Tag[]; } export interface IMapSettings { weather_seed: string | null; starting_weather: Weather; starting_funds: number; capture_strength: number; funds_per_turn: number; use_powers: boolean; use_fog: boolean; use_tag: boolean; use_teams: boolean; commander_bans: string[]; unit_bans: string[]; unit_unlocks: string[]; round_limit: number | null; capture_limit: number | null; unit_limit: number | null; } export interface ITile { id: TileKind; name: string; defense: number; capturable: boolean; vision: number; funds: boolean; primary_hq: boolean; secondary_hq: boolean; capture_count: boolean; repairs: UnitType[]; variants: number[]; weather_data: { [T in Weather]: { [T in MovementType]: number | undefined } }; ability_data: IAbilityData[]; } export interface ITileData { id: string; tile_id: TileKind; user_id: string | null; health: number; capture_health: number | null; load_data: string[]; faction: number | null; team: number | null; state: UnitState; coord: ICoord; ability_data: IAbilityData[]; } export interface IWeapon { id: WeaponKind; name: string; min_range: number; max_range: number; targets: { [T in UnitType]: MovementType[] }; damages: { [T in DefenseType]: number }; } export interface IWeaponData { id: string; weapon_id: WeaponKind; ammo: number | null; } export interface IFaction { id: number; name: string; color: number; } export enum GridType { Cardinal = "Cardinal", Hex = "Hex" } export interface ICoord { x: number; y: number; } export enum PowerKind { AttackBonus = 1, AttackBonusPerFunds = 2, AttackBonusPerTileDefense = 3, AttackBonusPerTileOwned = 4, CaptureBonus = 5, CostBonus = 6, CounterattackBonus = 7, DamageBounty = 8, Damage = 9, DamageFuelPercentage = 10, DamageTile = 11, DefenseBonus = 12, DeployUnitsTile = 13, DirectDefenseBonus = 14, EnemyChargeModifierPerFunds = 15, FirstStrike = 16, FuelUsageBonus = 17, FundIncomeBonus = 18, FundModifier = 19, IndirectDefenseBonus = 20, InstantCapture = 21, LuckReplacer = 22, MaxRangeBonus = 23, MinRangeBonus = 24, MovementBonus = 25, MovementCostReplacer = 26, RefreshUnits = 27, RepairBonus = 28, Repair = 29, SecretStat = 30, Strike = 31, Stun = 32, Supply = 33, TileAttackBonus = 34, TileDefenseBonus = 35, TileDefenseMultiplierBonus = 36, TileDeploy = 37, VisionBonus = 38, VisionPenetration = 39, WeatherChanceBonus = 40, WeatherChange = 41, WeatherReplacer = 42 } export enum WeaponKind { AACannon = 1, ArtilleryCannon = 2, ArtilleryMissiles = 3, ArtilleryRockets = 4, BattleshipArtillery = 5, Bazooka = 6, Bombs = 7, CarrierMissiles = 8, BCopterMachineGun = 9, BCopterMissiles = 10, CruiserCannon = 11, CruiserMissiles = 12, FighterMissiles = 13, LightMachineGun = 14, MachineGun = 15, MediumTankCannon = 16, MediumTankMachineGun = 17, MegatankCannon = 18, MegatankMachineGun = 19, NeotankCannon = 20, NeotankMachineGun = 21, PiperunnerCannon = 22, ReconMachineGun = 23, StealthMissiles = 24, TankCannon = 25, TankMachineGun = 26, Torpedos = 27 } export enum ActionKind { Ability = "Ability", Boot = "Boot", Defeat = "Defeat", GameEnd = "GameEnd", GameStart = "GameStart", Kick = "Kick", Power = "Power", Resign = "Resign", Turn = "Turn", Weather = "Weather" } export interface IAction { kind: ActionKind; params: string[]; result: string | null; index: number; turn: number; round: number; user_id: string; game_id: string; ability_id: AbilityKind | null; subject_unit_data_id: string | null; target_unit_data_id: string | null; subject_tile_data_id: string | null; target_tile_data_id: string | null; move_coords: ICoord[]; target_coords: ICoord[]; } export interface ICommander { id: string; name: string; description: string; faction: number; powerbar: number; ultrabar: number; passive: IPowerData[]; power: IPowerData[]; ultra: IPowerData[]; sprite: CommanderSprite; } export enum PowerType { Passive = "Passive", Power = "Power", Ultra = "Ultra" } export enum PowerPhase { Immediate = "Immediate", Tactical = "Tactical" } export interface IPower { id: PowerKind; name: string; phase: PowerPhase; } export interface IPowerData { id: string; power_id: PowerKind; magnitude: number | null; params: string[]; tags: Tag[]; tile_tags: Tag[]; } export enum UnitState { Ready = "Ready", Exhausted = "Exhausted", Stunned = "Stunned" }