From ee9c089829c0d6e229dd0df6afc2bc7911b284b8 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 30 Jun 2015 22:19:52 -0400 Subject: [PATCH] Add a Display Message With Title special node - Remove Wandering Will Fight, which has been made redundant --- doc/editor/appendix/Specials.html | 17 +++++++---------- rsrc/strings/specials-text-general.txt | 12 ++++++------ src/boe.specials.cpp | 17 ++++++++++------- src/boe.specials.hpp | 2 +- src/classes/simpletypes.hpp | 2 +- src/classes/special.cpp | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/editor/appendix/Specials.html b/doc/editor/appendix/Specials.html index 579b0332..64239191 100644 --- a/doc/editor/appendix/Specials.html +++ b/doc/editor/appendix/Specials.html @@ -189,6 +189,9 @@ example, a guard won't let them), use this node.
Uses:
Suppose you want a pillar the party can walk through. Place a special encounter on the pillar, and have a node of this type be the first special node called. Set Extra 1a to 0 and Extra 2a to 1.
+
Uses:
Suppose a group of soldiers outdoors will only attack the party if they +have the stolen Wand of Balloo. If they don't have it, use this node with Extra 1a set to +0. If you don't call a special node of this type, the soldiers will attack.
Note:
This doesn't have to be the last node in a chain. If this is the first special node called, the party is still kept from entering the space... unless another node of the same type undoes it. The only exception to this is forced passage, as the node @@ -323,17 +326,11 @@ time passes, and their health and spell points are restored.
Extra 1a:
The number of ticks that pass (a day is 3000 ticks)
Extra 1b:
The amount of health and spell points to restore.
-
Type 26: Wandering Will Fight
This special node only has an effect if called -when the party has just encountered a group of monsters outdoors. If called at any other -time, it has no effect. The node determines whether the monsters in the group will -actually attack the party or not. +
Type 26: Display Message with Title
This is similar to a Display Message node, +but lets you specify a title string and choose an icon.
-
Extra 1a:
If this is set to 0, the monsters will not attack the party, and the -outdoor encounter will simply end. If its non-zero, the monsters will attack the -party.
-
Uses:
Suppose a group of soldiers outdoors will only attack the party if they -have the stolen Wand of Balloo. If they don't have it, use this node with Extra 1a set to -0. If you don't call a special node of this type, the soldiers will attack.
+
Mess 3:
The number of the string to use as a title. Click Create/Edit to edit it. Note that the space allotted for the title is just one line, so keep it short.
+
Pic, Pictype
Specify the picture you want to show with the message.
Type 27: End Scenario
Every scenario should call a node of this type at least once. When called, the scenario immediately ends, and the player will be returned to the diff --git a/rsrc/strings/specials-text-general.txt b/rsrc/strings/specials-text-general.txt index be6e89f7..818c6417 100644 --- a/rsrc/strings/specials-text-general.txt +++ b/rsrc/strings/specials-text-general.txt @@ -414,19 +414,19 @@ Unused Unused Special to Jump To -------------------- -Wandering will fight +Display Message with Title Unused Unused +First part of message +Second part of message +Message title +Picture +Type of picture Unused Unused Unused Unused Unused -0 - no attack, 1 - attack -Unused -Unused -Unused -Unused Unused Special to Jump To -------------------- diff --git a/src/boe.specials.cpp b/src/boe.specials.cpp index 8d68aa35..e6441e9e 100644 --- a/src/boe.specials.cpp +++ b/src/boe.specials.cpp @@ -2152,6 +2152,10 @@ void general_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, case eSpecType::DISPLAY_MSG: check_mess = true; break; + case eSpecType::TITLED_MSG: + get_strs(str1,str2, cur_spec_type, cur_node.m3, -1); + handle_message(which_mode, cur_spec_type, cur_node.m1, cur_node.m2, a, b, str1, cur_node.pic, ePicType(cur_node.pictype)); + break; case eSpecType::DISPLAY_SM_MSG: get_strs(str1,str2, cur_spec_type,cur_node.m1,cur_node.m2); if(cur_node.m1 >= 0) @@ -2251,11 +2255,6 @@ void general_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, check_mess = true; do_rest(spec.ex1a, spec.ex1b, spec.ex1b); break; - case eSpecType::WANDERING_WILL_FIGHT: - if(which_mode != eSpecCtx::OUTDOOR_ENC) - break; - *a = (spec.ex1a == 0) ? 1 : 0; - break; case eSpecType::END_SCENARIO: end_scenario = true; break; @@ -4575,7 +4574,11 @@ void setsd(short a,short b,short val) { PSD[a][b] = val; } -void handle_message(eSpecCtx which_mode,short cur_type,short mess1,short mess2,short *a,short *b) { +void handle_message(eSpecCtx which_mode,short cur_type,short mess1,short mess2,short *a,short *b,std::string title,pic_num_t pic,ePicType pt) { + if(pic == -1) { + pic = univ.scenario.intro_pic; + pt = PIC_SCEN; + } eEncNoteType note_type; switch(cur_type) { case 0: @@ -4602,7 +4605,7 @@ void handle_message(eSpecCtx which_mode,short cur_type,short mess1,short mess2,s where1 = is_out() ? univ.party.outdoor_corner.x + univ.party.i_w_c.x : univ.town.num; where2 = is_out() ? univ.party.outdoor_corner.y + univ.party.i_w_c.y : univ.town.num; std::string placename = is_out() ? univ.out->out_name : univ.town->town_name; - cStrDlog display_strings(str1.c_str(), str2.c_str(),"",univ.scenario.intro_pic,PIC_SCEN,0); + cStrDlog display_strings(str1.c_str(), str2.c_str(),title,pic,pt,0); display_strings.setSound(57); display_strings.setRecordHandler(cStringRecorder(note_type).string1(mess1).string2(mess2).from(where1,where2).at(placename)); display_strings.show(); diff --git a/src/boe.specials.hpp b/src/boe.specials.hpp index 7b6149b0..222e3455 100644 --- a/src/boe.specials.hpp +++ b/src/boe.specials.hpp @@ -26,7 +26,7 @@ cSpecial get_node(short cur_spec,short cur_spec_type); void general_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, short *next_spec,short *next_spec_type,short *a,short *b,short *redraw); void setsd(short a,short b,short val); -void handle_message(eSpecCtx which_mode,short cur_type,short mess1,short mess2,short *a,short *b); +void handle_message(eSpecCtx which_mode,short cur_type,short mess1,short mess2,short*a,short*b,std::string title="",pic_num_t pic=-1,ePicType pt=PIC_SCEN); void get_strs(std::string& str1, std::string& str2,short cur_type,short which_str1,short which_str2) ; void ifthen_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, short *next_spec,short *next_spec_type,short *a,short *b,short *redraw); diff --git a/src/classes/simpletypes.hpp b/src/classes/simpletypes.hpp index 60cc4dc0..d5b0d5e5 100644 --- a/src/classes/simpletypes.hpp +++ b/src/classes/simpletypes.hpp @@ -594,7 +594,7 @@ enum class eSpecType { COPY_SDF = 23, DISPLAY_PICTURE = 24, REST = 25, - WANDERING_WILL_FIGHT = 26, + TITLED_MSG = 26, END_SCENARIO = 27, // add "win/lose" option SET_POINTER = 28, SET_CAMP_FLAG = 29, diff --git a/src/classes/special.cpp b/src/classes/special.cpp index 4b5fca81..a300de01 100644 --- a/src/classes/special.cpp +++ b/src/classes/special.cpp @@ -80,7 +80,7 @@ void cSpecial::append(legacy::special_node_type& old){ case 23: type = eSpecType::COPY_SDF; break; // 24 was ritual of sanctification case 25: type = eSpecType::REST; break; - case 26: type = eSpecType::WANDERING_WILL_FIGHT; break; + case 26: type = eSpecType::CANT_ENTER; break; // originally wandering will fight case 27: type = eSpecType::END_SCENARIO; break; // 28-49 were undefined case 50: type = eSpecType::ONCE_GIVE_ITEM; break; @@ -498,9 +498,9 @@ static const char*const button_dict[7][11] = { { // general nodes " mmmMmmmmmMmmm mmmmmm Mmm $ mmmmmm mmm", // msg1 " ", // msg2 - " ", // msg3 - " p 3 ", // pic - " ? ", // pictype + " M ", // msg3 + " p p 3 ", // pic + " ? ? ", // pictype " & x T i _ M cit j ", // ex1a " % S ss cJ ", // ex1b " ", // ex1c