From dfe4a9da2f3c72a89535b33b7a0b3153be1a490a Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sun, 25 Mar 2012 21:35:21 +0000
Subject: [PATCH] Doomed cunning at birth now matches the description
 Mindslayers have one more cunning at birth (bringing total bonuses in line
 with other classes) Mindslayer knockback abilities can no longer hit twice
 Fixed many mindslayer talent descriptions (they scale off mindpower)
 Mindslayer gem bonuses now apply to mindstars as well Greater telekenetic
 grasp now applies it's level five bonus at talent levels beyond 5 (only
 matters in the Infinite Dungeon) Mindslayer auras now scale better at higher
 levels, deal less spike damage at low levels, have a cooldown of 10, and cost
 less psi to spike

git-svn-id: http://svn.net-core.org/repos/t-engine4@4998 51575b47-30f0-44d4-a5cc-537603b46e54
---
 .../tome/data/birth/classes/afflicted.lua     |  2 +-
 .../tome/data/birth/classes/psionic.lua       |  4 +--
 game/modules/tome/data/damage_types.lua       | 19 +------------
 .../tome/data/talents/psionic/absorption.lua  |  6 ++--
 .../talents/psionic/augmented-mobility.lua    |  4 +--
 .../tome/data/talents/psionic/focus.lua       |  8 +++---
 .../tome/data/talents/psionic/grip.lua        |  6 ++--
 .../tome/data/talents/psionic/projection.lua  | 28 +++++++++----------
 .../tome/data/talents/psionic/psionic.lua     |  4 +--
 9 files changed, 32 insertions(+), 49 deletions(-)

diff --git a/game/modules/tome/data/birth/classes/afflicted.lua b/game/modules/tome/data/birth/classes/afflicted.lua
index 4760f023a9..c4b921b7a5 100644
--- a/game/modules/tome/data/birth/classes/afflicted.lua
+++ b/game/modules/tome/data/birth/classes/afflicted.lua
@@ -104,7 +104,7 @@ newBirthDescriptor{
 		"#LIGHT_BLUE# * +0 Strength, +0 Dexterity, +0 Constitution",
 		"#LIGHT_BLUE# * +0 Magic, +4 Willpower, +5 Cunning",
 	},
-	stats = { wil=4, cun=4, },
+	stats = { wil=4, cun=5, },
 	talents_types = {
 		["cursed/dark-sustenance"]={true, 0.3},
 		["cursed/force-of-will"]={true, 0.3},
diff --git a/game/modules/tome/data/birth/classes/psionic.lua b/game/modules/tome/data/birth/classes/psionic.lua
index 136a876553..c1d97456d6 100644
--- a/game/modules/tome/data/birth/classes/psionic.lua
+++ b/game/modules/tome/data/birth/classes/psionic.lua
@@ -50,9 +50,9 @@ newBirthDescriptor{
 		"Their most important stats are: Willpower and Cunning",
 		"#GOLD#Stat modifiers:",
 		"#LIGHT_BLUE# * +1 Strength, +0 Dexterity, +0 Constitution",
-		"#LIGHT_BLUE# * +0 Magic, +4 Willpower, +3 Cunning",
+		"#LIGHT_BLUE# * +0 Magic, +4 Willpower, +4 Cunning",
 	},
-	stats = { str=1, wil=4, cun=3, },
+	stats = { str=1, wil=4, cun=4, },
 	talents_types = {
 		--Level 0 trees:
 		["psionic/absorption"]={true, 0.3},
diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua
index b231182b3b..4f031eeb54 100644
--- a/game/modules/tome/data/damage_types.lua
+++ b/game/modules/tome/data/damage_types.lua
@@ -1460,7 +1460,7 @@ newDamageType{
 		if target and target:attr("never_move") then
 			dam = dam * 1.5
 		end
-		DamageType:get(DamageType.PHYSICAL).projector(src, x, y, DamageType.PHYSICAL, dam)
+		DamageType:get(DamageType.PHYSICAL).projector(src, x, y, DamageType.PHYSICAL, dam) -- This damage type can deal damage multiple times, use with accordingly
 		-- check knockback
 		if target and not target:attr("never_move") and not tmp[target] then
 			tmp[target] = true
@@ -1560,23 +1560,6 @@ newDamageType{
 	end,
 }
 
-newDamageType{
-	name = "batter", type = "BATTER",
-	projector = function(src, x, y, type, dam)
-		DamageType:get(DamageType.PHYSICAL).projector(src, x, y, DamageType.PHYSICAL, dam)
-		local target = game.level.map(x, y, Map.ACTOR)
-		if target then
-			if target:canBe("knockback") then
-				target:knockback(src.x, src.y, 3)
-				target:crossTierEffect(target.EFF_OFFBALANCE, src:combatMindpower())
-				game.logSeen(target, "%s is knocked back!", target.name:capitalize())
-			else
-				game.logSeen(target, "%s resists the knockback!", target.name:capitalize())
-			end
-		end
-	end,
-}
-
 newDamageType{
 	name = "mindslow", type = "MINDSLOW",
 	projector = function(src, x, y, type, dam)
diff --git a/game/modules/tome/data/talents/psionic/absorption.lua b/game/modules/tome/data/talents/psionic/absorption.lua
index 8cd6f65ec4..bce4eac4f4 100644
--- a/game/modules/tome/data/talents/psionic/absorption.lua
+++ b/game/modules/tome/data/talents/psionic/absorption.lua
@@ -131,7 +131,7 @@ newTalent{
 		local absorb = 100*getEfficiency(self,t)
 		return ([[Surround yourself with a shield that will absorb %d%% of any physical or acidic attack, up to a maximum of %d damage per attack. Deactivating the shield spikes it up to a temporary (five turns) %d point shield.
 		Every time your shield absorbs damage, you gain two points of energy plus an additional point for every %d points of damage absorbed. Spiked shields absorb energy more efficiently.
-		These values scale with Willpower and Cunning.]]):
+		These values scale with your Mindpower.]]):
 		format(absorb, s_str, spike_str, mast)
 	end,
 }
@@ -234,7 +234,7 @@ newTalent{
 		local absorb = 100*getEfficiency(self,t)
 		return ([[Surround yourself with a shield that will absorb %d%% of any fire or cold attack, up to a maximum of %d damage per attack. Deactivating the shield spikes it up to a temporary (five turns) %d point shield.
 		Every time your shield absorbs damage, you gain two points of energy plus an additional point for every %d points of damage absorbed. Spiked shields absorb energy more efficiently.
-		These values scale with Willpower and Cunning.]]):
+		These values scale with your Mindpower.]]):
 		format(absorb, s_str, spike_str, mast)
 	end,
 }
@@ -333,7 +333,7 @@ newTalent{
 		local absorb = 100*getEfficiency(self,t)
 		return ([[Surround yourself with a shield that will absorb %d%% of any lightning or blight attack, up to a maximum of %d damage per attack. Deactivating the shield spikes it up to a temporary (five turns) %d point shield.
 		Every time your shield absorbs damage, you gain two points of energy plus an additional point for every %d points of damage absorbed. Spiked shields absorb energy more efficiently.
-		These values scale with Willpower and Cunning.]]):
+		These values scale with your Mindpower.]]):
 		format(absorb, s_str, spike_str, mast)
 	end,
 }
diff --git a/game/modules/tome/data/talents/psionic/augmented-mobility.lua b/game/modules/tome/data/talents/psionic/augmented-mobility.lua
index d75a5445a2..e09979c68e 100644
--- a/game/modules/tome/data/talents/psionic/augmented-mobility.lua
+++ b/game/modules/tome/data/talents/psionic/augmented-mobility.lua
@@ -160,7 +160,7 @@ newTalent{
 					self:forceUseTalent(self.T_KINETIC_SHIELD, {ignore_energy=true})
 				end
 				local dam = self:spellCrit(self:combatTalentMindDamage(t, 20, 600))
-				self:project(tg, x, y, DamageType.BATTER, self:spellCrit(rng.avg(2*dam/3, dam, 3)))
+				self:project(tg, x, y, DamageType.MINDKNOCKBACK, self:spellCrit(rng.avg(2*dam/3, dam, 3)))
 				--local _ _, x, y = self:canProject(tg, x, y)
 				game.level.map:particleEmitter(self.x, self.y, tg.radius, "flamebeam", {tx=x-self.x, ty=y-self.y})
 				game:playSoundNear(self, "talents/lightning")
@@ -188,7 +188,7 @@ newTalent{
 			for i = 1, self:getTalentRange(t) do
 				self:project(tg, x, y, DamageType.DIG, 1)
 			end
-			self:project(tg, x, y, DamageType.BATTER, self:spellCrit(rng.avg(2*dam/3, dam, 3)))
+			self:project(tg, x, y, DamageType.MINDKNOCKBACK, self:spellCrit(rng.avg(2*dam/3, dam, 3)))
 			local _ _, x, y = self:canProject(tg, x, y)
 			game.level.map:particleEmitter(self.x, self.y, tg.radius, "flamebeam", {tx=x-self.x, ty=y-self.y})
 			game:playSoundNear(self, "talents/lightning")
diff --git a/game/modules/tome/data/talents/psionic/focus.lua b/game/modules/tome/data/talents/psionic/focus.lua
index 3c1efa96ff..cbce8cc066 100644
--- a/game/modules/tome/data/talents/psionic/focus.lua
+++ b/game/modules/tome/data/talents/psionic/focus.lua
@@ -100,7 +100,7 @@ newTalent{
 	info = function(self, t)
 		local dam = t.getDamage(self, t)
 		return ([[Focus energies on a distant target to lash it with physical force, doing %d damage as well as any Conduit damage.
-		Mindslayers do not do this sort of ranged attack naturally. The use of a telekinetically-wielded gem as a focus will improve the effects considerably.]]):
+		Mindslayers do not do this sort of ranged attack naturally. The use of a telekinetically-wielded gem or mindstar as a focus will improve the effects considerably.]]):
 		format(dam)
 	end,
 }
@@ -143,7 +143,7 @@ newTalent{
 		local radius = self:getTalentRadius(t)
 		local dam = t.getDamage(self, t)
 		return ([[Focus energies on all foes within %d squares, setting them ablaze. Does %d damage over ten turns.
-		Mindslayers do not do this sort of ranged attack naturally. The use of a telekinetically-wielded gem as a focus will improve the effects considerably.]]):
+		Mindslayers do not do this sort of ranged attack naturally. The use of a telekinetically-wielded gem or mindstar as a focus will improve the effects considerably.]]):
 		format(radius, dam)
 	end,
 }
@@ -156,7 +156,7 @@ newTalent{
 	points = 5,
 	info = function(self, t)
 		local inc = 2*self:getTalentLevel(t)
-		return ([[You can extend your mental reach beyond your natural limits using a telekinetically-wielded gemstone as a focus. Increases the range of various abilities by %d%% to %d%%, depending on the quality of the gem used as a focus.]]):
+		return ([[You can extend your mental reach beyond your natural limits using a telekinetically-wielded gemstone or mindstar as a focus. Increases the range of various abilities by %d%% to %d%%, depending on the quality of the gem used as a focus.]]):
 		format(inc, 5*inc)
 	end,
 }
@@ -169,7 +169,7 @@ newTalent{
 	points = 5,
 	info = function(self, t)
 		local inc = 1 + 0.15*self:getTalentLevel(t)
-		return ([[You can channel more energy with your auras and shields using a telekinetically-wielded gemstone as a focus. Increases the base strength of all auras and shields by %0.2f to %0.2f, depending on the quality of the gem used as a focus.]]):
+		return ([[You can channel more energy with your auras and shields using a telekinetically-wielded gemstone or mindstar as a focus. Increases the base strength of all auras and shields by %0.2f to %0.2f, depending on the quality of the gem or mindstar used as a focus.]]):
 		format(inc, 5*inc)
 	end,
 }
diff --git a/game/modules/tome/data/talents/psionic/grip.lua b/game/modules/tome/data/talents/psionic/grip.lua
index abf8b499d2..2dac467162 100644
--- a/game/modules/tome/data/talents/psionic/grip.lua
+++ b/game/modules/tome/data/talents/psionic/grip.lua
@@ -93,7 +93,7 @@ newTalent{
 	info = function(self, t)
 		local dur = t.getDuration(self, t)
 		return ([[Bind the target in crushing bands of telekinetic force, immobilizing it for %d turns.
-		The use of a telekinetically-wielded gem as a focus will improve the effects of this talent considerably.]]):
+		The use of a telekinetically-wielded gem or mindstar as a focus will improve the effects of this talent considerably.]]):
 		format(dur)
 	end,
 }
@@ -143,7 +143,7 @@ newTalent{
 		local dur = t.getDuration(self, t)
 		local dam = t.getDamage(self, t)
 		return ([[Crush the target mercilessly with constant, bone-shattering pressure, slowing it by 50%% for %d turns and dealing %d damage each turn.
-		The use of a telekinetically-wielded gem as a focus will improve the effects of this talent considerably.]]):
+		The use of a telekinetically-wielded gem or mindstar as a focus will improve the effects of this talent considerably.]]):
 		format(dur, dam)
 	end,
 }
@@ -170,7 +170,7 @@ newTalent{
 		return ([[Use finely controlled forces to augment both your flesh-and-blood grip and your telekinetic grip. This does the following:
 		Increases disarm immunity by %d%%.
 		Allows %d%% of willpower and cunning (instead of the usual 60%%) to be substituted for strength and dexterity for the purposes of determining damage done by telekinetically-wielded weapons.
-		At talent level 5, telekinetically wielded gems will be treated as one material level higher than they actually are.
+		At talent level 5, telekinetically wielded gems and mindstars will be treated as one material level higher than they actually are.
 		]]):
 		format(self:getTalentLevelRaw(t)*20, boost)
 	end,
diff --git a/game/modules/tome/data/talents/psionic/projection.lua b/game/modules/tome/data/talents/psionic/projection.lua
index a52533720e..8f46ef5099 100644
--- a/game/modules/tome/data/talents/psionic/projection.lua
+++ b/game/modules/tome/data/talents/psionic/projection.lua
@@ -21,11 +21,11 @@ local function aura_strength(self, t)
 	if self:knowTalent(self.T_FOCUSED_CHANNELING) then
 		add = getGemLevel(self)*(1 + 0.1*(self:getTalentLevel(self.T_FOCUSED_CHANNELING) or 0))
 	end
-	return self:combatStatTalentIntervalDamage(t, "combatMindpower", 10, 40) + add
+	return self:combatTalentMindDamage(t, 10, 50) + add
 end
 
 local function aura_spike_strength(self, t)
-	return (40 + 10*self:getTalentLevel(t))*math.sqrt(aura_strength(self, t))
+	return aura_strength(self, t) * 10
 end
 
 local function aura_mastery(self, t)
@@ -77,7 +77,7 @@ newTalent{
 	sustain_psi = 30,
 	remove_on_zero = true,
 	cooldown = function(self, t)
-		return 15 - (self:getTalentLevelRaw(self.T_AURA_DISCIPLINE) or 0)
+		return 10 - (self:getTalentLevelRaw(self.T_AURA_DISCIPLINE) or 0)
 	end,
 	tactical = { ATTACKAREA = { PHYSICAL = 2 } },
 	on_pre_use = function(self, t, silent)
@@ -122,7 +122,7 @@ newTalent{
 		end
 	end,
 	getSpikeCost = function(self, t)
-		return t.sustain_psi - 2*getGemLevel(self)
+		return t.sustain_psi/2 - 2*getGemLevel(self)
 	end,
 	getAuraStrength = function(self, t)
 		return aura_strength(self, t)
@@ -167,7 +167,7 @@ newTalent{
 		local actor = game.level.map(x, y, Map.ACTOR)
 		--if core.fov.distance(self.x, self.y, x, y) == 1 and not actor then return true end
 		if core.fov.distance(self.x, self.y, x, y) == 0 then return true end
-		self:project(tg, x, y, DamageType.BATTER, self:spellCrit(rng.avg(0.8*dam, dam)))
+		self:project(tg, x, y, DamageType.MINDKNOCKBACK, self:mindCrit(rng.avg(0.8*dam, dam)))
 		local _ _, x, y = self:canProject(tg, x, y)
 		game.level.map:particleEmitter(self.x, self.y, tg.radius, "matter_beam", {tx=x-self.x, ty=y-self.y})
 		self:incPsi(-cost)
@@ -181,7 +181,7 @@ newTalent{
 		local mast = aura_mastery(self, t)
 		local spikecost = t.getSpikeCost(self, t)
 		return ([[Fills the air around you with reactive currents of force that do %d physical damage to all who approach. All damage done by the aura will drain one point of energy per %0.2f points of damage dealt.
-		When deactivated, if you have at least %d energy, a massive spike of kinetic energy is released as a beam, smashing targets for %d physical damage and sending them flying. Telekinetically wielding a gem instead of a weapon will result in improved spike efficiency.
+		When deactivated, if you have at least %d energy, a massive spike of kinetic energy is released as a beam, smashing targets for %d physical damage and sending them flying.  Telekinetically wielding a gem or mindstar will result in improved spike efficiency.
 		To turn off an aura without spiking it, deactivate it and target yourself.]]):format(dam, mast, spikecost, spikedam)
 	end,
 }
@@ -196,7 +196,7 @@ newTalent{
 	sustain_psi = 40,
 	remove_on_zero = true,
 	cooldown = function(self, t)
-		return 15 - (self:getTalentLevelRaw(self.T_AURA_DISCIPLINE) or 0)
+		return 10 - (self:getTalentLevelRaw(self.T_AURA_DISCIPLINE) or 0)
 	end,
 	tactical = { ATTACKAREA = { FIRE = 2 } },
 	on_pre_use = function(self, t, silent)
@@ -246,7 +246,7 @@ newTalent{
 		return 0.8*aura_spike_strength(self, t)
 	end,
 	getSpikeCost = function(self, t)
-		return t.sustain_psi - 2*getGemLevel(self)
+		return t.sustain_psi/2 - 2*getGemLevel(self)
 	end,
 	do_thermalaura = function(self, t)
 		local mast = aura_mastery(self, t)
@@ -283,7 +283,7 @@ newTalent{
 		local actor = game.level.map(x, y, Map.ACTOR)
 		--if core.fov.distance(self.x, self.y, x, y) == 1 and not actor then return true end
 		if core.fov.distance(self.x, self.y, x, y) == 0 then return true end
-		self:project(tg, x, y, DamageType.FIREBURN, self:spellCrit(rng.avg(0.8*dam, dam)))
+		self:project(tg, x, y, DamageType.FIREBURN, self:mindCrit(rng.avg(0.8*dam, dam)))
 		game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_fire", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
 		game:playSoundNear(self, "talents/fire")
 		self:incPsi(-cost)
@@ -297,7 +297,7 @@ newTalent{
 		local mast = aura_mastery(self, t)
 		local spikecost = t.getSpikeCost(self, t)
 		return ([[Fills the air around you with reactive currents of furnace-like heat that do %d fire damage to all who approach. All damage done by the aura will drain one point of energy per %0.2f points of damage dealt.
-		When deactivated, if you have at least %d energy, a massive spike of thermal energy is released as a conical blast (radius %d) of superheated air. Anybody caught in it will suffer %d fire damage over several turns. Telekinetically wielding a gem instead of a weapon will result in improved spike efficiency.
+		When deactivated, if you have at least %d energy, a massive spike of thermal energy is released as a conical blast (radius %d) of superheated air. Anybody caught in it will suffer %d fire damage over several turns.  Telekinetically wielding a gem or mindstar will result in improved spike efficiency.
 		To turn off an aura without spiking it, deactivate it and target yourself.]]):format(dam, mast, spikecost, rad, spikedam)
 	end,
 }
@@ -312,7 +312,7 @@ newTalent{
 	sustain_psi = 50,
 	remove_on_zero = true,
 	cooldown = function(self, t)
-		return 15 - (self:getTalentLevelRaw(self.T_AURA_DISCIPLINE) or 0)
+		return 10 - (self:getTalentLevelRaw(self.T_AURA_DISCIPLINE) or 0)
 	end,
 	tactical = { ATTACKAREA = { LIGHTNING = 2 } },
 	on_pre_use = function(self, t, silent)
@@ -357,7 +357,7 @@ newTalent{
 		end
 	end,
 	getSpikeCost = function(self, t)
-		return t.sustain_psi - 2*getGemLevel(self)
+		return t.sustain_psi/2 - 2*getGemLevel(self)
 	end,
 	getAuraStrength = function(self, t)
 		return aura_strength(self, t)
@@ -442,7 +442,7 @@ newTalent{
 		for i, actor in ipairs(targets) do
 			local tgr = {type="beam", range=self:getTalentRange(t), friendlyfire=false, talent=t, x=sx, y=sy}
 			print("[Chain lightning] jumping from", sx, sy, "to", actor.x, actor.y)
-			self:project(tgr, actor.x, actor.y, DamageType.LIGHTNING, self:spellCrit(rng.avg(0.8*dam, dam)))
+			self:project(tgr, actor.x, actor.y, DamageType.LIGHTNING, self:mindCrit(rng.avg(0.8*dam, dam)))
 			game.level.map:particleEmitter(sx, sy, math.max(math.abs(actor.x-sx), math.abs(actor.y-sy)), "lightning", {tx=actor.x-sx, ty=actor.y-sy, nb_particles=150, life=6})
 			sx, sy = actor.x, actor.y
 		end
@@ -458,7 +458,7 @@ newTalent{
 		local spikecost = t.getSpikeCost(self, t)
 		local nb = t.getNumSpikeTargets(self, t)
 		return ([[Fills the air around you with crackling energy, doing %d lightning damage to all who stand nearby. All damage done by the aura will drain one point of energy per %0.2f points of damage dealt.
-		When deactivated, if you have at least %d energy, a massive spike of electrical energy jumps between up to %d nearby targets, doing %d lightning damage to each. Telekinetically wielding a gem instead of a weapon will result in improved spike efficiency.
+		When deactivated, if you have at least %d energy, a massive spike of electrical energy jumps between up to %d nearby targets, doing %d lightning damage to each.  Telekinetically wielding a gem or mindstar will result in improved spike efficiency.
 		To turn off an aura without spiking it, deactivate it and target yourself.]]):format(dam, mast, spikecost, nb, spikedam)
 	end,
 }
diff --git a/game/modules/tome/data/talents/psionic/psionic.lua b/game/modules/tome/data/talents/psionic/psionic.lua
index 34913602fc..dd83eae759 100644
--- a/game/modules/tome/data/talents/psionic/psionic.lua
+++ b/game/modules/tome/data/talents/psionic/psionic.lua
@@ -141,12 +141,12 @@ function getGemLevel(self)
 	local gem_level = 0
 	if self:getInven("PSIONIC_FOCUS") then
 		local tk_item = self:getInven("PSIONIC_FOCUS")[1]
-		if tk_item and (tk_item.type == "gem") then
+		if tk_item and (tk_item.type == "gem") or (tk_item.subtype == "mindstar") then
 			gem_level = tk_item.material_level or 5
 		end
 	end
 	if self:knowTalent(self.T_GREATER_TELEKINETIC_GRASP) and gem_level > 0 then
-		if self:getTalentLevelRaw(self.T_GREATER_TELEKINETIC_GRASP) == 5 then
+		if self:getTalentLevelRaw(self.T_GREATER_TELEKINETIC_GRASP) >= 5 then
 			gem_level = gem_level + 1
 		end
 	end
-- 
GitLab