From 4167e92e9fdd96192e0dcf5b2e7815e55e5f061c Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Mon, 14 Feb 2011 16:55:34 +0000
Subject: [PATCH] Armour and Defense are shown into actor tooltips

git-svn-id: http://svn.net-core.org/repos/t-engine4@2727 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Actor.lua                   |  7 ++++---
 game/modules/tome/data/chats/jewelry-store.lua      |  6 +++---
 game/modules/tome/data/maps/towns/derth.lua         | 10 +++++-----
 game/modules/tome/data/zones/reknor-escape/zone.lua |  9 ---------
 game/modules/tome/data/zones/town-derth/grids.lua   |  6 ------
 5 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index d37b2b36ea..5892ea0b18 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -659,6 +659,7 @@ function _M:tooltip(x, y, seen_by)
 	ts:add({"color", 255, 0, 0}, ("HP: %d (%d%%)"):format(self.life, self.life * 100 / self.max_life), {"color", "WHITE"}, true)
 	ts:add(("Stats: %d / %d / %d / %d / %d / %d"):format(self:getStr(), self:getDex(), self:getMag(), self:getWil(), self:getCun(), self:getCon()), true)
 	ts:add("Resists: ", table.concat(resists, ','), true)
+	ts:add("Armour/Defense: ", tostring(math.floor(self:combatArmor())), ' / ', tostring(math.floor(self:combatDefense())), true)
 	ts:add("Size: ", {"color", "ANTIQUE_WHITE"}, self:TextSizeCategory(), {"color", "WHITE"}, true)
 	ts:add(self.desc, true)
 	ts:add("Faction: ") ts:merge(factcolor:toTString()) ts:add(("%s (%s, %d)"):format(Faction.factions[self.faction].name, factstate, factlevel), {"color", "WHITE"}, true)
@@ -724,7 +725,7 @@ function _M:onTakeHit(value, src)
 	if self:attr("invulnerable") then
 		return 0
 	end
-	
+
 	if self:attr("retribution") then
 	-- Absorb damage into the retribution
 		if value / 2 <= self.retribution_absorb then
@@ -855,13 +856,13 @@ function _M:onTakeHit(value, src)
 		t.absorb(self, t, self:isTalentActive(self.T_BONE_SHIELD))
 		value = 0
 	end
-	
+
 	if self:hasEffect(self.EFF_FORESIGHT) then
 		self:removeEffect(self.EFF_FORESIGHT)
 		game.logSeen(self, "%s avoids the attack.", self.name:capitalize())
 		value = 0
 	end
-	
+
 	if self:isTalentActive(self.T_DEFLECTION) then
 		local t = self:getTalentFromId(self.T_DEFLECTION)
 		value = t.do_onTakeHit(self, t, self:isTalentActive(self.T_DEFLECTION), value)
diff --git a/game/modules/tome/data/chats/jewelry-store.lua b/game/modules/tome/data/chats/jewelry-store.lua
index 25677f2da1..9b2149ac6d 100644
--- a/game/modules/tome/data/chats/jewelry-store.lua
+++ b/game/modules/tome/data/chats/jewelry-store.lua
@@ -19,7 +19,7 @@
 
 local imbue_ring = function(npc, player)
 	player:showInventory("Imbue which ring?", player:getInven("INVEN"), function(o) return o.type == "jewelry" and o.subtype == "ring" and not o.egoed and not o.unique end, function(ring, ring_item)
-		player:showInventory("Use which gem?", player:getInven("INVEN"), function(gem) return gem.type == "gem" and (gem.material_level or 99) <= ring.material_level end, function(gem, gem_item)
+		player:showInventory("Use which gem?", player:getInven("INVEN"), function(gem) return gem.type == "gem" and (gem.material_level or 99) <= ring.material_level and not gem.unique end, function(gem, gem_item)
 			local price = 10 + gem.material_level * 5 + ring.material_level * 7
 			if price > player.money then require("engine.ui.Dialog"):simplePopup("Not enough money", "This costs "..price.." gold, you need more gold.") return end
 
@@ -39,8 +39,8 @@ end
 
 local artifact_imbue_ring = function(npc, player)
 	player:showInventory("Imbue which ring?", player:getInven("INVEN"), function(o) return o.type == "jewelry" and o.subtype == "ring" and not o.egoed and not o.unique end, function(ring, ring_item)
-		player:showInventory("Use which first gem?", player:getInven("INVEN"), function(gem1) return gem1.type == "gem" and (gem1.material_level or 99) <= ring.material_level end, function(gem1, gem1_item)
-			player:showInventory("Use which second gem?", player:getInven("INVEN"), function(gem2) return gem2.type == "gem" and (gem2.material_level or 99) <= ring.material_level and gem1.name ~= gem2.name end, function(gem2, gem2_item)
+		player:showInventory("Use which first gem?", player:getInven("INVEN"), function(gem1) return gem1.type == "gem" and (gem1.material_level or 99) <= ring.material_level and not gem1.unique end, function(gem1, gem1_item)
+			player:showInventory("Use which second gem?", player:getInven("INVEN"), function(gem2) return gem2.type == "gem" and (gem2.material_level or 99) <= ring.material_level and gem1.name ~= gem2.name and not gem2.unique end, function(gem2, gem2_item)
 				local price = 390
 				if price > player.money then require("engine.ui.Dialog"):simplePopup("Not enough money", "Limmir needs more gold for the magical plating.") return end
 
diff --git a/game/modules/tome/data/maps/towns/derth.lua b/game/modules/tome/data/maps/towns/derth.lua
index 94adb32611..b0ff77eafd 100644
--- a/game/modules/tome/data/maps/towns/derth.lua
+++ b/game/modules/tome/data/maps/towns/derth.lua
@@ -95,10 +95,10 @@ tttttttt~~~t.....__....._t_.....___.....t~~ttttttt
 ttttttt~~~~t....__......___......_......t~~ttttttt
 ttttttt~~~~t..___........_......__......t~~ttttttt
 ttttttt~~~tt.__.........._......_.......t~~~tttttt
-ttttttt~~~t.._######....._......_.###...t~~~tttttt
-ttttttt~~~t.._######....._.####._.###...t~~~tttttt
-ttttttt~~~t.._######....._.####._.###...t~~~tttttt
-ttttttt~~~t.._####2#....___####._.###...t~~~tttttt
+ttttttt~~~t.._.#####....._......_.###...t~~~tttttt
+ttttttt~~~t.._.#####....._.####._.###...t~~~tttttt
+ttttttt~~~t.._.#####....._.####._.###...t~~~tttttt
+ttttttt~~~t.._.###2#....___####._.###...t~~~tttttt
 ttttttt~~~t.._______..___._.._.._.###...t~~~tttttt
 ttttttt~~~t......._..__..._______.###..tt~~~tttttt
 ttttttt~~~tt......_.._.........._.._...t~~~ttttttt
@@ -117,4 +117,4 @@ tttttttttttttttttttttttttttttttttttttttttttttttttt
 tttttttttttttttttttttttttttttttttttttttttttttttttt
 tttttttttttttttttttttttttttttttttttttttttttttttttt
 tttttttttttttttttttttttttttttttttttttttttttttttttt
-tttttttttttttttttttttttttttttttttttttttttttttttttt]]
+tttttttttttttttttttttttttttttttttttttttttttttttttt]]
\ No newline at end of file
diff --git a/game/modules/tome/data/zones/reknor-escape/zone.lua b/game/modules/tome/data/zones/reknor-escape/zone.lua
index 7c739855de..02a5168ff6 100644
--- a/game/modules/tome/data/zones/reknor-escape/zone.lua
+++ b/game/modules/tome/data/zones/reknor-escape/zone.lua
@@ -79,15 +79,6 @@ return {
 		end
 	end,
 
-	on_turn = function(self)
-		if not game.level.turn_counter then return end
-		game.level.turn_counter = game.level.turn_counter - 1
-		game.player.changed = true
-		if game.level.turn_counter < 0 then
-			game.level.turn_counter = nil
-			game.player:hasQuest("master-jeweler"):ritual_end()
-		end
-	end,
 	on_leave = function(lev, old_lev, newzone)
 		if not newzone then return end
 
diff --git a/game/modules/tome/data/zones/town-derth/grids.lua b/game/modules/tome/data/zones/town-derth/grids.lua
index 845717ece4..65e44e66dd 100644
--- a/game/modules/tome/data/zones/town-derth/grids.lua
+++ b/game/modules/tome/data/zones/town-derth/grids.lua
@@ -30,9 +30,3 @@ newEntity{ base = "FLOOR", define_as = "COBBLESTONE",
 	name="cobblestone road",
 	display='.', image="terrain/stone_road1.png"
 }
-
-newEntity{ base = "FLOOR", define_as = "ROCK",
-	name="magical rock",
-	image="terrain/grass.png", add_displays = {class.new{image="terrain/maze_rock.png"}},
-	does_block_move = true
-}
-- 
GitLab