aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-03-04 08:47:03 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-03-04 08:47:03 -0500
commit0a06697db87063b77b71388278933807899568ef (patch)
treebb8d876e266761c7aac8656c2d75793855826bd0 /src/entities.cpp
parent5fadac5d0f37f574ca160107d832d11b421ad559 (diff)
parent30dd8efe8d71648bea7604ebee5afc4d55b25a6b (diff)
merge
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){