Fix summary calculation for statbot.

This commit is contained in:
Condorra 2022-12-31 01:01:57 +11:00
parent 3ad4de8f5f
commit 2ffc3e4f2e

View File

@ -37,7 +37,7 @@ fn next_action_text(user: &User) -> String {
let end = user.raw_stats.get(&StatType::Endurance).cloned().unwrap_or(8);
let col = user.raw_stats.get(&StatType::Cool).cloned().unwrap_or(8);
let tot = brn + sen + brw + refl + end + col;
let summary = format!("Brains: {}, Senses: {}, Brawn: {}, Reflexes: {}, Endurance: {}, Cool: {}. To spend: {}", brn, sen, brw, refl, end, col, tot - 48);
let summary = format!("Brains: {}, Senses: {}, Brawn: {}, Reflexes: {}, Endurance: {}, Cool: {}. To spend: {}", brn, sen, brw, refl, end, col, 62 - tot);
match st {
StatbotState::Brains => ansi!("I am Statbot, a robot servant of the empire, put here to help you choose how your body will function. The base body has 8 each of brains, senses, brawn, reflexes, endurance and cool - but you get 14 points of improvement. Each point spent lifts that stat by one. Your first job is to choose how much brainpower you will have. If you choose 8, you don't spend any points. There is a maximum of 15 - if you choose 15, you will spend 7 points and have 7 left for other stats.\n\n\tType <green><bold>-statbot brains 8<reset><blue> (or any other number) to set your brains to that number. You will be able to adjust your stats by sending me the new value, up until you leave here. Your stats now are: ").to_owned() + &summary,
StatbotState::Senses => "".to_owned(),