adapted all magic particles and usages to new particle system

stable-5.4
David Dormagen 2013-10-26 16:33:05 +02:00
parent 2139e950f1
commit b101a0d756
13 changed files with 34 additions and 120 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,17 +1,3 @@
[Particle]
Name=Magic
MaxCount=1500
InitFn=StdInit
ExecFn=StdExec
CollisionFn=Die
DrawFn=Std
Face=0,0,32,32,-16,-16
Delay=0
Repeats=1
GravityAcc=0
VertexCount=1
VertexY=20
AlphaFade=8
Additive=1
RByV=3
Attach=0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -1,17 +1,3 @@
[Particle]
Name=MagicFire
MaxCount=1500
InitFn=StdInit
ExecFn=StdExec
CollisionFn=Die
DrawFn=Std
Face=0,0,128,128,-64,-64
Delay=0
Repeats=1
GravityAcc=-4
VertexCount=1
VertexY=64
AlphaFade=18
Additive=1
RByV=0
Attach=0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -1,17 +1,3 @@
[Particle]
Name=MagicRing
MaxCount=1000
InitFn=StdInit
ExecFn=StdExec
CollisionFn=Die
DrawFn=Std
Face=0,0,64,64,-32,-32
Delay=0
Repeats=1
GravityAcc=0
VertexCount=1
VertexY=20
AlphaFade=35
Additive=1
RByV=3
Attach=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,12 +0,0 @@
[Particle]
Name=FireballSmoke
MaxCount=800
InitFn=StdInit
ExecFn=StdExec
DrawFn=Std
Face=0,0,64,64,-32,-32
Delay=0
WindDrift=1
Repeats=1
AlphaFade=2
FadeDelay=2

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,17 +1,3 @@
[Particle]
Name=MagicSpark
MaxCount=1500
InitFn=StdInit
ExecFn=StdExec
CollisionFn=Die
DrawFn=Std
Face=0,0,32,32,-16,-16
Delay=0
Repeats=1
GravityAcc=-4
VertexCount=1
VertexY=16
AlphaFade=12
Additive=1
RByV=1
Attach=0

View File

@ -91,17 +91,10 @@ protected func FxIntMeteorTimer()
ydir -= size * ydir ** 2 / 11552000; // Magic number.
SetYDir(ydir, 100);
// Smoke trail.
CreateParticle("ExploSmoke", Random(5)-2, Random(5)-2, Random(3)-1, Random(3)-1, size + RandomX(-20,20), RGBa(130,130,130,90));
CreateParticle("FireballSmoke", 0, 0, Random(3)-1, Random(3)-1, RandomX(120,180), RGBa(100,100,100,70));
CreateParticleEx("Smoke", PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(-3, 3), PV_Random(-3, 3), 30 + Random(60), Particles_SmokeTrail(), 5);
// Fire trail.
CreateParticle("MagicSpark", 0, 0, Sin(Random(360),RandomX(15,33)), Cos(Random(360), RandomX(15,33)), RandomX(30,70), RGB(255,255,255));
for (var i = 0; i < 6; i++)
{
var theta = RandomX(-45, 45);
var x = Sin(theta, size / 8);
var y = Cos(theta, size / 8);
CreateParticle("MagicFire", x, y, Random(3)-1, Random(3)-1 ,RandomX(50, 90), HSL(Random(50), 200+Random(25), Random(100)));
}
CreateParticleEx("MagicSpark", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), 16, Particles_SparkFire(), 4);
CreateParticleEx("Fire", PV_Random(-size / 8, size / 8), PV_Random(-size / 8, size / 8), PV_Random(-1, 1), PV_Random(-1, 1), 30, Particles_FireTrail(), 6 + size / 10);
// Sound.
// Burning and friction decrease size.
@ -118,13 +111,12 @@ protected func Hit(int xdir, int ydir)
var size = 10 + GetCon();
var speed2 = 20 + (xdir ** 2 + ydir ** 2) / 10000;
// Some fire sparks.
for (var i = 0; i < 6; i++)
var particles =
{
var theta = RandomX(135, 225);
var x = Sin(theta, size / 8);
var y = Cos(theta, size / 8);
CreateParticle("MagicFire", x, y, Random(3)-1, Random(3)-1 ,RandomX(50, 90), HSL(Random(50), 200+Random(25), Random(100)));
}
Prototype = Particles_Fire(),
Attach = nil
};
CreateParticleEx("Fire", PV_Random(-size / 4, size / 4), PV_Random(-size / 4, size / 4), PV_Random(-size/4, size/4), PV_Random(-size/4, size/4), 30, particles, 20 + size);
// Explode meteor, explode size scales with the energy of the meteor.
var dam = size * speed2 / 750;
dam = BoundBy(dam, 5, 30);

View File

@ -1,37 +1,9 @@
/*--- Amethyst ---*/
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";
#include Ruby
func Initialize()
// returns the color of the gem (used for effects)
func GetGemColor()
{
AddEffect("Sparkle", this, 1, 2, this);
var gfx = Random(4);
if (gfx) SetGraphics(Format("%d", gfx+1));
return true;
}
func FxSparkleTimer(target, effect, effect_time)
{
if(this()->Contained()) return;
effect.t_off += Random(10);
CreateParticle("MagicRing", 0, 0, 0, 0, Cos(effect_time*10+effect.t_off, 100), RGBa(255,20,255,100), this, false);
return FX_OK;
}
func IsValuable() { return true; }
func QueryOnSell()
{
// Inform goal of gem sale
var goal = FindObject(Find_ID(Goal_SellGems));
if (goal) goal->OnGemSold();
return false; // do perform selling
}
func Hit()
{
Sound("GlassHit*");
return true;
return RGB(255, 20, 255);
}

View File

@ -4,19 +4,37 @@ local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";
// returns the color of the gem (used for effects)
func GetGemColor()
{
return RGB(255, 20, 20);
}
func Initialize()
{
AddEffect("Sparkle", this, 1, 2, this);
AddEffect("Sparkle", this, 1, 30 + RandomX(-3, 3), this);
var gfx = Random(4);
if (gfx) SetGraphics(Format("%d", gfx+1));
return true;
}
func FxSparkleStart(target, effect, temp)
{
if (temp) return;
var color = this->~GetGemColor() ?? RGB(255, 20, 20);
effect.particles =
{
Prototype = Particles_MagicRing(),
R = (color >> 16) & 0xff,
G = (color >> 8) & 0xff,
B = (color >> 0) & 0xff,
};
}
func FxSparkleTimer(target, effect, effect_time)
{
if(this()->Contained()) return;
effect.t_off += Random(10);
CreateParticle("MagicRing", 0, 0, 0, 0, Cos(effect_time*10+effect.t_off, 100), RGBa(255,20,20,100), this, false);
if(this()->Contained() || !Random(2)) return FX_OK;
CreateParticleEx("MagicRing", 0, 0, 0, 0, effect.Interval, effect.particles, 1);
return FX_OK;
}