Skip to content
Snippets Groups Projects
Commit 86354b06 authored by DarkGod's avatar DarkGod
Browse files

New gameplay option to auto-validate the default target; thus requiring only...

New gameplay option to auto-validate the default target; thus requiring only one keypress to fire a talent
parent 4b0251bd
No related branches found
No related tags found
No related merge requests found
......@@ -281,6 +281,11 @@ function _M:targetGetForPlayer(typ)
msg = typ.msg
end
self:targetMode("exclusive", msg, coroutine.running(), typ)
if self.target.target.x and config.settings.auto_accept_target and not typ.immediate_keys and not typ.nolock and not typ.nowarning and not typ.no_restrict then
self.target_co = nil
self:targetMode(false, false) self.tooltip_x, self.tooltip_y = nil, nil
return self.target.target.x, self.target.target.y, self.target.target.entity
end
if typ.immediate_keys then self.target_style = "immediate" end
if typ.nolock then self.target_style = "free" end
if typ.nowarning then self.target_warning = false end
......
......@@ -52,6 +52,7 @@ newTalent{
speed = 'weapon',
is_melee = true,
action = function(self, t)
if self:attr("never_attack") then return end
local swap = not self:attr("disarmed") and (self:attr("warden_swap") and doWardenWeaponSwap(self, t, "blade"))
local tg = self:getTalentTarget(t)
......
......@@ -461,6 +461,15 @@ function _M:generateListGameplay()
self.c_list:drawItem(item)
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Auto-validate targets. If you fire an arrow/talent/... it will automatically use the default target without asking\n#LIGHT_RED#This is dangerous. Do not enable unless you know exactly what you are doing.#WHITE#\n\nDefault target is always either one of:\n - The last creature hovered by the mouse\n - The last attacked creature\n - The closest creature"}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Auto-accept target#WHITE##{normal}#", status=function(item)
return tostring(config.settings.auto_accept_target and "disabled" or "enabled")
end, fct=function(item)
config.settings.auto_accept_target = not config.settings.auto_accept_target
game:saveSettings("auto_accept_target", ("auto_accept_target = %s\n"):format(tostring(config.settings.auto_accept_target)))
self.c_list:drawItem(item)
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"New games begin with some talent points auto-assigned.#WHITE#"}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Auto-assign talent points at birth#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.autoassign_talents_on_birth and "enabled" or "disabled")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment