Open codeknave opened 2 years ago
This is a cool idea but is pretty complex. You would need a way to indicate which firing mode one is using (and if that gun has them available), and then subtract the corresponding amount of ammo. The randomizing ammo part shouldn't be too hard.
Also, what is T2K4e?
@jalensailin T2K4e is Twilight 2000, 4th edition I believe.
As @jalensailin mentions though, this is a tricky thing to implement since the rules for ammo are a little vague in Delta Green. That, and the way I originally did ammo is just with a text field that I intended people to fill with whatever made sense to them. But maybe something we could take a look at and see if there is some sort of automation that we could do on it.
Hey, If I may add a suggestion: The book lists a range of Select Fire Sprays with an intended Radius, Ammo Used, and Lethality on Pg.56.
Listing an Ammo Counter on the Sheet rather than the detail section of the item, Like: "Rifle (Light) 1D12 AP:3 30/30". Would do wonders for me as a DM as it reduced the more tedious tracking. So if I put that a Rifle w/ an Ammo Count of 25 then the weapon entry should be back to track 0-25 from the Equipment Section w/o Opening the Item itself.
If you want to get really fancy about the Selective Fire Function, I could imagine having a bit of logic in the item similar to the lethality check:
Is Lethal: [] Is Select Fire: []
If Select Fire is selected then both the Damage and Lethality Entry Spots would appear and when "used" a small pop-up could appear to specify the kill-radius and ammo used.
Like: Single | Short Burst | Long Burst | Short Spray | Long Spray Then using the example details given in the Book on Pg.56, If the Ammo Count on the Weapon Entry doesn't have enough ammo to perform the intended Fire-Rate then either a simple condition check could just hide the option or it could just drop the count to 0 and force a reload.
I present a simple solution by https://github.com/phenomen
template.json
"weapon": {
"ammo": {
"value": 0,
"min": 0,
"max": 0
},
},
templates\item\item-weapon-sheet.html
<div class="weapon-sheet-horizontal-grid-right-2col">
<span class="resource-label">{{localize 'DG.ItemWindow.Weapons.Ammo'}}:</span>
<div>
<span class="resource-label">Осталось:</span>
<input type="number" name="system.ammo.value" value="{{item.system.ammo.value}}" data-dtype="Number"
class="inline-weapon-ammo" />
<span class="resource-label">Всего:</span>
<input type="number" name="system.ammo.max" value="{{item.system.ammo.max}}" data-dtype="Number" />
</div>
</div>
templates\actor\actor-sheet.html
<span class="centered-item-property">
{{#if item.system.ammo.max}}
<div class="flex flexrow">
<input type="number" value="{{item.system.ammo.value}}" data-dtype="Number"
class="inline-weapon-ammo" />
<span> / </span>
<input class type="number" value="{{item.system.ammo.max}}" data-dtype="Number" disabled />
</div>
{{else}}
<span> - </span>
{{/if}}
</span>
module\actor\actor-sheet.js - inside function activateListeners(html)
html.find(".inline-weapon-ammo").change((ev) => {
const el = $(ev.currentTarget).parents(".item");
const item = this.actor.items.get(el.data("item-id"));
const value = ev.target.value;
item.update({ "system.ammo.value": value });
});
And Phenomen says:
I have also improved the logic a bit and for weapons with max ammo 0 a dash is shown instead of input fields.
Just note that for weapons in the library the data will be empty, because now the ammo structure is completely different. You will need to manually set the value and the maximum.
@TheLastScrub If you add this in the next update, specify Phenomen, thx
Thanks for your work on this system. Ammo is listed for various guns but it's not used. I envision a system where rolling a gun brings up a fire selector for the firearm and subtracts from current ammo in accordance with the ammo used (ref. p56 agent's guide). Maybe include a way to randomize ammo used within a range if you're feeling motivated.
I think T2K4e has a good system for magazines and firearms you could reference, but if not, maybe a reload macro that just opens up the character sheet and requires selecting a gear item (magazine) to expend.