updated some remainers of the old particle system to use the new one

stable-5.4
David Dormagen 2013-11-28 23:30:11 +01:00
parent 8461fb9822
commit 54fdb2cec1
17 changed files with 50 additions and 60 deletions

View File

@ -205,11 +205,6 @@ global func FxFillSpecialChestTimer(object target)
for(var i=0; i < GetLength(w_list); i++)
if (FindObject(Find_ID(w_list[i]))) return 1;
target->CreateChestContents(w_list[r]);
var clr = RGB(0,255,0);
if (r == 1) clr = RGB(255,0,0);
if (r == 2) clr = RGB(255,128,0);
CastParticles("AnouncingFire",75,60,target->GetX(),target->GetY(),100,150,clr);
return 1;
}

View File

@ -35,7 +35,7 @@ public func IsProjectileTarget(target,shooter)
public func OnProjectileHit(object projectile)
{
CastParticles("Air",20,5,0,-10,170,190,RGB(255,255,255),RGB(255,255,255));
CreateParticleEx("Air", 0, -10, PV_Random(-30, 30), PV_Random(-30,30), PV_Random(30, 120), Particles_Air(), 10);
if(load) load->~Fall(projectile->GetController());
RemoveObject();
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -1,15 +0,0 @@
[Particle]
Name=Lichen
MaxCount=1500
InitFn=StdInit
ExecFn=StdExec
DrawFn=Std
Face=0,0,64,64,-32,-32
Delay=0
Repeats=1
GravityAcc=33
VertexCount=1
VertexY=0
AlphaFade=15
RByV=3
Attach=0

View File

@ -45,12 +45,18 @@ public func Damage()
private func Destroy()
{
if(Random(maxsize+35)<size) CreateObject(Moss,0,0,-1);
for(var r=0; r<(size); r++)
var particles =
{
var i=Random(360);
var d=Random(size/5);
CreateParticle("Lichen",Sin(i,d),-Cos(i,d),RandomX(-3,3),RandomX(-3,3),10+Random(20),RGB(200+Random(50),200+Random(50),200+Random(50)),nil,Random(2));
}
Size = PV_Random(3, 7),
Alpha = PV_KeyFrames(0, 0, 255, 900, 255, 1000, 0),
ForceY = PV_Gravity(40),
DampingX = 900, DampingY = 900,
CollisionVertex = 750,
OnCollision = PC_Stop(),
Rotation = PV_Direction(PV_Random(900, 1100)),
Phase = PV_Random(0, 1)
};
CreateParticleEx("Lichen", PV_Random(-5, 5), PV_Random(-5, 5), PV_Random(-30, 30), PV_Random(-30, 30), PV_Random(36, 36 * 4), particles, 40);
RemoveObject();
}

View File

@ -39,5 +39,5 @@ public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool re
protected func FxParticlesTimer(object target, effect, int time)
{
var angle = time*10 % 360;
CreateParticle("PSpark", Sin(angle, 13), -Cos(angle, 13), 0, 0, 16, RGBa(255, 255, 255, 150), this);
CreateParticleEx("SphereSpark", Sin(angle, 13), -Cos(angle, 13), 0, 0, PV_Random(20, 30), Particles_Spark());
}

View File

@ -26,8 +26,14 @@ func Footstep()
{
var dir = Sign(GetXDir());
var clr = GetAverageTextureColor(GetTexture(0,10));
CreateParticle("Dust2", dir*-4, 8, dir*-2, -2, 25+Random(5), DoRGBaValue(clr,-150,0));
CreateParticle("Dust2", dir*-4, 8, dir*-3, -3, 25+Random(5), DoRGBaValue(clr,-150,0));
var particles =
{
Prototype = Particles_Dust(),
R = (clr >> 16) & 0xff,
G = (clr >> 8) & 0xff,
B = clr & 0xff,
};
CreateParticleEx("Dust", PV_Random(dir * -5, dir * -3), 8, PV_Random(dir * 2, dir * 1), PV_Random(-2, -3), PV_Random(36, 2 * 36), particles, 5);
Sound("StepSoft?");
}
}

View File

@ -73,7 +73,7 @@ public func IsProjectileTarget(target,shooter)
public func OnProjectileHit()
{
//Pop!
CastParticles("Air",20,5,0,-10,170,190,RGB(255,255,255),RGB(255,255,255));
CreateParticleEx("Air", 0, -10, PV_Random(-10, 10), PV_Random(-10, 10), 10, Particles_Air(), 30);
Sound("BalloonPop");
if (rider)
{

View File

@ -126,7 +126,7 @@ protected func DoSwing(object clonk, int ix, int iy)
//It's solid, but not diggable. So it is a hard mineral.
else
{
CastParticles("Spark",RandomX(3,9),35,x2*9/10,y2*9/10,10,30,RGB(255,255,150),RGB(255,255,200));
CreateParticleEx("Spark", x2*9/10,y2*9/10, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(10, 20), Particles_Glimmer(), 10);
Sound("Clang?");
}

View File

@ -152,7 +152,7 @@ public func Dust(object target)
B = clr & 0xff,
Size = PV_KeyFrames(0, 0, 0, 300, 40, 1000, 15),
};
CreateParticleEx("Dust", groundx, groundy, PV_Random(-3, 3), PV_Random(-3, -3), PV_Random(18, 1 * 36), particles, 3);
CreateParticleEx("Dust", groundx, groundy, PV_Random(-3, 3), PV_Random(-3, 3), PV_Random(18, 1 * 36), particles, 3);
}
}

View File

@ -25,7 +25,7 @@ protected func Hit()
ShakeFree(6);
RemoveEffect("HitCheck",this);
Sound("BulletHitGround?");
CastParticles("Spark",1,20,0,0,15,25,RGB(255,200,0),RGB(255,255,150));
CreateParticleEx("Spark", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(10, 20), Particles_Glimmer(), 3);
RemoveObject();
}

View File

@ -17,7 +17,7 @@ protected func Hit()
Sound("BulletHitGround?");
CastParticles("Spark",1,20,0,0,15,25,RGB(255,200,0),RGB(255,255,150));
CreateParticleEx("Spark", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(10, 20), Particles_Glimmer(), 3);
RemoveObject();
}

View File

@ -33,7 +33,15 @@ public func FxIntGravestoneStart(object clonk, proplist effect)
clonk->Enter(effect.grave);
//smoke effect
effect.grave->CastParticles("ExploSmoke", RandomX(10,15), 0, 0, 6, 200, 250, HSLa(0,0,255,64), HSLa(0,0,255,64));
var particles =
{
Prototype = Particles_Dust(),
R = 200,
G = 100,
B = 50,
Size = PV_KeyFrames(0, 0, 0, 300, 40, 1000, 15)
};
effect.grave->CreateParticleEx("Dust", 0, 0, PV_Random(-3, 3), PV_Random(-3, 3), PV_Random(18, 1 * 36), particles, 6);
}
public func FxIntGravestoneStop(object clonk, proplist effect, int reason)

View File

@ -212,7 +212,7 @@ func Damage()
{
// splatter
if(grow_anim)
CastParticles("MaterialParticle", 20, 30, 0, 0, 10, 20, RGB(200, 200, 200), RGB(200, 255, 200));
CreateParticleEx("Dust", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(20, 60), Particles_Material(RGB(50, 50, 255)), 30);
// ouch!
Die(false);

View File

@ -20,7 +20,7 @@ public func ControlUp(object clonk)
var arrw= CreateObject(Arrow,x,y,-1);
arrw->Launch(30,80, clonk);
arrw->SetGraphics("1");
CastParticles("Straw",30,20,x,y,30,40,RGB(255,255,255),RGB(255,120,200));
CreateParticleEx("Straw", 0, 0, PV_Random(-20, 20), PV_Random(-20,20), PV_Random(30, 120), Particles_Straw(), 20);
}
if(GetEffect("SparklingAttention",this)) RemoveEffect("SparklingAttention",this);
}

View File

@ -91,7 +91,7 @@ global func FxAutoOpenTimer(object pTarget, effect, int timer)
global func FxSparklingAttentionTimer(object pTarget, effect, int timer)
{
CastParticles("Flash",Random(10)+10,60,pTarget->GetX(),pTarget->GetY(),100,120,RGBa(255,235,200,80+Random(36)));
CreateParticleEx("Flash", 0, 0, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(8, 15), {Prototype = Particles_Flash(), Size = 10}, 10);
}
protected func Decoration()
@ -137,8 +137,13 @@ global func FxPlaneResetTimer(object target, effect, int time)
if(effect.count<4) return 1;
DrawParticleLine("AirIntake",target->GetX()+3,target->GetY(),3030,315,1,40);
DrawParticleLine("MagicSpark",target->GetX()-3,target->GetY(),3030,315,2,40);
var particles =
{
Prototype = Particles_Air(),
Size = PV_Linear(4, 0)
};
DrawParticleLine("Air", target->GetX()+3, target->GetY(), 3030, 315, 1, PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(10, 30), particles);
target->SetPosition(3030,315);
target->SetR(-90);
target->SetDir(0);

View File

@ -300,37 +300,22 @@ global func FxFireTimer(object target, proplist effect, int time)
return FX_OK;
// particles
//var smoke;//, sparks, bright;
//smoke=BoundBy(effect.strength, 0, 100);
//sparks=BoundBy((effect.strength*3)/4, 0, 100);
//bright=BoundBy((effect.strength-50), 0, 100);
if(time % 4 == 0)
{
var size = BoundBy(10*Max(width, height), 50, 800);
if (size > 300)
var size = BoundBy(Max(width, height), 5, 50);
if (size > 40)
if (time % 8 == 0)
return;
var wind = BoundBy(GetWind(target->GetX(), target->GetY()), -5, 5);
var smoke_color;
if(effect.strength < 50)
smoke_color = RGBa(255,255,255, 50);
else
smoke_color = RGBa(100, 100, 100, 50);
CreateParticle("ExploSmoke", RandomX(-width, width), RandomX(-height, height), wind, -effect.strength/8, size, smoke_color);
Smoke(RandomX(-width, width), RandomX(-height, height), size, smoke_color);
}
/*for(var i=0;i<Max(1, sparks/20);++i)
{
CreateParticle("MagicSpark", RandomX(-width, width), RandomX(-height, height), wind/2, -10, 100, RGBa(255,255,255, 200), target, Random(2));
}*/
/*for(var i=0;i<bright/10;++i)
{
CreateParticle("Flash", RandomX(-width, width), RandomX(-height, height), wind, -10, 5*Max(width, height)*Max(1, bright/15), RGBa(255,200,100, 50), target, Random(2));
}*/
return FX_OK;
}