Implement the special version of the skill picker for the Has Enough of Statisic? node

This commit is contained in:
2025-03-02 20:19:50 -05:00
committed by Celtic Minstrel
parent 50637d3ddd
commit aad5460acb
4 changed files with 16 additions and 4 deletions

View File

@@ -92,7 +92,7 @@ namespace {
.ex2b(STRT_CMP);
node_properties_t S_STAT = node_builder_t(eSpecType::IF_STATISTIC)
.ex1b(eSpecPicker::NODE)
.ex2a(+STRT_SKILL)
.ex2a(STRT_SKILL_CHECK)
.ex2b(STRT_ACCUM);
node_properties_t S_TEXT = node_builder_t(eSpecType::IF_TEXT_RESPONSE)
.msg1(+eSpecPicker::MSG_SINGLE)

View File

@@ -670,7 +670,7 @@ node_function_t operator+(eSpecPicker picker) {
node_function_t operator+(eStrType str) {
node_function_t n(str);
if(str == STRT_SPELL_PAT || str == STRT_SKILL) {
if(str == STRT_SPELL_PAT) {
n.augmented = true;
}
return n;

View File

@@ -136,7 +136,8 @@ struct node_category_info_t {
enum eStrType {
STRT_MONST, STRT_ITEM, STRT_TER, STRT_BUTTON,
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_ATTITUDE, STRT_STAIR, STRT_LIGHT, STRT_CONTEXT,
STRT_SHOP, STRT_COST_ADJ, STRT_STAIR_MODE, STRT_TALK_NODE,

View File

@@ -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));
}
break;
case STRT_SKILL:
case STRT_SKILL: case STRT_SKILL_CHECK:
for(int i = 0; i < 19; i++) {
strings.push_back(get_str("skills", i * 2 + 1));
}
strings.push_back("Maximum Health");
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;
case STRT_TRAIT:
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_PRIEST: title = "Which spell?"; 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_RACE: title = "Which species?"; 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);
if(fcn.str_type == STRT_SECTOR) {
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;
if(fcn.str_type == STRT_SECTOR) {
me[otherField].setTextToNum(store % scenario.outdoors.height());
store /= scenario.outdoors.height();
} else if(fcn.str_type == STRT_SKILL_CHECK && store > 20) {
store += 79;
}
} break;
case eSpecPicker::PICTURE: {