Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
v2.4.2b
  • Loading branch information
ShawnDriscoll committed Nov 19, 2018
1 parent c835d3a commit 278d35a
Show file tree
Hide file tree
Showing 29 changed files with 64 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. image:: docs/source/python_classic_2_5_tag.png
:target: https://www.python.org/download/releases/2.5.4/

.. image:: docs/source/release_v2_4_1b_tag.png
.. image:: docs/source/release_v2_4_2b_tag.png
:target: https://readthedocs.org/projects/diceroll/downloads/pdf/latest

.. image:: https://readthedocs.org/projects/diceroll/badge/?version=latest
Expand Down
27 changes: 18 additions & 9 deletions diceroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
init() # initialize colorama

__version__ = '2.4'
__release__ = '2.4.1b'
__release__ = '2.4.2b'
__author__ = 'Shawn Driscoll <shawndriscoll@hotmail.com>\nshawndriscoll.blogspot.com'

diceroll_log = logging.getLogger('diceroll')
Expand Down Expand Up @@ -72,8 +72,11 @@ def _dierolls(dtype, dcount):
diceroll_log.debug('Using %d %d-sided dice...' % (dcount, dtype))

for i in range(dcount):
rolled = randint(1, dtype)
if rolled == 8 or rolled == 18:
if dtype == 10:
rolled = randint(1, 10) - 1
else:
rolled = randint(1, dtype)
if rolled == 8 or rolled == 11 or rolled == 18 or rolled >= 80 and rolled <= 89:
diceroll_log.debug('Rolled an %s' % rolled)
else:
diceroll_log.debug('Rolled a %s' % rolled)
Expand All @@ -90,7 +93,7 @@ def roll(dice):
Some examples are:
roll('D6') or roll('1D6') -- roll one 6-sided die
roll('2D6') -- roll two 6-sided dice
roll('D10') -- roll a 10-sided die (1 - 10)
roll('D10') -- roll a 10-sided die (0 - 9)
roll('D100') -- roll a 100-sided die (1 - 100)
roll('D66') -- roll for a D66 chart
roll('FLUX') -- a FLUX roll (-5 to 5)
Expand Down Expand Up @@ -291,9 +294,12 @@ def roll(dice):
diceroll_log.info('%s = %d%s+%d = %d and %d = %d' % (dice, num_dice, dice_type, dice_mod, roll_1, roll_2, rolled))
return rolled
elif dice_type == 'D100' and num_dice == 1:
roll_1 = (_dierolls(10, 1) - 1) * 10
roll_1 = _dierolls(10, 1) * 10
roll_2 = _dierolls(10, 1)
rolled = roll_1 + roll_2 + dice_mod
if roll_1 == 0 and roll_2 == 0:
rolled = 100 + dice_mod
else:
rolled = roll_1 + roll_2 + dice_mod
diceroll_log.info('%s = %d%s+%d = %d and %d + %d = %d' % (dice, num_dice, dice_type, dice_mod, roll_1, roll_2, dice_mod, rolled))
return rolled
elif dice_type == 'DD':
Expand All @@ -303,9 +309,12 @@ def roll(dice):
elif dice_type == 'D00' and num_dice == 1:
log.warning('D00 was deprecated in 1.9. Use D100 instead.')
diceroll_log.warning('D00 was deprecated in 1.9. Use D100 instead.')
roll_1 = (_dierolls(10, 1) - 1) * 10
roll_1 = _dierolls(10, 1) * 10
roll_2 = _dierolls(10, 1)
rolled = roll_1 + roll_2 + dice_mod
if roll_1 == 0 and roll_2 == 0:
rolled = 100 + dice_mod
else:
rolled = roll_1 + roll_2 + dice_mod
diceroll_log.info('%s = %d%s+%d = %d and %d + %d = %d' % (dice, num_dice, dice_type, dice_mod, roll_1, roll_2, dice_mod, rolled))
return rolled

Expand All @@ -318,7 +327,7 @@ def roll(dice):
print "Valid dice rolls are:"
print "roll('D6') or roll('1D6') -- roll one 6-sided die"
print "roll('2D6') -- roll two 6-sided dice"
print "roll('D10') -- roll a 10-sided die (1 - 10)"
print "roll('D10') -- roll a 10-sided die (0 - 9)"
print "roll('D100') -- roll a 100-sided die (1 - 100)"
print "roll('D66') -- roll for a D66 chart"
print "roll('FLUX') -- a FLUX roll (-5 to 5)"
Expand Down
Binary file removed diceroll_2.4.1b.zip
Binary file not shown.
Binary file modified docs/build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/license.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/tutorial.doctree
Binary file not shown.
Binary file removed docs/build/_images/release_v2_4_1b_tag.png
Binary file not shown.
Binary file added docs/build/_images/release_v2_4_2b_tag.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/build/about_the_author.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/debugging.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/designers_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/diceroll.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/glossary.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h1><strong>diceroll 2.4 Overview</strong><a class="headerlink" href="#diceroll-
<p>The free-to-use source is available at its <a class="reference external" href="https://github.com/ShawnDriscoll/diceroll/">GitHub</a> repository.</p>
<p>This documentation explains how to install and use the <strong>diceroll module</strong> for your gaming projects.</p>
<a class="reference external image-reference" href="https://www.python.org/download/releases/2.5.4/"><img alt="_images/python_classic_2_5_tag.png" src="_images/python_classic_2_5_tag.png" /></a>
<img alt="_images/release_v2_4_1b_tag.png" src="_images/release_v2_4_1b_tag.png" />
<img alt="_images/release_v2_4_2b_tag.png" src="_images/release_v2_4_2b_tag.png" />
<a class="reference external image-reference" href="http://diceroll.readthedocs.io/en/latest/?badge=latest"><img alt="Doc Status" src="https://readthedocs.org/projects/diceroll/badge/?version=latest" /></a>
<p>Download the <a class="reference external" href="https://readthedocs.org/projects/diceroll/downloads/pdf/latest">PDF</a> or the <a class="reference external" href="https://readthedocs.org/projects/diceroll/downloads/epub/latest">EPUB</a></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/xuyfLJbdDso" frameborder="0" allowfullscreen></iframe><ul>
Expand Down Expand Up @@ -165,7 +165,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/build/license.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h1><strong>Open Source</strong><a class="headerlink" href="#open-source" title=
<div class="section" id="mit-license">
<h2>MIT License<a class="headerlink" href="#mit-license" title="Permalink to this headline"></a></h2>
<p class="centered">
<strong>LICENSE AGREEMENT</strong></p><p>Copyright (c) 2017, SHONNER CORPORATION</p>
<strong>LICENSE AGREEMENT</strong></p><p>Copyright (c) 2018, SHONNER CORPORATION</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the &quot;Software&quot;), to deal
in the Software without restriction, including without limitation the rights
Expand Down Expand Up @@ -126,7 +126,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/build/modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<link rel="index" title="Global index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="top" title="diceroll 2.4 Operations Manual" href="index.html" />
<generator object at 0x0351FDF0>
<generator object at 0x03594080>

<script type="text/javascript">
DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX = true;
Expand Down Expand Up @@ -92,7 +92,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/samples.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/build/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<link rel="index" title="Global index" href="genindex.html" />
<link rel="search" title="Search" href="" />
<link rel="top" title="diceroll 2.4 Operations Manual" href="index.html" />
<generator object at 0x0351FBC0>
<generator object at 0x039A3238>
<script type="text/javascript" src="_static/searchtools.js"></script>

</head>
Expand Down Expand Up @@ -83,7 +83,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2018, SHONNER CORP.
Last updated on Nov 07, 2018.
Last updated on Nov 18, 2018.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down

0 comments on commit 278d35a

Please sign in to comment.