# .tlv file generated by https://github.com/akkartik/teliva # You may edit it if you are careful; however, you may see cryptic errors if you # violate Teliva's assumptions. # # .tlv files are representations of Teliva programs. Teliva programs consist of # sequences of definitions. Each definition is a table of key/value pairs. Keys # and values are both strings. # # Lines in .tlv files always follow exactly one of the following forms: # - comment lines at the top of the file starting with '#' at column 0 # - beginnings of definitions starting with '- ' at column 0, followed by a # key/value pair # - key/value pairs consisting of ' ' at column 0, containing either a # spaceless value on the same line, or a multi-line value # - multiline values indented by more than 2 spaces, starting with a '>' # # If these constraints are violated, Teliva may unceremoniously crash. Please # report bugs at http://akkartik.name/contact - __teliva_timestamp: original str_helpers: >-- some string helpers from http://lua-users.org/wiki/StringIndexing > >-- index characters using [] >getmetatable('').__index = function(str,i) > if type(i) == 'number' then > return str:sub(i,i) > else > return string[i] > end >end > >-- ranges using (), selected bytes using {} >getmetatable('').__call = function(str,i,j) > if type(i)~='table' then > return str:sub(i,j) > else > local t={} > for k,v in ipairs(i) do > t[k]=str:sub(v,v) > end > return table.concat(t) > end >end > >-- iterate over an ordered sequence >function q(x) > if type(x) == 'string' then > return x:gmatch('.') > else > return ipairs(x) > end >end > >-- insert within string >function string.insert(str1, str2, pos) > return str1:sub(1,pos)..str2..str1:sub(pos+1) >end > >function string.remove(s, pos) > return s:sub(1,pos-1)..s:sub(pos+1) >end > >-- TODO: backport utf-8 support from Lua 5.3 - __teliva_timestamp: original check_eq: >function check_eq(x, expected, msg) > if eq(x, expected) then > Window:addch('.') > else > print('F - '..msg) > print(' expected '..str(expected)..' but got '..str(x)) > teliva_num_test_failures = teliva_num_test_failures + 1 > -- overlay first test failure on editors > if teliva_first_failure == nil then > teliva_first_failure = msg > end > end >end - __teliva_timestamp: original eq: >function eq(a, b) > if type(a) ~= type(b) then return false end > if type(a) == 'table' then > if #a ~= #b then return false end > for k, v in pairs(a) do > if b[k] ~= v then > return false > end > return true > end > end > return a == b >end - __teliva_timestamp: original str: >-- smarter tostring >-- slow; used only for debugging >function str(x) > if type(x) == 'table' then > local result = '' > result = result..#x..'{' > for k, v in pairs(x) do > result = result..str(k)..'='..str(v)..', ' > end > result = result..'}' > return result > end > return tostring(x) >end - __teliva_timestamp: original map: >-- only for arrays >function map(l, f) > result = {} > for _, x in ipairs(l) do > table.insert(result, f(x)) > end > return result >end - __teliva_timestamp: original reduce: >-- only for arrays >function reduce(l, f, init) > result = init > for _, x in ipairs(l) do > result = f(result, x) > end > return result >end - __teliva_timestamp: original filter: >-- only for arrays >function f
# Idle adventure game

You are the 7th and youngest daughter to a king. Your older siblings are all boys. Your chances of inheriting the thrown are essentially nill, and, to boot, you are the political hostage of good faith to a neighboring kingdom, as such you aren’t allowed to leave and don’t have much to do. 

What you have is the ability to talk with passing people, and receive a monthly stipend of $42. In this game you recruit and assign parties of adventurers tasks. They leave, attempt to complete the task and, if possible, return and tell you their grand tail and share their spoils with you. 

You then have the ability to dismiss them, or reinvest in them, helping them to level up so that they can take on more challenging adventures.

The final, and most expensive task in the game -- the way to win -- is to usurp the thrown through some means. 

## Technical 

HTML5/JS idle game about task assignment, and leveling up the recruited party members.

Every few ticks, without doing anything, you earn X currency (your monthly stipend). 

Whenever you want, you can spend this money on one of a few actions.

The actions available to the player: 

- invest in the princess (increasing your ability to recruit high-level players)
  - finery (dresses, hats, etc.), more likely to recruit folks with higher weapons and armor
  - books and maps, more likely to recruit folks with higher transportation stat
  - spiders, spiders
- recruit a new party member (there is some max to how many you can have)
- dismiss a party member (must pay them an exit fee)
- upgrade a party member
  - weapons and armor, able to take on stronger, more challenging tasks
  - transportation, reduce the time a task takes to complete
  - spiders, spiders
- assign a quest (quests are time bound tasks that party members take on -- while gone, a party member can't be upgraded or interacted with, quests have stat ratings, outfitting prices, and earn potentials, so it is important to balance the party member to the task)
append(result, combine(s[i], subresult)) > end > if key_pressed(Window) then return nil end -- interrupted > end > return result >end