public func ControlUse(object clonk, int x, int y) { x = LandscapeWidth() / 2 + 100; y = baseHeight - 20; DrawParticleLine("Flash", 0,0,-GetX()+x,-GetY()+y, 3, 0, 0, 8, {Prototype = Particles_Flash(), Size = 20, R = 50, G = 50, B = 255}); // Make sure the clonk loses the attach procedure. var action = clonk->GetAction(); if (action && clonk.ActMap[action].Procedure == DFA_ATTACH) clonk->SetAction("Jump"); clonk->SetPosition(x, y); clonk->SetXDir(0); clonk->SetYDir(-5); RemoveObject(); return 1; }
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); }