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

skeleton & ghoul player races

git-svn-id: http://svn.net-core.org/repos/t-engine4@554 51575b47-30f0-44d4-a5cc-537603b46e54
parent d7961dd3
No related branches found
No related tags found
No related merge requests found
......@@ -110,10 +110,15 @@ function _M:trigger(x, y, who)
str = str:gsub("@Target@", tname:capitalize())
game.logSeen(who, "%s", str)
end
if self:triggered(x, y, who) then
local known, del = self:triggered(x, y, who)
if known then
self:setKnown(who, true)
game.level.map:updateMap(x, y)
end
if del then
game.level.map:remove(x, y, Map.TRAP)
if self.removed then self:removed(x, y, who) end
end
end
--- When moving on a trap, trigger it
......
......@@ -357,6 +357,23 @@ function _M:onTakeHit(value, src)
end
end
if self:attr("damage_shield") then
-- Absorb damage into the shield
if value <= self.damage_shield_absorb then
self.damage_shield_absorb = self.damage_shield_absorb - value
value = 0
else
self.damage_shield_absorb = 0
value = value - self.damage_shield_absorb
end
-- If we are at the end of the capacity, release the time shield damage
if self.damage_shield_absorb <= 0 then
game.logPlayer(self, "Your shield crumbles under the damage!")
self:removeEffect(self.EFF_DAMAGE_SHIELD)
end
end
if self:attr("displacement_shield") then
-- Absorb damage into the displacement shield
if value <= self.displacement_shield and rng.percent(self.displacement_shield_chance) then
......
......@@ -33,8 +33,14 @@ newBirthDescriptor{
{
__ALL__ = "never",
Ghoul = function() return config.settings.tome.allow_build.undead_ghoul and "allow" or "never" end,
Skeleton = function() return config.settings.tome.allow_build.undead_skeleton and "allow" or "never" end,
Vampire = function() return config.settings.tome.allow_build.undead_vampire and "allow" or "never" end,
Wight = function() return config.settings.tome.allow_build.undead_wight and "allow" or "never" end,
},
},
copy = {
undead = 1,
}
}
newBirthDescriptor
......@@ -48,6 +54,7 @@ newBirthDescriptor
"- bleeding immunity",
"- stun resistance",
"- fear immunity",
"- special ghoul talents: ghoulish leap, gnaw and retch",
"The rotting body of ghouls also forces them to act a bit slower than most creatures.",
},
descriptor_choices =
......@@ -60,7 +67,7 @@ newBirthDescriptor
},
stats = { str=3, con=5, wil=-2, mag=0, dex=1, cun=2 },
talents_types = {
["undead/ghoul"]={true, 0.3},
["undead/ghoul"]={true, 0.1},
},
talents = {
[ActorTalents.T_GHOUL]=1,
......@@ -80,3 +87,47 @@ newBirthDescriptor
},
experience = 2,
}
newBirthDescriptor
{
type = "subrace",
name = "Skeleton",
desc = {
"Skeletons are animated bones, undead creatures, both strong and dextrous.",
"They have access to special skeleton talents and a wide range of undead abilities:",
"- poison immunity",
"- bleeding immunity",
"- fear immunity",
"- no need to breath",
"- special skeleton talents: ",
"The rotting body of ghouls also forces them to act a bit slower than most creatures.",
},
descriptor_choices =
{
sex =
{
__ALL__ = "never",
Male = "allow",
},
},
stats = { str=3, con=0, wil=0, mag=0, dex=4, cun=0 },
talents_types = {
["undead/skeleton"]={true, 0.1},
},
talents = {
[ActorTalents.T_SKELETON]=1,
},
copy = {
type = "undead", subtype="skeleton",
default_wilderness = {"wilderness/main", 39, 17},
starting_zone = "tower-amon-sul",
starting_quest = "start-dunadan",
starting_intro = "dwarf",
life_rating=12,
poison_immune = 1,
cut_immune = 1,
fear_immune = 1,
no_breath = 1,
},
experience = 2,
}
......@@ -278,6 +278,20 @@ newDamageType{
end,
}
-- Bleeding damage
newDamageType{
name = "bleed", type = "BLEED",
projector = function(src, x, y, type, dam)
DamageType:get(DamageType.PHYSICAL).projector(src, x, y, DamageType.PHYSICAL, dam / 6)
dam = dam - dam / 6
local target = game.level.map(x, y, Map.ACTOR)
if target and target:canBe("cut") then
-- Set on fire!
target:setEffect(target.EFF_CUT, 5, {src=src, power=dam / 5})
end
end,
}
-- Slime damage
newDamageType{
name = "slime", type = "SLIME",
......@@ -404,3 +418,16 @@ newDamageType{
end
end,
}
-- Retch: heal undead; damage living
newDamageType{
name = "retch", type = "RETCH",
projector = function(src, x, y, type, dam)
local target = game.level.map(x, y, Map.ACTOR)
if target and target.undead then
target:heal(dam)
elseif target then
DamageType:get(DamageType.BLIGHT).projector(src, x, y, DamageType.BLIGHT, dam)
end
end,
}
......@@ -24,11 +24,15 @@ newTalent{
require = undeads_req1,
points = 5,
on_learn = function(self, t)
self:incStat(self.STAT_STR, 2)
self:incStat(self.STAT_CON, 2)
end,
on_unlearn = function(self, t)
self:incStat(self.STAT_STR, -2)
self:incStat(self.STAT_CON, -2)
end,
info = function(self, t)
return ([[Improves your ghoulish body.]]):format()
return ([[Improves your ghoulish body, increasing strength and constitution by %d.]]):format(2 * self:getTalentLevelRaw(t))
end,
}
......@@ -110,13 +114,31 @@ newTalent{
type = {"undead/ghoul",4},
require = undeads_req4,
points = 5,
cooldown = 25,
tactical = {
DEFEND = 10,
ATTACK = 10,
},
range=1,
action = function(self, t)
local duration = self:getTalentLevel(t) / 2 + 4
local radius = 3
local dam = (2 + self:getCon(8)) * self:getTalentLevel(t)
local tg = {type="ball", range=self:getTalentRange(t), radius=radius}
-- Add a lasting map effect
game.level.map:addEffect(self,
self.x, self.y, duration,
DamageType.RETCH, dam,
radius,
5, nil,
engine.Entity.new{alpha=100, display='', color_br=30, color_bg=180, color_bb=60},
nil, self:spellFriendlyFire()
)
game:playSoundNear(self, "talents/cloud")
return true
end,
info = function(self, t)
return ([[Vomit on the ground aruond you, healing any undeads in the area and damaging others.]])
return ([[Vomit on the ground aruond you, healing any undeads in the area and damaging others.
Lasts %d turns and deals %d blight damage.]]):format(self:getTalentLevel(t) / 2 + 4, (2 + self:getCon(8)) * self:getTalentLevel(t))
end,
}
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
newTalent{
name = "Skeleton",
type = {"undead/skeleton", 1},
mode = "passive",
require = undeads_req1,
points = 5,
on_learn = function(self, t)
self:incStat(self.STAT_STR, 2)
self:incStat(self.STAT_DEX, 2)
end,
on_unlearn = function(self, t)
self:incStat(self.STAT_STR, -2)
self:incStat(self.STAT_DEX, -2)
end,
info = function(self, t)
return ([[Improves your skeletal condition, increasing strength and dexterity by %d.]]):format(2 * self:getTalentLevelRaw(t))
end,
}
newTalent{
name = "Sharp Bones",
type = {"undead/skeleton", 2},
require = undeads_req2,
points = 5,
cooldown = 15,
tactical = {
ATTACK = 10,
},
range = 1,
action = function(self, t)
local x, y = self.x, self.y
if game.level.map(x, y, game.level.map.TRAP) then
game.logPlayer(self, "There is already a trap here!")
return
end
local dam = (10 + self:getStr(20)) * self:getTalentLevel(t)
local e = require("mod.class.Trap").new{
type = "physical", subtype="sharp", id_by_type=true, unided_name = "trap", identified=true,
name = "sharp bones",
display = '^', color=colors.ANTIQUE_WHITE,
triggered = function(self, x, y, who)
self:project({type="hit",x=x,y=y}, x, y, engine.DamageType.BLEED, dam)
return true, true
end,
summoner_gain_exp = true,
summoner = self,
}
game.zone:addEntity(game.level, e, "trap", x, y)
game:playSoundNear(self, "talents/earth")
return true
end,
info = function(self, t)
return ([[Lay down some sharpened bones to make a simple trap that will cause anyone stepping on it to bleed for %d damage.]]):
format((10 + self:getStr(20)) * self:getTalentLevel(t))
end,
}
newTalent{
name = "Bone Armour",
type = {"undead/skeleton", 3},
require = undeads_req3,
points = 5,
cooldown = 30,
tactical = {
DEFEND = 20,
},
range = 1,
action = function(self, t)
self:setEffect(self.EFF_DAMAGE_SHIELD, 10, {power=(8 + self:getDex(20)) * self:getTalentLevel(t)})
return true
end,
info = function(self, t)
return ([[Creates a shield of bones absorbing %d damage. Lasts for 10 turns.]]):
format((5 + self:getDex(20)) * self:getTalentLevel(t))
end,
}
newTalent{ short_name = "SKELETON_REASSEMBLE",
name = "Re-assemble",
type = {"undead/skeleton",4},
require = undeads_req4,
points = 5,
cooldown = 45,
tactical = {
DEFEND = 10,
},
range=1,
action = function(self, t)
self:heal(self:getTalentLevel(t) * self.level / 2, self)
game:playSoundNear(self, "talents/heal")
return true
end,
info = function(self, t)
return ([[Re-position some of your bones, healing yourself for %d.
At level 5 you will gain the ability to completly re-assemble your body should it be destroyed (can only be used once)]]):
format(self:getTalentLevel(t) * self.level / 2)
end,
}
......@@ -41,3 +41,4 @@ undeads_req5 = {
}
load("/data/talents/undeads/ghoul.lua")
load("/data/talents/undeads/skeleton.lua")
......@@ -395,6 +395,24 @@ newEffect{
end,
}
newEffect{
name = "DAMAGE_SHIELD",
desc = "Damage Shield",
type = "magical",
status = "beneficial",
parameters = { power=100 },
on_gain = function(self, err) return "A shield forms around #target#.", "+Shield" end,
on_lose = function(self, err) return "The shield around #target# crumbles.", "-Shield" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("damage_shield", eff.power)
--- Warning there can be only one time shield active at once for an actor
self.damage_shield_absorb = eff.power
end,
deactivate = function(self, eff)
self:removeTemporaryValue("damage_shield", eff.tmpid)
self.damage_shield_absorb = nil
end,
}
newEffect{
name = "TIME_SHIELD",
......
......@@ -131,6 +131,13 @@ function _M:use()
self.actor.blood_life = false
game.logPlayer(self.actor, "#LIGHT_RED#The Blood of Life rushes through your dead body. You come back to life!")
self:cleanActor()
self:restoreRessources()
self:resurrectBasic()
elseif act == "skeleton" then
self.actor:attr("re-assembled", 1)
game.logPlayer(self.actor, "#YELLOW#Your bones magically come back together. You are once more able to dish pain to your foes!")
self:cleanActor()
self:restoreRessources()
self:resurrectBasic()
......@@ -142,6 +149,7 @@ function _M:generateList()
if config.settings.tome.cheat then list[#list+1] = {name="Resurrect by cheating", action="cheat"} end
if self.actor:attr("blood_life") and not self.actor:attr("undead") then list[#list+1] = {name="Resurrect with the Blood of Life", action="blood_life"} end
if self.actor:getTalentLevelRaw(self.actor.T_SKELETON_REASSEMBLE) >= 5 and not self.actor:attr("re-assembled") then list[#list+1] = {name="Re-assemble your bones ad resurrect (Skeleton ability)", action="skeleton"} end
list[#list+1] = {name="Character dump", action="dump"}
list[#list+1] = {name="Exit to main menu", action="exit"}
......
No preview for this file type
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