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

nasty surprise for the Master

monster escorts
2 new unique random boss


git-svn-id: http://svn.net-core.org/repos/t-engine4@715 51575b47-30f0-44d4-a5cc-537603b46e54
parent 15bb32ed
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ require "engine.Dialog"
module(..., package.seeall, class.inherit(engine.Dialog))
_M.birth_descriptor_def = {}
_M.birth_auto = {}
--- Defines birth descriptors
-- Static!
......@@ -32,6 +33,7 @@ function _M:loadDefinition(file)
setfenv(f, setmetatable({
ActorTalents = require("engine.interface.ActorTalents"),
newBirthDescriptor = function(t) self:newBirthDescriptor(t) end,
setAuto = function(type, v) self.birth_auto[type] = v end,
load = function(f) self:loadDefinition(f) end
}, {__index=_G}))
f()
......@@ -118,7 +120,7 @@ end
function _M:prev()
if self.cur_order == 1 then
if #self.list == 1 then self:next() end
if #self.list == 1 and self.birth_auto[self.current_type] ~= false then self:next() end
return
end
if not self.list then return end
......@@ -145,7 +147,7 @@ function _M:next()
end
end
self:selectType(self.order[self.cur_order])
if #self.list == 1 then
if #self.list == 1 and self.birth_auto[self.current_type] ~= false then
self:next()
end
end
......
......@@ -297,6 +297,7 @@ function _M:addEntity(level, e, typ, x, y)
elseif typ == "terrain" then
if x and y then level.map(x, y, Map.TERRAIN, e) end
end
e:check("addedToLevel", level, x, y)
e:check("on_added", level, x, y)
end
......
......@@ -996,3 +996,22 @@ end
function _M:projected(tx, ty, who, t, x, y, damtype, dam, particles)
return false
end
--- Call when added to a level
-- Used to make escorts and such
function _M:addedToLevel(level, x, y)
if self.make_escort then
for _, filter in ipairs(self.make_escort) do
for i = 1, filter.number do
-- Find space
local x, y = util.findFreeGrid(self.x, self.y, 10, true, {[Map.ACTOR]=true})
if not x then break end
-- Find an actor with that filter
local m = game.zone:makeEntity(game.level, "actor", filter)
if m then game.zone:addEntity(game.level, m, "actor", x, y) end
end
end
self.make_escort = nil
end
end
......@@ -526,7 +526,7 @@ function _M:setupCommands()
self.key:addCommands{
[{"_d","ctrl"}] = function()
if config.settings.tome.cheat then
self:changeLevel(1, "test")
self:changeLevel(1, "tol-falas")
end
end,
}
......
......@@ -56,6 +56,57 @@ function _M:onTakeHit(value, src)
return mod.class.Actor.onTakeHit(self, value, src)
end
function _M:die(src)
-- Sefl resurrect, mouhaha!
if self:attr("self_resurrect") then
self:attr("self_resurrect", -1)
game.logSeen(src, "#LIGHT_RED#%s raises from the dead!", self.name:capitalize()) -- src, not self as the source, to make sure the player knows his doom ;>
local sx, sy = game.level.map:getTileToScreen(self.x, self.y)
game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, "RESURRECT!", {255,120,0})
local effs = {}
-- Go through all spell effects
for eff_id, p in pairs(self.tmp) do
local e = self.tempeffect_def[eff_id]
effs[#effs+1] = {"effect", eff_id}
end
-- Go through all sustained spells
for tid, act in pairs(self.sustain_talents) do
if act then
effs[#effs+1] = {"talent", tid}
end
end
while #effs > 0 do
local eff = rng.tableRemove(effs)
if eff[1] == "effect" then
self:removeEffect(eff[2])
else
local old = self.energy.value
self:useTalent(eff[2])
-- Prevent using energy
self.energy.value = old
end
end
self.life = self.max_life
self.mana = self.max_mana
self.stamina = self.max_stamina
self.equilibrium = 0
self.air = self.max_air
self.dead = false
self.died = (self.died or 0) + 1
self:move(self.x, self.y, true)
return
end
return mod.class.Actor.die(self, src)
end
function _M:tooltip()
local str = mod.class.Actor.tooltip(self)
return str..([[
......
......@@ -17,6 +17,8 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
setAuto("subclass", false)
newBirthDescriptor{
type = "base",
name = "base",
......@@ -106,8 +108,9 @@ newBirthDescriptor{
"All damage done to the player increased by 20%",
"All damage done by the player decreased by 20%",
"All healing for the player decreased by 20%",
"Player rank is normal instead of elite",
},
copy = { resolvers.generic(function() game.difficulty = game.DIFFICULTY_INSANE end) },
copy = { resolvers.generic(function() game.difficulty = game.DIFFICULTY_INSANE end), rank=2 },
}
......
......@@ -31,7 +31,7 @@ newEntity{
stats = { str=12, dex=10, mag=3, con=13 },
energy = { mod=1 },
combat_armor = 1, combat_def = 1,
combat = { dam=5, atk=15, apr=7 },
combat = { dam=5, atk=15, apr=7, dammod={str=0.6} },
max_life = resolvers.rngavg(10,20),
rank = 1,
size_category = 1,
......@@ -151,3 +151,22 @@ newEntity{ base = "BASE_NPC_ANT",
max_life = resolvers.rngavg(50,60),
combat_armor = 15, combat_def = 7,
}
newEntity{ base = "BASE_NPC_ANT",
name = "Queen Ant", color=colors.VIOLET, unique=true,
desc = "Queen of the ants, queen of the biting death!",
level_range = {25, 50}, exp_worth = 2,
rank = 4,
size_category = 3,
rarity = 50,
max_life = 230, life_rating=12,
combat_armor = 18, combat_def = 7,
resolvers.drops{chance=100, nb=12, {type="money"} },
make_escort = {
{type="insect", subtype="ant", number=resolvers.mbonus(5, 5)},
},
summon = {
{type="insect", subtype="ant", number=2, hasexp=false},
},
resolvers.talents{ [Talents.T_STUN]=3, [Talents.T_ACIDIC_SKIN]=5, [Talents.T_SUMMON]=1,},
}
......@@ -32,9 +32,10 @@ newEntity{
size_category = 2,
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=10, },
ai = "dumb_talented_simple", ai_state = { talent_in=2, },
energy = { mod=1.1 },
stats = { str=10, dex=17, mag=3, con=7 },
combat = { dammod={str=0.6} },
combat_armor = 1, combat_def = 1,
}
......@@ -99,3 +100,23 @@ newEntity{ base = "BASE_NPC_CANINE",
combat_armor = 1, combat_def = 3,
combat = { dam=4, atk=10, apr=3 },
}
newEntity{ base = "BASE_NPC_CANINE",
name = "Rungof the Warg Titan", color=colors.VIOLET,
desc = [[It is a large wolf with eyes full of cunning, only 3 times bigger than a normal warg.]],
level_range = {20, 50}, exp_worth = 2,
rank = 4,
size_category = 4,
rarity = 50,
max_life = 220,
combat_armor = 25, combat_def = 0,
combat = { dam=20, atk=20, apr=16 },
make_escort = {
{type="animal", subtype="canine", name="warg", number=6},
},
resolvers.talents{
[Talents.T_RUSH]=3,
[Talents.T_CRIPPLE]=3,
},
}
......@@ -101,6 +101,11 @@ newEntity{ base = "BASE_NPC_THIEF",
combat_armor = 5, combat_def = 7,
max_life = resolvers.rngavg(90,100),
combat = { dam=resolvers.rngavg(6,7), atk=10, apr=4},
make_escort = {
{type="humanoid", subtype="human", name="bandit", number=2},
{type="humanoid", subtype="human", name="thief", number=2},
{type="humanoid", subtype="human", name="rogue", number=2},
},
summon = {
{type="humanoid", subtype="human", name="bandit", number=1, hasxp=false},
{type="humanoid", subtype="human", name="bandit", number=1, hasxp=false},
......
......@@ -126,4 +126,7 @@ newEntity{ base = "BASE_NPC_VAMPIRE",
ai = "dumb_talented_simple", ai_state = { talent_in=4, },
summon = {{type="undead", number=1, hasxp=false}, },
resolvers.talents{ [Talents.T_STUN]=4, [Talents.T_SUMMON]=1, [Talents.T_BLUR_SIGHT]=4, [Talents.T_PHANTASMAL_SHIELD]=5, [Talents.T_ROTTING_DISEASE]=5, },
make_escort = {
{type="undead", number=resolvers.mbonus(2, 2)},
},
}
......@@ -86,7 +86,7 @@ newEntity{ base = "BASE_NPC_WIGHT",
}
newEntity{ base = "BASE_NPC_WIGHT",
name = "barrow wight", color=colors.VIOLET,
name = "barrow wight", color=colors.LIGHT_RED,
desc=[[It is a ghostly nightmare of an entity.]],
level_range = {25, 50}, exp_worth = 1,
rarity = 8,
......@@ -107,6 +107,9 @@ newEntity{ base = "BASE_NPC_WIGHT",
max_life = resolvers.rngavg(100,150),
max_mana = resolvers.rngavg(300,350),
combat_armor = 12, combat_def = 10,
make_escort = {
{type="undead", subtype="wights", number=resolvers.mbonus(2, 2)},
},
resolvers.talents{ [Talents.T_MANA_POOL]=3, [Talents.T_FLAMESHOCK]=3, [Talents.T_LIGHTNING]=4, [Talents.T_CORROSIVE_VAPOUR]=3, [Talents.T_THUNDERSTORM]=2,
[Talents.T_MIND_DISRUPTION]=4,
},
......
......@@ -56,6 +56,7 @@ newEntity{ define_as = "THE_MASTER",
stun_immune = 0.7,
see_invisible = 20,
undead = 1,
self_resurrect = 1,
resolvers.talents{
[Talents.T_SUMMON]=1,
......
No preview for this file type
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