6      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] ^ _ ` a b c d e f g h i j k lmnopqr s t u v w x y z { | } ~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q!r!s!t!u!v!w!x!y!z!{!|!}!~!!!!!!!!!!!!!!!""""""""""""""""""""""""""""""""""""#########################$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&&&&&&&&&&&''''''' ' ' ' ' (((((())))))))))))) )!)")#)$)%)&)')()))*)+),)-).)/)0)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-{-|-}.~....////////////000000000000111111122222222333333345555555555555555555555555555555555555555555555556666666666666666666777777777777777777777 7 7 7 7 7889999999999999999 9!9"9#9$9%9&9'9(9)9*9+9,:-:.:/:0:1;2<3<4=5>? Safe-Infered6Serialize, 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, 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. ? Safe-Infered6789:;6789:;6789:; Safe-Infered6For each group that the kind belongs to, denoted by a String 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. Integer division, rounding up.  Safe-Infered*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-InferedAThe 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  Safe-Infered(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). (Game time in ticks. The time dimension. 8 One tick is 1 microsecond (one millionth of a second),  one turn is 0.5 s. 6Start of the game time, or zero lenght time interval. !: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. "0One 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). #Time addition. $?How many time intervals of the latter kind fits in an interval  of the former kind. %<Negate a time interval. Can be used to subtract from a time % or to reverse the ordering on time. &Scale time by an Int scalar value. '<Represent the main 10 thresholds of a time range by digits, + given the total length of the time range. (%Constructor for content definitions. )Normal speed (2 m//s) that suffices to move one tile in one turn. *Scale speed by an Int scalar value. +FThe number of time ticks it takes to walk 1 meter at the given speed. ,>Distance in meters (so also in tiles, given the chess metric) 8 traveled in a given time by a body with a given speed. -5Calculate projectile speed from item weight in grams  and speed bonus in percents.  See  ;https://github.com/kosmikus/LambdaHack/wiki/Item-statistics. .BCalculate 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.  !"#$%&'()*+,-.<= !"#$%&'()*+,-. !"#$%&'()*+,-. !"#$%&'()*+,-.<= Safe-Infered /)The content of the configuration file. It' s parsed < in a case sensitive way (unlike by default in ConfigFile). 0:Read the player configuration file and use it to override - any default config options. Currently we can' t unset options, only override. 'The default config, passed in argument  configDefault, J is expected to come from the default configuration file included via CPP  in file ConfigDefault.hs. 1FPersonal data directory for the game. Depends on the OS and the game, $ e.g., for LambdaHack under Linux it's ~/ .LambdaHack/. 25A 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. 33Simplified access to an option in a given section. % Fails if the option is not present. 4JAn association list corresponding to a section. Fails if no such section. 5?Looks up a file path in the config file and makes it absolute.  If the game'"s configuration directory exists, / the file path is appended to it; otherwise, it' s appended  to the current directory. 6+Dumps the current configuration to a file. 7,Gets a random generator from the config or, ? if not present, generates one and updates the config with it. /01234567config name of the generator >? /01234567 /01234567 /01234567>? Safe-Infered8?Animation is a list of frame modifications to play one by one, G where each modification if a map from locations to level map symbols. 97The data sufficent to draw a single game screen frame. ;$content of the screen, line by line <!an extra line to show at the top =$an extra line to show at the bottom B2Text attributes: foreground and backgroud colors. Dforeground colour Ebackgroud color F*Colours supported by the major frontends. W4The default colours, to optimize attribute setting. X4The default colours, to optimize attribute setting. Y6The default attribute, to optimize attribute setting. ZBA helper for the terminal frontends that display bright via bold. [IDue to the limitation of the curses library used in the curses frontend, # only these are legal backgrounds. \ATranslationg to heavily modified Linux console color RGB values. (89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\@AB%89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\%FVUTSRQPONMLKJIHGWXZ[\BCDEY>?@A9:;<=889:;<=>?@ABCDEFVUTSRQPONMLKJIHGWXYZ[\@AB  Safe-Infered ]The type of item flavours. ^&Turn a colour set into a flavour set. _&Turn a colour set into a flavour set. ` Colour sets. a Colour sets. b Colour sets. c#The standard full set of flavours. d-Get the underlying base colour of a flavour. e&Construct the full name of a flavour. ]^_`abcdeC ]^_`abcde ]^_`bacde ]^_`abcdeC  Safe-Inferedf$Queues implemented with two stacks. g"Create a new empty mutable queue. hCheck if the queue is empty. i$Remove all but the last written non-Nothing element of the queue. jTry reading a queue. Return Nothing if empty. k)Write to the queue. Faster than reading. fghijkfghijkfghijkfghijk Safe-InferedlBIf the condition fails, display the value blamed for the failure.  Used as in $ assert (c /= 0 `blame` c) $ 10 / c mLike D , but shows the source location @ and also the value to blame for the failure. To be used as in: D assert `failure` ((x1, y1), (x2, y2), "designate a vertical line") nLike @A:, 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]) oICheck that the value returned from a monad action satisfies a predicate. < Reports source location and the suspects. Drops the value. pLVerifies that the returned value is true (respectively, false). Used as in: K open newValve >>= assert `trueM` (newValve, "is already opened, not new") qLVerifies that the returned value is true (respectively, false). Used as in: K open newValve >>= assert `trueM` (newValve, "is already opened, not new") lmnopqlmnopqlmnopqlmnopq  Safe-Inferedr'2D points in cartesian representation. t*Spacial dimension for points and vectors. u*Spacial dimension for points and vectors. vHA list of all points on a straight vertical or straight horizontal line 3 between two points. Fails if no such line exists. wESort the sequence of two points, in the derived lexicographic order. x 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. rstuvwxErstuvwxutrsvwxrstuvwxE  Safe-InferedyIA screenful of text lines. When displayed, they are trimmed, not wrapped < and any lines below the lower screen edge are not visible. zThe history of reports. {=The type of a set of messages to show at the screen at once. |The type of a single message. }The "press something to see more" mark. ~"The confirmation request message. IAdd spaces at the message end, for display overlayed over the level map. - Also trims (does not wrap!) too long lines. 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. 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. 7Split an overlay into overlays that fit on the screen. 7Returns a function that looks up the characters in the : string by location. Takes the height of the display plus : the string. Returns also the message to print at the top > and number of screens required to display all of the string. yz{|}~FGyz{|}~|}~{zyyz{|}~FG  Safe-Infered(2D vectors in cartesian representation. Shift a point by a vector. 4Vectors of all unit moves in the chessboard metric, ! clockwise, starting north-west. IVectors of all cardinal direction unit moves, clockwise, starting north. 1The lenght of a vector in the chessboard metric,  where diagonal moves cost 1. &Squared euclidean length of a vector. Reverse an arbirary vector.  Safe-Infered =The type of areas. The bottom left and the top right points. >All (8 at most) closest neighbours of a point within an area. IAll (4 at most) cardinal direction neighbours of a point within an area. (Checks that a point belongs to an area. HSort the corners of an area so that the bottom left is the first point. GDivide uniformly a larger area into the given number of smaller areas.  Checks if it'#s an area with at least one field.  Checks if it'"s an area with exactly one field. EEnlarge (or shrink) the given area on all fours sides by the amount. limit the search to this area location to find neighbours of limit the search to this area location to find neighbours of  Safe-Infered >The type of locations 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. ? We do bounds check for the X size whenever we convert between % representations and each subsequent > array access 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 IntMap and cheaper array indexing, " including cheaper bounds checks.  We don't defin Point# as a newtype to avoid the trouble  with using EnumMap in place of IntMap, etc. 3Print a point as a tuple of cartesian coordinates. )Conversion from cartesian coordinates to Point. +The top-left corner location of the level. :The distance between two points in the chessboard metric. 2Checks whether two points are adjacent on the map + (horizontally, vertically or diagonally). CReturns the 8, or less, surrounding locations of a given location. EReturns the 4, or less, surrounding locations in cardinal directions  from a given location. (Checks that a point belongs to an area. >Calculate the displacement vector from a location 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.  Safe-Infered =2D vectors represented as offsets in the linear framebuffer  indexed by . 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. G E.g., for vectors of lenth 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. 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. ;Vectors of all unit moves, clockwise, starting north-west,  parameterized by level width. 5Squared euclidean distance between two unit vectors. 6Checks whether a unit vector is a diagonal direction,  as opposed to cardinal. Reverse an arbirary vector. FGiven two distinct locations, 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 loc1 (displacement loc1 loc2) == loc2 JParticularly simple and fast implementation in the linear representation. )A vector from a point to another. W have H H Safe-Infered +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. II Safe-Infered6Bindings and other information about player commands. binding keys to commands  macro map !major, most often used, commands &direction keys for moving and running 4Produce the macro map from a macro association list A taken from the config file. Macros cannot depend on each other. H The map is fully evaluated to catch errors in macro definitions early. 5Produce a set of help screens from the key bindings.  Safe-Infered 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  Safe-Infered!Calculates the list of tiles, in Bump# coordinates, visible from (0, 0),  within the given sight range. visiblity radius clear tile predicate  Safe-Infered!Calculates the list of tiles, in Bump# coordinates, visible from (0, 0). clear tile predicate  Safe-InferedIThe 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  Safe-Infered!The frequency distribution type. #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. +Leave only items that satisfy a predicate. 7Randomly choose an item according to the distribution. -Test if the frequency distribution is empty. JKL JKL Safe-InferedFractional 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. @Get a random object within a range with a uniform distribution. 2Get any element of a list with equal probability. 6Gen an element according to a frequency distribution. Roll a single die. Roll dice and sum the results. Maximal value of dice. Minimal value of dice. Mean value of dice. Roll the two sets of dice. +Roll dice scaled with current level depth. C Note that at the first level, the scaled dice are always ignored. 5Roll dice scaled with current level depth and return True $ if the results if greater than 50.  Generate a RollDeep' that always gives a constant integer. Maximal value of scaled dice. Give True/, with probability determined by the fraction. MNMN Safe-Infered>All possible effects, some of them parameterized or dependent , on outside coefficients, e.g., item power. LSuffix to append to a basic content name, if the content causes the effect. JHow much AI benefits from applying the effect. Multipllied by item power. H Negative means harm to the enemy when thrown at him. Effects with zero  benefit won'0t ever be used, neither actively nor passively.                       Safe-InferedLAll possible terrain tile features, some of them parameterized or dependent ; on outside coefficients, e.g., on the tile secrecy value. 4discovering the secret will require this many turns -used for distinct paths throughout the level $is a (not hidden) door, stair, etc. (items and stairs can be generated there 'sustains the effect continuously, TODO is lit with an ambient shine actors can see through actors can walk through 4transitions to any tile of the group when triggered !causes the effect when triggered triggered when the tile's secrecy becomes zero triggered by closing triggered by opening triggered by descending  triggered by ascending      Safe-Infered!(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.). !"#$%&'() !"#$%&'() !"#$%&'()!"#$%&'() Safe-Infered *3The 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 location is accessible from another. 9 Precondition: the two locations are next to each other. , a symbol -short description .frequency within groups 0the title of the game 1the path to data files 2the version of the game 3symbols of melee weapons 4 symbols of items AI can project 5DNo specific possible problems for the content of this kind, so far, N so the validation function always returns the empty list of offending kinds. OA dummy instance of the P' 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. *+,-./012345O *+,-./012345 *+,-./012345* +,-./012345O Safe-Infered 6<Actor properties that are fixed for a given kind of actors. 8 map symbol 9short description :frequency within groups ; map color <natural speed in m/s =encodes initial and maximal hp > can it see? ?can it smell? @ intelligence A#number of turns to regenerate 1 HP BIFilter a list of kinds, passing through only the incorrect ones, if any. :Make sure actor kinds can be told apart on the level map. 6789:;<=>?@AB 6789:;<=>?@AB 6789:;<=>?@AB6 789:;<=>?@AB Safe-Infered C:Item properties that are fixed for a given kind of items. E map symbol F generic name Gfrequency within groups Hpossible flavours Ithe effect when activated Jcreated in that quantify Kcreated with that power L*the verb for applying and possibly combat Mthe verb for projecting Nweight in grams O)percentage bonus or malus to throw speed PDNo specific possible problems for the content of this kind, so far, N so the validation function always returns the empty list of offending kinds. CDEFGHIJKLMNOPCDEFGHIJKLMNOPCDEFGHIJKLMNOPC DEFGHIJKLMNOP Safe-InferedQ5The coordinates of consecutive fields of a corridor. R$Pick a random point within an area. S4Create a random room according to given parameters. T/Create a void room, i.e., a single point area. UHPick a subset of connections between adjacent areas within a grid until B there is only one connected component in the graph of all areas. VFPick a single random connection between adjacent areas within a grid. W+Try to connect two places with a corridor. H Choose entrances at least 4 tiles distant from the edges, if possible. QRS minimum size )the containing area, not the room itself T$the area in which to pick the point UVWQRSTUVWRSTUVQWQRSTUVW  Safe-InferedX1Parameters for the generation of dungeon levels. Z 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 athe chance a place is dark b"a proportion of extra connections c#the chance of not creating a place d%extra places, may overlap except two e minimal distance between stairs f#the chance of a door in an opening gif there's a door, is it open? hif not open, is it hidden? i the number of items in the cave j!the default cave tile group name k"the cave corridor tile group name lthe filler wall group name m'the dark place plan legend ground name n&the lit place plan legend ground name othe hidden tiles ground name pIFilter 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. XYZ[\]^_`abcdefghijklmnopXYZ[\]^_`abcdefghijklmnopXYZ[\]^_`abcdefghijklmnopXYZ[\]^_`abcdefghijklmnop! Safe-InferedqArrays, indexed by type i$ of content identifiers pointing to  content type c+, where the identifiers are represented as Word8  (and so content of type c! can have at most 256 elements). r5Operations for all content types, gathered together. z+Content operations for the content of type a. |&the symbol of a content element at id }$the name of a content element at id ~ the content element at given id the id of the unique member of  a singleton content group &pick a random id belonging to a group  and satisfying a predicate "fold over all content elements of a !bounds of identifiers of content a auxiliary speedup components :Type family for auxiliary data structures for speeding up  content operations. )Content identifiers for the content type c. #Create content operations for type a from definition of content  of type a. 0The standard ruleset used for level operations. "Content identifiers array lookup. IConstruct a content identifiers array updated with the association list. <Create a content identifiers array from a list of elements. =Create a content identifiers array from an association list. "Content identifiers array bounds. "qrstuvwxyz{|}~QRSTUVqrstuvwxyz{|}~QRSz{|}~rstuvwxyqqrstuvwxyz {|}~TUV" Safe-Infered#The type of na actor target. /target current position of the cursor; default /target the list of locations one after another target a given location ,target an actor with its last seen location .A unique identifier of an actor in a dungeon. 8Actor properties that are changing throughout the game. ( If they are dublets of properties from  ActorKind, ; they are usually modified temporarily, but tend to return  to the original value from  ActorKind over time. E.g., HP. the kind of the actor individual map symbol individual name individual map color individual speed current hit points "direction and distance of running !target for ranged attacks and AI current location next inventory letter absolute time of next action !to which party the actor belongs The type of party identifiers. JAll supported party identifiers. Animals and projectiles move every turn.  Projectiles don'3t recognize friends and foes, animals turn friedly + or hostile, depending on various factors. JAll supported party identifiers. Animals and projectiles move every turn.  Projectiles don'3t recognize friends and foes, animals turn friedly + or hostile, depending on various factors. JAll supported party identifiers. Animals and projectiles move every turn.  Projectiles don'3t recognize friends and foes, animals turn friedly + or hostile, depending on various factors. JAll supported party identifiers. Animals and projectiles move every turn.  Projectiles don'3t recognize friends and foes, animals turn friedly + or hostile, depending on various factors. JAll supported party identifiers. Animals and projectiles move every turn.  Projectiles don'3t recognize friends and foes, animals turn friedly + or hostile, depending on various factors. JAll supported party identifiers. Animals and projectiles move every turn.  Projectiles don'3t recognize friends and foes, animals turn friedly + or hostile, depending on various factors. 0The list of parties that represent projectiles. =Find a hero name in the config file, or create a stock name. AChance 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. :A template for a new actor. The initial target is invalid  to force a reset ASAP. *Increment current hit points of an actor. 1Checks for the presence of actors in a location. ) Does not check if the tile is walkable. The unique kind of heroes.  The unique kind of projectiles. 5Access actor speed, individual or, otherwise, stock. 'WXY$$ WXY# Safe-Infered )Flavours assigned to items in this game. &The type of already discovered items. 8Game items in inventories or strewn around the dungeon. kind of the item power of the item inventory symbol inventory count Generate an item. Represent an item on the map. 0Price an item, taking count into consideration. ;Randomly chooses flavour for all item kinds for this game. +Assigns a letter to an item, for inclusion 0 in the inventory of a hero. Takes a remembered  letter and a starting letter. 6Adds an item to a list of items, joining equal items.  Also returns the joined item. ZZ$ Safe-Infered >The last time a hero left a smell in a given tile. To be used ! by monsters that hunt by smell. 5The time interval needed to discover a given secret, 3 e.g., a hidden terrain tile, e.g., a hidden door. +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. The player can' t tell one tile from the other. The player can'%t tell if the tile is hidden or not.    % Safe-Infered##A single, inhabited dungeon level. all actors on the level items belonging to actors width of the level height of the level smells secrecy values items on the ground  map tiles remembered map tiles !level description for the player 'debug information from cave generation %destination of the (up, down) stairs 'date of the last activity on the level Tile kinds on the map. /Actual and remembered item lists on map tiles. $Current secrecy value on map tiles. Current smell on map tiles. 6Items carried by actors, indexed by actor identifier. 6All actors on the level, indexed by actor identifier. "Update the hero and monster maps. .Update the hero items and monster items maps. Update the smell map. $Update the items on the ground map. *Update the tile and remembered tile maps. *Update the tile and remembered tile maps. 8Place all items on the list at a location on the level. 7Query for actual and remembered tile kinds on the map. 7Query for actual and remembered tile kinds on the map. 5Query for actual and remembered items on the ground. 5Query for actual and remembered items on the ground. 7Check whether one location is accessible from another, . using the formula from the standard ruleset. ACheck whether the location contains a door of secrecy lower than k ; and that can be opened according to the standard ruleset. :Find a random location on the map satisfying a predicate. 4Try to find a random location on the map satisfying , the conjunction of the list of predicates. 4 If the premitted 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. %the number of tries look up in this map predicates to satisfy [$$[& Safe-Infered :The complete dungeon is a map from level names to levels. 3Level ids are, for now, ordered linearly by depth. Depth of a level. !Default level for a given depth. :Create a dungeon from a list of levels and maximum depth. ' The depth is only a danger indicator; * there may potentially be multiple levels  with the same depth. /Association list corresponding to the dungeon. = Starts at the supplied level id (usually the current level) < to try to speed up the searches and keep the dungeon lazy.  Adjust the level at a given id.  Adjust the level at a given id.  Find a level with the given id. *Try to look up a level with the given id. Maximum depth of the dungeon. \]   \]' Safe-Infered Current result of the game. the player won game is supended ,the player lost the game on the given level 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  -Take care of saving a new score to the table + and return a list of messages to display.     ^_             ^_( Safe-Infered Field Of View scanning mode. )only feeling out adjacent tiles by touch "digital FOV with the given radius permissive FOV restrictive shadow casting @Perform a full scan for a given location. Returns the locations < 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.  %tile content, determines clear tiles scanning mode location of the spectacor the map that is scanned    ) Safe-Infered!%Current targeting cursor parameters. targeting mode  cursor level cursor coordinates $the level current player resides on $a parameter of the tgt digital line &Current targeting mode of the player. 8the mode was entered (and will be exited) automatically  /the player requested targeting mode explicitly !not in targeting mode ":The state of a single game that can be save and restored. 2 In practice, we maintain some extra state, but it's F temporary for a single turn or relevant only to the current session. $'represents the player-controlled actor %'cursor location and level to return to & association of flavour to items '(items (kinds) that have been discovered (all dungeon levels ) identifier of the current level *stores next actor index +current random generator , game config -'last command unexpectedly took no time .cause of game shutdown /debugging mode 0'The diary contains all the player data & that carries over from game to game. J That includes the last message, previous messages and otherwise recorded @ history of past games. This can be used for calculating player I achievements, unlocking advanced game features and general data mining. 4)Get current level from the dungeon data. 5(Get current time from the dungeon data. 6Initial player diary. 7Initial game state. 8'Update cursor parameters within state. 9Update time within state. :&Update item discoveries within state. ; Update level data within state. <"Update dungeon data within state. 0 !"#$%&'()*+,-./0123456789:;<=>`abc, !"#$%&'()*+,-./0123456789:;<=>,"#$%&'()*+,-./! 45789:;<01236=>! " #$%&'()*+,-./0123456789:;<=>`abc* Safe-Infered?7Save a simple serialized version of the current state. 3 Protected by a lock to avoid corrupting the file. @DRestore a saved game, if it exists. Initialize directory structure,  if needed. AGSave the diary and a backup of the save game file, in case of crashes. ? This is only a backup, so no problem is the game is shut down " before saving finishes, so we don't wait on the mvar. However, ? if a previous save is already in progress, we skip this save. B=Remove the backup of the savegame and save the player diary. ; Should be called before any non-error exit from the game. 0 Sometimes the backup file does not exist and it's OK.  We don'9t bother reporting any other removal exceptions, either, 4 because the backup file is relatively unimportant. N We wait on the mvar, because saving the diary at game shutdown is important. ?@AB?@AB?@BA?@AB+ Safe-Infered CThe grammatical object type. DThe type of verbs. FCapitalize a string. GAdd the indefinite article (a, an ) to a word (h is too hard). H:How to refer to an item in object position of a sentence. A If cheating is allowed, full identity of the object is revealed 7 together with its flavour (e.g. at game over screen). I:How to refer to an item in object position of a sentence. J;How to refer to an actor in object position of a sentence. KCapitalized actor object. LSentences such as "Dog barks loudly." MSentences such as "Dog quaffs a red potion fast." NSentences such as "Dog bites goblin furiously." OSentences such as "!Dog gulps down a red potion fast." PFProduces a textual description of the terrain and items at an already 0 explored location. Mute for unknown locations. 8 The detailed variant is for use in the targeting mode. CDEFGHIJKLMNOP game content  detailed? can be seen right now?  game state current level location to describe an extra sentence to print CDEFGHIJKLMNOPDCFEGHIJKLMNOPCDEFGHIJKLMNOP, Safe-InferedQ6Checks whether an actor identifier represents a hero. R9Checks whether an actor identifier represents a monster. SHow long until an actor's smell vanishes from a tile. T6Finds an actor body on any level. Fails if not found. UBTries to finds an actor body satisfying a predicate on any level. XCThe list of actors and their levels for all heroes in the dungeon. \ Calculate the location of player' s target. ]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 <- gets (memActor a) ^<Gets actor body from the current level. Error if not found. _ Gets actor':s items from the current level. Empty list, if not found. `7Removes the actor, if present, from the current level. a Add actor to the current level. b)Removes a player from the current level. lJFinds an actor at a location on the current level. Perception irrelevant. oCalculate loot')s worth for heroes on the current level. qECreate a new hero on the current level, close to the given location. rGCreate a set of initial heroes on the current level, at location ploc. s7Create a new monster in the level, at a given position % and with a given actor kind and HP. t8Create a projectile actor containing the given missile. $QRSTUVWXYZ[\]^_`abcdefghijklmnopqrst$QRSTUVWXYZ[\]^_`abcdefghijklmnopqrst$QRSTUVWXYZ[\]^_`abcgfedhkjilmnopqrst$QRSTUVWXYZ[\]^_`abcdefghijklmnopqrst- Safe-InfereduAThe type representing the perception of all actors on the level. CNote: Heroes share visibility and only have separate reachability. G The pplayer field must be void on all levels except where he resides. C Right now, the field is used only for player-controlled monsters. vDThe type representing the perception for all levels in the dungeon. w/The set of tiles visible by at least one hero. x+For debug only: the set of tiles reachable 1 (would be visible if lit) by at least one hero. y?Check whether a location is within the visually reachable area - of the given actor (disregarding lighting). L Defaults to false if the actor is not player-controlled (monster or hero). z=Check whether an actor is within the visually reachable area - of the given actor (disregarding lighting). / Not quite correct if FOV not symmetric (e.g., Shadow). : Defaults to false if neither actor is player-controlled. {"Whether a monster can see a hero (False if the target has D no perceptions, e.g., not a hero or a hero without perception, due K to being spawned on the same turn by a monster and then seen by another). ; An approximation, to avoid computing FOV for the monster. |5Calculate the perception of all actors on the level. uvwxyz{|uvwxyz{|vuwx|yz{uvwxyz{|. Safe-Infered}Color 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. 6Render animations on top of the current screen frame. }~}~}~}~/ Safe-InferedEThe 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  cdefaultTile. 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. -Given a few parameters, roll and construct a  datastructure + and fill a cave section acccording to it. <Construct a fence around an area, with the given tile kind. 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 d  d0 Safe-Infered 6The type of caves (not yet inhabited dungeon levels). the kind of the cave tile kinds in the cave secrecy strength of cave tiles starting items in the cave !debug information about 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. 9The map of starting secrecy strength of tiles in a cave. B The map is sparse. Unspecified tiles have secrecy strength of 0. !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  cdefaultTile. @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  1 Safe-Infered1Freshly generated and not yet populated dungeon. starting level for the party  starting location for the party  level maps %Generate the dungeon for a new game. ACompute the level identifier and starting location on the level,  after a level change.  game state jump this many levels 6target level and the location of its receiving stairs 2 Safe-Infered7A strategy is a choice of (non-empty) frequency tables  of possible actions. FStrategy where only the actions from the given single frequency table  can be picked. 9Strategy with the actions from both argument strategies,  with original frequencies. !Strategy with no actions at all. !Conditionally accepted strategy. @Strategy with all actions not satisfying the predicate removed. E The remaining action keep their original relative frequency values. eEStrategy is a monad. TODO: Can we write this as a monad transformer? fefe3 Safe-Infered)Session data maintained by the frontend. The name of the frontend. CSpawns the gtk input and output thread, which spawns all the other C required threads. We create a separate thread for gtk to minimize H communication with the heavy main thread. The other threads have to be 5 spawned after gtk is initialized, because they call  postGUIAsync,  and need sview and stags. !Shuts down the frontend cleanly. Add a frame to be drawn. >Input key via the frontend. Fail if there is no frame to show - to the player as a prompt for the keypress. CDisplay a prompt, wait for any of the specified keys (for any key, > if the list is empty). Repeat if an unexpected key received. 1 Starts in Push or None mode, stop in None mode. B Spends most time waiting for a key, so not performance critical,  so does not need optimization. 4 Safe-InferedPush a frame or a single frame'%s worth of delay to the frame queue. 5 Safe-Infered/CThe constant session information, not saved to the game save file. frontend session information  game content binding of keys to commands 7Actions and screen frames, including delays, resulting  from performing the actions. AActions of player-controlled characters and of any other actors. ,The type of the function inside any action.  (Separated from the Action/ type to document each argument with haddock.) =Run an action, with a given session, state and diary, in the IO monad. GInvoke pseudo-random computation with the generator kept in the state. 5Return the value with an empty set of screen frames. As the when monad operation, but on type ActionFrame (). /Inject action into actions with screen frames. Get the content operations. Get the key binding. DReset the state and resume from the last backup point, i.e., invoke  the failure continuation. Abort with the given message. 8Abort and print the given msg if the condition is true. 1Abort and conditionally print the fixed message. BSet the current exception handler. First argument is the handler, 4 second is the computation the handler scopes over. :Set the current exception handler. Apart of executing it, = draw and pass along a frame with the abort message, if any. @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. 6Try the given computation and silently catch failure, ' returning empty set of screen frames. Get the current diary. %Add a message to the current report. 6Store current report in the history and reset report. Wait for a player command. Wait for a player keypress. ,A series of confirmations for all overlays. 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. 0Print a msg and several overlays, one per page. ) All frames require confirmations. Raise abort if the players presses ESC. 0Print a msg and several overlays, one per page. 0 The last frame does not expect a confirmation. >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). Push a frame or a single frame'%s worth of delay to the frame queue. ?Draw the current level. The prompt is displayed, but not added ; to history. The prompt is appended to the current message E and only the first screenful of the resulting overlay is displayed. ?Initialize perception, etc., display level and run the action. Update player memory. /Update player at the given list of locations.. Get the current perception. ;Update actor stats. Works for actors on other levels, too. &Update player-controlled actor stats. #Obtains the current date and time. GSave the diary and a backup of the save game file, in case of crashes. See A. +Dumps the current configuration to a file. See 6. ?End the game, shutting down the frontend. The boolean argument H tells if ending screens should be shown, the other arguments describes  the cause of shutdown.  Debugging. 4session setup data cached perception  continuation failure/reset continuation current state current diary ghij000ghij6 Safe-Infered JThe source actor affects the target actor, with a given effect and power. < The second argument is verbosity of the resulting message. A Both actors are on the current level and can be the same actor. F The first bool result indicates if the effect was spectacular enough F for the actors to identify it (and the item that caused it, if any). H The second bool tells if the effect was seen by or affected the party. AThe boolean part of the result says if the ation was interesting 6 and the string part describes how the target reacted  (not what the source did). Change level and reset it'+s time and update the times of all actors.  The player may be added to lactor of the new level only after  this operation is executed. The player leaves the dungeon. >The source actor affects the target actor, with a given item. 4 If the event is seen, the item may get identified. #Make the item known to the player. )Make the actor controlled by the player. ? Focus on the actor if level changes. False, if nothing to do. HRemove dead heroes (or dead dominated monsters). Check if game is over. ? For now we only check the selected hero and at current level, ' but if poison, etc. is implemented, we'd need to check all heroes  on any level. 4End game, showing the ending screens, if requested. 7Create a list of item names, split into many overlays. ;Perform look around in the current location of the cursor. 7 Safe-Infered.Guess and report why the bump command failed. 0Player tries to trigger a tile using a feature. 4Perform the action specified for the tile in case it' s triggered. 5Ask for a direction and trigger a tile, if possible. 5Player tries to trigger a tile in a given direction. #Player tries to trigger the tile he's standing on. EAn actor opens a door: player (hero or controlled monster) or enemy. :Change the displayed level in targeting mode to (at most) C k levels shallower. Enters targeting mode, if not already in one. GSwitches current hero to the next hero on the level, if any, wrapping. % We cycle through at most 10 heroes (@ , 0--9). Search for hidden doors. 8This function performs a move (or attack) by any actor, 0 i.e., it can handle monsters, heroes and both. BResolves the result of an actor moving into another. Usually this C involves melee attack, but with two heroes it just changes focus. G Actors on blocked locations can be attacked without any restrictions. + For instance, an actor embedded in a wall , can be attacked from an adjacent position. ? This function is analogous to projectGroupItem, but for melee  and not using up the weapon. DResolves the result of an actor running (not walking) into another. 6 This involves switching positions of the two actors. 9Create a new monster in the level, at a random position. Generate a monster, possibly. <Possibly regenerate HP for all actors on the current level.  Display command help.  EAdd new smell traces to the level. Only humans leave a strong scent. allow attacks? who' s moving? in which direction?                     8 Safe-Infered?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. 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. 9 Safe-InferedDisplay inventory 8Let the 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. AStart the monster targeting mode. Cycle between monster targets. KStart the floor targeting mode or reset the cursor location to the player. .Set, activate and display cursor information.  Tweak the eps* parameter of the targeting digital line. ;End targeting mode, accepting the current location or not. !=Cancel something, e.g., targeting mode, resetting the cursor B to the position of the player. Chosen target is not invalidated. "EAccept something, e.g., targeting mode, keeping cursor where it was. < Or perform the default action, if nothing needs accepting. #Drop a single item. %Remove given item from an actor's inventory or floor. H TODO: this is subtly wrong: if identical items are on the floor and in J inventory, the floor one will be chosen, regardless of player intention. E TODO: right now it ugly hacks (with the ploc) around removing items  of dead heros/5monsters. The subtle incorrectness helps here a lot, C because items of dead heroes land on the floor, so we use them up 9 in inventory, but remove them after use from the floor. &?Remove given item from the given location. Tell if successful. *5Let the player choose any item from a list of items. +5Let the player choose a single, preferably suitable,  item from a list of items. all objects in question name of the group accepted item symbols prompt *how to refer to the collection of objects .actor applying the item (is on current level) how the applying is called the item to be applied .actor projecting the item (is on current lvl) "target location of the projectile how the projecting is called the item to be projected  !"#$%&'()*prompt all items in question (how to refer to the collection of items +prompt message !which items to consider suitable how to describe suitable items all items in question (how to refer to the collection of items  !"#$%&'()*+ !"#$%&'()*+ !"#$%&'()*+: Safe-Infered,IAbstract syntax of player commands. The type is abstract, but the values I are created outside this module via the Read class (from config file) . -7Major commands land on the first page of command help. .@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). /1The semantics of player commands in terms of the Action monad. 0 Description of player commands. ,-./0,-./0,-./0,-./0; Safe-Infered19Binding of keys to movement and other standard commands, 1 as well as commands defined in the config file. 1 game config semantics of abstract commands !description of abstract commands concrete binding 111< Safe-Infered2FMonster AI strategy based on monster sight, smell, intelligence, etc. 3 A strategy to always just wait. 23232323= Safe-Infered4<Start a clip (a part of a turn for which one or more frames 0 will be generated). Do whatever has to be done = every fixed number of time units, e.g., monster generation. ( Run the player and other actors moves. ) Eventually advance the time and repeat. 4444> Safe-Infered52Either restore a saved game, or setup a new game.  Then call the main game loop. 5555kBCDEFGHIJKLMNOPQRRSTUVWXYZZ[\]^_`abcdefghijklmnopqrstuvwxyz{{|}~                     !"#$%&'()**++,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYYZ[\]^_`aabcdefghijkllmnopqrstuvwxxyz{|}~                         !!!!!!!!!!!!!!!!!!!!!!!!!!!!""""""""""""""""""""""""""""""""""""#########################$$$$$$$$$%%%%%%%%% % % % % %%%%%%%%%%%%%%%%%%% %!%"%#%$&%&&&'&(&)&*&+&,&&-&.'/'0'1'2'3'3'4'5'6'7'8(9(:(;(<(=(>)?)?)@)A)B)B)C)D)E)F)G)H)I)J)K)L)L)M)N)O)P)Q)R)S)T)U)V)W)X)Y)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,{,|,},~,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--------.....////////////00000000000011111112222222233333334555555555555555555555555555555555555555555555i55566666666 6 6 6 6 6666666777777777777 7!7"7#7$7%7&7'7(7)7*7+7,7-7.8/809192939495969798999:9;9<9=9>9?9@9A9B9C9D9E9F9G9H9I9J9K9L:M:N:O:P:Q;R<S<T=U>V?W?X?Y?Z?[?\]^_`abc dBef g h ijklmnopqBrs!t!u!v!w!x!y"z"{"|#}%~&&''))))/225555LambdaHack-0.2.1Game.LambdaHack.Utils.AssertGame.LambdaHack.Utils.FileGame.LambdaHack.Misc!Game.LambdaHack.Content.PlaceKindGame.LambdaHack.ContentGame.LambdaHack.TimeGame.LambdaHack.ConfigGame.LambdaHack.ColorGame.LambdaHack.FlavourGame.LambdaHack.Utils.LQueueGame.LambdaHack.PointXYGame.LambdaHack.MsgGame.LambdaHack.VectorXYGame.LambdaHack.AreaGame.LambdaHack.PointGame.LambdaHack.VectorGame.LambdaHack.KeyGame.LambdaHack.BindingGame.LambdaHack.FOV.CommonGame.LambdaHack.FOV.DigitalGame.LambdaHack.FOV.PermissiveGame.LambdaHack.FOV.ShadowGame.LambdaHack.Utils.FrequencyGame.LambdaHack.RandomGame.LambdaHack.EffectGame.LambdaHack.Feature Game.LambdaHack.Content.TileKind Game.LambdaHack.Content.RuleKind!Game.LambdaHack.Content.ActorKind Game.LambdaHack.Content.ItemKindGame.LambdaHack.AreaRnd Game.LambdaHack.Content.CaveKindGame.LambdaHack.KindGame.LambdaHack.ActorGame.LambdaHack.ItemGame.LambdaHack.TileGame.LambdaHack.LevelGame.LambdaHack.DungeonGame.LambdaHack.HighScoreGame.LambdaHack.FOVGame.LambdaHack.StateGame.LambdaHack.SaveGame.LambdaHack.GrammarGame.LambdaHack.ActorStateGame.LambdaHack.PerceptionGame.LambdaHack.DrawGame.LambdaHack.PlaceGame.LambdaHack.CaveGame.LambdaHack.DungeonStateGame.LambdaHack.StrategyGame.LambdaHack.Display.GtkGame.LambdaHack.DisplayGame.LambdaHack.ActionGame.LambdaHack.EffectActionGame.LambdaHack.ActionsGame.LambdaHack.RunningGame.LambdaHack.ItemActionGame.LambdaHack.CommandGame.LambdaHack.BindingActionGame.LambdaHack.StrategyActionGame.LambdaHack.TurnGame.LambdaHack.StartPaths_LambdaHackListallbaseGHC.Baseassert encodeEOFstrictDecodeEOFFreqsnormalLevelBounddivUpFenceFNoneFFloorFWallCoverCReflectCStretch CAlternate PlaceKindpsymbolpnamepfreqpcoverpfenceptopLeft pvalidateCDefs getSymbolgetNamegetFreqvalidatecontentSpeedTimetimeZerotimeCliptimeTurntimeAddtimeFit timeNegate timeScale timeToDigittoSpeed speedNormal speedScale ticksPerMetertraveledspeedFromWeightrangeFromSpeedCPmkConfig appDataDir getOptiongetgetItemsgetFiledump getSetGen Animation SingleFramesfLevelsfTopsfBottomAttrCharacAttracCharAttrfgbgColorBrWhiteBrCyan BrMagentaBrBlueBrYellowBrGreenBrRedBrBlackWhiteCyanMagentaBlueBrownGreenRedBlackdefBGdefFG defaultAttrisBrightlegalBG colorToRGBFlavourzipPlainzipFancydarkCol brightColstdColstdFlavflavourToColor flavourToNameLQueue newLQueue nullLQueue trimLQueue tryReadLQueue writeLQueueblamefailureallBcheckMtrueMfalseMPointXYYXfromTo sortPointXYblaXYOverlayHistoryReportMsgmoreMsgyesnoMsgpadMsg emptyReport nullReportsingletonReportaddMsg splitReport renderReport emptyHistorysingletonHistory renderHistory addReport takeHistory splitOverlaystringByLocationVectorXYshiftXYmovesXYmovesCardinalXY chessDistXYeuclidDistSqXYnegXYArea vicinityXYvicinityCardinalXYinsideXY normalizeAreagrid validArea trivialAreaexpandPoint showPointtoPointorigin chessDistadjacentvicinityvicinityCardinalinsidedisplacementXYZblaVectortoVectorshift shiftBoundedmoves movesWidth euclidDistSqdiagonalnegtowards displacement displacePathModifier NoModifierControlKeyUnknownCharKPHomeBeginEndDownUpRightLeftPgDnPgUpTabSpaceReturnEscshowKM dirAllMoveKey handleDir moveBinding keyTranslateBindingkcmdkmacrokmajorkdirmacroKeykeyHelp EdgeIntervalEdge ConvexHullLineBumpBProgressDistancemaximalsteeperaddHullscanIntervalSBump Frequency runFrequency uniformFreqtoFreq scaleFreq filterFreqrollFreqnullFreqChanceRollDeep RollDiceXYRollDiceRndrandomRoneOf frequencyrollrollDicemaxDiceminDicemeanDice rollDiceXYrollDeep chanceDeep intToDeepmaxDeepchanceEffectDescendAscend Searching Regeneration ApplyPerfume SummonEnemy SummonFriendDominateWoundHealNoEffecteffectToSuffixeffectToBenefitFeatureSecretPathExitBoringAuraLitClearWalkableChangeToCauseHiddenClosableOpenable Descendable AscendableTileKindtsymboltnametfreqtcolortcolor2tfeature tvalidateRuleKindrsymbolrnamerfreq raccessiblertitlerpathsDataFile rpathsVersion ritemMelee ritemProject ruvalidate ActorKindasymbolanameafreqacoloraspeedahpasightasmellaiqaregen avalidateItemKindisymbolinameifreqiflavourieffecticountipower iverbApply iverbProjectiweightitoThrow ivalidateCorridorxyInAreamkRoom mkVoidRoom connectGridrandomConnection connectPlacesCaveKindcsymbolcnamecfreqcxsizecysizecgrid cminPlaceSize cdarkChance cauxConnects cvoidChance cnonVoidMin cminStairDist cdoorChance copenChance chiddenChancecitemNum cdefaultTile ccorridorTile cfillerTilecdarkLegendTileclitLegendTile chiddenTile cvalidateArrayCOpscoactorcocavecoitemcoplacecorulecotileOpsosymbolonameokind ouniqGroupopick ofoldrWithKeyoboundsospeedupSpeedupId createOps stdRuleset!// listArrayarrayboundsTargetTCursorTPathTLocTEnemyActorIdActorbkindbsymbolbnamebcolorbspeedbhpbdirbtargetblocbletterbtimebpartyPartyId heroParty enemyParty animalPartyheroProjectilesenemyProjectilesanimalProjectilesallProjectiles findHeroNamemonsterGenChancetemplateaddHp unoccupied heroKindIdprojectileKindId actorSpeed FlavourMap DiscoveriesItemjkindjpowerjletterjcountnewItemviewItem itemPricedungeonFlavourMap getFlavour assignLettercmpLetterMaybe maxLetter letterRange letterLabeljoinItemequalItemIdentityremoveItemByIdentityremoveItemByLetterstrongestSearchstrongestSwordstrongestRegen SmellTime SecretTimekindHasFeaturekindHas hasFeatureisClearisLitsimilar canBeHiddenLevellactorlinvlxsizelysizelsmelllsecretlitemlmaplrmapldesclmetalstairsltimeTileMapItemMap SecretMapSmellMapInvDict ActorDictupdateActorDict updateInv updateSmell updateIMap updateLMap updateLRMap dropItemsAtat rememberAtatI rememberAtI accessibleopenablefindLoc findLocTryDungeonLevelId levelNumber levelDefaultfromList currentFirstadjust mapDungeonlookupdepthStatusVictorCampingKilled ScoreRecordpointsnegTimedatestatusregisterFovModeBlindDigital PermissiveShadowfullscan DebugMode smarkVision somniscientCursor ctargetingclocLn clocation creturnLncepsTgtModeTgtAuto TgtExplicitTgtOffStatesplayerscursorsflavoursdiscosdungeonslidscountersrandomsconfigsnoTimesquitsdebugDiarysreportshistoryslevelstime defaultDiary defaultState updateCursor updateTimeupdateDiscoveries updateLevel updateDungeoncycleMarkVisiontoggleOmniscient saveGameFile restoreGame saveGameBkprmBkpSaveDiaryObjectVerb pluralise capitalize addIndefiniteobjectItemCheat objectItem objectActorcapActor actorVerb actorVerbItemactorVerbActoractorVerbExtraItemlookAtisAHero isAMonster smellTimeoutfindActorAnyLevel tryFindActor getPlayerBody getPlayerItemallHeroesAnyLevelupdateAnyActorBodyupdateAnyActorItemupdateAnyLevel targetToLocmemActorgetActor getActorItem deleteActor insertActor deletePlayer heroAssocs hostileAssocsdangerousAssocsfriendlyAssocsallButHeroesAssocsheroList hostileList dangerousList friendlyList locToActor locToActors nearbyFreeLoccalculateTotal tryFindHeroKaddHero initialHeroes addMonster addProjectile PerceptionDungeonPerception totalVisibledebugTotalReachableactorReachesLocactorReachesActormonsterSeesHerodungeonPerception ColorModeColorBW ColorFulldrawanimate TileMapXYPlaceqkindqareaqseenqlegend qsolidFence qhollowFence placeValid buildPlace buildFenceCavedkinddmapdsecretditemdmetadplaces ItemMapXY SecretMapXY buildCave FreshDungeon entryLevelentryLoc freshDungeongeneratewhereToStrategy runStrategy liftFrequency.|reject.=>onlyFrontendSession frontendNamestartupshutdowndisplay nextEvent promptGetKey displayFrameSessionsfsscopsskeyb ActionFrameAction ActionFun handlerToIO rndToAction returnNoFrame whenFrameinFramegetCOps getBindingabort abortWith abortIfWith neverMindtryWith tryWithFrametryRepeatedlyWith tryIgnoretryIgnoreFramegetDiarymsgAdd recordHistory getKeyCommand getKeyChoicegetOverConfirm displayMore displayYesNodisplayOverAbortdisplayOverlaysdisplayChoiceUIdisplayFramePush drawPrompt startClipremember rememberList getPerceptionupdateAnyActorupdatePlayerBody currentDatedumpCfgshutGamedebugeffectToActioneff nullEffect squashActor effLvlGoUp switchLevel fleeDungeonitemEffectActiondiscover selectPlayer focusIfOurs summonHeroessummonMonsterscheckPartyDeathgameOver itemOverlay stopRunningdoLook gameVersionsaveGamequitGame moveCursormove ifRunning guessBumpbumpTile triggerTileplayerTriggerDir playerBumpDirplayerTriggerTile actorOpenDoor tgtAscend cycleHerosearch moveOrAttackactorAttackActor actorRunActor rollMonstergenerateMonsterregenerateLevelHP displayHelpdisplayHistory dumpConfigredrawaddSmellrun continueRunItemDialogStateIAll ISuitableINone inventory getGroupItemapplyGroupItemplayerApplyGroupItemprojectGroupItemplayerProjectGroupItemplayerProjectGI targetMonster targetFloor setCursorepsIncr endTargetingendTargetingMsg cancelCurrent acceptCurrentdropItemremoveOnlyFromInventoryremoveFromInventory removeFromLocactorPickupItem pickupItemallObjectsName getAnyItemgetItemCmdmajorCmdtimedCmd cmdSemanticscmdDescription stdBindingstrategywait handleTurnstartversion getBinDir getLibDir getDataDir getLibexecDirgetDataFileName $fBinarySpeed $fBinaryTime$fShowCP $fBinaryCP$fBinaryAttrChar $fBinaryAttr $fBinaryColor$fBinaryFlavourGHC.Err undefined $fShowPointXY$fBinaryHistory$fBinaryReport$fBinaryVector $fShowKey$fFunctorFrequency$fMonadPlusFrequency$fMonadFrequency$fReadRollDice$fShowRollDice$fShowRuleKindGHC.ShowShow TileSpeedup isClearTabisLitTab $fBinaryArray $fShowCOps $fBinaryId$fBinaryTarget $fBinaryActor$fBinaryPartyId $fBinaryItem $fBinaryLevel$fBinaryDungeon$fBinaryLevelId$fBinaryScoreRecord$fBinaryStatus$fBinaryTgtMode$fBinaryCursor $fBinaryState $fBinaryDiary $fBinaryPlace$fMonadStrategy$fMonadPlusStrategy$fMonadStateStateAction$fFunctorAction $fMonadAction $fShowAction