From 6243ab28049ee815d5dad7cf996068f53639a578 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Tue, 4 Dec 2012 09:24:18 +0000
Subject: [PATCH] Buffed rare items

git-svn-id: http://svn.net-core.org/repos/t-engine4@5907 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Game.lua      |  8 +++-----
 game/modules/tome/class/GameState.lua |  2 +-
 game/modules/tome/class/NPC.lua       | 22 +++++++++++++---------
 3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index fe9e103aa6..3243b3191d 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -1253,11 +1253,9 @@ function _M:setupCommands()
 			end end
 		end end,
 		[{"_g","ctrl"}] = function() if config.settings.cheat then
-			local x, y = game.player.x + 5, game.player.y
-			--game.level.map:particleEmitter(game.player.x, game.player.y, math.max(math.abs(x-game.player.x), math.abs(y-game.player.y)), "lightning_beam", {tx=x-game.player.x, ty=y-game.player.y}, {type="lightning"})
-			game.level.map:particleEmitter(game.player.x, game.player.y, math.max(math.abs(-5), math.abs(y-game.player.y)), "lightning_beam", {tx=-5, ty=y-game.player.y}, {type="lightning"})
---			game.level.map:particleEmitter(game.player.x, game.player.y, 3, "lightning_shield", {radius=2}, {type="lightning"})
---			game.level.map:particleEmitter(game.player.x, game.player.y, math.max(math.abs(-5), math.abs(y-game.player.y)), "lightning_beam", {tx=-5, ty=y-game.player.y})
+			local o = game.zone:makeEntity(game.level,"object", {random_object=true}, nil, true)
+			o:identify(true)
+			if o then game.zone:addEntity(game.level, o, "object", game.player.x, game.player.y) end
 			
 do return end
 			local f, err = loadfile("/data/general/events/glowing-chest.lua")
diff --git a/game/modules/tome/class/GameState.lua b/game/modules/tome/class/GameState.lua
index 25b67014c0..919356aeb0 100644
--- a/game/modules/tome/class/GameState.lua
+++ b/game/modules/tome/class/GameState.lua
@@ -1231,7 +1231,7 @@ function _M:entityFilterPost(zone, level, type, e, filter)
 			e = game.state:generateRandart{
 				lev = lev,
 				egos = 0,
-				power_points_factor = data.power_points_factor or 3,
+				power_points_factor = data.power_points_factor or 7,
 				nb_powers_add = data.nb_powers_add or 1,
 				nb_themes = data.nb_themes or math.max(2, math.floor(lev / 20)),
 				force_themes = data.force_themes or nil,
diff --git a/game/modules/tome/class/NPC.lua b/game/modules/tome/class/NPC.lua
index 188dcb5dfe..4eebd253e5 100644
--- a/game/modules/tome/class/NPC.lua
+++ b/game/modules/tome/class/NPC.lua
@@ -336,15 +336,19 @@ end
 --- Call when added to a level
 -- Used to make escorts and such
 function _M:addedToLevel(level, x, y)
-	if game.difficulty == game.DIFFICULTY_NIGHTMARE and not game.party:hasMember(self) then
-		-- Increase talent level
-		for tid, lev in pairs(self.talents) do
-			self:learnTalent(tid, true, math.ceil(lev / 2))
-		end
-	elseif game.difficulty == game.DIFFICULTY_INSANE and not game.party:hasMember(self) then
-		-- Increase talent level
-		for tid, lev in pairs(self.talents) do
-			self:learnTalent(tid, true, lev)
+	if not self:attr("difficulty_boosted") then
+		if game.difficulty == game.DIFFICULTY_NIGHTMARE and not game.party:hasMember(self) then
+			-- Increase talent level
+			for tid, lev in pairs(self.talents) do
+				self:learnTalent(tid, true, math.ceil(lev / 2))
+			end
+			self:attr("difficulty_boosted", 1)
+		elseif game.difficulty == game.DIFFICULTY_INSANE and not game.party:hasMember(self) then
+			-- Increase talent level
+			for tid, lev in pairs(self.talents) do
+				self:learnTalent(tid, true, lev)
+			end
+			self:attr("difficulty_boosted", 1)
 		end
 	end
 
-- 
GitLab