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

All races now possess racial talents that can be learned using generic talents

git-svn-id: http://svn.net-core.org/repos/t-engine4@3026 51575b47-30f0-44d4-a5cc-537603b46e54
parent fd205300
No related branches found
No related tags found
No related merge requests found
......@@ -366,6 +366,20 @@ function _M:act()
if self.never_act then return false end
-- Compute bonuses based on actors in FOV
if self:knowTalent(self.T_MILITANT_MIND) and not self:hasEffect(self.EFF_MILITANT_MIND) then
local nb_foes = 0
local act
for i = 1, #self.fov.actors_dist do
act = self.fov.actors_dist[i]
if self:reactionToward(act) < 0 and self:canSee(act) then nb_foes = nb_foes + 1 end
end
if nb_foes > 1 then
nb_foes = math.min(nb_foes, self:getTalentLevel(self.T_MILITANT_MIND))
self:setEffect(self.EFF_MILITANT_MIND, 4, {power=self:getTalentLevel(self.T_MILITANT_MIND) * nb_foes * 0.6})
end
end
return true
end
......
......@@ -217,7 +217,12 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
local atk, def = self:combatAttack(weapon), target:combatDefense()
if not self:canSee(target) then atk = atk / 3 end
local dam, apr, armor = self:combatDamage(weapon), self:combatAPR(weapon), target:combatArmor()
print("[ATTACK] to ", target.name, " :: ", dam, apr, armor, "::", mult)
print("[ATTACK] to ", target.name, " :: ", dam, apr, armor, def, "::", mult)
if target:knowTalent(target.T_DUCK_AND_DODGE) then
local diff = util.bound((self.size_category or 3) - (target.size_category or 2), 0, 5)
def = def + diff * target:getTalentLevelRaw(target.T_DUCK_AND_DODGE) * 1.2
end
-- If hit is over 0 it connects, if it is 0 we still have 50% chance
local hitted = false
......
......@@ -478,6 +478,50 @@ newTalent{
end,
}
newTalent{
name = "Duck and Dodge",
type = {"race/halfling", 2},
require = racial_req2,
points = 5,
mode = "passive",
info = function(self, t)
return ([[Halfling have long learnt to use their small stature as an advantage when fighting the other races.
Increases defense in melee based on the size difference between the attacker and you (+%d defence per size).]]):
format(self:getTalentLevelRaw(t) * 1.2)
end,
}
newTalent{
name = "Militant Mind",
type = {"race/halfling", 3},
require = racial_req3,
points = 5,
mode = "passive",
info = function(self, t)
return ([[Halfling have always been a very organised and methodical race, the more foes they face the more organised they are.
If two or more foes are in sight your physical power, spellpower and mindpower are increased by %0.1f per foes (up to %d foes).]]):
format(self:getTalentLevel(t) * 0.6, self:getTalentLevel(t))
end,
}
newTalent{
name = "Indomitable",
type = {"race/halfling", 4},
require = racial_req4,
points = 5,
no_energy = true,
cooldown = function(self, t) return 50 - self:getTalentLevel(t) * 5 end,
tactical = { DEFEND = 1 },
action = function(self, t)
self:setEffect(self.EFF_FREE_ACTION, 3 + self:getTalentLevel(t), {})
return true
end,
info = function(self, t)
return ([[Halflings are one of the more powerful military force of the known world, they have been at war with most other races for thousand of years.
Instantly makes you immune to stuns, dazes and pinning effects for %d turns.]]):format(3 + self:getTalentLevel(t))
end,
}
------------------------------------------------------------------
-- Orcs powers
------------------------------------------------------------------
......
......@@ -3517,4 +3517,23 @@ newEffect{
end,
deactivate = function(self, eff)
end,
}
\ No newline at end of file
}
newEffect{
name = "MILITANT_MIND",
desc = "Militant Mind",
long_desc = function(self, eff) return ("Increases physical power, spellpower and mindpower by %d."):format(eff.power) end,
type = "other",
status = "beneficial",
parameters = { power=10 },
activate = function(self, eff)
eff.damid = self:addTemporaryValue("combat_dam", eff.power)
eff.spellid = self:addTemporaryValue("combat_spellpower", eff.power)
eff.mindid = self:addTemporaryValue("combat_mindpower", eff.power)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("combat_dam", eff.damid)
self:removeTemporaryValue("combat_spellpower", eff.spellid)
self:removeTemporaryValue("combat_mindpower", eff.mindid)
end,
}
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