def str n = [[base_str + @str_plus, 1].max, 999].min for i in @states n *= $data_states[i].str_rate / 100.0 end n = [[Integer(n), 1].max, 999].min return n end