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

continue adding Moria

Golbug as the boss, beware is a nasty
added wyrmic orcs
Orb of Many Ways

fixed all npcs to use auto_req for their stuff


git-svn-id: http://svn.net-core.org/repos/t-engine4@599 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0f6534c7
No related branches found
No related tags found
No related merge requests found
Showing
with 161 additions and 62 deletions
......@@ -144,7 +144,7 @@ function _M:loaded()
if v ~= nil then
t[x + y * self.w] = v
self._map:setSeen(x, y, v)
if v then self.has_seen[x + y * self.w] = true end
if v then self.has_seens[x + y * self.w] = true end
self.changed = true
end
return t[x + y * self.w]
......
......@@ -30,7 +30,7 @@ newAI("dumb_talented", function(self)
if t.mode == "activated" and not self:isTalentCoolingDown(t) and target_dist <= self:getTalentRange(t) and self:preUseTalent(t, true) and self:canProject({type="bolt"}, self.ai_target.actor.x, self.ai_target.actor.y) then
avail[#avail+1] = tid
print(self.name, self.uid, "dumb ai talents can use", t.name, tid)
elseif t.mode == "sustained" and not self:isTalentCoolingDown(t) and not self:isTalentActive(t) and self:preUseTalent(t, true) then
elseif t.mode == "sustained" and not self:isTalentCoolingDown(t) and not self:isTalentActive(t.id) and self:preUseTalent(t, true) then
avail[#avail+1] = tid
print(self.name, self.uid, "dumb ai talents can activate", t.name, tid)
end
......
......@@ -334,13 +334,14 @@ function _M:display()
self.target.target.x, self.target.target.y = tmx, tmy
end
self.old_tmx, self.old_tmy = tmx, tmy
--[[ too slow
if self.test_path and self.key.status[self.key._LSHIFT] then
for i, c in ipairs(self.test_path) do
local lx, ly = c.x, c.y
self.test_sprite:toScreen(self.level.map.display_x + (lx - game.level.map.mx) * self.level.map.tile_w, self.level.map.display_y + (ly - game.level.map.my) * self.level.map.tile_h)
end
end
]]
end
engine.GameTurnBased.display(self)
......@@ -435,7 +436,7 @@ function _M:setupCommands()
self.key:addCommands{
[{"_d","ctrl"}] = function()
if config.settings.tome.cheat then self:changeLevel(1, "moria") end
if config.settings.tome.cheat then self:changeLevel(3, "moria") end
end,
}
self.key:addBinds
......@@ -695,6 +696,7 @@ function _M:setupMouse()
end
game.level.map._map:setScroll(game.level.map.mx, game.level.map.my)
elseif button == "none" then
--[[ too slow
if self.key.status[self.key._LSHIFT] and (self.test_x ~= tmx or self.test_y ~= tmy) then
local a = Astar.new(self.level.map, self.player)
local path = a:calc(self.player.x, self.player.y, tmx, tmy, true)
......@@ -709,7 +711,7 @@ function _M:setupMouse()
self.test_sprite = core.display.newSurface(self.level.map.tile_w, self.level.map.tile_h)
self.test_sprite:erase(0, 0, 255, 90)
end
]]
end
end)
-- Scroll message log
......
......@@ -86,6 +86,7 @@ function _M:attackTarget(target, damtype, mult, noenergy)
if self:getInven(self.INVEN_MAINHAND) then
for i, o in ipairs(self:getInven(self.INVEN_MAINHAND)) do
if o.combat then
print("[ATTACK] attacking with", o.name)
local s, h = self:attackTargetWith(target, o.combat, damtype, mult)
speed = math.max(speed or 0, s)
hit = hit or h
......@@ -103,6 +104,7 @@ function _M:attackTarget(target, damtype, mult, noenergy)
end
for i, o in ipairs(self:getInven(self.INVEN_OFFHAND)) do
if o.combat then
print("[ATTACK] attacking with", o.name)
local s, h = self:attackTargetWith(target, o.combat, damtype, offmult)
speed = math.max(speed or 0, s)
hit = hit or h
......@@ -114,6 +116,7 @@ function _M:attackTarget(target, damtype, mult, noenergy)
-- Barehanded ?
if not speed and self.combat then
print("[ATTACK] attacking with inate combat")
local s, h = self:attackTargetWith(target, self.combat, damtype, mult)
speed = math.max(speed or 0, s)
hit = hit or h
......
......@@ -30,3 +30,7 @@ newAchievement{
name = "The secret city",
desc = [[Discovered the truth about mages.]],
}
newAchievement{
name = "Sliders",
desc = [[Activated a portal using the Orb of Many Ways.]],
}
......@@ -28,14 +28,14 @@ newEntity{
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
resolvers.drops{chance=20, nb=1, {} },
resolvers.drops{chance=20, nb=1, {type="money"} },
resolvers.drops{chance=10, nb=1, {type="money"} },
life_rating = 11,
rank = 2,
size_category = 3,
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=4, },
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
energy = { mod=1 },
stats = { str=20, dex=8, mag=6, con=16 },
}
......@@ -48,7 +48,7 @@ newEntity{ base = "BASE_NPC_ORC",
rarity = 4,
max_life = resolvers.rngavg(70,80),
resolvers.equip{
{type="weapon", subtype="longsword", autoreq=true},
{type="weapon", subtype="waraxe", autoreq=true},
{type="armor", subtype="shield", autoreq=true},
},
combat_armor = 2, combat_def = 0,
......@@ -72,3 +72,55 @@ newEntity{ base = "BASE_NPC_ORC",
{type="ammo", subtype="arrow", autoreq=true},
},
}
newEntity{ base = "BASE_NPC_ORC",
name = "uruk-hai", color=colors.DARK_RED,
desc = [[A fierce soldier-orc.]],
level_range = {1, 50}, exp_worth = 1,
rarity = 6,
max_life = resolvers.rngavg(120,140),
life_rating = 11,
resolvers.equip{
{type="weapon", subtype="battleaxe", autoreq=true},
},
combat_armor = 2, combat_def = 0,
resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=2, [Talents.T_CRUSH]=2, },
}
newEntity{ base = "BASE_NPC_ORC",
name = "fiery wyrmic uruk-hai", color=colors.RED,
desc = [[A fierce soldier-orc trained in the discipline of dragons.]],
level_range = {1, 50}, exp_worth = 1,
rarity = 8,
rank = 3,
max_life = resolvers.rngavg(100,110),
life_rating = 10,
resolvers.equip{
{type="weapon", subtype="battleaxe", autoreq=true},
},
combat_armor = 2, combat_def = 0,
resolvers.talents{
[Talents.T_BELLOWING_ROAR]=2,
[Talents.T_WING_BUFFET]=2,
[Talents.T_FIRE_BREATH]=2,
},
}
newEntity{ base = "BASE_NPC_ORC",
name = "icy wyrmic uruk-hai", color=colors.BLUE,
desc = [[A fierce soldier-orc trained in the discipline of dragons.]],
level_range = {1, 50}, exp_worth = 1,
rarity = 8,
rank = 3,
max_life = resolvers.rngavg(100,110),
life_rating = 10,
resolvers.equip{
{type="weapon", subtype="battleaxe", autoreq=true},
},
combat_armor = 2, combat_def = 0,
resolvers.talents{
[Talents.T_ICE_CLAW]=2,
[Talents.T_ICY_SKIN]=2,
[Talents.T_ICE_BREATH]=2,
},
}
......@@ -62,3 +62,35 @@ newEntity{ define_as = "STAFF_ABSORPTION",
end
end,
}
newEntity{ define_as = "ORB_MANY_WAYS",
unique = true, quest=true,
type = "jewelry", subtype="orb",
unided_name = "swirling orb",
name = "Orb of Many Ways",
level_range = {30, 30},
display = "*", color=colors.VIOLET,
encumber = 1,
desc = [[The orb projects images of distance places, some that seem to not be of this world, switching rapidly.
If used near an portal it could probably activate it.]],
max_power = 50, power_regen = 1,
use_power = { name = "activate a portal", power = 25,
use = function(self, who)
local g = game.level.map(who.x, who.y, game.level.map.TERRAIN)
if g and g.orb_portal then
world:gainAchievement("SLIDERS", who:resolveSource())
game:changeLevel(g.orb_portal.level, g.orb_portal.zone)
else
game.logPlayer(who, "There is no portal to activate here.")
end
end
},
on_drop = function(self, who)
if who == game.player then
game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName())
return true
end
end,
}
......@@ -44,8 +44,8 @@ newEntity{ define_as = "MINOTAUR_MAZE",
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, HEAD=1, },
equipment = resolvers.equip{
{type="weapon", subtype="battleaxe"},
{type="armor", subtype="head", defined="HELM_OF_HAMMERHAND"},
{type="weapon", subtype="battleaxe", autoreq=true},
{type="armor", subtype="head", defined="HELM_OF_HAMMERHAND", autoreq=true},
},
drops = resolvers.drops{chance=100, nb=5, {ego_chance=100} },
......
......@@ -17,69 +17,64 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
load("/data/general/npcs/skeleton.lua")
load("/data/general/npcs/ghoul.lua")
load("/data/general/npcs/wight.lua")
load("/data/general/npcs/vampire.lua")
load("/data/general/npcs/orc.lua")
load("/data/general/npcs/toll.lua")
local Talents = require("engine.interface.ActorTalents")
-- The boss of Tol Falas, no "rarity" field means it will not be randomly generated
newEntity{ define_as = "THE_MASTER",
type = "undead", subtype = "vampire", unique = true,
name = "The Master",
display = "V", color=colors.VIOLET,
desc = [[This elder vampire seems to be in control here and does not seem very happy about you.]],
level_range = {23, 45}, exp_worth = 2,
max_life = 350, life_rating = 19, fixed_rating = true,
max_mana = 145,
max_stamina = 145,
rank = 5,
-- The boss of Moria, no "rarity" field means it will not be randomly generated
newEntity{ define_as = "GOLBUG",
type = "humanoid", subtype = "orc", unique = true,
name = "Golbug the Destroyer",
display = "o", color=colors.VIOLET,
desc = [[A huge and muscular orc of unknown breed. He looks both menacing and cunning...]],
level_range = {28, 45}, exp_worth = 2,
max_life = 350, life_rating = 16, fixed_rating = true,
max_stamina = 245,
rank = 4,
size_category = 3,
stats = { str=19, dex=19, cun=34, mag=25, con=16 },
stats = { str=22, dex=19, cun=34, mag=10, con=16 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, NECK=1, },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, NECK=1, HEAD=1, },
equipment = resolvers.equip{
{type="weapon", subtype="greatsword", ego_chance=100},
{type="armor", subtype="heavy", ego_chance=50},
{type="jewelry", subtype="amulet", defined="AMULET_DREAD"},
{type="weapon", subtype="mace", ego_chance=100, autoreq=true},
{type="armor", subtype="shield", ego_chance=100, autoreq=true},
{type="armor", subtype="head", autoreq=true},
{type="armor", subtype="massive", ego_chance=50, autoreq=true},
},
resolvers.drops{chance=100, nb=5, {ego_chance=100} },
resolvers.drops{chance=100, nb=1, {type="weapon", subtype="staff", defined="STAFF_ABSORPTION"} },
resolvers.drops{chance=100, nb=1, {type="jewelry", subtype="orb", defined="ORB_MANY_WAYS"} },
summon = {
{type="undead", number=2, hasxp=true},
{type="humanoid", subtype="orc", number=2, hasxp=true},
{type="humanoid", subtype="troll", number=1, hasxp=true},
},
blind_immune = 1,
stun_immone = 0.7,
see_invisible = 20,
undead = 1,
stun_immune = 1,
see_invisible = 5,
resolvers.talents{
[Talents.T_SUMMON]=1,
[Talents.T_HEAVY_ARMOUR_TRAINING]=1,
[Talents.T_MANA_POOL]=1,
[Talents.T_CONGEAL_TIME]=2,
[Talents.T_MANATHRUST]=4,
[Talents.T_FREEZE]=4,
[Talents.T_PHASE_DOOR]=2,
[Talents.T_STRIKE]=3,
[Talents.T_MASSIVE_ARMOUR_TRAINING]=1,
[Talents.T_WEAPON_COMBAT]=6,
[Talents.T_MACE_MASTERY]=6,
[Talents.T_STAMINA_POOL]=1,
[Talents.T_SWORD_MASTERY]=3,
[Talents.T_STUNNING_BLOW]=1,
[Talents.T_SHIELD_PUMMEL]=4,
[Talents.T_RUSH]=4,
[Talents.T_SPELL_SHIELD]=4,
[Talents.T_RIPOSTE]=4,
[Talents.T_BLINDING_SPEED]=4,
[Talents.T_PERFECT_STRIKE]=3,
[Talents.T_OVERPOWER]=3,
[Talents.T_ASSAULT]=3,
[Talents.T_SHIELD_WALL]=3,
[Talents.T_SHIELD_EXPERTISE]=2,
},
autolevel = "warriormage",
ai = "dumb_talented_simple", ai_state = { talent_in=1, },
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=2, },
on_die = function(self, who)
world:gainAchievement("VAMPIRE_CRUSHER", who:resolveSource())
who:resolveSource():grantQuest("tol-falas")
who:resolveSource():setQuestStatus("tol-falas", engine.Quest.DONE)
-- who:resolveSource():grantQuest("tol-falas")
-- who:resolveSource():setQuestStatus("tol-falas", engine.Quest.DONE)
end,
}
......@@ -21,10 +21,10 @@ return {
name = "Mines of Moria",
level_range = {20, 30},
level_scheme = "player",
max_level = 7,
max_level = 4,
decay = {300, 800},
actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end,
width = 140, height = 140,
width = 100, height = 100,
all_remembered = true,
all_lited = true,
-- persistant = "zone",
......@@ -40,12 +40,12 @@ return {
up = "UP",
down = "DOWN",
},
--[[
actor = {
class = "engine.generator.actor.Random",
nb_npc = {20, 30},
guardian = "THE_MASTER",
guardian = "GOLBUG",
},
--[[
object = {
class = "engine.generator.object.Random",
nb_object = {6, 9},
......@@ -64,5 +64,16 @@ return {
up = "UP_WILDERNESS",
}, },
},
[4] = {
generator = {
map = {
class = "engine.generator.map.Static",
map = "zones/moria-last",
},
actor = {
nb_npc = {7, 7},
},
},
},
},
}
......@@ -48,7 +48,7 @@ newEntity{ define_as = "OLD_MAN_WILLOW",
resists = { [DamageType.FIRE] = -50 },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{ {type="armor", subtype="shield", defined="OLD_MAN_WILLOW_SHIELD"}, },
equipment = resolvers.equip{ {type="armor", subtype="shield", defined="OLD_MAN_WILLOW_SHIELD", autoreq=true}, },
drops = resolvers.drops{chance=100, nb=5, {ego_chance=100} },
resolvers.talents{
......
......@@ -40,9 +40,9 @@ newEntity{ define_as = "THE_MASTER",
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, NECK=1, },
equipment = resolvers.equip{
{type="weapon", subtype="greatsword", ego_chance=100},
{type="armor", subtype="heavy", ego_chance=50},
{type="jewelry", subtype="amulet", defined="AMULET_DREAD"},
{type="weapon", subtype="greatsword", ego_chance=100, autoreq=true},
{type="armor", subtype="heavy", ego_chance=50, autoreq=true},
{type="jewelry", subtype="amulet", defined="AMULET_DREAD", autoreq=true},
},
resolvers.drops{chance=100, nb=5, {ego_chance=100} },
resolvers.drops{chance=100, nb=1, {type="weapon", subtype="staff", defined="STAFF_ABSORPTION"} },
......@@ -52,7 +52,7 @@ newEntity{ define_as = "THE_MASTER",
},
blind_immune = 1,
stun_immone = 0.7,
stun_immune = 0.7,
see_invisible = 20,
undead = 1,
......
......@@ -40,7 +40,7 @@ newEntity{ define_as = "SHADE_OF_ANGMAR",
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="staff", defined="STAFF_ANGMAR"}, {type="armor", subtype="light"}, },
equipment = resolvers.equip{ {type="weapon", subtype="staff", defined="STAFF_ANGMAR", autoreq=true}, {type="armor", subtype="light", autoreq=true}, },
drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} },
resolvers.talents{
......
......@@ -44,7 +44,7 @@ newEntity{ define_as = "TROLL_BILL",
size_category = 4,
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{ {type="weapon", subtype="greatmaul", defined="GREATMAUL_BILL_TRUNK"}, },
equipment = resolvers.equip{ {type="weapon", subtype="greatmaul", defined="GREATMAUL_BILL_TRUNK", autoreq=true}, },
drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} },
resolvers.talents{
......
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