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

New random encounter in the far east: the shadow crypt

git-svn-id: http://svn.net-core.org/repos/t-engine4@1791 51575b47-30f0-44d4-a5cc-537603b46e54
parent 9cb16720
No related branches found
No related tags found
No related merge requests found
Showing
with 247 additions and 1 deletion
......@@ -61,6 +61,16 @@ newAI("target_player_radius", function(self)
end
end)
-- Target the player if within sense radius or if in sight
newAI("target_simple_or_player_radius", function(self)
if self:runAI("target_simple") then return true end
if core.fov.distance(self.x, self.y, game.player.x, game.player.y) < self.ai_state.sense_radius then
self.ai_target.actor = game.player
return true
end
end)
-- Special targetting for charred scar, select a normal target, if none is found go for the player
newAI("charred_scar_target", function(self)
if self:runAI("target_simple") then return true end
......
......@@ -722,6 +722,8 @@ function _M:onTakeHit(value, src)
end
end
if self.on_takehit then value = self:check("on_takehit", value, src) end
return value
end
......
......@@ -686,7 +686,7 @@ function _M:setupCommands()
a.faction = "enemies"
self.zone:addEntity(self.level, a, "actor", self.player.x+1, self.player.y)
--]]
-- self.state:generateRandart(false)
self:changeLevel(3, "shadow-crypt")
end
end,
}
......
......@@ -137,3 +137,7 @@ newAchievement{
name = "Arachnophobia", id = "SPYDRIC_INFESTATION",
desc = [[Destroyed the spydric menace.]],
}
newAchievement{
name = "Clone War", id = "SHADOW_CLONE",
desc = [[Destroyed your own Shade.]],
}
......@@ -43,3 +43,26 @@ newEntity{
return true
end,
}
newEntity{
name = "Shadow Crypt",
type = "hostile", subtype = "special", unique = true,
level_range = {34, 45},
rarity = 6,
on_encounter = function(self, who)
local x, y = self:findSpot(who)
if not x then return end
local g = mod.class.Grid.new{
show_tooltip=true,
name="Entrance to a dark crypt",
display='>', color=colors.GREY,
notice = true,
change_level=1, change_zone="shadow-crypt"
}
g:resolve() g:resolve(nil, true)
game.zone:addEntity(game.level, g, "terrain", x, y)
game.logPlayer(who, "#LIGHT_BLUE#You notice an entrance to a dark crypt. Fetid wind seems to come out of it.")
return true
end
}
-- 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
local Talents = require("engine.interface.ActorTalents")
-- Shades are very special, tehy are not monsters on their own, they are shades of some other monster
newEntity{
define_as = "BASE_NPC_SHADE",
type = "undead", subtype = "shade",
display = "G", color=colors.DARK_GREY,
resolvers.generic(function(e)
local base = game.zone:makeEntity(game.level, "actor", e.shade_filter, nil , true)
while base.unique do base = game.zone:makeEntity(game.level, "actor", e.shade_filter, nil , true) end
base.color_r = e.color_r
base.color_g = e.color_g
base.color_b = e.color_b
base.desc = e.desc
e:replaceWith(base)
-- Make the shade nasty
e.name = "shade of "..e.name
e.can_pass = {pass_wall=70}
e.undead = 1
e.no_breath = 1
e.stone_immune = 1
e.confusion_immune = 1
e.fear_immune = 1
e.teleport_immune = 1
e.disease_immune = 1
e.poison_immune = 1
e.stun_immune = 1
e.blind_immune = 1
e.see_invisible = 80
e.max_life = e.max_life * 0.50
e.life = e.max_life
e.resists.all = 20
-- AI
e.ai_state.sense_radius = 6
e.ai_state.ai_target = "target_simple_or_player_radius"
-- No escorts
e.make_escort = nil
-- Remove some talents
local tids = {}
for tid, _ in pairs(e.talents) do tids[#tids+1] = tid end
local nb = math.floor(#tids / 4)
for i = 1, nb do
local tid = rng.tableRemove(tids)
e.talents[tid] = nil
end
-- Summon shady friends (if possible)
e.summon = { {type="undead", subtype="shade", number=1, hasxp=false}, }
-- Give some talents
local rtals = {
{tid=e.T_SUMMON, level=1},
{tid=e.T_DRAIN, level=4},
{tid=e.T_EMPATHIC_HEX, level=3},
{tid=e.T_MIND_SEAR, level=4},
{tid=e.T_VIRULENT_DISEASE, level=4},
{tid=e.T_CYST_BURST, level=3},
}
for i = 1, 3 do
local t = rng.tableRemove(rtals)
e.talents[t.tid] = t.level
end
end),
}
newEntity{ base = "BASE_NPC_SHADE",
rarity = 1, level_range = {30, nil},
desc = [[Through some terrible process that remains mysterious, this creature shadow has been torn from its body and given unlife.]],
shade_filter = {type="animal", special_rarity="shade_rarity"},
}
newEntity{ base = "BASE_NPC_SHADE",
rarity = 1, level_range = {30, nil},
desc = [[Through some terrible process that remains mysterious, this creature shadow has been torn from its body and given unlife.]],
shade_filter = {type="humanoid", special_rarity="shade_rarity"},
}
newEntity{ base = "BASE_NPC_SHADE",
rarity = 1, level_range = {30, nil},
desc = [[Through some terrible process that remains mysterious, this creature shadow has been torn from its body and given unlife.]],
shade_filter = {type="giant", special_rarity="shade_rarity"},
}
......@@ -159,6 +159,7 @@ addZone({64, 52, 66, 53}, "zonename", "Tar'Eyal")
addZone({11, 87, 16, 94}, "zonename", "Tar'Eyal")
addZone({54, 23, 65, 37}, "world-encounter", "lumberjack-cursed")
addZone({3, 15, 19, 33}, "world-encounter", "angolwen")
addZone({136, 43, 145, 55}, "world-encounter", "shadow-crypt")
-- ASCII map section
return {
......
-- 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
defineTile('<', "UP")
defineTile("#", "OLD_WALL")
defineTile(".", "FLOOR")
defineTile("@", "FLOOR", nil, "CULTIST_RAK_SHOR")
startx = 7
starty = 13
-- ASCII map section
return [[
###############
##...........##
#.............#
#..##.....##..#
#..##.....##..#
#.............#
#......@......#
#.............#
#.............#
#.............#
#..##.....##..#
#..##.....##..#
#.............#
##...........##
###############]]
......@@ -115,6 +115,7 @@ newTalent{
cooldown = 20,
vim = 30,
range = 30,
no_npc_use = true,
direct_hit = true,
requires_target = true,
action = function(self, t)
......
......@@ -50,6 +50,7 @@ newTalent{
MOVE = 10,
},
range = 20,
no_npc_use = true,
action = function(self, t)
local eff = self.sustain_talents[self.T_JUMPGATE]
if not eff then
......@@ -80,6 +81,7 @@ newTalent{
points = 5,
cooldown = 20,
negative_sustain = 20,
no_npc_use = true,
tactical = {
MOVE = 10,
},
......@@ -156,6 +158,7 @@ newTalent{
},
requires_target = true,
range = 10,
no_npc_use = true,
action = function(self, t)
local tg = {type="bolt", range=self:getTalentRange(t), talent=t}
local tx, ty, target = self:getTarget(tg)
......
......@@ -25,6 +25,7 @@ newTalent{
message = "@Source@ meditates on nature.",
cooldown = 150,
range = 20,
no_npc_use = true,
action = function(self, t)
local seen = false
-- Check for visible monsters, only see LOS actors, so telepathy wont prevent it
......@@ -89,6 +90,7 @@ newTalent{ short_name = "NATURE_TOUCH",
cooldown = 20,
range = 1,
requires_target = true,
no_npc_use = true,
action = function(self, t)
local tg = {default_target=self, type="hit", nowarning=true, range=self:getTalentRange(t), first_target="friend"}
local x, y, target = self:getTarget(tg)
......@@ -117,6 +119,7 @@ newTalent{
cooldown = 10,
range = 100,
requires_target = true,
no_npc_use = true,
action = function(self, t)
local x, y = self:getTarget{type="ball", nolock=true, no_restrict=true, nowarning=true, range=100, radius=math.ceil(3 + self:getTalentLevel(t))}
if not x then return nil end
......
......@@ -30,6 +30,7 @@ newTalent{
ATTACK = 10,
},
requires_target = true,
no_npc_use = true,
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(tg)
......@@ -68,6 +69,7 @@ newTalent{
ATTACKAREA = 10,
},
range = 20,
no_npc_use = true,
action = function(self, t)
local tg = {type="ball", range=0, friendlyfire=false, radius=2 + self:getTalentLevel(t) / 2, talent=t, no_restrict=true}
self:project(tg, self.x, self.y, DamageType.PHYSKNOCKBACK, {dam=self:combatDamage() * 0.8, dist=4})
......
......@@ -323,6 +323,7 @@ newTalent{
cooldown = 10,
range = 20,
requires_target = true,
no_npc_use = true,
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t), nolock=true, talent=t, first_target="friend"}
local tx, ty, target = self:getTarget(tg)
......
......@@ -125,6 +125,7 @@ newTalent{
name = "Teleport: Angolwen",
type = {"base/class", 1},
cooldown = 1000,
no_npc_use = true,
no_silence=true, is_spell=true,
action = function(self, t)
if not self:canBe("worldport") then
......
......@@ -66,6 +66,7 @@ newTalent{
range = 10,
mana = 5,
requires_target = true,
no_npc_use = true,
action = function(self, t)
local mover, golem = getGolem(self)
if not golem then
......@@ -119,6 +120,7 @@ newTalent{
points = 5,
mana = 40,
cooldown = 60,
no_npc_use = true,
action = function(self, t)
local mover, golem = getGolem(self)
if not golem then
......
......@@ -58,6 +58,7 @@ newTalent{
mana = 15,
cooldown = 10,
no_energy = true,
no_npc_use = true,
action = function(self, t)
local tg = {type="hit", nolock=true, pass_terrain=true, nowarning=true, range=100, requires_knowledge=false}
x, y = self:getTarget(tg)
......@@ -92,6 +93,7 @@ newTalent{
random_ego = "utility",
mana = 20,
cooldown = 20,
no_npc_use = true,
action = function(self, t)
self:magicMap(5 + self:combatTalentSpellDamage(t, 2, 12))
game:playSoundNear(self, "talents/spell_generic")
......
......@@ -76,6 +76,7 @@ newTalent{
points = 1,
cooldown = 20,
mana = 10,
no_npc_use = true,
action = function(self, t)
if not self.alchemy_golem then
self.alchemy_golem = game.zone:finishEntity(game.level, "actor", makeGolem())
......@@ -173,6 +174,7 @@ newTalent{
range = 10,
mana = 5,
requires_target = true,
no_npc_use = true,
action = function(self, t)
local mover, golem = getGolem(self)
if not golem then
......@@ -207,6 +209,7 @@ newTalent{
range = 10,
mana = 5,
requires_target = true,
no_npc_use = true,
action = function(self, t)
local mover, golem = getGolem(self)
if not golem then
......@@ -264,6 +267,7 @@ newTalent{
range = 10,
mana = 5,
requires_target = true,
no_npc_use = true,
action = function(self, t)
local mover, golem = getGolem(self)
if not golem then
......@@ -319,6 +323,7 @@ newTalent{
points = 5,
mana = 10,
cooldown = 20,
no_npc_use = true,
action = function(self, t)
local mover, golem = getGolem(self)
if not golem then
......
......@@ -26,6 +26,7 @@ newTalent{
return math.ceil(5 + self:getDex(12))
end,
mana = 30,
no_npc_use = true,
make_gem = function(self, t, base_define)
local nb = rng.range(40, 80)
local gem = game.zone:makeEntityByName(game.level, "object", "ALCHEMIST_" .. base_define)
......@@ -63,6 +64,7 @@ newTalent{
points = 5,
mana = 5,
cooldown = 20,
no_npc_use = true,
action = function(self, t)
self:showEquipInven("Try to extract gems from which metallic item?", function(o) return o.metallic and (o.material_level or 1) <= self:getTalentLevelRaw(t) end, function(o, inven, item)
self:removeObject(inven, item)
......@@ -89,6 +91,7 @@ newTalent{
points = 5,
mana = 80,
cooldown = 100,
no_npc_use = true,
action = function(self, t)
self:showInventory("Use which gem?", self:getInven("INVEN"), function(gem) return gem.type == "gem" and gem.material_level <= self:getTalentLevelRaw(t) end, function(gem, gem_item)
self:showInventory("Imbue which armour?", self:getInven("INVEN"), function(o) return o.type == "armor" and o.slot == "BODY" and not o.been_imbued end, function(o, item)
......@@ -115,6 +118,7 @@ newTalent{
mana = 20,
points = 5,
range = 1,
no_npc_use = true,
action = function(self, t)
local ammo = self:hasAlchemistWeapon()
if not ammo or ammo:getNumber() < 5 then
......
......@@ -168,6 +168,7 @@ newTalent{
cooldown = 30,
sustain_stamina = 30,
require = techs_dex_req1,
no_npc_use = true,
on_kill = function(self, t, who)
-- Can not work without a correct weapon
if not self:getInven("MAINHAND") then return nil end
......
-- 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
load("/data/general/grids/basic.lua")
newEntity{
define_as = "QUICK_EXIT",
name = "teleporting circle to the surface", image = "terrain/maze_teleport.png",
display = '>', color_r=255, color_g=0, color_b=255,
notice = true, show_tooltip = true,
change_level = 1, change_zone = "wilderness",
}
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