OminousCave.ts 895 B

123456789101112131415161718
  1. /// <reference path="../Forest.ts" />
  2. /// <reference path="OrcVillage.ts" />
  3. module Forest{
  4. export let OminousCave = new RoomRandom("Ominous Cave", false, true);
  5. export let CaveCoordinates = Forest.rnc.generate(Forest.OrcCoordinates[0],Forest.OrcCoordinates[0] + 2, Forest.OrcCoordinates[0] + 3, Forest.OrcCoordinates[0] + 5);
  6. OminousCave.backgroundImage = "roomOminousCave";
  7. OminousCave.connectableOn = [Direction.SOUTH];
  8. }
  9. Forest.region.place(Forest.OminousCave);
  10. Forest.OminousCave.trickyCode = (options : TrickyOptions) => {
  11. let blocked = !options.map.isFree(Forest.CaveCoordinates[0], Forest.CaveCoordinates[1]);
  12. while (blocked) {
  13. Forest.CaveCoordinates[1] += 1;
  14. blocked = !options.map.isFree(Forest.CaveCoordinates[0], Forest.CaveCoordinates[1]);
  15. }
  16. return options.x == Forest.CaveCoordinates[0] && options.y == Forest.CaveCoordinates[1];
  17. };