From a9b7b0463056e23b0bcd229876e7d4285e2b5f5e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 26 Jan 2016 17:43:10 +0100 Subject: WAGE: Implement tryAttack() --- engines/wage/combat.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/wage/combat.cpp b/engines/wage/combat.cpp index 4a043311b8..d1f5d2639c 100644 --- a/engines/wage/combat.cpp +++ b/engines/wage/combat.cpp @@ -743,9 +743,14 @@ bool WageEngine::handleOfferCommand(const char *target) { } bool WageEngine::tryAttack(Obj *weapon, Common::String &input) { - warning("STUB: tryAttack"); - - return false; + Common::String w(weapon->_name); + w.toLowercase(); + Common::String i(input); + i.toLowercase(); + Common::String v(weapon->_operativeVerb); + v.toLowercase(); + + return i.contains(w) && i.contains(v); } bool WageEngine::handleAttack(Obj *weapon) { -- cgit v1.2.3