From 5315655bc6ce52870a688aa3933745ea884d83c6 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 21 Jan 2015 22:36:00 -0500 Subject: [PATCH] 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 --- rsrc/strings/special-contexts.txt | 10 +- rsrc/strings/specials-text-ifthen.txt | 20 +-- rsrc/strings/specials-text-once.txt | 40 +++--- rsrc/strings/specials-text-outdoor.txt | 16 +-- rsrc/strings/specials-text-rect.txt | 162 +------------------------ rsrc/strings/specials-text-town.txt | 8 +- src/boe.specials.cpp | 12 +- src/classes/special.cpp | 43 ++++--- src/dialogxml/button.cpp | 30 +++++ src/scenedit/scen.keydlgs.cpp | 4 +- 10 files changed, 110 insertions(+), 235 deletions(-) diff --git a/rsrc/strings/special-contexts.txt b/rsrc/strings/special-contexts.txt index 3d925e7c..f632f277 100644 --- a/rsrc/strings/special-contexts.txt +++ b/rsrc/strings/special-contexts.txt @@ -17,11 +17,11 @@ Won outdoor encounter Targetung spell Using space Seeing a monster for the first time - - - - - +Monster using special ability +Attacking at melee +Being attacked at melee +Attacking at range +Being attacked at range diff --git a/rsrc/strings/specials-text-ifthen.txt b/rsrc/strings/specials-text-ifthen.txt index 9f88e489..dcfc198b 100644 --- a/rsrc/strings/specials-text-ifthen.txt +++ b/rsrc/strings/specials-text-ifthen.txt @@ -287,18 +287,18 @@ Unused Otherwise call this special -------------------- If Fields? -Unused -Unused -Unused -Unused -Unused -Unused -Unused +Minimum # of fields +Maximum # of fields Field Type -If any fields, call this special ... +If enough fields, call this special ... Unused Unused Unused +Top of rectangle +Left of rectangle +Unused +Bottom of rectangle +Right of rectangle Unused Otherwise call this special -------------------- @@ -378,7 +378,7 @@ If the party has this much of the stat ... Call this special ... Unused Which statistic -Check mode (0 - cumulative, 1 - average, 2 - minimum, 3 - maximum) +Check mode Unused Otherwise call this special -------------------- @@ -422,7 +422,7 @@ Unused Unused Unused Unused -Which context (0 .. 18 or 100 .. 102) +Which context (0 .. 24 or 100 .. 102) 0 - can enter, 1 - no enter If context matches, call this special ... Unused diff --git a/rsrc/strings/specials-text-once.txt b/rsrc/strings/specials-text-once.txt index 5a55536e..43348ffe 100644 --- a/rsrc/strings/specials-text-once.txt +++ b/rsrc/strings/specials-text-once.txt @@ -142,35 +142,35 @@ Special if item IS taken Unused Special to Jump To -------------------- -Give Item (Terrain pic) -Stuff Done Flag Part A -Stuff Done Flag Part B -Number of first message in dialog -Num. of spec. item to give (-1 none) +Unused Node +Unused +Unused +Unused +Unused +Unused +Unused +Unused +Unused +Unused Unused -Terrain Picture number Unused -Item to give -Amount of gold to give Unused -Amount of food to give -Special if item IS taken Unused Special to Jump To -------------------- -Give Item (Monster pic) -Stuff Done Flag Part A -Stuff Done Flag Part B -Number of first message in dialog -Num. of spec. item to give (-1 none) +Unused Node +Unused +Unused +Unused +Unused +Unused +Unused +Unused +Unused +Unused Unused -Monster Picture number Unused -Item to give -Amount of gold to give Unused -Amount of food to give -Special if item IS taken Unused Special to Jump To -------------------- diff --git a/rsrc/strings/specials-text-outdoor.txt b/rsrc/strings/specials-text-outdoor.txt index 33577f93..47578e74 100644 --- a/rsrc/strings/specials-text-outdoor.txt +++ b/rsrc/strings/specials-text-outdoor.txt @@ -14,18 +14,18 @@ Unused Unused Special to Jump To -------------------- -Change Out Terrain -Unused -Unused -First part of message -Second part of message +Unused Node +Unused +Unused +Unused +Unused +Unused +Unused +Unused Unused Unused Unused -X coordinate of space -Y coordinate of space Unused -Terrain to change to Unused Unused Special to Jump To diff --git a/rsrc/strings/specials-text-rect.txt b/rsrc/strings/specials-text-rect.txt index 0893325d..55932206 100644 --- a/rsrc/strings/specials-text-rect.txt +++ b/rsrc/strings/specials-text-rect.txt @@ -15,7 +15,7 @@ Unused Special to Jump To -------------------- Set Explored -Unused +0 - clear, 1 - explore Unused First part of message Second part of message @@ -30,166 +30,6 @@ Right of rectangle Unused Special to Jump To -------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- -Unused Node -Unused -Unused -Unused -Unused -Unused -Unused -Unused -Top of rectangle -Left of rectangle -Unused -Bottom of rectangle -Right of rectangle -Unused -Special to Jump To --------------------- Move Items X of space to move to Y of space to move to diff --git a/rsrc/strings/specials-text-town.txt b/rsrc/strings/specials-text-town.txt index ef7d514a..22267218 100644 --- a/rsrc/strings/specials-text-town.txt +++ b/rsrc/strings/specials-text-town.txt @@ -198,8 +198,8 @@ Second part of message Unused Unused Unused -Type of creature to remove -Unused +X coordinate of space +Y coordinate of space Unused Unused Unused @@ -214,7 +214,7 @@ Second part of message Unused Unused Unused -0 - all, 1 - friendly, 2 - hostile +Type (or 0 - all, -1 - friendly, -2 - hostile) Unused Unused Unused @@ -398,7 +398,7 @@ Unused Unused Special to Jump To -------------------- -Start General Timer +Start Town Timer Unused Unused First part of message diff --git a/src/boe.specials.cpp b/src/boe.specials.cpp index c8c4b8b4..9165047a 100644 --- a/src/boe.specials.cpp +++ b/src/boe.specials.cpp @@ -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; diff --git a/src/classes/special.cpp b/src/classes/special.cpp index 23e411ac..7b85a7ae 100644 --- a/src/classes/special.cpp +++ b/src/classes/special.cpp @@ -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 } diff --git a/src/dialogxml/button.cpp b/src/dialogxml/button.cpp index 46c0ef73..8bd0ed29 100644 --- a/src/dialogxml/button.cpp +++ b/src/dialogxml/button.cpp @@ -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(){ diff --git a/src/scenedit/scen.keydlgs.cpp b/src/scenedit/scen.keydlgs.cpp index cbcbefb6..5b8f986c 100644 --- a/src/scenedit/scen.keydlgs.cpp +++ b/src/scenedit/scen.keydlgs.cpp @@ -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;