1
1

Door.ts 608 B

1234567891011121314151617181920212223
  1. /// <reference path="../Thing.ts" />
  2. class Door extends Thing {
  3. public locked = false;
  4. public key : Thing;
  5. public destination : Room;
  6. constructor (name : string, destination : Room, unique = false) {
  7. super({name : name, unique : unique == true});
  8. this.destination = destination;
  9. this.fixedInPlace = true;
  10. }
  11. public setBreakable (damage : number) {
  12. this.breakableOn = damage;
  13. this.breakable = true;
  14. this.breaksTo = this;
  15. }
  16. public breakThrough () {
  17. this.locked = false;
  18. this.name = "Broken " + this.name;
  19. }
  20. }