From d28b67e31283d6fd9af3f618f5ad6d4c81bbe783 Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Thu, 10 Nov 2016 00:27:19 +0100
Subject: [PATCH] multiplicity challenge ;)

---
 game/modules/tome/class/GameState.lua | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/game/modules/tome/class/GameState.lua b/game/modules/tome/class/GameState.lua
index 2edce48de4..6354cbfcc1 100644
--- a/game/modules/tome/class/GameState.lua
+++ b/game/modules/tome/class/GameState.lua
@@ -2481,6 +2481,7 @@ function _M:infiniteDungeonChallenge(zone, lev, data, id_layout_name, id_grids_n
 		{ id = "fast-exit", rarity = 3, min_lev = 8 },
 		{ id = "near-sighted", rarity = 3, min_lev = 4 },
 		{ id = "mirror-match", rarity = 9, min_lev = 5 },
+		{ id = "multiplicity", rarity = 8, min_lev = 10 },
 	}
 	
 	self:triggerHook{"InfiniteDungeon:getChallenges", challenges=challenges}
@@ -2693,6 +2694,21 @@ function _M:infiniteDungeonChallengeFinish(zone, level)
 			end)
 
 		end end, "Refuse", "Accept", true)
+	elseif id_challenge == "multiplicity" then
+		Dialog:yesnoPopup("Challenge: #PURPLE#Multiplicity", "Survive the level while all the foes have the multiply talent, even bosses, for a reward.", function(r) if not r then
+			self:makeChallengeQuest(level, "Multiplicity", "All foes have the multiply talent!", {
+				on_exit_check = function(self, who) who:setQuestStatus(self.id, self.COMPLETED) end,
+			})
+			game:onTickEnd(function()
+				local p = game:getPlayer(true)
+				for uid, e in pairs(game.level.entities) do
+					if p:reactionToward(e) < 0 and not game.party:hasMember(e) then
+						e:learnTalent(e.T_MULTIPLY, true)
+						e.can_multiply = 3
+					end
+				end
+			end)
+		end end, "Refuse", "Accept", true)
 	else
 		self:triggerHook{"InfiniteDungeon:setupChallenge", id_challenge=id_challenge, zone=zone, level=level}
 	end
-- 
GitLab