Jump to content

you can attack nightmare creatures with left click when using shadow helm


dois raios
  • Pending

It is not necessary to hold control to attack some shadow creatures.


Steps to Reproduce

equip bone helm

equip any item on hand

left click can attack some nightmare creatures

  • Like 1



User Feedback


Both nightmare and shadow creatures could get less in the way of the player if they received functions like these:

-- NOTE: taken from other entities that do use this code, with some changes, could potentially be improved further

local function IsLowPriorityAction(act, force_attack, is_hostile)
	return act == nil or not is_hostile and not force_attack
end

local function CanMouseThrough(inst)
	local player = ThePlayer

	if player and player.components.playeractionpicker ~= nil then
		local force_attack = player.components.playercontroller ~= nil and player.components.playercontroller:IsControlPressed(CONTROL_FORCE_ATTACK)
		local is_hostile = inst.HostileToPlayerTest and inst.HostileToPlayerTest(inst, player)
		local lmb, rmb = player.components.playeractionpicker:DoGetMouseActions(inst:GetPosition(), inst)
		return IsLowPriorityAction(rmb, force_attack, is_hostile)
			and IsLowPriorityAction(lmb, force_attack, is_hostile), not is_hostile -- mousethrough if the action isn't important, keepnone only if not hostile
	end

	return true, true -- mousethrough, keepnone
end

-- in prefab for both clients and server
inst.CanMouseThrough = CanMouseThrough

Not only you wouldn't be able to attack them with left click without holding force attack, but you'd be also able to click right through them so they don't get in the way. Just to clarify, this won't apply if they're able and can try to attack you (so if you have the Bone Helm and hit them, you'll be able to attack them without force attacking, until they deaggro).

 

There's.. many shadow/gestalt entities that could use a CanMouseThrough function, as well as potentially the NOBLOCK tag so they don't block structure placement/item deploying when they might not even be visible to some players, which can happen when one player is very sane, but another has low enough sanity to spawn them and have them linger around without aggroing (and they can even annoy the player they're following).

It's interesting because gestalts can't be invisible if they spawn at all, but even then, they have the tag, so they never get in the way of structure placement/item deploying (they do however get in the way of your cursor even when you can't examine or attack them or anything, and their transparency only works properly for host players in worlds without caves, which I reported a little while back).

Edited by hoxi
Added URL to mentioned gestalt report

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...