TheObelisk.ts 767 B

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