Add in branching flag logic.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 1355943754
commit f77b7f3cf2
  1. BIN
      C++ProjectTemplate
  2. 2
      flags.h
  3. 1
      main.cpp
  4. 10
      object.h

Binary file not shown.

@ -14,6 +14,8 @@ enum class Flag:int{
HAS_ANNA,
HAS_KING,
HAS_POO,
SHOPKEER_BRANCH1,
SHOPKEER_BRANCH2,
};

@ -1275,6 +1275,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
} else {
DisplayMessageBox("No problem here.");
}
GAME_FLAGS[(int)interaction.flag]=true;
CLOSE_OVERWORLD_WINDOW=true;
}
}break;

@ -181,6 +181,7 @@ class TrashCan_Obj : public Object{
};
extern int MESSAGE_BOX_DIALOG_ANSWER;
extern bool GAME_FLAGS[128];
class Shopkeeper_Obj : public Object{
DynamicObject(Shopkeeper_Obj)
@ -190,11 +191,14 @@ class Shopkeeper_Obj : public Object{
>1:What would you like to sell?\
>2:Are you okay?<";
Interaction Interact()override{
if (MESSAGE_BOX_DIALOG_ANSWER==2) {
if (GAME_FLAGS[(int)Flag::SHOPKEER_BRANCH1]&&MESSAGE_BOX_DIALOG_ANSWER==2) {
MESSAGE_BOX_DIALOG_ANSWER=0;
return {{"No! Stay away!"}};
GAME_FLAGS[(int)Flag::SHOPKEER_BRANCH1]=false;
return {{"No! Stay away! [Okay,Ignore]\
>0:Yeah I thought so.\
>1:...<"}};
} else {
return {{welcomeMessage}};
return {{welcomeMessage},flag:Flag::SHOPKEER_BRANCH1};
}
}
};

Loading…
Cancel
Save