Welcome to the Builder Academy

Question Cleaning up display of Armor Class (AC) in stat and score commands (tbaMUD 3.65)

More
23 Apr 2016 14:59 #5790 by Banlock
Wasn't 100% sure if this should be development or snippets, my apologies if I selected wrongly.

I've been playing around with tbaMUD for a while, still looking at 3.65 -- although very cool to see active development. One thing that has bugged me is the odd (to me as a D&D player) and seemingly inconsistent display of the armor class values (AC) in the stat and score commands.

I see that score uses "compute_armor_class" and displays the number using "%d/10", while stat uses "GET_AC" along with "dex_app" to display one number minus another with the divide this by 10 notation, but it isn't obvious how that number relates to the one score gives -- i.e. "Your armor class is -4/10" versus "AC: [36-3/10]" for the same character.

So I looked at fight.c saw this was used just before rolling the big d20:
Code:
victim_ac = compute_armor_class(victim) / 10;

So my suggestion would be this for "do_stat_character" in act.wizard.c (I also changed the position of a "\r\n" for formatting purposes):
Code:
if (!IS_NPC(k)) send_to_char(ch, ", Screen %s[%s%d%sx%s%d%s]%s", CCCYN(ch, C_NRM), CCYEL(ch, C_NRM), GET_SCREEN_WIDTH(k), CCNRM(ch, C_NRM), CCYEL(ch, C_NRM), GET_PAGE_LENGTH(k), CCCYN(ch, C_NRM), CCNRM(ch, C_NRM)); send_to_char(ch, "\r\nAC: [%d], Hitroll: [%2d], Damroll: [%2d], Saving throws: [%d/%d/%d/%d/%d]\r\n", (compute_armor_class(k) / 10), k->points.hitroll, k->points.damroll, GET_SAVE(k, 0), GET_SAVE(k, 1), GET_SAVE(k, 2), GET_SAVE(k, 3), GET_SAVE(k, 4));

and for "do_score" in act.informative.c:
Code:
send_to_char(ch, "Your armor class is %d, and your alignment is %d.\r\n", (compute_armor_class(ch) / 10), GET_ALIGNMENT(ch));

I've tried this and it seems to give the right values. I can look at a mob with both stat and medit and get consistent values (with the medit value being 10 times larger).

Would this a reasonable, helpful change to the codebase? It seem to me to be a more consistent, readable display of the "external" AC value than what is currently being used.

Next question -- is there anything else where the AC is displayed to a character that should also be changed to match?

Please Log in or Create an account to join the conversation.

Time to create page: 0.175 seconds