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

Shadowblades now have "Shadow magic"

nobody regens mana but mages


git-svn-id: http://svn.net-core.org/repos/t-engine4@654 51575b47-30f0-44d4-a5cc-537603b46e54
parent 96441fd0
No related branches found
No related tags found
No related merge requests found
Showing
with 166 additions and 5 deletions
......@@ -145,6 +145,7 @@ function _M:act()
end
if self:attr("stunned") then self.energy.value = 0 end
if self:attr("dazed") then self.energy.value = 0 end
-- Suffocate ?
local air_level, air_condition = game.level.map:checkEntity(self.x, self.y, Map.TERRAIN, "air_level"), game.level.map:checkEntity(self.x, self.y, Map.TERRAIN, "air_condition")
......@@ -351,6 +352,11 @@ end
--- Called before taking a hit, it's the chance to check for shields
function _M:onTakeHit(value, src)
-- Un-daze
if self:hasEffect(self.EFF_DAZED) then
self:removeEffect(self.EFF_DAZED)
end
if self:attr("invulnerable") then
return 0
end
......
......@@ -296,6 +296,14 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
end
end end
-- Shadow cast
if hitted and self:knowTalent(self.T_SHADOW_COMBAT) and self:isTalentActive(self.T_SHADOW_COMBAT) and self:getMana() > 0 then
local dam = 3 + self:getTalentLevel(self.T_SHADOW_COMBAT) * 2
local mana = 1 + self:getTalentLevelRaw(t) / 1.5
DamageType:get(DamageType.DARKNESS).projector(self, target.x, target.y, DamageType.DARKNESS, dam)
self:incMana(-mana)
end
-- Autospell cast
if hitted and self:knowTalent(self.T_ARCANE_COMBAT) and self:isTalentActive(self.T_ARCANE_COMBAT) and rng.percent(20 + self:getTalentLevel(self.T_ARCANE_COMBAT) * (1 + self:getDex(9, true))) then
local spells = {}
......@@ -455,6 +463,9 @@ function _M:combatSpellpower(mod)
if self:knowTalent(self.T_ARCANE_DEXTERITY) then
add = (15 + self:getTalentLevel(self.T_ARCANE_DEXTERITY) * 5) * self:getDex() / 100
end
if self:knowTalent(self.T_SHADOW_CUNNING) then
add = (15 + self:getTalentLevel(self.T_SHADOW_CUNNING) * 3) * self:getCun() / 100
end
return (self.combat_spellpower + add + self:getMag() * 0.7) * mod
end
......
......@@ -35,6 +35,8 @@ newBirthDescriptor{
},
talents = { [ActorTalents.T_TELEPORT_ANGOLWEN]=1 },
copy = {
mana_regen = 0.5,
mana_rating = 10,
resolvers.generic(function(e)
e.hotkey[10] = {"inventory", "potion of lesser mana"}
end),
......
......@@ -78,7 +78,7 @@ newBirthDescriptor{
name = "Shadowblade",
desc = {
"Shadowblades are a blend of rogues that were touched by the gift of magic, able to kill with their daggers under a veil of stealth while casting spells to enhance their performance and survival.",
"Their use of magic is innate and they never really studied it.",
"Their use of magic is innate and they never really studied it, as such they do not naturally regenerate mana and must use external means of recharging.",
"They use the schools of phantasm, temporal, divination and conveyance to enhance their arts.",
"Their most important stats are: Dexterity, Cunning and Magic",
},
......@@ -97,11 +97,18 @@ newBirthDescriptor{
["cunning/survival"]={true, 0.1},
["cunning/lethality"]={true, 0.3},
["cunning/dirty"]={true, 0.3},
["cunning/shadow-magic"]={true, 0.3},
},
talents = {
[ActorTalents.T_DUAL_STRIKE] = 1,
[ActorTalents.T_WEAPON_COMBAT] = 1,
[ActorTalents.T_SHADOW_COMBAT] = 1,
[ActorTalents.T_KNIFE_MASTERY] = 1,
[ActorTalents.T_PHASE_DOOR] = 1,
},
copy = {
resolvers.inventory{ id=true,
{type="potion", subtype="potion", name="potion of lesser mana"},
{type="potion", subtype="potion", name="potion of lesser mana"},
},
},
}
......@@ -145,9 +145,7 @@ newBirthDescriptor{
copy = {
max_life = 100,
life_rating = 9,
mana_rating = 6,
stamina_rating = 6,
mana_regen = 0,
resolvers.equip{ id=true,
{type="weapon", subtype="greatsword", name="iron greatsword", autoreq=true},
{type="armor", subtype="light", name="rough leather armour", autoreq=true},
......
......@@ -35,6 +35,10 @@ newBirthDescriptor{
body = { INVEN = 1000, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
copy = {
-- Mages are unheard of at first, nobody but them regenerates mana
mana_rating = 6,
mana_regen = 0,
max_level = 50,
money = 10,
resolvers.equip{ id=true,
......
......@@ -139,6 +139,11 @@ newDamageType{
end,
}
-- Darkness damage
newDamageType{
name = "darkness", type = "DARKNESS", text_color = "#DARK_GREY#",
}
-- Blinds
newDamageType{
name = "blindness", type = "BLIND",
......
......@@ -23,6 +23,7 @@ newTalentType{ type="cunning/trapping", name = "trapping", description = "The kn
newTalentType{ type="cunning/dirty", name = "dirty fighting", description = "Teaches various talents to criple your foes." }
newTalentType{ type="cunning/lethality", name = "lethality", description = "How to make your foes feel the pain." }
newTalentType{ type="cunning/survival", name = "survival", description = "The knowledge of the dangers of the world, and how to best avoid them." }
newTalentType{ type="cunning/shadow-magic", name = "shadow magic", description = "Blending magic and shadows." }
-- Generic requires for cunning based on talent level
cuns_req1 = {
......@@ -51,3 +52,4 @@ load("/data/talents/cunning/traps.lua")
load("/data/talents/cunning/dirty.lua")
load("/data/talents/cunning/lethality.lua")
load("/data/talents/cunning/survival.lua")
load("/data/talents/cunning/shadow-magic.lua")
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
newTalent{
name = "Shadow Combat",
type = {"cunning/shadow-magic", 1},
mode = "sustained",
points = 5,
require = cuns_req1,
sustain_stamina = 20,
cooldown = 5,
activate = function(self, t)
return {}
end,
deactivate = function(self, t, p)
return true
end,
info = function(self, t)
return ([[Canalize raw magical energy with your melee attacks, each doing %d damage but costing %.2f mana.]]):
format(3 + self:getTalentLevel(t) * 2, 1 + self:getTalentLevelRaw(t) / 1.5)
end,
}
newTalent{
name = "Shadow Cunning",
type = {"cunning/shadow-magic", 2},
mode = "passive",
points = 5,
require = cuns_req2,
info = function(self, t)
return ([[The user gains a bonus to spellpower equal to %d%% of her cunning.]]):
format(15 + self:getTalentLevel(t) * 3)
end,
}
newTalent{
name = "Shadow Feed",
type = {"cunning/shadow-magic", 3},
points = 5,
cooldown = 5,
stamina = 100,
require = cuns_req3,
range = 20,
action = function(self, t)
self:incMana(40 + self:getTalentLevel(t) * 12)
return true
end,
info = function(self, t)
return ([[Regenerates %d mana at the cost of 100 stamina.]]):format(40 + self:getTalentLevel(t) * 12)
end,
}
newTalent{
name = "Shadowstep",
type = {"cunning/shadow-magic", 4},
points = 5,
cooldown = 5,
stamina = 100,
require = cuns_req4,
range = function(self, t) return math.floor(5 + self:getTalentLevel(t)) end,
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)) > self:getTalentRange(t) then return nil end
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
lx, ly = l()
end
self:move(tx, ty, true)
-- Attack ?
if math.floor(core.fov.distance(self.x, self.y, x, y)) == 1 then
if target:canBe("stun") then
target:setEffect(target.EFF_DAZED, 2 + self:getTalentLevel(t), {})
else
game.logSeen(target, "%s is not dazed!", target.name:capitalize())
end
end
return true
end,
info = function(self, t)
return ([[Steps through the shadows to your target, dazing it for %d turns
Dazed targets can not act but any damage will free them.]]):
format(2 + self:getTalentLevel(t))
end,
}
......@@ -99,7 +99,7 @@ newTalent{
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = lx, ly
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
......
......@@ -153,6 +153,22 @@ newEffect{
end,
}
newEffect{
name = "DAZED",
desc = "Dazed",
type = "physical",
status = "detrimental",
parameters = {},
on_gain = function(self, err) return "#Target# is dazed!", "+Dazed" end,
on_lose = function(self, err) return "#Target# is not dazed anymore.", "-Dazed" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("dazed", 1)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("dazed", eff.tmpid)
end,
}
newEffect{
name = "EVASION",
desc = "Evasion",
......
No preview for this file type
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