Commit graph

3894 commits

Author SHA1 Message Date
Vincent Le Goff
5e242589d9 Rewrite the README in a development-oriented documentation 2017-05-06 14:42:57 +02:00
Vincent Le Goff
841e0031ae Add the first draft of documentation for the event system 2017-05-06 14:42:57 +02:00
Tehom
5de1f7b45b Add dbclass to names of classdict for cache_size function to remove duplicate entries 2017-05-06 03:21:50 -04:00
Griatch
4d8d26fd21 Fix small typo in settings. Resolves #1316. 2017-05-03 22:52:08 +02:00
BattleJenkins
9b3ca3ef20 More thorough explanation of clothing types
Added some further explanation of clothing types and their purpose. I felt like it wasn't clear enough that you could change the given clothing types or even elect not to use clothing types at all in your own implementation of the system.
2017-04-30 21:59:41 +02:00
Griatch
477d7883c8 Fix so evennia.utils.delay actually returns a deferred as the docstring says. 2017-04-25 23:34:44 +02:00
Griatch
d012974650 Fix bug in irc disconnect, trying to pass a reason when portal.disconnect does not support one. 2017-04-25 22:59:59 +02:00
Griatch
6a621af4d7 Remove spurious whitespace from sources. 2017-04-23 14:06:27 +02:00
CloudKeeper1
9c37665f00 Updated documentation.
Updated documentation explaining use. Also mentioned the result of chaining get_inputs.
2017-04-23 14:06:27 +02:00
CloudKeeper1
4327bc48d3 Extended get_input to accept *args & **kwargs
Calling get_input with args and kwargs passes them to the callback function. Does not affect previous use so no changed required to existing code.
2017-04-23 14:06:27 +02:00
Tehom
7e8e47b3b3 Fix attribute name to resolve recursion error in _recache method. 2017-04-20 14:14:00 -04:00
BlauFeuer
ae2c2be8a1 Fix to color normalization end tag in Telnet.
Initial fix in #1243 does not account for empty string.
Addresses a potential problem in Telnet prompt similar to IndexError in telnet.py #1306
2017-04-19 06:40:51 +02:00
BlauFeuer
154799f6e0 Fix to color normalization end tag in ssh.
Initial fix in #1243 does not account for empty string.
Addresses a potential problem similar to IndexError in telnet.py #1306
2017-04-19 06:40:51 +02:00
Griatch
f7955340a7 Remove ability to teleport puppeted objects to a None location, as per #1304. 2017-04-18 18:29:11 +02:00
Griatch
feed89257f Fix indexing bug with using an accidental :: prefix in EvEditor, fix function of the ::: editor command. 2017-04-18 00:45:38 +02:00
Griatch
bc1f5f0fc9 Fix to color normalization end tag in telnet. Resolves #1306. 2017-04-17 08:52:18 +02:00
Griatch
0fb7d13d63 Correct for PEP8 compliance. Add contrib entry to README. 2017-04-17 08:43:01 +02:00
BattleJenkins
011ba18d5b Made command tests for clothing more robust
I added a lot more test cases to the command tests, ensuring that the system works as intended when given the appropriate arguments (as well as no arguments, as before).
2017-04-17 08:31:01 +02:00
BattleJenkins
8da7f45de8 Fixes in accordance with Griatch's suggestions
Made a few changes:

- Put the helper functions above the typeclasses in the module.
- Changed the example command given and changed the default clothing type 'body' to 'fullbody', so that clothing types aren't taken to mean wear locations by default
- Added note to CLOTHING_TYPE_AUTOCOVER explaining that only clothes that are already worn get auto-covered
- Fixed a traceback issue in CmdGive
2017-04-17 08:31:01 +02:00
BattleJenkins
5cc508393b Added unit tests for clothing module
Added in unit tests for the clothing module, including all commands, methods, and functions.
2017-04-17 08:31:01 +02:00
BattleJenkins
6c041b98a2 Typo fix
Fixed reintroduced typos from last commit. Still not using GitHub properly.
2017-04-17 08:31:01 +02:00
BattleJenkins
d0ba768fdb Change to inventory
Inventory command now outputs a single line when inventory is completely empty rather than two empty tables.
2017-04-17 08:31:01 +02:00
BattleJenkins
86f42228f3 Typo fix
Fixed a weird autocomplete-induced typo.
2017-04-17 08:31:01 +02:00
BattleJenkins
12ff57d883 Typo fix
Typoed 'Superuser' as 'Suuperuser'.
2017-04-17 08:31:01 +02:00
BattleJenkins
17f9a06a68 Provided example and fixed bugs
Added an example of use to the module descriptions, as well as fixed a couple of bugs where the at_get() hook wasn't functioning right and clothing with custom wear styles didn't appear correctly.
2017-04-17 08:31:01 +02:00
BattleJenkins
e7f0149bf8 Adds new 'clothing' contrib module
Adds a new contrib module, providing a system for wearable clothing objects that are appended to one's description. From the module itself:

Items of clothing can be used to cover other items, and many options are provided to define your own clothing types and their limits and behaviors. For example, to have undergarments automatically covered by outerwear, or to put a limit on the number of each type of item
that can be worn. Characters can also specify the style of wear for their clothing - I.E. to wear a scarf 'tied into a tight knot around the neck' or 'draped loosely across the shoulders' - to add an easy avenue of customization. The system as-is is fairly freeform - you can cover any garment with almost any other, for example - but it can easily be made more restrictive, and can even be tied into a system for armor or other equipment.

The unit tests have not been put in for this module yet, but I thought I would share it first to get people's thoughts!
2017-04-17 08:31:01 +02:00
Griatch
a9bee74b37 Some minor pep8 fixes and refactoring. 2017-04-11 08:35:30 +02:00
Griatch
63f4f04d77 Add a short description in the contrib README index. 2017-04-08 19:34:43 +02:00
Griatch
59f491eab4 Some minor adjustments for pep8. 2017-04-08 19:30:46 +02:00
BattleJenkins
005923ee72 Stop the turn handler script at the end of tests
Put in a line of code to stop the turn handler script when the tests are completed, as I think the script lingering and attempting to iterate causes problems with the Travis build.
2017-04-08 19:30:46 +02:00
BattleJenkins
6f565be81e Added turn handler script methods to tests
I added all of the turn handler script's methods to the unit tests (excluding at_creation, at_repeat, and at_stop) - so I think with the exception of those, my module is now fully covered by unit tests!
2017-04-08 19:30:46 +02:00
BattleJenkins
96ccfde9de Added tests for combat functions
All the tests are in for the combat functions! I think I just have to test the turn handler script's methods, and then I'll have full coverage.
2017-04-08 19:30:46 +02:00
BattleJenkins
32dbe4b396 Added kwargs to resolve_attack
Lets you pass values for attack and defense rolls, making it easier to test and extend.
2017-04-08 19:30:46 +02:00
BattleJenkins
822a17ba63 Added turnbattle command tests
Added unit tests for the combat commands in the new 'turnbattle.py' contrib module.
2017-04-08 19:30:46 +02:00
BattleJenkins
334eaf6929 Slight tweak to CmdAttack
Changed the order of the code in CmdAttack, so that it does not try to search for a target until it's established that it's a valid time to attack. This is so it doesn't raise a 'not found' error message along with the other error messages given.
2017-04-08 19:30:46 +02:00
BattleJenkins
2b0d657314 Better combat help + tweak to combat cleanup
With the help of Cloud_Keeper and vincent_lg in chat, I made the combat help command work much better - it doesn't copy swaths of code from the original help command anymore, and instead simply calls the default help with super() when the conditions for combat help aren't met.

I also moved a line from combat cleanup to the turn handler script, since combat cleanup is called when a character is initialized in combat and could remove the needed reference to the turn handler on the room prematurely, resulting in various errors if more than one fighter joined a fight in progress.
2017-04-08 19:30:46 +02:00
BattleJenkins
4e2a927bb4 Properly implemented joining a fight in progress
Some of the code for joining a fight in progress was imported from my project, The World of Cool Battles, but was not implemented completely. The turn handler script now properly puts a reference to itself in the current fight's room, and joining a combat in progress that one isn't already a part of now works properly.
2017-04-08 19:30:46 +02:00
BattleJenkins
4b113cb6c8 Added combat help, fixed oversight in CmdFight
Added a new command, 'CmdCombatHelp', which inherits from the default help command. Its behavior is identical to the normal 'help' command, except that it'll return a short list of combat commands when used in combat with no arguments. If there's a better way to implement this functionality, let me know, since it did involve copy-pasting a huge chunk of code from the Help command just to change one thing!

I also fixed a glaring oversight where using the 'fight' command while already in a fight would start a second fight.
2017-04-08 19:30:46 +02:00
BattleJenkins
fba536e979 Battle commands merged into command set
I merged all the battle commands into a command set together, which makes the module easier to install. The installation instructions have been changed to reflect this.
2017-04-08 19:30:46 +02:00
BattleJenkins
9073b688a6 Fixed log error + bug with timeout
Reworked the way the turn timeout countdown works - it's now less precise but also no longer gives errors. There may be a problem in the Evennia codebase with the default script object's force_repeat() method, but I was unable to figure out what.
2017-04-08 19:30:46 +02:00
BattleJenkins
de21883717 Fixed at_before_move() hook on player
Fixed some erroneous code in the at_before_move() hook that I must have forgotten to test properly. It now works as intended.
2017-04-08 19:30:46 +02:00
BattleJenkins
0606f2b0d8 Updated more documentation to standard
Moved docstrings in the middle of code to the 'Notes:' sections of their relevant functions, and added a missing 'Args:' section.
2017-04-08 19:30:46 +02:00
BattleJenkins
c1cbf0420c Minor tweaks
Fixed the header for the character code section, now that the command set is gone. Also, I forgot to mention, last commit I also fixed a bug where the timer wouldn't give a full 30 seconds for each characters turn if the turn progressed mid-interval.
2017-04-08 19:30:46 +02:00
BattleJenkins
9e6627aabd New functions + Change install method
Created a number of new functions for redundant code, including to initialize characters for combat and spending actions - also changed the suggested method of import, having the user import and add the commands. Adding the command set to BattleCharacter at creation was not persistent across reloads.
2017-04-08 19:30:46 +02:00
BattleJenkins
4e3b59e486 Made turn handler script more efficient
It turns out that changing the turn handler script to react to turn-ending commands instead of check for the end of the turn every single second was actually super easy. The script's interval has been increased from 1 second to 10 seconds, so it should fire off ten times less often now, AND instantly cycle the turn once a player has used all their actions.
2017-04-08 19:30:46 +02:00
BattleJenkins
49cf1220a6 Restore minor fixes
Restores some minor fixes I committed and accidentally reverted when I failed to update my local copy of the module. Note to self: start actually using GitHub correctly.
2017-04-08 19:30:46 +02:00
BattleJenkins
8849366ae9 Re-organized and more thoroughly documented
Implemented most of Griatch's requested changes, including documentation of every class and function, adherence to Google and Evennia's style guides, re-ordering of methods to show them defined before they are used, and a less intrusive install process. Tested before committing and found to function the same way as before. More changes to come, particularly to rework the turn handler script to be more efficient.
2017-04-08 19:30:46 +02:00
BattleJenkins
a070ee1971 Typo fix & Minor bugfix
Fixed a typo and accounted for a rare bug where the turn handler may skip forward two turns if a player acts the same second they would time out.
2017-04-08 19:30:46 +02:00
BattleJenkins
fab0403408 Added contrib module for turn-based battle system
This adds a new contrib file, a module that provides a simple framework for a tabletop style turn based battle system. From the module itself:

This is a framework for a simple turn-based combat system, similar
to those used in D&D-style tabletop role playing games. It allows
any character to start a fight in a room, at which point initiative
is rolled and a turn order is established. Each participant in combat
has a limited time to decide their action for that turn (30 seconds by
default), and combat progresses through the turn order, looping through
the participants until the fight ends.

Only simple rolls for attacking are implemented here, but this system
is easily extensible and can be used as the foundation for implementing
the rules from your turn-based tabletop game of choice or making your
own battle system.
2017-04-08 19:30:46 +02:00
BlauFeuer
f8b279d7bb Adjust docstring to resolve #1300
Also realigns code indent to multiple of 4 after `# ` is removed to uncomment
2017-04-06 19:12:40 -04:00