Targets: the ! tiles a team defends. Each belongs to the team of the nearest base,
takes three hits from anything but its own team, and comes back a minute after it is
destroyed. Destroying one scores for the shooter's team.
ExPilot.Targets.new(arena)
ExPilot.Targets.hit(targets, cell, team)
Summary
Functions
The cells of targets currently destroyed.
A shot from team hits the target at cell.
A target for every ! on arena, each with its team.
Whether the target at cell stands, so a shot stops there.
Whether team has a target standing.
Let dt seconds pass: destroyed targets come back when their time is up.
Types
@type target() :: %{ pos: {integer(), integer()}, team: integer() | nil, hits: non_neg_integer(), respawn_in: float() }
Functions
The cells of targets currently destroyed.
@spec hit([target()], {integer(), integer()}, integer() | nil) :: {[target()], :none | :hit | {:destroyed, integer() | nil, pos_integer()}}
A shot from team hits the target at cell.
Returns {targets, outcome}: :hit, {:destroyed, team, points} for the shooter's
team, or :none when no standing target is there or it is the shooter's own.
@spec new(ExPilot.Map.t()) :: [target()]
A target for every ! on arena, each with its team.
Whether the target at cell stands, so a shot stops there.
Whether team has a target standing.
Let dt seconds pass: destroyed targets come back when their time is up.