Skip to main content

A small package to handle YZE games mechanics

Project description

The main goal of this Python library is to propose an object to emulate Year Zero Engine dice throwing.

System supported:

  • Mutant: Year Zero
  • Forbidden Lands
  • Twilight 2000
  • Alien
  • Blade Runner

Example

. my_py_venv/bin/activate
git clone https://github.com/nlegrand/yze.git
cd yze
python -m pip install -e .
python
Python 3.11.3 (main, Apr  8 2023, 02:16:51) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from yze.dice import MutantDicePool
>>> d = MutantDicePool(attr=3, skill=2, gear=2)
>>> d.throw()
{'attr': [5, 6, 6], 'skill': [1, 4], 'gear': [6, 2]}
>>> d.push()
{'attr': [2, 6, 6], 'skill': [5, 2], 'gear': [6, 1]}
>>> from yze.dice import FBLDicePool
>>> fbl = FBLDicePool(attr=2, skill=1, artefact=12)
>>> fbl.throw()
{'attr': [2, 2], 'skill': [2], 'gear': [], 'artefact': (8, 2)}
>>> fbl.push()
{'attr': [2, 6], 'skill': [3], 'gear': [], 'artefact': (8, 2)}
>>> from yze.dice import AlienDicePool
>>> alien = AlienDicePool(pool=4, stress=1)
>>> alien.throw()
{'pool': [4, 1, 6, 1], 'stress': [2]}
>>> alien.push()
{'pool': [1, 3, 6, 2], 'stress': [1, 1]}

Benchmark

You can also benchmark dice throw to see what are your chances to get some successes or damage.

benchmark_mutant --throw 10000 --attribute 4 --skill 2 --gear 1
Throwing dice 10000 times !
    at least one success : 7243
    at least one pushed success : 9096
    at least one damage to attribute : 7245
    at least one damage to gear : 2767
{   'atleast_one': 7243,
    'atleast_one_attr_botch': 7245,
    'atleast_one_gear_botch': 2767,
    'atleast_one_pushed': 9096,
    'attribute_botched': {1: 4158, 2: 2404, 3: 622, 4: 61},
    'gear_botched': {1: 2767},
    'pushed_successes': {1: 2666, 2: 3304, 3: 2070, 4: 843, 5: 194, 6: 19},
    'successes': {1: 3895, 2: 2424, 3: 757, 4: 154, 5: 13}}

Yes I know, I can improve this output :). I'll do it!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yze-0.0.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yze-0.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file yze-0.0.1.tar.gz.

File metadata

  • Download URL: yze-0.0.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for yze-0.0.1.tar.gz
Algorithm Hash digest
SHA256 04ff9796ce8de42b554f838599aff2f1f0d3c332b5aae55beed4a58472586d58
MD5 8663cd0e446e45451a7771bfc7e08869
BLAKE2b-256 9784ebc716a64b46b32a73c92e115c41a9c87aff008f513317b8ef63fcb9a369

See more details on using hashes here.

File details

Details for the file yze-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: yze-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for yze-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90a5d290480009fcebf457b25d7742365b6fd14d257df28b4f9ab84acd41f21d
MD5 8cd2e4337fb18fce3a11efc6131d4af5
BLAKE2b-256 d1b21e74a3036f435c3b6785233f4a836687dbb0e87a5a0680aa2dbcd7242b77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page