Skip to content
Snippets Groups Projects
Commit e0fb1cb0 authored by dg's avatar dg
Browse files

Wild Infusions now always cure "cross-tier" effects

git-svn-id: http://svn.net-core.org/repos/t-engine4@4653 51575b47-30f0-44d4-a5cc-537603b46e54
parent 3e9a4f44
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -389,7 +389,10 @@ end
--- Takeoff item
function _M:takeoffObject(inven, item)
local o = self:getInven(inven)[item]
inven = self:getInven(inven)
if not inven then return false end
local o = inven[item]
if o:check("on_cantakeoff", self, inven) then return false end
o = self:removeObject(inven, item, true)
......
......@@ -326,7 +326,7 @@ newAI("use_tactical", function(self)
end
end
if avail.cure and nb_detrimental_effs > 0 then
table.sort(avail.defend, function(a,b) return a.val > b.val end)
table.sort(avail.cure, function(a,b) return a.val > b.val end)
want.cure = nb_detrimental_effs
end
......
......@@ -3104,7 +3104,7 @@ function _M:on_set_temporary_effect(eff_id, e, p)
elseif save_type == "combatSpellResist"
then p.save_string = "Spell save"
end
if not p.no_ct_effect and e.status == "detrimental" then self:crossTierEffect(eff_id, p.apply_power, p.apply_save or save_for_effects[e.type]) end
if not p.no_ct_effect and not e.no_ct_effect and e.status == "detrimental" then self:crossTierEffect(eff_id, p.apply_power, p.apply_save or save_for_effects[e.type]) end
p.total_dur = p.dur
p.apply_power = nil
end
......
......@@ -100,7 +100,7 @@ newTalent{
points = 5,
vim = 18,
cooldown = 12,
range = 0,
range = 1,
radius = 1,
requires_target = true,
tactical = { ATTACK = {ACID = 2}, DISABLE = 1 },
......
......@@ -127,16 +127,28 @@ newInscription{
local target = self
local effs = {}
local force = {}
local known = false
-- Go through all temporary effects
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if data.what[e.type] and e.status == "detrimental" then
if data.what[e.type] and e.status == "detrimental" and e.subtype["cross tier"] then
force[#force+1] = {"effect", eff_id}
elseif data.what[e.type] and e.status == "detrimental" then
effs[#effs+1] = {"effect", eff_id}
end
end
-- Cross tier effects are always removed and not part of the random game, otherwise it is a huge nerf to wild infusion
for i = 1, #force do
local eff = force[i]
if eff[1] == "effect" then
target:removeEffect(eff[2])
known = true
end
end
for i = 1, 1 do
if #effs == 0 then break end
local eff = rng.tableRemove(effs)
......
......@@ -119,7 +119,7 @@ newEffect{
desc = "Spydric Poison",
long_desc = function(self, eff) return ("The target is poisoned, taking %0.2f nature damage per turn and unable to move (but can otherwise act freely)."):format(eff.power) end,
type = "physical",
subtype = { poison=true, pin=true, nature=true },
subtype = { poison=true, pin=true, nature=true }, no_ct_effect = true,
status = "detrimental",
parameters = {power=10},
on_gain = function(self, err) return "#Target# is poisoned and cannot move!", "+Spydric Poison" end,
......@@ -142,7 +142,7 @@ newEffect{
desc = "Insidious Poison",
long_desc = function(self, eff) return ("The target is poisoned, taking %0.2f nature damage per turn and decreasing all heals received by %d%%."):format(eff.power, eff.heal_factor) end,
type = "physical",
subtype = { poison=true, nature=true },
subtype = { poison=true, nature=true }, no_ct_effect = true,
status = "detrimental",
parameters = {power=10, heal_factor=30},
on_gain = function(self, err) return "#Target# is poisoned!", "+Insidious Poison" end,
......@@ -165,7 +165,7 @@ newEffect{
desc = "Crippling Poison",
long_desc = function(self, eff) return ("The target is poisoned and sick, doing %0.2f nature damage per turn. Each time it tries to use a talent there is %d%% chance of failure."):format(eff.power, eff.fail) end,
type = "physical",
subtype = { poison=true, nature=true },
subtype = { poison=true, nature=true }, no_ct_effect = true,
status = "detrimental",
parameters = {power=10, fail=5},
on_gain = function(self, err) return "#Target# is poisoned!", "+Crippling Poison" end,
......@@ -189,7 +189,7 @@ newEffect{
desc = "Numbing Poison",
long_desc = function(self, eff) return ("The target is poisoned and sick, doing %0.2f nature damage per turn. All damage it does is reduced by %d%%."):format(eff.power, eff.reduce) end,
type = "physical",
subtype = { poison=true, nature=true },
subtype = { poison=true, nature=true }, no_ct_effect = true,
status = "detrimental",
parameters = {power=10, reduce=5},
on_gain = function(self, err) return "#Target# is poisoned!", "+Numbing Poison" end,
......@@ -213,7 +213,7 @@ newEffect{
desc = "Stoning Poison",
long_desc = function(self, eff) return ("The target is poisoned and sick, doing %0.2f nature damage per turn. When the effect ends the target will turn to stone for %d turns."):format(eff.power, eff.stone) end,
type = "physical",
subtype = { poison=true, earth=true },
subtype = { poison=true, earth=true }, no_ct_effect = true,
status = "detrimental",
parameters = {power=10, reduce=5},
on_gain = function(self, err) return "#Target# is poisoned!", "+Stoning Poison" end,
......
......@@ -300,11 +300,11 @@ function _M:tutorial()
self:atEnd("created")
end
local d = Dialog.new("Tutorials", 170, 100)
local basic = Button.new{text="Basic Gameplay", fct=function() run("Basic") d.key:triggerVirtual("EXIT") end}
local stats = Button.new{text="Advanced Stats", fct=function() run("Stats") d.key:triggerVirtual("EXIT") end}
local d = Dialog.new("Tutorials", 250, 100)
local basic = Button.new{text="Basic Gameplay (recommended)", fct=function() run("Basic") d.key:triggerVirtual("EXIT") end}
local stats = Button.new{text="Stats and effects (advanced players)", fct=function() run("Stats") d.key:triggerVirtual("EXIT") end}
local cancel = Button.new{text="Cancel", fct=function() d.key:triggerVirtual("EXIT") end}
local sep = Separator.new{dir="vertical", size=150}
local sep = Separator.new{dir="vertical", size=230}
d:loadUI{
{hcenter=0, top=0, ui=basic},
......
......@@ -43,7 +43,7 @@ function _M:init(title, actor, filter, action, on_select)
end
end
self.c_doll = EquipDoll.new{actor=actor, drag_enable=true,
self.c_doll = EquipDoll.new{actor=actor, drag_enable=true, filter=filter,
fct = function(item, button, event) self:use(item, button, event) end,
on_select = function(ui, inven, item, o) if ui.ui.last_display_x then self:select{last_display_x=ui.ui.last_display_x+ui.ui.w, last_display_y=ui.ui.last_display_y, object=o} end end,
actorWear = function(ui, ...)
......@@ -53,7 +53,7 @@ function _M:init(title, actor, filter, action, on_select)
end
}
self.c_inven = Inventory.new{actor=actor, inven=actor:getInven("INVEN"), width=self.iw - 20 - self.c_doll.w, height=self.ih - 10,
self.c_inven = Inventory.new{actor=actor, inven=actor:getInven("INVEN"), width=self.iw - 20 - self.c_doll.w, height=self.ih - 10, filter=filter,
fct=function(item, sel, button, event) self:use(item, button, event) end,
select=function(item, sel) self:select(item) end,
select_tab=function(item) self:select(item) end,
......
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