public void VacateArea(RectInt area, string areaName) { foreach (Minion minion in minions) { if (!minion.hasWork && area.Contains(minion.pos)) { JobTransient.AssignWork(minion, "MapVacate", new TaskGoTo(this, $"Vacating {areaName}.", PathCfg.Vacate(area))); } } }
public void AssignIdleTask(Minion minion) { const int maxTries = 10; const float maxWander = 16; for (int i = 0; i < maxTries; ++i) { float rad = (float)rand.NextDouble() * maxWander; float deg = (float)rand.NextDouble() * 360; var roto = Quaternion.Euler(0, 0, deg); Vec2 vec = roto * new Vec3(rad, 0, 0); Vec2 pt = minion.pos + Vec2.one * .5f + vec; Vec2I tile = pt.Floor(); if (game.ValidTile(tile) && tile != minion.pos && game.Tile(tile).passable) { JobTransient.AssignIdleWork(minion, "IdleWanter", WanderTasks(tile)); break; } } }
public static void AssignFireAtRepeating(Game game, Minion minion, Vec2I target) => JobTransient.AssignWork(minion, "FireAtRepeat", GetTasks(game, minion, target));