Skip to content

Commit

Permalink
Merge pull request #854 from myk002/myk_add_recipe
Browse files Browse the repository at this point in the history
[add-recipe] reinstate
  • Loading branch information
myk002 authored Oct 7, 2023
2 parents 309ccf4 + 509cef4 commit e190bb4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 38 deletions.
29 changes: 1 addition & 28 deletions add-recipe.lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
-- Script to add unknown crafting recipes to the player's civ.
--[====[
add-recipe
==========
Adds unknown weapon and armor crafting recipes to your civ.
E.g. some civilizations never learn to craft high boots. This script can
help with that, and more. Only weapons, armor, and tools are currently supported;
things such as instruments are not. Available options:
* ``add-recipe all`` adds *all* available weapons and armor, including exotic items
like blowguns, two-handed swords, and capes.
* ``add-recipe native`` adds only native (but unknown) crafting recipes. Civilizations
pick randomly from a pool of possible recipes, which means not all civs get
high boots, for instance. This command gives you all the recipes your
civilisation could have gotten.
* ``add-recipe single <item token>`` adds a single item by the given
item token. For example::
add-recipe single SHOES:ITEM_SHOES_BOOTS
]====]

local itemDefs = df.global.world.raws.itemdefs
local resources = df.historical_entity.find(df.global.plotinfo.civ_id).resources
Expand Down Expand Up @@ -125,7 +104,6 @@ function addItems(category, exotic)
return added
end


function printItems(itemList)
for _, v in ipairs(itemList) do
local v = v --as:df.itemdef_weaponst
Expand Down Expand Up @@ -192,10 +170,5 @@ elseif (cmd == "native") then
elseif (cmd == "single") then
addSingleItem(args[2])
else
print("Available options:\n"
.."all: adds all supported crafting recipes.\n"
.."native: adds only unknown native recipes (eg. high boots for "
.."some dwarves)\n"
.."single: adds a specific item by itemstring (eg. "
.."SHOES:ITEM_SHOES_BOOTS)")
print(dfhack.script_help())
end
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Template for new versions:
# Future

## New Tools
- `add-recipe`: (reinstated) add reactions to your civ (e.g. for high boots if your civ didn't start with the ability to make high boots)

## New Features
- `drain-aquifer`: gained ability to drain just above or below a certain z-level
Expand Down
23 changes: 13 additions & 10 deletions docs/add-recipe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,29 @@ add-recipe

.. dfhack-tool::
:summary: Add crafting recipes to a civ.
:tags: unavailable adventure fort gameplay
:tags: adventure fort gameplay

Civilizations pick randomly from a pool of possible recipes, which means not all
civs get high boots, for instance. This script can help fix that. Only weapons,
armor, and tools are currently supported; things such as instruments are not.
Civilizations pick randomly from a pool of possible recipes, which means, for
example, not all civs get high boots. This script can help fix that. Only
weapons, armor, and tools are currently supported; dynamically generated item
types like instruments are not.

Usage
-----

::

add-recipe (all|native)
add-recipe single <item token>

Examples
--------

``add-recipe native``
Add all crafting recipes that your civ could have chosen from its pool, but
did not.
``add-recipe all``
Add *all* available weapons and armor, including exotic items like
blowguns, two-handed swords, and capes.
``add-recipe single <item token>``
Add a single item by the given item token.

Example
-------

``add-recipe single SHOES:ITEM_SHOES_BOOTS``
Allow your civ to craft high boots.

0 comments on commit e190bb4

Please sign in to comment.