Implement the special version of the skill picker for the Has Enough of Statisic? node
This commit is contained in:
@@ -92,7 +92,7 @@ namespace {
|
|||||||
.ex2b(STRT_CMP);
|
.ex2b(STRT_CMP);
|
||||||
node_properties_t S_STAT = node_builder_t(eSpecType::IF_STATISTIC)
|
node_properties_t S_STAT = node_builder_t(eSpecType::IF_STATISTIC)
|
||||||
.ex1b(eSpecPicker::NODE)
|
.ex1b(eSpecPicker::NODE)
|
||||||
.ex2a(+STRT_SKILL)
|
.ex2a(STRT_SKILL_CHECK)
|
||||||
.ex2b(STRT_ACCUM);
|
.ex2b(STRT_ACCUM);
|
||||||
node_properties_t S_TEXT = node_builder_t(eSpecType::IF_TEXT_RESPONSE)
|
node_properties_t S_TEXT = node_builder_t(eSpecType::IF_TEXT_RESPONSE)
|
||||||
.msg1(+eSpecPicker::MSG_SINGLE)
|
.msg1(+eSpecPicker::MSG_SINGLE)
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ node_function_t operator+(eSpecPicker picker) {
|
|||||||
|
|
||||||
node_function_t operator+(eStrType str) {
|
node_function_t operator+(eStrType str) {
|
||||||
node_function_t n(str);
|
node_function_t n(str);
|
||||||
if(str == STRT_SPELL_PAT || str == STRT_SKILL) {
|
if(str == STRT_SPELL_PAT) {
|
||||||
n.augmented = true;
|
n.augmented = true;
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
|
|||||||
@@ -136,7 +136,8 @@ struct node_category_info_t {
|
|||||||
enum eStrType {
|
enum eStrType {
|
||||||
STRT_MONST, STRT_ITEM, STRT_TER, STRT_BUTTON,
|
STRT_MONST, STRT_ITEM, STRT_TER, STRT_BUTTON,
|
||||||
STRT_SPEC_ITEM, STRT_MAGE, STRT_PRIEST, STRT_ALCHEMY,
|
STRT_SPEC_ITEM, STRT_MAGE, STRT_PRIEST, STRT_ALCHEMY,
|
||||||
STRT_TOWN, STRT_SECTOR, STRT_SKILL, STRT_TRAIT, STRT_RACE,
|
STRT_TOWN, STRT_SECTOR, STRT_SKILL, STRT_SKILL_CHECK,
|
||||||
|
STRT_TRAIT, STRT_RACE,
|
||||||
STRT_PICT, STRT_CMP, STRT_ACCUM, STRT_TRAP,
|
STRT_PICT, STRT_CMP, STRT_ACCUM, STRT_TRAP,
|
||||||
STRT_ATTITUDE, STRT_STAIR, STRT_LIGHT, STRT_CONTEXT,
|
STRT_ATTITUDE, STRT_STAIR, STRT_LIGHT, STRT_CONTEXT,
|
||||||
STRT_SHOP, STRT_COST_ADJ, STRT_STAIR_MODE, STRT_TALK_NODE,
|
STRT_SHOP, STRT_COST_ADJ, STRT_STAIR_MODE, STRT_TALK_NODE,
|
||||||
|
|||||||
@@ -341,12 +341,18 @@ short choose_text(eStrType list, unsigned short cur_choice, cDialog* parent, std
|
|||||||
strings.push_back(get_str("magic-names", i + 200));
|
strings.push_back(get_str("magic-names", i + 200));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STRT_SKILL:
|
case STRT_SKILL: case STRT_SKILL_CHECK:
|
||||||
for(int i = 0; i < 19; i++) {
|
for(int i = 0; i < 19; i++) {
|
||||||
strings.push_back(get_str("skills", i * 2 + 1));
|
strings.push_back(get_str("skills", i * 2 + 1));
|
||||||
}
|
}
|
||||||
strings.push_back("Maximum Health");
|
strings.push_back("Maximum Health");
|
||||||
strings.push_back("Maximum Spell Points");
|
strings.push_back("Maximum Spell Points");
|
||||||
|
if(list == STRT_SKILL) break;
|
||||||
|
strings.push_back("Current Health");
|
||||||
|
strings.push_back("Current Spell Points");
|
||||||
|
strings.push_back("Current Experience Points");
|
||||||
|
strings.push_back("Current Skill");
|
||||||
|
strings.push_back("Current Level");
|
||||||
break;
|
break;
|
||||||
case STRT_TRAIT:
|
case STRT_TRAIT:
|
||||||
for(int i = 0; i < 17; i++) {
|
for(int i = 0; i < 17; i++) {
|
||||||
@@ -974,6 +980,7 @@ static bool edit_spec_enc_value(cDialog& me, std::string item_hit, node_stack_t&
|
|||||||
case STRT_MAGE: title = "Which spell?"; break;
|
case STRT_MAGE: title = "Which spell?"; break;
|
||||||
case STRT_PRIEST: title = "Which spell?"; break;
|
case STRT_PRIEST: title = "Which spell?"; break;
|
||||||
case STRT_SKILL: title = "Which statistic?"; break;
|
case STRT_SKILL: title = "Which statistic?"; break;
|
||||||
|
case STRT_SKILL_CHECK: title = "Which statistic?"; break;
|
||||||
case STRT_TRAIT: title = "Which trait?"; break;
|
case STRT_TRAIT: title = "Which trait?"; break;
|
||||||
case STRT_RACE: title = "Which species?"; break;
|
case STRT_RACE: title = "Which species?"; break;
|
||||||
case STRT_TOWN: title = "Which town?"; break;
|
case STRT_TOWN: title = "Which town?"; break;
|
||||||
@@ -1017,11 +1024,15 @@ static bool edit_spec_enc_value(cDialog& me, std::string item_hit, node_stack_t&
|
|||||||
auto otherField = get_control_for_field(fcn.continuation);
|
auto otherField = get_control_for_field(fcn.continuation);
|
||||||
if(fcn.str_type == STRT_SECTOR) {
|
if(fcn.str_type == STRT_SECTOR) {
|
||||||
val = val * scenario.outdoors.height() + me[otherField].getTextAsNum();
|
val = val * scenario.outdoors.height() + me[otherField].getTextAsNum();
|
||||||
|
} else if(fcn.str_type == STRT_SKILL_CHECK && val >= 100) {
|
||||||
|
val -= 79;
|
||||||
}
|
}
|
||||||
store = choose_text(fcn.str_type, val + fcn.adjust, &me, title) - fcn.adjust;
|
store = choose_text(fcn.str_type, val + fcn.adjust, &me, title) - fcn.adjust;
|
||||||
if(fcn.str_type == STRT_SECTOR) {
|
if(fcn.str_type == STRT_SECTOR) {
|
||||||
me[otherField].setTextToNum(store % scenario.outdoors.height());
|
me[otherField].setTextToNum(store % scenario.outdoors.height());
|
||||||
store /= scenario.outdoors.height();
|
store /= scenario.outdoors.height();
|
||||||
|
} else if(fcn.str_type == STRT_SKILL_CHECK && store > 20) {
|
||||||
|
store += 79;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case eSpecPicker::PICTURE: {
|
case eSpecPicker::PICTURE: {
|
||||||
|
|||||||
Reference in New Issue
Block a user