Skip to content
Snippets Groups Projects
Commit 1183201c authored by dg's avatar dg
Browse files

New "charms" category of items. Wands are arcane charms, Totems are natural...

New "charms" category of items. Wands are arcane charms, Totems are natural charms and Torques are psionic charms


git-svn-id: http://svn.net-core.org/repos/t-engine4@5061 51575b47-30f0-44d4-a5cc-537603b46e54
parent 7274a0cc
No related branches found
No related tags found
No related merge requests found
Showing
with 106 additions and 7 deletions
......@@ -1072,7 +1072,10 @@ function _M:onWear(o, bypass_set)
mod.class.Actor.onWear(self, o, bypass_set)
if not self.no_power_reset_on_wear then
o:forAllStack(function(so) if so.power and so:attr("power_regen") then so.power = 0 end end)
o:forAllStack(function(so)
if so.power and so:attr("power_regen") then so.power = 0 end
if so.talent_cooldown then self.talents_cd[so.talent_cooldown] = math.max(self.talents_cd[so.talent_cooldown] or 0, math.min(4, math.floor((so.use_power or so.use_talent).power / 5))) end
end)
end
end
......
......@@ -19,12 +19,108 @@
--[[
Totems
healing
cure illness
cure poisons
cure
*healing
*cure illness
*cure poisons
thorny skin
]]
newEntity{
name = " of cure illness", addon=true, instant_resolve=true,
level_range = {15, 50},
rarity = 8,
charm_power_def = {add=1, max=5, floor=true},
resolvers.charm("removes up to %d diseases from the target", 20, function(self, who)
local tg = {default_target=who, type="hit", nowarning=true, range=6 + who:getWil(4), first_target="friend"}
local x, y = who:getTarget(tg)
if not x or not y then return nil end
local nb = self:getCharmPower()
who:project(tg, x, y, function(px, py)
local target = game.level.map(px, py, engine.Map.ACTOR)
if not target then return end
local effs = {}
-- Go through all temporary effects
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if e.subtype.disease then
effs[#effs+1] = {"effect", eff_id}
end
end
for i = 1, nb do
if #effs == 0 then break end
local eff = rng.tableRemove(effs)
if eff[1] == "effect" then
target:removeEffect(eff[2])
end
end
end)
game:playSoundNear(who, "talents/heal")
game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true})
return {id=true, used=true}
end),
}
newEntity{
name = " of cure poisons", addon=true, instant_resolve=true,
level_range = {1, 50},
rarity = 8,
charm_power_def = {add=1, max=5, floor=true},
resolvers.charm("removes up to %d poisons from the target", 20, function(self, who)
local tg = {default_target=who, type="hit", nowarning=true, range=6 + who:getWil(4), first_target="friend"}
local x, y = who:getTarget(tg)
if not x or not y then return nil end
local nb = self:getCharmPower()
who:project(tg, x, y, function(px, py)
local target = game.level.map(px, py, engine.Map.ACTOR)
if not target then return end
local effs = {}
-- Go through all temporary effects
for eff_id, p in pairs(target.tmp) do
local e = target.tempeffect_def[eff_id]
if e.subtype.poison then
effs[#effs+1] = {"effect", eff_id}
end
end
for i = 1, nb do
if #effs == 0 then break end
local eff = rng.tableRemove(effs)
if eff[1] == "effect" then
target:removeEffect(eff[2])
end
end
end)
game:playSoundNear(who, "talents/heal")
game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true})
return {id=true, used=true}
end),
}
newEntity{
name = " of thorny skin", addon=true, instant_resolve=true,
level_range = {1, 50},
rarity = 6,
charm_power_def = {add=50, max=250, floor=true},
resolvers.charm("hardens the skin for 6 turns %d", 20, function(self, who)
local tg = {default_target=who, type="hit", nowarning=true, range=6 + who:getWil(4), first_target="friend"}
local x, y = who:getTarget(tg)
if not x or not y then return nil end
local dam = self:getCharmPower()
who:project(tg, x, y, engine.DamageType.HEAL, dam)
game:playSoundNear(who, "talents/heal")
game.logSeen(who, "%s uses %s!", who.name:capitalize(), self:getName{no_count=true})
return {id=true, used=true}
end),
}
newEntity{
name = " of healing", addon=true, instant_resolve=true,
level_range = {25, 50},
......
......@@ -22,7 +22,7 @@ newEntity{
slot = "TOOL",
type = "charm", subtype="torque",
unided_name = "torque", id_by_type = true,
display = "-", color=colors.WHITE, image = resolvers.image_material("wand", "wood"),
display = "-", color=colors.WHITE, image = resolvers.image_material("torque", "metal"),
encumber = 2,
rarity = 12,
add_name = "#CHARM# #CHARGES#",
......
......@@ -22,7 +22,7 @@ newEntity{
slot = "TOOL",
type = "charm", subtype="totem",
unided_name = "totem", id_by_type = true,
display = "-", color=colors.WHITE, image = resolvers.image_material("wand", "wood"),
display = "-", color=colors.WHITE, image = resolvers.image_material("totem", "wood"),
encumber = 2,
rarity = 12,
add_name = "#CHARM# #CHARGES#",
......
game/modules/tome/data/gfx/shockbolt/object/torque_dsteel.png

7.7 KiB

game/modules/tome/data/gfx/shockbolt/object/torque_iron.png

7 KiB

game/modules/tome/data/gfx/shockbolt/object/torque_steel.png

7.51 KiB

game/modules/tome/data/gfx/shockbolt/object/torque_stralite.png

6.75 KiB

game/modules/tome/data/gfx/shockbolt/object/torque_voratun.png

8.41 KiB

game/modules/tome/data/gfx/shockbolt/object/totem_ash.png

5.71 KiB

game/modules/tome/data/gfx/shockbolt/object/totem_dragonbone.png

7.28 KiB

game/modules/tome/data/gfx/shockbolt/object/totem_elm.png

6.86 KiB

game/modules/tome/data/gfx/shockbolt/object/totem_elvenwood.png

5.4 KiB

game/modules/tome/data/gfx/shockbolt/object/totem_yew.png

6.73 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment