Adds a versatile function that will return a given current and maximum value as a "health bar" rendered with ANSI or xterm256 background color codes. This function has many options, such as being able to specify the length of the bar, its colors (including changing color depending on how full the bar is), what text is included inside the bar and how the text is justified within it.
This contrib module allows developers to generate an EvMenu instance with options sourced from a multi-line string, which supports categories, back and forth menu navigation, option descriptions, and passing selections to custom callbacks. This allows for easier dynamic menus and much faster deployment of simple menu trees which does not require the manual definition of menu nodes and option dictionary-lists.
This was an attempt to try to fix some strange 'unhandled error in
deffered' results while unit testing the contrib folder. It didn't
work, but it's probably good to do anyway.
I almost forgot - distance_inc is actually used by both
'approach' and 'withdraw', since approaching an object
might put you farther away from others. So, I moved it back
to its own function.
Adds a system for range and movement to the 'turnbattle' contrib. This is based on the abstract movement and positioning system I made for 'The World of Cool Battles', my learning project - fighters' absolute positions are not tracked, only their relative distance to each other and other objects. Commands for movement as well as distinction between melee and ranged attacks are included.
The unit tests for tb_basic and tb_equip are almost the same, with a few minor differences created by the different default values for unarmed attack and damage rolls.
Adds a new module, 'tb_equip', an implementation of the 'turnbattle' system that includes weapons and armor, which can be wielded and donned to modify attack damage and accuracy.
Moves the basic turnbattle module to a new module file in a new 'turnbattle' subfolder. Also fixes a minor bug where the first character in the turn order was not being initialized properly at the start of a fight.