Commit graph

3856 commits

Author SHA1 Message Date
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
Vincent Le Goff
7ddcae9d32 Add automatic escaping of color codes in the EvEditor 2017-04-04 11:37:36 -07:00
BlauFeuer
7010f998f1 Fold long lines, PEP 8, comparision to None
+Indent, comment and typo edits
2017-04-01 14:55:02 +02:00
BlauFeuer
684f163fd7 Fold long lines, PEP 8 whitespace
Keeping lines under 120 characters long, adjusting whitepace for closer PEP 8 compliance.
2017-04-01 14:51:25 +02:00
Griatch
c62f701626 Remove an extra quote marker typo. 2017-04-01 14:44:46 +02:00
BlauFeuer
3fdd7e0907 PEP 8, whitespace, LGTM, typo fixes 2017-04-01 14:44:46 +02:00
Griatch
4aba1b59b3 Add a brief mention of the superuser bypassing the locks of the simpledoor contrib. Resolves #1269. 2017-03-30 22:04:54 +02:00
BlauFeuer
6133280154 Explict bool return for move_to, typo fix 2017-03-30 01:27:34 -04:00
Vincent Le Goff
3811c074c6 Replace {character} by {object} in mapping of announce_move_* 2017-03-29 22:11:25 +02:00
Vincent Le Goff
f1d34a28aa Add additional mapping to announce_move_* hooks 2017-03-29 22:11:25 +02:00
Vincent Le Goff
4f41582127 Update Object.announce_move_* to take advantage of mapping 2017-03-29 22:11:25 +02:00
Griatch
d811d7577e Fix unittest compliance. 2017-03-29 22:00:27 +02:00
Griatch
f6e230f1a6 Change text optional kwarg type name to lowercase to match all other communications variables. Expand msg_contents to handle a tuple. 2017-03-29 21:50:51 +02:00
CloudKeeper1
c12306ff72 Adjustments to argument capitalisation.
Adjustments to argument capitalisation.
2017-03-29 18:16:19 +02:00
CloudKeeper1
4bbba76155 msg_contents doesn't take the text keyword in arguments.
Adjusted code so it works now...
2017-03-29 18:16:19 +02:00
CloudKeeper1
344a724479 Changed option entry to msg output kwarg.
Griatch - "That way it can still be parsed by the protocol if so needed, but it is also be passed on so the client can do custom stuff with it if it can."
2017-03-29 18:16:19 +02:00
CloudKeeper1
375cd7cecb Changed kwarg to options entry
Due to the set up of sessionhandler.clean_senddata the information is more appropriately stored in options.
2017-03-29 18:16:19 +02:00
CloudKeeper1
6cfbec83f1 Inclusion of type kwarg for common communications
Including a type kwarg for the say, whisper and pose commands allows the receivers of those messages to treat them differently depending on type. IMO This is a wide enough concern that it goes beyond a game specific requirement.
2017-03-29 18:16:19 +02:00
Eldritch Semblance
6224f90f74 Changed unit test's expected text output 2017-03-29 02:57:09 +00:00
Eldritch Semblance
534f4bcbe1 Removed insulting no mail message 2017-03-29 02:52:46 +00:00
Eldritch Semblance
a4e2744821 check if ooc or puppeting before finding player object 2017-03-29 02:46:44 +00:00
Griatch
21e72e416c Fix error in more edge calculation when using client with SCREENWIDTH=0. Resolves #1257. 2017-03-27 22:40:40 +02:00
Griatch
6f30ab09f5 Check slow exit deferred for .called state to avoid edge case errback. Resolves #1278. 2017-03-27 22:37:03 +02:00
eldritchsemblance
1ed559a71c Default email domain to example.com per RFC2606 2017-03-27 22:21:10 +02:00
Xelaadryth
12e0e2e4fd Fixing typo of local variable 2017-03-27 22:19:07 +02:00
Vincent Le Goff
4c4b97f994 Make sure CommandTest.call() returns the received message as is 2017-03-25 13:08:59 -07:00
Eldritch Semblance
66f5229240 change reference of self.caller.player to self.player 2017-03-25 11:43:41 +01:00
Griatch
6266401c2d Re-add bool return name, it is required by API generator. 2017-03-25 11:40:55 +01:00
BlauFeuer
99a24a9647 Docstring, comment, indent/whitespace edits
use of dict() to improve dictionary readability and shorten code
2017-03-25 11:38:47 +01:00
BlauFeuer
338899b8b1 Docstring, comments, indent/whitespace edits 2017-03-25 11:38:47 +01:00
BlauFeuer
b0ac809229 CmdLook use_dbref by Builders perm group #1251
Only allow referencing targets to view by #dbid if viewer is in Builders permission group
2017-03-25 10:44:59 +01:00
Eldritch Semblance
b2140b4ba1 gender character message don't try to substitute text that lacks gender info 2017-03-25 10:41:49 +01:00
Eldritch Semblance
8520d5f78c Escape pipes in @gender usage, fix gender substitution regex to respect escaped pipes 2017-03-25 10:41:49 +01:00
Vincent Le Goff
465a6336c5 The TestCommand.call() now returns the received message 2017-03-25 10:36:25 +01:00
BlauFeuer
a019a9d65a Docstring update suggestions
More explicit installation instructions, and help entry update:
The "forward" switch requires a message number.
2017-03-25 10:17:00 +01:00
Griatch
c4519d84e7 Remove spurious whitespace. 2017-03-25 10:01:56 +01:00
BattleJenkins
96ba31f858 Implemented default object's at_give() hook
Calls a new hook on the default object, at_give(), which passes the giving and receiving objects as arguments.
2017-03-25 10:01:56 +01:00
BattleJenkins
4e25c93888 Added at_give() hook to default object
Added another hook to the default object, at_give(), which will be called by the default give command.
2017-03-25 10:01:56 +01:00
BlauFeuer
ff3b293a4a Only parse as switches when directly after command 2017-03-25 09:56:58 +01:00