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

lost merchant can be talked to

new zone: unremarkable cave (no entarnce yet)


git-svn-id: http://svn.net-core.org/repos/t-engine4@784 51575b47-30f0-44d4-a5cc-537603b46e54
parent 7c0deee7
No related branches found
No related tags found
No related merge requests found
Showing
with 431 additions and 20 deletions
......@@ -237,7 +237,7 @@ function _M:finishEntity(level, type, e, ego_chance)
local picked_etype = {}
local etype = rng.tableIndex(e.egos_chance, picked_etype)
local echance = etype and e.egos_chance[etype]
while etype and rng.percent(util.bound(echance + (ego_chance or 0), 100, 100)) do
while etype and rng.percent(util.bound(echance + (ego_chance or 0), 0, 100)) do
picked_etype[etype] = true
if _G.type(etype) == "number" then etype = "" end
local egos = level:getEntitiesList(type.."/"..e.egos..":"..etype)
......
......@@ -33,6 +33,7 @@ function _M:init(zone, map, level, spots)
end
self.filters = data.filters
self.nb_npc = data.nb_npc or {10, 20}
self.area = data.area or {x1=0, x2=self.map.w-1, y1=0, y2=self.map.h-1}
self.guardian = data.guardian
self.post_generation = data.post_generation
end
......@@ -45,10 +46,10 @@ function _M:generate()
if self.guardian then
local m = self.zone:makeEntityByName(self.level, "actor", self.guardian)
if m then
local x, y = rng.range(0, self.map.w-1), rng.range(0, self.map.h-1)
local x, y = rng.range(self.area.x1, self.area.x2), rng.range(self.area.y1, self.area.y2)
local tries = 0
while (not m:canMove(x, y) or self.map.room_map[x][y].special) and tries < 100 do
x, y = rng.range(0, self.map.w-1), rng.range(0, self.map.h-1)
x, y = rng.range(self.area.x1, self.area.x2), rng.range(self.area.y1, self.area.y2)
tries = tries + 1
end
if tries < 100 then
......@@ -67,10 +68,10 @@ function _M:generateOne()
if self.filters then f = self.filters[rng.range(1, #self.filters)] end
local m = self.zone:makeEntity(self.level, "actor", f)
if m then
local x, y = rng.range(0, self.map.w-1), rng.range(0, self.map.h-1)
local x, y = rng.range(self.area.x1, self.area.x2), rng.range(self.area.y1, self.area.y2)
local tries = 0
while (not m:canMove(x, y) or self.map.room_map[x][y].special) and tries < 100 do
x, y = rng.range(0, self.map.w-1), rng.range(0, self.map.h-1)
x, y = rng.range(self.area.x1, self.area.x2), rng.range(self.area.y1, self.area.y2)
tries = tries + 1
end
if tries < 100 then
......
......@@ -49,8 +49,8 @@ function _M:loadMap(file)
subGenerator = function(g)
self.subgen[#self.subgen+1] = g
end,
defineTile = function(char, grid, obj, actor, trap)
t[char] = {grid=grid, obj=obj, actor=actor, trap=trap}
defineTile = function(char, grid, obj, actor, trap, status)
t[char] = {grid=grid, obj=obj, actor=actor, trap=trap, status=status}
end,
quickEntity = function(char, e)
if type(e) == "table" then
......@@ -132,6 +132,7 @@ function _M:generate(lev, old_lev)
local actor = self.tiles[c] and self.tiles[c].actor
local trap = self.tiles[c] and self.tiles[c].trap
local object = self.tiles[c] and self.tiles[c].object
local status = self.tiles[c] and self.tiles[c].status
if object then
local o = type(object) == "string" and self.zone:makeEntityByName(self.level, "object", object) or self.zone:finishEntity(self.level, "object", object)
......@@ -158,6 +159,11 @@ function _M:generate(lev, old_lev)
self.zone:addEntity(self.level, m, "actor", i-1, j-1)
end
end
if status then
if status.lite then self.level.map.lites(i-1, j-1, true) end
if status.remember then self.level.map.remembers(i-1, j-1, true) end
end
end end
for i = 1, #self.subgen do
......
......@@ -78,6 +78,7 @@ function _M:computeFOV(radius, block, apply, force, no_store, cache)
local t = {x=x,y=y, dx=dx, dy=dy, sqdist=sqdist}
fov.actors[a] = t
fov.actors_dist[#fov.actors_dist+1] = a
a:check("seen_by", self)
a:updateFOV(self, t.sqdist)
end
end, cache and game.level.map._fovcache[block])
......
......@@ -529,7 +529,7 @@ function _M:setupCommands()
self.key:addCommands{
[{"_d","ctrl"}] = function()
if config.settings.tome.cheat then
self:changeLevel(1, "carn-dum")
self:changeLevel(1, "unremarkable-cave")
end
end,
}
......
......@@ -43,11 +43,11 @@ function _M:bumpInto(target)
chat:invoke()
elseif self.move_others then
-- Displace
game.level.map:remove(self.x, self.y, Map.ACTOR)
game.level.map:remove(target.x, target.y, Map.ACTOR)
game.level.map(self.x, self.y, Map.ACTOR, target)
game.level.map(target.x, target.y, Map.ACTOR, self)
self.x, self.y, target.x, target.y = target.x, target.y, self.x, self.y
local tx, ty, sx, sy = target.x, target.y, self.x, self.y
target.x = nil target.y = nil
self.x = nil self.y = nil
target:move(sx, sy, true)
self:move(tx, ty, true)
end
end
end
......
......@@ -44,6 +44,7 @@ newBirthDescriptor{
name = "Sun Paladin",
desc = {
"Sun Paladins hail from the Gates of Morning, the last bastion of the free people in the Far East.",
"Their way of life is well represented by their motto 'We walk in the dark places no others will enter. We stand on the bridge, and no one may pass.'",
"They can channel the power of the Sun to smite all who seek to destroy the Sunwall.",
"Competent in both weapon and shield combat and magic they usually burn their foes from afar before engaging in melee.",
"Their most important stats are: Strength and Magic",
......
-- ToME - Tales of Middle-Earth
-- 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
newChat{ id="welcome",
text = [[Please save me! I will make it worth your ti..
*#LIGHT_GREEN#The assasin lord hits him in the mouth.#WHITE#*Shut up!]],
answers = {
{"Sorry I have to go!"},
}
}
return "welcome"
-- ToME - Tales of Middle-Earth
-- 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 function attack_krogar(npc, player)
local fillarel, krogar
for uid, e in pairs(game.level.entities) do
if e.define_as == "FILLAREL" and not e.dead then fillarel = e
elseif e.define_as == "CORRUPTOR" and not e.dead then krogar = e end
end
krogar.faction = "enemies"
fillarel.inc_damage = {all=-80}
fillarel:setTarget(krogar)
krogar:setTarget(filarel)
end
local function attack_fillarel(npc, player)
local fillarel, krogar
for uid, e in pairs(game.level.entities) do
if e.define_as == "FILLAREL" and not e.dead then fillarel = e
elseif e.define_as == "CORRUPTOR" and not e.dead then krogar = e end
end
fillarel.faction = "enemies"
krogar.inc_damage = {all=-80}
fillarel:setTarget(krogar)
krogar:setTarget(filarel)
end
newChat{ id="welcome",
text = [[#LIGHT_GREEN#*A beautiful elven woman in golden robes stands before you, she faces an orc clad in mail armour.*#WHITE#
Fillarel: "Abandon this fight Orc! You can not win, I stand with the power of the sun and the shadows of the moon."
Krogar: "Ah! It's only been one hour and you already look tired, my 'lady'."
#LIGHT_GREEN#*As you enter the room they notice you.*#WHITE#
Fillarel: "You! @playerdescriptor.race@! help me defeat this monster or be gone with him!"
Krogar: "Ah looking for help? Bah. @playerdescriptor.race@, kill this bitch for me and I shall reward you!"]],
answers = {
{"[attack Krogar]", action=attack_krogar},
{"[attack Fillarel]", action=attack_fillarel},
}
}
return "welcome"
-- ToME - Tales of Middle-Earth
-- 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
newChat{ id="welcome",
text = [[Thanks @playername@, I hate to admit it, but you saved my life.]],
answers = {
{"At your service. But may I ask what where you doing in this dark place?", jump="what"},
{"It was only natural my lady."},
}
}
newChat{ id="what",
text = [[I am an Anorithil, a mage of the Sun and Moon, we fight all that is evil. I was there with a group of sun paladins, we came from the Gates of Morning to the east.
They got ... slaughtered by orcs and I nearly died too, thank you again for your help.]],
answers = {
{"It was only natural my lady.", action=function(npc, player) game:setAllowedBuild("divine") game:setAllowedBuild("divine_anorithil", true) end},
}
}
return "welcome"
......@@ -58,7 +58,7 @@ for i, line in ipairs(lines) do
end
else
local n = tonumber(d)
if n then
if n then print(j, i, factsid[j], factsid[i], n*100)
facts[factsid[j]].reactions[factsid[i]] = n * 100
end
end
......@@ -71,3 +71,6 @@ for f1, data in pairs(facts) do
engine.Faction:setInitialReaction(f1, f2, v, true)
end
end
engine.Faction:add{ name="Neutral", reaction={}, }
engine.Faction:setInitialReaction("neutral", "enemies", -100, true)
......@@ -72,6 +72,7 @@ defineTile('@', "FLOOR", nil, mod.class.NPC.new{
size_category = 3,
ai = "simple",
faction = "reunited-kingdom",
can_talk = "lost-merchant",
is_merchant = true,
})
......
-- ToME - Tales of Middle-Earth
-- 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('.', "FLOOR", nil, nil, nil, {lite=true})
defineTile('#', "WALL", nil, nil, nil, {lite=true})
defineTile('+', "DOOR", nil, nil, nil, {lite=true})
defineTile('@', "FLOOR", nil, "FILLAREL", nil, {lite=true})
defineTile('M', "FLOOR", nil, "CORRUPTOR", nil, {lite=true})
subGenerator{
x = 0, y = 0, w = 86, h = 50,
generator = "engine.generator.map.Roomer",
data = {
edge_entrances = {4,6},
nb_rooms = 13,
rooms = {"simple", "pilar"},
['.'] = "FLOOR",
['#'] = "WALL",
up = "UP",
door = "DOOR",
force_tunnels = {
{"random", {85, 25}, id=-500},
},
},
define_up = true,
}
checkConnectivity({87,25}, "entrance", "boss-area", "boss-area")
return [[
##############
##############
##############
##############
##############
##############
##############
##############
##############
##############
##############
##############
##############
#######.######
#####.....####
###.........##
##...........#
#............#
#............#
#............#
#......@.....#
#............#
#............#
#............#
#............#
+............#
#............#
#............#
#............#
#............#
#......M.....#
#............#
#............#
##...........#
####.......###
#####.....####
#######.######
##############
##############
##############
##############
##############
##############
##############
##############
##############
##############
##############
##############
##############]]
......@@ -79,11 +79,11 @@ newTalent{
self:setEffect(self.EFF_EVASION, dur, {chance=50})
-- Displace
game.level.map:remove(self.x, self.y, Map.ACTOR)
game.level.map:remove(target.x, target.y, Map.ACTOR)
game.level.map(self.x, self.y, Map.ACTOR, target)
game.level.map(target.x, target.y, Map.ACTOR, self)
self.x, self.y, target.x, target.y = target.x, target.y, self.x, self.y
local tx, ty, sx, sy = target.x, target.y, self.x, self.y
target.x = nil target.y = nil
self.x = nil self.y = nil
target:move(sx, sy, true)
self:move(tx, ty, true)
end
return true
......
......@@ -23,8 +23,9 @@ In the uttermost east of Arda, on the continent known as the Far East, dwells th
Anorithil are elven mages who are trained in special magic to manipulate the Sun and Moon powers.
They have learned to harness the powers of both shadows and light in their battle against the Pride.
Their motto is: "I am Grey. I stand between the candle and the star. We are Grey. We stand between the darkness and the light."
You have discovered the Gates of Morning and can now create new characters with the #LIGHT_GREEN#Anorithil class#WHITE#.
You have helped one of them and can now create new characters with the #LIGHT_GREEN#Anorithil class#WHITE#.
Anorithil are pure spellcasters that rely on posivite and negative energies.
Class features:#YELLOW#
......
......@@ -23,6 +23,7 @@ In the uttermost east of Arda, on the continent known as the Far East, dwells th
Sun Paladins are humans warriors who are trained in special magic to manipulate the Sun powers.
Paragons of all that is good they are nonetheless terrible in their battle against the Pride.
Their motto is: "We walk in the dark places no others will enter. We stand on the bridge, and no one may pass."
You have discovered the Gates of Morning and can now create new characters with the #LIGHT_GREEN#Sun Paladin class#WHITE#.
......
-- ToME - Tales of Middle-Earth
-- 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")
-- ToME - Tales of Middle-Earth
-- 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/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")
newEntity{ define_as = "FILLAREL",
type = "humanoid", subtype = "elf", unique = true,
name = "Fillarel Aldaren", faction = "neutral",
display = "@", color=colors.GOLD,
desc = [[An elven women. She wears a tight robe decorated with symbols of the sun and the moon and wields a staff.]],
level_range = {25, 35}, exp_worth = 2,
max_life = 120, life_rating = 15, fixed_rating = true,
positive_regen = 10,
negative_regen = 10,
rank = 4,
size_category = 3,
stats = { str=10, dex=22, cun=25, mag=20, con=12 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{
{type="weapon", subtype="staff", ego_chance=100, autoreq=true},
{type="armor", subtype="cloth", ego_chance=100, autoreq=true},
},
drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} },
resolvers.talents{
[Talents.T_MOONLIGHT_RAY]=4,
[Talents.T_STARFALL]=5,
[Talents.T_SHADOW_BLAST]=3,
[Talents.T_SEARING_LIGHT]=4,
[Talents.T_FIREBEAM]=4,
[Talents.T_SUNBURST]=3,
[Talents.T_HYMN_OF_SHADOWS]=2,
[Talents.T_CHANT_OF_FORTITUDE]=2,
},
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { talent_in=1, ai_move="move_astar" },
on_added = function(self)
self.energy.value = game.energy_to_act self:useTalent(self.T_HYMN_OF_SHADOWS)
self.energy.value = game.energy_to_act self:useTalent(self.T_CHANT_OF_FORTITUDE)
end,
seen_by = function(self, who)
if not self.has_been_seen and who.player then
local Chat = require("engine.Chat")
local chat = Chat.new("unremarkable-cave-bosses", self, who)
chat:invoke()
self.has_been_seen = true
end
end,
can_talk = "unremarkable-cave-fillarel",
on_die = function(self, who)
-- game.player:resolveSource():setQuestStatus("start-dunadan", engine.Quest.COMPLETED, "amon-sul")
end,
}
newEntity{ define_as = "CORRUPTOR",
type = "humanoid", subtype = "orc", unique = true,
name = "Krogar", faction = "neutral",
display = "@", color=colors.GREEN,
desc = [[An orc clad in mail armour, he wields a staff and looks menacing.]],
level_range = {25, 35}, exp_worth = 2,
max_life = 120, life_rating = 15, fixed_rating = true,
positive_regen = 10,
negative_regen = 10,
rank = 4,
size_category = 3,
stats = { str=10, dex=22, cun=25, mag=20, con=12 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{
{type="weapon", subtype="staff", ego_chance=100, autoreq=true},
{type="armor", subtype="heavy", ego_chance=100, autoreq=true},
},
drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} },
resolvers.talents{
[Talents.T_HEAVY_ARMOUR_TRAINING]=3,
[Talents.T_MOONLIGHT_RAY]=4,
[Talents.T_STARFALL]=5,
[Talents.T_SHADOW_BLAST]=3,
[Talents.T_SEARING_LIGHT]=4,
[Talents.T_FIREBEAM]=4,
[Talents.T_SUNBURST]=3,
[Talents.T_HYMN_OF_SHADOWS]=2,
[Talents.T_CHANT_OF_FORTITUDE]=2,
},
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { talent_in=1, ai_move="move_astar" },
on_die = function(self, who)
-- game.player:resolveSource():setQuestStatus("start-dunadan", engine.Quest.COMPLETED, "amon-sul")
end,
}
-- ToME - Tales of Middle-Earth
-- 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/objects/objects.lua")
-- ToME - Tales of Middle-Earth
-- 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/traps/elemental.lua")
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