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

Rod of Recall will not drop in tutorial mode

git-svn-id: http://svn.net-core.org/repos/t-engine4@2566 51575b47-30f0-44d4-a5cc-537603b46e54
parent ee21fa18
No related branches found
No related tags found
No related merge requests found
......@@ -146,6 +146,8 @@ function _M:newGame()
-- Create the entity to store various game state things
self.state = GameState.new{}
local birth_done = function()
if self.player.__allow_rod_recall then game.state:allowRodRecall(true) self.player.__allow_rod_recall = nil end
for i = 1, 50 do
local o = self.state:generateRandart(true)
self.zone.object_list[#self.zone.object_list+1] = o
......
......@@ -32,6 +32,12 @@ function _M:init(t, no_default)
self.world_artifacts_pool = {}
end
--- Allow dropping the rod of recall
function _M:allowRodRecall(v)
if v == nil then return self.allow_drop_recall end
self.allow_drop_recall = v
end
--- Discovered the far east
function _M:goneEast()
self.gone_east = true
......
......@@ -193,11 +193,11 @@ function _M:die(src)
return
end
if self.rank >= 4 and not game.state.droped_rod_recall then
if self.rank >= 4 and game.state:allowRodRecall() then
local rod = game.zone:makeEntityByName(game.level, "object", "ROD_OF_RECALL")
if rod then
game.zone:addEntity(game.level, rod, "object", self.x, self.y)
game.state.droped_rod_recall = true
game.state:allowRodRecall(false)
end
end
......
......@@ -101,6 +101,9 @@ newBirthDescriptor{
"But what lurks in the shadows of the world?",
},
descriptor_choices = default_eyal_descriptors,
copy = {
__allow_rod_recall = true,
}
}
newBirthDescriptor{
......
......@@ -295,7 +295,7 @@ newEntity{ define_as = "ORB_SCRYING",
}
newEntity{ base = "BASE_WAND",
power_source = {unknown=true},
power_source = {unknown=true, arcane=false},
define_as = "ROD_OF_RECALL",
unided_name = "unstable wand", identified=true, force_lore_artifact=true,
name = "Rod of Recall", color=colors.LIGHT_BLUE, unique=true,
......
......@@ -157,6 +157,8 @@ newTalent{
local tg = {type="hit", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(tg)
if not x or not y then return nil end
local actor = game.level.map(x, y, Map.ACTOR)
if not actor then return true end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
local knockback = t.getKnockback(self, t)
forceHit(self, target, self.x, self.y, dam, knockback, 15, 1)
......@@ -246,6 +248,8 @@ newTalent{
local tg = {type="beam", range=self:getTalentRange(t), talent=t, display={particle="bolt_fire", trail="firetrail"}}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
local actor = game.level.map(x, y, Map.ACTOR)
if math.floor(core.fov.distance(self.x, self.y, x, y)) == 1 and not actor then return true end
self:project(tg, x, y, DamageType.FIREBURN, self:spellCrit(rng.avg(0.8*dam, dam)))
local _ _, x, y = self:canProject(tg, x, y)
game.level.map:particleEmitter(self.x, self.y, tg.radius, "flamebeam", {tx=x-self.x, ty=y-self.y})
......
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