1
0
Fork 0

fix(script/signal): make sure health and damage effects do not roll 0

This commit is contained in:
Sean Sube 2022-10-26 21:31:21 -05:00
parent 12e367a428
commit 5c8b674e73
1 changed files with 3 additions and 3 deletions

View File

@ -13,13 +13,13 @@ export async function SignalActorUse(this: ScriptTarget, context: ScriptContext)
if (item.stats.has(STAT_DAMAGE)) {
const maxDamage = getKey(item.stats, STAT_DAMAGE, 1);
const damageRoll = context.random.nextInt(maxDamage);
const damageRoll = context.random.nextInt(maxDamage, 1);
change -= damageRoll;
}
if (item.stats.has(STAT_HEALTH)) {
const maxHealth = getKey(item.stats, STAT_HEALTH, 0);
const healthRoll = context.random.nextInt(maxHealth);
const maxHealth = getKey(item.stats, STAT_HEALTH, 1);
const healthRoll = context.random.nextInt(maxHealth, 1);
change += healthRoll;
}