Skip to content

Instantly share code, notes, and snippets.

@lynnfaraday
Created January 11, 2017 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lynnfaraday/db712eb014eebebbd1fb49f7dec73b37 to your computer and use it in GitHub Desktop.
Save lynnfaraday/db712eb014eebebbd1fb49f7dec73b37 to your computer and use it in GitHub Desktop.
Earthdawn Dice Softcode
Examples:
Rolling step 4
Rolling d6 got 4
total=4 dice= 4
Rolling step 8
Rolling d6 got 5
Rolling d6 got 6
Rolling d6 got 5
total=16 dice= 5 11
Rolling step 9
Rolling d8 got 7
Rolling d6 got 3
total=10 dice= 7 3
@create Earthdawn Dice
@link Earthdawn Dice = #126
&CMD-EDROLL Earthdawn Dice=$+edroll *:think pemit(%#,u(fun_roll_step,%0))
&FUN_ROLL_DIE Earthdawn Dice=[localize([setq(r,rand(1,%0))][pemit(%#,Rolling d%0 got %qr)][switch(%qr,%0,add(%qr,u(fun_roll_die,%0)),%qr)])]
&FUN_ROLL_STEP Earthdawn Dice=[pemit(%#,Rolling step %0)][localize([setq(0,0)][setq(d,)][iter(v(step_%0),[setq(1,u(fun_roll_die,##))][setq(d,%qd %q1)][setq(0,add(%q0,%q1))])]total=%q0 dice=%qd)]
&STARTUP Earthdawn Dice=@set me=!no_command
@set Earthdawn Dice/STARTUP=no_command prefixmatch
&STEP_3 Earthdawn Dice=4
&STEP_4 Earthdawn Dice=6
&STEP_5 Earthdawn Dice=8
&STEP_6 Earthdawn Dice=10
&STEP_7 Earthdawn Dice=12
&STEP_8 Earthdawn Dice=6 6
&STEP_9 Earthdawn Dice=8 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment