func InitEffect() { Sound("Fire::Fireball", false, 100, nil, nil, nil, 200); Sound("Fire::FuseLoop", false, 20, nil, 1, nil, 200); SetLightRange(30, 70); SetLightColor(RGB(100, 100, 255)); var snow = { R = 200, G = 200, B = 255, Alpha = PV_Linear(255, 0), Size = PV_Random(0, 2), CollisionVertex = 0, OnCollision = PC_Stop(), ForceX = PV_Random(-5, 5, 10), ForceY = PV_Gravity(100), DampingX = 900, DampingY = 900 }; trail_particles = { R = PV_Random(200, 255), G = PV_Random(200, 255), B = 255, Prototype = Particles_FireTrail(), Size = PV_Linear(10, 0), BlitMode = nil, Rotation = PV_Random(0, 360), BlitMode = GFX_BLIT_Additive }; CreateParticle("StarFlash", 0, 0, PV_Random(-30, 30), PV_Random(-30, 30), 100, snow, 100); }
global func BlueExplosionEffect(int level, int x, int y) { var glimmer = { Prototype = Particles_Glimmer(), R = PV_Random(100, 150), G = PV_Random(100, 150), B = PV_Random(200, 255) }; var fire = { Prototype = Particles_Fire(), R = PV_Random(100, 150), G = PV_Random(100, 150), B = PV_Random(200, 255), Size = PV_Random(level/2, level/3) }; var smoke = { Prototype = Particles_SmokeTrail(), R = PV_Linear(PV_Random(100, 150), 0), G = PV_Linear(PV_Random(100, 150), 0), B = PV_Linear(PV_Random(200, 255), 0), Size = PV_Random(level - 5, level + 5) }; // Blast particle. CreateParticle("SmokeDirty", x, y, PV_Random(-2, 2), PV_Random(-2, 2), PV_Random(20, 40), smoke, 10); CreateParticle("MagicFire", x, y, PV_Random(-20, 20), PV_Random(-20, 20), PV_Random(5, 10), fire, 20); if(!GBackLiquid(x,y)) CreateParticle("SphereSpark", x, y, PV_Random(-100, 100), PV_Random(-100, 100), PV_Random(5, 36 * 3), glimmer, level); if(GBackLiquid(x,y)) CastObjects(Fx_Bubble, level * 4 / 10, level, x, y); return; }
func Intro_PlaneHit() { // Plane hit ground! Continue sequence. Sound("Objects::Plane::PlaneCrash", true); SetR(-90); var particles = Particles_Smoke(true); particles.Size = PV_Linear(PV_Random(20, 60), PV_Random(50, 100)); CreateParticle("Smoke", PV_Random(-30,30), PV_Random(-30,30), PV_Random(-60, 60), PV_Random(-20,0), PV_Random(200, 500), particles, 20); particles.Size = PV_Linear(PV_Random(50, 80), PV_Random(100, 200)); CreateParticle("Smoke", PV_Random(-30,30), PV_Random(-30,30), PV_Random(-20, 20), PV_Random(-20,0), PV_Random(100, 200), particles, 20); for (var iplr=0,plr; iplr<GetPlayerCount(C4PT_User); ++iplr) { plr = GetPlayerByIndex(iplr, C4PT_User); var icrew=0,crew; while (crew=GetCrew(plr, icrew++)) { crew->Exit(0,-5, 0, Random(1)+1, Random(5)-6); crew->SetAction("Tumble"); } } SetMeshMaterial("CrashedAirplane"); this.MeshTransformation=Trans_Mul(Trans_Rotate(10,0,2,1), Airplane.MeshTransformation); this.Hit = this.intro_seq.plane_Hit; this.intro_seq.plane_crashed = true; this.intro_seq->ScheduleNext(50); return true; }
func FxParticlesStop(object target, proplist effect, int reason, bool temporary) { if(temporary) return; SetSolidMask(); var props = { Size = PV_Linear(4, 0), ForceY = GetGravity(), Stretch = PV_Speed(1000, 500), Rotation = PV_Direction(), OnCollision = PC_Die(), CollisionVertex = 0, R = 100, G = 100, B = 100, BlitMode = GFX_BLIT_Additive, }; CreateParticle("Smoke", 0, 0, PV_Random(-10 , 10), PV_Random(-10, 20), 50, props, 10); var smoke = { ForceX = PV_Wind(200 - 180), DampingX = 900, DampingY = 900, Alpha = PV_Linear(255, 0), R = 100, G = 100, B = 100, Size = PV_Linear(PV_Random(4, 10), PV_Random(20, 30)), Phase = PV_Random(0, 15) }; CreateParticle("Smoke", PV_Random(-5,5), PV_Random(-5,5), PV_Random(-15, 15), PV_Random(-15, 15), 30, smoke, 15); }
func FxLifeStop(object target, proplist effect, int reason, bool temporary) { if(temporary) return; var prt = { Size = 15, Alpha = PV_Linear(255, 0), Rotation = PV_Step(15, PV_Random(0, 360)), ForceY = GetGravity() }; CreateParticle("SawbladePrt", 0, 0, PV_Random(-35, 35), PV_Random(-35, 5), 40, prt, 6); var prt2 = { Size = PV_Linear(2, 0), ForceY = GetGravity(), Stretch = PV_Speed(1000, 500), Rotation = PV_Direction(), R = 255, G = PV_Linear(128,32), B = PV_Random(0, 128, 2), Alpha = PV_Random(255,0,3), BlitMode = GFX_BLIT_Additive, }; CreateParticle("Flash", 0, 0, PV_Random(-35, 35), PV_Random(-35, 5), 70, prt2, 20); Sound("sawblade_destroyed", false, 50); RemoveObject(); }
func FxDischargeStart(object target, proplist effect, int temporary) { for(var i = 0; i < 360; i+= 10) { var props = { Size = PV_Linear(4, 0), Stretch = 10000, Rotation = i + 180, R = pR, G = pG, B = pB, BlitMode = GFX_BLIT_Additive, }; var x = Sin(i, DischargeSize + RandomX(-2, 2)); var y = -Cos(i, DischargeSize + RandomX(-2, 2)); var rnd = RandomX(4,20); var xdir = Sin(i + 180, rnd); var ydir = -Cos(i + 180, rnd); CreateParticle("Flash", x, y, xdir, ydir, 25, props, 1); } }
func CheckForEnemies(Size) { for(var o in FindObjects(Find_Distance(Size), Find_Func("CanBeHit", this))) { if(o->GetOwner() == GetOwner() || GetEffect("BallHitCD", o)) continue; o->AddBallHitEffect(); o->Fling(0, -2); AddEffect("BallHitCD", o, 1, 15); var trailparticles = { Prototype = Particles_ElectroSpark2(), Size = PV_Linear(PV_Random(5,15),0), BlitMode = GFX_BLIT_Additive, Rotation = PV_Random(0,360), R = pR, G = pG, B = pB, }; CreateParticle("Lightning", o->GetX() - GetX(), o->GetY() - GetY(), 0, 0, 10, trailparticles, 5); WeaponDamage(o, SpellDamage); Sound("Ball::ball_hit", false, 50); } }
func JumpEffect(object clonk, dir) { var from, to; if (dir == "Up") { from = 50; to = 130; } if (dir == "Left") { from = -30; to = 50; } if (dir == "Right") { from = 130; to = 210; } if (dir == "Down") { from = 230; to = 310; } clonk->Sound("Fire::Inflame", false, 30, nil, nil, nil, -100); var trailparticles = { Size = PV_Linear(0, 20), 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())); for(var i = from; i < to; i+=5) { var r = 10; var x = Cos(i, r); var y = Sin(i, r); clonk->CreateParticle("Shockwave", x, y, Cos(i, r), Sin(i, r), 60, trailparticles, 2); } }
func Initialize() { chargeprt = { Size = 5, Alpha = PV_Linear(255, 0), R = 150, G = 150, B = 150, ForceY = GetGravity(), Stretch = PV_Linear(1500, 1500), Rotation = PV_Step(10, PV_Random(0, 360), 1), OnCollision = PC_Bounce(), }; snapped = false; }
func JumpEffect(object clonk, dir) { var from; var to; if (dir == "Up") { from = 50; to = 130; } if (dir == "Left") { from = -30; to = 50; } if (dir == "Right") { from = 130; to = 210; } if (dir == "Down") { from = 230; to = 310; } Sound("hookjump", false, 30); for(var i = from; i < to; i+=5) { var r = 10; var x = clonk->GetX() + Cos(i, r); var y = clonk->GetY() + Sin(i, r); var angle = Angle(0,0,Cos(i, r),Sin(i, r)); var trailparticles = { //Prototype = Particles_ElectroSpark2(), Size = PV_Linear(10,0), Rotation = angle, R = 150, G = 150, B = 150, OnCollision = PC_Bounce(), }; CreateParticle("Shockwave", x, y, Cos(i, r + RandomX(-1,1)), Sin(i, r + RandomX(-1, 1)), 10, trailparticles); } }
func JumpEffect(object clonk, dir) { var from; var to; if (dir == "Up") { from = 50; to = 130; } if (dir == "Left") { from = -30; to = 50; } if (dir == "Right") { from = 130; to = 210; } if (dir == "Down") { from = 230; to = 310; } clonk->Sound("time_hit", false, 30); for(var i = from; i < to; i+=5) { var r = 10; var x = clonk->GetX() + Cos(i, r); var y = clonk->GetY() + Sin(i, r); var angle = Angle(0,0,Cos(i, r),Sin(i, r)); var trailparticles = { Prototype = Particles_ElectroSpark2(), Size = PV_Linear(10,0), Rotation = angle, R = 255, G = 165, B = 50, OnCollision = PC_Bounce(), }; CreateParticle("Lightning", x, y, Cos(i, r), Sin(i, r), 10, trailparticles); } }
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 FxBlockedTimer(object target, proplist fx, int time) { if(time >= BlockDur) return -1; var lightning = { Prototype = Particles_ElectroSpark2(), Size = PV_Linear(PV_Random(3,6),0), BlitMode = GFX_BLIT_Additive, Rotation = PV_Random(0,360), R = 100, G = 100, B = pB, Attach = ATTACH_Front, }; target->CreateParticle("Lightning", RandomX(-6, 6), RandomX(-6, 6), 0, 0, 20, lightning, 3); }
func FxTimeHitTimer(object target, proplist effect, int time) { var lightning = { Prototype = Particles_ElectroSpark2(), Size = PV_Linear(PV_Random(2,5),0), BlitMode = GFX_BLIT_Additive, Rotation = PV_Random(0,360), R = 255, G = 150, B = 50, Attach = ATTACH_Front | ATTACH_MoveRelative, }; target->CreateParticle("Lightning", RandomX(-5, 5), RandomX(-10, 10), 0, 0, 10, lightning, 2); if(time > 40) return -1; }
func InitEffect() { SetLightRange(30, 70); SetLightColor(RGB(255, 255, 0)); ox=GetX(); oy=GetY(); trailparticles = { Size = PV_Linear(5,0), Alpha = 128, BlitMode = GFX_BLIT_Additive, R = 255, G = 255, B = 50, }; AddEffect("Trail", this, 1, 1, this); AddEffect("HitCheck", this, 1,1, nil,nil, GetCrew(GetOwner())); }
func BlockEffect(object clonk, range) { for(var i = 0; i < 360; i+=10) { var r = range; var x = clonk->GetX() + Cos(i, r); var y = clonk->GetY() + Sin(i, r); var angle = Angle(0,0,Cos(i, r),Sin(i, r)) + 90; var trailparticles = { Size = PV_Linear(15,0), Rotation = angle, R = 150, G = 150, B = 150, }; CreateParticle("Shockwave", x, y, 0, 0, 10, trailparticles); } }
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); }
func BlockEffect(object clonk, range) { for(var i = 0; i < 360; i+=10) { var r = range; var x = clonk->GetX() + Cos(i, r); var y = clonk->GetY() + Sin(i, r); var angle = Angle(0,0,Cos(i, r),Sin(i, r)) + 90; var trailparticles = { Prototype = Particles_ElectroSpark2(), Size = PV_Linear(15,0), Rotation = angle, R = 255, G = 165, B = 50, }; CreateParticle("Lightning", x, y, 0, 0, 10, trailparticles); } }
func ChargeEffect(proplist params) { var clonk = params.clonk; for(var i = 0; i < 360; i+= RandomX(3,15)) { if(!Random(10)) { var props = { Prototype = Particles_FireTrail(), Size = PV_Linear(10,0), BlitMode = GFX_BLIT_Additive, OnCollision=nil, CollisionVertex=nil }; var xdir = Sin(i + 180, RandomX(15, 30)); var ydir = -Cos(i + 180, RandomX(15, 30)); CreateParticle("Fire", clonk->GetX() - GetX() + Sin(i, 30), clonk->GetY() - GetY() - Cos(i, 30), PV_Random(xdir -2, xdir + 2), PV_Random(ydir - 2 , ydir + 2), 20, props, 2); } } }
func InitEffect() { Sound("Fire::Fireball", false, 100); Sound("Fire::FuseLoop", false, 50, nil, 1); SetLightRange(30, 70); SetLightColor(RGB(255, 100, 0)); if (shooter.ChampType == ComboMan) { Speed = 75; ParticleSize = 13; SpellDamage = 25; SetVelocity(Angle(0,0,GetXDir(), GetYDir(), 10), Speed, 10); } var lightparticle = { R = 255, G = 100, B = 0, Alpha = 40, Size = 50, BlitMode = GFX_BLIT_Additive, Rotation = PV_Step(30, 0, 1), Attach = ATTACH_Back | ATTACH_MoveRelative }; CreateParticle("Shockwave", 0, 0, 0, 0, 0, lightparticle); firetrailparticles = { Prototype = Particles_FireTrail(), Size = PV_Linear(ParticleSize,0), BlitMode = GFX_BLIT_Additive, }; }
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, }; }
local is_selected = false; local number = 0; local offset = 0; local angle; local ChargeEffect = new Effect { Construction = func() { this.particles = { R = 255, G = 255, B = 255, Size = PV_Linear(PV_Random(2, 3), 0), OnCollision = PC_Die(), CollisionVertex = 0, ForceX = PV_Linear(0, PV_Random(-10, 10, 10)), ForceY = PV_Linear(0, PV_Random(-10, 10, 10)), DampingX = 900, DampingY = 900, BlitMode = GFX_BLIT_Additive }; }, Timer = func(int time) { var r = time / 3; this.Target->CreateParticle("StarSpark", PV_Random(-r, r), PV_Random(-r, r), 0, 0, PV_Random(60, 300), this.particles, 3); if (time > this.ChargeDuration) return FX_Execute_Kill; return FX_OK;
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; } }
func Initialize() { SetSolidMask(); if(GBackSolid()) { RemoveObject(); return 0; } SetSolidMask(0,0,10,10); var random = Random(5); if(random) { SetGraphics(Format("%d", random)); } SetR(Random(360)); SetRDir(2); SetAction("Travel"); AddEffect("Particles", this, 20, 1, this); for(var o in FindObjects(Find_OCF(OCF_Alive), Find_Distance(10))) { o->Unstuck(); } var smoke = { ForceX = PV_Wind(200 - 180), DampingX = 900, DampingY = 900, Alpha = PV_Linear(255, 0), R = 100, G = 100, B = 100, Size = PV_Linear(PV_Random(4, 10), PV_Random(20, 30)), Phase = PV_Random(0, 15) }; CreateParticle("Smoke", PV_Random(-5,5), PV_Random(-5,5), PV_Random(-15, 15), PV_Random(-15, 15), 30, smoke, 15); sharpflame = { Size = 10, R = 50, G = 255, B = 50, Alpha = 20, Rotation = PV_Random(0, 360), Phase = PV_Random(0, 5), OnCollision = 0, BlitMode = GFX_BLIT_Additive, }; lightning = { Prototype = Particles_ElectroSpark2(), Size = PV_Linear(PV_Random(2,5),0), BlitMode = GFX_BLIT_Additive, Rotation = PV_Random(0,360), R = 50, G = 255, B = 50, }; }
global func FireBreathEffect(proplist fx, int angle, int distance, int x, int y, int timer) { // calculate velocity and coordinates for the effects var fuzzy = distance / 9; var velocity = distance * 3; var vx = +Sin(angle, velocity); var vy = -Cos(angle, velocity); var vxs = +Sin(angle, 8 * velocity / 10); var vys = -Cos(angle, 8 * velocity / 10); var vx0 = +Sin(angle, velocity / 3); var vy0 = -Cos(angle, velocity / 3); // replace with faster flame if (velocity > fx.spray_old.v1 && fx.spray_cur.reach >= fx.spray_old.reach) { // transfer new values to old values fx.spray_old.reach = fx.spray_cur.reach; fx.spray_old.time = fx.spray_cur.time; fx.spray_old.v0 = fx.spray_cur.v0; fx.spray_old.v1 = fx.spray_cur.v1; fx.spray_old.rmax = fx.spray_cur.rmax; // start a new beam at the beginning fx.spray_cur.reach = 0; fx.spray_cur.time = 0; fx.spray_cur.v0 = velocity / 3; fx.spray_cur.v1 = velocity; fx.spray_cur.rmax = distance * CYCLOPS_FireBreath_Precision; } // calculate position of the flame FireBreathReach(fx.spray_old); FireBreathReach(fx.spray_cur); // particle definitions var smoke = Particles_Smoke(); smoke.ForceX = 0; smoke.ForceY = PV_Gravity(-10); smoke.R = smoke.G = smoke.B = PV_Linear(255, 100); smoke.Size = PV_Linear(5, PV_Random(20, 30)); for (var i = 0; i < RandomX(3, 5); i++) { var scale = 15; var factor = (scale - i); var x0 = x + i * vx0 / 20; var y0 = y + i * vy0 / 20; var vx1 = vx * factor / scale + RandomX(-fuzzy, +fuzzy); var vy1 = vy * factor / scale + RandomX(-fuzzy, +fuzzy); CreateParticle("Fire", x0, y0, PV_Linear(vx0, vx1), PV_Linear(vy0, vy1), PV_Random(30, 40), smoke, 1); } for (var i = 0; i < RandomX(3, 5); i++) { var scale = 15; var factor = (scale - i); var x0 = x + i * vx0 / 20; var y0 = y + i * vy0 / 20; var vxm = vx0 + RandomX(-fuzzy, + fuzzy); var vym = vy0 + RandomX(-fuzzy, + fuzzy); var vx1 = vxs * factor / scale + RandomX(-fuzzy, +fuzzy); var vy1 = vys * factor / scale + RandomX(-fuzzy, +fuzzy); CreateParticle("Fire", x0, y0, PV_Linear(vxm, vx1), PV_Linear(vym, vy1), PV_Random(50, 60), smoke, 1); } }
func FxDischargeStop(object target, proplist effect, int reason, bool temporary) { if(temporary) return; Sound("Ball::ball_discharge", false, 70); var flashparticle = { Alpha = 100, Size = DischargeSize * 2, R = pR, G = pG, B = pB, Rotation = PV_Random(0,360), BlitMode = GFX_BLIT_Additive, }; CreateParticle("StarSpark", 0, 0, 0, 0, 10, flashparticle, 5); for(var o in FindObjects(Find_Distance(DischargeSize), Find_Func("CanBeHit", this))) { var angle = Angle(GetX(), GetY(), o->GetX(), o->GetY()); o->AddBallHitEffect(); o->Fling(Sin(angle, 8), -Cos(angle, 8)); WeaponDamage(o, DischargeDamage); } for(var r = 5; r < DischargeSize; r += 5) { for(var i = 0; i < 360; i+= 1) { var props = { Size = PV_Linear(4, 0), Rotation = PV_Random(0, 360), R = pR, G = pG, B = pB, Alpha = PV_Linear(255,0), BlitMode = GFX_BLIT_Additive, }; var x = Sin(i, r + RandomX(-2, 2)); var y = -Cos(i, r + RandomX(-2, 2)); CreateParticle("StarSpark", x, y, 0, 0, 25, props, 2); } } var props = { Size = PV_Linear(20, 200), R = pR, G = pG, B = pB, Alpha = PV_Linear(180, 0), BlitMode = GFX_BLIT_Additive, }; CreateParticle("Shockwave2", 0, 0, 0, 0, 10, props, 1); Sound("Ball::ball_after_discharge", false, 30); Idle(); }
func FxHomeCallTimer(object target, proplist fx, int time) { if(!master) { KillBall(); return -1; } if(GetEffect("Blocked", this)) { ox=GetX(); oy=GetY(); return; } DrawParticleLine("Flash", 0, 0, ox-GetX(), oy-GetY(), 1, 0, 0, 15, hometrailparticles); if(time%7 == 0) { for(var i = 0; i < 360; i+=5) { CreateParticle("Flash", Sin(i, 3), -Cos(i, 5), 0, 0, 10, hometrailparticles2, 2); } } fx.x = master->GetX(); fx.y = master->GetY(); var angle = Angle(GetX(), GetY(), fx.x, fx.y, 10); var txdir = Sin(angle, Speed + 12, 10); var tydir = -Cos(angle, Speed + 12, 10); SetXDir((GetXDir() + (txdir - GetXDir())/2)); SetYDir((GetYDir() + (tydir - GetYDir())/2)); CheckForEnemies(HomeCallSize); ox=GetX(); oy=GetY(); var dst = Distance(GetX(), GetY(), fx.x, fx.y); if(dst < 8) { AddShield(master); Sound("Ball::ball_shield", false, 20); var particles = { Prototype = Particles_Glimmer(), R = pR, G = pG, B = pB, Alpha = 255, Size = PV_Linear(10, 0), OnCollision = PC_Bounce(), }; CreateParticle("StarSpark", 0, 0, PV_Random(-60,60), PV_Random(-60, 60), 25, particles, 5); var particle = { Alpha = PV_Linear(255, 0), Size = 50, R = pR, G = pG, B = pB, BlitMode = GFX_BLIT_Additive, }; master->CreateParticle("StarSpark", 0, 0, 0, 0, 7, particle, 4); FollowMaster(); return -1; } }
func Initialize() { SetAction("Travel"); SetRDir(10); SetObjectLayer(nil); //AddEffect("MoveTo", this, 1, 1, this); ox=GetX(); oy=GetY(); rangedummy = CreateObject(Dummy, 0, 0, GetOwner()); rangedummy.Visibility = VIS_Owner; rangedummy->SetAction("HangOnto", this); var props = { R = 255, G = 0, B = 0, Alpha = 40, Size = 70, BlitMode = GFX_BLIT_Additive, Rotation = PV_Step(10, 0, 1), Attach = ATTACH_Back | ATTACH_MoveRelative }; rangedummy->CreateParticle("Shockwave2", 0, 0, 0, 0, 0, props, 1); moveparticle = { Alpha = 100, Size = AttackSize * 2, R = pR, G = pG, B = pB, Rotation = PV_Random(0,360), BlitMode = GFX_BLIT_Additive, }; moveparticle2 = { Size = PV_Linear(2,0), BlitMode = GFX_BLIT_Additive, R = pR, G = pG, B = pB, Attach=ATTACH_Back, }; movetrailparticles = { Size = PV_Linear(5,0), BlitMode = GFX_BLIT_Additive, R = pR, G = pG, B = pB, Attach=ATTACH_Back, }; followtrailparticles = { Size = PV_Linear(5,0), BlitMode = GFX_BLIT_Additive, R = 50, G = 50, B = 50, Attach=ATTACH_Back, }; hometrailparticles = { Size = PV_Linear(5,0), BlitMode = GFX_BLIT_Additive, R = 0, G = 255, B = 255, Attach=ATTACH_Back, }; hometrailparticles2 = { Size = PV_Linear(2,0), BlitMode = GFX_BLIT_Additive, R = 0, G = 255, B = 255, Attach=ATTACH_Back, }; }