ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Mon Jul 22, 2019 5:34 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jun 13, 2019 3:20 am 
Offline

Joined: Thu Jun 13, 2019 2:52 am
Posts: 1
This was obviously programmed this way for a reason.
But nonetheless as a player this is unexpected behavior, it took me looking at the source code to figure out why my sustains would suddenly deactivate.
EX: Activate Sustain, Have 12 Mana, Cast Lightning for 11.2 Mana, Mana is technically .8 but rounded up to appear as 1, sustains are then deactivated as Mana is less than 1.
Really hope to see this improvement in the next patch.

-- Break some sustains if certain resources are too low
-- Note: force_talent_ignore_ressources has no effect here
-- consider replacing the minimum resource value of 1 with a number based on the talent and resource
for tid, p in pairs(self.sustain_talents) do
local deact, t = false, self.talents_def[tid]
-- check each possible resource the talent uses
for res, res_def in ipairs(_M.resources_def) do
if (t.remove_on_zero == nil and res_def.depleted_unsustain) or (t.remove_on_zero ~= nil and util.getval(t.remove_on_zero, self, t)) then
if t[res_def.sustain_prop] then
if res == self.RS_STAMINA and self:hasEffect(self.EFF_ADRENALINE_SURGE) then
else
if res_def.invert_values then
if self[res_def.maxname] and (self[res_def.maxname] - self[res_def.short_name]) < 1 then
deact = true break
end
else
if self[res_def.minname] and (self[res_def.short_name] - self[res_def.minname]) < 1 then
deact = true break
end
end
end
end
end
end
if deact then self:forceUseTalent(tid, {ignore_energy=true}) end
end

-- Handle if Embers DLC is available.
if self.steam and self.steam < 1 then
for tid, _ in pairs(self.sustain_talents) do
local t = self:getTalentFromId(tid)
if (t.sustain_steam or t.drain_steam) then
self:forceUseTalent(tid, {ignore_energy=true})
end
end
end


-- clear grappling
if self:hasEffect(self.EFF_GRAPPLING) and self.stamina < 1 and not self:hasEffect(self.EFF_ADRENALINE_SURGE) then
self:removeEffect(self.EFF_GRAPPLING)
end

-- disable spell sustains
if self:attr("spell_failure") then
for tid, _ in pairs(self.sustain_talents) do
local t = self:getTalentFromId(tid)
if t.is_spell and rng.percent(self:attr("spell_failure")/10)then
self:forceUseTalent(tid, {ignore_energy=true})
if not silent then game.logSeen(self, "%s has been disrupted by #ORCHID#anti-magic forces#LAST#!", t.name) end
end
end
end


Attachments:
tomeEX.GIF
tomeEX.GIF [ 69.63 KiB | Viewed 185 times ]
Top
 Profile  
 
PostPosted: Sat Jun 15, 2019 2:22 pm 
Offline
Spiderkin

Joined: Wed Jan 22, 2014 1:46 pm
Posts: 456
Good to know is also that sustains are deactivated after you regen resources, so having 1 mana regen takes care of that.

_________________
I write guides and make addons too now, apparently

You can go here for a compilation of everything I wrote, plus some other important stuff!

Includes general guides (inscriptions, zone, prodigies), and class guides (Demo, Anorithil, Bulwark, Zerker, Sblade)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group