diff --git a/game/modules/tome/data/gfx/particle_cloud.png b/game/engines/default/data/gfx/particle_cloud.png similarity index 100% rename from game/modules/tome/data/gfx/particle_cloud.png rename to game/engines/default/data/gfx/particle_cloud.png diff --git a/game/modules/tome/data/gfx/particle_drop.png b/game/engines/default/data/gfx/particle_drop.png similarity index 100% rename from game/modules/tome/data/gfx/particle_drop.png rename to game/engines/default/data/gfx/particle_drop.png diff --git a/game/engines/default/modules/boot/data/gfx/particles/flame.lua b/game/engines/default/modules/boot/data/gfx/particles/flame.lua index 4fb697c6deb42f13ab1ce68751d5e0d9ccd2e73e..e0991f6323b6347749d6e95d971a6a8668343454 100644 --- a/game/engines/default/modules/boot/data/gfx/particles/flame.lua +++ b/game/engines/default/modules/boot/data/gfx/particles/flame.lua @@ -1,4 +1,4 @@ --- ToME - Tales of Middle-Earth +-- ToME - Tales of Maj'Eyal -- Copyright (C) 2009, 2010 Nicolas Casalini -- -- This program is free software: you can redistribute it and/or modify @@ -17,22 +17,44 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org -return { - base = 1000, +-- Make the ray +local ray = {} +local tiles = math.ceil(math.sqrt(tx*tx+ty*ty)) +local tx = tx * engine.Map.tile_w +local ty = ty * engine.Map.tile_h +ray.dir = math.atan2(ty, tx) +ray.size = math.sqrt(tx*tx+ty*ty) - angle = { 0, 360 }, anglev = { 2000, 4000 }, anglea = { 200, 600 }, +-- Populate the beam based on the forks +return { generator = function() + local a = ray.dir + local r = rng.range(1, ray.size - 32) - life = { 5, 10 }, - size = { 3, 6 }, sizev = {0, 0}, sizea = {0, 0}, + local ra = a + (rng.chance(2) and math.rad(-90) or math.rad(90)) + local rr = rng.float(2, engine.Map.tile_w * 0.60) - r = {200, 255}, rv = {0, 0}, ra = {0, 0}, - g = {120, 170}, gv = {0, 0}, ga = {0, 0}, - b = {0, 0}, bv = {0, 0}, ba = {0, 0}, - a = {255, 255}, av = {0, 0}, aa = {0, 0}, + local vel = rng.float(1.2, 6) -}, function(self) + return { + life = 32 / vel, + size = rng.float(4, 10), sizev = -0.1, sizea = 0, + + x = r * math.cos(a) + rr * math.cos(ra), xv = 0, xa = 0, + y = r * math.sin(a) + rr * math.sin(ra), yv = 0, ya = 0, + dir = ray.dir, dirv = 0, dira = 0, + vel = vel, velv = -0.1, vela = 0.01, + + r = rng.range(200, 255)/255, rv = 0, ra = 0, + g = rng.range(120, 170)/255, gv = 0.005, ga = 0.0005, + b = rng.range(0, 10)/255, bv = 0, ba = 0, + a = rng.range(25, 220)/255, av = static and -0.034 or 0, aa = 0.005, + } +end, }, +function(self) self.nb = (self.nb or 0) + 1 - if self.nb < 4 then - self.ps:emit(100) + if self.nb < 6 then + self.ps:emit(9*tiles) end -end +end, +32*9*tiles, +"particle_cloud" diff --git a/game/engines/default/modules/boot/data/talents.lua b/game/engines/default/modules/boot/data/talents.lua index 5d22407f2e292f7636323afc6e744fa6665f3fef..5c3c464adeab2d6f085272ff9d72141e63e370bc 100644 --- a/game/engines/default/modules/boot/data/talents.lua +++ b/game/engines/default/modules/boot/data/talents.lua @@ -95,7 +95,8 @@ newTalent{ local tg = {type="bolt", range=self:getTalentRange(t), talent=t, display={particle="bolt_fire", trail="firetrail"}} local x, y = self:getTarget(tg) if not x or not y then return nil end - self:projectile(tg, x, y, DamageType.FIRE,rng.range(10, 20) * self:getTalentLevel(t), {type="flame"}) + self:project(tg, x, y, DamageType.FIRE,rng.range(10, 20) * self:getTalentLevel(t), {type="flame"}) + game.level.map:particleEmitter(self.x, self.y, tg.range, "flame", {tx=x-self.x, ty=y-self.y}) return true end, info = function(self, t)