« JdR:La Couleur des Roses/5 - Règles/3 - Scènes et résolution d'actions/Formule AnyDice » : différence entre les versions

De Magnus Codex
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 2 : Ligne 2 :


https://anydice.com/program/19869
https://anydice.com/program/19869
  function: rha QUALITY:n SKILL:n
  function: rha QUALITY:n SKILL:n
  {
  {
 
  result: QUALITYd{0,1} + SKILLd{0,1}
result: QUALITYd{0,1} + SKILLd{0,1}
 
  }
  }


  function: aux QUALITY:n SKILL:n QUALITY_ROLL:s SKILL_ROLL:s
  function: aux QUALITY:n SKILL:n QUALITY_ROLL:s SKILL_ROLL:s
  {
  {
 
  if QUALITY_ROLL = QUALITY
if QUALITY_ROLL = QUALITY
  {
 
    result: QUALITY_ROLL + [highest of SKILL_ROLL and SKILLd{0,1}]
{
  }
 
  else if SKILL_ROLL = SKILL
result: QUALITY_ROLL + [highest of SKILL_ROLL and SKILLd{0,1}]
  {
 
    result: SKILL_ROLL + [highest of QUALITY_ROLL and QUALITYd{0,1}]
}
  }
 
  else if QUALITY_ROLL > SKILL_ROLL
else if SKILL_ROLL = SKILL
  {
 
    result: QUALITY_ROLL + [highest of SKILL_ROLL and SKILLd{0,1}]
{
  }
 
  else
result: SKILL_ROLL + [highest of QUALITY_ROLL and QUALITYd{0,1}]
  {
 
    result: SKILL_ROLL + [highest of QUALITY_ROLL and QUALITYd{0,1}]
}
  }
 
else if QUALITY_ROLL > SKILL_ROLL
 
{
 
result: QUALITY_ROLL + [highest of SKILL_ROLL and SKILLd{0,1}]
 
}
 
else
 
{
 
result: SKILL_ROLL + [highest of QUALITY_ROLL and QUALITYd{0,1}]
 
}
 
  }
  }


  function: rha QUALITY:n SKILL:n adv
  function: rha QUALITY:n SKILL:n adv
  {
  {
 
  result: [aux QUALITY SKILL QUALITYd{0,1} SKILLd{0,1}]
result: [aux QUALITY SKILL QUALITYd{0,1} SKILLd{0,1}]
 
  }
  }


  \usage\
  \usage\
  output [rha 4 3] named "normal roll"
  output [rha 4 3] named "normal roll"
  output [rha 6 1 adv] named "ADV 6u1"
  output [rha 6 1 adv] named "ADV 6u1"
  output [rha 5 2 adv] named "ADV 5u2"
  output [rha 5 2 adv] named "ADV 5u2"
  output [rha 4 3 adv] named "ADV 4u3"
  output [rha 4 3 adv] named "ADV 4u3"

Version du 13 mai 2023 à 22:04


https://anydice.com/program/19869

function: rha QUALITY:n SKILL:n
{
  result: QUALITYd{0,1} + SKILLd{0,1}
}
function: aux QUALITY:n SKILL:n QUALITY_ROLL:s SKILL_ROLL:s
{
  if QUALITY_ROLL = QUALITY
  {
    result: QUALITY_ROLL + [highest of SKILL_ROLL and SKILLd{0,1}]
  }
  else if SKILL_ROLL = SKILL
  {
    result: SKILL_ROLL + [highest of QUALITY_ROLL and QUALITYd{0,1}]
  }
  else if QUALITY_ROLL > SKILL_ROLL
  {
    result: QUALITY_ROLL + [highest of SKILL_ROLL and SKILLd{0,1}]
  }
  else
  {
    result: SKILL_ROLL + [highest of QUALITY_ROLL and QUALITYd{0,1}]
  }
}
function: rha QUALITY:n SKILL:n adv
{
  result: [aux QUALITY SKILL QUALITYd{0,1} SKILLd{0,1}]
}
\usage\
output [rha 4 3] named "normal roll"
output [rha 6 1 adv] named "ADV 6u1"
output [rha 5 2 adv] named "ADV 5u2"
output [rha 4 3 adv] named "ADV 4u3"