Beispiel #1
0
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;
}
Beispiel #2
0
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;
	}
	
}