mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-10-05 08:51:44 +00:00
ru:: renamed statdata table to statinfo, to not confuse with statdata type
This commit is contained in:
@@ -206,6 +206,14 @@ template<class T> struct statarray : array<T, qstat> {
|
|||||||
const T& operator [] (stat s) const { return array<T, qstat>::operator[] ((int) s); };
|
const T& operator [] (stat s) const { return array<T, qstat>::operator[] ((int) s); };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct statinfo {
|
||||||
|
char key;
|
||||||
|
string name;
|
||||||
|
string desc;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern statarray<statinfo> statinfos;
|
||||||
|
|
||||||
struct stater {
|
struct stater {
|
||||||
virtual stater& act(const string& s, int& i, int _i) = 0;
|
virtual stater& act(const string& s, int& i, int _i) = 0;
|
||||||
virtual stater& act(const string& s, bool& b, bool _b) = 0;
|
virtual stater& act(const string& s, bool& b, bool _b) = 0;
|
||||||
|
|||||||
+8
-14
@@ -72,13 +72,7 @@ void generate_character() {
|
|||||||
randomize_stats();
|
randomize_stats();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct statinfo {
|
statarray<statinfo> statinfos;
|
||||||
char key;
|
|
||||||
string name;
|
|
||||||
string desc;
|
|
||||||
};
|
|
||||||
|
|
||||||
statarray<statinfo> statdata;
|
|
||||||
|
|
||||||
string prettystat(ld cur) {
|
string prettystat(ld cur) {
|
||||||
int curi = cur + 0.01;
|
int curi = cur + 0.01;
|
||||||
@@ -99,10 +93,10 @@ vector<string> professions = { "Warrior", "Morpher", "Sorcerer", "Rogue" };
|
|||||||
|
|
||||||
void stat_screen(bool editable) {
|
void stat_screen(bool editable) {
|
||||||
|
|
||||||
statdata[stat::str] = {'s', "Strength", "Affects the strength of your physical attacks."};
|
statinfos[stat::str] = {'s', "Strength", "Affects the strength of your physical attacks."};
|
||||||
statdata[stat::con] = {'t', "Toughness", "Affects the amount of hitpoints you have."};
|
statinfos[stat::con] = {'t', "Toughness", "Affects the amount of hitpoints you have."};
|
||||||
statdata[stat::wis] = {'w', "Wisdom", "Affects the power of your alchemy."};
|
statinfos[stat::wis] = {'w', "Wisdom", "Affects the power of your alchemy."};
|
||||||
statdata[stat::dex] = {'d', "Dexterity", "Improves your 'chill time' power."};
|
statinfos[stat::dex] = {'d', "Dexterity", "Improves your 'chill time' power."};
|
||||||
|
|
||||||
profdata[stat::str] = {'w', "Warrior", "Warriors start with a powerful axe."};
|
profdata[stat::str] = {'w', "Warrior", "Warriors start with a powerful axe."};
|
||||||
profdata[stat::con] = {'m', "Morpher", "Morpher start with an ability to transform into small animals."};
|
profdata[stat::con] = {'m', "Morpher", "Morpher start with an ability to transform into small animals."};
|
||||||
@@ -163,12 +157,12 @@ void stat_screen(bool editable) {
|
|||||||
auto cur = m.current.stats[st];
|
auto cur = m.current.stats[st];
|
||||||
string s = its(bas);
|
string s = its(bas);
|
||||||
if(cur != bas) s += " (" + prettystat(cur) + ")";
|
if(cur != bas) s += " (" + prettystat(cur) + ")";
|
||||||
dialog::addSelItem(statdata[st].name, s, statdata[st].key);
|
dialog::addSelItem(statinfos[st].name, s, statinfos[st].key);
|
||||||
dialog::add_action_push([st, editable] {
|
dialog::add_action_push([st, editable] {
|
||||||
render_the_map();
|
render_the_map();
|
||||||
draw_inventory_frame();
|
draw_inventory_frame();
|
||||||
dialog::init(statdata[st].name, 0xC000C0);
|
dialog::init(statinfos[st].name, 0xC000C0);
|
||||||
dialog::addHelp(statdata[st].desc);
|
dialog::addHelp(statinfos[st].desc);
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
dialog::addSelItem("base value", its(m.base_stats[st]), 0);
|
dialog::addSelItem("base value", its(m.base_stats[st]), 0);
|
||||||
dialog::addSelItem("current value", prettystat(m.current.stats[st]), 0);
|
dialog::addSelItem("current value", prettystat(m.current.stats[st]), 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user