func FxBloodTimer(target, effect, time) { if (time > 80) return -1; var size = (90 - time) / 5; effect.particles.Size = PV_KeyFrames(0, 0, 0, 100, size, 900, size, 1000, 0); effect.particle_target->CreateParticle("Blood", GetX(), GetY(), 0, 0, PV_Random(60, 90), effect.particles); }
global func Particles_Leaves() { return { Size = PV_Random(3, 6), Phase = PV_Linear(0, 7*5), Alpha = PV_KeyFrames(0, 0, 255, 900, 255, 1000, 0), CollisionVertex = 500, OnCollision = PC_Stop(), ForceX = PV_Wind(100), ForceY = PV_Gravity(40), DampingX = 975, DampingY = 975, Rotation = PV_Direction(PV_Random(750, 1250)), Attach = nil }; }
func BlockEffect(object clonk, int radius) { var trailparticles = { Size = PV_KeyFrames(0, 0, 0, 200, PV_Random(10, 25), 1000, 0), Alpha = PV_Linear(255, 0), OnCollision = PC_Die(), CollisionVertex = 0, DampingX = 900, DampingY = 900, BlitMode = GFX_BLIT_Additive }; trailparticles = Particles_Colored(trailparticles, GetPlayerColor(clonk->GetOwner())); clonk->CreateParticle("Shockwave", PV_Sin(PV_Random(0, 360, 0, 1), PV_Random(radius - 1, radius + 1, 0, 2)), PV_Cos(PV_Random(0, 360, 0, 1), PV_Random(radius - 1, radius + 1, 0, 2)), PV_Random(-5, 5), PV_Random(-5, 5), PV_Random(20, 30), trailparticles, 100); }
func RiftSparks(int radius) { var flash_particles = { Prototype = Particles_Flash(), Size = radius, }; var alpha = 120; var cSmokeR = PV_KeyFrames(0, 0, 227, 500, 191, 1000, 50); var cSmokeG = PV_KeyFrames(0, 0, 170, 500, 200, 1000, 50); var cSmokeB = PV_KeyFrames(0, 0, 255, 500, 255, 1000, 50); if (!Random(2)) // invert order of colors { cSmokeR = PV_KeyFrames(0, 0, 191, 500, 227, 1000, 50); cSmokeG = PV_KeyFrames(0, 0, 200, 500, 170, 1000, 50); cSmokeB = PV_KeyFrames(0, 0, 255, 500, 255, 1000, 50); } var dust_particles = { Prototype = Particles_Dust(), Size = PV_KeyFrames(0, 0, 0, 100, radius, 1000, 0), Alpha = PV_KeyFrames(0, 0, alpha, 750, alpha, 1000, 0), R = cSmokeR, G = cSmokeG, B = cSmokeB, }; // Create some particles CreateParticle("Dust", g_DimensionRift_X, g_DimensionRift_Y, PV_Random(-radius / 2, radius / 2), PV_Random(-radius / 2, radius / 2), PV_Random(18, 36), dust_particles, radius); CreateParticle("Flash", g_DimensionRift_X, g_DimensionRift_Y, 0, 0, 30, flash_particles); }
func Initialize() { // singleton g_storm = this; SetPosition(); // defaults storm_particles = { Size = 1, Stretch = PV_Speed(PV_Linear(4000, 0), 0), Alpha = PV_KeyFrames(0, 0, 0, 100, 255, 1000, 255), Rotation = PV_Direction(), CollisionVertex = 1000, OnCollision = PC_Die() }; StormStream = { max_segment_stretch = 100, // maximum number of pixels per segment that can be deviated from dir in either direction max_segment_stretch_want = 5, // maximum movement back into original position that is preferred (i.e.: speed at which gaps behind sky islands close) search_steps = 10, // steps in pixels in which to search for holes to blow through search_steps_mult = 200, // multiplyer, in percent, by which search steps get larger with each iteration }; find_mask = Find_And(Find_Category(C4D_Vehicle | C4D_Living | C4D_Object), Find_Not(Find_Func("IsEnvironment"))); SetStorm(20,0, 2000); }
global func ExplosionParticles_Init() { ExplosionParticles_Smoke = { Size = PV_KeyFrames(0, 180, 25, 1000, 50), DampingY = PV_Random(890, 920, 5), DampingX = PV_Random(900, 930, 5), ForceY=-1, ForceX = PV_Wind(20, PV_Random(-2, 2)), Rotation=PV_Random(0,360,0), R=PV_KeyFrames(0, 0, 255, 260, 64, 1000, 64), G=PV_KeyFrames(0, 0, 128, 260, 64, 1000, 64), B=PV_KeyFrames(0, 0, 0, 260, 108, 1000, 108), Alpha = PV_KeyFrames(0, 0, 0, 100, 20, 500, 20, 1000, 0) }; ExplosionParticles_Blast = { Size = PV_KeyFrames(0, 0, 0, 260, 25, 1000, 40), DampingY = PV_Random(890, 920, 0), DampingX = PV_Random(900, 930, 0), ForceY = PV_Random(-8,-2,0), ForceX = PV_Random(-5,5,0), R = 255, G = PV_Random(64, 120, 0), Rotation = PV_Random(0, 360, 0), B = 0, Alpha = PV_KeyFrames(0, 260, 100, 1000, 0), BlitMode = GFX_BLIT_Additive, Phase = PV_Random(0, 1) }; ExplosionParticles_BlastSmooth = { Size = PV_KeyFrames(0, 0, 0, 250, PV_Random(30, 50), 1000, 80), R = PV_KeyFrames(0, 0, 255, 250, 128, 1000, 0), G = PV_KeyFrames(0, 0, 255, 125, 64, 1000, 0), Rotation = PV_Random(0, 360, 0), B = PV_KeyFrames(0, 0, 100, 250, 64, 100, 0), Alpha = PV_KeyFrames(0, 0, 255, 750, 250, 1000, 0), BlitMode = GFX_BLIT_Additive }; ExplosionParticles_BlastSmoothBackground = { Prototype = ExplosionParticles_BlastSmooth, BlitMode = nil, R = PV_Linear(50, 0), G = PV_Linear(50, 0), B = PV_Linear(50, 0), Alpha = PV_Linear(128, 0) }; ExplosionParticles_Star = { Size = PV_KeyFrames(0, 0, 0, 500, 60, 1000, 0), R = PV_KeyFrames(0, 750, 255, 1000, 0), G = PV_KeyFrames(0, 300, 255, 1000, 0), B = PV_KeyFrames(0, 300, 255, 500, 0), Rotation = PV_Random(0, 360, 4), Alpha = PV_KeyFrames(0, 750, 255, 1000, 0), BlitMode = GFX_BLIT_Additive, Stretch = PV_Speed(1000, 1000) }; ExplosionParticles_Shockwave = { Size = PV_Linear(0, 120), R = 255, G = 128, B = PV_KeyFrames(0, 0, 128, 200, 0), Rotation = PV_Step(20), BlitMode = GFX_BLIT_Additive, Alpha = PV_Linear(255, 0) }; ExplosionParticles_Glimmer= { Size = PV_Linear(2, 0), ForceY = GetGravity(), DampingY = PV_Linear(1000,700), DampingX = PV_Linear(1000,700), Stretch = PV_Speed(1000, 500), Rotation = PV_Direction(), OnCollision = PC_Die(), CollisionVertex = 500, R = 255, G = PV_Linear(128,32), B = PV_Random(0, 128, 2), Alpha = PV_Random(255,0,3), BlitMode = GFX_BLIT_Additive, }; }
func FxFireDashTimer(object target, proplist effect, int time) { var a = effect.angle; var x = target->GetX(); var y = target->GetY(); target->SetPosition(target->GetX() + Sin(a, 6, effect.angle_prec), target->GetY() + -Cos(a, 6, effect.angle_prec)); for(var o in FindObjects(Find_Distance(effect.Size1, x, y), Find_Func("CanBeHit", target))) { if(o->GetOwner() == target->GetOwner()) continue; if(!GetEffect("DashCD", o)) { o->Fling(0, -5); AddEffect("DashCD", o, 20, 10); o->AddFireHitEffect(); target->WeaponDamage(o, effect.SpellDamage1); } } var chaoticspark = { Size = PV_Linear(1, 0), ForceX = PV_KeyFrames(10, 0, PV_Random(-6, 6), 333, PV_Random(-6, -6), 666, PV_Random(6, 6), 1000, PV_Random(-6, 6)), ForceY = PV_KeyFrames(10, 0, PV_Random(-8, 5), 333, PV_Random(-8, 5), 666, PV_Random(-10, 10), 1000, PV_Random(-10, 15)), Stretch = PV_Speed(1000, 500), Rotation = PV_Direction(), CollisionVertex = 0, OnCollision = PC_Die(), R = 255, G = PV_Linear(255,100), B = PV_Random(0, 100), DampingX=950, DampingY=950, Alpha = PV_Random(100,180), BlitMode = GFX_BLIT_Additive }; CreateParticle("Magic", x + RandomX(-5, 5), y + RandomX(-10, 10), RandomX(25, -25) + target->GetXDir(), RandomX(-25, 12) + target->GetYDir(), 50, chaoticspark, 4); var firetrailparticles = { Prototype = Particles_FireTrail(), Size = PV_Linear(effect.Size1,0), BlitMode = GFX_BLIT_Additive, OnCollision=nil, }; CreateParticle("Fire", x, y, PV_Random(-7,7), PV_Random(-7,7), 20, firetrailparticles, 3); var dist = Distance(x, y, effect.startx + effect.tx, effect.starty + effect.ty); if(dist < 10 || (dist > effect.dist + 1 && time > 10)) { effect.clonk->SetObjectLayer(nil); return -1; } else { //Log("%d %d", dist, effect.dist); effect.dist = dist; } }