Fix up some minor issues with the special node editing dialog

- Also: merge "nuke monsters" and "destroy monster" nodes, since the action of the "destroy monster" node isn't what it sounds like; now it simply destroys a single monster on a specific space
This commit is contained in:
2015-01-21 22:36:00 -05:00
parent e689ed93ef
commit 5315655bc6
10 changed files with 110 additions and 235 deletions

View File

@@ -3771,18 +3771,16 @@ void townmode_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type,
*redraw = 1;
break;
case eSpecType::TOWN_DESTROY_MONST:
for(i = 0; i < univ.town->max_monst(); i++)
if(univ.town.monst[i].number == spec.ex1a) {
univ.town.monst[i].active = 0;
}
if(spec.ex1a >= 0 && spec.ex1b >= 0 && (i = monst_there(l)))
univ.town.monst[i].active = 0;
*redraw = 1;
break;
case eSpecType::TOWN_NUKE_MONSTS:
for(i = 0; i < univ.town->max_monst(); i++)
if((univ.town.monst[i].active > 0) &&
(((spec.ex1a == 0) && (1 == 1)) ||
((spec.ex1a == 1) && (univ.town.monst[i].attitude % 2 == 0)) ||
((spec.ex1a == 2) && (univ.town.monst[i].attitude % 2 == 1)))){
(univ.town.monst[i].number == spec.ex1a || spec.ex1a == 0 ||
(spec.ex1a == -1 && univ.town.monst[i].attitude % 2 == 0) ||
(spec.ex1a == -2 && univ.town.monst[i].attitude % 2 == 1)){
univ.town.monst[i].active = 0;
}
*redraw = 1;

View File

@@ -183,6 +183,13 @@ void cSpecial::append(legacy::special_node_type& old){
type = eSpecType::IF_EQUIP_ITEM_CLASS;
ex2a = (old.type - 131) / 5;
break;
case 182: // Destroy all monsters of particular type
type = eSpecType::TOWN_NUKE_MONSTS;
break;
case 183: // Destroy all monsters, or all friendly / all hostile
type = eSpecType::TOWN_NUKE_MONSTS;
ex1a = -ex1a;
break;
case 193: // Split party
if(ex2a > 0) ex2a = 10;
break;
@@ -384,11 +391,11 @@ std::istream& operator >> (std::istream& in, eSpecType& e) {
// (terrain, monster, dialog, talk, item, pc, field, boom, missile, status)
static const char*const button_dict[7][11] = {
{ // general nodes
" mmmMMmmmm mmm mmmmmm Mmm $ mmmmmm ", // msg1
" mmmMmmmmmMmmm mmmmmm Mmm $ mmmmmm ", // msg1
" ", // msg2
" ", // msg3
" 3", // pic
" ", // pictype
" p 3", // pic
" ? ", // pictype
" # x T i M cit ", // ex1a
" & S ss c", // ex1b
" ", // ex1c
@@ -396,16 +403,16 @@ static const char*const button_dict[7][11] = {
" % t ", // ex2b
" ", // ex2c
}, { // one-shot nodes
"mm mddddddmmm", // msg1
"mm md d mmm", // msg1
" ", // msg2
" III ", // msg3
" pppppp p", // pic
" ?????? ?", // pictype
"iI bbbiii X", // ex1a
" sss ", // ex1b
" p p p", // pic
" ? ? ?", // pictype
"iI b i X", // ex1a
" s ", // ex1b
" ", // ex1c
" bbb ", // ex2a
"s ssssss S", // ex2b
" b ", // ex2a
"s s s S", // ex2b
" ", // ex2c
}, { // affect pc nodes
"mmmmmmmmmmm mmmmmmmm", // msg1
@@ -420,15 +427,15 @@ static const char*const button_dict[7][11] = {
" D ", // ex2b
" x ", // ex2c
}, { // if-then nodes
" $ $", // msg1
" ", // msg2
" f $ $", // msg1
" s ", // msg2
" ", // msg3
" ", // pic
" ", // pictype
" w APae f Qq $ * ", // ex1a
"ssss sss ssssss sss sssss =", // ex1b
" T I w APae Qq $ * ", // ex1a
"ssss sss ssssss s s sssss =", // ex1b
" ss", // ex1c
" K$ ", // ex2a
" t K$ ", // ex2a
"s ss s + s==+s =", // ex2b
" = s", // ex2c
}, { // town nodes
@@ -440,7 +447,7 @@ static const char*const button_dict[7][11] = {
" c L { ", // ex1a
" s s s s @ ", // ex1b
" }}", // ex1c
"@ D ! c T T i FD", // ex2a
"@ 7 ! c T T i FD", // ex2a
" DD / ", // ex2b
" x x : : ", // ex2c
}, { // rectangle nodes
@@ -456,7 +463,7 @@ static const char*const button_dict[7][11] = {
" ", // unused
" ", // ex2c
}, { // outdoors nodes
" mmmM", // msg1
" mmM", // msg1
" ", // msg2
" ", // msg3
" ", // pic
@@ -464,7 +471,7 @@ static const char*const button_dict[7][11] = {
" #", // ex1a
" &", // ex1b
" ", // ex1c
" t ", // ex2a
" ", // ex2a
" %", // ex2b
" ", // ex2c
}

View File

@@ -495,6 +495,36 @@ void cLedGroup::draw(){
void cButton::setBtnType(eBtnType newType){
if(type == BTN_LED || newType == BTN_LED) return; // can't change type
type = newType;
switch(newType) {
case BTN_SM:
frame.width() = 23;
frame.height() = 23;
break;
case BTN_REG: case BTN_DONE:
case BTN_LEFT: case BTN_RIGHT:
case BTN_UP: case BTN_DOWN:
frame.width() = 63;
frame.height() = 23;
break;
case BTN_LG:
frame.width() = 102;
frame.height() = 23;
break;
case BTN_HELP:
frame.width() = 16;
frame.height() = 13;
break;
case BTN_TALL:
case BTN_TRAIT:
frame.width() = 63;
frame.height() = 40;
break;
case BTN_PUSH:
frame.width() = 30;
frame.height() = 30;
break;
}
}
eBtnType cButton::getBtnType(){

View File

@@ -523,7 +523,7 @@ static bool edit_spec_enc_type(cDialog& me, std::string item_hit, node_stack_t&
else choices.push_back(name);
}
size_t cancelled = -1, result;
cStringChoice choose(choices, "Select a special node type:");
cStringChoice choose(choices, "Select a special node type:",&me);
result = choose.show((current < start || current > finish) ? cancelled : current - start);
if(result != cancelled) {
edit_stack.top().node.type = eSpecType(result + start);
@@ -753,7 +753,7 @@ static bool edit_spec_enc_value(cDialog& me, std::string item_hit, node_stack_t&
case '#':
choose_string = false;
store = val;
giveError("Either you have not chosen a shop type yet, or the shop type you chose doesn't allow you to customize its items.");
giveError("Either you have not chosen a shop type yet, or the shop type you chose doesn't allow you to customize its items.",&me);
break;
default:
choose_string = false;