From 6c170a55405fbf62c6bba512f2deb0e4082f2c79 Mon Sep 17 00:00:00 2001 From: Oliver Klemenz Date: Tue, 10 May 2022 12:55:44 +0200 Subject: [PATCH] Sneak for all guards, unblock 179 --- assets/maps/custom/level178.json | 6 ++---- assets/maps/custom/level179.json | 3 ++- assets/maps/level8.json | 3 +-- src/Enemy.js | 6 +++--- src/Fighter.js | 2 +- src/Game.js | 4 ++-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/assets/maps/custom/level178.json b/assets/maps/custom/level178.json index 2b151ec..5c3327c 100644 --- a/assets/maps/custom/level178.json +++ b/assets/maps/custom/level178.json @@ -1797,8 +1797,7 @@ "skill": 0, "colors": 2, "type": "guard", - "direction": 1, - "sneak": true + "direction": 1 }, { "room": 6, @@ -1814,8 +1813,7 @@ "skill": 4, "colors": 4, "type": "guard", - "direction": 1, - "sneak": true + "direction": 1 }, { "room": 13, diff --git a/assets/maps/custom/level179.json b/assets/maps/custom/level179.json index e8f5871..2fb7e53 100644 --- a/assets/maps/custom/level179.json +++ b/assets/maps/custom/level179.json @@ -2281,7 +2281,8 @@ "skill": 4, "colors": 6, "type": "guard", - "direction": -1 + "direction": -1, + "bias": 1 }, { "room": 15, diff --git a/assets/maps/level8.json b/assets/maps/level8.json index 14cc213..07a63ce 100644 --- a/assets/maps/level8.json +++ b/assets/maps/level8.json @@ -2733,8 +2733,7 @@ "skill": 3, "colors": 4, "type": "guard", - "direction": -1, - "sneak": true + "direction": -1 } ], "events": [ diff --git a/src/Enemy.js b/src/Enemy.js index bca6b0e..05d9aef 100644 --- a/src/Enemy.js +++ b/src/Enemy.js @@ -21,7 +21,7 @@ PrinceJS.Enemy = function (game, level, location, direction, room, skill, color, this.strikeTimer = 0; this.lookBelow = false; this.startFight = false; - this.sneakUp = false; + this.sneakUp = true; this.health = PrinceJS.Enemy.EXTRA_STRENGTH[skill] + PrinceJS.Enemy.STRENGTH[this.level.number]; @@ -388,8 +388,8 @@ PrinceJS.Enemy.prototype.setInactive = function () { } }; -PrinceJS.Enemy.prototype.setSneakUp = function () { - this.sneakUp = true; +PrinceJS.Enemy.prototype.setSneakUp = function (state) { + this.sneakUp = state; }; PrinceJS.Enemy.prototype.checkBarrier = function () { diff --git a/src/Fighter.js b/src/Fighter.js index 1272203..1d587a8 100644 --- a/src/Fighter.js +++ b/src/Fighter.js @@ -1321,7 +1321,7 @@ PrinceJS.Fighter.prototype.moveL = function (extended = true) { }; PrinceJS.Fighter.prototype.sneaks = function () { - return ["stoop", "stand", "standup", "turn", "jumphanglong", "hang", "climbup", "climbdown"].includes(this.action) || this.action.startsWith("step"); + return ["stoop", "stand", "standup", "turn", "jumphanglong", "hang", "hangdrop", "climbup", "climbdown", "testfoot"].includes(this.action) || this.action.startsWith("step"); }; PrinceJS.Fighter.prototype.getCharBounds = function () { diff --git a/src/Game.js b/src/Game.js index 8e0ce89..263ca90 100644 --- a/src/Game.js +++ b/src/Game.js @@ -66,8 +66,8 @@ PrinceJS.Game.prototype = { if (data.active === false) { enemy.setInactive(); } - if (data.sneak === true) { - enemy.setSneakUp(); + if (data.sneak === false) { + enemy.setSneakUp(false); } enemy.onInitLife.add((fighter) => { this.ui.setOpponentLive(fighter);