### Thursday, August 25, 2011

## Calculator Program (commentary forthcoming)

For those of you curious about my 4e table helper (read: no one), I was super bored and decided to transcribe my program.

:7→L

:6→C

:3→E

:2→P

:2→X

:L+C+E+P+X→A

:

:randInt(3,10)→W

:

:randInt(3,10)+randInt(3,10)→Y

:2→F

:5→I

:3→T

:F+E+T+C→D

:

:randInt(1,6)+randInt(1,6)+randInt(1,6)→R

:

:Menu("TYPE","AT-WILL",1,"ENC/DAILY",2,"INIT",3

:

:Lbl 1

:Menu("AT-WILLS","IRON FIST",4,"CHARGE",5,"MBA",6

:

:Lbl 2

:Menu("E/D","RUSH/SMASH",7,"SHIELD EDGE",8,"HARMONY",9

:

:Lbl 3

:ClrHome

:

:Disp randInt(1,20)+2+L

:

:Lbl 4

:ClrHome

:

:Disp randInt(1,20)+A,W+D,10+D+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 5

:ClrHome

:

:Disp randInt(1,20)+1+A,W+3+E+F,13+E+F+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,21+A)

:Stop

:

:Lbl 6

:ClrHome

:

:Disp randInt(1,20)+A,W+3+E+F,13+E+F+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 7

:ClrHome

:

:Disp randInt(1,20)+A,Y+D,20+D+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 8

:ClrHome

:Disp randInt(1,20)+14,randInt(1,6)+randInt(1,6)+3,12+3

:Output(1,1,"VS FORT (34)"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Stop

:7→L

:6→C

:3→E

:2→P

:2→X

:L+C+E+P+X→A

:

:randInt(3,10)→W

:

:randInt(3,10)+randInt(3,10)→Y

:2→F

:5→I

:3→T

:F+E+T+C→D

:

:randInt(1,6)+randInt(1,6)+randInt(1,6)→R

:

:Menu("TYPE","AT-WILL",1,"ENC/DAILY",2,"INIT",3

:

:Lbl 1

:Menu("AT-WILLS","IRON FIST",4,"CHARGE",5,"MBA",6

:

:Lbl 2

:Menu("E/D","RUSH/SMASH",7,"SHIELD EDGE",8,"HARMONY",9

:

:Lbl 3

:ClrHome

:

:Disp randInt(1,20)+2+L

:

:Lbl 4

:ClrHome

:

:Disp randInt(1,20)+A,W+D,10+D+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 5

:ClrHome

:

:Disp randInt(1,20)+1+A,W+3+E+F,13+E+F+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,21+A)

:Stop

:

:Lbl 6

:ClrHome

:

:Disp randInt(1,20)+A,W+3+E+F,13+E+F+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 7

:ClrHome

:

:Disp randInt(1,20)+A,Y+D,20+D+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 8

:ClrHome

:Disp randInt(1,20)+14,randInt(1,6)+randInt(1,6)+3,12+3

:Output(1,1,"VS FORT (34)"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Stop

## Calculator Program

For those of you curious about my 4e table helper (read: no one), I was super bored and decided to transcribe my program.

First, lets store some variables:

:7→L 1/2 level

:6→C con mod

:3→E enhancement

:2→P proficiency

:2→X expertise (yes I know this is a feat bonus)

:L+C+E+P+X→A add em up for my normal attack bonus with that weapon

:

:randInt(3,10)→W weapon damage for d10 brutal 2

:

:randInt(3,10)+randInt(3,10)→Y 2[w] attack

:2→F feat bonus to damage (dwt)

:5→I wis mod (marked scourge)

:3→T item bonus (radiant weapon in rad mode)

:F+E+T+C→D standard damage bonus

:

:randInt(1,6)+randInt(1,6)+randInt(1,6)→R crit damage

:

that's all the storing I plan on doing. next is my menu structure. I have 7 "attacks" (i'm including init) so I'm spreading them between this first opening menu and 2 more nested menus. this makes a grand total of 9 labels - labels 1 and 2 are the atwill and enc menus respectively, and labels 3 through 9 are init and my 6 attacks

:Menu("TYPE","AT-WILL",1,"ENC/DAILY",2,"INIT",3 menu strings correspond to the labels that follow them, except for the first, which is the title of that menu

:

:Lbl 1

:Menu("AT-WILLS","IRON FIST",4,"CHARGE",5,"MBA",6 so this menu, titled ATWILLS, has 3 attacks on it which correspond to labels 4-6

:

:Lbl 2

:Menu("E/D","RUSH/SMASH",7,"SHIELD EDGE",8,"HARMONY",9 same thing. but later on I realize that Harmony does the same damage as Lit Rush and never even make a label 9

:

starting here at label 3 is my first real 'roll': initiative

:Lbl 3

:ClrHome put ClrHome at the start of your labels so you have a clean screen to put what you want to go there

:

:Disp randInt(1,20)+2+L 1d20 plus my init bonus (hey, I'm a dwarf!) plus half-level

:Stop put Stop after completing a roll results page. from this point, pressing enter will restart the program

:

from here on out are the real guts of the program. we'll roll the d20 and determine which of your stored variables get applied to the roll. I also could have rolled the d20 up in the storage part and stored it as a value, then just called the value back out here. I didn't, because you will use a d20 for your whole career - no sense using up a variable name. (I did do it with W because if you get a new weapon you will only have to change the variable up in the storing section.(at least you would, if crits didn't work the way they did))

:Lbl 4 my main attack, Fist of Iron. it's listed as [W]+con damage, but we all know it's more complicated than that

:ClrHome

:

:Disp randInt(1,20)+A,W+D,10+D+R here's a Disp with 3 lines of output, separated by commas. each one will display on its own row. the first one is 1d20 plus the 'base attack bonus' i stored a hundred lines ago. the next one is the random weapon damage plus my 'standard bonus damage, also from up top. the third is a crit:10 is max dam on a craghammer, D is my standard bonus damage, and R is 3d6, as stored above

:Output(1,1,"HIT (CRIT )" Output is a great command. here the phrase HIT (CRIT ) will appear starting on row1 column1. your Disp lines will not be cleared

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A) here's my crit cheat. i don't know how to make the machine do an if-then yet that checks for getting a 20 on that randInt. so it just displays the number i'd have to roll for it to be a crit - it's static.

:Stop

:

:Lbl 5 charge. I use Melee Training: Con to make basic attacks, which we all know cuts the damage bonus in half. so i get to use A but not D in my calcs, instead putting in damage bonuses manually

:ClrHome

:

:Disp randInt(1,20)+1+A,W+3+E+F,13+E+F+R that +1 is the charge attack bonus

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,21+A) you see it again here

:Stop

:

:Lbl 6

:ClrHome

:

:Disp randInt(1,20)+A,W+3+E+F,13+E+F+R melee basic attack. identical to charge except the +1 to hit

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 7 Lightning Rush. Listed as 2[W] + con. So it's the same as Iron Fist, except using Y instead of W

:ClrHome

:

:Disp randInt(1,20)+A,Y+D,20+D+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 8 Shield Edge Block. this attack is an outlier in every way: it's not a weapon attack, it uses my str instead of con, and it hits fort. so all the math is just done here - there are no variables to call

:ClrHome

:Disp randInt(1,20)+14,randInt(1,6)+randInt(1,6)+3,12+3

:Output(1,1,"VS FORT (34)" really i should have made an "output 1,11" line like normal here and broken it into 20+L+7 but i got lazy. i think that 7 is 3 enhancement (inherent) and 4 power?

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Stop

First, lets store some variables:

:7→L 1/2 level

:6→C con mod

:3→E enhancement

:2→P proficiency

:2→X expertise (yes I know this is a feat bonus)

:L+C+E+P+X→A add em up for my normal attack bonus with that weapon

:

:randInt(3,10)→W weapon damage for d10 brutal 2

:

:randInt(3,10)+randInt(3,10)→Y 2[w] attack

:2→F feat bonus to damage (dwt)

:5→I wis mod (marked scourge)

:3→T item bonus (radiant weapon in rad mode)

:F+E+T+C→D standard damage bonus

:

:randInt(1,6)+randInt(1,6)+randInt(1,6)→R crit damage

:

that's all the storing I plan on doing. next is my menu structure. I have 7 "attacks" (i'm including init) so I'm spreading them between this first opening menu and 2 more nested menus. this makes a grand total of 9 labels - labels 1 and 2 are the atwill and enc menus respectively, and labels 3 through 9 are init and my 6 attacks

:Menu("TYPE","AT-WILL",1,"ENC/DAILY",2,"INIT",3 menu strings correspond to the labels that follow them, except for the first, which is the title of that menu

:

:Lbl 1

:Menu("AT-WILLS","IRON FIST",4,"CHARGE",5,"MBA",6 so this menu, titled ATWILLS, has 3 attacks on it which correspond to labels 4-6

:

:Lbl 2

:Menu("E/D","RUSH/SMASH",7,"SHIELD EDGE",8,"HARMONY",9 same thing. but later on I realize that Harmony does the same damage as Lit Rush and never even make a label 9

:

starting here at label 3 is my first real 'roll': initiative

:Lbl 3

:ClrHome put ClrHome at the start of your labels so you have a clean screen to put what you want to go there

:

:Disp randInt(1,20)+2+L 1d20 plus my init bonus (hey, I'm a dwarf!) plus half-level

:Stop put Stop after completing a roll results page. from this point, pressing enter will restart the program

:

from here on out are the real guts of the program. we'll roll the d20 and determine which of your stored variables get applied to the roll. I also could have rolled the d20 up in the storage part and stored it as a value, then just called the value back out here. I didn't, because you will use a d20 for your whole career - no sense using up a variable name. (I did do it with W because if you get a new weapon you will only have to change the variable up in the storing section.(at least you would, if crits didn't work the way they did))

:Lbl 4 my main attack, Fist of Iron. it's listed as [W]+con damage, but we all know it's more complicated than that

:ClrHome

:

:Disp randInt(1,20)+A,W+D,10+D+R here's a Disp with 3 lines of output, separated by commas. each one will display on its own row. the first one is 1d20 plus the 'base attack bonus' i stored a hundred lines ago. the next one is the random weapon damage plus my 'standard bonus damage, also from up top. the third is a crit:10 is max dam on a craghammer, D is my standard bonus damage, and R is 3d6, as stored above

:Output(1,1,"HIT (CRIT )" Output is a great command. here the phrase HIT (CRIT ) will appear starting on row1 column1. your Disp lines will not be cleared

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A) here's my crit cheat. i don't know how to make the machine do an if-then yet that checks for getting a 20 on that randInt. so it just displays the number i'd have to roll for it to be a crit - it's static.

:Stop

:

:Lbl 5 charge. I use Melee Training: Con to make basic attacks, which we all know cuts the damage bonus in half. so i get to use A but not D in my calcs, instead putting in damage bonuses manually

:ClrHome

:

:Disp randInt(1,20)+1+A,W+3+E+F,13+E+F+R that +1 is the charge attack bonus

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,21+A) you see it again here

:Stop

:

:Lbl 6

:ClrHome

:

:Disp randInt(1,20)+A,W+3+E+F,13+E+F+R melee basic attack. identical to charge except the +1 to hit

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 7 Lightning Rush. Listed as 2[W] + con. So it's the same as Iron Fist, except using Y instead of W

:ClrHome

:

:Disp randInt(1,20)+A,Y+D,20+D+R

:Output(1,1,"HIT (CRIT )"

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Output(1,11,20+A)

:Stop

:

:Lbl 8 Shield Edge Block. this attack is an outlier in every way: it's not a weapon attack, it uses my str instead of con, and it hits fort. so all the math is just done here - there are no variables to call

:ClrHome

:Disp randInt(1,20)+14,randInt(1,6)+randInt(1,6)+3,12+3

:Output(1,1,"VS FORT (34)" really i should have made an "output 1,11" line like normal here and broken it into 20+L+7 but i got lazy. i think that 7 is 3 enhancement (inherent) and 4 power?

:Output(2,1,"DAMAGE"

:Output(3,1,"CRIT"

:Stop