New special node to initiate conversation (should even work outdoors)

This commit is contained in:
2015-01-17 02:59:34 -05:00
parent 4e2c0100e8
commit 3d7fcbd60e
9 changed files with 52 additions and 42 deletions

View File

@@ -41,7 +41,7 @@ append-monst
append-item append-item
append-ter append-ter
pause pause
start-talk

View File

@@ -76,7 +76,7 @@ Unused
Number of items in store (1 .. 40) Number of items in store (1 .. 40)
Cost adjust (0 .. 6, lower = cheaper) Cost adjust (0 .. 6, lower = cheaper)
Unused Unused
Special to Jump To Unused
-------------------- --------------------
Display Small Message Display Small Message
Unused Unused
@@ -702,6 +702,22 @@ Unused
Unused Unused
Special to Jump To Special to Jump To
-------------------- --------------------
Start Conversation
Unused
Unused
Unused
Unused
Unused
Facial Picture
Unused
Personality
Unused
Unused
Unused
Unused
Unused
Unused
--------------------
Special Name Special Name
sdf1 sdf1
sdf2 sdf2

View File

@@ -677,9 +677,7 @@ void handle_talk_event(location p) {
strnum1 = -1; strnum1 = -1;
return; return;
case eTalkNode::BUY_HEALING: case eTalkNode::BUY_HEALING:
// TODO: extra1 and extra2 are actually never used! So remove them. start_shop_mode(eShopType::HEALING,0,0,a,save_talk_str1.c_str());
start_shop_mode(eShopType::HEALING,univ.town.monst[store_m_num].extra1,
univ.town.monst[store_m_num].extra2,a,save_talk_str1.c_str());
strnum1 = -1; strnum1 = -1;
return; return;
break; break;
@@ -834,8 +832,10 @@ void handle_talk_event(location p) {
talk_end_forced = true; talk_end_forced = true;
break; break;
case eTalkNode::END_FIGHT: case eTalkNode::END_FIGHT:
univ.town.monst[store_m_num].attitude = 1; if(store_m_num >= 0 && store_m_num <= univ.town->max_monst()) {
univ.town.monst[store_m_num].mobility = 1; univ.town.monst[store_m_num].attitude = 1;
univ.town.monst[store_m_num].mobility = 1;
}
talk_end_forced = true; talk_end_forced = true;
break; break;
case eTalkNode::END_ALARM: case eTalkNode::END_ALARM:
@@ -843,11 +843,13 @@ void handle_talk_event(location p) {
talk_end_forced = true; talk_end_forced = true;
break; break;
case eTalkNode::END_DIE: case eTalkNode::END_DIE:
// TODO: Any reason not to call something like kill_monst? if(store_m_num >= 0 && store_m_num <= univ.town->max_monst()) {
univ.town.monst[store_m_num].active = 0; // TODO: Any reason not to call something like kill_monst?
// Special killing effects univ.town.monst[store_m_num].active = 0;
if(sd_legit(univ.town.monst[store_m_num].spec1,univ.town.monst[store_m_num].spec2)) // Special killing effects
PSD[univ.town.monst[store_m_num].spec1][univ.town.monst[store_m_num].spec2] = 1; if(sd_legit(univ.town.monst[store_m_num].spec1,univ.town.monst[store_m_num].spec2))
PSD[univ.town.monst[store_m_num].spec1][univ.town.monst[store_m_num].spec2] = 1;
}
talk_end_forced = true; talk_end_forced = true;
break; break;
// TODO: Strings resulting from this don't seem to be recordable; whyever not? // TODO: Strings resulting from this don't seem to be recordable; whyever not?

View File

@@ -1538,8 +1538,6 @@ bool damage_monst(short which_m, short who_hit, short how_much, short how_much_s
univ.town.monst[which_spot].start_loc = victim->start_loc; univ.town.monst[which_spot].start_loc = victim->start_loc;
univ.town.monst[which_spot].mobility = victim->mobility; univ.town.monst[which_spot].mobility = victim->mobility;
univ.town.monst[which_spot].time_flag = victim->time_flag; univ.town.monst[which_spot].time_flag = victim->time_flag;
univ.town.monst[which_spot].extra1 = victim->extra1;
univ.town.monst[which_spot].extra2 = victim->extra2;
univ.town.monst[which_spot].spec1 = victim->spec1; univ.town.monst[which_spot].spec1 = victim->spec1;
univ.town.monst[which_spot].spec2 = victim->spec2; univ.town.monst[which_spot].spec2 = victim->spec2;
univ.town.monst[which_spot].spec_enc_code = victim->spec_enc_code; univ.town.monst[which_spot].spec_enc_code = victim->spec_enc_code;
@@ -2406,6 +2404,13 @@ void general_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type,
redraw_screen(REFRESH_TERRAIN | REFRESH_STATS); redraw_screen(REFRESH_TERRAIN | REFRESH_STATS);
sf::sleep(sf::milliseconds(spec.ex1a)); sf::sleep(sf::milliseconds(spec.ex1a));
break; break;
case eSpecType::START_TALK:
i = current_pc_picked_in_spec_enc;
if(i >= 100) i -= 100;
else i = -1;
start_talk_mode(i, spec.ex1a, spec.ex1b, spec.pic);
*next_spec = -1;
break;
} }
if(check_mess) { if(check_mess) {
handle_message(which_mode,cur_spec_type,cur_node.m1,cur_node.m2,a,b); handle_message(which_mode,cur_spec_type,cur_node.m1,cur_node.m2,a,b);

View File

@@ -375,7 +375,7 @@ cCreature::cCreature(){
id = number = active = attitude = start_attitude = 0; id = number = active = attitude = start_attitude = 0;
start_loc.x = start_loc.y = cur_loc.x = cur_loc.y = targ_loc.x = targ_loc.y = 80; start_loc.x = start_loc.y = cur_loc.x = cur_loc.y = targ_loc.x = targ_loc.y = 80;
mobility = 1; mobility = 1;
time_flag = summoned = extra1 = extra2 = 0; time_flag = summoned = 0;
spec1 = spec2 = spec_enc_code = time_code = monster_time = 0; spec1 = spec2 = spec_enc_code = time_code = monster_time = 0;
personality = special_on_kill = facial_pic = -1; personality = special_on_kill = facial_pic = -1;
target = 6; target = 6;
@@ -392,8 +392,6 @@ void cCreature::append(legacy::creature_start_type old){
start_loc.y = old.start_loc.y; start_loc.y = old.start_loc.y;
mobility = old.mobile; mobility = old.mobile;
time_flag = old.time_flag; time_flag = old.time_flag;
extra1 = old.extra1;
extra2 = old.extra2;
spec1 = old.spec1; spec1 = old.spec1;
spec2 = old.spec2; spec2 = old.spec2;
spec_enc_code = old.spec_enc_code; spec_enc_code = old.spec_enc_code;
@@ -419,8 +417,6 @@ void cCreature::append(legacy::creature_data_type old){
start_loc.y = old.monst_start.start_loc.y; start_loc.y = old.monst_start.start_loc.y;
mobility = old.monst_start.mobile; mobility = old.monst_start.mobile;
time_flag = old.monst_start.time_flag; time_flag = old.monst_start.time_flag;
extra1 = old.monst_start.extra1;
extra2 = old.monst_start.extra2;
spec1 = old.monst_start.spec1; spec1 = old.monst_start.spec1;
spec2 = old.monst_start.spec2; spec2 = old.monst_start.spec2;
spec_enc_code = old.monst_start.spec_enc_code; spec_enc_code = old.monst_start.spec_enc_code;
@@ -931,8 +927,6 @@ void cCreature::writeTo(std::ostream& file) const {
file << "MOBILITY " << unsigned(mobility) << '\n'; file << "MOBILITY " << unsigned(mobility) << '\n';
file << "TIMEFLAG " << unsigned(time_flag) << '\n'; file << "TIMEFLAG " << unsigned(time_flag) << '\n';
file << "SUMMONED " << summoned << '\n'; file << "SUMMONED " << summoned << '\n';
// TODO: Don't remember what these do
file << "EXTRA " << unsigned(extra1) << ' ' << unsigned(extra2) << '\n';
file << "SPEC " << spec1 << ' ' << spec2 << '\n'; file << "SPEC " << spec1 << ' ' << spec2 << '\n';
file << "SPECCODE " << int(spec_enc_code) << '\n'; file << "SPECCODE " << int(spec_enc_code) << '\n';
file << "TIMECODE " << int(time_code) << '\n'; file << "TIMECODE " << int(time_code) << '\n';
@@ -981,12 +975,7 @@ void cCreature::readFrom(std::istream& file) {
time_flag = i; time_flag = i;
} else if(cur == "SUMMONED") } else if(cur == "SUMMONED")
line >> summoned; line >> summoned;
else if(cur == "EXTRA") { else if(cur == "SPEC")
unsigned int i,j;
line >> i >> j;
extra1 = i;
extra2 = j;
} else if(cur == "SPEC")
line >> spec1 >> spec2; line >> spec1 >> spec2;
else if(cur == "SPECCODE") { else if(cur == "SPECCODE") {
int i; int i;

View File

@@ -164,7 +164,6 @@ public:
unsigned short mobility; unsigned short mobility;
unsigned char time_flag; unsigned char time_flag;
short summoned; short summoned;
unsigned char extra1, extra2;
short spec1, spec2; short spec1, spec2;
char spec_enc_code, time_code; char spec_enc_code, time_code;
short monster_time, personality; short monster_time, personality;

View File

@@ -545,6 +545,7 @@ enum class eSpecType {
APPEND_ITEM = 41, APPEND_ITEM = 41,
APPEND_TER = 42, APPEND_TER = 42,
PAUSE = 43, PAUSE = 43,
START_TALK = 44,
ONCE_GIVE_ITEM = 50, ONCE_GIVE_ITEM = 50,
ONCE_GIVE_SPEC_ITEM = 51, ONCE_GIVE_SPEC_ITEM = 51,
ONCE_NULL = 52, ONCE_NULL = 52,
@@ -668,7 +669,7 @@ enum class eSpecCat {
inline eSpecCat getNodeCategory(eSpecType node) { inline eSpecCat getNodeCategory(eSpecType node) {
int code = (int) node; int code = (int) node;
if(code >= 0 && code <= 43) if(code >= 0 && code <= 44)
return eSpecCat::GENERAL; return eSpecCat::GENERAL;
if(code >= 50 && code <= 63) if(code >= 50 && code <= 63)
return eSpecCat::ONCE; return eSpecCat::ONCE;

View File

@@ -379,17 +379,17 @@ std::istream& operator >> (std::istream& in, eSpecType& e) {
// (terrain, monster, dialog, talk, item, pc, field, boom, missile, status) // (terrain, monster, dialog, talk, item, pc, field, boom, missile, status)
static const char*const button_dict[7][11] = { static const char*const button_dict[7][11] = {
{ // general nodes { // general nodes
" mmmMMmmmm mmm mmmmmm Mmm $ mmmmmm ", // msg1 " mmmMMmmmm mmm mmmmmm Mmm $ mmmmmm ", // msg1
" ", // msg2 " ", // msg2
" ", // msg3 " ", // msg3
" ", // pic " 3", // pic
" ", // pictype " ", // pictype
" # x T i M cit ", // ex1a " # x T i M cit ", // ex1a
" & S ss ", // ex1b " & S ss c", // ex1b
" ", // ex1c " ", // ex1c
" tt ", // ex2a " tt ", // ex2a
" % t ", // ex2b " % t ", // ex2b
" ", // ex2c " ", // ex2c
}, { // one-shot nodes }, { // one-shot nodes
"mm mddddddmmm", // msg1 "mm mddddddmmm", // msg1
" ", // msg2 " ", // msg2

View File

@@ -607,8 +607,6 @@ bool handle_action(location the_point,sf::Event /*event*/) {
scenario.scen_monsters[mode_count].default_attitude; scenario.scen_monsters[mode_count].default_attitude;
town->creatures(i).mobility = 1; town->creatures(i).mobility = 1;
town->creatures(i).time_flag = 0; town->creatures(i).time_flag = 0;
town->creatures(i).extra1 = 0;
town->creatures(i).extra2 = 0;
town->creatures(i).spec1 = -1; town->creatures(i).spec1 = -1;
town->creatures(i).spec2 = -1; town->creatures(i).spec2 = -1;
town->creatures(i).spec_enc_code = 0; town->creatures(i).spec_enc_code = 0;