@startuml actor "Attacker / Defender" as A participant "web-API" as W participant Core as C A -> W: **Attacker** selects target and option of attack activate W W -> C: ""calculateRoll(//State, State, RollRequest, Environment//)"" activate C C -> W: ""//Roll//"" deactivate C W -> A: provide the roll to **Attacker** deactivate W A -> W: **Attacker** confirms the attack activate W W -> W: Init the attack state\nStore ""Attacker's //Roll//"" W -> A: ask **Defender** about defence option deactivate W A -> W: **Defender** selects defence option activate W W -> C: ""calculateRoll(//State, State, RollRequest, Environment//)"" activate C C -> W: ""//Roll//"" deactivate C W -> A: provide the roll to **Defender** deactivate W A -> W: **Defender** confirms defence option activate W W -> W: Update the attack state\nStore ""Defender's //Roll//"" == Parallel for Attacker and Defender == loop until **Actor** confirms his Test W -> W: get dice value() W -> C: ""makeDramaticTest(//__dice__, Roll//)"" activate C C -> W: ""//RollResult//"" deactivate C W -> A: provide roll result and modify options to **Actor** and ask him about an action alt **Actor** modifies test result (reroll, reverse, use selected value) A -> W: **Actor** confirms roll modify option else **Actor** confirms roll result A -> W: **Actor** confirms roll result W -> W: Update the attack state\nStore ""Actor's //RollResult//"" end end deactivate W == Syncronized == [o-> W: Once ""Attacker's and Defender's //RollResult//"" are stored activate W W -> C: ""makeAttack(//Opposed, Opposed//)"" activate C C -> C: ""makeOpposedTest(//Opposed, Opposed//): //OpposedResult//"" C -> C: ""resolve the attack"" C -> W: ""Attacker's //AttackResult//, Defender's //AttackResult//"" deactivate C W -> W: Update the attack state\nStore ""//AttackResults//"" opt for loser W -> A: notify about lost opposite test end opt for winner W -> A: notify about won opposite test and provide attack resolve options deactivate W opt winner selects to apply damage A -> W: **Actor** confirms attack resolve option activate W W -> C: applyDamage(targetState, AttackDamage) end opt W -> C: ""changeState(//__winnner__, WinnerState, ResolveAttackOption//)"" activate C C -> W: new ""//WinnerState//"" deactivate C W -> C: ""changeState(//__loser__, LoserState, ResolveAttackOption//)"" activate C C -> W: new ""//LoserState//"" deactivate C W -> W: Resolve the attack state\nStore new ""//AttackerState//"" and ""//DefenderState//"" W -> A: provide new **Attacker** and **Defender** states deactivate W end @enduml
Decode URL
Submit
amiga
aws-orange
black-knight
bluegray
blueprint
cerulean-outline
cerulean
crt-amber
crt-green
cyborg-outline
cyborg
hacker
lightgray
mars
materia-outline
materia
metal
mimeograph
minty
plain
reddress-darkblue
reddress-darkgreen
reddress-darkorange
reddress-darkred
reddress-lightblue
reddress-lightgreen
reddress-lightorange
reddress-lightred
sandstone
silver
sketchy-outline
sketchy
spacelab
spacelab-white
superhero-outline
superhero
toy
united
vibrant
🎉 Discover the future PlantUML Web Editor! 🚀
PNG
SVG
ASCII Art