diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua index a095c887233a3554e98a6b1494bb59df10acee60..7aca7523a9272e10232b670e34f25c82f50e6493 100644 --- a/game/modules/tome/class/Object.lua +++ b/game/modules/tome/class/Object.lua @@ -428,6 +428,11 @@ function _M:getTextualDesc() if a.leech then desc:add(("Life regen %d%% of max life"):format(a.leech), true) end end + if self.mana_consume then + desc:add({"color","YELLOW"}, "When consumed using the correct talent:", {"color", "LAST"}, true) + desc:add(("Restores at least %d mana."):format(self.mana_consume), true) + end + local use_desc = self:getUseDesc() if use_desc then desc:add(use_desc) end diff --git a/game/modules/tome/data/achievements/items.lua b/game/modules/tome/data/achievements/items.lua index e93d7538e72de7c6eb12b65c49ee3974949ce94c..d74f9639a63243be6a63ea487c69e99bc404e3a6 100644 --- a/game/modules/tome/data/achievements/items.lua +++ b/game/modules/tome/data/achievements/items.lua @@ -19,12 +19,12 @@ newAchievement{ name = "Deus Ex Machina", - desc = [[Found both ever-refilling potions.]], + desc = [[Found the ever-refilling potion and the blood of life.]], mode = "player", can_gain = function(self, who, obj) - if obj:getName{force_id=true} == "Ever-Refilling Potion of Mana" then self.mana = true end + if obj:getName{force_id=true} == "Blood of Life" then self.blood = true end if obj:getName{force_id=true} == "Ever-Refilling Potion of Healing" then self.life = true end - return self.mana and self.life + return self.blood and self.life end } diff --git a/game/modules/tome/data/birth/classes/mage.lua b/game/modules/tome/data/birth/classes/mage.lua index dc7dc74ad6f09c8d6c2419f8b75836187563aa89..ca1ca6fc44bff83e8f331a8c2819ad01ae711557 100644 --- a/game/modules/tome/data/birth/classes/mage.lua +++ b/game/modules/tome/data/birth/classes/mage.lua @@ -40,10 +40,10 @@ newBirthDescriptor{ copy = { mana_regen = 0.5, mana_rating = 7, - resolvers.generic(function(e) - e.hotkey[10] = {"inventory", "potion of lesser mana"} - end), }, + talents = { + [ActorTalents.T_MANA_GEM] = 1, + } } newBirthDescriptor{ @@ -90,8 +90,9 @@ newBirthDescriptor{ {type="armor", subtype="cloth", name="linen robe", autoreq=true}, }, resolvers.inventory{ id=true, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, }, }, copy_add = { @@ -141,8 +142,9 @@ newBirthDescriptor{ {type="gem",}, {type="gem",}, {type="gem",}, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, }, resolvers.generic(function(self) -- Make and wield some alchemist gems @@ -207,8 +209,9 @@ newBirthDescriptor{ {type="armor", subtype="cloth", name="linen robe", autoreq=true}, }, resolvers.inventory{ id=true, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, }, }, copy_add = { @@ -259,8 +262,9 @@ newBirthDescriptor{ {type="armor", subtype="cloth", name="linen robe", autoreq=true}, }, resolvers.inventory{ id=true, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, }, }, copy_add = { @@ -312,8 +316,9 @@ newBirthDescriptor{ {type="armor", subtype="cloth", name="linen robe", autoreq=true}, }, resolvers.inventory{ id=true, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, }, }, copy_add = { @@ -366,8 +371,9 @@ newBirthDescriptor{ {type="armor", subtype="cloth", name="linen robe", autoreq=true}, }, resolvers.inventory{ id=true, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, }, }, } @@ -415,8 +421,9 @@ newBirthDescriptor{ {type="armor", subtype="cloth", name="linen robe", autoreq=true}, }, resolvers.inventory{ id=true, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, - {type="potion", subtype="potion", name="potion of lesser mana", ego_chance=-1000}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, }, }, } diff --git a/game/modules/tome/data/birth/classes/rogue.lua b/game/modules/tome/data/birth/classes/rogue.lua index f7d3ed714437188b0d3d1f62ab63eb961ad2b0c9..02141feaa6d93ebde9ef5a38d16468d8790d8370 100644 --- a/game/modules/tome/data/birth/classes/rogue.lua +++ b/game/modules/tome/data/birth/classes/rogue.lua @@ -110,11 +110,13 @@ newBirthDescriptor{ [ActorTalents.T_SHADOW_COMBAT] = 1, [ActorTalents.T_PHASE_DOOR] = 1, [ActorTalents.T_LETHALITY] = 1, + [ActorTalents.T_MANA_GEM] = 1, }, copy = { resolvers.inventory{ id=true, - {type="potion", subtype="potion", name="potion of lesser mana"}, - {type="potion", subtype="potion", name="potion of lesser mana"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, }, }, } diff --git a/game/modules/tome/data/birth/classes/warrior.lua b/game/modules/tome/data/birth/classes/warrior.lua index 38c8ce7232d35f58d8a5270e808d908b80c099c8..a53d68d49c4de3503d4c9a238d42e5ba0df03277 100644 --- a/game/modules/tome/data/birth/classes/warrior.lua +++ b/game/modules/tome/data/birth/classes/warrior.lua @@ -159,6 +159,7 @@ newBirthDescriptor{ [ActorTalents.T_ARCANE_COMBAT] = 1, [ActorTalents.T_STUNNING_BLOW] = 1, [ActorTalents.T_WEAPON_COMBAT] = 1, + [ActorTalents.T_MANA_GEM] = 1, }, copy = { max_life = 100, @@ -168,8 +169,9 @@ newBirthDescriptor{ {type="armor", subtype="light", name="rough leather armour", autoreq=true}, }, resolvers.inventory{ id=true, - {type="potion", subtype="potion", name="potion of lesser mana"}, - {type="potion", subtype="potion", name="potion of lesser mana"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, + {type="gem", name="agate"}, }, }, copy_add = { diff --git a/game/modules/tome/data/general/objects/gem.lua b/game/modules/tome/data/general/objects/gem.lua index d40931befd332d970ac9cc721d5dae17c148bfa1..ef1a166cd73b724ac62b7462e2af1223a7664e79 100644 --- a/game/modules/tome/data/general/objects/gem.lua +++ b/game/modules/tome/data/general/objects/gem.lua @@ -29,13 +29,14 @@ newEntity{ desc = [[Gems can be sold for money or used in arcane rituals.]], } -local function newGem(name, image, cost, rarity, color, min_level, max_level, tier, power, imbue, bomb) +local function newGem(name, image, cost, rarity, color, min_level, max_level, tier, power, imbue, bomb, mana_consume) -- Gems, randomly lootable newEntity{ base = "BASE_GEM", define_as = "GEM_"..name:upper(), name = name:lower(), subtype = color, color = colors[color:upper()], image=image, level_range = {min_level, max_level}, rarity = rarity, cost = cost, + mana_consume = mana_consume, material_level = tier, imbue_powers = imbue, } @@ -53,97 +54,121 @@ end newGem("Diamond", "object/diamond.png",5, 18, "white", 40, 50, 5, 70, { inc_stats = { [Stats.STAT_STR] = 5, [Stats.STAT_DEX] = 5, [Stats.STAT_MAG] = 5, [Stats.STAT_WIL] = 5, [Stats.STAT_CUN] = 5, [Stats.STAT_CON] = 5, } }, - { power=25 } + { power=25 }, + 300 ) newGem("Pearl", "object/pearl.png", 5, 18, "white", 40, 50, 5, 70, { resists = {all=10} }, - { splash={type="LITE", dam=1} } + { splash={type="LITE", dam=1} }, + 300 ) newGem("Moonstone", "object/moonstone.png",5, 18, "white", 40, 50, 5, 70, { combat_def=10 }, - { stun={chance=20, dur=3} } + { stun={chance=20, dur=3} }, + 300 ) newGem("Fire Opal", "object/fireopal.png",5, 18, "red", 40, 50, 5, 70, { inc_damage = {all=10} }, - { splash={type="FIRE", dam=40} } + { splash={type="FIRE", dam=40} }, + 300 ) newGem("Bloodstone", "object/bloodstone.png",5, 18, "red", 40, 50, 5, 70, { stun_immune=0.6 }, - { leech=10 } + { leech=10 }, + 300 ) newGem("Ruby", "object/ruby.png", 4, 16, "red", 30, 40, 4, 65, { inc_stats = { [Stats.STAT_STR] = 4, [Stats.STAT_DEX] = 4, [Stats.STAT_MAG] = 4, [Stats.STAT_WIL] = 4, [Stats.STAT_CUN] = 4, [Stats.STAT_CON] = 4, } }, - { power=20 } + { power=20 }, + 250 ) newGem("Amber", "object/amber.png", 4, 16, "yellow", 30, 40, 4, 65, { inc_damage = {all=8} }, - { stun={chance=10, dur=2} } + { stun={chance=10, dur=2} }, + 250 ) newGem("Turquoise", "object/turquoise.png",4, 16, "green", 30, 40, 4, 65, { see_invisible=10 }, - { splash={type="ACID", dam=30} } + { splash={type="ACID", dam=30} }, + 250 ) newGem("Jade", "object/jade.png", 4, 16, "green", 30, 40, 4, 65, { resists = {all=8} }, - { splash={type="SLOW", dam=-1 + 1 / (1 + 0.20)} } + { splash={type="SLOW", dam=-1 + 1 / (1 + 0.20)} }, + 250 ) newGem("Sapphire", "object/garnet.png",4, 16, "blue", 30, 40, 4, 65, { combat_def=8 }, - { splash={type="ICE", dam=30} } + { splash={type="ICE", dam=30} }, + 250 ) newGem("Quartz", "object/quartz.png",3, 12, "white", 20, 30, 3, 50, { stun_immune=0.3 }, - { splash={type="SPELLKNOCKBACK", dam=10} } + { splash={type="SPELLKNOCKBACK", dam=10} }, + 200 ) newGem("Emerald", "object/emerald.png",3, 12, "green", 20, 30, 3, 50, { resists = {all=6} }, - { splash={type="POISON", dam=50} } + { splash={type="POISON", dam=50} }, + 200 ) newGem("Lapis Lazuli", "object/lapis_lazuli.png",3, 12, "blue", 20, 30, 3, 50, { combat_def=6 }, - { mana=30 } + { mana=30 }, + 200 ) newGem("Garnets", "object/garnet.png",3, 12, "red", 20, 30, 3, 50, { inc_damage = {all=6} }, - { leech=5 } + { leech=5 }, + 200 ) newGem("Onyx", "object/.png", 3, 12, "black", 20, 30, 3, 50, { inc_stats = { [Stats.STAT_STR] = 3, [Stats.STAT_DEX] = 3, [Stats.STAT_MAG] = 3, [Stats.STAT_WIL] = 3, [Stats.STAT_CUN] = 3, [Stats.STAT_CON] = 3, } }, - { power=15 } + { power=15 }, + 200 ) newGem("Amethyst", "object/.png",2, 10, "violet", 10, 20, 2, 35, { inc_damage = {all=4} }, - { splash={type="ARCANE", dam=25}} + { splash={type="ARCANE", dam=25}}, + 150 ) newGem("Opal", "object/.png", 2, 10, "blue", 10, 20, 2, 35, { inc_stats = { [Stats.STAT_STR] = 2, [Stats.STAT_DEX] = 2, [Stats.STAT_MAG] = 2, [Stats.STAT_WIL] = 2, [Stats.STAT_CUN] = 2, [Stats.STAT_CON] = 2, } }, - { power=10 } + { power=10 }, + 150 ) newGem("Topaz", "object/.png", 2, 10, "blue", 10, 20, 2, 35, { combat_def=4 }, - { range=3 } + { range=3 }, + 150 ) newGem("Aquamarine", "object/.png",2, 10, "blue", 10, 20, 2, 35, { resists = {all=4} }, - { mana=20 } + { mana=20 }, + 150 ) newGem("Ametrine", "object/.png",1, 8, "yellow", 1, 10, 1, 20, { inc_damage = {all=2} }, - { splash={type="LITE", dam=1} } + { splash={type="LITE", dam=1} }, + 100 ) newGem("Zircon", "object/.png",1, 8, "yellow", 1, 10, 1, 20, { resists = {all=2} }, - { daze={chance=20, dur=3} } + { daze={chance=20, dur=3} }, + 100 ) newGem("Spinel", "object/.png",1, 8, "green", 1, 10, 1, 20, { combat_def=2 }, - { mana=10 } + { mana=10 }, + 100 ) newGem("Citrine", "object/.png",1, 8, "yellow", 1, 10, 1, 20, { lite=1 }, - { range=1 } + { range=1 }, + 100 ) newGem("Agate", "object/.png", 1, 8, "black", 1, 10, 1, 20, { inc_stats = { [Stats.STAT_STR] = 1, [Stats.STAT_DEX] = 1, [Stats.STAT_MAG] = 1, [Stats.STAT_WIL] = 1, [Stats.STAT_CUN] = 1, [Stats.STAT_CON] = 1, } }, - { power=5 } + { power=5 }, + 100 ) diff --git a/game/modules/tome/data/general/objects/potions.lua b/game/modules/tome/data/general/objects/potions.lua index 56bb2442833d5e49948496143b87f79a0d0c0604..8f3dcdf95ee06fa373da8284b8e000133defdbbf 100644 --- a/game/modules/tome/data/general/objects/potions.lua +++ b/game/modules/tome/data/general/objects/potions.lua @@ -90,65 +90,6 @@ newEntity{ base = "BASE_POTION", end} } -------------------------------------------------------- --- Mana -------------------------------------------------------- -newEntity{ base = "BASE_POTION", - name = "potion of lesser mana", - color = colors.LIGHT_BLUE, image="object/potion-5x0.png", - level_range = {1, 20}, - rarity = 3, - cost = 3, - - use_simple = { name="restore some mana", use = function(self, who) - who:incMana(40 + who:getMag()) - game.logSeen(who, "%s quaffs a %s!", who.name:capitalize(), self:getName{no_count=true}) - return "destroy", true - end} -} - -newEntity{ base = "BASE_POTION", - name = "potion of mana", - color = colors.LIGHT_BLUE, image="object/potion-5x0.png", - level_range = {15, 35}, - rarity = 4, - cost = 5, - - use_simple = { name="restore a good part of your mana", use = function(self, who) - who:incMana(140 + who:getMag()) - game.logSeen(who, "%s quaffs a %s!", who.name:capitalize(), self:getName{no_count=true}) - return "destroy", true - end} -} - -newEntity{ base = "BASE_POTION", - name = "potion of greater mana", - color = colors.LIGHT_BLUE, image="object/potion-5x0.png", - level_range = {30, 50}, - rarity = 5, - cost = 7, - - use_simple = { name="restore a lot of mana", use = function(self, who) - who:incMana(240 + who:getMag()) - game.logSeen(who, "%s quaffs a %s!", who.name:capitalize(), self:getName{no_count=true}) - return "destroy", true - end} -} - -newEntity{ base = "BASE_POTION", - name = "potion of full mana", image="object/potion-5x0.png", - color = colors.LIGHT_BLUE, - level_range = {45, 50}, - rarity = 14, - cost = 50, - - use_simple = { name="fully restore mana", use = function(self, who) - who:incMana(1000000) - game.logSeen(who, "%s quaffs a %s!", who.name:capitalize(), self:getName{no_count=true}) - return "destroy", true - end} -} - ------------------------------------------------------- -- Curing ------------------------------------------------------- diff --git a/game/modules/tome/data/general/objects/world-artifacts.lua b/game/modules/tome/data/general/objects/world-artifacts.lua index 4545e3025963188e630a2bb5cbeff0f5badb9c18..66903bcfb1810d49cf86c85fead9d7313272ca26 100644 --- a/game/modules/tome/data/general/objects/world-artifacts.lua +++ b/game/modules/tome/data/general/objects/world-artifacts.lua @@ -302,28 +302,6 @@ newEntity{ }, } -newEntity{ - unique = true, - type = "potion", subtype="potion", - name = "Ever-Refilling Potion of Mana", - unided_name = "strange potion", - level_range = {35, 40}, - display = '!', color=colors.VIOLET, image="object/potion-0x3-violet.png", - encumber = 0.4, - rarity = 150, - desc = [[Bottle containing raw magic. But the more you drink from it, the more it refills!]], - cost = 80, - - max_power = 100, power_regen = 1, - use_power = { name = "restore mana", power = 80, - use = function(self, who) - who:incMana(150 + who:getMag()) - game.logSeen(who, "%s quaffs an %s!", who.name:capitalize(), self:getName()) - return nil, true - end - }, -} - newEntity{ unique = true, type = "potion", subtype="potion", diff --git a/game/modules/tome/data/talents/misc/misc.lua b/game/modules/tome/data/talents/misc/misc.lua index 9bca9d9fac337a68139f4e69238408dab1d0c021..57ca3ffee678a5082483e97b084ac52a5f0f7151 100644 --- a/game/modules/tome/data/talents/misc/misc.lua +++ b/game/modules/tome/data/talents/misc/misc.lua @@ -153,6 +153,29 @@ newTalent{ The spell will take time to activate, you must be out of sight of any creature when you cast it and when the teleportation takes effect.]] } +-- All mana users get to destroy gems to suck up mana +newTalent{ + short_name = "MANA_GEM", + name = "Mana Gem", + type = {"base/class", 1}, + cooldown = 8, + no_npc_use = true, + is_spell=true, + action = function(self, t) + self:showEquipInven("Crush which gem?", function(o) return not o.unique and not o.quest and o.mana_consume and o.type == "gem" end, function(o, inven, item) + self:removeObject(inven, item) + self:incMana(o.mana_consume + self:getMag() * 1.3) + game.logPlayer(self, "You absorb the mana of your %s.", o:getName{do_color=true, no_count=false}) + return true + end) + game:playSoundNear(self, "talents/arcane") + return true + end, + info = [[Crush a gem to free the magical energies contained inside to restore some of your own mana. + Different gems provide different amounts of mana. + The amount regenerated also increases with the Magic stat.]] +} + -- Highers's power, a "weak" regeneration newTalent{ short_name = "HIGHER_HEAL", diff --git a/game/modules/tome/data/talents/techniques/superiority.lua b/game/modules/tome/data/talents/techniques/superiority.lua index cf944c3e25ca850fb4b76f66a73611c10367cd19..309a84bfa78a92d0b39e89ba2559b088a348e134 100644 --- a/game/modules/tome/data/talents/techniques/superiority.lua +++ b/game/modules/tome/data/talents/techniques/superiority.lua @@ -109,7 +109,6 @@ newTalent{ end, info = function(self, t) return ([[Put all your strength into your weapon blows, creating shattering impacts that deal %d%% weapon damage to all nearby foes. - The impact damage will also affect you. Each blow will drain 15 stamina.]]): format(100 * self:combatTalentWeaponDamage(t, 0.1, 0.45)) end, diff --git a/game/modules/tome/data/zones/sandworm-lair/objects.lua b/game/modules/tome/data/zones/sandworm-lair/objects.lua index 8b7855facc74eaa8e27bb4eb374dd8c2c371a60b..60535c6d710a6ab40cbf92a620715672d2ce1095 100644 --- a/game/modules/tome/data/zones/sandworm-lair/objects.lua +++ b/game/modules/tome/data/zones/sandworm-lair/objects.lua @@ -37,7 +37,11 @@ newEntity{ game.logPlayer(who, "You have %d class talent point(s) to spend. Press G to use them.", who.unused_talents) game.logPlayer(who, "You have %d generic talent point(s) to spend. Press G to use them.", who.unused_generics) - who:learnTalentType("wild-gift/sand-drake", false) + if who:knowTalentType("wild-gift/sand-drake") then + who:setTalentTypeMastery("wild-gift/sand-drake", who:getTalentTypeMastery("wild-gift/sand-drake") + 0.1) + else + who:learnTalentType("wild-gift/sand-drake", false) + end game.logPlayer(who, "You are transformed by the heart of the Queen!.") game.logPlayer(who, "#00FF00#You gain an affinity for sand. You can now learn new sand talents (press G).")