From ff6eca6c0eff47ecd984f54d89a4d91188e98795 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Mon, 11 Feb 2013 16:12:44 +0000
Subject: [PATCH] Phase Door Rune now also grants a buff that increases
 defense, resist all and reduces status effects duration

git-svn-id: http://svn.net-core.org/repos/t-engine4@6397 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/data/birth/races/construct.lua    |  2 +-
 game/modules/tome/data/birth/races/elf.lua          |  2 +-
 game/modules/tome/data/birth/races/undead.lua       |  2 +-
 game/modules/tome/data/general/objects/scrolls.lua  |  2 ++
 .../modules/tome/data/talents/misc/inscriptions.lua | 13 +++++++++++--
 5 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/game/modules/tome/data/birth/races/construct.lua b/game/modules/tome/data/birth/races/construct.lua
index 507f84dafa..29d4034e3d 100644
--- a/game/modules/tome/data/birth/races/construct.lua
+++ b/game/modules/tome/data/birth/races/construct.lua
@@ -95,7 +95,7 @@ newBirthDescriptor
 		inscription_restrictions = { ["inscriptions/runes"] = true, },
 		resolvers.inscription("RUNE:_MANASURGE", {cooldown=25, dur=10, mana=620}),
 		resolvers.inscription("RUNE:_SHIELDING", {cooldown=14, dur=5, power=100}),
-		resolvers.inscription("RUNE:_PHASE_DOOR", {cooldown=7, range=10}),
+		resolvers.inscription("RUNE:_PHASE_DOOR", {cooldown=7, range=10, dur=5, power=15}),
 
 		type = "construct", subtype="golem", image = "npc/alchemist_golem.png",
 		starting_intro = "ghoul",
diff --git a/game/modules/tome/data/birth/races/elf.lua b/game/modules/tome/data/birth/races/elf.lua
index 5e3c922cfb..59b540a239 100644
--- a/game/modules/tome/data/birth/races/elf.lua
+++ b/game/modules/tome/data/birth/races/elf.lua
@@ -94,7 +94,7 @@ newBirthDescriptor
 		starting_intro = "shalore",
 		life_rating = 9,
 		resolvers.inscription("RUNE:_SHIELDING", {cooldown=14, dur=5, power=100}),
-		resolvers.inscription("RUNE:_PHASE_DOOR", {cooldown=7, range=10}),
+		resolvers.inscription("RUNE:_PHASE_DOOR", {cooldown=7, range=10, dur=5, power=15}),
 	},
 	experience = 1.35,
 	random_escort_possibilities = { {"tier1.1", 1, 2}, {"tier1.2", 1, 2}, {"daikara", 1, 2}, {"old-forest", 1, 4}, {"dreadfell", 1, 8}, {"reknor", 1, 2}, },
diff --git a/game/modules/tome/data/birth/races/undead.lua b/game/modules/tome/data/birth/races/undead.lua
index 1e3341000a..bf29913eaf 100644
--- a/game/modules/tome/data/birth/races/undead.lua
+++ b/game/modules/tome/data/birth/races/undead.lua
@@ -63,7 +63,7 @@ newBirthDescriptor{
 		forbid_nature = 1,
 		inscription_restrictions = { ["inscriptions/runes"] = true, ["inscriptions/taints"] = true, },
 		resolvers.inscription("RUNE:_SHIELDING", {cooldown=14, dur=5, power=100}),
-		resolvers.inscription("RUNE:_PHASE_DOOR", {cooldown=7, range=10}),
+		resolvers.inscription("RUNE:_PHASE_DOOR", {cooldown=7, range=10, dur=5, power=15}),
 	},
 	random_escort_possibilities = { {"tier1.1", 1, 2}, {"tier1.2", 1, 2}, {"daikara", 1, 2}, {"old-forest", 1, 4}, {"dreadfell", 1, 8}, {"reknor", 1, 2}, },
 }
diff --git a/game/modules/tome/data/general/objects/scrolls.lua b/game/modules/tome/data/general/objects/scrolls.lua
index 546afa9372..038a9b1114 100644
--- a/game/modules/tome/data/general/objects/scrolls.lua
+++ b/game/modules/tome/data/general/objects/scrolls.lua
@@ -266,6 +266,8 @@ newEntity{ base = "BASE_RUNE",
 	inscription_kind = "teleport",
 	inscription_data = {
 		cooldown = resolvers.rngrange(8, 10),
+		dur = resolvers.mbonus_level(5, 3),
+		power = resolvers.mbonus_level(30, 15, function(e, v) return v * 1 end),
 		range = resolvers.mbonus_level(10, 5, function(e, v) return v * 1 end),
 		use_stat_mod = 0.07,
 	},
diff --git a/game/modules/tome/data/talents/misc/inscriptions.lua b/game/modules/tome/data/talents/misc/inscriptions.lua
index a628972607..e8db3b6df5 100644
--- a/game/modules/tome/data/talents/misc/inscriptions.lua
+++ b/game/modules/tome/data/talents/misc/inscriptions.lua
@@ -339,15 +339,24 @@ newInscription{
 		game.level.map:particleEmitter(self.x, self.y, 1, "teleport")
 		self:teleportRandom(self.x, self.y, data.range + data.inc_stat)
 		game.level.map:particleEmitter(self.x, self.y, 1, "teleport")
+		self:setEffect(self.EFF_OUT_OF_PHASE, data.dur or 3, {
+			defense=(data.power or data.range) + data.inc_stat * 3,
+			resists=(data.power or data.range) + data.inc_stat * 3,
+			effect_reduction=(data.power or data.range) + data.inc_stat * 3,
+		})
 		return true
 	end,
 	info = function(self, t)
 		local data = self:getInscriptionData(t.short_name)
-		return ([[Activate the rune to teleport randomly in a range of %d.]]):format(data.range + data.inc_stat)
+		local power = (data.power or data.range) + data.inc_stat * 3
+		return ([[Activate the rune to teleport randomly in a range of %d.
+		Afterwards you stay out of phase for %d turns. In this state all new negative status effects duration is reduced by %d%%, your defense is increased by %d and all your resistances by %d%%.]]):
+		format(data.range + data.inc_stat, data.dur or 3, power, power, power)
 	end,
 	short_info = function(self, t)
 		local data = self:getInscriptionData(t.short_name)
-		return ([[range %d]]):format(data.range + data.inc_stat)
+		local power = (data.power or data.range) + data.inc_stat * 3
+		return ([[range %d; power %d; dur %d]]):format(data.range + data.inc_stat, power, data.dur or 3)
 	end,
 }
 
-- 
GitLab