├── setup.py
├── feature_request.md
├── devnotes.md
├── CONTRIBUTING.md
├── README.md
├── LICENSE
└── scripts
└── dnd-tools
/setup.py:
--------------------------------------------------------------------------------
1 | from distutils.core import setup
2 |
3 | setup(
4 | name='dnd-tools',
5 | version='0.1.5',
6 | license='AGPL',
7 | scripts=[
8 | 'scripts/dnd-tools'
9 | ]
10 | )
11 |
--------------------------------------------------------------------------------
/feature_request.md:
--------------------------------------------------------------------------------
1 | **Requesting Features:**
2 |
3 | - [Make an issue report](https://github.com/savagezen/dnd-tools/issues/new)
4 | - Begin your title with ```[Feature Request] - ``` followed by the feature title
5 | - e.g. ```[Feature Request] - Magic Shop Generator```
6 | - e.g. ```[Feature Request] - Add Items from Xanthar's Guide to Everything```
7 | - Description:
8 | - **Is your feature request related to a problem? Please describe.**
9 | - A clear and concise description of what the problem is.
10 | - **Describe the solution you'd like**
11 | - A clear and concise description of what you want to happen.
12 | - **Describe alternatives you've considered**
13 | - A clear and concise description of any alternative solutions or features you've considered.
14 | - **Additional context**
15 | - Add any other context or screenshots about the feature request here.
--------------------------------------------------------------------------------
/devnotes.md:
--------------------------------------------------------------------------------
1 | **Development Notes:**
2 |
3 | *Reminder: after major feature update, change 'relver' and push to AUR*
4 |
5 | - [Setup.py Quickstart](https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/quickstart.html)
6 | - [Python - install script to system](https://stackoverflow.com/questions/874521/python-install-script-to-system)
7 | - [Sample PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=tovid)
8 | - [Git commit for package version](https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything)
9 | - [Check package sanity](https://wiki.archlinux.org/index.php/creating_packages#Checking_package_sanity)
10 | - ```$ namcap PKGBUILD```
11 | - [Added AGPLv3 license](https://choosealicense.com/licenses/agpl-3.0/#)
12 | - [Submit package to AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository#Submitting_packages)
13 | - Generate package info
14 | - ```.SRCINFO```; ```$ makepkg --printsrcinfo > .SRCINFO```
15 | - libraries going to stay internal to make cross platform support easier
16 |
17 | ---
18 |
19 |
20 | ---
21 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | #### Contributing to dnd-tools:
2 | ---
3 |
4 | Firstly, thank you for your use of and interest in contributing to this project! I am very open to pull requests and would be glad to see any and all suggestions and input. When contributing changes to the source code please also update ```version``` in [setup.py](https://github.com/savagezen/dnd-tools/blob/master/setup.py), see sample naming conventions below.
5 |
6 | ```
7 | Version 0.1.2
8 | |______ 0.x.x - STABLE: major version release, significant structural change effecting majority modules, major bug fix, milestone beta changes
9 | |______ x.1.x - BETA: bug fixes, feature additions / expansions, milestone alpha changes
10 | |______ x.x.2 - ALPHA: cosmetic, whitespace, typographical, formatting changes
11 | ```
12 |
13 | **Did you find or fix a bug?**
14 | Please review [issues tagged as bugs](https://github.com/savagezen/dnd-tools/labels/bug) before making a new issue report. Please be as clear and descriptive as possible when making bug reports, including output logs and what steps you've attempted to remedy the problem yourself. Contributions in this area would likely warrnat a *beta* version change, but depending on the frequency, severity, and number of modules effected by the bug, it could be a *major / stable* version change.
15 |
16 | **Did you find whatespce, format code, or make a cosmetic patch?**
17 | This project involves dozens of random generators and lots of handwritten text. The entire project was created by hand, from scratch. So, it is entirely possible that there are typos and foobars that would only be encountered at *random* and not necessarily seen before a commit is made. These are *alpha* version changes in the exmaple above.
18 |
19 | **Did you add a completely new feature / module?**
20 | The potential for adding features is limitless. In theory, every random table from the Dungeon Master's Guide could be added. New source material is constantly being published as well which means that there is a never ending influx of material that can be added. For example, loot from *Xanthar's Guide to Everything* or monsters from *Mordenkainen's Book of Foes*. These would be considered *beta* version changes in the example above.
21 |
22 | **Did you expand upon, or make an existing feature more efficient?**
23 | There are many ways to program something and I am certianly not a professional. So, if you find a more efficiently progrmatic way to complete a module I'd love to see what you come up with. Generally I would consider formatting an *alpha* version change, but depending on the degree of improvement in efficiency / scalability a *beta* version change may be warranted.
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # dnd-tools
2 |
3 | ... is a set of interactive command line tools for Dungeons and Dragons 5th Edition. This is the source code for the python scripts and install functions used to create the [dnd-tools AUR package](https://aur.archlinux.org/packages/dnd-tools/). The aim of this project, inspired by [donjon](http://donjon.bin.sh/), is to create an offline, cross-platform, gamemaster tool set -- since you probably have too many browser windows open already. :-D
4 |
5 | ---
6 |
7 | #### Features:
8 |
9 | - *Completely interactive:* prompted with start menu after every function
10 | - *Character generator:* any or all stat blocks and features can be randomized
11 | - *NPC generator:* 35 NPC classes with stat blocks populated as with character creation (fixed NPC stats are in the Monster Manual and many places online)
12 | - *Save generated character:* export generated character to text file
13 | - *Dice roller:* any number of dice, any number of sides
14 | - *Encounter calculator:* calculates modified experience per party size / level and monster party size (and CR)
15 | - *Loot generator:* random loot tables based on CR and number of enemies
16 | - *Initiative roller:* random d20 rolls for x number of players (raw / without initiaitve bonus)
17 | - *Tarokka card game:* tarot card game from Curse of Strahd
18 | - *Wild magic effects:* effect roller for Wild Magic sorcerers
19 |
20 | ---
21 |
22 | #### Installation / Usage:
23 |
24 | **Arch**:
25 | - See [Arch Wiki for Installing AUR Packages](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages)
26 | - [Download snapshot from AUR](https://aur.archlinux.org/packages/dnd-tools/)
27 |
28 | **Other Linux**:
29 | ~~~
30 | $ git clone https://github.com/gtbjj/dnd-tools
31 | $ cd dnd-tools
32 | $ sudo python setup.py install
33 | $ /usr/bin/dnd-tools
34 | ~~~
35 |
36 | **Windows:**
37 |
38 | - Install [Python for Windows](https://www.python.org/downloads/windows/)
39 | - Copy and paste [the raw script](https://raw.githubusercontent.com/gtbjj/dnd-tools/master/scripts/dnd-tools) to a text editor
40 | - Save the script as ```dnd-tools.py```
41 | - [Execute script in terminal with Python](http://pythoncentral.io/execute-python-script-file-shell/)
42 |
43 | ---
44 | **To Do / Feature Requests:**
45 | If you would like a feature added, first check [issues tagged as enhancements](https://github.com/savagezen/dnd-tools/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement). If you do not see the feature you are looking for, follow the [issue template for feature requests](https://github.com/savagezen/dnd-tools/blob/master/feature_request.md).
46 |
47 | **Bugs:**
48 | Please review [issues tagged as bugs](https://github.com/savagezen/dnd-tools/labels/bug) before making a new issue report. Be as clear and descriptive as possible when making bug reports, including output logs and what steps you've attempted to remedy the problem yourself.
49 |
50 | **Contributing:**
51 | See [CONTRIBUTING.md](https://github.com/savagezen/dnd-tools/blob/master/CONTRIBUTING.md).
52 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published
637 | by the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/scripts/dnd-tools:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | from __future__ import print_function, division
3 |
4 |
5 | ###########
6 | # Imports #
7 | ###########
8 |
9 | import sys
10 | import math
11 | import random
12 | import itertools
13 |
14 | try:
15 | # Use the system PRNG if possible
16 | random = random.SystemRandom()
17 | except NotImplementedError:
18 | import warnings
19 | warnings.warn("A secure pseudo-random number generator is not available "
20 | "on your system. Falling back to Mersenne Twister.")
21 |
22 | # Python 2 compatibility
23 | try:
24 | range = xrange
25 | input = raw_input
26 | except NameError:
27 | pass
28 |
29 |
30 | ##########################
31 | # Lists and Dictionaries #
32 | ##########################
33 |
34 | def expand(d):
35 | ret = {}
36 | for k in d:
37 | v = d[k]
38 | if isinstance(k, range):
39 | ret.update({i: v for i in k})
40 | else:
41 | ret[k] = v
42 | return ret
43 |
44 |
45 | gem_10 = expand({
46 | 1: "Azurite",
47 | 2: "Banded Agate",
48 | 3: "Blue Quartz",
49 | 4: "Eye Agate",
50 | 5: "Hematite",
51 | 6: "Lapis Lazuli",
52 | 7: "Malchite",
53 | 8: "Moss Agate",
54 | 9: "Obsidian",
55 | 10: "Rhodochrosite",
56 | 11: "Tiger Eye",
57 | 12: "Turquoise"
58 | })
59 |
60 | gem_50 = expand({
61 | 1: "Bloodstone",
62 | 2: "Carnelian",
63 | 3: "Chalcedony",
64 | 4: "Chrysoprase",
65 | 5: "Citrine",
66 | 6: "Jasper",
67 | 7: "Moonstone",
68 | 8: "Onyx",
69 | 9: "Quartz",
70 | 10: "Sardonyx",
71 | 11: "Star rose quartz",
72 | 12: "Zircon"
73 | })
74 |
75 | gem_100 = expand({
76 | 1: "Amber",
77 | 2: "Amethyst",
78 | 3: "Chrysoberyl",
79 | 4: "Coral",
80 | 5: "Garnet",
81 | 6: "Jade",
82 | 7: "Jet",
83 | 8: "Pearl",
84 | 9: "Spinel",
85 | 10: "Tourmaline"
86 | })
87 |
88 | gem_500 = expand({
89 | 1: "Alexandrite",
90 | 2: "Aquamarine",
91 | 3: "Black Pearl",
92 | 4: "Blue Spinel",
93 | 5: "Peridot",
94 | 6: "Topaz"
95 | })
96 |
97 | gem_1000 = expand({
98 | 1: "Black Opal",
99 | 2: "Blue Sapphire",
100 | 3: "Emerald",
101 | 4: "Fire Opal",
102 | 5: "Opal",
103 | 6: "Star Ruby",
104 | 7: "Star Sapphire",
105 | 8: "Yellow Sapphire"
106 | })
107 |
108 | gem_5000 = expand({
109 | 1: "Black Sapphire",
110 | 2: "Diamond",
111 | 3: "Jacinth",
112 | 4: "Ruby"
113 | })
114 |
115 | art_25 = expand({
116 | 1: "Silver ewer",
117 | 2: "Carved bone statuette",
118 | 3: "Small gold bracelet",
119 | 4: "Cloth-of-gold vestments",
120 | 5: "Black velvet mask stitched with silver thread",
121 | 6: "Copper chalice with silver filigree",
122 | 7: "Pair of engraved bone dice",
123 | 8: "Small mirror set in a painted wooden frame",
124 | 9: "Embroidered silk handkerchief",
125 | 10: "gold locket with a painted portrait inside"
126 | })
127 |
128 | art_250 = expand({
129 | 1: "Gold ring set with bloodstones",
130 | 2: "Carved ivory statuette",
131 | 3: "Large gold bracelet",
132 | 4: "Silver necklace with gemstone pendant",
133 | 5: "Bronze crown",
134 | 6: "Silk robe with gold embroidery",
135 | 7: "Large well-made tapestry",
136 | 8: "Brass mug with jade inlay",
137 | 9: "Box of turquoise animal figurines",
138 | 10: "Gold bird cage with electrum filigree"
139 | })
140 |
141 | art_750 = expand({
142 | 1: "Silver chalice with moonstones",
143 | 2: "Sliver-plated steel longsword with jet set in hilt",
144 | 3: "Carved hard of exotic wood with ivory inlay and zirconb gems",
145 | 4: "Small gold idol",
146 | 5: "Gold dragon comb set with red garnets as eyes",
147 | 6: "Bottle stopper cork embossed with gold leaf and set with amethysts",
148 | 7: "Ceremonial electrum dagger with a black pearl in the pommel",
149 | 8: "Silver and gold brooch",
150 | 9: "Obsidian statuette with gold fittings and inlay",
151 | 10: "Painted gold war mask"
152 | })
153 |
154 | art_2500 = expand({
155 | 1: "Fine gold chain set with a fire opal",
156 | 2: "Old masterpiece painting",
157 | 3: "Embroidered silk and velvet mantle set with numerous moonstones",
158 | 4: "Platinum bracelet set with a sapphire",
159 | 5: "Embroidered glove set with jewel chips",
160 | 6: "Jeweled anklet",
161 | 7: "Gold music box",
162 | 8: "Gold circlet set with four aquamarines",
163 | 9: "Eye patch with a mock eye set in blue sapphire and moonstone",
164 | 10: "A necklace string of small pink pearls"
165 | })
166 |
167 | art_7500 = expand({
168 | 1: "Jeweled gold crown",
169 | 2: "Jeweled platinum ring",
170 | 3: "Small gold statuette set with rubies",
171 | 4: "Gold cup set with emeralds",
172 | 5: "Gold jewlery box with platinum filigree",
173 | 6: "Painted gold child sarcophagus",
174 | 7: "Jade game board with solid gold playing pieces",
175 | 8: "Bejeweled ivory drinking horn with gold filigree"
176 | })
177 |
178 | item_a = expand({
179 | range(1, 50): "Potion of healing",
180 | range(51, 60): "Spell scroll - cantrip",
181 | range(61, 70): "Potion of climbing",
182 | range(71, 90): "Spell scroll - 1st level",
183 | range(91, 94): "Spell scroll - 2nd level",
184 | range(95, 98): "Potion of greater healing",
185 | 99: "Bag of holding",
186 | 100: "Driftglobe"
187 | })
188 |
189 | item_b = expand({
190 | range(1, 15): "Potion of greater healing",
191 | range(16, 22): "Potrange of keys in dictionaryion of fire breath",
192 | range(23, 29): "Potion of resistance",
193 | range(30, 34): "Ammunition, +1",
194 | range(35, 39): "Potion of animal friendship",
195 | range(40, 44): "Potion of hill giant strength",
196 | range(45, 49): "Potion of growth",
197 | range(50, 54): "Potion of water breathing",
198 | range(55, 59): "Spell scroll - 2nd level",
199 | range(60, 64): "Spell scroll - 3rd level",
200 | range(65, 67): "Bag of holding",
201 | range(68, 70): "Keoghtom ointment",
202 | range(71, 72): "Oil of slipperiness",
203 | range(74, 75): "Dust of disappearance",
204 | range(76, 77): "Dust of dryness",
205 | range(78, 79): "Dust of sneezing and choking",
206 | range(80, 81): "Elemental gem",
207 | range(82, 83): "Philter of love",
208 | 84: "Alchemy jug",
209 | 85: "Cap of water breathing",
210 | 86: "Cloak of the manta ray",
211 | 87: "Driftglobe",
212 | 88: "Goggles of night",
213 | 89: "Helm of comprehending languages",
214 | 90: "Immovable rod",
215 | 91: "Lantern of revealing",
216 | 92: "Mariner armor",
217 | 93: "Mithral armor",
218 | 94: "Potion of poison",
219 | 95: "Ring of swimming",
220 | 96: "Robe of useful items",
221 | 97: "Rope of climbing",
222 | 98: "Saddle of the cavalier",
223 | 99: "Wand of magic detection",
224 | 100: "Wand of secrets"
225 | })
226 |
227 | item_c = expand({
228 | range(1, 15): "Potion of superior healing",
229 | range(16, 22): "Spell scroll - 4th level",
230 | range(23, 27): "Ammunition, +2",
231 | range(28, 32): "Potion of clairvoyance",
232 | range(33, 37): "Potion of diminution",
233 | range(38, 42): "Potion of gaseous form",
234 | range(43, 47): "Potion of frost giant strength",
235 | range(48, 52): "Potion of stone giant strength",
236 | range(53, 57): "Potion of heroism",
237 | range(58, 62): "Potion of invulnerability",
238 | range(63, 67): "Potion of mind reading",
239 | range(68, 72): "Spell scroll - 5th level",
240 | range(73, 75): "Elixer of health",
241 | range(76, 78): "Oil of etherealness",
242 | range(79, 81): "Potion of fire giant strength",
243 | range(82, 84): "Quaal feather token",
244 | range(85, 87): "Scroll of protection",
245 | range(88, 89): "Bag of beans",
246 | range(90, 91): "Bead of force",
247 | 92: "Chime of endless water",
248 | 93: "Decanter of endless water",
249 | 94: "Eyes of minute seeing",
250 | 95: "Folding boat",
251 | 96: "Heward handy haversack",
252 | 97: "Horseshoes of speed",
253 | 98: "Necklace of fireballs",
254 | 99: "Periapt of health",
255 | 100: "Sending stones"
256 | })
257 |
258 | item_d = expand({
259 | range(1, 20): "Potion of supreme healing",
260 | range(21, 30): "Potion of invisibility",
261 | range(31, 40): "Potion of speed",
262 | range(41, 50): "Spell scroll - 6th level",
263 | range(51, 57): "Spell scroll - 7th level",
264 | range(58, 62): "Ammunition, +3",
265 | range(63, 67): "Oil of sharpness",
266 | range(68, 72): "Potion of flying",
267 | range(73, 77): "Potion of cloud giant strength",
268 | range(78, 82): "Potion of longevity",
269 | range(83, 87): "Potion of vitality",
270 | range(88, 92): "Spell scroll - 8th level",
271 | range(93, 95): "Horseshoes of zephyr",
272 | range(96, 98): "Nolzur marvelous pigments",
273 | 99: "Bag of devouring",
274 | 100: "Portable hole"
275 | })
276 |
277 | item_e = expand({
278 | range(1, 30): "Spell scroll - 8th level",
279 | range(31, 55): "Potion of storm giant strength",
280 | range(56, 70): "Potion of supreme healing",
281 | range(71, 85): "Spell scroll - 9th level",
282 | range(86, 93): "Universal solvent",
283 | range(94, 98): "Arrow of slaying",
284 | range(99, 100): "Sovereign glue"
285 | })
286 |
287 | item_f = expand({
288 | range(1, 15): "Weapon, +1",
289 | range(16, 18): "Sheild, +1",
290 | range(19, 21): "Sentinel shield",
291 | range(24, 25): "Boots of elvenkind",
292 | range(26, 27): "Boots of striding and springing",
293 | range(28, 29): "Bracers of archery",
294 | range(30, 31): "Brooch of shielding",
295 | range(32, 33): "Broom of flying",
296 | range(34, 35): "Cloak of elvenkind",
297 | range(36, 37): "Cloak of protection",
298 | range(38, 39): "Gauntlets of ogre power",
299 | range(40, 41): "Hat of disguise",
300 | range(42, 43): "Javelin of lightning",
301 | range(44, 45): "Pearl of power",
302 | range(46, 47): "Rod of the pact keeper, +1",
303 | range(48, 49): "Slippers of spider climbing",
304 | range(50, 51): "staff of the adder",
305 | range(52, 53): "Staff of the python",
306 | range(54, 55): "Sword of vengeance",
307 | range(56, 57): "Trdient of fish command",
308 | range(58, 59): "Want of magic missiles",
309 | range(60, 61): "Wand of the war mage, +1",
310 | range(62, 63): "Wand of web",
311 | range(64, 65): "Weapon of warning",
312 | 66: "Adamantine chain male",
313 | 67: "Adamantine chain shirt",
314 | 68: "Adamantine scale male",
315 | 69: "Bag of tricks - gray",
316 | 70: "Bag of tricks - rust",
317 | 71: "Bag of tricks - tan",
318 | 72: "Boots of the winterlands",
319 | 73: "Circlet of blasting",
320 | 74: "Deck of illusions",
321 | 75: "Eversmoking bottle",
322 | 76: "Eyes of charming",
323 | 77: "Eyes of the eagle",
324 | 78: "Figurine of wondrous power - silver raven",
325 | 79: "Gem of brightness",
326 | 80: "Gloves of missile snaring",
327 | 81: "Gloves of swimming and climbing",
328 | 82: "Glove of thievery",
329 | 83: "Headband of intellect",
330 | 84: "Helm of telepathy",
331 | 85: "Doss lute of the bards",
332 | 86: "Fochlucan bandor of the bards",
333 | 87: "Mac-Fuimidh cittern of the bards",
334 | 88: "Medallion of thoughts",
335 | 89: "Necklace of adaptation",
336 | 90: "Periapt of wound closure",
337 | 91: "Pipes of haunting",
338 | 92: "Pipes of sewers",
339 | 93: "Ring of jumping",
340 | 94: "Ring of mind shielding",
341 | 95: "Ring of warmth",
342 | 96: "Ring of water walking",
343 | 97: "Quiver of Ehlonna",
344 | 98: "Stone of good luck",
345 | 99: "Wind fan",
346 | 100: "Winged boots"
347 | })
348 |
349 | item_g = expand({
350 | range(1, 11): "Weapon, +2",
351 | 15: "Adamantine breastplate",
352 | 16: "Adamantine splint male",
353 | 17: "Amulet of health",
354 | 18: "Armor of vulnerability",
355 | 19: "Arrow-catching shiled",
356 | 20: "Belt of dwarvenkind",
357 | 21: "Belt of hill giant strength",
358 | 22: "Berserker axe",
359 | 23: "Boots of levitation",
360 | 24: "Boots of speed",
361 | 25: "Bowl of commanding water elementals",
362 | 26: "Bracers of defense",
363 | 27: "Brazier of commanding fire elementals",
364 | 28: "Cape of the mountebank",
365 | 29: "Censer of controlling air elementals",
366 | 30: "Armor, +1 chain male",
367 | 31: "Chain male of resistance",
368 | 32: "Armor, +1 chain shirt",
369 | 33: "Chain shirt of resistance",
370 | 34: "Cloak of displacement",
371 | 35: "Cloak of the bat",
372 | 36: "Cube of force",
373 | 37: "Daern instant fortress",
374 | 38: "Dagger of venom",
375 | 39: "Dimensional shackles",
376 | 40: "Dragon slayer",
377 | 41: "Elven chain",
378 | 42: "Flame tongue",
379 | 43: "Gem of seeing",
380 | 44: "Giant slayer",
381 | 45: "Glamoured studded leather",
382 | 46: "Helm of teleportation",
383 | 47: "Horn of blasting",
384 | 48: "Horn of Valhalla - silver or brass",
385 | 49: "Canaith mandolin of the bards",
386 | 50: "Cli lyre of the bards",
387 | 51: "Ioun stone - awareness",
388 | 52: "Ioun stone - protection",
389 | 53: "Ioun stone - reserve",
390 | 54: "Ioun stone - sustenance",
391 | 55: "Iron bands of Bilarro",
392 | 56: "Armor, +1 leather",
393 | 57: "Armor of resistance (leather)",
394 | 58: "Mace of disruption",
395 | 60: "Mace of smiting",
396 | 61: "Mantle of spell resistance",
397 | 62: "Necklace of prayer beads",
398 | 63: "Periapt of proof against poison",
399 | 64: "Ring of animal influence",
400 | 65: "Ring of evasion",
401 | 66: "Ring of feather falling",
402 | 67: "Ring of free action",
403 | 68: "Ring of protection",
404 | 69: "Ring of resistance",
405 | 70: "Ring of spell storing",
406 | 71: "Ring of the ram",
407 | 72: "Ring of x-ray vision",
408 | 73: "Robe of eyes",
409 | 74: "Rod of ruleship",
410 | 75: "Rod of the pact keeper, +2",
411 | 76: "Rope of entanglement",
412 | 77: "Armor, +1 scale mail",
413 | 78: "Scale mail of resistance",
414 | 79: "Shield, +2",
415 | 80: "Shield of missile attraction",
416 | 81: "Staff of charming",
417 | 82: "Staff of healing",
418 | 83: "Staff of swarming insects",
419 | 84: "Staff of the woodlands",
420 | 85: "Staff of withering",
421 | 86: "Stone of controlling earth elementals",
422 | 87: "Sun blade",
423 | 88: "Sword of life stealing",
424 | 89: "Sword of wounding",
425 | 90: "Tentacle rod",
426 | 91: "Vicious weapon",
427 | 92: "Wand of blinding",
428 | 93: "Wand of enemy detection",
429 | 94: "Wand of fear",
430 | 95: "Wand of fireballs",
431 | 96: "Wand of lightning bolts",
432 | 97: "Wand of paralysis",
433 | 98: "Wand of the war mage, +2",
434 | 99: "Wand of wonder",
435 | 100: "Wings of flying"
436 | })
437 |
438 | item_g_12 = expand({
439 | 1: "Figurine of wondrous power - bronze griffon",
440 | 2: "Figurine of wondrous power - ebony fly",
441 | 3: "Figurine of wondrous power - golden lions",
442 | 4: "Figurine of wondrous power - ivory goats",
443 | 5: "Figurine of wondrous power - marble elephant",
444 | range(6, 7): "Figurine of wondrous power - onyx dog",
445 | 8: "Figurine of wondrous power - serpentine owl",
446 | })
447 |
448 | item_h = expand({
449 | range(1, 10): "Weapon, +3",
450 | range(11, 12): "Amulet of the planes",
451 | range(13, 14): "Carpet of flying",
452 | range(15, 16): "Crystal ball (very rare version)",
453 | range(17, 18): "Ring of regeneration",
454 | range(19, 20): "Ring of shooting stars",
455 | range(21, 22): "Ring of telekinesis",
456 | range(23, 24): "Robe of scintillating colors",
457 | range(25, 26): "Robe of stars",
458 | range(27, 28): "Rod of absorption",
459 | range(29, 30): "Rod of alertness",
460 | range(31, 32): "Rod of security",
461 | range(33, 34): "Rod of the pact keeper, +3",
462 | range(35, 36): "Scimitar of speed",
463 | range(37, 38): "Shield, +3",
464 | range(39, 40): "Staff of fire",
465 | range(41, 42): "Staff of frost",
466 | range(43, 44): "Staff of power",
467 | range(45, 46): "Staff of striking",
468 | range(47, 48): "Staff of thunder and lightning",
469 | range(49, 50): "Sword of sharpness",
470 | range(51, 52): "Wand of polymorph",
471 | range(53, 54): "Wand of the war mage, +3",
472 | 55: "Adamantine half plate",
473 | 56: "Adamantine full plate",
474 | 57: "Animated shield",
475 | 58: "Belt of fire giant strength",
476 | 59: "Belt of frost (or stone) giant strength",
477 | 60: "Breastplate, +1",
478 | 61: "Candle of invocation",
479 | 63: "Chainmail, +2",
480 | 64: "Chain shirt, +2",
481 | 65: "Cloak of arachnida",
482 | 66: "Dancing sword",
483 | 67: "Demon armor",
484 | 68: "Dragon scale mail",
485 | 69: "Dwarven plate",
486 | 70: "Dwarven thrower",
487 | 71: "Efreeti bottle",
488 | 72: "Figurine of wondrous power (obsidian steed)",
489 | 73: "Frost brand",
490 | 74: "Helm of brilliance",
491 | 75: "Horn of Valhalla (bronze)",
492 | 76: "Anstruth harp of the bards",
493 | 77: "Ioun stone - absorption",
494 | 78: "Ioun stone - agility",
495 | 79: "Ioun stone - fortitude",
496 | 80: "Ioun stone - insight",
497 | 81: "Ioun stone - intellect",
498 | 82: "Ioun stone - leadership",
499 | 83: "Ioun stone - strength",
500 | 84: "Armor, +2 leather",
501 | 85: "Manual of bodily health",
502 | 86: "Manual of gainful exercise",
503 | 87: "Manual of golems",
504 | 88: "Manual of quickness of action",
505 | 89: "Mirror of life trapping",
506 | 90: "Nine lives stealer",
507 | 91: "Oathbow",
508 | 92: "Scale mail, +2",
509 | 93: "Spellguard shield",
510 | 94: "Armor, +1 splint",
511 | 95: "Splint armor of resistance",
512 | 96: "Studded leather armor, +1",
513 | 97: "Studded leather armor of resistance",
514 | 98: "tome of clear thought",
515 | 99: "Tome of leadership and influence",
516 | 100: "Tome of understanding"
517 | })
518 |
519 | item_i = expand({
520 | range(1, 5): "Defender",
521 | range(6, 10): "Hammer of thunderbolts",
522 | range(11, 15): "Luck blade",
523 | range(16, 20): "Sword of answering",
524 | range(21, 23): "Holy avenger",
525 | range(24, 26): "Ring of djinni summoning",
526 | range(27, 29): "Ring of invisibility",
527 | range(30, 32): "Ring of spell turning",
528 | range(33, 35): "Rod of lordly might",
529 | range(36, 38): "Staff of the magi",
530 | range(39, 41): "Vorpal sword",
531 | range(42, 43): "Belt of cloud giant strength",
532 | range(44, 45): "Breastplate, +2",
533 | range(46, 47): "Chain mail, +3",
534 | range(48, 49): "Chain shirt, +3",
535 | range(50, 51): "Cloak of invisibility",
536 | range(52, 53): "Crystal ball (legendary version)",
537 | range(54, 55): "Half plate, +1",
538 | range(56, 57): "Iron flask",
539 | range(58, 59): "Leather armor, +3",
540 | range(60, 61): "Plate armor, +1",
541 | range(62, 63): "Robe of the archmagi",
542 | range(64, 65): "Rod of ressurection",
543 | range(66, 67): "Scale mail, +1",
544 | range(68, 69): "Scarab of protection",
545 | range(70, 71): "Splint armor, +2",
546 | range(72, 73): "Studded leather armor, +2",
547 | range(74, 75): "Well of many worlds",
548 | 77: "Apparatus of Kwalish",
549 | 78: "Armor of invulnerability",
550 | 79: "Belt of storm giant strength",
551 | 80: "Cubic gate",
552 | 81: "Deck of many things",
553 | 82: "Efretti chain",
554 | 83: "Half plate armor of resistance",
555 | 84: "Horn of Valhalla (iron)",
556 | 85: "Ollamh harp of the bards",
557 | 86: "Ioun stone - greater absorption",
558 | 87: "Ioun stone - mastery",
559 | 88: "Ioun stone - regeneration",
560 | 89: "Plate armor of etherealness",
561 | 90: "Plate armor of resistance",
562 | 91: "Ring of air elemental command",
563 | 92: "Ring of earth elemental command",
564 | 93: "Ring of fire elemental command",
565 | 94: "Ring of three wishes",
566 | 95: "Ring of water elemental command",
567 | 96: "Sphere of annihilation",
568 | 97: "Talisman of pure good",
569 | 98: "Talisman of the sphere",
570 | 99: "Talisman of ultimate evil",
571 | 100: "Tome of the stilled tongue"
572 | })
573 |
574 | item_i_76 = expand({
575 | range(1, 2): "Half plate, +2",
576 | range(3, 4): "Plate armor, +2",
577 | range(5, 6): "Studded leather armor, +3",
578 | range(7, 8): "Breastplate, +3",
579 | range(9, 10): "Splint armor, +3",
580 | 11: "Half plate armor, +3",
581 | 12: "Full plate armor, +3"
582 | })
583 |
584 | cr_xp = expand({
585 | 0: 10,
586 | 1 / 8: 25,
587 | 1 / 4: 50,
588 | 1 / 2: 100,
589 | 1: 200,
590 | 2: 450,
591 | 3: 700,
592 | 4: 1100,
593 | 5: 1800,
594 | 6: 2300,
595 | 7: 2900,
596 | 8: 3900,
597 | 9: 5000,
598 | 10: 5900,
599 | 11: 7200,
600 | 12: 8400,
601 | 13: 10000,
602 | 14: 11500,
603 | 15: 13000,
604 | 16: 15000,
605 | 17: 18000,
606 | 18: 20000,
607 | 19: 22000,
608 | 20: 25000,
609 | 21: 33000,
610 | 22: 41000,
611 | 23: 50000,
612 | 24: 62000,
613 | 25: 75000,
614 | 26: 90000,
615 | 27: 105000,
616 | 28: 120000,
617 | 29: 135000,
618 | 30: 155000,
619 | })
620 |
621 | item_loot = []
622 |
623 | card_deck = [
624 | "Hooded One (7) ",
625 | "Enchanter (3) ",
626 | "Shepherd (4) ",
627 | "Tempter ",
628 | "Raven ",
629 | "Seer ",
630 | "Swashbuckler (1) ",
631 | "Executioner ",
632 | "Ghost ",
633 | "Warrior ",
634 | "Tax Collector (8) ",
635 | "Anarchist (6) ",
636 | "Marionette ",
637 | "Miser (9) ",
638 | "Torturer (9) ",
639 | "Priest ",
640 | "Traitor (9) ",
641 | "Paladin (2) ",
642 | "Thief (7) ",
643 | "Beast ",
644 | "Guild Member (5) ",
645 | "Healer (3) ",
646 | "Darklord ",
647 | "Myrmidon (5) ",
648 | "Elementalist (5) ",
649 | "Diviner (2) ",
650 | "Abjurer (4) ",
651 | "Artifact ",
652 | "Avenger (1) ",
653 | "Beggar (6) ",
654 | "Beserker (6) ",
655 | "Bishop (8) ",
656 | "Broken One ",
657 | "Charlatan (7) ",
658 | "Conjurer (9) ",
659 | "Dictator (8) ",
660 | "Donjon ",
661 | "Druid (5) ",
662 | "Evoker (6) ",
663 | "Horseman ",
664 | "Illusionist (7) ",
665 | "Innocent ",
666 | "Missionary (2) ",
667 | "Mists ",
668 | "Monk (1) ",
669 | "Necromancer (8) ",
670 | "Philanthropist (2)",
671 | "Rogue ",
672 | "Soldier (3) ",
673 | "Trader (3) ",
674 | "Transmuter (1) ",
675 | "Wizard ",
676 | "Mercenary (4) ",
677 | "Merchant (4) "
678 | ]
679 |
680 | race_desc = [
681 | "Dwarf - Bold, hardy, warrior, miner, long memory and grudges",
682 | "Mountain Dwarf - Strong, hardy, rugged, tall for a dwarf",
683 | "Hill Dwarf - Keen senses, deep intuition, remarkable resilience",
684 | "Elf - Magical people of otherworldly grace, in but not of the world",
685 | "Wood Elf - Keen senses and intuition, fleet feet, and stealth",
686 | "High Elf - Keen mind and master of basic magic",
687 | "Drow - Follow the god Lolth down the path of evil and corruption",
688 | "Halfling - You love peace, food, hearth, and home",
689 | "Lightfoot Halfling - You can easily hide, are inclined to get along with others",
690 | "Stout Halfling - Hardier than average and may be part dwarven blood",
691 | "Human - Young, short-lived race, innovators and achievers",
692 | "Dragonborn - A servant to dragons, a warrior, or a drifter",
693 | "Gnome - You delight in life, are an inventor, explorer, and explorer",
694 | "Forest Gnome - Knack for illusion and inherent quickness and stealth",
695 | "Half-Elf - Curious, inventive, ambitious, love nature, artistic",
696 | "Half-Orc - Adventurer with savage fury and barbaric customs",
697 | "Tiefling - Demonic heritage, self-reliant, suspicious, drifter"
698 | ]
699 |
700 | race_short = [
701 | "Dwarf", "Mountain Dwarf", "Hill Dwarf", "Elf", "Wood Elf", "High Elf", "Drow", "Halfling", "Lightfoot Halfling", "Stout Halfling", "Human", "Dragonborn", "Gnome", "Forest Gnome", "Half-Elf", "Half-Orc", "Tiefling"
702 | ]
703 |
704 | class_desc = [
705 | "Barbarian - The relentless combatant fueld by fury.",
706 | "Bard - A story witty storyteller or musician.",
707 | "Cleric - A holy man capable of helaing wounds.",
708 | "Druid - A nomad devoted to the powers of Nature",
709 | "Fighter - The skilled combatant and strategist.",
710 | "Monk - A martial artist pulling bodily powers.",
711 | "Paladin - A novice fighter bolstered by divine magic.",
712 | "Ranger - One who blends wilderness knowledge and martial ability",
713 | "Rogue - The theif, assassin, and stealthy character.",
714 | "Sorcerer - A magic user who draws power from within.",
715 | "Warlock - Pacted to a deity for empowering spells.",
716 | "Wizard - Keeper of arcane secrets and manipulator of magic."
717 | ]
718 |
719 | # Class Descriptions - https://redd.it/2e9vzl
720 |
721 | class_short = [
722 | "Barbarian", "Bard", "Cleric", "Druid", "Fighter", "Monk", "Paladin", "Ranger", "Rogue", "Sorcerer", "Warlock", "Wizard"
723 | ]
724 |
725 | # NPC Class Info - http://www.5esrd.com/gamemastering/monsters-foes/npc/
726 |
727 | class_npc = [
728 | "Acolyte", "Archmage", "Assassin", "Bandit Captain", "Bandit Lord", "Bandit / Pirate", "Berserker", "Black Knight Commander", "City Watch Captain", "Commoner", "Cult Fanatic", "Cult Leader", "Cult Sorcerer", "Cultist", "Devilbound Gnomish Prince", "Druid", "Dwarven Ringmage", "Elvish Veteran Archer", "Ghost Knight", "Gladiator", "Guard", "Half-Red Dragon Veteran", "Knight", "Mage", "Noble", "Corrupted Ogre Chieftain", "Priest", "Ratfolk Rogue", "Scorpion Cultist", "Scout", "Spy", "Thug", "Tribal Warrior", "Veteran", "Wolf Reaver Dwarf"
729 | ]
730 |
731 | culture_npc = [
732 | "Babylonian", "Celtic", "Egyptian", "Greek", "Roman", "Sumerian", "English", "French", "German", "Italian", "Norse", "Saxon", "Slavic", "Spanish", "Arabic", "Chineese", "Hebrew", "Hindu", "Japanese", "Mongolian", "Persian", "Congolese", "Etheopian", "Malian", "Algonquin", "Aztec", "Inkan", "Inuit", "Navajo", "Sioux"
733 | ]
734 |
735 | avg_stats = [
736 | " Race Height Weight Lifespan",
737 | " ---- ------ ------ --------",
738 | " Dwarf 4-5' 150 lbs. 350 years",
739 | " Elf 5-6'+ 150-170 lbs. 750 years",
740 | " Halfling 3-4' 40 lbs. 150 years",
741 | " Human 5-6' 130-200 lbs. < 100 years",
742 | " Dragonborn > 6' 250 lbs. < 100 years",
743 | " Gnome 3-4' 40 lbs. 350 years",
744 | " Half-Elf 5-6' 130-170 lbs. 180 years",
745 | " Half-Orc 5-6'+ 150-230 lbs. < 80 years",
746 | " Tiefling 5-6' 130-200 lbs. 100 years"
747 | ]
748 |
749 | abilities = [
750 | " Strength - natural athleticism, bodily power",
751 | " Dexterity - physical agility, reflexes, balance, poise",
752 | " Constitution - health, stamina, vital force",
753 | " Intelligence - mental acuity, information recall, analytical skill",
754 | " Wisdom - awareness, intuition, insight",
755 | " Charisma - confidence, eloquence, leadership",
756 | ]
757 |
758 |
759 | #############
760 | # Functions #
761 | #############
762 |
763 | def start_fn():
764 | print("")
765 | print(" What would you like to do? ")
766 | print(" 1) (C)reate Character / NPC ")
767 | print(" 2) (R)oll Dice ")
768 | print(" 3) Roll Initiative (raw) ")
769 | print(" 4) Encounter Experience Calculator ")
770 | print(" 5) Get Treasure! ")
771 | print(" 6) Tarokka Fortune Cards ")
772 | print(" 7) Wild Magic (Roll Effect) ")
773 | print(" 0) (Q)uit ")
774 | print("")
775 | option = input("What would you like to do? ")
776 | if option in ("C", "c", "1"):
777 | global char_name
778 | global plyr_name
779 | char_name = ""
780 | plyr_name = ""
781 | print("")
782 | race_fn()
783 | print("")
784 | class_fn()
785 | print("")
786 | height_fn()
787 | print("")
788 | weight_fn()
789 | print("")
790 | age_fn()
791 | print("")
792 | gender_fn()
793 | print("")
794 | abilities_fn()
795 | print("")
796 | race_bonus_fn()
797 | print("")
798 | modifiers_fn()
799 | print("")
800 | saves_fn()
801 | print("")
802 | skills_fn()
803 | print("")
804 | hp_fn()
805 | print("")
806 | alignment_fn()
807 | print("")
808 | summary_fn()
809 | print("")
810 | name_fn()
811 | print("")
812 | save_fn()
813 | elif option in ("R", "r", "2"):
814 | dice = int(input("How many dice? "))
815 | sides = int(input("How many sides on each die? "))
816 | for _ in itertools.repeat(None, dice):
817 | print(random.randrange(1, sides))
818 | start_fn()
819 | elif option == "3":
820 | n_players = int(input("How many initiative rolls (e.g. players + monsters)? "))
821 | for _ in itertools.repeat(None, n_players):
822 | print(random.randint(1, 20))
823 | start_fn()
824 | elif option == "4":
825 | encounter_fn()
826 | start_fn()
827 | elif option == "5":
828 | loot_menu_fn()
829 | elif option == "6":
830 | draw_cards_fn()
831 | reveal_cards_fn()
832 | start_fn()
833 | elif option == "7":
834 | wild_magic_fn()
835 | start_fn()
836 | elif option in ("Q", "q", "0"):
837 | quit()
838 | else:
839 | start_fn()
840 |
841 |
842 | def loot_cr1_fn():
843 | gem_n = 0
844 | gem_t = "0"
845 | item_loot = []
846 | d100 = random.randint(1, 100)
847 | if d100 <= 6:
848 | pass
849 | elif 6 < d100 <= 16:
850 | roll = random.randint(1, 12)
851 | gem_t = gem_10[roll]
852 | gem_n = 0
853 | for dice in range(2):
854 | rolls = random.randint(1, 6)
855 | gem_n = gem_n + rolls
856 | elif 16 < d100 <= 26:
857 | roll = random.randint(1, 10)
858 | gem_t = art_25[roll]
859 | gem_n = 0
860 | for dice in range(2):
861 | rolls = random.randint(1, 4)
862 | gem_n = gem_n + rolls
863 | elif 26 < d100 <= 36:
864 | roll = random.randint(1, 12)
865 | gem_t = gem_50[roll]
866 | gem_n = 0
867 | for dice in range(2):
868 | rolls = random.randint(1, 6)
869 | gem_n = gem_n + rolls
870 | elif 36 < d100 <= 44:
871 | roll = random.randint(1, 12)
872 | gem_t = gem_10[roll]
873 | gem_n = 0
874 | for dice in range(2):
875 | rolls = random.randint(1, 6)
876 | gem_n = gem_n + rolls
877 | item_n = random.randint(1, 6)
878 | for n in range(item_n):
879 | item = random.choice(list(item_a))
880 | item = item_a[item]
881 | item_loot.append(item)
882 | elif 44 < d100 <= 52:
883 | roll = random.randint(1, 10)
884 | gem_t = art_25[roll]
885 | gem_n = 0
886 | for dice in range(2):
887 | rolls = random.randint(1, 4)
888 | gem_n = gem_n + rolls
889 | item_n = random.randint(1, 6)
890 | for n in range(item_n):
891 | item = random.choice(list(item_a))
892 | item = item_a[item]
893 | item_loot.append(item)
894 | elif 52 < d100 <= 60:
895 | roll = random.randint(1, 12)
896 | gem_t = gem_50[roll]
897 | gem_n = 0
898 | for dice in range(2):
899 | rolls = random.randint(1, 6)
900 | gem_n = gem_n + rolls
901 | item_n = random.randint(1, 6)
902 | for n in range(item_n):
903 | item = random.choice(list(item_a))
904 | item = item_a[item]
905 | item_loot.append(item)
906 | elif 60 < d100 <= 65:
907 | roll = random.randint(1, 12)
908 | gem_t = gem_10[roll]
909 | gem_n = 0
910 | for dice in range(2):
911 | rolls = random.randint(1, 6)
912 | gem_n = gem_n + rolls
913 | item_n = random.randint(1, 4)
914 | for n in range(item_n):
915 | item = random.choice(list(item_a))
916 | item = item_a[item]
917 | item_loot.append(item)
918 | elif 65 < d100 <= 70:
919 | roll = random.randint(1, 10)
920 | gem_t = art_25[roll]
921 | gem_n = 0
922 | for dice in range(2):
923 | rolls = random.randint(1, 4)
924 | gem_n = gem_n + rolls
925 | item_n = random.randint(1, 4)
926 | for n in range(item_n):
927 | item = random.choice(list(item_b))
928 | item = item_b[item]
929 | item_loot.append(item)
930 | elif 70 < d100 <= 75:
931 | roll = random.randint(1, 12)
932 | gem_t = gem_50[roll]
933 | gem_n = 0
934 | for dice in range(2):
935 | rolls = random.randint(1, 6)
936 | gem_n = gem_n + rolls
937 | item_n = random.randint(1, 4)
938 | for n in range(item_n):
939 | item = random.choice(list(item_b))
940 | item = item_b[item]
941 | item_loot.append(item)
942 | elif 75 < d100 <= 78:
943 | roll = random.randint(1, 12)
944 | gem_t = gem_10[roll]
945 | gem_n = 0
946 | for dice in range(2):
947 | rolls = random.randint(1, 6)
948 | gem_n = gem_n + rolls
949 | item_n = random.randint(1, 4)
950 | for n in range(item_n):
951 | item = random.choice(list(item_c))
952 | item = item_c[item]
953 | item_loot.append(item)
954 | elif 78 < d100 <= 80:
955 | roll = random.randint(1, 10)
956 | gem_t = art_25[roll]
957 | gem_n = 0
958 | for dice in range(2):
959 | rolls = random.randint(1, 4)
960 | gem_n = gem_n + rolls
961 | item_n = random.randint(1, 6)
962 | for n in range(item_n):
963 | item = random.choice(list(item_c))
964 | item = item_c[item]
965 | item_loot.append(item)
966 | elif 80 < d100 <= 85:
967 | roll = random.randint(1, 10)
968 | gem_t = gem_50[roll]
969 | gem_n = 0
970 | for dice in range(2):
971 | rolls = random.randint(1, 6)
972 | gem_n = gem_n + rolls
973 | item_n = random.randint(1, 4)
974 | for n in range(item_n):
975 | item = random.choice(list(item_c))
976 | item = item_c[item]
977 | item_loot.append(item)
978 | elif 85 < d100 <= 92:
979 | roll = random.randint(1, 10)
980 | gem_t = art_25[roll]
981 | gem_n = 0
982 | for dice in range(2):
983 | rolls = random.randint(1, 4)
984 | gem_n = gem_n + rolls
985 | item_n = random.randint(1, 4)
986 | for n in range(item_n):
987 | item = random.choice(list(item_f))
988 | item = item_f[item]
989 | item_loot.append(item)
990 | elif 92 < d100 <= 97:
991 | roll = random.randint(1, 12)
992 | gem_t = gem_50[roll]
993 | gem_n = 0
994 | for dice in range(2):
995 | rolls = random.randint(1, 6)
996 | gem_n = gem_n + rolls
997 | item_n = random.randint(1, 4)
998 | for n in range(item_n):
999 | item = random.choice(list(item_f))
1000 | item = item_f[item]
1001 | item_loot.append(item)
1002 | elif 97 < d100 <= 99:
1003 | roll = random.randint(1, 10)
1004 | gem_t = art_25[roll]
1005 | gem_n = 0
1006 | for dice in range(2):
1007 | rolls = random.randint(1, 4)
1008 | gem_n = gem_n + rolls
1009 | choice = random.randint(1, 100)
1010 | if choice in (12, 13, 14):
1011 | roll = random.randint(1, 8)
1012 | item = item_g_12[roll]
1013 | item_loot.append(item)
1014 | else:
1015 | item = random.choice(list(item_g))
1016 | item = item_g[item]
1017 | item_loot.append(item)
1018 | elif d100 > 99:
1019 | roll = random.randint(1, 12)
1020 | gem_t = gem_50[roll]
1021 | gem_n = 0
1022 | for dice in range(2):
1023 | rolls = random.randint(1, 6)
1024 | gem_n = gem_n + rolls
1025 | choice = random.randint(1, 100)
1026 | if choice in (12, 13, 14):
1027 | roll = random.randint(1, 8)
1028 | item = item_g_12[roll]
1029 | item_loot.append(item)
1030 | else:
1031 | item = random.choice(list(item_g))
1032 | item = item_g[item]
1033 | item_loot.append(item)
1034 | else:
1035 | pass
1036 | print(" ")
1037 | print("## Gems, Art, and Items ##")
1038 | print(gem_n, "x ", gem_t)
1039 | for item in item_loot:
1040 | print(item)
1041 |
1042 |
1043 | def loot_cr5_fn():
1044 | gem_n = 0
1045 | gem_t = "0"
1046 | item_loot = []
1047 | d100 = random.randint(1, 100)
1048 | if d100 <= 4:
1049 | roll = random.randint(1, 10)
1050 | gem_t = art_25[roll]
1051 | gem_n = 0
1052 | for dice in range(2):
1053 | rolls = random.randint(1, 4)
1054 | gem_n = gem_n + rolls
1055 | elif 4 < d100 <= 10:
1056 | roll = random.randint(1, 12)
1057 | gem_t = gem_50[roll]
1058 | gem_n = 0
1059 | for dice in range(2):
1060 | rolls = random.randint(1, 4)
1061 | gem_n = gem_n + rolls
1062 | elif 10 < d100 <= 16:
1063 | roll = random.randint(1, 12)
1064 | gem_t = gem_50[roll]
1065 | gem_n = 0
1066 | for dice in range(3):
1067 | rolls = random.randint(1, 6)
1068 | gem_n = gem_n + rolls
1069 | elif 16 < d100 <= 22:
1070 | roll = random.randint(1, 10)
1071 | gem_t = gem_100[roll]
1072 | gem_n = 0
1073 | for dice in range(3):
1074 | rolls = random.randint(1, 6)
1075 | gem_n = gem_n + rolls
1076 | elif 22 < d100 <= 28:
1077 | gem_t = art_250[random.randint(1, 12)]
1078 | gem_n = 0
1079 | for dice in range(2):
1080 | rolls = random.randint(1, 4)
1081 | gem_n = gem_n + rolls
1082 | elif 28 < d100 <= 32:
1083 | gem_t = art_25[random.randint(1, 10)]
1084 | gem_n = 0
1085 | for dice in range(2):
1086 | rolls = random.randint(1, 4)
1087 | gem_n = gem_n + rolls
1088 | item_n = random.randint(1, 6)
1089 | for _ in itertools.repeat(None, item_n):
1090 | item = random.choice(list(item_a))
1091 | item = item_a[item]
1092 | item_loot.append(item)
1093 | elif 32 < d100 <= 36:
1094 | gem_t = art_25[random.randint(1, 10)]
1095 | gem_n = 0
1096 | for dice in range(2):
1097 | rolls = random.randint(1, 4)
1098 | gem_n = gem_n + rolls
1099 | item_n = random.randint(1, 6)
1100 | for _ in itertools.repeat(None, item_n):
1101 | item = random.choice(list(item_a))
1102 | item = item_a[item]
1103 | item_loot.append(item)
1104 | elif 36 < d100 <= 40:
1105 | gem_t = gem_100[random.randint(1, 10)]
1106 | gem_n = 0
1107 | for dice in range(3):
1108 | rolls = random.randint(1, 6)
1109 | gem_n = gem_n + rolls
1110 | item_n = random.randint(1, 6)
1111 | for _ in itertools.repeat(None, item_n):
1112 | item = random.choice(list(item_a))
1113 | item = item_a[item]
1114 | item_loot.append(item)
1115 | elif 40 < d100 <= 44:
1116 | gem_t = art_250[random.randint(1, 10)]
1117 | gem_n = 0
1118 | for dice in range(2):
1119 | rolls = random.randint(1, 4)
1120 | gem_n = gem_n + rolls
1121 | item_n = random.randint(1, 6)
1122 | for _ in itertools.repeat(None, item_n):
1123 | item = random.choice(list(item_a))
1124 | item = item_a[item]
1125 | item_loot.append(item)
1126 | elif 44 < d100 <= 49:
1127 | gem_t = art_25[random.randint(1, 10)]
1128 | gem_n = 0
1129 | for dice in range(2):
1130 | rolls = random.randint(1, 4)
1131 | gem_n = gem_n + rolls
1132 | item_n = random.randint(1, 4)
1133 | for _ in itertools.repeat(None, item_n):
1134 | item = random.choice(list(item_b))
1135 | item = item_b[item]
1136 | item_loot.append(item)
1137 | elif 49 < d100 <= 54:
1138 | gem_t = gem_50[random.randint(1, 12)]
1139 | gem_n = 0
1140 | for dice in range(2):
1141 | rolls = random.randint(1, 6)
1142 | gem_n = gem_n + rolls
1143 | item_n = random.randint(1, 4)
1144 | for _ in itertools.repeat(None, item_n):
1145 | item = random.choice(list(item_b))
1146 | item = item_b[item]
1147 | item_loot.append(item)
1148 | elif 54 < d100 <= 59:
1149 | gem_t = gem_100[random.randint(1, 10)]
1150 | gem_n = 0
1151 | for dice in range(3):
1152 | rolls = random.randint(1, 6)
1153 | gem_n = gem_n + rolls
1154 | item_n = random.randint(1, 4)
1155 | for _ in itertools.repeat(None, item_n):
1156 | item = random.choice(list(item_b))
1157 | item = item_b[item]
1158 | item_loot.append(item)
1159 | elif 59 < d100 <= 63:
1160 | gem_t = art_250[random.randint(1, 10)]
1161 | gem_n = 0
1162 | for dice in range(2):
1163 | rolls = random.randint(1, 4)
1164 | gem_n = gem_n + rolls
1165 | item_n = random.randint(1, 4)
1166 | for _ in itertools.repeat(None, item_n):
1167 | item = random.choice(list(item_b))
1168 | item = item_b[item]
1169 | item_loot.append(item)
1170 | elif 63 < d100 <= 66:
1171 | gem_t = art_25[random.randint(1, 10)]
1172 | gem_n = 0
1173 | for dice in range(2):
1174 | rolls = random.randint(1, 4)
1175 | gem_n = gem_n + rolls
1176 | item_n = random.randint(1, 4)
1177 | for _ in itertools.repeat(None, item_n):
1178 | item = random.choice(list(item_c))
1179 | item = item_c[item]
1180 | item_loot.append(item)
1181 | elif 63 < d100 <= 69:
1182 | gem_t = gem_50[random.randint(1, 12)]
1183 | gem_n = 0
1184 | for dice in range(3):
1185 | rolls = random.randint(1, 6)
1186 | gem_n = gem_n + rolls
1187 | item_n = random.randint(1, 4)
1188 | for _ in itertools.repeat(None, item_n):
1189 | item = random.choice(list(item_c))
1190 | item = item_c[item]
1191 | item_loot.append(item)
1192 | elif 69 < d100 <= 72:
1193 | gem_t = gem_100[random.randint(1, 10)]
1194 | gem_n = 0
1195 | for dice in range(3):
1196 | rolls = random.randint(1, 6)
1197 | gem_n = gem_n + rolls
1198 | item_n = random.randint(1, 4)
1199 | for _ in itertools.repeat(None, item_n):
1200 | item = random.choice(list(item_c))
1201 | item = item_c[item]
1202 | item_loot.append(item)
1203 | elif 72 < d100 <= 74:
1204 | gem_t = art_250[random.randint(1, 10)]
1205 | gem_n = 0
1206 | for dice in range(2):
1207 | rolls = random.randint(1, 4)
1208 | gem_n = gem_n + rolls
1209 | item_n = random.randint(1, 4)
1210 | for _ in itertools.repeat(None, item_n):
1211 | item = random.choice(list(item_c))
1212 | item = item_c[item]
1213 | item_loot.append(item)
1214 | elif 74 < d100 <= 76:
1215 | gem_t = art_25[random.randint(1, 10)]
1216 | gem_n = 0
1217 | for dice in range(2):
1218 | rolls = random.randint(1, 4)
1219 | gem_n = gem_n + rolls
1220 | item = random.choice(list(item_d))
1221 | item = item_d[item]
1222 | item_loot.append(item)
1223 | elif 76 < d100 <= 78:
1224 | gem_t = gem_50[random.randint(1, 12)]
1225 | gem_n = 0
1226 | for dice in range(3):
1227 | rolls = random.randint(1, 6)
1228 | gem_n = gem_n + rolls
1229 | item = random.choice(list(item_d))
1230 | item = item_d[item]
1231 | item_loot.append(item)
1232 | elif d100 == 79:
1233 | gem_t = gem_100[random.randint(1, 10)]
1234 | gem_n = 0
1235 | for dice in range(3):
1236 | rolls = random.randint(1, 6)
1237 | gem_n = gem_n + rolls
1238 | item = random.choice(list(item_d))
1239 | item = item_d[item]
1240 | item_loot.append(item)
1241 | elif d100 == 80:
1242 | gem_t = art_250[random.randint(1, 10)]
1243 | gem_n = 0
1244 | for dice in range(2):
1245 | rolls = random.randint(1, 4)
1246 | gem_n = gem_n + rolls
1247 | item = random.choice(list(item_d))
1248 | item = item_d[item]
1249 | item_loot.append(item)
1250 | elif 80 < d100 <= 84:
1251 | gem_t = art_25[random.randint(1, 10)]
1252 | gem_n = 0
1253 | for dice in range(2):
1254 | rolls = random.randint(1, 4)
1255 | gem_n = gem_n + rolls
1256 | item_n = random.randint(1, 4)
1257 | for _ in itertools.repeat(None, item_n):
1258 | item = random.choice(list(item_f))
1259 | item = item_f[item]
1260 | item_loot.append(item)
1261 | elif 84 < d100 <= 88:
1262 | gem_t = gem_50[random.randint(1, 12)]
1263 | gem_n = 0
1264 | for dice in range(3):
1265 | rolls = random.randint(1, 6)
1266 | gem_n = gem_n + rolls
1267 | item_n = random.randint(1, 4)
1268 | for _ in itertools.repeat(None, item_n):
1269 | item = random.choice(list(item_f))
1270 | item = item_f[item]
1271 | item_loot.append(item)
1272 | elif 88 < d100 <= 91:
1273 | gem_t = gem_100[random.randint(1, 10)]
1274 | gem_n = 0
1275 | for dice in range(3):
1276 | rolls = random.randint(1, 6)
1277 | gem_n = gem_n + rolls
1278 | item_n = random.randint(1, 4)
1279 | for _ in itertools.repeat(None, item_n):
1280 | item = random.choice(list(item_f))
1281 | item = item_f[item]
1282 | item_loot.append(item)
1283 | elif 91 < d100 <= 94:
1284 | gem_t = art_250[random.randint(1, 10)]
1285 | gem_n = 0
1286 | for dice in range(2):
1287 | rolls = random.randint(1, 4)
1288 | gem_n = gem_n + rolls
1289 | item_n = random.randint(1, 4)
1290 | for _ in itertools.repeat(None, item_n):
1291 | item = random.choice(list(item_f))
1292 | item = item_f[item]
1293 | item_loot.append(item)
1294 | elif 94 < d100 <= 96:
1295 | gem_t = gem_100[random.randint(1, 10)]
1296 | gem_n = 0
1297 | for dice in range(3):
1298 | rolls = random.randint(1, 6)
1299 | gem_n = gem_n + rolls
1300 | item_n = random.randint(1, 4)
1301 | for _ in itertools.repeat(None, item_n):
1302 | choice = random.randint(1, 100)
1303 | if choice in (12, 13, 14):
1304 | item = random.choice(list(item_g_12))
1305 | item = item_g_12[item]
1306 | item_loot.append(item)
1307 | else:
1308 | item = random.choice(list(item_g))
1309 | item = item_g[item]
1310 | item_loot.append(item)
1311 | elif d100 == 99:
1312 | gem_t = gem_100[random.randint(1, 10)]
1313 | gem_n = 0
1314 | for dice in range(3):
1315 | rolls = random.randint(1, 6)
1316 | gem_n = gem_n + rolls
1317 | item = random.choice(list(item_h))
1318 | item = item_h[item]
1319 | item_loot.append(item)
1320 | elif d100 == 100:
1321 | gem_t = art_250[random.randint(1, 10)]
1322 | gem_n = 0
1323 | for dice in range(2):
1324 | rolls = random.randint(1, 4)
1325 | gem_n = gem_n + rolls
1326 | item = random.choice(list(item_h))
1327 | item = item_h[item]
1328 | item_loot.append(item)
1329 | else:
1330 | pass
1331 | print(" ")
1332 | print("## Gems, Art, and Items ##")
1333 | print(gem_n, "x ", gem_t)
1334 | for item in item_loot:
1335 | print(item)
1336 |
1337 |
1338 | def loot_cr11_fn():
1339 | item_loot = []
1340 | gem_t = "0"
1341 | gem_n = 0
1342 | d100 = random.randint(1, 100)
1343 | if d100 <= 3:
1344 | gem_t = art_250[random.randint(1, 10)]
1345 | gem_n = 0
1346 | for dice in range(2):
1347 | rolls = random.randint(1, 4)
1348 | gem_n = gem_n + rolls
1349 | elif 3 < d100 <= 6:
1350 | gem_t = art_750[random.randint(1, 10)]
1351 | gem_n = 0
1352 | for dice in range(2):
1353 | rolls = random.randint(1, 4)
1354 | gem_n = gem_n + rolls
1355 | elif 6 < d100 <= 9:
1356 | gem_t = gem_500[random.randint(1, 6)]
1357 | gem_n = 0
1358 | for dice in range(3):
1359 | rolls = random.randint(1, 6)
1360 | gem_n = gem_n + rolls
1361 | elif 9 < d100 <= 12:
1362 | gem_t = gem_1000[random.randint(1, 8)]
1363 | gem_n = 0
1364 | for dice in range(3):
1365 | rolls = random.randint(1, 6)
1366 | gem_n = gem_n + rolls
1367 | elif 12 < d100 <= 15:
1368 | gem_t = gem_1000[random.randint(1, 8)]
1369 | gem_n = 0
1370 | for dice in range(3):
1371 | rolls = random.randint(1, 6)
1372 | gem_n = gem_n + rolls
1373 | elif 15 < d100 <= 19:
1374 | gem_t = art_250[random.randint(1, 10)]
1375 | gem_n = 0
1376 | for dice in range(2):
1377 | rolls = random.randint(1, 4)
1378 | gem_n = gem_n + rolls
1379 | item_n = random.randint(1, 4)
1380 | for _ in itertools.repeat(None, item_n):
1381 | item = random.choice(list(item_a))
1382 | item = item_a[item]
1383 | item_loot.append(item)
1384 | item_n = random.randint(1, 6)
1385 | for _ in itertools.repeat(None, item_n):
1386 | item = random.choice(list(item_b))
1387 | item = item_b[item]
1388 | item_loot.append(item)
1389 | elif 19 < d100 <= 23:
1390 | gem_t = art_750[random.randint(1, 10)]
1391 | gem_n = 0
1392 | for dice in range(2):
1393 | rolls = random.randint(1, 4)
1394 | gem_n = gem_n + rolls
1395 | item_n = random.randint(1, 4)
1396 | for _ in itertools.repeat(None, item_n):
1397 | item = random.choice(list(item_b))
1398 | item = item_b[item]
1399 | item_loot.append(item)
1400 | item_n = random.randint(1, 6)
1401 | for _ in itertools.repeat(None, item_n):
1402 | item = random.choice(list(item_b))
1403 | item = item_b[item]
1404 | item_loot.append(item)
1405 | elif 23 < d100 <= 26:
1406 | gem_t = gem_500[random.randint(1, 6)]
1407 | gem_n = 0
1408 | for dice in range(3):
1409 | rolls = random.randint(1, 6)
1410 | gem_n = gem_n + rolls
1411 | item_n = random.randint(1, 4)
1412 | for _ in itertools.repeat(None, item_n):
1413 | item = random.choice(list(item_a))
1414 | item = item_a[item]
1415 | item_loot.append(item)
1416 | item_n = random.randint(1, 6)
1417 | for _ in itertools.repeat(None, item_n):
1418 | item = random.choice(list(item))
1419 | item = item_b[item]
1420 | item_loot.append(item)
1421 | elif 26 < d100 <= 29:
1422 | gem_t = gem_1000[random.randint(1, 8)]
1423 | gem_n = 0
1424 | for dice in range(3):
1425 | rolls = random.randint(1, 6)
1426 | gem_n = gem_n + rolls
1427 | item_n = random.randint(1, 4)
1428 | for _ in itertools.repeat(None, item_n):
1429 | item = random.choice(list(item_a))
1430 | item = item_a[item]
1431 | item_loot.append(item)
1432 | item_n = random.randint(1, 6)
1433 | for _ in itertools.repeat(None, item_n):
1434 | item = random.choice(list(item_b))
1435 | item = item_b[item]
1436 | item_loot.append(item)
1437 | elif 29 < d100 <= 35:
1438 | gem_t = art_250[random.randint(1, 10)]
1439 | gem_n = 0
1440 | for dice in range(2):
1441 | rolls = random.randint(1, 4)
1442 | gem_n = gem_n + rolls
1443 | item_n = random.randint(1, 6)
1444 | for _ in itertools.repeat(None, item_n):
1445 | item = random.choice(list(item_c))
1446 | item = item_c[item]
1447 | item_loot.append(item)
1448 | elif 35 < d100 <= 40:
1449 | gem_t = art_750[random.randint(1, 10)]
1450 | gem_n = 0
1451 | for dice in range(2):
1452 | rolls = random.randint(1, 4)
1453 | gem_n = gem_n + rolls
1454 | item_n = random.randint(1, 6)
1455 | for _ in itertools.repeat(None, item_n):
1456 | item = random.chocie(list(item_c))
1457 | item = item_c[item]
1458 | item_loot.append(item)
1459 | elif 40 < d100 <= 45:
1460 | gem_t = gem_500[random.randint(1, 6)]
1461 | gem_n = 0
1462 | for dice in range(3):
1463 | rolls = random.randint(1, 6)
1464 | gem_n = gem_n + rolls
1465 | item_n = random.randint(1, 6)
1466 | for _ in itertools.repeat(None, item_n):
1467 | item = random.choice(list(item_c))
1468 | item = item_c[item]
1469 | item_loot.append(item)
1470 | elif 45 < d100 <= 54:
1471 | gem_t = art_250[random.randint(1, 10)]
1472 | gem_n = 0
1473 | for dice in range(2):
1474 | rolls = random.randint(1, 4)
1475 | gem_n = gem_n + rolls
1476 | item_n = random.randint(1, 4)
1477 | for _ in itertools.repeat(None, item_n):
1478 | item = random.choice(list(item_d))
1479 | item = item_d[item]
1480 | item_loot.append(item)
1481 | elif 54 < d100 <= 58:
1482 | gem_t = art_750[random.randint(1, 10)]
1483 | gem_n = 0
1484 | for dice in range(2):
1485 | rolls = random.randint(1, 4)
1486 | gem_n = gem_n + rolls
1487 | item_n = random.randint(1, 4)
1488 | for _ in itertools.repeat(None, item_n):
1489 | item = random.choice(list(item_d))
1490 | item = item_d[item]
1491 | item_loot.append(item)
1492 | elif 58 < d100 <= 62:
1493 | gem_t = gem_500[random.randint(1, 6)]
1494 | gem_n = 0
1495 | for dice in range(3):
1496 | rolls = random.randint(1, 6)
1497 | gem_n = gem_n + rolls
1498 | item_n = random.randint(1, 4)
1499 | for _ in itertools.repeat(None, item_n):
1500 | item = random.choice(list(item_d))
1501 | item = item_d[item]
1502 | item_loot.append(item)
1503 | elif 62 < d100 <= 66:
1504 | gem_t = gem_1000[random.randint(1, 8)]
1505 | gem_n = 0
1506 | for dice in range(3):
1507 | rolls = random.randint(1, 6)
1508 | gem_n = gem_n + rolls
1509 | item_n = random.randint(1, 4)
1510 | for _ in itertools.repeat(None, item_n):
1511 | item = random.choice(list(item_d))
1512 | item = item_d[item]
1513 | item_loot.append(item)
1514 | elif 66 < d100 <= 68:
1515 | gem_t = art_250[random.randint(1, 10)]
1516 | gem_n = 0
1517 | for dice in range(2):
1518 | rolls = random.randint(1, 4)
1519 | gem_n = gem_n + rolls
1520 | item = random.choice(list(item_e))
1521 | item = item_e[item]
1522 | item_loot.append(item)
1523 | elif 68 < d100 <= 70:
1524 | gem_t = art_750[random.randint(1, 10)]
1525 | gem_n = 0
1526 | for dice in range(2):
1527 | rolls = random.randint(1, 4)
1528 | gem_n = gem_n + rolls
1529 | item = random.choice(list(item_e))
1530 | item = item_e[item]
1531 | item_loot.append(item)
1532 | elif 70 < d100 <= 72:
1533 | gem_t = gem_500[random.randint(1, 6)]
1534 | gem_n = 0
1535 | for dice in range(3):
1536 | rolls = random.randint(1, 6)
1537 | gem_n = gem_n + rolls
1538 | item = random.choice(list(item_e))
1539 | item = item_e[item]
1540 | item_loot.append(item)
1541 | elif 72 < d100 <= 74:
1542 | gem_t = gem_1000[random.randint(1, 8)]
1543 | gem_n = 0
1544 | for dice in range(3):
1545 | rolls = random.randint(1, 6)
1546 | gem_n = gem_n + rolls
1547 | item = random.choice(list(item_e))
1548 | item = item_e[item]
1549 | item_loot.append(item)
1550 | elif 74 < d100 <= 76:
1551 | gem_t = art_250[random.randint(1, 10)]
1552 | gem_n = 0
1553 | for dice in range(2):
1554 | rolls = random.randint(1, 4)
1555 | gem_n = gem_n + rolls
1556 | item = random.choice(list(item_f))
1557 | item = item_f[item]
1558 | item_loot.append(item)
1559 | item_n = random.randint(1, 4)
1560 | for _ in itertools.repeat(None, item_n):
1561 | choice = random.randint(1, 100)
1562 | if choice in (12, 13, 14):
1563 | item = random.choice(list(item_g_12))
1564 | item = item_g_12[item]
1565 | item_loot.append(item)
1566 | else:
1567 | item = random.choice(list(item_g))
1568 | item = item_g[item]
1569 | item_loot.append(item)
1570 | elif 76 < d100 <= 78:
1571 | gem_t = art_750[random.randint(1, 10)]
1572 | gem_n = 0
1573 | for dice in range(2):
1574 | rolls = random.randint(1, 4)
1575 | gem_n = gem_n + rolls
1576 | item = random.choice(list(item_f))
1577 | item = item_f[item]
1578 | item_loot.append(item)
1579 | item_n = random.randint(1, 4)
1580 | for _ in itertools.repeat(None, item_n):
1581 | choice = random.randint(1, 100)
1582 | if choice in (12, 13, 14):
1583 | item = random.choice(list(item_g_12))
1584 | item = item_g_12[item]
1585 | item_loot.append(item)
1586 | else:
1587 | item = random.choice(list(item_g))
1588 | item = item_g[item]
1589 | item_loot.append(item)
1590 | elif 78 < d100 <= 80:
1591 | gem_t = gem_500[random.randint(1, 6)]
1592 | gem_n = 0
1593 | for dice in range(3):
1594 | rolls = random.randint(1, 6)
1595 | gem_n = gem_n + rolls
1596 | item = random.choice(list(item_f))
1597 | item = item_f[item]
1598 | item_loot.append(item)
1599 | item_n = random.randint(1, 4)
1600 | for _ in itertools.repeat(None, item_n):
1601 | choice = random.randint(1, 100)
1602 | if choice in (12, 13, 14):
1603 | item = random.choice(list(item_g_12))
1604 | item = item_g_12[item]
1605 | item_loot.append(item)
1606 | else:
1607 | item = random.choice(list(item_g))
1608 | item = item_g[item]
1609 | item_loot.append(item)
1610 | elif 80 < d100 <= 82:
1611 | gem_t = gem_1000[random.randint(1, 8)]
1612 | gem_n = 0
1613 | for dice in range(3):
1614 | rolls = random.randint(1, 6)
1615 | gem_n = gem_n + rolls
1616 | item = random.choice(list(item_f))
1617 | item = item_f[item]
1618 | item_loot.append(item)
1619 | item_n = random.randint(1, 4)
1620 | for _ in itertools.repeat(None, item_n):
1621 | choice = random.randint(1, 100)
1622 | if choice in (12, 13, 14):
1623 | item = random.choice(list(item_g_12))
1624 | item = item_g_12[item]
1625 | item_loot.append(item)
1626 | else:
1627 | item = random.choice(list(item_g))
1628 | item = item_g[item]
1629 | item_loot.append(item)
1630 | elif 82 < d100 <= 85:
1631 | gem_t = art_250[random.randint(1, 10)]
1632 | gem_n = 0
1633 | for dice in range(2):
1634 | rolls = random.randint(1, 4)
1635 | gem_n = gem_n + rolls
1636 | item_n = random.randint(1, 5)
1637 | for _ in itertools.repeat(None, item_n):
1638 | item = random.choice(list(item_h))
1639 | item = item_h[item]
1640 | item_loot.append(item)
1641 | elif 85 < d100 <= 88:
1642 | gem_t = art_750[random.randint(1, 10)]
1643 | gem_n = 0
1644 | for dice in range(2):
1645 | rolls = random.randint(1, 4)
1646 | gem_n = gem_n + rolls
1647 | item_n = random.randint(1, 4)
1648 | for _ in itertools.repeat(None, item_n):
1649 | item = random.choice(list(item_h))
1650 | item = item_h[item]
1651 | item_loot.append(item)
1652 | elif 88 < d100 <= 90:
1653 | gem_t = gem_500[random.randint(1, 6)]
1654 | gem_n = 0
1655 | for dice in range(3):
1656 | rolls = random.randint(1, 6)
1657 | gem_n = gem_n + rolls
1658 | item_n = random.randint(1, 4)
1659 | for _ in itertools.repeat(None, item_n):
1660 | item = random.choice(list(item_h))
1661 | item = item_h[item]
1662 | item_loot.append(item)
1663 | elif 90 < d100 <= 92:
1664 | gem_t = gem_1000[random.randint(1, 8)]
1665 | gem_n = 0
1666 | for dice in range(3):
1667 | rolls = random.randint(1, 6)
1668 | gem_n = gem_n + rolls
1669 | item_n = random.randint(1, 4)
1670 | for _ in itertools.repeat(None, item_n):
1671 | item = random.choice(list(item_h))
1672 | item = item_h[item]
1673 | item_loot.append(item)
1674 | elif 92 < d100 <= 94:
1675 | gem_t = art_250[random.randint(1, 10)]
1676 | gem_n = 0
1677 | for dice in range(2):
1678 | rolls = random.randint(1, 4)
1679 | gem_n = gem_n + rolls
1680 | choice = random.randint(1, 100)
1681 | if choice == 76:
1682 | item = random.choice(list(item_i_76))
1683 | item = item_i_76[item]
1684 | item_loot.append(item)
1685 | else:
1686 | item = random.choice(list(item_i))
1687 | item = item_i[item]
1688 | item_loot.append(item)
1689 | elif 94 < d100 <= 96:
1690 | gem_t = art_750[random.randint(1, 10)]
1691 | gem_n = 0
1692 | for dice in range(2):
1693 | rolls = random.randint(1, 4)
1694 | gem_n = gem_n + rolls
1695 | item = random.choice(list(item_i))
1696 | item = item_i[item]
1697 | item_loot.append(item)
1698 | elif 96 < d100 <= 98:
1699 | gem_t = gem_500[random.randint(1, 6)]
1700 | gem_n = 0
1701 | for dice in range(3):
1702 | rolls = random.randint(1, 6)
1703 | gem_n = gem_n + rolls
1704 | choice = random.randint(1, 100)
1705 | if choice == 76:
1706 | item = random.choice(list(item_i_76))
1707 | item = item_i_76[item]
1708 | item_loot.append(item)
1709 | else:
1710 | item = random.choice(list(item_i))
1711 | item = item_i[item]
1712 | item_loot.append(item)
1713 | elif 98 < d100:
1714 | gem_t = gem_1000[random.randint(1, 8)]
1715 | gem_n = 0
1716 | for dice in range(3):
1717 | rolls = random.randint(1, 6)
1718 | gem_n = gem_n + rolls
1719 | choice = random.randint(1, 100)
1720 | if choice == 76:
1721 | item = random.choice(list(item_i_76))
1722 | item = item_i_76[item]
1723 | item_loot.append(item)
1724 | else:
1725 | item = random.choice(list(item_i))
1726 | item = item_i[item]
1727 | item_loot.append(item)
1728 | else:
1729 | pass
1730 | print(" ")
1731 | print("## Gems, Art, and Items ##")
1732 | print(gem_n, "x ", gem_t)
1733 | for item in item_loot:
1734 | print(item)
1735 |
1736 |
1737 | def loot_cr17_fn():
1738 | item_loot = []
1739 | gem_n = 0
1740 | gem_t = "0"
1741 | d100 = random.randint(1, 100)
1742 | if d100 <= 2:
1743 | pass
1744 | elif 2 < d100 <= 5:
1745 | gem_t = gem_1000[random.randint(1, 8)]
1746 | gem_n = 0
1747 | for dice in range(3):
1748 | rolls = random.randint(1, 6)
1749 | gem_n = gem_n + rolls
1750 | item_n = random.randint(1, 8)
1751 | for _ in itertools.repeat(None, item_n):
1752 | item = random.choice(list(item_c))
1753 | item = item_c[item]
1754 | item_loot.append(item)
1755 | elif 5 < d100 <= 8:
1756 | gem_t = art_2500[random.randint(1, 1)]
1757 | gem_n = random.randint(1, 10)
1758 | item_n = random.randint(1, 8)
1759 | for _ in itertools.repeat(None, item_n):
1760 | item = random.choice(list(item_c))
1761 | item = item_c[item]
1762 | item_loot.append(item)
1763 | elif 8 < d100 <= 11:
1764 | gem_t = art_7500[random.randint(1, 8)]
1765 | gem_n = random.randint(1, 4)
1766 | item_n = random.randint(1, 8)
1767 | for _ in itertools.repeat(None, item_n):
1768 | item = random.choice(list(item_c))
1769 | item = item_c[item]
1770 | item_loot.append(item)
1771 | elif 11 < d100 <= 14:
1772 | gem_t = gem_5000[random.randint(1, 4)]
1773 | gem_n = random.randint(1, 4)
1774 | item_n = random.randint(1, 8)
1775 | for _ in itertools.repeat(None, item_n):
1776 | item = random.choice(list(item_c))
1777 | item = item_c[item]
1778 | item_loot.append(item)
1779 | elif 14 < d100 <= 22:
1780 | gem_t = gem_1000[random.randint(1, 8)]
1781 | gem_n = 0
1782 | for dice in range(3):
1783 | rolls = random.randint(1, 6)
1784 | gem_n = gem_n + rolls
1785 | item_n = random.randint(1, 6)
1786 | for _ in itertools.repeat(None, item_n):
1787 | item = random.choice(list(item_d))
1788 | item = item_d[item]
1789 | item_loot.append(item)
1790 | elif 22 < d100 <= 30:
1791 | gem_t = art_2500[random.randint(1, 10)]
1792 | gem_n = random.randint(1, 10)
1793 | item_n = random.randint(1, 6)
1794 | for _ in itertools.repeat(None, item_n):
1795 | item = random.choice(list(item_d))
1796 | item = item_d[item]
1797 | item_loot.append(item)
1798 | elif 30 < d100 <= 38:
1799 | gem_t = art_7500[random.randint(1, 8)]
1800 | gem_n = random.randint(1, 4)
1801 | item_n = random.randint(1, 6)
1802 | for _ in itertools.repeat(None, item_n):
1803 | item = random.choice(list(item_d))
1804 | item = item_d[item]
1805 | item_loot.append(item)
1806 | elif 38 < d100 <= 46:
1807 | gem_t = gem_5000[random.randint(1, 4)]
1808 | gem_n = random.randint(1, 8)
1809 | item_n = random.randint(1, 6)
1810 | for _ in itertools.repeat(None, item_n):
1811 | item = random.choice(list(item_d))
1812 | item = item_d[item]
1813 | item_loot.append(item)
1814 | elif 46 < d100 <= 52:
1815 | gem_t = gem_1000[random.randint(1, 8)]
1816 | gem_n = 0
1817 | for dice in range(3):
1818 | rolls = random.randint(1, 6)
1819 | gem_n = gem_n + rolls
1820 | item_n = random.randint(1, 6)
1821 | for _ in itertools.repeat(None, item_n):
1822 | item = random.choice(list(item_e))
1823 | item = item_d[item]
1824 | item_loot.append(item)
1825 | elif 52 < d100 <= 58:
1826 | gem_t = art_2500[random.randint(1, 10)]
1827 | gem_n = random.randint(1, 10)
1828 | item_n = random.randint(1, 6)
1829 | for _ in itertools.repeat(None, item_n):
1830 | item = random.choice(list(item_e))
1831 | item = item_d[item]
1832 | item_loot.append(item)
1833 | elif 58 < d100 <= 63:
1834 | gem_t = art_7500[random.randint(1, 8)]
1835 | gem_n = random.randint(1, 4)
1836 | item_n = random.randint(1, 6)
1837 | for _ in itertools.repeat(None, item_n):
1838 | item = random.choice(list(item_e))
1839 | item = item_e[item]
1840 | item_loot.append(item)
1841 | elif 63 < d100 <= 68:
1842 | gem_t = gem_5000[random.randint(1, 4)]
1843 | gem_n = random.randint(1, 8)
1844 | item_n = random.randint(1, 6)
1845 | for _ in itertools.repeat(None, item_n):
1846 | item = random.choice(list(item_e))
1847 | item = item_e[item]
1848 | item_loot.append(item)
1849 | elif d100 == 69:
1850 | gem_t = gem_1000[random.randint(1, 8)]
1851 | gem_n = 0
1852 | for dice in range(3):
1853 | rolls = random.randint(1, 6)
1854 | gem_n = gem_n + rolls
1855 | item_n = random.randint(1, 4)
1856 | for _ in itertools.repeat(None, item_n):
1857 | choice = random.randint(1, 100)
1858 | if choice in (12, 13, 14):
1859 | item = random.choice(list(item_g_12))
1860 | item = item_g_12[item]
1861 | item_loot.append(item)
1862 | else:
1863 | item = random.choice(list(item_g))
1864 | item = item_g[item]
1865 | item_loot.append(item)
1866 | elif d100 == 70:
1867 | gem_t = art_2500[random.randint(1, 10)]
1868 | gem_n = random.randint(1, 10)
1869 | item_n = random.randint(1, 4)
1870 | for _ in itertools.repeat(None, item_n):
1871 | choice = random.randint(1, 100)
1872 | if choice in (12, 13, 14):
1873 | item = random.choice(list(item_g_12))
1874 | item = item_g_12[item]
1875 | item_loot.append(item)
1876 | else:
1877 | item = random.choice(list(item_g))
1878 | item = item_g[item]
1879 | item_loot.append(item)
1880 | elif d100 == 71:
1881 | gem_t = art_7500[random.randint(1, 8)]
1882 | gem_n = random.randint(1, 4)
1883 | item_n = random.randint(1, 4)
1884 | for _ in itertools.repeat(None, item_n):
1885 | choice = random.randint(1, 100)
1886 | if choice in (12, 13, 14):
1887 | item = random.choice(list(item_g_12))
1888 | item = item_g_12[item]
1889 | item_loot.append(item)
1890 | else:
1891 | item = random.choice(list(item_g))
1892 | item = item_g[item]
1893 | item_loot.append(item)
1894 | elif d100 == 72:
1895 | gem_t = gem_5000[random.randint(1, 4)]
1896 | gem_n = random.randint(1, 8)
1897 | item_n = random.randint(1, 4)
1898 | for _ in itertools.repeat(None, item_n):
1899 | choice = random.randint(1, 100)
1900 | if choice in (12, 13, 14):
1901 | item = random.choice(list(item_g_12))
1902 | item = item_g_12[item]
1903 | item_loot.append(item)
1904 | else:
1905 | item = random.choice(list(item_g))
1906 | item = item_g[item]
1907 | item_loot.append(item)
1908 | elif 72 < d100 <= 74:
1909 | gem_t = gem_1000[random.randint(1, 8)]
1910 | gem_n = 0
1911 | for dice in range(3):
1912 | rolls = random.randint(1, 6)
1913 | gem_n = gem_n + rolls
1914 | item_n = random.randint(1, 4)
1915 | for _ in itertools.repeat(None, item_n):
1916 | item = random.choice(list(item_h))
1917 | item = item_h[item]
1918 | item_loot.append(item)
1919 | elif 74 < d100 <= 76:
1920 | gem_t = art_2500[random.randint(1, 10)]
1921 | gem_n = random.randint(1, 10)
1922 | item_n = random.randint(1, 4)
1923 | for _ in itertools.repeat(None, item_n):
1924 | item = random.choice(list(item_h))
1925 | item = item_h[item]
1926 | item_loot.append(item)
1927 | elif 76 < d100 <= 78:
1928 | gem_t = art_7500[random.randint(1, 8)]
1929 | gem_n = random.randint(1, 4)
1930 | item_n = random.randint(1, 4)
1931 | for _ in itertools.repeat(None, item_n):
1932 | item = random.choice(list(item_h))
1933 | item = item_h[item]
1934 | item_loot.append(item)
1935 | elif 78 < d100 <= 80:
1936 | gem_t = gem_5000[random.randint(1, 4)]
1937 | gem_n = random.randint(1, 8)
1938 | item_n = random.randint(1, 4)
1939 | for _ in itertools.repeat(None, item_n):
1940 | item = random.choice(list(item_h))
1941 | item = item_h[item]
1942 | item_loot.append(item)
1943 | elif 80 < d100 <= 85:
1944 | gem_t = gem_1000[random.randint(1, 8)]
1945 | gem_n = 0
1946 | for dice in range(3):
1947 | rolls = random.randint(1, 6)
1948 | gem_n = gem_n + rolls
1949 | item_n = random.randint(1, 4)
1950 | for _ in itertools.repeat(None, item_n):
1951 | choice = random.randint(1, 100)
1952 | if choice == 76:
1953 | item = random.choice(list(item_i_76))
1954 | item = item_i_76[item]
1955 | item_loot.append(item)
1956 | else:
1957 | item = random.choice(list(item_i))
1958 | item = item_i[item]
1959 | item_loot.append(item)
1960 | elif 85 < d100 <= 90:
1961 | gem_t = art_2500[random.randint(1, 10)]
1962 | gem_n = random.randint(1, 10)
1963 | item_n = random.randint(1, 4)
1964 | for _ in itertools.repeat(None, item_n):
1965 | choice = random.randint(1, 100)
1966 | if choice == 76:
1967 | item = random.choice(list(item_i_76))
1968 | item = item_i_76[item]
1969 | item_loot.append(item)
1970 | else:
1971 | item = random.choice(list(item_i))
1972 | item = item_i[item]
1973 | item_loot.append(item)
1974 | elif 90 < d100 <= 95:
1975 | gem_t = art_7500[random.randint(1, 8)]
1976 | gem_n = random.randint(1, 4)
1977 | item_n = random.randint(1, 4)
1978 | for _ in itertools.repeat(None, item_n):
1979 | choice = random.randint(1, 100)
1980 | if choice == 76:
1981 | item = random.choice(list(item_i_76))
1982 | item = item_i_76[item]
1983 | item_loot.append(item)
1984 | else:
1985 | item = random.choice(list(item_i))
1986 | item = item_i[item]
1987 | item_loot.append(item)
1988 | elif 95 < d100:
1989 | gem_t = gem_5000[random.randint(1, 4)]
1990 | gem_n = random.randint(1, 8)
1991 | item_n = random.randint(1, 4)
1992 | for _ in itertools.repeat(None, item_n):
1993 | choice = random.randint(1, 100)
1994 | if choice == 76:
1995 | item = random.choice(list(item_i_76))
1996 | item = item_i_76[item]
1997 | item_loot.append(item)
1998 | else:
1999 | item = random.choice(list(item_i))
2000 | item = item_i[item]
2001 | item_loot.append(item)
2002 | else:
2003 | pass
2004 | print(" ")
2005 | print("## Gems, Art, and Items ##")
2006 | print(gem_n, "x ", gem_t)
2007 | for item in item_loot:
2008 | print(item)
2009 |
2010 |
2011 | def loot_coins_fn():
2012 | global cp
2013 | global sp
2014 | global ep
2015 | global gp
2016 | global pp
2017 | cp = 0
2018 | sp = 0
2019 | ep = 0
2020 | gp = 0
2021 | pp = 0
2022 | if size in ("I", "i", "Individual", "individual"):
2023 | if cr <= 4:
2024 | d100 = random.randint(1, 100)
2025 | if d100 <= 30:
2026 | for dice in range(5):
2027 | rolls = random.randint(1, 6)
2028 | cp = cp + rolls
2029 | elif 30 < d100 <= 60:
2030 | for dice in range(4):
2031 | rolls = random.randint(1, 6)
2032 | sp = sp + rolls
2033 | elif 60 < d100 <= 70:
2034 | for dice in range(3):
2035 | rolls = random.randint(1, 6)
2036 | ep = ep + rolls
2037 | elif 70 < d100 <= 95:
2038 | for dice in range(3):
2039 | rolls = random.randint(1, 6)
2040 | gp = gp + rolls
2041 | elif 95 < d100:
2042 | pp = random.randint(1, 6)
2043 | else:
2044 | pass
2045 | elif 4 < cr <= 10:
2046 | d100 = random.randint(1, 100)
2047 | if d100 <= 30:
2048 | for dice in range(4):
2049 | rolls = random.randint(1, 6)
2050 | cp = cp + rolls
2051 | cp = cp * 100
2052 | for dice in range(6):
2053 | rolls = random.randint(1, 6)
2054 | ep = ep + rolls
2055 | ep = ep * 10
2056 | elif 30 < d100 <= 60:
2057 | for dice in range(6):
2058 | rolls = random.randint(1, 6)
2059 | sp = sp + rolls
2060 | sp = sp * 10
2061 | for dice in range(2):
2062 | rolls = random.randint(1, 6)
2063 | gp = gp + rolls
2064 | gp = gp * 10
2065 | elif 60 < d100 <= 70:
2066 | for dice in range(3):
2067 | rolls = random.randint(1, 6)
2068 | ep = ep + rolls
2069 | ep = ep * 10
2070 | for dice in range(2):
2071 | rolls = random.randint(1, 6)
2072 | gp = gp + rolls
2073 | gp = gp * 10
2074 | elif 70 < d100 <= 95:
2075 | for dice in range(4):
2076 | rolls = random.randint(1, 6)
2077 | gp = gp + rolls
2078 | gp = gp * 10
2079 | elif 95 < d100:
2080 | for dice in range(2):
2081 | rolls = random.randint(1, 6)
2082 | gp = gp + rolls
2083 | gp = gp * 10
2084 | for dice in range(3):
2085 | rolls = random.randint(1, 6)
2086 | pp = pp + rolls
2087 | else:
2088 | pass
2089 | elif 10 < cr < 17:
2090 | d100 = random.randint(1, 100)
2091 | if d100 <= 20:
2092 | for dice in range(4):
2093 | rolls = random.randint(1, 6)
2094 | sp = sp + rolls
2095 | sp = sp * 100
2096 | gp = 100 * random.randint(1, 6)
2097 | elif 20 < d100 <= 35:
2098 | ep = random.randint(1, 6) * 100
2099 | gp = random.randint(1, 6) * 100
2100 | elif 35 < d100 <= 75:
2101 | for dice in range(2):
2102 | rolls = random.randint(1, 6)
2103 | gp = gp + rolls
2104 | gp = gp * 100
2105 | elif 75 < d100:
2106 | for dice in range(2):
2107 | rolls = random.randint(1, 6)
2108 | gp = gp + rolls
2109 | gp = gp * 100
2110 | for dice in range(2):
2111 | rolls = random.randint(1, 6)
2112 | pp = pp + rolls
2113 | pp = pp * 10
2114 | else:
2115 | pass
2116 | elif 17 <= cr:
2117 | d100 = random.randint(1, 100)
2118 | if d100 <= 15:
2119 | for dice in range(2):
2120 | rolls = random.randint(1, 6)
2121 | ep = ep + rolls
2122 | ep = ep * 1000
2123 | for dice in range(8):
2124 | rolls = random.randint(1, 6)
2125 | gp = gp + rolls
2126 | gp = gp * 100
2127 | elif 15 < d100 <= 55:
2128 | gp = random.randint(1, 6) * 1000
2129 | pp = random.randint(1, 6) * 100
2130 | elif 55 < d100:
2131 | gp = random.randint(1, 6) * 1000
2132 | for dice in range(2):
2133 | rolls = random.randint(1, 6)
2134 | pp = pp + rolls
2135 | pp = pp * 100
2136 | else:
2137 | pass
2138 | else:
2139 | loot_coins_fn()
2140 | elif size in ("H", "h", "Hoard", "hoard"):
2141 | if cr <= 4:
2142 | for dice in range(6):
2143 | rolls = random.randint(1, 6)
2144 | cp = cp + rolls
2145 | cp = cp * 100
2146 | for dice in range(3):
2147 | rolls = random.randint(1, 6)
2148 | sp = sp + rolls
2149 | sp = sp * 100
2150 | for dice in range(2):
2151 | rolls = random.randint(1, 6)
2152 | gp = gp * 10
2153 | elif 4 < cr <= 10:
2154 | for dice in range(2):
2155 | rolls = random.randint(1, 6)
2156 | cp = cp + rolls
2157 | cp = cp * 100
2158 | for dice in range(2):
2159 | rolls = random.randint(1, 6)
2160 | sp = sp + rolls
2161 | sp = sp * 1000
2162 | for dice in range(6):
2163 | rolls = random.randint(1, 6)
2164 | gp = gp + rolls
2165 | gp = gp * 100
2166 | for dice in range(3):
2167 | rolls = random.randint(1, 6)
2168 | pp = pp + rolls
2169 | pp = pp * 10
2170 | elif 10 < cr < 17:
2171 | for dice in range(4):
2172 | rolls = random.randint(1, 6)
2173 | gp = gp + rolls
2174 | gp = gp * 1000
2175 | for dice in range(5):
2176 | rolls = random.randint(1, 6)
2177 | pp = pp + rolls
2178 | pp = pp * 100
2179 | elif 17 <= cr:
2180 | for dice in range(12):
2181 | rolls = random.randint(1, 6)
2182 | gp = gp + rolls
2183 | gp = gp * 1000
2184 | for dice in range(8):
2185 | rolls = random.randint(1, 6)
2186 | pp = pp + rolls
2187 | pp = pp * 1000
2188 | else:
2189 | loot_coins_fn()
2190 | else:
2191 | loot_coins_fn()
2192 | print("")
2193 | print("## Coins ##")
2194 | print("cp: ", ep)
2195 | print("sp: ", sp)
2196 | print("ep: ", ep)
2197 | print("gp: ", gp)
2198 | print("pp: ", pp)
2199 |
2200 |
2201 | def loot_menu_fn():
2202 | print("")
2203 | global cr
2204 | global size
2205 | cr = float(input("Enter CR that loot is being awarded for (e.g.: 0.5, 5, 17): "))
2206 | size = input("Enemies being looted, (I)ndividual or (H)oard? ")
2207 | if size in ("H", "h", "Hoard", "hoard"):
2208 | loot_coins_fn()
2209 | if cr < 5:
2210 | loot_cr1_fn()
2211 | elif 5 <= cr < 11:
2212 | loot_cr5_fn()
2213 | elif 11 <= cr < 17:
2214 | loot_cr11_fn()
2215 | elif 17 < cr:
2216 | loot_cr17_fn()
2217 | else:
2218 | loot_menu_fn()
2219 | start_fn()
2220 | else:
2221 | loot_coins_fn()
2222 | start_fn()
2223 |
2224 |
2225 | def encounter_fn():
2226 | # player stats
2227 | party_n = int(input("How many players? "))
2228 | if party_n == 1:
2229 | party_lvl = int(input("Enter character level: "))
2230 | elif party_n in (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20):
2231 | party_lvl = int(input("Enter party level SUM: "))
2232 | party_lvl = party_lvl // party_n
2233 | else:
2234 | encounter_fn()
2235 | # monster stats
2236 | mnstr_n = int(input("How many monsters? "))
2237 | if mnstr_n == 1:
2238 | mnstr_cr = int(input("Enter monster CR: "))
2239 | else:
2240 | mnstr_cr = int(input("Enter monster CR SUM: "))
2241 | mnstr_cr = mnstr_cr // mnstr_n
2242 | # party size multipliers
2243 | if party_n in (1, 2):
2244 | if mnstr_n == 1:
2245 | multiplier = 1.5
2246 | elif mnstr_n == 2:
2247 | multiplier = 2
2248 | elif mnstr_n in (3, 4, 5, 6):
2249 | multiplier = 2.5
2250 | elif mnstr_n in (7, 8, 9, 10):
2251 | multiplier = 3
2252 | elif mnstr_n in (11, 12, 13, 14):
2253 | multiplier = 4
2254 | elif mnstr_n >= 15:
2255 | multiplier = 5
2256 | else:
2257 | encounter_fn()
2258 | elif party_n in (3, 4, 5):
2259 | if mnstr_n == 1:
2260 | multiplier = 1
2261 | elif mnstr_n == 2:
2262 | multiplier = 1.5
2263 | elif mnstr_n in (3, 4, 5, 6):
2264 | multiplier = 2
2265 | elif mnstr_n in (7, 8, 9, 10):
2266 | multiplier = 2.5
2267 | elif mnstr_n in (11, 12, 13, 14):
2268 | multiplier = 3
2269 | elif mnstr_n >= 15:
2270 | multiplier = 4
2271 | else:
2272 | encounter_fn()
2273 | elif party_n in (6, 7, 8):
2274 | if mnstr_n == 1:
2275 | multiplier = 0.5
2276 | elif mnstr_n == 2:
2277 | multiplier = 1
2278 | elif mnstr_n in (3, 4, 5, 6):
2279 | multiplier = 1.5
2280 | elif mnstr_n in (7, 8, 9, 10):
2281 | multiplier = 2
2282 | elif mnstr_n in (11, 12, 13, 14):
2283 | multiplier = 2.5
2284 | elif mnstr_n >= 15:
2285 | multiplier = 3
2286 | else:
2287 | encounter_fn()
2288 | else:
2289 | encounter_fn()
2290 | global raw_xp
2291 | global adj_xp
2292 | raw_xp = cr_xp[mnstr_cr]
2293 | adj_xp = raw_xp * multiplier
2294 | if party_lvl == 1:
2295 | if adj_xp >= 100:
2296 | enc_dif = "Deadly"
2297 | elif 100 > adj_xp >= 75:
2298 | enc_dif = "Hard"
2299 | elif 75 > adj_xp >= 50:
2300 | enc_dif = "Medium"
2301 | elif 50 > adj_xp:
2302 | enc_dif = "Easy"
2303 | else:
2304 | encounter_fn()
2305 | elif party_lvl == 2:
2306 | if adj_xp >= 200:
2307 | enc_dif = "Deadly"
2308 | elif 200 > adj_xp >= 150:
2309 | enc_dif = "Hard"
2310 | elif 150 > adj_xp >= 100:
2311 | enc_dif = "Medium"
2312 | elif 100 > adj_xp:
2313 | enc_dif = "Easy"
2314 | else:
2315 | encounter_fn()
2316 | elif party_lvl == 3:
2317 | if adj_xp >= 400:
2318 | enc_dif = "Deadly"
2319 | elif 400 > adj_xp >= 225:
2320 | enc_dif = "Hard"
2321 | elif 225 > adj_xp >= 150:
2322 | enc_dif = "Medium"
2323 | elif 150 > adj_xp:
2324 | enc_dif = "Easy"
2325 | else:
2326 | encounter_fn()
2327 | elif party_lvl == 4:
2328 | if adj_xp >= 500:
2329 | enc_dif = "Deadly"
2330 | elif 500 > adj_xp >= 375:
2331 | enc_dif = "Hard"
2332 | elif 375 > adj_xp >= 250:
2333 | enc_dif = "Medium"
2334 | elif 250 > adj_xp:
2335 | enc_dif = "Easy"
2336 | else:
2337 | encounter_fn()
2338 | elif party_lvl == 5:
2339 | if adj_xp >= 1100:
2340 | enc_dif = "Deadly"
2341 | elif 1100 > adj_xp >= 750:
2342 | enc_dif = "Hard"
2343 | elif 750 > adj_xp >= 500:
2344 | enc_dif = "Medium"
2345 | elif 500 > adj_xp:
2346 | enc_dif = "Easy"
2347 | else:
2348 | encounter_fn()
2349 | elif party_lvl == 6:
2350 | if adj_xp >= 1400:
2351 | enc_dif = "Deadly"
2352 | elif 1400 > adj_xp >= 900:
2353 | enc_dif = "Hard"
2354 | elif 900 > adj_xp >= 600:
2355 | enc_dif = "Medium"
2356 | elif 600 > adj_xp:
2357 | enc_dif = "Easy"
2358 | else:
2359 | encounter_fn()
2360 | elif party_lvl == 7:
2361 | if adj_xp >= 1700:
2362 | enc_dif = "Deadly"
2363 | elif 1700 > adj_xp >= 1100:
2364 | enc_dif = "Hard"
2365 | elif 1100 > adj_xp >= 750:
2366 | enc_dif = "Medium"
2367 | elif 750 > adj_xp:
2368 | enc_dif = "Easy"
2369 | else:
2370 | encounter_fn()
2371 | elif party_lvl == 8:
2372 | if adj_xp >= 2100:
2373 | enc_dif = "Deadly"
2374 | elif 2100 > adj_xp >= 1400:
2375 | enc_dif = "Hard"
2376 | elif 1400 > adj_xp >= 900:
2377 | enc_dif = "Medium"
2378 | elif 900 > adj_xp:
2379 | enc_dif = "Easy"
2380 | else:
2381 | encounter_fn()
2382 | elif party_lvl == 9:
2383 | if adj_xp >= 2400:
2384 | enc_dif = "Deadly"
2385 | elif 2400 > adj_xp >= 1600:
2386 | enc_dif = "Hard"
2387 | elif 1600 > adj_xp >= 1100:
2388 | enc_dif = "Medium"
2389 | elif 1100 > adj_xp:
2390 | enc_dif = "Easy"
2391 | else:
2392 | encounter_fn()
2393 | elif party_lvl == 10:
2394 | if adj_xp >= 2800:
2395 | enc_dif = "Deadly"
2396 | elif 2800 > adj_xp >= 1900:
2397 | enc_dif = "Hard"
2398 | elif 1900 > adj_xp >= 1200:
2399 | enc_dif = "Medium"
2400 | elif 1200 > adj_xp:
2401 | enc_dif = "Easy"
2402 | else:
2403 | encounter_fn()
2404 | elif party_lvl == 11:
2405 | if adj_xp >= 3600:
2406 | enc_dif = "Deadly"
2407 | elif 3600 > adj_xp >= 2400:
2408 | enc_dif = "Hard"
2409 | elif 2400 > adj_xp >= 1600:
2410 | enc_dif = "Medium"
2411 | elif 1600 > adj_xp:
2412 | enc_dif = "Easy"
2413 | else:
2414 | encounter_fn()
2415 | elif party_lvl == 12:
2416 | if adj_xp >= 4500:
2417 | enc_dif = "Deadly"
2418 | elif 4500 > adj_xp >= 3000:
2419 | enc_dif = "Hard"
2420 | elif 3000 > adj_xp >= 2000:
2421 | enc_dif = "Medium"
2422 | elif 2000 > adj_xp:
2423 | enc_dif = "Easy"
2424 | else:
2425 | encounter_fn()
2426 | elif party_lvl == 13:
2427 | if adj_xp >= 5100:
2428 | enc_dif = "Deadly"
2429 | elif 5100 > adj_xp >= 3400:
2430 | enc_dif = "Hard"
2431 | elif 3400 > adj_xp >= 2200:
2432 | enc_dif = "Medium"
2433 | elif 2200 > adj_xp:
2434 | enc_dif = "Easy"
2435 | else:
2436 | encounter_fn()
2437 | elif party_lvl == 14:
2438 | if adj_xp >= 5700:
2439 | enc_dif = "Deadly"
2440 | elif 5700 > adj_xp >= 3800:
2441 | enc_dif = "Hard"
2442 | elif 3800 > adj_xp >= 2500:
2443 | enc_dif = "Medium"
2444 | elif 2500 > adj_xp:
2445 | enc_dif = "Easy"
2446 | else:
2447 | encounter_fn()
2448 | elif party_lvl == 15:
2449 | if adj_xp >= 6400:
2450 | enc_dif = "Deadly"
2451 | elif 6400 > adj_xp >= 4300:
2452 | enc_dif = "Hard"
2453 | elif 4300 > adj_xp >= 2800:
2454 | enc_dif = "Medium"
2455 | elif 2800 > adj_xp:
2456 | enc_dif = "Easy"
2457 | else:
2458 | encounter_fn()
2459 | elif party_lvl == 16:
2460 | if adj_xp >= 7200:
2461 | enc_dif = "Deadly"
2462 | elif 7200 > adj_xp >= 4800:
2463 | enc_dif = "Hard"
2464 | elif 4800 > adj_xp >= 3200:
2465 | enc_dif = "Medium"
2466 | elif 3200 > adj_xp:
2467 | enc_dif = "Easy"
2468 | else:
2469 | encounter_fn()
2470 | elif party_lvl == 17:
2471 | if adj_xp >= 8800:
2472 | enc_dif = "Deadly"
2473 | elif 8800 > adj_xp >= 5900:
2474 | enc_dif = "Hard"
2475 | elif 5900 > adj_xp >= 3900:
2476 | enc_dif = "Medium"
2477 | elif 3900 > adj_xp:
2478 | enc_dif = "Easy"
2479 | else:
2480 | encounter_fn()
2481 | elif party_lvl == 18:
2482 | if adj_xp >= 9500:
2483 | enc_dif = "Deadly"
2484 | elif 9500 > adj_xp >= 6300:
2485 | enc_dif = "Hard"
2486 | elif 6400 > adj_xp >= 4200:
2487 | enc_dif = "Medium"
2488 | elif 4200 > adj_xp:
2489 | enc_dif = "Easy"
2490 | else:
2491 | encounter_fn()
2492 | elif party_lvl == 19:
2493 | if adj_xp >= 10900:
2494 | enc_dif = "Deadly"
2495 | elif 10900 > adj_xp >= 7300:
2496 | enc_dif = "Hard"
2497 | elif 7300 > adj_xp >= 4900:
2498 | enc_dif = "Medium"
2499 | elif 4900 > adj_xp:
2500 | enc_dif = "Easy"
2501 | else:
2502 | encounter_fn()
2503 | elif party_lvl == 20:
2504 | if adj_xp >= 12700:
2505 | enc_dif = "Deadly"
2506 | elif 12700 > adj_xp >= 8500:
2507 | enc_dif = "Hard"
2508 | elif 8500 > adj_xp >= 5700:
2509 | enc_dif = "Medium"
2510 | elif 5700 > adj_xp:
2511 | enc_dif = "Easy"
2512 | else:
2513 | encounter_fn()
2514 | else:
2515 | encounter_fn()
2516 | print("")
2517 | print("Raw XP : ", raw_xp)
2518 | print("Adjusted XP: ", adj_xp)
2519 | print("Difficulty: ", enc_dif)
2520 |
2521 |
2522 | def draw_cards_fn():
2523 | global drawn_cards
2524 | drawn_cards = random.sample(card_deck, 5)
2525 |
2526 | global pos_1
2527 | global pos_2
2528 | global pos_3
2529 | global pos_4
2530 | global pos_5
2531 |
2532 | pos_1 = random.choice(drawn_cards)
2533 | drawn_cards.remove(pos_1)
2534 |
2535 | pos_2 = random.choice(drawn_cards)
2536 | drawn_cards.remove(pos_2)
2537 |
2538 | pos_3 = random.choice(drawn_cards)
2539 | drawn_cards.remove(pos_3)
2540 |
2541 | pos_4 = random.choice(drawn_cards)
2542 | drawn_cards.remove(pos_4)
2543 |
2544 | pos_5 = random.choice(drawn_cards)
2545 | drawn_cards.remove(pos_5)
2546 |
2547 |
2548 | def reveal_cards_fn():
2549 | print(" |--------|")
2550 | print(" | |")
2551 | print(" | Card 2 |")
2552 | print(" | |")
2553 | print("|--------|--------|--------|")
2554 | print("| | | |")
2555 | print("| Card 1 | Card 5 | Card 3 |")
2556 | print("| | | |")
2557 | print("|--------|--------|--------|")
2558 | print(" | |")
2559 | print(" | Card 4 |")
2560 | print(" | |")
2561 | print(" |--------|")
2562 |
2563 | print("")
2564 | print("Card 1 - ", pos_1)
2565 | print("The Tome of Strahd (location): This card tells of history. Knowledge of the ancient will help you better understand your enemy")
2566 |
2567 | print("")
2568 | print("Card 2 - ", pos_2)
2569 | print("The Holy Symbol of Ravenkind (location): This card tells of a powerful force for good and protection, a symbol of great hope")
2570 |
2571 | print("")
2572 | print("Card 3 - ", pos_3)
2573 | print("The Sunsword (location): This is a card of power and strength. It tells of a weapon of vengeance: a sword of sunlight")
2574 |
2575 | print("")
2576 | print("Card 4 - ", pos_4)
2577 | print("Strahd's Enemy (where to find an ally: This card sheds light on one who will help you greatly in the battle against darkness")
2578 |
2579 | print("")
2580 | print("card 5 - ", pos_5)
2581 | print("Strahd (location): Your enemy is a creature of darkness, whose powers are beyond mortality. This card will lead you to him")
2582 |
2583 |
2584 | def wild_magic_fn():
2585 | global roll
2586 | roll = random.randrange(1, 100)
2587 | if roll in (1, 2):
2588 | print("Roll on this table at the start of each of your turns for the next minute, ignoring this result on subsequent rolls")
2589 | elif roll in (3, 4):
2590 | print("For the next minute, you can see any invisible creature if you have line of sight to it")
2591 | elif roll in (5, 6):
2592 | print("A modron chosen and controlled by the DM appears in an unoccupied space within 5 feet of you, then disappears 1 minute later")
2593 | elif roll in (7, 8):
2594 | print("You cast 'fireball' as 3rd-level spell centered on yourself")
2595 | elif roll in (9, 10):
2596 | print("You cast 'magic missile' as 5th-level spell")
2597 | elif roll in (13, 14):
2598 | print("You cast 'confusion' centered on yourself")
2599 | elif roll in (15, 16):
2600 | print("For the next minute, you regain 5 hit points at the start of each of your turns")
2601 | elif roll in (17, 18):
2602 | print("You grow a long beard made of feathers that remains until you sneeze, at which point the feathers explode out from your face")
2603 | elif roll in (19, 20):
2604 | print("You cast 'grease' centered on yourself")
2605 | elif roll in (21, 22):
2606 | print("Creatures have disadvantage on saving throws against the next spell you cast in the next minute that involves a saving throw")
2607 | elif roll in (23, 24):
2608 | print("Your skin turns a vibrant shade of blue. A 'remove curse' spell can end this effect")
2609 | elif roll in (25, 26):
2610 | print("An eye appears on your forehead for the next minute. During that time, you have advantage on Wisdom (Perception) checks that rely on sight")
2611 | elif roll in (27, 28):
2612 | print("For the next minute, all your spells with a casting time of 1 action have a casting time of 1 bonus action")
2613 | elif roll in (29, 30):
2614 | print("You teleport up to 60 feet to an unoccupied space of your choice that you can see")
2615 | elif roll in (31, 32):
2616 | print("You are transported to the Astral Plan until the end of your next turn, after which time you return to the space you previously occupied or the nearest unoccupied space if that space is occupied")
2617 | elif roll in (33, 34):
2618 | print("Maximize the damage of the next damaging spell you cast within the next minute")
2619 | elif roll in (41, 42):
2620 | print("You turn into a potted plant until the start of your next turn. While a plant, you are incapacitated and have vulnerability to all damage. If you drop to 0 hit points, your pot breaks, and your form revert")
2621 | elif roll in (43, 44):
2622 | print("For the next minute, you can teleport up to 20 feet as a bonus action on each of your turns")
2623 | elif roll in (45, 46):
2624 | print("You cast 'levitate' on yourself")
2625 | elif roll in (47, 48):
2626 | print("A unicorn controlled by the DM appears in a space within 5 feet of you, then disappears 1 minute later")
2627 | elif roll in (49, 50):
2628 | print("You can't speak for the next minute. Whenever you try, pink bubbles float out of your mouth")
2629 | elif roll in (51, 52):
2630 | print("A spectral shield hovers near you for the next minute, granting you a +2 bonus to AC and immunity to 'magic missile'")
2631 | elif roll in (55, 56):
2632 | print("Your hair falls out but grows back within 24 hours")
2633 | elif roll in (57, 58):
2634 | print("For the next minute, any flammable object you touch that isn't being worn or carried by another creature bursts into flames")
2635 | elif roll in (59, 60):
2636 | print("You regain your lowest-level expended spell slot")
2637 | elif roll in (61, 62):
2638 | print("For the next minute, you must shout when you speak")
2639 | elif roll in (63, 64):
2640 | print("You cast 'fog cloud' centered on yourself")
2641 | elif roll in (67, 68):
2642 | print("You are frightened by the nearest creature until the end of your next turn")
2643 | elif roll in (69, 70):
2644 | print("Each creature within 30 feet of you becomes invisible for the next minute. The invisibility ends on a creature when it attacks or casts a spell")
2645 | elif roll in (71, 72):
2646 | print("You gain resistance to all damage for the next minute")
2647 | elif roll in (75, 76):
2648 | print("You glow with bright light in a 30-foot radius for the next minute. Any creature that ends its turn within 5 feet of you is blinded until the end of its next turn")
2649 | elif roll in (77, 78):
2650 | print("You cast 'polymorph' on yourself. If you fail the saving throw, you turn into a sheep for the spell's duration")
2651 | elif roll in (79, 80):
2652 | print("Illusory butterflies and flower petals flutter in the air within 10 feet of you for the next minute")
2653 | elif roll in (81, 82):
2654 | print("You can take one additional action immediately")
2655 | elif roll in (85, 86):
2656 | print("You cast 'mirror image'")
2657 | elif roll in (87, 88):
2658 | print("You cast 'fly' on a random creature within 60 feet of you")
2659 | elif roll in (89, 90):
2660 | print("You become invisible for the next minute. During that time, other creatures can't hear you. The invisibility ends if you attack or cast a spell")
2661 | elif roll in (91, 92):
2662 | print("If you die within the next minute, you immediately come back to life as if by the 'reincarnate' spell")
2663 | elif roll in (93, 94):
2664 | print("Your size increases by one size category for the next minute")
2665 | elif roll in (95, 96):
2666 | print("You and all creatures within 30 feet of you gain vulnerability to piercing damage for the next minute")
2667 | elif roll in (97, 98):
2668 | print("You are surrounded by faint, ethereal music for the next minute")
2669 | elif roll in (99, 100):
2670 | print("You regain all expended sorcery points")
2671 | elif roll in (11, 12):
2672 | def roll_2_fn():
2673 | roll_2 = random.randint(1, 10)
2674 | if roll_2 in (1, 3, 5, 7, 9):
2675 | print("You shrink ", roll_2, " inches")
2676 | else:
2677 | print("You grow ", roll_2, " inches")
2678 | roll_2_fn()
2679 | elif roll in (35, 36):
2680 | def roll_3_fn():
2681 | roll_3 = random.randint(1, 10)
2682 | if roll_3 in (1, 3, 5, 7, 9):
2683 | print("You grow ", roll_3, " years younger - minimum of one year")
2684 | else:
2685 | print("You grow ", roll_3, " years older")
2686 | roll_3_fn()
2687 | elif roll in (37, 38):
2688 | def roll_4_fn():
2689 | global roll_4
2690 | roll_4 = random.randint(1, 4)
2691 | roll_4_fn()
2692 | print(roll_4, " flumphs controlled by the DM appear in unoccupied spaces within 60 feet of you and are firghtened of you. They vanish after 1 minute")
2693 |
2694 | elif roll in (39, 40):
2695 | def roll_5_fn():
2696 | global roll_5
2697 | roll_5 = random.randint(1, 10)
2698 | roll_5 = (roll_5 * 2)
2699 | roll_5_fn()
2700 | print("You regain ", roll_5, " hit points")
2701 | elif roll in (53, 54):
2702 | def roll_6_fn():
2703 | global days_n
2704 | for _ in itertools.repeat(None, 5):
2705 | days_n = random.randrange(1, 6)
2706 | roll_6_fn()
2707 | print("You are immiune to being intoxicated by alcohol for the next ", days_n, " days")
2708 | elif roll in (65, 66):
2709 | def roll_7_fn():
2710 | global damage
2711 | for _ in itertools.repeat(None, 4):
2712 | damage = random.randint(1, 10)
2713 | roll_7_fn()
2714 | print("Up to three creatures you choose within 30 feet of you take ", damage, " lightning damage")
2715 | elif roll in (73, 74):
2716 | def roll_8_fn():
2717 | global hours
2718 | hours = random.randint(1, 4)
2719 | roll_8_fn()
2720 | print("A random creature within 60 feet of you becomes poisoned for ", hours, " hours")
2721 | elif roll in (83, 84):
2722 | def roll_9_fn():
2723 | global damage
2724 | damage = random.randint(1, 10)
2725 | roll_9_fn()
2726 | print("Each creature within 30 feet of you takes ", damage, " necrotic damage. You regain hit points equa to the sum damage")
2727 | else:
2728 | pass
2729 |
2730 |
2731 | def race_fn():
2732 | global char_race
2733 | print("Available Races Include:")
2734 | print(" (R)andom")
2735 | for char_race in race_desc:
2736 | print(" ", char_race)
2737 | char_race = input("Enter Your Race (affects age, height, weight) [R]: ")
2738 | if char_race in race_short:
2739 | pass
2740 | elif char_race in ("R", "r", "Random", "random", ""):
2741 | char_race = (random.choice(race_short))
2742 | else:
2743 | print("Race not available")
2744 | race_fn()
2745 |
2746 |
2747 | def class_fn():
2748 | def adv_npc_fn():
2749 | adv_npc = input("Select (A)dventurer or (N)PC Class [A]: ")
2750 | if adv_npc in ("A", "a", "Adventurer", "adventurer", ""):
2751 | choose_class()
2752 | elif adv_npc in ("N", "n", "NPC", "npc"):
2753 | choose_class_npc()
2754 | else:
2755 | print("Invalid option")
2756 | adv_npc_fn()
2757 | def choose_class():
2758 | global char_class
2759 | print("Available Classes Include:")
2760 | print(" (R)andom")
2761 | for char_class in class_desc:
2762 | print(" ", char_class)
2763 | char_class = input("Enter Your Class [R]: ")
2764 | if char_class in ("R", "r", "Random", "random", ""):
2765 | char_class = (random.choice(class_short))
2766 | elif char_class not in class_short:
2767 | print("Class not available")
2768 | choose_class()
2769 | else:
2770 | pass
2771 | def choose_class_npc():
2772 | global npc_class
2773 | print("Available Classes Include:")
2774 | print(" (R)andom")
2775 | for npc_class in class_npc:
2776 | print(" ", npc_class)
2777 | npc_class = input("Enter NPC Class [R] ")
2778 | if npc_class in ("R", "r", "Random", "random", ""):
2779 | npc_class = (random.choice(class_npc))
2780 | elif npc_class not in class_npc:
2781 | print("Class not available")
2782 | choose_class_npc()
2783 | global char_class
2784 | char_class = npc_class
2785 | adv_npc_fn()
2786 |
2787 |
2788 | def height_fn():
2789 | def height_mod_fn():
2790 | global height_mod
2791 | if char_race in ("Dwarf", "Hill Dwarf", "Mountain Dwarf", "Lightfoot Halfling", "Stout Halfling", "Forest Gnome", "Gnome"):
2792 | height_mod = random.randrange(1, 4) + random.randrange(1, 4)
2793 | elif char_race == "Drow":
2794 | height_mod = random.randrange(1, 6) + random.randrange(1, 6)
2795 | elif char_race in ("Dragonborn", "Half-Elf", "Tiefling"):
2796 | height_mod = random.randrange(1, 8) + random.randrange(1, 8)
2797 | elif char_race in ("Human", "High Elf", "Wood Elf", "Elf", "Half-Orc"):
2798 | height_mod = random.randrange(1, 10) + random.randrange(1, 10)
2799 | else:
2800 | pass
2801 |
2802 | def rnd_height_fn():
2803 | if char_race == "Human":
2804 | height = 56 + height_mod
2805 | elif char_race in ("Dwarf", "Hill Dwarf"):
2806 | height = 44 + height_mod
2807 | elif char_race == "Mountain Dwarf":
2808 | height = 48 + height_mod
2809 | elif char_race in ("Elf", "High Elf", "Wood Elf"):
2810 | height = 54 + height_mod
2811 | elif char_race == "Drow":
2812 | height = 53 + height_mod
2813 | elif char_race in ("Halfling", "Lightfoot Halfling", "Stout Halfling"):
2814 | height = 31 + height_mod
2815 | elif char_race == "Dragonborn":
2816 | height = 66 + height_mod
2817 | elif char_race in ("Gnome", "Forest Gnome"):
2818 | height = 35 + height_mod
2819 | elif char_race in ("Half-Elf", "Tiefling"):
2820 | height = 57 + height_mod
2821 | elif char_race == "Half-Orc":
2822 | height = 58 + height_mod
2823 | else:
2824 | pass
2825 | global char_heightft
2826 | global char_heightin
2827 | char_heightft = math.trunc(height / 12)
2828 | char_heightin = height % 12
2829 |
2830 | print("Select Character Height:")
2831 | for entry in avg_stats:
2832 | print(entry)
2833 | print("Your race is", char_race)
2834 | height_mod_fn()
2835 | rnd_height = input("Do you want a random height? [Y]: ")
2836 | if rnd_height in ("Y", "y", "Yes", "yes", ""):
2837 | rnd_height_fn()
2838 | elif rnd_height in ("N", "n", "No", "no"):
2839 | height = int(input("Enter your height in total inches: "))
2840 | global char_heightft
2841 | global char_heightin
2842 | char_heightft = math.trunc(height / 12)
2843 | char_heightin = height % 12
2844 | else:
2845 | print(rnd_height, " is not a valid choice")
2846 | height_fn()
2847 |
2848 |
2849 | def weight_fn():
2850 | def weight_mod_fn():
2851 | global weight_mod
2852 | if char_race in ("Human", "Half-Elf", "Tiefling"):
2853 | weight_mod = height_mod * (random.randrange(1, 4) + random.randrange(1, 4))
2854 | elif char_race in ("Hill Dwarf", "Mountain Dwarf", "Dwarf", "Dragonborn", "Half-Orc"):
2855 | weight_mod = height_mod * (random.randrange(1, 6) + random.randrange(1, 6))
2856 | elif char_race in ("High Elf", "Wood Elf", "Elf"):
2857 | weight_mod = height_mod * random.randrange(1, 4)
2858 | elif char_race == "Drow":
2859 | weight_mod = height_mod * random.randrange(1, 6)
2860 | elif char_race in ("Halfling", "Lightfoot Halfling", "Stout Halfling", "Gnome", "Forest Gnome"):
2861 | weight_mod = height_mod
2862 | else:
2863 | pass
2864 |
2865 | def rnd_weight_fn():
2866 | global char_weight
2867 | if char_race in ("Human", "Half-Elf", "Tiefling"):
2868 | char_weight = 110 + weight_mod
2869 | if char_race in ("Dwarf", "Hill Dwarf"):
2870 | char_weight = 115 + weight_mod
2871 | if char_race == "Mountain Dwarf":
2872 | char_weight = 130 + weight_mod
2873 | if char_race in ("Elf", "High Elf"):
2874 | char_weight = 90 + weight_mod
2875 | if char_race == "Wood Elf":
2876 | char_weight = 100 + weight_mod
2877 | if char_race == "Drow":
2878 | char_weight = 75 + weight_mod
2879 | if char_race in ("Halfling", "Lightfoot Halfling", "Stout Halfling", "Gnome", "Forest Gnome"):
2880 | char_weight = 35 + weight_mod
2881 | if char_race == "Dragonborn":
2882 | char_weight = 175 + weight_mod
2883 | if char_race == "Half-Orc":
2884 | char_weight = 140 + weight_mod
2885 |
2886 | print("Select Character Weight:")
2887 | for entry in avg_stats:
2888 | print(entry)
2889 | print("Your race is", char_race)
2890 | weight_mod_fn()
2891 | global rnd_height
2892 | global char_weight
2893 | rnd_weight = input("Do you want a random weight? [Y]: ")
2894 | if rnd_weight in ("Y", "y", "Yes", "yes", ""):
2895 | rnd_weight_fn()
2896 | elif rnd_weight in ("N", "n", "No", "no"):
2897 | char_weight = int(input("Enter your weight in pounds: "))
2898 | else:
2899 | print(rnd_weight, " is not a valid choice")
2900 | weight_fn()
2901 |
2902 |
2903 | def age_fn():
2904 | global char_age
2905 | for entry in avg_stats:
2906 | print(entry)
2907 | print("Your race is", char_race)
2908 | rnd_age = input("Do you want a random age? [Y]: ")
2909 | if rnd_age in ("Y", "y", "Yes", "yes", ""):
2910 | if char_race in ("Dwarf", "Mountain Dwarf", "Hill Dwarf"):
2911 | char_age = random.randrange(125, 350)
2912 | if char_race in ("Elf", "Wood Elf", "High Elf", "Drow"):
2913 | char_age = random.randrange(175, 750)
2914 | if char_race in ("Halfling", "Lightfoot Halfling", "Stout Halflingl"):
2915 | char_age = random.randrange(50, 150)
2916 | if char_race == "Human":
2917 | char_age = random.randrange(18, 100)
2918 | if char_race == "Dragonborn":
2919 | char_age = random.randrange(18, 100)
2920 | if char_race in ("Gnome", "Forest Gnome"):
2921 | char_age = random.randrange(100, 150)
2922 | if char_race == "Half-Elf":
2923 | char_age = random.randrange(62, 180)
2924 | if char_race == "Half-Orc":
2925 | char_age = random.randrange(30, 80)
2926 | if char_race == "Tiefling":
2927 | char_age = random.randrange(18, 100)
2928 | elif rnd_age in ("N", "n", "No", "no"):
2929 | char_age = int(input("Enter character age: "))
2930 | else:
2931 | print("Not a valid choice")
2932 | age_fn()
2933 |
2934 |
2935 | def gender_fn():
2936 | global char_gender
2937 | print("Available Genders Include:")
2938 | print(" (R)andom")
2939 | print(" (M)ale")
2940 | print(" (F)emale")
2941 | char_gender = input("Enter character gender [R]: ")
2942 | if char_gender in ("R", "r", "Random", "random", ""):
2943 | char_gender = random.choice("MF")
2944 | if char_gender in ("M", "m", "Male", "male"):
2945 | char_gender = "Male"
2946 | elif char_gender in ("F", "f", "Female", "female"):
2947 | char_gender = "Female"
2948 | else:
2949 | print("Gender not available")
2950 | gender_fn()
2951 |
2952 |
2953 | def name_fn():
2954 | global char_name
2955 | global plyr_name
2956 | while not plyr_name:
2957 | plyr_name = input("Enter Player Name: ")
2958 | while not char_name:
2959 | char_name = input("Enter Character Name: ")
2960 |
2961 |
2962 | def abilities_fn():
2963 | def stat_roll():
2964 | d1 = random.randrange(1, 6)
2965 | d2 = random.randrange(1, 6)
2966 | d3 = random.randrange(1, 6)
2967 | d4 = random.randrange(1, 6)
2968 | raw_rolls = [d1, d2, d3, d4]
2969 | sorted_rolls = sorted(raw_rolls)
2970 | del sorted_rolls[0]
2971 | total = sum(sorted_rolls)
2972 | return total
2973 |
2974 | def strength():
2975 | global abl_str
2976 | abl_str = int(input("Enter the score to use for Strength: "))
2977 | if abl_str not in abl_scores:
2978 | print("Score not valid")
2979 | strength()
2980 | else:
2981 | abl_scores.remove(abl_str)
2982 |
2983 | def dexterity():
2984 | print("Remaining Scores: ", abl_scores)
2985 | global abl_dex
2986 | abl_dex = int(input("Enter the score to use for Dexterity: "))
2987 | if abl_dex not in abl_scores:
2988 | print("Score not valid")
2989 | dexterity()
2990 | else:
2991 | abl_scores.remove(abl_dex)
2992 |
2993 | def constitution():
2994 | print("Remaining Scores: ", abl_scores)
2995 | global abl_con
2996 | abl_con = int(input("Enter the score to use for Constitution: "))
2997 | if abl_con not in abl_scores:
2998 | print("Score not valid")
2999 | constitution()
3000 | else:
3001 | abl_scores.remove(abl_con)
3002 |
3003 | def intelligence():
3004 | print("Remaining Scores: ", abl_scores)
3005 | global abl_int
3006 | abl_int = int(input("Enter the score to use for Intelligence: "))
3007 | if abl_int not in abl_scores:
3008 | print("Score not valid")
3009 | intelligence()
3010 | else:
3011 | abl_scores.remove(abl_int)
3012 |
3013 | def wisdom():
3014 | print("Remaining Scores: ", abl_scores)
3015 | global abl_wis
3016 | abl_wis = int(input("Enter the score to use for Wisdom: "))
3017 | if abl_wis not in abl_scores:
3018 | print("Score not valid")
3019 | wisdom()
3020 | else:
3021 | abl_scores.remove(abl_wis)
3022 |
3023 | def charisma():
3024 | print("Remaining Scores: ", abl_scores)
3025 | global abl_cha
3026 | abl_cha = int(input("Enter the score to use for Charisma: "))
3027 | if abl_cha not in abl_scores:
3028 | print("Score not valid")
3029 | charisma()
3030 | else:
3031 | abl_scores.remove(abl_cha)
3032 |
3033 | def assign():
3034 | rnd_assign = input("Do you want to randomly assign stat rolls? [Y]: ")
3035 | if rnd_assign in ("Y", "y", "Yes", "yes", ""):
3036 | random.shuffle(abl_scores)
3037 | global abl_str
3038 | global abl_dex
3039 | global abl_int
3040 | global abl_con
3041 | global abl_wis
3042 | global abl_cha
3043 | abl_str = random.choice(abl_scores)
3044 | abl_scores.remove(abl_str)
3045 | abl_dex = random.choice(abl_scores)
3046 | abl_scores.remove(abl_dex)
3047 | abl_con = random.choice(abl_scores)
3048 | abl_scores.remove(abl_con)
3049 | abl_int = random.choice(abl_scores)
3050 | abl_scores.remove(abl_int)
3051 | abl_wis = random.choice(abl_scores)
3052 | abl_scores.remove(abl_wis)
3053 | abl_cha = random.choice(abl_scores)
3054 | elif rnd_assign in ("N", "n", "No", "no"):
3055 | strength()
3056 | dexterity()
3057 | constitution()
3058 | intelligence()
3059 | wisdom()
3060 | charisma()
3061 | else:
3062 | print("Invalid choice")
3063 | assign()
3064 | print("Rolling random ability scores...")
3065 | score1 = stat_roll()
3066 | score2 = stat_roll()
3067 | score3 = stat_roll()
3068 | score4 = stat_roll()
3069 | score5 = stat_roll()
3070 | score6 = stat_roll()
3071 | abl_scores = [score1, score2, score3, score4, score5, score6]
3072 | print(" Your Rolles Scores Are: ", abl_scores)
3073 | reroll = input(" Do you want to (C)ontinue or (R)eroll? [C]: ")
3074 | if reroll in ("C", "c", "Continue", "continue", ""):
3075 | assign()
3076 | print("The Scores You Assigned Were:")
3077 | print(" Strength: ", abl_str)
3078 | print(" Dexterity: ", abl_dex)
3079 | print(" Constitution: ", abl_con)
3080 | print(" Intelligence: ", abl_int)
3081 | print(" Wisdom: ", abl_wis)
3082 | print(" Charisma: ", abl_cha)
3083 | choice = input("Do you want to (C)ontinue, Re(A)ssign, or (R)eroll? [C]: ")
3084 | if choice in ("R", "r", "Reroll", "reroll"):
3085 | abilities_fn()
3086 | elif choice in ("A", "a", "Reassign", "reassign", "ReAssign"):
3087 | assign()
3088 | else:
3089 | pass
3090 | else:
3091 | abilities_fn()
3092 |
3093 |
3094 | def race_bonus_fn():
3095 | global abl_str
3096 | global abl_dex
3097 | global abl_con
3098 | global abl_int
3099 | global abl_wis
3100 | global abl_cha
3101 | print("Specific races give bonuses to certain ability scores.")
3102 | print("The race you selected was: ", char_race, )
3103 | print("Checking for Strength Bonus...")
3104 | if char_race in ("Mountain Dwarf", "Dragonborn", "Half-Orc", "Human"):
3105 | print(" ... you got a bonus!")
3106 | if char_race == "Human":
3107 | abl_str = abl_str + 1
3108 | else:
3109 | abl_str = abl_str + 2
3110 | else:
3111 | pass
3112 | print("Checking for Dexterity Bonus...")
3113 | if char_race in ("Elf", "Wood Elf", "High Elf", "Drow", "Halfling", "Lightfoot Halfling", "Forest Gnome", "Human"):
3114 | print(" ... you got a bonus!")
3115 | if char_race == "Human":
3116 | abl_dex = abl_dex + 1
3117 | else:
3118 | abl_dex = abl_dex + 2
3119 | else:
3120 | pass
3121 | print("Checking for Constitution Bonus...")
3122 | if char_race in ("Dwarf", "Mountain Dwarf", "Hill Dwarf", "Stout Halfling", "Rock Gnome", "Half-Orc", "Human"):
3123 | print(" ... you got a bonus!")
3124 | if char_race in ("Dwarf", "Mountain Dwarf", "Hill Dwarf"):
3125 | abl_con = abl_con + 2
3126 | else:
3127 | abl_con = abl_con + 1
3128 | else:
3129 | pass
3130 | print("Checking for Intelligence Bonus...")
3131 | if char_race in ("High Elf", "Gnome", "Forest Gnome", "Tiefling", "Human"):
3132 | print(" ... you got a bonus!")
3133 | if char_race in ("Gnome", "Forest Gnome"):
3134 | abl_int = abl_int + 2
3135 | else:
3136 | abl_int = abl_int + 1
3137 | else:
3138 | pass
3139 | print("Checking for Wisdom Bonus...")
3140 | if char_race in ("Hill Dwarf", "Wood Elf", "Human"):
3141 | print(" ... you got a bonus!")
3142 | abl_wis = abl_wis + 1
3143 | else:
3144 | pass
3145 | print("Checking for Charisma Bonus...")
3146 | if char_race in ("Half-Elf", "Drow", "Lightfoot Halfling", "Dragonborn", "Human", "Tiefling"):
3147 | print(" ... you got a bonus!")
3148 | if char_race in ("Half-Elf", "Tiefling"):
3149 | abl_cha = abl_cha + 2
3150 | else:
3151 | abl_cha = abl_cha + 2
3152 | else:
3153 | pass
3154 |
3155 |
3156 | def modifiers_fn():
3157 | global mod_str
3158 | global mod_dex
3159 | global mod_con
3160 | global mod_int
3161 | global mod_wis
3162 | global mod_cha
3163 | global char_ac
3164 | global prim_stat
3165 | global atk_bonus
3166 | print("Each ability score provides a modifier score which benefits certain attributes.")
3167 |
3168 | def mod(ability):
3169 | if ability == 1:
3170 | mod = -5
3171 | return mod
3172 | elif ability in (2, 3):
3173 | mod = -4
3174 | return mod
3175 | elif ability in (4, 5):
3176 | mod = -3
3177 | return mod
3178 | elif ability in (6, 7):
3179 | mod = -2
3180 | return mod
3181 | elif ability in (8, 9):
3182 | mod = -1
3183 | return mod
3184 | elif ability in (10, 11):
3185 | mod = +0
3186 | return mod
3187 | elif ability in (12, 13):
3188 | mod = 1
3189 | return mod
3190 | elif ability in (14, 15):
3191 | mod = 2
3192 | return mod
3193 | elif ability in (16, 17):
3194 | mod = 3
3195 | return mod
3196 | elif ability in (18, 19):
3197 | mod = 4
3198 | return mod
3199 | elif ability in (20, 21):
3200 | mod = 5
3201 | return mod
3202 | elif ability in (22, 23):
3203 | mod = 6
3204 | return mod
3205 | elif ability in (24, 25):
3206 | mod = 7
3207 | return mod
3208 | elif ability in (26, 27):
3209 | mod = 8
3210 | return mod
3211 | elif ability in (28, 29):
3212 | mod = 9
3213 | return mod
3214 | elif ability == 30:
3215 | mod = 10
3216 | return mod
3217 | else:
3218 | pass
3219 | mod_str = mod(abl_str)
3220 | mod_dex = mod(abl_dex)
3221 | mod_con = mod(abl_con)
3222 | mod_int = mod(abl_int)
3223 | mod_wis = mod(abl_wis)
3224 | mod_cha = mod(abl_cha)
3225 | char_ac = mod_dex + 10
3226 | print("Here are your Ability Scores and (Modifier):")
3227 | print(" Armor Class ", char_ac)
3228 | print(" Strength ", mod_str)
3229 | print(" Dexterity ", mod_dex)
3230 | print(" Constitution", mod_con)
3231 | print(" Intelligence", mod_int)
3232 | print(" Wisdom ", mod_wis)
3233 | print(" Charisma ", mod_cha)
3234 | print("Each character also gets an attack modifier based on their proficiency bonus + main stat modifier")
3235 | print("The proficiency bonus for Lvl 1 characters is 2")
3236 | print("Your class is: ", char_class)
3237 | print("Calculating attack bonus...")
3238 | if char_class is "Barbarian":
3239 | prim_stat = "Strength"
3240 | elif char_class in ("Bard", "Sorcerer", "Warlock"):
3241 | prim_stat = "Charisma"
3242 | elif char_class in ("Cleric", "Druid"):
3243 | prim_stat = "Wisdom"
3244 | elif char_class == "Fighter":
3245 | prim_stat = input("Choose (S)trength, (D)exterity or (R)andom [R]: ")
3246 | if prim_stat in ("R", "r", "Random", "random", ""):
3247 | prim_stat = random.choice("SD")
3248 | if prim_stat in ("S", "s", "Strength", "strength"):
3249 | prim_stat = "Strength"
3250 | elif prim_stat in ("D", "d", "Dexterity", "dexterity"):
3251 | prim_stat = "Dexterity"
3252 | else:
3253 | print("Choice not valid")
3254 | modifiers_fn()
3255 | elif char_class in ("Monk", "Ranger"):
3256 | prim_stat = input("Choose (D)exterity, (W)isdom or (R)andom [R]: ")
3257 | if prim_stat in ("R", "r", "Random", "random", ""):
3258 | prim_stat = random.choice("DW")
3259 | if prim_stat in ("D", "d", "Dexterity", "dexterity"):
3260 | prim_stat = "Dexterity"
3261 | elif prim_stat in ("W", "w", "Wisdom", "wisdom"):
3262 | prim_stat = "Wisdom"
3263 | else:
3264 | print("Choice not valid")
3265 | modifiers_fn()
3266 | elif char_class == "Paladin":
3267 | # str or cha
3268 | prim_stat = input("Choose (S)trength, (C)harisma or (R)andom [R]: ")
3269 | if prim_stat in ("R", "r", "Random", "random", ""):
3270 | prim_stat = random.choice("SC")
3271 | if prim_stat in ("S", "s", "Strength", "strength"):
3272 | prim_stat = "Strength"
3273 | elif prim_stat in ("C", "c", "Charisma", "charisma"):
3274 | prim_stat = "Charisma"
3275 | elif char_class == "Rogue":
3276 | prim_stat = "Dexterity"
3277 | else:
3278 | # Wizard
3279 | prim_stat = "Intelligence"
3280 | if prim_stat == "Strength":
3281 | atk_bonus = mod_str + 2
3282 | if prim_stat == "Dexterity":
3283 | atk_bonus = mod_dex + 2
3284 | if prim_stat == "Intelligence":
3285 | atk_bonus = mod_int + 2
3286 | if prim_stat == "Wisdom":
3287 | atk_bonus = mod_wis + 2
3288 | if prim_stat == "Charisma":
3289 | atk_bonus = mod_cha + 2
3290 | print("Your primary stat is: ", prim_stat)
3291 | print("Your attack bonus is: ", atk_bonus)
3292 |
3293 |
3294 | def saves_fn():
3295 | print("Calculating saving throw bonuses...")
3296 | # proficiency bonus = 2 for starting characters
3297 | global save_str
3298 | save_str = mod_str
3299 | global save_dex
3300 | save_dex = mod_dex
3301 | global save_con
3302 | save_con = mod_con
3303 | global save_int
3304 | save_int = mod_int
3305 | global save_wis
3306 | save_wis = mod_wis
3307 | global save_cha
3308 | save_cha = mod_cha
3309 | if char_class in ("Barbarian", "barbarian"):
3310 | save_str = save_str + 2
3311 | save_con = save_con + 2
3312 | if char_class in ("Bard", "bard"):
3313 | save_dex = save_dex + 2
3314 | save_cha = save_cha + 2
3315 | if char_class in ("Cleric", "cleric"):
3316 | save_wis = save_wis + 2
3317 | save_cha = save_cha + 2
3318 | if char_class in ("Druid", "druid"):
3319 | save_wis = save_wis + 2
3320 | save_int = save_int + 2
3321 | if char_class in ("Fighter", "fighter"):
3322 | save_str = save_str + 2
3323 | save_con = save_con + 2
3324 | if char_class in ("Monk", "monk"):
3325 | save_str = save_str + 2
3326 | save_dex = save_dex + 2
3327 | if char_class in ("Paladin", "paladin"):
3328 | save_wis = save_wis + 2
3329 | save_cha = save_cha + 2
3330 | if char_class in ("Ranger", "ranger"):
3331 | save_str = save_str + 2
3332 | save_dex = save_dex + 2
3333 | if char_class in ("Rogue", "rogue"):
3334 | save_dex = save_dex + 2
3335 | save_int = save_int + 2
3336 | if char_class in ("Sorcerer", "sorcerer"):
3337 | save_con = save_con + 2
3338 | save_cha = save_cha + 2
3339 | if char_class in ("Warlock", "warlock"):
3340 | save_wis = save_wis + 2
3341 | save_cha = save_cha + 2
3342 | if char_class in ("Wizard", "wizard"):
3343 | save_int = save_int + 2
3344 | save_wis = save_int + 2
3345 | print(" Strength Saves: ", save_str)
3346 | print(" Dexterity Saves: ", save_dex)
3347 | print(" Constitution Saves: ", save_con)
3348 | print(" Wisdom Saves: ", save_wis)
3349 | print(" Intelligence Saves: ", save_int)
3350 | print(" Charisma Saves: ", save_cha)
3351 |
3352 |
3353 | def skills_fn():
3354 | print("Some races, and all classes, have a set of skills they are proficient in.")
3355 | global skill_athletics
3356 | skill_athletics = mod_str
3357 | global skill_acrobatics
3358 | skill_acrobatics = mod_dex
3359 | global skill_sleight
3360 | skill_sleight = mod_dex
3361 | global skill_stealth
3362 | skill_stealth = mod_dex
3363 | global skill_arcana
3364 | skill_arcana = mod_dex
3365 | global skill_history
3366 | skill_history = mod_int
3367 | global skill_investigation
3368 | skill_investigation = mod_int
3369 | global skill_nature
3370 | skill_nature = mod_int
3371 | global skill_religion
3372 | skill_religion = mod_int
3373 | global skill_animal
3374 | skill_animal = mod_wis
3375 | global skill_insight
3376 | skill_insight = mod_wis
3377 | global skill_medicine
3378 | skill_medicine = mod_wis
3379 | global skill_perception
3380 | skill_perception = mod_wis
3381 | global skill_survival
3382 | skill_survival = mod_wis
3383 | global skill_deception
3384 | skill_deception = mod_cha
3385 | global skill_intimidation
3386 | skill_intimidation = mod_cha
3387 | global skill_performance
3388 | skill_performance = mod_cha
3389 | global skill_persuasion
3390 | skill_persuasion = mod_cha
3391 | print(" Checking for racial bonus...")
3392 | if char_race in ("Dwarf", "dwarf", "Mountain Dwarf", "mountain dwarf", "Hill Dwarf", "hill dwarf"):
3393 | print(" Your ", char_race, " race has proficiency in History.")
3394 | skill_history = mod_int + 2
3395 | if char_race in ("Elf", "elf", "High Elf", "high elf", "Wood Elf", "wood elf", "Drow", "drow"):
3396 | print(" Your ", char_race, " race has proficiency in Perception.")
3397 | skill_perception = mod_wis + 2
3398 | if char_race in ("Half-Orc", "half-orc"):
3399 | print(" Your ", char_race, " race has proficiency in Intimidation.")
3400 | skill_intimidation = mod_cha + 2
3401 | if char_race in ("Half-Elf", "half-elf"):
3402 | print(" Your ", char_race, " race gives you a choice of skill proficiency.")
3403 |
3404 | def skill_choice_fn():
3405 | x, y = input("Chose two from: Athletics, Acrobatics, Sleight (of hand), Stealth, Arcana, History, Investigation, Nature, Religion, Animal (handling), Insight, Medicine, Perception, Survival, Deception, Intimidation, Performance, Persuasion, or Random; separated by a space: ").split()
3406 | if x not in ("Athletics", "Acrobatics", "Sleight", "Stealth", "Arcana", "History", "Investigation", "Nature", "Religion", "Animal", "Insight", "Medicine", "Perception", "Survival", "Deception", "Intimidation", "Performance", "Persuasion", "Random", "random", "R", "r"):
3407 | print("Invalid input, ", x)
3408 | skill_choice_fn()
3409 | if y not in ("Athletics", "Acrobatics", "Sleight", "Stealth", "Arcana", "History", "Investigation", "Nature", "Religion", "Animal", "Insight", "Medicine", "Perception", "Survival", "Deception", "Intimidation", "Performance", "Persuasion", "Random", "random", "R", "r"):
3410 | print("Invalid input, ", y)
3411 | skill_choice_fn()
3412 | elif x == y:
3413 | print("You cannot make the same selection twice.")
3414 | skill_choice_fn()
3415 | if x or y == "Athletics":
3416 | skill_athletics = mod_str + 2
3417 | elif x or y == "Acrobatics":
3418 | skill_acrobatics = mod_dex + 2
3419 | elif x or y == "Sleight":
3420 | skill_sleight = mod_dex + 2
3421 | elif x or y == "Stealth":
3422 | skill_stealth = mod_dex + 2
3423 | elif x or y == "Arcana":
3424 | skill_arcana = mod_int + 2
3425 | elif x or y == "History":
3426 | skill_history = mod_int + 2
3427 | elif x or y == "Investigation":
3428 | skill_investigation = mod_int + 2
3429 | elif x or y == "Nature":
3430 | skill_nature = mod_wis + 2
3431 | elif x or y == "Religion":
3432 | skill_religion = mod_wis + 2
3433 | elif x or y == "Animal":
3434 | skill_animal = mod_wis + 2
3435 | elif x or y == "Insight":
3436 | skill_insight = mod_wis + 2
3437 | elif x or y == "Medicine":
3438 | skill_medicine = mod_wis + 2
3439 | elif x or y == "Perception":
3440 | skill_perception = mod_wis + 2
3441 | elif x or y == "Survival":
3442 | skill_survival = mod_wis + 2
3443 | elif x or y == "Deception":
3444 | skill_deception = mod_cha + 2
3445 | elif x or y == "Intimidation":
3446 | skill_intimidation = mod_cha + 2
3447 | elif x or y == "Performance":
3448 | skill_performance = mod_cha + 2
3449 | elif x or y == "Persuasion":
3450 | skill_persuasion = mod_cha + 2
3451 | skill_choice_fn()
3452 | print(" Checking for class bonus...")
3453 | if char_class in ("Bard", "bard"):
3454 | def skill_choice_fn():
3455 | x, y, z = input("Chose three from: Athletics, Acrobatics, Sleight (of hand), Stealth, Arcana, History, Investigation, Nature, Religion, Animal (handling), Insight, Medicine, Perception, Survival, Deception, Intimidation, Performance, Persuasion; separated by a space: ").split()
3456 | if x not in ("Athletics", "Acrobatics", "Sleight", "Stealth", "Arcana", "History", "Investigation", "Nature", "Religion", "Animal", "Insight", "Medicine", "Perception", "Survival", "Deception", "Intimidation", "Performance", "Persuasion"):
3457 | print("Invalid input, ", x)
3458 | skill_choice_fn()
3459 | if y not in ("Athletics", "Acrobatics", "Sleight", "Stealth", "Arcana", "History", "Investigation", "Nature", "Religion", "Animal", "Insight", "Medicine", "Perception", "Survival", "Deception", "Intimidation", "Performance", "Persuasion"):
3460 | print("Invalid input, ", y)
3461 | skill_choice_fn()
3462 | if z not in ("Athletics", "Acrobatics", "Sleight", "Stealth", "Arcana", "History", "Investigation", "Nature", "Religion", "Animal", "Insight", "Medicine", "Perception", "Survival", "Deception", "Intimidation", "Performance", "Persuasion"):
3463 | print("Invalid input", z)
3464 | skill_choice_fn()
3465 | if x in (y, z):
3466 | print("You cannot make the same selection twice.")
3467 | skill_choice_fn()
3468 | if y in (x, z):
3469 | print("You cannot make the same selection twice.")
3470 | skill_choice_fn()
3471 | if x or y or z == "Athletics":
3472 | skill_athletics = mod_str + 2
3473 | if x or y or z == "Acrobatics":
3474 | skill_acrobatics = mod_dex + 2
3475 | if x or y or z == "Sleight":
3476 | skill_sleight = mod_dex + 2
3477 | if x or y or z == "Stealth":
3478 | skill_stealth = mod_dex + 2
3479 | if x or y or z == "Arcana":
3480 | skill_arcana = mod_int + 2
3481 | if x or y or z == "History":
3482 | skill_history = mod_int + 2
3483 | if x or y or z == "Investigation":
3484 | skill_investigation = mod_int + 2
3485 | if x or y or z == "Nature":
3486 | skill_nature = mod_int + 2
3487 | if x or y or z == "Religion":
3488 | skill_religion = mod_int + 2
3489 | if x or y or z == "Animal":
3490 | skill_religion = mod_wis + 2
3491 | if x or y or z == "Insight":
3492 | skill_insight = mod_wis + 2
3493 | if x or y or z == "Medicine":
3494 | skill_medicine = mod_wis + 2
3495 | if x or y or z == "Perception":
3496 | skill_perception = mod_wis + 2
3497 | if x or y or z == "Survival":
3498 | skill_survival = mod_wis + 2
3499 | if x or y or z == "Deception":
3500 | skill_deception = mod_cha + 2
3501 | if x or y or z == "Intimidation":
3502 | skill_intimidation = mod_cha + 2
3503 | if x or y or z == "Performance":
3504 | skill_performance = mod_cha + 2
3505 | if x or y or z == "Persuasion":
3506 | skill_persuasion = mod_cha + 2
3507 | skill_choice_fn()
3508 | if char_class in ("Barbarian", "barbarian"):
3509 | def skill_choice_fn():
3510 | x, y = input("Chose two from: Animal (handling), Athletics, Intimidation, Nature, Perception, Survival; separated by a space: ").split()
3511 | if x not in ("Animal", "Athletics", "Intimidation", "Nature", "Perception", "Survival"):
3512 | print("Invalid input, ", x)
3513 | skill_choice_fn()
3514 | if y not in ("Animal", "Athletics", "Intimidation", "Nature", "Perception", "Survival"):
3515 | print("Invalid input, ", y)
3516 | skill_choice_fn()
3517 | if x == y:
3518 | print("You cannot make the same selection twice.")
3519 | skill_choice_fn()
3520 | if x or y == "Animal":
3521 | skill_animal = mod_wis + 2
3522 | if x or y == "Athletics":
3523 | skill_athletics = mod_str + 2
3524 | if x or y in "Intimidation":
3525 | skill_intimidation = mod_cha + 2
3526 | if x or y in "Nature":
3527 | skill_nature = mod_wis + 2
3528 | if x or y in "Perception":
3529 | skill_perception = mod_wis + 2
3530 | if x or y in "Survival":
3531 | skill_survival = mod_wis + 2
3532 | skill_choice_fn()
3533 | if char_class in ("Cleric", "cleric"):
3534 | def skill_choice_fn():
3535 | x, y = input("Chose two two from: History, Insight, Medicine, Persuasion, Religion; separated by a space: ").split()
3536 | if x not in ("History", "Insight", "Medicine", "Persuasion", "Religion"):
3537 | print("Invalid input, ", x)
3538 | skill_choice_fn()
3539 | if y not in ("History", "Insight", "Medicine", "Persuasion", "Religion"):
3540 | print("Invalid input, ", y)
3541 | skill_choice_fn()
3542 | if x == y:
3543 | print("You cannot make the same selection twice.")
3544 | skill_choice_fn()
3545 | if x or y == "History":
3546 | skill_history = mod_int + 2
3547 | if x or y == "Insight":
3548 | skill_insight = mod_wis + 2
3549 | if x or y == "Medicine":
3550 | skill_insight = mod_wis + 2
3551 | if x or y == "Persuasion":
3552 | skill_persuasion = mod_cha + 2
3553 | if x or y == "Religion":
3554 | skill_religion = mod_int + 2
3555 | skill_choice_fn()
3556 | if char_class in ("Druid", "druid"):
3557 | def skill_choice_fn():
3558 | x, y = input("Chose two from: Arcana, Animal (handling), Insight, Medicine, Nature, Perception, Religion, Survival; separated by a space: ").split()
3559 | if x not in ("Arcana", "Animal", "Insight", "Medicine", "Nature", "Perception", "Religion", "Survival"):
3560 | print("Invalid input, ", x)
3561 | skill_choice_fn()
3562 | if y not in ("Arcana", "Animal", "Insight", "Medicine", "Nature", "Perception", "Religion", "Survival"):
3563 | print("Invalid input, ", y)
3564 | skill_choice_fn()
3565 | if x == y:
3566 | print("You cannot make the same selection twice.")
3567 | skill_choice_fn()
3568 | if x or y == "Arcana":
3569 | skill_arcana = mod_int + 2
3570 | if x or y == "Insight":
3571 | skill_insight = mod_wis + 2
3572 | if x or y == "Medicine":
3573 | skill_medicine = mod_wis + 2
3574 | if x or y == "Nature":
3575 | skill_nature = mod_int + 2
3576 | if x or y == "Perception":
3577 | skill_peception = mod_wis + 2
3578 | if x or y == "Religion":
3579 | skill_religion = mod_int + 2
3580 | if x or y == "Survival":
3581 | skill_survival = mod_wis + 2
3582 | skill_choice_fn()
3583 | if char_class in ("Fighter", "fighter"):
3584 | def skill_choice_fn():
3585 | x, y = input("Chose two from: Acrobatics, Animal (handling), Athletics, History, Insight, Intimidation, Perception, Survival; separated by a space: ").split()
3586 | if x not in ("Acrobatics", "Animal", "Athletics", "History", "Insight", "Intimidation", "Perception", "Survival"):
3587 | print("Invalid input, ", x)
3588 | skill_choice_fn()
3589 | if y not in ("Acrobatics", "Animal", "Athletics", "History", "Insight", "Intimidation", "Perception", "Survival"):
3590 | print("Invalid input, ", y)
3591 | skill_choice_fn()
3592 | if x == y:
3593 | print("You cannot make the same selection twice.")
3594 | skill_choice_fn()
3595 | if x or y == "Acrobatics":
3596 | skill_acrobatics = mod_dex + 2
3597 | if x or y == "Animal":
3598 | skill_animal = mod_wis + 2
3599 | if x or y == "Athletics":
3600 | skill_athletics = mod_str + 2
3601 | if x or y == "History":
3602 | skill_history = mod_int + 2
3603 | if x or y == "Insight":
3604 | skill_insight = mod_wis + 2
3605 | if x or y == "Intimidation":
3606 | skill_intimidation = mod_cha + 2
3607 | if x or y == "Perception":
3608 | skill_perception = mod_wis + 2
3609 | if x or y == "Survival":
3610 | skill_survival = mod_wis + 2
3611 | skill_choice_fn()
3612 | if char_class in ("Monk", "monk"):
3613 | def skill_choice_fn():
3614 | x, y = input("Chose two from: Acrobatics, Athletics, History, Insight, Religion, Stealth; separated by a space: ").split()
3615 | if x not in ("Acrobatics", "Athletics", "History", "Insight", "Religion", "Stealth"):
3616 | print("Invalid input, ", x)
3617 | skill_choice_fn()
3618 | if y not in ("Acrobatics", "Athletics", "History", "Insight", "Religion", "Stealth"):
3619 | print("Invalid input, ", y)
3620 | skill_choice_fn()
3621 | if x == y:
3622 | print("You cannot make the same selection twice.")
3623 | skill_choice_fn()
3624 | if x or y == "Acrobatics":
3625 | skill_acrobatics = mod_dex + 2
3626 | if x or y == "Athletics":
3627 | skill_athletics = mod_str + 2
3628 | if x or y == "History":
3629 | skill_history = mod_int + 2
3630 | if x or y == "Insight":
3631 | skill_insight = mod_wis + 2
3632 | if x or y == "Religion":
3633 | skill_religion = mod_int + 2
3634 | if x or y == "Stealth":
3635 | skill_stealth = mod_dex + 2
3636 | skill_choice_fn()
3637 | if char_class in ("Paladin", "paladin"):
3638 | def skill_choice_fn():
3639 | x, y = input("Choose two from: Athletics, Insight, Intimidation, Medicine, Persuasion, Religion; separated by a space: ").split()
3640 | if x not in ("Athletics", "Insight", "Intimidation", "Medicine", "Persuasion", "Religion"):
3641 | print("Invalid input, ", x)
3642 | skill_choice_fn()
3643 | if y not in ("Athletics", "Insight", "Intimidation", "Medicine", "Persuasion", "Religion"):
3644 | print("Invalid input, ", y)
3645 | skill_choice_fn()
3646 | if x == y:
3647 | print("You cannot make the same selection twice.")
3648 | skill_choice_fn()
3649 | if x or y == "Athletics":
3650 | skill_athletics = mod_str + 2
3651 | if x or y == "Insight":
3652 | skill_insight = mod_wis + 2
3653 | if x or y == "Intimidation":
3654 | skill_intimidation = mod_cha + 2
3655 | if x or y == "Medicine":
3656 | skill_medicine = mod_wis + 2
3657 | if x or y == "Persuasion":
3658 | skill_persuasion = mod_cha + 2
3659 | if x or y == "Religion":
3660 | skill_religion = mod_int + 2
3661 | skill_choice_fn()
3662 | if char_class in ("Ranger", "ranger"):
3663 | def skill_choice_fn():
3664 | x, y, z = input("Chose three from: Animal (handling), Athletics, Insight, Investigation, Nature, Perception, Stealth, Survival; separated by a spaces: ").split()
3665 | if x not in ("Animal", "Athletics", "Insight", "Investigation", "Nature", "Perception", "Stealth", "Survival"):
3666 | print("Invalid input, ", x)
3667 | skill_choice_fn()
3668 | if y not in ("Animal", "Athletics", "Insight", "Investigation", "Nature", "Perception", "Stealth", "Survival"):
3669 | print("Invalid input, ", y)
3670 | skill_choice_fn()
3671 | if z not in ("Animal", "Athletics", "Insight", "Investigation", "Nature", "Perception", "Stealth", "Survival"):
3672 | print("Invalid input, ", y)
3673 | skill_choice_fn()
3674 | if x in (y, z):
3675 | print("You cannot make the same selection twice.")
3676 | skill_choice_fn()
3677 | if y in (x, z):
3678 | print("You cannot make the same selection twice.")
3679 | skill_choice_fn()
3680 | if x or y or z == "Animal":
3681 | skill_animal = mod_wis + 2
3682 | if x or y or z == "Athletics":
3683 | skill_athletics = mod_str + 2
3684 | if x or y or z == "Insight":
3685 | skill_insight = mod_wis + 2
3686 | if x or y or z == "Investigation":
3687 | skill_investigation = mod_int + 2
3688 | if x or y or z == "Nature":
3689 | skill_nature = skill_nature + 2
3690 | if x or y or z == "Perception":
3691 | skill_perception = mod_wis + 2
3692 | if x or y or z == "Stealth":
3693 | skill_stealth = mod_dex + 2
3694 | if x or y or z == "Survival":
3695 | skill_surviavl = mod_wis + 2
3696 | skill_choice_fn()
3697 | if char_class in ("Rogue", "rogue"):
3698 | def skill_choice_fn():
3699 | a, b, c, d = input("Chose four from: Acrobatics, Athletics, Deception, Insight, Intimidation, Investigation, Perception, Performance, Persuasion, Sleight (of hand), Stealth; separated by spaces: ").split()
3700 | if a not in ("Acrobatics", "Athletics", "Deception", "Insight", "Intimidation", "Investigation", "Perception", "Performance", "Persuasion", "Sleight", "Stealth"):
3701 | print("Invalid input, ", a)
3702 | skill_choice_fn()
3703 | if b not in ("Acrobatics", "Athletics", "Deception", "Insight", "Intimidation", "Investigation", "Perception", "Performance", "Persuasion", "Sleight", "Stealth"):
3704 | print("Invalid input, ", b)
3705 | skill_choice_fn()
3706 | if c not in ("Acrobatics", "Athletics", "Deception", "Insight", "Intimidation", "Investigation", "Perception", "Performance", "Persuasion", "Sleight", "Stealth"):
3707 | print("Invalid input, ", c)
3708 | skill_choice_fn()
3709 | if d not in ("Acrobatics", "Athletics", "Deception", "Insight", "Intimidation", "Investigation", "Perception", "Performance", "Persuasion", "Sleight", "Stealth"):
3710 | print("Invalid input, ", d)
3711 | skill_choice_fn()
3712 | if a in (b, c, d):
3713 | print("You cannot make the same selection twice.")
3714 | skill_choice_fn()
3715 | if b in (a, c, d):
3716 | print("You cannot make the same selection twice.")
3717 | skill_choice_fn()
3718 | if c in (a, b, d):
3719 | print("You cannot make the same selection twice.")
3720 | skill_choice_fn()
3721 | if a or b or c or d == "Acrobatics":
3722 | skill_acrobatics = mod_dex + 2
3723 | if a or b or c or d == "Athletics":
3724 | skill_athletics = mod_str + 2
3725 | if a or b or c or d == "Deception":
3726 | skill_deception = mod_cha + 2
3727 | if a or b or c or d == "Insight":
3728 | skill_insight = mod_wis + 2
3729 | if a or b or c or d == "Intimidation":
3730 | skill_intimidation = mod_cha + 2
3731 | if a or b or c or d == "Investigation":
3732 | skill_investigation = mod_int + 2
3733 | if a or b or c or d == "Perception":
3734 | skill_perception = mod_wis + 2
3735 | if a or b or c or d == "Performance":
3736 | skill_performance = mod_cha + 2
3737 | if a or b or c or d == "Persuasion":
3738 | skill_persuasion = mod_cha + 2
3739 | if a or b or c or d == "Sleight":
3740 | skill_slieght = mod_dex + 2
3741 | if a or b or c or d == "Stealth":
3742 | skill_stealth = mod_dex + 2
3743 | skill_choice_fn()
3744 | if char_class in ("Sorcerer", "sorcerer"):
3745 | def skill_choice_fn():
3746 | x, y = input("Chose two from: Arcana, Deception, Insight, Intimation, Persuasion, Religion; separated by a space: ").split()
3747 | if x not in ("Arcana", "Deception", "Insight", "Intimidation", "Persuasion", "Religion"):
3748 | print("Invalid input, ", x)
3749 | skill_choice_fn()
3750 | if y not in ("Arcana", "Deception", "Insight", "Intimidation", "Persuasion", "Religion"):
3751 | print("Invalid input, ", y)
3752 | skill_choice_fn()
3753 | if x == y:
3754 | print("You cannot make the same selection twice.")
3755 | skill_choice_fn()
3756 | if x or y == "Arcana":
3757 | skill_arcana = mod_int + 2
3758 | if x or y == "Deception":
3759 | slkill_deception = mod_cha + 2
3760 | if x or y == "Insight":
3761 | skill_insight = mod_wis + 2
3762 | if x or y == "Intimidation":
3763 | skill_intimidation = mod_cha + 2
3764 | if x or y == "Persuasion":
3765 | skill_persuasion = mod_cha + 2
3766 | if x or y == "Religion":
3767 | skill_religion = mod_int + 2
3768 | skill_choice_fn()
3769 | if char_class in ("Warlock", "warlock"):
3770 | def skill_choice_fn():
3771 | x, y = input("Chose two from: Arcana, Deception, History, Intimidation, Investigation, Nature, Religion; separated by a space: ").split()
3772 | if x not in ("Arcana", "Deception", "History", "Intimidation", "Investigation", "Nature", "Religion"):
3773 | print("Invalid input, ", x)
3774 | skill_choice_fn()
3775 | if y not in ("Arcana", "Deception", "History", "Intimidation", "Investigation", "Nature", "Religion"):
3776 | print("Invalid input, ", y)
3777 | skill_choice_fn()
3778 | if x == y:
3779 | print("You cannot make the same selection twice.")
3780 | skill_choice_fn()
3781 | if x or y == "Arcana":
3782 | skill_arcana = mod_int + 2
3783 | if x or y == "Deception":
3784 | skill_deception = mod_cha + 2
3785 | if x or y == "History":
3786 | skill_history = mod_int + 2
3787 | if x or y == "Intimidation":
3788 | skill_intimidation = mod_cha + 2
3789 | if x or y == "Investigation":
3790 | skill_investigation = mod_int + 2
3791 | if x or y == "Nature":
3792 | skill_nature = mod_int + 2
3793 | if x or y == "Religion":
3794 | skill_religion = mod_int + 2
3795 | skill_choice_fn()
3796 | if char_class in ("Wizard", "wizard"):
3797 | def skill_choice_fn():
3798 | x, y = input("Chose two from: Arcana, History, Insight, Investigation, Medicine, Religion; separated by a space: ").split()
3799 | if x not in ("Arcana", "History", "Insight", "Investigation", "Medicine", "Religion"):
3800 | print("Invalid input, ", x)
3801 | skill_choice_fn()
3802 | if y not in ("Arcana", "History", "Insight", "Investigation", "Medicine", "Religion"):
3803 | print("Invalid input, ", y)
3804 | skill_choice_fn()
3805 | if x == y:
3806 | print("You cannot make the same selection twice.")
3807 | skill_choice_fn()
3808 | if x or y == "Arcana":
3809 | skill_arcana = mod_int + 2
3810 | if x or y == "History":
3811 | skill_history = mod_int + 2
3812 | if x or y == "Insight":
3813 | skill_insight = mod_int + 2
3814 | if x or y == "Investigation":
3815 | skill_investigation = mod_int + 2
3816 | if x or y == "Medicine":
3817 | skill_medicine = mod_wis + 2
3818 | if x or y == "Religion":
3819 | skill_religion = mod_int + 2
3820 | skill_choice_fn()
3821 |
3822 |
3823 | def hp_fn():
3824 | global char_hp
3825 | print("Now we need to calculate hit points.")
3826 | if char_class is "Barbarian":
3827 | hit_die = random.randint(1, 12)
3828 | char_hp = mod_con + hit_die
3829 | print("You scored ", char_hp, " hit points")
3830 | elif char_class in ("Fighter", "Paladin", "Ranger"):
3831 | hit_die = random.randint(1, 10)
3832 | char_hp = mod_con + hit_die
3833 | print("You scored ", char_hp, " hit points")
3834 | elif char_class in ("Wizard", "Sorcerer"):
3835 | hit_die = random.randint(1, 6)
3836 | char_hp = mod_con + hit_die
3837 | print("You scored ", char_hp, " hit points")
3838 | else:
3839 | hit_die = random.randint(1, 8)
3840 | char_hp = mod_con + hit_die
3841 | print("You scored ", char_hp, " hit points")
3842 |
3843 |
3844 | def alignment_fn():
3845 | def lawchaos():
3846 | global align_lawchaos
3847 | align_lawchaos = input("Choose (L)awful, (C)haotic, or (N)eutral: ")
3848 | if align_lawchaos in ("L", "l", "Lawful", "lawful"):
3849 | align_lawchaos = "Lawful"
3850 | elif align_lawchaos in ("C", "c", "Chaotic", "chaotic"):
3851 | align_lawchaos = "Chaotic"
3852 | elif align_lawchaos in ("N", "n", "Neutral", "neutral"):
3853 | align_lawchaos = "Neutral"
3854 | else:
3855 | print("Invalid choice")
3856 | lawchaos()
3857 |
3858 | def goodevil():
3859 | global align_goodevil
3860 | align_goodevil = input("Choose (G)ood, (E)vil, or (N)eutral: ")
3861 | if align_goodevil in ("G", "g", "Good", "good"):
3862 | align_goodevil = "Good"
3863 | elif align_goodevil in ("E", "e", "Evil", "evil"):
3864 | align_goodevil = "Evil"
3865 | elif align_goodevil in ("N", "n", "Neutral", "neutral"):
3866 | align_goodevil = "Neutral"
3867 | else:
3868 | print("Invalid choice")
3869 | goodevil()
3870 |
3871 | def cont():
3872 | choice = input("Is this correct? (y/n) ")
3873 | if choice in ("Y", "y", "Yes", "yes"):
3874 | pass
3875 | elif choice in ("N", "n", "No", "no"):
3876 | alignment_fn()
3877 | else:
3878 | cont()
3879 |
3880 | print("Finally choose alignment.")
3881 | rnd_align = input("Do you want to use a random alignment? [Y]: ")
3882 | if rnd_align in ("Y", "y", "Yes", "yes", ""):
3883 | goodevil_ls = ["Good", "Evil", "Neutral"]
3884 | lawchaos_ls = ["Lawful", "Chaotic", "Neutral"]
3885 | global align_lawchaos
3886 | global align_goodevil
3887 | align_lawchaos = random.choice(lawchaos_ls)
3888 | align_goodevil = random.choice(goodevil_ls)
3889 | elif rnd_align in ("N", "n", "No", "no"):
3890 | lawchaos()
3891 | goodevil()
3892 | else:
3893 | print("Invalid choice")
3894 | alignment_fn()
3895 | print("Your alignment is ", align_lawchaos, "-", align_goodevil)
3896 |
3897 |
3898 | def summary_fn():
3899 | print("###########################################")
3900 | print("Dungeons and Dragons, 5th Edition Character")
3901 | print("###########################################")
3902 | print("")
3903 | print("GENERAL INFORMATION:")
3904 | if char_name:
3905 | print("Character: ", char_name)
3906 | print(" Race: ", char_race)
3907 | print(" Class: ", char_class)
3908 | if plyr_name:
3909 | print(" Player: ", plyr_name)
3910 | print("")
3911 | print(" Height: ", char_heightft, "'", char_heightin, '"')
3912 | print(" Weight: ", char_weight, "lbs.")
3913 | print(" Age: ", char_age, "years old")
3914 | print(" Gender: ", char_gender)
3915 | print(" Alignment: ", align_lawchaos, "-", align_goodevil)
3916 | print("")
3917 | print("BASIC STATS:")
3918 | print(" Max Hit Points: ", char_hp)
3919 | print(" Armor Class: ", char_ac)
3920 | print(" Attack Bonus: ", atk_bonus)
3921 | print(" Primary Stat: ", prim_stat)
3922 | print("")
3923 | print("ABILITY SCORES:")
3924 | print(" Strength: ", abl_str, "(", mod_str, ")")
3925 | print(" Dexterity: ", abl_dex, "(", mod_dex, ")")
3926 | print(" Constitution: ", abl_con, "(", mod_con, ")")
3927 | print(" Intelligence: ", abl_int, "(", mod_int, ")")
3928 | print(" Wisdom: ", abl_wis, "(", mod_wis, ")")
3929 | print(" Charisma: ", abl_cha, "(", mod_cha, ")")
3930 | print("")
3931 | print("SAVING THROWS:")
3932 | print(" Strength: ", save_str)
3933 | print(" Dexterity: ", save_dex)
3934 | print(" Constitution ", save_con)
3935 | print(" Intelligence ", save_int)
3936 | print(" Wisdom: ", save_wis)
3937 | print(" Charisma: ", save_cha)
3938 | print("")
3939 | print("SKILLS:")
3940 | print(" Athletics (STR): ", skill_athletics)
3941 | print(" Acrobatics (DEX) ", skill_acrobatics)
3942 | print(" Sleight of Hand (DEX) ", skill_sleight)
3943 | print(" Stealth (DEX) ", skill_stealth)
3944 | print(" Arcana (INT) ", skill_arcana)
3945 | print(" History (INT) ", skill_history)
3946 | print(" Investigation (INT) ", skill_investigation)
3947 | print(" Nature (INT) ", skill_nature)
3948 | print(" Religion (INT) ", skill_religion)
3949 | print(" Animal Handling (WIS) ", skill_animal)
3950 | print(" Insight (WIS) ", skill_insight)
3951 | print(" Medicine (WIS) ", skill_medicine)
3952 | print(" Perception (WIS) ", skill_perception)
3953 | print(" Survival (WIS) ", skill_survival)
3954 | print(" Deception (CHA) ", skill_deception)
3955 | print(" Intimidation (CHA) ", skill_intimidation)
3956 | print(" Performance (CHA) ", skill_performance)
3957 | print(" Persuasion (CHA) ", skill_persuasion)
3958 |
3959 |
3960 | def save_fn():
3961 | save_opt = input("Do you want to save this character? [Y]: ")
3962 | if save_opt in ("Y", "y", "Yes", "yes", ""):
3963 | original = sys.stdout
3964 | f = open(char_name + ".txt", "w")
3965 | sys.stdout = f
3966 | summary_fn()
3967 | f.close()
3968 | sys.stdout = original
3969 | start_fn()
3970 | else:
3971 | start_fn()
3972 |
3973 |
3974 | ##########
3975 | # Script #
3976 | ##########
3977 |
3978 | start_fn()
3979 |
--------------------------------------------------------------------------------