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

fix cloned actor placement

Objects default to price 0
only one hymn is usable at a time


git-svn-id: http://svn.net-core.org/repos/t-engine4@806 51575b47-30f0-44d4-a5cc-537603b46e54
parent cde044fb
No related branches found
No related tags found
No related merge requests found
......@@ -102,7 +102,12 @@ function _M:move(x, y, force)
end
self.old_x, self.old_y = self.x or x, self.y or y
self.x, self.y = x, y
if map(x, y, Map.ACTOR) then
print("[MOVE] WARNING erasing actor!!!")
util.show_backtrace()
end
map(x, y, Map.ACTOR, self)
-- print("[MOVE]", self.uid, x, y)
-- Update particle emitters attached to that actor
for e, _ in pairs(self.__particles) do
......
......@@ -301,6 +301,9 @@ end
-- @param y the coordinates where to add it. This CAN be null in which case it wont be added to the map
function _M:addEntity(level, e, typ, x, y)
if typ == "actor" then
-- We are additing it, this means there is no old position
e.x = nil
e.y = nil
if x and y then e:move(x, y, true) end
level:addEntity(e)
e:added()
......
......@@ -401,6 +401,7 @@ function util.findFreeGrid(sx, sy, radius, block, what)
for x, yy in pairs(grids) do for y, _ in pairs(yy) do
local ok = true
for w, _ in pairs(what) do
-- print("findFreeGrid test", x, y, w, ":=>", game.level.map(x, y, w))
if game.level.map(x, y, w) then ok = false end
end
if game.level.map:checkEntity(x, y, game.level.map.TERRAIN, "block_move") then ok = false end
......@@ -420,6 +421,7 @@ function util.findFreeGrid(sx, sy, radius, block, what)
end
end)
-- print("findFreeGrid using", gs[1][1], gs[1][2])
return gs[1][1], gs[1][2]
end
......
......@@ -308,5 +308,5 @@ end
--- Get item cost
function _M:getPrice()
return self.cost
return self.cost or 0
end
......@@ -72,7 +72,7 @@ newTalent{
return true
end,
info = function(self, t)
return ([[Designate a target as martyr. When the martyr deals damage it also damages it for %d%%.
return ([[Designate a target as martyr. When the martyr deals damage it also damages itself for %d%% of its damage dealt.
The damage percent will increase with the Magic stat]]):
format(
8 * self:getTalentLevelRaw(t)
......
......@@ -18,7 +18,7 @@
-- darkgod@te4.org
local function cancelHymns(self)
local hymns = {self.T_HYMN_OF_SHADOW, self.T_HYMN_OF_DETECTION, self.T_HYMN_OF_PERSEVERANCE, self.T_HYMN_OF_MOONLIGHT}
local hymns = {self.T_HYMN_OF_SHADOWS, self.T_HYMN_OF_DETECTION, self.T_HYMN_OF_PERSEVERANCE, self.T_HYMN_OF_MOONLIGHT}
for i, t in ipairs(hymns) do
if self:isTalentActive(t) then
local old = self.energy.value
......
......@@ -68,9 +68,9 @@ newTalent{
range = 6,
action = function(self, t)
local tg = {type="ball", range=0, friendlyfire=true, radius=2 + self:getTalentLevel(t) / 2, talent=t}
self:project(tg, self.x, self.y, DamageType.LITE, 1)
tg.friendlyfire = false
local grids = self:project(tg, self.x, self.y, DamageType.BLIND, 3 + self:getTalentLevel(t))
self:project(tg, self.x, self.y, DamageType.LITE, 1)
if self:getTalentLevel(t) then
self:project(tg, self.x, self.y, DamageType.LIGHT, 4 + self:combatSpellpower(0.15) * self:getTalentLevel(t))
end
......
......@@ -155,7 +155,7 @@ newTalent{
if not target or self:reactionToward(target) >= 0 then return end
-- Find space
local x, y = util.findFreeGrid(tx, ty, 5, true, {[Map.ACTOR]=true})
local x, y = util.findFreeGrid(tx, ty, 1, true, {[Map.ACTOR]=true})
if not x then
game.logPlayer(self, "Not enough space to summon!")
return
......@@ -166,8 +166,10 @@ newTalent{
faction = self.faction,
summoner = self, summoner_gain_exp=true,
summon_time = math.ceil(self:getTalentLevel(t)) + 3,
ai_target = {actor=target}
ai_target = {actor=target},
ai = "summoned", ai_real = target.ai,
}
m.energy.value = 0
m.life = m.life / 2
game.zone:addEntity(game.level, m, "actor", x, 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