Gerdofal / foundryvtt-cyberpunkred

GNU General Public License v3.0
20 stars 18 forks source link

Add dropdown for basic ammo types #83

Closed njfox closed 3 years ago

njfox commented 3 years ago

This adds a dropdown to the item sheet to allow the user to specify the type of ammo that an item uses. It's only cosmetic now but ideally it would be tied to inventory later on for automated ammo tracking.

Only basic ammo types are implemented because I wasn't sure the best way to handle special ammo types, as they are supposed to have some restrictions (e.g. Expansive Ammunition is only allowed for Arrows, Bullets and Slugs) and I wasn't sure of the best way to validate that. Do you have any suggestions @Gerdofal ?

This is to address #38

Gerdofal commented 3 years ago

The only other thing needed is a minor change to template.json to make it save

njfox commented 3 years ago

Would that look like this?

        "ammotype": {
          "value": "none"
        },
Gerdofal commented 3 years ago

Close. Have to setup telco For a new employee. Will reply more later.

Gerdofal commented 3 years ago

It would actually be a new property of the "weapon" template which starts at line 940 of template.json

"weapon": { "damage": { "value": "3d6" }, "ammo": { "min": 0, "max": 16, "value": 0 }, "weapontype": { "value": "pistol" }, "burst": { "value": false }, "fullauto": { "value": false }, "skill": { "value": "marksmanship" }, "rof": { "value": 1 } },

njfox commented 3 years ago

Gotcha, that's where I was planning to put that snippet, right below the ammo property. Just wasn't sure if I needed to add anything else