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

test

git-svn-id: http://svn.net-core.org/repos/t-engine4@5034 51575b47-30f0-44d4-a5cc-537603b46e54
parent 880dac78
No related branches found
No related tags found
No related merge requests found
......@@ -2195,6 +2195,8 @@ function _M:onWear(o, bypass_set)
self:breakReloading()
self:checkMindstar(o)
self:updateModdableTile()
if self == game.player then game:playSound("actions/wear") end
end
......@@ -2259,12 +2261,38 @@ function _M:onTakeoff(o, bypass_set)
end
end
self:checkMindstar(o)
self:breakReloading()
self:updateModdableTile()
if self == game.player then game:playSound("actions/takeoff") end
end
function _M:checkMindstar(o)
local new
local old
if o.wielded then
new = self:attr("psiblades_active")
old = o.psiblade_active
else
new = false
old = o.psiblade_active
end
if new and not old then
o.moddable_tile_ornament = o.psiblade_tile
o.psiblade_active = true
-- o.combat.dammod.wil
print("Activating psiblade", o.name)
elseif not new and old then
o.moddable_tile_ornament = nil
o.psiblade_active = false
print("Disabling psiblade", o.name)
end
end
--- Call when an object is added
function _M:onAddObject(o)
-- curse the item
......
......@@ -67,6 +67,7 @@ newBirthDescriptor{
["wild-gift/summon-utility"]={true, 0.3},
["wild-gift/summon-augmentation"]={false, 0.3},
["wild-gift/summon-advanced"]={false, 0.3},
["wild-gift/mindstar-mastery"]={false, 0.1},
["cunning/survival"]={true, 0},
["technique/combat-techniques-active"]={false, 0},
["technique/combat-techniques-passive"]={false, 0},
......
......@@ -24,6 +24,7 @@ newEntity{
add_name = " (#COMBAT_DAMTYPE#)",
display = "!", color=colors.LIGHT_RED, image = resolvers.image_material("mindstar", "nature"),
moddable_tile = resolvers.moddable_tile("mindstar"),
psiblade_tile = "mindstar_psiblade_%s_01",
randart_able = { attack=10, physical=40, spell=1, def=10, misc=10 },
encumber = 3,
rarity = 4,
......@@ -49,7 +50,7 @@ newEntity{ base = "BASE_MINDSTAR",
dam = resolvers.rngavg(2,3),
apr = 2,
physcrit = 2.5,
dammod = {wil=1},
dammod = {wil=0.4},
},
wielder = {
combat_mindpower = 1,
......@@ -67,7 +68,7 @@ newEntity{ base = "BASE_MINDSTAR",
dam = resolvers.rngavg(4,6),
apr = 3,
physcrit = 3,
dammod = {wil=1},
dammod = {wil=0.4},
},
wielder = {
combat_mindpower = 2,
......@@ -85,7 +86,7 @@ newEntity{ base = "BASE_MINDSTAR",
dam = resolvers.rngavg(7,10),
apr = 4,
physcrit = 3.5,
dammod = {wil=1},
dammod = {wil=0.4},
},
wielder = {
combat_mindpower = 3,
......@@ -103,7 +104,7 @@ newEntity{ base = "BASE_MINDSTAR",
dam = resolvers.rngavg(12,14),
apr = 5,
physcrit = 4.5,
dammod = {wil=1},
dammod = {wil=0.4},
},
wielder = {
combat_mindpower = 4,
......@@ -121,7 +122,7 @@ newEntity{ base = "BASE_MINDSTAR",
dam = resolvers.rngavg(15,18),
apr = 6,
physcrit = 5,
dammod = {wil=1},
dammod = {wil=0.4},
},
wielder = {
combat_mindpower = 5,
......
......@@ -32,6 +32,7 @@ newTalentType{ allow_random=true, is_nature=true, type="wild-gift/sand-drake", n
newTalentType{ allow_random=true, is_nature=true, type="wild-gift/fire-drake", name = "fire drake aspect", description = "Take on the defining aspects of a Fire Drake." }
newTalentType{ allow_random=true, is_nature=true, type="wild-gift/cold-drake", name = "cold drake aspect", description = "Take on the defining aspects of a Cold Drake." }
newTalentType{ allow_random=true, is_nature=true, type="wild-gift/storm-drake", name = "storm drake aspect", description = "Take on the defining aspects of a Storm Drake." }
newTalentType{ allow_random=true, is_nature=true, type="wild-gift/mindstar-mastery", name = "mindstar mastery", generic = true, description = "Learn to channel your mental power throught mindstars, forming powerful psionic blades." }
newTalentType{ allow_random=true, is_nature=true, type="wild-gift/earthen-power", name = "earthen power", description = "Dwarves have learned to imbue their shields with the power of stone itself." }
newTalentType{ allow_random=true, is_nature=true, type="wild-gift/earthen-vines", name = "earthen vines", description = "Control the stone itself and bring it alive in the form of dreadful vines." }
......@@ -193,5 +194,7 @@ load("/data/talents/gifts/summon-utility.lua")
load("/data/talents/gifts/summon-augmentation.lua")
load("/data/talents/gifts/summon-advanced.lua")
load("/data/talents/gifts/mindstar-mastery.lua")
load("/data/talents/gifts/earthen-power.lua")
load("/data/talents/gifts/earthen-vines.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
newTalent{
name = "Psiblades",
type = {"wild-gift/mindstar-mastery", 1},
require = gifts_req1,
points = 5,
mode = "sustained",
sustain_equilibrium = 10,
cooldown = 15,
tactical = { BUFF = 4 },
activate = function(self, t)
local r = {
tmpid = self:addTemporaryValue("psiblades_active", self:getTalentLevel(t)),
}
for i, o in ipairs(self:getInven("MAINHAND")) do self:checkMindstar(o) end
for i, o in ipairs(self:getInven("OFFHAND")) do self:checkMindstar(o) end
self:updateModdableTile()
return r
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("psiblades_active", p.tmpid)
for i, o in ipairs(self:getInven("MAINHAND")) do self:checkMindstar(o) end
for i, o in ipairs(self:getInven("OFFHAND")) do self:checkMindstar(o) end
self:updateModdableTile()
return true
end,
info = function(self, t)
return ([[Channel your mental power through your wielded mindstars.]]):
format()
end,
}
newTalent{
name = "Thorn Grab",
type = {"wild-gift/mindstar-mastery", 2},
require = gifts_req2,
points = 5,
mode = "sustained",
sustain_equilibrium = 20,
cooldown = 30,
tactical = { BUFF = 3 },
activate = function(self, t)
return {
tmpid = self:addTemporaryValue("elemental_harmony", self:getTalentLevel(t)),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("elemental_harmony", p.tmpid)
return true
end,
info = function(self, t)
local power = self:getTalentLevel(t)
local turns = 5 + math.ceil(power)
local fire = 100 * (0.1 + power / 16)
local cold = 3 + power * 2
local lightning = math.floor(power)
local acid = 5 + power * 2
local nature = 5 + power * 1.4
return ([[Befriend the natural elements that constitute nature. Each time you are hit by one of the elements you gain a special effect for %d turns. This can only happen every %d turns.
Fire: +%d%% global speed
Cold: +%d armour
Lightning: +%d to all stats
Acid: +%0.2f life regen
Nature: +%d%% to all resists]]):
format(turns, turns, fire, cold, lightning, acid, nature)
end,
}
newTalent{
name = "Leaves Tide",
type = {"wild-gift/mindstar-mastery", 3},
require = gifts_req3,
points = 5,
equilibrium = 15,
cooldown = 30,
tactical = { BUFF = 2 },
on_pre_use = function(self, t) return self:hasEffect(self.EFF_INFUSION_COOLDOWN) end,
action = function(self, t)
self:removeEffect(self.EFF_INFUSION_COOLDOWN)
local tids = {}
local nb = self:getTalentLevelRaw(t)
for tid, _ in pairs(self.talents_cd) do
local tt = self:getTalentFromId(tid)
if tt.type[1] == "inscriptions/infusions" and self:isTalentCoolingDown(tt) then tids[#tids+1] = tid end
end
for i = 1, nb do
if #tids == 0 then break end
local tid = rng.tableRemove(tids)
self.talents_cd[tid] = self.talents_cd[tid] - (1 + math.floor(self:getTalentLevel(t) / 2))
if self.talents_cd[tid] <= 0 then self.talents_cd[tid] = nil end
end
game:playSoundNear(self, "talents/spell_generic2")
return true
end,
info = function(self, t)
local turns = 1 + math.floor(self:getTalentLevel(t) / 2)
local nb = self:getTalentLevelRaw(t)
return ([[Commune with nature, removing the infusion saturation effect and reducing the cooldown of %d infusions by %d turns.]]):
format(nb, turns)
end,
}
newTalent{
name = "Nature's Equilibrium",
type = {"wild-gift/mindstar-mastery", 4},
require = gifts_req4,
points = 5,
equilibrium = 24,
cooldown = 20,
range = 10,
tactical = { DISABLE = 3, HEAL = 0.5 },
direct_hit = true,
requires_target = true,
range = 0,
radius = function(self, t) return 1 + self:getTalentLevelRaw(t) end,
target = function(self, t) return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=true, talent=t} end,
action = function(self, t)
local tg = self:getTalentTarget(t)
local grids = self:project(tg, self.x, self.y, function(px, py)
local target = game.level.map(px, py, Map.ACTOR)
if not target then return end
target:setEffect(target.EFF_HEALING_NEXUS, 3 + self:getTalentLevelRaw(t), {src=self, pct=0.4 + self:getTalentLevel(t) / 10, eq=5 + self:getTalentLevel(t)})
end)
game.level.map:particleEmitter(self.x, self.y, tg.radius, "ball_acid", {radius=tg.radius})
game:playSoundNear(self, "talents/spell_generic2")
return true
end,
info = function(self, t)
return ([[A wave a natural energies flow around you in a radius of %d, all creatures hit will suffer healing nexus for %d turns.
While under the effect all healing done to the creature will instead heal you for %d%% of the heal value (and no healing at all goes to the target).
Each heal leeched will also restore %d equilibrium]]):
format(self:getTalentRadius(t), 3 + self:getTalentLevelRaw(t), (0.4 + self:getTalentLevel(t) / 10) * 100, 5 + self:getTalentLevel(t))
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