librarygames/tower-defense/Defense.xtl

Tower defense's rules, a library: tower-defense.xtl (scripted), play.xtl (the game: clicks, keys and the clock) and the web page all use these. Built on lib/Ecs: the creeps, the towers and their shots are rows of one world, and every rule is a system over all of them at once. The game is 2D underneath (a grid of tiles and a road) and drawn in 2.5D: an isometric god's-eye view, every point of the board turned into the picture by one linear map (and a click turned back by its inverse). A game's state is a tuple: (the world, the money, the lives, the waves begun, the creeps still to come, the seconds to the next, the tower picked to build, the view (0 the board, 1 the grimoire), the grimoire's page, the seconds played, how it stands: 0 playing, 1 every wave beaten, 2 no lives left; how fast the game runs (1, 2 or 4 times), and what the last click or key did).

source · imports ec: lib/Ecs.xtl lib/Ecs.xtlm; sv: lib/Svg.xtl; t: lib/Text.xtl

The data

ʰw̲orld : Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ˡn̲ew

ʰp̲os : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asPos : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etPos : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰd̲ropPos : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰk̲ind : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asKind : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etKind : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰd̲ropKind : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰl̲evel : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asLevel : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etLevel : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰd̲ropLevel : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰp̲rog : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asProg : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etProg : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰd̲ropProg : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲p : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asHp : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etHp : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰd̲ropHp : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲low : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asSlow : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etSlow : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰd̲ropSlow : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰc̲ool : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asCool : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etCool : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰa̲im, ʰb̲uild

ʰd̲ropCool : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰt̲arget : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asTarget : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etTarget : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰa̲im

ʰd̲ropTarget : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰd̲mg : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰi̲mpact

ʰh̲asDmg : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etDmg : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰa̲im

ʰd̲ropDmg : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰa̲rea : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰi̲mpact

ʰh̲asArea : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etArea : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰa̲im

ʰd̲ropArea : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰc̲hill : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰi̲mpact

ʰh̲asChill : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etChill : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰa̲im

ʰd̲ropChill : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰt̲ower : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asTower : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etTower : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰb̲uild

ʰd̲ropTower : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰc̲reep : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asCreep : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etCreep : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰs̲pawning

ʰd̲ropCreep : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲hot : a -> a

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰh̲asShot : (Num a, Truthy b) => a -> b

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

ʰs̲etShot : Float -> (Int, Float) -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }
Used in: ʰa̲im

ʰd̲ropShot : Float -> Int -> Float

function (private) · line 25

The layout: where it is (x then y, in tiles), what kind (1 to 3) and level, how far a creep has come along the road, its hit points, the seconds it is slowed, a tower's seconds to its next shot, a shot's target (an entity), damage, splash and chill, and what it is.

"h" ᵉᶜc̲omponents< "pos:2 kind level prog hp slow cool target dmg area chill tower creep shot"
ᵉᶜc̲omponents< expands to
ʰw̲orld ← { n → (n c̲at 30) r̲eshape 0.0 }
ʰp̲os ← { W → (3 4) s̲elect₂ W }
ʰh̲asPos ← { W → 0 < 2 s̲elect₂ W }
ʰs̲etPos ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 2) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (2 3 4) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 3) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropPos ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 2 = r̲ange 30 }
ʰk̲ind ← { W → (6) s̲elect₂ W }
ʰh̲asKind ← { W → 0 < 5 s̲elect₂ W }
ʰs̲etKind ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (5 6) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropKind ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 5 = r̲ange 30 }
ʰl̲evel ← { W → (8) s̲elect₂ W }
ʰh̲asLevel ← { W → 0 < 7 s̲elect₂ W }
ʰs̲etLevel ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (7 8) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropLevel ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 7 = r̲ange 30 }
ʰp̲rog ← { W → (10) s̲elect₂ W }
ʰh̲asProg ← { W → 0 < 9 s̲elect₂ W }
ʰs̲etProg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (9 10) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropProg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 9 = r̲ange 30 }
ʰh̲p ← { W → (12) s̲elect₂ W }
ʰh̲asHp ← { W → 0 < 11 s̲elect₂ W }
ʰs̲etHp ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (11 12) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropHp ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 11 = r̲ange 30 }
ʰs̲low ← { W → (14) s̲elect₂ W }
ʰh̲asSlow ← { W → 0 < 13 s̲elect₂ W }
ʰs̲etSlow ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (13 14) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropSlow ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 13 = r̲ange 30 }
ʰc̲ool ← { W → (16) s̲elect₂ W }
ʰh̲asCool ← { W → 0 < 15 s̲elect₂ W }
ʰs̲etCool ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (15 16) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCool ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 15 = r̲ange 30 }
ʰt̲arget ← { W → (18) s̲elect₂ W }
ʰh̲asTarget ← { W → 0 < 17 s̲elect₂ W }
ʰs̲etTarget ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (17 18) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTarget ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 17 = r̲ange 30 }
ʰd̲mg ← { W → (20) s̲elect₂ W }
ʰh̲asDmg ← { W → 0 < 19 s̲elect₂ W }
ʰs̲etDmg ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (19 20) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropDmg ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 19 = r̲ange 30 }
ʰa̲rea ← { W → (22) s̲elect₂ W }
ʰh̲asArea ← { W → 0 < 21 s̲elect₂ W }
ʰs̲etArea ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (21 22) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropArea ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 21 = r̲ange 30 }
ʰc̲hill ← { W → (24) s̲elect₂ W }
ʰh̲asChill ← { W → 0 < 23 s̲elect₂ W }
ʰs̲etChill ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (23 24) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropChill ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 23 = r̲ange 30 }
ʰt̲ower ← { W → (26) s̲elect₂ W }
ʰh̲asTower ← { W → 0 < 25 s̲elect₂ W }
ʰs̲etTower ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (25 26) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropTower ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 25 = r̲ange 30 }
ʰc̲reep ← { W → (28) s̲elect₂ W }
ʰh̲asCreep ← { W → 0 < 27 s̲elect₂ W }
ʰs̲etCreep ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (27 28) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropCreep ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 27 = r̲ange 30 }
ʰs̲hot ← { W → (30) s̲elect₂ W }
ʰh̲asShot ← { W → 0 < 29 s̲elect₂ W }
ʰs̲etShot ← { W (ids, v) →
  i ← r̲avel ids
  V ← (((t̲ally i) c̲at 1) r̲eshape 1.0) c̲at₂ ((t̲ally i) c̲at 1) r̲eshape v
  R ← f̲loat (r̲ange t̲ally W) '= t̲able i
  C ← f̲loat (29 30) '= t̲able r̲ange 30
  M ← 0 < R '+ '× i̲nner (((t̲ally i) c̲at 2) r̲eshape 1.0) '+ '× i̲nner C
  (W × f̲loat n̲ot M) + R '+ '× i̲nner V '+ '× i̲nner C
}
ʰd̲ropShot ← { W ids → W × f̲loat n̲ot ((r̲ange t̲ally W) m̲ember? r̲avel ids) '× t̲able 29 = r̲ange 30 }

rows : Box Char

value (private) · line 28

The map: R rows of C tiles, row by row; the grass as 1s, the road as 1s.

rows ← "td.toml" ⎕L̲IST "map"
Used in: cells, R

cells : Char

value (private) · line 29
cells ← ᵗj̲oin rows
Used in: C, GRASS, COL, DIST, BOARD

R : Int

value (private) · line 30
R ← t̲ally rows
Used in: C, ʰt̲ile

C : Int

value (private) · line 31
C ← (t̲ally cells) d̲iv R

GRASS : Int

value (private) · line 32
GRASS ← 0 + cells = f̲irst "."

ROAD : Int

value (private) · line 33
ROAD ← 1 − GRASS

FAR : Int

value (private) · line 35

A distance beyond any on the map.

FAR ← 1000000

ʰs̲hift : Int -> Int -> Int

function (private) · line 40

The road's tiles in order, from S to E: every road tile's distance to E by a flood (each one more than its nearest road neighbor, all at once, until nothing changes), then the tiles sorted by it, farthest first. The road is one path, so that order is the way along it.

ʰs̲hift ← { d k →
  k > 0 ? (k d̲rop d) c̲at k r̲eshape FAR
  ((n̲eg k) r̲eshape FAR) c̲at ((t̲ally d) + k) t̲ake d
}
Used in: ʰf̲lood

COL : Int

value (private) · line 44
COL ← ((r̲ange t̲ally cells) − 1) m̲od C
Used in: ʰf̲lood

ʰf̲lood : Int -> Int

function (private) · line 45
ʰf̲lood ← { d →
  e ← (FAR × GRASS) m̲ax d m̲in 1 + ((FAR × 0 + COL = C − 1) m̲ax d ʰs̲hift 1) m̲in ((FAR × 0 + COL = 0) m̲ax d ʰs̲hift -1) m̲in (d ʰs̲hift C) m̲in d ʰs̲hift n̲eg C
  '∧ r̲/ e = d ? d
  ʰf̲lood e
}
Used in: ʰf̲lood, DIST

DIST : Int

value (private) · line 50
DIST ← ʰf̲lood FAR × 0 + (r̲ange t̲ally cells) ≠ f̲irst w̲here cells = f̲irst "E"
Used in: PATH

PATH : Int

value (private) · line 51
PATH ← (g̲rade n̲eg (w̲here ROAD) s̲elect DIST) s̲elect w̲here ROAD
Used in: PX, PY, LONG, ˡr̲oad

PX : Float

value (private) · line 52
PX ← 0.5 + f̲loat (PATH − 1) m̲od C

PY : Float

value (private) · line 53
PY ← 0.5 + f̲loat (PATH − 1) d̲iv C

LONG : Int

value (private) · line 55

How long the road is, in tiles.

LONG ← (t̲ally PATH) − 1

ʰc̲ol : Box Char -> Int -> Float

function (private) · line 57

A column of a table from td.toml as numbers.

ʰc̲ol ← { T j → 'ˢᵛn̲um e̲ach j s̲elect₂ T }

TT : Box Char

value (private) · line 60

The towers, a row per kind and level (arrow 1 to 3, cannon 1 to 3, frost 1 to 3).

TT ← ("td.toml" "tower") ⎕T̲ABLE ("towers" "tower-fields")

RANGE : Float

value (private) · line 61
RANGE ← TT ʰc̲ol 2
Used in: ʰa̲im, ʰa̲bout

DAMAGE : Float

value (private) · line 62
DAMAGE ← TT ʰc̲ol 3
Used in: ʰa̲im, ʰa̲bout

COOLDOWN : Float

value (private) · line 63
COOLDOWN ← TT ʰc̲ol 4

SPLASH : Float

value (private) · line 64
SPLASH ← TT ʰc̲ol 5
Used in: ʰa̲im, ʰa̲bout

CHILL : Float

value (private) · line 65
CHILL ← TT ʰc̲ol 6
Used in: ʰa̲im, ʰa̲bout

COST : Int

value (private) · line 66
COST ← f̲loor TT ʰc̲ol 7

CT : Box Char

value (private) · line 68

The creeps, a row per kind.

CT ← ("td.toml" "creep") ⎕T̲ABLE ("creeps" "creep-fields")

HP : Float

value (private) · line 69
HP ← CT ʰc̲ol 2

SPEED : Float

value (private) · line 70
SPEED ← CT ʰc̲ol 3

ARMOR : Float

value (private) · line 71
ARMOR ← CT ʰc̲ol 4

BOUNTY : Int

value (private) · line 72
BOUNTY ← f̲loor CT ʰc̲ol 5

LEAK : Int

value (private) · line 73
LEAK ← f̲loor CT ʰc̲ol 6

LETTERS : Char

value (private) · line 74
LETTERS ← ᵗj̲oin 7 s̲elect₂ CT
Used in: ʰw̲ave

WAVES : Box Char

value (private) · line 76

The waves, the money and lives at the start, the art switch.

WAVES ← "td.toml" ⎕L̲IST "waves"

start : Int

value (private) · line 77
start ← f̲loor 'ˢᵛn̲um e̲ach "td.toml" ⎕L̲IST "start"
Used in: ˡn̲ew

ART : Bool

value (private) · line 78
ART ← "1" m̲atch d̲isclose f̲irst "td.toml" ⎕L̲IST "art"

PIECES : Box Char

value (private) · line 81

The pieces' names in the art: the towers by kind and level, then the creeps (the grimoire's pages are in this order too).

PIECES ← "arrow-1" "arrow-2" "arrow-3" "cannon-1" "cannon-2" "cannon-3" "frost-1" "frost-2" "frost-3" "runner" "brute" "shield"

SHOT : Float

value (private) · line 83

A shot's speed, tiles a second; the seconds between creeps.

SHOT ← 9.0
Used in: ʰf̲ly

GAP : Float

value (private) · line 84
GAP ← 1.0
Used in: ʰs̲pawning

A new game

ʰp̲air : (a, a) -> a

function (private) · line 89

n by 2 from two columns.

ʰp̲air ← { (a, b) → o̲\ (2 c̲at t̲ally a) r̲eshape a c̲at b }
Used in: ʰa̲long, ʰf̲ly

ʰr̲ows : (a, Int) -> a

function (private) · line 91

n rows, each the value v_i, m wide; and n rows each v, m wide.

ʰr̲ows ← { (v, m) → o̲\ (m c̲at t̲ally v) r̲eshape v }

ʰc̲ols : (a, Int) -> a

function (private) · line 92
ʰc̲ols ← { (v, n) → (n c̲at t̲ally v) r̲eshape v }

ˡn̲ew : (Any a, Num b, Num c, Num d, Num e, Num f, Num g, Num h) => a -> (Float, Int, Int, b, c, Float, d, e, f, Float, g, h, Char)

function · line 96

A new game: an empty world, the money and lives from td.toml, no wave begun, the arrow tower picked.

ˡn̲ew ← { z → (ʰw̲orld 96, f̲irst start, 2 s̲elect start, 0, 0 r̲eshape 0, 0.0, 1, 0, 1, 0.0, 0, 1, "Pick a tower below, click the grass to build it; click a tower to upgrade it (its cost is over it).") }

The systems

ʰc̲reeps : Num a => a -> Int

function (private) · line 101

The creeps, the towers, the shots alive.

ʰc̲reeps ← { W → w̲here (ᵉᶜa̲live W) ∧ ʰh̲asCreep W }

ʰt̲owers : Num a => a -> Int

function (private) · line 102
ʰt̲owers ← { W → w̲here (ᵉᶜa̲live W) ∧ ʰh̲asTower W }

ʰs̲hots : Num a => a -> Int

function (private) · line 103
ʰs̲hots ← { W → w̲here (ᵉᶜa̲live W) ∧ ʰh̲asShot W }

ʰa̲long : Float -> Float

function (private) · line 106

Where along the road the creeps are, from how far each has come: the segment it is on and how far along it, every creep at once.

ʰa̲long ← { p →
  i ← 0 m̲ax (LONG − 1) m̲in f̲loor p
  f ← p − f̲loat i
  x ← ((i + 1) s̲elect PX) + f × ((i + 2) s̲elect PX) − (i + 1) s̲elect PX
  y ← ((i + 1) s̲elect PY) + f × ((i + 2) s̲elect PY) − (i + 1) s̲elect PY
  ʰp̲air (x, y)
}

ʰs̲pawning : (Float, Int, Float) -> (Float, Int, Float)

function (private) · line 114

The next creep of the wave onto the road, when its time has come.

ʰs̲pawning ← { (W, q, tm) →
  (0 = t̲ally q) ∨ tm > 0.0 ? (W, q, tm)
  (spawned, ids) ← W ᵉᶜs̲pawn 1
  k ← f̲irst q
  creep ← ((spawned ʰs̲etCreep (ids, 1.0)) ʰs̲etKind (ids, f̲loat k)) ʰs̲etProg (ids, 0.0)
  fresh ← ((creep ʰs̲etHp (ids, k s̲elect HP)) ʰs̲etSlow (ids, 0.0)) ʰs̲etPos (ids, ʰa̲long 1 r̲eshape 0.0)
  (fresh, 1 d̲rop q, GAP)
}
Used in: ˡt̲ick

ʰc̲rawl : Float -> Float -> (Float, Int)

function (private) · line 124

Every creep comes along the road by its speed (half while slowed); the creeps past E get out, and cost their lives.

ʰc̲rawl ← { W dt →
  c ← ʰc̲reeps W
  0 = t̲ally c ? (W, 0)
  k ← f̲loor c s̲elect ʰk̲ind W
  sl ← c s̲elect ʰs̲low W
  p ← (c s̲elect ʰp̲rog W) + dt × (k s̲elect SPEED) × 1.0 − 0.5 × f̲loat sl > 0.0
  moved ← ((W ʰs̲etProg (c, p)) ʰs̲etSlow (c, 0.0 m̲ax sl − dt)) ʰs̲etPos (c, ʰa̲long p)
  out ← p ≥ f̲loat LONG
  (moved ᵉᶜd̲espawn out r̲eplicate c, '+ r̲/ 0 c̲at out r̲eplicate k s̲elect LEAK)
}
Used in: ˡt̲ick

ʰr̲ow : Num a => a -> Int -> Int

function (private) · line 135

A tower's row in the towers' table: its kind and level.

ʰr̲ow ← { W tw → (3 × (f̲loor tw s̲elect ʰk̲ind W) − 1) + f̲loor tw s̲elect ʰl̲evel W }

ʰa̲im : Float -> Float -> Float

function (private) · line 139

The towers aim and shoot: every tower against every creep at once (a table, towers down, creeps across), each ready tower at the creep in its reach that has come farthest, a shot spawned for each.

ʰa̲im ← { W dt →
  tw ← ʰt̲owers W
  0 = t̲ally tw ? W
  cool ← 0.0 m̲ax (tw s̲elect ʰc̲ool W) − dt
  cooled ← W ʰs̲etCool (tw, cool)
  c ← ʰc̲reeps cooled
  0 = t̲ally c ? cooled
  j ← cooled ʰr̲ow tw
  T ← tw s̲elect ʰp̲os cooled
  P ← c s̲elect ʰp̲os cooled
  dx ← (1 s̲elect₂ T) '− t̲able 1 s̲elect₂ P
  dy ← (2 s̲elect₂ T) '− t̲able 2 s̲elect₂ P
  reach ← ʰr̲ows (j s̲elect RANGE, t̲ally c)
  S ← (f̲loat ((dx × dx) + dy × dy) ≤ reach × reach) × ʰc̲ols (1.0 + c s̲elect ʰp̲rog cooled, t̲ally tw)
  best ← 'm̲ax r̲/₂ S
  pick ← 'm̲in r̲/₂ (ʰc̲ols (r̲ange t̲ally c, t̲ally tw)) + 1000 × 0 + S < ʰr̲ows (best, t̲ally c)
  ready ← (cool ≤ 0.0) ∧ best > 0.0
  n ← '+ r̲/ 0 + ready
  0 = n ? cooled
  from ← ready r̲eplicate tw
  js ← ready r̲eplicate j
  (spawned, ids) ← cooled ᵉᶜs̲pawn n
  aimed ← ((spawned ʰs̲etShot (ids, 1.0)) ʰs̲etPos (ids, from s̲elect ʰp̲os spawned)) ʰs̲etTarget (ids, f̲loat (ready r̲eplicate pick) s̲elect c)
  loaded ← ((aimed ʰs̲etDmg (ids, js s̲elect DAMAGE)) ʰs̲etArea (ids, js s̲elect SPLASH)) ʰs̲etChill (ids, js s̲elect CHILL)
  loaded ʰs̲etCool (from, js s̲elect COOLDOWN)
}
Used in: ˡt̲ick

ʰi̲mpact : Float -> Int -> Float

function (private) · line 169

Shots that reach their target: every hitting shot against every creep at once (shots down, creeps across): the target, and with a splash every creep near where it lands, takes the shot's damage less its armor (never below 1); a chill slows them.

ʰi̲mpact ← { W hs →
  c ← ʰc̲reeps W
  tg ← f̲loor hs s̲elect ʰt̲arget W
  I ← tg s̲elect ʰp̲os W
  P ← c s̲elect ʰp̲os W
  dx ← (1 s̲elect₂ I) '− t̲able 1 s̲elect₂ P
  dy ← (2 s̲elect₂ I) '− t̲able 2 s̲elect₂ P
  area ← ʰr̲ows (hs s̲elect ʰa̲rea W, t̲ally c)
  H ← (tg '= t̲able c) ∨ (area > 0.0) ∧ ((dx × dx) + dy × dy) ≤ area × area
  arm ← ʰc̲ols ((f̲loor c s̲elect ʰk̲ind W) s̲elect ARMOR, t̲ally hs)
  D ← (f̲loat H) × 1.0 m̲ax (ʰr̲ows (hs s̲elect ʰd̲mg W, t̲ally c)) − arm
  cold ← 'm̲ax r̲/₁ (f̲loat H) × ʰr̲ows (hs s̲elect ʰc̲hill W, t̲ally c)
  (W ʰs̲etHp (c, (c s̲elect ʰh̲p W) − '+ r̲/₁ D)) ʰs̲etSlow (c, (c s̲elect ʰs̲low W) m̲ax cold)
}
Used in: ʰf̲ly

ʰf̲ly : Float -> Float -> Float

function (private) · line 185

Every shot flies at its target; shots whose target is gone vanish, and those that reach it hit (and go).

ʰf̲ly ← { W dt →
  all ← ʰs̲hots W
  0 = t̲ally all ? W
  alive ← (ᵉᶜa̲live W) ∧ ʰh̲asCreep W
  ok ← (f̲loor all s̲elect ʰt̲arget W) s̲elect alive
  kept ← W ᵉᶜd̲espawn (n̲ot ok) r̲eplicate all
  s ← ok r̲eplicate all
  0 = t̲ally s ? kept
  S ← s s̲elect ʰp̲os kept
  D ← ((f̲loor s s̲elect ʰt̲arget kept) s̲elect ʰp̲os kept) − S
  far ← ('+ r̲/₂ D × D) ^ 0.5
  k ← 1.0 m̲in (SHOT × dt) ÷ 0.001 m̲ax far
  flown ← kept ʰs̲etPos (s, S + D × ʰp̲air (k, k))
  hs ← (far ≤ SHOT × dt) r̲eplicate s
  0 = t̲ally hs ? flown
  (flown ʰi̲mpact hs) ᵉᶜd̲espawn hs
}
Used in: ˡt̲ick

ʰb̲eaten : Float -> (Float, Int)

function (private) · line 204

The creeps with no hit points left are beaten: their money is won, and they go.

ʰb̲eaten ← { W →
  c ← ʰc̲reeps W
  dead ← ((c s̲elect ʰh̲p W) ≤ 0.0) r̲eplicate c
  (W ᵉᶜd̲espawn dead, '+ r̲/ 0 c̲at (f̲loor dead s̲elect ʰk̲ind W) s̲elect BOUNTY)
}
Used in: ˡt̲ick

ʰo̲utcome : (Num a, Num c, Num d) => (a, Int, b, c) -> d

function (private) · line 210

How it stands: no lives 2, every wave begun and beaten 1, else 0.

ʰo̲utcome ← { (lv, wv, q, W) →
  lv ≤ 0 ? 2
  (wv = t̲ally WAVES) ∧ (0 = t̲ally q) ∧ 0 = t̲ally ʰc̲reeps W ? 1
  0
}
Used in: ˡt̲ick

ˡt̲ick : (Any a, Num b, Any c, Num d, Num e, Any f) => (Float, Int, Int, Int, Int, Float, a, b, c, Float, d, e, f) -> Float -> (Float, Int, Int, Int, Int, Float, a, b, c, Float, d, e, f)

function · line 221

A tick of the clock, dt seconds: the next creep comes, the creeps come along the road, the towers shoot, the shots fly and hit, the beaten creeps pay; each a system over every entity at once. While the grimoire is open the board waits (only the time moves, for its turning pictures). A game over stays as it is.

ˡt̲ick ← { s dt →
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) ← s
  st > 0 ? s
  md = 1 ? (W, mo, lv, wv, q, tm, sel, md, pg, t + dt, st, sp, ms)
  d ← dt × f̲loat sp
  (spawned, coming, wait) ← ʰs̲pawning (W, q, tm − d)
  (crawled, lost) ← spawned ʰc̲rawl d
  (kept, won) ← ʰb̲eaten (crawled ʰa̲im d) ʰf̲ly d
  lives ← lv − lost
  (kept, mo + won, lives, wv, coming, wait, sel, md, pg, t + d, ʰo̲utcome (lives, wv, coming, kept), sp, ms)
}
Used in: ᵘl̲oop, ᵘg̲o

Clicks and keys

ʰw̲ave : (Any a, Num b, Any c, Num d, Num e) => (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char) -> (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char)

function (private) · line 236

The next wave on its way, when the last is over.

ʰw̲ave ← { s →
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) ← s
  wv ≥ t̲ally WAVES ? ʰs̲aid (s, "That was the last wave.")
  (0 < t̲ally q) ∨ 0 < t̲ally ʰc̲reeps W ? ʰs̲aid (s, "Beat this wave first.")
  (W, mo, lv, wv + 1, LETTERS i̲ndexOf d̲isclose (wv + 1) s̲elect WAVES, 0.0, sel, md, pg, t, st, sp, @ f̲ormat< "Wave {wv + 1} is coming.")
}
f̲ormat< expands to
("Wave " c̲at (f̲ormat (wv + 1)) c̲at " is coming.")
Used in: ˡc̲lick, ˡk̲ey

ʰt̲owerAt : Float -> Float -> Int

function (private) · line 244

The tower whose box holds the point xy of the picture (the nearest one when boxes overlap), or 0: every tower's box tested at once.

ʰt̲owerAt ← { W xy →
  tw ← ʰt̲owers W
  0 = t̲ally tw ? 0
  P ← tw s̲elect ʰp̲os W
  sx ← ʰs̲x (1 s̲elect₂ P, 2 s̲elect₂ P)
  sy ← ʰs̲y (1 s̲elect₂ P, 2 s̲elect₂ P, 0.0)
  z ← ʰb̲oxZ tw s̲elect ʰl̲evel W
  x ← f̲irst xy
  y ← 2 s̲elect xy
  in ← ((a̲bs x − sx) ≤ 18.0) ∧ (y ≤ sy + 10.0) ∧ y ≥ sy − z
  n̲ot '∨ r̲/ in ? 0
  (f̲irst g̲rade n̲eg ((f̲loat in) × 1000.0) + '+ r̲/₂ P) s̲elect tw
}
Used in: ˡc̲lick

ʰb̲oxZ : Float -> Float

function (private) · line 259

How tall a tower stands in the picture, by level: its picture, or its box.

ʰb̲oxZ ← { l → ART ? (s̲hape l) r̲eshape 0.85 × SPRITE◆ 26.0 + 10.0 × l }
Used in: ʰt̲owerAt

ʰo̲n : Float -> Int -> Int

function (private) · line 261

The tower on tile k (a number from 1), or 0.

ʰo̲n ← { W k →
  tw ← ʰt̲owers W
  T ← tw s̲elect ʰp̲os W
  at ← (1 + (C × f̲loor 2 s̲elect₂ T) + f̲loor 1 s̲elect₂ T) = k
  f̲irst (at r̲eplicate tw) c̲at 0
}
Used in: ʰb̲uild

ʰb̲uild : (Any a, Num b, Any c, Num d, Num e) => (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char) -> Int -> (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char)

function (private) · line 269

A click on tile k: a tower of the kind picked built there (on grass, if the money is there), or the tower there upgraded (to level 3).

ʰb̲uild ← { s k →
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) ← s
  k = 0 ? s
  0 = k s̲elect GRASS ? ʰs̲aid (s, "Towers go on the grass, not the road.")
  tw ← W ʰo̲n k
  tw > 0 ? ʰu̲pgrade (s, tw)
  cost ← (1 + 3 × sel − 1) s̲elect COST
  cost > mo ? ʰs̲aid (s, @ f̲ormat< "That tower costs {cost}; the money is {mo}.")
  (spawned, ids) ← W ᵉᶜs̲pawn 1
  tower ← ((spawned ʰs̲etTower (ids, 1.0)) ʰs̲etKind (ids, f̲loat sel)) ʰs̲etLevel (ids, 1.0)
  built ← (tower ʰs̲etCool (ids, 0.0)) ʰs̲etPos (ids, (0.5 + f̲loat (k − 1) m̲od C) c̲at 0.5 + f̲loat (k − 1) d̲iv C)
  (built, mo − cost, lv, wv, q, tm, sel, md, pg, t, st, sp, @ f̲ormat< "Built: {d_isclose (1 + 3 * sel - 1) s_elect 1 s_elect_2 TT} ({cost}). Click it to upgrade.")
}
f̲ormat< expands to
("That tower costs " c̲at (f̲ormat (cost)) c̲at "; the money is " c̲at (f̲ormat (mo)) c̲at ".")
f̲ormat< expands to
("Built: " c̲at (f̲ormat (d̲isclose (1 + 3 × sel − 1) s̲elect 1 s̲elect₂ TT)) c̲at " (" c̲at (f̲ormat (cost)) c̲at "). Click it to upgrade.")
Used in: ˡc̲lick

ʰu̲pgrade : (Any a, Num b, Any c, Num d, Num e) => ((Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char), Int) -> (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char)

function (private) · line 282
ʰu̲pgrade ← { (s, tw) →
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) ← s
  l ← f̲loor tw s̲elect ʰl̲evel W
  l ≥ 3 ? ʰs̲aid (s, "That tower is at the top level.")
  cost ← (1 + (W ʰr̲ow tw)) s̲elect COST
  cost > mo ? ʰs̲aid (s, @ f̲ormat< "The upgrade costs {cost}; the money is {mo}.")
  (W ʰs̲etLevel (tw, f̲loat l + 1), mo − cost, lv, wv, q, tm, sel, md, pg, t, st, sp, @ f̲ormat< "Upgraded to {d_isclose (1 + (W h:r_ow tw)) s_elect 1 s_elect_2 TT} (level {l + 1}, {cost}).")
}
f̲ormat< expands to
("The upgrade costs " c̲at (f̲ormat (cost)) c̲at "; the money is " c̲at (f̲ormat (mo)) c̲at ".")
f̲ormat< expands to
("Upgraded to " c̲at (f̲ormat (d̲isclose (1 + (W ʰr̲ow tw)) s̲elect 1 s̲elect₂ TT)) c̲at " (level " c̲at (f̲ormat (l + 1)) c̲at ", " c̲at (f̲ormat (cost)) c̲at ").")

PAGES : Int

value (private) · line 292

The grimoire's pages: the nine towers by kind and level, then the three creeps.

PAGES ← 12
Used in: ʰb̲ook

ʰs̲aid : (Any a, Num b, Any c, Num d, Num e) => ((Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char), Char) -> (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char)

function (private) · line 294

The state with a new message.

ʰs̲aid ← { (s, m) →
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) ← s
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, m)
}

ʰf̲aster : (Any a, Num b, Any c, Num d, Num e) => (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char) -> (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char)

function (private) · line 299

The game run faster: 1, 2, 4 times, then 1 again.

ʰf̲aster ← { s →
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) ← s
  n ← (1 + (1 2 4 i̲ndexOf sp) m̲od 3) s̲elect 1 2 4
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, n, @ f̲ormat< "Speed {n}x.")
}
f̲ormat< expands to
("Speed " c̲at (f̲ormat (n)) c̲at "x.")
Used in: ˡc̲lick, ˡk̲ey

ʰs̲et : (Any a, Num b, Any c, Num d, Num e) => (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char) -> (Int, b, Int) -> (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char)

function (private) · line 305

The view and the picked tower changed.

ʰs̲et ← { s (sel, md, pg) →
  (W, mo, lv, wv, q, tm, a, b, c, t, st, sp, ms) ← s
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms)
}

TW : Float

value (private) · line 311

The board's view: the picture's units of a tile, where tile (0, 0)'s corner is, the toolbar's buttons and the grimoire's.

TW ← 32.0

TH : Float

value (private) · line 312
TH ← 16.0
Used in: ʰt̲ile, ʰs̲y, MID, MIDZ

OX : Float

value (private) · line 313
OX ← 352.0

OY : Float

value (private) · line 314
OY ← 96.0

VIEW : Float

value (private) · line 315
VIEW ← 0.0 0.0 880.0 600.0

BAR : Float

value (private) · line 316
BAR ← 6 4 r̲eshape 12 532 132 52  156 532 132 52  300 532 132 52  444 532 132 52  588 532 132 52  732 532 136 52.0
Used in: ˡc̲lick, ʰb̲ar

BOOK : Float

value (private) · line 317
BOOK ← 3 4 r̲eshape 60 520 180 52  260 520 180 52  640 520 180 52.0

ʰt̲ile : Float -> Int

function (private) · line 320

The tile under a point of the picture (a number from 1), or 0 off the map: the inverse of the board's map.

ʰt̲ile ← { xy →
  a ← ((f̲irst xy) − OX) ÷ TW
  b ← ((2 s̲elect xy) − OY) ÷ TH
  gx ← f̲loor 0.5 × a + b
  gy ← f̲loor 0.5 × b − a
  (gx < 0) ∨ (gy < 0) ∨ (gx ≥ C) ∨ gy ≥ R ? 0
  1 + (C × gy) + gx
}
Used in: ˡc̲lick

ˡc̲lick : (Any a, Num b, Any c, Num d, Num e) => (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char) -> Float -> (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char)

function · line 334

A click at xy (the picture's units): in the grimoire its buttons (back, next, close; a click outside it closes it too); on the board the toolbar (a tower to build, the next wave, the speed, the grimoire), a tower (upgrade it: anywhere on its box, which stands up over the tiles behind it) or a tile (build there).

ˡc̲lick ← { s xy →
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) ← s
  st > 0 ? s
  md = 1 ? ʰb̲ook (s, ʰb̲ookHit xy)
  b ← BAR ˢᵛh̲it xy
  (b > 0) ∧ b ≤ 3 ? s ʰs̲et (b, 0, pg)
  b = 4 ? ʰw̲ave s
  b = 5 ? ʰf̲aster s
  b = 6 ? s ʰs̲et (sel, 1, pg)
  tw ← W ʰt̲owerAt xy
  tw > 0 ? ʰu̲pgrade (s, tw)
  s ʰb̲uild ʰt̲ile xy
}

PANEL : Float

value (private) · line 349

Which of the grimoire's buttons a click is on (1 back, 2 next, 3 close); a click outside its panel closes it too.

PANEL ← 1 4 r̲eshape 30 70 820 520.0
Used in: ʰb̲ookHit

ʰb̲ookHit : Float -> Int

function (private) · line 350
ʰb̲ookHit ← { xy → 0 = PANEL ˢᵛh̲it xy ? 3◆ BOOK ˢᵛh̲it xy }
Used in: ˡc̲lick

ʰb̲ook : (Any a, Num b, Any c, Num d, Num e) => ((Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char), Int) -> (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char)

function (private) · line 351
ʰb̲ook ← { (s, b) →
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) ← s
  b = 1 ? s ʰs̲et (sel, 1, 1 + (pg + PAGES − 2) m̲od PAGES)
  b = 2 ? s ʰs̲et (sel, 1, 1 + pg m̲od PAGES)
  b = 3 ? s ʰs̲et (sel, 0, pg)
  s
}
Used in: ˡc̲lick, ˡk̲ey

ˡk̲ey : (Any a, Num b, Any c, Num d, Num e) => (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char) -> Char -> (Float, Int, a, Int, Int, Float, Int, b, Int, c, d, e, Char)

function · line 363

A key: 1, 2, 3 pick the tower to build (left and right step through them), the space bar sends the next wave, f runs the game faster (1, 2, 4 times), g opens or closes the grimoire (left and right turn its pages there; Enter or x closes it too).

ˡk̲ey ← { s name →
  (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) ← s
  k ← ("1" "2" "3" "LEFT" "RIGHT" " " "g" "f" "Enter" "x") i̲ndexOf e̲nclose name
  (k > 10) ∨ st > 0 ? s
  (md = 1) ∧ k ≥ 9 ? s ʰs̲et (sel, 0, pg)
  k ≥ 9 ? s
  k = 8 ? ʰf̲aster s
  k = 7 ? s ʰs̲et (sel, 1 − md, pg)
  (md = 1) ∧ k = 4 ? ʰb̲ook (s, 1)
  (md = 1) ∧ k = 5 ? ʰb̲ook (s, 2)
  md = 1 ? s
  k = 6 ? ʰw̲ave s
  k = 4 ? s ʰs̲et (1 + (sel + 1) m̲od 3, md, pg)
  k = 5 ? s ʰs̲et (1 + sel m̲od 3, md, pg)
  s ʰs̲et (k, md, pg)
}
Used in: ᵘl̲oop, built, wave

What it shows

ˡs̲tatus : (Any a, Any b, Any c, Any d, Any e, Any f, Any g, Any h, Any i, Any j, Any k, Any l, Any m) => (a, b, c, d, e, f, g, h, i, j, k, l, m) -> k

function · line 384

0 playing, 1 every wave beaten, 2 no lives left.

ˡs̲tatus ← { (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) → st }

ˡs̲core : (Any a, Any c, Any d, Any e, Any f, Any g, Any h, Any i, Any j, Any k) => (a, b, b, b, c, d, e, f, g, h, i, j, k) -> b

function · line 387

The money, the lives, the waves begun.

ˡs̲core ← { (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) → mo c̲at lv c̲at wv }

ˡc̲ounts : (Num a, Any b, Any c, Any d, Any e, Any f, Any g, Any h, Any i, Any j, Any k, Any l, Any m) => (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Int

function · line 390

How many are alive: towers, creeps, shots.

ˡc̲ounts ← { (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) → (t̲ally ʰt̲owers W) c̲at (t̲ally ʰc̲reeps W) c̲at t̲ally ʰs̲hots W }

ˡt̲owers : (Any a, Any b, Any c, Any d, Any e, Any f, Any g, Any h, Any i, Any j, Any k, Any l) => (Float, a, b, c, d, e, f, g, h, i, j, k, l) -> Float

function · line 393

The towers: kind, level and tile (x, y), a row each.

ˡt̲owers ← { (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) →
  tw ← ʰt̲owers W
  P ← f̲loat f̲loor tw s̲elect ʰp̲os W
  o̲\ (4 c̲at t̲ally tw) r̲eshape (tw s̲elect ʰk̲ind W) c̲at (tw s̲elect ʰl̲evel W) c̲at (1 s̲elect₂ P) c̲at 2 s̲elect₂ P
}

ˡr̲oad : Any a => a -> Int

function · line 400

The road as tiles in order (row, column, from 0).

ˡr̲oad ← { s → o̲\ (2 c̲at t̲ally PATH) r̲eshape ((PATH − 1) d̲iv C) c̲at (PATH − 1) m̲od C }

ʰs̲x : (Float, Float) -> Float

function (private) · line 403

A point of the board (x, y in tiles, z up in the picture's units) in the picture: one linear map, every point at once.

ʰs̲x ← { (x, y) → OX + TW × x − y }

ʰs̲y : (Float, Float, Float) -> Float

function (private) · line 404
ʰs̲y ← { (x, y, z) → (OY + TH × x + y) − z }

ʰp̲oly : (Float, Float, Float, Char) -> Char

function (private) · line 406

A polygon through points of the board.

ʰp̲oly ← { (x, y, z, fill) →
  sx ← ʰs̲x (x, y)
  sy ← ʰs̲y (x, y, z)
  pts ← ᵗj̲oin '{ i → e̲nclose @ f̲ormat< "{sv:w_hole i s_elect sx},{sv:w_hole i s_elect sy} " } e̲ach r̲ange t̲ally x
  @ f̲ormat< "<polygon points=\"{pts}\" fill=\"{fill}\" stroke=\"#1d1f2b\" stroke-width=\"1\"/>"
}
f̲ormat< expands to
((f̲ormat (ˢᵛw̲hole i s̲elect sx)) c̲at "," c̲at (f̲ormat (ˢᵛw̲hole i s̲elect sy)) c̲at " ")
f̲ormat< expands to
"<polygon points=\"" c̲at (f̲ormat (pts)) c̲at "\" fill=\"" c̲at (f̲ormat (fill)) c̲at "\" stroke=\"#1d1f2b\" stroke-width=\"1\"/>"

ʰt̲ileAt : Int -> Box Char

function (private) · line 413

The board, drawn once: each tile a diamond, grass or road.

ʰt̲ileAt ← { k →
  gx ← f̲loat (k − 1) m̲od C
  gy ← f̲loat (k − 1) d̲iv C
  fill ← d̲isclose (1 + k s̲elect ROAD) s̲elect "#3a7d44" "#8d7b5e"
  e̲nclose ʰp̲oly (gx c̲at (gx + 1.0) c̲at (gx + 1.0) c̲at gx, gy c̲at gy c̲at (gy + 1.0) c̲at gy + 1.0, 0.0 0.0 0.0 0.0, fill)
}
Used in: BOARD

BOARD : Char

value (private) · line 419
BOARD ← ᵗj̲oin 'ʰt̲ileAt e̲ach r̲ange t̲ally cells
Used in: ˡd̲raw

FACES : Box Char

value (private) · line 421

A tower's colors (top, left, right faces) by kind.

FACES ← 3 3 r̲eshape "#d4a373" "#a47148" "#7f5539" "#adb5bd" "#6c757d" "#495057" "#bde0fe" "#7fb7e8" "#4a90c8"
Used in: ʰb̲ox

ʰb̲ox : (Float, Float, Float, Float, Float, Int) -> Char

function (private) · line 425

A box standing on the board: its middle (x, y), half its width, its height, and its corners turned by a (radians) about the middle; the two faces toward the viewer and the top.

ʰb̲ox ← { (x, y, w, z, a, kind) →
  u ← (a + 0.25 × p̲i @) + 0.5 × (p̲i @) × 0.0 1.0 2.0 3.0
  cx ← x + w × 1.414 × c̲os u
  cy ← y + w × 1.414 × s̲in u
  i ← g̲rade n̲eg cx + cy
  near ← 3 t̲ake i
  l ← 2 t̲ake near
  r ← (f̲irst near) c̲at 3 s̲elect near
  col ← '{ j → e̲nclose d̲isclose j s̲elect kind s̲elect FACES } e̲ach 1 2 3
  zs ← 0.0 0.0 c̲at z c̲at z
  left ← ʰp̲oly ((l s̲elect cx) c̲at r̲ev l s̲elect cx, (l s̲elect cy) c̲at r̲ev l s̲elect cy, zs, d̲isclose 2 s̲elect col)
  right ← ʰp̲oly ((r s̲elect cx) c̲at r̲ev r s̲elect cx, (r s̲elect cy) c̲at r̲ev r s̲elect cy, zs, d̲isclose 3 s̲elect col)
  top ← ʰp̲oly (cx, cy, 4 r̲eshape z, d̲isclose f̲irst col)
  left c̲at right c̲at top
}
Used in: ʰd̲rawTower

ʰd̲rawTower : (Float, Float, Int, Int, Float) -> Char

function (private) · line 441

A tower drawn: a box as tall as its level, with a pip a level on top.

ʰd̲rawTower ← { (x, y, kind, level, a) →
  z ← 14.0 + 10.0 × f̲loat level
  pips ← ᵗj̲oin '{ i → e̲nclose @ f̲ormat< "<circle cx=\"{sv:w_hole (h:s_x (x, y)) + 6.0 * f_loat i - 2}\" cy=\"{sv:w_hole (h:s_y (x, y, z)) - 3.0}\" r=\"2.5\" fill=\"#ffffff\"/>" } e̲ach r̲ange level
  (ʰb̲ox (x, y, 0.32, z, a, kind)) c̲at pips
}
f̲ormat< expands to
("<circle cx=\"" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲x (x, y)) + 6.0 × f̲loat i − 2)) c̲at "\" cy=\"" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲y (x, y, z)) − 3.0)) c̲at "\" r=\"2.5\" fill=\"#ffffff\"/>")
Used in: TOWERART, ʰs̲pin

TOWERART : Box Char

value (private) · line 448

Every kind and level of tower drawn once, on tile (0, 0); the board moves each to its tile (towers do not turn on the board).

TOWERART ← '{ j → e̲nclose ʰd̲rawTower (0.0, 0.0, 1 + (j − 1) d̲iv 3, 1 + (j − 1) m̲od 3, 0.0) } e̲ach r̲ange 9
Used in: ʰp̲laced

ʰp̲laced : (Float, Float, Int) -> Char

function (private) · line 449
ʰp̲laced ← { (x, y, j) → @ f̲ormat< "<g transform=\"translate({sv:w_hole (h:s_x (x, y)) - OX} {sv:w_hole (h:s_y (x, y, 0.0)) - OY})\">{d_isclose j s_elect TOWERART}</g>" }
f̲ormat< expands to
"<g transform=\"translate(" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲x (x, y)) − OX)) c̲at " " c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲y (x, y, 0.0)) − OY)) c̲at ")\">" c̲at (f̲ormat (d̲isclose j s̲elect TOWERART)) c̲at "</g>"
Used in: ʰt̲hing

ʰu̲pLabel : (Float, Float, Int, Int) -> Char

function (private) · line 452

Over a tower, what its upgrade costs: gold when the money is there, gray when not, "top" at level 3 (j: its row in the towers' table).

ʰu̲pLabel ← { (x, y, j, mo) →
  top ← 0 = j m̲od 3
  cost ← (1 + j m̲in 8) s̲elect COST
  words ← ʰu̲pWords (top, cost)
  fill ← d̲isclose (1 + (n̲ot top) ∧ cost ≤ mo) s̲elect "#adb5bd" "#ffd166"
  z ← ʰl̲abelZ j
  @ f̲ormat< "<text x=\"{sv:w_hole h:s_x (x, y)}\" y=\"{sv:w_hole (h:s_y (x, y, z)) - 8.0}\" font-size=\"13\" font-weight=\"bold\" text-anchor=\"middle\" fill=\"{fill}\" stroke=\"#1d1f2b\" stroke-width=\"3\" paint-order=\"stroke\">{words}</text>"
}
f̲ormat< expands to
"<text x=\"" c̲at (f̲ormat (ˢᵛw̲hole ʰs̲x (x, y))) c̲at "\" y=\"" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲y (x, y, z)) − 8.0)) c̲at "\" font-size=\"13\" font-weight=\"bold\" text-anchor=\"middle\" fill=\"" c̲at (f̲ormat (fill)) c̲at "\" stroke=\"#1d1f2b\" stroke-width=\"3\" paint-order=\"stroke\">" c̲at (f̲ormat (words)) c̲at "</text>"
Used in: ʰt̲hing

ʰl̲abelZ : Int -> Float

function (private) · line 462

How high over its tile a tower's label stands: over its picture, or over its box (taller each level).

ʰl̲abelZ ← { j → ART ? 0.6 × SPRITE◆ 30.0 + 10.0 × f̲loat 1 + (j − 1) m̲od 3 }
Used in: ʰu̲pLabel

ʰu̲pWords : Truthy a => (a, Int) -> Char

function (private) · line 463
ʰu̲pWords ← { (top, cost) → top ? "top"◆ @ f̲ormat< "up {cost}" }
f̲ormat< expands to
"up " c̲at (f̲ormat (cost))
Used in: ʰu̲pLabel

SPRITE : Float

value (private) · line 467

A piece drawn from the art (td.toml art = "1"): its picture from X_eTaL-extensions (a 3D model rendered in Blender), every piece at one scale, standing on its tile.

SPRITE ← 112.0

ʰs̲prite : (Float, Float, a) -> Char

function (private) · line 468
ʰs̲prite ← { (x, y, name) → @ f̲ormat< "<image class=\"entity flat\" href=\"art/{name}.png\" x=\"{sv:w_hole (h:s_x (x, y)) - 0.5 * SPRITE}\" y=\"{sv:w_hole (h:s_y (x, y, 0.0)) - 0.85 * SPRITE}\" width=\"{sv:w_hole SPRITE}\" height=\"{sv:w_hole SPRITE}\"/>" }
f̲ormat< expands to
"<image class=\"entity flat\" href=\"art/" c̲at (f̲ormat (name)) c̲at ".png\" x=\"" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲x (x, y)) − 0.5 × SPRITE)) c̲at "\" y=\"" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲y (x, y, 0.0)) − 0.85 × SPRITE)) c̲at "\" width=\"" c̲at (f̲ormat (ˢᵛw̲hole SPRITE)) c̲at "\" height=\"" c̲at (f̲ormat (ˢᵛw̲hole SPRITE)) c̲at "\"/>"
Used in: ʰt̲hing

ʰh̲pBar : (Float, Float, Int, Float, Float) -> Char

function (private) · line 470

A creep's hit points, as a bar over it.

ʰh̲pBar ← { (x, y, kind, hp, z) →
  frac ← 0.0 m̲ax 1.0 m̲in hp ÷ kind s̲elect HP
  sy ← ʰs̲y (x, y, z)
  @ f̲ormat< "<rect x=\"{sv:w_hole (h:s_x (x, y)) - 10.0}\" y=\"{sv:w_hole sy}\" width=\"20\" height=\"3\" fill=\"#3a0d0d\"/><rect x=\"{sv:w_hole (h:s_x (x, y)) - 10.0}\" y=\"{sv:w_hole sy}\" width=\"{sv:w_hole 20.0 * frac}\" height=\"3\" fill=\"#ff595e\"/>"
}
f̲ormat< expands to
"<rect x=\"" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲x (x, y)) − 10.0)) c̲at "\" y=\"" c̲at (f̲ormat (ˢᵛw̲hole sy)) c̲at "\" width=\"20\" height=\"3\" fill=\"#3a0d0d\"/><rect x=\"" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲x (x, y)) − 10.0)) c̲at "\" y=\"" c̲at (f̲ormat (ˢᵛw̲hole sy)) c̲at "\" width=\"" c̲at (f̲ormat (ˢᵛw̲hole 20.0 × frac)) c̲at "\" height=\"3\" fill=\"#ff595e\"/>"
Used in: ʰt̲hing

CREEPCOLORS : Box Char

value (private) · line 476

A creep drawn: a shadow, a body by its kind, its hit points as a bar.

CREEPCOLORS ← "#80ed99" "#c1440e" "#5c7aa6"
Used in: ʰd̲rawCreep

ʰd̲rawCreep : (Float, Float, Int, Float) -> Char

function (private) · line 477
ʰd̲rawCreep ← { (x, y, kind, hp) →
  sx ← ˢᵛw̲hole ʰs̲x (x, y)
  sy ← ʰs̲y (x, y, 0.0)
  r ← (1 + kind) s̲elect 0.0 6.0 10.0 8.0
  col ← d̲isclose kind s̲elect CREEPCOLORS
  frac ← 0.0 m̲ax 1.0 m̲in hp ÷ kind s̲elect HP
  @ f̲ormat< "<ellipse cx=\"{sx}\" cy=\"{sv:w_hole sy}\" rx=\"{sv:w_hole r}\" ry=\"{sv:w_hole 0.5 * r}\" fill=\"#000000\" opacity=\"0.3\"/><circle class=\"entity\" cx=\"{sx}\" cy=\"{sv:w_hole sy - r}\" r=\"{sv:w_hole r}\" fill=\"{col}\" stroke=\"#1d1f2b\" stroke-width=\"1.5\"/><rect x=\"{sv:w_hole (h:s_x (x, y)) - 10.0}\" y=\"{sv:w_hole sy - 6.0 + 2.0 * r}\" width=\"20\" height=\"3\" fill=\"#3a0d0d\"/><rect x=\"{sv:w_hole (h:s_x (x, y)) - 10.0}\" y=\"{sv:w_hole sy - 6.0 + 2.0 * r}\" width=\"{sv:w_hole 20.0 * frac}\" height=\"3\" fill=\"#ff595e\"/>"
}
f̲ormat< expands to
"<ellipse cx=\"" c̲at (f̲ormat (sx)) c̲at "\" cy=\"" c̲at (f̲ormat (ˢᵛw̲hole sy)) c̲at "\" rx=\"" c̲at (f̲ormat (ˢᵛw̲hole r)) c̲at "\" ry=\"" c̲at (f̲ormat (ˢᵛw̲hole 0.5 × r)) c̲at "\" fill=\"#000000\" opacity=\"0.3\"/><circle class=\"entity\" cx=\"" c̲at (f̲ormat (sx)) c̲at "\" cy=\"" c̲at (f̲ormat (ˢᵛw̲hole sy − r)) c̲at "\" r=\"" c̲at (f̲ormat (ˢᵛw̲hole r)) c̲at "\" fill=\"" c̲at (f̲ormat (col)) c̲at "\" stroke=\"#1d1f2b\" stroke-width=\"1.5\"/><rect x=\"" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲x (x, y)) − 10.0)) c̲at "\" y=\"" c̲at (f̲ormat (ˢᵛw̲hole sy − 6.0 + 2.0 × r)) c̲at "\" width=\"20\" height=\"3\" fill=\"#3a0d0d\"/><rect x=\"" c̲at (f̲ormat (ˢᵛw̲hole (ʰs̲x (x, y)) − 10.0)) c̲at "\" y=\"" c̲at (f̲ormat (ˢᵛw̲hole sy − 6.0 + 2.0 × r)) c̲at "\" width=\"" c̲at (f̲ormat (ˢᵛw̲hole 20.0 × frac)) c̲at "\" height=\"3\" fill=\"#ff595e\"/>"

ʰs̲hotAt : (Float, Float) -> Char

function (private) · line 486

A shot drawn, in the air.

ʰs̲hotAt ← { (x, y) → @ f̲ormat< "<circle cx=\"{sv:w_hole h:s_x (x, y)}\" cy=\"{sv:w_hole h:s_y (x, y, 22.0)}\" r=\"3\" fill=\"#fff3b0\" stroke=\"#000000\" stroke-width=\"0.5\"/>" }
f̲ormat< expands to
"<circle cx=\"" c̲at (f̲ormat (ˢᵛw̲hole ʰs̲x (x, y))) c̲at "\" cy=\"" c̲at (f̲ormat (ˢᵛw̲hole ʰs̲y (x, y, 22.0))) c̲at "\" r=\"3\" fill=\"#fff3b0\" stroke=\"#000000\" stroke-width=\"0.5\"/>"
Used in: ʰt̲hing

ʰt̲hings : (Float, Int) -> Box Char

function (private) · line 489

Everything on the board, drawn far to near (by x + y): what each entity is picks its drawing.

ʰt̲hings ← { (W, mo) →
  e ← w̲here ᵉᶜa̲live W
  P ← e s̲elect ʰp̲os W
  order ← g̲rade ('+ r̲/₂ P) + 0.01 × f̲loat 0 + e s̲elect ʰh̲asShot W
  '{ i → e̲nclose ʰt̲hing (W, i s̲elect e, i s̲elect P, mo) } e̲ach order
}
Used in: ʰt̲hingsIf

ʰt̲hingsIf : Num a => (Float, Int, a) -> Box Char

function (private) · line 496

The board's things, unless the grimoire is open over them.

ʰt̲hingsIf ← { (W, mo, md) → md = 1 ? 0 r̲eshape e̲nclose ""◆ ʰt̲hings (W, mo) }
Used in: ˡd̲raw

ʰt̲hing : (Float, Int, Float, Int) -> Char

function (private) · line 497
ʰt̲hing ← { (W, n, p, mo) →
  x ← f̲irst p
  y ← 2 s̲elect p
  ART ∧ n s̲elect ʰh̲asTower W ? (ʰs̲prite (x, y, d̲isclose (W ʰr̲ow n) s̲elect PIECES)) c̲at ʰu̲pLabel (x, y, W ʰr̲ow n, mo)
  ART ∧ n s̲elect ʰh̲asCreep W ? (ʰs̲prite (x, y, d̲isclose (9 + f̲loor n s̲elect ʰk̲ind W) s̲elect PIECES)) c̲at ʰh̲pBar (x, y, f̲loor n s̲elect ʰk̲ind W, n s̲elect ʰh̲p W, 44.0)
  n s̲elect ʰh̲asTower W ? (ʰp̲laced (x, y, W ʰr̲ow n)) c̲at ʰu̲pLabel (x, y, W ʰr̲ow n, mo)
  n s̲elect ʰh̲asCreep W ? ʰd̲rawCreep (x, y, f̲loor n s̲elect ʰk̲ind W, n s̲elect ʰh̲p W)
  ʰs̲hotAt (x, y)
}
Used in: ʰt̲hings

ʰb̲utton : (Float, a, Int) -> Box Char

function (private) · line 507

A button: its rectangle, its words, lit when picked.

ʰb̲utton ← { (r, words, lit) →
  fill ← d̲isclose (1 + lit) s̲elect "#2b2d42" "#4361ee"
  cls ← d̲isclose (1 + lit) s̲elect "button" "button you"
  e̲nclose @ f̲ormat< "<g class=\"{cls}\"><rect x=\"{sv:w_hole f_irst r}\" y=\"{sv:w_hole 2 s_elect r}\" width=\"{sv:w_hole 3 s_elect r}\" height=\"{sv:w_hole 4 s_elect r}\" rx=\"8\" fill=\"{fill}\" stroke=\"#8d99ae\" stroke-width=\"2\"/><text x=\"{sv:w_hole (f_irst r) + 0.5 * 3 s_elect r}\" y=\"{sv:w_hole (2 s_elect r) + 33.0}\" font-size=\"18\" text-anchor=\"middle\" fill=\"#ffffff\">{words}</text></g>"
}
f̲ormat< expands to
("<g class=\"" c̲at (f̲ormat (cls)) c̲at "\"><rect x=\"" c̲at (f̲ormat (ˢᵛw̲hole f̲irst r)) c̲at "\" y=\"" c̲at (f̲ormat (ˢᵛw̲hole 2 s̲elect r)) c̲at "\" width=\"" c̲at (f̲ormat (ˢᵛw̲hole 3 s̲elect r)) c̲at "\" height=\"" c̲at (f̲ormat (ˢᵛw̲hole 4 s̲elect r)) c̲at "\" rx=\"8\" fill=\"" c̲at (f̲ormat (fill)) c̲at "\" stroke=\"#8d99ae\" stroke-width=\"2\"/><text x=\"" c̲at (f̲ormat (ˢᵛw̲hole (f̲irst r) + 0.5 × 3 s̲elect r)) c̲at "\" y=\"" c̲at (f̲ormat (ˢᵛw̲hole (2 s̲elect r) + 33.0)) c̲at "\" font-size=\"18\" text-anchor=\"middle\" fill=\"#ffffff\">" c̲at (f̲ormat (words)) c̲at "</text></g>")
Used in: ʰb̲ar, ʰp̲age

ʰb̲ar : Int -> Char

function (private) · line 514

The toolbar: the three towers (with what they cost), the next wave, the speed, the grimoire; drawn once for each tower picked and speed.

ʰb̲ar ← { j →
  sel ← 1 + (j − 1) d̲iv 3
  sp ← (1 + (j − 1) m̲od 3) s̲elect 1 2 4
  names ← "Arrow" "Cannon" "Frost"
  towers ← '{ k → ʰb̲utton (k s̲elect BAR, @ f̲ormat< "{d_isclose k s_elect names} {(1 + 3 * k - 1) s_elect COST}", k = sel) } e̲ach 1 2 3
  ᵗj̲oin towers c̲at (ʰb̲utton (4 s̲elect BAR, "Next wave", 0 = 1)) c̲at (ʰb̲utton (5 s̲elect BAR, @ f̲ormat< "Speed {sp}x", sp > 1)) c̲at ʰb̲utton (6 s̲elect BAR, "Grimoire", 0 = 1)
}
f̲ormat< expands to
((f̲ormat (d̲isclose k s̲elect names)) c̲at " " c̲at (f̲ormat ((1 + 3 × k − 1) s̲elect COST)))
f̲ormat< expands to
("Speed " c̲at (f̲ormat (sp)) c̲at "x")
Used in: BARS

BARS : Box Char

value (private) · line 521
BARS ← 'ʰb̲ar m̲ap r̲ange 9
Used in: ˡd̲raw

ʰw̲rap : Char -> Int -> Box Char

function (private) · line 524

Text cut into lines of about n characters, at spaces: each word's line from a running sum of the words' lengths.

ʰw̲rap ← { t n →
  w ← (n̲ot t = f̲irst " ") p̲artition t
  len ← 1 + 'ʰl̲en e̲ach w
  line ← (('+ s̲\ len) − 1) d̲iv n
  '{ i → e̲nclose ᵗj̲oin '{ x → e̲nclose (d̲isclose x) c̲at " " } e̲ach (line = i) r̲eplicate w } e̲ach u̲nique line
}

ʰl̲en : Box Char -> Int

function (private) · line 530
ʰl̲en ← { x → t̲ally d̲isclose x }
Used in: ʰw̲rap

ʰp̲anel : Truthy a => a -> Char

function (private) · line 533

The grimoire's panel; with the art, a window in it where the piece turns in the 3D view (behind the picture).

ʰp̲anel ← { art →
  art ? "<path d=\"M46 70 H834 Q850 70 850 86 V574 Q850 590 834 590 H46 Q30 590 30 574 V86 Q30 70 46 70 Z M70 130 V470 H410 V130 Z\" fill=\"#11121c\" fill-rule=\"evenodd\" opacity=\"0.96\" stroke=\"#8d99ae\" stroke-width=\"2\"/>"
  "<rect x=\"30\" y=\"70\" width=\"820\" height=\"520\" rx=\"16\" fill=\"#11121c\" opacity=\"0.96\" stroke=\"#8d99ae\" stroke-width=\"2\"/>"
}
Used in: ʰp̲age

ʰp̲age : (Int, Float) -> Box Char

function (private) · line 539

The grimoire's page pg: the piece turning (the 3D art's turntable, or the game's own drawing turned), its name and what it does.

ʰp̲age ← { (pg, t) →
  panel ← e̲nclose ʰp̲anel ART
  tower ← pg ≤ 9
  pic ← ʰs̲pin (pg, t)
  words ← ʰa̲bout pg
  lines ← '{ i → (430.0, 150.0 + 30.0 × f̲loat i − 1, 20.0) ʰw̲ords d̲isclose i s̲elect words } e̲ach r̲ange t̲ally words
  buttons ← (ʰb̲utton (1 s̲elect BOOK, "Back", 0 = 1)) c̲at (ʰb̲utton (2 s̲elect BOOK, "Next", 0 = 1)) c̲at ʰb̲utton (3 s̲elect BOOK, "Close", 0 = 1)
  hint ← (440.0, 500.0, 15.0) ʰw̲ords "Left, right: pages | g, Enter, x or a click outside: close"
  panel c̲at pic c̲at (r̲avel lines) c̲at buttons c̲at hint
}
Used in: ʰb̲ookIf

ʰs̲pin : (Int, Float) -> Box Char

function (private) · line 551

The piece on page pg: its picture when the art is in use (it turns in the 3D view), else the game's own drawing, turned with the time.

ʰs̲pin ← { (pg, t) →
  ART ? e̲nclose @ f̲ormat< "<rect class=\"flat\" x=\"70\" y=\"130\" width=\"340\" height=\"340\" fill=\"#11121c\"/><image class=\"entity flat\" href=\"art/{d_isclose pg s_elect PIECES}.png\" x=\"70\" y=\"130\" width=\"340\" height=\"340\"/>"
  pg ≤ 9 ? e̲nclose "<g transform=\"translate(-816 -504) scale(3)\">" c̲at (ʰd̲rawTower (6.0, 6.0, 1 + (pg − 1) d̲iv 3, 1 + (pg − 1) m̲od 3, t)) c̲at "</g>"
  e̲nclose "<g transform=\"translate(-992 -623) scale(3.5)\">" c̲at (ʰd̲rawCreep (5.6, 5.6, pg − 9, 1000.0)) c̲at "</g>"
}
f̲ormat< expands to
("<rect class=\"flat\" x=\"70\" y=\"130\" width=\"340\" height=\"340\" fill=\"#11121c\"/><image class=\"entity flat\" href=\"art/" c̲at (f̲ormat (d̲isclose pg s̲elect PIECES)) c̲at ".png\" x=\"70\" y=\"130\" width=\"340\" height=\"340\"/>")
Used in: ʰp̲age

ʰa̲bout : Int -> Box Char

function (private) · line 558

What page pg says: a tower's name, level, numbers, words and its next upgrade; a creep's name, numbers and words.

ʰa̲bout ← { pg →
  pg > 9 ? ʰc̲reepAbout pg − 9
  name ← d̲isclose pg s̲elect 1 s̲elect₂ TT
  lvl ← 1 + (pg − 1) m̲od 3
  next ← ʰn̲extUp pg
  head ← (e̲nclose @ f̲ormat< "{name} (level {lvl})") c̲at e̲nclose @ f̲ormat< "Reach {pg s_elect RANGE} | damage {pg s_elect DAMAGE} | every {pg s_elect COOLDOWN} s"
  more ← e̲nclose @ f̲ormat< "Splash {pg s_elect SPLASH} | slows {pg s_elect CHILL} s | costs {pg s_elect COST}"
  head c̲at more c̲at (e̲nclose "") c̲at ((d̲isclose pg s̲elect 8 s̲elect₂ TT) ʰw̲rap 38) c̲at (e̲nclose "") c̲at e̲nclose next
}
f̲ormat< expands to
((f̲ormat (name)) c̲at " (level " c̲at (f̲ormat (lvl)) c̲at ")")
f̲ormat< expands to
("Reach " c̲at (f̲ormat (pg s̲elect RANGE)) c̲at " | damage " c̲at (f̲ormat (pg s̲elect DAMAGE)) c̲at " | every " c̲at (f̲ormat (pg s̲elect COOLDOWN)) c̲at " s")
f̲ormat< expands to
("Splash " c̲at (f̲ormat (pg s̲elect SPLASH)) c̲at " | slows " c̲at (f̲ormat (pg s̲elect CHILL)) c̲at " s | costs " c̲at (f̲ormat (pg s̲elect COST)))
Used in: ʰp̲age

ʰn̲extUp : Int -> Char

function (private) · line 567
ʰn̲extUp ← { pg →
  3 = 1 + (pg − 1) m̲od 3 ? "The top level."
  @ f̲ormat< "Click it on the board to upgrade: {(pg + 1) s_elect COST}."
}
f̲ormat< expands to
"Click it on the board to upgrade: " c̲at (f̲ormat ((pg + 1) s̲elect COST)) c̲at "."
Used in: ʰa̲bout

ʰc̲reepAbout : Int -> Box Char

function (private) · line 571
ʰc̲reepAbout ← { k →
  name ← d̲isclose k s̲elect 1 s̲elect₂ CT
  head ← (e̲nclose name) c̲at e̲nclose @ f̲ormat< "Hit points {k s_elect HP} | speed {k s_elect SPEED} | armor {k s_elect ARMOR}"
  more ← e̲nclose @ f̲ormat< "Worth {k s_elect BOUNTY} | costs {k s_elect LEAK} lives if it gets out"
  head c̲at more c̲at (e̲nclose "") c̲at (d̲isclose k s̲elect 8 s̲elect₂ CT) ʰw̲rap 38
}
f̲ormat< expands to
("Hit points " c̲at (f̲ormat (k s̲elect HP)) c̲at " | speed " c̲at (f̲ormat (k s̲elect SPEED)) c̲at " | armor " c̲at (f̲ormat (k s̲elect ARMOR)))
f̲ormat< expands to
("Worth " c̲at (f̲ormat (k s̲elect BOUNTY)) c̲at " | costs " c̲at (f̲ormat (k s̲elect LEAK)) c̲at " lives if it gets out")
Used in: ʰa̲bout

ʰw̲ords : (Float, Float, Float) -> Char -> Box Char

function (private) · line 578

Words at x, y in size z, light on the dark picture.

ʰw̲ords ← { (x, y, z) t → e̲nclose @ f̲ormat< "<text x=\"{sv:w_hole x}\" y=\"{sv:w_hole y}\" font-size=\"{sv:w_hole z}\" fill=\"#e9ecef\">{t}</text>" }
f̲ormat< expands to
("<text x=\"" c̲at (f̲ormat (ˢᵛw̲hole x)) c̲at "\" y=\"" c̲at (f̲ormat (ˢᵛw̲hole y)) c̲at "\" font-size=\"" c̲at (f̲ormat (ˢᵛw̲hole z)) c̲at "\" fill=\"#e9ecef\">" c̲at (f̲ormat (t)) c̲at "</text>")
Used in: ʰp̲age, ˡd̲raw

ʰs̲ays : (Num d, Num e) => (a, b, c, d, e) -> Char

function (private) · line 580

What the top line says.

ʰs̲ays ← { (mo, lv, wv, t, st) →
  st = 1 ? @ f̲ormat< "Every wave beaten! Lives {lv} | Money {mo} | Time {f_loor t} s"
  st = 2 ? @ f̲ormat< "The creeps got through. Wave {wv} | Time {f_loor t} s"
  @ f̲ormat< "Money {mo} | Lives {lv} | Wave {wv} of {t_ally WAVES} | Time {f_loor t} s"
}
f̲ormat< expands to
("Every wave beaten! Lives " c̲at (f̲ormat (lv)) c̲at " | Money " c̲at (f̲ormat (mo)) c̲at " | Time " c̲at (f̲ormat (f̲loor t)) c̲at " s")
f̲ormat< expands to
("The creeps got through. Wave " c̲at (f̲ormat (wv)) c̲at " | Time " c̲at (f̲ormat (f̲loor t)) c̲at " s")
f̲ormat< expands to
"Money " c̲at (f̲ormat (mo)) c̲at " | Lives " c̲at (f̲ormat (lv)) c̲at " | Wave " c̲at (f̲ormat (wv)) c̲at " of " c̲at (f̲ormat (t̲ally WAVES)) c̲at " | Time " c̲at (f̲ormat (f̲loor t)) c̲at " s"
Used in: ˡd̲raw

ˡd̲raw : (Any c, Any d, Num e, Num f, Num g) => (Float, Int, a, b, c, d, Int, e, Int, Float, f, g, Char) -> Char

function · line 589

The picture, as SVG text: the board and everything on it drawn far to near, the toolbar, the top line, and the grimoire over it all when open.

ˡd̲raw ← { (W, mo, lv, wv, q, tm, sel, md, pg, t, st, sp, ms) →
  top ← (16.0, 40.0, 22.0) ʰw̲ords ʰs̲ays (mo, lv, wv, t, st)
  said ← (16.0, 70.0, 18.0) ʰw̲ords ms
  book ← ʰb̲ookIf (md, pg, t)
  scene ← ʰs̲ceneIf (W, md, pg, t)
  VIEW ˢᵛp̲icture (VIEW ˢᵛr̲ect "class=\"flat\" fill=\"#1d1f2b\"") c̲at (e̲nclose "<g class=\"flat\">" c̲at BOARD c̲at "</g>") c̲at scene c̲at (ʰt̲hingsIf (W, mo, md)) c̲at (((3 × sel − 1) + 1 2 4 i̲ndexOf sp) s̲elect BARS) c̲at top c̲at said c̲at book
}
Used in: ᵘs̲how, _

ʰb̲ookIf : Num a => (a, Int, Float) -> Box Char

function (private) · line 596
ʰb̲ookIf ← { (md, pg, t) → md = 0 ? 0 r̲eshape e̲nclose ""◆ ʰp̲age (pg, t) }
Used in: ˡd̲raw

The scene, for a 3D view

SCALE : Float

value (private) · line 608

With the art, the picture carries what a 3D view of it is to draw, as JSON in its metadata: a camera that sees the board as this picture's isometric map does (30 degrees above it, along its diagonal, as many units of the picture to a tile), the tiles, every piece (its model, where it stands, the way it faces, the clip it plays and how far into it), the shots. A page that can draws that scene behind the picture and hides what the picture marks "flat" (the board and the pieces' pictures); one that cannot shows the picture as it is.

SCALE ← TW × 2.0 ^ 0.5

ʰj̲son : Float -> Char

function (private) · line 610

Numbers as a JSON list.

ʰj̲son ← { v → "[" c̲at (1 d̲rop ᵗj̲oin '{ x → e̲nclose "," c̲at f̲ormat x } e̲ach v) c̲at "]" }

ʰq̲uote : Char -> Char

function (private) · line 612

Text as a JSON string (the names and colors here need no escapes).

ʰq̲uote ← { x → "\"" c̲at x c̲at "\"" }

MID : Float

value (private) · line 614

The board point at the middle of the picture: x and z.

MID ← (0.5 × ((0.5 × 3 s̲elect VIEW) − OX) ÷ TW) + 0.5 × ((0.5 × 4 s̲elect VIEW) − OY) ÷ TH

MIDZ : Float

value (private) · line 615
MIDZ ← (0.5 × ((0.5 × 4 s̲elect VIEW) − OY) ÷ TH) − 0.5 × ((0.5 × 3 s̲elect VIEW) − OX) ÷ TW

ʰc̲amera : (Float, Float) -> Char

function (private) · line 619

The camera: looking at the board point at the middle of the picture (up above the ground), along the board's diagonal from 30 degrees up, k picture units a tile.

ʰc̲amera ← { (k, up) →
  tx ← MID
  tz ← MIDZ
  "\"camera\":{\"target\":" c̲at (ʰj̲son tx c̲at up c̲at tz) c̲at ",\"dir\":" c̲at (ʰj̲son 0.6124 0.5 0.6124) c̲at ",\"scale\":" c̲at (f̲ormat k) c̲at "}"
}

ʰp̲iece : (Char, Float, Float, Float, Float, Char, Float) -> Char

function (private) · line 625

A piece of the scene: its model, place, heading, clip and time.

ʰp̲iece ← { (m, x, z, hx, hz, clip, t) →
  "{\"m\":" c̲at (ʰq̲uote m) c̲at ",\"x\":" c̲at (f̲ormat x) c̲at ",\"z\":" c̲at (f̲ormat z) c̲at ",\"dir\":" c̲at (ʰj̲son hx c̲at hz) c̲at ",\"clip\":" c̲at (ʰq̲uote clip) c̲at ",\"t\":" c̲at (f̲ormat t) c̲at "}"
}

ʰt̲owerPieces : (Float, Float) -> Box Char

function (private) · line 629

The towers: idle, or the fire clip just after a shot.

ʰt̲owerPieces ← { (W, t) →
  tw ← ʰt̲owers W
  '{ i → e̲nclose ʰt̲owerPiece (W, i s̲elect tw, t) } e̲ach r̲ange t̲ally tw
}

ʰt̲owerPiece : (Float, Int, Float) -> Char

function (private) · line 633
ʰt̲owerPiece ← { (W, n, t) →
  j ← W ʰr̲ow n
  p ← n s̲elect ʰp̲os W
  since ← (j s̲elect COOLDOWN) − n s̲elect ʰc̲ool W
  since < 0.4 ? ʰp̲iece (d̲isclose j s̲elect PIECES, f̲irst p, 2 s̲elect p, 0.0, 1.0, "fire", since)
  ʰp̲iece (d̲isclose j s̲elect PIECES, f̲irst p, 2 s̲elect p, 0.0, 1.0, "idle", t)
}

ʰc̲reepPieces : (Float, Float) -> Box Char

function (private) · line 641

The creeps: walking, each facing along the road where it is.

ʰc̲reepPieces ← { (W, t) →
  c ← ʰc̲reeps W
  '{ i → e̲nclose ʰc̲reepPiece (W, i s̲elect c, t) } e̲ach r̲ange t̲ally c
}

ʰc̲reepPiece : (Float, Int, Float) -> Char

function (private) · line 645
ʰc̲reepPiece ← { (W, n, t) →
  p ← n s̲elect ʰp̲os W
  i ← 0 m̲ax (LONG − 1) m̲in f̲loor n s̲elect ʰp̲rog W
  hx ← ((i + 2) s̲elect PX) − (i + 1) s̲elect PX
  hz ← ((i + 2) s̲elect PY) − (i + 1) s̲elect PY
  ʰp̲iece (d̲isclose (9 + f̲loor n s̲elect ʰk̲ind W) s̲elect PIECES, f̲irst p, 2 s̲elect p, hx, hz, "walk", t)
}

ROADTEXT : Char

value (private) · line 653

The board's tiles: 1 road, 0 grass, row by row.

ROADTEXT ← ᵗj̲oin '{ r → e̲nclose f̲ormat r } e̲ach ROAD

ʰb̲oardScene : (Float, Float) -> Char

function (private) · line 655

The scene of the board: its camera, tiles, pieces and shots.

ʰb̲oardScene ← { (W, t) →
  ps ← (ʰt̲owerPieces (W, t)) c̲at ʰc̲reepPieces (W, t)
  S ← (ʰs̲hots W) s̲elect ʰp̲os W
  shots ← 1 d̲rop ᵗj̲oin '{ i → e̲nclose "," c̲at ʰj̲son i s̲elect S } e̲ach r̲ange t̲ally S
  "{\"view\":" c̲at (ʰj̲son 2 d̲rop VIEW) c̲at ",\"background\":\"#1d1f2b\",\"base\":\"art/\"," c̲at (ʰc̲amera (SCALE, 0.0)) c̲at ",\"tiles\":{\"cols\":" c̲at (f̲ormat C) c̲at ",\"road\":" c̲at (ʰq̲uote ROADTEXT) c̲at ",\"colors\":[\"#3a7d44\",\"#8d7b5e\"]},\"pieces\":[" c̲at (1 d̲rop ᵗj̲oin '{ x → e̲nclose "," c̲at d̲isclose x } e̲ach ps) c̲at "],\"shots\":[" c̲at shots c̲at "]}"
}
Used in: ʰs̲ceneIf

ʰb̲ookScene : (Int, Float) -> Char

function (private) · line 664

The scene of the grimoire's page pg: its piece alone, turning, where the panel's window is (200 picture units left of the middle: along the picture's x, which is the board's x less its z).

ʰb̲ookScene ← { (pg, t) →
  k ← ʰz̲oom pg
  e ← 200.0 ÷ k × 2.0 ^ 0.5
  piece ← ʰp̲iece (d̲isclose pg s̲elect PIECES, MID − e, MIDZ + e, s̲in 0.8 × t, c̲os 0.8 × t, "idle", t)
  "{\"view\":" c̲at (ʰj̲son 2 d̲rop VIEW) c̲at ",\"background\":\"#11121c\",\"base\":\"art/\"," c̲at (ʰc̲amera (k, ʰh̲eight pg)) c̲at ",\"pieces\":[" c̲at piece c̲at "],\"shots\":[]}"
}
Used in: ʰs̲ceneIf

ʰz̲oom : Int -> Float

function (private) · line 672

How near the grimoire's camera is (picture units a tile) and how high it looks: towers are taller than creeps.

ʰz̲oom ← { pg → pg ≤ 9 ? 170.0◆ 260.0 }
Used in: ʰb̲ookScene

ʰh̲eight : Int -> Float

function (private) · line 673
ʰh̲eight ← { pg → pg ≤ 9 ? 0.75◆ 0.25 }
Used in: ʰb̲ookScene

ʰs̲ceneIf : Num a => (Float, a, Int, Float) -> Box Char

function (private) · line 675

The scene as the picture's metadata, with the art; else nothing.

ʰs̲ceneIf ← { (W, md, pg, t) →
  n̲ot ART ? 0 r̲eshape e̲nclose ""
  md = 1 ? e̲nclose "<metadata id=\"scene\">" c̲at (ʰb̲ookScene (pg, t)) c̲at "</metadata>"
  e̲nclose "<metadata id=\"scene\">" c̲at (ʰb̲oardScene (W, t)) c̲at "</metadata>"
}
Used in: ˡd̲raw