00001
00002
00003
00004
00005
00006
00007
00008 #ifndef ABLSHOW_H
00009 #define ABLSHOW_H
00010
00011 #include "enum.h"
00012
00013 #include <string>
00014 #include <vector>
00015
00016 struct generic_cost
00017 {
00018 int base, add, rolls;
00019
00020 generic_cost(int num)
00021 : base(num), add(num == 0 ? 0 : (num + 1) / 2 + 1), rolls(1)
00022 {
00023 }
00024 generic_cost(int num, int _add, int _rolls = 1)
00025 : base(num), add(_add), rolls(_rolls)
00026 {
00027 }
00028 static generic_cost fixed(int fixed)
00029 {
00030 return generic_cost(fixed, 0, 1);
00031 }
00032 static generic_cost range(int low, int high, int _rolls = 1)
00033 {
00034 return generic_cost(low, high - low + 1, _rolls);
00035 }
00036
00037 int cost() const;
00038
00039 operator bool () const { return base > 0 || add > 0; }
00040 };
00041
00042 struct scaling_cost
00043 {
00044 int value;
00045
00046 scaling_cost(int permille) : value(permille) {}
00047
00048 static scaling_cost fixed(int fixed)
00049 {
00050 return scaling_cost(-fixed);
00051 }
00052
00053 int cost(int max) const;
00054
00055 operator bool () const { return value != 0; }
00056 };
00057
00058
00059 struct ability_def
00060 {
00061 ability_type ability;
00062 const char * name;
00063 unsigned int mp_cost;
00064 scaling_cost hp_cost;
00065 unsigned int food_cost;
00066 generic_cost piety_cost;
00067 unsigned int flags;
00068 unsigned int xp_cost;
00069 };
00070
00071 struct talent
00072 {
00073 ability_type which;
00074 int hotkey;
00075 int fail;
00076 bool is_invocation;
00077 };
00078
00079 const std::string make_cost_description(ability_type ability);
00080 const char* ability_name(ability_type ability);
00081 std::vector<const char*> get_ability_names();
00082 int choose_ability_menu(const std::vector<talent>& talents);
00083
00084 bool activate_ability();
00085 std::vector<talent> your_talents(bool check_confused);
00086 bool string_matches_ability_name(const std::string& key);
00087 std::string print_abilities(void);
00088
00089 void set_god_ability_slots(void);
00090
00091
00092 #endif