Minimize ranged roll commands for Roll20
This commit is contained in:
parent
ba01d52335
commit
4c975c7a59
1
TASKS.md
1
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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue