How to use the level/cells.js.BRAMBLES function in level

To help you get started, we’ve selected a few level examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ondras / sleeping-beauty / src / js / being / pc.js View on Github external
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);