diff --git a/game/engine/ai/talented.lua b/game/engine/ai/talented.lua index 780308fa3a3a0a8d54e4b78bbf130af672d7b904..6eaecce96c833cf32fa749359b3e92545f37825e 100644 --- a/game/engine/ai/talented.lua +++ b/game/engine/ai/talented.lua @@ -10,6 +10,9 @@ newAI("dumb_talented", function(self) if t.mode == "activated" and not self:isTalentCoolingDown(t) and target_dist <= self:getTalentRange(t) and self:preUseTalent(t, true) and self:canProject({type="bolt"}, self.ai_target.actor.x, self.ai_target.actor.y) then avail[#avail+1] = tid print(self.name, self.uid, "dumb ai talents can use", t.name, tid) + elseif t.mode == "sustained" and not self:isTalentCoolingDown(t) and not self:isTalentActive(t) and self:preUseTalent(t, true) then + avail[#avail+1] = tid + print(self.name, self.uid, "dumb ai talents can activate", t.name, tid) end end if #avail > 0 then diff --git a/game/engine/generator/map/Roomer.lua b/game/engine/generator/map/Roomer.lua index af39940c16e0ab0a430ed5faab7e1ee5efbc3c25..487f5b40099d62ed59ed93008823ef69bd7e478e 100644 --- a/game/engine/generator/map/Roomer.lua +++ b/game/engine/generator/map/Roomer.lua @@ -153,6 +153,8 @@ end --- Tunnel from x1,y1 to x2,y2 function _M:tunnel(x1, y1, x2, y2, id) + -- Disable the many prints of tunnelling + local print = function()end local xdir, ydir = self:tunnelDir(x1, y1, x2, y2) print("tunneling from",x1, y1, "to", x2, y2, "initial dir", xdir, ydir) diff --git a/game/engine/generator/map/TileSet.lua b/game/engine/generator/map/TileSet.lua index 0f6aca1976a92499fc5c78e6309b5298f83f5f4b..6e0f264e49f60909b248a8c7c69dbbe19cb465bc 100644 --- a/game/engine/generator/map/TileSet.lua +++ b/game/engine/generator/map/TileSet.lua @@ -3,7 +3,7 @@ local Map = require "engine.Map" require "engine.Generator" module(..., package.seeall, class.inherit(engine.Generator)) -function _M:init(zone, map, grid_list, data) +function _M:init(zone, map, level, data) engine.Generator.init(self, zone, map, level) self.data = data self.grid_list = zone.grid_list @@ -23,7 +23,8 @@ function _M:init(zone, map, grid_list, data) end function _M:loadTiles(tileset) - local f = loadfile("/data/tilesets/"..tileset..".lua") + local f, err = loadfile("/data/tilesets/"..tileset..".lua") + if not f and err then error(err) end local d = {} setfenv(f, d) local ret, err = f() @@ -180,7 +181,7 @@ function _M:generate() while #process > 0 do local b = table.remove(process) local type = "room" - if not first and rng.percent(70) then type = "tunnel" end + if not first and rng.percent(30) then type = "tunnel" end first = false local opens = self:buildTile(b.tile, b[1], b[2], id) diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 2453ed6dc41d911082121e7939bc858fee8c885d..211958f3745981ba854b91bda1051488a43fcd83 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -367,7 +367,7 @@ function _M:setupCommands() self.key:addCommands{ [{"_d","ctrl"}] = function() - self:changeLevel(5, "tower-amon-sul") + self:changeLevel(2, "illusory-castle") end, } self.key:addBinds diff --git a/game/modules/tome/data/talents/techniques/archery.lua b/game/modules/tome/data/talents/techniques/archery.lua index a93ca7ec7546f177bf7e2dd38bdc404c8aa1fcb6..66cf88d8402fd1c43e11a99614f75a5d58ae29dc 100644 --- a/game/modules/tome/data/talents/techniques/archery.lua +++ b/game/modules/tome/data/talents/techniques/archery.lua @@ -135,7 +135,7 @@ newTalent{ type = {"technique/archery-utility", 1}, no_energy = true, points = 5, - cooldown = 1000, + cooldown = 200, stamina = 30, require = techs_dex_req1, action = function(self, t) @@ -150,7 +150,7 @@ newTalent{ if weapon.archery == "sling" then st = "shot" end local o = game.zone:makeEntity(game.level, "object", {type="ammo", subtype=st}) - if o and rng.percent(40 + self:getTalentLevel(t) * 10) then + if o and rng.percent(10 + self:getTalentLevel(t) * 10) then o:identify(true) o:forAllStack(function(so) so.cost = 0 end) self:addObject(self.INVEN_INVEN, o) diff --git a/game/modules/tome/data/tilesets/dungeon.lua b/game/modules/tome/data/tilesets/dungeon.lua index a5624245f72a99dddd83287afd3e7e4a40271124..6a553ab6fa25e96f41338d3bdd7b9b2da3052b75 100644 --- a/game/modules/tome/data/tilesets/dungeon.lua +++ b/game/modules/tome/data/tilesets/dungeon.lua @@ -27,7 +27,6 @@ tiles = }, {type="tunnel", -{ [[#####]], [[#####]], [[.....]], @@ -158,4 +157,25 @@ tiles = [[....#]], [[#####]], }, +{type="room", +[[#####]], +[[.....]], +[[#+++#]], +[[.....]], +[[#####]], +}, +{type="room", +[[##+##]], +[[##.##]], +[[#...#]], +[[#...#]], +[[#...#]], +}, +{type="room", +[[#...#]], +[[#...#]], +[[#...#]], +[[##.##]], +[[##+##]], +}, } diff --git a/game/modules/tome/data/zones/illusory-castle/grids.lua b/game/modules/tome/data/zones/illusory-castle/grids.lua new file mode 100644 index 0000000000000000000000000000000000000000..bc1ca76f543260a51f0280590cab61eeed6ddf42 --- /dev/null +++ b/game/modules/tome/data/zones/illusory-castle/grids.lua @@ -0,0 +1 @@ +load("/data/general/grids/basic.lua") diff --git a/game/modules/tome/data/zones/illusory-castle/npcs.lua b/game/modules/tome/data/zones/illusory-castle/npcs.lua new file mode 100644 index 0000000000000000000000000000000000000000..8fd9f8026820b88165f74a88f633168dd1c949bc --- /dev/null +++ b/game/modules/tome/data/zones/illusory-castle/npcs.lua @@ -0,0 +1,38 @@ +--[=[ +load("/data/general/npcs/rodent.lua") +load("/data/general/npcs/vermin.lua") +load("/data/general/npcs/molds.lua") +load("/data/general/npcs/skeleton.lua") +load("/data/general/npcs/snake.lua") + +local Talents = require("engine.interface.ActorTalents") + +-- The boss of Amon Sul, no "rarity" field means it will not be randomly generated +newEntity{ define_as = "SHADE_OF_ANGMAR", + type = "undead", subtype = "skeleton", unique = true, + name = "The Shade of Angmar", + display = "s", color=colors.VIOLET, + desc = [[This skeleton looks nasty. There is red flames in its empty eye sockets. It wield a nasty sword and towers toward you, throwing spells.]], + level_range = {7, 10}, exp_worth = 2, + max_life = 150, life_rating = 15, fixed_rating = true, + max_mana = 85, + max_stamina = 85, + stats = { str=16, dex=12, cun=14, mag=25, con=16 }, + + body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, + equipment = resolvers.equip{ {type="weapon", subtype="staff", defined="STAFF_ANGMAR"}, {type="armor", subtype="light"}, }, + drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} }, + + talents = resolvers.talents{ + [Talents.T_MANA_POOL]=1, [Talents.T_MANATHRUST]=4, [Talents.T_FREEZE]=4, [Talents.T_TIDAL_WAVE]=2, + [Talents.T_STAMINA_POOL]=1, [Talents.T_SWORD_MASTERY]=3, [Talents.T_STUNNING_BLOW]=1, + }, + + autolevel = "warriormage", + ai = "dumb_talented_simple", ai_state = { talent_in=4, }, + + on_die = function(self, who) + who:setQuestStatus("start-dunadan", engine.Quest.COMPLETED, "amon-sul") + end, +} +]=] \ No newline at end of file diff --git a/game/modules/tome/data/zones/illusory-castle/objects.lua b/game/modules/tome/data/zones/illusory-castle/objects.lua new file mode 100644 index 0000000000000000000000000000000000000000..cd1f9347928f61e098a8e7a41b3966fa79dfac80 --- /dev/null +++ b/game/modules/tome/data/zones/illusory-castle/objects.lua @@ -0,0 +1,21 @@ +load("/data/general/objects/objects.lua") + +-- Artifact, droped (and used!) by the Shade of Angmar +newEntity{ base = "BASE_STAFF", + define_as = "STAFF_ANGMAR", rarity=false, + name = "Angmar's Fall", unique=true, + desc = [[Made from the bones of of many creatures this staff glows with power. You can feel its evilness as you touch it.]], + require = { stat = { mag=25 }, }, + cost = 5, + combat = { + dam = 10, + apr = 0, + physcrit = 1.5, + dammod = {mag=1.1}, + }, + wielder = { + see_invisible = 2, + combat_spellpower = 15, + combat_spellcrit = 8, + }, +} diff --git a/game/modules/tome/data/zones/illusory-castle/traps.lua b/game/modules/tome/data/zones/illusory-castle/traps.lua new file mode 100644 index 0000000000000000000000000000000000000000..61e5f0daf639c9f18947c9f2431c5ccdc17720fc --- /dev/null +++ b/game/modules/tome/data/zones/illusory-castle/traps.lua @@ -0,0 +1 @@ +load("/data/general/traps/elemental.lua") diff --git a/game/modules/tome/data/zones/illusory-castle/zone.lua b/game/modules/tome/data/zones/illusory-castle/zone.lua new file mode 100644 index 0000000000000000000000000000000000000000..16b88e1fb9dcf4f2dc48028997c8302d56b4645a --- /dev/null +++ b/game/modules/tome/data/zones/illusory-castle/zone.lua @@ -0,0 +1,46 @@ +return { + name = "Illusory Castle", + level_range = {1, 5}, + level_scheme = "player", + max_level = 5, + width = 50, height = 50, + all_remembered = true, + all_lited = true, +-- persistant = true, + generator = { + map = { +-- class = "engine.generator.map.Rooms", + class = "engine.generator.map.TileSet", + tileset = "dungeon", + ['.'] = "FLOOR", + ['#'] = "WALL", + ['+'] = "DOOR", + up = "UP", + down = "DOWN", + door = "DOOR", + }, + actor = { + class = "engine.generator.actor.Random", + nb_npc = {0, 0}, + adjust_level = {-1, 2}, +-- guardian = "SHADE_OF_ANGMAR", -- The gardian is set in the static map + }, + object = { + class = "engine.generator.object.Random", + nb_object = {6, 9}, + filters = { {type="potion" }, {type="potion" }, {type="potion" }, {type="scroll" }, {}, {} } + }, + trap = { + class = "engine.generator.trap.Random", + nb_trap = {6, 9}, + }, + }, + levels = + { + [1] = { + generator = { map = { + up = "UP_WILDERNESS", + }, }, + }, + }, +} diff --git a/game/modules/tome/data/zones/tower-amon-sul/zone.lua b/game/modules/tome/data/zones/tower-amon-sul/zone.lua index b9f0b5474ed599863cea2bc5f8c49c8b498a9aa9..6e04b9eee4d99a47d269a094f1bfb300ab05b786 100644 --- a/game/modules/tome/data/zones/tower-amon-sul/zone.lua +++ b/game/modules/tome/data/zones/tower-amon-sul/zone.lua @@ -4,8 +4,8 @@ return { level_scheme = "player", max_level = 5, width = 50, height = 50, - all_remembered = true, - all_lited = true, +-- all_remembered = true, +-- all_lited = true, persistant = true, generator = { map = {