[1.7.2] command_lement

Make all T-Engine/ToME 4 bug reports here

Moderator: Moderator

Post Reply
Message
Author
Werekracken
Yeek
Posts: 13
Joined: Sat Feb 08, 2014 1:37 am

[1.7.2] command_lement

#1 Post by Werekracken »

https://git.net-core.org/tome/t-engine4 ... .lua#L1396

Code: Select all

function resolvers.calc.staff_element(t, e)
	local command_flavor, command_lement = nil, nil
	if not e.flavor_name then
		if not e.flavors then -- standard
			local staff_type = rng.table{2, 2, 2, 2, 3, 3, 3, 4, 4, 4}
			command_flavor = e["flavor_names"][staff_type]
		else
			command_flavor = rng.tableIndex(e.flavors)
		end
	end
	if not e.combat.element then
		command_element = rng.table(e:getStaffFlavor(e.flavor_name or command_flavor))
	end

	e.combat.damtype = e.combat.damtype or engine.DamageType.PHYSICAL
	if not e.no_command then 
		e.wielder = e.wielder or {}
		e.wielder.learn_talent = e.wielder.learn_talent or {}
		e.wielder.learn_talent[Talents.T_COMMAND_STAFF] = 1
	end

	if command_flavor or command_element then e:commandStaff(command_element, command_flavor) end

	-- hee hee
	if not e.unique then
		local chance = math.max((e.material_level or 1) - 3, 0)
		if rng.percent(chance) then
			e.combat.sentient = rng.table{"default", "aggressive", "fawning"}
		end
	end
end
command_lement is obviously supposed to be command_element

I don't see where this is causing any errors, but it's wrong and I thought I would point it out.

Post Reply