diff --git a/TASKS.md b/TASKS.md index 5b96375..89c4124 100644 --- a/TASKS.md +++ b/TASKS.md @@ -36,6 +36,7 @@ - [x] Mark combat rolls with cs1cf10 and all other dice rolls with cs1cfX for the selected die. - [x] Simplify ranged attack ammunition roll data and expose worker progress in the weapon row. - [x] Remove ammunition fields from ranged chat commands while retaining worker-side checks and deductions. +- [x] Reduce ranged startRoll commands to the minimum attack and damage fields accepted by Roll20. - [x] Raise the Torse control on both cyberpunk body maps for better silhouette alignment. ## Live Roll20 checks after local verification diff --git a/templates/cyberpunk-weapons.js b/templates/cyberpunk-weapons.js index b42a81b..9228adb 100644 --- a/templates/cyberpunk-weapons.js +++ b/templates/cyberpunk-weapons.js @@ -46,10 +46,11 @@ function d10WeaponAttack(event, mode, ranged) { const dice = mode === 'burst' ? '(?{Nombre de dés|1}+1)' : '?{Nombre de dés|1}'; const multipleShots = mode === 'burst' || mode === 'auto'; const command = `&{template:d10weapon} {{name=${d10Text(get('name') || 'Arme')}}} ` + - `{{mode=${modeName}}} {{type=${d10Text(get('weapon_type'))}}} ` + - `{{attack_roll=[[${dice}d10<${threshold}cs1cf10]]}} {{threshold=[[${threshold}]]}} ` + - `${multipleShots ? '{{damage_list=[[0]]}}' : '{{damage=[[0]]}}'} {{special=${d10Text(get('notes'))}}}` + - (mode === 'single' || mode === 'melee' ? ` {{rmax=${d10Whole(get('rmax')) || 'sans limite'}}}` : ''); + `{{attack_roll=[[${dice}d10<${threshold}cs1cf10]]}} ` + + `${multipleShots ? '{{damage_list=[[0]]}}' : '{{damage=[[0]]}}'}` + + (ranged ? '' : ` {{mode=${modeName}}} {{type=${d10Text(get('weapon_type'))}}} ` + + `{{threshold=[[${threshold}]]}} {{special=${d10Text(get('notes'))}}} ` + + `{{rmax=${d10Whole(get('rmax')) || 'sans limite'}}}`); setAttrs({[prefix + 'weapon_status']: 'Jet en cours…'}); startRoll(command, result => { const successes = d10Whole(result.results.attack_roll.result); diff --git a/tests/test_tabs.mjs b/tests/test_tabs.mjs index 77890e1..af2e8ce 100644 --- a/tests/test_tabs.mjs +++ b/tests/test_tabs.mjs @@ -88,10 +88,10 @@ for (const variant of ['base', 'cyberpunk']) { handlers.get('clicked:repeating_distance:fire_single')({ sourceAttribute: ranged + 'fire_single' }); assert.match(rolls.at(-1), /\?\{Nombre de dés\|1\}d10<8cs1cf10/); assert.doesNotMatch(rolls.at(-1), /ammo|magazine|reserve/); + assert.doesNotMatch(rolls.at(-1), /mode=|type=|threshold=|special=|rmax=/); assert.equal(attributes[ranged + 'ammo_current'], 4); assert.equal(attributes[ranged + 'weapon_status'], 'Chargeur : 4/10'); assert.equal(finished.at(-1).computed.damage, 5); - assert.match(rolls.at(-1), /rmax=1/); attributes[ranged + 'ammo_current'] = '5'; handlers.get('clicked:repeating_distance:fire_burst')({ sourceAttribute: ranged + 'fire_burst' }); assert.match(rolls.at(-1), /\(\?\{Nombre de dés\|1\}\+1\)d10<8cs1cf10/); @@ -138,6 +138,7 @@ for (const variant of ['base', 'cyberpunk']) { }); handlers.get('clicked:repeating_melee:attack')({ sourceAttribute: melee + 'attack' }); assert.match(rolls.at(-1), /\?\{Nombre de dés\|1\}d10<4cs1cf10/); + assert.match(rolls.at(-1), /mode=Mêlée/); assert.equal(finished.at(-1).computed.damage, 6); handlers.get('clicked:repeating_melee:damage_only')({ sourceAttribute: melee + 'damage_only' }); assert.equal(finished.at(-1).computed.damage, 6);