Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armor from bark or hides #37

Open
2 of 3 tasks
fabio-t opened this issue Feb 28, 2018 · 1 comment
Open
2 of 3 tasks

Armor from bark or hides #37

fabio-t opened this issue Feb 28, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@fabio-t
Copy link
Owner

fabio-t commented Feb 28, 2018

  • item types (one per body part? Or allow multi-part?)

  • crafting recipes

  • must inherit protection values from material

@fabio-t fabio-t added this to the 0.3.0 milestone Feb 28, 2018
@fabio-t fabio-t self-assigned this Feb 28, 2018
fabio-t added a commit that referenced this issue Mar 4, 2018
…ses now get the dead creature's letter, including case
@fabio-t
Copy link
Owner Author

fabio-t commented Mar 4, 2018

Bark armour was easy; hide armour will be trickier.

In the former we simply set the protection values in the item yaml. For hides, we want the protection values to depend on the source creature.

This means that we'll probably need regex support in the crafting code. For example:

Hide:
    source_names: ["(\w)'s corpse"]
    name: "$1 hide"

The above would find the first corpse in the inventory with a name matching the source_names pattern, capturing the word between parentheses. The corresponding capture will then go to the object name. Eg, "a big buffalo's corpse" would create an object with tag "hide" and name "buffalo hide".

We then need a way of inheriting properties from the source. The problem here lies in which source to use. I can probably use a simple approach such as: only the first source is used to get properties.

Hide:
    source_names: ["(\w)'s corpse"]
    name: "$1 hide"
    inherit_properties: [Skin]

This should allow, with some Reflection trick, getting the component dynamically (if present) and passing it to the newly created object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant