diff options
| author | Julian Irwin <julian.irwin@gmail.com> | 2013-01-26 13:03:36 -0500 |
|---|---|---|
| committer | Julian Irwin <julian.irwin@gmail.com> | 2013-01-26 13:03:36 -0500 |
| commit | 96ec51791405fd8982fdda3ee430a0520f0a822c (patch) | |
| tree | 337afbc8831baddd574700b0a0150102d5120e69 /doc | |
| parent | 7f6cb008d54bb650662605ecd702089f87eea70d (diff) | |
| parent | f19f86792b33beaf2e1e12989a85557ae7fbc29c (diff) | |
Merge branch 'master' of git://github.com/takluyver/weatbag into southern-tiles-1
Getting everything up to date before I continue. Also see if anyone has added cool new features.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/api_misc.rst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/api_misc.rst b/doc/api_misc.rst index 674ab08..3a68d81 100644 --- a/doc/api_misc.rst +++ b/doc/api_misc.rst @@ -24,6 +24,26 @@ Understanding commands .. automodule:: weatbag.words +Combining items +--------------- + +To allow items to be combined to form other items, add a module in ``weatbag.items`` +with the same name as one of the items, replacing spaces with underscores. There, +define a function called ``combine``, which will take the name of a second +object. You only need to define this for one object; the game will try to find +it for both objects being combined. + +If the objects can be combined, it should describe what has happened, and return +a list of the new objects created. Otherwise, it should return ``None``. For +example, this function is in :mod:`weatbag.items.unlit_torch`:: + + def combine(other): + if other == 'match': + print("The torch sputters into life.") + return ['flaming torch'] + + return None + Utility functions ----------------- |
