wobblyhead hg > minor_monsters
diff game/js/map.js @ 23:2f555a54c332
layout fixes and balancing
| author | ark |
|---|---|
| date | 2026-10-20 12:04 +0200 |
| parents | fe680946164b |
| children | a464bd43b76c |
line wrap: on
line diff
--- a/game/js/map.js Tue Oct 20 03:08:56 2026 +0200 +++ b/game/js/map.js Tue Oct 20 12:04:42 2026 +0200 @@ -28,7 +28,6 @@ } this.length = d; this.value = data.value; - this.weight = data.weight; this.sideways(maxOffset); } @@ -207,22 +206,19 @@ }; // route weights for a monster of the given speed (balance.md, route - // preference). fixed weights from routes.toml take precedence. + // preference) GameMap.prototype.routeWeights = function (speed) { var rp = cfg.route_preference; var f = MM.util.clamp((speed - rp.reference_speed) / rp.reference_speed, -1, 1); return this.routes.map(function (r) { - if (r.weight !== null) return r.weight; return Math.max(rp.min_weight, 1 + rp.bias * f * (2 * r.value - 1)); }); }; - // index of the shortest route, leaving out routes with a fixed weight - // of 0 in routes.toml + // index of the shortest route GameMap.prototype.shortestRoute = function () { var best = -1; this.routes.forEach(function (r, i) { - if (r.weight === 0) return; if (best < 0 || r.length < this.routes[best].length) best = i; }, this); return best;
