Page 1 of 1

[b34] rush not triggering traps

Posted: Tue Oct 11, 2011 2:19 pm
by marchewka
When NPC ends his Rush maneuver on a tile with trap, the trap does not get triggered. For sure its the case for rogue-set traps.

Re: [b34] rush not triggering traps

Posted: Thu Oct 13, 2011 3:38 am
by lukep
Movement is the only thing that sets off traps IIRC. This means Rush (and similar ones), knockbacks, and any form of teleportation do not trigger them.

Re: [b34] rush not triggering traps

Posted: Thu Oct 13, 2011 9:06 am
by marchewka
Well, it certainly is like that right now. My understanding is that it was not by design, but more like a leftover/simplification of things from earlier stages. If you prefer i'll post it in a Idea forum too, and treat it more like a request for feature.

Re: [b34] rush not triggering traps

Posted: Thu Oct 13, 2011 9:19 am
by Rectifier
Rush should definitely trigger a rogue's trap, that defeats the purpose of tactically setting traps in the path of an enemy.

If anything Rush should cause the target to take more damage from traps because of foolishly sprinting headlong into said trap.

Re: [b34] rush not triggering traps

Posted: Thu Oct 13, 2011 1:03 pm
by marvalis
Here is another bug I think i found for light of foot by looking at the move function:

Code: Select all

	if not forced and moved and ox and oy and (ox ~= self.x or oy ~= self.y) and self:knowTalent(self.T_LIGHT_OF_FOOT) then
		self:incStamina(self:getTalentLevelRaw(self.T_LIGHT_OF_FOOT) * 0.2)
I have no idea if I am reading this correct, but should this not be:
if not force
instead of forced?

in Actor.lua

Code: Select all

function _M:move(x, y, force)
	local moved = false
	local ox, oy = self.x, self.y

	if force or self:enoughEnergy() then

		-- Confused ?
		if not force and self:attr("confused") then
			if rng.percent(self:attr("confused")) then
				x, y = self.x + rng.range(-1, 1), self.y + rng.range(-1, 1)
			end
		end

		-- Encased in ice, attack the ice
		if not force and self:attr("encased_in_ice") then
			self:attackTarget(self)
			moved = true
		-- Should we prob travel through walls ?
		elseif not force and self:attr("prob_travel") and game.level.map:checkEntity(x, y, Map.TERRAIN, "block_move", self) then
			moved = self:probabilityTravel(x, y, self:attr("prob_travel"))
		-- Never move but tries to attack ? ok
		elseif not force and self:attr("never_move") then
			-- A bit weird, but this simple asks the collision code to detect an attack
			if not game.level.map:checkAllEntities(x, y, "block_move", self, true) then
				game.logPlayer(self, "You are unable to move!")
			end
		else
			moved = engine.Actor.move(self, x, y, force)
		end
		if not force and moved and (self.x ~= ox or self.y ~= oy) and not self.did_energy then
			self:useEnergy(game.energy_to_act * self:combatMovementSpeed())
		end
	end
	self.did_energy = nil

	-- Try to detect traps
	if self:knowTalent(self.T_TRAP_DETECTION) then
		local power = self:getTalentLevel(self.T_TRAP_DETECTION) * self:getCun(25, true)
		local grids = core.fov.circle_grids(self.x, self.y, 1, true)
		for x, yy in pairs(grids) do for y, _ in pairs(yy) do
			local trap = game.level.map(x, y, Map.TRAP)
			if trap and not trap:knownBy(self) and self:checkHit(power, trap.detect_power) then
				trap:setKnown(self, true)
				game.level.map:updateMap(x, y)
				game.logPlayer(self, "You have found a trap (%s)!", trap:getName())
			end
		end end
	end

	if moved and self:knowTalent(self.T_CURSED_TOUCH) then
		local t = self:getTalentFromId(self.T_CURSED_TOUCH)
		t.curseFloor(self, t, x, y)
	end

	if moved and self:isTalentActive(self.T_BODY_OF_STONE) then
		self:forceUseTalent(self.T_BODY_OF_STONE, {ignore_energy=true})
	end

	if not forced and moved and ox and oy and (ox ~= self.x or oy ~= self.y) and self:knowTalent(self.T_LIGHT_OF_FOOT) then
		self:incStamina(self:getTalentLevelRaw(self.T_LIGHT_OF_FOOT) * 0.2)
	end

	if moved and not force and ox and oy and (ox ~= self.x or oy ~= self.y) and config.settings.tome.smooth_move > 0 then
		local blur = 0
		if game.level.data.zero_gravity then blur = 2 end
		if self:attr("lightning_speed") or self:attr("step_up") or self:attr("wild_speed") then blur = 3 end
		self:setMoveAnim(ox, oy, config.settings.tome.smooth_move, blur)
	end

	return moved
end

Re: [b34] rush not triggering traps

Posted: Thu Oct 13, 2011 1:05 pm
by Grey
You should maybe put that in a separate bug report, marvalis.