… | |
… | |
827 | } |
827 | } |
828 | |
828 | |
829 | void |
829 | void |
830 | object::swap_stats (int a, int b) |
830 | object::swap_stats (int a, int b) |
831 | { |
831 | { |
832 | int tmp = get_attr_value (&contr->orig_stats, a); |
832 | swap (contr->orig_stats.stat (a), contr->orig_stats.stat (b)); |
833 | set_attr_value (&contr->orig_stats, a, get_attr_value (&contr->orig_stats, b)); |
|
|
834 | set_attr_value (&contr->orig_stats, b, tmp); |
|
|
835 | |
833 | |
|
|
834 | for (int i = 0; i < NUM_STATS; ++i) |
836 | stats.Str = contr->orig_stats.Str; |
835 | stats.stat (i) = contr->orig_stats.stat (i); |
837 | stats.Dex = contr->orig_stats.Dex; |
|
|
838 | stats.Con = contr->orig_stats.Con; |
|
|
839 | stats.Int = contr->orig_stats.Int; |
|
|
840 | stats.Wis = contr->orig_stats.Wis; |
|
|
841 | stats.Pow = contr->orig_stats.Pow; |
|
|
842 | stats.Cha = contr->orig_stats.Cha; |
|
|
843 | |
836 | |
844 | //TODO: the following code looks so borked and should, at the very least, |
837 | //TODO: the following code looks so borked and should, at the very least, |
845 | // be merged with the similar code in roll_stats |
838 | // be merged with the similar code in roll_stats |
846 | stats.ac = 0; |
839 | stats.ac = 0; |
847 | |
840 | |