Newer
Older
-- Copyright (C) 2009 - 2014 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
-- Empty Hand adds extra scaling to gauntlet and glove attacks based on character level.
newTalent{
name = "Empty Hand",
type = {"technique/unarmed-other", 1},
innate = true,
hide = true,
mode = "passive",
points = 1,
on_learn = function(self, t)
local fct = function()
self.before_empty_hands_combat = self.combat
self.combat = table.clone(self.combat, true)
self.combat.physspeed = math.min(0.6, self.combat.physspeed or 1000)
if not self.combat.sound then self.combat.sound = {"actions/punch%d", 1, 4} end
if not self.combat.sound_miss then self.combat.sound_miss = "actions/melee_miss" end
end
if type(self.combat.dam) == "table" then
game:onTickEnd(fct)
else
fct()
end
end,
on_unlearn = function(self, t)
self.combat = self.before_empty_hands_combat
end,
getDamage = function(self, t) return self.level * 0.5 end,
info = function(self, t)
local damage = t.getDamage(self, t)
return ([[Grants %d Physical Power when fightning unarmed (or with gloves or gauntlets).
This talent's effects will scale with your level.]]):
format(damage)
end,
}
-- generic unarmed training
newTalent{
name = "Unarmed Mastery",
type = {"technique/unarmed-training", 1},
points = 5,
require = { stat = { cun=function(level) return 12 + level * 6 end }, },
getDamage = function(self, t) return self:getTalentLevel(t) * 10 end,
getPercentInc = function(self, t) return math.sqrt(self:getTalentLevel(t) / 5) / 2 end,
return ([[Increases Physical Power by %d, and increases all unarmed damage by %d%% (including grapples and kicks).
Note that brawlers naturally gain 0.5 Physical Power per character level while unarmed (current brawler physical power bonus: %0.1f) and attack 40%% faster while unarmed.]]):
dg
committed
format(damage, 100*inc, self.level * 0.5)
end,
}
newTalent{
name = "Steady Mind",
type = {"technique/unarmed-training", 2},
mode = "passive",
points = 5,
getDefense = function(self, t) return self:combatTalentStatDamage(t, "dex", 5, 35) end,
getMental = function(self, t) return self:combatTalentStatDamage(t, "cun", 5, 35) end,
info = function(self, t)
local defense = t.getDefense(self, t)
local saves = t.getMental(self, t)
return ([[Superior cunning and training allows you to outthink and outwit your opponents' physical and mental assaults. Increases Defense by %d and Mental Save by %d.
The Defense bonus will scale with your Dexterity, and the save bonus with your Cunning.]]):
format(defense, saves)
end,
}
newTalent{
name = "Heightened Reflexes",
type = {"technique/unarmed-training", 3},
getPower = function(self, t) return self:combatTalentScale(t, 0.6, 2.5, 0.75) end,
self:setEffect(self.EFF_REFLEXIVE_DODGING, 1, {power=t.getPower(self, t)})
return ([[When you're targeted by a projectile, your global speed is increased by %d%% for 1 turn. Taking any action other then movement will break the effect.]]):
end,
}
newTalent{
name = "Combo String",
type = {"technique/unarmed-training", 4},
getDuration = function(self, t) return math.ceil(self:combatTalentScale(t, 0.3, 2.3)) end,
getChance = function(self, t) return self:combatLimit(self:getTalentLevel(t) * (5 + self:getCun(5, true)), 100, 0, 0, 50, 50) end, -- Limit < 100%
info = function(self, t)
local duration = t.getDuration(self, t)
local chance = t.getChance(self, t)
return ([[When gaining a combo point, you have a %d%% chance to gain an extra combo point. Additionally, your combo points will last %d turns longer before expiring.
The chance of building a second combo point will improve with your Cunning.]]):