Skip to content
Snippets Groups Projects
Commit 1691fc5e authored by dg's avatar dg
Browse files

New option (on by default) to make the immediate melee targetting mode...

New option (on by default) to make the immediate melee targetting mode autoselect when there is only one foe


git-svn-id: http://svn.net-core.org/repos/t-engine4@6713 51575b47-30f0-44d4-a5cc-537603b46e54
parent 845fbdb0
No related branches found
No related tags found
No related merge requests found
......@@ -659,10 +659,25 @@ function _M:getTarget(typ)
end
else
if type(typ) == "table" and typ.range and typ.range == 1 and config.settings.tome.immediate_melee_keys then
local oldft = typ.first_target
typ = table.clone(typ)
typ.first_target = "friend"
typ.immediate_keys = true
typ.default_target = self
if config.settings.tome.immediate_melee_keys_auto and not oldft then
local foes = {}
for _, c in pairs(util.adjacentCoords(self.x, self.y)) do
local target = game.level.map(c[1], c[2], Map.ACTOR)
if target and self:reactionToward(target) < 0 then foes[#foes+1] = target end
end
if #foes == 1 then
game.target.target.entity = foes[1]
game.target.target.x = foes[1].x
game.target.target.y = foes[1].y
return game.target.target.x, game.target.target.y, game.target.target.entity
end
end
end
return game:targetGetForPlayer(typ)
end
......
......@@ -311,6 +311,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"Enables quick melee targetting auto attacking.\nTalents that require a melee target will automatically target and confirm if there is only one hostile creatue around.#WHITE#"}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Quick melee targetting auto attack#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.immediate_melee_keys_auto and "enabled" or "disabled")
end, fct=function(item)
config.settings.tome.immediate_melee_keys_auto = not config.settings.tome.immediate_melee_keys_auto
game:saveSettings("tome.immediate_melee_keys_auto", ("tome.immediate_melee_keys_auto = %s\n"):format(tostring(config.settings.tome.immediate_melee_keys_auto)))
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")
......
......@@ -80,6 +80,7 @@ if type(config.settings.tome.rest_before_explore) == "nil" then config.settings.
if type(config.settings.tome.lore_popup) == "nil" then config.settings.tome.lore_popup = true end
if type(config.settings.tome.auto_hotkey_object) == "nil" then config.settings.tome.auto_hotkey_object = true end
if type(config.settings.tome.immediate_melee_keys) == "nil" then config.settings.tome.immediate_melee_keys = true end
if type(config.settings.tome.immediate_melee_keys_auto) == "nil" then config.settings.tome.immediate_melee_keys_auto = true end
if not config.settings.tome.fonts then config.settings.tome.fonts = {type="fantasy", size="normal"} end
if not config.settings.tome.ui_theme2 then config.settings.tome.ui_theme2 = "metal" end
if not config.settings.tome.uiset_mode then config.settings.tome.uiset_mode = "Minimalist" end
......
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