]      !"#$%&'()*+,-./0123456789:;<=>? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~               !!!!!"""""""######$$$$$$%%%&&&&&&&&&&&&&&&&& & & & & &&&&&&&&&&&'''''''' '!'"'#'$'%'&'''(')'*'+','-'.'/'0'1(2(3(4(5(6(7(8(9(:(;(<(=(>(?(@(A(B(C(D(E(F(G(H(I(J(K(L(M(N(O(P(Q(R(S(T(U(V(W(X(Y(Z([(\(])^)_)`)a)b)c)d)e)f)g)h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*{*|*}*~****************++++++++++++++++,,,,,,,,,,,,---------.....................................//////////////////0000111111111111111111111111222 2 2 2 2 2222222222233333333 3!3"3#3$3%3&3'3(3)3*4+4,4-4.4/404142535455565758595:5;5<5=5>5?5@5A5B5C5D5E5F5G5H5I5J5K5L5M5N5O5P6Q6R7S7T7U7V7W8X8Y8Z8[8\8]8^8_8`8a8b8c8d8e8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}8~888888888888888888888888889999999999999999999999999999:::;;;;;;;;;;;;<<<================>>>>>>>>>>>>>>>>???????????@@@@@@@@@@@@@@@@@@@@AABC C C C C CCDDDDDDDDDDDDDDDDD D!D"D#D$E%E&E'E(F)G*H+H,H-H.H/H0H1H2I3I4I5I6I7I8I9I:I;I<I=I>I?I@IAIBICIDIEIFIGIHIIIJIKILIMINIOIPIQIRISITIUIVIWIXIYJZJ[J\J]K^L_L`MaMbMcMdMeMfMgMhMiNjNkNlNmNnNoNpNqNrNsNtNuNvNwNxNyNzN{N|N}N~NNNNOOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPQQRRRRRRRRRRRRRRRRRRRRRRRRRRSSSSTTUUUVVVVVVVVVVVVVVWXXXXXYYY[ Safe-Inferred $Queues implemented with two stacks. "Create a new empty mutable queue. Check if the queue is empty. The length of the queue. Try reading a queue. Return Nothing if empty. )Write to the queue. Faster than reading. $Remove all but the last written non-Nothing element of the queue. 7Remove frames up to and including the first segment of Nothing frames. > | If the resulting queue is empty, apply trimLQueue instead. "Dump all but the last written non-Nothing element of the queue, if any.     NoneAbstract level identifiers. ,A unique identifier of a faction in a game. 6For each group that the kind belongs to, denoted by a Text name H in the first component of a pair, the second component of a pair shows * how common the kind is within the group. ALevel bounds. TODO: query terminal size instead and scroll view. IMaximal supported level X and Y dimension (32768). Not checked anywhere. @ The value is chosen to support architectures with 32-bit ints. Integer division, rounding up.  breturn b a = [a | b]NoneAThe general type of a particular game content, e.g., item kinds. "symbol, e.g., to print on the map "name, e.g., to show to the player frequency within groups *validate and catch some offenders, if any %all the defined content of this type None@Faction properties that are fixed for a given kind of factions.  a symbol short description frequency within groups !!AI to use for the selected actor "AI to use for idle actors #DNo specific possible problems for the content of this kind, so far, N so the validation function always returns the empty list of offending kinds.  !"# !"# !"# !"#None$*The choice of a fence type for the place. %2skip the fence and fill all with the place proper &,leave an empty floor space around the place '(put a solid wall fence around the place (CA method of filling the whole area by transforming a given corner. )8tile separately and symmetrically quarters of the place *7fill symmetrically 4 corners and stretch their borders +9reflect every other corner, overlapping 1 row and column ,EParameters for the generation of small areas within a dungeon level. . a symbol /short description 0frequency within groups 1,how to fill whole place based on the corner 2-whether to fence the place with solid border 3)plan of the top-left corner of the place 4IFilter a list of kinds, passing through only the incorrect ones, if any. BVerify that the top-left corner map is rectangular and not empty. $%&'()*+,-./01234$%&'()*+,-./01234,-./0123(+*)$'&%4$'&%(+*),-./01234Z Safe-Inferred   Safe-Inferred 5IAll possible AI actor abilities. AI chooses among these when considering J the next action to perform. The ability descriptions refer to the target 7 that any actor picks each turn, depending on the actor's characteristics  and his environment. 61wander around, meleeing any opponents on the way 71chase the target, ignoring any actors on the way 88use items, if target opponent visible, some of the time 9>attack the visible target opponent at range, some of the time :!gather items, if no foes visible ; melee target <flee if almost dead =heal if almost dead >6move along a set path, if any, meleeing any opponents 56789:;<=> 56789:;<=> 5>=<;:98765 >=<;:9876 None?CStrategy properties that are fixed for a given kind of strategies. A a symbol Bshort description Cfrequency within groups D-abilities to pick from in roughly that order EDNo specific possible problems for the content of this kind, so far, N so the validation function always returns the empty list of offending kinds. ?@ABCDE?@ABCDE?@ABCDE?@ABCDE NoneF(Speed in meters per 1 million seconds (m/Ms).  Actors at normal speed (2 m/s) take one time turn (0.5 s)  to move one tile (1 m by 1 m). G(Game time in ticks. The time dimension. 8 One tick is 1 microsecond (one millionth of a second),  one turn is 0.5 s. H6Start of the game time, or zero lenght time interval. AThe smallest unit of time. Do not export, because the proportion . of turn to tick is an implementation detail. G The significance of this detail is only that it determines resolution  of the time dimension. IAn infinitesimal time period. J:At least once per clip all moves are resolved and a frame  or a frame delay is generated. 1 Currently one clip is 0.1 s, but it may change, 5 and the code should not depend on this fixed value. K0One turn is 0.5 s. The code may depend on that.  Actors at normal speed (2 m/0s) take one turn to move one tile (1 m by 1 m). (This many turns fit in a single second. 8This many ticks fits in a single second. Do not export, LTime addition. M?How many time intervals of the latter kind fits in an interval  of the former kind. N<Negate a time interval. Can be used to subtract from a time % or to reverse the ordering on time. OScale time by an Int scalar value. P<Represent the main 10 thresholds of a time range by digits, + given the total length of the time range. $Number of seconds in a kilo-second. Q%Constructor for content definitions. R$No movement possible at that speed. SNormal speed (2 m//s) that suffices to move one tile in one turn. TScale speed by an Int scalar value. USpeed addition. VSpeed negation. WFThe number of time ticks it takes to walk 1 meter at the given speed. X>Distance in meters (so also in tiles, given the chess metric) 8 traveled in a given time by a body with a given speed. Y5Calculate projectile speed from item weight in grams  and speed bonus in percents.  See  ;https://github.com/kosmikus/LambdaHack/wiki/Item-statistics. ZBCalculate maximum range in meters of a projectile from its speed.  See  ;https://github.com/kosmikus/LambdaHack/wiki/Item-statistics. B With this formula, each projectile flies for exactly one second, 0 that is 2 turns, and then drops to the ground. < Dividing and multiplying by 2 ensures both turns of flight  cover the same distance. FGHIJKLMNOPQRSTUVWXYZFGHIJKLMNOPQRSTUVWXYZGHJKLMNOIPFQRSTUVWXYZFGHIJKLMNOPQRSTUVWXYZ  Safe-Inferred_2Text attributes: foreground and backgroud colors. aforeground colour bbackgroud color c*Colours supported by the major frontends. t4The default colours, to optimize attribute setting. u4The default colours, to optimize attribute setting. v6The default attribute, to optimize attribute setting. wBA helper for the terminal frontends that display bright via bold. xIDue to the limitation of the curses library used in the curses frontend, # only these are legal backgrounds. y Colour sets. z Colour sets. { Colour sets. |ATranslationg to heavily modified Linux console color RGB values. 2For reference, the original Linux console colors. > Good old retro feel and more useful than xterm (e.g. brown). '[\]^_`abcdefghijklmnopqrstuvwxyz{|  "[\]^_`abcdefghijklmnopqrstuvwxyz{|"csrqponmlkjihgfedtuwxyz{|_`abv[\]^[\]^_`abcsrqponmlkjihgfedtuvwxyz{|   Safe-Inferred }The type of item flavours.  0should the colour description be fancy or plain  the colour of the flavour ~&Turn a colour set into a flavour set. &Turn a colour set into a flavour set. #The standard full set of flavours. -Get the underlying base colour of a flavour. &Construct the full name of a flavour. 7Human-readable names, for item colors. The simple set. 6Human-readable names, for item colors. The fancy set. 9Simple names for team colors (bright colours preferred). }   ~ }~ }~ }   ~ None#Serialize, compress and save data. 8 Note that LBS.writeFile opens the file in binary mode. 6Serialize, compress and save data with an EOF marker.  The OK? is used as an EOF marker to ensure any apparent problems with 0 corrupted files are reported to the user ASAP. )Read and decompress the serialized data. 'Read, decompress and deserialize data. :Read, decompress and deserialize data with an EOF marker.  The OK: EOF marker ensures any easily detectable file corruption 9 is discovered and reported before the function returns. &Try to create a directory, if it doesn't exist. Terminate the program ; with an exception if the directory does not exist, but can't be created. 3Try to copy over data files, if not already there. NoneBIf the condition fails, display the value blamed for the failure.  Used as in $ assert (c /= 0 `blame` c) $ 10 / c Like ), but shows the source position and also 7 the value to blame for the failure. To be used as in: D assert `failure` ((x1, y1), (x2, y2), "designate a vertical line") Like [\:, but if the predicate fails, blame all the list elements < and especially those for which it fails. To be used as in: / assert (allB (>= 0) [yf, xf, y1, x1, y2, x2]) #To be used in place of the verbose skip , as in:  do b <- getB a  assert (b `blame` a) skip None'2D points in cartesian representation. *Spacial dimension for points and vectors. *Spacial dimension for points and vectors. HA list of all points on a straight vertical or straight horizontal line 3 between two points. Fails if no such line exists. ESort the sequence of two points, in the derived lexicographic order. See  Bhttp://roguebasin.roguelikedevelopment.org/index.php/Digital_lines.  Bresenham'3s line algorithm generalized to arbitrary starting eps  (eps? value of 0 gives the standard BLA). Includes the source point 0 and goes through the target point to infinity.  None4A few overlays, displayed one by one upon keypress. / When displayed, they are trimmed, not wrapped < and any lines below the lower screen edge are not visible. FA series of screen lines that may or may not fit the width nor height G of the screen. An overlay may be transformed by adding the first line  and/6or by splitting into a slideshow of smaller overlays. The history of reports. =The type of a set of messages to show at the screen at once. The type of a single message. BRe-exported English phrase creation functions, applied to default  irregular word sets. BRe-exported English phrase creation functions, applied to default  irregular word sets. The "press something to see more" mark. "The confirmation request message. JAdd a space at the message end, for display overlayed over the level map. B Also trims (does not wrap!) too long lines. In case of newlines, A displays only the first line, but marks the message as partial. Empty set of messages. &Test if the set of messages is empty. 'Construct a singleton set of messages. "Add message to the end of report. 3Split a messages into chunks that fit in one line. G We assume the width of the messages line is the same as of level map. 2Render a report as a (possibly very long) string. CSplit a string into lines. Avoids ending the line with a character D other than whitespace or punctuation. Space characters are removed J from the start, but never from the end of lines. Newlines are respected. Empty history of reports. *Construct a singleton history of reports. =Render history as many lines of text, wrapping if necessary. /Add a report to history, handling repetitions. 1Take the given prefix of reports from a history. 7Returns a function that looks up the characters in the D string by position. Takes the width and height of the display plus F the string. Returns also the message to print at the top and bottom. 9Split an overlay into a slideshow in which each overlay,  prefixed by msg and postfixed by moreMsg except for the last one, B fits on the screen wrt height (but lines may still be too wide). BDeclare the list of overlays to be fit for display on the screen.  In particular, current Report is eiter empty or unimportant @ or contained in the overlays and if any vertical or horizontal 5 trimming of the overlays happens, this is intended. #None !The frequency distribution type. "short description for debug, etc. #give acces to raw frequency values )Uniform discrete frequency distribution. 1Takes a name and a list of frequencies and items " into the frequency distribution. ,Scale frequecy distribution, multiplying it ! by a positive integer constant. )Change the description of the frequency. 7Randomly choose an item according to the distribution. -Test if the frequency distribution is empty.  !"#  !"#NoneFractional chance. 5Dice for parameters scaled with current level depth. C To the result of rolling the first set of dice we add the second, I scaled in proportion to current depth divided by maximal dungeon depth. =Dice for rolling a pair of integer parameters pertaining to, 5 respectively, the X and Y cartesian 2D coordinates. Dice: 1d7, 3d3, 1d0, etc.   RollDice a b represents a rolls of b -sided die. 7The monad of computations with random generator state. K The lazy state monad is OK here: the state is small and regularly forced. @Get a random object within a range with a uniform distribution. AGet a random object of a given type with a uniform distribution. 2Get any element of a list with equal probability. 6Gen an element according to a frequency distribution. Roll a single die. Roll dice and sum the results. Maximal value of dice. Minimal value of dice. Mean value of dice. Roll the two sets of dice. +Roll dice scaled with current level depth. C Note that at the first level, the scaled dice are always ignored. 5Roll dice scaled with current level depth and return True $ if the results if greater than 50.  Generate a RollDeep' that always gives a constant integer. Maximal value of scaled dice. Give True/, with probability determined by the fraction. $%&'$%&'None/Transform an effect using a stateful function. (KSuffix to append to a basic content name if the content causes the effect. FHow much AI benefits from applying the effect. Multipllied by item p. H Negative means harm to the enemy when thrown at him. Effects with zero  benefit won'0t ever be used, neither actively nor passively. ()*+, ()*+,None?All possible terrain tile features, some of them parameterized H or dependent on outside coefficients, e.g., on the tile secrecy value. *when hidden, looks as a tile of the group ,used for visible paths throughout the level $is a (not hidden) door, stair, etc. )actors and stairs can be generated there items can be generated there (can never be excavated nor seen through 'sustains the effect continuously, TODO (may not be what it seems (clients only) is lit with an ambient shine actors can see through actors can walk through 2transitions to a tile of the group when triggered !causes the effect when triggered triggered by closing triggered by opening triggered by escaping triggered by descending triggered by ascending --None :Item properties that are fixed for a given kind of items.  map symbol  generic name frequency within groups possible flavours the effect when activated created in that quantify *the verb for applying and possibly combat the verb for projecting weight in grams )percentage bonus or malus to throw speed DNo specific possible problems for the content of this kind, so far, N so the validation function always returns the empty list of offending kinds.    None <Actor properties that are fixed for a given kind of actors.  map symbol short description frequency within groups  map color natural speed in m/s  encodes initial and maximal hp   can it see?  can it smell?   intelligence  #number of turns to regenerate 1 HP the set of supported abilities IFilter a list of kinds, passing through only the incorrect ones, if any. :Make sure actor kinds can be told apart on the level map.                      None 7A strategy is a choice of (non-empty) frequency tables  of possible actions. FStrategy where only the actions from the given single frequency table  can be picked. 9Strategy with the actions from both argument strategies,  with original frequencies. !Strategy with no actions at all. !Conditionally accepted strategy. @Strategy with all actions not satisfying the predicate removed. F The remaining actions keep their original relative frequency values. 7When better choices are towards the start of the list, - this is the best frequency of the strategy. BOverwrite the description of all frequencies within the strategy. Like .+, but pick a name of the single frequency. /EStrategy is a monad. TODO: Can we write this as a monad transformer? 0123/   0123/None(2D vectors in cartesian representation. Shift a point by a vector. 4Vectors of all unit moves in the chessboard metric, ! clockwise, starting north-west. IVectors of all cardinal direction unit moves, clockwise, starting north. 1The lenght of a vector in the chessboard metric,  where diagonal moves cost 1.  &Squared euclidean length of a vector. !Reverse an arbirary vector.  ! ! ! !None)$Abstract syntax of player commands. G7Major commands land on the first page of command help. H8Minor commands land on the second page of command help. I<Commands that are forbidden on a remote level, because they . would usually take time when invoked on one. E Not that movement commands are not included, because they take time  on normal levels, but don''t take time on remote levels, that is,  in targeting mode. J Description of player commands. ,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ456)"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ+)FEDCBA@?>=<;:9876543210/.-,+*"%#&'(&'$GHIJ "%#&'(&'$)FEDCBA@?>=<;:9876543210/.-,+*GHIJ456None K=The type of areas. The bottom left and the top right points. L>All (8 at most) closest neighbours of a point within an area. MIAll (4 at most) cardinal direction neighbours of a point within an area. N(Checks that a point belongs to an area. OHSort the corners of an area so that the bottom left is the first point. PGDivide uniformly a larger area into the given number of smaller areas. Q Checks if it'#s an area with at least one field. R Checks if it'"s an area with exactly one field. SEEnlarge (or shrink) the given area on all fours sides by the amount. KLlimit the search to this area position to find neighbours of Mlimit the search to this area position to find neighbours of NOPQRS KLMNOPQRS KLMNOPQRS KLMNOPQRSNone T>The type of positions on the 2D level map, heavily optimized. DWe represent the (level map on the) screen as a linear framebuffer,  where Point is an Int% offset counted from the first cell. 7 We do bounds check for the X size whenever we convert : between representations and each subsequent array access 1 performs another check, effectively for Y size. # After dungeon is generated (using PointXY, not Point),  and converted to the Point! representation, points are used K mainly as keys and not constructed often, so the performance will improve ' due to smaller save files, the use of EnumMap and cheaper array indexing, " including cheaper bounds checks. U3Print a point as a tuple of cartesian coordinates. V)Conversion from cartesian coordinates to Point. 7Conversion from Point to cartesian coordinates. W+The top-left corner position of the level. X:The distance between two points in the chessboard metric. Y2Checks whether two points are adjacent on the map + (horizontally, vertically or diagonally). ZCReturns the 8, or less, surrounding positions of a given position. [EReturns the 4, or less, surrounding positions in cardinal directions  from a given position. \(Checks that a point belongs to an area. ]>Calculate the displacement vector from a position to another. ^ Bresenham'3s line algorithm generalized to arbitrary starting eps  (eps% value of 0 gives the standard BLA). : Skips the source point and goes through the second point ! to the edge of the level. GIves Nothing if the points are equal. T8UV7WXYZ[\]^9: TUVWXYZ[\]^ TVUWXYZ[\]^T8UV7WXYZ[\]^9:None d.Sequences of screen frames, including delays. e?Animation is a list of frame modifications to play one by one, G where each modification if a map from positions to level map symbols. f7The data sufficent to draw a single game screen frame. h$content of the screen, line by line i!an extra line to show at the top j$an extra line to show at the bottom n,Render animations on top of a screen frame. pHAttack animation. A part of it also reused for self-damage and healing. q"Attack that hits through a block. rAttack that is blocked. s%Death animation for an organic body. t2Swap-places animation, both hostile and friendly. _`abcde;fghijklmn<=>opqrstu?@ [\]^_`abv_`abcdefghijklmnopqrstu _`abv[\]^fghijklmednopqrstu_cba`_cba`de;fghijklmn<=>opqrstu?@Nonev=2D vectors represented as offsets in the linear framebuffer  indexed by T. 5A newtype is used to prevent mixing up the type with Point itself. I Note that the offset representations of a vector is usually not unique. H E.g., for vectors of length 1 in the chessboard metric, used to denote D geographical directions, the representations are pairwise distinct ; if and only if the level width and height are at least 3. w3Converts a vector in cartesian representation into Vector. x9Tells if a vector has length 1 in the chessboard metric. y8Converts a unit vector in cartesian representation into Vector. A4Converts a unit vector in the offset representation 9 into the cartesian representation. Arbitrary vectors can't be  converted uniquely. zTranslate a point by a vector. JParticularly simple and fast implementation in the linear representation. {GTranslate a point by a vector, but only if the result fits in an area. |;Vectors of all unit moves, clockwise, starting north-west. }5Squared euclidean distance between two unit vectors. ~6Checks whether a unit vector is a diagonal direction, 4 as opposed to cardinal. If the vector is not unit, , it reject horizontal and vertical vectors. Reverse an arbirary vector. BCGiven a vector of arbitrary non-zero length, produce a unit vector ? that points in the same direction (in the chessboard metric). H Of several equally good directions it picks one of those that visually E (in the euclidean metric) maximally align with the original vector. FGiven two distinct positions, determine the direction (a unit vector) @ in which one should move from the first in order to get closer F to the second. Ignores obstacles. Of several equally good directions @ (in the chessboard metric) it picks one of those that visually C (in the euclidean metric) maximally align with the vector between  the two points. *A vector from a point to another. We have  - shift pos1 (displacement pos1 pos2) == pos2 JParticularly simple and fast implementation in the linear representation. ,A list of vectors between a list of points. 2A list of points that a list of vectors leads to. vCwDxyAz{|}~BEFvwxyz{|}~vwyz{|x}~vCwDxyAz{|}~BEFNone +Our own encoding of modifiers. Incomplete. 1Frontend-independent datatype to represent keys. ,an unknown key, registered to warn the user a single printable character 4a keypad key for a character (digits and operators) $Show a key with a modifier, if any. 3Configurable event handler for the direction keys. 0 Used for directed commands such as close door. 'Binding of both sets of movement keys. FTranslate key from a GTK string description to our internal key type. @ To be used, in particular, for the command bindings and macros  in the config file. +GHIJKLMNOPQRSGHIJKLMNOPQRSNone1Parameters for the generation of dungeon levels.  a symbol short description frequency within groups X size of the whole cave Y size of the whole cave %the dimensions of the grid of places minimal size of places the chance a place is dark "a proportion of extra connections #the chance of not creating a place %extra places, may overlap except two  minimal distance between stairs #the chance of a door in an opening if there's a door, is it open? #if not open, hidden one in n times  the number of items in the cave !the default cave tile group name "the cave corridor tile group name the filler wall group name 'the dark place plan legend ground name &the lit place plan legend ground name IFilter a list of kinds, passing through only the incorrect ones, if any. ECatch caves with not enough space for all the places. Check the size ; of the cave descriptions to make sure they fit on screen. None 1The area left to be scanned, delimited by edges. 1An edge (comprising of a line and a convex hull)  of the area to be scanned. -Convex hull represented as a list of points. Straight line between points. HRotated and translated coordinates of 2D points, so that the points fit M in a single quadrant area (e, g., quadrant I for Permissive FOV, hence both E coordinates positive; adjacent diagonal halves of quadrant I and II % for Digital FOV, hence y positive). E The special coordinates are written using the standard mathematical < coordinate setup, where quadrant I, with x and y positive,  is on the upper right. <Progress along an arc with a constant distance from (0, 0). 5Distance from the (0, 0) point where FOV originates. EMaximal element of a non-empty list. Prefers elements from the rear, : which is essential for PFOV, to avoid ill-defined lines. CCheck if the line from the second point to the first is more steep B than the line from the third point to the first. This is related C to the formal notion of gradient (or angle), but hacked wrt signs L to work fast in this particular setup. Returns True for ill-defined lines. IExtends a convex hull of bumps with a new bump. Nothing needs to be done E if the new bump already lies within the hull. The first argument is  typically 6, optionally negated, applied to the second argument. a comparison function a new bump to consider -a convex hull of bumps represented as a list   None(The type of kinds of terrain tiles. See Tile.hs for explanation ( of the absence of a corresponding type Tile that would hold + particular concrete tiles in the dungeon.  map symbol short description frequency within groups  map color map color when not in FOV  properties IFilter a list of kinds, passing through only the incorrect ones, if any. LIf tiles look the same on the map, the description should be the same, too. J Otherwise, the player has to inspect manually all the tiles of that kind 8 to see if any is special. This is a part of a stronger < but less precise property that tiles that look the same can't be = distinguished by player actions (but may behave differently 0 wrt dungeon generation, AI preferences, etc.).    None3The type of game rule sets and assorted game data. @For now the rules are immutable througout the game, so there is  no type Rule' to hold any changing parameters, just RuleKind  for the fixed set. F However, in the future, if the rules can get changed during gameplay B based on data mining of player behaviour, we may add such a type  and then RuleKind3 will become just a starting template, analogously  as for the other content. The  raccessible$ field holds a predicate that tells 2 whether one position is accessible from another. 9 Precondition: the two positions are next to each other.  a symbol short description frequency within groups the title of the game the path to data files the version of the game symbols of melee weapons  symbols of items AI can project #the default game rules config file $the default UI settings config file  the ASCII art for the Main Menu 'Validates the ASCII art format (TODO). TA dummy instance of the U' class, to satisfy general requirments  about content. We won'2t have many rule sets and they contain functions, 1 so defining a proper instance is not practical. T T]None)Session data maintained by the frontend. Vthe widget to draw to Wtext color tags for fg/bg Xchannel for keyboard input Y7state of the frame finite machine; this mvar is locked " for a short time only, because it's needed, among others, > to display frames, which is done by a single polling thread,  in real time Z:most recent full (not empty, not repeated) frame received 9 and if any empty frame followed it; this mvar is locked = for longer intervals to ensure that threads (possibly many) B add frames in an orderly manner, which is not done in real time, : though sometimes the frame display subsystem has to poll D for a frame, in which case the locking interval becomes meaningful [screen output channel \last full frame shown ])Perform an operation on the frame queue. The name of the frontend. 1Starts GTK. The other threads have to be spawned - after gtk is initialized, because they call  postGUIAsync,  and need sview and stags&. Because of Windows, GTK needs to be  on a bound thread, so we can'#t avoid the communication overhead  of bound threads, so there'/s no point spawning a separate thread for GTK. ^ASets up and starts the main GTK loop providing input and output. _'Output to the screen via the frontend. `Maximal frames per second. = This is better low and fixed, to avoid jerkiness and delays G that tell the player there are many intelligent enemies on the level.  That'Es better than scaling AI sofistication down based on the FPS setting  and machine speed. aMaximal polls per second. b,Add a given number of microseconds to time. cGThe difference between the first and the second time, in microseconds. d?Poll the frame queue often and draw frames at fixed intervals. e>Add a game screen frame to the frame drawing channel, or show  it ASAP if  immediate0 display is requested and the channel is empty. fDTrim current frame queue and display the most recent frame, if any. Add a frame to be drawn. $Display a prompt, wait for any key. 1 Starts in Push or None mode, stop in None mode. gTells a dead key. h*Translates modifiers to our own encoding. %ijklmVWXYZnop[\q]r^_frontend session data the screen frame to draw s`abcdetfghuijklmVWXYZnpo[\q]r^_s`abcdetfghu!None"None 5The coordinates of consecutive fields of a corridor. v3The choice of horizontal and vertical orientation. $Pick a random point within an area. 4Create a random room according to given parameters. /Create a void room, i.e., a single point area. HPick a subset of connections between adjacent areas within a grid until B there is only one connected component in the graph of all areas. FPick a single random connection between adjacent areas within a grid. w7Create a corridor, either horizontal or vertical, with A a possible intermediate part that is in the opposite direction. +Try to connect two places with a corridor. M Choose entrances at least 4 or 3 tiles distant from the edges, if the place  is big enough. Note that with pfence == FNone, the area considered < is the interior of the place, without the outermost tiles. vxy minimum size )the containing area, not the room itself $the area in which to pick the point zw$orientation of the starting section starting point  ending point +the area containing the intermediate point "straight sections of the corridor  vyxzw#None!Calculates the list of tiles, in Bump# coordinates, visible from (0, 0),  within the given sight range. =Create a line from two points. Debug: check if well-defined. Compare steepness of (p1, f) and (p2, f). C Debug: Verify that the results of 2 independent checks are equal. DThe X coordinate, represented as a fraction, of the intersection of @ a given line and the line of diagonals of diamonds at distance  d from (0, 0). Debug functions for DFOV: FDebug: calculate steeper for DFOV in another way and compare results. 6Debug: check is a view border line for DFOV is legal. visiblity radius clear tile predicate $None!Calculates the list of tiles, in Bump# coordinates, visible from (0, 0). =Create a line from two points. Debug: check if well-defined. Compare steepness of (p1, f) and (p2, f). C Debug: Verify that the results of 2 independent checks are equal. DThe Y coordinate, represented as a fraction, of the intersection of ? a given line and the line of diagonals of squares at distance  d from (0, 0). Debug functions for PFOV: FDebug: calculate steeper for PFOV in another way and compare results. ,Debug: checks postconditions of borderLine. clear tile predicate %NoneIThe area left to be scanned, delimited by fractions of the original arc.  Interval (0, 1)8 means the whole 45 degrees arc of the processed octant  is to be scanned. BRotated and translated coordinates of 2D points, so that they fit ! in the same single octant area. !Calculates the list of tiles, in SBump# coordinates, visible from (0, 0). clear tile predicate !the current distance from (0, 0) the current interval to scan {|{|&None;Arrays of content identifiers pointing to the content type c, * where the identifiers are represented as Word8  (and so content of type c! can have at most 256 elements).  The arrays are indexed by type i!, e.g., a dungeon tile position. 5Operations for all content types, gathered together. +Content operations for the content of type a. &the symbol of a content element at id $the name of a content element at id  the content element at given id the id of the unique member of  a singleton content group  &pick a random id belonging to a group  and satisfying a predicate  "fold over all content elements of a  !bounds of identifiers of content a  auxiliary speedup components  :Type family for auxiliary data structures for speeding up  content operations. )Content identifiers for the content type c. #Create content operations for type a from definition of content  of type a. 0The standard ruleset used for level operations. "Content identifiers array lookup. IConstruct a content identifiers array updated with the association list. <Create a content identifiers array from a list of elements. =Create a content identifiers array from an association list. "Content identifiers array bounds. "Fold left strictly over an array. '}     ~#           }       ~'NoneHFlavours assigned by the server to item kinds, in this particular game. 8Game items in inventories or strewn around the dungeon.  The fields jsymbol, jname and jflavour make it possible to refer to I and draw an unidentified item. Full information about item is available  through the jkindIx* index as soon as the item is identified. 'index pointing to the kind of the item individual map symbol individual generic name individual flavour the effect when activated  The reverse map to  Discovery, needed for item creation. !/The map of item kind indexes to item kind ids. 7 The full map, as known by the server, is a bijection. "CAn index of the kind id of an item. Clients have partial knowledge M how these idexes map to kind ids. They gain knowledge by identifying items. #/A unique identifier of an item in the dungeon. $-Recover a kind id of an item, if identified. &$Build an item with the given stats. '!Generate an item based on level. (Represent an item on the map. ?Assigns flavours to item kinds. Assures no flavor is repeated, 3 except for items with only one permitted flavour. *;Randomly chooses flavour for all item kinds for this game. .(The part of speech describing the item.  !"#$%&'()*+,-./0 !"#$%&'()*+,-./0#$&'(+,-"! %)*./0 !"#$%&'()*+,-./0(None!1HReverse item map, for item creation, to keep items and item identifiers  in bijection. 26All actors on the level, indexed by actor identifier. 3;All items in the dungeon (including in actor inventories),  indexed by item identifier. 98Actor properties that are changing throughout the game. ( If they are dublets of properties from  ActorKind, ; they are usually modified temporarily, but tend to return  to the original value from  ActorKind over time. E.g., HP. ;the kind of the actor <individual map symbol =individual name >individual map color ?individual speed @current hit points A#path the actor is forced to travel Bcurrent position Cprevious position Dcurrent level Eitems carried Fmap from letters to items Gnext inventory letter Habsolute time of next action I"last bracing expires at this time J#to which faction the actor belongs K"is a projectile? (shorthand only, # this can be deduced from bkind) L0A unique identifier of an actor in the dungeon. MAChance that a new monster is generated. Currently depends on the F number of monsters already present, and on the level. In the future, H the strength of the character and the strength of the monsters present F could further influence the chance, and the chance could also affect G which monster is generated. How many and which monsters are generated < will also depend on the cave kind used to build the level. N)The part of speech describing the actor. O+A template for a new non-projectile actor. P5Access actor speed, individual or, otherwise, stock. Q,Add time taken by a single step at the actor's current speed. R1Whether an actor is braced for combat this turn. S1Checks for the presence of actors in a position. ) Does not check if the tile is walkable. TThe unique kind of heroes. U The unique kind of projectiles. VHow long until an actor's smell vanishes from a tile. X<Assigns a letter to an item, for inclusion in the inventory : of a hero. Tries to to use the requested letter, if any. 3123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\,123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\,LMN9:;<=>?@ABCDEFGHIJKOQRSTUP5467831WXZY[2V\123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\)None]>The last time a hero left a smell in a given tile. To be used ! by monsters that hunt by smell. ^+Whether a tile kind has the given feature. _6Whether a tile kind has all features of the first set  and no features of the second. `AWhether a tile kind (specified by its id) has the given feature. a&Whether a tile does not block vision.  Essential for efficiency of FOV, hence tabulated. b"Whether a tile is lit on its own.  Essential for efficiency of  Perception, hence tabulated. c=Whether a tile can be explored, possibly yielding a treasure < or a hidden message. We exclude doors and hidden features. dThe player can' t tell one tile from the other. ]^_`abcdefg ]^_`abcdefg ]^_`abcdefg ]^_`abcdefg*None!h+A view on single, inhabited dungeon level.  Remembered fields < carry a subset of the info in the client copies of levels. jdepth of the level k$remembered actor times on the level l$remembered items lying on the floor mremembered level map nwidth of the level oheight of the level premembered smells on the level qlevel description r!destination of (up, down) stairs s!currently remembered clear tiles t&total number of initially clear tiles u'date of the last activity on the level v'number of initial items, 0 for clients w&secret level seed, unknown by clients x(secret tile density, unknown by clients yCurrent smell on map tiles. zTile kinds on the map. {Items located on map tiles. Actor time priority queue. |Item container type. :The complete dungeon is a map from level names to levels. Levels in the current branch, k$ levels shallower than the current. &Update the actor time priority queue. Update the smell map. $Update the items on the ground map. Update the tile map. !Query for tile kinds on the map. Query for items on the ground. 7Check whether one position is accessible from another, . using the formula from the standard ruleset. 9 Precondition: the two positions are next to each other. CCheck whether actors can move from a position along a unit vector, . using the formula from the standard ruleset. :Find a random position on the map satisfying a predicate. 4Try to find a random position on the map satisfying , the conjunction of the list of predicates. 4 If the permitted number of attempts is not enough, A try again the same number of times without the first predicate, E then without the first two, etc., until only one predicate remains, . at which point try as many times, as needed. *hijklmnopqrstuvwxyz{|}~the number of tries look up in this map predicates to satisfy 'hijklmnopqrstuvwxyz{|}~'|~}y{zhijklmnopqrstuvwxhijklmnopqrstuvwxyz{|~}+None$Abstract syntax of server commands. =The actor performing the command, if still alive afterwards. ,None EThe map of tile kinds in a place (and generally anywhere in a cave). L The map is sparse. The default tile that eventually fills the empty spaces 2 is specified in the cave kind specification with cdefTile. 6The parameters of a place. Most are immutable and set ( at the time when a place is generated. For  CAlternate( tiling, require the place be comprised = of an even number of whole corners, with exactly one square 5 overlap between consecutive coners and no trimming. J For other tiling methods, check that the area is large enough for tiling < the corner twice in each direction, with a possible one row/column overlap. 4Modify available room area according to fence type. -Given a few parameters, roll and construct a  datastructure + and fill a cave section acccording to it. FRoll a legend of a place plan: a map from plan symbols to tile kinds. <Construct a fence around an area, with the given tile kind. @Construct a place of the given kind, with the given fence tile. #Create a place by tiling patterns. the area to fill the place kind to construct the game content current cave kind fence tile, if fence hollow current level depth maximum depth interior area of the place the place parameters the place kind  the legend the area to fill the place kind to construct    -None6The type of caves (not yet inhabited dungeon levels). the kind of the cave tile kinds in the cave starting items in the cave places generated in the cave AThe map of starting items in tiles of a cave. The map is sparse. + Unspecified tiles have no starting items. !The map of tile kinds in a cave. L The map is sparse. The default tile that eventually fills the empty spaces 2 is specified in the cave kind specification with cdefTile. @Cave generation by an algorithm inspired by the original Rogue, content definitions depth of the level to generate maximum depth of the dungeon  cave kind to use for generation   .NoneCurrent game status. current game outcome depth of the final encounter extra information Outcome of a game. game is restarted %the player escaped the dungeon alive )the player won by eliminating all rivals game is supended )the faction lost the game in another way the faction was eliminated HDiplomacy states. Higher overwrite lower in case of assymetric content. the kind of the faction individual name raw name specified in config AI for the leaders;  Nothing means human-controlled AI to use for other actors;  Nothing means human-controlled diplomatic mode cause of game end/exit  color of actors or their frames number of initial actors !level where initial actors start 9All factions in the game, indexed by faction identifier. HTell whether the faction is controlled (at least partially) by a human. ?Tell whether the faction uses AI to control any of its actors. +Tell whether the faction can spawn actors. CTell whether actors of the faction can be summoned by items, etc.. 0Check if factions are at war. Assumes symmetry. 0Check if factions are allied. Assumes symmetry. *&& /NoneAMultiplex connection channels, for the case of a frontend shared ? among clients. This is transparent to the clients themselves. ?show a whole slideshow without interleaving with other clients #flush frames, possibly show fadeout/fadein and ask for a keypress 9show a frame, if the fid acitve, or save it to the client's queue CDisplay a prompt, wait for any of the specified keys (for any key, > if the list is empty). Repeat if an unexpected key received. 0Augment a function that takes and returns keys. 0None )The list of scores, in decreasing order. CA single score record. Records are ordered in the highscore table, M from the best to the worst, in lexicographic ordering wrt the fields below.  the score *game time spent (negated, so less better) #date of the last game interruption  reason of the game interruption JShow a single high score, from the given ranking in the high score table. Empty score table EInsert a new score into the table, Return new table and the ranking.  Make sure the table doesn't grow too large. 'Register a new score in a score table. +Show a screenful of the high scores table. @ Parameter height is the number of (3-line) scores to be shown. 9Produce a couple of renderings of the high scores table. ;Generate a slideshow with the current and previous scores.  old table  the total score. not halved yet game time spent  reason of the game interruption  current date current score table 0position of the current high score in the table  reason of the game interruption  1NoneView on game state.  Remembered# fields carry a subset of the info B in the client copies of the state. Clients never directly change  their State8, but apply atomic actions sent by the server to do so. remembered dungeon dungeon 'depth' for items creation, etc. !remembered actors in the dungeon  remembered items in the dungeon remembered sides still in game global game time remembered content high score table $Initial complete global game state. Initial empty state. ?Local state created by removing secret information from global  state components. "Update dungeon data within state. Update dungeon depth. Update the actor dictionary. Update the item dictionary. "Update faction data within state. !Update global time within state. "Update content data within state. (Get current time from the dungeon data. HTell whether the faction is controlled (at least partially) by a human. ?Tell whether the faction uses AI to control any of its actors. +Tell whether the faction can spawn actors. CTell whether actors of the faction can be summoned by items, etc.. $ 2None JFinds an actor at a position on the current level. Perception irrelevant.  Calculate loot')s worth for heroes on the current level. IWarning: scores are shown during the game, so when the server calculates ; then, we should be careful not to leak secret information G (e.g., the nature of the items through the total worth of inventory). 0Price an item, taking count into consideration. BTries to finds an actor body satisfying a predicate on any level. ACompute the level identifier and starting position on the level,  after a level change. <Gets actor body from the current level. Error if not found.  Gets actor'<s items from the current level. Warning: this does not work 0 for viewing items of actors from remote level. 5Checks if the actor is present on the current level. C The order of argument here and in other functions is set to allow  b <- getsState (memActor a)       game state start from this level jump down this many levels 6target level and the position of its receiving stairs                3None *Perception indexed by faction identifier.  This can't be added to  FactionDict, because clients can' t see it. =Perception of a single faction, indexed by level identifier. >The type representing the perception of a faction on a level. : The total visibility holds the sum of FOVs of all actors ? of a given faction on the level and serves only as a speedup. ; The fields are not strict because often not all are used. visible points for each actor sum over all actors sum over actors that can smell #/The set of tiles visible by at least one hero. $/The set of tiles smelled by at least one hero. %%Whether an actor can see a position.  !"#$%&'() !"#$%&'() !"#$%&'()  !"#$%&'()4None *Field Of View scanning mode. +)only feeling out adjacent tiles by touch ,"digital FOV with the given radius -permissive FOV .restrictive shadow casting /#Calculate perception of the level. #Calculate perception of a faction. 0/Calculate the perception of the whole dungeon. GA position can be directly lit by an ambient shine or a weak, portable A light source, e.g,, carried by a hero. (Only lights of radius 0  are considered for now and it'!s assumed they do not reveal hero' s position. E TODO: change this to be radius 1 noctovision and introduce stronger : light sources that show more but make the hero visible.)  A position is visible if it'$s reachable and either directly lit @ or adjacent to one that is at once directly lit and reachable. ' The last condition approximates being 4 on the same side of obstacles as the light source. I The approximation is not exact for multiple heroes, but the discrepancy F can be attributed to deduction based on combined vague visual hints,  e.g., if I don'0t see the reachable light seen by another hero, = there must be a wall in-between. Stray rays indicate doors, ( moving shadows indicate monsters, etc. FReachable are all fields on an unblocked path from the hero position. 1@Perform a full scan for a given position. Returns the positions < that are currently in the field of view. The Field of View M algorithm to use, passed in the second argument, is set in the config file.  The actor'.s own position is considred reachable by him. *+,-./01%tile content, determines clear tiles scanning mode position of the spectator the map that is scanned *+,-./010/1*.-,+ *.-,+/015NoneC;Fully typed contents of the rules config file. This config  is a part of the game server. &23456789:;<=>?@ABCDEFGHIJKLMNO23456789:;<=>?@ABCDEFGHIJKLMNOCDEFGHIJKLMNOB<=>?@A6789:;2345 23456789:;<=>?@ABC DEFGHIJKLMNO6None )The content of the configuration file. It' s parsed < in a case sensitive way (unlike by default in ConfigFile). 8Read a player configuration file and use it to override 0 options from a default config. Currently we can't unset options, 7 only override. The default config, passed in argument  configDefault, I is expected to come from a default configuration file included via CPP. * The player configuration comes from file cfile. FPersonal data directory for the game. Depends on the OS and the game, $ e.g., for LambdaHack under Linux it's ~/ .LambdaHack/. P+Dumps the current configuration to a file. KSimplified setting of an option in a given section. Overwriting forbidden. ,Gets a random generator from the config or, ? if not present, generates one and updates the config with it. ;Switches all names to case sensitive (unlike by default in  the  ConfigFile( library) and wraps in the constructor. "In case of corruption, just fail. 5A simplified access to an option in a given section, I with simple error reporting (no internal errors are caught nor hidden). , If there is no such option, gives Nothing. 3Simplified access to an option in a given section. % Fails if the option is not present. JAn association list corresponding to a section. Fails if no such section. QFRead and parse rules config file and supplement it with random seeds. Pconfig name of the generator QPQQPPQ7NoneR1Freshly generated and not yet populated dungeon. Tmaps for all levels U+dungeon depth (can be different than size) .Create a level from a cave, from a cave kind. V%Generate the dungeon for a new game. RSTUVRSTUVRSTUVRSTUV8Nonei$Abstract syntax of atomic commands. EWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~AWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ai~}|{zyxwvutsrqponmlkj[hgfedcba`_^]\WZYX WZYX[ hgfedcba`_^]\i(~}|{zyxwvutsrqponmlkj9NoneGlobal, server state. full item discoveries data *reverse disco map, used for item creation 'reverse id map, used for item creation  association of flavour to items stores next actor index stores next item index "atomic commands performed to date perception of all factions current random generator current game mode  this game'!s config (including initial RNG) exit the game loop make backup savefile now current debugging mode !debugging mode for the next game "Initial, empty game server state. :None6Save game to the backup savefile, in case of crashes. ? This is only a backup, so no problem is the game is shut down " before saving finishes, so we don't wait on the mvar. However, ? if a previous save is already in progress, we skip this save. 7Save a simple serialized version of the current state. 3 Protected by a lock to avoid corrupting the file. CRestore a saved game, if it exists. Initialize directory structure & and cope over data files, if needed. ;None  <NoneACreates an actor. Note: after this command, usually a new leader M for the party should be elected (in case this actor is the only one alive). (Update a given level data within state. ?Kills an actor. Note: after this command, usually a new leader " for the party should be elected. JCreate a few copies of an item that is already registered for the dungeon  (in sitemRev field of  StateServer). 3Destroy some copies (possibly not all) of an item. @Alter an attribute (actually, the only, the defining attribute) - of a visible tile. This is similar to e.g.,  PathActorA. Age the level. ?Not aging the game here, since not all factions see the level, = so not all get this command (it would lead information that  there is somebody's leader on the level). #     #     =None 9The type representing visibility of actions to factions, + based on the position of the action, etc. %never broadcasted, but sent manually everybody notices only the server notices faction and server notices only the faction notices +whomever smells all the positions, notices !observers and the faction notice )whomever sees all the positions, notices BProduces the positions where the action takes place. If a faction F is returned, the action is visible only for that faction, if Nothing  is returned, it'1s never visible. Empty list of positions implies  the action is visible always. ?The goal of the mechanics: client should not get significantly F more information by looking at the atomic commands he is able to see 8 than by looking at the state changes they enact. E.g., DisplaceActorA H in a black room, with one actor carrying a 0-radius light would not be > distinguishable by looking at the state (or the screen) from  MoveActorA & of the illuminated actor, hence such DisplaceActorA should not be  observable, but  MoveActorA. should be (or the former should be perceived F as the latter). However, to simplify, we assing as strict visibility  requirements to  MoveActorA as to DisplaceActorA and fall back  to  SpotActorA3 (which provides minimal information that does not / contradict state) if the visibility is lower. ;Decompose an atomic action. The original action is visible  if it'9s positions are visible both before and after the action A (in between the FOV might have changed). The decomposed actions C are only tested vs the FOV after the action and they give reduced ' information that still modifies client'"s state to match the server state ' wrt the current FOV and the subset of  posCmdAtomic that is visible. E The original actions give more information not only due to spanning 6 potentially more positions than those visible. E.g.,  MoveActorA < informs about the continued existence of the actor between 9 moves, v.s., popping out of existence and then back in.  >NoneHConnection information for all factions, indexed by faction identifier. :Connection to the human-controlled client of a faction and/or ( to the AI client for the same faction. <Connection channels between the server and a single client. 4Abstract syntax of client commands that use the UI. +Abstract syntax of client commands that don't use the UI.  ?None   @None DUpdate the cached perception for the selected level, for a faction. D The assumption is the level, and only the level, has changed since & the previous perception calculation. 9Save a backup of the save game file, in case of crashes. See ^_. 6Dumps the current game rules configuration to a file. -Create a server config file. Warning: when it's used, the game state I may still be undefined, hence the content ops are given as an argument. ?Read the high scores table. Return the empty table if no file.  Warning: when it's used, the game state C may still be undefined, hence the config is given as an argument. ,Generate a new score, register it and save. 6Update connections to the new definition of factions. 4 Connect to clients in old or newly spawned threads / that read and write directly to the channels. ECompute and insert auxiliary optimized components into game content, 3 to be used in time-critical sections of the code. GInvoke pseudo-random computation with the generator kept in the state.  ! !ANone#Server state transformation monad. "current global state #current server state $%client-server connection information Run an action in the IO monad, with undefined state. %&'("#$)*+,%&'("#$)*+,BNone6Send an atomic action to all clients that can see it. -./-./CNone>The source actor affects the target actor, with a given item. B If the event is seen, the item may get identified. This function  is mutually recursive with effect and so it' s a part of Effect  semantics.  JThe source actor affects the target actor, with a given effect and power. A Both actors are on the current level and can be the same actor. C The boolean result indicates if the effect was spectacular enough F for the actors to identify it (and the item that caused it, if any).  ECreate a new hero on the current level, close to the given position.  @Spawn monsters of any spawn or summon faction, friendly or not. L To be used for spontaneous spawning of monsters and for the summon effect. 07Create a new monster on the level, at a given position % and with a given actor kind and HP. 1 The faction leaves the dungeon.  23456  789 : 0;<=>?@A1           23456  789 : 0;<=>?@A1DNone 3Actor moves or attacks or searches or opens doors.  Note that client can'.t determine which of these actions is chosen, ? because foes can be invisible, doors hidden, clients can move A simultaneously during the same turn, etc. Also, only the server E is authorized to check if a move is legal and it needs full context E for that, e.g., the initial actor position to check if melee attack * does not try to reach to a distant tile. DAdd a smell trace for the actor to the level. For now, all and only 0 actors from non-spawning factions leave smell. 5Resolves the result of an actor moving into another. G Actors on blocked positions can be attacked without any restrictions. @ For instance, an actor embedded in a wall can be attacked from G an adjacent position. This function is analogous to projectGroupItem, , but for melee and not using up the weapon. An actor opens a door. :Actor moves or swaps position with others or opens doors. DWhen an actor runs (not walks) into another, they switch positions. Update the wait/)block count. Uses local, per-level time, K to remain correct even if the level is frozen for some global time turns. 8Create a projectile actor containing the given missile. 4Perform the action specified for the tile in case it' s triggered. .actor projecting the item (is on current lvl) "target position of the projectile digital line parameter the item to be projected 0whether the items comes from floor or inventory .actor applying the item (is on current level) the item to be applied the location of the item  !"# !"# !"# !"#ENone$Apply debug options that don't need a new game. BBFind starting postions for all factions. Try to make them distant J from each other. If only one faction, also move it away from any stairs. $%&CDE'FB$%&'$'&% $%&CDE'FBFNone(<Start a clip (a part of a turn for which one or more frames 0 will be generated). Do whatever has to be done = every fixed number of time units, e.g., monster generation. D Run the leader and other actors moves. Eventually advance the time  and repeat. GAPerform moves for individual actors, as long as there are actors G with the next move time less than or equal to the current level time. ; Some very fast actors may move many times a clip and then A we introduce subclips and produce many frames per clip to avoid J jerky movement. But most often we push exactly one frame or frame delay. HDrop all actor' s items. I+Advance the move time for the given actor. JGenerate a monster, possibly. K<Possibly regenerate HP for all actors on the current level. ?We really want leader selection to be a purely UI distinction, 9 so all actors need to regenerate, not just the leaders.  Actors on frozen levels don'%t regenerate. This prevents cheating H via sending an actor to a safe level and letting him regenerate there. L&Continue or exit or restart the game. (MNGOHIJPKLQ(( (MNGOHIJPKLQGNoneR>The semantics of server commands. The resulting boolean value * indicates if the command took some time. )8Fire up the frontend with the engine fueled by content. 9 The action monad types to be used are determined by the exeSer  and  executorCli3 calls. If other functions are used in their place A the types are different and so the whole pattern of computation K is different. Which of the frontends is run depends on the flags supplied $ when compiling the engine library. RS)))RS)HNone*8Fully typed contents of the UI config file. This config  is a part of a game client. *+,-./01TU*+,-./01*+,-./01*+,-./01TUINone 2The type of na actor target. 3target a given position 4,target an actor with its last seen position 5$Current targeting mode of a client. 68the mode was entered (and will be exited) automatically 7/the player requested targeting mode explicitly 9-Client state, belonging to a single faction. 2 Some of the data, e.g, the history, carries over 2 from game to game, even across playing sessions.  Data invariant: if _sleader is Nothing then so is srunning. ;targeting mode <cursor coordinates =$a parameter of the tgt digital line >%targets of our actors in the dungeon ?"direction and distance of running @current messages Ahistory of messages B"atomic commands performed to date Cremembered item discoveries D%faction perception indexed by levels Ecurrent random generator F&client config (including initial RNG) Glast command key pressed Hselected actor I!faction controlled by the client Jexit the game loop K whether it's an AI client Lmark leader and party FOV M$mark smell, if the leader can smell Nmark suspect features Oshow client debug messages PInitial game client state. R.Update target parameters within client state. S)Get target parameters from client state. T0Update selected actor within state. Verify actor' s faction. *23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXVWX'23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX(9:;<=>?@ABCDEFGHIJKLMNOPQRSTU57688243VWX243576889:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXVWXJNoneYColor mode for the display. Zblack+white only [normal, with full colours \<Draw the whole screen: level map, status area and, at most, 3 a single page overlay of text divided into lines. YZ[\YYZ[\Y[Z\Y[Z\YKNoneZ)The content of the configuration file. It' s parsed < in a case sensitive way (unlike by default in ConfigFile). [8Read a player configuration file and use it to override 0 options from a default config. Currently we can't unset options, 7 only override. The default config, passed in argument  configDefault, I is expected to come from a default configuration file included via CPP. * The player configuration comes from file cfile. \FPersonal data directory for the game. Depends on the OS and the game, $ e.g., for LambdaHack under Linux it's ~/ .LambdaHack/. ];Switches all names to case sensitive (unlike by default in  the  ConfigFile( library) and wraps in the constructor. ^"In case of corruption, just fail. _3Simplified access to an option in a given section. % Fails if the option is not present. `JAn association list corresponding to a section. Fails if no such section. ]Read and parse UI config file. Zab[\]^_`c]d]] Zab[\]^_`c]dLNonee6Save game to the backup savefile, in case of crashes. ? This is only a backup, so no problem is the game is shut down " before saving finishes, so we don't wait on the mvar. However, ? if a previous save is already in progress, we skip this save. ^7Save a simple serialized version of the current state. 3 Protected by a lock to avoid corrupting the file. _DRestore a saved game, if it exists. Initialize directory structure,  if needed. fe^_^_^_fe^_MNone`<Bindings and other information about human player commands. bbinding keys to commands c macro map dmajor commands eminor commands ffrom cmds to their main keys g9Binding of keys to movement and other standard commands, 1 as well as commands defined in the config file. h5Produce a set of help screens from the key bindings. `abcdefg game config concrete binding gh `abcdefgh `abcdefgh`abcdefgghNNonei3The bottom of the action monads class semilattice. z3Connection method between a client and a frontend. |,read a keystroke received from the frontend }#write a UI request to the frontend ~BThe information that is constant across a client playing session, 7 including many consecutive games in a single session, L but is completely disregarded and reset when a new playing session starts. 2 Auxiliary AI and computer player clients have no sfs nor sbinding. connection with the frontend binding of keys to commands ijklmnopqrstuvwxyz{|}~hijijklmnopqrstuvwxyz{|}~~z{|}vwxypqrstunolmijk ijklmnopqrstuvwxyz{|}~hijONoneAClient parts of actions of human and computer player characters. 3The type of the function inside any client action. k:Invokes the action continuation on the provided argument. l3Distributes the session and shutdown continuation,  threads the state and history. ?Run an action, with a given session, state and history, in the IO monad. mnclient UI setup data #this client connection information  continuation failure/reset continuation current local state current client state klopqrstuvwmnklopqrstuvwPNoneDReset the state and resume from the last backup point, i.e., invoke  the failure continuation. 8Abort and print the given msg if the condition is true. 1Abort and conditionally print the fixed message. @Take a handler and a computation. If the computation fails, the 9 handler is invoked and then the computation is retried. 6Try the given computation and silently catch failure. :Set the current exception handler. Apart of executing it, M draw and pass along a slide with the abort message (even if message empty). KDisplay a slideshow, awaiting confirmation for each slide except the last.  Calculate the position of leader' s target. Get the key binding. %Add a message to the current report. 5Wipe out and set a new value for the current report. 6Store current report in the history and reset report. (Get the current perception of a client. 8Display an overlay and wait for a human player command. *Push frames or delays to the frame queue. xA yes-no confirmation. Display a msg with a more. prompt. Return value indicates if the player  tried to cancel/escape.  Print a yes/!no question and return the player's answer. Use black ! and white colours to turn player's attention to the choice. >Print a prompt and an overlay and wait for a player keypress. H If many overlays, scroll screenfuls with SPACE. Do not wrap screenfuls  (in some menus ?6 cycles views, so the user can restart from the top). IThe prompt is shown after the current message, but not added to history. ? This is useful, e.g., in targeting mode, not to spam history. HThe prompt is shown after the current message at the top of each slide. D Together they may take more than one line. The prompt is not added > to history. The portions of overlay that fit on the the rest H of the screen are displayed below. As many slides as needed are shown. 0Draw the current level with the overlay on top. ?Push the frame depicting the current level to the frame queue. A Only one screenful of the report is shown, the rest is ignored. GInvoke pseudo-random computation with the generator kept in the state. 6Render animations on top of the current screen frame. FThe part of speech describing the actor or a special name if a leader  of the observer'8s faction. The actor may not be present in the dungeon. @The part of speech describing the actor (designated by actor id ; and present in the dungeon) or a special name if a leader  of the observer' s faction. 'yz{x|:]ijklmnpqrstvwxyz{|}~:pqrstnlmijk~z{|}vwxy]'yz{x|QNone}}RNoneFProduces a textual description of the terrain and items at an already 0 explored position. Mute for unknown positions. 8 The detailed variant is for use in the targeting mode. ~;Perform look around in the current position of the cursor. B Assumes targeting mode and so assumes that a leader is selected. Create a list of item names. Create a list of item names. DSwitches current member to the next on the level, if any, wrapping. 2Select a faction leader. False, if nothing to do. HSwitches current member to the previous in the whole dungeon, wrapping. Display inventory GStart floor targeting mode or reset the cursor position to the leader. M Note that the origin of a command (the hero that performs it) is unaffected D by targeting. For example, not the targeted door, but one adjacent ( to the selected hero is closed by him. .Set, activate and display cursor information. =Start the enemy targeting mode. Cycle between enemy targets. :Change the displayed level in targeting mode to (at most) C k levels shallower. Enters targeting mode, if not already in one.  Tweak the eps* parameter of the targeting digital line. =Cancel something, e.g., targeting mode, resetting the cursor B to the position of the leader. Chosen target is not invalidated. Display the main menu. EAccept something, e.g., targeting mode, keeping cursor where it was. < Or perform the default action, if nothing needs accepting. ;End targeting mode, accepting the current position or not. 5Clear current messages, show the next screen if any. Display command help.  detailed? can be seen right now? position to describe the actor that looks an extra sentence to print ~ ~SNone<Clients keep a subset of atomic commands sent by the server D and add some of their own. The result of this function is the list - of commands kept for each command received. 7Effect of atomic actions on client state is calculated 5 in the global state before the command is executed. = Clients keep a subset of atomic commands sent by the server H and add their own. The result of this function is the list of commands ! kept for each command received. ;Visualization of atomic actions for the client is perfomed = in the global state after the command is executed and after . the client state is modified by the command. Sentences such as "Dog barks loudly.". TNone <Human running mode, determined from the nearby cave layout.  dead end 'a single corridor, turning here or not a hub of separate corridors )open space, in particular the T crossing ?Start running in the given direction and with the given number C of tiles already traversed (usually 0). The first turn of running > succeeds much more often than subsequent turns, because most D of the disturbances are ignored, since the player is aware of them & and still explicitly requests a run. FDetermine the running mode. For corridors, pick the running direction I trying to explore all corners, by prefering cardinal to diagonal moves. ICheck for disturbances to running such as newly visible items, monsters. FThis function implements the actual logic of running. It checks if we @ have to stop running because something interesting cropped up, ; it ajusts the direction given by the vector if we reached  a corridor'9s corner (we never change direction except in corridors) 3 and it increments the counter of traversed tiles. UNone9AI proposes possible targets for the actor. Never empty. AI strategy based on actor'0s sight, smell, intelligence, etc. Never empty.  A strategy to always just wait. Strategy for dumb missiles. ;AI finds interesting moves in the absense of visible foes. G This strategy can be null (e.g., if the actor is blocked by friends). VNone (Leader waits a turn (and blocks, etc.). Drop a single item. ;Let the human player choose any item from a list of items. ;Let the human player choose a single, preferably suitable,  item from a list of items. <Let a human player choose any item with a given group name. I Note that this does not guarantee the chosen item belongs to the group, ( as the player can override the choice. 5Ask for a direction and trigger a tile, if possible. 0Player tries to trigger a tile using a feature. = To help the player, only visible features can be triggered. @Verify important feature triggers, such as fleeing the dungeon. .Guess and report why the bump command failed. #Leader tries to trigger the tile he's standing on. prompt all items in question inventory characters (how to refer to the collection of items prompt message !which items to consider suitable how to describe suitable items all items in question inventory characters (how to refer to the collection of items all objects in question inventory characters name of the group accepted item symbols prompt *how to refer to the collection of objects WNone7The semantics of human player commands in terms of the Action monad. > Decides if the action takes time and what action to perform. A Time cosuming commands are marked as such in help and cannot be C invoked in targeting mode on a remote level (level different than " the level of the selected hero). :The basic action for a command and whether it takes time. =If in targeting mode, check if the current level is the same = as player level and refuse performing the action otherwise. XNoneHandle the move of the hero. )Continue running in the given direction. EDetermine and process the next human player command. The argument is 0 the last abort message due to running, if any. YNone;Wire together game content, the main loop of game clients, C the main game loop assigned to this frontend (possibly containing : the server loop, if the whole game runs in one process), 1 UI config and the definitions of game commands. lnppnl`abcdecdfcdghijklmnopqrstuvwxyyz{|}~                                 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOOPQRSTUVWXYZ[[\]^_`abcdefghijklmnopqrrstuvwxyz{|}~F          ! " # $ % & ' ( ) * +],]-].]/]0"1"2"3"4"5"6"7#8#9#:#;#<#=$8$9$:$;$<$=%>%?%8&@&A&A&B&C&D&E&F&G&H&I&J&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z&[&\&]'^'_'_'`'a'b'c'd'e'f'g'h'i'j'k'l'm'n'o'p'q'r's't'u(v(w(x(y(z({({(|(}(}(~((((((((((((((((((((((((((((((((()))))))))))**************************************++++++++++++++++,,,,,,,,,,,,---------........,.................... . . . . ...../////////////// /!/"/#0$0%0&0'1(1)1*1+1,1-1.1/101112131415161718191:1;1<1=1>1?2@2A2B2C2D2E2F2G2H2I2J2K2L2M2N2O2P2Q3R3S3T3T3U3V3W3X3Y3Y3Z3[3\3]3^3_3`3a4b4c4d4e4f4g4h4i5j5j5k5l5m5m5n5o5p5q5r5r5s5t5u5v5w5x5x5y5z5{5|5}5~555556677777888888888888888888888888888888888888888888888888888888888888888889999999999999999999999999999:::;;;;;;;;;;;;<<<================>>>>>> > > > > >>>>>>???????????@@ @!@@_@"@#@$@%@&@@'@(@)@*@+@,@-@.@/A0A1B2C3C4C5C6C7C8C9D:D;D<D=D>D?D@DADBDCDDDEDFDGDHDIDJDKDLDMDNEOEPEQERFSGTHUHUHVHWHXHYHZH[I\I]I^I_I`IaIbIcIcIdIeIfIgIhIiIjIIIkIIlImInIoIIpIqIrIsIItIuIvIwIxIyIzI{I|J}J~JJKLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNOOOPPPPPPPPPPPPPPPPPP!PPPPPPPPPPPPP/PPPQQRRRRRRRRRRRRRRRRRRRRRRRRRRSSSSTTUUUVVVVVVVVVVVVVVWXXXXXYYYrs   Z Z ZZZZZZZZZZZ           ! " # $ %  & ' ( ) *`+,-./012345 6789:;<=>?@AB`aCDhEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd e`fg]h]i]j]k]l]m]n]o]p]q]r]s]t]u]v]w]x]y]z]{]{]|]}],]~]]]]]]]"""""%%&@&T&&&&&&&&''^'g'h'''(((((((****,,,,,--.....//////////0000000000$000111111111(11122234444444455555555666666666666667777888899:;;<<<<<<<<<<<<<<< < < < < <<<<<<<<<<<<<===>@@ @!@"@#@$@%A&A'A(A0A)A*A*A+A,A-A.B/B0B1C2C3C4C5C6C7C8C9C:C;C<C=C>C?C@CACBCCEDEEEFEGEHFIFJFKFLFMFNFOFPFQFRFSGTGUHVHWIXIYIZJ[KKKKKKKKKK\KL]L^M_N`NaNbOcOdOOeOfOgOhOiOjOkOlOmOnPoPpPPqPrQsRtRuRvRwRxRySzS{S|S}S~SSSSSSSSSSTTTTTTTTUUUUUUUUUUUUVVVVVVVVVVVVVVWWWWWWWY/YLambdaHack-0.2.8Game.LambdaHack.Utils.AssertGame.LambdaHack.Common.MsgGame.LambdaHack.Utils.LQueueGame.LambdaHack.Common.Misc!Game.LambdaHack.Common.ContentDef#Game.LambdaHack.Content.FactionKind!Game.LambdaHack.Content.PlaceKindGame.LambdaHack.Common.Ability$Game.LambdaHack.Content.StrategyKindGame.LambdaHack.Common.TimeGame.LambdaHack.Common.ColorGame.LambdaHack.Common.FlavourGame.LambdaHack.Utils.FileGame.LambdaHack.Common.PointXYGame.LambdaHack.Utils.FrequencyGame.LambdaHack.Common.RandomGame.LambdaHack.Common.EffectGame.LambdaHack.Common.Feature Game.LambdaHack.Content.ItemKind!Game.LambdaHack.Content.ActorKindGame.LambdaHack.Client.StrategyGame.LambdaHack.Common.VectorXYGame.LambdaHack.Client.HumanCmdGame.LambdaHack.Common.AreaGame.LambdaHack.Common.Point Game.LambdaHack.Common.AnimationGame.LambdaHack.Common.VectorGame.LambdaHack.Common.Key Game.LambdaHack.Content.CaveKind!Game.LambdaHack.Server.Fov.Common Game.LambdaHack.Content.TileKind Game.LambdaHack.Content.RuleKindGame.LambdaHack.Frontend.Chosen)Game.LambdaHack.Server.DungeonGen.AreaRnd"Game.LambdaHack.Server.Fov.Digital%Game.LambdaHack.Server.Fov.Permissive!Game.LambdaHack.Server.Fov.ShadowGame.LambdaHack.Common.KindGame.LambdaHack.Common.ItemGame.LambdaHack.Common.ActorGame.LambdaHack.Common.TileGame.LambdaHack.Common.Level Game.LambdaHack.Common.ServerCmd'Game.LambdaHack.Server.DungeonGen.Place&Game.LambdaHack.Server.DungeonGen.CaveGame.LambdaHack.Common.FactionGame.LambdaHack.Frontend Game.LambdaHack.Common.HighScoreGame.LambdaHack.Common.State!Game.LambdaHack.Common.ActorState!Game.LambdaHack.Common.PerceptionGame.LambdaHack.Server.FovGame.LambdaHack.Server.Config&Game.LambdaHack.Server.Action.ConfigIO!Game.LambdaHack.Server.DungeonGen Game.LambdaHack.Common.AtomicCmdGame.LambdaHack.Server.State"Game.LambdaHack.Server.Action.SaveGame.LambdaHack.Common.Action Game.LambdaHack.Common.AtomicSem Game.LambdaHack.Common.AtomicPos Game.LambdaHack.Common.ClientCmd)Game.LambdaHack.Server.Action.ActionClassGame.LambdaHack.Server.Action(Game.LambdaHack.Server.Action.ActionType#Game.LambdaHack.Server.AtomicSemSer Game.LambdaHack.Server.EffectSem Game.LambdaHack.Server.ServerSem"Game.LambdaHack.Server.StartAction!Game.LambdaHack.Server.LoopActionGame.LambdaHack.ServerGame.LambdaHack.Client.ConfigGame.LambdaHack.Client.StateGame.LambdaHack.Client.Draw&Game.LambdaHack.Client.Action.ConfigIO"Game.LambdaHack.Client.Action.SaveGame.LambdaHack.Client.Binding)Game.LambdaHack.Client.Action.ActionClass(Game.LambdaHack.Client.Action.ActionTypeGame.LambdaHack.Client.Action!Game.LambdaHack.Client.LoopAction!Game.LambdaHack.Client.HumanLocal#Game.LambdaHack.Client.AtomicSemCli Game.LambdaHack.Client.RunAction%Game.LambdaHack.Client.StrategyAction"Game.LambdaHack.Client.HumanGlobalGame.LambdaHack.Client.HumanSem Game.LambdaHack.Client.ClientSemGame.LambdaHack.ClientPaths_LambdaHackListallGame.LambdaHack.Frontend.GtkSave saveGameBkpbaseGHC.Baseassertminimorph-0.1.4.0NLP.Minimorph.UtilshowT<+><>LQueue newLQueue nullLQueue lengthLQueue tryReadLQueue writeLQueue trimLQueuedropStartLQueue lastLQueue toListLQueueLevelId FactionIdFreqsnormalLevelBound maxLevelDimdivUpbreturn ContentDef getSymbolgetNamegetFreqvalidatecontent FactionKindfsymbolfnameffreq fAiLeader fAiMember fvalidateFenceFNoneFFloorFWallCoverCReflectCStretch CAlternate PlaceKindpsymbolpnamepfreqpcoverpfenceptopLeft pvalidateAbilityWanderChaseToolsRangedPickupMeleeFleeHealTrack StrategyKindssymbolsnamesfreq sabilities svalidateSpeedTimetimeZero timeEpsilontimeCliptimeTurntimeAddtimeFit timeNegate timeScale timeToDigittoSpeed speedZero speedNormal speedScalespeedAdd speedNegate ticksPerMetertraveledspeedFromWeightrangeFromSpeedAttrCharacAttracCharAttrfgbgColorBrWhiteBrCyan BrMagentaBrBlueBrYellowBrGreenBrRedBrBlackWhiteCyanMagentaBlueBrownGreenRedBlackdefBGdefFGdefAttrisBrightlegalBGdarkCol brightColstdCol colorToRGBFlavourzipPlainzipFancystdFlavflavourToColor flavourToNamecolorToPlainNamecolorToFancyNamecolorToTeamName encodeEOFstrictDecodeEOF tryCreateDirtryCopyDataFilesblamefailureallBskipPointXYYXfromTo sortPointXYblaXY Slideshow runSlideshowOverlayHistoryReportMsg makePhrase makeSentencemoreMsgyesnoMsg truncateMsg emptyReport nullReportsingletonReportaddMsg splitReport renderReport findInReport emptyHistorysingletonHistory mergeHistory renderHistory addReport takeHistorystringByLocation splitOverlay toSlideshow Frequency nameFrequency runFrequency uniformFreqtoFreq scaleFreq renameFreqrollFreqnullFreqChanceRollDeep RollDiceXYRollDiceRndrandomRrandomoneOf frequencyrollrollDicemaxDiceminDicemeanDice rollDiceXYrollDeep chanceDeep intToDeepmaxDeepchancerndToIOEffectEscapeDescendAscend Searching Regeneration ApplyPerfume CreateItemSummon CallFriendDominate MindprobeHurtNoEffect effectTraveffectToSuffixeffectToBenefitFeatureHiddenAsPathExitCanActorCanItem ImpenetrableAuraSuspectLitClearWalkableChangeToCauseClosableOpenable Escapable Descendable AscendableItemKindisymbolinameifreqiflavourieffecticount iverbApply iverbProjectiweightitoThrow ivalidate ActorKindasymbolanameafreqacoloraspeedahpasightasmellaiqaregenacanDo avalidateStrategy nullStrategy liftFrequency.|reject.=>only bestVariantrenameStrategyreturNVectorXYshiftXYmovesXYmovesCardinalXY chessDistXYeuclidDistSqXYnegXYTrigger BumpFeaturefeature ApplyItemverbobjectsymbolHumanCmdHelp MarkSuspect MarkSmell MarkVisionAcceptCancelEpsIncr TgtAscendTgtEnemyTgtFloor Inventory MemberBack MemberCycle SelectHeroCfgDumpGameSaveGameExit GameRestart TriggerTile TriggerDirApplyProjectDropWaitRunMove majorHumanCmd minorHumanCmdnoRemoteHumanCmdcmdDescriptionArea vicinityXYvicinityCardinalXYinsideXY normalizeAreagrid validArea trivialAreaexpandPoint showPointtoPointorigin chessDistadjacentvicinityvicinityCardinalinsidedisplacementXYZblaAcFrameAcDelayAcNormal AcRunning AcConfirmFrames Animation SingleFramesfLevelsfTopsfBottomemptySingleFramexsizeSingleFrameysizeSingleFrame renderAnim restrictAnim twirlSplashblockHit blockMiss deathBody swapPlacesfadeoutVectortoVectorisUnittoDirshift shiftBoundedmoves euclidDistSqdiagonalnegtowards displacement displacePath shiftPathKMmodifierkeyModifierControl NoModifierKeyUnknownCharKPHomeBeginEndDownUpRightLeftPgDnPgUpBackTabTabSpaceReturnEscshowKM dirAllMoveKey handleDir moveBinding keyTranslateCaveKindcsymbolcnamecfreqcxsizecysizecgrid cminPlaceSize cdarkChance cauxConnects cvoidChance cnonVoidMin cminStairDist cdoorChance copenChancechiddencitemNumcdefTile ccorridorTile cfillerTilecdarkLegendTileclitLegendTile cvalidate EdgeIntervalEdge ConvexHullLineBumpBProgressDistancemaximalsteeperaddHullTileKindtsymboltnametfreqtcolortcolor2tfeature tvalidateRuleKindrsymbolrnamerfreq raccessiblertitlerpathsDataFile rpathsVersion ritemMelee ritemProjectrcfgRulesDefault rcfgUIDefault rmainMenuArt ruvalidateFrontendSession frontendNamestartupdisplaypromptGetAnyKeyCorridorxyInAreamkRoom mkVoidRoom connectGridrandomConnection connectPlacesscandlinedsteeper intersect debugSteeper debugLineIntervalSBumpArrayCOpscoactorcocavecofactcoitemcoplacecorulecostratcotileOpsosymbolonameokind ouniqGroupopick ofoldrWithKeyoboundsospeedupSpeedupId sentinelId createOps stdRuleset!// listArrayarraybounds foldlArray FlavourMapItemjkindIxjsymboljnamejflavourjeffectDiscoRev Discovery ItemKindIxItemIdjkind serverDiscos buildItemnewItemviewItememptyFlavourMapdungeonFlavourMapstrongestSearchstrongestSwordstrongestRegenpartItem partItemWs partItemAWItemRev ActorDictItemDictItemInvItemBagInvCharinvCharActorbkindbsymbol_bnamebcolorbspeedbhpbpathbposboldposblidbbagbinvbletterbtimebwaitbfidbprojActorIdmonsterGenChance partActor actorTemplate actorSpeedtimeAddFromSpeedbraced unoccupied heroKindIdprojectileKindId smellTimeout allLetters assignLetter letterRange letterLabel rmFromBagmapActorItems_ SmellTimekindHasFeaturekindHas hasFeatureisClearisLit isExplorablesimilarspeedupchangeTohiddenAsLevelldepthlpriolfloorltilelxsizelysizelsmellldesclstairlseenlclearltimelitemNumlsecretlhiddenSmellMapTileMap ItemFloor ContainerCActorCFloorDungeonascendInBranch updatePrio updateSmell updateFloor updateTileatatI accessible accessibleDirhideTilefindPos findPosTrymapLevelActors_mapDungeonActors_CmdSer CfgDumpSer GameSaveSer GameExitSerGameRestartSer SetPathSer TriggerSerApplySer ProjectSerDropSer PickupSerWaitSerRunSer ExploreSerMoveSer aidCmdSer TileMapXYPlaceqkindqareaqseenqlegend qsolidFence qhollowFence placeValid buildPlace buildFenceCavedkinddmapditemdplaces ItemFloorXY buildCaveStatus stOutcomestDepthstInfoOutcomeRestartConquerCampingDefeatedKilled DiplomacyWarAllianceNeutralFactiongkindgnamegconfig gAiLeader gAiMembergdiplgquitgleadergcolorginitialgentry FactionDict isHumanFact usesAIFact isSpawnFact isSummonFactisAtWarisAllied ConnMulti fromMultitoMultiFrontReq FrontSlides frontClear frontSlidesFrontKeyfrontKMfrontFr FrontFramefrontAc ChanFrontendstartupF connMultigetConfirmGeneric loopFrontend ScoreTableemptyregister slideshowStatedefStateGlobal emptyStatelocalFromGlobal updateDungeon updateDepth updateActorD updateItemD updateFaction updateTime updateCOps getLocalTimeisHumanFaction usesAIFactionisSpawnFactionisSummonFactionsdungeonsdepthsactorDsitemD sfactionDstimescopsshigh actorAssocs actorListactorNotProjAssocsactorNotProjList posToActornearbyFreePointscalculateTotal foesAdjacent tryFindHeroKwhereTo getActorBodyupdateActorBody getActorBagactorContainer getActorInv getActorItem getItemBodymemActorPers FactionPers PerceptionperActorptotalpsmellPerActorPerceptionVisiblepvisible totalVisible smellVisible actorSeesLocnullPeraddPerdiffPersmellFromActorsFovModeBlindDigital PermissiveShadowlevelPerceptiondungeonPerceptionfullscanScenarioscenarioPlayersscenarioDungeonPlayer playerName playerKind playerInitial playerEntryPlayers playersHumanplayersComputer playersEnemy playersAllyCavesConfigconfigSelfString configCavesconfigFirstDeathEnds configFovModeconfigSaveBkpClipsconfigAppDataDirconfigScoresFileconfigRulesCfgFileconfigHeroNames configPlayersconfigScenariodump mkConfigRules FreshDungeon freshDungeon freshDepth dungeonGen HitAtomic MissBlockD HitBlockDHitD SfxAtomic DisplayDelayD DisplayPushDMsgAllDMsgFidDEffectDShunDTriggerDCheckD ActivateDCatchDProjectDRecoilDStrikeD CmdAtomicMsgAllASaveBkpA SaveExitA KillExitA ResumeServerAResumeARestartServerARestartA PerceptionACoverA DiscoverAAgeGameA AgeLevelA LoseSmellA SpotSmellA AlterSmellA LoseTileA SpotTileA SearchTileA AlterTileA DiplFactionA LeadFactionA QuitFactionA ColorActorA PathActorA HasteActorA HealActorA AgeActorA MoveItemADisplaceActorA WaitActorA MoveActorA LoseItemA SpotItemA LoseActorA SpotActorA DestroyItemA CreateItemA DestroyActorA CreateActorAAtomic undoCmdAtomic undoSfxAtomic undoAtomic DebugModeSersknowMap sknowEventssniffInsniffOut sallClearstryFov sdebugCli StateServersdisco sdiscoRevsitemRevsflavour sacounter sicountersundospersrandomscenariosconfigsquitsbkpSave sdebugSer sdebugNxtemptyStateServerdefDebugModeSersaveGameBkpSer saveGameSerrestoreGameSer MonadAtomic execAtomic execCmdAtomic execSfxAtomic MonadAction modifyStateputState MonadActionROgetState getsState getsLevelnHumans cmdAtomicSemposOfAidposOfContainer PosAtomicPosNonePosAllPosSer PosFidAndSerPosFidPosSmellPosFidAndSightPosSight posCmdAtomic posSfxAtomicresetsFovAtomicbreakCmdAtomic loudCmdAtomic seenAtomicCli seenAtomicSerConnServerDictConnServerFaction ChanServer fromServertoServer CmdClientUI CmdQueryUI SfxAtomicUI CmdAtomicUI CmdClientAI CmdQueryAI CmdAtomicAIdebugCmdClientAIdebugCmdClientUIdebugAidMonadConnServergetDictgetsDict modifyDictputDict MonadServer getServer getsServer modifyServer putServerliftIOfovModeresetFidPerception getPerFiddumpCfg sendUpdateAI sendQueryAI sendUpdateUI sendQueryUI restoreScore revealItems deduceQuits tryRestore updateConnkillAllClientswaitForChildren speedupCOps rndToAction ActionSer executorSer atomicSendSem itemEffect effectSem electLeader deduceKilledaddHero spawnMonsters createItems execFailurebroadcastCmdAtomicbroadcastSfxAtomicmoveSeraddSmellactorAttackActor actorOpenDoorrunSer displaceActorwaitSer pickupSerdropSer projectSer addProjectileapplySer triggerSer setPathSergameRestartSer gameExitSer gameSaveSer cfgDumpSer applyDebuginitPer reinitGame gameResetloopSermainSerConfigUIconfigCommandsconfigAppDataDirUIconfigUICfgFile configMacros configFontconfigHistoryMaxTargetTPosTEnemyTgtModeTgtAuto TgtExplicit tgtLevelId StateClientstgtModescursorsepsstargetDsrunningsreportshistorysfper sconfigUIslastKey_sleader_ssidesisAI smarkVision smarkSmell smarkSuspectdefStateClient defHistory updateTarget getTarget updateLeaderssidetoggleMarkVisiontoggleMarkSmelltoggleMarkSuspect ColorModeColorBW ColorFulldraw mkConfigUI saveGameClirestoreGameCliBindingkcmdkmacrokmajorkminorkrevMap stdBindingkeyHelpMonadClientAborttryWith abortWithMonadConnClientgetConn MonadClientUI getsSession MonadClient getClient getsClient modifyClient putClient ConnServerreadConnServerwriteConnServer ConnFrontendreadConnFrontendwriteConnFrontend SessionUIsfconnsbinding ActionCli FunActionCli executorCli debugPrint connFrontend connServerabort abortIfWith neverMindtryRepeatedlyWith tryIgnore tryWithSlidegetInitConfirms getLeaderUI getArenaUI targetToPos askBindingmsgAddmsgReset recordHistorygetKeyOverlayCommand displayFrames displayMore displayYesNodisplayChoiceUIpromptToSlideshowoverlayToSlideshow drawOverlay displayPushscoreToSlideshowclientGameSave restoreGameanimatepartActorLeader partAidLeaderloopAIloopUI moveCursor viewedLevellookAtfloorItemOverlay itemOverlayretargetLeaderselectHeroHumanmemberCycleHuman selectLeader stopRunningmemberBackHumaninventoryHumantgtFloorLeadertgtEnemyLeadertgtAscendHuman epsIncrHuman cancelHumandisplayMainMenu acceptHuman endTargeting clearHuman historyHumanhumanMarkVisionhumanMarkSmellhumanMarkSuspect helpHumancmdAtomicFilterClicmdAtomicSemClidrawCmdAtomicUIdrawSfxAtomicUIcanRuncontinueRunDirtargetStrategy visibleFoesactionStrategy moveLeader exploreLeader runLeader waitHuman pickupHuman dropHuman projectLeader applyHumantriggerDirHumantriggerTileHumangameRestartHuman gameExitHuman gameSaveHuman cfgDumpHuman cmdHumanSemqueryAI queryAIPickqueryUI continueRun humanCommandcmdClientAISemcmdClientUISem exeFrontend$fBinaryLevelId$fBinaryFactionId$fAdjustableEnumMap$fLookupEnumMap$fIndexableEnumMap$fTraversableWithKeyEnumMap$fFoldableWithKeyEnumMap$fKeyedEnumMap$fZipWithKeyEnumMap $fZipEnumMap$fBinaryEnumSet$fBinaryEnumMapcatchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName _timeTick turnsInSecond_ticksInSecondsInMs $fBinarySpeed $fBinaryTime _olorToRGB$fBinaryAttrChar $fBinaryAttr $fBinaryColor$fHashableColor fancyName baseColor$fBinaryFlavour$fHashableFlavour encodeDatastrictReadSerializedstrictDecodeDataGHC.Errerror balancedWordfromTo1 $fEnumPointXY $fShowPointXY splitTextrenderRepetition splitText'$fBinaryHistory$fBinaryReport$fFunctorFrequency$fMonadPlusFrequency$fMonadFrequency$fBinaryRollDice$fHashableRollDice$fReadRollDice$fShowRollDice effectToSuff affixPower affixBonus$fBinaryEffect$fHashableEffect$fBinaryFeaturereturn$fMonadStrategy runStrategynormalizeStrategy$fMonadPlusStrategytriggerDescription$fBinaryTrigger$fBinaryHumanCmd fromPoint $fShowPoint $fBinaryPointblank coloredSymbol mzipPairs$fBinaryAcFrame$fBinarySingleFramefromDir normalizeisUnitXY $fShowVector$fBinaryVectorshowKey dirViChar dirViMoveKey dirMoveKey dirViRunKey dirRunKey _dirAllRunKeydirNums dirHeroKey $fBinaryKM$fShowKM$fBinaryModifier $fBinaryKey$fShowRuleKindGHC.ShowShowsviewstagsschanKey sframeState slastFullfpushedfshownonQueuerunGtkoutputmaxFpsmaxPollsaddTimediffTime pollFrames pushFrametrimFrameStatedeadKeymodifierTranslateGtkFramegfChargfAttr FrameStateFPushed dummyFrame lengthQueuesetTo evalFramedoAttrHV mkCorridorVertHoriz connectGrid'downBiasupBias $fShowArray $fBinaryArray$fEqCOps $fShowCOps $fBinaryId TileSpeedup isClearTabisLitTabrollFlavourMap strongestItem $fBinaryItem$fHashableItem cmpLetter $fBinaryActor$fBinaryHashMap$fBinaryInvChar $fOrdInvChar$fBinaryActorId ActorPrioassertSparseItems $fBinaryLevel$fBinaryContainer expandFenceolegenddigPlace tilePlace $fBinaryPlace digCorridors mergeCorridorDipl$fBinaryStatus$fBinaryOutcome$fBinaryDiplomacy$fBinaryFaction promptGetKeyReqMapToMulti FromMulti flushFrames displayAcgetSingleFrame toSinglesfadeFinsertFr ScoreRecordpointsnegTimedatestatus showScore insertPos showTableshowCloseScores$fBinaryScoreRecord$fShowScoreTable _sdungeon_sdepth_sactorD_sitemD _sfactionD_stime_scops_shigh unknownLevelunknownTileMap $fBinaryState itemPrice tryFindActor posToActors$fBinaryPerceptionfactionPerceptioncomputeVisiblecomputeReachablePerceptionReachable preachable isVisible$fBinaryFovMode$fBinaryConfig$fNFDataConfig$fBinaryScenario$fNFDataScenario$fBinaryPlayers$fNFDataPlayers$fBinaryPlayer$fNFDataPlayerCPmkConfig appDataDirset getSetGentoCP forceEither getOptiongetgetItems overrideCPparseConfigRules$fShowCP buildLevelconvertTileMaps placeStairs findGenerator$fBinaryHitAtomic$fBinarySfxAtomic$fBinaryCmdAtomic$fBinaryAtomic$fBinaryDebugModeSer$fBinaryStateServersaveLock $fShowWriterT$fMonadActionROWriterT createActorA updateLevel destroyActorA createItemA destroyItemA alterTileA ageLevelAinsertItemFloorinsertItemActordeleteItemFloordeleteItemActor moveActorA waitActorAdisplaceActorA moveItemA ageActorA healActorA hasteActorA pathActorA colorActorA quitFactionA leadFactionA diplFactionA spotTileA loseTileA alterSmellA spotSmellA loseSmellAageGameArestartArestartServerA resumeServerA singleAidsingleContainerfidOfAid$fShowChanServer registerScore writeTQueueAI writeTQueueUI readTQueuequitFchildren forkChildserState serServerserDict runActionSerSerState$fMonadConnServerActionSer$fMonadServerActionSer$fMonadActionActionSer$fMonadActionROActionSer storeUndoatomicServerSematomicRemember addMonster effectEscapeeffectNoEffect effectHeal effectWoundeffectMindprobeeffectDominateeffectCallFriend summonFriendsaddActor effectSummoneffectCreateItemeffectApplyPerfumeeffectSearching effectAscend effLvlGoUp switchLevels effectDescend findEntryPossmapFromInvFuns lowercasecreateFactionspopulateDungeon handleActors dropAllItems advanceTimegenerateMonsterregenerateLevelHP endOrLoop saveBkpAllendClipdieSer rollSpawnPos restartGame cmdSerSem debugArgs$fBinaryConfigUI$fNFDataConfigUI$fBinaryTarget$fBinaryTgtMode$fBinaryStateClientdrawLeaderStatus parseConfigUIsaveGameBkpCli _saveLockcoImage$fMonadClientAbortWriterT$fMonadClientUIWriterT$fMonadClientWriterTreturnActionCli bindActionCli runActionCli$fMonadConnClientcActionCli$fMonadClientUIActionCli$fMonadClientActionCli$fMonadActionActionCli$fMonadActionROActionCli$fMonadClientAbortActionCli$fShowActionCli$fFunctorActionCli$fMonadActionCligetYesNo displayFrame getConfirmsaveNameinitClidoLook setCursor cursorLevelpartyAfterLeadersetTgtIdendTargetingMsg actorVerbMU perceptionA discoverAcoverA killExitA saveExitA lookAtMoveaVerbMU itemVerbMU_iVerbMUaiVerbMU moveItemUIdisplaceActorUI quitFactionUIstrikeDRunMode RunDeadEnd RunCorridorRunHubRunOpenrunModerunDisturbancerunDir waitBlockNowtrack moveStrategy reacquireTgt proposeActionpickupmelee rangedFreq toolsFreq bumpableHerechasewander getAnyItemgetItem getGroupItembumpTile verifyTrigger guessBumpItemDialogStateIAll ISuitableINoneallObjectsNameactorProjectGItriggerSymbolstriggerFeatures cmdAction checkCursor moveHumanrunHuman projectHuman tgtFloorHuman tgtEnemyHuman wireSession