Skip to content
Snippets Groups Projects
Commit 9da56c34 authored by dg's avatar dg
Browse files

fix a few things

allows dumb talented Ai to activate (but not deactivate) sustained talents


git-svn-id: http://svn.net-core.org/repos/t-engine4@395 51575b47-30f0-44d4-a5cc-537603b46e54
parent 58bb18bb
No related branches found
No related tags found
No related merge requests found
Showing
with 142 additions and 9 deletions
......@@ -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
......
......@@ -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)
......
......@@ -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)
......
......@@ -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
......
......@@ -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)
......
......@@ -27,7 +27,6 @@ tiles =
},
{type="tunnel",
{
[[#####]],
[[#####]],
[[.....]],
......@@ -158,4 +157,25 @@ tiles =
[[....#]],
[[#####]],
},
{type="room",
[[#####]],
[[.....]],
[[#+++#]],
[[.....]],
[[#####]],
},
{type="room",
[[##+##]],
[[##.##]],
[[#...#]],
[[#...#]],
[[#...#]],
},
{type="room",
[[#...#]],
[[#...#]],
[[#...#]],
[[##.##]],
[[##+##]],
},
}
load("/data/general/grids/basic.lua")
--[=[
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
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,
},
}
load("/data/general/traps/elemental.lua")
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",
}, },
},
},
}
......@@ -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 = {
......
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