When playtesting NetHack heavily, I observed that most of the time it wasn't placing much strain on my wrists, but Sokoban was an exception: travel, farmove, etc. can normally be used to avoid the need to spam keys, but they don't work while pushing a boulder, and the boulders often need to be pushed along precise routes, so you have to tap out every movement. This becomes particularly straining when pushing in the last few boulders, as you have to push them a long way along the goal corridor. This commit adds rolling boulder traps to Sokoban that will automatically roll boulders along the goal corridor, meaning that you don't have to push them there manually. This considerably reduces the number of keystrokes needed to solve Sokoban, without making any significant change to the difficulty of the levels. Some of the designs had to change slightly in order to make room for them, but not in a way that meaningfully changes the solution.
105 lines
3.0 KiB
Lua
105 lines
3.0 KiB
Lua
-- NetHack sokoban soko4-1.lua $NHDT-Date: 1652196036 2022/05/10 15:20:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
|
|
-- Copyright (c) 1998-1999 by Kevin Hugo
|
|
-- NetHack may be freely redistributed. See license for details.
|
|
--
|
|
--
|
|
-- In case you haven't played the game Sokoban, you'll learn
|
|
-- quickly. This branch isn't particularly difficult, just time
|
|
-- consuming. Some players may wish to skip this branch.
|
|
--
|
|
-- The following actions are currently permitted without penalty:
|
|
-- Carrying or throwing a boulder already in inventory
|
|
-- (player or nonplayer).
|
|
-- Teleporting boulders.
|
|
-- Digging in the floor.
|
|
-- The following actions are permitted, but with a luck penalty:
|
|
-- Breaking boulders.
|
|
-- Stone-to-fleshing boulders.
|
|
-- Creating new boulders (e.g., with a scroll of earth).
|
|
-- Jumping.
|
|
-- Being pulled by a thrown iron ball.
|
|
-- Hurtling through the air from Newton's 3rd law.
|
|
-- Squeezing past boulders when naked or as a giant.
|
|
-- These actions are not permitted:
|
|
-- Moving diagonally between two boulders and/or walls.
|
|
-- Pushing a boulder diagonally.
|
|
-- Picking up boulders (player or nonplayer).
|
|
-- Digging or walking through walls.
|
|
-- Teleporting within levels or between levels of this branch.
|
|
-- Using cursed potions of gain level.
|
|
-- Escaping a pit/hole (e.g., by flying, levitation, or
|
|
-- passing a dexterity check).
|
|
-- Bones files are not permitted.
|
|
|
|
|
|
--## Bottom (first) level of Sokoban ###
|
|
des.level_init({ style = "solidfill", fg = " " });
|
|
|
|
des.level_flags("mazelevel", "noteleport", "hardfloor", "premapped", "sokoban", "solidify");
|
|
|
|
des.map([[
|
|
------ -----
|
|
|....| |...|
|
|
|....----...|
|
|
|...........|
|
|
|..|-|.|-|..|
|
|
---------|.---
|
|
|......|.....|
|
|
|..----|.....|
|
|
--.| |.....|
|
|
|.|---|.....|
|
|
|...........|
|
|
|..|---------
|
|
----
|
|
]]);
|
|
des.levregion({ region = {06,04,06,04}, type = "branch" })
|
|
des.stair("up", 06,06)
|
|
des.region(selection.area(00,00,13,12), "lit")
|
|
des.non_diggable(selection.area(00,00,13,12))
|
|
des.non_passwall(selection.area(00,00,13,12))
|
|
|
|
-- Boulders
|
|
des.object("boulder",02,02)
|
|
des.object("boulder",02,03)
|
|
--
|
|
des.object("boulder",10,02)
|
|
des.object("boulder",09,03)
|
|
des.object("boulder",10,04)
|
|
--
|
|
des.object("boulder",08,07)
|
|
des.object("boulder",09,08)
|
|
des.object("boulder",09,09)
|
|
des.object("boulder",08,10)
|
|
des.object("boulder",10,10)
|
|
|
|
-- prevent monster generation over the (filled) pits
|
|
des.exclusion({ type = "monster-generation", region = { 01,06, 07,11 } });
|
|
|
|
-- Traps
|
|
des.trap("pit",04,06)
|
|
|
|
des.trap("pit",02,06)
|
|
des.trap("pit",02,07)
|
|
des.trap("pit",02,08)
|
|
des.trap("rolling boulder",02,09)
|
|
|
|
des.trap("pit",02,10)
|
|
des.trap("pit",03,10)
|
|
des.trap("pit",04,10)
|
|
des.trap("pit",05,10)
|
|
des.trap("pit",06,10)
|
|
des.trap("rolling boulder",07,10)
|
|
|
|
-- A little help
|
|
des.object("scroll of earth",02,11)
|
|
des.object("scroll of earth",03,11)
|
|
|
|
-- Random objects
|
|
des.object({ class = "%" });
|
|
des.object({ class = "%" });
|
|
des.object({ class = "%" });
|
|
des.object({ class = "%" });
|
|
des.object({ class = "=" });
|
|
des.object({ class = "/" });
|
|
|