Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
super.moveTo(xy, level);
if (!this._xy) { return; }
this._updateFOV();
if (level && level.danger > this._maxDanger) {
this._maxDanger = level.danger;
log.add("You feel healthier.");
this.maxhp += rules.LEVEL_HP;
this.adjustStat("hp", rules.LEVEL_HP);
}
// getEntity not possible, because *we* are standing here :)
let cell = this._level.getCell(this._xy);
if (cell == cells.BRAMBLES && ROT.RNG.getUniform() < rules.BRAMBLE_CHANCE) {
log.add("You make your way through %s. Ouch! You injure yourself on a thorn.", cell);
this.adjustStat("hp", -1);
}
let item = this._level.getItem(this._xy);
if (item) {
log.add("%A is lying here.", item);
if (!TUTORIAL.item) {
log.add("To pick it up, press {#fff}Enter{}.");
TUTORIAL.item = true;
}
return;
}
if (cell instanceof cells.Door) {
log.add("You pass through %a.", cell);