Skip to content
Snippets Groups Projects
Commit 3aeae915 authored by dg's avatar dg
Browse files

Grgglck the Devouring Darkness will now invoke tentacles every few turns, not at random

git-svn-id: http://svn.net-core.org/repos/t-engine4@2256 51575b47-30f0-44d4-a5cc-537603b46e54
parent 7d38004d
No related branches found
No related tags found
No related merge requests found
......@@ -120,10 +120,10 @@ function _M:mouseHandleDefault(key, allow_move, button, mx, my, xrel, yrel, even
self:mouseScrollMap(game.level.map, xrel, yrel)
moving_around = true
-- Zoom map
-- elseif button == "wheelup" then
-- game.level.map:setZoom(0.1, tmx, tmy)
-- elseif button == "wheeldown" then
-- game.level.map:setZoom(-0.1, tmx, tmy)
elseif config.settings.cheat and button == "wheelup" then
game.level.map:setZoom(0.1, tmx, tmy)
elseif config.settings.cheat and button == "wheeldown" then
game.level.map:setZoom(-0.1, tmx, tmy)
-- Pass any other buttons to the keybinder
elseif button ~= "none" and not xrel and not yrel and event == "button" then
key:receiveKey(button, core.key.modState("ctrl") and true or false, core.key.modState("shift") and true or false, core.key.modState("alt") and true or false, core.key.modState("meta") and true or false, nil, false, true)
......
......@@ -456,12 +456,23 @@ You can discern a huge round mouth covered in razor-sharp teeth.]],
[Talents.T_MOONLIGHT_RAY]=4,
[Talents.T_PACIFICATION_HEX]=4,
[Talents.T_BURNING_HEX]=4,
[Talents.T_INVOKE_TENTACLE]=1,
},
resolvers.sustains_at_birth(),
-- Invoke tentacles every few turns
on_act = function(self)
if not self.ai_target.actor or self.ai_target.actor.dead then return end
if not self:hasLOS(self.ai_target.actor.x, self.ai_target.actor.y) then return end
self.last_tentacle = self.last_tentacle or (game.turn - 60)
if game.turn - self.last_tentacle >= 60 then -- Summon a tentacle every 6 turns
self:forceUseTalent(self.T_INVOKE_TENTACLE, {no_energy=true})
self.last_tentacle = game.turn
end
end,
autolevel = "warriormage",
ai = "dumb_talented_simple", ai_state = { talent_in=3, ai_move="move_astar" },
ai = "dumb_talented_simple", ai_state = { talent_in=1, ai_move="move_astar" },
}
newEntity{ base="BASE_NPC_HORROR", define_as = "GRGGLCK_TENTACLE",
......
......@@ -77,7 +77,7 @@ function _M:use(item)
game.level.map:liteAll(0, 0, game.level.map.w, game.level.map.h)
game.level.map:rememberAll(0, 0, game.level.map.w, game.level.map.h)
elseif act == "change_level" then
game:registerDialog(GetQuantity.new("Zone: "..game.zone.name, "Level 1-"..game.zone.max_level.max, game.level.level, game.zone.max_level, function(qty)
game:registerDialog(GetQuantity.new("Zone: "..game.zone.name, "Level 1-"..game.zone.max_level, game.level.level, game.zone.max_level, function(qty)
game:changeLevel(qty)
end), 1)
end
......@@ -92,6 +92,7 @@ function _M:generateList()
list[#list+1] = {name="Godmode", action="godmode"}
list[#list+1] = {name="Create all artifacts", action="all_arts"}
list[#list+1] = {name="Grant/Alter Quests", dialog="GrantQuest"}
list[#list+1] = {name="Summon Creature", dialog="SummonCreature"}
local chars = {}
for i, v in ipairs(list) do
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
require "engine.class"
require "engine.ui.Dialog"
local List = require "engine.ui.List"
local GetQuantity = require "engine.dialogs.GetQuantity"
module(..., package.seeall, class.inherit(engine.ui.Dialog))
function _M:init()
self:generateList()
engine.ui.Dialog.init(self, "Summon Creature", 1, 1)
local list = List.new{width=400, height=500, list=self.list, fct=function(item) self:use(item) end}
self:loadUI{
{left=0, top=0, ui=list},
}
self:setupUI(true, true)
self.key:addCommands{ __TEXTINPUT = function(c)
for i = list.sel + 1, #self.list do
local v = self.list[i]
if v.name:sub(1, 1):lower() == c:lower() then list:select(i) return end
end
for i = 1, list.sel do
local v = self.list[i]
if v.name:sub(1, 1):lower() == c:lower() then list:select(i) return end
end
end}
self.key:addBinds{ EXIT = function() game:unregisterDialog(self) end, }
end
function _M:use(item)
if not item then return end
game:unregisterDialog(self)
local n = game.zone:finishEntity(game.level, "actor", item.e)
local x, y = util.findFreeGrid(game.player.x, game.player.y, 20, true, {[engine.Map.ACTOR]=true})
if not x then return end
game.zone:addEntity(game.level, n, "actor", x, y)
end
function _M:generateList()
local list = {}
for i, e in ipairs(game.zone.npc_list) do
list[#list+1] = {name=e.name, unique=e.unique, e=e}
end
table.sort(list, function(a,b)
if a.unique and not b.unique then return true
elseif not a.unique and b.unique then return false end
return a.name < b.name
end)
local chars = {}
for i, v in ipairs(list) do
v.name = v.name
chars[self:makeKeyChar(i)] = i
end
list.chars = chars
self.list = list
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