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

When finding lore items they register in the combat log

Added trails based on damage type to the Channel Staff spell, made it intoa real projectile and uses spell crit instead of physical crit


git-svn-id: http://svn.net-core.org/repos/t-engine4@1158 51575b47-30f0-44d4-a5cc-537603b46e54
parent 32b07f30
No related branches found
No related tags found
No related merge requests found
Showing
with 515 additions and 12 deletions
...@@ -378,6 +378,7 @@ function _M:restCheck() ...@@ -378,6 +378,7 @@ function _M:restCheck()
if self:getMana() < self:getMaxMana() and self.mana_regen > 0 then return true end if self:getMana() < self:getMaxMana() and self.mana_regen > 0 then return true end
if self:getStamina() < self:getMaxStamina() and self.stamina_regen > 0 then return true end if self:getStamina() < self:getMaxStamina() and self.stamina_regen > 0 then return true end
if self.life < self.max_life and self.life_regen> 0 then return true end if self.life < self.max_life and self.life_regen> 0 then return true end
if self.alchemy_golem and game.level:hasEntity(self.alchemy_golem) and self.alchemy_golem.life_regen > 0 and not self.alchemy_golem.dead and self.alchemy_golem.life < self.alchemy_golem.max_life then return true end
else else
return true return true
end end
......
...@@ -61,6 +61,9 @@ function _M:learnLore(lore) ...@@ -61,6 +61,9 @@ function _M:learnLore(lore)
if not self.lore_known[lore] then if not self.lore_known[lore] then
local l = self:getLore(lore) local l = self:getLore(lore)
Dialog:simpleLongPopup("Lore found: #0080FF#"..l.name, "#ANTIQUE_WHITE#"..l.lore, 400) Dialog:simpleLongPopup("Lore found: #0080FF#"..l.name, "#ANTIQUE_WHITE#"..l.lore, 400)
game.logPlayer(self, "Lore found: #0080FF#%s", l.name)
game.logPlayer(self, "#ANTIQUE_WHITE#%s", l.lore)
game.logPlayer(self, "You can read all your collected lore in tha game menu, by pressing Escape.")
end end
self.lore_known[lore] = true self.lore_known[lore] = true
......
-- 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
local nb = 0
return { generator = function()
local radius = 0
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0.1, sradius / 2)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 3 + 9 * (sradius - r) / sradius,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = 0, dirv = 0, dira = 0,
vel = 0, velv = 0, vela = 0,
r = rng.range(0, 0)/255, rv = 0, ra = 0,
g = rng.range(80, 200)/255, gv = 0.005, ga = 0.0005,
b = rng.range(0, 0)/255, bv = 0, ba = 0,
a = rng.range(255, 255)/255, av = static and -0.034 or 0, aa = 0.005,
}
end, },
function(self)
if nb < 1 then
self.ps:emit(40)
end
nb = nb + 1
end,
40
-- 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
return { generator = function()
local radius = 0
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0, sradius / 4)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 6,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = a, dirv = 0, dira = 0,
vel = sradius / 2 / 6, velv = 0, vela = 0,
r = rng.range(0, 0)/255, rv = 0, ra = 0,
g = rng.range(80, 200)/255, gv = 0.005, ga = 0.0005,
b = rng.range(0, 0)/255, bv = 0, ba = 0,
a = rng.range(255, 255)/255, av = static and -0.034 or 0, aa = 0.005,
}
end, },
function(self)
self.ps:emit(30)
end,
30*6
-- 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
return { generator = function()
local radius = 0
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0, sradius / 4)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 6,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = a, dirv = 0, dira = 0,
vel = sradius / 2 / 6, velv = 0, vela = 0,
r = rng.range(0, 40)/255, rv = 0, ra = 0,
g = rng.range(0, 40)/255, gv = 0.005, ga = 0.0005,
b = rng.range(0, 40)/255, bv = 0, ba = 0,
a = rng.range(255, 255)/255, av = static and -0.034 or 0, aa = 0.005,
}
end, },
function(self)
self.ps:emit(30)
end,
30*6
-- 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
return { generator = function()
local radius = 0
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0, sradius / 4)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 6,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = a, dirv = 0, dira = 0,
vel = sradius / 2 / 6, velv = 0, vela = 0,
r = rng.range(220, 255)/255, rv = 0, ra = 0,
g = rng.range(200, 230)/255, gv = 0, ga = 0,
b = 0, bv = 0, ba = 0,
a = rng.range(25, 220)/255, av = 0, aa = 0,
}
end, },
function(self)
self.ps:emit(30)
end,
30*6
-- 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
return { generator = function()
local radius = 0
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0, sradius / 4)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 6,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = a, dirv = 0, dira = 0,
vel = sradius / 2 / 6, velv = 0, vela = 0,
r = rng.range(180, 220)/255, rv = 0, ra = 0,
g = rng.range(240, 255)/255, gv = 0, ga = 0,
b = rng.range(220, 240)/255, bv = 0, ba = 0,
a = rng.range(255, 255)/255, av = 0, aa = 0,
}
end, },
function(self)
self.ps:emit(30)
end,
30*6
-- 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
local nb = 0
return { generator = function()
local radius = 0
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0.1, sradius / 2)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 3 + 9 * (sradius - r) / sradius,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = 0, dirv = 0, dira = 0,
vel = 0, velv = 0, vela = 0,
r = rng.range(0, 40)/255, rv = 0, ra = 0,
g = rng.range(0, 40)/255, gv = 0.005, ga = 0.0005,
b = rng.range(0, 40)/255, bv = 0, ba = 0,
a = rng.range(255, 255)/255, av = static and -0.034 or 0, aa = 0.005,
}
end, },
function(self)
if nb < 1 then
self.ps:emit(40)
end
nb = nb + 1
end,
40
-- 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
local nb = 0
return { generator = function()
local radius = 0
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0.1, sradius / 2)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 3 + 9 * (sradius - r) / sradius,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = 0, dirv = 0, dira = 0,
vel = 0, velv = 0, vela = 0,
r = 0, rv = 0, ra = 0,
g = rng.range(170, 210)/255, gv = 0, ga = 0,
b = rng.range(200, 255)/255, gv = 0, ga = 0,
a = rng.range(230, 225)/255, av = 0, aa = 0,
}
end, },
function(self)
if nb < 1 then
self.ps:emit(40)
end
nb = nb + 1
end,
40
-- 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
local nb = 0
return { generator = function()
local radius = 0
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0.1, sradius / 2)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 3 + 9 * (sradius - r) / sradius,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = 0, dirv = 0, dira = 0,
vel = 0, velv = 0, vela = 0,
r = rng.range(180, 220)/255, rv = 0, ra = 0,
g = rng.range(240, 255)/255, gv = 0, ga = 0,
b = rng.range(220, 240)/255, bv = 0, ba = 0,
a = rng.range(255, 255)/255, av = 0, aa = 0,
}
end, },
function(self)
if nb < 1 then
self.ps:emit(40)
end
nb = nb + 1
end,
40
-- 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
local nb = 0
return { generator = function()
local radius = 0
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0.1, sradius / 2)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 3 + 9 * (sradius - r) / sradius,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = 0, dirv = 0, dira = 0,
vel = 0, velv = 0, vela = 0,
r = rng.range(220, 255)/255, rv = 0, ra = 0,
g = rng.range(200, 230)/255, gv = 0, ga = 0,
b = 0, bv = 0, ba = 0,
a = rng.range(25, 220)/255, av = 0, aa = 0,
}
end, },
function(self)
if nb < 1 then
self.ps:emit(40)
end
nb = nb + 1
end,
40
...@@ -28,31 +28,46 @@ newTalent{ ...@@ -28,31 +28,46 @@ newTalent{
}, },
range = 10, range = 10,
reflectable = true, reflectable = true,
proj_speed = 20,
action = function(self, t) action = function(self, t)
local weapon = self:hasStaffWeapon() local weapon = self:hasStaffWeapon()
if not weapon then if not weapon then
game.logPlayer(self, "You need a staff to use this spell.") game.logPlayer(self, "You need a staff to use this spell.")
return return
end end
local combat = weapon.combat
local tg = {type="bolt", range=self:getTalentRange(t), talent=t} local trail = "firetrail"
local x, y, target = self:getTarget(tg) local particle = "bolt_fire"
if not x or not y or not target then return nil end local explosion = "flame"
local _ _, x, y = self:canProject(tg, x, y)
target = game.level.map(x, y, Map.ACTOR) if combat.damtype == DamageType.COLD then explosion = "freeze" particle = "ice_shards" trail = "icetrail"
if not x or not y or not target then return nil end elseif combat.damtype == DamageType.ACID then explosion = "acid" particle = "bolt_acid" trail = "acidtrail"
elseif combat.damtype == DamageType.LIGHTNING then explosion = "lightning_explosion" particle = "bolt_lightning" trail = "lightningtrail"
elseif combat.damtype == DamageType.LIGHT then explosion = "light" particle = "bolt_light" trail = "lighttrail"
elseif combat.damtype == DamageType.DARKNESS then explosion = "dark" particle = "bolt_dark" trail = "darktrail"
elseif combat.damtype == DamageType.NATURE then explosion = "slime" particle = "bolt_slime" trail = "slimetrail"
elseif combat.damtype == DamageType.BLIGHT then explosion = "slime" particle = "bolt_slime" trail = "slimetrail"
end
-- Compute damage
local dam = self:combatDamage(combat)
local damrange = self:combatDamageRange(combat)
dam = rng.range(dam, dam * damrange)
dam = self:spellCrit(dam)
dam = dam * self:combatTalentWeaponDamage(t, 0.4, 1.1)
local tg = {type="bolt", range=self:getTalentRange(t), talent=t, display = {particle=particle, trail=trail}}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:projectile(tg, x, y, combat.damtype, dam, {type=explosion})
self.combat_apr = self.combat_apr + 10000
self.combat_atk = self.combat_atk + 10000
local speed, hit = self:attackTargetWith(target, weapon.combat, nil, self:combatTalentWeaponDamage(t, 0.4, 1.1))
self.combat_atk = self.combat_atk - 10000
self.combat_apr = self.combat_apr - 10000
game:playSoundNear(self, "talents/arcane") game:playSoundNear(self, "talents/arcane")
return true return true
end, end,
info = function(self, t) info = function(self, t)
return ([[Channel raw mana through your staff, projecting a bolt of your staff damage type doing %d%% staff damage. return ([[Channel raw mana through your staff, projecting a bolt of your staff damage type doing %d%% staff damage.
This attack always has a 95%% chance to hit and ignores target armour.]]): This attack always has a 100%% chance to hit and ignores target armour.]]):
format(self:combatTalentWeaponDamage(t, 0.4, 1.1) * 100) format(self:combatTalentWeaponDamage(t, 0.4, 1.1) * 100)
end, 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