diff --git a/game/engine/Game.lua b/game/engine/Game.lua index 85a9ae52fda13e0d8b842afee499fc705392cde3..18b0bc25780e67fc90d111c67d59bfd89a626a4a 100644 --- a/game/engine/Game.lua +++ b/game/engine/Game.lua @@ -52,6 +52,8 @@ function _M:loaded() self.key = engine.Key.current self.mouse = engine.Mouse.new() self.mouse:setCurrent() + + self.__threads = self.__threads or {} end --- Defines the default fields to be saved by the savefile code diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index d36058be7ff56ef0e8781aa5e549bf90ba6fa79d..b3fa3ae119d828afb7440b024334932492200877 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -178,6 +178,10 @@ function _M:act() local t = self:getTalentFromId(self.T_THUNDERSTORM) t.do_storm(self, t) end + if self:isTalentActive(self.T_BODY_OF_FIRE) then + local t = self:getTalentFromId(self.T_BODY_OF_FIRE) + t.do_fire(self, t) + end if self:isTalentActive(self.T_HYMN_OF_MOONLIGHT) then local t = self:getTalentFromId(self.T_HYMN_OF_MOONLIGHT) t.do_beams(self, t) diff --git a/game/modules/tome/data/talents/spells/fire-alchemy.lua b/game/modules/tome/data/talents/spells/fire-alchemy.lua index fa057880548cb4ab1623d8ac3df27473109362af..2db3bc60c6c9c692946b1549001fb7b638064840 100644 --- a/game/modules/tome/data/talents/spells/fire-alchemy.lua +++ b/game/modules/tome/data/talents/spells/fire-alchemy.lua @@ -83,43 +83,11 @@ newTalent{ return ([[Throw a smoke bomb, blocking line of sight. The smoke dissipates after %d turns.]]):format(2 + self:combatSpellpower(0.03) * self:getTalentLevel(t)) end, } -newTalent{ - name = "Body of Fire", - type = {"spell/fire-alchemy",3}, - require = spells_req3, - cooldown = 20, - mana = 20, - points = 5, - range = 1, - action = function(self, t) - local ammo = self:hasAlchemistWeapon() - if not ammo or ammo:getNumber() < 5 then - game.logPlayer(self, "You need to ready 2 alchemist gems in your quiver.") - return - end - - local tg = {type="bolt", range=self:getTalentRange(t), nolock=true, talent=t} - local x, y = self:getTarget(tg) - if not x or not y then return nil end - local _ _, x, y = self:canProject(tg, x, y) - - for i = 1, 5 do self:removeObject(self:getInven("QUIVER"), 1) end - local power = math.floor(4 + self:combatSpellpower(0.06) * self:getTalentLevel(t)) - self:probabilityTravel(x, y, power) - game:playSoundNear(self, "talents/arcane") - return true - end, - info = function(self, t) - return ([[Turn your body into pure flame, increasing your fire resistance, burning any creatures attacking you for %0.2f fire damage and projecting randomly fire bolts at targets in sight. - The damage will increase with Magic stat.]]): - format(math.floor(4 + self:combatSpellpower(0.06) * self:getTalentLevel(t))) - end, -} newTalent{ name = "Magma Pool", - type = {"spell/fire-alchemy",4}, - require = spells_req4, + type = {"spell/fire-alchemy",3}, + require = spells_req3, points = 5, mana = 80, cooldown = 15, @@ -152,3 +120,73 @@ newTalent{ At level 3 it will become a beam.]]):format(math.floor((3 + self:getTalentLevel(t)) / 1.5)) end, } + +newTalent{ + name = "Body of Fire", + type = {"spell/fire-alchemy",4}, + require = spells_req4, + mode = "sustained", + cooldown = 40, + sustain_mana = 250, + points = 5, + range = 1, + proj_speed = 2, + do_fire = function(self, t) + if self:getMana() <= 0 then + local old = self.energy.value + self.energy.value = 100000 + self:useTalent(self.T_BODY_OF_FIRE) + self.energy.value = old + return + end + + local tgts = {} + local grids = core.fov.circle_grids(self.x, self.y, 5, true) + for x, yy in pairs(grids) do for y, _ in pairs(grids[x]) do + local a = game.level.map(x, y, Map.ACTOR) + if a and self:reactionToward(a) < 0 then + tgts[#tgts+1] = a + end + end end + + -- Randomly take targets + local tg = {type="bolt", range=self:getTalentRange(t), talent=t, display={particle="bolt_fire"}} + for i = 1, math.floor(self:getTalentLevel(t)) do + if #tgts <= 0 then break end + local a, id = rng.table(tgts) + table.remove(tgts, id) + + self:projectile(tg, a.x, a.y, DamageType.FIRE, self:spellCrit(self:combatTalentSpellDamage(t, 15, 70)), {type="flame"}) + game:playSoundNear(self, "talents/fire") + end + end, + activate = function(self, t) + local res = self:combatTalentSpellDamage(t, 5, 45) + local dam = self:combatTalentSpellDamage(t, 5, 25) + + game:playSoundNear(self, "talents/fireflash") + game.logSeen(self, "#FF8000#%s turns into pure flame!", self.name:capitalize()) + return { + onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.FIRE]=dam}), + res = self:addTemporaryValue("resists", {[DamageType.FIRE] = res}), + drain = self:addTemporaryValue("mana_regen", -0.4 * self:getTalentLevelRaw(t)), + } + end, + deactivate = function(self, t, p) + game.logSeen(self, "#FF8000#The raging fire around %s calms down and disappears.", self.name) + self:removeTemporaryValue("onhit", p.onhit) + self:removeTemporaryValue("resists", p.res) + self:removeTemporaryValue("mana_regen", p.drain) + return true + end, + info = function(self, t) + return ([[Turn your body into pure flame, increasing your fire resistance by %d%%, burning any creatures attacking you for %0.2f fire damage and projecting randomly slow moving fire bolts at targets in sight doing %0.2f fire damage. + This powerful spell drains mana while active. + The damage will increase with Magic stat.]]): + format( + self:combatTalentSpellDamage(t, 5, 45), + self:combatTalentSpellDamage(t, 5, 25), + self:combatTalentSpellDamage(t, 15, 70) + ) + end, +} diff --git a/ideas/crafting.ods b/ideas/crafting.ods index e67c3b641c0a07d7243a60f88a2b59c37f3a0cce..fdce4f767aa8c74e627edf91bcf67f4fc8246c39 100644 Binary files a/ideas/crafting.ods and b/ideas/crafting.ods differ