G&      !"#$%&'()*+,-./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*{*|*}*~******************+++++++++++++++++++++++++++++++++++,,,,,,,,,,,,---------.....///////////////////////////////00001111111111111111111111222 2 2 2 2 2222222222233333333 3!3"3#3$3%3&3'3(3)3*4+4,4-4.4/404142535455565758595:5;5<5=6>6?7@7A7B7C7D7E7F7G7H7I7J7K7L7M7N7O7P7Q7R7S7T7U7V7W7X7Y7Z7[7\7]7^7_7`7a7b8c8d8e8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}8~888888888888888888888888888888888888899999::::::::;;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<=============>>>????????????????@@@@@@@ @ @ @ @ @@@@@@@AAAAAAAAAAAA A!B"B#B$B%B&B'B(B)B*B+B,B-B.B/B0B1B2B3B4B5B6B7C8C9D:E;E<E=E>E?E@EAFBFCFDFEFFFGFHFIFJFKFLFMFNFOFPFQFRFSFTFUFVFWFXGYGZG[G\H]I^J_J`JaJbJcJdJeJfJgJhJiKjKkKlKmKnKoKpKqKrKsKtKuKvKwKxKyKzK{K|K}K~KKKKKKKKKKKKKKKKKKLLLLMNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOPPPQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQRRSSSSSSSSSSSSSSSSSSSSSSSSSSTTTTUVVVWWWWWWWWWW W W W W XYYYYYZZZ\ Safe-Infered $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.      Safe-Infered    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.     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*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 +frequency within groups ,,how to fill whole place based on the corner --whether to fence the place with solid border .)plan of the top-left corner of the place /IFilter a list of kinds, passing through only the incorrect ones, if any. BVerify that the top-left corner map is rectangular and not empty.  !"#$%&'()*+,-./ !"#$%&'()*+,-./'()*+,-.#&%$"! /"! #&%$'()*+,-./[ Safe-Infered ()*+,-./012)./012 ()*+,-./012 Safe-Infered 0IAll 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. 11wander around, meleeing any opponents on the way 21chase the target, ignoring any actors on the way 38use items, if target opponent visible, some of the time 4>attack the visible target opponent at range, some of the time 5trigger a feature 6!gather items, if no foes visible 7 melee target 8flee if almost dead 9heal if almost dead :6move along a set path, if any, meleeing any opponents 0123456789:3 0123456789: 0:9876543210 :9876543213 None;@Faction properties that are fixed for a given kind of factions. = a symbol >short description ?frequency within groups @ abilities of the selected actor Aabilities of the other actors BDNo specific possible problems for the content of this kind, so far, N so the validation function always returns the empty list of offending kinds. ;<=>?@AB;<=>?@AB;<=>?@AB;<=>?@AB NoneC(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). D(Game time in ticks. The time dimension. 8 One tick is 1 microsecond (one millionth of a second),  one turn is 0.5 s. E6Start of the game time, or zero lenght time interval. 4AThe 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. FAn infinitesimal time period. G: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. H0One 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). 5(This many turns fit in a single second. 68This many ticks fits in a single second. Do not export, ITime addition. J?How many time intervals of the latter kind fits in an interval  of the former kind. K<Negate a time interval. Can be used to subtract from a time % or to reverse the ordering on time. LScale time by an Int scalar value. M<Represent the main 10 thresholds of a time range by digits, + given the total length of the time range. 7$Number of seconds in a kilo-second. N%Constructor for content definitions. O$No movement possible at that speed. PNormal speed (2 m//s) that suffices to move one tile in one turn. QScale speed by an Int scalar value. RSpeed addition. SSpeed negation. TFThe number of time ticks it takes to walk 1 meter at the given speed. U>Distance in meters (so also in tiles, given the chess metric) 8 traveled in a given time by a body with a given speed. V5Calculate projectile speed from item weight in grams  and speed bonus in percents.  See  ;https://github.com/kosmikus/LambdaHack/wiki/Item-statistics. WBCalculate 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. C8D9E4FGH56IJKLM7NOPQRSTUVW:;CDEFGHIJKLMNOPQRSTUVWDEGHIJKLFMCNOPQRSTUVWC8D9E4FGH56IJKLM7NOPQRSTUVW:; None\2Text attributes: foreground and backgroud colors. ^foreground colour _backgroud color `*Colours supported by the major frontends. q4The default colours, to optimize attribute setting. r4The default colours, to optimize attribute setting. s6The default attribute, to optimize attribute setting. tBA helper for the terminal frontends that display bright via bold. uIDue to the limitation of the curses library used in the curses frontend, # only these are legal backgrounds. v Colour sets. w Colour sets. x Colour sets. yATranslationg 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). 'XYZ[\]^_`abcdefghijklmnopqrstuvwxy<=>?@"XYZ[\]^_`abcdefghijklmnopqrstuvwxy"`ponmlkjihgfedcbaqrtuvwxy\]^_sXYZ[XYZ[\]^_`ponmlkjihgfedcbaqrstuvwxy<=>?@ None zThe type of item flavours. A0should the colour description be fancy or plain Bthe 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). zCAB{|}~DE z{|}~ z{|}~ zCAB{|}~DENone#Properties of a particular player. name of the player *name of faction(s) the player can control &level where the initial members start number of initial members  is the leader under AI control? !are the others under AI control? is the player considered human * and so, e.g., eligible for a high score? "does the faction have a UI client & (for control or passive observation) 0The specification of players for the game mode. !players, both human and computer the initial enmity matrix the initial aliance matrix <Requested cave groups for particular levels. The default is  the dng3 group, which means a random choice from all caves < that can randomly appear. The second component of the pair  is the Escape feature on the level. True means it's represented  by  @, @False@, by @. Game mode specification. (a symbol (matches the keypress, if any) short description frequency within groups  players taking part in the game arena of the game 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. F FNoneBIf the condition fails, display the value blamed for the failure.  Used as in $ assert (c /= 0 `blame` c) $ 10 / c Like G), 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 =In case of corruption, just fail and show the error message. 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. HSee  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. IHJK IHJK 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. LCSplit 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. $MNOPLQRS MNOPLQRSNoneTBRepeatedly save a simple serialized version of the current state. CRestore a saved game, if it exists. Initialize directory structure & and cope over data files, if needed. TTNone !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. UVWX UVWXNoneFractional 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. Cast a single die. Cast dice and sum the results. Maximal value of dice. Minimal value of dice. Mean value of dice. Cast the two sets of dice. +Cast dice scaled with current level depth. C Note that at the first level, the scaled dice are always ignored. 5Cast 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. YZ[\]YZ[\]None/Transform an effect using a stateful function. ^KSuffix to append to a basic content name if the content causes the effect. ^_`ab ^_`abNone?All possible terrain tile features, some of them parameterized H or dependent on outside coefficients, e.g., on the tile secrecy value. ,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 2if secret, can be revealed to belong to the group *when hidden, looks as a tile of the group -alters tile, but does not change walkability  0goes from a closed to an open tile when altered  0goes from an open to a closed tile when altered  !causes the effect when triggered    c         cNone (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.).           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 07A strategy is a choice of (non-empty) frequency tables  of possible actions. 2FStrategy where only the actions from the given single frequency table  can be picked. 39Strategy with the actions from both argument strategies,  with original frequencies. 4!Strategy with no actions at all. 5!Conditionally accepted strategy. 6@Strategy with all actions not satisfying the predicate removed. F The remaining actions keep their original relative frequency values. 77When better choices are towards the start of the list, - this is the best frequency of the strategy. 8BOverwrite the description of all frequencies within the strategy. 9Like d+, but pick a name of the single frequency. eEStrategy is a monad. TODO: Can we write this as a monad transformer? 0fgh123456789ije 0123456789 01234567890fgh123456789ijeNone:(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. AReverse an arbirary vector. :;<=>?@A:;<=>?@A:;<=>?@A:;<=>?@ANoneJ$Abstract syntax of player commands. h7Major commands land on the first page of command help. i8Minor commands land on the second page of command help. j<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. k Description of player commands. -BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkklm*BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk/Jgfedcba`_^]\[ZYXWVUTSRQPONMLKBFDCGHIGHEGHEhijk B FDCGHIGHEGHEJgfedcba`_^]\[ZYXWVUTSRQPONMLKhijkklmNone l=The type of areas. The bottom left and the top right points. m>All (8 at most) closest neighbours of a point within an area. nIAll (4 at most) cardinal direction neighbours of a point within an area. o(Checks that a point belongs to an area. pHSort the corners of an area so that the bottom left is the first point. qGDivide uniformly a larger area into the given number of smaller areas. r Checks if it'#s an area with at least one field. s Checks if it'"s an area with exactly one field. tEEnlarge (or shrink) the given area on all fours sides by the amount. lmlimit the search to this area position to find neighbours of nlimit the search to this area position to find neighbours of opqrst lmnopqrst lmnopqrst lmnopqrstNone u>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. v3Print a point as a tuple of cartesian coordinates. w)Conversion from cartesian coordinates to Point. nConversion from Point to cartesian coordinates. x+The top-left corner position of the level. y:The distance between two points in the chessboard metric. z2Checks whether two points are adjacent on the map + (horizontally, vertically or diagonally). {CReturns 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. uovwnxyz{|}~pq uvwxyz{|}~ uwvxyz{|}~uovwnxyz{|}~pqNone3The 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 ranged weapons and missiles  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). rA dummy instance of the s' 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. rrNone=2D vectors represented as offsets in the linear framebuffer  indexed by u. 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. 3Converts a vector in cartesian representation into Vector. 9Tells if a vector has length 1 in the chessboard metric. 8Converts a unit vector in cartesian representation into Vector. t4Converts a unit vector in the offset representation 9 into the cartesian representation. Arbitrary vectors can't be  converted uniquely. Translate 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. uCGiven 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. vwtuxyvwtuxyNone +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. ,z{|}~z{|}~ None1Parameters 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 5The coordinates of consecutive fields of a corridor. 3The 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. 7Create 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.  minimum size )the containing area, not the room itself $the area in which to pick the point $orientation of the starting section starting point  ending point +the area containing the intermediate point "straight sections of the corridor  #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 if 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 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.  !"#$%&'()*+, !"#$%&'()*+, "#$'()!%&*+, !"#$%&'()*+,(None!-HReverse item map, for item creation, to keep items and item identifiers  in bijection. .6All actors on the level, indexed by actor identifier. /;All items in the dungeon (including in actor inventories),  indexed by item identifier. 58Actor 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. 7the kind of the actor 8individual map symbol 9individual name :individual map color ;individual speed <current hit points =#path the actor is forced to travel >current position ?previous position @current level Aitems carried Bmap from letters to items Cnext inventory letter Dabsolute time of next action E"last bracing expires at this time F#to which faction the actor belongs G"is a projectile? (shorthand only, # this can be deduced from bkind) H0A unique identifier of an actor in the dungeon. IAChance 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. J)The part of speech describing the actor. K+A template for a new non-projectile actor. L,Add time taken by a single step at the actor's current speed. M:Whether an actor is braced for combat this clip. If a foe C moves just after this actor in the same time moment, the actor won' t block,  because bwait is reset to zero in  ageActorA before the condition  is checked. NDThe actor most probably waited at most a turn ago (unless his speed  was changed, etc.) O1Checks for the presence of actors in a position. ) Does not check if the tile is walkable. PThe unique kind of heroes. Q The unique kind of projectiles. RHow long until an actor's smell vanishes from a tile. T<Assigns a letter to an item, for inclusion in the inventory : of a hero. Tries to to use the requested letter, if any. 2-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX,HIJ56789:;<=>?@ABCDEFGKLMNOPQ10234/-STVUW.RX-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX)None Y>The last time a hero left a smell in a given tile. To be used ! by monsters that hunt by smell. Z+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. ]&Whether a tile does not block vision.  Essential for efficiency of FOV, hence tabulated. ^"Whether a tile is lit on its own.  Essential for efficiency of  Perception, hence tabulated. _=Whether a tile can be explored, possibly yielding a treasure  or a hidden message. `The player can' t tell one tile from the other. f@Whether a tile kind (specified by its id) has a OpenTo feature. gAWhether a tile kind (specified by its id) has a CloseTo feature. hBWhether a tile kind (specified by its id) has a ChangeTo feature. YZ[\]^_`abcdefghYZ[\]^_`abcdefghYZ[\]^_`abcdefghYZ[\]^_`abcdefgh*None!i+A view on single, inhabited dungeon level.  Remembered fields < carry a subset of the info in the client copies of levels. kdepth of the level l$remembered actor times on the level m$remembered items lying on the floor nremembered level map owidth of the level pheight of the level qremembered smells on the level rlevel description s"destinations of (up, down) stairs t!currently remembered clear tiles u&total number of initially clear tiles v'date of the last activity on the level w'number of initial items, 0 for clients xsecret tile seed ysecret tile density zCurrent smell on map tiles. {Tile 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. +ijklmnopqrstuvwxyz{|}~the number of tries look up in this map predicates to satisfy (ijklmnopqrstuvwxyz{|}~(}~z|{ijklmnopqrstuvwxyijklmnopqrstuvwxyz{|}~+None$Abstract syntax of server commands. @The actor that start performing the command (may be dead, after  the command is performed). ###  ,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   .None1Freshly generated and not yet populated dungeon. maps for all levels +dungeon depth (can be different than size) .Create a level from a cave, from a cave kind. %Generate the dungeon for a new game. /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  color of actors or their frames !the player spec for this faction diplomatic mode cause of game end/exit "the leader of the faction, if any 9All factions in the game, indexed by faction identifier. +Tell whether the faction can spawn actors. BTell 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. $  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. +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)      level of the stairs position of the stairs jump up this many levels  game state 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*.-,+ *.-,+/015None2;Fully typed contents of the rules config file. This config  is a part of the game server. 23456789:;< 23456789:;< 23456789:;<2 3456789:;<6None )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, H is expected to come from a default configuration file included via TH. * 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/. =+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. 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. >FRead and parse rules config file and supplement it with random seeds. =config name of the generator >=>>==>7NoneA&Font to use for the main game window. BMaximal 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'2s better than scaling AI sofistication down based ' on the FPS setting and machine speed. CDon'0t maintain any requested delays between frames,  e.g., for screensaver. D0Auto-answer all prompts, e.g., for screensaver. EDon't show any animations. F-Start a new game, overwriting the save file. GPrefix of the save game file. HWhether to use the stdout/stdin frontend. I Show clients' internal debug messages. O.Sequences of screen frames, including delays. P?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. Q7The data sufficent to draw a single game screen frame. BThe fields are not strict, because sometimes frames are not used, H e.g., when a keypress discards all frames not yet drawn and displayed. S$content of the screen, line by line T!an extra line to show at the top U$an extra line to show at the bottom Y,Render animations on top of a screen frame. [HAttack animation. A part of it also reused for self-damage and healing. \"Attack that hits through a block. ]Attack that is blocked. ^%Death animation for an organic body. _2Swap-places animation, both hostile and friendly. *?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a,XYZ[\]^_s?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a,\]^_sXYZ[QRSTUVWXPOYZ[\]^_`JNMLK?@ABCDEFGHIa? @ABCDEFGHIJNMLKOPQRSTUVWXYZ[\]^_`a8Noneu$Abstract syntax of atomic commands. Ebcdefghijklmnopqrstuvwxyz{|}~Abcdefghijklmnopqrstuvwxyz{|}~Au~}|{zyxwvftsrqponmlkjihgbedc bedcftsrqponmlkjihgu'~}|{zyxwv^None)Session data maintained by the frontend. the widget to draw to text color tags for fg/bg channel for keyboard input 7State 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. :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 E for a frame, in which case the locking interval becomes meaningful. client configuration 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 polls per second. ,Add a given number of microseconds to time.  GThe difference between the first and the second time, in microseconds.  ?Poll the frame queue often and draw frames at fixed intervals.  >Add a game screen frame to the frame drawing channel, or show  it ASAP if  immediate0 display is requested and the channel is empty.  DTrim current frame queue and display the most recent frame, if any.  Add a frame to be drawn. $Display a prompt, wait for any key. ) Starts in Push mode, ends in None mode. J Syncs with the drawing threads by showing the last or all queued frames. Tells a dead key. *Translates modifiers to our own encoding. )frontend session data the screen frame to draw      frontend session data the screen frame to draw  !       !9None9No session data needs to be maintained by this frontend. "client configuration The name of the frontend. BStarts the main program loop using the frontend input and output. 'Output to the screen via the frontend. #Input key via the frontend. $Display a prompt, wait for any key. $"frontend session data the screen frame to draw #%$"#%:None!The name of the chosen frontend. ;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 &?The first component is the number of UI players at game start. '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. )*&'(+,-./0)*&'(+,-./0<NoneDebug commands. See _` for the descriptions. Global, 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  this game'!s config (including initial RNG) exit the game loop make backup savefile now this session start time current debugging mode !debugging mode for the next game "Initial, empty game server state. #12!! 12=None34  34>None5ACreates 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). 6(Update a given level data within state. 7?Kills an actor. Note: after this command, usually a new leader " for the party should be elected. 8JCreate a few copies of an item that is already registered for the dungeon  (in sitemRev field of  StateServer). 93Destroy 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). #5678<=9>?@ABCDEFGHIJK:LMNOP;QRST#5678<=9>?@ABCDEFGHIJK:LMNOP;QRST?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. UVW UVW@NoneHConnection information for all factions, indexed by faction identifier. <Connections to the human-controlled client of a faction and ( 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. XYZ[\]^_     `a           XYZ[\]^_     `aANone     BNone"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. $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. b,Generate a new score, register it and save. 36Update 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. 5ECompute and insert auxiliary optimized components into game content, 3 to be used in time-critical sections of the code. 6GInvoke pseudo-random computation with the generator kept in the state. !"#$cdef%&'()*+,b-./g0123456!"#$%&'()*+,-./01234561345%&'()*!$+,/06-."#2!"#$cdef%&'()*+,b-./g0123456CNone7#Server state transformation monad. hcurrent global state icurrent server state j%client-server connection information kconnection to the save thread 8Run an action in the IO monad, with undefined state. 7lmnohijk8pqrs78787lmnohijk8pqrsDNone96Send an atomic action to all clients that can see it. tu9v99tu9vENone:>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. w7Create a new monster on the level, at a given position % and with a given actor kind and HP. x The faction leaves the dungeon. :;yz{|}<=~>?w@x:;<=>?@:;@>?<=:;yz{|}<=~>?w@xFNoneEDAdd a smell trace for the actor to the level. For now, all and only 0 actors from non-spawning factions leave smell. FActor moves or attacks. > Note that client may not be able to see an invisible monster  so it'7s the server that determines if melee took place, etc. A Also, only the server is authorized to check if a move is legal F and it needs full context for that, e.g., the initial actor position C to check if melee attack does not try to reach to a distant tile. G5Resolves 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. H,Actor tries to swap positions with another. I Search and/or alter the tile.  Note that if  serverTile /= freshClientTile, freshClientTile  should not be alterable (but  serverTile may be). JUpdate the wait/)block count. Uses local, per-level time, K to remain correct even if the level is frozen for some global time turns. O8Create a projectile actor containing the given missile. Q4Perform the effect specified for the tile in case it' s triggered. ABCDEFGHIJKLM.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 N.actor projecting the item (is on current lvl) !starting point of the projectile #rest of the path of the projectile the item to be projected 0whether the items comes from floor or inventory OP.actor applying the item (is on current level) the item to be applied the location of the item QRSTUVWABCDEFGHIJKLMNOPQRSTUVWABCDEFGHIJKLMNOPQRSTUVWABCDEFGHIJKLMNOPQRSTUVWGNoneXApply debug options that don't need a new game. BFind 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. XYZ[XYZ[X[ZY XYZ[HNone\8Start a game session. Loop, communicating with clients. ?Save game on server and all clients. Clients are pinged first, > which greatly reduced the chance of saves being out of sync. APerform 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. Drop all actor' s items. +Advance the move time for the given actor. Generate a monster, possibly. <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. &Continue or exit or restart the game. \\\\INone>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. ]]]]JNone^8Fully typed contents of the UI config file. This config  is a part of a game client. ^_`abcdefgh ^_`abcdefgh ^_`abcdefgh^ _`abcdefghKNone iThe type of na actor target. jtarget a given position k,target an actor with its last seen position l$Current targeting mode of a client. m8the mode was entered (and will be exited) automatically n/the player requested targeting mode explicitly p-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. rtargeting mode scursor coordinates t$a parameter of the tgt digital line u%targets of our actors in the dungeon v"direction and distance of running wcurrent messages xhistory of messages y"atomic commands performed to date zremembered item discoveries {%faction perception indexed by levels |current random generator }&client config (including initial RNG) ~last command key pressed selected actor !faction controlled by the client exit the game loop  whether it's an AI client mark leader and party FOV $mark smell, if the leader can smell mark suspect features client debugging mode Initial game client state. .Update target parameters within client state. )Get target parameters from client state. 0Update selected actor within state. Verify actor' s faction. *ijklmnopqrstuvwxyz{|}~'ijklmnopqrstuvwxyz{|}~(pqrstuvwxyz{|}~lnmooikjikjlnmoopqrstuvwxyz{|}~LNoneColor mode for the display. black+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. MNone)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, H is expected to come from a default configuration file included via TH. * 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. 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.  NNone<Bindings and other information about human player commands. binding keys to commands  macro map major commands minor commands from cmds to their main keys 9Binding of keys to movement and other standard commands, 1 as well as commands defined in the config file. 5Produce a set of help screens from the key bindings.  game config concrete binding   ONone3The bottom of the action monads class semilattice. 3Connection 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  PNoneAClient parts of actions of human and computer player characters. 3The type of the function inside any client action. :Invokes the action continuation on the provided argument. 3Distributes the session and shutdown continuation,  threads the state and history. ;Init the client, then run an action, with a given session,  state and history, in the IO monad. client UI setup data #this client connection information  continuation failure/reset continuation current local state current client state QNoneDReset 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. A 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. >Assuming the client runs on the same machine and for the same > user as the server, move the server savegame out of the way. 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. $88$RNoneSNoneFProduces 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  TNone<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.". UNone <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. VNone9AI 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). ;Actor moves or searches or alters or attacks. Displaces if run. 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. WNone5Actor atttacks an enemy actor or his own projectile. #Actor swaps position with another. EActor moves or searches or alters. No visible actor at the position. (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. 3Ask for a direction and alter a tile, if possible. .Player tries to alter a tile using a feature. .Guess and report why the bump command failed. #Leader tries to trigger the tile he's standing on. 0Player tries to trigger a tile using a feature. @Verify important feature triggers, such as fleeing the dungeon. .Guess and report why the bump command failed. 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                 XNone 7The 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.     YNone Handle the move of a UI player. )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. ZNone;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.      abcdefghijklmnopqrstuvwxyz{{|}~                                                       !"#$%&'()*+,-./01223456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeffghijklmnnopqrstuvwxyzz{|}~ ^                         ! " #!$!%!&!'!(!)!*!+!,!-!."/"0"1"2"3"4"5#6#7#8#9#:#;$6$7$8$9$:$;%<%=%6&>&?&?&@&A&B&C&D&E&F&G&H&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(w(x(y(y(z({(|(}(~((((((((((((((((((((((((((((())))))))))))))))***************************************+++++++++++++++++++++++++++++++++++,,,,,,,,,,,,---------.... . / / / / ////G////////////////// /!/"/#/$/%0&0'0(0)1*1+1,1-1.1/101112131415161718191:1;1<1=1>1?2@2A2B2C2D2E2F2G2H2I2J2K2L2M2N2O2P2Q3R3S3T3T3U3V3W3X3Y3Y3Z3[3\3]3^3_3`3a4b4c4d4e4f4g4h4i5j5j5k5l5m5n5o5p5q5r5s6t6u7v7v7w7x7y7z7{7|7}7~77777777777777777777777778888888888888888888888888888888888888888888888888888888888888888899999::::::::;;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<< < < < < =============>>>??? ?!?"?#?$?%?&?'?(?)?*?+?,?-@.@/@0@0@1@2@3@4@5@6@7@8@9@:@;@<@=@>A?A@AAABACADAEAFAGAHAIAJAKBLBMBNBOBPBQBRBSBTBUBuBVBWBXBYBZB[B\B]B^B_B`CaCbDcEdEeEfEgEhEiEjFkFlFmFnFoFpFqFrFsFtFuFvFwFxFyFzF{F|F}F~FFFGGGGHIJJJJoJJrJJJJJKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKLLLLMNNNNNNNNNOOOOOOOOOOOOOOOIOOOOOOOOOOKPPPQLQQQQQQQQQQQQQQQQNQQQQQQQQQQQ%QQ`QQQRRSSSSSSSSSSSSSSSSSSSSS S S S S STTTTUVVVWWWWWWWWWW W!W"W#W$X%Y&Y'Y(Y)Y*Z+Z,Z-./0tu123456789:;<=[>[?[@[A[B[C[D[E[F[G[HI J K L M   N O P Q R S T U V  W XYaZ[\]^_ `    a b c de'fgh3ijklmnopqrabstuvwxyz{|}~a"""""%%&>&P&&&&&&&&''Z'c'd'''((((((****,,,,,--...../////0000000000&000111111111*11122234444444455666666666666677777778888^^^^^^^^^^^^^^^^^^^^ ^^^ ^ ^ ^ ^ ^^^^^^^^^^^^^^9999 ;;;;;; ;!;";#;$;%<&<'=(=)>*>+>,>->.>/>0>1>2>3>4>5>6>7>8>9>:>;><>=>>>?>@>A>B>C>D>E>F>G>H>I?J?K?L@M@M@N@O@P@Q@R@S@T@UBVBWBXBYBZB[C\C]C^C_CaC`CaCaCbCcCdCeDfDgDhEiEjEkElEmEnEoEpEqErEsEtEuEvEwExEyEzG{G|G}G~GHHHHHHHHHHHHHIII`JJKKKLMMMMMMMMMMNOOOPPPPPPPPPPPPPQQQRSSSSSSTT,TTTTTTTTTTTTTTUUUUUUUUUVVVVVVVVVVVVVVVWWWWWWWWWWWWWWWxWWWXXXXXXZfLambdaHack-0.2.10Game.LambdaHack.Utils.AssertGame.LambdaHack.Utils.LQueueGame.LambdaHack.Utils.ThreadGame.LambdaHack.Utils.FileGame.LambdaHack.Common.Misc!Game.LambdaHack.Common.ContentDef!Game.LambdaHack.Content.PlaceKindGame.LambdaHack.Common.Ability#Game.LambdaHack.Content.FactionKindGame.LambdaHack.Common.TimeGame.LambdaHack.Common.ColorGame.LambdaHack.Common.FlavourGame.LambdaHack.Common.Msg Game.LambdaHack.Content.ModeKindGame.LambdaHack.Common.PointXYGame.LambdaHack.Common.SaveGame.LambdaHack.Utils.FrequencyGame.LambdaHack.Common.RandomGame.LambdaHack.Common.EffectGame.LambdaHack.Common.Feature Game.LambdaHack.Content.TileKind 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.Content.RuleKindGame.LambdaHack.Common.VectorGame.LambdaHack.Common.Key Game.LambdaHack.Content.CaveKind!Game.LambdaHack.Server.Fov.Common)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.Cave!Game.LambdaHack.Server.DungeonGenGame.LambdaHack.Common.Faction 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.Common.Animation Game.LambdaHack.Common.AtomicCmdGame.LambdaHack.Frontend.StdGame.LambdaHack.Frontend.ChosenGame.LambdaHack.FrontendGame.LambdaHack.Server.StateGame.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.ConfigIOGame.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.GtkServer debugArgsbaseGHC.BaseassertLQueue newLQueue nullLQueue lengthLQueue tryReadLQueue writeLQueue trimLQueuedropStartLQueue lastLQueue toListLQueue forkChildwaitForChildren encodeEOFstrictDecodeEOF tryCreateDirtryCopyDataFilesLevelId FactionIdFreqsnormalLevelBound maxLevelDimdivUpbreturn ContentDef getSymbolgetNamegetFreqvalidatecontentFenceFNoneFFloorFWallCoverCReflectCStretch CAlternate PlaceKindpsymbolpnamepfreqpcoverpfenceptopLeft pvalidateAbilityWanderChaseToolsRangedTriggerPickupMeleeFleeHealTrack FactionKindfsymbolfnameffreqfAbilityLeader fAbilityOther fvalidateSpeedTimetimeZero timeEpsilontimeCliptimeTurntimeAddtimeFit timeNegate timeScale timeToDigittoSpeed speedZero speedNormal speedScalespeedAdd speedNegate ticksPerMetertraveledspeedFromWeightrangeFromSpeedAttrCharacAttracCharAttrfgbgColorBrWhiteBrCyan BrMagentaBrBlueBrYellowBrGreenBrRedBrBlackWhiteCyanMagentaBlueBrownGreenRedBlackdefBGdefFGdefAttrisBrightlegalBGdarkCol brightColstdCol colorToRGBFlavourzipPlainzipFancystdFlavflavourToColor flavourToNamecolorToPlainNamecolorToFancyNamecolorToTeamNameminimorph-0.1.4.0NLP.Minimorph.Util<><+>Player playerName playerFaction playerEntry playerInitialplayerAiLeader playerAiOther playerHumanplayerUIPlayers playersList playersEnemy playersAllyCavesModeKindmsymbolmnamemfreqmplayersmcaves mvalidateblamewithfailureallBskip forceEitherPointXYYXfromTo sortPointXYblaXY Slideshow runSlideshowOverlayHistoryReportMsgshowT makePhrase makeSentencemoreMsgyesnoMsg truncateMsg emptyReport nullReportsingletonReportaddMsg splitReport renderReport findInReport emptyHistorysingletonHistory mergeHistory renderHistory addReport takeHistorystringByLocation splitOverlay toSlideshowChanSave saveToChan wrapInSaves restoreGame delayPrint Frequency nameFrequency runFrequency uniformFreqtoFreq scaleFreq renameFreqrollFreqnullFreqChanceRollDeep RollDiceXYRollDiceRndrandomRrandomoneOf frequencycastrollDicecastDicemaxDiceminDicemeanDice castDiceXYcastDeep chanceDeep intToDeepmaxDeepchancerndToIOEffectEscapeAscend Searching Regeneration ApplyPerfume CreateItemSummon CallFriendDominate MindprobeHurtNoEffect effectTraveffectToSuffixFeaturePathExitCanActorCanItem ImpenetrableAuraSuspectLitClearWalkableRevealAsHideAsChangeToCloseToOpenToCauseTileKindtsymboltnametfreqtcolortcolor2tfeature tvalidateItemKindisymbolinameifreqiflavourieffecticount iverbApply iverbProjectiweightitoThrow ivalidate ActorKindasymbolanameafreqacoloraspeedahpasightasmellaiqaregenacanDo avalidateStrategy nullStrategy liftFrequency.|reject.=>only bestVariantrenameStrategyreturNVectorXYshiftXYmovesXYmovesCardinalXY chessDistXYeuclidDistSqXYnegXYTriggerFeature AlterFeaturefeature ApplyItemverbobjectsymbolHumanCmdHelp MarkSuspect MarkSmell MarkVisionAcceptCancelEpsIncr TgtAscendTgtEnemyTgtFloor Inventory MemberBack MemberCycle SelectHeroCfgDumpGameSaveGameExit GameRestart TriggerTileAlterDirApplyProjectDropWaitRunMove majorHumanCmd minorHumanCmdnoRemoteHumanCmdcmdDescriptionArea vicinityXYvicinityCardinalXYinsideXY normalizeAreagrid validArea trivialAreaexpandPoint showPointtoPointorigin chessDistadjacentvicinityvicinityCardinalinsidedisplacementXYZblaRuleKindrsymbolrnamerfreq raccessiblertitlerpathsDataFile rpathsVersion ritemMelee ritemRanged ritemProjectrcfgRulesDefault rcfgUIDefault rmainMenuArt ruvalidateVectortoVectorisUnittoDirshift shiftBoundedmoves euclidDistSqdiagonalnegtowards displacement displacePath shiftPathKMmodifierkeyModifierControl NoModifierKeyUnknownCharKPHomeBeginEndDownUpRightLeftPgDnPgUpBackTabTabSpaceReturnEscshowKMescKey dirAllMoveKey handleDir moveBinding keyTranslateCaveKindcsymbolcnamecfreqcxsizecysizecgrid cminPlaceSize cdarkChance cauxConnects cvoidChance cnonVoidMin cminStairDist cdoorChance copenChancechiddencitemNumcdefTile ccorridorTile cfillerTilecdarkLegendTileclitLegendTile cvalidate EdgeIntervalEdge ConvexHullLineBumpBProgressDistancemaximalsteeperaddHullCorridorxyInAreamkRoom mkVoidRoom connectGridrandomConnection connectPlacesscandlinedsteeper intersect debugSteeper debugLineIntervalSBumpArrayCOpscoactorcocavecofactcoitemcomodecoplacecorulecotileOpsokind ouniqGroupopick ofoldrWithKeyoboundsospeedupSpeedupId sentinelId createOps stdRuleset!// listArrayarraybounds foldlArray FlavourMapItemjkindIxjsymboljnamejflavourjeffectDiscoRev Discovery ItemKindIxItemIdjkind serverDiscos buildItemnewItemviewItememptyFlavourMapdungeonFlavourMapstrongestSearchstrongestSwordstrongestRegenpartItem partItemWs partItemAWItemRev ActorDictItemDictItemInvItemBagInvCharinvCharActorbkindbsymbolbnamebcolorbspeedbhpbpathbposboldposblidbbagbinvbletterbtimebwaitbfidbprojActorIdmonsterGenChance partActor actorTemplatetimeAddFromSpeedbracedwaitedLastTurn unoccupied heroKindIdprojectileKindId smellTimeout allLetters assignLetter letterRange letterLabel rmFromBagmapActorItems_ SmellTimekindHasFeaturekindHas hasFeatureisClearisLit isExplorablesimilarspeedupopenTocloseTorevealAshideAsopenableclosable changeableLevelldepthlpriolfloorltilelxsizelysizelsmellldesclstairlseenlclearltimelitemNumlsecretlhiddenSmellMapTileMap ItemFloor ContainerCActorCFloorDungeonascendInBranch updatePrio updateSmell updateFloor updateTileatatI accessible accessibleDir isSecretPoshideTilefindPos findPosTrymapLevelActors_mapDungeonActors_ FailureSerTriggerNothingProjectBlockFoesProjectBlockActorProjectBlockTerrainProjectAimOnself AlterNothingAlterBlockItemAlterBlockActor AlterDistantDisplaceAccessDisplaceDistant MeleeDistant MoveNothingCmdSerTakeTime SetPathSer TriggerSerApplySer ProjectSerDropSer PickupSerWaitSerAlterSer DisplaceSerMeleeSerMoveSerCmdSer CfgDumpSer GameSaveSer GameExitSerGameRestartSer TakeTimeSer aidCmdSeraidCmdSerTakeTimeshowFailureSer TileMapXYPlaceqkindqareaqseenqlegend qsolidFence qhollowFence placeValid buildPlace buildFenceCavedkinddmapditemdplaces ItemFloorXY buildCave FreshDungeon freshDungeon freshDepth dungeonGenStatus stOutcomestDepthstInfoOutcomeRestartConquerCampingDefeatedKilled DiplomacyWarAllianceNeutralFactiongkindgnamegcolorgplayergdiplgquitgleader FactionDict isSpawnFact isSummonFactisAtWarisAllied ScoreTableemptyregister slideshowStatedefStateGlobal emptyStatelocalFromGlobal updateDungeon updateDepth updateActorD updateItemD updateFaction updateTime updateCOps getLocalTimeisSpawnFactionisSummonFactionsdungeonsdepthsactorDsitemD sfactionDstimescopsshigh actorAssocs actorListactorNotProjAssocsactorNotProjList posToActornearbyFreePointscalculateTotal foesAdjacent tryFindHeroKwhereTo getActorBodyupdateActorBody getActorBagactorContainer getActorInv getActorItem getItemBodymemActorPers FactionPers PerceptionperActorptotalpsmellPerActorPerceptionVisiblepvisible totalVisible smellVisible actorSeesPosnullPeraddPerdiffPersmellFromActorsFovModeBlindDigital PermissiveShadowlevelPerceptiondungeonPerceptionfullscanConfigconfigSelfStringconfigFirstDeathEnds configFovModeconfigSaveBkpClipsconfigAppDataDirconfigScoresFileconfigRulesCfgFileconfigSavePrefixconfigHeroNamesdump mkConfigRules DebugModeClisfontsmaxFpssnoDelaysnoMoresnoAnim snewGameClissavePrefixCli sfrontendStd sdbgMsgCliAcFrameAcDelayAcNormal AcRunning AcConfirmFrames Animation SingleFramesfLevelsfTopsfBottomemptySingleFramexsizeSingleFrameysizeSingleFrame renderAnim restrictAnim twirlSplashblockHit blockMiss deathBody swapPlacesfadeoutdefDebugModeCli HitAtomic MissBlockD HitBlockDHitD SfxAtomicRecordHistoryD DisplayDelayD DisplayPushDMsgAllDMsgFidDEffectDShunDTriggerDCheckD ActivateDCatchDProjectDRecoilDStrikeD CmdAtomicMsgAllASaveBkpA 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 undoAtomicFrontendSession frontendNamestartupfdisplay fpromptGetKeyFrontend fdebugCli chosenStartup stdStartup ConnMulti fromMultitoMultiFrontReq FrontSlides frontClear frontSlidesFrontKeyfrontKMfrontFr FrontFramefrontAc ChanFrontendstartupF connMulti loopFrontend DebugModeSersknowMap sknowEventssniffInsniffOut sallClear sgameMode sstopAftersfovMode snewGameSerssavePrefixSer sdbgMsgSer sdebugCli StateServersdisco sdiscoRevsitemRevsflavour sacounter sicountersundospersrandomsconfigsquitsbkpSavesstart sdebugSer sdebugNxtemptyStateServerdefDebugModeSer MonadAtomic execAtomic execCmdAtomic execSfxAtomic MonadAction modifyStateputState MonadActionROgetState getsStategetLevelnUIserverSaveName cmdAtomicSemposOfAidposOfContainer PosAtomicPosNonePosAllPosSer PosFidAndSerPosFidPosSmellPosFidAndSightPosSight posCmdAtomic posSfxAtomicresetsFovAtomicbreakCmdAtomic loudCmdAtomic seenAtomicCli seenAtomicSerConnServerDictConnServerFaction ChanServer fromServertoServer CmdClientUI CmdPingUI CmdQueryUI SfxAtomicUI CmdAtomicUI CmdClientAI CmdPingAI CmdQueryAI CmdAtomicAIdebugCmdClientAIdebugCmdClientUIdebugAidMonadConnServergetDictgetsDict modifyDictputDict MonadServer getServer getsServer modifyServer putServerliftIO saveServersaveName debugPrintresetFidPerception getPerFiddumpCfg sendUpdateAI sendQueryAI sendPingAI sendUpdateUI sendQueryUI sendPingUI restoreScoreresetSessionStartelapsedSessionTimeGT revealItems deduceQuits tryRestorechildrenServer updateConnkillAllClients speedupCOps rndToAction ActionSer executorSer atomicSendSem itemEffect effectSem electLeader deduceKilledaddHero spawnMonsters createItems execFailurebroadcastCmdAtomicbroadcastSfxAtomic checkAdjacentaddSmellmoveSermeleeSer displaceSeralterSerwaitSer pickupSerdropSer projectSer projectBla addProjectileapplySer triggerSer triggerEffect setPathSergameRestartSer gameExitSer gameSaveSer cfgDumpSer applyDebuginitPer reinitGame gameResetloopSermainSerConfigUIconfigCommandsconfigUICfgFile configMacros configFontconfigHistoryMax configMaxFps configNoAnimTargetTPosTEnemyTgtModeTgtAuto TgtExplicit tgtLevelId StateClientstgtModescursorsepsstargetDsrunningsreportshistorysfper sconfigUIslastKey_sleader_ssidesisAI smarkVision smarkSmell smarkSuspectdefStateClient defHistory updateTarget getTarget updateLeaderssidetoggleMarkVisiontoggleMarkSmelltoggleMarkSuspect ColorModeColorBW ColorFulldraw mkConfigUIBindingkcmdkmacrokmajorkminorkrevMap stdBindingkeyHelpMonadClientAborttryWith abortWithMonadClientWriteServer writeServerMonadClientReadServer readServer MonadClientUI getsSession MonadClient getClient getsClient modifyClient putClient saveClient ConnFrontendreadConnFrontendwriteConnFrontend SessionUIsfconnsbinding ActionCli FunActionCli executorCli connFrontendabort abortIfWith neverMindtryRepeatedlyWith tryIgnore tryWithSlidegetInitConfirms getLeaderUI getArenaUI targetToPos askBindingmsgAddmsgReset recordHistorygetKeyOverlayCommand displayFrames displayMore displayYesNodisplayChoiceUIpromptToSlideshowoverlayToSlideshow drawOverlay displayPushscoreToSlideshowremoveServerSaveanimatepartActorLeader partAidLeaderloopAIloopUI moveCursor viewedLevellookAtfloorItemOverlay itemOverlayretargetLeaderselectHeroHumanmemberCycleHuman selectLeader stopRunningmemberBackHumaninventoryHumantgtFloorLeadertgtEnemyLeadertgtAscendHuman epsIncrHuman cancelHumandisplayMainMenu acceptHuman endTargeting clearHuman historyHumanhumanMarkVisionhumanMarkSmellhumanMarkSuspect helpHumancmdAtomicFilterClicmdAtomicSemClidrawCmdAtomicUIdrawSfxAtomicUIcontinueRunDirtargetStrategy visibleFoesactionStrategymeleeAid displaceAid moveRunAid waitHuman pickupHuman dropHuman projectAid applyHuman alterDirHumantriggerTileHumangameRestartHuman gameExitHuman gameSaveHuman cfgDumpHuman cmdHumanSemqueryAI queryAIPickqueryUI continueRun humanCommandcmdClientAISemcmdClientUISem exeFrontend encodeDatastrictReadSerializedstrictDecodeData$fBinaryLevelId$fBinaryFactionId$fAdjustableEnumMap$fLookupEnumMap$fIndexableEnumMap$fTraversableWithKeyEnumMap$fFoldableWithKeyEnumMap$fKeyedEnumMap$fZipWithKeyEnumMap $fZipEnumMap$fBinaryHashMap$fBinaryEnumSet$fBinaryEnumMapcatchIOversionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileName$fBinaryAbility _timeTick turnsInSecond_ticksInSecondsInMs $fBinarySpeed $fBinaryTime _olorToRGB$fBinaryAttrChar $fBinaryAttr $fBinaryColor$fHashableColor fancyName baseColor$fBinaryFlavour$fHashableFlavour$fBinaryPlayerGHC.Errerror balancedWordfromTo1 $fEnumPointXY $fShowPointXY splitTextrenderRepetition splitText'$fBinaryHistory$fBinaryReportloopSave$fFunctorFrequency$fMonadPlusFrequency$fMonadFrequency$fBinaryRollDice$fHashableRollDice$fReadRollDice$fShowRollDice effectToSuff affixPower affixBonus$fBinaryEffect$fHashableEffect$fBinaryFeaturereturn$fMonadStrategy runStrategynormalizeStrategy$fFunctorStrategy$fMonadPlusStrategytriggerDescription$fBinaryTrigger$fBinaryHumanCmd fromPoint $fShowPoint $fBinaryPoint$fShowRuleKindGHC.ShowShowfromDir normalizeisUnitXY $fShowVector$fBinaryVectorshowKey dirViChar dirViMoveKey dirMoveKey dirViRunKey dirRunKey _dirAllRunKeydirNums dirHeroKey $fBinaryKM$fShowKM$fBinaryModifier $fBinaryKeyHV mkCorridorVertHoriz connectGrid'downBiasupBias TileSpeedup isClearTabisLitTab $fShowArray $fBinaryArray$fEqCOps $fShowCOps $fBinaryIdrollFlavourMap strongestItem $fBinaryItem$fHashableItem cmpLetter $fBinaryActor$fBinaryInvChar $fOrdInvChar$fBinaryActorId ActorPrioassertSparseItems $fBinaryLevel$fBinaryContainer expandFenceolegenddigPlace tilePlace $fBinaryPlace digCorridors mergeCorridor buildLevelconvertTileMaps placeStairslevelFromCaveKind findGeneratorDipl$fBinaryStatus$fBinaryOutcome$fBinaryDiplomacy$fBinaryFaction ScoreRecordpointsnegTimedatestatus showScore insertPos showTableshowCloseScores$fBinaryScoreRecord$fShowScoreTable _sdungeon_sdepth_sactorD_sitemD _sfactionD_stime_scops_shigh unknownLevelunknownTileMap $fBinaryState itemPrice tryFindActor posToActors$fBinaryPerceptionfactionPerceptioncomputeVisiblecomputeReachablePerceptionReachable preachable isVisible$fBinaryFovMode$fBinaryConfig$fNFDataConfigCPmkConfig appDataDirset getSetGentoCP getOptiongetgetItems overrideCPparseConfigRules$fShowCPblank coloredSymbol mzipPairs$fBinaryDebugModeCli$fBinaryAcFrame$fBinarySingleFrame$fBinaryHitAtomic$fBinarySfxAtomic$fBinaryCmdAtomic$fBinaryAtomicsviewstagsschanKey sframeState slastFullfpushedfshownonQueuerunGtkoutputmaxPollsaddTimediffTime pollFrames pushFrametrimFrameStatedeadKeymodifierTranslateGtkFramegfChargfAttr FrameStateFPushed dummyFrame lengthQueuesetTo picoInMicro microInSec defaultMaxFps evalFramedisplayAllFramesSyncdoAttr nextEvent FromMulti promptGetKeygetConfirmGenericReqMapToMulti flushFrames displayAcgetSingleFrame toSinglesfadeFinsertFr$fBinaryDebugModeSer$fBinaryStateServer $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 singleAidsingleContainerfidOfAidDebugAidlabelcmdlidtimeaidfaction debugPretty debugPlain registerScore writeTQueueAI writeTQueueUI readTQueueAI readTQueueUIquitFserState serServerserDict serToSave runActionSerSerState$fMonadConnServerActionSer$fMonadServerActionSer$fMonadActionActionSer$fMonadActionROActionSer storeUndoatomicServerSematomicRemember addMonster effectEscapeeffectNoEffect effectHeal effectWoundeffectMindprobeeffectDominateeffectCallFriend summonFriendsaddActor effectSummoneffectCreateItemeffectApplyPerfumeeffectSearching effectAscend effLvlGoUp switchLevels1 switchLevels2 findEntryPossmapFromInvFuns lowercasecreateFactionspopulateDungeon saveBkpAll handleActors dropAllItems advanceTimegenerateMonsterregenerateLevelHP endOrLoop initDebugendClipdieSer rollSpawnPos saveAndExit restartGame cmdSerSemcmdSerSemTakeTime$fBinaryConfigUI$fNFDataConfigUI$fBinaryTarget$fBinaryTgtMode$fBinaryStateClientdrawLeaderStatus parseConfigUIcoImage$fMonadClientAbortWriterT$fMonadClientUIWriterT$fMonadClientWriterTreturnActionCli bindActionCli runActionCli"$fMonadClientWriteServerdActionCli!$fMonadClientReadServercActionCli$fMonadClientUIActionCli$fMonadClientActionCli$fMonadActionActionCli$fMonadActionROActionCli$fMonadClientAbortActionCli$fFunctorActionCli$fMonadActionCligetYesNo displayFrameinitClidoLook setCursor cursorLevelpartyAfterLeadersetTgtIdendTargetingMsg actorVerbMU perceptionA discoverAcoverA killExitA lookAtMoveaVerbMU itemVerbMU_iVerbMUaiVerbMUdestroyActorUI moveItemUIdisplaceActorUI quitFactionUIstrikeDRunMode RunDeadEnd RunCorridorRunHubRunOpencanRunrunModerunDisturbancerunDir waitBlockNowtrack moveStrategyeffectToBenefit reacquireTgt proposeActionpickupmelee triggerFreq rangedFreq toolsFreq bumpableHerechasewander getAnyItemgetItem getGroupItem alterTile guessAlter triggerTile verifyTrigger guessTriggerItemDialogStateIAll ISuitableINone abortFailureallObjectsNametriggerSymbols alterFeaturestriggerFeatures cmdAction checkCursor moveRunHuman projectHuman tgtFloorHuman tgtEnemyHuman