Skip to content

sentinels targeting builderson empty tiles #4

Closed

Description

@subodhbgwt

replace the targeting loop in main with this:
bestTile = None
bestPriority = 0

for tile in ct.get_attackable_tiles():
building_id = ct.get_tile_building_id(tile)
builder_id = ct.get_tile_builder_bot_id(tile)

if builder_id is not None and ct.get_team(builder_id) == team:
    continue

tilePriority = 0

if building_id is not None:
    if ct.get_team(building_id) == team:
        continue

    building_type = ct.get_entity_type(building_id)
    if building_type not in targets:
        continue

    tilePriority = priority.get(building_type, 1)

    if builder_id is not None:
        tilePriority += 2

elif builder_id is not None:
    tilePriority = 2

if tilePriority > bestPriority:
    bestTile = tile
    bestPriority = tilePriority

if bestTile is not None and ct.can_fire(bestTile):
ct.fire(bestTile)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions