summary refs log tree commit diff
path: root/whispers-qol/superload/mod/class/Player.lua
blob: 3a6068e31c5d119de73fe9d7554f0dbea3510bdf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local _M = loadPrevious(...)

-- detect Auto-Transmo Gems, hopefully durably
if type(config.settings.tome.auto_transmo_gems) ~= 'nil' then
	local super_pickupFloor = _M.pickupFloor
	function _M:pickupFloor(i, vocal, no_sort)
		local ret = { super_pickupFloor(self, i, vocal, no_sort) }

		local o = ret[1]
		if not (o and type(o) == 'table' and o.type == 'gem' and o.imbue_powers and o.__transmo == true) then
			return unpack(ret)
		if o.imbue_powers.stun_immune or o.imbue_powers.resists_pen then
			o.__transmo = false
		end

		return unpack(ret)
	end
end