1
1

WitchHut.ts 695 B

12345678910111213141516
  1. /// <reference path="../Forest.ts" />
  2. module Forest{
  3. export let WitchHut = new RoomRandom("The Witch's Hut", false, true);
  4. export let WitchCoordinates = Forest.rnc.generate(-2,2, 2, 4);
  5. WitchHut.backgroundImage = "roomWitch";
  6. }
  7. Forest.region.place(Forest.WitchHut);
  8. Forest.WitchHut.trickyCode = (options : TrickyOptions) => {
  9. let blocked = !options.map.isFree(Forest.WitchCoordinates[0], Forest.WitchCoordinates[1]);
  10. while (blocked) {
  11. Forest.WitchCoordinates[1] += 1;
  12. blocked = !options.map.isFree(Forest.WitchCoordinates[0], Forest.WitchCoordinates[1]);
  13. }
  14. return options.x == Forest.WitchCoordinates[0] && options.y == Forest.WitchCoordinates[1];
  15. };