Clash Blueprint Engine API
    Preparing search index...

    Class Battlefield

    Mutable combat state derived from a Village. Owns building/wall hit points and the occupancy arrays the pathfinder reads. What blocks movement and what counts as a target are decided by the game's category flags (passable / targetable) rather than a hardcoded category, so e.g. traps (passable, non-targetable) are ignored in any game that declares them that way. All state updates in place as things are destroyed so pathfinding stays consistent through the battle.

    Index
    coreId: string | undefined
    height: number
    structures: Map<string, SimStructure> = ...
    walls: Map<string, SimWallState> = ...
    width: number
    • Apply damage to a structure. Returns true on the tick it is destroyed.

      Parameters

      • id: string
      • amount: number

      Returns boolean

    • Apply damage to the wall on a tile. Returns its id and whether it broke.

      Parameters

      • x: number
      • y: number
      • amount: number

      Returns { broken: boolean; wallId: string | undefined }