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

Duck and Dodge now is an Evasion effect triggered when the halfling takes damage

Militant Mind now starts off capping at 5 foes and grants saves too
Indomitable now clears existing stuns, dazes, and pins as well as prodiving free action

git-svn-id: http://svn.net-core.org/repos/t-engine4@5160 51575b47-30f0-44d4-a5cc-537603b46e54
parent b248ed76
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,7 @@ project "TEngine"
links { "IOKit" }
configuration "windows"
links { "mingw32", "SDLmain", "SDL", "SDL_ttf", "SDL_image", "openal32", "vorbisfile", "OPENGL32", "GLU32", "wsock32", "png12" }
links { "mingw32", "SDL2main", "SDL2", "SDL2_ttf", "SDL2_image", "openal32", "vorbisfile", "OPENGL32", "GLU32", "wsock32", "png" }
defines { [[TENGINE_HOME_PATH='"T-Engine"']], 'SELFEXE_WINDOWS' }
prebuildcommands { "windres ../src/windows/icon.rc -O coff -o ../src/windows/icon.res" }
linkoptions { "../src/windows/icon.res" }
......
......@@ -546,7 +546,7 @@ function _M:act()
if act and 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))
nb_foes = math.min(nb_foes, 5)
self:setEffect(self.EFF_MILITANT_MIND, 4, {power=self:getTalentLevel(self.T_MILITANT_MIND) * nb_foes * 0.6})
end
end
......@@ -1730,6 +1730,13 @@ function _M:onTakeHit(value, src)
self:setEffect(self.EFF_INVISIBILITY, 5, {power=self:attr("invis_on_hit_power")})
for tid, _ in pairs(self.invis_on_hit_disable) do self:forceUseTalent(tid, {ignore_energy=true}) end
end
if self:knowTalent(self.T_DUCK_AND_DODGE) then
local t = self:getTalentFromId(self.T_DUCK_AND_DODGE)
if value >= self.max_life * t.getThreshold(self, t) then
self:setEffect(self.EFF_EVASION, t.getDuration(self, t), {chance=t.getEvasionChance(self, t)})
end
end
-- Damage shield on hit
if self:attr("contingency") and value >= self.max_life * self:attr("contingency") / 100 and not self:hasEffect(self.EFF_DAMAGE_SHIELD) then
......
......@@ -325,11 +325,6 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam)
local dam, apr, armor = force_dam or self:combatDamage(weapon), self:combatAPR(weapon), target:combatArmor()
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
-- check repel
local repelled = false
if target:isTalentActive(target.T_REPEL) then
......
......@@ -497,11 +497,12 @@ newTalent{
self:setEffect(self.EFF_HALFLING_LUCK, 5, {
physical=10 + self:getCun() / 2,
spell=10 + self:getCun() / 2,
mind=10 + self:getCun() / 2,
})
return true
end,
info = function(self, t)
return ([[Call upon the luck and cunning of the Little Folk to increase your physical and spell critical strike chance by %d%% for 5 turns.
return ([[Call upon the luck and cunning of the Little Folk to increase your physical, mental, and spell critical strike chance by %d%% for 5 turns.
The bonus will increase with the Cunning stat.]]):format(10 + self:getCun() / 2, 10 + self:getCun() / 2)
end,
}
......@@ -512,10 +513,16 @@ newTalent{
require = racial_req2,
points = 5,
mode = "passive",
getThreshold = function(self, t) return math.max(10, (15 - self:getTalentLevelRaw(t))) / 100 end,
getEvasionChance = function(self, t) return self:getStat("lck") end,
getDuration = function(self, t) return 1 + math.ceil(self:getTalentLevel(t)/2) end,
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)
local threshold = t.getThreshold(self, t)
local evasion = t.getEvasionChance(self, t)
local duration = t.getDuration(self, t)
return ([[Your incredible luck kicks in at just the right moment to save your skin.
Whenever you take %d%% or more of your life from a single attack you gain Evasion equal to your luck stat (currently %d%%) for the next %d turns.]]):
format(threshold * 100, evasion, duration)
end,
}
......@@ -527,8 +534,8 @@ newTalent{
mode = "passive",
info = function(self, t)
return ([[Halflings 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))
If two or more foes are in sight your physical power, physical save, spellpower, spell save, mental save, and mindpower are increased by %0.1f per foes (up to 5 foes).]]):
format(self:getTalentLevel(t) * 0.6)
end,
}
......@@ -539,14 +546,38 @@ newTalent{
points = 5,
no_energy = true,
cooldown = function(self, t) return 50 - self:getTalentLevel(t) * 5 end,
tactical = { DEFEND = 1 },
tactical = { DEFEND = 1, CURE = 1 },
getRemoveCount = function(self, t) return 1 + self:getTalentLevel(t) end,
getDuration = function(self, t) return 1 + self:getTalentLevel(t) end,
action = function(self, t)
self:setEffect(self.EFF_FREE_ACTION, 3 + self:getTalentLevel(t), {})
local effs = {}
-- Go through all effects
for eff_id, p in pairs(self.tmp) do
local e = self.tempeffect_def[eff_id]
if e.subtype.stun or e.subtype.pin then -- Daze is stun subtype
effs[#effs+1] = {"effect", eff_id}
end
end
for i = 1, t.getRemoveCount(self, t) do
if #effs == 0 then break end
local eff = rng.tableRemove(effs)
if eff[1] == "effect" then
self:removeEffect(eff[2])
end
end
self:setEffect(self.EFF_FREE_ACTION, t.getDuration(self, t), {})
return true
end,
info = function(self, t)
local duration = t.getDuration(self, t)
local count = t.getRemoveCount(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))
Removes %d stun, daze, or pin effects and makes you immune to stuns, dazes and pins for %d turns.
This talent takes no time to use.]]):format(duration, count)
end,
}
......
......@@ -1593,7 +1593,7 @@ newEffect{
newEffect{
name = "HALFLING_LUCK", image = "talents/halfling_luck.png",
desc = "Halflings's Luck",
long_desc = function(self, eff) return ("The target's luck and cunning combine to grant it %d%% higher combat critical chance and %d%% higher spell critical chance."):format(eff.physical, eff.spell) end,
long_desc = function(self, eff) return ("The target's luck and cunning combine to grant it %d%% higher combat critical chance, %d%% higher mental critical chance, and %d%% higher spell critical chance."):format(eff.physical, eff.mind, eff.spell) end,
type = "mental",
subtype = { focus=true },
status = "beneficial",
......@@ -1603,10 +1603,12 @@ newEffect{
activate = function(self, eff)
eff.pid = self:addTemporaryValue("combat_physcrit", eff.physical)
eff.sid = self:addTemporaryValue("combat_spellcrit", eff.spell)
eff.mid = self:addTemporaryValue("combat_mindcrit", eff.mind)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("combat_physcrit", eff.pid)
self:removeTemporaryValue("combat_spellcrit", eff.sid)
self:removeTemporaryValue("combat_mindcrit", eff.mid)
end,
}
......
......@@ -496,7 +496,7 @@ newEffect{
newEffect{
name = "MILITANT_MIND", image = "talents/militant_mind.png",
desc = "Militant Mind",
long_desc = function(self, eff) return ("Increases physical power, spellpower and mindpower by %d."):format(eff.power) end,
long_desc = function(self, eff) return ("Increases physical power, physical save, spellpower, spell save, mindpower, and mental save by %d."):format(eff.power) end,
type = "other",
subtype = { miscellaneous=true },
status = "beneficial",
......@@ -505,11 +505,17 @@ newEffect{
eff.damid = self:addTemporaryValue("combat_dam", eff.power)
eff.spellid = self:addTemporaryValue("combat_spellpower", eff.power)
eff.mindid = self:addTemporaryValue("combat_mindpower", eff.power)
eff.presid = self:addTemporaryValue("combat_physresist", eff.power)
eff.sresid = self:addTemporaryValue("combat_spellresist", eff.power)
eff.mresid = self:addTemporaryValue("combat_mentalresist", 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)
self:removeTemporaryValue("combat_physresist", eff.presid)
self:removeTemporaryValue("combat_spellresist", eff.sresid)
self:removeTemporaryValue("combat_mentalresist", eff.mresid)
end,
}
......
......@@ -28,10 +28,11 @@ solution "TEngine"
configuration "windows"
libdirs {
"/c/mingw2/lib",
"/c/code/SDL/lib",
}
includedirs {
"/c/mingw2/include/SDL",
"/c/code/SDL/include/SDL2",
"/c/code/SDL/include",
"/c/mingw2/include/GL",
}
......
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