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

trollshaws, starting masteries

git-svn-id: http://svn.net-core.org/repos/t-engine4@188 51575b47-30f0-44d4-a5cc-537603b46e54
parent d2023d67
No related branches found
No related tags found
No related merge requests found
Showing
with 175 additions and 33 deletions
......@@ -125,7 +125,14 @@ function _M:apply()
end
if d.talents_types then
for t, v in pairs(d.talents_types) do
local mastery
if type(v) == "table" then
v, mastery = v[1], v[2]
else
v, mastery = v, 0
end
self.actor:learnTalentType(t, v)
self.actor.talents_types_mastery[t] = (self.actor.talents_types_mastery[t] or 1) + mastery
print(t)
end
end
......
......@@ -14,13 +14,16 @@ function _M:init(zone, map, level)
if data.adjust_level and game:getPlayer() then
self.adjust_level = {base=zone.base_level, min=data.adjust_level[1], max=data.adjust_level[2]}
end
self.filters = data.filters
self.nb_npc = data.nb_npc or {10, 20}
self.guardian = data.guardian
end
function _M:generate()
for i = 1, rng.range(self.nb_npc[1], self.nb_npc[2]) do
local m = self.zone:makeEntity(self.level, "actor")
local f = nil
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), rng.range(0, self.map.h)
local tries = 0
......
......@@ -14,13 +14,16 @@ function _M:init(zone, map, level)
if data.adjust_level_to_player and game:getPlayer() then
self.adjust_level_to_player = {base=game:getPlayer().level, min=data.adjust_level_to_player[1], max=data.adjust_level_to_player[2]}
end
self.filters = data.filters
self.nb_object = data.nb_object or {10, 20}
self.level_range = data.level_range or {level, level}
end
function _M:generate()
for i = 1, rng.range(self.nb_object[1], self.nb_object[2]) do
local o = self.zone:makeEntity(self.level, "object")
local f = nil
if self.filters then f = self.filters[rng.range(1, #self.filters)] end
local o = self.zone:makeEntity(self.level, "object", f)
if o then
local x, y = rng.range(0, self.map.w), rng.range(0, self.map.h)
local tries = 0
......
......@@ -32,10 +32,10 @@ newBirthDescriptor{
},
stats = { str=3, con=2, dex=1, },
talents_types = {
["physical/shield"]=true,
["physical/2hweapon"]=true,
["physical/combat-training"]=true,
["physical/weapon-training"]=true,
["physical/shield"]={true, 0.3},
["physical/2hweapon"]={true, 0.3},
["physical/combat-training"]={true, 0.3},
["physical/weapon-training"]={true, 0.3},
},
}
......@@ -75,14 +75,10 @@ newBirthDescriptor{
},
stats = { dex=3, wil=1, cun=3, },
talents_types = {
["physical/dualweapon"]=true,
["physical/combat-training"]=true,
["physical/weapon-training"]=true,
["cunning/stealth"]=true,
},
talents_types_mastery = {
["physical/dualweapon"]=0.2,
["cunning/stealth"]=0.3,
["physical/dualweapon"]={true, 0.3},
["physical/combat-training"]={true, 0},
["physical/weapon-training"]={true, 0},
["cunning/stealth"]={true, 0.3},
},
}
......@@ -119,18 +115,18 @@ newBirthDescriptor{
},
stats = { mag=3, wil=2, cun=1, },
talents_types = {
["spell/arcane"]=true,
["spell/fire"]=true,
["spell/earth"]=true,
["spell/water"]=true,
["spell/air"]=true,
["spell/mind"]=true,
["spell/temporal"]=true,
["spell/meta"]=true,
["spell/divination"]=true,
["spell/conveyance"]=true,
["spell/nature"]=true,
["spell/necromancy"]=true,
["spell/arcane"]={true, 0.3},
["spell/fire"]={true, 0.3},
["spell/earth"]={true, 0.3},
["spell/water"]={true, 0.3},
["spell/air"]={true, 0.3},
["spell/mind"]={true, 0.3},
["spell/temporal"]={true, 0.3},
["spell/meta"]={true, 0.3},
["spell/divination"]={true, 0.3},
["spell/conveyance"]={true, 0.3},
["spell/nature"]={true, 0.3},
["spell/necromancy"]={true, 0.3},
},
talents = {
ActorTalents.T_MANATHRUST, ActorTalents.T_FLAME, ActorTalents.T_FREEZE,
......
newEntity{
define_as = "BASE_GREATMAUL",
slot = "MAINHAND",
slot_forbid = "OFFHAND",
type = "weapon", subtype="greatmaul",
display = "\\", color=colors.SLATE,
encumber = 5,
rarity = 3,
combat = { talented = "mace", },
desc = [[Massive two-handed maul.]],
twohanded = true,
}
......@@ -10,6 +10,7 @@ load("/data/general/objects/swords.lua")
load("/data/general/objects/2hswords.lua")
load("/data/general/objects/knifes.lua")
--load("/data/general/objects/maces.lua")
load("/data/general/objects/2hmaces.lua")
--load("/data/general/objects/axes.lua")
-- Armours
......
......@@ -8,17 +8,17 @@ quickEntity('_', {name='river', display='~', color={r=0, g=80, b=255}})
quickEntity('*', {name="Dunadan's Outpost", display='*', color={r=255, g=255, b=255}})
quickEntity('1', {name="Caves below the tower of Amon Sûl", display='>', color={r=0, g=255, b=255}, change_level=1, change_zone="tower-amon-sul"})
quickEntity('2', {name="Ettenmoors's cavern", display='>', color={r=80, g=255, b=255}})
quickEntity('3', {name="Passageway into the Trollshaws", display='>', color={r=0, g=255, b=0}})
quickEntity('3', {name="Passageway into the Trollshaws", display='>', color={r=0, g=255, b=0}, change_level=1, change_zone="trollshaws"})
return {
[[W..........&&.....MM.]],
[[WW..........&&.....MM]],
[[WW...........3&&&...M]],
[[WW...........2&&&...M]],
[[WW..............&&..M]],
[[WW1......*_________MM]],
[[WW.....___.........MM]],
[[W....._............MM]],
[[.....__..tt2t......MM]],
[[.....__..tt3t......MM]],
[[....__.ttttttt....MM.]],
[[...._....tttt....MMM.]],
}
......@@ -13,10 +13,11 @@ newEntity{ define_as = "SHADE_OF_ANGMAR",
level_range = {7, 10}, exp_worth = 2,
max_life = 150, life_rating = 15, fixed_rating = true,
max_mana = 85,
stats = { str=20, dex=12, cun=14, mag=20, con=16 },
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="greatsword"}, {type="armor", subtype="light"}, },
equipment = resolvers.equip{ {type="weapon", subtype="stagg", name="STAFF_ANGMAR"}, {type="armor", subtype="light"}, },
drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} },
talents = resolvers.talents{
......
load("/data/general/objects/objects.lua")
-- Artifact, droped (and used!) by the Shade of Angmar
newEntity{ base = "BASE_STAFF",
define_as = "STAFF_ANGMAR",
name = "Angmar's Fall", unique=true,
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/grids/basic.lua")
load("/data/general/npcs/vermin.lua")
load("/data/general/npcs/molds.lua")
load("/data/general/npcs/skeleton.lua")
local Talents = require("engine.interface.ActorTalents")
-- The boss of trollshaws, no "rarity" field means it will not be randomly generated
newEntity{ define_as = "TROLL_BILL",
type = "giant", subtype = "troll", unique = true,
name = "Bill the Stone Troll",
display = "T", color=colors.VIOLET,
desc = [[Big, brawny, powerful and with a taste for hobbit. He has friends called Bert and Tom.
He is wielding a small tree trunk and towering toward you.
He should have turned to stone long ago, how could he still walk?!]],
level_range = {7, 10}, exp_worth = 2,
max_life = 250, life_rating = 17, fixed_rating = true,
max_stamina = 85,
stats = { str=25, dex=10, cun=8, mag=10, con=20 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{ {type="weapon", subtype="greatmaul", name="GREATMAUL_BILL_TRUNK"}, },
drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} },
talents = resolvers.talents{
[Talents.T_STAMINA_POOL]=1, [Talents.T_STUNNING_BLOW]=1,
},
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=4, },
}
load("/data/general/objects/objects.lua")
-- Artifact, droped (and used!) by Bill the Stone Troll
newEntity{ base = "BASE_GREATMAUL",
define_as = "GREATMAUL_BILL_TRUNK",
name = "Bill's Tree Trunk", unique=true,
require = { stat = { str=25 }, },
cost = 5,
combat = {
dam = 30,
apr = 7,
physcrit = 1.5,
dammod = {str=1.3},
},
}
return {
name = "Trollshaws",
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.Roomer",
nb_rooms = 10,
rooms = {"simple", "pilar"},
['.'] = "FLOOR",
['#'] = "WALL",
up = "UP",
down = "DOWN",
door = "DOOR",
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {20, 30},
ood = {chance=5, range={1, 10}},
adjust_level = {-1, 2},
guardian = "TROLL_BILL",
},
object = {
class = "engine.generator.object.Random",
nb_object = {2, 5},
ood = {chance=5, range={1, 10}},
},
},
levels =
{
[1] = {
generator = { map = {
up = "UP_WILDERNESS",
}, },
},
},
}
......@@ -7,13 +7,19 @@ function resolvers.calc.equip(t, e)
-- Iterate of object requests, try to create them and equip them
for i, filter in ipairs(t[1]) do
print("Equipment resolver", filter.type, filter.subtype)
local o = game.zone:makeEntity(game.level, "object", filter)
local o
if not filter.name then
o = game.zone:makeEntity(game.level, "object", filter)
else
o = game.zone:makeEntityByName(game.level, "object", filter.name)
end
if o then
print("Zone made us an equipment according to filter!", o:getName())
e:wearObject(o, true, false)
-- Do not drop it unless it is an ego or better
if not o.egoed and not o.unique then o.no_drop = true end
print(o.name, o.unique, o.no_drop)
end
end
-- Delete the origin field
......@@ -33,7 +39,12 @@ function resolvers.calc.drops(t, e)
for i = 1, (t.nb or 1) do
local filter = t[rng.range(1, #t)]
print("Drops resolver", filter.type, filter.subtype)
local o = game.zone:makeEntity(game.level, "object", filter)
local o
if not filter.name then
o = game.zone:makeEntity(game.level, "object", filter)
else
o = game.zone:makeEntityByName(game.level, "object", filter.name)
end
if o then
print("Zone made us an drop according to filter!", o:getName())
e:addObject(e.INVEN_INVEN, o)
......
File added
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