[b34] rush not triggering traps

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
marchewka
Thalore
Posts: 156
Joined: Thu Dec 30, 2010 9:52 am

[b34] rush not triggering traps

#1 Post 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.

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: [b34] rush not triggering traps

#2 Post 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.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

marchewka
Thalore
Posts: 156
Joined: Thu Dec 30, 2010 9:52 am

Re: [b34] rush not triggering traps

#3 Post 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.

Rectifier
Archmage
Posts: 386
Joined: Mon Aug 29, 2011 8:06 am

Re: [b34] rush not triggering traps

#4 Post 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.

marvalis
Uruivellas
Posts: 683
Joined: Sun Sep 05, 2010 5:11 am

Re: [b34] rush not triggering traps

#5 Post 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

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: [b34] rush not triggering traps

#6 Post by Grey »

You should maybe put that in a separate bug report, marvalis.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Post Reply