Commit c765102ee53dbf8e5bcb56b4dce5b1f1f6d98e58

Authored by dg
1 parent b248ed76

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
... ... @@ -48,7 +48,7 @@ project "TEngine"
48 48 links { "IOKit" }
49 49
50 50 configuration "windows"
51   - links { "mingw32", "SDLmain", "SDL", "SDL_ttf", "SDL_image", "openal32", "vorbisfile", "OPENGL32", "GLU32", "wsock32", "png12" }
  51 + links { "mingw32", "SDL2main", "SDL2", "SDL2_ttf", "SDL2_image", "openal32", "vorbisfile", "OPENGL32", "GLU32", "wsock32", "png" }
52 52 defines { [[TENGINE_HOME_PATH='"T-Engine"']], 'SELFEXE_WINDOWS' }
53 53 prebuildcommands { "windres ../src/windows/icon.rc -O coff -o ../src/windows/icon.res" }
54 54 linkoptions { "../src/windows/icon.res" }
... ...
... ... @@ -546,7 +546,7 @@ function _M:act()
546 546 if act and self:reactionToward(act) < 0 and self:canSee(act) then nb_foes = nb_foes + 1 end
547 547 end
548 548 if nb_foes > 1 then
549   - nb_foes = math.min(nb_foes, self:getTalentLevel(self.T_MILITANT_MIND))
  549 + nb_foes = math.min(nb_foes, 5)
550 550 self:setEffect(self.EFF_MILITANT_MIND, 4, {power=self:getTalentLevel(self.T_MILITANT_MIND) * nb_foes * 0.6})
551 551 end
552 552 end
... ... @@ -1730,6 +1730,13 @@ function _M:onTakeHit(value, src)
1730 1730 self:setEffect(self.EFF_INVISIBILITY, 5, {power=self:attr("invis_on_hit_power")})
1731 1731 for tid, _ in pairs(self.invis_on_hit_disable) do self:forceUseTalent(tid, {ignore_energy=true}) end
1732 1732 end
  1733 +
  1734 + if self:knowTalent(self.T_DUCK_AND_DODGE) then
  1735 + local t = self:getTalentFromId(self.T_DUCK_AND_DODGE)
  1736 + if value >= self.max_life * t.getThreshold(self, t) then
  1737 + self:setEffect(self.EFF_EVASION, t.getDuration(self, t), {chance=t.getEvasionChance(self, t)})
  1738 + end
  1739 + end
1733 1740
1734 1741 -- Damage shield on hit
1735 1742 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)
325 325 local dam, apr, armor = force_dam or self:combatDamage(weapon), self:combatAPR(weapon), target:combatArmor()
326 326 print("[ATTACK] to ", target.name, " :: ", dam, apr, armor, def, "::", mult)
327 327
328   - if target:knowTalent(target.T_DUCK_AND_DODGE) then
329   - local diff = util.bound((self.size_category or 3) - (target.size_category or 2), 0, 5)
330   - def = def + diff * target:getTalentLevelRaw(target.T_DUCK_AND_DODGE) * 1.2
331   - end
332   -
333 328 -- check repel
334 329 local repelled = false
335 330 if target:isTalentActive(target.T_REPEL) then
... ...
... ... @@ -497,11 +497,12 @@ newTalent{
497 497 self:setEffect(self.EFF_HALFLING_LUCK, 5, {
498 498 physical=10 + self:getCun() / 2,
499 499 spell=10 + self:getCun() / 2,
  500 + mind=10 + self:getCun() / 2,
500 501 })
501 502 return true
502 503 end,
503 504 info = function(self, t)
504   - 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.
  505 + 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.
505 506 The bonus will increase with the Cunning stat.]]):format(10 + self:getCun() / 2, 10 + self:getCun() / 2)
506 507 end,
507 508 }
... ... @@ -512,10 +513,16 @@ newTalent{
512 513 require = racial_req2,
513 514 points = 5,
514 515 mode = "passive",
  516 + getThreshold = function(self, t) return math.max(10, (15 - self:getTalentLevelRaw(t))) / 100 end,
  517 + getEvasionChance = function(self, t) return self:getStat("lck") end,
  518 + getDuration = function(self, t) return 1 + math.ceil(self:getTalentLevel(t)/2) end,
515 519 info = function(self, t)
516   - return ([[Halfling have long learnt to use their small stature as an advantage when fighting the other races.
517   - Increases defense in melee based on the size difference between the attacker and you (+%d defence per size).]]):
518   - format(self:getTalentLevelRaw(t) * 1.2)
  520 + local threshold = t.getThreshold(self, t)
  521 + local evasion = t.getEvasionChance(self, t)
  522 + local duration = t.getDuration(self, t)
  523 + return ([[Your incredible luck kicks in at just the right moment to save your skin.
  524 + 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.]]):
  525 + format(threshold * 100, evasion, duration)
519 526 end,
520 527 }
521 528
... ... @@ -527,8 +534,8 @@ newTalent{
527 534 mode = "passive",
528 535 info = function(self, t)
529 536 return ([[Halflings have always been a very organised and methodical race, the more foes they face the more organised they are.
530   - 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).]]):
531   - format(self:getTalentLevel(t) * 0.6, self:getTalentLevel(t))
  537 + 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).]]):
  538 + format(self:getTalentLevel(t) * 0.6)
532 539 end,
533 540 }
534 541
... ... @@ -539,14 +546,38 @@ newTalent{
539 546 points = 5,
540 547 no_energy = true,
541 548 cooldown = function(self, t) return 50 - self:getTalentLevel(t) * 5 end,
542   - tactical = { DEFEND = 1 },
  549 + tactical = { DEFEND = 1, CURE = 1 },
  550 + getRemoveCount = function(self, t) return 1 + self:getTalentLevel(t) end,
  551 + getDuration = function(self, t) return 1 + self:getTalentLevel(t) end,
543 552 action = function(self, t)
544   - self:setEffect(self.EFF_FREE_ACTION, 3 + self:getTalentLevel(t), {})
  553 + local effs = {}
  554 +
  555 + -- Go through all effects
  556 + for eff_id, p in pairs(self.tmp) do
  557 + local e = self.tempeffect_def[eff_id]
  558 + if e.subtype.stun or e.subtype.pin then -- Daze is stun subtype
  559 + effs[#effs+1] = {"effect", eff_id}
  560 + end
  561 + end
  562 +
  563 + for i = 1, t.getRemoveCount(self, t) do
  564 + if #effs == 0 then break end
  565 + local eff = rng.tableRemove(effs)
  566 +
  567 + if eff[1] == "effect" then
  568 + self:removeEffect(eff[2])
  569 + end
  570 + end
  571 +
  572 + self:setEffect(self.EFF_FREE_ACTION, t.getDuration(self, t), {})
545 573 return true
546 574 end,
547 575 info = function(self, t)
  576 + local duration = t.getDuration(self, t)
  577 + local count = t.getRemoveCount(self, t)
548 578 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.
549   - Instantly makes you immune to stuns, dazes and pinning effects for %d turns.]]):format(3 + self:getTalentLevel(t))
  579 + Removes %d stun, daze, or pin effects and makes you immune to stuns, dazes and pins for %d turns.
  580 + This talent takes no time to use.]]):format(duration, count)
550 581 end,
551 582 }
552 583
... ...
... ... @@ -1593,7 +1593,7 @@ newEffect{
1593 1593 newEffect{
1594 1594 name = "HALFLING_LUCK", image = "talents/halfling_luck.png",
1595 1595 desc = "Halflings's Luck",
1596   - 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,
  1596 + 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,
1597 1597 type = "mental",
1598 1598 subtype = { focus=true },
1599 1599 status = "beneficial",
... ... @@ -1603,10 +1603,12 @@ newEffect{
1603 1603 activate = function(self, eff)
1604 1604 eff.pid = self:addTemporaryValue("combat_physcrit", eff.physical)
1605 1605 eff.sid = self:addTemporaryValue("combat_spellcrit", eff.spell)
  1606 + eff.mid = self:addTemporaryValue("combat_mindcrit", eff.mind)
1606 1607 end,
1607 1608 deactivate = function(self, eff)
1608 1609 self:removeTemporaryValue("combat_physcrit", eff.pid)
1609 1610 self:removeTemporaryValue("combat_spellcrit", eff.sid)
  1611 + self:removeTemporaryValue("combat_mindcrit", eff.mid)
1610 1612 end,
1611 1613 }
1612 1614
... ...
... ... @@ -496,7 +496,7 @@ newEffect{
496 496 newEffect{
497 497 name = "MILITANT_MIND", image = "talents/militant_mind.png",
498 498 desc = "Militant Mind",
499   - long_desc = function(self, eff) return ("Increases physical power, spellpower and mindpower by %d."):format(eff.power) end,
  499 + long_desc = function(self, eff) return ("Increases physical power, physical save, spellpower, spell save, mindpower, and mental save by %d."):format(eff.power) end,
500 500 type = "other",
501 501 subtype = { miscellaneous=true },
502 502 status = "beneficial",
... ... @@ -505,11 +505,17 @@ newEffect{
505 505 eff.damid = self:addTemporaryValue("combat_dam", eff.power)
506 506 eff.spellid = self:addTemporaryValue("combat_spellpower", eff.power)
507 507 eff.mindid = self:addTemporaryValue("combat_mindpower", eff.power)
  508 + eff.presid = self:addTemporaryValue("combat_physresist", eff.power)
  509 + eff.sresid = self:addTemporaryValue("combat_spellresist", eff.power)
  510 + eff.mresid = self:addTemporaryValue("combat_mentalresist", eff.power)
508 511 end,
509 512 deactivate = function(self, eff)
510 513 self:removeTemporaryValue("combat_dam", eff.damid)
511 514 self:removeTemporaryValue("combat_spellpower", eff.spellid)
512 515 self:removeTemporaryValue("combat_mindpower", eff.mindid)
  516 + self:removeTemporaryValue("combat_physresist", eff.presid)
  517 + self:removeTemporaryValue("combat_spellresist", eff.sresid)
  518 + self:removeTemporaryValue("combat_mentalresist", eff.mresid)
513 519 end,
514 520 }
515 521
... ...
... ... @@ -28,10 +28,11 @@ solution "TEngine"
28 28
29 29 configuration "windows"
30 30 libdirs {
31   - "/c/mingw2/lib",
  31 + "/c/code/SDL/lib",
32 32 }
33 33 includedirs {
34   - "/c/mingw2/include/SDL",
  34 + "/c/code/SDL/include/SDL2",
  35 + "/c/code/SDL/include",
35 36 "/c/mingw2/include/GL",
36 37 }
37 38
... ...