Skip to content
Snippets Groups Projects
Commit 4aad556e authored by DarkGod's avatar DarkGod
Browse files

undeads cant use infusions instead of only being able to use runes (doesnt...

undeads cant use infusions instead of only being able to use runes (doesnt change anything for vanilla)
parent fcad744e
No related branches found
No related tags found
No related merge requests found
......@@ -4638,6 +4638,10 @@ function _M:preUseTalent(ab, silent, fake)
if not silent then game.logSeen(self, "%s is unable to use this kind of inscription.", self.name:capitalize()) end
return false
end
if ab.is_inscription and self.inscription_forbids and self.inscription_forbids[ab.type[1]] then
if not silent then game.logSeen(self, "%s is unable to use this kind of inscription.", self.name:capitalize()) end
return false
end
-- when using unarmed techniques check for weapons and heavy armor
if ab.is_unarmed and not (ab.mode == "sustained" and self:isTalentActive(ab.id)) then
......
......@@ -38,6 +38,10 @@ function _M:setInscription(id, name, data, cooldown, vocal, src, bypass_max_same
if vocal then game.logPlayer(self, "You are unable to use this kind of inscription.") end
return
end
if self.inscription_forbids and self.inscription_forbids[t.type[1]] then
if vocal then game.logPlayer(self, "You are unable to use this kind of inscription.") end
return
end
-- Count occurrences
local nb_same = 0
......
......@@ -61,7 +61,7 @@ newBirthDescriptor{
starting_quest = "start-undead",
undead = 1,
forbid_nature = 1,
inscription_restrictions = { ["inscriptions/runes"] = true, ["inscriptions/taints"] = true, },
inscription_forbids = { ["inscriptions/infusions"] = true },
resolvers.inscription("RUNE:_SHIELDING", {cooldown=14, dur=5, power=130}),
--resolvers.inscription("RUNE:_PHASE_DOOR", {cooldown=7, range=10, dur=5, power=15}),
resolvers.inscription("RUNE:_HEAT_BEAM", {cooldown=18, range=8, power=40}), -- yeek and undead starts are unfun to the point of absurdity
......
......@@ -190,9 +190,8 @@ newTalent{
self:attr("undead", 1)
self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) + 20
self.resists[DamageType.DARKNESS] = (self.resists[DamageType.DARKNESS] or 0) + 20
self.inscription_restrictions = self.inscription_restrictions or {}
self.inscription_restrictions["inscriptions/runes"] = true
self.inscription_restrictions["inscriptions/taints"] = true
self.inscription_forbids = self.inscription_forbids or {}
self.inscription_forbids["inscriptions/infusions"] = true
local level = self:getTalentLevel(t)
if level < 2 then
......
......@@ -134,13 +134,18 @@ uberTalent{
uberTalent{
name = "Fungal Blood",
require = { special={desc="Be able to use infusions", fct=function(self) return not self.inscription_restrictions or self.inscription_restrictions['inscriptions/infusions'] end} },
require = { special={desc="Be able to use infusions", fct=function(self)
return
(not self.inscription_restrictions or self.inscription_restrictions['inscriptions/infusions']) and
(not self.inscription_forbids or not self.inscription_forbids['inscriptions/infusions'])
end} },
tactical = { HEAL = function(self) return not self:hasEffect(self.EFF_FUNGAL_BLOOD) and 0 or math.ceil(self:hasEffect(self.EFF_FUNGAL_BLOOD).power / 150) end },
healmax = function(self, t) return self.max_life * self:combatStatLimit("con", 0.5, 0.1, 0.25) end, -- Limit < 50% max life
fungalPower = function(self, t) return self:getCon()*2 + self.max_life * self:combatStatLimit("con", 0.05, 0.005, 0.01) end,
on_pre_use = function(self, t) return self:hasEffect(self.EFF_FUNGAL_BLOOD) and self:hasEffect(self.EFF_FUNGAL_BLOOD).power > 0 and not self:attr("undead") end,
trigger = function(self, t)
if self.inscription_restrictions and not self.inscription_restrictions['inscriptions/infusions'] then return end
if self.inscription_forbids and self.inscription_forbids['inscriptions/infusions'] then return end
self:setEffect(self.EFF_FUNGAL_BLOOD, 6, {power=t.fungalPower(self, t)})
end,
no_energy = true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment