From af8dbcb7da1a32b5fda2f80bfb2a866d5a4d9b23 Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Thu, 24 Sep 2015 14:56:30 +0200
Subject: [PATCH] explain, explain

---
 game/engines/default/engine/ai/talented.lua   | 2 +-
 game/modules/tome/class/Object.lua            | 1 +
 game/modules/tome/class/interface/Archery.lua | 6 +++++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/game/engines/default/engine/ai/talented.lua b/game/engines/default/engine/ai/talented.lua
index c82edbee7b..793988604d 100644
--- a/game/engines/default/engine/ai/talented.lua
+++ b/game/engines/default/engine/ai/talented.lua
@@ -62,7 +62,7 @@ newAI("dumb_talented_simple", function(self)
 		local used_talent
 		if (not self.ai_state.no_talents or self.ai_state.no_talents == 0) and rng.chance(self.ai_state.talent_in or 6) and self:reactionToward(self.ai_target.actor) < 0 then
 			used_talent = self:runAI("dumb_talented")
-			print("dumb ai used talent", used_talent)
+			-- print("dumb ai used talent", used_talent)
 		end
 		if not self.energy.used then
 			self:runAI(self.ai_state.ai_move or "move_simple")
diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua
index acb126084a..154c35adcf 100644
--- a/game/modules/tome/class/Object.lua
+++ b/game/modules/tome/class/Object.lua
@@ -536,6 +536,7 @@ function _M:getTextualDesc(compare_with, use_actor)
 	if self.material_level then desc:add(" ; tier ", tostring(self.material_level)) end
 	desc:add(true)
 	if self.slot_forbid == "OFFHAND" then desc:add("It must be held with both hands.", true) end
+	if self.double_weapon then desc:add("It can be used as a weapon and offhand.", true) end
 	desc:add(true)
 
 	if not self:isIdentified() then -- give limited information if the item is unidentified
diff --git a/game/modules/tome/class/interface/Archery.lua b/game/modules/tome/class/interface/Archery.lua
index fb8c012a50..c759554378 100644
--- a/game/modules/tome/class/interface/Archery.lua
+++ b/game/modules/tome/class/interface/Archery.lua
@@ -547,7 +547,7 @@ function _M:archeryShoot(targets, talent, tg, params)
 		game.logPlayer(self, "You are disarmed!")
 		return nil
 	end
-	print("[SHOOT WITH]", weapon.name, ammo.name)
+	print("[SHOOT WITH]", weapon.name, ammo.name, offweapon and offweapon.name)
 	local realweapon = weapon
 	weapon = weapon.combat
 	local realoffweapon = offweapon
@@ -612,6 +612,8 @@ function _M:hasArcheryWeapon(type)
 	if not self:getInven("QUIVER") then return nil, "no ammo" end
 	local weapon = self:getInven("MAINHAND")[1]
 	local offweapon = self:getInven("OFFHAND") and self:getInven("OFFHAND")[1]
+	if not offweapon and weapon and weapon.double_weapon then offweapon = weapon end
+
 	local ammo = self:getInven("QUIVER")[1]
 	if self.inven[self.INVEN_PSIONIC_FOCUS] then
 		local pf_weapon = self:getInven("PSIONIC_FOCUS")[1]
@@ -652,6 +654,8 @@ function _M:hasArcheryWeaponQS(type)
 	if not self:getInven("QS_QUIVER") then return nil, "no ammo" end
 	local weapon = self:getInven("QS_MAINHAND")[1]
 	local offweapon = self:getInven("QS_OFFHAND") and self:getInven("QS_OFFHAND")[1]
+	if not offweapon and weapon and weapon.double_weapon then offweapon = weapon end
+
 	local ammo = self:getInven("QS_QUIVER")[1]
 	if self.inven[self.INVEN_PSIONIC_FOCUS] then
 		local pf_weapon = self:getInven("QS_PSIONIC_FOCUS")[1]
-- 
GitLab