From 8ecfa1b4fbc300fb02b58c0a3ed2dcbcad8200b3 Mon Sep 17 00:00:00 2001 From: thmsn <9084377+thmsndk@users.noreply.github.com> Date: Thu, 25 Apr 2024 23:07:23 +0200 Subject: [PATCH] `enter('winter_instance')` is now configured instead of hardcoded --- design/maps.py | 11 +++++++++++ node/server.js | 29 ----------------------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/design/maps.py b/design/maps.py index d64fbd5a..21660419 100644 --- a/design/maps.py +++ b/design/maps.py @@ -1162,6 +1162,17 @@ "drop_norm":4000, "instance":True, "lux":0.75, + "enter": { + # requirements to enter the dungeon + # TODO level, class, + "items": [["frozenkey", 1]], #requires 1 frozenkey to enter + + # [mapKey, locationType, locationIndex, range] + "locations": [ + # ["winterland", "spawns", 5, 120], + ["winterland", "doors", 3, 120] + ] + } }, "winterland":{ #"key":"jayson_IceLandPrototype", diff --git a/node/server.js b/node/server.js index c37a4c4a..e00070db 100644 --- a/node/server.js +++ b/node/server.js @@ -5038,35 +5038,6 @@ function init_io() { } else { return fail_response("cant_enter"); } - } else if (data.place == "winter_instance") { - var f = "cave"; - var ref = G.maps.cave.spawns[2]; - var item = "cryptkey"; - if (data.place == "winter_instance") { - f = "winterland"; - ref = G.maps.winterland.spawns[5]; - item = "frozenkey"; - } - if (simple_distance(player, { in: f, map: f, x: ref[0], y: ref[1] }) > 120) { - return fail_response("transport_cant_reach"); - } - if (data.name) { - // Player requested to enter an existing instance - if (instances[data.name] && instances[data.name].map == data.place) { - // The instance exists - transport_player_to(player, data.name); - } else { - // The instance doesn't exist - return fail_response("transport_cant_invalid"); - } - } else { - if (!consume_one_by_id(player, item)) { - return fail_response("transport_cant_item"); - } - instance = create_instance(name, data.place); - transport_player_to(player, name); - } - resend(player, "u+cid+reopen"); } else if (data.place == "dungeon0" && player.role == "gm") { instance = create_instance(name, "dungeon0", { solo: player.id }); transport_player_to(player, name);