h*n6(      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!""""""""""""""""""########################################################################$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''''''''''''''''''''''''(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))******************************************++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,----------------------.......................................//000000000000111111111111111111111111111112222222222222334444444444444444444444444444444556666666666666666666666677777889999999999999999999999:;;;;;;;;;;;;;;;;;;;;;;<<<<<<<<<<=====>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>??????????????????????????????????????????????????????????@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIJJJJJJJKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKLLLLLMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOPPQQRRRRRRRRRRRRRRRRRRRRRRRRRSSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVVVVVVVVVVVVVVVVVVVWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWXXXXXXXXYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZ[[[[[[[[[[[\\\\\\\\\\\\\\\\\\\\\]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]^^^^^_____________```````````````aaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddeeeeeeeeeffffgggggggggggghhhhhhhhhhhhhhhhh h h i i i i i i i i j j j j j j j j k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l m m m m m m m m!m!m!m!m!m!m!m!m!m!m!m!m!m!m!m!n!n!n!n!n!n!n!n!n!n!n!n!n!n!n!n!n!o!o!o!o!o!o!o!o!o!o!o!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!p!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q!q"q"q"q"q"q"q"q"q"q"q"q"q"q"q"q"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"s"t"t"t"t"t"t"t"t"t"t"t"t"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u"u#u#u#u#u#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#w#w#w#w#w#w#w#w#w#w#w#w#w#w#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#y#y#y#y#y#y#y#y#y#y#y#y#y#y#y#y#y#y#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{${${${${${${${${${${$|$|$|$|$|$|$|$|$|$|$}$}$}$}$}$}$}$}$}$}$}$}$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$~$$$$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''((((((((((((((((((((((((((((((0.11.0.1 Safe-Inferred"%&'3=j LambdaHackShow and pack the result. LambdaHackInteger division, rounding up. LambdaHackA version specialized to lists to avoid errors such as taking length of  Maybe [a] instead of [a]. Such errors are hard to detect, because the type of elements of the list is not constrained. LambdaHackA version specialized to lists to avoid errors such as taking null of  Maybe [a] instead of [a]. Such errors are hard to detect, because the type of elements of the list is not constrained. LambdaHack Re-exported , but please give it explicit type to make it obvious if wrapping, etc., may occur. Use  instead, if possible, because it fails instead of wrapping, etc. In general, it may wrap or otherwise lose information. LambdaHack Re-exported , but please give it explicit type to make it obvious if wrapping, etc., may occur and to trigger optimization. In general, it may crash. LambdaHackThis has a more specific type (unit result) than normally, to catch errors. LambdaHackThis has a more specific type (unit result) than normally, to catch errors.:HK<=>?FBNOPAIJD@3^%QR& 2*/\E.defghi;C) 0'S9 85$"#Vr,s+GLM6Y47(- 1[]cjklmntz{|}~opqU!WXZuvwxy((((((((_`abT:HK<=>?FBNOPAIJD@3^%QR& 2*/\E.defghi;C) 0'S9 85$"#Vr,s+GLM647(- 1[]cjklmntz{|}~,s+opq4U!WXZutvwxyY8_`abT74 Safe-Inferred"%&'39:;<=s] LambdaHackThe frequency distribution type. Not normalized (operations may or may not group the same elements and sum their frequencies). However, elements with less than zero frequency are removed upon construction.The Eq instance compares raw representations, not relative, normalized frequencies, so operations don't need to preserve the expected equalities. LambdaHack"give acces to raw frequency values LambdaHack!short description for debug, etc. LambdaHack(Uniform discrete frequency distribution. LambdaHackTakes a name and a list of frequencies and items into the frequency distribution. LambdaHackScale frequency distribution, multiplying it by a positive integer constant. LambdaHack,Test if the frequency distribution is empty. Safe-Inferred"%&'3=y LambdaHackDice for rolling a pair of integer parameters pertaining to, respectively, the X and Y cartesian 2D coordinates. LambdaHackAbsolute depth in the dungeon. When used for the maximum depth of the whole dungeon, this can be different than dungeon size, e.g., when the dungeon is branched, and it can even be different than the length of the longest branch, if levels at some depths are missing. LambdaHackMultiple dice rolls, some scaled with current level depth, in which case the sum of all rolls is scaled in proportion to current depth divided by maximal dungeon depth.The simple dice should have positive number of rolls and number of sides.The Num instance doesn't have abs nor signum defined, because the functions for computing infimum, supremum and mean dice results would be too costly. LambdaHackCast dice scaled with current level depth. When scaling, we round up, so that the value of 1  1 is 13 even at the lowest level, but so is the value of 1  depth.The implementation calls RNG as many times as there are dice rolls, which is costly, so content should prefer to cast fewer dice and then multiply them by a constant. If rounded results are not desired (often they are, to limit the number of distinct item varieties in inventory), another dice may be added to the result.>A different possible implementation, with dice represented as  Frequency, makes only one RNG call per dice, but due to lists lengths proportional to the maximal value of the dice, it's is intractable for 1000d1000 and problematic already for 100d100. LambdaHack/A die, rolled the given number of times. E.g., 1  2 rolls 2-sided die one time. LambdaHackA die rolled the given number of times, with the result scaled with dungeon level depth. LambdaHackA die, starting from zero, ending at one less than second argument, rolled the given number of times. E.g., 1  1 always rolls zero. LambdaHackA die, starting from zero, ending at one less than second argument, rolled the given number of times, with the result scaled with dungeon level depth. LambdaHack/Minimal and maximal possible value of the dice.divUp& in the implementation corresponds to ceiling, applied to results of meanDice elsewhere in the code, and prevents treating 1d1-power effects (on shallow levels) as null effects. LambdaHackMaximal value of dice. The scaled part taken assuming median level. LambdaHackMinimal value of dice. The scaled part taken assuming median level. LambdaHackMean value of dice. The scaled part taken assuming median level, but not taking into account rounding up, and so too low, especially for dice small compared to depth. To fix this, depth would need to be taken as argument. LambdaHackMaximal value of DiceXY. LambdaHackMinimal value of DiceXY. Safe-Inferred"%&'3= Safe-Inferred"%&'3<= LambdaHack4Ring buffers of a size determined at initialization. Safe-Inferred"%&'3<=  LambdaHack8current libfreetype6 default, thin, large letter spacing LambdaHack9mimics OTF, blurry, thick, tight tracking, accurate shape LambdaHackfilename, size, hinting mode LambdaHackextra cell extension LambdaHack,size ignored for bitmap fonts and no hinting LambdaHackRe-exported English phrase creation functions, applied to our custom irregular word sets. LambdaHackRe-exported English phrase creation functions, applied to our custom irregular word sets. LambdaHack Apply the WWandW1 constructor, first representing repetitions as  CardinalWs. The parts are not sorted, only grouped, to keep the order. The internal structure of speech parts is compared, not their string rendering, so some coincidental clashes are avoided (and code is simpler). LambdaHackPersonal data directory for the game. Depends on the OS and the game, e.g., for LambdaHack under Linux it's ~/.LambdaHack/. LambdaHackMultiplies by a million. LambdaHack*Multiplies by a million, double precision. Safe-Inferred"%&'39=' LambdaHackSpeed in meters per 1 million seconds (m/Ms). Actors at normal speed (2 m/s) take one time turn (0.5 s) to make one step (move one tile, which is 1 m by 1 m). LambdaHackOne-dimentional vectors. Introduced to tell apart the 2 uses of Time: as an absolute game time and as an increment. LambdaHackGame time in ticks. The time dimension. One tick is 1 microsecond (one millionth of a second), one turn is 0.5 s. LambdaHack5Start of the game time, or zero lenght time interval. LambdaHackThe smallest unit of time. Should not be exported and used elsewhere, because the proportion of turn to tick is an implementation detail. The significance of this detail is only that it determines resolution of the time dimension. LambdaHackAn infinitesimal time period. LambdaHackAt least once per clip all moves are resolved and a frame or a frame delay is generated. Currently one clip is 0.05 s, but it may change, and the code should not depend on this fixed value. LambdaHackOne turn is 0.5 s. The code may depend on that. Actors at normal speed (2 m/s) take one turn to move one tile (1 m by 1 m). LambdaHack(This many ticks fits in a single second. LambdaHack'This many turns fit in a single second. LambdaHackThis many clips fit in one turn. Determines the resolution of actor move sampling and display updates. LambdaHackAbsolute time addition, e.g., for summing the total game session time from the times of individual games. LambdaHackAbsolute time negation. To be used for reversing time flow, e.g., for comparing absolute times in the reverse order. LambdaHackHow many time intervals of the latter kind fits in an interval of the former kind. LambdaHackHow many time intervals of the latter kind cover an interval of the former kind (rounded up). LambdaHack+Shifting an absolute time by a time vector. LambdaHackTime time vector between the second and the first absolute times. The arguments are in the same order as in the underlying scalar subtraction. LambdaHackAddition of time deltas. LambdaHackSubtraction of time deltas. The arguments are in the same order as in the underlying scalar subtraction. LambdaHackReverse a time vector. LambdaHackScale the time vector by an Int scalar value. LambdaHack*Take the given percent of the time vector. LambdaHackDivide a time vector. LambdaHackRepresent the main 10 thresholds of a time range by digits, given the total length of the time range. LambdaHack#Number of seconds in a mega-second. LambdaHack$Constructor for content definitions. LambdaHackReadable representation of speed in the format used in content definitions. LambdaHackPretty-print speed given in the format used in content definitions. LambdaHackThe minimal speed is half a meter (half a step across a tile) per second (two standard turns, which the time span during which projectile moves, unless it has modified linger value). This is four times slower than standard human movement speed.It needen't be lower, because rangeFromSpeed gives 0 steps with such speed, so the actor's trajectory is empty, so it drops down at once. Twice that speed already moves a normal projectile one step before it stops. It shouldn't be lower or a slow actor would incur such a time debt for performing a single action that he'd be paralyzed for many turns, e.g., leaving his dead body on the screen for very long. LambdaHackFast walk speed (2 m/s) that suffices to move one tile in one turn. LambdaHackLimp speed (1 m/s) that suffices to move one tile in two turns. This is the minimal speed for projectiles to fly just one space and drop. LambdaHackSword thrust speed (10 m/s). Base weapon damages, both melee and ranged, are given assuming this speed and ranged damage is modified accordingly when projectile speeds differ. Differences in melee weapon swing speeds are captured in damage bonuses instead, since many other factors influence total damage.Billiard ball is 25 m!s, sword swing at the tip is 35 ms, medieval bow is 70 ms, AK47 is 700 ms. LambdaHackModify damage when projectiles is at a non-standard speed. Energy and so damage is proportional to the square of speed, hence the formula. LambdaHackScale speed by a scalar value. LambdaHackSpeed addition. LambdaHackThe number of time ticks it takes to walk 1 meter at the given speed. LambdaHackCalculate projectile speed from item weight in grams and velocity percent modifier. See  =https://github.com/LambdaHack/LambdaHack/wiki/Item-statistics. LambdaHackCalculate maximum range in meters of a projectile from its speed. See  =https://github.com/LambdaHack/LambdaHack/wiki/Item-statistics. With this formula, each projectile flies for at most 1 second, that is 2 standard turns, and then drops to the ground. LambdaHackCalculate maximum range taking into account the linger percentage.-- Safe-Inferred"%&'3=( LambdaHackSerialize and save data. Note that LBS.writeFile opens the file in binary mode. LambdaHack;Serialize, compress and save data with an EOF marker. The OK is used as an EOF marker to ensure any apparent problems with corrupted files are reported to the user ASAP. LambdaHack?Read, decompress and deserialize data with an EOF marker. The OK EOF marker ensures any easily detectable file corruption is discovered and reported before any value is decoded from the second component and before the file handle is closed. OTOH, binary encoding corruption is not discovered until a version check elswere ensures that binary formats are compatible. LambdaHackTry to create a directory, if it doesn't exist. We catch exceptions in case many clients try to do the same thing at the same time. LambdaHackTry to write a file, given content, if the file not already there. We catch exceptions in case many clients and/or the server try to do the same thing at the same time. Using / to avoid UTF conflicts with OS or filesystem.( Safe-Inferred"%&'3=b  Safe-Inferred"%&'3<=0 LambdaHackOptions that affect the behaviour of the client (but not game rules). LambdaHack/Font set chosen by the player for the whole UI. LambdaHack6The scale applied to all fonts, resizing the whole UI. LambdaHack*Available fonts as defined in config file. LambdaHack.Available font sets as defined in config file. LambdaHack5Whether to start in fullscreen mode and in which one. LambdaHackHow much to log (e.g., from SDL). 1 is all, 5 is errors, the default. LambdaHackMaximal frames per second. This is better low and fixed, to avoid jerkiness and delays that tell the player there are many intelligent enemies on the level. That's better than scaling AI sofistication down based on the FPS setting and machine speed. LambdaHack8Never auto-answer all prompts, even if under AI control. LambdaHackDon't show any animations. LambdaHack,Start a new game, overwriting the save file. LambdaHack7Don't create directories and files and show time stats. LambdaHackDisplay messages in realistic was under AI control (e.g., for benchmarking). LambdaHack"Prefix of the save game file name. LambdaHack!Whether to use the ANSI frontend. LambdaHack)Whether to use the stdout/stdin frontend. LambdaHack/Whether to use null (no input/output) frontend. LambdaHack:Whether to use lazy (output not even calculated) frontend. LambdaHack&Show clients' internal debug messages. LambdaHack*Kinds of fullscreen or windowed mode. See  https://hackage.haskell.org/package/sdl2-2.5.3.0/docs/SDL-Video.html#t:WindowMode. LambdaHack%a normal window instead of fullscreen LambdaHackfake fullscreen; window the size of the desktop; this is the preferred one, if it works LambdaHack(real fullscreen with a video mode change LambdaHack Default value of client options.    Safe-Inferred"%&'3=C LambdaHackGenerate the standard textual representation for the tutorial hints.  Safe-Inferred"%&'39:;= LambdaHackA strategy is a choice of (non-empty) frequency tables of possible actions.Currently, the way we use it, the list could have at most one element (we filter out void frequencies early and only ever access the first). except for the argument of  mapStrategyM, which may even be process to the end of the list, if no earlier strategies can be transformed into non-null ones. LambdaHackStrategy where only the actions from the given single frequency table can be picked. LambdaHackStrategy with the actions from both argument strategies, with original frequencies. LambdaHack Strategy with no actions at all. LambdaHack Conditionally accepted strategy. LambdaHackStrategy with all actions not satisfying the predicate removed. The remaining actions keep their original relative frequency values. LambdaHackWhen better choices are towards the start of the list, this is the best frequency of the strategy. LambdaHackLike *, but pick a name of the single frequency.  23  Safe-Inferred"%&'3= LambdaHackFractional chance. LambdaHack6The monad of computations with random generator state. LambdaHackGet a random object within a (inclusive) range with a uniform distribution. LambdaHackGenerate random * in [0, x] range. LambdaHack$Generate a random integral value in [0, x] range, where x is within Int32.The limitation to Int32 values is needed to keep it working on signed types. In package random, a much more complex scheme is used to keep it working for arbitrary fixed number of bits. LambdaHack Get a random ( using full range. LambdaHack1Get any element of a list with equal probability. LambdaHackGenerates a random permutation. Naive, but good enough for small inputs. LambdaHackCode that means the information (e.g., flavour or hidden kind index) should be regenerated, because it could not be transferred from previous playthrough (it's random in each playthrough or there was no previous playthrough). LambdaHackGenerates a random permutation, except for the existing mapping. LambdaHack5Gen an element according to a frequency distribution. LambdaHack6Randomly choose an item according to the distribution. LambdaHackGive True., with probability determined by the fraction. LambdaHack*Cast dice scaled with current level depth. LambdaHack5Cast dice scaled with current level depth and return True$ if the results is greater than 50. LambdaHack= 02chessDist p1 p2 ^ (2 :: Int) <= euclidDistSq p1 p2 LambdaHack.Squared euclidean distance between two points. LambdaHackChecks whether two points are adjacent on the map (horizontally, vertically or diagonally). LambdaHack=Bresenham's 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 infinity. Gives Nothing1 if the points are equal. The target is given as Point, not PointI, to permit aiming out of the level, e.g., to get uniform distributions of directions for explosions close to the edge of the level.1bresenhamsLineAlgorithm 0 (Point 0 0) (Point 0 0)Nothingtake 3 $ fromJust $ bresenhamsLineAlgorithm 0 (Point 0 0) (Point 1 0)[(1,0),(2,0),(3,0)]take 3 $ fromJust $ bresenhamsLineAlgorithm 0 (Point 0 0) (Point 0 1)[(0,1),(0,2),(0,3)]take 3 $ fromJust $ bresenhamsLineAlgorithm 0 (Point 0 0) (Point 1 1)[(1,1),(2,2),(3,3)] LambdaHack=Bresenham's line algorithm generalized to arbitrary starting eps (eps value of 0 gives the standard BLA). Includes the source point and goes through the target point to infinity.?take 4 $ bresenhamsLineAlgorithmBegin 0 (Point 0 0) (Point 2 0)[(0,0),(1,0),(2,0),(3,0)] LambdaHackSee  http://roguebasin.roguelikedevelopment.org/index.php/index.php?title=Digital_lines. LambdaHackA list of all points on a straight vertical or straight horizontal line between two points. Fails if no such line exists.fromTo (Point 0 0) (Point 2 0)[(0,0),(1,0),(2,0)] LambdaHack'Checks that a point belongs to an area. Safe-Inferred"%&'3<= LambdaHackEnumeration representation of Vector. LambdaHack2D vectors in cartesian representation. Coordinates grow to the right and down, so that the (1, 1) vector points to the bottom-right corner of the screen. LambdaHack8Tells if a vector has length 1 in the chessboard metric. LambdaHackReverse an arbirary vector. LambdaHackThe lenght of a vector in the chessboard metric, where diagonal moves cost 1. LambdaHack/Squared euclidean distance between two vectors. LambdaHackVectors of all unit moves in the chessboard metric, clockwise, starting north-west. LambdaHackVectors of all cardinal direction unit moves, clockwise, starting north. LambdaHackVectors of all diagonal direction unit moves, clockwise, starting north. LambdaHack=All (8 at most) closest neighbours of a point within an area. LambdaHackAll (4 at most) cardinal direction neighbours of a point within an area. LambdaHackTranslate a point by a vector. LambdaHackTranslate a point by a vector, but only if the result fits in an area. LambdaHack1A list of points that a list of vectors leads to. LambdaHackA list of points that a list of vectors leads to, bounded by level size. LambdaHack:The vector between the second point and the first. We have -shift pos1 (pos2 `vectorToFrom` pos1) == pos2The arguments are in the same order as in the underlying scalar subtraction. LambdaHack+A list of vectors between a list of points. LambdaHackRotate a vector by the given angle (expressed in radians) counterclockwise and return a unit vector approximately in the resulting direction. LambdaHackGiven a vector of arbitrary non-zero length, produce a unit vector that points in the same direction (in the chessboard metric). Of several equally good directions it picks one of those that visually (in the euclidean metric) maximally align with the original vector. LambdaHackGiven two distinct positions, determine the direction (a unit vector) in which one should move from the first in order to get closer to the second. Ignores obstacles. Of several equally good directions (in the chessboard metric) it picks one of those that visually (in the euclidean metric) maximally align with the vector between the two points. LambdaHacklimit the search to this area LambdaHackposition to find neighbours of LambdaHacklimit the search to this area LambdaHackposition to find neighbours of"" Safe-Inferred"%&'3<= LambdaHackItem container type. LambdaHackfor bootstrapping actor bodies LambdaHack/A unique identifier of an actor in the dungeon. LambdaHackAbstract level identifiers. LambdaHackA unique identifier of a faction in a game. It's assigned in the order from game mode roster, starting from one. We keep the  FactionId and TeamContinuity types separate mostly to let  FactionId reflect the order, which influences starting faction positions, etc. We use TeamContinuity for dictionaries containing teams that may or may not be active factions in the current game, while  FactionId are used only for factions in the game (in particular, because they vary depending on order in game mode roster, while TeamContinuity are stable). LambdaHack.A unique identifier of an item in the dungeon.   Safe-Inferred"%&'3<= LambdaHackPerception indexed by faction identifier. This can't be added to  FactionDict3, because clients can't see it for other factions. LambdaHackAccess a BFS array and interpret the looked up distance value.   Safe-Inferred"%&'3<=*  LambdaHackThe type of item flavours.( LambdaHack*how fancy should the colour description be( LambdaHackthe colour of the flavour  LambdaHack%Turn a colour set into a flavour set.  LambdaHack%Turn a colour set into a flavour set.  LambdaHack%Turn a colour set into a flavour set.  LambdaHack%Turn a colour set into a flavour set.  LambdaHack%Turn a colour set into a flavour set.  LambdaHack%Turn a colour set into a flavour set.  LambdaHack,Get the underlying base colour of a flavour.  LambdaHack%Construct the full name of a flavour.  LambdaHack4Human-readable names for item colors. The plain set.  LambdaHack4Human-readable names for item colors. The fancy set.  LambdaHack5Human-readable names for item colors. The liquid set.  LambdaHack:Human-readable names for item colors. The plain glass set.  LambdaHack:Human-readable names for item colors. The fancy glass set.( LambdaHack+Human-readable names for story item colors.  LambdaHack8Simple names for team colors (bright colours preferred).   Safe-Inferred"%&'3<=N  LambdaHackParameters modifying a throw of a projectile or flight of pushed actor. Not additive and don't start at 0.  LambdaHack,fly with this percentage of base throw speed  LambdaHack"fly for this percentage of 2 turns  LambdaHackstart flight with this many HP  LambdaHackSpecification of how to randomly roll a timer at item creation to obtain a fixed timer for the item's lifetime.  LambdaHackEffects of items. Can be invoked by the item wielder to affect another actor or the wielder himself.Various effects of an item kind are all groupped in one list, at the cost of conditionals, sequences, etc., to ensure brevity and simplicity of content definitions. Most effects fire regardless of activation kind (the only exceptions are OnSmash and  OnCombine effects) so the deviations, handled via the conditionals, are rare and the definitions remain simple. Whether an item can be activated in any particular way, OTOH, is specified via simple flags elsewhere, again, by default, assuming that most activations are possible for all.  LambdaHackburn with this damage  LambdaHack&explode producing this group of blasts  LambdaHack%modify HP of the actor by this amount  LambdaHack'modify Calm of the actor by this amount  LambdaHackchange actor's allegiance  LambdaHack$make actor susceptible to domination  LambdaHack$put actor to sleep, also calming him  LambdaHack2make the actor yell/yawn, waking him and others up  LambdaHack/summon the given number of actors of this group  LambdaHack&ascend to another level of the dungeon  LambdaHackescape from the dungeon  LambdaHack!paralyze for this many game clips  LambdaHack.paralyze for this many game clips due to water  LambdaHack/give actor this many extra tenths of actor move  LambdaHack*teleport actor across rougly this distance  LambdaHackcreate an item of the group and insert into the store with the given random timer; it cardinality not specified, roll it  LambdaHackdestroy some items of the group from the store; see below about Ints  LambdaHackConsumeItems toUse toDestroy uses items matching toUse (destroys non-durable, without invoking OnSmash effects; applies normal effects of durable, without destroying them; the same behaviour as when transforming terrain using items) and destroys items matching  toDestroy, invoking no effects, regardless of durability; the items are taken from CGround (but not from CEqp), preferring non-durable (since durable can harm when used and may be more vauable when destroyed); if not all required items are present, no item are destroyed; if an item belongs to many groups in the sum of toUse and  toDestroy, it counts for all (otherwise, some orders of destroying would succeed, while others would not); even if item durable, as many copies are needed as specified, not just one applied many times; items are first destroyed and then, if any copies left, applied  LambdaHackmake the actor drop items of the given group from the given store; the first integer says how many item kinds to drop, the second, how many copies of each kind to drop; for non-organs, beware of not dropping all kinds, or cluttering store with rubbish becomes beneficial  LambdaHackreduce the cooldown period of this number of discharged items in the victim's equipment and organs by this dice of game clips; if the result is negative, set to 0, instantly recharging the item; starts with weapons with highest raw damage in equipment, then among organs, then non-weapons in equipment and among organs; beware of exploiting for healing periodic items  LambdaHackincrease the cooldown period of this number of fully recharged items in the victim's equipment and organs by this dice of game clips; starts with weapons with highest raw damage in equipment, then among organs, then non-weapons in equipment and among organs; beware of exploiting for hunger inducing and similar organs  LambdaHackget a suitable (i.e., numerous enough) non-unique common item stack on the floor and polymorph it to a stack of random common items, with current depth coefficient  LambdaHackget a suitable (i.e., with any random aspects) single item (even unique) on the floor and change the random bonuses of the items randomly, with maximal depth coefficient  LambdaHackexactly duplicate a single non-unique, non-valuable item on the floor  LambdaHackfind a suitable (i.e., not identified) item, starting from the floor, and identify it  LambdaHack/detect something on the map in the given radius  LambdaHack.send an actor flying (push or pull, depending)  LambdaHack push an actor  LambdaHack pull an actor  LambdaHackremove all smell on the level  LambdaHack1try to trigger a single random effect of the list  LambdaHacktrigger, with equal probability, one of the effects that don't end with UseDud  LambdaHacktrigger the effect when item smashed (not when applied nor meleed)  LambdaHacktrigger the effect only when the actor explicitly desires to combine items or otherwise subtly tinker with an item or a tile, e.g., craft items from other items in a workshop; in particular, don't trigger the effects when entering a tile; trigger exclusively the effects when activating walkable terrain  LambdaHack,apply the effect to the user, not the victim  LambdaHacknothing happens, UseDud, no description  LambdaHack*only fire second effect if first activated  LambdaHack.only fire second effect if first not activated  LambdaHack(fire all effects in order; always suceed  LambdaHackif condition not met, fail without a message; better avoided, since AI can't value it well  LambdaHackif condition met, fail without a message; better avoided, since AI can't value it well  LambdaHackconditional effect; better avoided, since AI can't value it well  LambdaHacka sentence with the actor causing the effect as subject, the given texts as the verb and the ending of the sentence (that may be ignored when the message is cited, e.g., as heard by someone) that is emitted when an activation causes an item to expire; no spam is emitted if a projectile; the ending is appended without a space in-between  LambdaHackas  VerbNoLonger4 but that is emitted whenever the item is activated;  LambdaHackas VerbMsg, but a failed effect (returns UseId)  LambdaHackAspects of items. Aspect AddSkill is additive (starting at 0) for all items wielded by an actor and it affects the actor. The others affect only the item in question, not the actor carrying it, and so are not additive in any sense.  LambdaHackspecifies the cooldown before an item may be applied again; if a copy of an item is applied manually (not via periodic activation), all effects on a single copy of the item are disabled until the copy recharges for the given time expressed in game turns; all copies recharge concurrently  LambdaHackbonus to a skill; in content, avoid boosting skills such as SkApply via permanent equipment, to avoid micromanagement through swapping items among party members before each skill use  LambdaHack item feature  LambdaHack,extra label of the item; it's not pluralized  LambdaHackparameters modifying a throw  LambdaHack.until identified, presents as this unique kind  LambdaHack+AI and UI flag that leaks item intended use  LambdaHackif level-scaled dice roll > 50, pick the former aspects, otherwise the latter  LambdaHackItem properties that are fixed for a given kind of items. Of these, aspects and effects are jointly called item powers. Note that this type is mutually recursive with   and  .  LambdaHack map symbol  LambdaHack%generic name; is pluralized if needed  LambdaHackfrequency within groups  LambdaHackpossible flavours  LambdaHackcreated in that quantity  LambdaHackrarity on given depths  LambdaHackthe verb for hitting  LambdaHackweight in grams  LambdaHackbasic kinetic damage  LambdaHackaffect the actor continuously  LambdaHack cause the effects when triggered  LambdaHack!accompanying organs and equipment  LambdaHack description  LambdaHackWhether the effect has a chance of exhibiting any potentially noticeable behaviour, except when the item is destroyed or combined. We assume at least one of OneOf effects must be noticeable.  LambdaHack6Whether a non-nested effect always applies raw damage.  LambdaHackWhether an item is damaging. Such items may trigger embedded items and may collide with bursting items mid-air. LambdaHack$Catch invalid item kind definitions. LambdaHackValidate all item kinds.        Safe-Inferred"%&'3=_9  LambdaHackMarks whether projectiles are permitted to trigger the tile transformation action. LambdaHack#All possible terrain tile features. LambdaHackinitially an item of this group is embedded; we assume the item has effects and is supposed to be triggered LambdaHack6goes from a closed to closed or open tile when altered LambdaHack5goes from an open to open or closed tile when altered LambdaHack,alters tile, but does not change walkability LambdaHackalters tile, as before, using up all listed items from the ground and equipment; the list never empty; for simplicity, such tiles are never taken into account when pathfinding LambdaHack2when hidden, looks as the unique tile of the group LambdaHackwhen generating, may be transformed to the unique tile of the group LambdaHackwhen generating in opening, can be revealed to belong to the group LambdaHackwhen generating in solid wall, can be revealed to belong to the group LambdaHackactors can walk through LambdaHackactors can see through LambdaHack is not lit with an ambient light LambdaHack#initial items often generated there LambdaHack(initial items very often generated there LambdaHack8initial actors often generated there; counterpart of  VeryOftenItem for dark places LambdaHackno items ever generated there LambdaHackno actors ever generated there LambdaHackeven if otherwise uninteresting, taken into account for triggering by AI LambdaHack,used for visible trails throughout the level LambdaHackin place normal legend and in override, don't roll a tile kind only once per place, but roll for each position; one non-spicy (according to frequencies of non-spicy) and at most one spicy (according to their frequencies) is rolled per place and then, once for each position, one of the two is semi-randomly chosen (according to their individual frequencies only) LambdaHack(The type of kinds of terrain tiles. See Tile.hs9 for explanation of the absence of a corresponding type Tile that would hold particular concrete tiles in the dungeon. Note that tile names (and any other content names) should not be plural (that would lead to "a stairs"), so "road with cobblestones" is fine, but "granite cobblestones" is wrong.,Tile kind for unknown space has the minimal  ContentId index. The talter for unknown space is 1' and no other tile kind has that value. LambdaHack map symbol LambdaHackshort description LambdaHackfrequency within groups LambdaHack map color LambdaHackmap color when not in FOV LambdaHackminimal skill needed to activate embeds and, in case of big actors not standing on the tile, to alter the tile in any way LambdaHackproperties; order matters LambdaHackValidate a single tile kind. LambdaHackValidate all tile kinds.We don't check it any more, but if tiles look the same on the map (symbol and color), their substantial features should be the same, too, unless there is a good reason they shouldn't. Otherwise the player has to inspect manually all the tiles with this look to see if any is special. This tends to be tedious. Note that tiles may freely differ wrt text blurb, dungeon generation rules, AI preferences, etc., whithout causing the tedium.44! Safe-Inferred"%&'3<=h< LambdaHackPlaces are rooms and other dungeon features, their names can be seen on a level map by aiming at a position that is an entry to the place (an individual entrance point, an approach area around the place or a phantom entry not on the map, but only used for statistics to witness the place exists). Entries are proxies for initial places created on the level (which may be otherwise eradicated by burrowing the walls, etc.) and so used for dungeon statistics. The statistics are presented in the Dashboard/displace place lore menu. LambdaHack)The choice of a fence type for the place. LambdaHack'put a solid wall fence around the place LambdaHack+leave an empty space, like the room's floor LambdaHack,leave an empty space, like the cave's ground LambdaHack1skip the fence and fill all with the place proper LambdaHackA method of filling the whole area (except for CVerbatim and CMirror, which are just placed in the middle of the area) by transforming a given corner. LambdaHack8reflect every other corner, overlapping 1 row and column LambdaHack6fill symmetrically 4 corners and stretch their borders LambdaHack7tile separately and symmetrically quarters of the place LambdaHack7just build the given interior, without filling the area LambdaHack6build the given interior in one of 4 mirrored variants LambdaHackParameters for the generation of small areas within a dungeon level. LambdaHack%short description, singular or plural LambdaHackfrequency within groups LambdaHackrarity on given depths LambdaHack(how to fill whole place using the corner LambdaHack(whether to fence place with solid border LambdaHack(plan of the top-left corner of the place LambdaHack dark legend LambdaHack lit legend LambdaHackCatch invalid place kind definitions. In particular, verify that the top-left corner map is rectangular and not empty. LambdaHackValidate all place kinds." Safe-Inferred"%&'3=k LambdaHack.The type of game rules and assorted game data. LambdaHacktitle of the game (not lib) LambdaHackmaximum level width LambdaHackmaximum level height LambdaHackversion of the game LambdaHackname of the UI config file LambdaHack#the default UI settings config file LambdaHack&game saved that often (not on browser) LambdaHack'server switches leader level that often LambdaHackname of the scores file LambdaHack'what is a close distance between actors LambdaHackwords that can't be dropped from stair name as it goes through levels LambdaHack(item symbols treated specially in engine LambdaHack$Catch invalid rule kind definitions.# Safe-Inferred"%&'3<=tX LambdaHackOutcome of a game. LambdaHack%the faction escaped the dungeon alive LambdaHack)the faction won by eliminating all rivals LambdaHack(the faction lost the game in another way LambdaHackthe faction was eliminated LambdaHack#game is restarted; the quitter quit LambdaHackgame is supended LambdaHackConditional polynomial representing score calculation for this faction. LambdaHackthe team the faction identifies with across games and modes LambdaHacknames of actor groups that may naturally fall under faction's control, e.g., upon spawning; make sure all groups that may ever continuousely generate actors, e.g., through spawning or summoning, are mentioned in at least one faction kind; groups of initial faction actors don't need to be included LambdaHackfixed skill modifiers to the non-leader actors; also summed with skills implied by  fdoctrine (which is not fixed) LambdaHack"the faction can escape the dungeon LambdaHack(the faction declared killed if no actors LambdaHack&score formula (conditional polynomial) LambdaHackwhether actors have gender LambdaHack&initial faction's non-leaders doctrine LambdaHackspawns fast enough that switching pointman to another level to optimize spawning is a winning tactics, which would spoil the fun, so switching is disabled in UI and AI clients LambdaHack'whether the faction can have a pointman LambdaHackdoes the faction have a UI client (for control or passive observation) LambdaHack)is the faction initially under AI control LambdaHack&teams starting at war with the faction LambdaHack&teams starting allied with the faction LambdaHack%Validate game faction kinds together.33$ Safe-Inferred"%&'3=* LambdaHackParameters for the generation of dungeon levels. Warning: for efficiency, avoid embedded items in any of the common tiles. LambdaHackshort description LambdaHackfrequency within groups LambdaHack minimal X size of the whole cave LambdaHack minimal Y size of the whole cave LambdaHack"size of a map cell holding a place LambdaHack#minimal size of places; for merging LambdaHack#maximal size of places; for growing LambdaHack9the odds a place is dark (level-scaled dice roll > 50) LambdaHack:the odds the cave is dark (level-scaled dice roll > 50) LambdaHack!a proportion of extra connections LambdaHack,at most this proportion of rooms may be void LambdaHack"the chance of a door in an opening LambdaHackif there's a door, is it open? LambdaHack"if not open, hidden one in n times LambdaHack"the lower, the more monsters spawn LambdaHackactor groups to consider LambdaHack#number of initial items in the cave LambdaHackitem groups to consider; note that the groups are flattened; e.g., if an item is moved to another included group with the same weight, the outcome doesn't change LambdaHackplace groups to consider LambdaHack$are passable default tiles permitted LambdaHackwaste of time for AI to explore LambdaHackthe default cave tile LambdaHackthe dark cave corridor tile LambdaHackthe lit cave corridor tile LambdaHackthe tile used for FWall fence LambdaHacktile used for the fence corners LambdaHackthe outer fence N wall LambdaHackthe outer fence E wall LambdaHackthe outer fence S wall LambdaHackthe outer fence W wall LambdaHack are places touching fence banned LambdaHackminimal distance between stairs LambdaHackmaximum number of stairs LambdaHackescape groups, if any LambdaHackplace groups for created stairs LambdaHackextra groups for inherited LambdaHack(which faction starting positions to skip LambdaHackwhether actors spawn sleeping LambdaHackfull cave description LambdaHackCatch caves with not enough space for all the places. Check the size of the cave descriptions to make sure they fit on screen. Etc. LambdaHackValidate all cave kinds. Note that names don't have to be unique: we can have several variants of a cave with a given name.22% Safe-Inferred"%&'3= LambdaHackThe specification of factions and of levels, numbers and groups of their initial members. LambdaHack5Requested cave groups for particular level intervals. LambdaHackGame mode specification. LambdaHackshort description LambdaHackfrequency within groups LambdaHack'whether to show tutorial messages, etc. LambdaHackwhether this is an attract mode LambdaHack factions taking part in the game LambdaHackarena of the game LambdaHackmessages displayed at each particular game ends; if message empty, the screen is skipped LambdaHack rules note LambdaHack description LambdaHack"why/when the mode should be played LambdaHack'hints in case player faces difficulties LambdaHack)Catch invalid game mode kind definitions. LambdaHackChecks, in particular, that there is at least one faction with fneverEmpty or the game would get stuck as soon as the dungeon is devoid of actors. LambdaHack"Validate game mode kinds together.& Safe-Inferred"%&'3= LambdaHackA map morally indexed by ContentId TileKind. LambdaHackA lot of tabulated maps from tile kind identifier to a property of the tile kind. LambdaHackWhether a tile does not block vision. Essential for efficiency of FOV, hence tabulated. LambdaHackWhether a tile has ambient light --- is lit on its own. Essential for efficiency of  Perception, hence tabulated. LambdaHack4Whether a tile is a good hideout: walkable and dark. LambdaHackWhether actors can walk into a tile. Essential for efficiency of pathfinding, hence tabulated. LambdaHackWhether a tile is a door, open or closed. Essential for efficiency of pathfinding, hence tabulated. LambdaHack1Whether a tile kind (specified by its id) has an OpenTo feature. LambdaHack0Whether a tile kind (specified by its id) has a CloseTo feature. LambdaHackWhether a tile is changable.( LambdaHack-Whether a tile is modifiable with some items. LambdaHackWhether a tile is suspect. Essential for efficiency of pathfinding, hence tabulated. LambdaHackWhether one can easily explore a tile, possibly finding a treasure, either spawned there or dropped there by a (dying from poison) foe. Doors can't be explorable since revealing a secret tile should not change it's explorable status. Also, door explorable status should not depend on whether they are open or not, so that a foe opening a door doesn't force us to backtrack to explore it. Still, a foe that digs through a wall will affect our exploration counter and if content lets walls contain threasure, such backtraking makes sense. LambdaHack1Whether a tile kind (specified by its id) has an OpenTo. feature or is walkable even without opening. LambdaHack*Whether a tile kind has the given feature.' Safe-Inferred"%&'3<=) LambdaHackPartial information about an item, deduced from its item kind. These are assigned to each  . The kmConst flag says whether the item's aspect record is constant rather than random or dependent on item creation dungeon level. LambdaHack3whether the item doesn't need second identification LambdaHack,mean value of item's possible aspect records LambdaHackRecord of skills conferred by an item as well as of item flags and other item aspects.( Safe-Inferred"%&'3<=H LambdaHackThe difficulty level influencess HP of either the human player or the AI. The challenges restrict some abilities of the human player only. LambdaHack)game difficulty level (HP bonus or malus) LambdaHack-cold fish challenge (no healing from enemies) LambdaHack)ready goods challenge (crafting disabled) LambdaHack1lone wolf challenge (only one starting character) LambdaHack1finder keeper challenge (ranged attacks disabled) LambdaHackCurrent game status. LambdaHackcurrent game outcome LambdaHackdepth of the final encounter LambdaHacknew game group to start, if any LambdaHackDiplomacy states. Higher overwrite lower in case of asymmetric content. LambdaHackThe faction datatype. LambdaHackthe player spec for this faction, do not update! it is morally read-only, but not represented as ContentId FactionKind, because it's very small and it's looked up often enough in the code and during runtime; a side-effect is that if content changes mid-game, this stays; if we ever have thousands of factions in a single game, e.g., one for each separately spawned herd of animals, change this LambdaHackindividual name LambdaHackcolor of numbered actors LambdaHack%non-pointmen behave according to this LambdaHack'whether the faction is under AI control LambdaHackinitial actors LambdaHackdiplomatic standing LambdaHackcause of game end/exit LambdaHackthe leader of the faction; don't use in place of sleader on clients LambdaHack9level and position of faction's shared inventory stash LambdaHackmembers killed LambdaHack8All factions in the game, indexed by faction identifier. LambdaHack;Tell whether the faction consists of summoned horrors only.Horror player is special, for summoned actors that don't belong to any of the main players of a given game. E.g., animals summoned during a skirmish game between two hero factions land in the horror faction. In every game, either all factions for which summoning items exist should be present or a horror player should be added to host them. LambdaHack/Check if factions are at war. Assumes symmetry.( LambdaHack/Check if factions are allied. Assumes symmetry. LambdaHackCheck if factions are allied or are the same faction. Assumes symmetry...) Safe-Inferred"%&'3<= LambdaHack1A dictionary from game mode IDs to scores tables. LambdaHack(The list of scores, in decreasing order. LambdaHackA single score record. Records are ordered in the highscore table, from the best to the worst, in lexicographic ordering wrt the fields below.( LambdaHack the score( LambdaHack)game time spent (negated, so less better)( LambdaHack"date of the last game interruption( LambdaHackreason of the game interruption( LambdaHackchallenge setup of the game( LambdaHackname of the faction's gkind( LambdaHack allies lost( LambdaHack foes killed LambdaHackEmpty score table LambdaHackInsert a new score into the table, Return new table and the ranking. Make sure the table doesn't grow too large. LambdaHack&Register a new score in a score table. LambdaHackShow a single high score, from the given ranking in the high score table.  LambdaHack old table LambdaHack the total value of faction items LambdaHack the total value of dungeon items LambdaHackgame time spent LambdaHackreason of the game interruption LambdaHack current date LambdaHackchallenge setup LambdaHackname of the faction's gkind LambdaHack allies lost  LambdaHack foes killed LambdaHack%number of (3-line) scores to be shown LambdaHackcurrent score table LambdaHack*position of the current score in the table LambdaHackthe name of the game mode  * Safe-Inferred"%&'3=. LambdaHackA list of active screenfulls to be shown one after another. Each screenful has an independent numbering of rows and columns. LambdaHackAn Overlay of text with an associated list of keys or slots that activate when the specified screen position is pointed at. The list should be sorted wrt rows and then columns. LambdaHack7A key or a menu slot at a given position on the screen. LambdaHackWidth of on-screen button text, expressed in characters, and so UI (mono font) width is deduced from the used font. LambdaHackThis appends vertically a list of blurbs into a single font overlay map. Not to be used if some blurbs need to be places overlapping vertically, e.g., when the square font symbol needs to be in the same line as the start of the descritpion of the denoted item or when mono font buttons need to be after a prompt. LambdaHack:Generate a slideshow with the current and previous scores. LambdaHack6Show a screenful of the high scores table. Parameter entries. is the number of (3-line) scores to be shown. LambdaHack8Produce a couple of renderings of the high scores table. LambdaHackwidth of the display area LambdaHackheight of the display area LambdaHackcurrent score table LambdaHack*position of the current score in the table LambdaHackthe name of the game mode LambdaHack"the timezone where the game is run!!+ Safe-Inferred"%&'3= LambdaHackRequests that take game time. LambdaHack.Possible forms of requests sent by UI clients. LambdaHackRequests sent by UI clients to the server. If faction leader is to be changed, it's included as the second component. LambdaHack.Possible forms of requests sent by AI clients. LambdaHackRequests sent by AI clients to the server. If faction leader is to be changed, it's included as the second component., Safe-Inferred"%&'3<=P LambdaHackDescription of how item manipulation is triggered and communicated to the player. LambdaHack)Abstract syntax of human player commands. LambdaHackThis triple of command categories, description and the command term itself defines the meaning of a human command as entered via a keypress, mouse click or chosen from a menu. LambdaHackSymbolic representation of areas of the screen used to define the meaning of mouse button presses relative to where the mouse points to.- Safe-Inferred"%&'3<= LambdaHackOptions that affect the UI of the client, specified in the config file. More documentation is in the default config file.. Safe-Inferred"%&'3=  LambdaHack;Bindings and other information about human player commands. LambdaHackbinding of keys to commands LambdaHack:the properly ordered list of commands for the help menu LambdaHackand from commands to their keys LambdaHackKey-command mappings to be specified in content and used for the UI. LambdaHackCreate binding of keys to movement and other standard commands, as well as commands defined in the config file. LambdaHackflingTs - list containing one flingable projectile >>> flingTs [TriggerItem {tiverb = Text "fling", tiobject = Text "in-range projectile", tisymbols = ""}]I question the value of that test. But would Bob Martin like it on the grounds it's like double-bookkeeping? LambdaHackUI client options LambdaHack%default key bindings from the content LambdaHackconcrete binding''/ Safe-Inferred"%&'3= LambdaHack,Description of default key-command bindings.In addition to these commands, mouse and keys have a standard meaning when navigating various menus.0 Safe-Inferred"%&'3= LambdaHack&Screen layout and features definition.Warning: this type is not abstract, but its values should not be created ad hoc, even for unit tests, but should be constructed with makeData, which includes validation,The emptyScreenContent is one such valid by construction value of this type. It's suitable for bootstrapping and for testing. LambdaHack screen width LambdaHack screen height LambdaHack%an extra blurb line for the main menu LambdaHackthe intro screen (first help screen) text and the rest of the manual LambdaHackverbs to use for apply actions LambdaHack!embedded game-supplied font files LambdaHack$Catch invalid rule kind definitions.  1 Safe-Inferred"%&'3=l LambdaHackA frame that is padded to fill the whole screen with optional overlays to display in proportional, square and monospace fonts.Note that we don't provide a list of color-highlighed box positions to be drawn separately, because overlays need to obscure not only map, but the highlights as well, so highlights need to be included earlier.See the description of / for explanation of why screen coordinates in  singleArray are Point even though they should be . LambdaHackA simpler variant of  PreFrames3. LambdaHackA simpler variant of  PreFrame3. LambdaHackSequence of screen frames, including delays. Potentially based on a single base frame. LambdaHackComponents of a frame, before it's decided if the first can be overwritten in-place or needs to be copied. LambdaHack9A frame, that is, a base frame and all its modifications. LambdaHack Safe-Inferred"%&'3<= LambdaHackAll items in the dungeon (including those carried by actors), indexed by item identifier. LambdaHackA bag of items, e.g., one of the stores of an actor or the items on a particular floor position or embedded in a particular map tile. LambdaHackNumber of items in a bag, together with recharging timer, in case of items that need recharging, exists only temporarily or auto-activate at regular intervals. Data invariant: the length of the timer should be less or equal to the number of items. LambdaHackThe absolute level's local time at which an item's copy becomes operational again. Even if item is not identified and so its timeout unknown, it's enough to compare this to the local level time to learn whether an item is recharged.This schema causes timeout jumps for items in stash, but timeout is reset when items move, so this is a minor problem. Global time can't be used even only for items in stash, or exploit would be possible when an actor on a desolate level waits to recharge items for actors on a busy level. It's probably impossible to avoid such exploits or, otherwise, timeout jumps, particularly for faction where many actors move on many levels and so an item in stash is not used by a single actor at a time. LambdaHackThe fields are, in order: 1. whether the item should be kept in equipment (not in stash) 2. the total benefit from picking the item up (to use or to put in equipment) 3. the benefit of applying the item to self 4. the (usually negative, for him) value of hitting a foe in melee with it 5. the (usually negative, for him) value of flinging the item at an opponent LambdaHackThe map of item kind indexes to identifiers of items that have that kind. Used to update data about items when their kinds become known, e.g., AI item use benefit data. LambdaHackThe map of item kind indexes to item kind ids. The full map, as known by the server, is 1-1. Because it's sparse and changes, we don't represent it as an (unboxed) vector, until it becomes a bottleneck (if ever, likely on JS, where only vectors are fast). LambdaHackFull information about an item. LambdaHackThe secret part of the information about an item. If a faction knows the aspect record of the item, this is the complete secret information. Items that don't need second identification (the kmConst flag is set) may be identified or not and both cases are OK (their display flavour will differ and that may be the point). LambdaHackAn index of the kind identifier of an item. Clients have partial knowledge how these idexes map to kind ids. They gain knowledge by identifying items. The indexes and kind identifiers are 1-1. LambdaHackThe map of item ids to item aspect record. The full map is known by the server. LambdaHackEither the explicit obvious kind of the item or the kind it's hidden under, with the details covered under the index indirection. LambdaHackGame items in actor possesion or strewn around the dungeon. The information contained in this time is available to the player from the moment the item is first seen and is never mutated.'Some items are not created identified (IdentityCovered). Then they are presented as having a template kind that is really not their own, though usually close. Full kind information about item's kind is available through the  ItemKindIx index once the item is identified and full information about the value of item's aspect record is available elsewhere (both IdentityObvious and IdentityCovered items may or may not need identification of their aspect record). LambdaHack'the kind of the item, or an indirection LambdaHack)the faction that created the item, if any LambdaHackflavour, always the real one, it's not hidden; people may not recognize shape, but they remember colour and old vs fancy look LambdaHackDamage calculation. The armor and hurt skills are additive. They can't be multiplicative, because then 100% armor would minimize damage regardless of even 200% hurt skill. However, additive skills make the relative effectiveness of weapons dependent on the enemy, so even with -100% hurt skill a kinetic weapon can't be removed from the list, because an enemy may have negative armor skill. This is bad, but also KISS.? Safe-Inferred"%&'3=N LambdaHack&Possible causes of failure of request.88@ Safe-Inferred"%&'3= LambdaHack+A view on single, inhabited dungeon level.  Remembered fields carry a subset of the info in the client copies of levels. LambdaHack,the kind of cave the level is an instance of LambdaHackabsolute depth of the level LambdaHack#remembered items lying on the floor LambdaHack%remembered items embedded in the tile LambdaHackseen big (non-projectile) actors at positions on the level; could be recomputed at resume, but small enough LambdaHackseen projectiles at positions on the level; could be recomputed at resume LambdaHackremembered level map LambdaHackroom entrances on the level LambdaHackarea of the level LambdaHackremembered smells on the level LambdaHackpositions of (up, down) stairs LambdaHackpositions of IK.Escape tiles LambdaHack currently remembered clear tiles LambdaHack total number of explorable tiles LambdaHack)local time on the level (possibly frozen) LambdaHack(whether the level is covered in darkness LambdaHackEntries of places on the map. LambdaHackCurrent smell on map tiles. LambdaHackTile kinds on the map. LambdaHack0Collections of projectiles located on map tiles. LambdaHack Big actors located on map tiles. LambdaHackItems located on map tiles. LambdaHack?The complete dungeon is a map from level identifiers to levels. LambdaHackLevels in the current branch, one level up (or down) from the current. LambdaHackCompute the level identifier and stair position on the new level, after a level change.We assume there is never a staircase up and down at the same position. LambdaHack Query for tile kinds on the map. LambdaHackTry to find a random position on the map satisfying conjunction of the mandatory and an optional predicate. If the permitted number of attempts is not enough, try again the same number of times without the next optional predicate, and fall back to trying with only the mandatory predicate. LambdaHackGenerate a list of all passable points on (connected component of) the level in the order of path distance from the starting position (BFS). The starting position needn't be passable and is always included. LambdaHacklevel of the stairs LambdaHackposition of the stairs LambdaHackoptional forced direction LambdaHackcurrent game dungeon LambdaHackpossible destinations LambdaHackthe number of tries LambdaHacklook up in this level LambdaHackmandatory predicate LambdaHackoptional predicates LambdaHackthe number of tries LambdaHacklook up in this level LambdaHackmandatory predicate LambdaHackoptional predicates LambdaHackgood to have pred. LambdaHackworst case predicates00A Safe-Inferred"%&'3<= = LambdaHack5All actors on the level, indexed by actor identifier. LambdaHackRepresentation of recent changes to HP of Calm of an actor. This is reset every time the actor perfoms an action, so this is aggregated over actor turn (move), not time turn. The resource changes recorded in the tuple are, respectively, negative and positive. LambdaHackresource change this move LambdaHackresource change previous move LambdaHackActor attributes that are changing throughout the game. If they appear to be dublets of aspects from actor kinds, e.g. HP, they may be results of casting the dice specified in their respective actor kind and/or may be modified temporarily, but return to the original value from their respective kind over time.Other properties of an actor, in particular its current aspects, are derived from the actor's trunk, organs and equipment. A class of the aspects, the boolean ones, are called flags. Another class are skills. Stats are a subclass that determines if particular actions are permitted for the actor (or faction). LambdaHack#the trunk organ of the actor's body LambdaHack>continued team character identity index number in this game LambdaHackcurrent hit points * 1M LambdaHackHP delta this turn * 1M LambdaHackcurrent calm * 1M LambdaHackcalm delta this turn * 1M LambdaHackcurrent position LambdaHackprevious position, if any LambdaHack current level LambdaHack&faction the actor currently belongs to LambdaHack8trajectory the actor must travel and his travel speed LambdaHackorgans LambdaHackpersonal equipment LambdaHack&number of weapons among eqp and organs LambdaHack$number of benign items among weapons LambdaHack!state of the actor's watchfulness LambdaHackis a projectile? affects being able to fly through other projectiles, etc. LambdaHack8The speed from organs and gear; being pushed is ignored. LambdaHackProjectile that ran out of steam or collided with obstacle, dies. Even if it pierced through an obstacle, but lost its payload while altering the obstacle during piercing, it dies, too. LambdaHack3Check if actor calm enough to perform some actions.If max Calm is zero, always holds, to permit removing disastrous equipped items, which would otherwise be stuck forever. LambdaHack:Has the skill and can wake up easily, so can sleep safely. LambdaHackCan't loot, not too aggresive, so sometimes prefers to sleep instead of exploring. LambdaHackChance, in parts per million, that a new monster is generated. Depends on the number of monsters already present, and on the level depth and its cave kind.Note that sometimes monsters spawn in groups, increasing danger, but many monsters are generated asleep, decreasing initial danger. LambdaHack5How long until an actor's smell vanishes from a tile.99B Safe-Inferred"%&'3= LambdaHackThe main game state, the basic one, pertaining to a single game, not to a single playing session or an intersection of both. This state persists between playing sessions, until the particular game ends. Anything that persists between games is stored in server state, client state or client UI session state.Another differentiating property of this state is that it's kept separately on the server and each of the clients (players, human or AI) and separately updated, according to what each player can observe. It's never updated directly, but always through atomic commands ( CmdAtomic) that are filtered and interpreted differently on server and on each client. Therefore, the type is a view on the game state, not the real game state, except on the server that alone stores the full game information.( LambdaHackremembered dungeon( LambdaHack(absolute dungeon depth for item creation( LambdaHack remembered actors in the dungeon( LambdaHackremembered items in the dungeon( LambdaHackspotted items with the same kind index could be recomputed at resume, but small( LambdaHackremembered sides still in game( LambdaHack%global game time, for UI display only( LambdaHackremembered content; warning: use only validated content, even for testing( LambdaHack(total value of human trinkets in dungeon( LambdaHackhigh score table( LambdaHackcurrent game mode( LambdaHackitem kind discoveries data( LambdaHack%item aspect data; could be recomputed( LambdaHack#actor maximal skills; is recomputed LambdaHack#Create a map full of unknown tiles.=unknownTileMap (fromJust (toArea (0,0,0,0))) TK.unknownId 2 2 PointArray.Array with size (2,2) LambdaHack#Initial complete global game state. LambdaHackInitial empty state. LambdaHackLocal state created by removing secret information from global state components. LambdaHack!Update dungeon data within state. LambdaHackUpdate dungeon depth. LambdaHackUpdate the actor dictionary. LambdaHackUpdate the item dictionary. LambdaHackUpdate the item kind index map. LambdaHack!Update faction data within state. LambdaHack Update global time within state. LambdaHack?Update content data within state and recompute the cached data. LambdaHack'Update total gold value in the dungeon.%%C Safe-Inferred"%&'3= LambdaHack+Calculate loot's worth for a given faction. LambdaHack/Price an item, taking count into consideration. LambdaHackChecks if the actor is present on the current level. The order of argument here and in other functions is set to allow b <- getsState (memActor a) LambdaHack'Get current time from the dungeon data. LambdaHackDetermine the dungeon level of the container. If the item is in the shared stash, the level depends on which actor asks, not where the stash is located physically. LambdaHackRequire that any non-dying foe is adjacent. We include even projectiles that explode when stricken down, because they can be caught and then they don't explode, so it makes sense to focus on handling them. If there are many projectiles in a single adjacent position, we only test the first one, the one that would be hit in melee (this is not optimal if the actor would need to flee instead of meleeing, but fleeing with *many* projectiles adjacent is a possible waste of a move anyway). LambdaHackCheck if any non-dying foe is adjacent to any of our normal actors and either can harm them via melee or can attack from a distance. Otherwise no point meleeing him. Projectiles are ignored, because they are not actively attempted to melee, see meleeAny. This is regardless of whether our actor can melee or just needs to flee, in which case alert is needed so that he is not slowed down by others. However, if our actor can't move nor melee, no real combat is taking place. This is needed only by AI and computed as lazily as possible.99D Safe-Inferred"%&'3=} LambdaHackMonad for reading game state. A state monad with state modification disallowed (another constraint is needed to permit that). The basic server and client monads are like that, because server and clients freely modify their internal session data, but don't modify the main game state, except in very restricted and synchronized way.  E Safe-Inferred"%&'3<="V LambdaHackSuffix to append to a basic content name if the content causes the effect.&We show absolute time in seconds, not moves, because actors can have different speeds (and actions can potentially take different time intervals). We call the time taken by one player move, when walking, a move. Turn and clip are used mostly internally, the former as an absolute time unit. We show distances in steps, because one step, from a tile to another tile, is always 1 meter. We don't call steps tiles, reserving that term for the context of terrain kinds or units of area.F Safe-Inferred"%&'3<=$ LambdaHackindividual map symbol LambdaHackindividual name LambdaHackindividual pronoun LambdaHackindividual map color LambdaHack(The part of speech describing the actor. LambdaHack2The part of speech containing the actor's pronoun.  G Safe-Inferred"%&'3<=/) LambdaHackThe goal of an actor. LambdaHack1shared inventory stash of our or an enemy faction LambdaHack(last seen position of the targeted actor LambdaHack)embedded item that can be triggered; in TPoint (TEmbed bag p) _ q usually bag is embbedded in p and q is an adjacent open tile LambdaHackitem lying on the ground LambdaHack!smell potentially left by enemies LambdaHacka blocking tile to be approached (and, e.g., revealed to be walkable or altered or searched) LambdaHackan unknown tile to be explored LambdaHacka known tile to be patrolled LambdaHack