Code Monkey home page Code Monkey logo

Comments (5)

obiwankennedy avatar obiwankennedy commented on May 29, 2024

The error is on $2d5, as $2 could be 0 and 0d5 leads to error.

The command you want is:

!2d10;$1i.[=10]{+1d5};$2+5;"Final result: $3"

The explode operator does not support sub-operation yet. It will be possible soon to do it like this:

!2d10e10(1d5)+5

from diceparser.

frakc avatar frakc commented on May 29, 2024

2d10;$1c[=10];$2d5 this works perfect and count separatrly notmal sum and crit sum.

i want to add +5 on normal sum, not critical sum.
2d10+5 <- this one brakes in joined statement !2d10+5;$1c[=10];$2d5

from diceparser.

frakc avatar frakc commented on May 29, 2024

thank you now formula works properly
!2d10;$1c[=10];$2i:[>0]{$2d5};$1+4;"normal damage $4, critical damage $3"

however there is still problem with adding + bonus to first case. (in example above i just moved that operation to sepparate case)
!2d10+4;$1c[=10];$2i:[>0]{$2d5};$1+0;"normal damage $4, critical damage $3"
here $3 is always 0 even if 2d10 both 10

from diceparser.

obiwankennedy avatar obiwankennedy commented on May 29, 2024

it is because this can't worked: 2d10+4;$1c[=10]

in diceparser, each instruction has a result.
Diceparser manages 3 types of result: dicelist, number and string
The result type of: 2d10 is dicelist.
The result type of: 2d10+4 is number (assuming you want to roll 2 dice, sum their values and add 4.

Count operator (c) works on dicelist only. If previous result isn't dicelist, it does nothing.

from diceparser.

frakc avatar frakc commented on May 29, 2024

got it, thanks

from diceparser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.