Skip to content

Commit

Permalink
enter('winter_instance') is now configured instead of hardcoded
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsndk committed Apr 25, 2024
1 parent 2b644b6 commit a396eea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 29 deletions.
11 changes: 11 additions & 0 deletions design/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
29 changes: 0 additions & 29 deletions node/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5020,35 +5020,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);
Expand Down

0 comments on commit a396eea

Please sign in to comment.