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

Every level of the High Peak is now guarded by a random unique

git-svn-id: http://svn.net-core.org/repos/t-engine4@3372 51575b47-30f0-44d4-a5cc-537603b46e54
parent bb5b4401
No related branches found
No related tags found
No related merge requests found
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011 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
require "engine.class"
local Map = require "engine.Map"
require "engine.Generator"
local Random = require "engine.generator.actor.Random"
--- Very specialized generator that puts sandworms in interesting spots to dig tunnels
module(..., package.seeall, class.inherit(Random))
function _M:init(zone, map, level, spots)
Random.init(self, zone, map, level, spots)
end
function _M:generate()
-- Add a guard on the stairs, except on the last level
local data = self.level.data.generator.actor
local glevel = self.zone.max_level
if self.level.level < glevel and self.level.default_down and data.guard then
local m = self.zone:makeEntity(self.level, "actor", rng.table(data.guard), nil, true)
if m then
local x, y = util.findFreeGrid(self.level.default_down.x, self.level.default_down.y, 5, true, {[Map.ACTOR]=true})
if x and y then
m.no_decay = true
self.zone:addEntity(self.level, m, "actor", x, y)
print("[RANDOM STAIR GUARD] placed guard", m.name)
end
end
end
-- Make the random generator place normal actors
Random.generate(self)
end
......@@ -37,30 +37,35 @@ newEntity{
newEntity{ base = "BASE_NPC_HUMANOID_RANDOM_BOSS",
name = "human", subtype = "human", color=colors.LIGHT_UMBER,
image = "player/cornac_male.png",
humanoid_random_boss = 1,
resolvers.racial(),
}
newEntity{ base = "BASE_NPC_HUMANOID_RANDOM_BOSS",
name = "thalore", subtype = "thalore", color=colors.LIGHT_GREEN,
image = "player/thalore_female.png",
humanoid_random_boss = 1,
resolvers.racial(),
}
newEntity{ base = "BASE_NPC_HUMANOID_RANDOM_BOSS",
name = "shalore", subtype = "shalore", color=colors.LIGHT_BLUE,
image = "player/shalore_male.png",
humanoid_random_boss = 1,
resolvers.racial(),
}
newEntity{ base = "BASE_NPC_HUMANOID_RANDOM_BOSS",
name = "halfling", subtype = "halfling", color=colors.BLUE,
image = "player/halfling_female.png",
humanoid_random_boss = 1,
resolvers.racial(),
}
newEntity{ base = "BASE_NPC_HUMANOID_RANDOM_BOSS",
name = "dwarf", subtype = "dwarf", color=colors.UMBER,
image = "player/dwarf_male.png",
humanoid_random_boss = 2,
resolvers.racial(),
}
......@@ -407,9 +407,9 @@ newTalent{
local NPC = require "mod.class.NPC"
local m = NPC.new{
type = "dragon", subtype = "fire",
display = "D", color=colors.RED, image = "npc/summoner_fire_drake.png",
display = "D", color=colors.RED, image = "npc/dragon_fire_fire_drake.png",
name = "fire drake", faction = self.faction,
desc = [[A mighty fire drake, an Uruloki.]],
desc = [[A mighty fire drake.]],
autolevel = "none",
ai = "summoned", ai_real = "tactical", ai_state = { talent_in=1, ally_compassion=10},
ai_tactic = resolvers.tactic"melee",
......
......@@ -209,7 +209,7 @@ newTalent{
local m = NPC.new{
type = "giant", subtype = "minotaur",
display = "H",
name = "minotaur", color=colors.UMBER, image = "npc/summoner_minotaur.png",
name = "minotaur", color=colors.UMBER, resolvers.nice_tile{image="invis.png", add_mos = {{image="npc/giant_minotaur_minotaur.png", display_h=2, display_y=-1}}},
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
......
......@@ -52,7 +52,15 @@ return {
door = "DOOR",
},
actor = {
class = "engine.generator.actor.Random",
class = "mod.class.generator.actor.RandomStairGuard",
guard = {
{special_rarity="humanoid_random_boss", random_boss={rank = 3.5, loot_quantity = 2,}},
{type="demon", subtype="major", random_boss={rank = 3.5, loot_quantity = 2,}},
{type="humanoid", subtype="naga", random_boss={rank = 3.5, loot_quantity = 2,}},
{type="humanoid", subtype="orc", random_boss={rank = 3.5, loot_quantity = 2,}},
{type="undead", subtype="giant", random_boss={rank = 3.5, loot_quantity = 2,}},
{type="horror", random_boss={rank = 3.5, loot_quantity = 2,}},
},
nb_npc = {20, 30},
},
object = {
......@@ -97,6 +105,7 @@ return {
map = "zones/high-peak-last",
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {0, 0},
},
},
......
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