private void AddRoomEdgeConnectors(Connector connector, Rect edge, Direction dir) { bool skip = Rng.OneIn(2); foreach (Vec pos in edge) { // don't place connectors close to the incoming connector if (connector != null) { if (Vec.IsDistanceWithin(connector.Position, pos, 1)) { continue; } } if (!skip && (Rng.Int(100) < mWriter.Options.ChanceOfRoomConnector)) { mWriter.AddRoomConnector(pos, dir); skip = true; } else { skip = false; } } }
public override bool WillUseMove(Monster monster, Entity target) { // make sure target is in range if (!Vec.IsDistanceWithin(target.Position, monster.Position, Info.Radius)) { return(false); } return(true); }
public override bool WillUseMove(Monster monster, Entity target) { Los los = new Los(monster.Dungeon, monster.Position, target.Position); // don't try if the target is too far away if (!Vec.IsDistanceWithin(target.Position, monster.Position, Info.Radius)) { return(false); } // see if we can see a clear path to the target return(los.HitsEntity(target, true)); }