Skip to content

Commit

Permalink
WAGE: Implement handleOfferCommand()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Feb 14, 2016
1 parent a9b7b04 commit 45afdbb
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion engines/wage/combat.cpp
Expand Up @@ -737,7 +737,31 @@ void WageEngine::wearObj(Obj *o, int pos) {


bool WageEngine::handleOfferCommand(const char *target) {
warning("STUB: handleOfferCommand");
Chr *player = _world->_player;
Chr *enemy = getMonster();

if (enemy != NULL) {
Common::String t(target);
t.toLowercase();

for (ObjArray::const_iterator it = player->_inventory.begin(); it != player->_inventory.end(); ++it) {
Common::String n((*it)->_name);
n.toLowercase();

if (t.contains(n)) {
if ((*it)->_value < enemy->_rejectsOffers) {
appendText("Your offer is rejected.");
} else {
appendText("Your offer is accepted.");
appendText(enemy->_acceptsOfferComment.c_str());
_world->move(*it, enemy);
_world->move(enemy, _world->_storageScene);
}

return true;
}
}
}

return false;
}
Expand Down

0 comments on commit 45afdbb

Please sign in to comment.