LambdaHack 0.9.3.0 → 0.9.3.1
raw patch · 15 files changed
+161/−195 lines, 15 filesdep ~assert-failuredep ~asyncdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: assert-failure, async, base, base-compat, binary, containers, deepseq, enummapset, filepath, hashable, keys, miniutter, optparse-applicative, primitive, random, text, time, transformers, unordered-containers, vector, vector-binary-instances
API changes (from Hackage documentation)
- Game.LambdaHack.Client.UI.HandleHumanLocalM: xhairPointerEnemy :: MonadClientUI m => Bool -> m ()
- Game.LambdaHack.Client.UI.HandleHumanLocalM: xhairPointerFloor :: MonadClientUI m => Bool -> m ()
- Game.LambdaHack.Client.UI.Content.Input: mouseLMB :: CmdTriple
+ Game.LambdaHack.Client.UI.Content.Input: mouseLMB :: HumanCmd -> Text -> CmdTriple
Files
- GameDefinition/InGameHelp.txt +17/−17
- GameDefinition/MoveKeys.txt +3/−3
- GameDefinition/PLAYING.md +11/−10
- GameDefinition/game-src/Client/UI/Content/Input.hs +12/−4
- LambdaHack.cabal +33/−93
- Makefile +2/−2
- engine-src/Game/LambdaHack/Client/UI/Content/Input.hs +8/−9
- engine-src/Game/LambdaHack/Client/UI/DisplayAtomicM.hs +1/−2
- engine-src/Game/LambdaHack/Client/UI/Frontend/Dom.hs +7/−2
- engine-src/Game/LambdaHack/Client/UI/Frontend/Sdl.hs +7/−7
- engine-src/Game/LambdaHack/Client/UI/HandleHelperM.hs +4/−2
- engine-src/Game/LambdaHack/Client/UI/HandleHumanGlobalM.hs +32/−15
- engine-src/Game/LambdaHack/Client/UI/HandleHumanLocalM.hs +19/−25
- engine-src/Game/LambdaHack/Client/UI/KeyBindings.hs +4/−3
- engine-src/Game/LambdaHack/Common/ReqFailure.hs +1/−1
GameDefinition/InGameHelp.txt view
@@ -8,7 +8,7 @@ Walk throughout a level with mouse or numeric keypad (left diagram below), or with its compact laptop replacement (middle) or the Vi editor keys (right) selectable in config.ui.ini. Run until disturbed with Shift or Control.- Go-to with LMB (left mouse button). Run collectively with RMB.+ Go-to with LMB (left mouse button). Run collectively via S-LMB (holding Shift). 7 8 9 7 8 9 y k u \|/ \|/ \|/@@ -20,8 +20,8 @@ Press `KP_5` (`5` on keypad) to wait, bracing for impact, which reduces any damage taken and prevents displacement by foes. Press `C-KP_5` (the same key with Control) to lurk 0.1 of a turn, without bracing and `S-KP_5` (with Shift)- to yell/yawn, taunting and waking up enemies/yourself. You displace enemies- by running into them with Shift/Control or RMB. Search, open, descend and+ or `%` to yell/yawn, taunting and waking up enemies/yourself. Displace enemies+ by running into them with Shift/Control or S-LMB. Search, open, descend and attack by bumping into walls, doors, stairs and enemies. The best melee weapon is automatically chosen from your equipment and from among your body parts. @@ -36,9 +36,9 @@ keys command E manage equipment of the leader g or , grab item(s)- ESC finish aiming/open main menu- RET or INS accept target/open dashboard- SPACE clear messages/display history+ ESC open main menu/finish aiming+ RET or INS open dashboard/accept target+ SPACE clear messages and show history S-TAB cycle among all party members KP_* or ! cycle x-hair among enemies KP_/ or / cycle x-hair among items@@ -50,7 +50,6 @@ For more general gameplay information see https://github.com/LambdaHack/LambdaHack/blob/master/GameDefinition/PLAYING.md - Item menu commands. keys command@@ -70,8 +69,8 @@ Remaining item-related commands. keys command- P or I manage inventory pack of the leader E manage equipment of the leader+ P or I manage inventory pack of the leader S manage the shared party stash G manage items on the ground A manage all owned items@@ -107,8 +106,8 @@ Aiming commands. keys command- ESC finish aiming/open main menu- RET or INS accept target/open dashboard+ ESC open main menu/finish aiming+ RET or INS open dashboard/accept target KP_* or ! cycle x-hair among enemies KP_/ or / cycle x-hair among items + swerve the aiming line@@ -135,8 +134,9 @@ in exploration mode and (if different) in aiming mode. keys command- LMB set x-hair to enemy/go to pointer for 25 steps- RMB or C-LMB fling at enemy/run to pointer collectively for 25 steps+ LMB go to pointer for 25 steps/fling at enemy+ S-LMB run to pointer collectively for 25 steps/fling at enemy+ RMB or C-LMB start aiming at enemy under pointer C-RMB open or close or alter at pointer MMB snap x-hair to floor under pointer WHEEL-UP swerve the aiming line@@ -145,10 +145,10 @@ Mouse in exploration and aiming modes. exploration LMB (left mouse button) RMB (right mouse button)- message line clear messages/display history display help+ message line clear messages and show history display help leader on map grab item(s) drop item(s) party on map pick new leader on screen select party member on screen- the map area go to pointer for 25 steps run to pointer collectively+ the map area go to pointer for 25 steps set x-hair to enemy level number move aiming one level up move aiming one level down level caption open dashboard open main menu percent seen explore nearest unknown spot autoexplore 25 times@@ -157,17 +157,17 @@ Calm value yell/yawn yell/yawn HP gauge rest (wait 25 times) heed (lurk 0.1 turns 100 times) HP Value wait a turn, bracing for impact lurk 0.1 of a turn- leader info fling without aiming clear chosen item and x-hair+ leader info auto-fling and keep choice clear chosen item and x-hair aiming mode LMB (left mouse button) RMB (right mouse button)- the map area set x-hair to enemy fling at enemy under pointer+ the map area fling at enemy under pointer snap x-hair to enemy level caption accept target cancel aiming percent seen set x-hair to nearest upstairs set x-hair to nearest dnstairs Assorted commands. keys command- SPACE clear messages/display history+ SPACE clear messages and show history F12 open dashboard ? display help F1 display help immediately
GameDefinition/MoveKeys.txt view
@@ -1,7 +1,7 @@ Walk throughout a level with mouse or numeric keypad (left diagram below), or with its compact laptop replacement (middle) or the Vi editor keys (right) selectable in config.ui.ini. Run until disturbed with Shift or Control.-Go-to with LMB (left mouse button). Run collectively with RMB.+Go-to with LMB (left mouse button). Run collectively via S-LMB (holding Shift). 7 8 9 7 8 9 y k u \|/ \|/ \|/@@ -13,7 +13,7 @@ Press `KP_5` (`5` on keypad) to wait, bracing for impact, which reduces any damage taken and prevents displacement by foes. Press `C-KP_5` (the same key with Control) to lurk 0.1 of a turn, without bracing and `S-KP_5` (with Shift)-to yell/yawn, taunting and waking up enemies/yourself. You displace enemies-by running into them with Shift/Control or RMB. Search, open, descend and+or `%` to yell/yawn, taunting and waking up enemies/yourself. Displace enemies+by running into them with Shift/Control or S-LMB. Search, open, descend and attack by bumping into walls, doors, stairs and enemies. The best melee weapon is automatically chosen from your equipment and from among your body parts.
GameDefinition/PLAYING.md view
@@ -104,7 +104,7 @@ highlighted in yellow. Most commands involve only the leader, including movement with keyboard's keypad or `LMB` (left mouse button). If more heroes are selected (highlighted in blue), they run together-whenever `:` or `RMB` (right mouse button) over map area is pressed.+whenever `:` or `S-LMB` (while holding Shift) over map area is pressed. Next on the bottom-most status line is the leader's current and maximum Calm (morale, composure, focus, attentiveness), then his current@@ -169,7 +169,7 @@ Walk throughout a level with mouse or numeric keypad (left diagram below), or with its compact laptop replacement (middle) or the Vi editor keys (right) selectable in config.ui.ini. Run until disturbed with Shift or Control.-Go-to with LMB (left mouse button). Run collectively with RMB.+Go-to with LMB (left mouse button). Run collectively via S-LMB (holding Shift). 7 8 9 7 8 9 y k u \|/ \|/ \|/@@ -181,8 +181,8 @@ Press `KP_5` (`5` on keypad) to wait, bracing for impact, which reduces any damage taken and prevents displacement by foes. Press `C-KP_5` (the same key with Control) to lurk 0.1 of a turn, without bracing and `S-KP_5` (with Shift)-to yell/yawn, taunting and waking up enemies/yourself. You displace enemies-by running into them with Shift/Control or RMB. Search, open, descend and+or `%` to yell/yawn, taunting and waking up enemies/yourself. Displace enemies+by running into them with Shift/Control or S-LMB. Search, open, descend and attack by bumping into walls, doors, stairs and enemies. The best melee weapon is automatically chosen from your equipment and from among your body parts. @@ -197,9 +197,9 @@ keys command E manage equipment of the leader g or , grab item(s)- ESC finish aiming/open main menu- RET or INS accept target/open dashboard- SPACE clear messages/display history+ ESC open main menu/finish aiming+ RET or INS open dashboard/accept target+ SPACE clear messages and show history S-TAB cycle among all party members KP_* or ! cycle x-hair among enemies KP_/ or / cycle x-hair among items@@ -207,7 +207,7 @@ + swerve the aiming line Screen area and UI mode (exploration/aiming) determine-mouse click effects. We give an overview+mouse click effects. First, we give an overview of effects of each button over the game map area. The list includes not only left and right buttons, but also the optional middle mouse button (MMB) and the mouse wheel,@@ -215,8 +215,9 @@ (For mice without RMB, one can use Control key with LMB.) keys command- LMB set x-hair to enemy/go to pointer for 25 steps- RMB or C-LMB fling at enemy/run to pointer collectively for 25 steps+ LMB go to pointer for 25 steps/fling at enemy+ S-LMB run to pointer collectively for 25 steps/fling at enemy+ RMB or C-LMB start aiming at enemy under pointer C-RMB open or close or alter at pointer MMB snap x-hair to floor under pointer WHEEL-UP swerve the aiming line
GameDefinition/game-src/Client/UI/Content/Input.hs view
@@ -47,17 +47,17 @@ , ChooseItemMenu (MStore CEqp) )) , ("g", addCmdCategory CmdMinimal $ grabItems "grab item(s)") , ("Escape", ( [CmdMinimal, CmdAim]- , "finish aiming/open main menu"+ , "open main menu/finish aiming" , ByAimMode AimModeCmd { exploration = ExecuteIfClear MainMenu , aiming = Cancel } )) , ("C-Escape", ([CmdNoHelp], "", MainMenu)) -- required by frontends; not shown , ("Return", ( [CmdMinimal, CmdAim]- , "accept target/open dashboard"+ , "open dashboard/accept target" , ByAimMode AimModeCmd { exploration = ExecuteIfClear Dashboard , aiming = Accept } )) , ("space", ( [CmdMinimal, CmdMeta]- , "clear messages/display history"+ , "clear messages and show history" , ExecuteIfClear LastHistory )) , ("Tab", ( [CmdMove] , "cycle among party members on the level"@@ -202,7 +202,12 @@ , ("safeD101", ([CmdInternal, CmdDashboard], "display history", AllHistory)) -- Mouse- , ("LeftButtonRelease", mouseLMB)+ , ( "LeftButtonRelease"+ , mouseLMB goToCmd+ "go to pointer for 25 steps/fling at enemy" )+ , ( "S-LeftButtonRelease"+ , mouseLMB runToAllCmd+ "run to pointer collectively for 25 steps/fling at enemy" ) , ("RightButtonRelease", mouseRMB) , ("C-LeftButtonRelease", replaceDesc "" mouseRMB) -- Mac convention , ( "C-RightButtonRelease"@@ -255,6 +260,9 @@ , ("safe11", ( [CmdInternal] , "lurk 0.1 of a turn" , Wait10 ))+ , ("safe12", ( [CmdInternal]+ , "snap x-hair to enemy"+ , XhairPointerEnemy )) ] ++ map defaultHeroSelect [0..6]
LambdaHack.cabal view
@@ -6,7 +6,7 @@ -- PVP summary:+-+------- breaking API changes -- | | +----- minor or non-breaking API additions -- | | | +--- code changes with no API change-version: 0.9.3.0+version: 0.9.3.1 synopsis: A game engine library for tactical squad ASCII roguelike dungeon crawlers description: LambdaHack is a Haskell game engine library for ASCII roguelike games of arbitrary theme, size and complexity, with optional@@ -42,11 +42,15 @@ when developing the library --- library users are free to access any modules, since the library authors are in no position to guess their particular needs.+ .+ This is a workaround .cabal file, flattened to eliminated+ internal libraries until generating haddocks for them+ is fixed. The original .cabal file is stored in the github repo. homepage: https://lambdahack.github.io bug-reports: http://github.com/LambdaHack/LambdaHack/issues license: BSD-3-Clause license-file: COPYLEFT-tested-with: GHC==8.2.2, GHC==8.4.4, GHC==8.6.4+tested-with: GHC==8.2.2, GHC==8.4.4, GHC==8.6.5 data-files: GameDefinition/config.ui.default, GameDefinition/fonts/16x16xw.woff, GameDefinition/fonts/16x16xw.bdf,@@ -161,9 +165,12 @@ if !flag(supportNodeJS) ghcjs-options: -DGHCJS_BROWSER -library definition+library import: options- hs-source-dirs: definition-src+ hs-source-dirs: definition-src,+ engine-src,+ GameDefinition/game-src,+ GameDefinition exposed-modules: Game.LambdaHack.Core.Dice Game.LambdaHack.Core.Frequency Game.LambdaHack.Core.Prelude@@ -179,30 +186,7 @@ Game.LambdaHack.Content.PlaceKind Game.LambdaHack.Content.RuleKind Game.LambdaHack.Content.TileKind- build-depends:- ,assert-failure- ,base- ,base-compat- ,binary- ,containers- ,deepseq- ,enummapset- ,ghc-prim- ,hashable- ,keys- ,miniutter- ,random- ,time- ,text- ,transformers- ,unordered-containers- ,vector- ,vector-binary-instances--library- import: options- hs-source-dirs: engine-src- exposed-modules: Game.LambdaHack.Atomic+ Game.LambdaHack.Atomic Game.LambdaHack.Atomic.CmdAtomic Game.LambdaHack.Atomic.HandleAtomicWrite Game.LambdaHack.Atomic.MonadStateWrite@@ -310,25 +294,26 @@ Game.LambdaHack.Server.ServerOptions Game.LambdaHack.Server.StartM Game.LambdaHack.Server.State- reexported-modules: ,Game.LambdaHack.Core.Dice- ,Game.LambdaHack.Core.Frequency- ,Game.LambdaHack.Core.Prelude- ,Game.LambdaHack.Core.Random- ,Game.LambdaHack.Definition.Ability- ,Game.LambdaHack.Definition.Color- ,Game.LambdaHack.Definition.ContentData- ,Game.LambdaHack.Definition.Defs- ,Game.LambdaHack.Definition.Flavour- ,Game.LambdaHack.Content.CaveKind- ,Game.LambdaHack.Content.ItemKind- ,Game.LambdaHack.Content.ModeKind- ,Game.LambdaHack.Content.PlaceKind- ,Game.LambdaHack.Content.RuleKind- ,Game.LambdaHack.Content.TileKind+ exposed-modules: Content.CaveKind+ Content.ItemKind+ Content.ItemKindEmbed+ Content.ItemKindActor+ Content.ItemKindOrgan+ Content.ItemKindBlast+ Content.ItemKindTemporary+ Content.ModeKind+ Content.ModeKindPlayer+ Content.PlaceKind+ Content.RuleKind+ Content.TileKind+ TieKnot+ Client.UI.Content.Input+ Client.UI.Content.Screen+ Implementation.MonadClientImplementation+ Implementation.MonadServerImplementation other-modules: Paths_LambdaHack autogen-modules: Paths_LambdaHack- build-depends: definition,- assert-failure >= 0.1.2 && < 0.2,+ build-depends: assert-failure >= 0.1.2 && < 0.2, async >= 2, base >= 4.10 && < 99, base-compat >= 0.8.0,@@ -354,7 +339,9 @@ transformers >= 0.4, unordered-containers >= 0.2.3, vector >= 0.11,- vector-binary-instances >= 0.2.3.1+ vector-binary-instances >= 0.2.3.1,+ template-haskell >= 2.6,+ ghc-compact if impl(ghcjs) || flag(jsaddle) { exposed-modules: Game.LambdaHack.Client.UI.Frontend.Dom@@ -385,56 +372,10 @@ build-depends: zlib >= 0.5.3.1 } -library this-game-content- import: options- hs-source-dirs: GameDefinition- exposed-modules: Content.CaveKind- Content.ItemKind- Content.ItemKindEmbed- Content.ItemKindActor- Content.ItemKindOrgan- Content.ItemKindBlast- Content.ItemKindTemporary- Content.ModeKind- Content.ModeKindPlayer- Content.PlaceKind- Content.RuleKind- Content.TileKind- other-modules: Paths_LambdaHack- autogen-modules: Paths_LambdaHack- build-depends: ,definition- ,base- ,filepath- ,template-haskell >= 2.6- ,text--library this-game-src- import: options- hs-source-dirs: GameDefinition/game-src- exposed-modules: TieKnot- other-modules: Client.UI.Content.Input- Client.UI.Content.Screen- Implementation.MonadClientImplementation- Implementation.MonadServerImplementation- build-depends: ,LambdaHack- ,this-game-content- ,async- ,base- ,enummapset- ,filepath- ,ghc-compact- ,optparse-applicative- ,primitive- ,random- ,template-haskell >= 2.6- ,text- ,transformers- executable LambdaHack import: options, exe-options main-is: GameDefinition/Main.hs build-depends: ,LambdaHack- ,this-game-src ,async ,base ,filepath@@ -445,7 +386,6 @@ type: exitcode-stdio-1.0 main-is: test/test.hs build-depends: ,LambdaHack- ,this-game-src ,async ,base ,filepath
Makefile view
@@ -29,10 +29,10 @@ google-chrome --no-sandbox --js-flags="--logfile=%t.log --prof" ../lambdahack.github.io/index.html minific:- npx google-closure-compiler dist-newstyle/build/x86_64-linux/ghcjs-8.6.0.1/LambdaHack-0.9.3.0/x/LambdaHack/build/LambdaHack/LambdaHack.jsexe/all.js --compilation_level=ADVANCED_OPTIMIZATIONS --isolation_mode=IIFE --assume_function_wrapper --externs=dist-newstyle/build/x86_64-linux/ghcjs-8.6.0.1/LambdaHack-0.9.3.0/x/LambdaHack/build/LambdaHack/LambdaHack.jsexe/all.js.externs --jscomp_off="*" > ../lambdahack.github.io/lambdahack.all.js+ npx google-closure-compiler dist-newstyle/build/x86_64-linux/ghcjs-8.6.0.1/LambdaHack-0.9.3.1/x/LambdaHack/build/LambdaHack/LambdaHack.jsexe/all.js --compilation_level=ADVANCED_OPTIMIZATIONS --isolation_mode=IIFE --assume_function_wrapper --externs=dist-newstyle/build/x86_64-linux/ghcjs-8.6.0.1/LambdaHack-0.9.3.1/x/LambdaHack/build/LambdaHack/LambdaHack.jsexe/all.js.externs --jscomp_off="*" > ../lambdahack.github.io/lambdahack.all.js minificForNode:- npx google-closure-compiler dist-newstyle/build/x86_64-linux/ghcjs-8.6.0.1/LambdaHack-0.9.3.0/x/LambdaHack/build/LambdaHack/LambdaHack.jsexe/all.js --compilation_level=ADVANCED_OPTIMIZATIONS --isolation_mode=IIFE --assume_function_wrapper --externs=dist-newstyle/build/x86_64-linux/ghcjs-8.6.0.1/LambdaHack-0.9.3.0/x/LambdaHack/build/LambdaHack/LambdaHack.jsexe/all.js.externs --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/assert.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/child_process.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/crypto.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/dns.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/events.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/globals.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/https.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/os.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/punycode.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/readline.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/stream.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/tls.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/url.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/vm.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/buffer.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/cluster.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/dgram.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/domain.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/fs.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/http.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/net.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/path.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/querystring.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/repl.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/string_decoder.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/tty.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/util.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/zlib.js --jscomp_off="*" > ../lambdahack.github.io/lambdahack.all.js+ npx google-closure-compiler dist-newstyle/build/x86_64-linux/ghcjs-8.6.0.1/LambdaHack-0.9.3.1/x/LambdaHack/build/LambdaHack/LambdaHack.jsexe/all.js --compilation_level=ADVANCED_OPTIMIZATIONS --isolation_mode=IIFE --assume_function_wrapper --externs=dist-newstyle/build/x86_64-linux/ghcjs-8.6.0.1/LambdaHack-0.9.3.1/x/LambdaHack/build/LambdaHack/LambdaHack.jsexe/all.js.externs --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/assert.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/child_process.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/crypto.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/dns.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/events.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/globals.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/https.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/os.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/punycode.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/readline.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/stream.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/tls.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/url.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/vm.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/buffer.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/cluster.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/dgram.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/domain.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/fs.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/http.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/net.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/path.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/querystring.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/repl.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/string_decoder.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/tty.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/util.js --externs=/home/mikolaj/r/closure-compiler/contrib/nodejs/zlib.js --jscomp_off="*" > ../lambdahack.github.io/lambdahack.all.js # Low delay to display animations swiftly and not bore the public too much. # Delay can't be lower than 2, because browsers sometimes treat delay 1
engine-src/Game/LambdaHack/Client/UI/Content/Input.hs view
@@ -118,20 +118,19 @@ , Repeat n ) -- @AimFloor@ is not there, but @AimEnemy@ and @AimItem@ almost make up for it.-mouseLMB :: CmdTriple-mouseLMB = ( [CmdMouse]- , "set x-hair to enemy/go to pointer for 25 steps"- , ByAimMode aimMode )+mouseLMB :: HumanCmd -> Text -> CmdTriple+mouseLMB goToOrRunTo desc =+ ([CmdMouse], desc, ByAimMode aimMode) where aimMode = AimModeCmd { exploration = ByArea $ common ++ -- exploration mode [ (CaMapLeader, grabCmd) , (CaMapParty, PickLeaderWithPointer)- , (CaMap, goToCmd)+ , (CaMap, goToOrRunTo) , (CaArenaName, Dashboard) , (CaPercentSeen, autoexploreCmd) ] , aiming = ByArea $ common ++ -- aiming mode- [ (CaMap, AimPointerEnemy)+ [ (CaMap, aimFlingCmd) , (CaArenaName, Accept) , (CaPercentSeen, XhairStair True) ] } common =@@ -152,18 +151,18 @@ mouseRMB :: CmdTriple mouseRMB = ( [CmdMouse]- , "fling at enemy/run to pointer collectively for 25 steps"+ , "start aiming at enemy under pointer" , ByAimMode aimMode ) where aimMode = AimModeCmd { exploration = ByArea $ common ++ [ (CaMapLeader, dropCmd) , (CaMapParty, SelectWithPointer)- , (CaMap, runToAllCmd)+ , (CaMap, AimPointerEnemy) , (CaArenaName, MainMenu) , (CaPercentSeen, autoexplore25Cmd) ] , aiming = ByArea $ common ++- [ (CaMap, aimFlingCmd)+ [ (CaMap, XhairPointerEnemy) -- hack; same effect, but matches LMB , (CaArenaName, Cancel) , (CaPercentSeen, XhairStair False) ] } common =
engine-src/Game/LambdaHack/Client/UI/DisplayAtomicM.hs view
@@ -1534,9 +1534,8 @@ - modifyDamageBySpeed rawDeltaHP speed _ -> - rawDeltaHP in min 0 speedDeltaHP- deadliness = 1000 * (- sDamage) `div` max oneM (bhp tb)+ deadliness = 1000 * (- sDamage) `div` max 1 (bhp tb) strongly- | bhp tb <= 0 = "cruelly" | deadliness >= 10000 = "artfully" | deadliness >= 5000 = "madly" | deadliness >= 2000 = "mercilessly"
engine-src/Game/LambdaHack/Client/UI/Frontend/Dom.hs view
@@ -24,7 +24,8 @@ import GHCJS.DOM.EventM (EventM, mouseAltKey, mouseButton, mouseCtrlKey, mouseMetaKey, mouseShiftKey, on, preventDefault, stopPropagation)-import GHCJS.DOM.GlobalEventHandlers (contextMenu, keyDown, mouseUp, wheel)+import GHCJS.DOM.GlobalEventHandlers (contextMenu, keyDown, mouseDown, mouseUp,+ wheel) import GHCJS.DOM.HTMLCollection (itemUnsafe) import GHCJS.DOM.HTMLTableElement (HTMLTableElement (HTMLTableElement), getRows, setCellPadding, setCellSpacing)@@ -48,9 +49,9 @@ import Game.LambdaHack.Client.UI.Frontend.Common import qualified Game.LambdaHack.Client.UI.Key as K import Game.LambdaHack.Common.Area-import Game.LambdaHack.Content.TileKind (floorSymbol) import Game.LambdaHack.Common.Point import qualified Game.LambdaHack.Common.PointArray as PointArray+import Game.LambdaHack.Content.TileKind (floorSymbol) import qualified Game.LambdaHack.Definition.Color as Color -- | Session data maintained by the frontend.@@ -191,6 +192,10 @@ stopPropagation void $ cell `on` mouseUp $ do saveMouse+ preventDefault+ stopPropagation+ void $ cell `on` mouseDown $ do+ -- Just disable selecting a region. preventDefault stopPropagation
engine-src/Game/LambdaHack/Client/UI/Frontend/Sdl.hs view
@@ -218,22 +218,23 @@ || SDL.keyModifierRightShift ksm key = keyTranslate shiftPressed $ SDL.keysymKeycode sym modifier = modTranslate ksm+ modifierNoShift = -- to prevent S-!, etc.+ if modifier == K.Shift then K.NoModifier else modifier p <- SDL.getAbsoluteMouseLocation when (key == K.Esc) $ resetChanKey (fchanKey rf)- saveKMP rf modifier key (pointTranslate p)+ saveKMP rf modifierNoShift key (pointTranslate p) SDL.MouseButtonEvent mouseButtonEvent | SDL.mouseButtonEventMotion mouseButtonEvent == SDL.Released -> do- md <- modTranslate <$> SDL.getModState+ modifier <- modTranslate <$> SDL.getModState let key = case SDL.mouseButtonEventButton mouseButtonEvent of SDL.ButtonLeft -> K.LeftButtonRelease SDL.ButtonMiddle -> K.MiddleButtonRelease SDL.ButtonRight -> K.RightButtonRelease _ -> K.LeftButtonRelease -- any other is spare left- modifier = if md == K.Shift then K.NoModifier else md p = SDL.mouseButtonEventPos mouseButtonEvent saveKMP rf modifier key (pointTranslate p) SDL.MouseWheelEvent mouseWheelEvent -> do- md <- modTranslate <$> SDL.getModState+ modifier <- modTranslate <$> SDL.getModState let SDL.V2 _ y = SDL.mouseWheelEventPos mouseWheelEvent mkey = case (compare y 0, SDL.mouseWheelEventDirection mouseWheelEvent) of@@ -242,7 +243,6 @@ (GT, SDL.ScrollNormal) -> Just K.WheelNorth (LT, SDL.ScrollFlipped) -> Just K.WheelNorth (GT, SDL.ScrollFlipped) -> Just K.WheelSouth- modifier = if md == K.Shift then K.NoModifier else md p <- SDL.getAbsoluteMouseLocation maybe (return ()) (\key -> saveKMP rf modifier key (pointTranslate p)) mkey@@ -402,12 +402,12 @@ void $! SDL.Raw.Video.saveBMP ptrOut fileNameCString SDL.Raw.Video.freeSurface ptrOut --- | Translates modifiers to our own encoding, ignoring Shift.+-- | Translates modifiers to our own encoding. modTranslate :: SDL.KeyModifier -> K.Modifier modTranslate m = modifierTranslate (SDL.keyModifierLeftCtrl m || SDL.keyModifierRightCtrl m)- False+ (SDL.keyModifierLeftShift m || SDL.keyModifierRightShift m) (SDL.keyModifierLeftAlt m || SDL.keyModifierRightAlt m || SDL.keyModifierAltGr m)
engine-src/Game/LambdaHack/Client/UI/HandleHelperM.hs view
@@ -51,6 +51,7 @@ import Game.LambdaHack.Common.Misc import Game.LambdaHack.Common.MonadStateRead import Game.LambdaHack.Common.Perception+import Game.LambdaHack.Common.Point import Game.LambdaHack.Common.ReqFailure import Game.LambdaHack.Common.State import Game.LambdaHack.Common.Time@@ -58,7 +59,6 @@ import qualified Game.LambdaHack.Content.ItemKind as IK import qualified Game.LambdaHack.Content.PlaceKind as PK import qualified Game.LambdaHack.Content.TileKind as TK-import Game.LambdaHack.Common.Point import qualified Game.LambdaHack.Definition.Ability as Ability import qualified Game.LambdaHack.Definition.Color as Color import Game.LambdaHack.Definition.Defs@@ -536,7 +536,9 @@ side <- getsClient sside factionD <- getsState sfactionD let standingOn = p == bpos b && lidV == blid b- verb = MU.Text $ if | standingOn -> "stand on"+ verb = MU.Text $ if | standingOn -> if bhp b > 0+ then "stand on"+ else "fall over" | canSee -> "notice" | otherwise -> "remember" nWs (iid, kit@(k, _)) =
engine-src/Game/LambdaHack/Client/UI/HandleHumanGlobalM.hs view
@@ -849,14 +849,23 @@ case psuitReqFun itemFull of Left reqFail -> failSer reqFail Right (pos, _) -> do- -- Set personal target to enemy, so that AI, if it takes over- -- the actor, is likely to continue the fight even if the foe flees.- -- Similarly if the crosshair points at position, etc.- sxhair <- getsSession sxhair- modifyClient $ updateTarget leader (const sxhair)- -- Project.- eps <- getsClient seps- return $ Right $ ReqProject pos eps iid fromCStore+ Benefit{benFling} <- getsClient $ (EM.! iid) . sdiscoBenefit+ go <- if benFling >= 0+ then displayYesNo ColorFull+ "The item appears beneficial. Do you really want to fling it?"+ else return True+ if go then do+ -- Set personal target to enemy, so that AI, if it takes over+ -- the actor, is likely to continue the fight even if the foe+ -- flees. Similarly if the crosshair points at position, etc.+ sxhair <- getsSession sxhair+ modifyClient $ updateTarget leader (const sxhair)+ -- Project.+ eps <- getsClient seps+ return $ Right $ ReqProject pos eps iid fromCStore+ else do+ modifySession $ \sess -> sess {sitemSel = Nothing}+ failWith "never mind" -- * Apply @@ -896,15 +905,23 @@ else case permittedApply localTime skill calmE itemFull kit of Left reqFail -> failSer reqFail Right _ -> do- -- No warning if item durable, because activation weak, but price low.- go <- if IA.checkFlag Ability.Durable arItem- || not (IA.checkFlag Ability.Periodic arItem)- then return True- else displayYesNo ColorFull- "Applying this periodic item will produce only the first of its effects and moreover, because it's not durable, will destroy it. Are you sure?"+ Benefit{benApply} <- getsClient $ (EM.! iid) . sdiscoBenefit+ go <-+ if | IA.checkFlag Ability.Periodic arItem+ && not (IA.checkFlag Ability.Durable arItem) ->+ -- No warning if item durable, because activation weak,+ -- but price low, due to no destruction.+ displayYesNo ColorFull+ "Applying this periodic item will produce only the first of its effects and moreover, because it's not durable, will destroy it. Are you sure?"+ | benApply <= 0 ->+ displayYesNo ColorFull+ "The item appears harmful. Do you really want to apply it?"+ | otherwise -> return True if go then return $ Right $ ReqApply iid fromCStore- else failWith "never mind"+ else do+ modifySession $ \sess -> sess {sitemSel = Nothing}+ failWith "never mind" -- * AlterDir
engine-src/Game/LambdaHack/Client/UI/HandleHumanLocalM.hs view
@@ -24,7 +24,7 @@ -- * Internal operations , permittedProjectClient, projectCheck, xhairLegalEps, posFromXhair , permittedApplyClient, selectAid, eitherHistory, endAiming, endAimingMsg- , doLook, flashAiming, xhairPointerFloor, xhairPointerEnemy+ , doLook, flashAiming #endif ) where @@ -1102,11 +1102,21 @@ xhairPointerFloorHuman :: MonadClientUI m => m () xhairPointerFloorHuman = do saimMode <- getsSession saimMode- xhairPointerFloor False+ aimPointerFloorHuman modifySession $ \sess -> sess {saimMode} -xhairPointerFloor :: MonadClientUI m => Bool -> m ()-xhairPointerFloor verbose = do+-- * XhairPointerEnemy++xhairPointerEnemyHuman :: MonadClientUI m => m ()+xhairPointerEnemyHuman = do+ saimMode <- getsSession saimMode+ aimPointerEnemyHuman+ modifySession $ \sess -> sess {saimMode}++-- * AimPointerFloor++aimPointerFloorHuman :: MonadClientUI m => m ()+aimPointerFloorHuman = do COps{corule=RuleContent{rXmax, rYmax}} <- getsState scops lidV <- viewedLevelUI -- Not @ScreenContent@, because not drawing here.@@ -1121,19 +1131,13 @@ sess { saimMode = Just $ AimMode lidV , sxhair , sxhairMoused }- if verbose then doLook else flashAiming+ doLook else stopPlayBack --- * XhairPointerEnemy--xhairPointerEnemyHuman :: MonadClientUI m => m ()-xhairPointerEnemyHuman = do- saimMode <- getsSession saimMode- xhairPointerEnemy False- modifySession $ \sess -> sess {saimMode}+-- * AimPointerEnemy -xhairPointerEnemy :: MonadClientUI m => Bool -> m ()-xhairPointerEnemy verbose = do+aimPointerEnemyHuman :: MonadClientUI m => m ()+aimPointerEnemyHuman = do COps{corule=RuleContent{rXmax, rYmax}} <- getsState scops lidV <- viewedLevelUI -- Not @ScreenContent@, because not drawing here.@@ -1161,15 +1165,5 @@ sess { saimMode = Just $ AimMode lidV , sxhairMoused , sxhair }- if verbose then doLook else flashAiming+ doLook else stopPlayBack---- * AimPointerFloor--aimPointerFloorHuman :: MonadClientUI m => m ()-aimPointerFloorHuman = xhairPointerFloor True---- * AimPointerEnemy--aimPointerEnemyHuman :: MonadClientUI m => m ()-aimPointerEnemyHuman = xhairPointerEnemy True
engine-src/Game/LambdaHack/Client/UI/KeyBindings.hs view
@@ -180,9 +180,10 @@ okm sel key1 key2 header footer = let kst1 = keySel sel key1 kst2 = keySel sel key2- f (ca1, Left km1, _) (ca2, Left km2, _) y = assert (ca1 == ca2)- [ (Left [km1], (y, keyM + 3, keyB + keyM + 3))- , (Left [km2], (y, keyB + keyM + 5, 2 * keyB + keyM + 5)) ]+ f (ca1, Left km1, _) (ca2, Left km2, _) y =+ assert (ca1 == ca2 `blame` (kst1, kst2))+ [ (Left [km1], (y, keyM + 3, keyB + keyM + 3))+ , (Left [km2], (y, keyB + keyM + 5, 2 * keyB + keyM + 5)) ] f c d e = error $ "" `showFailure` (c, d, e) kxs = concat $ zipWith3 f kst1 kst2 [offset + length header..] render (ca1, _, desc1) (_, _, desc2) =
engine-src/Game/LambdaHack/Common/ReqFailure.hs view
@@ -155,7 +155,7 @@ ProjectAimOnself -> "cannot aim at oneself" ProjectBlockTerrain -> "aiming obstructed by terrain" ProjectBlockActor -> "aiming blocked by an actor"- ProjectLobable -> "lobbing an item at a specific spot requires fling stat 3"+ ProjectLobable -> "flinging a lobable item that stops at target position requires fling stat 3" ProjectOutOfReach -> "cannot aim an item out of reach" TriggerNothing -> "wasting time on triggering nothing" NoChangeDunLeader -> "no manual level change for your team"