RezmasonInitial commit.56b98775 years agoHistory
75 lines · 1.5 KB · JavaScript
RawDownload
'use strict' class Door extends Puzzle {  constructor (id, fadeDuration = 0, silent = false) {    super(id)    this.fadeDuration = fadeDuration    this.silent = silent    this._isOpen = { value: false }  }   setup () {    this.isOpen = false  }   openDoor () {    this.isOpen = true    hiversaires.showModifier(this.fadeDuration)  }   walkThroughDoor () {    if (this.silent) {      hiversaires.playFootStep()    } else {      hiversaires.music.playEffect('action_DoorActive')    }    const subject = hiversaires.currentSubject    let changed = false    if (this.isAlternateUnlocked) {      changed = true      hiversaires.game.userNodeID = subject.alternateNodeID      if (subject.alternateOrientation != null) {        hiversaires.game.userOrientation = subject.alternateOrientation      }    } else if (this.isUnlocked) {      changed = true      hiversaires.game.userNodeID = subject.nodeID      if (subject.orientation != null) {        hiversaires.game.userOrientation = subject.orientation      }    }     if (changed) {      this.isOpen = false      hiversaires.refreshNode()    }  }   get isUnlocked () {    return false  }   get isAlternateUnlocked () {    return false  }   get active () {    return this.isUnlocked || this.isAlternateUnlocked  }   get isOpen () {    return this._isOpen.value  }   set isOpen (value) {    this._isOpen.value = value  }   performAction () {    if (this.isOpen) {      this.walkThroughDoor()    } else {      this.openDoor()    }  }}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t