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

fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@5377 51575b47-30f0-44d4-a5cc-537603b46e54
parent f10700b2
No related branches found
No related tags found
No related merge requests found
File added
File added
File added
File added
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 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
-- Edge TODO: Sounds, Particles,
newTalent{
name = "Sleep",
type = {"psionic/dreaming", 1},
points = 5,
require = psi_wil_req1,
cooldown = 4,
psi = 5,
tactical = { DISABLE = {sleep = 1} },
direct_hit = true,
requires_target = true,
range = function(self, t) return 5 + math.min(5, self:getTalentLevelRaw(t)) end,
radius = function(self, t) return 1 + math.floor(self:getTalentLevel(t)/4) end,
target = function(self, t) return {type="ball", radius=self:getTalentRadius(t), range=self:getTalentRange(t), talent=t} end,
getDuration = function(self, t) return 2 + math.ceil(self:getTalentLevel(t)/3) end,
getInsomniaDuration = function(self, t)
local t = self:getTalentFromId(self.T_SANDMAN)
local reduction = t.getInsomniaReduction(self, t)
return 10 - reduction
end,
getSleepPower = function(self, t)
local power = self:combatTalentMindDamage(t, 5, 25)
if self:knowTalent(self.T_SANDMAN) then
local t = self:getTalentFromId(self.T_SANDMAN)
power = power + t.getSleepPowerBonus(self, t)
end
return power
end,
action = function(self, t)
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
if not x or not y then return nil end
--Restless?
local is_waking =0
if self:knowTalent(self.T_RESTLESS_NIGHT) then
local t = self:getTalentFromId(self.T_RESTLESS_NIGHT)
is_waking = t.getDamage(self, t)
end
local power = self:mindCrit(t.getSleepPower(self, t))
self:project(tg, x, y, function(tx, ty)
local target = game.level.map(tx, ty, Map.ACTOR)
if target then
if target:canBe("sleep") then
target:setEffect(target.EFF_SLEEP, t.getDuration(self, t), {src=self, power=power, waking=is_waking, insomnia=t.getInsomniaDuration(self, t), no_ct_effect=true, apply_power=self:combatMindpower()})
else
game.logSeen(self, "%s resists the sleep!", target.name:capitalize())
end
end
end)
return true
end,
info = function(self, t)
local radius = self:getTalentRadius(t)
local duration = t.getDuration(self, t)
local power = t.getSleepPower(self, t)
local insomnia = t.getInsomniaDuration(self, t)
return([[Puts targets in a radius of %d to sleep for %d turns, rendering them unable to act. Every %d points of damage the target suffers will reduce the effect duration by one turn.
When Sleep ends the target will suffer from Insomnia for %d turns, rendering them resistant to sleep effects.
The damage threshold will scale with your mindpower.]]):format(radius, duration, power, insomnia)
end,
}
newTalent{
name = "Lucid Dreamer",
type = {"psionic/dreaming", 2},
points = 5,
require = psi_wil_req2,
mode = "sustained",
sustain_psi = 20,
cooldown = 12,
tactical = { BUFF=2 },
getPower = function(self, t) return self:combatTalentMindDamage(t, 5, 25) end,
activate = function(self, t)
game:playSoundNear(self, "talents/heal")
local power = t.getPower(self, t)
local ret = {
phys = self:addTemporaryValue("combat_physresist", power),
mental = self:addTemporaryValue("combat_mentalresist", power),
spell = self:addTemporaryValue("combat_spellresist", power),
dreamer = self:addTemporaryValue("lucid_dreamer", power),
sleep = self:addTemporaryValue("sleep", 1),
}
return ret
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("combat_physresist", p.phys)
self:removeTemporaryValue("combat_mentalresist", p.mental)
self:removeTemporaryValue("combat_spellresist", p.spell)
self:removeTemporaryValue("lucid_dreamer", p.dreamer)
self:removeTemporaryValue("sleep", p.sleep)
return true
end,
info = function(self, t)
local power = t.getPower(self, t)
return ([[Slip into a lucid dream. While in this state you are considered sleeping but can still act, are immune to insomnia, inflict %d%% more damage to targets under the effects of Insomnia, and your physical, mental, and spell saves are increased by %d.
Note that being asleep may make you more vulnerable to certain effects (such as Inner Demons, Night Terror, and Waking Nightmare).
The saving throw bonuses scale with your mindpower.]]):format(power, power)
end,
}
newTalent{
name = "Dream Walk",
type = {"psionic/dreaming", 3},
points = 5,
require = psi_wil_req3,
psi= 10,
cooldown = 10,
tactical = { CLOSEIN = 2, ESCAPE = 2 },
range = function(self, t) return 5 + math.min(5, self:getTalentLevelRaw(t)) end,
requires_target = true,
target = function(self, t)
return {type="hit", range=self:getTalentRange(t)}
end,
direct_hit = true,
is_teleport = true,
action = function(self, t)
local tg = self:getTalentTarget(t)
local x, y, target = self:getTarget(tg)
if not x or not y then return nil end
if not self:hasLOS(x, y) then
game.logPlayer(self, "You do not have line of sight to this location.")
return nil
end
local __, x, y = self:canProject(tg, x, y)
if not (self:getTalentLevel(t) >= 5 and self:attr("lucid_dreamer") or game.zone.is_dream_scape) then
target = game.level.map(x, y, Map.ACTOR)
if not (target and target:attr("sleep")) then
game.logPlayer(self, "Your target must be sleeping in order to dream walk.")
return nil
end
end
game.level.map:particleEmitter(self.x, self.y, 1, "teleport")
-- since we're using a precise teleport we'll look for a free grid first
local tx, ty = util.findFreeGrid(x, y, 5, true, {[Map.ACTOR]=true})
if tx and ty then
if not self:teleportRandom(tx, ty, 0) then
game.logSeen(self, "The dream walk fizzles!")
end
end
game.level.map:particleEmitter(self.x, self.y, 1, "teleport")
game:playSoundNear(self, "talents/teleport")
return true
end,
info = function(self, t)
local range = self:getTalentRange(t)
return ([[You move through the dream world, reappearing next to a sleeping target within range (%d). At talent level 5 you may teleport anywhere within range as long as you have Lucid Dreamer active.]]):format(range)
end,
}
newTalent{
name = "Dream Prison",
type = {"psionic/dreaming", 4},
points = 5,
require = psi_wil_req4,
mode = "sustained",
sustain_psi = 40,
cooldown = 50,
tactical = { DISABLE=2 },
range = function(self, t) return 5 + math.min(5, self:getTalentLevelRaw(t)) end,
requires_target = true,
target = function(self, t)
return {type="ball", radius=self:getTalentRange(t), range=0}
end,
direct_hit = true,
getDrain = function(self, t) return 10 - math.min(8, math.ceil(self:getTalentLevel(t))) end,
remove_on_zero = true,
activate = function(self, t)
game:playSoundNear(self, "talents/heal")
local ret = {
drain = self:addTemporaryValue("psi_regen", -t.getDrain(self, t)),
}
return ret
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("psi_regen", p.drain)
return true
end,
info = function(self, t)
local drain = t.getDrain(self, t)
return ([[Imprisons all sleeping targets within range in their dream state, effectively extending sleeping effects for as long as Dream Prison is maintainted.
This powerful effect constantly drains %d Psi per turn and is considered a psionic channel as such it will break if you move, use a talent, or activate an item.
(Note that sleeping effects that happen each turn, such as Nightmare's damage and Slumber's contagion, will cease to function for the duration of the effect.)]]):format(drain)
end,
}
\ No newline at end of file
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 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
load("/data/general/grids/basic.lua")
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 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
load("/data/general/npcs/all.lua")
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 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
load("/data/general/objects/objects.lua")
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 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
load("/data/general/traps/natural_forest.lua")
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 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
return {
name = "Dreamscape",
level_range = {1, 100},
level_scheme = "player",
max_level = 1,
actor_adjust_level = function(zone, level, e) return level.source_zone.base_level + e:getRankLevelAdjust() + level.source_level.level-1 + rng.range(-1,2) end,
width = 20, height = 20,
all_remembered = true,
all_lited = true,
no_worldport = true,
is_dream_scape = true,
no_planechange = true,
ambient_music = "Straight Into Ambush.ogg",
color_shown = {0.5, 1, 0.7, 1},
color_obscure = {0.5*0.6, 1*0.6, 0.7*0.6, 0.6},
generator = {
map = {
class = "engine.generator.map.Forest",
zoom = 3,
sqrt_percent = 45,
noise = "fbm_perlin",
floor = "FLOOR",
wall = "WALL",
up = "FLOOR",
down = "FLOOR",
door = "FLOOR",
},
},
post_process = function(level)
game.state:makeWeather(level, 6, {max_nb=7, chance=1, dir=120, speed={0.1, 0.9}, alpha={0.2, 0.4}, particle_name="weather/grey_cloud_%02d"})
end,
foreground = function(level, dx, dx, nb_keyframes)
local tick = core.game.getTime()
local sr, sg, sb
sr = 4 + math.sin(tick / 2000) / 2
sg = 3 + math.sin(tick / 2700)
sb = 3 + math.sin(tick / 3200)
local max = math.max(sr, sg, sb)
sr = sr / max
sg = sg / max
sb = sb / max
level.map:setShown(sr, sg, sb, 1)
level.map:setObscure(sr * 0.6, sg * 0.6, sb * 0.6, 1)
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