From cc062ce601c90bda0b791241da8fd399c58ccdde Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Mon, 20 May 2013 23:42:17 +0000
Subject: [PATCH] plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@6764 51575b47-30f0-44d4-a5cc-537603b46e54
---
 .../engines/default/engine/interface/ActorTalents.lua |  1 +
 game/modules/tome/class/Game.lua                      |  2 ++
 game/modules/tome/class/interface/Archery.lua         | 11 +++++++----
 game/modules/tome/class/interface/Combat.lua          | 10 ++++++++++
 4 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/game/engines/default/engine/interface/ActorTalents.lua b/game/engines/default/engine/interface/ActorTalents.lua
index 41049e62e7..43fa723015 100644
--- a/game/engines/default/engine/interface/ActorTalents.lua
+++ b/game/engines/default/engine/interface/ActorTalents.lua
@@ -247,6 +247,7 @@ function _M:useTalentMessage(ab)
 	str = str:gsub("@source@", self.name)
 	str = str:gsub("@target@", tname)
 	str = str:gsub("@Target@", tname:capitalize())
+	str = str:gsub("@hisher@", string.his_her(self))
 	return str
 end
 
diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index 5e118f69ec..efe5bf6d7a 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -1296,6 +1296,8 @@ function _M:setupCommands()
 			print("===============")
 		end end,
 		[{"_g","ctrl"}] = function() if config.settings.cheat then
+			game.level.map:particleEmitter(game.player.x, game.player.y, 1, "burning-steam", {})
+do return end
 			local f, err = loadfile("/data/general/events/crystaline-forest.lua")
 			print(f, err)
 			setfenv(f, setmetatable({level=self.level, zone=self.zone}, {__index=_G}))
diff --git a/game/modules/tome/class/interface/Archery.lua b/game/modules/tome/class/interface/Archery.lua
index ea899c67fe..4948d0b99a 100644
--- a/game/modules/tome/class/interface/Archery.lua
+++ b/game/modules/tome/class/interface/Archery.lua
@@ -35,7 +35,10 @@ function _M:archeryAcquireTargets(tg, params)
 		game.logPlayer(self, "You must wield a bow or a sling (%s)!", ammo)
 		return nil
 	end
-	if not ammo or (ammo.combat.shots_left <= 0 and not ammo.infinite) then
+
+	local infinite = ammo.infinite or self:attr("infinite_ammo")
+
+	if not ammo or (ammo.combat.shots_left <= 0 and not infinite) then
 		game.logPlayer(self, "You do not have enough ammo left!")
 		return nil
 	end
@@ -75,7 +78,7 @@ function _M:archeryAcquireTargets(tg, params)
 	local runfire = function(weapon, targets)
 		if params.one_shot then
 			local a = ammo
-			if not ammo.infinite and ammo.combat.shots_left > 0 then
+			if not infinite and ammo.combat.shots_left > 0 then
 				ammo.combat.shots_left = ammo.combat.shots_left - 1
 			end
 			if a then
@@ -102,7 +105,7 @@ function _M:archeryAcquireTargets(tg, params)
 
 				for i = 1, params.multishots or 1 do
 					local a = ammo
-					if not ammo.infinite then
+					if not infinite then
 						if ammo.combat.shots_left > 0 then ammo.combat.shots_left = ammo.combat.shots_left - 1
 						else break
 						end
@@ -147,7 +150,7 @@ function _M:archeryAcquireTargets(tg, params)
 
 		if sound then game:playSoundNear(self, sound) end
 
---		if not ammo.infinite and (ammo.combat.shots_left < 10 or ammo:getNumber() == 50 or ammo:getNumber() == 40 or ammo:getNumber() == 25) then
+--		if not infinite and (ammo.combat.shots_left < 10 or ammo:getNumber() == 50 or ammo:getNumber() == 40 or ammo:getNumber() == 25) then
 --			game.logPlayer(self, "You only have %s left!", ammo:getName{do_color=true})
 --		end
 
diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua
index 08f4331ff3..b55bc09cbc 100644
--- a/game/modules/tome/class/interface/Combat.lua
+++ b/game/modules/tome/class/interface/Combat.lua
@@ -1818,6 +1818,16 @@ function _M:hasMassiveArmor()
 	return armor
 end
 
+--- Check if the actor has a cloak
+function _M:hasCloak()
+	if not self:getInven("CLOAK") then return end
+	local cloak = self:getInven("CLOAK")[1]
+	if not cloak then
+		return nil
+	end
+	return cloak
+end
+
 -- Unarmed Combat; this handles grapple checks and building combo points
 -- Builds Comob; reduces the cooldown on all unarmed abilities on cooldown by one
 function _M:buildCombo()
-- 
GitLab