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

plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@1858 51575b47-30f0-44d4-a5cc-537603b46e54
parent fbe647d5
No related branches found
No related tags found
No related merge requests found
-- 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"
......@@ -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)
......
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