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

Added Pyromancer and Cryomancer achievements, for doing much damage with fire...

Added Pyromancer and Cryomancer achievements, for doing much damage with fire or cold. They will unlock the Pyromancer and Cryomancer classes instead of the books in the Prides.


git-svn-id: http://svn.net-core.org/repos/t-engine4@1294 51575b47-30f0-44d4-a5cc-537603b46e54
parent 4bbe848c
No related branches found
No related tags found
No related merge requests found
......@@ -46,3 +46,28 @@ newAchievement{
return nb >= 4 * 4 * 5
end
}
newAchievement{
name = "Pyromancer",
desc = [[Unlocked Archmage class and done over two million fire damage (with any item/talent/class).]],
mode = "world",
can_gain = function(self, who, dam)
self.nb = (self.nb or 0) + dam
return self.nb > 2000000 and profile.mod.allow_build.mage
end,
on_gain = function(_, src, personal)
game:setAllowedBuild("mage_pyromancer", true)
end,
}
newAchievement{
name = "Cryomancer",
desc = [[Unlocked Archmage class and done over two million cold damage (with any item/talent/class).]],
mode = "world",
can_gain = function(self, who, dam)
self.nb = (self.nb or 0) + dam
return self.nb > 2000000 and profile.mod.allow_build.mage
end,
on_gain = function(_, src, personal)
game:setAllowedBuild("mage_cryomancer", true)
end,
}
......@@ -127,6 +127,7 @@ newDamageType{
local target = game.level.map(x, y, Map.ACTOR)
if realdam > 0 and target and not target:attr("fire_proof") then
tryDestroy(target, target:getInven("INVEN"), realdam, "fire_destroy", "fire_proof", "The burst of heat destroys your %s!")
if src.player then world:gainAchievement("PYROMANCER", src, realdam) end
end
return realdam
end,
......@@ -138,6 +139,7 @@ newDamageType{
local target = game.level.map(x, y, Map.ACTOR)
if realdam > 0 and target and not target:attr("cold_proof") then
tryDestroy(target, target:getInven("INVEN"), realdam, "cold_destroy", "cold_proof", "The intense cold destroys your %s!")
if src.player then world:gainAchievement("CRYOMANCER", src, realdam) end
end
return realdam
end,
......
......@@ -67,7 +67,7 @@ newEntity{ base = "BASE_SCROLL", subtype="tome",
game.logPlayer(who, "#00FFFF#You read the tome and perfect your mastery of fire magic!")
end
game:setAllowedBuild("mage_pyromancer", true)
-- game:setAllowedBuild("mage_pyromancer", true)
return "destroy", true
end}
......@@ -91,7 +91,7 @@ newEntity{ base = "BASE_SCROLL", subtype="tome",
game.logPlayer(who, "#00FFFF#You read the tome and perfect your mastery of ice magic!")
end
game:setAllowedBuild("mage_cryomancer", true)
-- game:setAllowedBuild("mage_cryomancer", true)
return "destroy", true
end}
......
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