Commit Graph

112 Commits

Author SHA1 Message Date
35663dd8d4
Add list option
This option lists enumeration identifiers, along with their string forms
for clarity's sake. This makes it much easier to blacklist things
without reading the source code.

A note about listing has been added to the Blacklisting section of the
README.

A dedicated action has been created for the list command.
2021-08-14 17:55:45 -05:00
3b1ca61104
Fix BlacklistAction bug
This bug would have caused an error if BlacklistAction were used with a
different nargs.

The "verbose" argument no longer has a default specified. Instead, the
code that checks it supplies a default for itself.
2021-08-14 14:40:15 -05:00
4cf9e4f008
Add --no-verbose option
The action for "--verbose" has been changed to BooleanOptionalAction,
which adds a negative version that may be useful for overriding
configuration files.
2021-08-14 14:08:38 -05:00
cae8ac5055
Clarify nargs specifiers
Rather than using raw strings, nargs specifiers are now expressed in
terms of argparse's corresponding global variables.
2021-08-14 13:05:17 -05:00
45fb0d14e8
Update example invocation in README
The usage example now includes the blacklist argument, to better
indicate how it is meant to be used.
2021-08-14 12:14:40 -05:00
1275891b27
Tweak costs
Balmoral Woods costs now take achievable quantities of Time Remaining in
the Woods into account.

Volumes of Collated Research are now acquired using the Übergoat statue
at the Hurlers.

Trembling Amber is now acquired using the Rubbery Men opportunity card.
2021-08-13 12:14:18 -05:00
4034530ddb
Add support for configuration files
Configuration files allow common arguments like --shadowy-level and
--blacklist to be saved and referenced rather being typed out each time.

ArgumentParser has been subclassed to allow more freedom when parsing
configuration files.
2021-08-13 10:26:59 -05:00
be44c9c489
Add blacklist parameter to CLI
Blacklisting uses a dedicated action to parse arguments into enumeration
members.

Choices are not provided for this option, as it would utterly overwhelm
the help interface. This means that errors may not be as helpful,
however.

The README has been updated with a small section on blacklisting, how to
do it, and why you may wish to do it.

Options that were previously commented out are now enabled, since the
user can simply blacklist them instead.
2021-08-13 09:45:27 -05:00
dabf0ff4d7
Add blacklist parameter to solver
Enum members in this dictionary are disallowed by the solver.

The types that can be blacklisted have been added to __all__ in
solve.py.
2021-08-13 09:03:14 -05:00
cacb985be6
Fix Enum arguments that accept multiple values
EnumAction was erasing nargs before passing it to the superclass
initializer, which broke handling for arguments with consecutive values.

The help text for --desired-buyer has been updated to reflect that you
actually can specify multiple values with a single declaration now.
2021-08-13 08:27:23 -05:00
4ef31a9cca
Fix warm amber calculation
The cost was inaccurately multiplied by the number of joint additions
before.

Credit to 34Witches in the FBG Discord for diagnosing the problem.
2021-08-12 21:38:07 -05:00
90b769230b
Add skulls fascination for Diplomat
This fascination scales with all three skeleton attributes multiplied together.
2021-08-11 18:35:15 -05:00
fad2aa4158
Correct long form of exhaustion limit
The argument incorrectly used an underscore as a word separator. This
has been corrected.
2021-08-03 15:43:00 -05:00
84ad2c1455
Fix typos in README
Some of the CLI arguments in the example used underscores instead of dashes.
2021-08-03 15:38:41 -05:00
06df9e6304
Add amalgamy fascination for Diplomat
This fascination scales with the amount of amalgamy on the skeleton.
2021-08-03 15:34:37 -05:00
84c62aa3c6
Convert project to package
All scripts are now contained in a package named "bonemarketsolver".

The command-line interface has been moved to __main__.py.

The solver script has been moved to solve.py.

Relative module imports are now used where appropriate.

The invocation method of the CLI has changed: instead of running Python
itself, you can now use "pipenv run bone_market_solver".

The README has been updated to reflect the new usage method.
2021-08-03 14:48:42 -05:00
b0075ab519
Move remaining enumerations to different files
This makes it possible to split the central script up further.

Importing enum is no longer necessary for the central script, so it has
been removed.
2021-08-03 14:23:52 -05:00
a17135d85d
Move EnumAction to different file
This will make it easier to move main() in the future.
2021-08-03 13:54:36 -05:00
9cfed0f839
Specify interface and author for each module
Spelling out what is public in each module helps to futureproof the
project, and allows the main script to import the relevant names without
contravening best practices.

Buyer was missing from the main script's interface, despite being used
to call Solve. This has been fixed.
2021-08-03 12:53:25 -05:00
ed9cde4b01
Move Buyer to different file
Since the main script is no longer using Action directly, it is no
longer imported.
2021-08-03 12:43:41 -05:00
5aa070f989
Move Embellishment to different file 2021-08-03 12:38:31 -05:00
7f750f8dab
Move Declaration to different file 2021-08-03 12:31:20 -05:00
92109d5141
Move Adjustment to different file 2021-08-03 12:24:53 -05:00
66deeb50e7
Move Appendage to different file 2021-08-03 12:22:00 -05:00
cb11bf7c07
Move Skull to different file 2021-08-03 12:19:21 -05:00
ebbcf965cd
Move Torso to different file 2021-08-03 12:16:16 -05:00
ee71de9b8a
Move Action to different file
In order to move remaining enumerations into other files, dependencies
in this file need to be moved as well.

The folder is named "objects" because "types" is taken as a name.
2021-08-03 12:12:11 -05:00
27add1aa47
Move Cost enumeration to different file
Having a single extremely large file harms readability. To solve this
problem, the Cost enumeration is now in a distinct file.
2021-08-03 12:02:06 -05:00
f13497e9b8
Add README
This should make it easier for people to actually use the tool.
2021-08-03 11:33:35 -05:00
985414aeab
Add Windows-specific curses dependency
The curses module is not included with Python on Windows, and must be
installed as a package. The Pipfile has been updated to do this when run
on Windows.
2021-07-20 11:15:56 -05:00
b07752ce95
Add insect fascination for Diplomat
This fascination effectively requires an Insect declaration, and scales
with all three skeleton attributes multiplied together.
2021-07-14 10:39:20 -05:00
545e46e301
Make world quality arguments optional
In the absence of provided values, the script will use the "normal"
values for everything. While this may produce suboptimal results, it
could prove helpful for creating worst-case scenario designs.
2021-07-11 15:49:50 -05:00
c73023d4dc
Reorganize command-line arguments
All arguments are now enclosed in a single argument group to improve the
generated help text.

Due to how argparse works, this means that the script now allows
redundant command-line arguments like specifying the occasional buyer
and explicit buyers.

The grammar of the help text has been made slightly more consistent.
2021-07-11 15:49:50 -05:00
630d63a555
Remove arguments from verbosity flag
'-v' and '--verbose' no longer accept an argument, optional or
otherwise. Instead, they simply act as a flag.

This dramatically simplifies the help text and implementation of the
flags.
2021-07-11 15:49:46 -05:00
12773d479e
Remove comments on Diplomat difficulty
It has been confirmed that no Trifling Diplomat option is meant to have
a Shadowy check.
2021-07-09 10:46:56 -05:00
a709f5404b
Erase comment on Trifling Diplomat bird difficulty
The Trifling Diplomat does not have a Shadowy challenge at all for this
fascination, so the difficulty level is effectively zero.
2021-07-08 16:15:35 -05:00
afbad8b532
Clean up requirements
Declarations that require a specific range of torso style now use one
constraint to model that, rather than two.

Inconsistent whitespace has been cleaned up.

Skipping tails is only possible if there are tails to skip.
2021-07-07 15:12:03 -05:00
82363c8172
Update fluctuation bonuses for hybrid buyers
The multiplier is now 1/2 instead of 4/5.

This means that is no longer necessary to multiply before dividing.
2021-07-07 14:17:55 -05:00
76a7effb6e
Add the Enterprising Boot Salesman
This buyer scales with the number of legs on the skeleton.
2021-07-06 14:18:07 -05:00
cf45cd81ce
Add Menace fluctuation
This fluctuation affects buyers similarly to the existing fluctuations,
and uses a similar implementation as a result.
2021-07-06 13:19:29 -05:00
283bf92243
Add bird fascination for Diplomat
This fascination effectively requires a Bird declaration, and scales
with all three skeleton attributes multiplied together.
2021-07-06 12:33:03 -05:00
673b6160c6
Define DiplomatFascination functionally
Rather than laboriously replicating every fascination the Trifling
Diplomat has, the script now exploits the consistent member names to
generate the list automatically.

This should not have any effect on usage, but will ease future
maintainance.
2021-07-06 12:18:49 -05:00
9b7162527d
Add DiplomatFascination to public interface
Its prior exclusion was a mistake: this is necessary to use Solve.
2021-07-06 12:05:10 -05:00
dc75b4d157
Fix missing variable name 2021-07-06 11:42:20 -05:00
0c08586f24
Remove unnecessary use of setattr()
If an attribute is referenced using a string literal, there is no reason
to use setattr().
2021-07-06 11:27:13 -05:00
3a97dba0cb
Change names of DiplomatFascination members
The new names are more consistent with other enumerations, namely
Declaration and Fluctuation.
2021-07-06 11:25:15 -05:00
a2e8fe8b62
Add fossilised fish fascination for Diplomat
This fascination effectively requires a Fish declaration, and scales
with all three skeleton attributes multiplied together.
2021-06-29 15:56:42 -05:00
dd01457cc4
Fix description of Zoological Mania option
Not all declarations have a 10% bonus associated with them.
2021-06-25 18:40:39 -05:00
7a6a0697e3
Add the Trifling Diplomat
This buyer actually changes based on a world quality. As such, it has
been implemented in a similar fashion to Occasional Buyer.

The scaling for this buyer's difficulty level has not been established
at the time of this writing, so it is being treated as 0.
2021-06-25 18:37:41 -05:00
b13c416d5e
Stop requiring desired buyers or occasional buyer
If no occasional or desired buyers are specified, the script will choose
from among the buyers that are definitely present.
2021-06-25 17:37:32 -05:00