diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 341e29f9f6d88d995ee01fe57ec079cf838ae613..f4ffb3c187557fde1adf6f28947eaadeb4568b9e 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -92,7 +92,7 @@ function _M:init(t, no_default) self.last_learnt_talents = self.last_learnt_talents or { class={}, generic={} } self.puuid = self.puuid or util.uuid() - self.damage_log = self.damage_log or {} + self.damage_log = self.damage_log or {weapon={}} end function _M:onBirth(birther) diff --git a/game/modules/tome/class/interface/Archery.lua b/game/modules/tome/class/interface/Archery.lua index 0cb5b6726891f367c1ae5b448e298e80e09039a9..88f6d7a9916164a9a12ac94eb7e3c7ab7a4b0a31 100644 --- a/game/modules/tome/class/interface/Archery.lua +++ b/game/modules/tome/class/interface/Archery.lua @@ -393,6 +393,16 @@ local function archery_projectile(tx, ty, tg, self, tmp) target:knockback(self.x, self.y, math.ceil(math.log(dam))) end + -- Roll with it + if hitted and target:attr("knockback_on_hit") and not target.turn_procs.roll_with_it and rng.percent(util.bound(dam, 0, 100)) then + local ox, oy = self.x, self.y + game:onTickEnd(function() + target:knockback(ox, oy, 1) + if not target:hasEffect(target.EFF_WILD_SPEED) then target:setEffect(target.EFF_WILD_SPEED, 1, {power=200}) end + end) + target.turn_procs.roll_with_it = true + end + self.use_psi_combat = false end diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index 42238c78bc55c1852291b9c232cd9d66f5fb6fd5..798a655545041b8fec4ea117340c0227e47021ea 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -327,6 +327,13 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam) damtype = damtype or (weapon and weapon.damtype) or DamageType.PHYSICAL mult = mult or 1 + local mode = "other" + if self:hasShield() then mode = "shield" + elseif self:hasTwoHandedWeapon() then mode = "twohanded" + elseif self:hasDualWeapon() then mode = "dualwield" + end + self.turn_procs.weapon_type = {kind=weapon.talented, mode=mode} + -- Does the blow connect? yes .. complex :/ local atk, def = self:combatAttack(weapon), target:combatDefense() @@ -771,7 +778,10 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam) -- Roll with it if hitted and target:attr("knockback_on_hit") and not target.turn_procs.roll_with_it and rng.percent(util.bound(dam, 0, 100)) then local ox, oy = self.x, self.y - game:onTickEnd(function() target:knockback(ox, oy, 1) end) + game:onTickEnd(function() + target:knockback(ox, oy, 1) + if not target:hasEffect(target.EFF_WILD_SPEED) then target:setEffect(target.EFF_WILD_SPEED, 1, {power=200}) end + end) target.turn_procs.roll_with_it = true end @@ -855,6 +865,8 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam) -- Visual feedback if hitted then game.level.map:particleEmitter(target.x, target.y, 1, "melee_attack", {color=target.blood_color}) end + self.turn_procs.weapon_type = nil + return self:combatSpeed(weapon), hitted end diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index 70b231f24d69f9a82a6d498e0afe6e06ac850081..5010b74bde37f65f76b7eb8fac5c25814dae2b6a 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -365,6 +365,10 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr) if dam > 0 and src.damage_log then src.damage_log[type] = (src.damage_log[type] or 0) + dam + if src.turn_procs and src.turn_procs.weapon_type then + src.damage_log.weapon[src.turn_procs.weapon_type.kind] = (src.damage_log.weapon[src.turn_procs.weapon_type.kind] or 0) + dam + src.damage_log.weapon[src.turn_procs.weapon_type.mode] = (src.damage_log.weapon[src.turn_procs.weapon_type.mode] or 0) + dam + end end if dam > 0 and source_talent then diff --git a/game/modules/tome/data/talents/uber/dex.lua b/game/modules/tome/data/talents/uber/dex.lua index 1d297177834df6f26293f56c443ae6c7fa56f2fe..8cefa8ff0f10a4b24109032418cd0e7d132fcf7b 100644 --- a/game/modules/tome/data/talents/uber/dex.lua +++ b/game/modules/tome/data/talents/uber/dex.lua @@ -56,9 +56,8 @@ uberTalent{ uberTalent{ name = "Windblade", mode = "activated", - require = { special={desc="Know at least 20 talent levels of stamina using talents.", fct=function(self) return knowRessource(self, "stamina", 20) end} }, + require = { special={desc="Dealt over 50000 damage with dual wielded weapons.", fct=function(self) return self.damage_log and self.damage_log.weapon.dualwield and self.damage_log.weapon.dualwield >= 50000 end} }, cooldown = 20, - stamina = 30, radius = 2, range = 1, tactical = { ATTACK = { PHYSICAL=2 }, DISABLE = { disarm = 2 } }, @@ -109,9 +108,15 @@ uberTalent{ uberTalent{ name = "Giant Leap", mode = "activated", - require = { special={desc="Know at least 20 talent levels of stamina using talents.", fct=function(self) return knowRessource(self, "stamina", 20) end} }, + require = { special={desc="Dealt over 50000 damage with any weapon or unarmed.", fct=function(self) return + self.damage_log and ( + (self.damage_log.weapon.twohanded and self.damage_log.weapon.twohanded >= 50000) or + (self.damage_log.weapon.shield and self.damage_log.weapon.shield >= 50000) or + (self.damage_log.weapon.dualwield and self.damage_log.weapon.dualwield >= 50000) or + (self.damage_log.weapon.other and self.damage_log.weapon.other >= 50000) + ) + end} }, cooldown = 20, - stamina = 30, radius = 1, range = 10, tactical = { CLOSEIN = 2, ATTACK = { PHYSICAL = 2 }, DISABLE = { daze = 1 } }, @@ -177,6 +182,7 @@ uberTalent{ activate = function(self, t) local ret = {} self:talentTemporaryValue(ret, "knockback_on_hit", 1) + self:talentTemporaryValue(ret, "movespeed_on_hit", {speed=3, dur=1}) self:talentTemporaryValue(ret, "resists", {[DamageType.PHYSICAL] = 10}) return ret end, @@ -185,7 +191,7 @@ uberTalent{ end, info = function(self, t) return ([[You have learnt to take a few hits when needed, you know how to flow with them, reducing all physical damage by 10%%. - When you get hit by melee or archery you go back one tile (this can only happen once per turn) for free and gain 300% movement speed for a turn.]]) + When you get hit by melee or archery you go back one tile (this can only happen once per turn) for free and gain 200%% movement speed for a turn.]]) :format() end, } diff --git a/game/modules/tome/data/talents/uber/str.lua b/game/modules/tome/data/talents/uber/str.lua index fcba6b9b5b70c8cc3ae9d240bd9564e462b9d0fa..28fa6ac32e0956d3d7d223668ffc59c37a882b44 100644 --- a/game/modules/tome/data/talents/uber/str.lua +++ b/game/modules/tome/data/talents/uber/str.lua @@ -37,12 +37,11 @@ uberTalent{ uberTalent{ name = "You Shall Be My Weapon!", short_name="TITAN_S_SMASH", image = "talents/titan_s_smash.png", mode = "activated", - require = { special={desc="Be of at least size category 'huge' (also required to use it) and know at least 20 talent levels of stamina using talents.", fct=function(self) return self.size_category and self.size_category >= 5 and knowRessource(self, "stamina", 20) end} }, + require = { special={desc="Be of at least size category 'huge' (also required to use it).", fct=function(self) return self.size_category and self.size_category >= 5 end} }, requires_target = true, tactical = { ATTACK = 4 }, on_pre_use = function(self, t) return self.size_category and self.size_category >= 5 end, - cooldown = 10, - stamina = 20, + cooldown = 12, action = function(self, t) local tg = {type="hit", range=self:getTalentRange(t)} local x, y, target = self:getTarget(tg) @@ -76,11 +75,13 @@ uberTalent{ uberTalent{ name = "Massive Blow", mode = "activated", - require = { special={desc="Dug at least 30 walls/trees/... and know at least 20 talent levels of stamina using talents.", fct=function(self) return self.dug_times and self.dug_times >= 30 and knowRessource(self, "stamina", 20) end} }, + require = { special={desc="Dug at least 30 walls/trees/... and dealt over 50000 damage with a two handed weapon.", fct=function(self) return + self.dug_times and self.dug_times >= 30 and + self.damage_log and self.damage_log.weapon.twohanded and self.damage_log.weapon.twohanded >= 50000 + end} }, requires_target = true, tactical = { ATTACK = 4 }, - cooldown = 10, - stamina = 20, + cooldown = 12, action = function(self, t) local tg = {type="hit", range=self:getTalentRange(t)} local x, y, target = self:getTarget(tg)