Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • amagad/t-engine4
  • HirumaKai/t-engine4
  • Hogulus/t-engine4
  • Inkie/t-engine4
  • Liberty/t-engine4
  • Lokean/t-engine4
  • Mawootad/t-engine4
  • Michelle/t-engine4
  • MrFrog/t-engine4
  • Nagyhal/t-engine4
  • Recaiden/t-engine4
  • RootOfAllThings/t-engine4
  • Sebsebeleb/t-engine4
  • Sheila/t-engine4
  • Shibari/t-engine4
  • Stof/t-engine4
  • Umbral/t-engine4
  • tome/t-engine4
  • 0player/t-engine4
  • BreezyIdiot/t-engine4
  • Bunny/t-engine4
  • Effigy/t-engine4
  • Hachem_Muche/t-engine4
  • razakai/t-engine4
  • Zireael/t-engine4
  • cinornu/t-engine4
  • edge2054/t-engine4
  • gordaxx727/t-engine4
  • grayswandir/t-engine4
  • helminthauge/t-engine4
  • housepet/t-engine4
  • minqmay/t-engine4
  • nsrr/t-engine4
  • orange/t-engine4
  • otowakotori/t-engine4
  • purequestion/t-engine4
  • rexorcorum/t-engine4
  • rgeens/t-engine4
  • sageacrin/t-engine4
  • stuntofthelitter/t-engine4
  • tiger_eye/t-engine4
  • xelivous/t-engine4
  • yutio888/t-engine4
43 results
Show changes
Commits on Source (26)
Showing
with 160 additions and 21 deletions
...@@ -149,6 +149,22 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_ ...@@ -149,6 +149,22 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_
local msg, line local msg, line
local old_level, old_target, new_target = nil, nil, nil
local function prepareUse()
-- Stub some stuff
if force_level then old_level = who.talents[id] end
if ab.mode == "activated" then
if ab.onAIGetTarget and not who.player then old_target = rawget(who, "getTarget"); new_target = function() return ab.onAIGetTarget(self, ab) end end
if force_target and not old_target then old_target = rawget(who, "getTarget"); new_target = function(a) return force_target.x, force_target.y, not force_target.__no_self and force_target end end
end
if new_target then who.getTarget = new_target end
if force_level then who.talents[id] = force_level end
end
local function finishUse()
if new_target then who.getTarget = old_target end
if force_level then who.talents[id] = old_level end
end
if ab.mode == "activated" and ab.action then if ab.mode == "activated" and ab.action then
if self:isTalentCoolingDown(ab) and not ignore_cd then if self:isTalentCoolingDown(ab) and not ignore_cd then
game.logPlayer(who, "%s is still on cooldown for %d turns.", ab.name:capitalize(), self.talents_cd[ab.id]) game.logPlayer(who, "%s is still on cooldown for %d turns.", ab.name:capitalize(), self.talents_cd[ab.id])
...@@ -166,7 +182,9 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_ ...@@ -166,7 +182,9 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_
if not silent then self:logTalentMessage(ab) end if not silent then self:logTalentMessage(ab) end
self:setCurrentTalentMode("active", ab.id) self:setCurrentTalentMode("active", ab.id)
prepareUse()
local ok, ret, special = xpcall(function() return ab.action(who, ab) end, debug.traceback) local ok, ret, special = xpcall(function() return ab.action(who, ab) end, debug.traceback)
finishUse()
self:setCurrentTalentMode(nil) self:setCurrentTalentMode(nil)
self.__talent_running = nil self.__talent_running = nil
if not ok then self:onTalentLuaError(ab, ret) error(ret) end if not ok then self:onTalentLuaError(ab, ret) error(ret) end
...@@ -202,7 +220,9 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_ ...@@ -202,7 +220,9 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_
if not self.sustain_talents[id] then -- activating if not self.sustain_talents[id] then -- activating
if self.deactivating_sustain_talent == ab.id then return end if self.deactivating_sustain_talent == ab.id then return end
self:setCurrentTalentMode("active", ab.id) self:setCurrentTalentMode("active", ab.id)
prepareUse()
ok, ret, special = xpcall(function() return ab.activate(who, ab) end, debug.traceback) ok, ret, special = xpcall(function() return ab.activate(who, ab) end, debug.traceback)
finishUse()
self:setCurrentTalentMode(nil) self:setCurrentTalentMode(nil)
if not ok then self:onTalentLuaError(ab, ret) error(ret) end if not ok then self:onTalentLuaError(ab, ret) error(ret) end
if ret == true then ret = {} end -- fix for badly coded talents if ret == true then ret = {} end -- fix for badly coded talents
...@@ -247,7 +267,9 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_ ...@@ -247,7 +267,9 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_
end end
p.__tmpparticles = nil p.__tmpparticles = nil
self:setCurrentTalentMode("active", ab.id) self:setCurrentTalentMode("active", ab.id)
prepareUse()
ok, ret, special = xpcall(function() return ab.deactivate(who, ab, p) end, debug.traceback) ok, ret, special = xpcall(function() return ab.deactivate(who, ab, p) end, debug.traceback)
finishUse()
self:setCurrentTalentMode(nil) self:setCurrentTalentMode(nil)
if not ok then self:onTalentLuaError(ab, ret) error(ret) end if not ok then self:onTalentLuaError(ab, ret) error(ret) end
...@@ -284,25 +306,13 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_ ...@@ -284,25 +306,13 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_
print("[useTalent] Attempt to use non activated or sustainable talent: "..id.." :: "..ab.name.." :: "..ab.mode) print("[useTalent] Attempt to use non activated or sustainable talent: "..id.." :: "..ab.name.." :: "..ab.mode)
end end
if co then -- talent is usable and has passed checks if co then -- talent is usable and has passed checks
-- Stub some stuff
local old_level, old_target, new_target = nil, nil, nil
if force_level then old_level = who.talents[id] end
if ab.mode == "activated" then
if ab.onAIGetTarget and not who.player then old_target = rawget(who, "getTarget"); new_target = function() return ab.onAIGetTarget(self, ab) end end
if force_target and not old_target then old_target = rawget(who, "getTarget"); new_target = function(a) return force_target.x, force_target.y, not force_target.__no_self and force_target end end
end
local co_wrapper = coroutine.create(function() -- coroutine for talent interface local co_wrapper = coroutine.create(function() -- coroutine for talent interface
success = true success = true
local ok local ok
while success do while success do
if new_target then who.getTarget = new_target end
if force_level then who.talents[id] = force_level end
self.__talent_running = ab self.__talent_running = ab
ok, ret = coroutine.resume(co) -- ret == error or return value from co ok, ret = coroutine.resume(co) -- ret == error or return value from co
success = success and ok success = success and ok
if new_target then who.getTarget = old_target end
if force_level then who.talents[id] = old_level end
self.__talent_running = nil self.__talent_running = nil
if ok and coroutine.status(co) == "dead" then -- coroutine terminated normally if ok and coroutine.status(co) == "dead" then -- coroutine terminated normally
if success and not ret then -- talent failed if success and not ret then -- talent failed
......
...@@ -2789,7 +2789,7 @@ function _M:onTakeHit(value, src, death_note) ...@@ -2789,7 +2789,7 @@ function _M:onTakeHit(value, src, death_note)
a.life = math.max(1, self.life - value / 2) a.life = math.max(1, self.life - value / 2)
a.clone_on_hit.chance = math.ceil(self.clone_on_hit.chance / 2) a.clone_on_hit.chance = math.ceil(self.clone_on_hit.chance / 2)
a.energy.value = 0 a.energy.value = 0
a.exp_worth = 0.1 a.exp_worth = math.min(0.1, a.exp_worth)
a.inven = {} a.inven = {}
a:removeAllMOs() a:removeAllMOs()
a.x, a.y = nil, nil a.x, a.y = nil, nil
...@@ -7009,9 +7009,12 @@ end ...@@ -7009,9 +7009,12 @@ end
-- @return the experience rewarded -- @return the experience rewarded
function _M:worthExp(target) function _M:worthExp(target)
if not target.level or self.level < target.level - 7 then return 0 end if not target.level or self.level < target.level - 7 then return 0 end
if self.summoner then return 0 end
local level_mult = game.level.data.exp_worth_mult or 1 local level_mult = game.level.data.exp_worth_mult or 1
local worth = 0
-- HHHHAACKKK ! Use a normal scheme for the game except in the infinite dungeon -- HHHHAACKKK ! Use a normal scheme for the game except in the infinite dungeon
if not game.zone.infinite_dungeon then if not game.zone.infinite_dungeon then
local mult = 0.6 local mult = 0.6
...@@ -7024,7 +7027,7 @@ function _M:worthExp(target) ...@@ -7024,7 +7027,7 @@ function _M:worthExp(target)
elseif self.rank >= 5 then mult = 60 elseif self.rank >= 5 then mult = 60
end end
return self.level * mult * self.exp_worth * (target.exp_kill_multiplier or 1) * level_mult worth = self.level * mult * self.exp_worth * (target.exp_kill_multiplier or 1) * level_mult
else else
local mult = 2 + (self.exp_kill_multiplier or 0) local mult = 2 + (self.exp_kill_multiplier or 0)
if self.rank == 1 then mult = 2 if self.rank == 1 then mult = 2
...@@ -7036,8 +7039,9 @@ function _M:worthExp(target) ...@@ -7036,8 +7039,9 @@ function _M:worthExp(target)
elseif self.rank >= 5 then mult = 6.5 elseif self.rank >= 5 then mult = 6.5
end end
return self.level * mult * self.exp_worth * (target.exp_kill_multiplier or 1) * level_mult worth = self.level * mult * self.exp_worth * (target.exp_kill_multiplier or 1) * level_mult
end end
return worth
end end
--- Burn arcane resources --- Burn arcane resources
......
...@@ -2061,14 +2061,14 @@ function _M:setupCommands() ...@@ -2061,14 +2061,14 @@ function _M:setupCommands()
print("===============") print("===============")
end end, end end,
[{"_g","ctrl"}] = function() if config.settings.cheat then [{"_g","ctrl"}] = function() if config.settings.cheat then
game.player:takeHit(100, game.player)
game.player:useEnergy()
-- DamageType:get(DamageType.ACID).projector(game.player, game.player.x, game.player.y, DamageType.ACID, 100)
do return end
local f, err = loadfile("/data/general/events/glowing-chest.lua") local f, err = loadfile("/data/general/events/glowing-chest.lua")
print(f, err) print(f, err)
setfenv(f, setmetatable({level=self.level, zone=self.zone}, {__index=_G})) setfenv(f, setmetatable({level=self.level, zone=self.zone}, {__index=_G}))
print(pcall(f)) print(pcall(f))
do return end
game.player:takeHit(100, game.player)
game.player:useEnergy()
-- DamageType:get(DamageType.ACID).projector(game.player, game.player.x, game.player.y, DamageType.ACID, 100)
do return end do return end
game.player:setEffect("EFF_STUNNED", 1, {apply_power=200}) game.player:setEffect("EFF_STUNNED", 1, {apply_power=200})
do return end do return end
......
...@@ -24,7 +24,7 @@ newEntity{ ...@@ -24,7 +24,7 @@ newEntity{
display = "=", display = "=",
encumber = 0.1, encumber = 0.1,
rarity = 6, rarity = 6,
desc = _t[[Rings can have magical properties.]], desc = _t[[Rings make your fingers look great!]],
randart_able = "/data/general/objects/random-artifacts/generic.lua", randart_able = "/data/general/objects/random-artifacts/generic.lua",
-- Most rings are ego items -- Most rings are ego items
egos = "/data/general/objects/egos/rings.lua", egos_chance = { prefix=resolvers.mbonus(50, 40), suffix=resolvers.mbonus(50, 40) }, egos_chance_decay = 0.5, egos = "/data/general/objects/egos/rings.lua", egos_chance = { prefix=resolvers.mbonus(50, 40), suffix=resolvers.mbonus(50, 40) }, egos_chance_decay = 0.5,
...@@ -36,7 +36,7 @@ newEntity{ ...@@ -36,7 +36,7 @@ newEntity{
display = '"', display = '"',
encumber = 0.1, encumber = 0.1,
rarity = 8, rarity = 8,
desc = _t[[Amulets can have magical properties.]], desc = _t[[Amulets make your neck look great!]],
randart_able = "/data/general/objects/random-artifacts/generic.lua", randart_able = "/data/general/objects/random-artifacts/generic.lua",
egos = "/data/general/objects/egos/amulets.lua", egos_chance = { prefix=resolvers.mbonus(50, 40), suffix=resolvers.mbonus(50, 40) }, egos_chance_decay = 0.5, egos = "/data/general/objects/egos/amulets.lua", egos_chance = { prefix=resolvers.mbonus(50, 40), suffix=resolvers.mbonus(50, 40) }, egos_chance_decay = 0.5,
} }
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009 - 2019 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
-- Make the 2 main forks
local sizeratio = 64 / engine.Map.tile_w
local dir = dir
local dist = (range or 1) * engine.Map.tile_w
local life = 32
local points = {}
points[#points+1] = {size=4, x=0, y=0, prev=-1, angle=0, vel=0}
for i = 1, 16 do
local x = rng.range(-2, 2) / sizeratio
local y = -dist / 16 * i
-- local si = math.sqrt(i) * 0.8
local size
if i <= 4 then size = 16 - i * 3
else size = points[#points].size * 0.92
end
points[#points+1] = {angle=-math.pi/2, vel=y/life/sizeratio * ((grab and 1) or -1), size=(i==16) and 1 or size, x=x, y=y, prev=#points-1}
end
local nbp = #points
return { engine=core.particles.ENGINE_LINES, system_rotation=dir, generator = function()
local p = table.remove(points, 1)
if not p then return nil end
return {
life = life, trail=p.prev,
size = p.size, sizev = 0, sizea = 0,
x = p.x, xv = 0, xa = 0,
y = p.y, yv = 0, ya = 0,
dir = p.angle, dirv = 0, dira = 0,
vel = p.vel, velv = 0, vela = 0,
r = 1, rv = 0, ra = 0,
g = 1, gv = 0, ga = 0,
b = 1, bv = 0, ba = 0,
a = 0.5, av = 0, aa = -1/(life^2)*2,
}
end, },
function(self)
if nbp > 0 then
nbp = nbp - self.ps:emit(nbp)
end
end,
nbp, "particles_images/"..img
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009 - 2019 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
base_size = 64
toback = false
can_shift = true
local r = r or 168
local g = g or 10
local b = b or 10
local run = true
return { generator = function()
local ad = rng.range(0, 360)
local a = math.rad(ad)
local dir = math.rad(90)
local r = rng.range(18, 22)
local dirchance = rng.chance(2)
local x = rng.range(-6, 6) + x * 64
local y = rng.range(-6, -2) + y * 64
return {
trail = 2,
life = 32,
size = rng.range(6, 12), sizev = 0, sizea = -0.016,
x = x, xv = 0, xa = 0,
y = y, yv = 0.2, ya = 0.04,
dir = 0, dirv = 0, dira = 0,
vel = 0, velv = 0, vela = 0,
r = r/255, rv = 0, ra = 0,
g = g/255, gv = 0, ga = 0,
b = b/255, bv = 0, ba = 0,
a = 1.0, av = -1.0/32, aa = 0,
}
end, },
function(self)
if run then self.ps:emit(1) end
run = not run
end,
32,
"particles_images/apply_poison"..rng.range(1, 4)
game/modules/tome/data/gfx/particles_images/blood_rush_mark.png

3.9 KiB

game/modules/tome/data/gfx/particles_images/blood_sigil_dark.png

332 KiB

game/modules/tome/data/gfx/particles_images/blood_sigil_light.png

354 KiB

game/modules/tome/data/gfx/particles_images/blood_trail_segment.png

4.1 KiB

game/modules/tome/data/gfx/particles_images/blood_trail_segment_thick.png

4.11 KiB

game/modules/tome/data/gfx/particles_images/blood_trail_segment_thin.png

3.95 KiB

game/modules/tome/data/gfx/particles_images/devourer_shield.png

68.3 KiB

game/modules/tome/data/gfx/particles_images/mark_vampire.png

8.03 KiB

game/modules/tome/data/gfx/particles_images/spiral_dark.png

105 KiB

game/modules/tome/data/gfx/particles_images/spiral_light.png

111 KiB

game/modules/tome/data/gfx/particles_images/sun_sigil_dark.png

358 KiB

game/modules/tome/data/gfx/particles_images/sun_sigil_light.png

343 KiB

game/modules/tome/data/gfx/particles_images/vampire_circle.png

192 KiB