diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 8a0f363366b088928894a22dfae170b6a81cf7fc..3f6f9d4492f6a4ff78371e9f82c80f5ea86538d3 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -138,6 +138,10 @@ end --- Called before taking a hit, it's the chance to check for shields function _M:onTakeHit(value, src) + if self:attr("invulnerable") then + return 0 + end + if self:attr("mana_shield") then local mana = self:getMana() local mana_val = value * self:attr("mana_shield") diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index 6cdf2f634ed20873236dd288826a29c08e7a3158..3cb04b70ec06dd693d2c8e281fb2cbf24cc97393 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -230,3 +230,37 @@ newDamageType{ end end, } + +-- Slowness +newDamageType{ + name = "slow", type = "SLOW", + projector = function(src, x, y, type, dam) + local target = game.level.map(x, y, Map.ACTOR) + if target then + -- Freeze it, if we pass the test + local sx, sy = game.level.map:getTileToScreen(x, y) + if target:checkHit(src:combatSpellpower(), target:combatSpellResist(), 0, 95, 20) then + target:setEffect(target.EFF_SLOW, 7, {power=dam}) + else + game.logSeen(target, "%s resists!", target.name:capitalize()) + end + end + end, +} + +-- Time prison, invulnerability and stun +newDamageType{ + name = "time prison", type = "TIME_PRISON", + projector = function(src, x, y, type, dam) + local target = game.level.map(x, y, Map.ACTOR) + if target then + -- Freeze it, if we pass the test + local sx, sy = game.level.map:getTileToScreen(x, y) + if target:checkHit(src:combatSpellpower(), target:combatSpellResist(), 0, 95, 20) then + target:setEffect(target.EFF_TIME_PRISON, dam, {}) + else + game.logSeen(target, "%s resists!", target.name:capitalize()) + end + end + end, +} diff --git a/game/modules/tome/data/talents/spells/arcane.lua b/game/modules/tome/data/talents/spells/arcane.lua index 719212a4535984e981a35539952e40184536ad30..baa5b69dfc477aa0d6cc7dd6662d5f5fb5815219 100644 --- a/game/modules/tome/data/talents/spells/arcane.lua +++ b/game/modules/tome/data/talents/spells/arcane.lua @@ -74,7 +74,7 @@ newTalent{ DEFEND = 10, }, activate = function(self, t) - local power = 3 - (self:combatSpellpower(1) * self:getTalentLevel(t)) / 280 + local power = math.max(0.8, 3 - (self:combatSpellpower(1) * self:getTalentLevel(t)) / 280) return { shield = self:addTemporaryValue("mana_shield", power), } @@ -85,6 +85,6 @@ newTalent{ end, info = function(self, t) return ([[Uses mana instead of life to take damage. Uses %0.2f mana per damage taken. - The damage to mana ratio increases with the Magic stat]]):format(3 - (self:combatSpellpower(1) * self:getTalentLevel(t)) / 280) + The damage to mana ratio increases with the Magic stat]]):format(math.max(0.8, 3 - (self:combatSpellpower(1) * self:getTalentLevel(t)) / 280)) end, } diff --git a/game/modules/tome/data/talents/spells/temporal.lua b/game/modules/tome/data/talents/spells/temporal.lua index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..aa40ce1ef9e0e46b2b200ce2e116166a5e273b65 100644 --- a/game/modules/tome/data/talents/spells/temporal.lua +++ b/game/modules/tome/data/talents/spells/temporal.lua @@ -0,0 +1,73 @@ +newTalent{ + name = "Time Prison", + type = {"spell/temporal", 1}, + require = spells_req1, + points = 5, + mana = 30, + cooldown = 30, + tactical = { + DEFENSE = 10, + }, + range = 20, + action = function(self, t) + local tg = {type="hit", range=self:getTalentRange(t)} + local x, y = self:getTarget(tg) + if not x or not y then return nil end + self:project(tg, x, y, DamageType.TIME_PRISON, 4 + self:combatSpellpower(0.03) * self:getTalentLevel(t), {type="manathrust"}) + return true + end, + info = function(self, t) + return ([[Removes the target from the flow of time for %d turns. In this state the target cannot act nor be harmed. + The duration will increase with the Magic stat]]):format(4 + self:combatSpellpower(0.03) * self:getTalentLevel(t)) + end, +} + +newTalent{ + name = "Congeal Time", + type = {"spell/temporal",2}, + require = spells_req2, + points = 5, + mana = 20, + cooldown = 30, + tactical = { + BUFF = 10, + }, + action = function(self, t) + local tg = {type="hit", range=self:getTalentRange(t)} + local x, y = self:getTarget(tg) + if not x or not y then return nil end + self:project(tg, x, y, DamageType.SLOW, util.bound((self:combatSpellpower(25) * self:getTalentLevel(t)) / 100, 0.1, 0.4), {type="manathrust"}) + return true + end, + info = function(self, t) + return ([[Decreases the target global speed by %.2f for 7 turns. + The speed decreases with the Magic stat]]):format(util.bound((self:combatSpellpower(25) * self:getTalentLevel(t)) / 100, 0.1, 0.4)) + end, +} + +newTalent{ + name = "Essence of Speed", + type = {"spell/temporal",4}, + require = spells_req4, + points = 5, + mode = "sustained", + sustain_mana = 450, + cooldown = 30, + tactical = { + BUFF = 10, + }, + activate = function(self, t) + local power = util.bound((self:combatSpellpower(50) * self:getTalentLevel(t)) / 100, 0.1, 2) + return { + speed = self:addTemporaryValue("energy", {mod=power}), + } + end, + deactivate = function(self, t, p) + self:removeTemporaryValue("energy", p.speed) + return true + end, + info = function(self, t) + return ([[Increases the caster global speed by %.2f. + The speed increases with the Magic stat]]):format(util.bound((self:combatSpellpower(50) * self:getTalentLevel(t)) / 100, 0.1, 2)) + end, +} diff --git a/game/modules/tome/data/timed_effects.lua b/game/modules/tome/data/timed_effects.lua index 76c98be2f4f8cf261771cd0a70541fcc12852479..28f7429c851a8efffaef071da7a1bc5b1988a12d 100644 --- a/game/modules/tome/data/timed_effects.lua +++ b/game/modules/tome/data/timed_effects.lua @@ -135,6 +135,22 @@ newEffect{ end, } +newEffect{ + name = "SLOW", + desc = "Slow", + type = "magical", + status = "detrimental", + parameters = { power=0.1 }, + on_gain = function(self, err) return "#Target# slows down.", "+Slow" end, + on_lose = function(self, err) return "#Target# speeds up.", "-Slow" end, + activate = function(self, eff) + eff.tmpid = self:addTemporaryValue("energy", {mod=-eff.power}) + end, + deactivate = function(self, eff) + self:removeTemporaryValue("energy", eff.tmpid) + end, +} + newEffect{ name = "INVISIBILITY", desc = "Invisibility", @@ -222,3 +238,23 @@ newEffect{ self:removeTemporaryValue("combat_spellcrit", eff.sid) end, } + +newEffect{ + name = "TIME_PRISON", + desc = "Time Prison", + type = "other", + status = "detrimental", + parameters = {}, + on_gain = function(self, err) return "#Target# is removed from time!", "+Out of Time" end, + on_lose = function(self, err) return "#Target# is into normal time.", "-Out of Time" end, + activate = function(self, eff) + eff.iid = self:addTemporaryValue("invulnerable", 1) + self.energy.value = 0 + end, + on_timeout = function(self, eff) + self.energy.value = 0 + end, + deactivate = function(self, eff) + self:removeTemporaryValue("invulnerable", eff.iid) + end, +} diff --git a/ideas/spells.ods b/ideas/spells.ods index a0cedd779c9b9ac0ea7b9265e29828e941018c95..6a0645a0ee65447286922de980654b36ecd11b4a 100644 Binary files a/ideas/spells.ods and b/ideas/spells.ods differ