Strictify and use talk node type enum

This commit is contained in:
2015-01-17 02:41:25 -05:00
parent 544cc80e56
commit 4e2c0100e8
8 changed files with 94 additions and 90 deletions

View File

@@ -685,38 +685,38 @@ inline eSpecCat getNodeCategory(eSpecType node) {
return eSpecCat::INVALID;
}
enum eTalkNodeType {
TALK_REGULAR = 0,
TALK_DEP_ON_SDF = 1,
TALK_SET_SDF = 2,
TALK_INN = 3,
TALK_DEP_ON_TIME = 4,
TALK_DEP_ON_TIME_AND_EVENT = 5,
TALK_DEP_ON_TOWN = 6,
TALK_BUY_ITEMS = 7,
TALK_TRAINING = 8,
TALK_BUY_MAGE = 9,
TALK_BUY_PRIEST = 10,
TALK_BUY_ALCHEMY = 11,
TALK_BUY_HEALING = 12,
TALK_SELL_WEAPONS = 13,
TALK_SELL_ARMOR = 14,
TALK_SELL_ITEMS = 15,
TALK_IDENTIFY = 16,
TALK_ENCHANT = 17,
TALK_BUY_INFO = 18,
TALK_BUY_SDF = 19,
TALK_BUY_SHIP = 20,
TALK_BUY_HORSE = 21,
TALK_BUY_SPEC_ITEM = 22,
TALK_BUY_JUNK = 23,
TALK_BUY_TOWN_LOC = 24,
TALK_END_FORCE = 25,
TALK_END_FIGHT = 26,
TALK_END_ALARM = 27, // Town hostile
TALK_END_DIE = 28,
TALK_CALL_TOWN_SPEC = 29,
TALK_CALL_SCEN_SPEC = 30,
enum class eTalkNode {
REGULAR = 0,
DEP_ON_SDF = 1,
SET_SDF = 2,
INN = 3,
DEP_ON_TIME = 4,
DEP_ON_TIME_AND_EVENT = 5,
DEP_ON_TOWN = 6,
BUY_ITEMS = 7,
TRAINING = 8,
BUY_MAGE = 9,
BUY_PRIEST = 10,
BUY_ALCHEMY = 11,
BUY_HEALING = 12,
SELL_WEAPONS = 13,
SELL_ARMOR = 14,
SELL_ITEMS = 15,
IDENTIFY = 16,
ENCHANT = 17,
BUY_INFO = 18,
BUY_SDF = 19,
BUY_SHIP = 20,
BUY_HORSE = 21,
BUY_SPEC_ITEM = 22,
BUY_JUNK = 23,
BUY_TOWN_LOC = 24,
END_FORCE = 25,
END_FIGHT = 26,
END_ALARM = 27, // Town hostile
END_DIE = 28,
CALL_TOWN_SPEC = 29,
CALL_SCEN_SPEC = 30,
};
enum eEncNoteType {

View File

@@ -20,7 +20,7 @@ void cSpeech::append(legacy::talking_record_type& old){
strlens[i] = old.strlens[i];
for(i = 0; i < 60; i++){
talk_nodes[i].personality = old.talk_nodes[i].personality;
talk_nodes[i].type = old.talk_nodes[i].type;
talk_nodes[i].type = eTalkNode(old.talk_nodes[i].type);
for(j = 0; j < 4; j++){
talk_nodes[i].link1[j] = old.talk_nodes[i].link1[j];
talk_nodes[i].link2[j] = old.talk_nodes[i].link2[j];

View File

@@ -26,7 +26,8 @@ class cSpeech { // formerly talking_record_type
public:
class cNode { // formerly talking_node_type
public:
short personality,type;
short personality;
eTalkNode type;
char link1[4],link2[4];
short extras[4];
std::string str1, str2;

View File

@@ -122,7 +122,7 @@ cTown::cTown(cScenario& scenario, bool init_strings) : scenario(scenario) {
strong_barriers = defy_scrying = defy_mapping = is_hidden = false;
for(i = 0; i < 60; i++) {
talking.talk_nodes[i].personality = -1;
talking.talk_nodes[i].type = 0;
talking.talk_nodes[i].type = eTalkNode::REGULAR;
talking.talk_nodes[i].extras[0] = 0;
talking.talk_nodes[i].extras[1] = 0;
talking.talk_nodes[i].extras[2] = 0;