aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/entities.cpp')
-rw-r--r--src/entities.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/entities.cpp b/src/entities.cpp
index 73105f1..329af63 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -166,6 +166,8 @@ Merchant::Merchant(){ //sets all of the Merchant specific traits on object creat
maxHealth = health = 100;
canMove = true;
+
+ trade.reserve(100);
//tex = new Texturec(1,"assets/NPC.png");
//inv = new Inventory(NPC_INV_SIZE);
@@ -447,9 +449,15 @@ void NPC::interact(){ //have the npc's interact back to the player
}
void Merchant::interact(){
- ui::merchantBox(name, &bsinv, ":Accept:Good-Bye", false, "Welcome to Smithy\'s. Buy your sausages here you freaking meme lording screw-face");
- //ui::merchantBox();
+ ui::merchantBox(name, trade.back(), ":Accept:Good-Bye", false, "Welcome to Smithy\'s. Buy your sausages here you freaking meme lording screw-face");
ui::waitForDialog();
+ if(ui::dialogOptChosen == 1){
+ std::cout << "Gimme ye' munny" << std::endl;
+ if(player->inv->takeItem(trade.back().item[1],trade.back().quantity[1]) >= 0)
+ player->inv->addItem(trade.back().item[0],trade.back().quantity[0]);
+ }else{
+ std::cout << "See ye!" << std::endl;
+ }
}
void Object::interact(void){