@@ -222,8 +222,16 @@ ||is_rocky(g.map[y,x+1])||is_rocky(g.map[y,x-1])) tgt ~= new Pos(y,x); cand ~= search(g, ro, tgt, death, true); } + + // 'horo-push' mode + if(cand.empty) { + Pos[] horo = g.map.objects('@'); + if(!horo.empty) { + cand ~= search(g, ro, horo, death, true); + } + } if(cand.empty) { choke_count++; cand ~= tuple('W',int.max); @@ -297,15 +305,16 @@ if(!danger(p.y,p.x)) q ~= p; bool[][] v = new bool[][](g.map.H+2, g.map.W+2); foreach(p; q) v[p.y][p.x]=true; + bool first_step = true; for(int step=1; q.length; ++step) { Pos[] q2; foreach(p; q) { int[] yyy=[p.y-1,p.y,p.y,p.y+1]; int[] xxx=[p.x,p.x-1,p.x+1,p.x]; string sss="URLD"; - for(int i=0; i=4)continue; @@ -410,8 +423,9 @@ v[y][x]=true; } } } + first_step = false; q = q2; } return []; }