hexyz is tower defense game, and a lua library for dealing with hexagonal grids
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
6.3 KiB

  1. --[[
  2. the following is a list of tower specifications, which are declarations of a variety of properties describing what a tower is, and how it functions
  3. this a lua file. a quick run-down of what writing code in lua looks like: https://www.amulet.xyz/doc/#lua-primer
  4. each tower spec is a lua table. lua tables are the thing that you use to represent bundles of data (both arrays and hashtables are represented by tables)
  5. the format of the bundles in our case are described below.
  6. some propreties are optional. required properties are marked with an asterisk (*), and are generally included at the top of the list.
  7. # TOWER SPEC TABLE
  8. | --------------------------| -------- | -------------------------------------------------------------- |
  9. | property name, required* | datatype | general description / details |
  10. | --------------------------| -------- | -------------------------------------------------------------- |
  11. | name* | string | exact one-line display name text of the tower |
  12. | placement_rules_text* | string | one-line description of the placement rules for this tower |
  13. | short_description* | string | one-line description of the nature of this tower |
  14. | texture* | userdata | @TODO |
  15. | icon_texture* | userdata | @TODO |
  16. | cost* | number | the starting cost of placing this tower |
  17. | | | |
  18. | weapons* | table | an array of weapons. |
  19. | | | order matters - two weapons share a 'choke' value, and both |
  20. | | | could acquire a target in a frame, the first one is choosen. |
  21. | | | |
  22. | placement_f | function |
  23. | | | |
  24. | | | |
  25. | | | |
  26. | | | |
  27. | | | |
  28. | visual_range | number | when the tower has multiple weapons, what range represents the |
  29. | | | overall range of the tower. default is calculated on load as |
  30. | | | the largest range among the weapons the tower has. |
  31. | min_visual_range | number | same as above but the largest minimum range among weapons |
  32. | | | |
  33. | update_f | function | default value is complicated @TODO |
  34. | grow_f | function | default value is false/nil. @TODO |
  35. | size | number | default value of 1, which means the tower occupies one hex. |
  36. | height | number | default value of 1. height is relevant for mob pathing and |
  37. | | | projectile collision |
  38. | | | |
  39. | --------------------------| -------- | -------------------------------------------------------------- |
  40. # WEAPON TABLE
  41. | --------------------------| -------- | -------------------------------------------------------------- |
  42. | property name, required* | datatype | general description / details |
  43. | --------------------------| -------- | -------------------------------------------------------------- |
  44. | type | number | sometimes, instead of specifying everything for a weapon, it's |
  45. | | | convenient to refer to a base type. if this is provided all of |
  46. | | | the weapon's other fields will be initialized to preset values |
  47. | | | and any other values you provide with the weapon spec will |
  48. | | | overwrite those preset values. |
  49. | | | if you provide a value here, all other properties become |
  50. | | | optional. |
  51. | | | values you can provide, and what they mean: |
  52. | | | @TODO |
  53. | | | |
  54. | fire_rate* | number | 'shots' per second, if the weapon has a valid target |
  55. | range* | number | max distance (in hexes) at which this weapon acquires targets |
  56. | | | |
  57. | min-range | number | default of 0. min distance (in hexes) at which this weapon acquires targets |
  58. | target_acquisition_f | function | default value is complicated @TODO |
  59. | choke | number | default of false/nil. @TODO |
  60. | | | |
  61. | --------------------------| -------- | -------------------------------------------------------------- |
  62. ]]