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

Removed Benevolent Spirit talent and replaced with Suppress Summoning

git-svn-id: http://svn.net-core.org/repos/t-engine4@1611 51575b47-30f0-44d4-a5cc-537603b46e54
parent 3f4707c2
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 65 deletions
......@@ -22,7 +22,7 @@ local Savefile = require "engine.Savefile"
local Dialog = require "engine.ui.Dialog"
local Map = require "engine.Map"
local Astar = require "engine.Astar"
--local print = function() end
local print = function() end
--- Defines a zone: a set of levels, with depth, nps, objects, level generator, ...
module(..., package.seeall, class.make)
......
......@@ -1591,6 +1591,7 @@ function _M:canBe(what)
if what == "instakill" and rng.percent(100 * (self:attr("instakill_immune") or 0)) then return false end
if what == "teleport" and rng.percent(100 * (self:attr("teleport_immune") or 0)) then return false end
if what == "worldport" and game.zone.no_worldport then return false end
if what == "summon" and self:attr("suppress_summon") then return false end
return true
end
......
......@@ -459,6 +459,8 @@ newEntity{
},
max_power = 100, power_regen = 1,
use_power = { name = "summon spiders", power = 80, use = function(self, who)
if not who:canBe("summon") then game.logPlayer(who, "You can not summon, you are suppressed!") return end
local NPC = require "mod.class.NPC"
local list = NPC:loadList("/data/general/npcs/spider.lua")
......
......@@ -60,15 +60,6 @@ newTalent{
local tg = {type="ball", range=self:getTalentRange(t), radius=1 + self:getTalentLevelRaw(t), talent=t}
target:project(tg, target.x, target.y, DamageType.SLIME, 18 + self:getWil(22) * self:getTalentLevel(t), {type="slime"})
target:die()
elseif target.name == "benevolent spirit" then
local tg = {type="ball", range=self:getTalentRange(t), radius=1 + self:getTalentLevelRaw(t), talent=t}
target:project(tg, target.x, target.y, function(tx, ty)
local a = game.level.map(tx, ty, Map.ACTOR)
if a and self:reactionToward(a) >= 0 then
a:heal(10 + self:getWil(30) * self:getTalentLevel(t))
end
end, nil, {type="acid"})
target:die()
else
game.logPlayer("You may not detonate this summon.")
return nil
......@@ -81,7 +72,6 @@ newTalent{
Only some summons can be detonated:
- Fire Imp: Explodes into a fireball
- Jelly: Explodes into a ball of slowing slime
- Benevolent Spirit: Explodes into a ball of healing
The effect improves with your Willpower.]]):format()
end,
}
......
......@@ -137,6 +137,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......@@ -207,6 +208,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......@@ -279,6 +281,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......@@ -352,6 +355,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......
......@@ -29,6 +29,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......@@ -95,6 +96,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......@@ -164,6 +166,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......@@ -238,6 +241,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......
......@@ -156,6 +156,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......@@ -225,6 +226,7 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
......@@ -283,71 +285,32 @@ newTalent{
}
newTalent{
name = "Benevolent Spirit",
name = "Suppress Summoning",
type = {"wild-gift/summon-utility", 3},
require = gifts_req3,
points = 5,
random_ego = "attack",
message = "@Source@ summons a Benevolent Spirit!",
equilibrium = 8,
equilibrium = 15,
cooldown = 18,
range = 20,
range = function(self, t) return 4 + self:getTalentLevel(t) * 3 end,
requires_target = true,
action = function(self, t)
if checkMaxSummon(self) then return end
local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
local tx, ty, target = self:getTarget(tg)
if not tx or not ty then return nil end
local _ _, tx, ty = self:canProject(tg, tx, ty)
target = game.level.map(tx, ty, Map.ACTOR)
if target == self then target = nil end
-- Find space
local x, y = util.findFreeGrid(tx, ty, 5, true, {[Map.ACTOR]=true})
if not x then
game.logPlayer(self, "Not enough space to summon!")
return
end
local NPC = require "mod.class.NPC"
local m = NPC.new{
type = "spirit", subtype = "lesser",
display = "G", color=colors.LIGHT_GREEN,
name = "benevolent spirit", faction = self.faction,
desc = [[]],
autolevel = "none",
ai = "summoned", ai_real = "dumb_heal_simple", ai_state = { talent_in=1, },
stats = { mag=15 + self:getWil() * self:getTalentLevel(t) / 5, wil=10 + self:getTalentLevel(t) * 2, con=10 + self:getTalentLevelRaw(self.T_RESILIENCE)*2 },
level_range = {self.level, self.level}, exp_worth = 0,
max_life = resolvers.rngavg(5,10),
life_rating = 8,
infravision = 20,
combat_armor = 0, combat_def = 0,
combat = { dam=1, atk=1, },
resolvers.talents{
[self.T_HEAL_OTHER]=self:getTalentLevelRaw(t),
[self.T_REGENERATE_OTHER]=self:getTalentLevelRaw(t),
},
summoner = self, summoner_gain_exp=true, wild_gift_summon=true,
summon_time = math.ceil(self:getTalentLevel(t)) + 5 + self:getTalentLevelRaw(self.T_RESILIENCE),
ai_target = {actor=target}
}
m:resolve() m:resolve(nil, true)
m:forceLevelup(self.level)
game.zone:addEntity(game.level, m, "actor", x, y)
game.level.map:particleEmitter(x, y, 1, "summon")
local dur = math.floor(5 + self:getTalentLevel(t))
local tg = {type="ball", range=0, radius=self:getTalentRange(t), friendlyfire=true, talent=t}
self:project(tg, self.x, self.y, function(px, py)
local target = game.level.map(px, py, Map.ACTOR)
if not target then return end
if not target:checkHit(self:combatMindpower(), target:combatMentalResist(), 10) then game.logSeen(target, "%s resists the suppression!", target.name:capitalize()) return end
target:setEffect(target.EFF_NO_SUMMON, dur, {})
game.level.map:particleEmitter(px, py, 1, "summon")
end)
game:playSoundNear(self, "talents/spell_generic")
return true
end,
info = function(self, t)
return ([[Summon a Benevolent Spirit to heal your allies and yourself.
It will get %d magic and %d willpower.]]):format(15 + self:getWil() * self:getTalentLevel(t) / 5, 10 + self:getTalentLevel(t) * 2)
return ([[Disrupts the local area, preventing any summons, including yours, for %d turns.
This talent will only prevent new summons, it does not remove existing ones.]]):
format(math.floor(5 + self:getTalentLevel(t)))
end,
}
......
......@@ -303,6 +303,8 @@ newTalent{
range = 20,
direct_hit = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
local filters = self.summon or {{type=self.type, subtype=self.subtype, number=1, hasxp=true, lastfor=20}}
if #filters == 0 then return end
local filter = rng.table(filters)
......
......@@ -112,6 +112,8 @@ newTalent{
},
requires_target = true,
action = function(self, t)
if not self:canBe("summon") then game.logPlayer(self, "You can not summon, you are suppressed!") return end
-- Find space
local x, y = util.findFreeGrid(self.x, self.y, 5, true, {[Map.ACTOR]=true})
if not x then
......
......@@ -1794,6 +1794,23 @@ newEffect{
end,
}
newEffect{
name = "NO_SUMMON",
desc = "Suppress Summon",
long_desc = function(self, eff) return "You can not summon." end,
type = "physical",
status = "detrimental",
parameters = {},
on_gain = function(self, err) return "#Target# attunes to the damage.", "+Resolve" end,
on_lose = function(self, err) return "#Target# is no longer attuned.", "-Resolve" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("suppress_summon", 1)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("suppress_summon", eff.tmpid)
end,
}
newEffect{
name = "RESOLVE",
desc = "Resolve",
......
......@@ -33,6 +33,8 @@ newEntity{ base = "BASE_AMULET",
},
max_power = 60, power_regen = 1,
use_power = { name = "summon an elder vampire to your side", power = 60, use = function(self, who)
if not who:canBe("summon") then game.logPlayer(who, "You can not summon, you are suppressed!") return end
-- Find space
local x, y = util.findFreeGrid(who.x, who.y, 5, true, {[engine.Map.ACTOR]=true})
if not x then
......
No preview for this file type
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