Exemplo n.º 1
0
def attack_coefficient(gc, our_unit, our_loc, their_unit, their_loc):
    # generic: how appealing is their_unit to attack
    coeff = ranger_unit_priority[their_unit.unit_type]
    # if distance < attack_range_non_robots(their_unit):
    #     coeff = coeff * sense_util.can_attack_multiplier(their_unit)
    coeff = coeff * sense_util.health_multiplier(their_unit)
    return coeff
Exemplo n.º 2
0
def attack_coefficient(gc, our_unit, their_unit, location, priority): 
    distance = sense_util.distance_squared_between_maplocs(their_unit.location.map_location(), location)

    coeff = priority[their_unit.unit_type]
    if distance < attack_range_non_robots(their_unit):
        coeff *= sense_util.can_attack_multiplier(their_unit)
    coeff *= sense_util.health_multiplier(their_unit)
    return coeff
Exemplo n.º 3
0
def attack_coefficient(gc, our_unit, their_unit, location):
    # generic: how appealing is their_unit to attack
    our_location = our_unit.location.map_location()
    distance = their_unit.location.map_location().distance_squared_to(
        our_location)
    coeff = ranger_unit_priority[their_unit.unit_type]
    if distance < attack_range_non_robots(their_unit):
        coeff = coeff * sense_util.can_attack_multiplier(their_unit)
    coeff = coeff * sense_util.health_multiplier(their_unit)
    return coeff