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

Anacondas dont stun, they constrict

git-svn-id: http://svn.net-core.org/repos/t-engine4@718 51575b47-30f0-44d4-a5cc-537603b46e54
parent 6163615c
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,6 @@ function _M:calc(sx, sy, tx, ty, use_has_seen, heuristic)
local came_from = {}
local cache = self.map._fovcache.path_caches[self.actor:getPathString()]
print("pathing using", self.actor:getPathString())
local checkPos
if cache then
checkPos = function(node, nx, ny)
......
......@@ -27,7 +27,8 @@ _M.tempeffect_def = {}
--- Defines actor temporary effects
-- Static!
function _M:loadDefinition(file)
local f = loadfile(file)
local f, err = loadfile(file)
if not f and err then error(err) end
setfenv(f, setmetatable({
DamageType = require "engine.DamageType",
newEffect = function(t) self:newEffect(t) end,
......
......@@ -35,7 +35,6 @@ function _M:bumpInto(target)
return self:attackTarget(target)
elseif reaction >= 0 then
-- Talk ?
print(self.player , target.can_talk)
if self.player and target.can_talk then
local chat = Chat.new(target.can_talk, target, self)
chat:invoke()
......
......@@ -107,13 +107,13 @@ newEntity{ base = "BASE_NPC_SNAKE",
newEntity{ base = "BASE_NPC_SNAKE",
name = "anaconda", color=colors.YELLOW_GREEN,
desc = [[You recoil in fear as you notice this huge, 10 meter long snake. It seeks to crush the life out of you.]],
level_range = {20, 50}, exp_worth = 1,
rarity = 11,
level_range = {1, 50}, exp_worth = 1,
rarity = 1,
rank = 9,
max_life = resolvers.rngavg(100,120),
combat_armor = 14, combat_def = 5,
combat = { dam=12, atk=10, apr=10 },
energy = { mod=0.8 },
resolvers.talents{ [Talents.T_STUN]=5 },
resolvers.talents{ [Talents.T_CONSTRICT]=5 },
}
......@@ -170,7 +170,37 @@ newTalent{
return true
end,
info = function(self, t)
return ([[Hits the target with your weapon doing %d%% damage, if the attack hits, the target is stunned.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
return ([[Hits the target doing %d%% damage, if the attack hits, the target is stunned.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
end,
}
newTalent{
name = "Constrict",
type = {"technique/other", 1},
points = 5,
cooldown = 6,
stamina = 8,
require = { stat = { str=12 }, },
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
local hit = self:attackTarget(target, nil, 0.5 + self:getTalentLevel(t) / 10, true)
-- Try to stun !
if hit then
if target:checkHit(self:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
target:setEffect(target.EFF_CONSTRICTED, (2 + self:getTalentLevel(t)) * 10, {src=self, power=1.5 * self:getTalentLevel(t)})
else
game.logSeen(target, "%s resists the constriction!", target.name:capitalize())
end
end
return true
end,
info = function(self, t)
return ([[Hits the target doing %d%% damage, if the attack hits, the target is constricted.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
end,
}
......
......@@ -157,6 +157,28 @@ newEffect{
end,
}
newEffect{
name = "CONSTRICTED",
desc = "Constricted",
type = "physical",
status = "detrimental",
parameters = {},
on_gain = function(self, err) return "#Target# is constricted!", "+Constricted" end,
on_lose = function(self, err) return "#Target# is free to breathe.", "-Constricted" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("never_move", 1)
end,
on_timeout = function(self, eff)
if math.floor(core.fov.distance(self.x, self.y, eff.src.x, eff.src.y)) > 1 then
return true
end
self:suffocate(eff.power, eff.src)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("never_move", eff.tmpid)
end,
}
newEffect{
name = "DAZED",
desc = "Dazed",
......
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