Add a Display Message With Title special node

- Remove Wandering Will Fight, which has been made redundant
This commit is contained in:
2015-06-30 22:19:52 -04:00
parent c045c315aa
commit ee9c089829
6 changed files with 29 additions and 29 deletions

View File

@@ -189,6 +189,9 @@ example, a guard won't let them), use this node.</dd>
<dt>Uses:</dt><dd>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.</dd>
<dt>Uses:</dt><dd>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.</dd>
<dt>Note:</dt><dd>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.
<dt>Extra 1a:</dt><dd>The number of ticks that pass (a day is 3000 ticks)</dd>
<dt>Extra 1b:</dt><dd>The amount of health and spell points to restore.</dd></dd>
<dt>Type 26: Wandering Will Fight</dt><dd>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.
<dt>Type 26: Display Message with Title</dt><dd>This is similar to a Display Message node,
but lets you specify a title string and choose an icon.
<dl>
<dt>Extra 1a:</dt><dd>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.</dd>
<dt>Uses:</dt><dd>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.</dd></dd>
<dt>Mess 3:</dt><dd>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.</dd>
<dt>Pic, Pictype</dt><dd>Specify the picture you want to show with the message.</dd></dd>
<dt>Type 27: End Scenario</dt><dd>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

View File

@@ -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
--------------------

View File

@@ -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();

View File

@@ -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);

View File

@@ -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,

View File

@@ -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