Skip to content

Gear Asset Definitions

Timothy O'Connell edited this page Mar 16, 2018 · 12 revisions

Asset definoition

Data model

Gear asset definitions are complex, but are fairly flat.

Additionally, unlike the attributes on other types of asset definitions, most of these are optional (since they exist to facilitate front-end/UI type stuff, rather than back-end operations).

key R/O type note/comment
affinities O dict See detailed spec below.
affinity_bonus O dict See detailed spec below.
accuracy O int
armor O int
desc O str
expansion O str Should be the handle of an existing expansion asset definition.
location O str Value should be 'head', 'body', 'waist', 'arms' or 'legs'
keywords O list Value is a list of strings, e.g. ['weapon','melee','bone'].
name R str
recipes O list See detailed spec below.
rules O list Value is a list of strings, e.g. ['Sharp','Frail'].
speed O int
strength O int
type R str Should be the handle of an existing location asset definition. Will ultimately become the asset's sub_type value when serialized (i.e. because type will be 'gear').

Members of the keywords and rules lists are not evaluated by the API, e.g. validated against a list of known/possible values. They're basically a free-for-all.

The affinities dict

Should only contain one each of the following keys: top, left, right and bottom. Each key's value should be an affinity, e.g. 'red', 'blue' or 'green'.

The affinity_bonus dict

This has a very specific syntax:

    'green_boots': {
        'expansion': 'green_knight_armor',
        'type': 'green_knight_armor',
        'name': 'Green Boots',
        'keywords': ['armor','set','bone','heavy','metal'],
        'desc': 'You may use the <b>Tumble</b> fighting art.',
        'affinities': {
            'top': 'green',
            'left': 'green',
        },
        'armor': 5,
        'affinity_bonus': {
            'desc': 'You successfully tumble on 2+ instead of 6+.',
            'requires': {
                'puzzle': {'green': 2}
            },
        },
        'recipes': [],
    },

desc, like everywhere else in the API, should be a string. The requires dictionary should have two keys (at most: one is fine, if that's all the asset wants to define), puzzle or complete.

Each key under requires should contain a dict that describes how many affinities are required to unlock the bonus. In the above 'Green Boots' example, the affinity bonus requires two connected green affinities.

If the affinity bonus requires complete affinities (i.e. completed anywhere on the Gear Grid) the syntax is similar:

    'finger_of_god': {
        'type': 'weapon_crafter',
        'name': 'Finger of God',
        'keywords': ['weapon','melee','spear','two-handed'],
        'rules': ['Reach 2'],
        'speed': 2,
        'accuracy': 5,
        'strength': 6,
        'affinities': {'top': 'red'},
        'affinity_bonus': {
            'desc': 'As long as you have 5+ survival, gain +1 accuracy and +1 strength.',
            'requires': {
                'complete': {'red': 1, 'blue': 1, 'green': 1},
            },
        },
    },

Finally, mixing and matching puzzle and complete is totally fine, as in the following:

    'gloom_cream': {
        'expansion': 'slenderman',
        'type': 'light_forging',
        'name': 'Gloom Cream',
        'keywords': ['item','consumable','balm','gloomy','stinky','other'],
        'affinities': {'left': 'red','top':'blue', 'right':'red', 'bottom': 'blue'},
        'affinity_bonus': {
            'desc': 'When you <b>Depart</b>, gain -3 Hunt XP, -1 understanding. If you have no understanding, die instantly.',
            'requires': {
                'complete': {'blue': 2},
                'puzzle': {'red': 2},
            },
        },
    },

The recipes dict

These dicts basically list requirements. For example:

    'bone_pickaxe': {
        'affinities': {'top': 'green'},
        'type': 'bone_smith',
        'name': 'Bone Pickaxe',
        'keywords': ['item','tool','pickaxe','bone'],
        'desc': 'After Hunt phase setup, place the <b>Mineral Gathering</b> event on any hunt space.',
        'recipes': [
            {
                'locations': ['bone_smith'],
                'innovations': ['ammonia'],
                'resource_types': {'bone': 1},
                'resource_handles': {'leather': 1},
            },
        ],
        'speed': 1,
        'accuracy': 8,
        'strength': 2,
    },

The following data elements can be specified in an individual recipe. list items should be lists of existing asset handles (of the appropriate asset type); dict type items should be simple dicts where the key is an asset handle of the appropriate family and the value is an int:

key type comment
gear_handles dict
locations list
innovations list
quarries list
resource_handles dict
resource_types dict
Clone this wiki locally