Made ammo consumed available in scope as ~ammo

This commit is contained in:
Thaum Rystra
2023-09-19 15:10:32 +02:00
parent f62a8bead4
commit 98ac2e7122

View File

@@ -243,6 +243,9 @@ function spendResources(prop, actionContext) {
gainLog.push(logName + ': ' + -itemConsumed.quantity.value);
}
ammoChildren.push(...getItemChildren(item, actionContext, prop));
// simulate the increment and add the item to the action scope
item.quantity -= itemConsumed.quantity.value;
actionContext.scope['~ammo'] = item;
});
} catch (e) {
actionContext.addLog({