Show stat blocks

This commit is contained in:
2021-12-29 15:53:03 -06:00
parent ea85bf005d
commit 901b4a004a
3 changed files with 16 additions and 4 deletions

View File

@@ -84,7 +84,7 @@ StatName = < [A-Za-z]+ > - { $$.string = strdup(yytext); }
StatVal = < [0-9]+ > - { $$.num = atoi(yytext); }
StatRel = < ('+'|'-')? > { $$.num = 0x0 } -
StatRel = < ('+'|'-')? > { $$.num = yytext[0] == '+' ? STATCHECK_GT : STATCHECK_LT; } -
EndOfFile = !.

View File

@@ -52,7 +52,10 @@ void Storybook::Find(const char* id) {
void print_choice(Choice* c) {
printf("%d) %s", c->option, c->flavor);
if (c->statcheck) {
//TODO
printf("(%s %d%c)",
c->statcheck->stat,
c->statcheck->value,
c->statcheck->rel == STATCHECK_GT ? '+' : '-');
}
printf("\n");
}