mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-10 00:43:27 +02:00
target switching
This commit is contained in:
parent
6c5741d0a8
commit
8109160fa8
@ -80,13 +80,16 @@ local function select_units_around_spawner(spawner, force_name, biter_force_name
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function send_group(unit_group, force_name, nearest_player_unit)
|
local function send_group(unit_group, force_name, nearest_player_unit)
|
||||||
|
local target = nearest_player_unit.position
|
||||||
|
if math_random(1,2) == 1 then target = global.rocket_silo[force_name].position end
|
||||||
|
|
||||||
unit_group.set_command({
|
unit_group.set_command({
|
||||||
type = defines.command.compound,
|
type = defines.command.compound,
|
||||||
structure_type = defines.compound_command.return_last,
|
structure_type = defines.compound_command.return_last,
|
||||||
commands = {
|
commands = {
|
||||||
{
|
{
|
||||||
type = defines.command.attack_area,
|
type = defines.command.attack_area,
|
||||||
destination = nearest_player_unit.position,
|
destination = target,
|
||||||
radius = 32,
|
radius = 32,
|
||||||
distraction=defines.distraction.by_enemy
|
distraction=defines.distraction.by_enemy
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user